NextGEN Gallery – WordPress Gallery Plugin - Version 3.1.11

Version Description

  • 03.020.2019 =
  • NEW: Many performance enhancements
  • Fixed: Broken Overview page on WordPress 5.1
  • Fixed: Problem with notices not being dismissible
  • Fixed: Recover images from backup generating errors
  • Fixed: Manage Tags the only menu option after activating
  • Fixed: Compatibility with environments which don't have mime_content_type function
Download this release

Release Info

Developer photocrati
Plugin Icon 128x128 NextGEN Gallery – WordPress Gallery Plugin
Version 3.1.11
Comparing to
See all releases

Code changes from version 3.1.7 to 3.1.11

Files changed (52) hide show
  1. changelog.txt +8 -0
  2. composer.json +1 -1
  3. nggallery.php +53 -45
  4. non_pope/class.photocrati_installer.php +4 -5
  5. pope/lib/class.component_registry.php +1 -1
  6. products/photocrati_nextgen/modules/ajax/module.ajax.php +1 -1
  7. products/photocrati_nextgen/modules/ajax/package.module.ajax.php +5 -12
  8. products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php +5 -9
  9. products/photocrati_nextgen/modules/attach_to_post/package.module.attach_to_post.php +6 -8
  10. products/photocrati_nextgen/modules/attach_to_post/static/display_tab.js +5 -18
  11. products/photocrati_nextgen/modules/attach_to_post/static/display_tab.min.js +1 -1
  12. products/photocrati_nextgen/modules/dynamic_thumbnails/module.dynamic_thumbnails.php +2 -9
  13. products/photocrati_nextgen/modules/dynamic_thumbnails/package.module.dynamic_thumbnails.php +1 -455
  14. products/photocrati_nextgen/modules/fs/module.fs.php +1 -1
  15. products/photocrati_nextgen/modules/fs/package.module.fs.php +22 -71
  16. products/photocrati_nextgen/modules/i18n/lang/nggallery-da_DK.po +2 -2
  17. products/photocrati_nextgen/modules/i18n/lang/nggallery-sv_SE.po +4 -4
  18. products/photocrati_nextgen/modules/i18n/lang/nggallery.po +2 -2
  19. products/photocrati_nextgen/modules/i18n/module.i18n.php +4 -5
  20. products/photocrati_nextgen/modules/imagify/lib/class-imagify-partner.php +1 -1
  21. products/photocrati_nextgen/modules/imagify/module.imagify.php +1 -1
  22. products/photocrati_nextgen/modules/mvc/module.mvc.php +1 -3
  23. products/photocrati_nextgen/modules/mvc/package.module.mvc.php +5 -131
  24. products/photocrati_nextgen/modules/nextgen_addgallery_page/module.nextgen_addgallery_page.php +1 -1
  25. products/photocrati_nextgen/modules/nextgen_addgallery_page/package.module.nextgen_addgallery_page.php +25 -29
  26. products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.js +1 -4
  27. products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.min.js +1 -1
  28. products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php +11 -6
  29. products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_media_library.php +0 -1
  30. products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php +1 -3
  31. products/photocrati_nextgen/modules/nextgen_admin/module.nextgen_admin.php +486 -469
  32. products/photocrati_nextgen/modules/nextgen_admin/package.module.nextgen_admin.php +61 -8
  33. products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.css +3 -3
  34. products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.js +1 -1
  35. products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.min.css +1 -1
  36. products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.min.js +1 -1
  37. products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_wizards.js +23 -7
  38. products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_wizards.min.js +1 -1
  39. products/photocrati_nextgen/modules/nextgen_admin/templates/nextgen_admin_page.php +3 -0
  40. products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php +1 -1
  41. products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php +1 -1
  42. products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/thumbnails/default-view.php +2 -3
  43. products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/thumbnails/index.php +1 -2
  44. products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/module.nextgen_basic_imagebrowser.php +1 -1
  45. products/photocrati_nextgen/modules/nextgen_basic_singlepic/module.nextgen_basic_singlepic.php +1 -1
  46. products/photocrati_nextgen/modules/nextgen_basic_tagcloud/module.nextgen_basic_tagcloud.php +1 -1
  47. products/photocrati_nextgen/modules/nextgen_block/module.nextgen_block.php +1 -1
  48. products/photocrati_nextgen/modules/nextgen_block/static/build/block.min.js +1 -1
  49. products/photocrati_nextgen/modules/nextgen_block/static/build/block.min.js.map +1 -1
  50. products/photocrati_nextgen/modules/nextgen_block/static/src/block.min.js +1 -2
  51. products/photocrati_nextgen/modules/nextgen_data/module.nextgen_data.php +15 -8
  52. products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php +3633 -3609
changelog.txt CHANGED
@@ -1,6 +1,14 @@
1
  NextGEN Gallery
2
  by Imagely
3
 
 
 
 
 
 
 
 
 
4
  = V3.1.7 - 02.26.2019 =
5
  * Changed: Upgraded Freemius SDK to latest release
6
 
1
  NextGEN Gallery
2
  by Imagely
3
 
4
+ = V3.1.11 - 03.020.2019 =
5
+ * NEW: Many performance enhancements
6
+ * Fixed: Broken Overview page on WordPress 5.1
7
+ * Fixed: Problem with notices not being dismissible
8
+ * Fixed: Recover images from backup generating errors
9
+ * Fixed: Manage Tags the only menu option after activating
10
+ * Fixed: Compatibility with environments which don't have mime_content_type function
11
+
12
  = V3.1.7 - 02.26.2019 =
13
  * Changed: Upgraded Freemius SDK to latest release
14
 
composer.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "imagely/nextgen-gallery",
3
- "description": "The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 24 million downloads.",
4
  "keywords": ["nextgen", "nextgen gallery", "gallery", "galleries", "image", "images", "image gallery", "photo", "photos", "photo gallery", "picture", "pictures", "picture gallery", "album", "albums", "photo albums", "image album", "media", "media gallery", "thumbnails", "thumbnail gallery", "thumbnail galleries", "slideshow", "slideshows", "slideshow gallery", "slideshow galleries", "fancybox", "lightbox", "responsive", "responsive gallery", "responsive galleries", "singlepic", "watermarks", "watermarking", "photography", "photographer"],
5
  "homepage": "https://www.imagely.com/",
6
  "license": "GPLv2",
1
  {
2
  "name": "imagely/nextgen-gallery",
3
+ "description": "The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 25 million downloads.",
4
  "keywords": ["nextgen", "nextgen gallery", "gallery", "galleries", "image", "images", "image gallery", "photo", "photos", "photo gallery", "picture", "pictures", "picture gallery", "album", "albums", "photo albums", "image album", "media", "media gallery", "thumbnails", "thumbnail gallery", "thumbnail galleries", "slideshow", "slideshows", "slideshow gallery", "slideshow galleries", "fancybox", "lightbox", "responsive", "responsive gallery", "responsive galleries", "singlepic", "watermarks", "watermarking", "photography", "photographer"],
5
  "homepage": "https://www.imagely.com/",
6
  "license": "GPLv2",
nggallery.php CHANGED
@@ -3,8 +3,8 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
3
 
4
  /**
5
  * Plugin Name: NextGEN Gallery
6
- * Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 24 million downloads.
7
- * Version: 3.1.7
8
  * Author: Imagely
9
  * Plugin URI: https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/
10
  * Author URI: https://www.imagely.com
@@ -391,8 +391,9 @@ class C_NextGEN_Bootstrap
391
  */
392
  function _register_hooks()
393
  {
394
- // Register the deactivation routines
395
- add_action('deactivate_'.NGG_PLUGIN_BASENAME, array(get_class(), 'deactivate'));
 
396
 
397
  // Register our test suite
398
  add_filter('simpletest_suites', array(&$this, 'add_testsuite'));
@@ -654,13 +655,43 @@ class C_NextGEN_Bootstrap
654
  /**
655
  * Run the uninstaller
656
  */
657
- static function deactivate()
658
  {
659
  include_once('products/photocrati_nextgen/class.nextgen_product_installer.php');
660
  C_Photocrati_Installer::add_handler(NGG_PLUGIN_BASENAME, 'C_NextGen_Product_Installer');
661
  C_Photocrati_Installer::uninstall(NGG_PLUGIN_BASENAME);
662
  }
663
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
664
  /**
665
  * Defines necessary plugins for the plugin to load correctly
666
  */
@@ -668,7 +699,7 @@ class C_NextGEN_Bootstrap
668
  {
669
  define('NGG_PLUGIN', basename($this->directory_path()));
670
  define('NGG_PLUGIN_BASENAME', plugin_basename(__FILE__));
671
- define('NGG_PLUGIN_DIR', $this->directory_path());
672
  define('NGG_PLUGIN_URL', $this->path_uri());
673
  define('NGG_TESTS_DIR', implode(DIRECTORY_SEPARATOR, array(rtrim(NGG_PLUGIN_DIR, "/\\"), 'tests')));
674
  define('NGG_PRODUCT_DIR', implode(DIRECTORY_SEPARATOR, array(rtrim(NGG_PLUGIN_DIR, "/\\"), 'products')));
@@ -676,12 +707,14 @@ class C_NextGEN_Bootstrap
676
  define('NGG_PRODUCT_URL', path_join(str_replace("\\" , '/', NGG_PLUGIN_URL), 'products'));
677
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
678
  define('NGG_PLUGIN_STARTED_AT', microtime());
679
- define('NGG_PLUGIN_VERSION', '3.1.7');
680
 
681
- if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG)
682
- define('NGG_SCRIPT_VERSION', (string)mt_rand(0, mt_getrandmax()));
683
- else
684
- define('NGG_SCRIPT_VERSION', NGG_PLUGIN_VERSION);
 
 
685
 
686
  if (!defined('NGG_HIDE_STRICT_ERRORS')) {
687
  define('NGG_HIDE_STRICT_ERRORS', TRUE);
@@ -739,6 +772,11 @@ class C_NextGEN_Bootstrap
739
  if (!defined('NGG_POPE_CACHE')) {
740
  define('NGG_POPE_CACHE', FALSE);
741
  }
 
 
 
 
 
742
  }
743
 
744
  /**
@@ -802,36 +840,6 @@ class C_NextGEN_Bootstrap
802
  */
803
  function get_plugin_location()
804
  {
805
- $path = dirname(__FILE__);
806
- $gallery_dir = strtolower($path);
807
- $gallery_dir = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $gallery_dir);
808
-
809
- $theme_dir = strtolower(get_stylesheet_directory());
810
- $theme_dir = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $theme_dir);
811
-
812
- $plugin_dir = strtolower(WP_PLUGIN_DIR);
813
- $plugin_dir = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $plugin_dir);
814
-
815
- $common_dir_theme = substr($gallery_dir, 0, strlen($theme_dir));
816
- $common_dir_plugin = substr($gallery_dir, 0, strlen($plugin_dir));
817
-
818
- if ($common_dir_theme == $theme_dir)
819
- {
820
- return 'theme';
821
- }
822
-
823
- if ($common_dir_plugin == $plugin_dir)
824
- {
825
- return 'plugin';
826
- }
827
-
828
- $parent_dir = dirname($path);
829
-
830
- if (file_exists($parent_dir . DIRECTORY_SEPARATOR . 'style.css'))
831
- {
832
- return 'theme';
833
- }
834
-
835
  return 'plugin';
836
  }
837
 
@@ -989,10 +997,10 @@ function ngg_fs( $activate_for_all = false ) {
989
  $run_freemius = true;
990
  } else {
991
  // Run Freemius code on 20% of the new installations.
992
- // $random = rand( 1, 10 );
993
- // $run_freemius = ( 1 <= $random && $random <= 2 );
994
- // Update 2016-08: run on all new instances
995
- $run_freemius = TRUE;
996
  }
997
 
998
  update_option( 'ngg_run_freemius', $run_freemius );
3
 
4
  /**
5
  * Plugin Name: NextGEN Gallery
6
+ * Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 25 million downloads.
7
+ * Version: 3.1.11
8
  * Author: Imagely
9
  * Plugin URI: https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/
10
  * Author URI: https://www.imagely.com
391
  */
392
  function _register_hooks()
393
  {
394
+ // Register the (de)activation routines
395
+ add_action('deactivate_' . NGG_PLUGIN_BASENAME, array(get_class(), 'deactivate'));
396
+ add_action('activate_' . NGG_PLUGIN_BASENAME, array(get_class(), 'activate'), -10);
397
 
398
  // Register our test suite
399
  add_filter('simpletest_suites', array(&$this, 'add_testsuite'));
655
  /**
656
  * Run the uninstaller
657
  */
658
+ public static function deactivate()
659
  {
660
  include_once('products/photocrati_nextgen/class.nextgen_product_installer.php');
661
  C_Photocrati_Installer::add_handler(NGG_PLUGIN_BASENAME, 'C_NextGen_Product_Installer');
662
  C_Photocrati_Installer::uninstall(NGG_PLUGIN_BASENAME);
663
  }
664
 
665
+ public static function activate()
666
+ {
667
+ // Set the capabilities for the administrator
668
+ $role = get_role('administrator');
669
+
670
+ // We need this role, no other chance
671
+ if (empty($role))
672
+ {
673
+ update_option("ngg_init_check", __('Sorry, NextGEN Gallery works only with a role called administrator',"nggallery"));
674
+ return;
675
+ }
676
+
677
+ $capabilities = array(
678
+ 'NextGEN Attach Interface',
679
+ 'NextGEN Change options',
680
+ 'NextGEN Change style',
681
+ 'NextGEN Edit album',
682
+ 'NextGEN Gallery overview',
683
+ 'NextGEN Manage gallery',
684
+ 'NextGEN Manage others gallery',
685
+ 'NextGEN Manage tags',
686
+ 'NextGEN Upload images',
687
+ 'NextGEN Use TinyMCE'
688
+ );
689
+
690
+ foreach ($capabilities as $capability) {
691
+ $role->add_cap($capability);
692
+ }
693
+ }
694
+
695
  /**
696
  * Defines necessary plugins for the plugin to load correctly
697
  */
699
  {
700
  define('NGG_PLUGIN', basename($this->directory_path()));
701
  define('NGG_PLUGIN_BASENAME', plugin_basename(__FILE__));
702
+ define('NGG_PLUGIN_DIR', plugin_dir_path(__FILE__));
703
  define('NGG_PLUGIN_URL', $this->path_uri());
704
  define('NGG_TESTS_DIR', implode(DIRECTORY_SEPARATOR, array(rtrim(NGG_PLUGIN_DIR, "/\\"), 'tests')));
705
  define('NGG_PRODUCT_DIR', implode(DIRECTORY_SEPARATOR, array(rtrim(NGG_PLUGIN_DIR, "/\\"), 'products')));
707
  define('NGG_PRODUCT_URL', path_join(str_replace("\\" , '/', NGG_PLUGIN_URL), 'products'));
708
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
709
  define('NGG_PLUGIN_STARTED_AT', microtime());
710
+ define('NGG_PLUGIN_VERSION', '3.1.11');
711
 
712
+ define(
713
+ 'NGG_SCRIPT_VERSION',
714
+ defined('SCRIPT_DEBUG') && SCRIPT_DEBUG
715
+ ? (string)mt_rand(0, mt_getrandmax())
716
+ : NGG_PLUGIN_VERSION
717
+ );
718
 
719
  if (!defined('NGG_HIDE_STRICT_ERRORS')) {
720
  define('NGG_HIDE_STRICT_ERRORS', TRUE);
772
  if (!defined('NGG_POPE_CACHE')) {
773
  define('NGG_POPE_CACHE', FALSE);
774
  }
775
+
776
+ // Where are galleries restricted to?
777
+ if (!defined('NGG_GALLERY_ROOT_TYPE')) {
778
+ define('NGG_GALLERY_ROOT_TYPE', 'site'); // "content" is the other possible value
779
+ }
780
  }
781
 
782
  /**
840
  */
841
  function get_plugin_location()
842
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
843
  return 'plugin';
844
  }
845
 
997
  $run_freemius = true;
998
  } else {
999
  // Run Freemius code on 20% of the new installations.
1000
+ // $random = rand( 1, 10 );
1001
+ // $run_freemius = ( 1 <= $random && $random <= 2 );
1002
+ // Update 2016-08: run on all new instances
1003
+ $run_freemius = true;
1004
  }
1005
 
1006
  update_option( 'ngg_run_freemius', $run_freemius );
non_pope/class.photocrati_installer.php CHANGED
@@ -126,9 +126,9 @@ if (!class_exists('C_Photocrati_Installer'))
126
  $global_settings = C_NextGen_Global_Settings::get_instance();
127
 
128
  // Somehow some installations are missing several default settings
129
- // Because gallerystorage_driver is essential to know we do a 'soft' reset here
130
  // by filling in any missing options from the default settings
131
- if (is_null($local_settings->gallerystorage_driver)) {
132
  $settings_installer = new C_NextGen_Settings_Installer();
133
 
134
  $local_settings->reset();
@@ -188,10 +188,9 @@ if (!class_exists('C_Photocrati_Installer'))
188
  apc_clear_cache();
189
  }
190
 
191
- // We flush ALL transients
192
  wp_cache_flush();
193
- global $wpdb;
194
- $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient%'");
195
 
196
  // Remove all NGG created cron jobs
197
  self::refresh_cron();
126
  $global_settings = C_NextGen_Global_Settings::get_instance();
127
 
128
  // Somehow some installations are missing several default settings
129
+ // Because imgWidth is essential to know we do a 'soft' reset here
130
  // by filling in any missing options from the default settings
131
+ if (!$local_settings->imgWidth) {
132
  $settings_installer = new C_NextGen_Settings_Installer();
133
 
134
  $local_settings->reset();
188
  apc_clear_cache();
189
  }
190
 
191
+ // Clear all of our transients
192
  wp_cache_flush();
193
+ C_Photocrati_Transient_Manager::flush();
 
194
 
195
  // Remove all NGG created cron jobs
196
  self::refresh_cron();
pope/lib/class.component_registry.php CHANGED
@@ -81,7 +81,7 @@ class C_Component_Registry
81
  */
82
  function add_module_path($path, $recurse = false, $load_all = false)
83
  {
84
- if (!$recurse || (!$this->has_searched_path_before($path))) {
85
 
86
  // If no default module path has been set, then set one now
87
  if ($this->get_default_module_path() == null) {
81
  */
82
  function add_module_path($path, $recurse = false, $load_all = false)
83
  {
84
+ if (!preg_match("/(lib|libs|include|includes|static|templates)$/", $path) && (!$recurse || (!$this->has_searched_path_before($path)))) {
85
 
86
  // If no default module path has been set, then set one now
87
  if ($this->get_default_module_path() == null) {
products/photocrati_nextgen/modules/ajax/module.ajax.php CHANGED
@@ -17,7 +17,7 @@ class M_Ajax extends C_Base_Module
17
  'photocrati-ajax',
18
  'AJAX',
19
  'Provides AJAX functionality',
20
- '3.0.0',
21
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
22
  'Imagely',
23
  'https://www.imagely.com'
17
  'photocrati-ajax',
18
  'AJAX',
19
  'Provides AJAX functionality',
20
+ '3.1.8',
21
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
22
  'Imagely',
23
  'https://www.imagely.com'
products/photocrati_nextgen/modules/ajax/package.module.ajax.php CHANGED
@@ -59,19 +59,12 @@ class C_Ajax_Controller extends C_MVC_Controller
59
  }
60
  return self::$_instances[$context];
61
  }
62
- function validate_ajax_request($action = NULL, $check_token = false)
63
  {
64
- // TODO: remove this. Pro 2.1's proofing calls validate_ajax_request() with a null $action
65
- if (!$action) {
66
- return TRUE;
67
  }
68
- $valid_request = false;
69
- $security = $this->get_registry()->get_utility('I_Security_Manager');
70
- $sec_actor = $security->get_current_actor();
71
- $sec_token = $security->get_request_token($action);
72
- if ($sec_actor->is_allowed($action) && (!$check_token || $sec_token->check_current_request())) {
73
- $valid_request = true;
74
- }
75
- return $valid_request;
76
  }
77
  }
59
  }
60
  return self::$_instances[$context];
61
  }
62
+ function validate_ajax_request($action = NULL, $token = false)
63
  {
64
+ if ($token === TRUE) {
65
+ $token = isset($_REQUEST['nonce']) ? $_REQUEST['nonce'] : FALSE;
 
66
  }
67
+ // TODO: Remove !$action condition. Necessary for Proofing at the moment
68
+ return (!$action || M_Security::is_allowed($action)) && (!$token || M_Security::verify_nonce($token, $action));
 
 
 
 
 
 
69
  }
70
  }
products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  define('NGG_ATTACH_TO_POST_SLUG', 'nextgen-attach_to_post');
4
- define('NGG_ATTACH_TO_POST_VERSION', '3.1.4.2');
5
 
6
  class M_Attach_To_Post extends C_Base_Module
7
  {
@@ -249,11 +249,9 @@ class M_Attach_To_Post extends C_Base_Module
249
 
250
  function add_media_button()
251
  {
252
- $security = $this->get_registry()->get_utility('I_Security_Manager');
253
- $sec_actor = $security->get_current_actor();
254
  if (in_array(FALSE, array(
255
- $sec_actor->is_allowed('NextGEN Attach Interface'),
256
- $sec_actor->is_allowed('NextGEN Use TinyMCE'))))
257
  return;
258
 
259
  $router = C_Router::get_instance();
@@ -403,11 +401,9 @@ class M_Attach_To_Post extends C_Base_Module
403
 
404
  function can_use_tinymce()
405
  {
406
- $security = $this->get_registry()->get_utility('I_Security_Manager');
407
- $sec_actor = $security->get_current_actor();
408
  $checks = array(
409
- $sec_actor->is_allowed('NextGEN Attach Interface'),
410
- $sec_actor->is_allowed('NextGEN Use TinyMCE'),
411
  get_user_option('rich_editing') == 'true'
412
  );
413
  return !in_array(FALSE, $checks);
1
  <?php
2
 
3
  define('NGG_ATTACH_TO_POST_SLUG', 'nextgen-attach_to_post');
4
+ define('NGG_ATTACH_TO_POST_VERSION', '3.1.8');
5
 
6
  class M_Attach_To_Post extends C_Base_Module
7
  {
249
 
250
  function add_media_button()
251
  {
 
 
252
  if (in_array(FALSE, array(
253
+ M_Security::is_allowed('NextGEN Attach Interface'),
254
+ M_Security::is_allowed('NextGEN Use TinyMCE'))))
255
  return;
256
 
257
  $router = C_Router::get_instance();
401
 
402
  function can_use_tinymce()
403
  {
 
 
404
  $checks = array(
405
+ M_Security::is_allowed('NextGEN Attach Interface'),
406
+ M_Security::is_allowed('NextGEN Use TinyMCE'),
407
  get_user_option('rich_editing') == 'true'
408
  );
409
  return !in_array(FALSE, $checks);
products/photocrati_nextgen/modules/attach_to_post/package.module.attach_to_post.php CHANGED
@@ -445,7 +445,6 @@ class Mixin_Attach_To_Post extends Mixin
445
  $image_mapper = $this->get_registry()->get_utility('I_Image_Mapper', $context);
446
  $display_type_mapper = $this->get_registry()->get_utility('I_Display_Type_Mapper', $context);
447
  $sources = C_Displayed_Gallery_Source_Manager::get_instance();
448
- $security = $this->get_registry()->get_utility('I_Security_Manager');
449
  $settings = C_NextGen_Settings::get_instance();
450
  // Get the nextgen tags
451
  global $wpdb;
@@ -464,12 +463,13 @@ class Mixin_Attach_To_Post extends Mixin
464
  if (!apply_filters('ngg_atp_show_display_type', $available, $display_type)) {
465
  continue;
466
  }
 
467
  $display_types[] = $display_type;
468
  }
469
  usort($display_types, array($this->object, '_display_type_list_sort'));
470
  wp_enqueue_script('ngg_display_tab', $this->get_static_url('photocrati-attach_to_post#display_tab.js'), array('jquery', 'backbone', 'photocrati_ajax'), NGG_SCRIPT_VERSION);
471
  $this->object->mark_script('ngg_display_tab');
472
- wp_localize_script('ngg_display_tab', 'igw_data', array('displayed_gallery_preview_url' => $settings->gallery_preview_url, 'displayed_gallery' => $this->object->_displayed_gallery->get_entity(), 'sources' => $sources->get_all(), 'gallery_primary_key' => $gallery_mapper->get_primary_key_column(), 'galleries' => $gallery_mapper->find_all(), 'albums' => $album_mapper->find_all(), 'tags' => $tags, 'display_types' => $display_types, 'sec_token' => $security->get_request_token('nextgen_edit_displayed_gallery')->get_json(), 'image_primary_key' => $image_mapper->get_primary_key_column(), 'display_type_priority_base' => NGG_DISPLAY_PRIORITY_BASE, 'display_type_priority_step' => NGG_DISPLAY_PRIORITY_STEP, 'shortcode_ref' => isset($_REQUEST['ref']) ? floatval($_REQUEST['ref']) : null, 'shortcode_defaults' => array('order_by' => $settings->galSort, 'order_direction' => $settings->galSortDir, 'returns' => 'included', 'maximum_entity_count' => $settings->maximum_entity_count), 'shortcode_attr_replacements' => array('source' => 'src', 'container_ids' => 'ids', 'display_type' => 'display'), 'i18n' => array('sources' => __('Are you inserting a Gallery (default), an Album, or images based on Tags?', 'nggallery'), 'optional' => __('(optional)', 'nggallery'), 'slug_tooltip' => __('Sets an SEO-friendly name to this gallery for URLs. Currently only in use by the Pro Lightbox', 'nggallery'), 'slug_label' => __('Slug', 'nggallery'), 'no_entities' => __('No entities to display for this source', 'nggallery'), 'exclude_question' => __('Exclude?', 'nggallery'), 'select_gallery' => __('Select a Gallery', 'nggallery'), 'galleries' => __('Select one or more galleries (click in box to see available galleries).', 'nggallery'), 'albums' => __('Select one album (click in box to see available albums).', 'nggallery'))));
473
  }
474
  function start_resource_monitoring()
475
  {
@@ -603,18 +603,16 @@ class Mixin_Attach_To_Post extends Mixin
603
  function _get_main_tabs()
604
  {
605
  $retval = array();
606
- $security = $this->get_registry()->get_utility('I_Security_Manager');
607
- $sec_actor = $security->get_current_actor();
608
- if ($sec_actor->is_allowed('NextGEN Manage gallery')) {
609
  $retval['displayed_tab'] = array('content' => $this->object->_render_display_tab(), 'title' => __('Insert Into Page', 'nggallery'));
610
  }
611
- if ($sec_actor->is_allowed('NextGEN Upload images')) {
612
  $retval['create_tab'] = array('content' => $this->object->_render_create_tab(), 'title' => __('Upload Images', 'nggallery'));
613
  }
614
- if ($sec_actor->is_allowed('NextGEN Manage others gallery') && $sec_actor->is_allowed('NextGEN Manage gallery')) {
615
  $retval['galleries_tab'] = array('content' => $this->object->_render_galleries_tab(), 'title' => __('Manage Galleries', 'nggallery'));
616
  }
617
- if ($sec_actor->is_allowed('NextGEN Edit album')) {
618
  $retval['albums_tab'] = array('content' => $this->object->_render_albums_tab(), 'title' => __('Manage Albums', 'nggallery'));
619
  }
620
  // if ($sec_actor->is_allowed('NextGEN Manage tags')) {
445
  $image_mapper = $this->get_registry()->get_utility('I_Image_Mapper', $context);
446
  $display_type_mapper = $this->get_registry()->get_utility('I_Display_Type_Mapper', $context);
447
  $sources = C_Displayed_Gallery_Source_Manager::get_instance();
 
448
  $settings = C_NextGen_Settings::get_instance();
449
  // Get the nextgen tags
450
  global $wpdb;
463
  if (!apply_filters('ngg_atp_show_display_type', $available, $display_type)) {
464
  continue;
465
  }
466
+ $display_type->preview_image_url = M_Static_Assets::get_static_url($display_type->preview_image_relpath);
467
  $display_types[] = $display_type;
468
  }
469
  usort($display_types, array($this->object, '_display_type_list_sort'));
470
  wp_enqueue_script('ngg_display_tab', $this->get_static_url('photocrati-attach_to_post#display_tab.js'), array('jquery', 'backbone', 'photocrati_ajax'), NGG_SCRIPT_VERSION);
471
  $this->object->mark_script('ngg_display_tab');
472
+ wp_localize_script('ngg_display_tab', 'igw_data', array('displayed_gallery_preview_url' => $settings->gallery_preview_url, 'displayed_gallery' => $this->object->_displayed_gallery->get_entity(), 'sources' => $sources->get_all(), 'gallery_primary_key' => $gallery_mapper->get_primary_key_column(), 'galleries' => $gallery_mapper->find_all(), 'albums' => $album_mapper->find_all(), 'tags' => $tags, 'display_types' => $display_types, 'nonce' => M_Security::create_nonce('nextgen_edit_displayed_gallery'), 'image_primary_key' => $image_mapper->get_primary_key_column(), 'display_type_priority_base' => NGG_DISPLAY_PRIORITY_BASE, 'display_type_priority_step' => NGG_DISPLAY_PRIORITY_STEP, 'shortcode_ref' => isset($_REQUEST['ref']) ? floatval($_REQUEST['ref']) : null, 'shortcode_defaults' => array('order_by' => $settings->galSort, 'order_direction' => $settings->galSortDir, 'returns' => 'included', 'maximum_entity_count' => $settings->maximum_entity_count), 'shortcode_attr_replacements' => array('source' => 'src', 'container_ids' => 'ids', 'display_type' => 'display'), 'i18n' => array('sources' => __('Are you inserting a Gallery (default), an Album, or images based on Tags?', 'nggallery'), 'optional' => __('(optional)', 'nggallery'), 'slug_tooltip' => __('Sets an SEO-friendly name to this gallery for URLs. Currently only in use by the Pro Lightbox', 'nggallery'), 'slug_label' => __('Slug', 'nggallery'), 'no_entities' => __('No entities to display for this source', 'nggallery'), 'exclude_question' => __('Exclude?', 'nggallery'), 'select_gallery' => __('Select a Gallery', 'nggallery'), 'galleries' => __('Select one or more galleries (click in box to see available galleries).', 'nggallery'), 'albums' => __('Select one album (click in box to see available albums).', 'nggallery'))));
473
  }
474
  function start_resource_monitoring()
475
  {
603
  function _get_main_tabs()
604
  {
605
  $retval = array();
606
+ if (M_Security::is_allowed('NextGEN Manage gallery')) {
 
 
607
  $retval['displayed_tab'] = array('content' => $this->object->_render_display_tab(), 'title' => __('Insert Into Page', 'nggallery'));
608
  }
609
+ if (M_Security::is_allowed('NextGEN Upload images')) {
610
  $retval['create_tab'] = array('content' => $this->object->_render_create_tab(), 'title' => __('Upload Images', 'nggallery'));
611
  }
612
+ if (M_Security::is_allowed('NextGEN Manage others gallery') && M_Security::is_allowed('NextGEN Manage gallery')) {
613
  $retval['galleries_tab'] = array('content' => $this->object->_render_galleries_tab(), 'title' => __('Manage Galleries', 'nggallery'));
614
  }
615
+ if (M_Security::is_allowed('NextGEN Edit album')) {
616
  $retval['albums_tab'] = array('content' => $this->object->_render_albums_tab(), 'title' => __('Manage Albums', 'nggallery'));
617
  }
618
  // if ($sec_actor->is_allowed('NextGEN Manage tags')) {
products/photocrati_nextgen/modules/attach_to_post/static/display_tab.js CHANGED
@@ -235,11 +235,12 @@ jQuery(function($){
235
  extra_data: {},
236
 
237
  _create_request: function(limit, offset) {
238
- var request = _.extend({}, igw_data.sec_token, {
239
  action: this.action,
240
  limit: limit ? limit : this.fetch_limit,
241
- offset: offset ? offset : 0
242
- });
 
243
  for (var index in this.extra_data) {
244
  var value = this.extra_data[index];
245
  if (typeof(request[index]) === 'undefined') {
@@ -825,22 +826,8 @@ jQuery(function($){
825
  // Create all elements
826
  var image_container = $('<label style="display: block; cursor: pointer;"/>').addClass('image_container');
827
 
828
- // 2.0.66 did not support plugins_url, 2.0.66.3+ does
829
- var installed_at_version = this.model.get('installed_at_version');
830
- var baseurl = photocrati_ajax.wp_plugins_url;
831
- var preview_image_relpath = this.model.get('preview_image_relpath');
832
- if (typeof installed_at_version == 'undefined') {
833
- baseurl = photocrati_ajax.wp_site_url;
834
- baseurl = baseurl.replace(/(.*)\/index\.php$/i, "$1");
835
- // those who installed 2.0.66.3 lack the 'installed_at_version' setting but have a
836
- // plugin-relative path
837
- if (preview_image_relpath.indexOf('/nextgen-gallery') == 0) {
838
- baseurl = photocrati_ajax.wp_plugins_url;
839
- }
840
- }
841
-
842
  var img = $('<img/>').attr({
843
- src: baseurl + '/' + preview_image_relpath,
844
  title: this.model.get('title'),
845
  alt: this.model.get('alt')
846
  });
235
  extra_data: {},
236
 
237
  _create_request: function(limit, offset) {
238
+ var request = {
239
  action: this.action,
240
  limit: limit ? limit : this.fetch_limit,
241
+ offset: offset ? offset : 0,
242
+ nonce: igw_data.nonce,
243
+ };
244
  for (var index in this.extra_data) {
245
  var value = this.extra_data[index];
246
  if (typeof(request[index]) === 'undefined') {
826
  // Create all elements
827
  var image_container = $('<label style="display: block; cursor: pointer;"/>').addClass('image_container');
828
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
829
  var img = $('<img/>').attr({
830
+ src: this.model.get('preview_image_url'),
831
  title: this.model.get('title'),
832
  alt: this.model.get('alt')
833
  });
products/photocrati_nextgen/modules/attach_to_post/static/display_tab.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(e){var t={Models:{},Views:{}};t.Models.SelectableItems=Backbone.Collection.extend({selected:function(){return this.filter(function(e){return 1==e.get("selected")})},deselect_all:function(){this.each(function(e){e.set("selected",!1)})},selected_ids:function(){return _.pluck(this.selected(),"id")},select:function(e){_.isArray(e)||(e=[e]),this.each(function(t){_.indexOf(e,t.id)>=0&&t.set("selected",!0)}),this.trigger("selected")}}),t.Views.SelectTag=Backbone.View.extend({tagName:"select",collection:null,multiple:!1,value_field:"id",text_field:"title",initialize:function(e){this.options=e||{},_.each(this.options,function(e,t){this[t]=e},this),this.collection.on("add",this.render_new_option,this),this.collection.on("remove",this.remove_existing_option,this),this.collection.on("reset",this.empty_list,this)},events:{change:"selection_changed"},empty_list:function(){this.$el.empty()},render_new_option:function(e){this.$el.append(new this.Option({model:e,value_field:this.value_field,text_field:this.text_field}).render().el)},remove_existing_option:function(e){this.$el.find("option[value='"+e.id+"']").remove()},selection_changed:function(){var t=_.map(this.$el.find(":selected"),function(t){return e(t).val()});this.collection.each(function(e){_.indexOf(t,e.id)>=0||_.indexOf(t,e.id.toString())>=0?e.set("selected",!0):e.set("selected",!1)}),this.collection.trigger("selected")},render:function(){return this.$el.empty(),this.multiple&&(this.$el.prop("multiple",!0),this.$el.attr("multiple","multiple")),this.collection.each(function(e){var t=new this.Option({model:e,value_field:this.value_field,text_field:this.text_field});this.$el.append(t.render().el)},this),this.width&&this.$el.width(this.width),this},Option:Backbone.View.extend({tagName:"option",model:null,initialize:function(e){this.options=e||{},_.each(this.options,function(e,t){this[t]=e},this),this.model.on("change",this.render,this)},render:function(){var e=this;return this.$el.html(this.model.get(this.text_field).replace(/\\&/g,"&").replace(/\\'/g,"'")),this.$el.prop({value:"id"==this.value_field?this.model.id:this.model.get(this.value_field)}),1==e.model.get("selected")&&this.$el.prop("selected",!0).attr("selected","selected"),this}})}),t.Views.Chosen=Backbone.View.extend({tagName:"span",initialize:function(e){this.options=e||{},this.collection=this.options.collection,this.select_tag=new t.Views.SelectTag(this.options),this.collection.on("change",this.selection_changed,this)},selection_changed:function(e){_.isUndefined(e.changed.selected)&&this.render()},render:function(){return this.$el.append(this.select_tag.render().$el),this.options.width&&this.select_tag.$el.width(this.options.width),this.select2_opts={placeholder:this.options.placeholder},this.select_tag.$el.select2(this.select2_opts),this}}),t.DisplayTab={Models:{},Views:{},App:{}},t.Models.Remote_Collection=t.Models.SelectableItems.extend({fetch_limit:5e3,in_progress:!1,fetch_url:photocrati_ajax.url,action:"",extra_data:{},_create_request:function(e,t){var i=_.extend({},igw_data.sec_token,{action:this.action,limit:e||this.fetch_limit,offset:t||0});for(var s in this.extra_data){var l=this.extra_data[s];void 0===i[s]&&(i[s]={}),void 0!==l.toJSON&&(l=l.toJSON()),i[s]=_.extend(i[s],l)}return i},_add_item:function(e){this.push(e)},fetch:function(t,i){var s=this;this.in_progress=!0,e.post(this.fetch_url,this._create_request(t,i),function(e){"undefined"!=typeof _&&(_.isObject(e)||(e=JSON.parse(e)),e.items&&(_.each(e.items,function(e){s._add_item(e)}),e.total>=e.limit+e.offset?s.fetch(e.limit,e.offset+e.limit):(s.in_progress=!1,s.trigger("finished_fetching"))))})}}),t.DisplayTab.Models.Displayed_Gallery=Backbone.Model.extend({defaults:{source:null,container_ids:[],entity_ids:[],display_type:null,display_settings:{},exclusions:[],sortorder:[],slug:null},to_shortcode:function(){retval=null;var e=function(e,t){var i=e[t];if(void 0!==igw_data.shortcode_defaults[t]&&igw_data.shortcode_defaults[t]==i&&(i=null),_.isArray(i)&&(i=i.length>0?i.join(","):null),i)return i=i.toString().replace("[","&#91;"),i=i.toString().replace("]","&#93;"),void 0!==igw_data.shortcode_attr_replacements[t]&&(t=igw_data.shortcode_attr_replacements[t]),t+'="'+i+'"'},i=t.DisplayTab.instance.display_types.find_by_name_or_alias(this.get("display_type")),s=this.toJSON();s.display_type=i.get_shortcode_value();var l="[ngg",n=null;(n=e(s,"source"))&&(l+=" "+n),(n=e(s,"container_ids"))&&(l+=" "+n),(n=e(s,"entity_ids"))&&(l+=" "+n),(n=e(s,"exclusions"))&&(l+=" "+n),(n=e(s,"sortorder"))&&(l+=" "+n);for(var a in s){if(!(["source","container_ids","entity_ids","exclusions","sortorder","__defaults_set","id_field","post_category","ID"].indexOf(a)>-1))if("display_settings"==a)for(var r in s[a])(n=e(s[a],r))&&(l+=" "+n);else(n=e(s,a))&&(l+=" "+n)}return l+="]"}}),t.DisplayTab.Models.Source=Backbone.Model.extend({idAttribute:"name",defaults:{title:"",name:"",selected:!1}}),t.DisplayTab.Models.Source_Collection=t.Models.SelectableItems.extend({model:t.DisplayTab.Models.Source,selected_value:function(){var e=null,t=this.selected();return t.length>0&&(e=t[0].get("name")),e},find_by_name_or_alias:function(e){return this.find(function(t){return t.get("name")==e||_.isArray(t.get("aliases"))&&t.get("aliases").indexOf(e)>-1})}}),t.DisplayTab.Models.Gallery=Backbone.Model.extend({idAttribute:igw_data.gallery_primary_key,defaults:{title:"",name:""}}),t.DisplayTab.Models.Gallery_Collection=t.Models.Remote_Collection.extend({model:t.DisplayTab.Models.Gallery,action:"get_existing_galleries"}),t.DisplayTab.Models.Album=Backbone.Model.extend({defaults:{title:"",name:""}}),t.DisplayTab.Models.Album_Collection=t.Models.Remote_Collection.extend({model:t.DisplayTab.Models.Album,action:"get_existing_albums"}),t.DisplayTab.Models.Tag=Backbone.Model.extend({defaults:{title:""}}),t.DisplayTab.Models.Tag_Collection=t.Models.Remote_Collection.extend({model:t.DisplayTab.Models.Tag,action:"get_existing_image_tags"}),t.DisplayTab.Models.Display_Type=Backbone.Model.extend({idAttribute:"name",defaults:{title:""},is_compatible_with_source:function(e){var t=!0;for(index in e.get("returns")){var i=e.get("returns")[index];if(_.indexOf(this.get("entity_types"),i)<0){t=!1;break}}return t},get_shortcode_value:function(){var e=this.id,t=this.get("aliases");return _.isArray(t)&&t.length>0&&(e=t[0]),e}}),t.DisplayTab.Models.Display_Type_Collection=t.Models.SelectableItems.extend({model:t.DisplayTab.Models.Display_Type,selected_value:function(){var e=this.selected();return e.length>0?e[0].get("name"):null},find_by_name_or_alias:function(e){return this.find(function(t){return t.get("name")==e||_.isArray(t.get("aliases"))&&t.get("aliases").indexOf(e)>-1})}}),t.DisplayTab.Models.Entity=Backbone.Model.extend({entity_id:function(){return this.get(this.get("id_field"))},is_excluded:function(){return current_value=this.get("exclude"),!_.isUndefined(current_value)&&(_.isBoolean(current_value)?current_value:0!=parseInt(current_value))},is_included:function(){return!this.is_excluded()},is_gallery:function(){return retval=!1,1==this.get("is_gallery")&&(retval=!0),retval},is_album:function(){return retval=!1,1==this.get("is_album")&&(retval=!0),retval},is_image:function(){return!this.is_album()&&!this.is_gallery()},alttext:function(){return this.is_image()?this.get("alttext"):this.is_gallery()?this.get("title"):this.is_album()?this.get("name"):void 0}}),t.DisplayTab.Models.Entity_Collection=t.Models.Remote_Collection.extend({model:t.DisplayTab.Models.Entity,action:"get_displayed_gallery_entities",_add_item:function(e){e.exclude=1==parseInt(e.exclude),e.is_gallery=1==parseInt(e.is_gallery),e.is_album=1==parseInt(e.is_album),this.push(e)},entity_ids:function(){return this.map(function(e){return e.entity_id()})},included_ids:function(){return _.compact(this.map(function(e){if(e.is_included())return e.entity_id()}))},excluded_ids:function(){return _.compact(this.map(function(e){if(!e.is_included())return e.entity_id()}))}}),t.DisplayTab.Models.SortOrder=Backbone.Model.extend({}),t.DisplayTab.Models.SortOrder_Options=t.Models.SelectableItems.extend({model:t.DisplayTab.Models.SortOrder}),t.DisplayTab.Models.SortDirection=Backbone.Model.extend({}),t.DisplayTab.Models.SortDirection_Options=Backbone.Collection.extend({model:t.DisplayTab.Models.SortDirection}),t.DisplayTab.Models.Slug=Backbone.Model.extend({}),t.DisplayTab.Views.Source_Config=Backbone.View.extend({el:"#source_configuration",selected_view:null,initialize:function(){this.sources=t.DisplayTab.instance.sources,this.sources.on("selected",this.render,this),_.bindAll(this,"render"),this.render()},render:function(){var e=new t.Views.Chosen({id:"source_select",collection:this.sources,placeholder:"Select a source",width:500}),i=_.template('<tr><td id="source_column"></td><td><label><%- sources %></label></td></tr>');this.$el.html(i(igw_data.i18n)),this.$el.find("#source_column").append(e.render().el);var s=this.sources.selected();if(s.length){var l=function(e){return e=String(e),e.charAt(0).toUpperCase()+e.slice(1)}(s.pop().id)+"Source";if(void 0!==t.DisplayTab.Views[l]){var n=new t.DisplayTab.Views[l];this.$el.append(n.render().el)}}return this}}),t.DisplayTab.Views.Slug_Config=Backbone.View.extend({el:"#slug_configuration",selected_view:null,initialize:function(){this.displayed_gallery=t.DisplayTab.instance.displayed_gallery,this.slug=t.DisplayTab.instance.displayed_gallery.get("slug"),this.render()},render:function(){var t=this,i=e("<input>").prop({type:"text",name:"slug",value:this.slug,placeholder:igw_data.i18n.optional,id:"field_slug"});i.on("input",function(){e(this).val(e(this).val().replace(/\s|\?|\\|\/|&|=|\[|]|#/gm,"-")),t.displayed_gallery.set("slug",e(this).val())}),i.on("change",function(){e(this).val(e(this).val().replace(/^-*/gm,"").replace(/-*$/gm,"")),t.displayed_gallery.set("slug",e(this).val())});var s=_.template('<tr><td id="slug_label"><label for="field_slug" class="tooltip" title="<%- slug_tooltip %><"><<%- slug_label %></label></td><td id="slug_column"></td></tr>');return this.$el.append(s(igw_data.i18n)),this.$el.find("#slug_column").append(i),this}}),t.DisplayTab.Views.Display_Type_Selector=Backbone.View.extend({el:"#display_type_selector",initialize:function(){this.display_types=t.DisplayTab.instance.display_types,this.display_type_order_base=t.DisplayTab.instance.display_type_order_base,this.display_type_order_step=t.DisplayTab.instance.display_type_order_step,this.sources=t.DisplayTab.instance.sources,this.render()},selection_changed:function(t){var i=null;this.display_types.each(function(e){e.get("name")==t?(i=e,e.set("selected",!0)):e.set("selected",!1)}),e(".display_settings_form").each(function(){$this=e(this),$this.attr("rel")==t?$this.removeClass("hidden"):$this.addClass("hidden")})},render:function(){var t=this.sources.selected(),i=0;t=t.length>0&&t[0],this.$el.empty();var s=this.display_type_order_base,l=this.display_type_order_step;return this.display_types.each(function(n){if(t&&!n.is_compatible_with_source(t)){var a=e("#display_type_tab_content:visible");if(0==a.length)return;if("hidden"==a.css("visibility"))return}var r=new this.DisplayType;r.model=n,r.on("selected",this.selection_changed,this),this.display_types.selected_value()||(n.set("selected",!0),this.selection_changed(n.id));var o=n.get("view_order");o||(o=s);var d=Math.floor(o/l);i=d,this.$el.append(r.render().el)},this),this.$el.append('<li class="clear" style="height: 10px; list-style-type:none" />'),this},DisplayType:Backbone.View.extend({className:"display_type_preview",events:{click:"clicked"},clicked:function(e){this.trigger("selected",this.model.get("name"))},render:function(){var t=e('<label style="display: block; cursor: pointer;"/>').addClass("image_container"),i=this.model.get("installed_at_version"),s=photocrati_ajax.wp_plugins_url,l=this.model.get("preview_image_relpath");void 0===i&&(s=photocrati_ajax.wp_site_url,s=s.replace(/(.*)\/index\.php$/i,"$1"),0==l.indexOf("/nextgen-gallery")&&(s=photocrati_ajax.wp_plugins_url));var n=e("<img/>").attr({src:s+"/"+l,title:this.model.get("title"),alt:this.model.get("alt")}),a=e("<div/>"),r=e("<input/>").prop({type:"radio",value:this.model.get("name"),title:this.model.get("title"),name:"display_type",checked:this.model.get("selected")}),o=e("<br>");return t.append(a),t.append(n),t.append("<br>"),t.append(this.model.get("title").replace(/nextgen /gi,"")),a.append(r),a.append(o),this.$el.append(t),this}})}),t.DisplayTab.Views.Preview_Area=Backbone.View.extend({el:"#preview_area",initialize:function(){this.entities=t.DisplayTab.instance.entities,this.sources=t.DisplayTab.instance.sources,this.displayed_gallery=t.DisplayTab.instance.displayed_gallery,this.entity_list=e("<ul/>").attr("id","entity_list").append('<li class="clear"/>'),this.entities.on("add",this.render_entity,this),this.entities.on("remove",this.remove_entity,this),this.entities.on("reset",this.entities_reset,this),this.entities.on("change:sortorder",function(e){this.entities.remove(e,{silent:!0}),this.entities.add(e,{at:e.changed.sortorder,silent:!0}),this.displayed_gallery.set("sortorder",this.entities.entity_ids()),"undefined"!=typeof console&&void 0!==console.log&&console.log(this.entities.entity_ids()),this.displayed_gallery.set("order_by","sortorder")},this),this.sources.on("selected",this.render,this),this.render()},events:{opened:"entities_reset"},entities_reset:function(e){this.entities.reset(null,{silent:!0}),this.entity_list.empty().append('<li class="clear"/>'),this.entities.in_progress||this.entities.fetch()},render_entity:function(e){var t=new this.EntityElement({model:e});this.entity_list.find(".clear").before(t.render().$el),t.$el.css("visibility","hidden"),setTimeout(function(){t.$el.css("visibility","visible")},0),1==this.$el.find(".no_entities").length?this.render():this.entities.length>1&&this.entity_list.sortable("refresh")},remove_entity:function(e){var t=this.id=e.get("id_field")+"_"+e.entity_id();this.entity_list.find("#"+t).remove();this.entity_list.sortable("refresh"),0==this.entities.length&&this.render_no_images_notice()},render_no_images_notice:function(){this.$el.empty(),this.$el.append("<p class='no_entities'>"+igw_data.i18n.no_entities+"</p>")},render:function(){return this.$el.empty(),this.entities.length>0&&this.displayed_gallery.get("container_ids").length>0?(this.$el.append(new this.RefreshButton({entities:this.entities}).render().el),this.$el.append(new this.SortButtons({entities:this.entities,displayed_gallery:this.displayed_gallery,sources:this.sources}).render().el),this.$el.append(new this.ExcludeButtons({entities:this.entities}).render().el),this.$el.append(this.entity_list),this.entity_list.sortable({placeholder:"placeholder",forcePlaceholderSize:!0,containment:"parent",opacity:.7,revert:!0,dropOnEmpty:!0,start:function(e,t){return t.placeholder.css({height:t.item.height()}),!0},stop:function(e,t){t.item.trigger("drop",t.item.index())}}),this.entity_list.disableSelection()):this.render_no_images_notice(),this},RefreshButton:Backbone.View.extend({className:"refresh_button button-primary",tagName:"input",label:"Refresh",events:{click:"clicked"},clicked:function(){this.entities.reset()},initialize:function(e){this.options=e||{},_.each(this.options,function(e,t){this[t]=e},this)},render:function(){return this.$el.attr({value:this.label,type:"button"}),this}}),ExcludeButtons:Backbone.View.extend({className:"header_row",initialize:function(e){this.options=e||{},_.each(this.options,function(e,t){this[t]=e},this)},render:function(){this.$el.empty(),this.$el.append('<span style="margin-right: 8px;">Exclude:</span>');var e=new this.Button({value:!0,text:"All",entities:this.entities});this.$el.append(e.render().el),this.$el.append('<span class="separator">|</span>');var t=new this.Button({value:!1,text:"None",entities:this.entities});return this.$el.append(t.render().el),this},Button:Backbone.View.extend({tagName:"a",value:1,text:"",events:{click:"clicked"},initialize:function(e){this.options=e||{},_.each(this.options,function(e,t){this[t]=e},this)},clicked:function(e){e.preventDefault(),this.entities.each(function(e){e.set("exclude",this.value)},this)},render:function(){return this.$el.text(this.text).attr("href","#"),this}})}),SortButtons:Backbone.View.extend({className:"header_row",initialize:function(e){this.options=e||{},_.each(this.options,function(e,t){this[t]=e},this),this.sortorder_options=new t.DisplayTab.Models.SortOrder_Options,this.sortorder_options.on("change:selected",this.sortoption_changed,this),this.sortdirection_options=new t.DisplayTab.Models.SortDirection_Options([{value:"ASC",title:"Ascending",selected:"ASC"==this.displayed_gallery.get("order_direction")},{value:"DESC",title:"Descending",selected:"DESC"==this.displayed_gallery.get("order_direction")}]),this.sortdirection_options.on("change:selected",this.sortdirection_changed,this),this.displayed_gallery.on("change:order_by",this.displayed_gallery_order_changed,this),this.displayed_gallery.on("change.order_direction",this.displayed_gallery_order_dir_changed,this)},populate_sorting_fields:function(){var e=this.sources.selected().pop().get("returns");-1!==_.indexOf(e,"image")?this.fill_image_sortorder_options():this.fill_gallery_sortorder_options()},create_sortorder_option:function(e,i){return new t.DisplayTab.Models.SortOrder({name:e,title:i,value:e,selected:this.displayed_gallery.get("order_by")==e})},fill_image_sortorder_options:function(){this.sortorder_options.reset(),this.sortorder_options.push(this.create_sortorder_option("","None")),this.sortorder_options.push(this.create_sortorder_option("sortorder","Custom")),this.sortorder_options.push(this.create_sortorder_option(t.DisplayTab.instance.image_key,"Image ID")),this.sortorder_options.push(this.create_sortorder_option("filename","Filename")),this.sortorder_options.push(this.create_sortorder_option("alttext","Alt/Title Text")),this.sortorder_options.push(this.create_sortorder_option("imagedate","Date/Time"))},fill_gallery_sortorder_options:function(){this.sortorder_options.reset(),this.sortorder_options.push(this.create_sortorder_option("","None")),this.sortorder_options.push(this.create_sortorder_option("sortorder","Custom")),this.sortorder_options.push(this.create_sortorder_option("name","Name")),this.sortorder_options.push(this.create_sortorder_option("galdesc","Description"))},displayed_gallery_order_changed:function(e){this.sortorder_options.findWhere({value:e.get("order_by")}).set("selected",!0)},displayed_gallery_order_dir_changed:function(e){this.sortdirection_options.findWhere({value:e.get("order_direction")}).set("selected",!0)},sortoption_changed:function(t){this.sortorder_options.each(function(e){e.set("selected",t.get("value")==e.get("value"),{silent:!0})}),this.displayed_gallery.set("sortorder",[]);var i=t.get("value");0==t.get("value").length&&(i="sortorder"),this.displayed_gallery.set("order_by",i),this.entities.reset(),this.$el.find("a.sortorder").each(function(){var i=e(this);i.attr("value")==t.get("value")?i.addClass("selected"):i.removeClass("selected")})},sortdirection_changed:function(t){this.sortdirection_options.each(function(e){e.set("selected",t.get("value")==e.get("value"),{silent:!0})}),this.displayed_gallery.set("order_direction",t.get("value")),this.entities.reset(),this.$el.find("a.sortdirection").each(function(){var i=e(this);i.attr("value")==t.get("value")?i.addClass("selected"):i.removeClass("selected")})},render:function(){return this.$el.empty(),this.populate_sorting_fields(),this.$el.append('<span style="margin-right: 8px;">Sort By:</span>'),this.sortorder_options.each(function(e,t){var i=new this.Button({model:e,className:"sortorder"});this.$el.append(i.render().el),this.sortorder_options.length-1>t&&this.$el.append('<span class="separator">|</span>')},this),this.$el.append('<span style="margin: 0 8px 0 40px;">Order By:</span>'),this.sortdirection_options.each(function(e,t){var i=new this.Button({model:e,className:"sortdirection"});this.$el.append(i.render().el),this.sortdirection_options.length-1>t&&this.$el.append('<span class="separator">|</span>')},this),this},Button:Backbone.View.extend({tagName:"a",initialize:function(e){this.options=e||{},_.each(this.options,function(e,t){this[t]=e},this)},events:{click:"clicked"},clicked:function(e){e.preventDefault(),this.model.set("selected",!0)},render:function(){return this.$el.prop({value:this.model.get("value"),href:"#"}),this.$el.text(this.model.get("title")),this.model.get("selected")&&this.$el.addClass("selected"),this}})}),EntityElement:Backbone.View.extend({tagName:"li",events:{drop:"item_dropped"},initialize:function(e){this.options=e||{},_.each(this.options,function(e,t){this[t]=e},this),this.initTime=(new Date).getTime(),this.model.on("change",this.render,this),0==this.model.get("sortorder")&&this.model.set("sortorder",-1,{silent:!0}),this.id=this.model.get("id_field")+"_"+this.model.entity_id()},item_dropped:function(e,i){t.DisplayTab.instance.displayed_gallery.set("order_by","sortorder"),this.model.set("sortorder",i)},render:function(){this.$el.empty();var t=e("<div/>").addClass("preview_item"),i=e("<div/>").addClass("image_container"),s=this.model.alttext().replace(/\\&/g,"&").replace(/\\'/g,"'"),l=this.initTime;i.attr({title:s,style:"background-image: url('"+this.model.get("thumb_url")+"?timestamp"+l+"')"}),this.$el.append(t).addClass("ui-state-default"),t.append(i);var n=e("<div/>").addClass("exclude_container"),a=e("<label/>");a.append(igw_data.i18n.exclude_question);var r=new this.ExcludeCheckbox({model:this.model});return a.append(r.render().el),n.append(a),t.append(n),this},ExcludeCheckbox:Backbone.View.extend({tagName:"input",events:{change:"entity_excluded"},type_set:!1,entity_excluded:function(e){this.model.set("exclude",e.target.checked)},initialize:function(e){this.options=e||{},_.each(this.options,function(e,t){this[t]=e},this),this.model.on("change:exclude",this.render,this)},render:function(){return this.type_set||(this.$el.attr("type","checkbox"),this.type_set=!0),this.model.is_excluded()?this.$el.prop("checked",!0):this.$el.prop("checked",!1),this}})})}),t.DisplayTab.Views.GalleriesSource=Backbone.View.extend({tagName:"tbody",initialize:function(){this.galleries=t.DisplayTab.instance.galleries},render:function(){var i=new t.Views.Chosen({collection:this.galleries,placeholder:igw_data.i18n.select_gallery,multiple:!0,width:500}),s=e('<tr><td class="galleries_column"></td><td><label>'+igw_data.i18n.galleries+"</label></td></tr>");return this.$el.empty(),this.$el.append(s),this.$el.find(".galleries_column").append(i.render().el),this}}),t.DisplayTab.Views.AlbumsSource=Backbone.View.extend({tagName:"tbody",initialize:function(){this.albums=t.DisplayTab.instance.albums},render:function(){var e=new t.Views.Chosen({collection:this.albums,multiple:!0,placeholder:"Select an album",text_field:"name",width:500});return this.$el.empty(),this.$el.append('<tr><td class="albums_column"></td><td><label>'+igw_data.i18n.albums+"</label></td></tr>"),this.$el.find(".albums_column").append(e.render().el),this}}),t.DisplayTab.Views.TagsSource=Backbone.View.extend({tagName:"tbody",initialize:function(){this.tags=t.DisplayTab.instance.tags},render:function(){var e=new t.Views.Chosen({collection:this.tags,multiple:!0,placeholder:"Select a tag",text_field:"name",width:500});return this.$el.empty(),this.$el.append('<tr><td class="tags_column"></td><td><label>Tags</label></td></tr>'),this.$el.find(".tags_column").append(e.render().el),this}}),t.DisplayTab.Views.Recent_imagesSource=Backbone.View.extend({tagName:"tbody",initialize:function(){this.displayed_gallery=t.DisplayTab.instance.displayed_gallery,this.maximum_entity_count=t.DisplayTab.instance.displayed_gallery.get("maximum_entity_count"),this.displayed_gallery.set("container_ids",[])},render:function(){var t=this,i=e("<input/>").prop({type:"text",value:this.maximum_entity_count,name:"maximum_entity_count"});return i.change(function(){t.displayed_gallery.set("maximum_entity_count",e(this).val())}),this.$el.empty(),this.$el.append('<tr><td class="recent_images_column"></td><td><label># of Images To Display</label></td></tr>'),this.$el.find(".recent_images_column").append(i),this}}),t.DisplayTab.Views.Random_imagesSource=Backbone.View.extend({tagName:"tbody",initialize:function(){this.displayed_gallery=t.DisplayTab.instance.displayed_gallery,this.maximum_entity_count=t.DisplayTab.instance.displayed_gallery.get("maximum_entity_count"),this.displayed_gallery.set("container_ids",[])},render:function(){var t=this,i=e("<input/>").prop({type:"text",value:this.maximum_entity_count,name:"maximum_entity_count"});return i.change(function(){t.displayed_gallery.set("maximum_entity_count",e(this).val())}),this.$el.empty(),this.$el.append('<tr><td class="random_images_column"></td><td><label># of Images To Display</label></td></tr>'),this.$el.find(".random_images_column").append(i),this}}),t.DisplayTab.Views.SaveButton=Backbone.View.extend({el:"#save_displayed_gallery",errors_el:"#errors",displayed_gallery:null,events:{click:"clicked"},initialize:function(){this.displayed_gallery=t.DisplayTab.instance.displayed_gallery,this.entities=t.DisplayTab.instance.entities,this.render()},clicked:function(){this.set_display_settings();var e=this.displayed_gallery.to_shortcode();insert_into_editor(e,this.displayed_gallery.id?this.displayed_gallery.id:igw_data.shortcode_ref);var t=null;(t=location.toString().match(/editor=([^\&]+)/))&&t.length>=2&&top.tinyMCE.editors[t[1]].fire("ngg-inserted",{shortcode:e}),close_attach_to_post_window()},set_display_settings:function(){var t=this.displayed_gallery.get("display_type");if(t){var i=e("form[rel='"+t+"']"),s=i.data("defaults"),l=function(t){var i={};return e.each(t.serializeArray(),function(e,t){for(var l=t.name.split("["),n=i,a=0;a<l.length;a++){var r=l[a].replace(/\]$/,"");if(s[r]==t.value)return!0;n[r]||(a==l.length-1?n[r]=t.value:n[r]={}),n=n[r]}}),i}(i);this.displayed_gallery.set("display_settings",l[t])}},render:function(){return this.$el.css("z-index",1e3),this}}),t.DisplayTab.App=Backbone.View.extend({initialize:function(){if(this.displayed_gallery=new t.DisplayTab.Models.Displayed_Gallery(igw_data.displayed_gallery),this.original_displayed_gallery=new t.DisplayTab.Models.Displayed_Gallery(igw_data.displayed_gallery),this.galleries=new t.DisplayTab.Models.Gallery_Collection(igw_data.galleries),this.albums=new t.DisplayTab.Models.Album_Collection(igw_data.albums),this.tags=new t.DisplayTab.Models.Tag_Collection(igw_data.tags),this.sources=new t.DisplayTab.Models.Source_Collection(igw_data.sources),this.display_types=new t.DisplayTab.Models.Display_Type_Collection(igw_data.display_types),this.display_type_order_base=igw_data.display_type_priority_base,this.display_type_order_step=igw_data.display_type_priority_step,this.entities=new t.DisplayTab.Models.Entity_Collection,this.entities.extra_data.displayed_gallery=this.displayed_gallery,this.image_key=igw_data.image_primary_key,this.displayed_gallery.get("source")){if(this.displayed_gallery.get("source")){var i=this.sources.find_by_name_or_alias(this.displayed_gallery.get("source"));i&&i.set("selected",!0)}if(this.displayed_gallery.get("container_ids")&&_.each(this.displayed_gallery.get("container_ids"),function(e){var t=this[this.displayed_gallery.get("source")].find(function(t){return t.id==e},this);t&&t.set("selected",!0)},this),this.displayed_gallery.get("display_type")){var s=this.display_types.find_by_name_or_alias(this.displayed_gallery.get("display_type"));s&&(s.set("selected",!0),this.displayed_gallery.set("display_type",s.get("name")))}}if(collections=["galleries","albums","tags"],_.each(collections,function(e){this[e].on("selected",function(){this.update_selected_containers(e)},this)},this),this.display_types.on("change:selected",function(){this.displayed_gallery.set("display_type",this.display_types.selected_value())},this),this.sources.on("selected",function(){e("#save_displayed_gallery").prop("disabled",!0),setTimeout(function(){e("#save_displayed_gallery").prop("disabled",!1)},1e3),this.displayed_gallery.set("source",this.sources.selected_value()),this.sources.selected_value()!=this.original_displayed_gallery.get("source")?this.displayed_gallery.set("exclusions",this.entities.excluded_ids()):this.displayed_gallery.set("exclusions",this.original_displayed_gallery.get("exclusions")),"random_images"!=this.sources.selected_value()&&"recent_images"!=this.sources.selected_value()||this.displayed_gallery.set("maximum_entity_count",20),this.galleries.deselect_all(),this.albums.deselect_all(),this.tags.deselect_all();var t=this.display_types.selected(),i=this.sources.selected();t.length>0&&i.length>0&&(t=t[0],i=i[0],t.is_compatible_with_source(i)||this.display_types.deselect_all(),this.display_type_selector&&this.display_type_selector.render()),this.preview_area&&this.preview_area.render()},this),this.entities.on("change:exclude finished_fetching",function(){this.displayed_gallery.set("exclusions",this.entities.excluded_ids())},this),!this.displayed_gallery.get("source")){var l=this.sources.find_by_name_or_alias("galleries");l&&(l.set("selected",!0),this.sources.trigger("selected"))}if(window.Frame_Event_Publisher){var n=this;Frame_Event_Publisher.listen_for("attach_to_post:new_gallery",function(){n.galleries.reset(),n.galleries.fetch()}),Frame_Event_Publisher.listen_for("attach_to_post:manage_galleries attach_to_post:manage_images",function(e){n.galleries.reset(),n.galleries.fetch();var t=n.sources.selected().pop();t&&(_.indexOf(t.get("returns"),"image")>=0||_.indexOf(t.get("returns"),"gallery"))&&n.entities.reset()}),Frame_Event_Publisher.listen_for("attach_to_post:manage_album",function(e){n.albums.reset(),n.albums.fetch();var t=n.sources.selected().pop();t&&_.indexOf(t.get("returns"),"album")>=0&&n.entities.reset()}),Frame_Event_Publisher.listen_for("attach_to_post:manage_tags attach_to_post:manage_images",function(e){n.tags.reset(),n.tags.fetch();var t=n.sources.selected().pop();t&&(_.indexOf(t.get("returns"),"image")>=0||_.indexOf(t.get("returns"),"gallery"))&&n.entities.reset()}),Frame_Event_Publisher.listen_for("attach_to_post:thumbnail_modified",function(e){var t=n.sources.selected().pop(),i=e.image[e.image.id_field];if(t)if(_.indexOf(t.get("returns"),"image")>=0){var s=n.entities.find(function(e){return parseInt(e.entity_id())==parseInt(i)},this);s&&s.set("thumb_url",e.image.thumb_url)}else{var l=n.entities.find(function(e){return parseInt(e.get("previewpic"))==i},this);l&&l.trigger("change")}})}},update_selected_containers:function(e){this.displayed_gallery.set("container_ids",this[e].selected_ids())},render:function(){this.display_type_selector=new t.DisplayTab.Views.Display_Type_Selector,new t.DisplayTab.Views.Source_Config,new t.DisplayTab.Views.Slug_Config,this.preview_area=new t.DisplayTab.Views.Preview_Area,new t.DisplayTab.Views.SaveButton}}),t.DisplayTab.instance=new t.DisplayTab.App,t.DisplayTab.instance.render(),window.Ngg=t,e("span.tooltip, label.tooltip").tooltip()});
1
+ jQuery(function(e){var t={Models:{},Views:{}};t.Models.SelectableItems=Backbone.Collection.extend({selected:function(){return this.filter(function(e){return 1==e.get("selected")})},deselect_all:function(){this.each(function(e){e.set("selected",!1)})},selected_ids:function(){return _.pluck(this.selected(),"id")},select:function(e){_.isArray(e)||(e=[e]),this.each(function(t){_.indexOf(e,t.id)>=0&&t.set("selected",!0)}),this.trigger("selected")}}),t.Views.SelectTag=Backbone.View.extend({tagName:"select",collection:null,multiple:!1,value_field:"id",text_field:"title",initialize:function(e){this.options=e||{},_.each(this.options,function(e,t){this[t]=e},this),this.collection.on("add",this.render_new_option,this),this.collection.on("remove",this.remove_existing_option,this),this.collection.on("reset",this.empty_list,this)},events:{change:"selection_changed"},empty_list:function(){this.$el.empty()},render_new_option:function(e){this.$el.append(new this.Option({model:e,value_field:this.value_field,text_field:this.text_field}).render().el)},remove_existing_option:function(e){this.$el.find("option[value='"+e.id+"']").remove()},selection_changed:function(){var t=_.map(this.$el.find(":selected"),function(t){return e(t).val()});this.collection.each(function(e){_.indexOf(t,e.id)>=0||_.indexOf(t,e.id.toString())>=0?e.set("selected",!0):e.set("selected",!1)}),this.collection.trigger("selected")},render:function(){return this.$el.empty(),this.multiple&&(this.$el.prop("multiple",!0),this.$el.attr("multiple","multiple")),this.collection.each(function(e){var t=new this.Option({model:e,value_field:this.value_field,text_field:this.text_field});this.$el.append(t.render().el)},this),this.width&&this.$el.width(this.width),this},Option:Backbone.View.extend({tagName:"option",model:null,initialize:function(e){this.options=e||{},_.each(this.options,function(e,t){this[t]=e},this),this.model.on("change",this.render,this)},render:function(){var e=this;return this.$el.html(this.model.get(this.text_field).replace(/\\&/g,"&").replace(/\\'/g,"'")),this.$el.prop({value:"id"==this.value_field?this.model.id:this.model.get(this.value_field)}),1==e.model.get("selected")&&this.$el.prop("selected",!0).attr("selected","selected"),this}})}),t.Views.Chosen=Backbone.View.extend({tagName:"span",initialize:function(e){this.options=e||{},this.collection=this.options.collection,this.select_tag=new t.Views.SelectTag(this.options),this.collection.on("change",this.selection_changed,this)},selection_changed:function(e){_.isUndefined(e.changed.selected)&&this.render()},render:function(){return this.$el.append(this.select_tag.render().$el),this.options.width&&this.select_tag.$el.width(this.options.width),this.select2_opts={placeholder:this.options.placeholder},this.select_tag.$el.select2(this.select2_opts),this}}),t.DisplayTab={Models:{},Views:{},App:{}},t.Models.Remote_Collection=t.Models.SelectableItems.extend({fetch_limit:5e3,in_progress:!1,fetch_url:photocrati_ajax.url,action:"",extra_data:{},_create_request:function(e,t){var i={action:this.action,limit:e||this.fetch_limit,offset:t||0,nonce:igw_data.nonce};for(var s in this.extra_data){var l=this.extra_data[s];void 0===i[s]&&(i[s]={}),void 0!==l.toJSON&&(l=l.toJSON()),i[s]=_.extend(i[s],l)}return i},_add_item:function(e){this.push(e)},fetch:function(t,i){var s=this;this.in_progress=!0,e.post(this.fetch_url,this._create_request(t,i),function(e){"undefined"!=typeof _&&(_.isObject(e)||(e=JSON.parse(e)),e.items&&(_.each(e.items,function(e){s._add_item(e)}),e.total>=e.limit+e.offset?s.fetch(e.limit,e.offset+e.limit):(s.in_progress=!1,s.trigger("finished_fetching"))))})}}),t.DisplayTab.Models.Displayed_Gallery=Backbone.Model.extend({defaults:{source:null,container_ids:[],entity_ids:[],display_type:null,display_settings:{},exclusions:[],sortorder:[],slug:null},to_shortcode:function(){retval=null;var e=function(e,t){var i=e[t];if(void 0!==igw_data.shortcode_defaults[t]&&igw_data.shortcode_defaults[t]==i&&(i=null),_.isArray(i)&&(i=i.length>0?i.join(","):null),i)return i=i.toString().replace("[","&#91;"),i=i.toString().replace("]","&#93;"),void 0!==igw_data.shortcode_attr_replacements[t]&&(t=igw_data.shortcode_attr_replacements[t]),t+'="'+i+'"'},i=t.DisplayTab.instance.display_types.find_by_name_or_alias(this.get("display_type")),s=this.toJSON();s.display_type=i.get_shortcode_value();var l="[ngg",n=null;(n=e(s,"source"))&&(l+=" "+n),(n=e(s,"container_ids"))&&(l+=" "+n),(n=e(s,"entity_ids"))&&(l+=" "+n),(n=e(s,"exclusions"))&&(l+=" "+n),(n=e(s,"sortorder"))&&(l+=" "+n);for(var a in s){if(!(["source","container_ids","entity_ids","exclusions","sortorder","__defaults_set","id_field","post_category","ID"].indexOf(a)>-1))if("display_settings"==a)for(var r in s[a])(n=e(s[a],r))&&(l+=" "+n);else(n=e(s,a))&&(l+=" "+n)}return l+="]"}}),t.DisplayTab.Models.Source=Backbone.Model.extend({idAttribute:"name",defaults:{title:"",name:"",selected:!1}}),t.DisplayTab.Models.Source_Collection=t.Models.SelectableItems.extend({model:t.DisplayTab.Models.Source,selected_value:function(){var e=null,t=this.selected();return t.length>0&&(e=t[0].get("name")),e},find_by_name_or_alias:function(e){return this.find(function(t){return t.get("name")==e||_.isArray(t.get("aliases"))&&t.get("aliases").indexOf(e)>-1})}}),t.DisplayTab.Models.Gallery=Backbone.Model.extend({idAttribute:igw_data.gallery_primary_key,defaults:{title:"",name:""}}),t.DisplayTab.Models.Gallery_Collection=t.Models.Remote_Collection.extend({model:t.DisplayTab.Models.Gallery,action:"get_existing_galleries"}),t.DisplayTab.Models.Album=Backbone.Model.extend({defaults:{title:"",name:""}}),t.DisplayTab.Models.Album_Collection=t.Models.Remote_Collection.extend({model:t.DisplayTab.Models.Album,action:"get_existing_albums"}),t.DisplayTab.Models.Tag=Backbone.Model.extend({defaults:{title:""}}),t.DisplayTab.Models.Tag_Collection=t.Models.Remote_Collection.extend({model:t.DisplayTab.Models.Tag,action:"get_existing_image_tags"}),t.DisplayTab.Models.Display_Type=Backbone.Model.extend({idAttribute:"name",defaults:{title:""},is_compatible_with_source:function(e){var t=!0;for(index in e.get("returns")){var i=e.get("returns")[index];if(_.indexOf(this.get("entity_types"),i)<0){t=!1;break}}return t},get_shortcode_value:function(){var e=this.id,t=this.get("aliases");return _.isArray(t)&&t.length>0&&(e=t[0]),e}}),t.DisplayTab.Models.Display_Type_Collection=t.Models.SelectableItems.extend({model:t.DisplayTab.Models.Display_Type,selected_value:function(){var e=this.selected();return e.length>0?e[0].get("name"):null},find_by_name_or_alias:function(e){return this.find(function(t){return t.get("name")==e||_.isArray(t.get("aliases"))&&t.get("aliases").indexOf(e)>-1})}}),t.DisplayTab.Models.Entity=Backbone.Model.extend({entity_id:function(){return this.get(this.get("id_field"))},is_excluded:function(){return current_value=this.get("exclude"),!_.isUndefined(current_value)&&(_.isBoolean(current_value)?current_value:0!=parseInt(current_value))},is_included:function(){return!this.is_excluded()},is_gallery:function(){return retval=!1,1==this.get("is_gallery")&&(retval=!0),retval},is_album:function(){return retval=!1,1==this.get("is_album")&&(retval=!0),retval},is_image:function(){return!this.is_album()&&!this.is_gallery()},alttext:function(){return this.is_image()?this.get("alttext"):this.is_gallery()?this.get("title"):this.is_album()?this.get("name"):void 0}}),t.DisplayTab.Models.Entity_Collection=t.Models.Remote_Collection.extend({model:t.DisplayTab.Models.Entity,action:"get_displayed_gallery_entities",_add_item:function(e){e.exclude=1==parseInt(e.exclude),e.is_gallery=1==parseInt(e.is_gallery),e.is_album=1==parseInt(e.is_album),this.push(e)},entity_ids:function(){return this.map(function(e){return e.entity_id()})},included_ids:function(){return _.compact(this.map(function(e){if(e.is_included())return e.entity_id()}))},excluded_ids:function(){return _.compact(this.map(function(e){if(!e.is_included())return e.entity_id()}))}}),t.DisplayTab.Models.SortOrder=Backbone.Model.extend({}),t.DisplayTab.Models.SortOrder_Options=t.Models.SelectableItems.extend({model:t.DisplayTab.Models.SortOrder}),t.DisplayTab.Models.SortDirection=Backbone.Model.extend({}),t.DisplayTab.Models.SortDirection_Options=Backbone.Collection.extend({model:t.DisplayTab.Models.SortDirection}),t.DisplayTab.Models.Slug=Backbone.Model.extend({}),t.DisplayTab.Views.Source_Config=Backbone.View.extend({el:"#source_configuration",selected_view:null,initialize:function(){this.sources=t.DisplayTab.instance.sources,this.sources.on("selected",this.render,this),_.bindAll(this,"render"),this.render()},render:function(){var e=new t.Views.Chosen({id:"source_select",collection:this.sources,placeholder:"Select a source",width:500}),i=_.template('<tr><td id="source_column"></td><td><label><%- sources %></label></td></tr>');this.$el.html(i(igw_data.i18n)),this.$el.find("#source_column").append(e.render().el);var s=this.sources.selected();if(s.length){var l=function(e){return e=String(e),e.charAt(0).toUpperCase()+e.slice(1)}(s.pop().id)+"Source";if(void 0!==t.DisplayTab.Views[l]){var n=new t.DisplayTab.Views[l];this.$el.append(n.render().el)}}return this}}),t.DisplayTab.Views.Slug_Config=Backbone.View.extend({el:"#slug_configuration",selected_view:null,initialize:function(){this.displayed_gallery=t.DisplayTab.instance.displayed_gallery,this.slug=t.DisplayTab.instance.displayed_gallery.get("slug"),this.render()},render:function(){var t=this,i=e("<input>").prop({type:"text",name:"slug",value:this.slug,placeholder:igw_data.i18n.optional,id:"field_slug"});i.on("input",function(){e(this).val(e(this).val().replace(/\s|\?|\\|\/|&|=|\[|]|#/gm,"-")),t.displayed_gallery.set("slug",e(this).val())}),i.on("change",function(){e(this).val(e(this).val().replace(/^-*/gm,"").replace(/-*$/gm,"")),t.displayed_gallery.set("slug",e(this).val())});var s=_.template('<tr><td id="slug_label"><label for="field_slug" class="tooltip" title="<%- slug_tooltip %><"><<%- slug_label %></label></td><td id="slug_column"></td></tr>');return this.$el.append(s(igw_data.i18n)),this.$el.find("#slug_column").append(i),this}}),t.DisplayTab.Views.Display_Type_Selector=Backbone.View.extend({el:"#display_type_selector",initialize:function(){this.display_types=t.DisplayTab.instance.display_types,this.display_type_order_base=t.DisplayTab.instance.display_type_order_base,this.display_type_order_step=t.DisplayTab.instance.display_type_order_step,this.sources=t.DisplayTab.instance.sources,this.render()},selection_changed:function(t){var i=null;this.display_types.each(function(e){e.get("name")==t?(i=e,e.set("selected",!0)):e.set("selected",!1)}),e(".display_settings_form").each(function(){$this=e(this),$this.attr("rel")==t?$this.removeClass("hidden"):$this.addClass("hidden")})},render:function(){var t=this.sources.selected(),i=0;t=t.length>0&&t[0],this.$el.empty();var s=this.display_type_order_base,l=this.display_type_order_step;return this.display_types.each(function(n){if(t&&!n.is_compatible_with_source(t)){var a=e("#display_type_tab_content:visible");if(0==a.length)return;if("hidden"==a.css("visibility"))return}var r=new this.DisplayType;r.model=n,r.on("selected",this.selection_changed,this),this.display_types.selected_value()||(n.set("selected",!0),this.selection_changed(n.id));var o=n.get("view_order");o||(o=s);var d=Math.floor(o/l);i=d,this.$el.append(r.render().el)},this),this.$el.append('<li class="clear" style="height: 10px; list-style-type:none" />'),this},DisplayType:Backbone.View.extend({className:"display_type_preview",events:{click:"clicked"},clicked:function(e){this.trigger("selected",this.model.get("name"))},render:function(){var t=e('<label style="display: block; cursor: pointer;"/>').addClass("image_container"),i=e("<img/>").attr({src:this.model.get("preview_image_url"),title:this.model.get("title"),alt:this.model.get("alt")}),s=e("<div/>"),l=e("<input/>").prop({type:"radio",value:this.model.get("name"),title:this.model.get("title"),name:"display_type",checked:this.model.get("selected")}),n=e("<br>");return t.append(s),t.append(i),t.append("<br>"),t.append(this.model.get("title").replace(/nextgen /gi,"")),s.append(l),s.append(n),this.$el.append(t),this}})}),t.DisplayTab.Views.Preview_Area=Backbone.View.extend({el:"#preview_area",initialize:function(){this.entities=t.DisplayTab.instance.entities,this.sources=t.DisplayTab.instance.sources,this.displayed_gallery=t.DisplayTab.instance.displayed_gallery,this.entity_list=e("<ul/>").attr("id","entity_list").append('<li class="clear"/>'),this.entities.on("add",this.render_entity,this),this.entities.on("remove",this.remove_entity,this),this.entities.on("reset",this.entities_reset,this),this.entities.on("change:sortorder",function(e){this.entities.remove(e,{silent:!0}),this.entities.add(e,{at:e.changed.sortorder,silent:!0}),this.displayed_gallery.set("sortorder",this.entities.entity_ids()),"undefined"!=typeof console&&void 0!==console.log&&console.log(this.entities.entity_ids()),this.displayed_gallery.set("order_by","sortorder")},this),this.sources.on("selected",this.render,this),this.render()},events:{opened:"entities_reset"},entities_reset:function(e){this.entities.reset(null,{silent:!0}),this.entity_list.empty().append('<li class="clear"/>'),this.entities.in_progress||this.entities.fetch()},render_entity:function(e){var t=new this.EntityElement({model:e});this.entity_list.find(".clear").before(t.render().$el),t.$el.css("visibility","hidden"),setTimeout(function(){t.$el.css("visibility","visible")},0),1==this.$el.find(".no_entities").length?this.render():this.entities.length>1&&this.entity_list.sortable("refresh")},remove_entity:function(e){var t=this.id=e.get("id_field")+"_"+e.entity_id();this.entity_list.find("#"+t).remove();this.entity_list.sortable("refresh"),0==this.entities.length&&this.render_no_images_notice()},render_no_images_notice:function(){this.$el.empty(),this.$el.append("<p class='no_entities'>"+igw_data.i18n.no_entities+"</p>")},render:function(){return this.$el.empty(),this.entities.length>0&&this.displayed_gallery.get("container_ids").length>0?(this.$el.append(new this.RefreshButton({entities:this.entities}).render().el),this.$el.append(new this.SortButtons({entities:this.entities,displayed_gallery:this.displayed_gallery,sources:this.sources}).render().el),this.$el.append(new this.ExcludeButtons({entities:this.entities}).render().el),this.$el.append(this.entity_list),this.entity_list.sortable({placeholder:"placeholder",forcePlaceholderSize:!0,containment:"parent",opacity:.7,revert:!0,dropOnEmpty:!0,start:function(e,t){return t.placeholder.css({height:t.item.height()}),!0},stop:function(e,t){t.item.trigger("drop",t.item.index())}}),this.entity_list.disableSelection()):this.render_no_images_notice(),this},RefreshButton:Backbone.View.extend({className:"refresh_button button-primary",tagName:"input",label:"Refresh",events:{click:"clicked"},clicked:function(){this.entities.reset()},initialize:function(e){this.options=e||{},_.each(this.options,function(e,t){this[t]=e},this)},render:function(){return this.$el.attr({value:this.label,type:"button"}),this}}),ExcludeButtons:Backbone.View.extend({className:"header_row",initialize:function(e){this.options=e||{},_.each(this.options,function(e,t){this[t]=e},this)},render:function(){this.$el.empty(),this.$el.append('<span style="margin-right: 8px;">Exclude:</span>');var e=new this.Button({value:!0,text:"All",entities:this.entities});this.$el.append(e.render().el),this.$el.append('<span class="separator">|</span>');var t=new this.Button({value:!1,text:"None",entities:this.entities});return this.$el.append(t.render().el),this},Button:Backbone.View.extend({tagName:"a",value:1,text:"",events:{click:"clicked"},initialize:function(e){this.options=e||{},_.each(this.options,function(e,t){this[t]=e},this)},clicked:function(e){e.preventDefault(),this.entities.each(function(e){e.set("exclude",this.value)},this)},render:function(){return this.$el.text(this.text).attr("href","#"),this}})}),SortButtons:Backbone.View.extend({className:"header_row",initialize:function(e){this.options=e||{},_.each(this.options,function(e,t){this[t]=e},this),this.sortorder_options=new t.DisplayTab.Models.SortOrder_Options,this.sortorder_options.on("change:selected",this.sortoption_changed,this),this.sortdirection_options=new t.DisplayTab.Models.SortDirection_Options([{value:"ASC",title:"Ascending",selected:"ASC"==this.displayed_gallery.get("order_direction")},{value:"DESC",title:"Descending",selected:"DESC"==this.displayed_gallery.get("order_direction")}]),this.sortdirection_options.on("change:selected",this.sortdirection_changed,this),this.displayed_gallery.on("change:order_by",this.displayed_gallery_order_changed,this),this.displayed_gallery.on("change.order_direction",this.displayed_gallery_order_dir_changed,this)},populate_sorting_fields:function(){var e=this.sources.selected().pop().get("returns");-1!==_.indexOf(e,"image")?this.fill_image_sortorder_options():this.fill_gallery_sortorder_options()},create_sortorder_option:function(e,i){return new t.DisplayTab.Models.SortOrder({name:e,title:i,value:e,selected:this.displayed_gallery.get("order_by")==e})},fill_image_sortorder_options:function(){this.sortorder_options.reset(),this.sortorder_options.push(this.create_sortorder_option("","None")),this.sortorder_options.push(this.create_sortorder_option("sortorder","Custom")),this.sortorder_options.push(this.create_sortorder_option(t.DisplayTab.instance.image_key,"Image ID")),this.sortorder_options.push(this.create_sortorder_option("filename","Filename")),this.sortorder_options.push(this.create_sortorder_option("alttext","Alt/Title Text")),this.sortorder_options.push(this.create_sortorder_option("imagedate","Date/Time"))},fill_gallery_sortorder_options:function(){this.sortorder_options.reset(),this.sortorder_options.push(this.create_sortorder_option("","None")),this.sortorder_options.push(this.create_sortorder_option("sortorder","Custom")),this.sortorder_options.push(this.create_sortorder_option("name","Name")),this.sortorder_options.push(this.create_sortorder_option("galdesc","Description"))},displayed_gallery_order_changed:function(e){this.sortorder_options.findWhere({value:e.get("order_by")}).set("selected",!0)},displayed_gallery_order_dir_changed:function(e){this.sortdirection_options.findWhere({value:e.get("order_direction")}).set("selected",!0)},sortoption_changed:function(t){this.sortorder_options.each(function(e){e.set("selected",t.get("value")==e.get("value"),{silent:!0})}),this.displayed_gallery.set("sortorder",[]);var i=t.get("value");0==t.get("value").length&&(i="sortorder"),this.displayed_gallery.set("order_by",i),this.entities.reset(),this.$el.find("a.sortorder").each(function(){var i=e(this);i.attr("value")==t.get("value")?i.addClass("selected"):i.removeClass("selected")})},sortdirection_changed:function(t){this.sortdirection_options.each(function(e){e.set("selected",t.get("value")==e.get("value"),{silent:!0})}),this.displayed_gallery.set("order_direction",t.get("value")),this.entities.reset(),this.$el.find("a.sortdirection").each(function(){var i=e(this);i.attr("value")==t.get("value")?i.addClass("selected"):i.removeClass("selected")})},render:function(){return this.$el.empty(),this.populate_sorting_fields(),this.$el.append('<span style="margin-right: 8px;">Sort By:</span>'),this.sortorder_options.each(function(e,t){var i=new this.Button({model:e,className:"sortorder"});this.$el.append(i.render().el),this.sortorder_options.length-1>t&&this.$el.append('<span class="separator">|</span>')},this),this.$el.append('<span style="margin: 0 8px 0 40px;">Order By:</span>'),this.sortdirection_options.each(function(e,t){var i=new this.Button({model:e,className:"sortdirection"});this.$el.append(i.render().el),this.sortdirection_options.length-1>t&&this.$el.append('<span class="separator">|</span>')},this),this},Button:Backbone.View.extend({tagName:"a",initialize:function(e){this.options=e||{},_.each(this.options,function(e,t){this[t]=e},this)},events:{click:"clicked"},clicked:function(e){e.preventDefault(),this.model.set("selected",!0)},render:function(){return this.$el.prop({value:this.model.get("value"),href:"#"}),this.$el.text(this.model.get("title")),this.model.get("selected")&&this.$el.addClass("selected"),this}})}),EntityElement:Backbone.View.extend({tagName:"li",events:{drop:"item_dropped"},initialize:function(e){this.options=e||{},_.each(this.options,function(e,t){this[t]=e},this),this.initTime=(new Date).getTime(),this.model.on("change",this.render,this),0==this.model.get("sortorder")&&this.model.set("sortorder",-1,{silent:!0}),this.id=this.model.get("id_field")+"_"+this.model.entity_id()},item_dropped:function(e,i){t.DisplayTab.instance.displayed_gallery.set("order_by","sortorder"),this.model.set("sortorder",i)},render:function(){this.$el.empty();var t=e("<div/>").addClass("preview_item"),i=e("<div/>").addClass("image_container"),s=this.model.alttext().replace(/\\&/g,"&").replace(/\\'/g,"'"),l=this.initTime;i.attr({title:s,style:"background-image: url('"+this.model.get("thumb_url")+"?timestamp"+l+"')"}),this.$el.append(t).addClass("ui-state-default"),t.append(i);var n=e("<div/>").addClass("exclude_container"),a=e("<label/>");a.append(igw_data.i18n.exclude_question);var r=new this.ExcludeCheckbox({model:this.model});return a.append(r.render().el),n.append(a),t.append(n),this},ExcludeCheckbox:Backbone.View.extend({tagName:"input",events:{change:"entity_excluded"},type_set:!1,entity_excluded:function(e){this.model.set("exclude",e.target.checked)},initialize:function(e){this.options=e||{},_.each(this.options,function(e,t){this[t]=e},this),this.model.on("change:exclude",this.render,this)},render:function(){return this.type_set||(this.$el.attr("type","checkbox"),this.type_set=!0),this.model.is_excluded()?this.$el.prop("checked",!0):this.$el.prop("checked",!1),this}})})}),t.DisplayTab.Views.GalleriesSource=Backbone.View.extend({tagName:"tbody",initialize:function(){this.galleries=t.DisplayTab.instance.galleries},render:function(){var i=new t.Views.Chosen({collection:this.galleries,placeholder:igw_data.i18n.select_gallery,multiple:!0,width:500}),s=e('<tr><td class="galleries_column"></td><td><label>'+igw_data.i18n.galleries+"</label></td></tr>");return this.$el.empty(),this.$el.append(s),this.$el.find(".galleries_column").append(i.render().el),this}}),t.DisplayTab.Views.AlbumsSource=Backbone.View.extend({tagName:"tbody",initialize:function(){this.albums=t.DisplayTab.instance.albums},render:function(){var e=new t.Views.Chosen({collection:this.albums,multiple:!0,placeholder:"Select an album",text_field:"name",width:500});return this.$el.empty(),this.$el.append('<tr><td class="albums_column"></td><td><label>'+igw_data.i18n.albums+"</label></td></tr>"),this.$el.find(".albums_column").append(e.render().el),this}}),t.DisplayTab.Views.TagsSource=Backbone.View.extend({tagName:"tbody",initialize:function(){this.tags=t.DisplayTab.instance.tags},render:function(){var e=new t.Views.Chosen({collection:this.tags,multiple:!0,placeholder:"Select a tag",text_field:"name",width:500});return this.$el.empty(),this.$el.append('<tr><td class="tags_column"></td><td><label>Tags</label></td></tr>'),this.$el.find(".tags_column").append(e.render().el),this}}),t.DisplayTab.Views.Recent_imagesSource=Backbone.View.extend({tagName:"tbody",initialize:function(){this.displayed_gallery=t.DisplayTab.instance.displayed_gallery,this.maximum_entity_count=t.DisplayTab.instance.displayed_gallery.get("maximum_entity_count"),this.displayed_gallery.set("container_ids",[])},render:function(){var t=this,i=e("<input/>").prop({type:"text",value:this.maximum_entity_count,name:"maximum_entity_count"});return i.change(function(){t.displayed_gallery.set("maximum_entity_count",e(this).val())}),this.$el.empty(),this.$el.append('<tr><td class="recent_images_column"></td><td><label># of Images To Display</label></td></tr>'),this.$el.find(".recent_images_column").append(i),this}}),t.DisplayTab.Views.Random_imagesSource=Backbone.View.extend({tagName:"tbody",initialize:function(){this.displayed_gallery=t.DisplayTab.instance.displayed_gallery,this.maximum_entity_count=t.DisplayTab.instance.displayed_gallery.get("maximum_entity_count"),this.displayed_gallery.set("container_ids",[])},render:function(){var t=this,i=e("<input/>").prop({type:"text",value:this.maximum_entity_count,name:"maximum_entity_count"});return i.change(function(){t.displayed_gallery.set("maximum_entity_count",e(this).val())}),this.$el.empty(),this.$el.append('<tr><td class="random_images_column"></td><td><label># of Images To Display</label></td></tr>'),this.$el.find(".random_images_column").append(i),this}}),t.DisplayTab.Views.SaveButton=Backbone.View.extend({el:"#save_displayed_gallery",errors_el:"#errors",displayed_gallery:null,events:{click:"clicked"},initialize:function(){this.displayed_gallery=t.DisplayTab.instance.displayed_gallery,this.entities=t.DisplayTab.instance.entities,this.render()},clicked:function(){this.set_display_settings();var e=this.displayed_gallery.to_shortcode();insert_into_editor(e,this.displayed_gallery.id?this.displayed_gallery.id:igw_data.shortcode_ref);var t=null;(t=location.toString().match(/editor=([^\&]+)/))&&t.length>=2&&top.tinyMCE.editors[t[1]].fire("ngg-inserted",{shortcode:e}),close_attach_to_post_window()},set_display_settings:function(){var t=this.displayed_gallery.get("display_type");if(t){var i=e("form[rel='"+t+"']"),s=i.data("defaults"),l=function(t){var i={};return e.each(t.serializeArray(),function(e,t){for(var l=t.name.split("["),n=i,a=0;a<l.length;a++){var r=l[a].replace(/\]$/,"");if(s[r]==t.value)return!0;n[r]||(a==l.length-1?n[r]=t.value:n[r]={}),n=n[r]}}),i}(i);this.displayed_gallery.set("display_settings",l[t])}},render:function(){return this.$el.css("z-index",1e3),this}}),t.DisplayTab.App=Backbone.View.extend({initialize:function(){if(this.displayed_gallery=new t.DisplayTab.Models.Displayed_Gallery(igw_data.displayed_gallery),this.original_displayed_gallery=new t.DisplayTab.Models.Displayed_Gallery(igw_data.displayed_gallery),this.galleries=new t.DisplayTab.Models.Gallery_Collection(igw_data.galleries),this.albums=new t.DisplayTab.Models.Album_Collection(igw_data.albums),this.tags=new t.DisplayTab.Models.Tag_Collection(igw_data.tags),this.sources=new t.DisplayTab.Models.Source_Collection(igw_data.sources),this.display_types=new t.DisplayTab.Models.Display_Type_Collection(igw_data.display_types),this.display_type_order_base=igw_data.display_type_priority_base,this.display_type_order_step=igw_data.display_type_priority_step,this.entities=new t.DisplayTab.Models.Entity_Collection,this.entities.extra_data.displayed_gallery=this.displayed_gallery,this.image_key=igw_data.image_primary_key,this.displayed_gallery.get("source")){if(this.displayed_gallery.get("source")){var i=this.sources.find_by_name_or_alias(this.displayed_gallery.get("source"));i&&i.set("selected",!0)}if(this.displayed_gallery.get("container_ids")&&_.each(this.displayed_gallery.get("container_ids"),function(e){var t=this[this.displayed_gallery.get("source")].find(function(t){return t.id==e},this);t&&t.set("selected",!0)},this),this.displayed_gallery.get("display_type")){var s=this.display_types.find_by_name_or_alias(this.displayed_gallery.get("display_type"));s&&(s.set("selected",!0),this.displayed_gallery.set("display_type",s.get("name")))}}if(collections=["galleries","albums","tags"],_.each(collections,function(e){this[e].on("selected",function(){this.update_selected_containers(e)},this)},this),this.display_types.on("change:selected",function(){this.displayed_gallery.set("display_type",this.display_types.selected_value())},this),this.sources.on("selected",function(){e("#save_displayed_gallery").prop("disabled",!0),setTimeout(function(){e("#save_displayed_gallery").prop("disabled",!1)},1e3),this.displayed_gallery.set("source",this.sources.selected_value()),this.sources.selected_value()!=this.original_displayed_gallery.get("source")?this.displayed_gallery.set("exclusions",this.entities.excluded_ids()):this.displayed_gallery.set("exclusions",this.original_displayed_gallery.get("exclusions")),"random_images"!=this.sources.selected_value()&&"recent_images"!=this.sources.selected_value()||this.displayed_gallery.set("maximum_entity_count",20),this.galleries.deselect_all(),this.albums.deselect_all(),this.tags.deselect_all();var t=this.display_types.selected(),i=this.sources.selected();t.length>0&&i.length>0&&(t=t[0],i=i[0],t.is_compatible_with_source(i)||this.display_types.deselect_all(),this.display_type_selector&&this.display_type_selector.render()),this.preview_area&&this.preview_area.render()},this),this.entities.on("change:exclude finished_fetching",function(){this.displayed_gallery.set("exclusions",this.entities.excluded_ids())},this),!this.displayed_gallery.get("source")){var l=this.sources.find_by_name_or_alias("galleries");l&&(l.set("selected",!0),this.sources.trigger("selected"))}if(window.Frame_Event_Publisher){var n=this;Frame_Event_Publisher.listen_for("attach_to_post:new_gallery",function(){n.galleries.reset(),n.galleries.fetch()}),Frame_Event_Publisher.listen_for("attach_to_post:manage_galleries attach_to_post:manage_images",function(e){n.galleries.reset(),n.galleries.fetch();var t=n.sources.selected().pop();t&&(_.indexOf(t.get("returns"),"image")>=0||_.indexOf(t.get("returns"),"gallery"))&&n.entities.reset()}),Frame_Event_Publisher.listen_for("attach_to_post:manage_album",function(e){n.albums.reset(),n.albums.fetch();var t=n.sources.selected().pop();t&&_.indexOf(t.get("returns"),"album")>=0&&n.entities.reset()}),Frame_Event_Publisher.listen_for("attach_to_post:manage_tags attach_to_post:manage_images",function(e){n.tags.reset(),n.tags.fetch();var t=n.sources.selected().pop();t&&(_.indexOf(t.get("returns"),"image")>=0||_.indexOf(t.get("returns"),"gallery"))&&n.entities.reset()}),Frame_Event_Publisher.listen_for("attach_to_post:thumbnail_modified",function(e){var t=n.sources.selected().pop(),i=e.image[e.image.id_field];if(t)if(_.indexOf(t.get("returns"),"image")>=0){var s=n.entities.find(function(e){return parseInt(e.entity_id())==parseInt(i)},this);s&&s.set("thumb_url",e.image.thumb_url)}else{var l=n.entities.find(function(e){return parseInt(e.get("previewpic"))==i},this);l&&l.trigger("change")}})}},update_selected_containers:function(e){this.displayed_gallery.set("container_ids",this[e].selected_ids())},render:function(){this.display_type_selector=new t.DisplayTab.Views.Display_Type_Selector,new t.DisplayTab.Views.Source_Config,new t.DisplayTab.Views.Slug_Config,this.preview_area=new t.DisplayTab.Views.Preview_Area,new t.DisplayTab.Views.SaveButton}}),t.DisplayTab.instance=new t.DisplayTab.App,t.DisplayTab.instance.render(),window.Ngg=t,e("span.tooltip, label.tooltip").tooltip()});
products/photocrati_nextgen/modules/dynamic_thumbnails/module.dynamic_thumbnails.php CHANGED
@@ -20,7 +20,7 @@ class M_Dynamic_Thumbnails extends C_Base_Module
20
  'photocrati-dynamic_thumbnails',
21
  'Dynamic Thumbnails',
22
  'Adds support for dynamic thumbnails',
23
- '3.0.0',
24
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
25
  'Imagely',
26
  'https://www.imagely.com'
@@ -29,11 +29,6 @@ class M_Dynamic_Thumbnails extends C_Base_Module
29
  C_Photocrati_Installer::add_handler($this->module_id, 'C_Dynamic_Thumbnails_Installer');
30
  }
31
 
32
- function _register_adapters()
33
- {
34
- $this->get_registry()->add_adapter('I_GalleryStorage_Driver', 'A_Dynamic_Thumbnails_Storage_Driver');
35
- }
36
-
37
  function _register_utilities()
38
  {
39
  $this->get_registry()->add_utility('I_Dynamic_Thumbnails_Manager', 'C_Dynamic_Thumbnails_Manager');
@@ -63,10 +58,8 @@ class M_Dynamic_Thumbnails extends C_Base_Module
63
  function get_type_list()
64
  {
65
  return array(
66
- 'A_Dynamic_Thumbnails_Storage_Driver' => 'adapter.dynamic_thumbnails_storage_driver.php',
67
  'C_Dynamic_Thumbnails_Installer' => 'class.dynamic_thumbnails_installer.php',
68
- 'C_Dynamic_Thumbnails_Controller' => 'class.dynamic_thumbnails_controller.php',
69
- 'C_Dynamic_Thumbnails_Manager' => 'class.dynamic_thumbnails_manager.php'
70
  );
71
  }
72
  }
20
  'photocrati-dynamic_thumbnails',
21
  'Dynamic Thumbnails',
22
  'Adds support for dynamic thumbnails',
23
+ '3.1.8',
24
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
25
  'Imagely',
26
  'https://www.imagely.com'
29
  C_Photocrati_Installer::add_handler($this->module_id, 'C_Dynamic_Thumbnails_Installer');
30
  }
31
 
 
 
 
 
 
32
  function _register_utilities()
33
  {
34
  $this->get_registry()->add_utility('I_Dynamic_Thumbnails_Manager', 'C_Dynamic_Thumbnails_Manager');
58
  function get_type_list()
59
  {
60
  return array(
 
61
  'C_Dynamic_Thumbnails_Installer' => 'class.dynamic_thumbnails_installer.php',
62
+ 'C_Dynamic_Thumbnails_Controller' => 'class.dynamic_thumbnails_controller.php'
 
63
  );
64
  }
65
  }
products/photocrati_nextgen/modules/dynamic_thumbnails/package.module.dynamic_thumbnails.php CHANGED
@@ -1,93 +1,4 @@
1
  <?php
2
- /**
3
- * Class A_Dynamic_Thumbnails_Storage_Driver
4
- * @mixin C_GalleryStorage_Driver_Base
5
- * @adapts I_GalleryStorage_Driver
6
- */
7
- class A_Dynamic_Thumbnails_Storage_Driver extends Mixin
8
- {
9
- function get_image_abspath($image, $size = FALSE, $check_existance = FALSE)
10
- {
11
- $retval = NULL;
12
- $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance();
13
- if ($dynthumbs && $dynthumbs->is_size_dynamic($size)) {
14
- // If we have the id, get the actual image entity
15
- if (is_numeric($image)) {
16
- $image = $this->object->_image_mapper->find($image);
17
- }
18
- // Ensure we have the image entity - user could have passed in an
19
- // incorrect id
20
- if (is_object($image)) {
21
- if ($folder_path = $this->object->get_cache_abspath($image->galleryid)) {
22
- $params = $dynthumbs->get_params_from_name($size, true);
23
- $image_filename = $dynthumbs->get_image_name($image, $params);
24
- $image_path = implode(DIRECTORY_SEPARATOR, array(rtrim($folder_path, "\\/"), $image_filename));
25
- if ($check_existance) {
26
- if (@file_exists($image_path)) {
27
- $retval = $image_path;
28
- }
29
- } else {
30
- $retval = $image_path;
31
- }
32
- }
33
- }
34
- } else {
35
- $retval = $this->call_parent('get_image_abspath', $image, $size, $check_existance);
36
- }
37
- return $retval;
38
- }
39
- function get_image_url($image, $size = 'full', $check_existance = FALSE)
40
- {
41
- $retval = NULL;
42
- $abspath = FALSE;
43
- $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance();
44
- if ($dynthumbs && $dynthumbs->is_size_dynamic($size)) {
45
- $abspath = $this->object->get_image_abspath($image, $size, true);
46
- // If abspath is NULL, then we assume we're dealing with a dynamic image
47
- if ($abspath == null) {
48
- $params = $dynthumbs->get_params_from_name($size, true);
49
- $retval = $dynthumbs->get_image_url($image, $params);
50
- } else {
51
- $check_existance = FALSE;
52
- }
53
- }
54
- if ($retval == null) {
55
- $retval = $this->call_parent('get_image_url', $image, $size, $check_existance, $abspath);
56
- }
57
- // Try generating the thumbnail
58
- if ($retval == null) {
59
- $params = array('watermark' => false, 'reflection' => false, 'crop' => true);
60
- $result = $this->generate_image_size($image, $size, $params);
61
- if ($result) {
62
- $retval = $this->call_parent('get_image_url', $image, $size, $check_existance);
63
- }
64
- }
65
- return $retval;
66
- }
67
- function get_image_dimensions($image, $size = 'full')
68
- {
69
- $retval = $this->call_parent('get_image_dimensions', $image, $size);
70
- if ($retval == null) {
71
- $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance();
72
- if ($dynthumbs && $dynthumbs->is_size_dynamic($size)) {
73
- $new_dims = $this->object->calculate_image_size_dimensions($image, $size);
74
- $retval = array('width' => $new_dims['real_width'], 'height' => $new_dims['real_height']);
75
- }
76
- }
77
- return $retval;
78
- }
79
- function get_image_size_params($image, $size, $params = null, $skip_defaults = false)
80
- {
81
- $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance();
82
- if ($dynthumbs && $dynthumbs->is_size_dynamic($size)) {
83
- $named_params = $dynthumbs->get_params_from_name($size, true);
84
- foreach ($named_params as $param_name => $param_value) {
85
- $params[$param_name] = $param_value;
86
- }
87
- }
88
- return $this->call_parent('get_image_size_params', $image, $size, $params, $skip_defaults);
89
- }
90
- }
91
  /**
92
  * Class C_Dynamic_Thumbnails_Controller
93
  * @implements I_Dynamic_Thumbnails_Controller
@@ -139,7 +50,7 @@ class C_Dynamic_Thumbnails_Controller extends C_MVC_Controller
139
  $hash = wp_hash($uri_plain);
140
  if (strpos($uri, $hash) === false) {
141
  $valid = false;
142
- $filename = $this->object->find_static_file('invalid_image.png');
143
  $this->set_content_type('image/png');
144
  readfile($filename);
145
  $this->render();
@@ -150,369 +61,4 @@ class C_Dynamic_Thumbnails_Controller extends C_MVC_Controller
150
  }
151
  }
152
  }
153
- }
154
- class Mixin_Dynamic_Thumbnails_Manager extends Mixin
155
- {
156
- function get_route_name()
157
- {
158
- return C_NextGen_Settings::get_instance()->get('dynamic_thumbnail_slug');
159
- }
160
- function _get_params_sanitized($params)
161
- {
162
- if (isset($params['rotation'])) {
163
- $rotation = intval($params['rotation']);
164
- if ($rotation && in_array(abs($rotation), array(90, 180, 270))) {
165
- $rotation = $rotation % 360;
166
- if ($rotation < 0) {
167
- $rotation = 360 - $rotation;
168
- }
169
- $params['rotation'] = $rotation;
170
- } else {
171
- unset($params['rotation']);
172
- }
173
- }
174
- if (isset($params['flip'])) {
175
- $flip = strtolower($params['flip']);
176
- if (in_array($flip, array('h', 'v', 'hv'))) {
177
- $params['flip'] = $flip;
178
- } else {
179
- unset($params['flip']);
180
- }
181
- }
182
- return $params;
183
- }
184
- function get_uri_from_params($params)
185
- {
186
- $params = $this->object->_get_params_sanitized($params);
187
- $image = isset($params['image']) ? $params['image'] : null;
188
- $image_id = is_scalar($image) || is_null($image) ? (int) $image : $image->pid;
189
- $image_width = isset($params['width']) ? $params['width'] : null;
190
- $image_height = isset($params['height']) ? $params['height'] : null;
191
- $image_quality = isset($params['quality']) ? $params['quality'] : null;
192
- $image_type = isset($params['type']) ? $params['type'] : null;
193
- $image_crop = isset($params['crop']) ? $params['crop'] : null;
194
- $image_watermark = isset($params['watermark']) ? $params['watermark'] : null;
195
- $image_rotation = isset($params['rotation']) ? $params['rotation'] : null;
196
- $image_flip = isset($params['flip']) ? $params['flip'] : null;
197
- $image_reflection = isset($params['reflection']) ? $params['reflection'] : null;
198
- $uri = null;
199
- $uri .= '/';
200
- $uri .= $this->object->get_route_name() . '/';
201
- $uri .= strval($image_id) . '/';
202
- $uri .= strval($image_width) . 'x' . strval($image_height);
203
- if ($image_quality != null) {
204
- $uri .= 'x' . strval($image_quality);
205
- }
206
- $uri .= '/';
207
- if ($image_type != null) {
208
- $uri .= $image_type . '/';
209
- }
210
- if ($image_crop) {
211
- $uri .= 'crop/';
212
- }
213
- if ($image_watermark) {
214
- $uri .= 'watermark/';
215
- }
216
- if ($image_rotation) {
217
- $uri .= 'rotation-' . $image_rotation . '/';
218
- }
219
- if ($image_flip) {
220
- $uri .= 'flip-' . $image_flip . '/';
221
- }
222
- if ($image_reflection) {
223
- $uri .= 'reflection/';
224
- }
225
- return $uri;
226
- }
227
- function get_image_uri($image, $params)
228
- {
229
- $params['image'] = $image;
230
- $uri = $this->object->get_uri_from_params($params);
231
- if (substr($uri, -1) != '/') {
232
- $uri .= '/';
233
- }
234
- $uri .= wp_hash($uri) . '/';
235
- return $uri;
236
- }
237
- function get_image_url($image, $params)
238
- {
239
- return C_Router::get_instance()->get_url($this->object->get_image_uri($image, $params), FALSE, 'root');
240
- }
241
- function get_params_from_uri($uri)
242
- {
243
- $regex = '/\\/?' . $this->object->get_route_name() . '\\/(\\d+)(?:\\/(.*))?/';
244
- $match = null;
245
- // XXX move this URL clean up to I_Router?
246
- $uri = preg_replace('/\\/index.php\\//', '/', $uri, 1);
247
- $uri = trim($uri, '/');
248
- if (@preg_match($regex, $uri, $match) > 0) {
249
- $image_id = $match[1];
250
- $uri_args = isset($match[2]) ? explode('/', $match[2]) : array();
251
- $params = array('image' => $image_id);
252
- foreach ($uri_args as $uri_arg) {
253
- $uri_arg_set = explode('-', $uri_arg);
254
- $uri_arg_name = array_shift($uri_arg_set);
255
- $uri_arg_value = $uri_arg_set ? array_shift($uri_arg_set) : null;
256
- $size_match = null;
257
- if ($uri_arg == 'watermark') {
258
- $params['watermark'] = true;
259
- } else {
260
- if ($uri_arg_name == 'rotation') {
261
- $params['rotation'] = $uri_arg_value;
262
- } else {
263
- if ($uri_arg_name == 'flip') {
264
- $params['flip'] = $uri_arg_value;
265
- } else {
266
- if ($uri_arg == 'reflection') {
267
- $params['reflection'] = true;
268
- } else {
269
- if ($uri_arg == 'crop') {
270
- $params['crop'] = true;
271
- } else {
272
- if (in_array(strtolower($uri_arg), array('gif', 'jpg', 'png'))) {
273
- $params['type'] = $uri_arg;
274
- } else {
275
- if (preg_match('/(\\d+)x(\\d+)(?:x(\\d+))?/i', $uri_arg, $size_match) > 0) {
276
- $params['width'] = $size_match[1];
277
- $params['height'] = $size_match[2];
278
- if (isset($size_match[3])) {
279
- $params['quality'] = $size_match[3];
280
- }
281
- }
282
- }
283
- }
284
- }
285
- }
286
- }
287
- }
288
- }
289
- return $this->object->_get_params_sanitized($params);
290
- }
291
- return null;
292
- }
293
- function _get_name_prefix_list()
294
- {
295
- return array('id' => 'nggid0', 'size' => 'ngg0dyn-', 'flags' => '00f0', 'flag' => array('w0' => 'watermark', 'c0' => 'crop', 'r1' => 'rotation', 'f1' => 'flip', 'r0' => 'reflection', 't0' => 'type'), 'flag_len' => 2, 'max_value_length' => 15);
296
- }
297
- function get_name_from_params($params, $only_size_name = false, $id_in_name = true)
298
- {
299
- $prefix_list = $this->object->_get_name_prefix_list();
300
- $id_prefix = $prefix_list['id'];
301
- $size_prefix = $prefix_list['size'];
302
- $flags_prefix = $prefix_list['flags'];
303
- $flags = $prefix_list['flag'];
304
- $max_value_length = $prefix_list['max_value_length'];
305
- $params = $this->object->_get_params_sanitized($params);
306
- $image = isset($params['image']) ? $params['image'] : null;
307
- $image_width = isset($params['width']) ? $params['width'] : null;
308
- $image_height = isset($params['height']) ? $params['height'] : null;
309
- $image_quality = isset($params['quality']) ? $params['quality'] : null;
310
- $extension = null;
311
- $name = null;
312
- // if $only_size_name is false then we include the file name and image id for the image
313
- if (!$only_size_name) {
314
- if (is_int($image)) {
315
- $imap = C_Image_Mapper::get_instance();
316
- $image = $imap->find($image);
317
- }
318
- if ($image != null) {
319
- // this is used to remove the extension and then add it back at the end of the name
320
- $extension = M_I18n::mb_pathinfo($image->filename, PATHINFO_EXTENSION);
321
- if ($extension != null) {
322
- $extension = '.' . $extension;
323
- }
324
- $name .= M_I18n::mb_basename($image->filename);
325
- $name .= '-';
326
- if ($id_in_name) {
327
- $image_id = strval($image->pid);
328
- $id_len = min($max_value_length, strlen($image_id));
329
- $id_len_hex = dechex($id_len);
330
- // sanity check, should never occurr if $max_value_length is not messed up, ensure only 1 character is used to encode length or else skip parameter
331
- if (strlen($id_len_hex) == 1) {
332
- $name .= $id_prefix . $id_len . substr($image_id, 0, $id_len);
333
- $name .= '-';
334
- }
335
- }
336
- }
337
- }
338
- $name .= $size_prefix;
339
- $name .= strval($image_width) . 'x' . strval($image_height);
340
- if ($image_quality != null) {
341
- $name .= 'x' . $image_quality;
342
- }
343
- $name .= '-';
344
- $name .= $flags_prefix;
345
- foreach ($flags as $flag_prefix => $flag_name) {
346
- $flag_value = 0;
347
- if (isset($params[$flag_name])) {
348
- $flag_value = $params[$flag_name];
349
- if (!is_string($flag_value)) {
350
- // only strings or ints allowed, sprintf is required because intval(0) returns '' and not '0'
351
- $flag_value = intval($flag_value);
352
- $flag_value = sprintf('%d', $flag_value);
353
- }
354
- }
355
- $flag_value = strval($flag_value);
356
- $flag_len = min($max_value_length, strlen($flag_value));
357
- $flag_len_hex = dechex($flag_len);
358
- // sanity check, should never occurr if $max_value_length is not messed up, ensure only 1 character is used to encode length or else skip parameter
359
- if (strlen($flag_len_hex) == 1) {
360
- $name .= $flag_prefix . $flag_len . substr($flag_value, 0, $flag_len);
361
- }
362
- }
363
- $name .= $extension;
364
- return $name;
365
- }
366
- function get_size_name($params)
367
- {
368
- $name = $this->object->get_name_from_params($params, true);
369
- return $name;
370
- }
371
- function get_image_name($image, $params)
372
- {
373
- $params['image'] = $image;
374
- $name = $this->object->get_name_from_params($params);
375
- return $name;
376
- }
377
- function get_params_from_name($name, $is_only_size_name = false)
378
- {
379
- $prefix_list = $this->object->_get_name_prefix_list();
380
- $id_prefix = $prefix_list['id'];
381
- $size_prefix = $prefix_list['size'];
382
- $flags_prefix = $prefix_list['flags'];
383
- $max_value_length = $prefix_list['max_value_length'];
384
- $size_name = null;
385
- $id_name = null;
386
- $params = array();
387
- if (!$is_only_size_name) {
388
- $extension = M_I18n::mb_pathinfo($name, PATHINFO_EXTENSION);
389
- if ($extension != null) {
390
- $extension = '.' . $extension;
391
- }
392
- $name = M_I18n::mb_basename($name);
393
- }
394
- $size_index = strrpos($name, $size_prefix);
395
- if ($size_index > 0 || $size_index === 0) {
396
- // check if name contains dynamic size/params info by looking for prefix
397
- $size_name = substr($name, $size_index);
398
- }
399
- if (!$is_only_size_name) {
400
- // name should contain the image id, search for prefix
401
- $id_index = strrpos($name, $id_prefix);
402
- if ($id_index > 0 || $id_index === 0) {
403
- if ($size_index > 0 && $size_index > $id_index) {
404
- $id_name = substr($name, $id_index, $size_index - $id_index);
405
- } else {
406
- $id_name = substr($name, $id_index);
407
- }
408
- }
409
- }
410
- // Double check we got a correct dynamic size/params string
411
- if (substr($size_name, 0, strlen($size_prefix)) == $size_prefix) {
412
- $flags = $prefix_list['flag'];
413
- // get the length of the flag id (the key in the $flags array) in the string (how many characters to consume)
414
- $flag_id_len = $prefix_list['flag_len'];
415
- $params_str = substr($size_name, strlen($size_prefix));
416
- $params_parts = explode('-', $params_str);
417
- // $param_part is a single param, separated by '-'
418
- foreach ($params_parts as $param_part) {
419
- // Parse WxHxQ - Q=quality
420
- $param_size = explode('x', $param_part);
421
- $param_size_count = count($param_size);
422
- if (substr($param_part, 0, strlen($flags_prefix)) == $flags_prefix) {
423
- /* Set flags, using $flags keys as prefixes */
424
- // move string pointer up (after the main flags prefix)
425
- $param_flags = substr($param_part, strlen($flags_prefix));
426
- $param_flags_len = strlen($param_flags);
427
- $flags_todo = $flags;
428
- while (true) {
429
- // ensure we don't run into an infinite loop ;)
430
- if (count($flags_todo) == 0 || strlen($param_flags) == 0) {
431
- break;
432
- }
433
- // get the flag prefix (a key in the $flags array) using flag id length
434
- $flag_prefix = substr($param_flags, 0, $flag_id_len);
435
- // move string pointer up (after the single flag prefix)
436
- $param_flags = substr($param_flags, $flag_id_len);
437
- // get the length of the flag value in the string (how many characters to consume)
438
- // flag value length is stored in a single hexadecimal character next to the flag prefix
439
- $flag_value_len = min(hexdec(substr($param_flags, 0, 1)), min($max_value_length, strlen($param_flags) - 1));
440
- // get the flag value
441
- $flag_value = substr($param_flags, 1, $flag_value_len);
442
- // move string pointer up (after the entire flag)
443
- $param_flags = substr($param_flags, $flag_value_len + 1);
444
- // make sure the flag is supported
445
- if (isset($flags[$flag_prefix])) {
446
- $flag_name = $flags[$flag_prefix];
447
- if (is_numeric($flag_value)) {
448
- // convert numerical flags to integers
449
- $flag_value = intval($flag_value);
450
- }
451
- $params[$flag_name] = $flag_value;
452
- if (isset($flags_todo[$flag_prefix])) {
453
- unset($flags_todo[$flag_prefix]);
454
- }
455
- } else {
456
- // XXX unknown flag?
457
- }
458
- }
459
- } else {
460
- if ($param_size_count == 2 || $param_size_count == 3) {
461
- // Set W H Q
462
- $params['width'] = intval($param_size[0]);
463
- $params['height'] = intval($param_size[1]);
464
- if (isset($param_size[2]) && intval($param_size[2]) > 0) {
465
- $params['quality'] = intval($param_size[2]);
466
- }
467
- }
468
- }
469
- }
470
- }
471
- // Double check we got a correct id string
472
- if (substr($id_name, 0, strlen($id_prefix)) == $id_prefix) {
473
- // move string pointer up (after the prefix)
474
- $id_name = substr($id_name, strlen($id_prefix));
475
- // get the length of the image id in the string (how many characters to consume)
476
- $id_len = min(hexdec(substr($id_name, 0, 1)), min($max_value_length, strlen($id_name) - 1));
477
- // get the id based on old position and id length
478
- $image_id = intval(substr($id_name, 1, $id_len));
479
- if ($image_id > 0) {
480
- $params['image'] = $image_id;
481
- }
482
- }
483
- return $this->object->_get_params_sanitized($params);
484
- }
485
- function is_size_dynamic($name, $is_only_size_name = false)
486
- {
487
- $params = $this->object->get_params_from_name($name, $is_only_size_name);
488
- if (isset($params['width']) && isset($params['height'])) {
489
- return true;
490
- }
491
- return false;
492
- }
493
- }
494
- /**
495
- * Class C_Dynamic_Thumbnails_Manager
496
- * @mixin Mixin_Dynamic_Thumbnails_Manager
497
- */
498
- class C_Dynamic_Thumbnails_Manager extends C_Component
499
- {
500
- static $_instances = array();
501
- function define($context = FALSE)
502
- {
503
- parent::define($context);
504
- $this->implement('I_Dynamic_Thumbnails_Manager');
505
- $this->add_mixin('Mixin_Dynamic_Thumbnails_Manager');
506
- }
507
- /**
508
- * @param bool|string $context
509
- * @return C_Dynamic_Thumbnails_Manager
510
- */
511
- static function get_instance($context = False)
512
- {
513
- if (!isset(self::$_instances[$context])) {
514
- self::$_instances[$context] = new C_Dynamic_Thumbnails_Manager($context);
515
- }
516
- return self::$_instances[$context];
517
- }
518
  }
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * Class C_Dynamic_Thumbnails_Controller
4
  * @implements I_Dynamic_Thumbnails_Controller
50
  $hash = wp_hash($uri_plain);
51
  if (strpos($uri, $hash) === false) {
52
  $valid = false;
53
+ $filename = M_Static_Assets::get_static_abspath('photocrati-dynamic_thumbnails#invalid_image.png');
54
  $this->set_content_type('image/png');
55
  readfile($filename);
56
  $this->render();
61
  }
62
  }
63
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  }
products/photocrati_nextgen/modules/fs/module.fs.php CHANGED
@@ -19,7 +19,7 @@ class M_Fs extends C_Base_Module
19
  'photocrati-fs',
20
  'Filesystem',
21
  'Provides a filesystem abstraction layer for Pope modules',
22
- '3.0.0',
23
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
24
  'Imagely',
25
  'https://www.imagely.com'
19
  'photocrati-fs',
20
  'Filesystem',
21
  'Provides a filesystem abstraction layer for Pope modules',
22
+ '3.1.8',
23
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
24
  'Imagely',
25
  'https://www.imagely.com'
products/photocrati_nextgen/modules/fs/package.module.fs.php CHANGED
@@ -47,41 +47,11 @@ class Mixin_Fs_Instance_Methods extends Mixin
47
  * Returns a calculated path to a file
48
  * @param string $path
49
  * @param string|false $module (optional)
50
- * @param bool $relpath (optional)
51
- * @return string
52
- */
53
- function get_abspath($path, $module = FALSE, $relpath = FALSE)
54
- {
55
- // Wel'l assume that we're to calculate the path relative to
56
- // the site document root
57
- $retval = $path;
58
- if (strpos($path, $this->get_document_root()) === FALSE) {
59
- $retval = $this->join_paths($this->get_document_root(), $path);
60
- }
61
- // If a module is provided, then we should calculate the path
62
- // relative to the module directory
63
- if ($module) {
64
- if ($module_dir = $this->get_registry()->get_module_dir($module)) {
65
- $retval = $this->join_paths($module_dir, $path);
66
- } else {
67
- $retval = $this->join_path($this->get_document_root(), $module, $path);
68
- }
69
- }
70
- // Return the calculated path relative to the document root
71
- if ($relpath) {
72
- $retval = $this->object->remove_path_segment($retval, $this->get_document_root());
73
- }
74
- return $retval;
75
- }
76
- /**
77
- * Returns a calculated relpath to a particular file
78
- * @param string $path
79
- * @param string|false $module (optional)
80
  * @return string
81
  */
82
- function get_relpath($path, $module = FALSE)
83
  {
84
- return $this->object->get_abspath($path, $module, TRUE);
85
  }
86
  /**
87
  * Removes a path segment from a url or filesystem path
@@ -104,41 +74,25 @@ class Mixin_Fs_Instance_Methods extends Mixin
104
  * @param array $search_paths (optional)
105
  * @return string|NULL
106
  */
107
- function find_abspath($path, $module = FALSE, $relpath = FALSE, $search_paths = array())
108
  {
109
- $retval = NULL;
110
- // Ensure that we weren't passed a module id in the path
111
- if (!$module) {
112
- list($path, $module) = $this->object->parse_formatted_path($path);
113
- }
114
- if (@file_exists($path)) {
115
- $retval = $path;
116
- } else {
117
- // Ensure that we know where to search for the file
118
- if (!$search_paths) {
119
- $search_paths = $this->object->get_search_paths($path, $module);
120
- }
121
- // See if the file is located under one of the search paths directly
122
- foreach ($search_paths as $dir) {
123
- if (@file_exists($this->join_paths($dir, $path))) {
124
- $retval = $this->join_paths($dir, $path);
125
- break;
126
- }
127
- }
128
- // Use rglob to find the file
129
- if (!$retval) {
130
- foreach ($search_paths as $dir) {
131
- if ($retval = $this->object->_rglob($dir, $path)) {
132
- break;
133
- }
134
- }
135
- }
136
- // Return the relative path if we're to do so
137
- if ($relpath) {
138
- $retval = $this->object->remove_path_segment($retval, $this->get_document_root());
139
  }
140
  }
141
- return $retval;
 
 
 
 
 
 
 
142
  }
143
  /**
144
  * Returns a list of directories to search for a particular filename
@@ -245,6 +199,7 @@ class Mixin_Fs_Instance_Methods extends Mixin
245
  }
246
  /**
247
  * Joins multiple path segments together
 
248
  * @return string
249
  */
250
  function join_paths()
@@ -337,7 +292,7 @@ class Mixin_Fs_Instance_Methods extends Mixin
337
  break;
338
  case 'gallery':
339
  case 'galleries':
340
- $root_type = defined('NGG_GALLERY_ROOT_TYPE') ? NGG_GALLERY_ROOT_TYPE : 'site';
341
  if ($root_type == 'content') {
342
  $retval = WP_CONTENT_DIR;
343
  } else {
@@ -347,14 +302,10 @@ class Mixin_Fs_Instance_Methods extends Mixin
347
  default:
348
  $retval = $this->_document_root;
349
  }
350
- if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
351
- $retval = str_replace('/', DIRECTORY_SEPARATOR, $retval);
352
- }
353
- return $retval;
354
  }
355
  function get_absolute_path($path)
356
  {
357
- $path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path);
358
  $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');
359
  $absolutes = array();
360
  foreach ($parts as $part) {
@@ -367,7 +318,7 @@ class Mixin_Fs_Instance_Methods extends Mixin
367
  $absolutes[] = $part;
368
  }
369
  }
370
- return implode(DIRECTORY_SEPARATOR, $absolutes);
371
  }
372
  /**
373
  * Sets the document root for this application
47
  * Returns a calculated path to a file
48
  * @param string $path
49
  * @param string|false $module (optional)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  * @return string
51
  */
52
+ function get_abspath($path, $module = FALSE)
53
  {
54
+ return M_Static_Assets::get_static_abspath($path, $module);
55
  }
56
  /**
57
  * Removes a path segment from a url or filesystem path
74
  * @param array $search_paths (optional)
75
  * @return string|NULL
76
  */
77
+ function find_abspath($path, $module = FALSE)
78
  {
79
+ if (strpos($path, '#') !== FALSE) {
80
+ $parts = explode("#", $path);
81
+ if (count($parts) === 2) {
82
+ $path = $parts[1];
83
+ $module = $parts[0];
84
+ } else {
85
+ $path = $parts[0];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  }
87
  }
88
+ if (!$module) {
89
+ die(sprintf("find_abspath requires a path and module. Received %s and %s", $path, strval($module)));
90
+ }
91
+ $module_dir = C_Component_Registry::get_instance()->get_module_dir($module);
92
+ $path = preg_replace("#^/{1,2}#", "", $path, 1);
93
+ $retval = path_join($module_dir, $path);
94
+ // Adjust for windows paths
95
+ return wp_normalize_path($retval);
96
  }
97
  /**
98
  * Returns a list of directories to search for a particular filename
199
  }
200
  /**
201
  * Joins multiple path segments together
202
+ * @deprecated use path_join() instead when you can
203
  * @return string
204
  */
205
  function join_paths()
292
  break;
293
  case 'gallery':
294
  case 'galleries':
295
+ $root_type = NGG_GALLERY_ROOT_TYPE;
296
  if ($root_type == 'content') {
297
  $retval = WP_CONTENT_DIR;
298
  } else {
302
  default:
303
  $retval = $this->_document_root;
304
  }
305
+ return wp_normalize_path($retval);
 
 
 
306
  }
307
  function get_absolute_path($path)
308
  {
 
309
  $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');
310
  $absolutes = array();
311
  foreach ($parts as $part) {
318
  $absolutes[] = $part;
319
  }
320
  }
321
+ return wp_normalize_path(implode(DIRECTORY_SEPARATOR, $absolutes));
322
  }
323
  /**
324
  * Sets the document root for this application
products/photocrati_nextgen/modules/i18n/lang/nggallery-da_DK.po CHANGED
@@ -3499,10 +3499,10 @@ msgstr "Galleriet ID =%s findes ikke."
3499
  #. Description of the plugin
3500
  msgid ""
3501
  "The most popular gallery plugin for WordPress and one of the most popular "
3502
- "plugins of all time with over 24 million downloads."
3503
  msgstr ""
3504
  "Den mest populære galleri plugin til WordPress og et af de mest populære "
3505
- "plugins igennem tiden med over 24 millioner downloads."
3506
 
3507
  #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:290
3508
  msgid "The most powerful gallery system ever built for WordPress. "
3499
  #. Description of the plugin
3500
  msgid ""
3501
  "The most popular gallery plugin for WordPress and one of the most popular "
3502
+ "plugins of all time with over 25 million downloads."
3503
  msgstr ""
3504
  "Den mest populære galleri plugin til WordPress og et af de mest populære "
3505
+ "plugins igennem tiden med over 25 millioner downloads."
3506
 
3507
  #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:290
3508
  msgid "The most powerful gallery system ever built for WordPress. "
products/photocrati_nextgen/modules/i18n/lang/nggallery-sv_SE.po CHANGED
@@ -2431,8 +2431,8 @@ msgid "Server Settings"
2431
  msgstr "Serverinställningar"
2432
 
2433
  #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:97
2434
- msgid "NextGEN Gallery is one of the most popular WordPress plugins of all time with over 24 million downloads."
2435
- msgstr "NextGEN Gallery är en av de mest populära WordPress-tilläggen genom tiderna med över 24 miljoner nedladdningar."
2436
 
2437
  # Missed by NextGEN, translated string is displayed.
2438
  #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:97
@@ -3222,8 +3222,8 @@ msgid "https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/"
3222
  msgstr "https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/"
3223
 
3224
  #. Description of the plugin/theme
3225
- msgid "The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 24 million downloads."
3226
- msgstr "Det mest populära galleri-tillägget för WordPress och ett av de mest populära tillägg genom tiderna med över 24 miljoner nedladdningar."
3227
 
3228
  #. Author of the plugin/theme
3229
  msgid "Imagely"
2431
  msgstr "Serverinställningar"
2432
 
2433
  #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:97
2434
+ msgid "NextGEN Gallery is one of the most popular WordPress plugins of all time with over 25 million downloads."
2435
+ msgstr "NextGEN Gallery är en av de mest populära WordPress-tilläggen genom tiderna med över 25 miljoner nedladdningar."
2436
 
2437
  # Missed by NextGEN, translated string is displayed.
2438
  #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:97
3222
  msgstr "https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/"
3223
 
3224
  #. Description of the plugin/theme
3225
+ msgid "The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 25 million downloads."
3226
+ msgstr "Det mest populära galleri-tillägget för WordPress och ett av de mest populära tillägg genom tiderna med över 25 miljoner nedladdningar."
3227
 
3228
  #. Author of the plugin/theme
3229
  msgid "Imagely"
products/photocrati_nextgen/modules/i18n/lang/nggallery.po CHANGED
@@ -2446,7 +2446,7 @@ msgid "Server Settings"
2446
  msgstr ""
2447
 
2448
  #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:97
2449
- msgid "NextGEN Gallery is one of the most popular WordPress plugins of all time with over 24 million downloads."
2450
  msgstr ""
2451
 
2452
  #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:97
@@ -3231,7 +3231,7 @@ msgid "https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/"
3231
  msgstr ""
3232
 
3233
  #. Description of the plugin/theme
3234
- msgid "The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 24 million downloads."
3235
  msgstr ""
3236
 
3237
  #. Author of the plugin/theme
2446
  msgstr ""
2447
 
2448
  #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:97
2449
+ msgid "NextGEN Gallery is one of the most popular WordPress plugins of all time with over 25 million downloads."
2450
  msgstr ""
2451
 
2452
  #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:97
3231
  msgstr ""
3232
 
3233
  #. Description of the plugin/theme
3234
+ msgid "The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 25 million downloads."
3235
  msgstr ""
3236
 
3237
  #. Author of the plugin/theme
products/photocrati_nextgen/modules/i18n/module.i18n.php CHANGED
@@ -20,7 +20,7 @@ class M_I18N extends C_Base_Module
20
  'photocrati-i18n',
21
  'Internationalization',
22
  "Adds I18N resources and methods",
23
- '3.1.6',
24
  'https://www.imagely.com/languages/',
25
  'Imagely',
26
  'https://www.imagely.com'
@@ -47,11 +47,10 @@ class M_I18N extends C_Base_Module
47
 
48
  function register_translation_hooks()
49
  {
50
- $fs = C_Fs::get_instance();
51
  $dir = str_replace(
52
- $fs->get_document_root('plugins'),
53
- '',
54
- $fs->get_abspath('lang', 'photocrati-i18n')
55
  );
56
 
57
  // Load text domain
20
  'photocrati-i18n',
21
  'Internationalization',
22
  "Adds I18N resources and methods",
23
+ '3.1.8',
24
  'https://www.imagely.com/languages/',
25
  'Imagely',
26
  'https://www.imagely.com'
47
 
48
  function register_translation_hooks()
49
  {
 
50
  $dir = str_replace(
51
+ wp_normalize_path(WP_CONTENT_DIR),
52
+ "",
53
+ M_Static_Assets::get_static_abspath('photocrati-i18n#lang')
54
  );
55
 
56
  // Load text domain
products/photocrati_nextgen/modules/imagify/lib/class-imagify-partner.php CHANGED
@@ -833,7 +833,7 @@ if ( ! class_exists( 'Imagify_Partner' ) ) :
833
  return IMAGIFY_FILE;
834
  }
835
 
836
- return WP_PLUGIN_DIR . '/imagify/imagify.php';
837
  }
838
 
839
  /**
833
  return IMAGIFY_FILE;
834
  }
835
 
836
+ return wp_normalize_path(WP_PLUGIN_DIR . '/imagify/imagify.php');
837
  }
838
 
839
  /**
products/photocrati_nextgen/modules/imagify/module.imagify.php CHANGED
@@ -27,7 +27,7 @@ class M_Imagify extends C_Base_Module
27
  'photocrati-imagify',
28
  'NextGEN Imagify Integration',
29
  'NextGen Gallery / Imagify Integration',
30
- '3.1.0',
31
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
32
  'Imagely',
33
  'https://www.imagely.com'
27
  'photocrati-imagify',
28
  'NextGEN Imagify Integration',
29
  'NextGen Gallery / Imagify Integration',
30
+ '3.1.8',
31
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
32
  'Imagely',
33
  'https://www.imagely.com'
products/photocrati_nextgen/modules/mvc/module.mvc.php CHANGED
@@ -27,7 +27,7 @@ class M_MVC extends C_Base_Module
27
  'photocrati-mvc',
28
  'MVC Framework',
29
  'Provides an MVC architecture for the plugin to use',
30
- '3.1.0',
31
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery',
32
  'Imagely',
33
  'https://www.imagely.com'
@@ -57,7 +57,6 @@ class M_MVC extends C_Base_Module
57
  function _register_adapters()
58
  {
59
  $this->get_registry()->add_adapter('I_Fs', 'A_MVC_Fs');
60
- $this->get_registry()->add_adapter('I_Router', 'A_MVC_Router');
61
  $this->get_registry()->add_adapter('I_Component_Factory', 'A_MVC_Factory');
62
  }
63
 
@@ -66,7 +65,6 @@ class M_MVC extends C_Base_Module
66
  return array(
67
  'A_Mvc_Factory' => 'adapter.mvc_factory.php',
68
  'A_Mvc_Fs' => 'adapter.mvc_fs.php',
69
- 'A_Mvc_Router' => 'adapter.mvc_router.php',
70
  'C_Mvc_Installer' => 'class.mvc_installer.php',
71
  'C_Mvc_Controller' => 'class.mvc_controller.php',
72
  'C_Mvc_View' => 'class.mvc_view.php',
27
  'photocrati-mvc',
28
  'MVC Framework',
29
  'Provides an MVC architecture for the plugin to use',
30
+ '3.1.8',
31
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery',
32
  'Imagely',
33
  'https://www.imagely.com'
57
  function _register_adapters()
58
  {
59
  $this->get_registry()->add_adapter('I_Fs', 'A_MVC_Fs');
 
60
  $this->get_registry()->add_adapter('I_Component_Factory', 'A_MVC_Factory');
61
  }
62
 
65
  return array(
66
  'A_Mvc_Factory' => 'adapter.mvc_factory.php',
67
  'A_Mvc_Fs' => 'adapter.mvc_fs.php',
 
68
  'C_Mvc_Installer' => 'class.mvc_installer.php',
69
  'C_Mvc_Controller' => 'class.mvc_controller.php',
70
  'C_Mvc_View' => 'class.mvc_view.php',
products/photocrati_nextgen/modules/mvc/package.module.mvc.php CHANGED
@@ -42,6 +42,7 @@ class A_MVC_Fs extends Mixin
42
  * @param bool $relative (optional)
43
  * @param bool $found_root (optional)
44
  * @return string|NULL
 
45
  */
46
  function find_static_abspath($path, $module = FALSE, $relative = FALSE, &$found_root = FALSE)
47
  {
@@ -72,6 +73,7 @@ class A_MVC_Fs extends Mixin
72
  }
73
  // Create the absolute path to the file
74
  $path = $this->object->join_paths($mod_dir, C_NextGen_Settings::get_instance()->get('mvc_static_dirname'), $path);
 
75
  if ($relative) {
76
  $original_length = strlen($path);
77
  $roots = array('plugins', 'plugins_mu', 'templates', 'stylesheets');
@@ -104,123 +106,6 @@ class A_MVC_Fs extends Mixin
104
  }
105
  return $key;
106
  }
107
- /**
108
- * Gets the relative path to a static resource. If it doesn't exist, then NULL is returned
109
- *
110
- * @param string $path
111
- * @param string|false $module (optional)
112
- * @return string|NULL
113
- */
114
- function find_static_relpath($path, $module = FALSE)
115
- {
116
- return $this->object->find_static_abspath($path, $module, TRUE);
117
- }
118
- }
119
- /**
120
- * Class A_MVC_Router
121
- * @mixin C_Router
122
- * @adapts I_Router
123
- */
124
- class A_MVC_Router extends Mixin
125
- {
126
- static $_lookups = array();
127
- function initialize()
128
- {
129
- register_shutdown_function(array(&$this, 'cache_lookups'));
130
- self::$_lookups = C_Photocrati_Transient_Manager::fetch($this->_get_cache_key(), array());
131
- }
132
- function _get_cache_key()
133
- {
134
- return C_Photocrati_Transient_Manager::create_key('MVC', 'get_static_url');
135
- }
136
- function cache_lookups()
137
- {
138
- C_Photocrati_Transient_Manager::update($this->_get_cache_key(), self::$_lookups);
139
- }
140
- function _get_static_url_key($path, $module = FALSE)
141
- {
142
- $parts = array($path, $module, $this->object->get_base_url('plugins'), $this->object->get_base_url('plugins_mu'), $this->object->get_base_url('templates'), $this->object->get_base_url('stylesheets'));
143
- return implode('|', $parts);
144
- }
145
- /**
146
- * First tries to find the static file in the 'static' folder
147
- * @param string $path
148
- * @param string $module
149
- * @return string
150
- */
151
- function get_static_url($path, $module = FALSE)
152
- {
153
- $retval = NULL;
154
- $key = $this->object->_get_static_url_key($path, $module);
155
- // Have we looked up this url before?
156
- if (isset(self::$_lookups[$key])) {
157
- $retval = self::$_lookups[$key];
158
- }
159
- $fs = C_Fs::get_instance();
160
- // Check for a user-supplied override
161
- if (NULL === $retval) {
162
- $formatted_path = $fs->parse_formatted_path($path);
163
- $abspath = $fs->join_paths($this->object->get_static_override_dir($formatted_path[1]), $formatted_path[0]);
164
- if (@is_file($abspath)) {
165
- $abspath = str_replace($fs->get_document_root('content'), '', $abspath);
166
- $retval = self::$_lookups[$key] = $this->object->join_paths($this->object->get_base_url('content'), str_replace("\\", '/', $abspath));
167
- }
168
- }
169
- // We'll have to calculate the url from our own modules
170
- if (NULL === $retval) {
171
- $path = $fs->find_static_abspath($path, $module);
172
- $original_length = strlen($path);
173
- $roots = array('plugins', 'plugins_mu', 'templates', 'stylesheets');
174
- $found_root = FALSE;
175
- foreach ($roots as $root) {
176
- $path = str_replace($fs->get_document_root($root), '', $path);
177
- if (strlen($path) != $original_length) {
178
- $found_root = $root;
179
- break;
180
- }
181
- }
182
- // We found the root so we know what base url to prepend
183
- if ($found_root) {
184
- $retval = self::$_lookups[$key] = $this->object->join_paths($this->object->get_base_url($found_root), str_replace("\\", '/', $path));
185
- } else {
186
- $retval = self::$_lookups[$key] = $this->object->join_paths($this->object->get_base_url('root'), str_replace("\\", '/', $path));
187
- }
188
- }
189
- // For the "Sage" theme and others using the "Soil" plugin "Roots" theme was re-branded to "Sage" theme
190
- // 2015-02-25; see https://roots.io/new-website-sage-and-the-future/
191
- if ((current_theme_supports('soil-relative-urls') || current_theme_supports('root-relative-urls')) && strpos($retval, '/') !== 0) {
192
- $retval = '/' . $retval;
193
- }
194
- return $retval;
195
- }
196
- /**
197
- * @param string $module_id
198
- *
199
- * @return string $dir
200
- */
201
- function get_static_override_dir($module_id = NULL)
202
- {
203
- $fs = C_Fs::get_instance();
204
- $dir = $fs->join_paths(WP_CONTENT_DIR, 'ngg');
205
- if (!@file_exists($dir)) {
206
- wp_mkdir_p($dir);
207
- }
208
- $dir = $fs->join_paths($dir, 'modules');
209
- if (!@file_exists($dir)) {
210
- wp_mkdir_p($dir);
211
- }
212
- if ($module_id) {
213
- $dir = $fs->join_paths($dir, $module_id);
214
- if (!@file_exists($dir)) {
215
- wp_mkdir_p($dir);
216
- }
217
- $dir = $fs->join_paths($dir, 'static');
218
- if (!@file_exists($dir)) {
219
- wp_mkdir_p($dir);
220
- }
221
- }
222
- return $dir;
223
- }
224
  }
225
  if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) {
226
  die('You are not allowed to call this page directly.');
@@ -397,22 +282,11 @@ class Mixin_MVC_Controller_Instance_Methods extends Mixin
397
  * Gets the absolute path of a static resource
398
  * @param string $path
399
  * @param string|false $module (optional)
400
- * @param boolean $relative
401
- * @return string
402
- */
403
- function get_static_abspath($path, $module = FALSE, $relative = FALSE)
404
- {
405
- return C_Fs::get_instance()->find_static_abspath($path, $module);
406
- }
407
- /**
408
- * Gets the relative path of a static resource
409
- * @param string $path
410
- * @param string|false $module (optional)
411
  * @return string
412
  */
413
- function get_static_relpath($path, $module = FALSE)
414
  {
415
- return C_Fs::get_instance()->find_static_abspath($path, $module, TRUE);
416
  }
417
  /**
418
  * @param string $path
@@ -421,7 +295,7 @@ class Mixin_MVC_Controller_Instance_Methods extends Mixin
421
  */
422
  function get_static_url($path, $module = FALSE)
423
  {
424
- return C_Router::get_instance()->get_static_url($path, $module);
425
  }
426
  /**
427
  * Renders a template and outputs the response headers
42
  * @param bool $relative (optional)
43
  * @param bool $found_root (optional)
44
  * @return string|NULL
45
+ * @deprecated Use M_Static_Assets instead
46
  */
47
  function find_static_abspath($path, $module = FALSE, $relative = FALSE, &$found_root = FALSE)
48
  {
73
  }
74
  // Create the absolute path to the file
75
  $path = $this->object->join_paths($mod_dir, C_NextGen_Settings::get_instance()->get('mvc_static_dirname'), $path);
76
+ $path = wp_normalize_path($path);
77
  if ($relative) {
78
  $original_length = strlen($path);
79
  $roots = array('plugins', 'plugins_mu', 'templates', 'stylesheets');
106
  }
107
  return $key;
108
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  }
110
  if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) {
111
  die('You are not allowed to call this page directly.');
282
  * Gets the absolute path of a static resource
283
  * @param string $path
284
  * @param string|false $module (optional)
 
 
 
 
 
 
 
 
 
 
 
285
  * @return string
286
  */
287
+ function get_static_abspath($path, $module = FALSE)
288
  {
289
+ return M_Static_Assets::get_static_abspath($path, $module);
290
  }
291
  /**
292
  * @param string $path
295
  */
296
  function get_static_url($path, $module = FALSE)
297
  {
298
+ return M_Static_Assets::get_static_url($path, $module);
299
  }
300
  /**
301
  * Renders a template and outputs the response headers
products/photocrati_nextgen/modules/nextgen_addgallery_page/module.nextgen_addgallery_page.php CHANGED
@@ -22,7 +22,7 @@ class M_NextGen_AddGallery_Page extends C_Base_Module
22
  'photocrati-nextgen_addgallery_page',
23
  'NextGEN Add Gallery Page',
24
  'Provides admin page for adding a gallery and uploading images',
25
- '3.0.0',
26
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
27
  'Imagely',
28
  'https://www.imagely.com'
22
  'photocrati-nextgen_addgallery_page',
23
  'NextGEN Add Gallery Page',
24
  'Provides admin page for adding a gallery and uploading images',
25
+ '3.1.8',
26
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
27
  'Imagely',
28
  'https://www.imagely.com'
products/photocrati_nextgen/modules/nextgen_addgallery_page/package.module.nextgen_addgallery_page.php CHANGED
@@ -19,7 +19,7 @@ class A_Import_Folder_Form extends Mixin
19
  }
20
  function render()
21
  {
22
- return $this->object->render_partial('photocrati-nextgen_addgallery_page#import_folder', array('browse_sec_token' => C_WordPress_Security_Manager::get_instance()->get_request_token('nextgen_upload_image'), 'import_sec_token' => C_WordPress_Security_Manager::get_instance()->get_request_token('nextgen_upload_image')), TRUE);
23
  }
24
  }
25
  /**
@@ -39,10 +39,7 @@ class A_Import_Media_Library_Form extends Mixin
39
  wp_enqueue_script('nextgen_media_library_import-js');
40
  wp_enqueue_style('nextgen_media_library_import-css');
41
  $url = admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid={gid}';
42
- $i18n_array = array('admin_url' => admin_url(), 'title' => __('Import Images into NextGen Gallery', 'nggallery'), 'import_multiple' => __('Import %s images', 'nggallery'), 'import_singular' => __('Import 1 image', 'nggallery'), 'imported_multiple' => sprintf(__('{count} images were uploaded successfully. <a href="%s" target="_blank">Manage gallery</a>', 'nggallery'), $url), 'imported_singular' => sprintf(__('1 image was uploaded successfully. <a href="%s" target="_blank">Manage gallery</a>', 'nggallery'), $url), 'imported_none' => __('0 images were uploaded', 'nggallery'), 'progress_title' => __('Importing gallery', 'nggallery'), 'in_progress' => __('In Progress...', 'nggallery'), 'gritter_title' => __('Upload complete. Great job!', 'nggallery'), 'gritter_error' => __('Oops! Sorry, but an error occured. This may be due to a server misconfiguration. Check your PHP error log or ask your hosting provider for assistance.', 'nggallery'));
43
- foreach (C_WordPress_Security_Manager::get_instance()->get_request_token('nextgen_upload_image')->get_request_list() as $name => $value) {
44
- $i18n_array['sectoken'][$name] = $value;
45
- }
46
  wp_localize_script('nextgen_media_library_import-js', 'ngg_importml_i18n', $i18n_array);
47
  }
48
  function render()
@@ -52,16 +49,14 @@ class A_Import_Media_Library_Form extends Mixin
52
  }
53
  function get_galleries()
54
  {
55
- $security = $this->get_registry()->get_utility('I_Security_Manager');
56
- $sec_actor = $security->get_current_actor();
57
  $galleries = array();
58
- if ($sec_actor->is_allowed('nextgen_edit_gallery')) {
59
  $galleries = C_Gallery_Mapper::get_instance()->find_all();
60
- if (!$sec_actor->is_allowed('nextgen_edit_gallery_unowned')) {
61
  $galleries_all = $galleries;
62
  $galleries = array();
63
  foreach ($galleries_all as $gallery) {
64
- if ($sec_actor->is_user() && $sec_actor->get_entity_id() == (int) $gallery->author) {
65
  $galleries[] = $gallery;
66
  }
67
  }
@@ -126,22 +121,22 @@ class A_NextGen_AddGallery_Ajax extends Mixin
126
  } else {
127
  $retval['error'] = __('Failed to extract images from ZIP', 'nggallery');
128
  }
129
- } elseif ($image = $storage->upload_image($gallery_id)) {
130
- $retval['image_ids'] = array($image->id());
131
  $retval['image_errors'] = array();
132
  // check if image was resized correctly
133
  if ($settings->imgAutoResize) {
134
- $image_path = $storage->get_full_abspath($image);
135
  $image_thumb = new C_NggLegacy_Thumbnail($image_path, true);
136
  if ($image_thumb->error) {
137
- $retval['image_errors'][] = array('id' => $image->id(), 'error' => sprintf(__('Automatic image resizing failed [%1$s].', 'nggallery'), $image_thumb->errmsg));
138
  $image_thumb = null;
139
  }
140
  }
141
  // check if thumb was generated correctly
142
- $thumb_path = $storage->get_thumb_abspath($image);
143
  if (!file_exists($thumb_path)) {
144
- $retval['image_errors'][] = array('id' => $image->id(), 'error' => __('Thumbnail generation failed.', 'nggallery'));
145
  }
146
  } else {
147
  $retval['error'] = __('Image generation failed', 'nggallery');
@@ -161,6 +156,9 @@ class A_NextGen_AddGallery_Ajax extends Mixin
161
  }
162
  }
163
  } else {
 
 
 
164
  $retval['error'] = __("No permissions to upload images. Try refreshing the page or ensuring that your user account has sufficient roles/privileges.", 'nggallery');
165
  $error = TRUE;
166
  }
@@ -224,7 +222,7 @@ class A_NextGen_AddGallery_Ajax extends Mixin
224
  function import_folder_action()
225
  {
226
  $retval = array();
227
- if ($this->validate_ajax_request('nextgen_upload_image', TRUE)) {
228
  if ($folder = $this->param('folder')) {
229
  $storage = C_Gallery_Storage::get_instance();
230
  $fs = C_Fs::get_instance();
@@ -267,7 +265,7 @@ class A_NextGen_AddGallery_Ajax extends Mixin
267
  $gallery_mapper = C_Gallery_Mapper::get_instance();
268
  $image_mapper = C_Image_Mapper::get_instance();
269
  $attachment_ids = $this->param('attachment_ids');
270
- if ($this->validate_ajax_request('nextgen_upload_image', TRUE)) {
271
  if (empty($attachment_ids) || !is_array($attachment_ids)) {
272
  $retval['error'] = __('An unexpected error occured.', 'nggallery');
273
  }
@@ -297,10 +295,10 @@ class A_NextGen_AddGallery_Ajax extends Mixin
297
  $retval['error'] = __('Image generation failed', 'nggallery');
298
  break;
299
  }
300
- $image = $storage->upload_base64_image($gallery_id, $file_data, $file_name);
301
  if ($image) {
302
  // Potentially import metadata from WordPress
303
- $image = $image_mapper->find($image->id());
304
  if (!empty($attachment->post_excerpt)) {
305
  $image->alttext = $attachment->post_excerpt;
306
  }
@@ -309,11 +307,11 @@ class A_NextGen_AddGallery_Ajax extends Mixin
309
  }
310
  $image = apply_filters('ngg_medialibrary_imported_image', $image, $attachment);
311
  $image_mapper->save($image);
 
312
  } else {
313
  $retval['error'] = __('Image generation failed', 'nggallery');
314
  break;
315
  }
316
- $retval['image_ids'][] = $image->{$image->id_field};
317
  } catch (E_NggErrorException $ex) {
318
  $retval['error'] = $ex->getMessage();
319
  if ($created_gallery) {
@@ -406,7 +404,7 @@ class A_Upload_Images_Form extends Mixin
406
  $fs = C_Fs::get_instance();
407
  $router = C_Router::get_instance();
408
  $locale = get_locale();
409
- $dir = $fs->find_static_abspath('photocrati-nextgen_addgallery_page#plupload-2.1.1/i18n') . DIRECTORY_SEPARATOR;
410
  $tmp = explode('_', $locale, 2);
411
  $retval = FALSE;
412
  if (file_exists($dir . $tmp[0] . '.js')) {
@@ -417,7 +415,7 @@ class A_Upload_Images_Form extends Mixin
417
  }
418
  }
419
  if ($retval) {
420
- $retval = $router->get_static_url('photocrati-nextgen_addgallery_page#plupload-2.1.1/i18n/' . $retval . '.js');
421
  }
422
  return $retval;
423
  }
@@ -434,7 +432,7 @@ class A_Upload_Images_Form extends Mixin
434
  }
435
  function render()
436
  {
437
- return $this->object->render_partial('photocrati-nextgen_addgallery_page#upload_images', array('plupload_options' => json_encode($this->object->get_plupload_options()), 'galleries' => $this->object->get_galleries(), 'sec_token' => C_WordPress_Security_Manager::get_instance()->get_request_token('nextgen_upload_image')), TRUE);
438
  }
439
  function get_plupload_options()
440
  {
@@ -468,17 +466,15 @@ class A_Upload_Images_Form extends Mixin
468
  }
469
  function get_galleries()
470
  {
471
- $security = $this->get_registry()->get_utility('I_Security_Manager');
472
- $sec_actor = $security->get_current_actor();
473
  $galleries = array();
474
- if ($sec_actor->is_allowed('nextgen_edit_gallery')) {
475
  $gallery_mapper = C_Gallery_Mapper::get_instance();
476
  $galleries = $gallery_mapper->find_all();
477
- if (!$sec_actor->is_allowed('nextgen_edit_gallery_unowned')) {
478
  $galleries_all = $galleries;
479
  $galleries = array();
480
  foreach ($galleries_all as $gallery) {
481
- if ($sec_actor->is_user() && $sec_actor->get_entity_id() == (int) $gallery->author) {
482
  $galleries[] = $gallery;
483
  }
484
  }
19
  }
20
  function render()
21
  {
22
+ return $this->object->render_partial('photocrati-nextgen_addgallery_page#import_folder', array('browse_nonce' => M_Security::create_nonce('nextgen_upload_image'), 'import_nonce' => M_Security::create_nonce('nextgen_upload_image')), TRUE);
23
  }
24
  }
25
  /**
39
  wp_enqueue_script('nextgen_media_library_import-js');
40
  wp_enqueue_style('nextgen_media_library_import-css');
41
  $url = admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid={gid}';
42
+ $i18n_array = array('admin_url' => admin_url(), 'title' => __('Import Images into NextGen Gallery', 'nggallery'), 'import_multiple' => __('Import %s images', 'nggallery'), 'import_singular' => __('Import 1 image', 'nggallery'), 'imported_multiple' => sprintf(__('{count} images were uploaded successfully. <a href="%s" target="_blank">Manage gallery</a>', 'nggallery'), $url), 'imported_singular' => sprintf(__('1 image was uploaded successfully. <a href="%s" target="_blank">Manage gallery</a>', 'nggallery'), $url), 'imported_none' => __('0 images were uploaded', 'nggallery'), 'progress_title' => __('Importing gallery', 'nggallery'), 'in_progress' => __('In Progress...', 'nggallery'), 'gritter_title' => __('Upload complete. Great job!', 'nggallery'), 'gritter_error' => __('Oops! Sorry, but an error occured. This may be due to a server misconfiguration. Check your PHP error log or ask your hosting provider for assistance.', 'nggallery'), 'nonce' => M_Security::create_nonce('nextgen_upload_image'));
 
 
 
43
  wp_localize_script('nextgen_media_library_import-js', 'ngg_importml_i18n', $i18n_array);
44
  }
45
  function render()
49
  }
50
  function get_galleries()
51
  {
 
 
52
  $galleries = array();
53
+ if (M_Security::is_allowed('nextgen_edit_gallery')) {
54
  $galleries = C_Gallery_Mapper::get_instance()->find_all();
55
+ if (!M_Security::is_allowed('nextgen_edit_gallery_unowned')) {
56
  $galleries_all = $galleries;
57
  $galleries = array();
58
  foreach ($galleries_all as $gallery) {
59
+ if (wp_get_current_user()->ID == (int) $gallery->author) {
60
  $galleries[] = $gallery;
61
  }
62
  }
121
  } else {
122
  $retval['error'] = __('Failed to extract images from ZIP', 'nggallery');
123
  }
124
+ } elseif ($image_id = $storage->upload_image($gallery_id)) {
125
+ $retval['image_ids'] = array($image_id);
126
  $retval['image_errors'] = array();
127
  // check if image was resized correctly
128
  if ($settings->imgAutoResize) {
129
+ $image_path = $storage->get_full_abspath($image_id);
130
  $image_thumb = new C_NggLegacy_Thumbnail($image_path, true);
131
  if ($image_thumb->error) {
132
+ $retval['image_errors'][] = array('id' => $image_id, 'error' => sprintf(__('Automatic image resizing failed [%1$s].', 'nggallery'), $image_thumb->errmsg));
133
  $image_thumb = null;
134
  }
135
  }
136
  // check if thumb was generated correctly
137
+ $thumb_path = $storage->get_thumb_abspath($image_id);
138
  if (!file_exists($thumb_path)) {
139
+ $retval['image_errors'][] = array('id' => $image_id, 'error' => __('Thumbnail generation failed.', 'nggallery'));
140
  }
141
  } else {
142
  $retval['error'] = __('Image generation failed', 'nggallery');
156
  }
157
  }
158
  } else {
159
+ $action = 'nextgen_upload_image';
160
+ $retval['allowed'] = M_Security::is_allowed($action);
161
+ $retval['verified_token'] = !$_REQUEST['nonce'] || wp_verify_nonce($_REQUEST['nonce'], $action);
162
  $retval['error'] = __("No permissions to upload images. Try refreshing the page or ensuring that your user account has sufficient roles/privileges.", 'nggallery');
163
  $error = TRUE;
164
  }
222
  function import_folder_action()
223
  {
224
  $retval = array();
225
+ if ($this->validate_ajax_request('nextgen_upload_image', $_REQUEST['nonce'])) {
226
  if ($folder = $this->param('folder')) {
227
  $storage = C_Gallery_Storage::get_instance();
228
  $fs = C_Fs::get_instance();
265
  $gallery_mapper = C_Gallery_Mapper::get_instance();
266
  $image_mapper = C_Image_Mapper::get_instance();
267
  $attachment_ids = $this->param('attachment_ids');
268
+ if ($this->validate_ajax_request('nextgen_upload_image', $_REQUEST['nonce'])) {
269
  if (empty($attachment_ids) || !is_array($attachment_ids)) {
270
  $retval['error'] = __('An unexpected error occured.', 'nggallery');
271
  }
295
  $retval['error'] = __('Image generation failed', 'nggallery');
296
  break;
297
  }
298
+ $image = $storage->upload_image($gallery_id, $file_name, $file_data);
299
  if ($image) {
300
  // Potentially import metadata from WordPress
301
+ $image = $image_mapper->find($image);
302
  if (!empty($attachment->post_excerpt)) {
303
  $image->alttext = $attachment->post_excerpt;
304
  }
307
  }
308
  $image = apply_filters('ngg_medialibrary_imported_image', $image, $attachment);
309
  $image_mapper->save($image);
310
+ $retval['image_ids'][] = $image->{$image->id_field};
311
  } else {
312
  $retval['error'] = __('Image generation failed', 'nggallery');
313
  break;
314
  }
 
315
  } catch (E_NggErrorException $ex) {
316
  $retval['error'] = $ex->getMessage();
317
  if ($created_gallery) {
404
  $fs = C_Fs::get_instance();
405
  $router = C_Router::get_instance();
406
  $locale = get_locale();
407
+ $dir = M_Static_Assets::get_static_abspath('photocrati-nextgen_addgallery_page#plupload-2.1.1/i18n');
408
  $tmp = explode('_', $locale, 2);
409
  $retval = FALSE;
410
  if (file_exists($dir . $tmp[0] . '.js')) {
415
  }
416
  }
417
  if ($retval) {
418
+ $retval = M_Static_Assets::get_static_url('photocrati-nextgen_addgallery_page#plupload-2.1.1/i18n/' . $retval . '.js');
419
  }
420
  return $retval;
421
  }
432
  }
433
  function render()
434
  {
435
+ return $this->object->render_partial('photocrati-nextgen_addgallery_page#upload_images', array('plupload_options' => json_encode($this->object->get_plupload_options()), 'galleries' => $this->object->get_galleries(), 'nonce' => M_Security::create_nonce('nextgen_upload_image')), TRUE);
436
  }
437
  function get_plupload_options()
438
  {
466
  }
467
  function get_galleries()
468
  {
 
 
469
  $galleries = array();
470
+ if (M_Security::is_allowed('nextgen_edit_gallery')) {
471
  $gallery_mapper = C_Gallery_Mapper::get_instance();
472
  $galleries = $gallery_mapper->find_all();
473
+ if (!M_Security::is_allowed('nextgen_edit_gallery_unowned')) {
474
  $galleries_all = $galleries;
475
  $galleries = array();
476
  foreach ($galleries_all as $gallery) {
477
+ if (wp_get_current_user()->ID == (int) $gallery->author) {
478
  $galleries[] = $gallery;
479
  }
480
  }
products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.js CHANGED
@@ -53,10 +53,6 @@
53
  ngg_importml.methods.import.params.gallery_id = ngg_importml.methods.urlencode(ngg_importml.selectors.gallery_select.val());
54
  ngg_importml.methods.import.params.gallery_name = ngg_importml.methods.urlencode(ngg_importml.selectors.gallery_name.val());
55
 
56
- Object.keys(ngg_importml_i18n.sectoken).forEach(function(key) {
57
- ngg_importml.methods.import.params[key] = ngg_importml_i18n.sectoken[key];
58
- });
59
-
60
  ngg_importml.progress_bar = $.nggProgressBar({
61
  title: ngg_importml_i18n.progress_title,
62
  infinite: true,
@@ -97,6 +93,7 @@
97
 
98
  send_ajax: function() {
99
  var params = ngg_importml.methods.import.params;
 
100
  params.attachment_ids = [ngg_importml.import_ids.pop()];
101
 
102
  $.post(photocrati_ajax.url, params, function(data) {
53
  ngg_importml.methods.import.params.gallery_id = ngg_importml.methods.urlencode(ngg_importml.selectors.gallery_select.val());
54
  ngg_importml.methods.import.params.gallery_name = ngg_importml.methods.urlencode(ngg_importml.selectors.gallery_name.val());
55
 
 
 
 
 
56
  ngg_importml.progress_bar = $.nggProgressBar({
57
  title: ngg_importml_i18n.progress_title,
58
  infinite: true,
93
 
94
  send_ajax: function() {
95
  var params = ngg_importml.methods.import.params;
96
+ params.nonce = ngg_importml_i18n.nonce;
97
  params.attachment_ids = [ngg_importml.import_ids.pop()];
98
 
99
  $.post(photocrati_ajax.url, params, function(data) {
products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={ml_data:null,import_ids:[],selectors:{ml_btn_import:e("#ngg-importML-selected-image-import"),ml_btn_select:e("#ngg-importML-select-opener"),gallery_select:e("#ngg-importML-gallery-id"),gallery_name:e("#ngg-importML-gallery-name")},initialize:function(){this.methods.initialize(),this.methods.set_events()},methods:{initialize:function(){t.ml_dialog=top.wp.media.frames.ngg_importml=top.wp.media({multiple:!0,title:ngg_importml_i18n.title,button:{text:ngg_importml_i18n.button_text}})},urlencode:function(e){return e=(e+"").toString(),encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")},import:{import_count:0,params:{action:"import_media_library"},start:function(){t.selectors.ml_btn_import.attr("disabled",!0),t.selectors.ml_btn_select.attr("disabled",!0),t.methods.import.params.gallery_id=t.methods.urlencode(t.selectors.gallery_select.val()),t.methods.import.params.gallery_name=t.methods.urlencode(t.selectors.gallery_name.val()),Object.keys(ngg_importml_i18n.sectoken).forEach(function(e){t.methods.import.params[e]=ngg_importml_i18n.sectoken[e]}),t.progress_bar=e.nggProgressBar({title:ngg_importml_i18n.progress_title,infinite:!0,starting_value:ngg_importml_i18n.in_progress}),e(t).trigger("send_ajax")},done:function(){t.progress_bar.close(100),t.selectors.ml_btn_import.attr("disabled",!1),t.selectors.ml_btn_select.attr("disabled",!1);var l=ngg_importml_i18n.imported_multiple;1==t.methods.import.import_count&&(l=ngg_importml_i18n.imported_singular),l=l.replace("{gid}",t.methods.import.params.gallery_id),l=l.replace("{count}",t.methods.import.import_count),delete t.methods.import.params.gallery_id,delete t.methods.import.params.gallery_name,e.gritter.add({title:ngg_importml_i18n.gritter_title,text:l,sticky:!0}),t.methods.import.import_count=0,t.ml_dialog.trigger("reset"),t.import_ids=[],t.selectors.ml_btn_import.fadeOut()},send_ajax:function(){var l=t.methods.import.params;l.attachment_ids=[t.import_ids.pop()],e.post(photocrati_ajax.url,l,function(l){if(void 0===l.error){if(t.methods.import.import_count++,0==t.selectors.gallery_select.find('option[value="'+l.gallery_id+'"]').length){t.methods.import.params.gallery_id=l.gallery_id;var r=e("<option/>").attr("value",l.gallery_id).html(l.gallery_name);t.selectors.gallery_select.append(r),t.selectors.gallery_select.val(l.gallery_id),r.prop("selected",!0),t.selectors.gallery_name.val("").fadeOut()}}else e.gritter.add({title:ngg_importml_i18n.gritter_error,text:l.error,sticky:!0});0==t.import_ids.length?t.methods.import.done():e(t).trigger("send_ajax")},"json")}},set_events:function(){e(t).on("send_ajax",function(){t.methods.import.send_ajax()}),t.ml_dialog.on("select",function(){t.import_ids=[],t.ml_data=t.ml_dialog.state().get("selection"),t.ml_data.map(function(e){e=e.toJSON(),t.import_ids.push(e.id)});var e=ngg_importml_i18n.import_multiple.replace("%s",t.import_ids.length);1==t.import_ids.length&&(e=ngg_importml_i18n.import_singular),t.selectors.ml_btn_import.html(e),t.selectors.ml_btn_import.fadeIn()}),t.selectors.ml_btn_select.on("click",function(e){e.preventDefault(),t.ml_dialog.open()}),t.selectors.ml_btn_import.on("click",function(e){e.preventDefault(),t.methods.import.start()}),t.selectors.gallery_select.on("change",function(){0==parseInt(this.value)?(t.selectors.gallery_name.fadeIn().focus(),0==t.selectors.gallery_name.val().length&&(t.selectors.ml_btn_import.fadeOut(),t.selectors.ml_btn_select.fadeOut())):t.selectors.gallery_name.fadeOut(400,function(){t.selectors.gallery_select.focus(),t.selectors.ml_btn_select.fadeIn(),t.import_ids.length>0&&t.selectors.ml_btn_import.fadeIn()})}),t.selectors.gallery_name.on("keyup",function(){t.selectors.gallery_name.val().length>0?(t.selectors.gallery_name.removeClass("error"),t.selectors.ml_btn_select.fadeIn(),t.import_ids.length>0&&t.selectors.ml_btn_import.fadeIn()):(t.selectors.ml_btn_import.fadeOut(),t.selectors.ml_btn_select.fadeOut())})}}};e(document).ready(function(){window.ngg_importml=t,t.initialize(),window.Frame_Event_Publisher.broadcast()})}(jQuery);
1
+ !function(e){var t={ml_data:null,import_ids:[],selectors:{ml_btn_import:e("#ngg-importML-selected-image-import"),ml_btn_select:e("#ngg-importML-select-opener"),gallery_select:e("#ngg-importML-gallery-id"),gallery_name:e("#ngg-importML-gallery-name")},initialize:function(){this.methods.initialize(),this.methods.set_events()},methods:{initialize:function(){t.ml_dialog=top.wp.media.frames.ngg_importml=top.wp.media({multiple:!0,title:ngg_importml_i18n.title,button:{text:ngg_importml_i18n.button_text}})},urlencode:function(e){return e=(e+"").toString(),encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")},import:{import_count:0,params:{action:"import_media_library"},start:function(){t.selectors.ml_btn_import.attr("disabled",!0),t.selectors.ml_btn_select.attr("disabled",!0),t.methods.import.params.gallery_id=t.methods.urlencode(t.selectors.gallery_select.val()),t.methods.import.params.gallery_name=t.methods.urlencode(t.selectors.gallery_name.val()),t.progress_bar=e.nggProgressBar({title:ngg_importml_i18n.progress_title,infinite:!0,starting_value:ngg_importml_i18n.in_progress}),e(t).trigger("send_ajax")},done:function(){t.progress_bar.close(100),t.selectors.ml_btn_import.attr("disabled",!1),t.selectors.ml_btn_select.attr("disabled",!1);var l=ngg_importml_i18n.imported_multiple;1==t.methods.import.import_count&&(l=ngg_importml_i18n.imported_singular),l=l.replace("{gid}",t.methods.import.params.gallery_id),l=l.replace("{count}",t.methods.import.import_count),delete t.methods.import.params.gallery_id,delete t.methods.import.params.gallery_name,e.gritter.add({title:ngg_importml_i18n.gritter_title,text:l,sticky:!0}),t.methods.import.import_count=0,t.ml_dialog.trigger("reset"),t.import_ids=[],t.selectors.ml_btn_import.fadeOut()},send_ajax:function(){var l=t.methods.import.params;l.nonce=ngg_importml_i18n.nonce,l.attachment_ids=[t.import_ids.pop()],e.post(photocrati_ajax.url,l,function(l){if(void 0===l.error){if(t.methods.import.import_count++,0==t.selectors.gallery_select.find('option[value="'+l.gallery_id+'"]').length){t.methods.import.params.gallery_id=l.gallery_id;var r=e("<option/>").attr("value",l.gallery_id).html(l.gallery_name);t.selectors.gallery_select.append(r),t.selectors.gallery_select.val(l.gallery_id),r.prop("selected",!0),t.selectors.gallery_name.val("").fadeOut()}}else e.gritter.add({title:ngg_importml_i18n.gritter_error,text:l.error,sticky:!0});0==t.import_ids.length?t.methods.import.done():e(t).trigger("send_ajax")},"json")}},set_events:function(){e(t).on("send_ajax",function(){t.methods.import.send_ajax()}),t.ml_dialog.on("select",function(){t.import_ids=[],t.ml_data=t.ml_dialog.state().get("selection"),t.ml_data.map(function(e){e=e.toJSON(),t.import_ids.push(e.id)});var e=ngg_importml_i18n.import_multiple.replace("%s",t.import_ids.length);1==t.import_ids.length&&(e=ngg_importml_i18n.import_singular),t.selectors.ml_btn_import.html(e),t.selectors.ml_btn_import.fadeIn()}),t.selectors.ml_btn_select.on("click",function(e){e.preventDefault(),t.ml_dialog.open()}),t.selectors.ml_btn_import.on("click",function(e){e.preventDefault(),t.methods.import.start()}),t.selectors.gallery_select.on("change",function(){0==parseInt(this.value)?(t.selectors.gallery_name.fadeIn().focus(),0==t.selectors.gallery_name.val().length&&(t.selectors.ml_btn_import.fadeOut(),t.selectors.ml_btn_select.fadeOut())):t.selectors.gallery_name.fadeOut(400,function(){t.selectors.gallery_select.focus(),t.selectors.ml_btn_select.fadeIn(),t.import_ids.length>0&&t.selectors.ml_btn_import.fadeIn()})}),t.selectors.gallery_name.on("keyup",function(){t.selectors.gallery_name.val().length>0?(t.selectors.gallery_name.removeClass("error"),t.selectors.ml_btn_select.fadeIn(),t.import_ids.length>0&&t.selectors.ml_btn_import.fadeIn()):(t.selectors.ml_btn_import.fadeOut(),t.selectors.ml_btn_select.fadeOut())})}}};e(document).ready(function(){window.ngg_importml=t,t.initialize(),window.Frame_Event_Publisher.broadcast()})}(jQuery);
products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php CHANGED
@@ -20,7 +20,10 @@
20
  else return;
21
 
22
  // Post params
23
- var browse_params = <?php echo $browse_sec_token->get_json() ?>;
 
 
 
24
  browse_params.action = 'browse_folder';
25
 
26
  // Render file browser
@@ -52,11 +55,13 @@
52
  });
53
 
54
  // Start importing process
55
- var post_params = <?php echo $import_sec_token->get_json()?>;
56
- post_params.action = 'import_folder';
57
- post_params.folder = selected_folder;
58
- post_params.keep_location = $('#import_keep_location').is(":checked") ? 'on' : 'off';
59
- post_params.gallery_title = $('#import_gallery_title').val();
 
 
60
 
61
  $.post(photocrati_ajax.url, post_params, function(response){
62
  if (typeof(response) != 'object') response = JSON.parse(response);
20
  else return;
21
 
22
  // Post params
23
+ var browse_params = {
24
+ action: 'browser_folder',
25
+ nonce: '<?php echo $browse_nonce ?>'
26
+ };
27
  browse_params.action = 'browse_folder';
28
 
29
  // Render file browser
55
  });
56
 
57
  // Start importing process
58
+ var post_params = {
59
+ nonce: '<?php echo $import_nonce ?>',
60
+ action: "import_folder",
61
+ folder: selected_folder,
62
+ keep_location: $('#import_keep_location').is(":checked") ? 'on' : 'off',
63
+ gallery_title: $('#import_gallery_title').val()
64
+ }
65
 
66
  $.post(photocrati_ajax.url, post_params, function(response){
67
  if (typeof(response) != 'object') response = JSON.parse(response);
products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_media_library.php CHANGED
@@ -1,4 +1,3 @@
1
- <?php $i18n['isavalidvar'] = true; // make my editor shutup about invalid variables ?>
2
  <div id="ngg-importML-gallery-selection">
3
  <label for="ngg-importML-gallery-id"><?php _e('Gallery', 'nggallery'); ?></label>
4
  <select id="ngg-importML-gallery-id">
 
1
  <div id="ngg-importML-gallery-selection">
2
  <label for="ngg-importML-gallery-id"><?php _e('Gallery', 'nggallery'); ?></label>
3
  <select id="ngg-importML-gallery-id">
products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php CHANGED
@@ -47,9 +47,7 @@
47
  window.set_plupload_url = function(gallery_id, gallery_name) {
48
  var qs = "&action=upload_image&gallery_id="+urlencode(gallery_id);
49
  qs += "&gallery_name="+urlencode(gallery_name);
50
- <?php foreach ($sec_token->get_request_list() as $name=>$value): ?>
51
- qs += "&<?php echo $name?>=<?php echo $value?>";
52
- <?php endforeach ?>
53
  return photocrati_ajax.url + qs;
54
  };
55
 
47
  window.set_plupload_url = function(gallery_id, gallery_name) {
48
  var qs = "&action=upload_image&gallery_id="+urlencode(gallery_id);
49
  qs += "&gallery_name="+urlencode(gallery_name);
50
+ qs += "&nonce="+urlencode("<?php echo $nonce; ?>");
 
 
51
  return photocrati_ajax.url + qs;
52
  };
53
 
products/photocrati_nextgen/modules/nextgen_admin/module.nextgen_admin.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  /***
4
  {
5
- Module: photocrati-nextgen_admin
6
  }
7
  ***/
8
 
@@ -10,10 +10,10 @@ define('NGG_FS_ACCESS_SLUG', 'ngg_fs_access');
10
 
11
  class M_NextGen_Admin extends C_Base_Module
12
  {
13
- /**
14
- * Defines the module
15
- */
16
- function define($id = 'pope-module',
17
  $name = 'Pope Module',
18
  $description = '',
19
  $version = '',
@@ -21,36 +21,36 @@ class M_NextGen_Admin extends C_Base_Module
21
  $author = '',
22
  $author_uri = '',
23
  $context = FALSE)
24
- {
25
- parent::define(
26
- 'photocrati-nextgen_admin',
27
- 'NextGEN Administration',
28
- 'Provides a framework for adding Administration pages',
29
- '3.1.4.2',
30
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
31
  'Imagely',
32
  'https://www.imagely.com'
33
- );
34
 
35
- C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Admin_Installer');
36
 
37
- C_NextGen_Settings::get_instance()->add_option_handler('C_NextGen_Admin_Option_Handler', array(
38
- 'jquery_ui_theme',
39
- 'jquery_ui_theme_version',
40
- 'jquery_ui_theme_url'
41
- ));
42
  if (is_multisite()) C_NextGen_Global_Settings::get_instance()->add_option_handler('C_NextGen_Admin_Option_Handler', array(
43
  'jquery_ui_theme',
44
  'jquery_ui_theme_version',
45
  'jquery_ui_theme_url'
46
  ));
47
- }
48
 
49
- /**
50
- * Register utilities necessary for this module (and the plugin)
51
- */
52
- function _register_utilities()
53
- {
54
  // Provides a NextGEN Administation page
55
  $this->get_registry()->add_utility(
56
  'I_NextGen_Admin_Page',
@@ -73,97 +73,96 @@ class M_NextGen_Admin extends C_Base_Module
73
  'I_Form',
74
  'C_Form'
75
  );
76
- }
77
-
78
- /**
79
- * Registers adapters required by this module
80
- */
81
- function _register_adapters()
82
- {
83
- $this->get_registry()->add_adapter(
84
- 'I_MVC_Controller',
85
- 'A_MVC_Validation'
86
- );
87
- }
88
-
89
-
90
- function get_common_admin_css_handlers($array)
91
- {
92
- $array['nextgen_admin_css'] = $this->module_version;
93
- return $array;
94
- }
95
-
96
- function get_common_admin_js_handlers($array)
97
- {
98
- $array['nextgen_admin_js'] = $this->module_version;
99
- return $array;
100
- }
101
-
102
- // Enqueues static resources that should be enqueued in the HEADER on a NextGEN Admin Page
103
- static function enqueue_common_admin_static_resources($footer=FALSE)
104
- {
105
- $footer = ($footer === TRUE);
106
- $script_handles_filter = $footer ? 'ngg_admin_footer_script_handles' : 'ngg_admin_script_handles';
107
- $style_handles_filter = 'ngg_admin_style_handles';
108
- $enqueue_action = $footer ? 'ngg_admin_footer_enqueue_scripts' : 'ngg_admin_enqueue_scripts';
109
-
110
- if ($slug = C_NextGen_Admin_Page_Manager::is_requested()) {
111
- $script_handles = apply_filters($script_handles_filter, array(), $slug);
112
- $style_handles = apply_filters($style_handles_filter, array(), $slug);
113
-
114
- foreach ($script_handles as $handle => $version) {
115
- $hook = "ngg_enqueue_{$handle}_script";
116
- if (has_action($hook))
117
- do_action($hook, $handle, $version);
118
- else
119
- wp_enqueue_script($handle, '', array(), $version);
120
-
121
- }
122
-
123
- if (!$footer) {
124
- foreach ($style_handles as $handle => $version) {
125
- $hook = "ngg_enqueue_{$handle}_style";
126
- if (has_action($hook))
127
- do_action($hook, $handle, $version);
128
- else
129
- wp_enqueue_style($handle, '', array(), $version);
130
- }
131
- }
132
-
133
- // Expose a means for other modules or third-party plugins to provide their own
134
- // enqueue calls
135
- do_action($enqueue_action, $slug);
136
- }
137
- }
138
-
139
- // Enqueues static resources that should be enqueued in the FOOTER on a NextGEN Admin Page
140
- function enqueue_common_admin_footer_static_resources()
141
- {
142
- self::enqueue_common_admin_static_resources(TRUE);
143
- }
144
-
145
- /**
146
- * Hooks into the WordPress Framework
147
- */
148
- function _register_hooks()
149
- {
150
  // Register scripts
151
  add_action('init', array($this, 'register_scripts'), 9);
152
- add_action('admin_enqueue_scripts', array($this, 'enqueue_wizard_components'));
 
 
153
  add_action('current_screen', array($this, 'init_wizards'), 20);
154
  add_action('current_screen', array($this, 'handle_wizards'), 100);
155
 
156
  // Enqueue common static resources for NGG admin pages
157
- add_filter('ngg_admin_style_handles', array($this, 'get_common_admin_css_handlers'));
158
- add_filter('ngg_admin_script_handles', array($this, 'get_common_admin_js_handlers'));
159
- add_action('admin_enqueue_scripts', array(get_class(), 'enqueue_common_admin_static_resources'));
160
- add_action('admin_footer_print_scripts', array(&$this, 'enqueue_common_admin_footer_static_resources'));
161
 
162
- // Provides menu options for managing NextGEN Settings
163
- add_action('admin_menu', array($this, 'add_menu_pages'), 999);
164
-
165
- // Define routes
166
- add_action('ngg_routes', array($this, 'define_routes'));
167
 
168
  // Add ngg-admin body class to all admin pages for styling
169
  add_filter( 'admin_body_class', array($this, 'add_ngg_body_class'));
@@ -178,11 +177,14 @@ class M_NextGen_Admin extends C_Base_Module
178
  // Requirements need to be registered with the notification manager *before* it's serve_ajax_request()
179
  add_action('init', array(C_Admin_Requirements_Manager::get_instance(), 'create_notification'), -10);
180
 
 
 
 
181
  // Provides admin notices
182
  $notices = C_Admin_Notification_Manager::get_instance();
183
- add_action('init', array($notices, 'serve_ajax_request'));
184
- add_action('admin_footer', array($notices, 'enqueue_scripts'));
185
- add_action('do_ngg_notices', array($notices, 'render'));
186
  add_action('ngg_created_new_gallery', array($this, 'set_review_notice_flag'));
187
  add_action('ngg_created_new_gallery', get_class().'::update_gallery_count_setting');
188
  add_action('ngg_delete_gallery', get_class().'::update_gallery_count_setting');
@@ -224,13 +226,15 @@ class M_NextGen_Admin extends C_Base_Module
224
  $notices->add($review_notice_1->get_name(), $review_notice_1);
225
  $notices->add($review_notice_2->get_name(), $review_notice_2);
226
  $notices->add($review_notice_3->get_name(), $review_notice_3);
227
- }
 
 
228
 
229
  /**
230
  * Used to determine if the current request is for a NGG legacy page
231
  * @return bool
232
  */
233
- static function is_ngg_legacy_page()
234
  {
235
  return (
236
  is_admin() &&
@@ -259,7 +263,7 @@ class M_NextGen_Admin extends C_Base_Module
259
  * We do not want to suddenly ask users for a review when they have upgraded. Instead we will wait for a new
260
  * gallery to be created and then will we also consider displaying reviews if the gallery count is within range.
261
  */
262
- function set_review_notice_flag()
263
  {
264
  $settings = C_NextGen_Settings::get_instance();
265
  if (!$settings->get('gallery_created_after_reviews_introduced'))
@@ -295,52 +299,52 @@ class M_NextGen_Admin extends C_Base_Module
295
  {
296
  $router = C_Router::get_instance();
297
  wp_register_script(
298
- 'gritter',
299
- $router->get_static_url('photocrati-nextgen_admin#gritter/gritter.min.js'),
300
- array('jquery'),
301
- NGG_SCRIPT_VERSION
302
  );
303
  wp_register_style(
304
- 'gritter',
305
- $router->get_static_url('photocrati-nextgen_admin#gritter/css/gritter.css'),
306
- array(),
307
- NGG_SCRIPT_VERSION
308
  );
309
  wp_register_script(
310
- 'ngg_progressbar',
311
- $router->get_static_url('photocrati-nextgen_admin#ngg_progressbar.js'),
312
- array('gritter'),
313
- NGG_SCRIPT_VERSION
314
  );
315
  wp_register_style(
316
- 'ngg_progressbar',
317
- $router->get_static_url('photocrati-nextgen_admin#ngg_progressbar.css'),
318
- array('gritter'),
319
- NGG_SCRIPT_VERSION
320
  );
321
  wp_register_style(
322
- 'ngg_select2',
323
- $router->get_static_url('photocrati-nextgen_admin#select2/select2.css'),
324
- array(),
325
- NGG_SCRIPT_VERSION
326
  );
327
  wp_register_script(
328
- 'ngg_select2',
329
- $router->get_static_url('photocrati-nextgen_admin#select2/select2.js'),
330
- array(),
331
- NGG_SCRIPT_VERSION
332
  );
333
  wp_register_script(
334
  'jquery.nextgen_radio_toggle',
335
  $router->get_static_url('photocrati-nextgen_admin#jquery.nextgen_radio_toggle.js'),
336
  array('jquery'),
337
- NGG_SCRIPT_VERSION
338
  );
339
  wp_register_style(
340
- 'ngg-jquery-ui',
341
- $router->get_static_url('photocrati-nextgen_admin#jquery-ui/jquery-ui-1.10.4.custom.css'),
342
- array(),
343
- '1.10.4'
344
  );
345
  wp_register_script(
346
  'iris',
@@ -363,32 +367,32 @@ class M_NextGen_Admin extends C_Base_Module
363
  'nextgen_admin_js',
364
  $router->get_static_url('photocrati-nextgen_admin#nextgen_admin_page.js'),
365
  array('wp-color-picker'),
366
- NGG_SCRIPT_VERSION
367
  );
368
 
369
  // Style the parent menu icons for NextGEN-related pages
370
  wp_add_inline_style('wp-admin', '
371
- #adminmenu li.toplevel_page_nextgen-gallery img,
372
- #adminmenu li[class*=toplevel_page_nextgen-gallery] img,
373
- #adminmenu li[class*=toplevel_page_ngg] img {
374
- opacity: 1;
375
- max-width: 18px;
376
- padding-top: 7px;
377
- }
378
  ');
379
- }
380
-
381
- /**
382
- * Adds a common body class to all admin pages
383
- *
384
- * @param $classes
385
- *
386
- * @return string
387
- */
388
- function add_ngg_body_class( $classes )
389
- {
390
- return C_NextGen_Admin_Page_Manager::is_requested() ? "$classes ngg-admin" : $classes;
391
- }
392
 
393
  /**
394
  * Adds a common body class to all admin pages
@@ -409,118 +413,124 @@ class M_NextGen_Admin extends C_Base_Module
409
 
410
  }
411
 
412
- /* Add common admin markup to top of custom post type pages */
413
- function custom_post_type_markup_top() {
414
  global $title;
415
  $url = $_SERVER['REQUEST_URI'];
416
  $is_ngg_post_type = strpos($url, 'post_type=ngg_') || strpos($url, 'post_type=nextgen_');
417
  $is_single_edit_page = strpos($url, '&ngg_edit');
418
- if ( $is_ngg_post_type && !$is_single_edit_page) {
419
- echo '<div id="ngg_page_content"><div class="ngg_page_content_header "><img src="' . C_Router::get_instance()->get_static_url('photocrati-nextgen_admin#imagely_icon.png') . '"><h3>'. $title . '</h3></div><div class="ngg_page_content_main">';
420
- }
421
- }
422
 
423
- /* Add common admin markup to bottom of custom post type pages */
424
- function custom_post_type_markup_bottom() {
425
  $url = $_SERVER['REQUEST_URI'];
426
  $is_ngg_post_type = strpos($url, 'post_type=ngg_') || strpos($url, 'post_type=nextgen_');
427
  $is_single_edit_page = strpos($url, '&ngg_edit');
428
  if ( $is_ngg_post_type && !$is_single_edit_page) {
429
- echo '</div></div>';
430
- }
431
- }
432
-
433
- function init_wizards()
434
- {
435
- $is_block_editor = false;
436
- if (function_exists('get_current_screen')) {
437
- $current_screen = get_current_screen();
438
- if (is_object($current_screen)) {
439
- if (method_exists($current_screen, 'is_block_editor'))
440
- $is_block_editor = $current_screen->is_block_editor();
441
-
442
- if (!$is_block_editor) {
443
- if ($current_screen->action == 'add')
444
- $is_block_editor = function_exists('use_block_editor_for_post_type') && use_block_editor_for_post_type($current_screen->post_type);
445
- else
446
- $is_block_editor = function_exists('use_block_editor_for_post') && use_block_editor_for_post(null);
447
- }
448
-
449
- if (!$is_block_editor) {
450
- if ($current_screen->action == 'add')
451
- $is_block_editor = !isset($_GET['classic-editor']) && function_exists('gutenberg_can_edit_post_type') && gutenberg_can_edit_post_type($current_screen->post_type);
452
- else
453
- $is_block_editor = !isset($_GET['classic-editor']) && function_exists('gutenberg_can_edit_post') && gutenberg_can_edit_post(null);
454
- }
455
- }
456
- }
457
-
458
- if (!$is_block_editor)
459
- $is_block_editor = function_exists('is_gutenberg_page') && is_gutenberg_page();
460
-
461
- $wizards = C_NextGEN_Wizard_Manager::get_instance();
462
- $wizards->set_starter(__('Do you need help with NextGEN?', 'nggallery'));
463
- $wizards->set_active(false);
464
-
 
 
 
 
 
 
465
  /*
466
  * This is the new wizard sequence that helps users both crerate a gallery
467
  * and add it to a page.
468
  */
469
- $wizard = $wizards->add_wizard('nextgen.beginner.gallery_creation_igw');
470
- $wizard->add_step('start');
471
- $wizard->set_step_text('start', __('Hello, this wizard will guide you through creating a NextGEN gallery and inserting it into a page. Click "Next step" to proceed.', 'nggallery'));
472
- $wizard->add_step('pages_menu');
473
- $wizard->set_step_text('pages_menu', __('Click on "Pages" to access your WordPress pages.', 'nggallery'));
474
- $wizard->set_step_target('pages_menu', '#menu-pages a.menu-top', 'right center', 'left center');
475
- $wizard->set_step_view('pages_menu', '#menu-pages a.menu-top');
476
- $wizard->add_step('add_page_menu');
477
- $wizard->set_step_text('add_page_menu', __('Click "Add New" to create a new page.', 'nggallery'));
478
- $wizard->set_step_target('add_page_menu', '#menu-pages a[href*="post-new.php?post_type=page"]', 'right center', 'left center');
479
- $wizard->set_step_view('add_page_menu', '#menu-pages a[href*="post-new.php?post_type=page"]');
480
-
481
- if ($is_block_editor) {
482
- $wizard->add_step('input_page_title');
483
- $wizard->set_step_text('input_page_title', __('Type in a title for your page.', 'nggallery'));
484
- $wizard->set_step_target('input_page_title', '.editor-post-title__input', 'bottom center', 'top center');
485
- $wizard->set_step_view('input_page_title', '.editor-post-title__input');
486
-
487
- $wizard->add_step('add_block');
488
- $wizard->set_step_text('add_block', __('Now click the button to insert a block.', 'nggallery'));
489
- $wizard->set_step_target('add_block', 'button.editor-inserter__toggle', 'right center', 'left center');
490
- $wizard->set_step_view('add_block', 'button.editor-inserter__toggle');
491
- $wizard->set_step_lazy('add_block', true);
492
-
493
- $wizard->add_step('search_nextgen');
494
- $wizard->set_step_text('search_nextgen', __('Type "nextgen" to search for the NextGEN block.', 'nggallery'));
495
- $wizard->set_step_target('search_nextgen', 'input.editor-inserter__search', 'right center', 'left center');
496
- $wizard->set_step_view('search_nextgen', 'input.editor-inserter__search');
497
- $wizard->set_step_lazy('search_nextgen', true);
498
-
499
- $wizard->add_step('add_ngg_block');
500
- $wizard->set_step_text('add_ngg_block', __('Click on the NextGEN block to add it.', 'nggallery'));
501
- $wizard->set_step_target('add_ngg_block', 'button.editor-block-list-item-imagely-nextgen-gallery', 'right center', 'left center');
502
- $wizard->set_step_view('add_ngg_block', 'button.editor-block-list-item-imagely-nextgen-gallery');
503
- $wizard->set_step_lazy('add_ngg_block', true);
504
- $wizard->set_step_condition('add_ngg_block', 'wait', '1500');
505
-
506
- $wizard->add_step('add-ngg-gallery');
507
- $wizard->set_step_text('add-ngg-gallery', __('Now click the "Add Gallery" button to open NextGEN\'s Insert Gallery Window.', 'nggallery'));
508
- $wizard->set_step_target('add-ngg-gallery', '.add-ngg-gallery', 'bottom center', 'top center');
509
- $wizard->set_step_view('add-ngg-gallery', '.add-ngg-gallery');
510
- $wizard->set_step_lazy('add-ngg-gallery', true);
511
- }
512
- else {
513
- $wizard->add_step('input_page_title');
514
- $wizard->set_step_text('input_page_title', __('Type in a title for your page.', 'nggallery'));
515
- $wizard->set_step_target('input_page_title', 'input#title', 'bottom center', 'top center');
516
- $wizard->set_step_view('input_page_title', 'input#title');
517
-
518
- $wizard->add_step('add_gallery_button');
519
- $wizard->set_step_text('add_gallery_button', __('Now click the "Add Gallery" button to open NextGEN\'s Insert Gallery Window (IGW).', 'nggallery'));
520
- $wizard->set_step_target('add_gallery_button', 'a#ngg-media-button', 'right center', 'left center');
521
- $wizard->set_step_view('add_gallery_button', 'a#ngg-media-button');
522
- }
523
-
524
  $wizard->add_step('add_gallery_tab');
525
  $wizard->set_step_text('add_gallery_tab', __('Now click the "Upload Images" tab to add a new gallery.', 'nggallery'));
526
  $wizard->set_step_target('add_gallery_tab', '#attach_to_post_tabs a#ui-id-2', 'right center', 'left center');
@@ -528,94 +538,100 @@ class M_NextGen_Admin extends C_Base_Module
528
  $wizard->set_step_context('add_gallery_tab', 'iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]');
529
  $wizard->set_step_lazy('add_gallery_tab', true);
530
  $wizard->set_step_condition('add_gallery_tab', 'nextgen_event', 'plupload_init', null, 10000);
531
- $wizard->add_step('input_gallery_name');
532
- $wizard->set_step_text('input_gallery_name', __('Select a name for your gallery.', 'nggallery'));
533
  $wizard->set_step_target('input_gallery_name', 'input#gallery_name:visible', 'bottom center', 'top center');
534
  $wizard->set_step_view('input_gallery_name', 'input#gallery_name');
535
  $wizard->set_step_context('input_gallery_name', array('iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]', 'iframe#ngg-iframe-create_tab'));
536
- $wizard->set_step_lazy('input_gallery_name', true);
537
  // $wizard->set_step_condition('input_gallery_name', 'nextgen_event', 'plupload_init', null, 10000);
538
- $wizard->add_step('select_images');
539
- $wizard->set_step_text('select_images', __('Now click the "Add Files" button and select some images to add to the gallery.', 'nggallery'));
540
- $wizard->set_step_target('select_images', 'a#uploader_browse', 'bottom center', 'top center');
541
- $wizard->set_step_view('select_images', 'a#uploader_browse');
542
- $wizard->set_step_context('select_images', array('iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]', 'iframe#ngg-iframe-create_tab'));
543
- $wizard->set_step_lazy('select_images', true);
544
- $wizard->add_step('upload_images');
545
- $wizard->set_step_text('upload_images', __('Now click the "Start Upload" button to begin the upload process.', 'nggallery'));
546
- $wizard->set_step_target('upload_images', 'a#uploader_upload', 'bottom center', 'top center');
547
- $wizard->set_step_view('upload_images', 'a#uploader_upload');
548
- $wizard->set_step_context('upload_images', array('iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]', 'iframe#ngg-iframe-create_tab'));
549
- $wizard->set_step_lazy('upload_images', true);
550
- $wizard->set_step_condition('upload_images', 'plupload_bind', 'UploadComplete', array('iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]', 'iframe#ngg-iframe-create_tab', '#uploader'));
551
- $wizard->add_step('display_gallery_tab');
552
- $wizard->set_step_text('display_gallery_tab', __('Congratulations! You just created your first gallery. Now let\'s insert it into the page. Click the "Insert into Page" tab.', 'nggallery'));
553
- $wizard->set_step_target('display_gallery_tab', '#attach_to_post_tabs a#ui-id-1', 'right center', 'left center');
554
- $wizard->set_step_view('display_gallery_tab', '#attach_to_post_tabs a#ui-id-1');
555
- $wizard->set_step_context('display_gallery_tab', 'iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]');
556
- $wizard->set_step_lazy('display_gallery_tab', true);
557
- $wizard->set_step_condition('display_gallery_tab', 'wait', '500');
558
- $wizard->add_step('display_type_select');
559
- $wizard->set_step_text('display_type_select', __('Click on the "NextGEN Basic Slideshow" radio button to select the display type for the gallery.', 'nggallery'));
560
- $wizard->set_step_target('display_type_select', '.display_type_preview input[value="photocrati-nextgen_basic_slideshow"]', 'bottom center', 'top center');
561
- $wizard->set_step_view('display_type_select', '.display_type_preview input[type="radio"]');
562
- $wizard->set_step_context('display_type_select', 'iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]');
563
- $wizard->set_step_lazy('display_type_select', true);
564
- $wizard->add_step('source_select');
565
- $wizard->set_step_text('source_select', __('Now click inside the "Galleries" field and select your gallery.', 'nggallery'));
566
- $wizard->set_step_target('source_select', '#source_configuration .galleries_column .select2-container input', 'right center', 'left center');
567
- $wizard->set_step_view('source_select', '#source_configuration .galleries_column select');
568
- $wizard->set_step_context('source_select', 'iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]');
569
- $wizard->set_step_lazy('source_select', true);
570
- $wizard->add_step('insert_gallery');
571
- $wizard->set_step_text('insert_gallery', __('Now click on the "Insert Gallery" button to insert the gallery in your page.', 'nggallery'));
572
- $wizard->set_step_target('insert_gallery', '#displayed_tab #save_displayed_gallery', 'top center', 'bottom left');
573
- $wizard->set_step_view('insert_gallery', '#displayed_tab #save_displayed_gallery');
574
- $wizard->set_step_context('insert_gallery', 'iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]');
575
- $wizard->set_step_lazy('insert_gallery', true);
576
- $wizard->set_step_condition('insert_gallery', 'wait', '1000');
577
- $wizard->add_step('finish');
578
- $wizard->set_step_text('finish', __('Congratulations! You just created your first gallery. You can now click the "Publish" button on the right to publish your page.', 'nggallery'));
579
- }
580
-
581
- function handle_wizards()
582
- {
583
- $wizards = C_NextGEN_Wizard_Manager::get_instance();
584
-
585
- // adjust wizards state based on query/parameters
586
- $wizards->handle_wizard_query();
587
-
588
- global $ngg_fs;
589
- // make sure we don't trigger the wizards if NGG Fremius is running or this is an AJAX request
590
- if (isset($_REQUEST['ngg_dismiss_notice']) || (is_admin() && !M_Attach_To_Post::is_atp_url() && !isset($_REQUEST['attach_to_post']) && (!isset($ngg_fs) || !$ngg_fs->is_activation_mode()) && (!defined('DOING_AJAX') || !DOING_AJAX)))
591
- {
592
- $wizards->set_active(true);
593
- }
594
-
595
- // before adding notices or activating individual wizards, ensure wizards are globally enabled and no wizard is currently running already
596
- if ($wizards->is_active() && $wizards->get_running_wizard() == null)
597
- {
598
- // add notice for gallery creation wizard
599
- $wizard = $wizards->get_wizard('nextgen.beginner.gallery_creation_igw');
600
-
601
- if (!$wizard->is_completed() && !$wizard->is_cancelled())
602
- {
603
- $mapper = C_Gallery_Mapper::get_instance();
604
- if ($mapper->count() == 0)
605
- {
606
- $wizard->set_active(true);
607
- $notices = C_Admin_Notification_Manager::get_instance();
608
- $notices->add('ngg_wizard_' . $wizard->get_id(), array("message" => __('Thanks for installing NextGEN Gallery! Want help creating your first gallery?', 'nggallery') . ' <a data-ngg-wizard="' . $wizard->get_id() . '" class="ngg-wizard-invoker" href="' . esc_url(add_query_arg('ngg_wizard', $wizard->get_id())) . '">' . __('Launch the Gallery Wizard', 'nggallery') . '</a>. ' . __('If you close this message, you can also launch the Gallery Wizard at any time from the', 'nggallery') . ' <a href="' . esc_url(admin_url('admin.php?page=nextgen-gallery')) . '">' . __('NextGEN Overview page', 'nggallery') . '</a>.'));
609
- }
610
- else if (isset($_GET['page']) && $_GET['page'] == 'nextgen-gallery') {
611
- $wizard->set_active(true);
612
- }
613
- }
614
- }
615
- }
616
-
617
- function enqueue_wizard_components()
618
- {
 
 
 
 
 
 
619
  $router = C_Router::get_instance();
620
 
621
  // Wizards related scripts/styles
@@ -625,143 +641,144 @@ class M_NextGen_Admin extends C_Base_Module
625
  array(),
626
  NGG_SCRIPT_VERSION
627
  );
628
-
629
- wp_register_script(
630
- 'tourist',
631
- $router->get_static_url('photocrati-nextgen_admin#tourist/tourist.js'),
632
- array('jquery', 'backbone'),
633
- NGG_SCRIPT_VERSION
634
- );
635
- wp_register_style(
636
- 'tourist',
637
- $router->get_static_url('photocrati-nextgen_admin#tourist/tourist.css'),
638
- array('bootstrap-tooltip'),
639
- NGG_SCRIPT_VERSION
640
- );
641
- wp_register_script(
642
- 'ngg-wizards',
643
- $router->get_static_url('photocrati-nextgen_admin#nextgen_wizards.js'),
644
- array('tourist'),
645
- NGG_SCRIPT_VERSION,
646
- true
647
- );
648
- wp_register_style(
649
- 'ngg-wizards',
650
- $router->get_static_url('photocrati-nextgen_admin#nextgen_wizards.css'),
651
- array('tourist'),
652
- NGG_SCRIPT_VERSION
653
- );
654
 
655
- $wizards = C_NextGEN_Wizard_Manager::get_instance();
656
- $wizard = $wizards->get_next_wizard();
657
-
658
- if ($wizards->is_active() && $wizard != null) {
659
- $data = array();
660
- $data['starter'] = array('text' => $wizards->get_starter(), 'image' => $router->get_static_url('photocrati-nextgen_admin#imagely_icon.png'));
661
- $running_wizard = $wizards->get_running_wizard();
662
- $data['running_wizard'] = $running_wizard != null ? $running_wizard->get_id() : null;
663
- $data['wizard_list'] = array($wizard->toData());
664
- wp_localize_script('ngg-wizards', 'NextGEN_Wizard_Manager_State', $data);
665
- if (method_exists('M_Gallery_Display', 'enqueue_fontawesome'))
666
- M_Gallery_Display::enqueue_fontawesome();
667
-
668
- wp_enqueue_style('ngg-wizards');
669
- wp_enqueue_script('ngg-wizards');
670
- };
671
- }
672
-
673
- /**
674
- * Adds menu pages to manage NextGen Settings
675
- * @uses action: admin_menu
676
- */
677
- function add_menu_pages()
678
- {
679
- C_NextGen_Admin_Page_Manager::get_instance()->setup();
680
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
681
 
682
  function get_type_list()
683
  {
684
  return array(
685
- 'A_Fs_Access_Page' => 'adapter.fs_access_page.php',
686
- 'A_MVC_Validation' => 'adapter.mvc_validation.php',
687
- 'A_Nextgen_Admin_Default_Pages' => 'adapter.nextgen_admin_default_pages.php',
688
- 'A_Nextgen_Settings_Routes' => 'adapter.nextgen_settings_routes.php',
689
- 'C_Admin_Notification_Manager' => 'class.admin_notification_manager.php',
690
- 'C_Admin_Requirements_Manager' => 'class.admin_requirements_manager.php',
691
- 'C_Form' => 'class.form.php',
692
- 'C_Form_Manager' => 'class.form_manager.php',
693
- 'C_NextGEN_Wizard_Manager' => 'class.nextgen_wizard_manager.php',
694
- 'C_NextGen_Admin_Page_Manager' => 'class.nextgen_admin_page_manager.php',
695
- 'C_Nextgen_Admin_Installer' => 'class.nextgen_admin_installer.php',
696
- 'C_Nextgen_Admin_Page_Controller' => 'class.nextgen_admin_page_controller.php'
 
697
  );
698
  }
699
  }
700
 
701
  class C_NextGen_Admin_Installer
702
  {
703
- function install()
704
- {
705
- $settings = C_NextGen_Settings::get_instance();
706
-
707
- // In version 0.2 of this module and earlier, the following values
708
- // were statically set rather than dynamically using a handler. Therefore, we need
709
- // to delete those static values
710
- $module_name = 'photocrati-nextgen_admin';
711
- $modules = get_option('pope_module_list', array());
712
- if (!$modules) {
713
- $modules = $settings->get('pope_module_list', array());
714
- }
715
-
716
- $cleanup = FALSE;
717
- foreach ($modules as $module) {
718
- if (strpos($module, $module_name) !== FALSE) {
719
- // Leave $module as-is: inside version_compare() will warn about passing items by reference
720
- $module = explode('|', $module);
721
- $val = array_pop($module);
722
- if (version_compare($val, '0.3') == -1) {
723
- $cleanup = TRUE;
724
- }
725
- break;
726
- }
727
- }
728
-
729
- if ($cleanup) {
730
- $keys = array(
731
- 'jquery_ui_theme',
732
- 'jquery_ui_theme_version',
733
- 'jquery_ui_theme_url'
734
- );
735
- foreach ($keys as $key) $settings->delete($key);
736
- }
737
- }
738
  }
739
 
740
  class C_NextGen_Admin_Option_Handler
741
  {
742
- function get_router()
743
- {
744
- return C_Router::get_instance();
745
- }
746
-
747
- function get($key, $default=NULL)
748
- {
749
- $retval = $default;
750
-
751
- switch ($key) {
752
- case 'jquery_ui_theme':
753
- $retval = 'jquery-ui-nextgen';
754
- break;
755
- case 'jquery_ui_theme_version':
756
- $retval = '1.8';
757
- break;
758
- case 'jquery_ui_theme_url':
759
- $retval = $this->get_router()->get_static_url('photocrati-nextgen_admin#jquery-ui/jquery-ui-1.10.4.custom.css');
760
- break;
761
- }
762
-
763
- return $retval;
764
- }
765
  }
766
 
767
  new M_NextGen_Admin();
2
 
3
  /***
4
  {
5
+ Module: photocrati-nextgen_admin
6
  }
7
  ***/
8
 
10
 
11
  class M_NextGen_Admin extends C_Base_Module
12
  {
13
+ /**
14
+ * Defines the module
15
+ */
16
+ function define($id = 'pope-module',
17
  $name = 'Pope Module',
18
  $description = '',
19
  $version = '',
21
  $author = '',
22
  $author_uri = '',
23
  $context = FALSE)
24
+ {
25
+ parent::define(
26
+ 'photocrati-nextgen_admin',
27
+ 'NextGEN Administration',
28
+ 'Provides a framework for adding Administration pages',
29
+ '3.1.8',
30
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
31
  'Imagely',
32
  'https://www.imagely.com'
33
+ );
34
 
35
+ C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Admin_Installer');
36
 
37
+ C_NextGen_Settings::get_instance()->add_option_handler('C_NextGen_Admin_Option_Handler', array(
38
+ 'jquery_ui_theme',
39
+ 'jquery_ui_theme_version',
40
+ 'jquery_ui_theme_url'
41
+ ));
42
  if (is_multisite()) C_NextGen_Global_Settings::get_instance()->add_option_handler('C_NextGen_Admin_Option_Handler', array(
43
  'jquery_ui_theme',
44
  'jquery_ui_theme_version',
45
  'jquery_ui_theme_url'
46
  ));
47
+ }
48
 
49
+ /**
50
+ * Register utilities necessary for this module (and the plugin)
51
+ */
52
+ function _register_utilities()
53
+ {
54
  // Provides a NextGEN Administation page
55
  $this->get_registry()->add_utility(
56
  'I_NextGen_Admin_Page',
73
  'I_Form',
74
  'C_Form'
75
  );
76
+ }
77
+
78
+ /**
79
+ * Registers adapters required by this module
80
+ */
81
+ function _register_adapters()
82
+ {
83
+ $this->get_registry()->add_adapter(
84
+ 'I_MVC_Controller',
85
+ 'A_MVC_Validation'
86
+ );
87
+ }
88
+
89
+
90
+ function get_common_admin_css_handlers($array)
91
+ {
92
+ $array['nextgen_admin_css'] = $this->module_version;
93
+ return $array;
94
+ }
95
+
96
+ function get_common_admin_js_handlers($array)
97
+ {
98
+ $array['nextgen_admin_js'] = $this->module_version;
99
+ return $array;
100
+ }
101
+
102
+ // Enqueues static resources that should be enqueued in the HEADER on a NextGEN Admin Page
103
+ static function enqueue_common_admin_static_resources($footer=FALSE)
104
+ {
105
+ $footer = ($footer === TRUE);
106
+ $script_handles_filter = $footer ? 'ngg_admin_footer_script_handles' : 'ngg_admin_script_handles';
107
+ $style_handles_filter = 'ngg_admin_style_handles';
108
+ $enqueue_action = $footer ? 'ngg_admin_footer_enqueue_scripts' : 'ngg_admin_enqueue_scripts';
109
+
110
+ if ($slug = C_NextGen_Admin_Page_Manager::is_requested()) {
111
+ $script_handles = apply_filters($script_handles_filter, array(), $slug);
112
+ $style_handles = apply_filters($style_handles_filter, array(), $slug);
113
+
114
+ foreach ($script_handles as $handle => $version) {
115
+ $hook = "ngg_enqueue_{$handle}_script";
116
+ if (has_action($hook))
117
+ do_action($hook, $handle, $version);
118
+ else
119
+ wp_enqueue_script($handle, '', array(), $version);
120
+
121
+ }
122
+
123
+ if (!$footer) {
124
+ foreach ($style_handles as $handle => $version) {
125
+ $hook = "ngg_enqueue_{$handle}_style";
126
+ if (has_action($hook))
127
+ do_action($hook, $handle, $version);
128
+ else
129
+ wp_enqueue_style($handle, '', array(), $version);
130
+ }
131
+ }
132
+
133
+ // Expose a means for other modules or third-party plugins to provide their own
134
+ // enqueue calls
135
+ do_action($enqueue_action, $slug);
136
+ }
137
+ }
138
+
139
+ // Enqueues static resources that should be enqueued in the FOOTER on a NextGEN Admin Page
140
+ function enqueue_common_admin_footer_static_resources()
141
+ {
142
+ self::enqueue_common_admin_static_resources(TRUE);
143
+ }
144
+
145
+ /**
146
+ * Hooks into the WordPress Framework
147
+ */
148
+ function _register_hooks()
149
+ {
150
  // Register scripts
151
  add_action('init', array($this, 'register_scripts'), 9);
152
+
153
+ // Wizard-related hooks
154
+ add_action('admin_enqueue_scripts', array($this, 'enqueue_wizard_components'));
155
  add_action('current_screen', array($this, 'init_wizards'), 20);
156
  add_action('current_screen', array($this, 'handle_wizards'), 100);
157
 
158
  // Enqueue common static resources for NGG admin pages
159
+ add_filter('ngg_admin_style_handles', array($this, 'get_common_admin_css_handlers'));
160
+ add_filter('ngg_admin_script_handles', array($this, 'get_common_admin_js_handlers'));
161
+ add_action('admin_enqueue_scripts', array(get_class(), 'enqueue_common_admin_static_resources'));
162
+ add_action('admin_footer_print_scripts', array(&$this, 'enqueue_common_admin_footer_static_resources'));
163
 
164
+ // Provides menu options for managing NextGEN Settings
165
+ add_action('admin_menu', array($this, 'add_menu_pages'), 999);
 
 
 
166
 
167
  // Add ngg-admin body class to all admin pages for styling
168
  add_filter( 'admin_body_class', array($this, 'add_ngg_body_class'));
177
  // Requirements need to be registered with the notification manager *before* it's serve_ajax_request()
178
  add_action('init', array(C_Admin_Requirements_Manager::get_instance(), 'create_notification'), -10);
179
 
180
+ // Define routes
181
+ add_action('ngg_routes', array($this, 'define_routes'));
182
+
183
  // Provides admin notices
184
  $notices = C_Admin_Notification_Manager::get_instance();
185
+ add_action('init', array($notices, 'serve_ajax_request'));
186
+ add_action('admin_footer', array($notices, 'enqueue_scripts'));
187
+ add_action('do_ngg_notices', array($notices, 'render'));
188
  add_action('ngg_created_new_gallery', array($this, 'set_review_notice_flag'));
189
  add_action('ngg_created_new_gallery', get_class().'::update_gallery_count_setting');
190
  add_action('ngg_delete_gallery', get_class().'::update_gallery_count_setting');
226
  $notices->add($review_notice_1->get_name(), $review_notice_1);
227
  $notices->add($review_notice_2->get_name(), $review_notice_2);
228
  $notices->add($review_notice_3->get_name(), $review_notice_3);
229
+
230
+ $notices->add('nextgen.beginner.gallery_creation_igw', 'C_NextGen_First_Run_Notification_Wizard');
231
+ }
232
 
233
  /**
234
  * Used to determine if the current request is for a NGG legacy page
235
  * @return bool
236
  */
237
+ static function is_ngg_legacy_page()
238
  {
239
  return (
240
  is_admin() &&
263
  * We do not want to suddenly ask users for a review when they have upgraded. Instead we will wait for a new
264
  * gallery to be created and then will we also consider displaying reviews if the gallery count is within range.
265
  */
266
+ function set_review_notice_flag()
267
  {
268
  $settings = C_NextGen_Settings::get_instance();
269
  if (!$settings->get('gallery_created_after_reviews_introduced'))
299
  {
300
  $router = C_Router::get_instance();
301
  wp_register_script(
302
+ 'gritter',
303
+ $router->get_static_url('photocrati-nextgen_admin#gritter/gritter.min.js'),
304
+ array('jquery'),
305
+ NGG_SCRIPT_VERSION
306
  );
307
  wp_register_style(
308
+ 'gritter',
309
+ $router->get_static_url('photocrati-nextgen_admin#gritter/css/gritter.css'),
310
+ array(),
311
+ NGG_SCRIPT_VERSION
312
  );
313
  wp_register_script(
314
+ 'ngg_progressbar',
315
+ $router->get_static_url('photocrati-nextgen_admin#ngg_progressbar.js'),
316
+ array('gritter'),
317
+ NGG_SCRIPT_VERSION
318
  );
319
  wp_register_style(
320
+ 'ngg_progressbar',
321
+ $router->get_static_url('photocrati-nextgen_admin#ngg_progressbar.css'),
322
+ array('gritter'),
323
+ NGG_SCRIPT_VERSION
324
  );
325
  wp_register_style(
326
+ 'ngg_select2',
327
+ $router->get_static_url('photocrati-nextgen_admin#select2/select2.css'),
328
+ array(),
329
+ NGG_SCRIPT_VERSION
330
  );
331
  wp_register_script(
332
+ 'ngg_select2',
333
+ $router->get_static_url('photocrati-nextgen_admin#select2/select2.js'),
334
+ array(),
335
+ NGG_SCRIPT_VERSION
336
  );
337
  wp_register_script(
338
  'jquery.nextgen_radio_toggle',
339
  $router->get_static_url('photocrati-nextgen_admin#jquery.nextgen_radio_toggle.js'),
340
  array('jquery'),
341
+ NGG_SCRIPT_VERSION
342
  );
343
  wp_register_style(
344
+ 'ngg-jquery-ui',
345
+ $router->get_static_url('photocrati-nextgen_admin#jquery-ui/jquery-ui-1.10.4.custom.css'),
346
+ array(),
347
+ '1.10.4'
348
  );
349
  wp_register_script(
350
  'iris',
367
  'nextgen_admin_js',
368
  $router->get_static_url('photocrati-nextgen_admin#nextgen_admin_page.js'),
369
  array('wp-color-picker'),
370
+ NGG_SCRIPT_VERSION
371
  );
372
 
373
  // Style the parent menu icons for NextGEN-related pages
374
  wp_add_inline_style('wp-admin', '
375
+ #adminmenu li.toplevel_page_nextgen-gallery img,
376
+ #adminmenu li[class*=toplevel_page_nextgen-gallery] img,
377
+ #adminmenu li[class*=toplevel_page_ngg] img {
378
+ opacity: 1;
379
+ max-width: 18px;
380
+ padding-top: 7px;
381
+ }
382
  ');
383
+ }
384
+
385
+ /**
386
+ * Adds a common body class to all admin pages
387
+ *
388
+ * @param $classes
389
+ *
390
+ * @return string
391
+ */
392
+ function add_ngg_body_class( $classes )
393
+ {
394
+ return C_NextGen_Admin_Page_Manager::is_requested() ? "$classes ngg-admin" : $classes;
395
+ }
396
 
397
  /**
398
  * Adds a common body class to all admin pages
413
 
414
  }
415
 
416
+ /* Add common admin markup to top of custom post type pages */
417
+ function custom_post_type_markup_top() {
418
  global $title;
419
  $url = $_SERVER['REQUEST_URI'];
420
  $is_ngg_post_type = strpos($url, 'post_type=ngg_') || strpos($url, 'post_type=nextgen_');
421
  $is_single_edit_page = strpos($url, '&ngg_edit');
422
+ if ( $is_ngg_post_type && !$is_single_edit_page) {
423
+ echo '<div id="ngg_page_content"><div class="ngg_page_content_header "><img src="' . C_Router::get_instance()->get_static_url('photocrati-nextgen_admin#imagely_icon.png') . '"><h3>'. $title . '</h3></div><div class="ngg_page_content_main">';
424
+ }
425
+ }
426
 
427
+ /* Add common admin markup to bottom of custom post type pages */
428
+ function custom_post_type_markup_bottom() {
429
  $url = $_SERVER['REQUEST_URI'];
430
  $is_ngg_post_type = strpos($url, 'post_type=ngg_') || strpos($url, 'post_type=nextgen_');
431
  $is_single_edit_page = strpos($url, '&ngg_edit');
432
  if ( $is_ngg_post_type && !$is_single_edit_page) {
433
+ echo '</div></div>';
434
+ }
435
+ }
436
+
437
+ /* Add function to determine if block editor is in use */
438
+ static function is_block_editor()
439
+ {
440
+ $is_block_editor = false;
441
+ if (function_exists('get_current_screen')) {
442
+ $current_screen = get_current_screen();
443
+ if (is_object($current_screen)) {
444
+ if (method_exists($current_screen, 'is_block_editor'))
445
+ $is_block_editor = $current_screen->is_block_editor();
446
+
447
+ if (!$is_block_editor) {
448
+ if ($current_screen->action == 'add')
449
+ $is_block_editor = function_exists('use_block_editor_for_post_type') && use_block_editor_for_post_type($current_screen->post_type);
450
+ else
451
+ $is_block_editor = function_exists('use_block_editor_for_post') && use_block_editor_for_post(null);
452
+ }
453
+
454
+ if (!$is_block_editor) {
455
+ if ($current_screen->action == 'add')
456
+ $is_block_editor = !isset($_GET['classic-editor']) && function_exists('gutenberg_can_edit_post_type') && gutenberg_can_edit_post_type($current_screen->post_type);
457
+ else
458
+ $is_block_editor = !isset($_GET['classic-editor']) && function_exists('gutenberg_can_edit_post') && gutenberg_can_edit_post(null);
459
+ }
460
+ }
461
+ }
462
+
463
+ if (!$is_block_editor)
464
+ $is_block_editor = function_exists('is_gutenberg_page') && is_gutenberg_page();
465
+
466
+ return $is_block_editor;
467
+ }
468
+
469
+ function init_wizards()
470
+ {
471
+ $wizards = C_NextGEN_Wizard_Manager::get_instance();
472
+ $wizards->set_starter(__('Do you need help with NextGEN?', 'nggallery'));
473
+ $wizards->set_active(false);
474
+
475
  /*
476
  * This is the new wizard sequence that helps users both crerate a gallery
477
  * and add it to a page.
478
  */
479
+ $wizard = $wizards->add_wizard('nextgen.beginner.gallery_creation_igw');
480
+ $wizard->add_step('start');
481
+ $wizard->set_step_text('start', __('Hello, this wizard will guide you through creating a NextGEN gallery and inserting it into a page. Click "Next step" to proceed.', 'nggallery'));
482
+ $wizard->add_step('pages_menu');
483
+ $wizard->set_step_text('pages_menu', __('Click on "Pages" to access your WordPress pages.', 'nggallery'));
484
+ $wizard->set_step_target('pages_menu', '#menu-pages a.menu-top', 'right center', 'left center');
485
+ $wizard->set_step_view('pages_menu', '#menu-pages a.menu-top');
486
+ $wizard->add_step('add_page_menu');
487
+ $wizard->set_step_text('add_page_menu', __('Click "Add New" to create a new page.', 'nggallery'));
488
+ $wizard->set_step_target('add_page_menu', '#menu-pages a[href*="post-new.php?post_type=page"]', 'right center', 'left center');
489
+ $wizard->set_step_view('add_page_menu', '#menu-pages a[href*="post-new.php?post_type=page"]');
490
+
491
+ if ($this->is_block_editor()) {
492
+ $wizard->add_step('input_page_title');
493
+ $wizard->set_step_text('input_page_title', __('Type in a title for your page.', 'nggallery'));
494
+ $wizard->set_step_target('input_page_title', '.editor-post-title__input', 'bottom center', 'top center');
495
+ $wizard->set_step_view('input_page_title', '.editor-post-title__input');
496
+
497
+ $wizard->add_step('add_block');
498
+ $wizard->set_step_text('add_block', __('Now click the button to insert a block.', 'nggallery'));
499
+ $wizard->set_step_target('add_block', 'button.editor-inserter__toggle', 'right center', 'left center');
500
+ $wizard->set_step_view('add_block', 'button.editor-inserter__toggle');
501
+ $wizard->set_step_lazy('add_block', true);
502
+
503
+ $wizard->add_step('search_nextgen');
504
+ $wizard->set_step_text('search_nextgen', __('Type "nextgen" to search for the NextGEN block.', 'nggallery'));
505
+ $wizard->set_step_target('search_nextgen', 'input.editor-inserter__search', 'right center', 'left center');
506
+ $wizard->set_step_view('search_nextgen', 'input.editor-inserter__search');
507
+ $wizard->set_step_lazy('search_nextgen', true);
508
+
509
+ $wizard->add_step('add_ngg_block');
510
+ $wizard->set_step_text('add_ngg_block', __('Click on the NextGEN block to add it.', 'nggallery'));
511
+ $wizard->set_step_target('add_ngg_block', 'button.editor-block-list-item-imagely-nextgen-gallery', 'right center', 'left center');
512
+ $wizard->set_step_view('add_ngg_block', 'button.editor-block-list-item-imagely-nextgen-gallery');
513
+ $wizard->set_step_lazy('add_ngg_block', true);
514
+ $wizard->set_step_condition('add_ngg_block', 'wait', '1500');
515
+
516
+ $wizard->add_step('add-ngg-gallery');
517
+ $wizard->set_step_text('add-ngg-gallery', __('Now click the "Add Gallery" button to open NextGEN\'s Insert Gallery Window.', 'nggallery'));
518
+ $wizard->set_step_target('add-ngg-gallery', '.add-ngg-gallery', 'bottom center', 'top center');
519
+ $wizard->set_step_view('add-ngg-gallery', '.add-ngg-gallery');
520
+ $wizard->set_step_lazy('add-ngg-gallery', true);
521
+ }
522
+ else {
523
+ $wizard->add_step('input_page_title');
524
+ $wizard->set_step_text('input_page_title', __('Type in a title for your page.', 'nggallery'));
525
+ $wizard->set_step_target('input_page_title', 'input#title', 'bottom center', 'top center');
526
+ $wizard->set_step_view('input_page_title', 'input#title');
527
+
528
+ $wizard->add_step('add_gallery_button');
529
+ $wizard->set_step_text('add_gallery_button', __('Now click the "Add Gallery" button to open NextGEN\'s Insert Gallery Window (IGW).', 'nggallery'));
530
+ $wizard->set_step_target('add_gallery_button', 'a#ngg-media-button', 'right center', 'left center');
531
+ $wizard->set_step_view('add_gallery_button', 'a#ngg-media-button');
532
+ }
533
+
534
  $wizard->add_step('add_gallery_tab');
535
  $wizard->set_step_text('add_gallery_tab', __('Now click the "Upload Images" tab to add a new gallery.', 'nggallery'));
536
  $wizard->set_step_target('add_gallery_tab', '#attach_to_post_tabs a#ui-id-2', 'right center', 'left center');
538
  $wizard->set_step_context('add_gallery_tab', 'iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]');
539
  $wizard->set_step_lazy('add_gallery_tab', true);
540
  $wizard->set_step_condition('add_gallery_tab', 'nextgen_event', 'plupload_init', null, 10000);
541
+ $wizard->add_step('input_gallery_name');
542
+ $wizard->set_step_text('input_gallery_name', __('Select a name for your gallery.', 'nggallery'));
543
  $wizard->set_step_target('input_gallery_name', 'input#gallery_name:visible', 'bottom center', 'top center');
544
  $wizard->set_step_view('input_gallery_name', 'input#gallery_name');
545
  $wizard->set_step_context('input_gallery_name', array('iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]', 'iframe#ngg-iframe-create_tab'));
546
+ $wizard->set_step_lazy('input_gallery_name', true);
547
  // $wizard->set_step_condition('input_gallery_name', 'nextgen_event', 'plupload_init', null, 10000);
548
+ $wizard->add_step('select_images');
549
+ $wizard->set_step_text('select_images', __('Now click the "Add Files" button and select some images to add to the gallery.', 'nggallery'));
550
+ $wizard->set_step_target('select_images', 'a#uploader_browse', 'bottom center', 'top center');
551
+ $wizard->set_step_view('select_images', 'a#uploader_browse');
552
+ $wizard->set_step_context('select_images', array('iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]', 'iframe#ngg-iframe-create_tab'));
553
+ $wizard->set_step_lazy('select_images', true);
554
+ $wizard->add_step('upload_images');
555
+ $wizard->set_step_text('upload_images', __('Now click the "Start Upload" button to begin the upload process.', 'nggallery'));
556
+ $wizard->set_step_target('upload_images', 'a#uploader_upload', 'bottom center', 'top center');
557
+ $wizard->set_step_view('upload_images', 'a#uploader_upload');
558
+ $wizard->set_step_context('upload_images', array('iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]', 'iframe#ngg-iframe-create_tab'));
559
+ $wizard->set_step_lazy('upload_images', true);
560
+ $wizard->set_step_condition('upload_images', 'plupload_bind', 'UploadComplete', array('iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]', 'iframe#ngg-iframe-create_tab', '#uploader'));
561
+ $wizard->add_step('display_gallery_tab');
562
+ $wizard->set_step_text('display_gallery_tab', __('Congratulations! You just created your first gallery. Now let\'s insert it into the page. Click the "Insert into Page" tab.', 'nggallery'));
563
+ $wizard->set_step_target('display_gallery_tab', '#attach_to_post_tabs a#ui-id-1', 'right center', 'left center');
564
+ $wizard->set_step_view('display_gallery_tab', '#attach_to_post_tabs a#ui-id-1');
565
+ $wizard->set_step_context('display_gallery_tab', 'iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]');
566
+ $wizard->set_step_lazy('display_gallery_tab', true);
567
+ $wizard->set_step_condition('display_gallery_tab', 'wait', '500');
568
+ $wizard->add_step('display_type_select');
569
+ $wizard->set_step_text('display_type_select', __('Click on the "NextGEN Basic Slideshow" radio button to select the display type for the gallery.', 'nggallery'));
570
+ $wizard->set_step_target('display_type_select', '.display_type_preview input[value="photocrati-nextgen_basic_slideshow"]', 'bottom center', 'top center');
571
+ $wizard->set_step_view('display_type_select', '.display_type_preview input[type="radio"]');
572
+ $wizard->set_step_context('display_type_select', 'iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]');
573
+ $wizard->set_step_lazy('display_type_select', true);
574
+ $wizard->add_step('source_select');
575
+ $wizard->set_step_text('source_select', __('Now click inside the "Galleries" field and select your gallery.', 'nggallery'));
576
+ $wizard->set_step_target('source_select', '#source_configuration .galleries_column .select2-container input', 'right center', 'left center');
577
+ $wizard->set_step_view('source_select', '#source_configuration .galleries_column select');
578
+ $wizard->set_step_context('source_select', 'iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]');
579
+ $wizard->set_step_lazy('source_select', true);
580
+ $wizard->add_step('insert_gallery');
581
+ $wizard->set_step_text('insert_gallery', __('Now click on the "Insert Gallery" button to insert the gallery in your page.', 'nggallery'));
582
+ $wizard->set_step_target('insert_gallery', '#displayed_tab #save_displayed_gallery', 'top center', 'bottom left');
583
+ $wizard->set_step_view('insert_gallery', '#displayed_tab #save_displayed_gallery');
584
+ $wizard->set_step_context('insert_gallery', 'iframe[src*="' . NGG_ATTACH_TO_POST_SLUG . '"]');
585
+ $wizard->set_step_lazy('insert_gallery', true);
586
+ $wizard->set_step_condition('insert_gallery', 'wait', '1000');
587
+ $wizard->add_step('finish');
588
+ $wizard->set_step_text('finish', __('Congratulations! You just created your first gallery. You can now click the "Publish" button on the right to publish your page.', 'nggallery'));
589
+ }
590
+
591
+ function handle_wizards()
592
+ {
593
+ $wizards = C_NextGEN_Wizard_Manager::get_instance();
594
+
595
+ // adjust wizards state based on query/parameters
596
+ $wizards->handle_wizard_query();
597
+
598
+ global $ngg_fs;
599
+ // make sure we don't trigger the wizards if NGG Fremius is running or this is an AJAX request
600
+ if (isset($_REQUEST['ngg_dismiss_notice'])
601
+ || (is_admin()
602
+ // && C_NextGen_Admin_Page_Manager::is_requested()
603
+ && !M_Attach_To_Post::is_atp_url()
604
+ && !isset($_REQUEST['attach_to_post'])
605
+ && (!isset($ngg_fs) || !$ngg_fs->is_activation_mode())
606
+ && (!defined('DOING_AJAX') || !DOING_AJAX)))
607
+ {
608
+ $wizards->set_active(true);
609
+ }
610
+
611
+ // before adding notices or activating individual wizards, ensure wizards are globally enabled and no wizard is currently running already
612
+ if ($wizards->is_active() && $wizards->get_running_wizard() == null)
613
+ {
614
+ // add notice for gallery creation wizard
615
+ $wizard = $wizards->get_wizard('nextgen.beginner.gallery_creation_igw');
616
+
617
+ if (!$wizard->is_completed() && !$wizard->is_cancelled())
618
+ {
619
+ $mapper = C_Gallery_Mapper::get_instance();
620
+ if ($mapper->count() == 0)
621
+ {
622
+ $wizard->set_active(true);
623
+ // This notification was registered earlier; set_wizard() here makes the is_renderable() return TRUE
624
+ C_NextGen_First_Run_Notification_Wizard::set_wizard($wizard);
625
+ }
626
+ else if (isset($_GET['page']) && $_GET['page'] == 'nextgen-gallery') {
627
+ $wizard->set_active(true);
628
+ }
629
+ }
630
+ }
631
+ }
632
+
633
+ function enqueue_wizard_components()
634
+ {
635
  $router = C_Router::get_instance();
636
 
637
  // Wizards related scripts/styles
641
  array(),
642
  NGG_SCRIPT_VERSION
643
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
644
 
645
+ wp_register_script(
646
+ 'tourist',
647
+ $router->get_static_url('photocrati-nextgen_admin#tourist/tourist.js'),
648
+ array('jquery', 'backbone'),
649
+ NGG_SCRIPT_VERSION
650
+ );
651
+ wp_register_style(
652
+ 'tourist',
653
+ $router->get_static_url('photocrati-nextgen_admin#tourist/tourist.css'),
654
+ array('bootstrap-tooltip'),
655
+ NGG_SCRIPT_VERSION
656
+ );
657
+ wp_register_script(
658
+ 'ngg-wizards',
659
+ $router->get_static_url('photocrati-nextgen_admin#nextgen_wizards.js'),
660
+ array('tourist'),
661
+ NGG_SCRIPT_VERSION,
662
+ true
663
+ );
664
+ wp_register_style(
665
+ 'ngg-wizards',
666
+ $router->get_static_url('photocrati-nextgen_admin#nextgen_wizards.css'),
667
+ array('tourist'),
668
+ NGG_SCRIPT_VERSION
669
+ );
670
+
671
+ $wizards = C_NextGEN_Wizard_Manager::get_instance();
672
+ $wizard = $wizards->get_next_wizard();
673
+
674
+ if ($wizards->is_active() && $wizard != null) {
675
+ $data = array();
676
+ $data['starter'] = array('text' => $wizards->get_starter(), 'image' => $router->get_static_url('photocrati-nextgen_admin#imagely_icon.png'));
677
+ $running_wizard = $wizards->get_running_wizard();
678
+ $data['running_wizard'] = $running_wizard != null ? $running_wizard->get_id() : null;
679
+ $data['wizard_list'] = array($wizard->toData());
680
+ wp_localize_script('ngg-wizards', 'NextGEN_Wizard_Manager_State', $data);
681
+ if (method_exists('M_Gallery_Display', 'enqueue_fontawesome'))
682
+ M_Gallery_Display::enqueue_fontawesome();
683
+
684
+ wp_enqueue_style('ngg-wizards');
685
+ wp_enqueue_script('ngg-wizards');
686
+ };
687
+ }
688
+
689
+ /**
690
+ * Adds menu pages to manage NextGen Settings
691
+ * @uses action: admin_menu
692
+ */
693
+ function add_menu_pages()
694
+ {
695
+ C_NextGen_Admin_Page_Manager::get_instance()->setup();
696
+ }
697
 
698
  function get_type_list()
699
  {
700
  return array(
701
+ 'A_Fs_Access_Page' => 'adapter.fs_access_page.php',
702
+ 'A_MVC_Validation' => 'adapter.mvc_validation.php',
703
+ 'A_Nextgen_Admin_Default_Pages' => 'adapter.nextgen_admin_default_pages.php',
704
+ 'A_Nextgen_Settings_Routes' => 'adapter.nextgen_settings_routes.php',
705
+ 'C_Admin_Notification_Manager' => 'class.admin_notification_manager.php',
706
+ 'C_Admin_Requirements_Manager' => 'class.admin_requirements_manager.php',
707
+ 'C_Form' => 'class.form.php',
708
+ 'C_Form_Manager' => 'class.form_manager.php',
709
+ 'C_NextGEN_Wizard_Manager' => 'class.nextgen_wizard_manager.php',
710
+ 'C_NextGen_Admin_Page_Manager' => 'class.nextgen_admin_page_manager.php',
711
+ 'C_Nextgen_Admin_Installer' => 'class.nextgen_admin_installer.php',
712
+ 'C_Nextgen_Admin_Page_Controller' => 'class.nextgen_admin_page_controller.php',
713
+ 'C_NextGen_First_Run_Notification_Wizard' => 'class.nextgen_first_run_notification_wizard.php'
714
  );
715
  }
716
  }
717
 
718
  class C_NextGen_Admin_Installer
719
  {
720
+ function install()
721
+ {
722
+ $settings = C_NextGen_Settings::get_instance();
723
+
724
+ // In version 0.2 of this module and earlier, the following values
725
+ // were statically set rather than dynamically using a handler. Therefore, we need
726
+ // to delete those static values
727
+ $module_name = 'photocrati-nextgen_admin';
728
+ $modules = get_option('pope_module_list', array());
729
+ if (!$modules) {
730
+ $modules = $settings->get('pope_module_list', array());
731
+ }
732
+
733
+ $cleanup = FALSE;
734
+ foreach ($modules as $module) {
735
+ if (strpos($module, $module_name) !== FALSE) {
736
+ // Leave $module as-is: inside version_compare() will warn about passing items by reference
737
+ $module = explode('|', $module);
738
+ $val = array_pop($module);
739
+ if (version_compare($val, '0.3') == -1) {
740
+ $cleanup = TRUE;
741
+ }
742
+ break;
743
+ }
744
+ }
745
+
746
+ if ($cleanup) {
747
+ $keys = array(
748
+ 'jquery_ui_theme',
749
+ 'jquery_ui_theme_version',
750
+ 'jquery_ui_theme_url'
751
+ );
752
+ foreach ($keys as $key) $settings->delete($key);
753
+ }
754
+ }
755
  }
756
 
757
  class C_NextGen_Admin_Option_Handler
758
  {
759
+ function get_router()
760
+ {
761
+ return C_Router::get_instance();
762
+ }
763
+
764
+ function get($key, $default=NULL)
765
+ {
766
+ $retval = $default;
767
+
768
+ switch ($key) {
769
+ case 'jquery_ui_theme':
770
+ $retval = 'jquery-ui-nextgen';
771
+ break;
772
+ case 'jquery_ui_theme_version':
773
+ $retval = '1.8';
774
+ break;
775
+ case 'jquery_ui_theme_url':
776
+ $retval = $this->get_router()->get_static_url('photocrati-nextgen_admin#jquery-ui/jquery-ui-1.10.4.custom.css');
777
+ break;
778
+ }
779
+
780
+ return $retval;
781
+ }
782
  }
783
 
784
  new M_NextGen_Admin();
products/photocrati_nextgen/modules/nextgen_admin/package.module.nextgen_admin.php CHANGED
@@ -350,7 +350,12 @@ class C_Admin_Notification_Manager
350
  }
351
  ob_end_clean();
352
  echo json_encode($retval);
353
- throw new E_Clean_Exit();
 
 
 
 
 
354
  }
355
  }
356
  function render_notice($name)
@@ -904,18 +909,16 @@ class Mixin_NextGen_Admin_Page_Instance_Methods extends Mixin
904
  */
905
  function is_authorized_request($privilege = NULL)
906
  {
 
907
  if (!$privilege) {
908
  $privilege = $this->object->get_required_permission();
909
  }
910
- $security = $this->get_registry()->get_utility('I_Security_Manager');
911
- $retval = $sec_token = $security->get_request_token(str_replace(array(' ', "\n", "\t"), '_', $privilege));
912
- $sec_actor = $security->get_current_actor();
913
  // Ensure that the user has permission to access this page
914
- if (!$sec_actor->is_allowed($privilege)) {
915
  $retval = FALSE;
916
  }
917
  // Ensure that nonce is valid
918
- if ($this->object->is_post_request() && !$sec_token->check_current_request()) {
919
  $retval = FALSE;
920
  }
921
  return $retval;
@@ -926,7 +929,7 @@ class Mixin_NextGen_Admin_Page_Instance_Methods extends Mixin
926
  */
927
  function get_required_permission()
928
  {
929
- return $this->object->name;
930
  }
931
  // Sets an appropriate screen for NextGEN Admin Pages
932
  function set_screen()
@@ -1103,7 +1106,7 @@ class Mixin_NextGen_Admin_Page_Instance_Methods extends Mixin
1103
  }
1104
  }
1105
  // Render the view
1106
- $index_params = array('page_heading' => $this->object->get_page_heading(), 'tabs' => $tabs, 'forms' => $forms, 'errors' => $errors, 'success' => $success, 'header_message' => $this->object->get_header_message(), 'form_header' => $token->get_form_html(), 'show_save_button' => $this->object->show_save_button(), 'model' => $this->object->has_method('get_model') ? $this->get_model() : NULL, 'logo' => $this->get_router()->get_static_url('photocrati-nextgen_admin#imagely_icon.png'));
1107
  $index_params = array_merge($index_params, $this->object->get_index_params());
1108
  $this->render_partial($this->object->index_template(), $index_params);
1109
  } else {
@@ -1308,6 +1311,56 @@ class C_Page_Manager
1308
  return C_NextGen_Admin_Page_Manager::is_requested();
1309
  }
1310
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1311
  /**
1312
  * Class C_NextGEN_Wizard
1313
  */
350
  }
351
  ob_end_clean();
352
  echo json_encode($retval);
353
+ // E_Clean_Exit causes warnings to be appended to XHR responses, potentially breaking the client JS
354
+ if (!defined('NGG_DISABLE_SHUTDOWN_EXCEPTION_HANDLER') || !NGG_DISABLE_SHUTDOWN_EXCEPTION_HANDLER) {
355
+ throw new E_Clean_Exit();
356
+ } else {
357
+ exit;
358
+ }
359
  }
360
  }
361
  function render_notice($name)
909
  */
910
  function is_authorized_request($privilege = NULL)
911
  {
912
+ $retval = TRUE;
913
  if (!$privilege) {
914
  $privilege = $this->object->get_required_permission();
915
  }
 
 
 
916
  // Ensure that the user has permission to access this page
917
+ if (!M_Security::is_allowed($privilege)) {
918
  $retval = FALSE;
919
  }
920
  // Ensure that nonce is valid
921
+ if ($this->object->is_post_request() && (isset($_REQUEST['nonce']) && !M_Security::verify_nonce($_REQUEST['nonce'], $privilege))) {
922
  $retval = FALSE;
923
  }
924
  return $retval;
929
  */
930
  function get_required_permission()
931
  {
932
+ return str_replace(array(' ', "\n", "\t"), '_', $this->object->name);
933
  }
934
  // Sets an appropriate screen for NextGEN Admin Pages
935
  function set_screen()
1106
  }
1107
  }
1108
  // Render the view
1109
+ $index_params = array('page_heading' => $this->object->get_page_heading(), 'tabs' => $tabs, 'forms' => $forms, 'errors' => $errors, 'success' => $success, 'form_header' => FALSE, 'header_message' => $this->object->get_header_message(), 'nonce' => M_Security::create_nonce($this->object->get_required_permission()), 'show_save_button' => $this->object->show_save_button(), 'model' => $this->object->has_method('get_model') ? $this->get_model() : NULL, 'logo' => $this->get_router()->get_static_url('photocrati-nextgen_admin#imagely_icon.png'));
1110
  $index_params = array_merge($index_params, $this->object->get_index_params());
1111
  $this->render_partial($this->object->index_template(), $index_params);
1112
  } else {
1311
  return C_NextGen_Admin_Page_Manager::is_requested();
1312
  }
1313
  }
1314
+ class C_NextGen_First_Run_Notification_Wizard
1315
+ {
1316
+ protected static $wizard = NULL;
1317
+ protected static $_instance = NULL;
1318
+ /**
1319
+ * @return bool
1320
+ */
1321
+ public function is_renderable()
1322
+ {
1323
+ return is_null(self::$wizard) ? FALSE : TRUE;
1324
+ }
1325
+ /**
1326
+ * @return string
1327
+ */
1328
+ public function render()
1329
+ {
1330
+ if (!self::$wizard) {
1331
+ return '';
1332
+ }
1333
+ $wizard = self::$wizard;
1334
+ return __('Thanks for installing NextGEN Gallery! Want help creating your first gallery?', 'nggallery') . ' <a data-ngg-wizard="' . $wizard->get_id() . '" class="ngg-wizard-invoker" href="' . esc_url(add_query_arg('ngg_wizard', $wizard->get_id())) . '">' . __('Launch the Gallery Wizard', 'nggallery') . '</a>. ' . __('If you close this message, you can also launch the Gallery Wizard at any time from the', 'nggallery') . ' <a href="' . esc_url(admin_url('admin.php?page=nextgen-gallery')) . '">' . __('NextGEN Overview page', 'nggallery') . '</a>.';
1335
+ }
1336
+ public function get_css_class()
1337
+ {
1338
+ return 'updated';
1339
+ }
1340
+ public function is_dismissable()
1341
+ {
1342
+ return TRUE;
1343
+ }
1344
+ public function dismiss($code)
1345
+ {
1346
+ return array('handled' => TRUE);
1347
+ }
1348
+ /**
1349
+ * @return C_NextGen_First_Run_Notification_Wizard
1350
+ */
1351
+ public static function get_instance()
1352
+ {
1353
+ if (!isset(self::$_instance)) {
1354
+ $klass = get_class();
1355
+ self::$_instance = new $klass();
1356
+ }
1357
+ return self::$_instance;
1358
+ }
1359
+ public static function set_wizard($wizard)
1360
+ {
1361
+ self::$wizard = $wizard;
1362
+ }
1363
+ }
1364
  /**
1365
  * Class C_NextGEN_Wizard
1366
  */
products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.css CHANGED
@@ -521,10 +521,10 @@ table.nextgen_settings_position {
521
  color: transparent;
522
  content: "\2022";
523
  display:block;
524
- height: 16px;
525
- margin: 0 0 0 -1px;
526
  vertical-align: middle;
527
- width: 16px;
528
  }
529
 
530
  /***** 5) NGG Admin CSS: Tables *****/
521
  color: transparent;
522
  content: "\2022";
523
  display:block;
524
+ height: 17px;
525
+ margin: -1px 0 0 -1px;
526
  vertical-align: middle;
527
+ width: 17px;
528
  }
529
 
530
  /***** 5) NGG Admin CSS: Tables *****/
products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.js CHANGED
@@ -51,7 +51,7 @@ jQuery(function($){
51
  }
52
 
53
  // Check if this is a proxy button for another field
54
- if ($button.attr('name').indexOf('_proxy') != -1) {
55
 
56
  // Get the value to set
57
  var value = $button.attr('data-proxy-value');
51
  }
52
 
53
  // Check if this is a proxy button for another field
54
+ if ($button.attr('name') && $button.attr('name').indexOf('_proxy') != -1) {
55
 
56
  // Get the value to set
57
  var value = $button.attr('data-proxy-value');
products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.min.css CHANGED
@@ -1 +1 @@
1
- #ngg_page_content.ngg_settings_page .ngg_page_content_main .watermark_field img,.url_field{max-width:100%}.ngg-admin .notice,.ngg-admin div.error,.ngg-admin div.updated{margin:20px 15px 0 0}.ngg-admin #ngg_page_content .notice,.ngg-admin #ngg_page_content div.error,.ngg-admin #ngg_page_content div.updated{margin:20px 0}.hidden{display:none}.nextgen_advanced_toggle_link{font-size:11px;position:relative;bottom:5px;color:#444}.url_field{width:400px}.nextgen_settings_field_colorpicker{width:85px!important;text-align:center;margin-left:50px}#ngg_page_content .wp-picker-container,#ngg_page_content .wp-picker-holder,#ngg_page_content .wp-picker-input-wrap{position:initial!important}#nextgen_settings_wmXpos,#nextgen_settings_wmYpos{width:65px!important}table.nextgen_settings_position{width:auto!important}#ngg_page_content label.tooltip,#ngg_page_content span.tooltip{outline:0;background-image:url(information.png);background-repeat:no-repeat;padding-left:22px;padding-bottom:4px;background-size:18px}#poststuff .ui-accordion h3{padding-left:25px}#lightbox_effects_content table tr td:first-child{vertical-align:top;text-align:right;padding-right:7px;padding-top:5px}#lightbox_effects_content tr{height:28px}.ngg-admin #screen-meta-links{padding-bottom:20px}.ngg-admin #wpbody{position:static}#ngg_page_content{padding-bottom:0;width:98%;font-family:lato,sans-serif;height:auto;margin-top:25px;float:left;box-shadow:0 0 100px 10px rgba(0,0,0,.05)}#adminmenu .wp-submenu a[href*=ngg_pro_upgrade]{color:#9fbb1a;font-weight:600}.toplevel_page_nextgen-gallery #ngg_page_content{margin-top:20px}#ngg_page_content.ngg_settings_page{background:#fff}.ngg_gallery_sort,.ngg_manage_albums,.ngg_manage_galleries,.ngg_manage_images{background:#fcfcfc}#ngg_page_content .wrap{margin:0}#ngg_page_content .about-wrap{max-width:100%;float:left;background:#fcfcfc}#ngg_page_content a{color:#9fbb1a}#ngg_page_content .button-primary,#ngg_page_content .button-secondary,#ngg_page_content button{background-color:#9FBB1A;color:#fff!important;border:none!important;box-shadow:none!important;text-shadow:none!important;height:35px!important;padding:0 24px!important;line-height:35px;width:auto!important;border-radius:3px;text-transform:uppercase;letter-spacing:1px;font-size:11px;font-weight:700;font-family:Lato,sans-serif}#ngg_page_content .button-primary:hover,#ngg_page_content .button-secondary:hover,#ngg_page_content button:hover{background-color:#A9C524}#ngg_page_content .button-primary:active,#ngg_page_content .button-secondary:active,#ngg_page_content button:active{vertical-align:middle}#ngg_page_content .button-secondary{background-color:#888!important}.ngg-admin #ngg_page_content .notice button,.ngg-admin #ngg_page_content div.error button,.ngg-admin #ngg_page_content div.updated button{background-color:transparent!important;padding:0}#ngg_page_content button,.ngg-admin .notice button,.ngg-admin div.error button,.ngg-admin div.updated button{background:0 0}#ngg_page_content button.wp-color-result{height:24px!important;padding:0 0 0 30px!important;border:1px solid #ddd!important}#ngg_page_content button.wp-color-result:hover{background-color:transparent}#ngg_page_content input[type=checkbox]{height:16px!important;width:16px!important}#ngg_page_content.ngg_settings_page form>p{width:81%;background:#fff;margin:0;float:right}#ngg_page_content .ngg_save_settings_button{margin:30px;font-weight:700;height:40px!important;padding:0 40px!important}#ngg_page_content ::-webkit-input-placeholder{color:#aaa}#ngg_page_content :-ms-input-placeholder{color:#aaa}#ngg_page_content ::-moz-placeholder{color:#aaa;opacity:1}#ngg_page_content :-moz-placeholder{color:#aaa;opacity:1}.ngg-admin .select2-drop.select2-drop-above .select2-search input{width:100%}#ngg_page_content .ngg_page_content_header{border-bottom:10px solid #9FBB1A;height:80px;padding:0 0 0 20px;background:#143650;margin-top:-23px}#ngg_page_content .ngg_page_content_header img{height:40px;padding-top:20px;padding-right:20px;float:left;width:auto}#ngg_page_content .ngg_page_content_header h2,#ngg_page_content .ngg_page_content_header h3{line-height:80px;color:#fff;font-size:18px;font-family:Lato,sans-serif;text-transform:uppercase;letter-spacing:2px;text-align:left;font-weight:900}#ngg_page_content .ngg_page_content_header p{float:right;margin:-98px 0 0;font-size:15px;font-style:italic;font-weight:400;background:rgba(93,134,167,.18);padding:0 40px;border-left:1px solid #566b7c;color:#a7b8c6;line-height:80px}#ngg_page_content .ngg_page_content_header p a{text-decoration:none;font-weight:500;background:#aac43b;color:#fff;padding:5px 10px;font-style:normal;margin:-1px 0 0 20px;border-radius:1px;text-transform:uppercase}#ngg_page_content .ngg_page_content_header .ngg_save_settings_button{margin:0!important}#ngg_page_content .ngg_page_content_menu{width:20%;float:left;padding:0;height:100%;background:0 0}#ngg_page_content .ngg_page_content_menu a{box-shadow:none!important;cursor:pointer;display:block;padding:20px 10px 20px 15px;line-height:22px;margin:0;text-decoration:none;color:#2b5d89;text-transform:uppercase;font-size:11px;border-bottom:1px solid #eee;font-weight:600;letter-spacing:1.2px}.responsive-menu-icon{cursor:pointer;display:none;margin-bottom:5px;text-align:left}.responsive-menu-icon::before{color:#fff;content:'\f0c9';display:block;font:400 20px/1 'Font Awesome 5 Free';margin:0 auto;text-align:center;font-weight:900}#ngg_page_content .ngg_page_content_menu .ngg_page_content_menu_active,#ngg_page_content .ngg_page_content_menu a:active{outline:transparent 0;border-right:1px solid #fff;background:#9ebc1b;position:relative;color:#fff;margin-right:-1px;font-weight:800;border-bottom:1px solid #9dbd1b}#ngg_page_content .ngg_page_content_menu a:before{float:left;font:400 16px/1 'Font Awesome 5 Free';height:16px;right:0;margin-top:3px;text-align:right;z-index:9999;padding-right:10px;content:"\f1de";font-weight:900}#ngg_page_content .ngg_page_content_menu .ngg_page_content_menu_active:after,#ngg_page_content .ngg_page_content_menu a:active:after{right:0;border:8px solid transparent;content:"";width:0;position:absolute;pointer-events:none;border-right-color:#fff;top:50%;margin-top:-8px}#ngg_page_content .ngg_page_content_main{padding:10px 20px 20px 30px;min-height:600px;float:left;background:#fff;box-sizing:border-box;width:100%;box-shadow:0 -5px 4px 2px rgba(0,0,0,.05)}#ngg_page_content .ngg_overview .ngg_page_content_main,#ngg_page_content.ngg_settings_page .ngg_page_content_main{width:80%}.gallery_page_ngg_display_settings #ngg_page_content.ngg_settings_page .ngg_page_content_main{min-height:1000px}.gallery_page_ngg_other_options #ngg_page_content.ngg_settings_page .ngg_page_content_main{min-height:400px}#ngg_page_content .ngg_manage_tags .ngg_page_content_main{padding:0}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main>div,#ngg_page_content .ngg_overview .ngg_page_content_main>div,#ngg_page_content.ngg_settings_page .ngg_page_content_main>div{display:none}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main>div:first-of-type,#ngg_page_content .ngg_overview .ngg_page_content_main>div:first-of-type,#ngg_page_content.ngg_settings_page .ngg_page_content_main>div:first-of-type{display:block}#ngg_page_content.ngg_settings_page .ngg_page_content_main h3{color:rgba(29,36,42,.85);font-size:18px;margin:20px 0 30px;text-transform:uppercase}#ngg_page_content .ngg_page_content_main input,#ngg_page_content .ngg_page_content_main select{color:#888;height:35px;border:1px solid #ddd;padding-left:10px;width:200px;box-shadow:inset 0 0 2px 1px rgba(100,100,100,.05)}#ngg_page_content .ngg_page_content_main select{font-size:13px}#ngg_page_content .ngg_page_content_main .select2-container{width:200px!important;line-height:0}#ngg_page_content .ngg_page_content_main .select2-selection--multiple,#ngg_page_content .ngg_page_content_main .select2-selection--single{border:1px solid #ddd}#ngg_page_content .ngg_page_content_main .select2-search{width:100%}#ngg_page_content .ngg_page_content_main .select2-search__field{border-radius:3px}#ngg_page_content .ngg_page_content_main .select2-selection__choice{background:#9fbb1a;border:none;box-shadow:none;color:#fff;line-height:20px;padding:7px 10px 7px 8px;width:92%}#ngg_page_content .ngg_page_content_main .select2-selection__choice__remove{color:#fff;margin-right:6px}#ngg_page_content .ngg_page_content_main div[data-id=lightbox_effects] .select2-container,#ngg_page_content .ngg_page_content_main div[data-id=lightbox_effects] input,#ngg_page_content .ngg_page_content_main div[data-id=lightbox_effects] select{width:250px}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main input[type=radio],#ngg_page_content.ngg_settings_page .ngg_page_content_main input[type=radio]{border-radius:50%!important;height:16px!important;width:16px!important;padding:0!important;vertical-align:middle}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main input[type=radio]:checked:before,#ngg_page_content.ngg_settings_page .ngg_page_content_main input[type=radio]:checked:before{background-color:#9FBB1A;border-radius:50%;color:transparent;content:"\2022";display:block;height:16px;margin:0 0 0 -1px;vertical-align:middle;width:16px}#tr_photocrati-nextgen_basic_imagebrowser_ngg_triggers_display,#tr_photocrati-nextgen_basic_slideshow_ngg_triggers_display,.ngg-post-type .ngg_admin_notice{display:none}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main table,#ngg_page_content.ngg_settings_page .ngg_page_content_main table{color:rgba(29,36,42,.85);border-collapse:collapse;width:100%}#ngg_page_content table .sorting-indicator:before{color:#fff!important}#attach_to_post_tabs #displayed_tab #display_settings_tab_content table tr,#ngg_page_content.ngg_settings_page .ngg_page_content_main table tr{border:1px solid #f7f8f3;padding:5px 0!important;height:auto}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main table tr td,#ngg_page_content.ngg_settings_page .ngg_page_content_main table tr td,#ngg_page_content.ngg_settings_page .ngg_page_content_main table tr th{line-height:30px;vertical-align:middle;padding:10px 20px;box-sizing:border-box}.ngg-admin #ngg_page_content .widefat td,.ngg-admin #ngg_page_content .widefat th{padding:10px;color:#aaa;vertical-align:middle}.ngg-admin #ngg_page_content .widefat tfoot th,.ngg-admin #ngg_page_content .widefat thead th{padding:0 10px;color:#fff;text-transform:uppercase}#ngg_page_content.ngg_settings_page .ngg_page_content_main table tr th{font-weight:400!important;font-size:13px!important;line-height:1.5!important}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main table tr td:first-of-type{width:300px;text-align:left;font-weight:400;padding-top:8px}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main table table tr td:first-of-type,#ngg_page_content.ngg_settings_page .ngg_page_content_main table table tr td:first-of-type{width:auto;font-weight:400;padding:10px 20px}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main table tr:nth-of-type(2n),#ngg_page_content.ngg_settings_page .ngg_page_content_main table tr:nth-of-type(2n){background-color:#f7f8f3}#ngg_page_content.ngg_settings_page .ngg_page_content_main tr.watermark_field{padding:10px 0!important}#ngg_page_content.ngg_settings_page .ngg_page_content_main .watermark_field table{border:1px solid #d3e1c8}#ngg_page_content.ngg_settings_page .ngg_page_content_main .watermark_field table td{padding:5px 15px!important}#ngg_page_content.ngg_settings_page .ngg_page_content_main .watermark_field table td:first-of-type{width:auto!important}#ngg_page_content.ngg_settings_page .ngg_page_content_main .watermark_field table tr{border:none;padding:0!important}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main label,#ngg_page_content.ngg_settings_page .ngg_page_content_main label,#ngg_page_content.ngg_settings_page .ngg_page_content_main p.description{font-size:14px;color:#666}#ngg_page_content.ngg_settings_page .ngg_page_content_main label{margin-right:5px}#ngg_page_content.ngg_settings_page .ngg_page_content_main label:last-of-type{margin-right:15px}#ngg_page_content.ngg_settings_page .nextgen_settings_position td,#ngg_page_content.ngg_settings_page .nextgen_settings_position tr:nth-of-type(2n){border:none!important}#ngg_page_content.ngg_settings_page .nextgen_pro_lightbox_admin_header{background:#38576f!important;margin-top:20px}.nextgen_pro_lightbox_admin_header td{padding-left:0!important}.nextgen_pro_lightbox_admin_header td h3{text-transform:none!important;color:#fff!important;margin:0 0 0 20px!important}.ngg_options_promo{background:#224460;color:#fff;font-family:Lato,sans-serif;font-size:14px;font-weight:600}.ngg_options_promo a{text-decoration:none;font-weight:600;margin-left:6px}.gallery_page_ngg_other_options #ngg_page_content .ngg_page_content_main tbody tr td.ngg_options_promo{width:100%!important}.ngg-post-type .ngg_page_content_main .button,.ngg-post-type .ngg_page_content_main .page-title-action{background-color:#9FBB1A!important;color:#fff!important;border:none!important;box-shadow:none!important;text-shadow:none!important;height:35px!important;padding:0 15px!important;line-height:35px;width:auto!important}.ngg-post-type .ngg_page_content_main .button:hover,.ngg-post-type .ngg_page_content_main .page-title-action:hover{background-color:#A9C524!important}.ngg-post-type .ngg_page_content_main .page-title-action{padding:8px 16px!important}.ngg-post-type .ngg_page_content_main .tablenav{margin:0 0 20px}.ngg-post-type .ngg_page_content_main .tablenav .actions,.ngg-post-type .ngg_page_content_main .tablenav .tablenav-pages{margin:10px 0}.ngg-post-type .ngg_page_content_main .tablenav .tablenav-pages a,.ngg-post-type .ngg_page_content_main .tablenav-pages-navspan{background:#556472;border:none;color:#fff!important;margin:0 2px}.ngg-post-type #ngg_page_content .ngg_page_content_main .tablenav input.current-page{width:50px!important}.ngg-post-type .ngg_page_content_main table{box-shadow:none;table-layout:auto;border:1px solid rgba(159,187,26,.08)}.ngg-post-type .ngg_page_content_main table tfoot,.ngg-post-type .ngg_page_content_main table thead{background-color:#38576f;text-transform:uppercase}.ngg-post-type .ngg_page_content_main table tfoot{background-color:#38576f}.ngg-post-type .ngg_page_content_main table tfoot a,.ngg-post-type .ngg_page_content_main table thead a{padding:0}.ngg-post-type .ngg_page_content_main table tfoot span,.ngg-post-type .ngg_page_content_main table thead span{color:#fff;font-size:15px}.ngg-post-type .ngg_page_content_main table thead td,.ngg-post-type .ngg_page_content_main table thead th{background-color:transparent;border:none;color:#fff}.ngg-post-type .ngg_page_content_main table thead td{padding:12px 5px!important}.ngg-post-type #ngg_page_content .ngg_page_content_main input[type=checkbox]{height:13px!important;width:13px!important;min-width:auto;margin-top:2px}.ngg-post-type #ngg_page_content .ngg_page_content_main input[type=checkbox]:checked:before{color:#9FBB1A;margin:-5px 0 0 -5px}.ngg-post-type #ngg_page_content .sorting-indicator:before{color:#fff!important}.ngg-post-type .ngg_page_content_main .striped>tbody>:nth-child(odd){background-color:#f7f8f3}.ngg-post-type .ngg_page_content_main a.row-title{font-weight:400}.ngg-post-type .ngg_page_content_main .row-actions{left:0;padding-top:0}.ngg-post-type .ngg_page_content_main .row-actions a{color:#aaa!important}.ngg-post-type .ngg_page_content_main td.column-title strong{margin-bottom:0}.ngg-post-type #wpbody-content .quick-edit-row-page .inline-edit-col-left{width:100%}.ngg-post-type #ngg_page_content .widefat td,.ngg-post-type #ngg_page_content .widefat th{padding:10px;color:#aaa;vertical-align:middle}.ngg-post-type #ngg_page_content .widefat tfoot th,.ngg-post-type #ngg_page_content .widefat thead th{padding:0 10px;color:#fff;text-transform:uppercase}.ngg-post-type .ngg_page_content_main .tablenav.bottom{margin:10px 0 0}.ngg-admin #postbox-container-2 h2.ui-sortable-handle,.ngg-post-type #ngg_page_content h3.accordion_tab{padding:10px;background:#38576f;margin-bottom:0}.ngg-admin #postbox-container-2 h2.ui-sortable-handle,.ngg-post-type #ngg_page_content h3.accordion_tab a{color:#fff;text-decoration:none}.ngg-admin #postbox-container-2 .postbox,.ngg-post-type .accordion>div{border-left:1px solid rgba(159,187,26,.05);border-bottom:1px solid rgba(159,187,26,.05);border-right:1px solid rgba(159,187,26,.05);margin-bottom:30px;background-color:#f7f8f3}.ngg-post-type .accordion>div{padding:20px;margin-bottom:30px}.ngg-post-type .accordion>div table{border:none}.ngg-admin #postbox-container-2 .postbox .inside{margin:0}.ngg-admin #postbox-container-2 .postbox .inside a{color:#9fbb1a}.ngg-admin #postbox-container-2 .postbox .inside td,.ngg-admin #postbox-container-2 .postbox .inside th{padding:5px 10px}.ngg-admin #postbox-container-2 .postbox .inside .button-primary,.ngg-post-type .accordion>div .button-primary{margin:15px 0 0}.ngg-post-type table input[type=text]{margin:0}@media (max-width:1030px){#ngg_page_content .ngg_page_content_header p{padding:0 20px}}@media (max-width:900px){#ngg_page_content .ngg_page_content_header p{display:none}}@media (max-width:782px){.ngg-post-type #ngg_page_content button.toggle-row{width:40px!important;height:40px!important;background:0 0!important}.ngg-post-type tr:not(.inline-edit-row):not(.no-items) td.column-primary~td:not(.check-column){padding:3px 8px 3px 35%}.ngg-post-type #ngg_page_content .ngg_page_content_main input[type=checkbox]:checked:before{font:400 20px/1 dashicons!important}#ngg_page_content .ngg_page_content_header img{padding-right:10px}#ngg_page_content .ngg_overview .ngg_page_content_header h3,#ngg_page_content .ngg_page_content_header h3{font-size:14px}#ngg_page_content .ngg_overview .ngg_page_content_main,#ngg_page_content .ngg_page_content_menu,#ngg_page_content.ngg_settings_page .ngg_page_content_main{width:100%}#ngg_page_content .ngg_page_content_main,#ngg_page_content.ngg_settings_page .ngg_page_content_main{padding:20px}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main table,#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main tbody,#ngg_page_content.ngg_settings_page .ngg_page_content_main table,#ngg_page_content.ngg_settings_page .ngg_page_content_main tbody{display:block!important;max-width:100%}#attach_to_post_tabs #displayed_tab #ngg_page_content #slug_configuration,#ngg_page_content.ngg_settings_page .ngg_page_content_main tbody.hidden{display:none!important}#attach_to_post_tabs #displayed_tab #display_settings_tab_content table tr,#ngg_page_content.ngg_settings_page .ngg_page_content_main table tr{display:block!important;padding:10px 0 20px!important}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main table tr td,#ngg_page_content.ngg_settings_page .ngg_page_content_main table tr td,#ngg_page_content.ngg_settings_page .ngg_page_content_main table tr th{display:block;padding:2px 10px}#ngg_page_content.ngg_settings_page .ngg_page_content_main table.nextgen_settings_position tr td{display:table-cell}#ngg_page_content.ngg_settings_page .ngg_page_content_main h2,#ngg_page_content.ngg_settings_page .ngg_page_content_main h3{text-align:center}#ngg_page_content.ngg_settings_page form>p{width:100%;padding:15px;box-sizing:border-box}#ngg_page_content .ngg_page_content_main input,#ngg_page_content .ngg_page_content_main select{max-width:100%;margin:5px 0;box-sizing:border-box}#ngg_page_content .ngg_page_content_main .select2-container,#ngg_page_content .ngg_page_content_main input[type=number],#ngg_page_content .ngg_page_content_main input[type=text],#ngg_page_content .ngg_page_content_main select{width:100%!important}#ngg_page_content button.wp-color-result{width:auto!important}#ngg_page_content button.wp-color-result .wp-color-result-text{line-height:22px}.ngg-post-type .ngg_page_content_main .subsubsub,.ngg-post-type .ngg_page_content_main .tablenav .actions{width:100%}.ngg-post-type #ngg_page_content .ngg_page_content_main input,.ngg-post-type #ngg_page_content .ngg_page_content_main select{width:100%!important;max-width:100%;margin:5px 0;box-sizing:border-box}#ngg_page_content input[type=checkbox]{width:16px!important}#ngg_page_content .button-primary,#ngg_page_content .button-secondary,#ngg_page_content button{width:100%!important;margin:4px 0;display:block;text-align:center}.ngg-post-type .ngg_page_content_main .button,.ngg-post-type .ngg_page_content_main .page-title-action{width:80%!important;display:block;text-align:center;margin:10px auto 20px;padding:0!important}.ngg-post-type .ngg_page_content_main .displaying-num{display:none}#gallery_selection label{display:block;padding-bottom:8px}.post-type-ngg_pricelist .accordion table{width:100%!important}.post-type-ngg_pricelist .accordion #manual_shipping_options td{display:block;width:100%!important}.post-type-ngg_pricelist #ngg_page_content .accordion table input.shipping_rate{width:100%;max-width:100%}.post-type-ngg_pricelist .accordion input[type=checkbox]:checked:before{font:400 21px/1 dashicons}.ngg-post-type #ngg_page_content h1{text-align:center;display:block}#ngg_page_content .responsive-menu-icon{display:block;background:#9fbb1a;padding:10px 0 15px}#ngg_page_content .responsive-menu{display:none;float:none;margin:0}#ngg_page_content .responsive-menu a{display:block}#ngg_page_content .ngg_page_content_menu .ngg_page_content_menu_active:after,#ngg_page_content .ngg_page_content_menu a:active:after{display:none}}
1
+ #ngg_page_content.ngg_settings_page .ngg_page_content_main .watermark_field img,.url_field{max-width:100%}.ngg-admin .notice,.ngg-admin div.error,.ngg-admin div.updated{margin:20px 15px 0 0}.ngg-admin #ngg_page_content .notice,.ngg-admin #ngg_page_content div.error,.ngg-admin #ngg_page_content div.updated{margin:20px 0}.hidden{display:none}.nextgen_advanced_toggle_link{font-size:11px;position:relative;bottom:5px;color:#444}.url_field{width:400px}.nextgen_settings_field_colorpicker{width:85px!important;text-align:center;margin-left:50px}#ngg_page_content .wp-picker-container,#ngg_page_content .wp-picker-holder,#ngg_page_content .wp-picker-input-wrap{position:initial!important}#nextgen_settings_wmXpos,#nextgen_settings_wmYpos{width:65px!important}table.nextgen_settings_position{width:auto!important}#ngg_page_content label.tooltip,#ngg_page_content span.tooltip{outline:0;background-image:url(information.png);background-repeat:no-repeat;padding-left:22px;padding-bottom:4px;background-size:18px}#poststuff .ui-accordion h3{padding-left:25px}#lightbox_effects_content table tr td:first-child{vertical-align:top;text-align:right;padding-right:7px;padding-top:5px}#lightbox_effects_content tr{height:28px}.ngg-admin #screen-meta-links{padding-bottom:20px}.ngg-admin #wpbody{position:static}#ngg_page_content{padding-bottom:0;width:98%;font-family:lato,sans-serif;height:auto;margin-top:25px;float:left;box-shadow:0 0 100px 10px rgba(0,0,0,.05)}#adminmenu .wp-submenu a[href*=ngg_pro_upgrade]{color:#9fbb1a;font-weight:600}.toplevel_page_nextgen-gallery #ngg_page_content{margin-top:20px}#ngg_page_content.ngg_settings_page{background:#fff}.ngg_gallery_sort,.ngg_manage_albums,.ngg_manage_galleries,.ngg_manage_images{background:#fcfcfc}#ngg_page_content .wrap{margin:0}#ngg_page_content .about-wrap{max-width:100%;float:left;background:#fcfcfc}#ngg_page_content a{color:#9fbb1a}#ngg_page_content .button-primary,#ngg_page_content .button-secondary,#ngg_page_content button{background-color:#9FBB1A;color:#fff!important;border:none!important;box-shadow:none!important;text-shadow:none!important;height:35px!important;padding:0 24px!important;line-height:35px;width:auto!important;border-radius:3px;text-transform:uppercase;letter-spacing:1px;font-size:11px;font-weight:700;font-family:Lato,sans-serif}#ngg_page_content .button-primary:hover,#ngg_page_content .button-secondary:hover,#ngg_page_content button:hover{background-color:#A9C524}#ngg_page_content .button-primary:active,#ngg_page_content .button-secondary:active,#ngg_page_content button:active{vertical-align:middle}#ngg_page_content .button-secondary{background-color:#888!important}.ngg-admin #ngg_page_content .notice button,.ngg-admin #ngg_page_content div.error button,.ngg-admin #ngg_page_content div.updated button{background-color:transparent!important;padding:0}#ngg_page_content button,.ngg-admin .notice button,.ngg-admin div.error button,.ngg-admin div.updated button{background:0 0}#ngg_page_content button.wp-color-result{height:24px!important;padding:0 0 0 30px!important;border:1px solid #ddd!important}#ngg_page_content button.wp-color-result:hover{background-color:transparent}#ngg_page_content input[type=checkbox]{height:16px!important;width:16px!important}#ngg_page_content.ngg_settings_page form>p{width:81%;background:#fff;margin:0;float:right}#ngg_page_content .ngg_save_settings_button{margin:30px;font-weight:700;height:40px!important;padding:0 40px!important}#ngg_page_content ::-webkit-input-placeholder{color:#aaa}#ngg_page_content :-ms-input-placeholder{color:#aaa}#ngg_page_content ::-moz-placeholder{color:#aaa;opacity:1}#ngg_page_content :-moz-placeholder{color:#aaa;opacity:1}.ngg-admin .select2-drop.select2-drop-above .select2-search input{width:100%}#ngg_page_content .ngg_page_content_header{border-bottom:10px solid #9FBB1A;height:80px;padding:0 0 0 20px;background:#143650;margin-top:-23px}#ngg_page_content .ngg_page_content_header img{height:40px;padding-top:20px;padding-right:20px;float:left;width:auto}#ngg_page_content .ngg_page_content_header h2,#ngg_page_content .ngg_page_content_header h3{line-height:80px;color:#fff;font-size:18px;font-family:Lato,sans-serif;text-transform:uppercase;letter-spacing:2px;text-align:left;font-weight:900}#ngg_page_content .ngg_page_content_header p{float:right;margin:-98px 0 0;font-size:15px;font-style:italic;font-weight:400;background:rgba(93,134,167,.18);padding:0 40px;border-left:1px solid #566b7c;color:#a7b8c6;line-height:80px}#ngg_page_content .ngg_page_content_header p a{text-decoration:none;font-weight:500;background:#aac43b;color:#fff;padding:5px 10px;font-style:normal;margin:-1px 0 0 20px;border-radius:1px;text-transform:uppercase}#ngg_page_content .ngg_page_content_header .ngg_save_settings_button{margin:0!important}#ngg_page_content .ngg_page_content_menu{width:20%;float:left;padding:0;height:100%;background:0 0}#ngg_page_content .ngg_page_content_menu a{box-shadow:none!important;cursor:pointer;display:block;padding:20px 10px 20px 15px;line-height:22px;margin:0;text-decoration:none;color:#2b5d89;text-transform:uppercase;font-size:11px;border-bottom:1px solid #eee;font-weight:600;letter-spacing:1.2px}.responsive-menu-icon{cursor:pointer;display:none;margin-bottom:5px;text-align:left}.responsive-menu-icon::before{color:#fff;content:'\f0c9';display:block;font:400 20px/1 'Font Awesome 5 Free';margin:0 auto;text-align:center;font-weight:900}#ngg_page_content .ngg_page_content_menu .ngg_page_content_menu_active,#ngg_page_content .ngg_page_content_menu a:active{outline:transparent 0;border-right:1px solid #fff;background:#9ebc1b;position:relative;color:#fff;margin-right:-1px;font-weight:800;border-bottom:1px solid #9dbd1b}#ngg_page_content .ngg_page_content_menu a:before{float:left;font:400 16px/1 'Font Awesome 5 Free';height:16px;right:0;margin-top:3px;text-align:right;z-index:9999;padding-right:10px;content:"\f1de";font-weight:900}#ngg_page_content .ngg_page_content_menu .ngg_page_content_menu_active:after,#ngg_page_content .ngg_page_content_menu a:active:after{right:0;border:8px solid transparent;content:"";width:0;position:absolute;pointer-events:none;border-right-color:#fff;top:50%;margin-top:-8px}#ngg_page_content .ngg_page_content_main{padding:10px 20px 20px 30px;min-height:600px;float:left;background:#fff;box-sizing:border-box;width:100%;box-shadow:0 -5px 4px 2px rgba(0,0,0,.05)}#ngg_page_content .ngg_overview .ngg_page_content_main,#ngg_page_content.ngg_settings_page .ngg_page_content_main{width:80%}.gallery_page_ngg_display_settings #ngg_page_content.ngg_settings_page .ngg_page_content_main{min-height:1000px}.gallery_page_ngg_other_options #ngg_page_content.ngg_settings_page .ngg_page_content_main{min-height:400px}#ngg_page_content .ngg_manage_tags .ngg_page_content_main{padding:0}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main>div,#ngg_page_content .ngg_overview .ngg_page_content_main>div,#ngg_page_content.ngg_settings_page .ngg_page_content_main>div{display:none}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main>div:first-of-type,#ngg_page_content .ngg_overview .ngg_page_content_main>div:first-of-type,#ngg_page_content.ngg_settings_page .ngg_page_content_main>div:first-of-type{display:block}#ngg_page_content.ngg_settings_page .ngg_page_content_main h3{color:rgba(29,36,42,.85);font-size:18px;margin:20px 0 30px;text-transform:uppercase}#ngg_page_content .ngg_page_content_main input,#ngg_page_content .ngg_page_content_main select{color:#888;height:35px;border:1px solid #ddd;padding-left:10px;width:200px;box-shadow:inset 0 0 2px 1px rgba(100,100,100,.05)}#ngg_page_content .ngg_page_content_main select{font-size:13px}#ngg_page_content .ngg_page_content_main .select2-container{width:200px!important;line-height:0}#ngg_page_content .ngg_page_content_main .select2-selection--multiple,#ngg_page_content .ngg_page_content_main .select2-selection--single{border:1px solid #ddd}#ngg_page_content .ngg_page_content_main .select2-search{width:100%}#ngg_page_content .ngg_page_content_main .select2-search__field{border-radius:3px}#ngg_page_content .ngg_page_content_main .select2-selection__choice{background:#9fbb1a;border:none;box-shadow:none;color:#fff;line-height:20px;padding:7px 10px 7px 8px;width:92%}#ngg_page_content .ngg_page_content_main .select2-selection__choice__remove{color:#fff;margin-right:6px}#ngg_page_content .ngg_page_content_main div[data-id=lightbox_effects] .select2-container,#ngg_page_content .ngg_page_content_main div[data-id=lightbox_effects] input,#ngg_page_content .ngg_page_content_main div[data-id=lightbox_effects] select{width:250px}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main input[type=radio],#ngg_page_content.ngg_settings_page .ngg_page_content_main input[type=radio]{border-radius:50%!important;height:16px!important;width:16px!important;padding:0!important;vertical-align:middle}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main input[type=radio]:checked:before,#ngg_page_content.ngg_settings_page .ngg_page_content_main input[type=radio]:checked:before{background-color:#9FBB1A;border-radius:50%;color:transparent;content:"\2022";display:block;height:17px;margin:-1px 0 0 -1px;vertical-align:middle;width:17px}#tr_photocrati-nextgen_basic_imagebrowser_ngg_triggers_display,#tr_photocrati-nextgen_basic_slideshow_ngg_triggers_display,.ngg-post-type .ngg_admin_notice{display:none}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main table,#ngg_page_content.ngg_settings_page .ngg_page_content_main table{color:rgba(29,36,42,.85);border-collapse:collapse;width:100%}#ngg_page_content table .sorting-indicator:before{color:#fff!important}#attach_to_post_tabs #displayed_tab #display_settings_tab_content table tr,#ngg_page_content.ngg_settings_page .ngg_page_content_main table tr{border:1px solid #f7f8f3;padding:5px 0!important;height:auto}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main table tr td,#ngg_page_content.ngg_settings_page .ngg_page_content_main table tr td,#ngg_page_content.ngg_settings_page .ngg_page_content_main table tr th{line-height:30px;vertical-align:middle;padding:10px 20px;box-sizing:border-box}.ngg-admin #ngg_page_content .widefat td,.ngg-admin #ngg_page_content .widefat th{padding:10px;color:#aaa;vertical-align:middle}.ngg-admin #ngg_page_content .widefat tfoot th,.ngg-admin #ngg_page_content .widefat thead th{padding:0 10px;color:#fff;text-transform:uppercase}#ngg_page_content.ngg_settings_page .ngg_page_content_main table tr th{font-weight:400!important;font-size:13px!important;line-height:1.5!important}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main table tr td:first-of-type{width:300px;text-align:left;font-weight:400;padding-top:8px}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main table table tr td:first-of-type,#ngg_page_content.ngg_settings_page .ngg_page_content_main table table tr td:first-of-type{width:auto;font-weight:400;padding:10px 20px}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main table tr:nth-of-type(2n),#ngg_page_content.ngg_settings_page .ngg_page_content_main table tr:nth-of-type(2n){background-color:#f7f8f3}#ngg_page_content.ngg_settings_page .ngg_page_content_main tr.watermark_field{padding:10px 0!important}#ngg_page_content.ngg_settings_page .ngg_page_content_main .watermark_field table{border:1px solid #d3e1c8}#ngg_page_content.ngg_settings_page .ngg_page_content_main .watermark_field table td{padding:5px 15px!important}#ngg_page_content.ngg_settings_page .ngg_page_content_main .watermark_field table td:first-of-type{width:auto!important}#ngg_page_content.ngg_settings_page .ngg_page_content_main .watermark_field table tr{border:none;padding:0!important}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main label,#ngg_page_content.ngg_settings_page .ngg_page_content_main label,#ngg_page_content.ngg_settings_page .ngg_page_content_main p.description{font-size:14px;color:#666}#ngg_page_content.ngg_settings_page .ngg_page_content_main label{margin-right:5px}#ngg_page_content.ngg_settings_page .ngg_page_content_main label:last-of-type{margin-right:15px}#ngg_page_content.ngg_settings_page .nextgen_settings_position td,#ngg_page_content.ngg_settings_page .nextgen_settings_position tr:nth-of-type(2n){border:none!important}#ngg_page_content.ngg_settings_page .nextgen_pro_lightbox_admin_header{background:#38576f!important;margin-top:20px}.nextgen_pro_lightbox_admin_header td{padding-left:0!important}.nextgen_pro_lightbox_admin_header td h3{text-transform:none!important;color:#fff!important;margin:0 0 0 20px!important}.ngg_options_promo{background:#224460;color:#fff;font-family:Lato,sans-serif;font-size:14px;font-weight:600}.ngg_options_promo a{text-decoration:none;font-weight:600;margin-left:6px}.gallery_page_ngg_other_options #ngg_page_content .ngg_page_content_main tbody tr td.ngg_options_promo{width:100%!important}.ngg-post-type .ngg_page_content_main .button,.ngg-post-type .ngg_page_content_main .page-title-action{background-color:#9FBB1A!important;color:#fff!important;border:none!important;box-shadow:none!important;text-shadow:none!important;height:35px!important;padding:0 15px!important;line-height:35px;width:auto!important}.ngg-post-type .ngg_page_content_main .button:hover,.ngg-post-type .ngg_page_content_main .page-title-action:hover{background-color:#A9C524!important}.ngg-post-type .ngg_page_content_main .page-title-action{padding:8px 16px!important}.ngg-post-type .ngg_page_content_main .tablenav{margin:0 0 20px}.ngg-post-type .ngg_page_content_main .tablenav .actions,.ngg-post-type .ngg_page_content_main .tablenav .tablenav-pages{margin:10px 0}.ngg-post-type .ngg_page_content_main .tablenav .tablenav-pages a,.ngg-post-type .ngg_page_content_main .tablenav-pages-navspan{background:#556472;border:none;color:#fff!important;margin:0 2px}.ngg-post-type #ngg_page_content .ngg_page_content_main .tablenav input.current-page{width:50px!important}.ngg-post-type .ngg_page_content_main table{box-shadow:none;table-layout:auto;border:1px solid rgba(159,187,26,.08)}.ngg-post-type .ngg_page_content_main table tfoot,.ngg-post-type .ngg_page_content_main table thead{background-color:#38576f;text-transform:uppercase}.ngg-post-type .ngg_page_content_main table tfoot{background-color:#38576f}.ngg-post-type .ngg_page_content_main table tfoot a,.ngg-post-type .ngg_page_content_main table thead a{padding:0}.ngg-post-type .ngg_page_content_main table tfoot span,.ngg-post-type .ngg_page_content_main table thead span{color:#fff;font-size:15px}.ngg-post-type .ngg_page_content_main table thead td,.ngg-post-type .ngg_page_content_main table thead th{background-color:transparent;border:none;color:#fff}.ngg-post-type .ngg_page_content_main table thead td{padding:12px 5px!important}.ngg-post-type #ngg_page_content .ngg_page_content_main input[type=checkbox]{height:13px!important;width:13px!important;min-width:auto;margin-top:2px}.ngg-post-type #ngg_page_content .ngg_page_content_main input[type=checkbox]:checked:before{color:#9FBB1A;margin:-5px 0 0 -5px}.ngg-post-type #ngg_page_content .sorting-indicator:before{color:#fff!important}.ngg-post-type .ngg_page_content_main .striped>tbody>:nth-child(odd){background-color:#f7f8f3}.ngg-post-type .ngg_page_content_main a.row-title{font-weight:400}.ngg-post-type .ngg_page_content_main .row-actions{left:0;padding-top:0}.ngg-post-type .ngg_page_content_main .row-actions a{color:#aaa!important}.ngg-post-type .ngg_page_content_main td.column-title strong{margin-bottom:0}.ngg-post-type #wpbody-content .quick-edit-row-page .inline-edit-col-left{width:100%}.ngg-post-type #ngg_page_content .widefat td,.ngg-post-type #ngg_page_content .widefat th{padding:10px;color:#aaa;vertical-align:middle}.ngg-post-type #ngg_page_content .widefat tfoot th,.ngg-post-type #ngg_page_content .widefat thead th{padding:0 10px;color:#fff;text-transform:uppercase}.ngg-post-type .ngg_page_content_main .tablenav.bottom{margin:10px 0 0}.ngg-admin #postbox-container-2 h2.ui-sortable-handle,.ngg-post-type #ngg_page_content h3.accordion_tab{padding:10px;background:#38576f;margin-bottom:0}.ngg-admin #postbox-container-2 h2.ui-sortable-handle,.ngg-post-type #ngg_page_content h3.accordion_tab a{color:#fff;text-decoration:none}.ngg-admin #postbox-container-2 .postbox,.ngg-post-type .accordion>div{border-left:1px solid rgba(159,187,26,.05);border-bottom:1px solid rgba(159,187,26,.05);border-right:1px solid rgba(159,187,26,.05);margin-bottom:30px;background-color:#f7f8f3}.ngg-post-type .accordion>div{padding:20px;margin-bottom:30px}.ngg-post-type .accordion>div table{border:none}.ngg-admin #postbox-container-2 .postbox .inside{margin:0}.ngg-admin #postbox-container-2 .postbox .inside a{color:#9fbb1a}.ngg-admin #postbox-container-2 .postbox .inside td,.ngg-admin #postbox-container-2 .postbox .inside th{padding:5px 10px}.ngg-admin #postbox-container-2 .postbox .inside .button-primary,.ngg-post-type .accordion>div .button-primary{margin:15px 0 0}.ngg-post-type table input[type=text]{margin:0}@media (max-width:1030px){#ngg_page_content .ngg_page_content_header p{padding:0 20px}}@media (max-width:900px){#ngg_page_content .ngg_page_content_header p{display:none}}@media (max-width:782px){.ngg-post-type #ngg_page_content button.toggle-row{width:40px!important;height:40px!important;background:0 0!important}.ngg-post-type tr:not(.inline-edit-row):not(.no-items) td.column-primary~td:not(.check-column){padding:3px 8px 3px 35%}.ngg-post-type #ngg_page_content .ngg_page_content_main input[type=checkbox]:checked:before{font:400 20px/1 dashicons!important}#ngg_page_content .ngg_page_content_header img{padding-right:10px}#ngg_page_content .ngg_overview .ngg_page_content_header h3,#ngg_page_content .ngg_page_content_header h3{font-size:14px}#ngg_page_content .ngg_overview .ngg_page_content_main,#ngg_page_content .ngg_page_content_menu,#ngg_page_content.ngg_settings_page .ngg_page_content_main{width:100%}#ngg_page_content .ngg_page_content_main,#ngg_page_content.ngg_settings_page .ngg_page_content_main{padding:20px}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main table,#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main tbody,#ngg_page_content.ngg_settings_page .ngg_page_content_main table,#ngg_page_content.ngg_settings_page .ngg_page_content_main tbody{display:block!important;max-width:100%}#attach_to_post_tabs #displayed_tab #ngg_page_content #slug_configuration,#ngg_page_content.ngg_settings_page .ngg_page_content_main tbody.hidden{display:none!important}#attach_to_post_tabs #displayed_tab #display_settings_tab_content table tr,#ngg_page_content.ngg_settings_page .ngg_page_content_main table tr{display:block!important;padding:10px 0 20px!important}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main table tr td,#ngg_page_content.ngg_settings_page .ngg_page_content_main table tr td,#ngg_page_content.ngg_settings_page .ngg_page_content_main table tr th{display:block;padding:2px 10px}#ngg_page_content.ngg_settings_page .ngg_page_content_main table.nextgen_settings_position tr td{display:table-cell}#ngg_page_content.ngg_settings_page .ngg_page_content_main h2,#ngg_page_content.ngg_settings_page .ngg_page_content_main h3{text-align:center}#ngg_page_content.ngg_settings_page form>p{width:100%;padding:15px;box-sizing:border-box}#ngg_page_content .ngg_page_content_main input,#ngg_page_content .ngg_page_content_main select{max-width:100%;margin:5px 0;box-sizing:border-box}#ngg_page_content .ngg_page_content_main .select2-container,#ngg_page_content .ngg_page_content_main input[type=number],#ngg_page_content .ngg_page_content_main input[type=text],#ngg_page_content .ngg_page_content_main select{width:100%!important}#ngg_page_content button.wp-color-result{width:auto!important}#ngg_page_content button.wp-color-result .wp-color-result-text{line-height:22px}.ngg-post-type .ngg_page_content_main .subsubsub,.ngg-post-type .ngg_page_content_main .tablenav .actions{width:100%}.ngg-post-type #ngg_page_content .ngg_page_content_main input,.ngg-post-type #ngg_page_content .ngg_page_content_main select{width:100%!important;max-width:100%;margin:5px 0;box-sizing:border-box}#ngg_page_content input[type=checkbox]{width:16px!important}#ngg_page_content .button-primary,#ngg_page_content .button-secondary,#ngg_page_content button{width:100%!important;margin:4px 0;display:block;text-align:center}.ngg-post-type .ngg_page_content_main .button,.ngg-post-type .ngg_page_content_main .page-title-action{width:80%!important;display:block;text-align:center;margin:10px auto 20px;padding:0!important}.ngg-post-type .ngg_page_content_main .displaying-num{display:none}#gallery_selection label{display:block;padding-bottom:8px}.post-type-ngg_pricelist .accordion table{width:100%!important}.post-type-ngg_pricelist .accordion #manual_shipping_options td{display:block;width:100%!important}.post-type-ngg_pricelist #ngg_page_content .accordion table input.shipping_rate{width:100%;max-width:100%}.post-type-ngg_pricelist .accordion input[type=checkbox]:checked:before{font:400 21px/1 dashicons}.ngg-post-type #ngg_page_content h1{text-align:center;display:block}#ngg_page_content .responsive-menu-icon{display:block;background:#9fbb1a;padding:10px 0 15px}#ngg_page_content .responsive-menu{display:none;float:none;margin:0}#ngg_page_content .responsive-menu a{display:block}#ngg_page_content .ngg_page_content_menu .ngg_page_content_menu_active:after,#ngg_page_content .ngg_page_content_menu a:active:after{display:none}}
products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(e){e(".ngg_page_content_menu a:first-of-type").addClass("ngg_page_content_menu_active"),e(".ngg_page_content_menu a").click(function(t){e(".ngg_page_content_menu a").removeClass("ngg_page_content_menu_active"),e(this).addClass("ngg_page_content_menu_active");e(this).attr("data-id");e(".ngg_page_content_main > div").css("display","none"),e('div[data-id="'+e(this).attr("data-id")+'"]').css("display","block")}),e(".responsive-menu-icon").remove(),e(".ngg_page_content_menu").addClass("responsive-menu").before('<div class="responsive-menu-icon"></div>'),e(".responsive-menu-icon").click(function(){e(this).next(".ngg_page_content_menu").slideToggle("fast")}),e(window).resize(function(){window.innerWidth>640&&(e(".ngg_page_content_menu").removeAttr("style"),e(".responsive-menu > a").removeClass("menu-open"))}),e(".responsive-menu > a").click(function(t){window.innerWidth<782&&e(this).parent(".ngg_page_content_menu").slideToggle("fast")}),e('input[type="submit"], button[type="submit"]').click(function(t){var n=e(this),i=!1;if((i=n.attr("data-confirm"))&&!confirm(i))return void t.preventDefault();if(-1!=n.attr("name").indexOf("_proxy")){var a=n.attr("data-proxy-value");a||(a=n.attr("value"));var s=n.attr("name").replace("_proxy",""),o=e('input[name="'+s+'"]');o.length>0?o.val(a):(o=e("<input/>").attr({type:"hidden",name:s,value:a}),n.parents("form").append(o))}}),e(".nextgen_advanced_toggle_link").on("click",function(t){t.preventDefault();var n="#"+e(this).attr("rel"),i=e(this);e(n).toggle(500,"swing",function(){e(this).hasClass("hidden")?(e(this).removeClass("hidden"),i.text(i.attr("active_label"))):(e(this).addClass("hidden"),i.text(i.attr("hidden_label")))})}),e("input.nextgen_settings_field_colorpicker").wpColorPicker(),e("#ngg_page_content").css("visibility","visible"),e("#ngg-listimages .row-actions .confirmrecover, #ngg-listimages .row-actions.submitdelete.delete").on("click",function(e){var t=e.target;confirm(t.getAttribute("data-question")+' "'+t.getAttribute("data-text")+'"')||e.preventDefault()})});
1
+ jQuery(function(e){e(".ngg_page_content_menu a:first-of-type").addClass("ngg_page_content_menu_active"),e(".ngg_page_content_menu a").click(function(t){e(".ngg_page_content_menu a").removeClass("ngg_page_content_menu_active"),e(this).addClass("ngg_page_content_menu_active");e(this).attr("data-id");e(".ngg_page_content_main > div").css("display","none"),e('div[data-id="'+e(this).attr("data-id")+'"]').css("display","block")}),e(".responsive-menu-icon").remove(),e(".ngg_page_content_menu").addClass("responsive-menu").before('<div class="responsive-menu-icon"></div>'),e(".responsive-menu-icon").click(function(){e(this).next(".ngg_page_content_menu").slideToggle("fast")}),e(window).resize(function(){window.innerWidth>640&&(e(".ngg_page_content_menu").removeAttr("style"),e(".responsive-menu > a").removeClass("menu-open"))}),e(".responsive-menu > a").click(function(t){window.innerWidth<782&&e(this).parent(".ngg_page_content_menu").slideToggle("fast")}),e('input[type="submit"], button[type="submit"]').click(function(t){var n=e(this),i=!1;if((i=n.attr("data-confirm"))&&!confirm(i))return void t.preventDefault();if(n.attr("name")&&-1!=n.attr("name").indexOf("_proxy")){var a=n.attr("data-proxy-value");a||(a=n.attr("value"));var s=n.attr("name").replace("_proxy",""),o=e('input[name="'+s+'"]');o.length>0?o.val(a):(o=e("<input/>").attr({type:"hidden",name:s,value:a}),n.parents("form").append(o))}}),e(".nextgen_advanced_toggle_link").on("click",function(t){t.preventDefault();var n="#"+e(this).attr("rel"),i=e(this);e(n).toggle(500,"swing",function(){e(this).hasClass("hidden")?(e(this).removeClass("hidden"),i.text(i.attr("active_label"))):(e(this).addClass("hidden"),i.text(i.attr("hidden_label")))})}),e("input.nextgen_settings_field_colorpicker").wpColorPicker(),e("#ngg_page_content").css("visibility","visible"),e("#ngg-listimages .row-actions .confirmrecover, #ngg-listimages .row-actions.submitdelete.delete").on("click",function(e){var t=e.target;confirm(t.getAttribute("data-question")+' "'+t.getAttribute("data-text")+'"')||e.preventDefault()})});
products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_wizards.js CHANGED
@@ -105,18 +105,30 @@ if (typeof(NextGEN_Wizard_Manager) === 'undefined') {
105
 
106
  el.click(function (e) {
107
  // here we only trigger done() if anchor is page-local (i.e. JS button) because for normal anchors this step is only "done" when reaching the new page
108
- if (!el.is('a') || (el.attr("href").startsWith("#") || el.attr("href").startsWith("javascript:") || el.hasClass("thickbox"))) {
109
  self.done(el);
110
  }
111
  });
112
 
113
  this.setup = function() {
114
- if (!el.is('a'))
115
- return;
116
 
117
- var href = el.attr("href");
118
- this.originalHref = href;
 
119
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  if (!href.startsWith("#")) {
121
  if (href.indexOf("?") == -1)
122
  href = href + "?";
@@ -125,7 +137,11 @@ if (typeof(NextGEN_Wizard_Manager) === 'undefined') {
125
 
126
  href = href + "ngg_wizard=" + this.currentWizard + "&ngg_wizard_step=" + this.currentStep;
127
 
128
- el.attr("href", href);
 
 
 
 
129
  }
130
  };
131
 
@@ -208,7 +224,7 @@ if (typeof(NextGEN_Wizard_Manager) === 'undefined') {
208
  view = {
209
  handler : ButtonView,
210
  name : "ButtonView",
211
- selector : "a, input[type='button'], input[type='submit']"
212
  };
213
  this.views.push(view);
214
 
105
 
106
  el.click(function (e) {
107
  // here we only trigger done() if anchor is page-local (i.e. JS button) because for normal anchors this step is only "done" when reaching the new page
108
+ if (!el.is('a,button.ngg_save_settings_button,input.ngg_save_gallery_changes') || (el.attr("href").startsWith("#") || el.attr("href").startsWith("javascript:") || el.hasClass("thickbox"))) {
109
  self.done(el);
110
  }
111
  });
112
 
113
  this.setup = function() {
 
 
114
 
115
+ if (!el.is('a,button.ngg_save_settings_button,button.ngg_save_pricelist_button,input.ngg_save_gallery_changes')) {
116
+ return;
117
+ }
118
 
119
+ if (el.is('a')) {
120
+ var href = el.attr("href");
121
+ this.originalHref = href;
122
+ }
123
+
124
+ if (el.is('button.ngg_save_settings_button,button.ngg_save_pricelist_button,input.ngg_save_gallery_changes')) {
125
+ var href = el.parents('form').attr('action');
126
+ if (href.indexOf("&ngg_wizard") > -1) {
127
+ hrefSplit = href.split("&ngg_wizard");
128
+ href = hrefSplit[0];
129
+ }
130
+ }
131
+
132
  if (!href.startsWith("#")) {
133
  if (href.indexOf("?") == -1)
134
  href = href + "?";
137
 
138
  href = href + "ngg_wizard=" + this.currentWizard + "&ngg_wizard_step=" + this.currentStep;
139
 
140
+ if ( el.is('a') )
141
+ el.attr("href", href);
142
+
143
+ if ( el.is('button.ngg_save_settings_button,button.ngg_save_pricelist_button,input.ngg_save_gallery_changes') )
144
+ el.parents('form').attr('action', href);
145
  }
146
  };
147
 
224
  view = {
225
  handler : ButtonView,
226
  name : "ButtonView",
227
+ selector : "a, input[type='button'], input[type='submit'], button"
228
  };
229
  this.views.push(view);
230
 
products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_wizards.min.js CHANGED
@@ -1 +1 @@
1
- function NextGEN_Wizard(t,e){this.id=t,this.manager=e,this.data={},this.steps=[],this.status=null,this.tour=null,this.created=Math.floor(Date.now()/1e3)}if("undefined"==typeof NextGEN_Wizard_Manager){NextGEN_Wizard.prototype.start=function(){null!=this.tour&&this.tour.start()},NextGEN_Wizard.prototype.getNextStep=function(t){for(var e=0;e<this.steps.length;e++){if(this.steps[e].id==t)break}return e++,e<this.steps.length?this.steps[e]:null},NextGEN_Wizard.prototype.setState=function(t){};var manager={state:[],wizards:[],runningWizard:null,views:[],starter:null,anchor:null,events:{},targetWatchers:{},refreshTimer:null,nggEvents:[],init:function(){function t(t){this.itemSelector=".view-item",this.currentWizard=null,this.currentStep=null,this.doneFlag=!1,this.init=function(){},this.disable=function(){t.addClass("ngg-wizard-disabled")},this.enable=function(){t.removeClass("ngg-wizard-disabled")},this.setup=function(){},this.reset=function(){t.removeClass("ngg-wizard-has-selection"),t.find(this.itemSelector).removeClass("ngg-wizard-selected")},this.done=function(t){this.doneFlag||(this.doneFlag=!0,this.trigger("done",this,t))}}function e(e){t.call(this,e);var i=this;jQuery(e.get(0).ownerDocument).on("click",e.selector,function(t){i.done(e)})}function i(e){t.call(this,e);var i=this;e.click(function(t){(!e.is("a")||e.attr("href").startsWith("#")||e.attr("href").startsWith("javascript:")||e.hasClass("thickbox"))&&i.done(e)}),this.setup=function(){if(e.is("a")){var t=e.attr("href");this.originalHref=t,t.startsWith("#")||(-1==t.indexOf("?")?t+="?":t+="&",t=t+"ngg_wizard="+this.currentWizard+"&ngg_wizard_step="+this.currentStep,e.attr("href",t))}},this.reset=function(){this.originalHref&&e.is("a")&&e.attr("href",this.originalHref)}}function n(e){t.call(this,e);var i=this;e.on("input",function(t){jQuery(this).val().length>=3&&i.done(e)}),this.setup=function(){}}function r(e){t.call(this,e);var i=this;jQuery(e.get(0).ownerDocument).on("change",e.selector,function(t){jQuery(this).is(":checked")&&i.done(e)}),this.setup=function(){}}function a(e){t.call(this,e);var i=this;e.on("change",function(t){i.done(e)})}"undefined"!=typeof NextGEN_Wizard_Manager_State&&(this.state=NextGEN_Wizard_Manager_State);var o=this;jQuery(window.top.document).find("body").on("nextgen_event",function(t,e){o.nggEvents.push({type:e})}),_.extend(t.prototype,Backbone.Events),_.extend(e.prototype,t.prototype),_.extend(i.prototype,t.prototype),_.extend(n.prototype,t.prototype),_.extend(r.prototype,t.prototype),_.extend(a.prototype,t.prototype);var s=null;s={handler:a,name:"SelectView",selector:"select"},this.views.push(s),s={handler:r,name:"RadioView",selector:"input[type='radio']"},this.views.push(s),s={handler:n,name:"TextView",selector:"input[type='text'], input[type='search'], input[type='email'], input[type='tel'], input[type='number'], input[type='username'], input[type='password'], textarea"},this.views.push(s),s={handler:i,name:"ButtonView",selector:"a, input[type='button'], input[type='submit']"},this.views.push(s),s={handler:e,name:"GenericView",selector:"*"},this.views.push(s),Tourist.Tip.Base.prototype.nextButtonTemplate='<a class="button-primary pull-right tour-next">Next step →</a>',Tourist.Tip.Base.prototype.finalButtonTemplate='<button class="button-primary pull-right tour-next">Finish up</button>',Tourist.Tip.Base.prototype.closeButtonTemplate='<a class="btn btn-close tour-close" href="#"><i class="icon icon-remove far fa-window-close"></i></a>',Tourist.Tip.BootstrapTip.prototype._getTargetBounds=function(t){var e,i;e=t[0],i="function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():{width:e.offsetWidth,height:e.offsetHeight};var n=t.offset();if(t.ownerDocument!=document)for(var r=function(t,e){for(var i=t.find("iframe"),n=[],a=0;a<i.size();a++){var o=jQuery(i.get(a));try{if(o.prop("contentWindow").document==e)return[o]}catch(t){continue}var s=r(o.contents(),e);if(s.length>0){n.push(o);for(var u=0;u<s.length;u++)n.push(s[u]);break}}return n},a=r(jQuery(document),t.get(0).ownerDocument),o=0;o<a.length;o++){var s=a[o],u=s.offset();n.left+=u.left,n.top+=u.top}return jQuery.extend({},i,n)},jQuery(".ngg-wizard-invoker").on("click",function(t){t.preventDefault();for(var e=NextGEN_Wizard_Manager,i=jQuery(this).data("ngg-wizard"),n=null,r=0;r<e.wizards.length;r++){var a=e.wizards[r];if(a.id==i){n=a;break}}return null!=n&&null==this.runningWizard&&n.start(),!1})},bind:function(t,e){t in this.events||(this.events[t]=[]);var i={handler:e};this.events[t].push(i)},trigger:function(t,e){if(void 0===e&&(e={}),t in this.events)for(var i=this.events[t],n=0;n<i.length;n++){var r=i[n];r.handler&&r.handler(this,e)}},didNextgenEventFire:function(t){for(var e=0;e<this.nggEvents.length;e++){if(this.nggEvents[e].type==t)return!0}return!1},getViewForSelector:function(t,e){var i=null;void 0===e&&(e=!0);for(var n=0;n<this.views.length;n++){var r=this.views[n];if(t.is(r.selector)){i=r.handler;break}}if(null!=i){var r=new i(t);return e&&r.init(),r}return null},getViewFor:function(t,e,i){var n=this.getViewForSelector(t,!1);return null!=n&&(n.currentWizard=e,n.currentStep=i,n.init()),n},generateQueue:function(t){var e=this,i=this.state,n=i.wizard_list.length,r=i.starter,a=i.running_wizard;if(n>0){var o=t('<div id="ngg-wizard-starter" class="ngg-wizard-starter"></div>');o.append('<div class="starter-wrap-top"><div class="starter-wrap-icon"><img class="starter-icon" src="'+r.image+'" /></div></div>'),o.append('<div class="starter-wrap-bottom"><div class="starter-wrap-text">'+r.text+"</div></div>"),o.on("click",".starter-wrap-icon, starter-wrap-bottom",function(){e.startQueue()}),o.hide(),o.appendTo("body"),this.starter=o;var s=t('<div id="ngg-wizard-anchor" class="ngg-wizard-anchor"></div>');s.appendTo("body"),this.anchor=s;for(var u=0,l=0;l<n;l++){var d=i.wizard_list[l],h=new NextGEN_Wizard(d.id,this);h.data=d,h.steps=d.steps;var c=this.generateTour(h);"ok"==c.result?(h.status="ready",h.tour=c.tour):"wait_element"==c.result&&(h.status="wait",u++),h.id==a?(this.wizards.unshift(h),this.runningWizard=h):this.wizards.push(h)}u>0?this.enqueueRefreshOperation():this.trigger("ready")}},getContextObject:function(t){var e=null;if(null!=t){"object"!=typeof t&&(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];if(e=null==e?jQuery(n):e.find(n),e.is("iframe")){var r=e.prop("contentWindow");if("interactive"!=r.document.readyState&&"complete"!=r.document.readyState){e=jQuery([]);break}e=r.jQuery?r.jQuery("body"):e.contents().find("body")}}0==e.size()&&(e=jQuery([]))}else e=jQuery(document);return e},computeStepTarget:function(t,e,i){var n=e.target_wait,r=e.target,a=e.view,o=null,s=null,u=null,l=this.getContextObject(e.context),d=!1;if(null!=r){if(o=l.find(r),o.size()>0?d=!0:o=this.anchor,!d&&null!=n&&Math.floor(Date.now()/1e3)-t.created<=n)return!1}else o=this.anchor;return null!=a&&(s=l.find(a),s.size()>0&&(u=this.getViewFor(s,t.id,e.id))),i.highlightTarget=d,i.nextButton=!d||e.optional,i.target=o,i.ngg_view=u,!0},scrollIntoView:function(t){},generateTour:function(t){if(null==t.tour){var e=t.data,i=e.steps,n=e.current_step,r=0,a=[],o=null;if(null!=e.view&&null==(o=this.getViewFor(jQuery(e.view),t.id)))return{result:"wait_element",element:e.view};for(var s=0;s<i.length;s++){var u=i[s];null!=n&&n==u.id&&(r=s);var l={ngg_step_id:u.id,ngg_step_data:u,viewport:jQuery(window),closeButton:!0,content:'<div class="ngg-wizard-text">'+u.text+"</div>",my:u.popup_anchor,at:u.target_anchor,bind:["onDone"],onDone:function(t,e,i,n){var r=t.ngg_wizard,a=this.ngg_step_data,o=!0;if(null!=a.condition&&(this.condition_met||(o=!1,this.condition_setup||this.setupCondition(t,e))),o&&null!=r){var s=r.getNextStep(this.ngg_step_id);if(null!=s&&s.lazy){o=!1;for(var u=null,l=0;l<t.options.steps.length;l++){var d=t.options.steps[l];if(d.ngg_step_id==s.id){u=d;break}}null!=u&&(null==u.target||0==u.target.size()||"ngg-wizard-anchor"==u.target.attr("id")?!(o=r.manager.computeStepTarget(r,s,u))||null!=u.target&&0!=u.target.size()&&"ngg-wizard-anchor"!=u.target.attr("id")||(o=!1):o=!0)}}if(o)t.next();else{null!=this.lazyTimeout&&(clearTimeout(this.lazyTimeout),this.lazyTimeout=null);var h=this;this.lazyTimeout=setTimeout(function(){h.lazyTimeout=null,h.onDone(t,e,i,n)},500)}}};if(!this.computeStepTarget(t,u,l))return{result:"wait_element",element:u.target};l.setupCondition=function(t,e){var i=t.ngg_wizard,n=this.ngg_step_data;if(!this.condition_setup&&null!=n.condition){var r=n.condition,a=r.type,o=r.value,s=r.context,u=r.timeout;this.condition_met=!1,this.condition_setup=!1,s&&"object"!=typeof s&&(s=[s]);var l=jQuery([]);if(s){s=s.slice(0);var d=s.pop();l=i.manager.getContextObject(s).find(d)}if(l.size()>0){var h=l.get(0).ownerDocument;h.defaultView||h.parentWindow}switch(a){case"frame_event":if(window.Frame_Event_Publisher){this.condition_setup=!0;var c=this;Frame_Event_Publisher.listen_for(o,function(){c.condition_met=!0})}break;case"event_bind":case"plupload_bind":var p=l.size()>0;if("plupload_bind"==a&&(void 0!==l.pluploadQueue?l=l.pluploadQueue():p=!1),p){this.condition_setup=!0;var c=this;l.bind(o,function(){c.condition_met=!0})}break;case"nextgen_event":if(this.condition_setup=!0,i.manager.didNextgenEventFire(o))this.condition_met=!0;else{var c=this;jQuery(window.top.document).find("body").bind("nextgen_event",function(t,e){e==o&&(c.condition_met=!0)})}break;case"wait":this.condition_setup=!0;var c=this;setTimeout(function(){c.condition_met=!0},o)}}var g=jQuery(".tourist-popover .ngg-wizard-text"),f=g.find(".ngg-wizard-loading");if(f.hide(),this.condition_setup&&!this.condition_met&&u>0){this.condition_timeout=0,0==f.length&&(f=jQuery('<div class="ngg-wizard-loading"></div>'),g.append(f)),f.html("Loading... ("+Math.ceil(u/1e3).toString()+")"),f.show();var c=this;c.condition_timer=setInterval(function(){c.condition_timeout+=1e3,c.condition_timeout>=u&&(c.condition_met=!0);var t=(Math.floor(c.condition_timeout/1e3),Math.ceil(u/1e3),Math.floor((u-c.condition_timeout)/1e3));f.html("Loading... ("+t.toString()+")"),c.condition_met&&(f.hide(),clearInterval(c.condition_timer),c.condition_timer=null)},1e3)}return this.condition_setup},l.setup=function(t,e){var i=e.view;null!=this.ngg_view&&(i=this.ngg_view),null!=i&&(i.currentWizard=t.ngg_wizard_id,i.currentStep=this.ngg_step_id,i.setup(),i.bind("done",this.onDone),i.enable())},l.teardown=function(t,e){var i=e.view;null!=this.ngg_view&&(i=this.ngg_view),null!=i&&(i.disable(),i.unbind("done",this.onDone),i.reset())},a.push(l)}var d={steps:a,tipClass:"Bootstrap",tipOptions:{showEffect:"slidein"},stepOptions:{}};null!=o&&(d.stepOptions.view=o);var h=new Tourist.Tour(d);for(h.ngg_wizard_id=t.id,h.ngg_wizard=t;r>0;)h.next(),r--;return{result:"ok",tour:h}}},enqueueRefreshOperation:function(){null!=this.refreshTimer&&(clearTimeout(this.refreshTimer),this.refreshTimer=null),this.refreshTimer=setTimeout(function(t){NextGEN_Wizard_Manager.refreshQueue()},500)},refreshQueue:function(){this.refreshTimer=null;for(var t=0,e=0;e<this.wizards.length;e++){var i=this.wizards[e];if("wait"==i.status){var n=this.generateTour(i);"ok"==n.result?(i.status="ready",i.tour=n.tour):"wait_element"==n.result&&(i.status="wait",t++)}}t>0?this.enqueueRefreshOperation():this.trigger("ready")},start:function(){null!=this.runningWizard?this.runningWizard.start():this.showStarter()},showStarter:function(){},startQueue:function(){if(null!=this.starter){var t=this;this.starter.fadeOut(function(){t.nextTour()})}else this.nextTour()},nextTour:function(){for(var t=0,e=0;e<this.wizards.length;e++){var i=this.wizards[e];if("ready"==i.status&&null!=i.tour){t=e;break}}if(t<this.wizards.length){var i=this.wizards[t];i.tour.start()}},updateWizardState:function(t){}};manager.init(),window.NextGEN_Wizard_Manager=manager}jQuery(function(t){"undefined"!=typeof NextGEN_Wizard_Manager&&(NextGEN_Wizard_Manager.bind("ready",function(){NextGEN_Wizard_Manager.start()}),NextGEN_Wizard_Manager.generateQueue(t))});
1
+ function NextGEN_Wizard(t,e){this.id=t,this.manager=e,this.data={},this.steps=[],this.status=null,this.tour=null,this.created=Math.floor(Date.now()/1e3)}if("undefined"==typeof NextGEN_Wizard_Manager){NextGEN_Wizard.prototype.start=function(){null!=this.tour&&this.tour.start()},NextGEN_Wizard.prototype.getNextStep=function(t){for(var e=0;e<this.steps.length;e++){if(this.steps[e].id==t)break}return e++,e<this.steps.length?this.steps[e]:null},NextGEN_Wizard.prototype.setState=function(t){};var manager={state:[],wizards:[],runningWizard:null,views:[],starter:null,anchor:null,events:{},targetWatchers:{},refreshTimer:null,nggEvents:[],init:function(){function t(t){this.itemSelector=".view-item",this.currentWizard=null,this.currentStep=null,this.doneFlag=!1,this.init=function(){},this.disable=function(){t.addClass("ngg-wizard-disabled")},this.enable=function(){t.removeClass("ngg-wizard-disabled")},this.setup=function(){},this.reset=function(){t.removeClass("ngg-wizard-has-selection"),t.find(this.itemSelector).removeClass("ngg-wizard-selected")},this.done=function(t){this.doneFlag||(this.doneFlag=!0,this.trigger("done",this,t))}}function e(e){t.call(this,e);var i=this;jQuery(e.get(0).ownerDocument).on("click",e.selector,function(t){i.done(e)})}function i(e){t.call(this,e);var i=this;e.click(function(t){(!e.is("a,button.ngg_save_settings_button,input.ngg_save_gallery_changes")||e.attr("href").startsWith("#")||e.attr("href").startsWith("javascript:")||e.hasClass("thickbox"))&&i.done(e)}),this.setup=function(){if(e.is("a,button.ngg_save_settings_button,button.ngg_save_pricelist_button,input.ngg_save_gallery_changes")){if(e.is("a")){var t=e.attr("href");this.originalHref=t}if(e.is("button.ngg_save_settings_button,button.ngg_save_pricelist_button,input.ngg_save_gallery_changes")){var t=e.parents("form").attr("action");t.indexOf("&ngg_wizard")>-1&&(hrefSplit=t.split("&ngg_wizard"),t=hrefSplit[0])}t.startsWith("#")||(-1==t.indexOf("?")?t+="?":t+="&",t=t+"ngg_wizard="+this.currentWizard+"&ngg_wizard_step="+this.currentStep,e.is("a")&&e.attr("href",t),e.is("button.ngg_save_settings_button,button.ngg_save_pricelist_button,input.ngg_save_gallery_changes")&&e.parents("form").attr("action",t))}},this.reset=function(){this.originalHref&&e.is("a")&&e.attr("href",this.originalHref)}}function n(e){t.call(this,e);var i=this;e.on("input",function(t){jQuery(this).val().length>=3&&i.done(e)}),this.setup=function(){}}function r(e){t.call(this,e);var i=this;jQuery(e.get(0).ownerDocument).on("change",e.selector,function(t){jQuery(this).is(":checked")&&i.done(e)}),this.setup=function(){}}function a(e){t.call(this,e);var i=this;e.on("change",function(t){i.done(e)})}"undefined"!=typeof NextGEN_Wizard_Manager_State&&(this.state=NextGEN_Wizard_Manager_State);var s=this;jQuery(window.top.document).find("body").on("nextgen_event",function(t,e){s.nggEvents.push({type:e})}),_.extend(t.prototype,Backbone.Events),_.extend(e.prototype,t.prototype),_.extend(i.prototype,t.prototype),_.extend(n.prototype,t.prototype),_.extend(r.prototype,t.prototype),_.extend(a.prototype,t.prototype);var o=null;o={handler:a,name:"SelectView",selector:"select"},this.views.push(o),o={handler:r,name:"RadioView",selector:"input[type='radio']"},this.views.push(o),o={handler:n,name:"TextView",selector:"input[type='text'], input[type='search'], input[type='email'], input[type='tel'], input[type='number'], input[type='username'], input[type='password'], textarea"},this.views.push(o),o={handler:i,name:"ButtonView",selector:"a, input[type='button'], input[type='submit'], button"},this.views.push(o),o={handler:e,name:"GenericView",selector:"*"},this.views.push(o),Tourist.Tip.Base.prototype.nextButtonTemplate='<a class="button-primary pull-right tour-next">Next step →</a>',Tourist.Tip.Base.prototype.finalButtonTemplate='<button class="button-primary pull-right tour-next">Finish up</button>',Tourist.Tip.Base.prototype.closeButtonTemplate='<a class="btn btn-close tour-close" href="#"><i class="icon icon-remove far fa-window-close"></i></a>',Tourist.Tip.BootstrapTip.prototype._getTargetBounds=function(t){var e,i;e=t[0],i="function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():{width:e.offsetWidth,height:e.offsetHeight};var n=t.offset();if(t.ownerDocument!=document)for(var r=function(t,e){for(var i=t.find("iframe"),n=[],a=0;a<i.size();a++){var s=jQuery(i.get(a));try{if(s.prop("contentWindow").document==e)return[s]}catch(t){continue}var o=r(s.contents(),e);if(o.length>0){n.push(s);for(var u=0;u<o.length;u++)n.push(o[u]);break}}return n},a=r(jQuery(document),t.get(0).ownerDocument),s=0;s<a.length;s++){var o=a[s],u=o.offset();n.left+=u.left,n.top+=u.top}return jQuery.extend({},i,n)},jQuery(".ngg-wizard-invoker").on("click",function(t){t.preventDefault();for(var e=NextGEN_Wizard_Manager,i=jQuery(this).data("ngg-wizard"),n=null,r=0;r<e.wizards.length;r++){var a=e.wizards[r];if(a.id==i){n=a;break}}return null!=n&&null==this.runningWizard&&n.start(),!1})},bind:function(t,e){t in this.events||(this.events[t]=[]);var i={handler:e};this.events[t].push(i)},trigger:function(t,e){if(void 0===e&&(e={}),t in this.events)for(var i=this.events[t],n=0;n<i.length;n++){var r=i[n];r.handler&&r.handler(this,e)}},didNextgenEventFire:function(t){for(var e=0;e<this.nggEvents.length;e++){if(this.nggEvents[e].type==t)return!0}return!1},getViewForSelector:function(t,e){var i=null;void 0===e&&(e=!0);for(var n=0;n<this.views.length;n++){var r=this.views[n];if(t.is(r.selector)){i=r.handler;break}}if(null!=i){var r=new i(t);return e&&r.init(),r}return null},getViewFor:function(t,e,i){var n=this.getViewForSelector(t,!1);return null!=n&&(n.currentWizard=e,n.currentStep=i,n.init()),n},generateQueue:function(t){var e=this,i=this.state,n=i.wizard_list.length,r=i.starter,a=i.running_wizard;if(n>0){var s=t('<div id="ngg-wizard-starter" class="ngg-wizard-starter"></div>');s.append('<div class="starter-wrap-top"><div class="starter-wrap-icon"><img class="starter-icon" src="'+r.image+'" /></div></div>'),s.append('<div class="starter-wrap-bottom"><div class="starter-wrap-text">'+r.text+"</div></div>"),s.on("click",".starter-wrap-icon, starter-wrap-bottom",function(){e.startQueue()}),s.hide(),s.appendTo("body"),this.starter=s;var o=t('<div id="ngg-wizard-anchor" class="ngg-wizard-anchor"></div>');o.appendTo("body"),this.anchor=o;for(var u=0,l=0;l<n;l++){var d=i.wizard_list[l],h=new NextGEN_Wizard(d.id,this);h.data=d,h.steps=d.steps;var c=this.generateTour(h);"ok"==c.result?(h.status="ready",h.tour=c.tour):"wait_element"==c.result&&(h.status="wait",u++),h.id==a?(this.wizards.unshift(h),this.runningWizard=h):this.wizards.push(h)}u>0?this.enqueueRefreshOperation():this.trigger("ready")}},getContextObject:function(t){var e=null;if(null!=t){"object"!=typeof t&&(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];if(e=null==e?jQuery(n):e.find(n),e.is("iframe")){var r=e.prop("contentWindow");if("interactive"!=r.document.readyState&&"complete"!=r.document.readyState){e=jQuery([]);break}e=r.jQuery?r.jQuery("body"):e.contents().find("body")}}0==e.size()&&(e=jQuery([]))}else e=jQuery(document);return e},computeStepTarget:function(t,e,i){var n=e.target_wait,r=e.target,a=e.view,s=null,o=null,u=null,l=this.getContextObject(e.context),d=!1;if(null!=r){if(s=l.find(r),s.size()>0?d=!0:s=this.anchor,!d&&null!=n&&Math.floor(Date.now()/1e3)-t.created<=n)return!1}else s=this.anchor;return null!=a&&(o=l.find(a),o.size()>0&&(u=this.getViewFor(o,t.id,e.id))),i.highlightTarget=d,i.nextButton=!d||e.optional,i.target=s,i.ngg_view=u,!0},scrollIntoView:function(t){},generateTour:function(t){if(null==t.tour){var e=t.data,i=e.steps,n=e.current_step,r=0,a=[],s=null;if(null!=e.view&&null==(s=this.getViewFor(jQuery(e.view),t.id)))return{result:"wait_element",element:e.view};for(var o=0;o<i.length;o++){var u=i[o];null!=n&&n==u.id&&(r=o);var l={ngg_step_id:u.id,ngg_step_data:u,viewport:jQuery(window),closeButton:!0,content:'<div class="ngg-wizard-text">'+u.text+"</div>",my:u.popup_anchor,at:u.target_anchor,bind:["onDone"],onDone:function(t,e,i,n){var r=t.ngg_wizard,a=this.ngg_step_data,s=!0;if(null!=a.condition&&(this.condition_met||(s=!1,this.condition_setup||this.setupCondition(t,e))),s&&null!=r){var o=r.getNextStep(this.ngg_step_id);if(null!=o&&o.lazy){s=!1;for(var u=null,l=0;l<t.options.steps.length;l++){var d=t.options.steps[l];if(d.ngg_step_id==o.id){u=d;break}}null!=u&&(null==u.target||0==u.target.size()||"ngg-wizard-anchor"==u.target.attr("id")?!(s=r.manager.computeStepTarget(r,o,u))||null!=u.target&&0!=u.target.size()&&"ngg-wizard-anchor"!=u.target.attr("id")||(s=!1):s=!0)}}if(s)t.next();else{null!=this.lazyTimeout&&(clearTimeout(this.lazyTimeout),this.lazyTimeout=null);var h=this;this.lazyTimeout=setTimeout(function(){h.lazyTimeout=null,h.onDone(t,e,i,n)},500)}}};if(!this.computeStepTarget(t,u,l))return{result:"wait_element",element:u.target};l.setupCondition=function(t,e){var i=t.ngg_wizard,n=this.ngg_step_data;if(!this.condition_setup&&null!=n.condition){var r=n.condition,a=r.type,s=r.value,o=r.context,u=r.timeout;this.condition_met=!1,this.condition_setup=!1,o&&"object"!=typeof o&&(o=[o]);var l=jQuery([]);if(o){o=o.slice(0);var d=o.pop();l=i.manager.getContextObject(o).find(d)}if(l.size()>0){var h=l.get(0).ownerDocument;h.defaultView||h.parentWindow}switch(a){case"frame_event":if(window.Frame_Event_Publisher){this.condition_setup=!0;var c=this;Frame_Event_Publisher.listen_for(s,function(){c.condition_met=!0})}break;case"event_bind":case"plupload_bind":var g=l.size()>0;if("plupload_bind"==a&&(void 0!==l.pluploadQueue?l=l.pluploadQueue():g=!1),g){this.condition_setup=!0;var c=this;l.bind(s,function(){c.condition_met=!0})}break;case"nextgen_event":if(this.condition_setup=!0,i.manager.didNextgenEventFire(s))this.condition_met=!0;else{var c=this;jQuery(window.top.document).find("body").bind("nextgen_event",function(t,e){e==s&&(c.condition_met=!0)})}break;case"wait":this.condition_setup=!0;var c=this;setTimeout(function(){c.condition_met=!0},s)}}var p=jQuery(".tourist-popover .ngg-wizard-text"),f=p.find(".ngg-wizard-loading");if(f.hide(),this.condition_setup&&!this.condition_met&&u>0){this.condition_timeout=0,0==f.length&&(f=jQuery('<div class="ngg-wizard-loading"></div>'),p.append(f)),f.html("Loading... ("+Math.ceil(u/1e3).toString()+")"),f.show();var c=this;c.condition_timer=setInterval(function(){c.condition_timeout+=1e3,c.condition_timeout>=u&&(c.condition_met=!0);var t=(Math.floor(c.condition_timeout/1e3),Math.ceil(u/1e3),Math.floor((u-c.condition_timeout)/1e3));f.html("Loading... ("+t.toString()+")"),c.condition_met&&(f.hide(),clearInterval(c.condition_timer),c.condition_timer=null)},1e3)}return this.condition_setup},l.setup=function(t,e){var i=e.view;null!=this.ngg_view&&(i=this.ngg_view),null!=i&&(i.currentWizard=t.ngg_wizard_id,i.currentStep=this.ngg_step_id,i.setup(),i.bind("done",this.onDone),i.enable())},l.teardown=function(t,e){var i=e.view;null!=this.ngg_view&&(i=this.ngg_view),null!=i&&(i.disable(),i.unbind("done",this.onDone),i.reset())},a.push(l)}var d={steps:a,tipClass:"Bootstrap",tipOptions:{showEffect:"slidein"},stepOptions:{}};null!=s&&(d.stepOptions.view=s);var h=new Tourist.Tour(d);for(h.ngg_wizard_id=t.id,h.ngg_wizard=t;r>0;)h.next(),r--;return{result:"ok",tour:h}}},enqueueRefreshOperation:function(){null!=this.refreshTimer&&(clearTimeout(this.refreshTimer),this.refreshTimer=null),this.refreshTimer=setTimeout(function(t){NextGEN_Wizard_Manager.refreshQueue()},500)},refreshQueue:function(){this.refreshTimer=null;for(var t=0,e=0;e<this.wizards.length;e++){var i=this.wizards[e];if("wait"==i.status){var n=this.generateTour(i);"ok"==n.result?(i.status="ready",i.tour=n.tour):"wait_element"==n.result&&(i.status="wait",t++)}}t>0?this.enqueueRefreshOperation():this.trigger("ready")},start:function(){null!=this.runningWizard?this.runningWizard.start():this.showStarter()},showStarter:function(){},startQueue:function(){if(null!=this.starter){var t=this;this.starter.fadeOut(function(){t.nextTour()})}else this.nextTour()},nextTour:function(){for(var t=0,e=0;e<this.wizards.length;e++){var i=this.wizards[e];if("ready"==i.status&&null!=i.tour){t=e;break}}if(t<this.wizards.length){var i=this.wizards[t];i.tour.start()}},updateWizardState:function(t){}};manager.init(),window.NextGEN_Wizard_Manager=manager}jQuery(function(t){"undefined"!=typeof NextGEN_Wizard_Manager&&(NextGEN_Wizard_Manager.bind("ready",function(){NextGEN_Wizard_Manager.start()}),NextGEN_Wizard_Manager.generateQueue(t))});
products/photocrati_nextgen/modules/nextgen_admin/templates/nextgen_admin_page.php CHANGED
@@ -21,6 +21,9 @@
21
  <?php if (isset($form_header)): ?>
22
  <?php echo $form_header."\n"; ?>
23
  <?php endif ?>
 
 
 
24
  <input type="hidden" name="action"/>
25
  <!-- <div class="accordion" id="nextgen_admin_accordion"> -->
26
  <div class="ngg_page_content_menu"">
21
  <?php if (isset($form_header)): ?>
22
  <?php echo $form_header."\n"; ?>
23
  <?php endif ?>
24
+ <?php if (isset($nonce)): ?>
25
+ <input type="hidden" name="nonce" value="<?php echo esc_attr($nonce)?>"/>
26
+ <?php endif ?>
27
  <input type="hidden" name="action"/>
28
  <!-- <div class="accordion" id="nextgen_admin_accordion"> -->
29
  <div class="ngg_page_content_menu"">
products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php CHANGED
@@ -26,7 +26,7 @@ class M_NextGen_Basic_Album extends C_Base_Module
26
  NGG_BASIC_ALBUM,
27
  'NextGEN Basic Album',
28
  "Provides support for NextGEN's Basic Album",
29
- '3.0.0.5',
30
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
31
  'Imagely',
32
  'https://www.imagely.com'
26
  NGG_BASIC_ALBUM,
27
  'NextGEN Basic Album',
28
  "Provides support for NextGEN's Basic Album",
29
+ '3.1.8',
30
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
31
  'Imagely',
32
  'https://www.imagely.com'
products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php CHANGED
@@ -37,7 +37,7 @@ class M_NextGen_Basic_Gallery extends C_Base_Module
37
  NGG_BASIC_GALLERY,
38
  'NextGEN Basic Gallery',
39
  "Provides NextGEN Gallery's basic thumbnail/slideshow integrated gallery",
40
- '3.0.13',
41
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
42
  'Imagely',
43
  'https://www.imagely.com'
37
  NGG_BASIC_GALLERY,
38
  'NextGEN Basic Gallery',
39
  "Provides NextGEN Gallery's basic thumbnail/slideshow integrated gallery",
40
+ '3.1.8',
41
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
42
  'Imagely',
43
  'https://www.imagely.com'
products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/thumbnails/default-view.php CHANGED
@@ -1,8 +1,7 @@
1
  <?php
2
-
3
  $this->start_element('nextgen_gallery.gallery_container', 'container', $displayed_gallery);
4
-
5
  ?>
 
6
  <div
7
  class="ngg-galleryoverview default-view <?php if (!intval($ajax_pagination)) echo ' ngg-ajax-pagination-none'; ?>"
8
  id="ngg-gallery-<?php echo esc_attr($displayed_gallery_id)?>-<?php echo esc_attr($current_page)?>">
@@ -48,7 +47,7 @@ $this->start_element('nextgen_gallery.gallery_container', 'container', $displaye
48
  <img
49
  title="<?php echo esc_attr($image->alttext)?>"
50
  alt="<?php echo esc_attr($image->alttext)?>"
51
- src="<?php echo esc_attr($storage->get_image_url($image, $thumbnail_size_name, TRUE))?>"
52
  width="<?php echo esc_attr($thumb_size['width'])?>"
53
  height="<?php echo esc_attr($thumb_size['height'])?>"
54
  style="max-width:100%;"
1
  <?php
 
2
  $this->start_element('nextgen_gallery.gallery_container', 'container', $displayed_gallery);
 
3
  ?>
4
+ <!-- default-view.php -->
5
  <div
6
  class="ngg-galleryoverview default-view <?php if (!intval($ajax_pagination)) echo ' ngg-ajax-pagination-none'; ?>"
7
  id="ngg-gallery-<?php echo esc_attr($displayed_gallery_id)?>-<?php echo esc_attr($current_page)?>">
47
  <img
48
  title="<?php echo esc_attr($image->alttext)?>"
49
  alt="<?php echo esc_attr($image->alttext)?>"
50
+ src="<?php echo esc_attr($storage->get_image_url($image, $thumbnail_size_name))?>"
51
  width="<?php echo esc_attr($thumb_size['width'])?>"
52
  height="<?php echo esc_attr($thumb_size['height'])?>"
53
  style="max-width:100%;"
products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/thumbnails/index.php CHANGED
@@ -1,8 +1,7 @@
1
  <?php
2
-
3
  $this->start_element('nextgen_gallery.gallery_container', 'container', $displayed_gallery);
4
-
5
  ?>
 
6
  <div
7
  class="ngg-galleryoverview<?php if (!intval($ajax_pagination)) echo ' ngg-ajax-pagination-none'; ?>"
8
  id="ngg-gallery-<?php echo esc_attr($displayed_gallery_id)?>-<?php echo esc_attr($current_page)?>">
1
  <?php
 
2
  $this->start_element('nextgen_gallery.gallery_container', 'container', $displayed_gallery);
 
3
  ?>
4
+ <!-- index.php -->
5
  <div
6
  class="ngg-galleryoverview<?php if (!intval($ajax_pagination)) echo ' ngg-ajax-pagination-none'; ?>"
7
  id="ngg-gallery-<?php echo esc_attr($displayed_gallery_id)?>-<?php echo esc_attr($current_page)?>">
products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/module.nextgen_basic_imagebrowser.php CHANGED
@@ -26,7 +26,7 @@ class M_NextGen_Basic_ImageBrowser extends C_Base_Module
26
  'photocrati-nextgen_basic_imagebrowser',
27
  'NextGEN Basic ImageBrowser',
28
  'Provides the NextGEN Basic ImageBrowser Display Type',
29
- '3.0.0.4',
30
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
31
  'Imagely',
32
  'https://www.imagely.com'
26
  'photocrati-nextgen_basic_imagebrowser',
27
  'NextGEN Basic ImageBrowser',
28
  'Provides the NextGEN Basic ImageBrowser Display Type',
29
+ '3.1.8',
30
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
31
  'Imagely',
32
  'https://www.imagely.com'
products/photocrati_nextgen/modules/nextgen_basic_singlepic/module.nextgen_basic_singlepic.php CHANGED
@@ -24,7 +24,7 @@ class M_NextGen_Basic_Singlepic extends C_Base_Module
24
  NGG_BASIC_SINGLEPIC,
25
  'NextGen Basic Singlepic',
26
  'Provides a singlepic gallery for NextGEN Gallery',
27
- '3.1.0',
28
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
29
  'Imagely',
30
  'https://www.imagely.com'
24
  NGG_BASIC_SINGLEPIC,
25
  'NextGen Basic Singlepic',
26
  'Provides a singlepic gallery for NextGEN Gallery',
27
+ '3.1.8',
28
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
29
  'Imagely',
30
  'https://www.imagely.com'
products/photocrati_nextgen/modules/nextgen_basic_tagcloud/module.nextgen_basic_tagcloud.php CHANGED
@@ -24,7 +24,7 @@ class M_NextGen_Basic_Tagcloud extends C_Base_Module
24
  NGG_BASIC_TAGCLOUD,
25
  'NextGen Basic Tagcloud',
26
  'Provides a tagcloud for NextGEN Gallery',
27
- '3.1.6',
28
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
29
  'Imagely',
30
  'https://www.imagely.com'
24
  NGG_BASIC_TAGCLOUD,
25
  'NextGen Basic Tagcloud',
26
  'Provides a tagcloud for NextGEN Gallery',
27
+ '3.1.8',
28
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
29
  'Imagely',
30
  'https://www.imagely.com'
products/photocrati_nextgen/modules/nextgen_block/module.nextgen_block.php CHANGED
@@ -23,7 +23,7 @@ class M_NextGEN_Block extends C_Base_Module
23
  'photocrati-nextgen_block',
24
  'NextGEN Block',
25
  'Provides a NextGEN Block for the Gutenberg interface.',
26
- '3.1.5.3',
27
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
28
  'Imagely',
29
  'https://www.imagely.com'
23
  'photocrati-nextgen_block',
24
  'NextGEN Block',
25
  'Provides a NextGEN Block for the Gutenberg interface.',
26
+ '3.1.8',
27
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
28
  'Imagely',
29
  'https://www.imagely.com'
products/photocrati_nextgen/modules/nextgen_block/static/build/block.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(C){var e={};function t(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return C[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=C,t.c=e,t.d=function(C,e,n){t.o(C,e)||Object.defineProperty(C,e,{enumerable:!0,get:n})},t.r=function(C){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(C,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(C,"__esModule",{value:!0})},t.t=function(C,e){if(1&e&&(C=t(C)),8&e)return C;if(4&e&&"object"==typeof C&&C&&C.__esModule)return C;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:C}),2&e&&"string"!=typeof C)for(var r in C)t.d(n,r,function(e){return C[e]}.bind(null,r));return n},t.n=function(C){var e=C&&C.__esModule?function(){return C.default}:function(){return C};return t.d(e,"a",e),e},t.o=function(C,e){return Object.prototype.hasOwnProperty.call(C,e)},t.p="",t(t.s=0)}([function(C,e,t){"use strict";function n(C){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(C){return typeof C}:function(C){return C&&"function"==typeof Symbol&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C})(C)}function r(C,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(C,n.key,n)}}function o(C,e,t){return(o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(C,e,t){var n=function(C,e){for(;!Object.prototype.hasOwnProperty.call(C,e)&&null!==(C=l(C)););return C}(C,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(t):r.value}})(C,e,t||C)}function l(C){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)})(C)}function i(C,e){return(i=Object.setPrototypeOf||function(C,e){return C.__proto__=e,C})(C,e)}function a(C){if(void 0===C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}t.r(e);wp.i18n.__;var c=(0,lodash.memoize)(function(C,e){return function(t){function c(C){var e;return function(C,e){if(!(C instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),(e=function(C,e){return!e||"object"!==n(e)&&"function"!=typeof e?a(C):e}(this,l(c).call(this,C))).openIGW=e.openIGW.bind(a(a(e))),e.updateContent=e.updateContent.bind(a(a(e))),e.hasGallery=e.hasGallery.bind(a(a(e))),e.toggleAddGalleryBtn=e.toggleAddGalleryBtn.bind(a(a(e))),e}return function(C,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");C.prototype=Object.create(e&&e.prototype,{constructor:{value:C,writable:!0,configurable:!0}}),e&&i(C,e)}(c,e),function(C,e,t){e&&r(C.prototype,e),t&&r(C,t)}(c,[{key:"hasGallery",value:function(){return this.props.attributes.content&&this.props.attributes.content.length>0}},{key:"componentDidMount",value:function(){o(l(c.prototype),"componentDidMount",this).call(this),C(this.ref).addClass("freeform-toolbar").addClass("ngg-freeform-toolbar"),this.toggleAddGalleryBtn()}},{key:"componentDidUpdate",value:function(){this.toggleAddGalleryBtn()}},{key:"toggleAddGalleryBtn",value:function(){this.props.attributes.content?(C(this.ref).addClass("hidden"),C(this.ref).siblings(".add-ngg-gallery-wrap").hide()):(C(this.ref).removeClass("hidden"),C(this.ref).siblings(".add-ngg-gallery-wrap").show())}},{key:"updateContent",value:function(C){this.props.setAttributes({content:C})}},{key:"onSetup",value:function(C){o(l(c.prototype),"onSetup",this).call(this,C);var e=this.updateContent.bind(this);C.on("ngg-removed",function(){return e("")}),C.on("ngg-inserted",function(C){var t=C.shortcode;return e(t)})}},{key:"openIGW",value:function(){this.editor.execCommand("ngg_attach_to_post")}},{key:"render",value:function(){return[o(l(c.prototype),"render",this).call(this),React.createElement("div",{className:"add-ngg-gallery-wrap"},React.createElement("div",{className:"add-ngg-gallery",onClick:this.openIGW},ngg_tinymce_plugin.i18n.button_label))]}}]),c}()}),u={};u.nextgen=React.createElement("svg",{id:"svg",version:"1.1",width:"400",height:"385.8088930936613",viewBox:"0 0 400 385.8088930936613"},React.createElement("g",{id:"svgg"},React.createElement("path",{id:"path0",d:"",stroke:"none",fill:"#000055","fill-rule":"evenodd"}),React.createElement("path",{id:"path1",d:"",stroke:"none",fill:"#002424","fill-rule":"evenodd"}),React.createElement("path",{id:"path2",d:"M194.418 152.698 C 154.152 157.677,135.139 203.873,160.388 235.383 C 179.730 259.522,217.168 260.458,237.772 237.316 C 261.954 210.156,250.860 167.167,216.592 155.239 C 210.224 153.023,200.657 151.926,194.418 152.698 ",stroke:"none",fill:"#143650","fill-rule":"evenodd"}),React.createElement("path",{id:"path3",d:"",stroke:"none",fill:"#555500","fill-rule":"evenodd"}),React.createElement("path",{id:"path4",d:"M109.430 274.467 C 109.368 274.629,109.202 274.717,109.061 274.663 C 108.920 274.609,108.715 274.732,108.606 274.936 C 108.496 275.140,108.286 275.307,108.139 275.307 C 107.992 275.307,107.796 275.441,107.705 275.605 C 107.536 275.907,106.895 276.338,106.291 276.556 C 106.109 276.622,105.960 276.753,105.960 276.848 C 105.960 276.942,105.747 277.101,105.487 277.200 C 105.227 277.299,105.014 277.467,105.014 277.573 C 105.014 277.680,104.920 277.767,104.805 277.767 C 104.690 277.767,104.285 278.009,103.906 278.303 C 103.527 278.598,103.068 278.894,102.886 278.960 C 102.703 279.026,102.554 279.168,102.554 279.275 C 102.554 279.382,102.427 279.470,102.272 279.470 C 102.117 279.470,101.884 279.640,101.754 279.849 C 101.624 280.057,101.367 280.227,101.184 280.227 C 101.001 280.227,100.851 280.314,100.851 280.421 C 100.851 280.528,100.639 280.696,100.378 280.795 C 100.118 280.894,99.905 281.071,99.905 281.189 C 99.905 281.306,99.793 281.360,99.655 281.307 C 99.518 281.254,99.304 281.373,99.181 281.570 C 99.057 281.768,98.838 281.930,98.694 281.930 C 98.550 281.930,98.383 282.059,98.322 282.217 C 98.262 282.374,97.997 282.585,97.734 282.685 C 97.471 282.785,97.256 282.954,97.256 283.061 C 97.256 283.167,97.095 283.254,96.898 283.254 C 96.701 283.254,96.491 283.382,96.431 283.538 C 96.371 283.694,96.201 283.822,96.053 283.822 C 95.904 283.822,95.731 283.959,95.667 284.126 C 95.603 284.292,95.438 284.386,95.302 284.334 C 95.165 284.281,94.952 284.400,94.829 284.598 C 94.705 284.796,94.529 284.957,94.437 284.957 C 94.344 284.957,93.996 285.213,93.661 285.525 C 93.327 285.837,92.965 286.093,92.857 286.093 C 92.748 286.093,92.296 286.391,91.851 286.755 C 91.407 287.119,90.958 287.417,90.854 287.417 C 90.750 287.417,90.637 287.481,90.602 287.559 C 90.471 287.855,89.293 288.565,89.116 288.455 C 89.014 288.392,88.931 288.476,88.931 288.641 C 88.931 288.805,88.718 289.021,88.458 289.120 C 88.198 289.219,87.985 289.392,87.985 289.505 C 87.985 289.617,87.602 289.879,87.133 290.086 C 86.665 290.293,86.282 290.546,86.282 290.647 C 86.282 290.749,86.090 290.915,85.856 291.017 C 85.220 291.292,84.692 291.646,84.522 291.911 C 84.439 292.041,84.245 292.148,84.091 292.148 C 83.936 292.148,83.761 292.275,83.701 292.431 C 83.641 292.588,83.504 292.715,83.396 292.715 C 83.287 292.715,82.835 293.013,82.391 293.377 C 81.946 293.742,81.493 294.040,81.384 294.040 C 81.276 294.040,81.097 294.207,80.988 294.411 C 80.871 294.629,80.673 294.738,80.508 294.675 C 80.337 294.609,80.227 294.677,80.227 294.850 C 80.227 295.006,80.014 295.187,79.754 295.253 C 79.494 295.318,79.281 295.455,79.281 295.557 C 79.281 295.659,79.162 295.743,79.017 295.743 C 78.872 295.743,78.707 295.864,78.650 296.012 C 78.594 296.160,78.223 296.433,77.826 296.619 C 77.429 296.804,76.994 297.108,76.858 297.295 C 76.722 297.482,76.488 297.635,76.337 297.635 C 76.187 297.635,76.064 297.715,76.064 297.814 C 76.064 297.990,75.336 298.457,74.693 298.693 C 74.510 298.760,74.361 298.892,74.361 298.986 C 74.361 299.081,74.170 299.241,73.936 299.342 C 73.345 299.597,72.922 299.894,72.049 300.662 C 71.636 301.026,71.221 301.325,71.127 301.325 C 71.032 301.325,70.662 301.559,70.303 301.845 C 69.945 302.131,69.562 302.365,69.452 302.365 C 69.342 302.365,69.253 302.449,69.253 302.551 C 69.253 302.653,69.040 302.790,68.780 302.855 C 68.519 302.920,68.307 303.102,68.307 303.259 C 68.307 303.451,68.183 303.512,67.928 303.446 C 67.680 303.381,67.550 303.440,67.550 303.617 C 67.550 303.766,67.337 303.969,67.077 304.068 C 66.816 304.167,66.604 304.337,66.604 304.447 C 66.604 304.556,66.391 304.726,66.131 304.825 C 65.870 304.924,65.658 305.092,65.658 305.199 C 65.658 305.305,65.487 305.393,65.279 305.393 C 65.071 305.393,64.901 305.480,64.901 305.587 C 64.901 305.693,64.688 305.861,64.428 305.960 C 64.167 306.059,63.955 306.227,63.955 306.334 C 63.955 306.441,63.784 306.528,63.576 306.528 C 63.368 306.528,63.198 306.615,63.198 306.722 C 63.198 306.828,62.985 306.997,62.725 307.096 C 62.465 307.194,62.252 307.361,62.252 307.465 C 62.252 307.570,61.907 307.831,61.486 308.046 C 61.064 308.261,60.672 308.561,60.614 308.712 C 60.556 308.864,60.389 308.988,60.243 308.988 C 60.097 308.988,59.835 309.154,59.662 309.356 C 59.488 309.559,59.285 309.687,59.210 309.641 C 59.135 309.595,58.800 309.812,58.467 310.124 C 58.133 310.436,57.748 310.691,57.612 310.691 C 57.475 310.691,57.335 310.754,57.301 310.833 C 57.184 311.095,55.380 312.394,55.132 312.394 C 54.996 312.394,54.803 312.547,54.703 312.735 C 54.602 312.923,54.174 313.242,53.752 313.445 C 53.330 313.647,52.983 313.879,52.982 313.959 C 52.981 314.040,52.789 314.189,52.554 314.290 C 51.958 314.548,51.520 314.853,50.731 315.562 C 50.355 315.900,49.942 316.176,49.812 316.177 C 49.683 316.177,49.476 316.340,49.353 316.537 C 49.229 316.735,49.027 316.858,48.903 316.810 C 48.779 316.763,48.626 316.856,48.564 317.018 C 48.502 317.181,48.339 317.313,48.203 317.313 C 48.067 317.313,47.695 317.547,47.375 317.833 C 46.625 318.507,45.782 319.104,45.364 319.259 C 45.182 319.327,45.033 319.470,45.033 319.578 C 45.033 319.685,44.903 319.773,44.743 319.773 C 44.584 319.773,44.405 319.901,44.345 320.057 C 44.285 320.213,44.075 320.341,43.878 320.341 C 43.622 320.341,43.519 320.476,43.519 320.814 C 43.519 321.074,43.587 321.287,43.670 321.287 C 43.753 321.287,44.147 321.798,44.545 322.422 C 44.942 323.046,45.343 323.557,45.434 323.557 C 45.526 323.557,45.601 323.655,45.601 323.774 C 45.601 323.894,45.899 324.355,46.263 324.799 C 46.627 325.244,46.925 325.700,46.925 325.812 C 46.925 325.925,47.010 326.017,47.114 326.017 C 47.219 326.017,47.304 326.132,47.304 326.272 C 47.304 326.411,47.474 326.680,47.682 326.868 C 47.890 327.057,48.061 327.331,48.061 327.477 C 48.061 327.634,48.209 327.719,48.420 327.685 C 48.728 327.634,49.763 328.480,49.763 328.783 C 49.763 328.837,49.976 329.160,50.237 329.501 C 50.497 329.842,50.710 330.217,50.710 330.335 C 50.710 330.610,51.587 331.190,51.802 331.058 C 51.891 331.002,52.123 331.229,52.316 331.562 C 52.509 331.894,52.780 332.235,52.918 332.318 C 53.056 332.401,53.169 332.587,53.169 332.731 C 53.169 332.875,53.347 333.049,53.565 333.118 C 53.783 333.187,54.082 333.533,54.230 333.888 C 54.378 334.242,54.578 334.532,54.675 334.532 C 54.772 334.532,54.964 334.766,55.102 335.052 C 55.239 335.338,55.492 335.574,55.663 335.575 C 56.001 335.578,56.764 336.191,56.764 336.461 C 56.764 336.713,57.567 337.748,57.763 337.748 C 57.981 337.748,58.642 338.535,58.650 338.804 C 58.654 338.917,58.888 339.130,59.171 339.277 C 59.786 339.598,61.757 341.524,61.929 341.973 C 61.996 342.147,62.168 342.289,62.311 342.289 C 62.454 342.289,62.725 342.577,62.915 342.929 C 63.125 343.319,63.542 343.693,63.985 343.889 C 64.385 344.065,64.711 344.333,64.711 344.485 C 64.711 344.637,64.882 344.825,65.091 344.902 C 65.299 344.979,65.628 345.336,65.821 345.696 C 66.014 346.056,66.335 346.394,66.535 346.449 C 66.972 346.567,68.307 347.617,68.307 347.843 C 68.307 348.075,69.693 349.274,69.850 349.177 C 69.923 349.132,70.037 349.267,70.103 349.477 C 70.170 349.687,70.389 349.858,70.590 349.858 C 70.791 349.858,70.956 349.924,70.956 350.004 C 70.956 350.370,72.658 351.980,72.934 351.874 C 73.117 351.804,73.226 351.868,73.226 352.046 C 73.226 352.202,73.370 352.385,73.545 352.452 C 73.721 352.520,74.109 352.853,74.408 353.193 C 74.727 353.556,75.063 353.768,75.222 353.707 C 75.385 353.645,75.552 353.757,75.637 353.986 C 75.778 354.360,77.338 355.718,77.633 355.722 C 77.925 355.725,78.903 356.556,78.903 356.800 C 78.903 356.937,78.988 357.048,79.093 357.048 C 79.198 357.048,79.469 357.261,79.695 357.521 C 79.921 357.781,80.240 357.997,80.403 357.999 C 80.566 358.002,81.069 358.343,81.520 358.756 C 81.972 359.170,82.451 359.508,82.586 359.508 C 82.721 359.508,82.876 359.678,82.931 359.886 C 82.988 360.104,83.189 360.265,83.404 360.265 C 83.627 360.265,83.821 360.428,83.883 360.668 C 83.961 360.965,84.092 361.045,84.379 360.970 C 84.624 360.906,84.768 360.959,84.768 361.114 C 84.768 361.353,85.288 361.680,85.572 361.619 C 85.650 361.603,85.714 361.717,85.714 361.873 C 85.714 362.029,85.864 362.157,86.048 362.157 C 86.231 362.157,86.466 362.349,86.570 362.583 C 86.674 362.817,86.908 362.997,87.090 362.982 C 87.272 362.967,87.686 363.202,88.008 363.503 C 88.331 363.805,88.863 364.179,89.191 364.334 C 89.518 364.490,89.998 364.809,90.257 365.043 C 90.517 365.277,90.814 365.478,90.918 365.489 C 91.452 365.547,91.958 365.827,91.958 366.064 C 91.958 366.211,92.107 366.386,92.289 366.453 C 92.472 366.520,92.693 366.695,92.781 366.842 C 92.883 367.012,93.105 367.067,93.396 366.994 C 93.646 366.932,93.851 366.963,93.851 367.063 C 93.851 367.400,94.783 368.258,95.042 368.158 C 95.182 368.105,95.398 368.222,95.521 368.420 C 95.645 368.618,95.905 368.780,96.100 368.780 C 96.294 368.780,96.559 368.907,96.689 369.063 C 96.818 369.219,97.049 369.347,97.202 369.347 C 97.355 369.347,97.828 369.645,98.254 370.009 C 98.679 370.374,99.129 370.672,99.254 370.672 C 99.379 370.672,99.586 370.798,99.714 370.953 C 99.843 371.108,100.024 371.189,100.116 371.131 C 100.208 371.074,100.284 371.112,100.284 371.214 C 100.284 371.425,101.342 371.996,101.732 371.996 C 101.872 371.996,101.965 372.103,101.939 372.233 C 101.912 372.372,102.130 372.493,102.470 372.526 C 102.801 372.558,103.360 372.861,103.781 373.235 C 104.185 373.594,104.655 373.888,104.826 373.888 C 104.997 373.888,105.342 374.106,105.592 374.372 C 105.873 374.671,106.180 374.821,106.396 374.765 C 106.594 374.713,106.953 374.853,107.220 375.085 C 107.480 375.311,107.751 375.501,107.820 375.506 C 108.117 375.528,108.913 375.843,109.149 376.032 C 109.289 376.145,109.518 376.254,109.657 376.274 C 109.796 376.294,110.249 376.584,110.664 376.917 C 111.079 377.251,111.501 377.472,111.602 377.410 C 111.704 377.348,111.837 377.429,111.899 377.591 C 111.962 377.753,112.093 377.836,112.191 377.776 C 112.289 377.715,112.694 377.851,113.091 378.077 C 114.435 378.844,114.758 378.995,115.057 378.996 C 115.221 378.997,115.558 379.214,115.807 379.478 C 116.071 379.759,116.425 379.938,116.658 379.907 C 116.877 379.879,117.263 379.987,117.516 380.147 C 117.769 380.308,118.444 380.635,119.016 380.874 C 119.588 381.114,120.203 381.438,120.381 381.595 C 120.559 381.753,120.847 381.827,121.021 381.760 C 121.216 381.685,121.596 381.838,122.021 382.162 C 122.398 382.449,122.810 382.660,122.938 382.631 C 123.065 382.602,123.363 382.702,123.600 382.854 C 123.837 383.006,124.201 383.158,124.409 383.192 C 124.617 383.226,124.903 383.410,125.045 383.601 C 125.219 383.834,125.444 383.912,125.735 383.839 C 125.999 383.772,126.203 383.825,126.261 383.974 C 126.364 384.244,127.909 384.408,127.909 384.150 C 127.909 384.061,128.172 383.720,128.493 383.391 C 128.979 382.894,129.056 382.698,128.951 382.220 C 128.843 381.728,128.872 381.664,129.154 381.773 C 129.421 381.875,129.463 381.821,129.376 381.489 C 129.294 381.175,129.353 381.079,129.625 381.079 C 129.919 381.079,129.961 380.981,129.868 380.513 C 129.795 380.146,129.862 379.784,130.062 379.479 C 130.231 379.221,130.369 378.916,130.369 378.801 C 130.369 378.686,130.500 378.461,130.659 378.301 C 130.886 378.075,130.901 377.952,130.726 377.742 C 130.546 377.525,130.624 377.364,131.121 376.920 C 131.619 376.476,131.716 376.274,131.618 375.885 C 131.552 375.619,131.565 375.402,131.649 375.402 C 131.907 375.402,132.450 374.330,132.450 373.821 C 132.450 373.241,132.798 372.415,133.253 371.913 C 133.436 371.711,133.568 371.456,133.546 371.346 C 133.477 370.988,133.777 370.104,133.968 370.104 C 134.070 370.104,134.153 369.891,134.153 369.631 C 134.153 369.354,134.251 369.178,134.390 369.205 C 134.539 369.235,134.621 369.043,134.613 368.685 C 134.606 368.373,134.720 368.028,134.867 367.918 C 135.013 367.809,135.108 367.596,135.077 367.445 C 135.005 367.096,135.651 365.752,135.891 365.752 C 135.991 365.752,136.055 365.561,136.034 365.326 C 135.986 364.807,136.396 363.671,136.632 363.671 C 136.725 363.671,136.802 363.467,136.802 363.218 C 136.802 362.969,136.939 362.713,137.106 362.649 C 137.318 362.567,137.376 362.395,137.297 362.082 C 137.226 361.799,137.288 361.546,137.466 361.399 C 137.621 361.270,137.748 361.086,137.748 360.989 C 137.748 360.893,137.919 360.462,138.127 360.031 C 138.335 359.600,138.505 359.088,138.505 358.894 C 138.505 358.699,138.590 358.592,138.694 358.657 C 138.804 358.724,138.884 358.547,138.884 358.239 C 138.884 357.944,139.096 357.390,139.357 357.008 C 139.617 356.625,139.830 356.124,139.830 355.895 C 139.830 355.368,140.756 353.453,141.011 353.453 C 141.121 353.453,141.154 353.217,141.089 352.892 C 141.008 352.486,141.062 352.282,141.283 352.159 C 141.484 352.046,141.552 351.844,141.480 351.570 C 141.399 351.260,141.440 351.179,141.641 351.256 C 141.842 351.334,141.911 351.196,141.911 350.715 C 141.911 350.360,141.990 350.021,142.086 349.962 C 142.182 349.902,142.316 349.599,142.385 349.288 C 142.453 348.977,142.613 348.723,142.741 348.723 C 142.871 348.723,143.126 348.120,143.321 347.351 C 143.512 346.596,143.784 345.845,143.925 345.680 C 144.066 345.516,144.182 345.249,144.182 345.086 C 144.182 344.923,144.315 344.739,144.479 344.676 C 144.671 344.602,144.735 344.434,144.660 344.198 C 144.596 343.997,144.713 343.465,144.918 343.014 C 145.572 341.583,145.955 340.687,145.995 340.492 C 146.130 339.835,146.342 339.451,146.569 339.451 C 146.727 339.451,146.833 339.245,146.837 338.931 C 146.840 338.645,146.966 338.247,147.117 338.048 C 147.304 337.801,147.332 337.612,147.204 337.458 C 147.074 337.302,147.105 337.156,147.301 336.993 C 147.459 336.863,147.588 336.596,147.588 336.401 C 147.588 336.205,147.673 336.045,147.777 336.045 C 147.881 336.045,147.966 335.837,147.966 335.583 C 147.966 335.329,148.129 335.006,148.329 334.866 C 148.539 334.719,148.741 334.286,148.808 333.839 C 148.871 333.414,149.091 332.719,149.296 332.294 C 149.792 331.268,149.789 330.258,149.290 329.991 C 149.082 329.879,148.912 329.700,148.912 329.593 C 148.912 329.485,148.699 329.119,148.439 328.777 C 148.179 328.436,147.966 328.086,147.966 327.998 C 147.966 327.911,147.625 327.435,147.209 326.941 C 146.793 326.448,146.452 325.953,146.452 325.841 C 146.452 325.730,146.386 325.639,146.306 325.639 C 146.226 325.639,145.991 325.321,145.786 324.934 C 145.580 324.546,145.284 324.090,145.128 323.921 C 144.619 323.370,144.182 322.798,144.182 322.684 C 144.182 322.622,143.926 322.248,143.614 321.854 C 143.302 321.460,143.046 321.041,143.046 320.922 C 143.046 320.804,142.919 320.658,142.763 320.598 C 142.606 320.538,142.479 320.406,142.479 320.305 C 142.479 320.203,142.181 319.757,141.816 319.312 C 141.452 318.868,141.154 318.404,141.154 318.281 C 141.154 318.158,141.026 318.009,140.870 317.949 C 140.714 317.889,140.587 317.719,140.587 317.571 C 140.587 317.423,140.459 317.252,140.303 317.192 C 140.147 317.132,140.019 317.004,140.019 316.907 C 140.019 316.698,139.230 315.544,139.026 315.453 C 138.947 315.418,138.884 315.282,138.884 315.151 C 138.884 315.019,138.713 314.758,138.505 314.570 C 138.297 314.381,138.127 314.113,138.127 313.973 C 138.127 313.833,138.040 313.718,137.933 313.718 C 137.826 313.718,137.658 313.505,137.559 313.245 C 137.460 312.985,137.306 312.772,137.216 312.772 C 137.067 312.772,136.696 312.128,136.642 311.775 C 136.630 311.695,136.443 311.440,136.228 311.208 C 135.601 310.532,134.359 308.771,134.237 308.384 C 134.175 308.189,133.939 307.836,133.713 307.599 C 133.487 307.362,133.174 306.971,133.018 306.730 C 132.862 306.489,132.644 306.196,132.534 306.079 C 132.424 305.962,132.169 305.573,131.967 305.216 C 131.764 304.858,131.450 304.390,131.268 304.175 C 130.563 303.344,130.452 303.186,130.089 302.503 C 129.884 302.115,129.647 301.798,129.564 301.798 C 129.481 301.798,129.333 301.585,129.234 301.325 C 129.135 301.064,128.967 300.851,128.860 300.851 C 128.753 300.851,128.666 300.737,128.666 300.597 C 128.666 300.457,128.496 300.188,128.288 300.000 C 128.079 299.812,127.909 299.579,127.909 299.484 C 127.909 299.389,127.803 299.200,127.673 299.064 C 127.543 298.928,127.308 298.626,127.152 298.393 C 126.996 298.160,126.734 297.788,126.570 297.566 C 126.405 297.344,126.216 297.013,126.150 296.831 C 126.083 296.649,125.950 296.500,125.853 296.500 C 125.756 296.500,125.489 296.138,125.260 295.695 C 125.030 295.253,124.723 294.823,124.578 294.740 C 124.433 294.657,124.314 294.465,124.314 294.314 C 124.314 294.163,124.226 294.040,124.119 294.040 C 124.012 294.040,123.869 293.891,123.802 293.709 C 123.735 293.526,123.503 293.122,123.287 292.810 C 123.071 292.498,122.809 292.106,122.705 291.939 C 122.487 291.589,121.384 290.080,121.101 289.743 C 120.995 289.617,120.908 289.459,120.908 289.392 C 120.908 289.289,119.878 287.898,119.207 287.094 C 119.102 286.968,119.016 286.810,119.016 286.743 C 119.016 286.675,118.761 286.298,118.448 285.904 C 118.136 285.509,117.881 285.097,117.881 284.987 C 117.881 284.877,117.774 284.719,117.644 284.636 C 117.344 284.444,116.556 283.327,116.556 283.093 C 116.556 282.996,116.429 282.868,116.272 282.808 C 116.116 282.748,115.989 282.577,115.989 282.429 C 115.989 282.281,115.861 282.111,115.705 282.051 C 115.549 281.991,115.421 281.851,115.421 281.739 C 115.421 281.511,114.646 280.356,114.428 280.259 C 114.350 280.224,114.286 280.079,114.286 279.937 C 114.286 279.795,114.179 279.610,114.049 279.527 C 113.749 279.335,112.961 278.218,112.961 277.984 C 112.961 277.887,112.833 277.759,112.677 277.699 C 112.521 277.639,112.394 277.503,112.394 277.396 C 112.394 276.953,110.065 274.176,109.691 274.173 C 109.610 274.173,109.493 274.305,109.430 274.467 ",stroke:"none",fill:"#8ca516","fill-rule":"evenodd"}),React.createElement("path",{id:"path5",d:"",stroke:"none",fill:"#6db600","fill-rule":"evenodd"}),React.createElement("path",{id:"path6",d:"M79.186 45.256 C 78.978 45.372,78.369 45.838,77.832 46.291 C 77.295 46.744,76.809 47.114,76.752 47.114 C 76.696 47.114,76.441 47.306,76.186 47.540 C 75.500 48.170,75.046 48.533,74.934 48.540 C 74.693 48.557,73.983 49.116,73.983 49.289 C 73.982 49.611,72.116 51.366,71.950 51.200 C 71.890 51.140,71.722 51.260,71.577 51.468 C 71.431 51.675,71.190 51.845,71.039 51.845 C 70.889 51.845,70.766 52.019,70.766 52.232 C 70.766 52.464,70.539 52.748,70.200 52.942 C 69.888 53.119,69.633 53.328,69.632 53.406 C 69.632 53.484,69.461 53.548,69.253 53.548 C 69.044 53.548,68.874 53.634,68.874 53.739 C 68.874 53.992,67.915 55.061,67.688 55.061 C 67.590 55.061,67.342 55.274,67.137 55.535 C 66.933 55.795,66.647 56.008,66.502 56.008 C 66.357 56.008,66.137 56.197,66.013 56.429 C 65.743 56.933,65.537 57.138,64.871 57.564 C 64.594 57.741,64.126 58.227,63.830 58.644 C 63.452 59.177,63.194 59.371,62.961 59.300 C 62.776 59.244,62.630 59.297,62.630 59.421 C 62.630 59.747,61.733 60.786,61.150 61.136 C 60.865 61.307,60.668 61.576,60.699 61.751 C 60.730 61.922,60.634 62.062,60.487 62.062 C 60.249 62.062,59.039 63.359,58.877 63.788 C 58.843 63.879,58.688 63.955,58.533 63.955 C 58.258 63.955,57.711 64.387,57.711 64.603 C 57.711 64.663,57.561 64.867,57.379 65.056 C 57.197 65.246,56.793 65.714,56.482 66.097 C 56.170 66.480,55.804 66.793,55.668 66.793 C 55.532 66.793,55.296 67.091,55.144 67.455 C 54.992 67.819,54.762 68.121,54.633 68.125 C 54.505 68.130,53.463 69.275,52.318 70.671 C 51.173 72.067,50.086 73.262,49.903 73.326 C 49.719 73.390,49.605 73.501,49.649 73.573 C 49.805 73.824,49.216 74.409,48.921 74.296 C 48.711 74.216,48.627 74.303,48.625 74.604 C 48.622 75.122,48.429 75.402,48.074 75.402 C 47.926 75.402,47.741 75.638,47.663 75.927 C 47.586 76.216,47.349 76.642,47.137 76.874 C 46.126 77.977,44.276 80.266,44.276 80.414 C 44.276 80.505,44.106 80.634,43.898 80.700 C 43.690 80.766,43.519 80.985,43.519 81.186 C 43.519 81.387,43.390 81.701,43.233 81.883 C 41.478 83.908,40.527 85.119,40.618 85.210 C 40.679 85.271,40.378 85.740,39.948 86.253 C 39.519 86.766,39.167 87.281,39.167 87.396 C 39.167 87.512,39.040 87.606,38.884 87.606 C 38.728 87.606,38.600 87.763,38.600 87.954 C 38.600 88.146,38.324 88.625,37.988 89.019 C 37.651 89.413,37.374 89.838,37.373 89.964 C 37.371 90.090,36.944 90.679,36.424 91.275 C 35.904 91.870,35.500 92.441,35.527 92.542 C 35.554 92.644,35.398 92.916,35.181 93.147 C 34.964 93.378,34.676 93.822,34.542 94.134 C 34.408 94.447,34.074 94.941,33.800 95.232 C 33.526 95.524,33.302 95.856,33.302 95.971 C 33.302 96.086,33.089 96.459,32.829 96.800 C 32.569 97.141,32.356 97.527,32.356 97.657 C 32.356 97.788,32.194 98.070,31.996 98.285 C 31.656 98.654,31.110 99.547,30.515 100.706 C 30.370 100.990,30.171 101.272,30.073 101.332 C 29.976 101.392,29.896 101.592,29.896 101.776 C 29.896 101.960,29.683 102.310,29.423 102.554 C 29.163 102.799,28.950 103.139,28.950 103.311 C 28.950 103.483,28.745 103.816,28.495 104.051 C 28.245 104.286,27.983 104.780,27.914 105.149 C 27.845 105.518,27.539 106.085,27.233 106.410 C 26.928 106.735,26.716 107.099,26.761 107.220 C 26.806 107.340,26.678 107.587,26.477 107.769 C 26.276 107.951,26.112 108.252,26.112 108.438 C 26.112 108.624,26.032 108.825,25.934 108.886 C 25.725 109.015,25.166 110.097,25.166 110.374 C 25.166 110.480,25.049 110.701,24.908 110.865 C 24.766 111.029,24.497 111.573,24.310 112.072 C 24.124 112.572,23.805 113.098,23.602 113.240 C 23.388 113.390,23.291 113.594,23.372 113.724 C 23.448 113.848,23.409 114.012,23.285 114.089 C 23.161 114.166,23.040 114.357,23.017 114.513 C 22.994 114.669,22.842 115.001,22.679 115.251 C 22.516 115.500,22.320 115.918,22.245 116.178 C 22.005 117.008,21.524 117.971,21.276 118.117 C 21.144 118.196,20.979 118.600,20.908 119.016 C 20.838 119.432,20.703 119.773,20.608 119.773 C 20.513 119.773,20.435 119.909,20.435 120.075 C 20.435 120.390,19.954 121.350,19.531 121.878 C 19.395 122.047,19.304 122.260,19.328 122.351 C 19.423 122.710,19.048 123.830,18.710 124.192 C 18.514 124.402,18.354 124.722,18.354 124.902 C 18.354 125.081,18.265 125.258,18.156 125.294 C 18.048 125.331,17.934 125.593,17.904 125.878 C 17.874 126.163,17.792 126.453,17.723 126.522 C 17.654 126.591,17.597 126.800,17.597 126.985 C 17.597 127.171,17.456 127.402,17.284 127.498 C 17.104 127.598,17.019 127.797,17.083 127.965 C 17.148 128.134,17.072 128.303,16.903 128.368 C 16.743 128.430,16.659 128.604,16.718 128.756 C 16.776 128.908,16.742 129.083,16.643 129.144 C 16.543 129.206,16.462 129.496,16.462 129.789 C 16.462 130.083,16.337 130.426,16.184 130.553 C 16.031 130.680,15.913 130.839,15.922 130.907 C 15.975 131.306,15.854 131.666,15.559 131.989 C 15.375 132.191,15.231 132.483,15.240 132.640 C 15.254 132.898,14.806 134.251,14.394 135.194 C 14.034 136.017,13.441 137.881,13.325 138.555 C 13.257 138.946,13.127 139.313,13.034 139.370 C 12.942 139.427,12.867 139.724,12.867 140.030 C 12.867 140.336,12.781 140.587,12.677 140.587 C 12.573 140.587,12.488 140.752,12.488 140.954 C 12.488 141.156,12.403 141.374,12.299 141.438 C 12.195 141.502,12.108 141.784,12.106 142.064 C 12.103 142.344,11.940 142.928,11.743 143.362 C 11.546 143.796,11.432 144.198,11.489 144.255 C 11.547 144.312,11.412 144.782,11.189 145.299 C 10.967 145.816,10.785 146.405,10.785 146.608 C 10.785 146.811,10.658 147.220,10.503 147.519 C 10.347 147.817,10.219 148.290,10.219 148.570 C 10.218 148.850,10.144 149.124,10.054 149.180 C 9.964 149.236,9.832 149.645,9.760 150.090 C 9.514 151.625,8.933 154.114,8.690 154.683 C 8.531 155.055,8.445 155.436,7.841 158.467 C 7.675 159.300,7.457 160.135,7.357 160.323 C 7.256 160.510,7.122 161.216,7.060 161.890 C 6.997 162.564,6.873 163.160,6.784 163.215 C 6.695 163.270,6.621 163.586,6.620 163.918 C 6.618 164.251,6.490 165.061,6.335 165.719 C 6.180 166.377,6.010 167.271,5.957 167.706 C 5.904 168.140,5.815 168.794,5.757 169.158 C 5.700 169.522,5.628 170.076,5.597 170.388 C 5.566 170.700,5.489 171.083,5.425 171.239 C 5.361 171.395,5.221 172.247,5.113 173.132 C 5.006 174.016,4.874 174.995,4.821 175.307 C 4.767 175.620,4.675 176.471,4.616 177.200 C 4.557 177.928,4.436 178.612,4.347 178.719 C 4.258 178.827,4.184 179.337,4.182 179.854 C 4.180 180.372,4.133 181.306,4.077 181.930 C 4.021 182.554,3.937 183.576,3.890 184.201 C 3.843 184.825,3.790 185.336,3.772 185.336 C 3.711 185.336,3.445 190.033,3.343 192.917 C 3.310 193.860,3.223 194.729,3.149 194.847 C 3.017 195.060,3.058 195.456,3.313 196.452 C 3.388 196.743,3.369 196.973,3.271 196.973 C 2.976 196.973,3.139 207.939,3.515 213.434 C 3.575 214.319,3.650 215.511,3.680 216.083 C 3.711 216.656,3.841 218.188,3.969 219.489 C 4.098 220.790,4.193 222.138,4.181 222.485 C 4.170 222.833,4.219 223.211,4.291 223.327 C 4.449 223.584,4.491 223.880,4.653 225.875 C 4.722 226.734,4.832 227.436,4.897 227.436 C 4.961 227.436,5.029 227.670,5.047 227.956 C 5.081 228.509,5.332 230.268,5.686 232.450 C 5.804 233.179,5.892 234.009,5.880 234.295 C 5.869 234.581,5.927 234.816,6.010 234.816 C 6.092 234.816,6.155 235.163,6.149 235.587 C 6.144 236.012,6.205 236.400,6.286 236.450 C 6.367 236.500,6.433 236.797,6.433 237.110 C 6.433 237.423,6.516 237.833,6.617 238.023 C 6.719 238.212,6.898 238.994,7.016 239.760 C 7.134 240.527,7.282 241.239,7.344 241.342 C 7.407 241.445,7.471 241.785,7.488 242.099 C 7.504 242.412,7.616 243.024,7.736 243.460 C 7.857 243.896,7.937 244.321,7.916 244.406 C 7.894 244.491,8.052 245.128,8.267 245.821 C 8.482 246.515,8.615 247.303,8.564 247.572 C 8.511 247.851,8.557 248.061,8.673 248.061 C 8.785 248.061,8.929 248.380,8.994 248.770 C 9.059 249.160,9.162 249.607,9.224 249.763 C 9.286 249.920,9.352 250.218,9.370 250.426 C 9.389 250.634,9.502 251.044,9.622 251.337 C 9.741 251.630,9.839 252.027,9.839 252.220 C 9.839 252.413,9.929 252.600,10.040 252.637 C 10.150 252.674,10.245 253.071,10.251 253.519 C 10.258 254.029,10.360 254.371,10.524 254.434 C 10.668 254.489,10.785 254.736,10.785 254.982 C 10.785 255.505,11.579 258.598,11.996 259.697 C 12.153 260.114,12.286 260.593,12.291 260.764 C 12.295 260.934,12.426 261.317,12.582 261.615 C 12.737 261.913,12.865 262.292,12.865 262.457 C 12.866 262.621,12.926 262.815,12.998 262.888 C 13.071 262.960,13.152 263.123,13.179 263.251 C 13.404 264.299,13.720 265.234,13.934 265.483 C 14.076 265.648,14.191 265.999,14.191 266.264 C 14.191 266.529,14.319 266.852,14.475 266.982 C 14.631 267.112,14.759 267.458,14.759 267.751 C 14.759 268.044,14.838 268.333,14.936 268.393 C 15.033 268.454,15.252 268.991,15.423 269.587 C 15.594 270.184,15.898 270.953,16.098 271.297 C 16.298 271.642,16.462 272.082,16.462 272.275 C 16.462 272.469,16.558 272.659,16.675 272.698 C 16.792 272.737,16.907 272.936,16.929 273.139 C 17.027 274.010,17.279 274.723,17.524 274.816 C 17.668 274.872,17.786 275.128,17.786 275.385 C 17.786 275.642,17.871 275.905,17.975 275.970 C 18.079 276.034,18.165 276.232,18.165 276.409 C 18.165 276.587,18.335 277.050,18.543 277.438 C 18.751 277.827,18.925 278.294,18.928 278.476 C 18.932 278.659,19.137 279.055,19.384 279.357 C 19.631 279.659,19.788 280.024,19.733 280.169 C 19.678 280.313,19.771 280.583,19.940 280.770 C 20.109 280.957,20.375 281.538,20.530 282.062 C 20.686 282.585,20.983 283.230,21.192 283.495 C 21.400 283.760,21.570 284.084,21.570 284.216 C 21.570 284.347,21.687 284.589,21.830 284.753 C 21.973 284.918,22.233 285.494,22.409 286.035 C 22.585 286.575,22.882 287.214,23.070 287.454 C 23.257 287.694,23.476 288.103,23.555 288.363 C 23.635 288.623,23.944 289.172,24.243 289.583 C 24.542 289.994,24.787 290.569,24.787 290.860 C 24.787 291.152,24.852 291.391,24.931 291.391 C 25.093 291.391,25.194 291.562,26.053 293.295 C 26.385 293.965,26.875 294.806,27.141 295.164 C 27.407 295.523,27.625 295.999,27.625 296.223 C 27.625 296.447,27.796 296.784,28.004 296.973 C 28.212 297.161,28.382 297.402,28.382 297.507 C 28.382 297.613,28.501 297.834,28.647 297.998 C 29.249 298.678,29.679 299.668,29.465 299.882 C 29.311 300.036,29.391 300.234,29.765 300.624 C 30.045 300.917,30.274 301.258,30.274 301.382 C 30.274 301.507,30.346 301.608,30.433 301.608 C 30.521 301.608,30.692 301.800,30.815 302.034 C 30.937 302.268,31.289 302.800,31.596 303.217 C 31.903 303.633,32.157 304.086,32.160 304.224 C 32.164 304.361,32.273 304.592,32.403 304.737 C 32.948 305.345,33.113 305.575,33.113 305.728 C 33.113 305.817,33.367 306.133,33.678 306.431 C 34.339 307.065,34.665 306.968,36.013 305.736 C 36.434 305.351,36.848 305.079,36.934 305.132 C 37.019 305.184,37.140 305.094,37.202 304.932 C 37.265 304.769,37.430 304.636,37.569 304.636 C 37.708 304.636,37.940 304.466,38.086 304.259 C 38.231 304.051,38.408 303.939,38.479 304.011 C 38.550 304.082,38.739 303.953,38.899 303.726 C 39.058 303.498,39.308 303.311,39.453 303.311 C 39.598 303.311,39.784 303.205,39.868 303.075 C 39.951 302.945,40.307 302.677,40.660 302.481 C 41.013 302.284,41.460 301.986,41.653 301.819 C 41.847 301.651,42.169 301.372,42.368 301.198 C 42.568 301.025,42.783 300.935,42.846 300.998 C 42.909 301.061,43.091 300.926,43.251 300.698 C 43.410 300.470,43.655 300.284,43.794 300.284 C 43.933 300.284,44.098 300.151,44.160 299.988 C 44.222 299.825,44.350 299.739,44.443 299.797 C 44.536 299.854,44.941 299.597,45.343 299.225 C 45.745 298.853,46.383 298.390,46.760 298.195 C 47.137 298.000,47.497 297.709,47.558 297.548 C 47.620 297.388,47.790 297.256,47.937 297.256 C 48.083 297.256,48.309 297.130,48.437 296.975 C 48.566 296.820,48.747 296.740,48.840 296.797 C 48.933 296.855,49.061 296.768,49.123 296.605 C 49.186 296.442,49.544 296.163,49.920 295.985 C 50.295 295.806,50.746 295.530,50.921 295.371 C 51.096 295.211,51.463 294.877,51.737 294.629 C 52.011 294.381,52.289 294.231,52.354 294.297 C 52.420 294.362,52.593 294.245,52.740 294.035 C 52.886 293.826,53.080 293.701,53.171 293.757 C 53.261 293.813,53.404 293.750,53.489 293.618 C 53.635 293.389,54.125 293.034,54.633 292.790 C 54.761 292.728,55.229 292.345,55.673 291.939 C 56.117 291.534,56.558 291.202,56.652 291.202 C 56.746 291.202,57.129 290.968,57.503 290.682 C 57.877 290.396,58.245 290.182,58.320 290.207 C 58.395 290.232,58.547 290.082,58.658 289.875 C 58.768 289.668,58.987 289.499,59.142 289.499 C 59.298 289.499,59.476 289.366,59.538 289.204 C 59.601 289.042,59.753 288.948,59.877 288.996 C 60.001 289.043,60.204 288.921,60.327 288.723 C 60.451 288.525,60.636 288.363,60.740 288.363 C 60.843 288.363,61.097 288.214,61.306 288.032 C 61.514 287.850,61.861 287.545,62.078 287.354 C 62.295 287.163,62.515 287.050,62.567 287.102 C 62.619 287.154,62.825 287.055,63.024 286.881 C 63.224 286.708,63.550 286.424,63.750 286.250 C 63.949 286.077,64.164 285.987,64.227 286.050 C 64.290 286.113,64.472 285.978,64.632 285.750 C 64.792 285.522,65.025 285.336,65.150 285.336 C 65.275 285.336,65.484 285.166,65.614 284.957 C 65.744 284.749,65.950 284.579,66.073 284.579 C 66.196 284.579,66.784 284.196,67.380 283.728 C 67.976 283.259,68.556 282.876,68.669 282.876 C 68.782 282.876,68.874 282.801,68.874 282.709 C 68.874 282.617,69.023 282.488,69.205 282.422 C 69.809 282.204,70.450 281.773,70.619 281.471 C 70.710 281.307,70.904 281.173,71.050 281.173 C 71.196 281.173,71.383 281.056,71.466 280.912 C 71.550 280.769,71.919 280.491,72.286 280.296 C 72.944 279.946,73.261 279.714,74.012 279.029 C 74.222 278.838,74.434 278.722,74.483 278.772 C 74.533 278.822,74.773 278.680,75.017 278.457 C 75.752 277.784,76.020 277.596,76.111 277.688 C 76.159 277.735,76.572 277.432,77.030 277.014 C 77.487 276.596,77.959 276.254,78.078 276.254 C 78.197 276.254,78.347 276.117,78.411 275.950 C 78.475 275.783,78.639 275.690,78.776 275.742 C 78.912 275.794,79.127 275.672,79.253 275.470 C 79.379 275.269,79.561 275.152,79.656 275.211 C 79.752 275.270,79.922 275.145,80.035 274.934 C 80.148 274.723,80.356 274.551,80.497 274.551 C 80.639 274.551,80.803 274.423,80.863 274.267 C 80.923 274.111,81.092 273.983,81.239 273.983 C 81.385 273.983,81.609 273.858,81.736 273.705 C 81.863 273.552,82.022 273.446,82.090 273.469 C 82.158 273.491,82.405 273.340,82.640 273.132 C 82.874 272.923,83.243 272.597,83.459 272.406 C 83.676 272.215,83.903 272.108,83.963 272.168 C 84.023 272.229,84.191 272.108,84.336 271.900 C 84.482 271.693,84.723 271.523,84.874 271.523 C 85.024 271.523,85.147 271.438,85.147 271.334 C 85.147 271.230,85.296 271.145,85.480 271.145 C 85.663 271.145,85.921 270.971,86.053 270.759 C 86.186 270.547,86.367 270.418,86.457 270.474 C 86.546 270.529,86.758 270.362,86.928 270.102 C 87.098 269.843,87.362 269.631,87.516 269.631 C 87.670 269.631,87.796 269.554,87.796 269.461 C 87.796 269.367,88.158 269.103,88.600 268.874 C 89.042 268.644,89.472 268.337,89.555 268.192 C 89.639 268.047,89.830 267.928,89.981 267.928 C 90.132 267.928,90.255 267.841,90.255 267.734 C 90.255 267.628,90.468 267.459,90.728 267.360 C 90.989 267.262,91.202 267.113,91.202 267.030 C 91.202 266.947,91.521 266.713,91.911 266.511 C 92.632 266.138,92.857 265.977,93.614 265.288 C 93.848 265.075,94.105 264.922,94.185 264.948 C 94.328 264.994,94.626 264.780,95.394 264.081 C 95.603 263.890,95.823 263.783,95.883 263.843 C 95.943 263.903,96.111 263.782,96.257 263.575 C 96.402 263.367,96.641 263.198,96.787 263.198 C 96.934 263.198,97.145 263.027,97.256 262.819 C 97.368 262.611,97.566 262.441,97.696 262.441 C 97.826 262.441,98.228 262.189,98.588 261.881 C 98.948 261.573,99.345 261.318,99.470 261.313 C 99.595 261.309,99.765 261.199,99.849 261.069 C 99.932 260.939,100.170 260.738,100.378 260.623 C 100.865 260.354,100.977 259.783,100.587 259.564 C 100.420 259.471,100.284 259.324,100.284 259.238 C 100.284 259.151,99.986 258.586,99.622 257.981 C 99.257 257.376,98.959 256.766,98.959 256.626 C 98.959 256.485,98.803 256.202,98.612 255.997 C 98.421 255.792,97.979 255.051,97.629 254.350 C 97.279 253.648,96.927 253.047,96.847 253.014 C 96.766 252.980,96.644 252.639,96.575 252.257 C 96.507 251.874,96.369 251.458,96.270 251.333 C 95.977 250.964,95.364 249.702,95.364 249.469 C 95.364 249.350,95.194 249.057,94.986 248.817 C 94.778 248.577,94.607 248.192,94.607 247.960 C 94.607 247.729,94.480 247.433,94.324 247.304 C 94.167 247.174,94.039 246.972,94.039 246.855 C 94.038 246.737,93.928 246.429,93.794 246.168 C 93.659 245.908,93.364 245.142,93.137 244.465 C 92.909 243.789,92.551 242.898,92.341 242.486 C 92.131 242.074,91.958 241.551,91.958 241.324 C 91.958 241.097,91.831 240.862,91.675 240.802 C 91.518 240.742,91.391 240.480,91.391 240.219 C 91.391 239.959,91.175 239.258,90.912 238.663 C 90.648 238.067,90.474 237.471,90.525 237.339 C 90.576 237.207,90.536 237.048,90.436 236.986 C 90.337 236.925,90.255 236.743,90.255 236.583 C 90.255 236.423,90.138 236.024,89.994 235.696 C 89.633 234.873,89.405 234.170,89.035 232.734 C 88.860 232.058,88.638 231.243,88.540 230.923 C 88.443 230.604,88.363 230.199,88.363 230.024 C 88.363 229.850,88.269 229.707,88.154 229.707 C 88.038 229.707,87.997 229.569,88.062 229.399 C 88.127 229.230,88.106 228.995,88.014 228.879 C 87.923 228.762,87.793 228.249,87.727 227.739 C 87.660 227.229,87.529 226.718,87.435 226.604 C 87.341 226.489,87.205 225.885,87.133 225.260 C 87.061 224.636,86.875 223.674,86.720 223.122 C 86.565 222.570,86.365 221.506,86.276 220.757 C 86.039 218.777,85.722 216.991,85.531 216.556 C 85.440 216.348,85.312 215.241,85.247 214.096 C 85.073 211.034,84.952 209.437,84.844 208.798 C 84.589 207.284,84.477 198.358,84.678 195.553 C 84.730 194.825,84.809 193.718,84.853 193.094 C 84.897 192.469,85.030 190.851,85.149 189.499 C 85.269 188.146,85.391 186.729,85.421 186.350 C 85.452 185.972,85.521 185.588,85.574 185.499 C 85.628 185.409,85.733 184.697,85.808 183.917 C 85.884 183.136,86.031 182.392,86.135 182.264 C 86.239 182.135,86.272 181.893,86.208 181.726 C 86.144 181.559,86.155 181.324,86.233 181.203 C 86.311 181.083,86.476 180.345,86.598 179.565 C 86.721 178.784,86.878 177.933,86.947 177.673 C 87.017 177.412,87.119 176.753,87.174 176.206 C 87.230 175.660,87.347 175.213,87.434 175.213 C 87.522 175.213,87.650 174.785,87.719 174.263 C 87.789 173.740,87.916 173.269,88.001 173.216 C 88.087 173.163,88.214 172.612,88.284 171.990 C 88.355 171.369,88.477 170.861,88.556 170.861 C 88.679 170.861,88.867 170.215,89.051 169.158 C 89.178 168.428,89.542 167.132,89.766 166.612 C 90.345 165.264,90.429 164.986,90.334 164.738 C 90.279 164.594,90.375 164.422,90.548 164.356 C 90.726 164.287,90.816 164.116,90.756 163.959 C 90.698 163.807,90.732 163.633,90.831 163.571 C 90.931 163.510,91.012 163.214,91.012 162.914 C 91.012 162.614,91.097 162.316,91.202 162.252 C 91.306 162.187,91.391 161.991,91.392 161.815 C 91.393 161.639,91.520 161.251,91.676 160.953 C 91.831 160.655,91.958 160.303,91.958 160.172 C 91.958 160.040,92.086 159.827,92.242 159.697 C 92.398 159.568,92.526 159.217,92.526 158.917 C 92.526 158.618,92.611 158.373,92.715 158.373 C 92.819 158.373,92.904 158.207,92.904 158.005 C 92.904 157.803,92.990 157.586,93.094 157.521 C 93.198 157.457,93.283 157.239,93.283 157.037 C 93.283 156.835,93.368 156.670,93.472 156.670 C 93.576 156.670,93.661 156.457,93.661 156.197 C 93.661 155.937,93.746 155.724,93.851 155.724 C 93.955 155.724,94.040 155.558,94.040 155.356 C 94.040 155.154,94.114 154.943,94.205 154.887 C 94.295 154.831,94.424 154.513,94.491 154.179 C 94.557 153.846,94.732 153.439,94.879 153.276 C 95.025 153.113,95.173 152.854,95.207 152.701 C 95.242 152.547,95.372 152.311,95.498 152.175 C 95.624 152.039,95.683 151.814,95.629 151.675 C 95.576 151.535,95.668 151.368,95.835 151.304 C 96.002 151.240,96.122 151.080,96.101 150.949 C 96.052 150.643,96.622 149.354,96.875 149.198 C 96.981 149.132,97.067 148.918,97.067 148.722 C 97.067 148.526,97.247 148.240,97.466 148.086 C 97.686 147.933,97.814 147.725,97.753 147.625 C 97.691 147.525,97.809 147.228,98.016 146.965 C 98.223 146.702,98.392 146.357,98.392 146.197 C 98.392 146.037,98.472 145.857,98.570 145.797 C 98.668 145.736,98.936 145.310,99.166 144.849 C 99.396 144.389,99.678 144.029,99.792 144.049 C 99.907 144.070,99.973 143.930,99.940 143.737 C 99.907 143.545,99.992 143.247,100.129 143.075 C 100.434 142.693,100.816 142.036,101.254 141.139 C 101.437 140.767,101.719 140.352,101.881 140.218 C 102.043 140.083,102.176 139.856,102.176 139.712 C 102.176 139.569,102.472 139.124,102.835 138.723 C 103.197 138.322,103.444 137.944,103.382 137.883 C 103.256 137.756,104.837 135.667,105.059 135.667 C 105.138 135.667,105.203 135.517,105.203 135.334 C 105.203 135.151,105.500 134.661,105.862 134.246 C 106.224 133.831,106.522 133.385,106.524 133.254 C 106.526 133.124,106.627 133.039,106.748 133.065 C 106.869 133.091,107.018 132.927,107.079 132.700 C 107.192 132.281,107.820 131.433,108.930 130.202 C 109.269 129.825,109.549 129.414,109.551 129.288 C 109.553 129.161,109.726 128.967,109.934 128.855 C 110.142 128.744,110.312 128.528,110.312 128.376 C 110.312 128.223,110.405 128.098,110.518 128.098 C 110.815 128.098,111.434 127.306,111.441 126.916 C 111.445 126.717,111.593 126.585,111.813 126.585 C 112.072 126.585,112.197 126.432,112.239 126.064 C 112.280 125.705,112.401 125.552,112.630 125.570 C 112.812 125.585,112.961 125.521,112.961 125.429 C 112.961 125.337,113.259 124.931,113.623 124.528 C 113.988 124.125,114.286 123.699,114.286 123.582 C 114.286 123.464,114.413 123.368,114.570 123.368 C 114.726 123.368,114.854 123.304,114.854 123.226 C 114.855 122.992,116.210 121.476,116.417 121.476 C 116.688 121.476,117.111 120.877,117.118 120.482 C 117.121 120.297,117.270 120.149,117.455 120.147 C 117.637 120.144,118.031 119.811,118.331 119.405 C 118.654 118.970,118.982 118.709,119.135 118.768 C 119.278 118.823,119.395 118.791,119.395 118.698 C 119.395 118.605,119.733 118.149,120.146 117.685 C 120.559 117.220,120.900 116.776,120.903 116.698 C 120.906 116.620,121.026 116.556,121.170 116.556 C 121.313 116.556,121.656 116.262,121.930 115.901 C 122.243 115.491,122.534 115.287,122.710 115.354 C 122.884 115.421,122.990 115.348,122.990 115.161 C 122.990 114.996,123.181 114.810,123.415 114.748 C 123.649 114.687,124.120 114.259,124.462 113.799 C 124.804 113.338,125.169 112.961,125.275 112.961 C 125.625 112.961,126.383 111.929,126.388 111.447 C 126.391 111.052,125.869 110.217,124.884 109.043 C 124.779 108.917,124.689 108.747,124.685 108.665 C 124.681 108.582,124.425 108.220,124.117 107.860 C 123.809 107.499,123.557 107.123,123.557 107.024 C 123.557 106.925,123.427 106.709,123.269 106.544 C 122.761 106.017,121.665 104.476,121.665 104.289 C 121.665 104.190,121.537 104.060,121.381 104.000 C 121.225 103.940,121.097 103.790,121.097 103.668 C 121.097 103.545,120.799 103.081,120.435 102.637 C 120.071 102.192,119.773 101.736,119.773 101.624 C 119.773 101.511,119.688 101.419,119.584 101.419 C 119.480 101.419,119.395 101.305,119.395 101.165 C 119.395 101.025,119.224 100.756,119.016 100.568 C 118.808 100.379,118.638 100.120,118.638 99.991 C 118.638 99.862,118.510 99.708,118.354 99.648 C 118.198 99.588,118.070 99.413,118.070 99.258 C 118.070 99.104,117.959 98.910,117.823 98.827 C 117.687 98.744,117.373 98.335,117.124 97.919 C 116.875 97.502,116.561 97.094,116.425 97.010 C 116.289 96.927,116.178 96.766,116.178 96.652 C 116.178 96.537,115.880 96.080,115.516 95.636 C 115.151 95.191,114.853 94.753,114.853 94.663 C 114.853 94.573,114.601 94.204,114.293 93.843 C 113.985 93.483,113.730 93.121,113.726 93.038 C 113.722 92.956,113.632 92.786,113.527 92.660 C 112.772 91.760,112.204 90.922,112.204 90.709 C 112.204 90.571,112.034 90.367,111.826 90.255 C 111.618 90.144,111.447 89.926,111.447 89.770 C 111.447 89.614,111.320 89.438,111.164 89.378 C 111.008 89.318,110.880 89.189,110.880 89.092 C 110.880 88.883,110.091 87.729,109.886 87.638 C 109.808 87.603,109.745 87.459,109.745 87.316 C 109.745 87.174,109.638 86.990,109.508 86.906 C 109.195 86.706,108.420 85.593,108.420 85.344 C 108.420 85.235,108.333 85.147,108.226 85.147 C 108.120 85.147,107.951 84.934,107.852 84.674 C 107.753 84.413,107.585 84.201,107.479 84.201 C 107.372 84.201,107.285 84.112,107.285 84.004 C 107.285 83.795,106.542 82.672,106.274 82.476 C 106.086 82.338,105.636 81.589,105.472 81.139 C 105.408 80.964,105.236 80.775,105.090 80.719 C 104.944 80.663,104.825 80.496,104.825 80.348 C 104.825 80.200,104.697 80.029,104.541 79.969 C 104.385 79.910,104.257 79.743,104.257 79.600 C 104.257 79.457,104.087 79.186,103.879 78.997 C 103.671 78.809,103.500 78.582,103.500 78.493 C 103.500 78.404,103.032 77.698,102.460 76.924 C 101.887 76.150,101.419 75.467,101.419 75.407 C 101.419 75.346,101.100 74.885,100.710 74.382 C 100.319 73.879,99.872 73.278,99.716 73.046 C 99.560 72.815,99.262 72.431,99.054 72.193 C 98.846 71.956,98.505 71.477,98.297 71.129 C 98.089 70.781,97.769 70.280,97.585 70.016 C 97.402 69.752,97.200 69.387,97.138 69.205 C 97.075 69.023,96.946 68.874,96.851 68.874 C 96.757 68.874,96.598 68.661,96.500 68.401 C 96.401 68.141,96.232 67.928,96.126 67.928 C 96.019 67.928,95.932 67.836,95.932 67.723 C 95.932 67.611,95.634 67.155,95.270 66.711 C 94.905 66.266,94.607 65.805,94.607 65.685 C 94.607 65.566,94.520 65.468,94.413 65.468 C 94.307 65.468,94.137 65.277,94.036 65.043 C 93.750 64.382,93.408 63.889,93.046 63.616 C 92.864 63.478,92.715 63.261,92.715 63.133 C 92.715 63.004,92.463 62.605,92.155 62.245 C 91.847 61.884,91.592 61.522,91.588 61.440 C 91.583 61.357,91.494 61.187,91.389 61.061 C 90.740 60.285,89.688 58.868,89.688 58.772 C 89.688 58.668,88.254 56.616,87.796 56.063 C 87.692 55.937,87.606 55.776,87.606 55.704 C 87.606 55.632,87.308 55.210,86.944 54.765 C 86.580 54.321,86.282 53.872,86.282 53.768 C 86.282 53.664,86.218 53.551,86.140 53.516 C 85.977 53.444,85.147 52.290,85.147 52.136 C 85.147 52.080,84.998 51.870,84.816 51.669 C 84.309 51.111,84.132 50.868,83.637 50.047 C 83.386 49.631,83.070 49.222,82.934 49.139 C 82.798 49.056,82.687 48.894,82.687 48.780 C 82.687 48.666,82.389 48.209,82.025 47.764 C 81.660 47.320,81.362 46.864,81.362 46.752 C 81.362 46.639,81.277 46.547,81.173 46.547 C 81.069 46.547,80.984 46.433,80.984 46.294 C 80.984 46.033,79.963 45.029,79.708 45.039 C 79.629 45.042,79.395 45.140,79.186 45.256 ",stroke:"none",fill:"#9fbb1a","fill-rule":"evenodd"}),React.createElement("path",{id:"path7",d:"M190.728 4.092 C 190.364 4.223,189.799 4.285,189.473 4.229 C 189.135 4.172,188.824 4.219,188.750 4.338 C 188.679 4.453,188.530 4.491,188.419 4.423 C 188.117 4.236,186.136 4.191,185.800 4.363 C 185.639 4.446,184.674 4.555,183.655 4.606 C 182.637 4.658,181.757 4.746,181.700 4.803 C 181.643 4.860,181.445 4.825,181.260 4.726 C 181.028 4.602,180.702 4.639,180.211 4.844 C 179.819 5.008,179.236 5.103,178.916 5.056 C 178.597 5.009,178.153 5.054,177.930 5.155 C 177.665 5.276,177.408 5.275,177.188 5.151 C 176.939 5.012,176.677 5.060,176.193 5.332 C 175.705 5.606,175.498 5.643,175.395 5.476 C 175.317 5.350,175.150 5.315,175.018 5.396 C 174.731 5.574,173.781 5.731,173.132 5.709 C 172.871 5.700,172.531 5.745,172.375 5.809 C 172.219 5.872,171.835 5.942,171.523 5.964 C 171.211 5.986,170.805 6.068,170.621 6.145 C 170.437 6.223,170.057 6.243,169.775 6.189 C 169.494 6.135,168.963 6.205,168.596 6.343 C 168.229 6.481,167.673 6.577,167.360 6.556 C 167.048 6.534,166.553 6.631,166.259 6.771 C 165.966 6.910,165.540 7.007,165.313 6.985 C 165.086 6.963,164.773 6.996,164.617 7.059 C 164.461 7.122,163.936 7.213,163.450 7.261 C 162.965 7.310,162.403 7.437,162.203 7.544 C 162.003 7.651,161.464 7.761,161.005 7.788 C 160.547 7.815,159.865 7.985,159.491 8.166 C 159.117 8.347,158.627 8.447,158.401 8.388 C 158.176 8.329,157.886 8.367,157.757 8.472 C 157.627 8.576,157.223 8.661,156.859 8.658 C 156.495 8.656,155.899 8.785,155.535 8.945 C 155.170 9.104,154.532 9.288,154.115 9.354 C 153.699 9.419,153.018 9.570,152.602 9.689 C 152.185 9.809,151.771 9.888,151.680 9.865 C 151.589 9.842,151.079 9.974,150.545 10.156 C 150.011 10.339,149.404 10.494,149.196 10.501 C 148.988 10.508,148.711 10.580,148.582 10.660 C 148.452 10.741,148.160 10.842,147.933 10.886 C 147.706 10.930,147.466 11.054,147.399 11.162 C 147.333 11.270,146.854 11.388,146.337 11.424 C 145.819 11.460,145.229 11.581,145.025 11.691 C 144.416 12.023,143.918 12.170,143.561 12.126 C 143.375 12.103,142.854 12.291,142.402 12.543 C 141.806 12.877,141.492 12.953,141.259 12.823 C 141.031 12.696,140.841 12.731,140.605 12.944 C 140.423 13.110,140.221 13.245,140.158 13.245 C 140.095 13.245,139.804 13.342,139.511 13.461 C 139.218 13.580,138.851 13.703,138.694 13.735 C 137.405 14.000,136.837 14.157,136.471 14.348 C 135.438 14.886,135.267 14.948,134.805 14.948 C 134.536 14.948,134.188 15.076,134.032 15.232 C 133.876 15.388,133.551 15.516,133.311 15.516 C 133.071 15.516,132.768 15.644,132.638 15.802 C 132.460 16.015,132.336 16.035,132.148 15.879 C 131.958 15.721,131.744 15.777,131.277 16.110 C 130.937 16.353,130.518 16.527,130.348 16.498 C 130.177 16.469,129.991 16.567,129.934 16.715 C 129.877 16.863,129.210 17.172,128.451 17.403 C 127.692 17.633,126.900 17.942,126.691 18.088 C 126.482 18.234,126.171 18.354,126.000 18.354 C 125.829 18.354,125.479 18.520,125.221 18.722 C 124.961 18.927,124.590 19.048,124.387 18.995 C 124.177 18.940,123.727 19.099,123.331 19.367 C 122.952 19.625,122.597 19.791,122.543 19.736 C 122.488 19.682,122.192 19.817,121.883 20.036 C 121.575 20.256,121.143 20.435,120.923 20.435 C 120.702 20.435,120.185 20.648,119.773 20.908 C 119.361 21.168,118.958 21.383,118.878 21.385 C 118.798 21.387,117.966 21.769,117.029 22.235 C 116.093 22.701,115.172 23.082,114.983 23.083 C 114.794 23.084,114.368 23.289,114.037 23.539 C 113.705 23.789,113.117 24.124,112.729 24.284 C 112.341 24.444,111.836 24.750,111.605 24.965 C 111.172 25.369,111.017 25.422,110.449 25.364 C 110.263 25.345,109.604 25.675,108.984 26.099 C 108.364 26.522,107.767 26.868,107.657 26.868 C 107.548 26.868,106.986 27.217,106.409 27.643 C 105.732 28.143,105.231 28.384,104.995 28.322 C 104.763 28.262,104.208 28.515,103.479 29.014 C 102.847 29.447,102.189 29.886,102.016 29.991 C 101.844 30.095,101.650 30.253,101.585 30.342 C 101.520 30.431,101.290 30.448,101.075 30.380 C 100.804 30.294,100.435 30.433,99.869 30.835 C 99.421 31.154,98.845 31.562,98.591 31.743 C 98.336 31.924,97.760 32.349,97.312 32.687 C 96.863 33.025,96.412 33.302,96.309 33.302 C 96.206 33.302,96.121 33.387,96.121 33.491 C 96.121 33.595,96.032 33.680,95.924 33.680 C 95.815 33.680,95.624 33.763,95.498 33.865 C 95.372 33.966,95.019 34.252,94.713 34.501 L 94.157 34.952 94.848 35.972 C 95.229 36.533,96.117 37.818,96.824 38.829 C 97.530 39.840,98.482 41.202,98.939 41.857 C 99.396 42.511,100.152 43.600,100.618 44.276 C 101.085 44.953,101.626 45.682,101.821 45.897 C 102.016 46.112,102.176 46.351,102.176 46.428 C 102.176 46.506,102.474 46.969,102.838 47.457 C 103.690 48.598,103.846 48.816,104.594 49.902 C 105.327 50.967,108.212 55.098,108.792 55.913 C 109.014 56.225,109.932 57.545,110.832 58.846 C 111.732 60.147,112.515 61.254,112.573 61.306 C 112.631 61.358,112.934 61.783,113.246 62.252 C 113.557 62.720,113.878 63.188,113.957 63.292 C 114.786 64.376,115.421 65.277,115.421 65.371 C 115.421 65.434,115.825 66.032,116.320 66.700 C 117.956 68.911,118.920 70.264,119.016 70.484 C 119.068 70.604,119.648 71.461,120.305 72.390 C 124.511 78.336,125.354 79.540,126.329 80.984 C 126.926 81.868,127.674 82.929,127.993 83.340 C 128.311 83.751,128.657 84.236,128.761 84.418 C 128.933 84.718,130.457 86.906,132.027 89.106 C 132.367 89.582,133.022 90.525,133.484 91.202 C 133.945 91.878,134.716 92.985,135.198 93.661 C 135.680 94.338,136.301 95.232,136.580 95.648 C 136.858 96.064,137.171 96.501,137.275 96.618 C 137.379 96.736,137.574 96.991,137.707 97.186 C 137.840 97.381,138.421 98.221,138.998 99.054 C 139.575 99.886,140.190 100.801,140.364 101.087 C 140.778 101.764,141.053 101.743,142.264 100.946 C 142.817 100.581,143.341 100.326,143.427 100.380 C 143.513 100.433,143.697 100.366,143.835 100.231 C 144.299 99.780,145.901 98.770,146.152 98.770 C 146.289 98.770,146.618 98.600,146.882 98.392 C 147.147 98.184,147.483 98.013,147.628 98.013 C 147.774 98.013,148.059 97.888,148.261 97.735 C 148.463 97.583,148.726 97.455,148.846 97.452 C 148.965 97.448,149.509 97.145,150.055 96.778 C 150.600 96.411,151.089 96.153,151.140 96.205 C 151.192 96.257,151.483 96.122,151.786 95.906 C 152.118 95.670,152.519 95.548,152.792 95.600 C 153.102 95.659,153.457 95.512,153.915 95.135 C 154.284 94.831,154.661 94.630,154.754 94.687 C 154.846 94.744,155.137 94.622,155.400 94.416 C 155.663 94.209,156.064 94.040,156.292 94.040 C 156.699 94.040,156.919 93.949,158.510 93.124 C 158.950 92.896,159.546 92.677,159.835 92.638 C 160.332 92.572,161.122 92.273,162.479 91.639 C 162.812 91.484,163.157 91.402,163.247 91.457 C 163.337 91.513,163.916 91.315,164.534 91.018 C 165.152 90.721,165.730 90.547,165.818 90.631 C 165.907 90.716,166.439 90.574,167.002 90.317 C 167.565 90.059,168.344 89.809,168.733 89.762 C 169.521 89.665,170.644 89.319,170.995 89.064 C 171.120 88.973,171.298 88.945,171.391 89.002 C 171.483 89.059,171.986 88.944,172.508 88.746 C 173.207 88.480,173.512 88.441,173.668 88.597 C 173.824 88.753,173.972 88.725,174.230 88.491 C 174.423 88.317,174.760 88.174,174.980 88.174 C 175.200 88.174,175.429 88.095,175.489 87.997 C 175.549 87.900,175.894 87.869,176.255 87.927 C 176.638 87.989,177.025 87.941,177.181 87.811 C 177.329 87.688,177.822 87.566,178.277 87.539 C 178.732 87.512,179.217 87.420,179.356 87.335 C 179.494 87.249,180.025 87.157,180.536 87.129 C 181.047 87.102,181.577 86.986,181.715 86.871 C 181.852 86.757,182.016 86.715,182.079 86.778 C 182.142 86.841,182.631 86.787,183.166 86.659 C 183.701 86.530,184.664 86.406,185.305 86.382 C 185.946 86.358,186.641 86.288,186.850 86.226 C 187.397 86.063,191.399 85.731,194.229 85.613 C 198.932 85.416,201.514 85.397,201.514 85.558 C 201.514 85.654,201.635 85.665,201.783 85.582 C 201.992 85.464,204.170 85.524,206.339 85.706 C 206.505 85.720,207.806 85.733,209.555 85.737 C 209.868 85.738,210.251 85.786,210.407 85.844 C 210.703 85.954,211.110 86.005,212.895 86.157 C 213.483 86.207,214.121 86.329,214.314 86.429 C 214.507 86.528,214.771 86.571,214.901 86.524 C 215.032 86.477,216.032 86.579,217.124 86.751 C 218.216 86.922,219.182 87.017,219.271 86.962 C 219.360 86.907,219.595 86.980,219.792 87.124 C 220.057 87.317,220.216 87.331,220.402 87.177 C 220.589 87.022,220.696 87.038,220.821 87.240 C 220.913 87.390,221.141 87.528,221.327 87.547 C 221.513 87.566,222.067 87.623,222.558 87.674 C 223.049 87.725,223.519 87.808,223.603 87.860 C 223.686 87.911,224.136 88.011,224.602 88.080 C 225.068 88.150,225.542 88.284,225.656 88.378 C 225.770 88.472,225.910 88.502,225.967 88.445 C 226.024 88.388,226.570 88.486,227.179 88.664 C 227.789 88.841,228.415 89.001,228.571 89.019 C 228.728 89.037,229.111 89.160,229.423 89.293 C 229.735 89.426,230.309 89.547,230.699 89.564 C 231.089 89.580,231.408 89.657,231.409 89.735 C 231.409 89.813,231.527 89.877,231.669 89.877 C 231.812 89.877,232.329 90.054,232.818 90.270 C 233.308 90.487,233.820 90.621,233.956 90.568 C 234.093 90.516,234.380 90.596,234.594 90.746 C 234.809 90.896,235.053 90.997,235.136 90.971 C 235.220 90.944,235.544 91.016,235.856 91.130 C 236.168 91.244,236.764 91.446,237.181 91.578 C 237.597 91.710,238.273 91.977,238.683 92.172 C 239.092 92.367,239.620 92.526,239.854 92.526 C 240.089 92.526,240.333 92.611,240.397 92.715 C 240.462 92.819,240.672 92.904,240.866 92.904 C 241.059 92.904,241.246 92.970,241.280 93.049 C 241.315 93.129,242.092 93.441,243.007 93.742 C 243.922 94.043,244.740 94.414,244.825 94.566 C 244.910 94.718,245.209 94.868,245.491 94.899 C 245.772 94.930,246.657 95.268,247.457 95.650 C 248.834 96.308,249.689 96.696,250.331 96.956 C 250.487 97.020,250.870 97.234,251.183 97.434 C 251.495 97.633,251.870 97.803,252.016 97.810 C 252.162 97.818,252.561 98.037,252.902 98.297 C 253.243 98.557,253.630 98.770,253.762 98.770 C 253.893 98.770,254.317 98.989,254.704 99.257 C 255.091 99.526,255.524 99.762,255.666 99.783 C 255.808 99.804,256.191 100.010,256.516 100.242 C 256.841 100.473,257.206 100.662,257.327 100.662 C 257.449 100.662,257.667 100.769,257.812 100.899 C 258.456 101.477,258.653 101.600,259.113 101.716 C 259.382 101.783,259.603 101.966,259.603 102.122 C 259.603 102.289,259.713 102.363,259.871 102.303 C 260.018 102.246,260.183 102.314,260.236 102.453 C 260.289 102.592,260.632 102.804,260.996 102.924 C 261.361 103.045,261.982 103.439,262.376 103.799 C 262.770 104.160,263.182 104.421,263.291 104.379 C 263.401 104.336,263.783 104.590,264.139 104.942 C 264.496 105.294,264.924 105.582,265.091 105.582 C 265.258 105.582,265.962 106.050,266.656 106.623 C 267.350 107.195,268.005 107.663,268.112 107.663 C 268.219 107.663,268.307 107.748,268.307 107.852 C 268.307 107.956,268.436 108.042,268.594 108.042 C 268.753 108.042,268.979 108.254,269.098 108.515 C 269.221 108.785,269.472 108.988,269.684 108.988 C 269.887 108.988,270.385 109.329,270.790 109.746 C 271.194 110.163,271.706 110.532,271.926 110.565 C 272.147 110.599,272.441 110.832,272.581 111.084 C 272.720 111.336,272.837 111.460,272.841 111.360 C 272.845 111.261,273.167 111.516,273.557 111.928 C 274.300 112.712,274.800 113.086,275.355 113.273 C 275.537 113.334,275.686 113.449,275.686 113.528 C 275.686 113.825,277.572 115.636,277.760 115.520 C 277.868 115.453,278.135 115.702,278.353 116.072 C 278.572 116.442,278.827 116.698,278.921 116.640 C 279.015 116.582,279.258 116.817,279.462 117.162 C 279.665 117.507,280.105 117.951,280.439 118.148 C 281.049 118.508,282.687 120.109,282.687 120.345 C 282.687 120.579,283.386 121.281,283.503 121.164 C 283.567 121.101,283.720 121.271,283.844 121.542 C 283.968 121.814,284.213 122.082,284.388 122.138 C 284.564 122.193,284.820 122.449,284.957 122.706 C 285.095 122.962,285.369 123.224,285.567 123.287 C 285.765 123.349,286.020 123.606,286.135 123.857 C 286.249 124.109,286.414 124.314,286.502 124.314 C 286.589 124.314,286.660 124.442,286.660 124.598 C 286.660 124.754,286.740 124.882,286.837 124.882 C 286.934 124.882,287.066 125.048,287.130 125.250 C 287.195 125.453,287.395 125.666,287.575 125.723 C 287.755 125.781,288.042 126.062,288.213 126.348 C 288.945 127.577,289.576 128.101,289.881 127.732 C 290.035 127.546,290.416 127.253,290.728 127.080 C 291.041 126.907,291.807 126.381,292.431 125.911 C 293.056 125.441,293.716 125.007,293.898 124.947 C 294.080 124.887,294.229 124.767,294.229 124.681 C 294.229 124.595,294.437 124.413,294.691 124.277 C 295.220 123.994,297.304 122.597,297.446 122.430 C 297.498 122.369,297.753 122.176,298.013 122.002 C 298.273 121.828,298.912 121.380,299.432 121.007 C 299.953 120.634,300.712 120.108,301.120 119.839 C 301.529 119.569,302.034 119.189,302.244 118.993 C 302.454 118.798,302.730 118.638,302.858 118.638 C 302.986 118.638,303.119 118.570,303.154 118.487 C 303.188 118.404,303.898 117.873,304.730 117.306 C 305.563 116.740,306.287 116.225,306.339 116.161 C 306.391 116.097,306.807 115.798,307.263 115.497 C 308.823 114.465,309.129 114.251,310.763 113.052 C 311.192 112.738,312.053 112.146,312.677 111.736 C 313.302 111.326,313.898 110.924,314.002 110.843 C 314.520 110.440,315.959 109.416,316.457 109.096 C 316.766 108.897,317.187 108.578,317.391 108.388 C 317.596 108.197,317.848 108.042,317.952 108.042 C 318.055 108.042,318.334 107.859,318.571 107.637 C 318.808 107.414,319.161 107.138,319.356 107.022 C 319.885 106.708,321.547 105.551,323.463 104.163 C 324.399 103.484,325.302 102.866,325.469 102.789 C 325.636 102.712,326.019 102.458,326.321 102.224 C 326.622 101.991,327.252 101.502,327.720 101.138 C 328.188 100.774,328.644 100.476,328.733 100.475 C 328.822 100.474,329.163 100.259,329.490 99.997 C 329.817 99.735,330.177 99.448,330.289 99.358 C 330.401 99.268,330.860 98.950,331.308 98.651 C 331.756 98.352,332.440 97.895,332.829 97.635 C 333.217 97.375,333.902 96.917,334.350 96.619 C 334.798 96.320,335.256 95.996,335.368 95.900 C 335.608 95.694,337.379 94.421,338.282 93.806 C 338.627 93.570,339.150 93.186,339.444 92.952 C 339.738 92.718,340.066 92.526,340.172 92.526 C 340.279 92.526,340.394 92.456,340.429 92.371 C 340.488 92.225,340.999 91.856,343.992 89.798 C 344.669 89.333,345.310 88.877,345.416 88.785 C 345.523 88.692,345.864 88.454,346.173 88.255 C 346.483 88.057,347.086 87.638,347.515 87.324 C 349.323 86.002,351.509 84.476,352.195 84.057 C 352.492 83.876,353.295 83.314,353.981 82.808 C 354.667 82.303,355.425 81.799,355.665 81.690 C 356.209 81.442,356.225 80.909,355.707 80.361 C 355.489 80.131,354.905 79.342,354.408 78.606 C 351.941 74.954,351.625 74.551,351.234 74.551 C 350.972 74.551,350.426 74.114,350.426 73.903 C 350.426 73.567,348.578 71.305,348.232 71.218 C 348.005 71.161,347.506 70.660,347.123 70.104 C 346.740 69.549,346.319 69.053,346.186 69.002 C 346.053 68.951,345.633 68.440,345.253 67.866 C 344.872 67.293,344.262 66.640,343.898 66.415 C 343.534 66.189,343.236 65.944,343.236 65.869 C 343.236 65.795,342.767 65.243,342.195 64.642 C 341.623 64.042,341.154 63.478,341.154 63.389 C 341.154 63.301,340.835 63.035,340.445 62.798 C 340.054 62.561,339.661 62.246,339.571 62.098 C 339.481 61.950,339.077 61.488,338.672 61.071 C 338.268 60.655,337.938 60.245,337.938 60.160 C 337.938 60.076,337.773 59.954,337.573 59.891 C 337.372 59.827,337.035 59.481,336.822 59.121 C 336.610 58.762,336.306 58.467,336.146 58.467 C 335.987 58.467,335.856 58.382,335.856 58.278 C 335.856 58.174,335.772 58.089,335.669 58.089 C 335.566 58.089,335.162 57.736,334.771 57.304 C 333.770 56.200,332.960 55.440,332.783 55.440 C 332.588 55.440,330.937 53.717,330.937 53.514 C 330.937 53.428,330.824 53.359,330.687 53.359 C 330.550 53.359,330.151 53.103,329.801 52.791 C 329.452 52.479,329.114 52.223,329.051 52.223 C 328.988 52.223,328.786 51.968,328.602 51.656 C 328.417 51.343,328.149 51.088,328.006 51.088 C 327.863 51.088,327.691 50.918,327.625 50.710 C 327.510 50.348,327.323 50.254,326.836 50.314 C 326.713 50.329,326.559 50.169,326.492 49.958 C 326.425 49.747,326.254 49.574,326.112 49.574 C 325.970 49.574,325.676 49.325,325.458 49.019 C 325.241 48.714,324.873 48.437,324.641 48.404 C 324.409 48.371,324.135 48.153,324.033 47.919 C 323.930 47.684,323.743 47.493,323.616 47.493 C 323.490 47.493,323.319 47.380,323.236 47.242 C 323.152 47.103,322.807 46.830,322.469 46.633 C 322.131 46.437,321.854 46.209,321.854 46.128 C 321.854 46.046,321.764 45.979,321.654 45.979 C 321.544 45.979,321.037 45.543,320.526 45.010 C 319.887 44.344,319.501 44.078,319.289 44.160 C 319.083 44.239,318.950 44.158,318.886 43.916 C 318.834 43.717,318.629 43.512,318.431 43.460 C 318.232 43.408,318.070 43.239,318.070 43.084 C 318.070 42.779,317.569 42.510,317.304 42.673 C 317.214 42.729,316.817 42.432,316.422 42.012 C 316.028 41.593,315.573 41.249,315.411 41.249 C 315.250 41.249,314.654 40.842,314.087 40.345 C 313.520 39.847,312.822 39.338,312.535 39.213 C 312.249 39.089,312.015 38.899,312.015 38.793 C 312.015 38.687,311.890 38.600,311.738 38.600 C 311.586 38.600,311.366 38.423,311.250 38.207 C 311.135 37.990,310.932 37.855,310.799 37.906 C 310.667 37.957,310.232 37.708,309.834 37.353 C 309.435 36.998,308.961 36.708,308.781 36.708 C 308.601 36.708,308.243 36.457,307.985 36.151 C 307.727 35.844,307.476 35.633,307.427 35.682 C 307.379 35.731,307.231 35.641,307.099 35.482 C 306.968 35.324,306.714 35.194,306.536 35.194 C 306.358 35.194,305.964 34.941,305.661 34.632 C 305.357 34.322,304.965 34.067,304.789 34.064 C 304.614 34.061,304.200 33.812,303.870 33.510 C 303.540 33.209,303.030 32.914,302.737 32.856 C 302.443 32.797,301.882 32.427,301.488 32.034 C 301.079 31.625,300.628 31.343,300.434 31.376 C 300.247 31.408,300.095 31.343,300.095 31.232 C 300.095 31.122,299.971 31.031,299.820 31.031 C 299.669 31.031,299.463 30.883,299.361 30.702 C 299.260 30.520,299.116 30.433,299.042 30.507 C 298.890 30.659,297.824 30.087,297.824 29.855 C 297.824 29.774,297.695 29.707,297.538 29.707 C 297.142 29.707,296.529 29.332,295.890 28.700 C 295.593 28.406,295.247 28.204,295.121 28.250 C 294.995 28.296,294.636 28.145,294.324 27.915 C 294.011 27.685,293.511 27.436,293.213 27.362 C 292.914 27.289,292.546 27.105,292.395 26.954 C 292.244 26.803,291.961 26.679,291.767 26.679 C 291.572 26.679,291.360 26.593,291.295 26.488 C 291.230 26.383,290.629 26.040,289.959 25.727 C 289.290 25.414,288.742 25.075,288.742 24.973 C 288.742 24.871,288.593 24.785,288.411 24.783 C 288.228 24.781,287.867 24.612,287.606 24.409 C 287.346 24.205,286.989 24.037,286.813 24.034 C 286.637 24.032,286.440 23.944,286.375 23.838 C 286.309 23.732,286.189 23.687,286.108 23.737 C 286.027 23.787,285.775 23.655,285.547 23.443 C 285.320 23.231,285.030 23.092,284.903 23.136 C 284.777 23.179,284.546 23.071,284.390 22.896 C 284.148 22.624,283.364 22.302,282.814 22.248 C 282.727 22.240,282.540 22.073,282.397 21.878 C 282.246 21.672,282.014 21.570,281.844 21.635 C 281.683 21.697,281.552 21.665,281.552 21.565 C 281.552 21.464,281.432 21.381,281.287 21.381 C 281.141 21.381,280.537 21.126,279.943 20.814 C 279.350 20.501,278.738 20.246,278.583 20.246 C 278.429 20.246,277.698 19.948,276.958 19.584 C 276.219 19.219,275.457 18.921,275.266 18.921 C 275.074 18.921,274.868 18.794,274.808 18.638 C 274.748 18.482,274.494 18.354,274.244 18.354 C 273.994 18.354,273.641 18.279,273.460 18.187 C 273.279 18.095,272.876 17.913,272.564 17.783 C 272.252 17.653,271.826 17.473,271.618 17.383 C 271.410 17.293,271.068 17.196,270.859 17.167 C 270.650 17.138,270.269 16.968,270.013 16.788 C 269.757 16.609,269.370 16.462,269.154 16.462 C 268.938 16.462,268.680 16.394,268.581 16.312 C 268.482 16.230,267.763 15.953,266.982 15.697 C 266.202 15.441,265.535 15.168,265.500 15.090 C 265.465 15.012,265.230 14.948,264.977 14.948 C 264.724 14.948,264.369 14.873,264.189 14.781 C 263.474 14.417,262.885 14.167,262.622 14.114 C 262.470 14.084,262.219 14.011,262.062 13.952 C 261.906 13.893,261.523 13.780,261.211 13.702 C 260.899 13.624,260.601 13.546,260.549 13.529 C 260.497 13.512,260.199 13.434,259.886 13.357 C 259.310 13.213,258.639 12.958,258.044 12.655 C 257.863 12.563,257.549 12.488,257.346 12.488 C 257.142 12.488,256.929 12.413,256.873 12.321 C 256.816 12.229,256.214 12.049,255.535 11.921 C 254.856 11.792,254.253 11.611,254.195 11.517 C 254.137 11.423,254.013 11.394,253.919 11.452 C 253.825 11.510,253.494 11.426,253.184 11.266 C 252.874 11.106,252.408 10.974,252.149 10.974 C 251.890 10.974,251.632 10.901,251.577 10.811 C 251.490 10.670,251.059 10.569,249.571 10.339 C 249.413 10.314,249.194 10.239,249.085 10.171 C 248.975 10.104,248.679 10.009,248.426 9.962 C 247.537 9.795,246.829 9.596,246.641 9.460 C 246.537 9.385,246.325 9.320,246.168 9.316 C 246.012 9.312,245.246 9.168,244.465 8.996 C 243.685 8.824,242.833 8.654,242.573 8.617 C 242.313 8.581,241.845 8.451,241.533 8.330 C 241.220 8.209,240.922 8.121,240.870 8.134 C 240.596 8.206,238.851 7.878,238.653 7.718 C 238.526 7.615,237.917 7.515,237.300 7.494 C 236.683 7.474,236.043 7.345,235.878 7.208 C 235.712 7.071,235.441 7.011,235.274 7.075 C 235.107 7.139,234.872 7.128,234.751 7.051 C 234.630 6.974,234.149 6.900,233.680 6.887 C 233.212 6.874,232.573 6.753,232.261 6.618 C 231.949 6.483,231.626 6.387,231.543 6.406 C 231.460 6.424,230.524 6.303,229.462 6.136 C 228.400 5.969,227.190 5.798,226.774 5.755 C 226.358 5.713,225.634 5.632,225.166 5.576 C 224.697 5.520,223.974 5.439,223.557 5.396 C 223.141 5.354,222.800 5.309,222.800 5.296 C 222.800 5.284,222.460 5.239,222.044 5.196 C 220.557 5.042,219.570 4.935,218.638 4.825 C 217.114 4.646,215.912 4.545,214.096 4.444 C 211.620 4.306,210.155 4.179,209.893 4.078 C 209.766 4.030,209.610 4.075,209.545 4.179 C 209.481 4.282,209.244 4.308,209.019 4.235 C 208.606 4.101,206.004 4.009,202.176 3.994 C 201.031 3.989,199.924 3.983,199.716 3.979 C 198.221 3.955,194.042 3.995,193.188 4.042 C 192.616 4.074,191.977 4.044,191.769 3.977 C 191.561 3.910,191.093 3.962,190.728 4.092 ",stroke:"none",fill:"#b5cb2b","fill-rule":"evenodd"}),React.createElement("path",{id:"path8",d:"",stroke:"none",fill:"#55ff00","fill-rule":"evenodd"}),React.createElement("path",{id:"path9",d:"M364.522 96.081 C 363.619 96.742,362.897 97.244,359.648 99.478 C 358.854 100.024,357.583 100.938,356.822 101.509 C 356.062 102.080,355.333 102.549,355.203 102.551 C 355.073 102.553,354.967 102.627,354.967 102.715 C 354.967 102.851,354.376 103.279,352.707 104.352 C 352.545 104.456,351.944 104.889,351.372 105.314 C 350.799 105.740,350.024 106.293,349.648 106.544 C 347.578 107.929,346.136 108.917,345.885 109.122 C 345.631 109.330,344.163 110.365,341.471 112.233 C 340.970 112.582,340.270 113.079,339.916 113.340 C 339.562 113.600,338.581 114.281,337.736 114.853 C 336.890 115.426,335.705 116.256,335.103 116.698 C 334.500 117.140,333.921 117.502,333.816 117.502 C 333.712 117.502,333.577 117.631,333.516 117.789 C 333.456 117.947,333.212 118.162,332.976 118.267 C 332.595 118.436,331.562 119.112,331.031 119.541 C 330.927 119.624,330.118 120.192,329.234 120.801 C 328.349 121.410,327.597 121.981,327.562 122.071 C 327.528 122.160,327.408 122.233,327.296 122.233 C 327.185 122.233,326.787 122.467,326.413 122.752 C 326.039 123.038,325.180 123.649,324.503 124.109 C 323.827 124.570,323.231 124.997,323.179 125.058 C 323.127 125.119,322.709 125.424,322.250 125.735 C 321.792 126.046,321.229 126.429,320.999 126.585 C 320.769 126.741,320.047 127.252,319.395 127.720 C 318.742 128.188,318.015 128.699,317.780 128.855 C 316.016 130.025,314.359 131.179,313.150 132.081 C 312.370 132.663,311.582 133.194,311.400 133.262 C 311.218 133.329,311.069 133.472,311.069 133.580 C 311.069 133.687,310.971 133.775,310.851 133.775 C 310.731 133.775,310.284 134.034,309.858 134.351 C 308.177 135.600,305.993 137.141,304.778 137.938 C 304.075 138.398,303.500 138.831,303.500 138.901 C 303.500 138.970,303.253 139.129,302.952 139.254 C 302.650 139.379,302.209 139.688,301.972 139.940 C 301.736 140.191,301.463 140.397,301.366 140.397 C 301.269 140.397,300.879 140.639,300.500 140.934 C 300.121 141.228,299.662 141.524,299.480 141.590 C 299.001 141.764,299.066 142.077,299.811 143.183 C 300.175 143.724,300.473 144.297,300.473 144.456 C 300.473 144.615,300.856 145.249,301.325 145.865 C 301.793 146.480,302.176 147.071,302.176 147.178 C 302.176 147.284,302.473 147.940,302.836 148.637 C 303.199 149.333,303.455 149.967,303.406 150.046 C 303.358 150.125,303.615 150.580,303.979 151.057 C 304.343 151.534,304.627 151.991,304.609 152.073 C 304.592 152.156,304.718 152.540,304.890 152.927 C 305.063 153.314,305.203 153.766,305.203 153.933 C 305.203 154.099,305.416 154.514,305.676 154.855 C 305.937 155.197,306.149 155.646,306.149 155.854 C 306.149 156.062,306.308 156.376,306.501 156.551 C 306.726 156.754,306.820 157.034,306.764 157.328 C 306.709 157.616,306.825 157.978,307.075 158.295 C 307.294 158.574,307.474 158.951,307.474 159.132 C 307.474 159.313,307.592 159.560,307.737 159.680 C 307.882 159.800,308.057 160.277,308.127 160.740 C 308.196 161.202,308.339 161.634,308.444 161.699 C 308.549 161.764,308.592 161.928,308.540 162.064 C 308.488 162.200,308.604 162.454,308.798 162.630 C 308.993 162.806,309.105 163.070,309.048 163.218 C 308.992 163.366,309.060 163.625,309.201 163.794 C 309.341 163.963,309.431 164.295,309.400 164.530 C 309.369 164.766,309.434 165.015,309.544 165.083 C 309.654 165.151,309.745 165.404,309.745 165.646 C 309.745 165.887,309.860 166.180,310.002 166.298 C 310.147 166.418,310.220 166.715,310.170 166.976 C 310.117 167.253,310.205 167.564,310.386 167.745 C 310.554 167.913,310.691 168.251,310.691 168.498 C 310.691 168.745,310.776 168.999,310.880 169.063 C 310.984 169.128,311.069 169.388,311.069 169.641 C 311.069 169.895,311.232 170.592,311.432 171.191 C 311.631 171.790,311.849 172.682,311.916 173.174 C 311.982 173.666,312.109 174.113,312.198 174.168 C 312.286 174.223,312.313 174.438,312.259 174.646 C 312.204 174.855,312.254 175.139,312.370 175.279 C 312.485 175.418,312.526 175.585,312.460 175.651 C 312.394 175.717,312.456 175.912,312.599 176.084 C 312.742 176.256,312.881 176.748,312.909 177.177 C 312.958 177.938,313.431 180.323,313.646 180.889 C 313.705 181.045,313.785 181.514,313.822 181.930 C 313.981 183.680,314.099 184.354,314.286 184.579 C 314.413 184.733,314.421 184.979,314.309 185.275 C 314.203 185.553,314.203 185.856,314.307 186.044 C 314.403 186.214,314.514 186.720,314.554 187.169 C 314.594 187.618,314.680 188.453,314.744 189.026 C 315.128 192.434,315.238 194.787,315.312 201.135 C 315.348 204.241,315.301 206.811,315.207 206.929 C 315.114 207.045,315.068 207.746,315.106 208.487 C 315.143 209.228,315.123 209.885,315.061 209.947 C 314.999 210.009,314.935 210.627,314.919 211.321 C 314.894 212.420,314.508 215.779,314.177 217.786 C 314.117 218.150,314.070 218.615,314.073 218.818 C 314.076 219.021,313.991 219.294,313.883 219.424 C 313.775 219.554,313.743 219.839,313.813 220.057 C 313.882 220.275,313.846 220.565,313.734 220.700 C 313.621 220.836,313.534 221.151,313.540 221.401 C 313.558 222.105,312.777 225.972,312.566 226.227 C 312.462 226.352,312.433 226.675,312.501 226.945 C 312.574 227.240,312.544 227.436,312.426 227.436 C 312.317 227.436,312.170 227.841,312.100 228.335 C 311.917 229.615,311.490 231.225,311.260 231.503 C 311.151 231.633,311.112 231.869,311.172 232.026 C 311.233 232.183,311.029 232.869,310.720 233.550 C 310.412 234.231,310.201 234.831,310.253 234.882 C 310.359 234.989,309.875 236.529,308.877 239.262 C 308.801 239.470,308.752 239.704,308.768 239.782 C 308.785 239.860,308.719 239.924,308.621 239.924 C 308.523 239.924,308.442 240.073,308.439 240.255 C 308.431 240.809,307.965 242.384,307.809 242.384 C 307.729 242.384,307.663 242.549,307.663 242.751 C 307.663 242.953,307.578 243.171,307.474 243.236 C 307.370 243.300,307.285 243.551,307.285 243.794 C 307.285 244.037,307.147 244.288,306.979 244.353 C 306.794 244.424,306.710 244.609,306.767 244.825 C 306.820 245.029,306.672 245.410,306.417 245.721 C 306.173 246.019,305.971 246.415,305.967 246.601 C 305.963 246.787,305.828 247.140,305.667 247.385 C 305.506 247.631,305.331 248.075,305.278 248.372 C 305.224 248.669,305.101 248.993,305.003 249.092 C 304.905 249.191,304.825 249.418,304.825 249.596 C 304.825 249.775,304.758 249.950,304.677 249.984 C 304.596 250.019,304.257 250.622,303.924 251.325 C 303.592 252.027,303.232 252.602,303.126 252.602 C 303.020 252.602,302.930 252.793,302.927 253.027 C 302.924 253.262,302.796 253.618,302.643 253.820 C 302.490 254.022,302.365 254.364,302.365 254.579 C 302.365 254.795,302.069 255.311,301.707 255.726 C 301.344 256.141,301.046 256.600,301.044 256.747 C 301.042 256.893,300.828 257.292,300.568 257.633 C 300.307 257.974,300.095 258.386,300.095 258.548 C 300.095 258.710,299.906 259.059,299.676 259.324 C 299.446 259.589,299.169 260.077,299.061 260.409 C 298.953 260.740,298.668 261.110,298.427 261.229 C 298.186 261.349,297.995 261.500,298.001 261.565 C 298.060 262.145,297.957 262.497,297.635 262.819 C 297.427 263.027,297.256 263.277,297.256 263.374 C 297.256 263.471,297.078 263.607,296.861 263.676 C 296.594 263.761,296.495 263.915,296.556 264.148 C 296.612 264.366,296.408 264.755,296.005 265.195 C 295.653 265.579,295.364 266.007,295.364 266.145 C 295.364 266.474,294.426 267.471,294.183 267.400 C 294.079 267.370,294.040 267.466,294.097 267.615 C 294.241 267.992,293.752 268.691,292.337 270.133 C 292.077 270.398,291.862 270.718,291.861 270.843 C 291.859 270.968,291.518 271.416,291.104 271.839 C 290.689 272.261,290.326 272.742,290.297 272.907 C 290.267 273.073,289.926 273.542,289.540 273.950 C 288.536 275.010,287.803 275.939,287.799 276.159 C 287.796 276.263,287.540 276.518,287.228 276.727 C 286.916 276.935,286.661 277.198,286.661 277.312 C 286.661 277.425,286.362 277.679,285.998 277.875 C 285.594 278.093,285.336 278.374,285.336 278.596 C 285.336 278.965,283.437 280.984,283.090 280.984 C 282.987 280.984,282.843 281.167,282.773 281.390 C 282.593 281.958,280.226 284.201,279.808 284.201 C 279.726 284.201,279.659 284.330,279.659 284.489 C 279.659 284.648,279.447 284.859,279.186 284.957 C 278.910 285.062,278.713 285.287,278.713 285.497 C 278.713 285.719,278.495 285.948,278.146 286.093 C 277.833 286.222,277.578 286.446,277.578 286.591 C 277.578 286.736,277.131 287.143,276.585 287.497 C 276.038 287.850,275.367 288.381,275.093 288.677 C 274.558 289.254,274.365 289.412,273.557 289.930 C 272.807 290.412,272.879 290.641,274.487 292.876 C 275.285 293.984,276.285 295.402,276.710 296.026 C 277.135 296.651,277.532 297.204,277.592 297.256 C 277.651 297.308,277.757 297.479,277.825 297.635 C 277.894 297.791,278.418 298.557,278.989 299.338 C 279.561 300.118,280.409 301.310,280.875 301.987 C 281.340 302.663,282.300 304.043,283.008 305.054 C 283.716 306.065,284.551 307.256,284.863 307.702 C 285.175 308.148,286.147 309.535,287.022 310.784 C 288.475 312.858,289.115 313.775,290.954 316.414 C 291.298 316.909,291.895 317.760,292.279 318.307 C 292.664 318.853,294.253 321.131,295.810 323.368 C 297.367 325.605,298.805 327.649,299.004 327.909 C 299.363 328.377,302.341 332.638,303.542 334.403 C 303.883 334.905,304.253 335.415,304.364 335.538 C 304.474 335.661,305.113 336.564,305.783 337.545 C 306.977 339.294,307.255 339.694,309.416 342.763 C 310.003 343.595,310.973 345.000,311.573 345.885 C 312.173 346.769,312.714 347.535,312.775 347.588 C 312.836 347.640,313.265 348.236,313.728 348.912 C 314.191 349.588,314.616 350.184,314.672 350.237 C 314.729 350.289,315.155 350.893,315.618 351.580 C 318.330 355.596,319.517 357.226,319.734 357.232 C 319.869 357.235,320.961 356.535,322.162 355.676 C 323.363 354.818,324.573 353.969,324.850 353.790 C 325.894 353.117,326.206 352.823,326.206 352.517 C 326.206 352.225,327.371 351.257,328.471 350.635 C 329.111 350.273,329.423 349.937,329.423 349.610 C 329.423 349.458,329.820 349.048,330.304 348.698 C 330.789 348.347,331.449 347.799,331.771 347.479 C 332.092 347.159,332.654 346.694,333.018 346.445 C 333.921 345.827,334.153 345.582,334.153 345.249 C 334.153 345.092,334.430 344.773,334.768 344.539 C 335.106 344.306,335.649 343.853,335.973 343.533 C 336.298 343.213,336.809 342.735,337.109 342.470 C 337.408 342.205,337.872 341.737,338.138 341.430 C 338.404 341.122,339.149 340.384,339.793 339.790 C 340.438 339.196,340.965 338.621,340.965 338.513 C 340.965 338.405,341.071 338.313,341.202 338.310 C 341.585 338.300,342.523 337.379,342.421 337.113 C 342.367 336.972,342.600 336.721,342.970 336.522 C 343.324 336.331,343.614 336.062,343.614 335.924 C 343.614 335.785,343.950 335.450,344.360 335.179 C 344.772 334.906,345.132 334.502,345.164 334.277 C 345.196 334.053,345.413 333.786,345.646 333.683 C 345.879 333.581,346.050 333.373,346.025 333.221 C 346.000 333.069,346.173 332.845,346.410 332.725 C 346.647 332.604,347.158 332.085,347.545 331.571 C 348.386 330.457,349.674 329.157,350.232 328.858 C 350.489 328.720,350.614 328.496,350.578 328.236 C 350.539 327.966,350.667 327.757,350.958 327.610 C 351.199 327.489,351.390 327.336,351.384 327.271 C 351.350 326.931,351.406 326.848,351.791 326.677 C 352.022 326.574,352.256 326.300,352.312 326.069 C 352.367 325.837,352.843 325.198,353.370 324.648 C 353.896 324.099,354.449 323.372,354.599 323.034 C 354.749 322.695,355.021 322.370,355.203 322.312 C 355.385 322.255,355.535 322.127,355.535 322.030 C 355.535 321.932,355.747 321.667,356.008 321.441 C 356.268 321.214,356.481 320.872,356.481 320.679 C 356.481 320.486,356.608 320.280,356.764 320.220 C 356.921 320.160,357.048 320.011,357.048 319.888 C 357.048 319.766,357.307 319.512,357.624 319.325 C 358.051 319.073,358.170 318.892,358.084 318.621 C 358.009 318.386,358.073 318.217,358.265 318.143 C 358.428 318.081,358.562 317.917,358.562 317.779 C 358.562 317.641,358.720 317.478,358.914 317.416 C 359.107 317.355,359.423 316.956,359.615 316.529 C 359.807 316.103,360.330 315.378,360.777 314.918 C 361.224 314.458,361.589 313.922,361.589 313.727 C 361.589 313.532,361.845 313.131,362.157 312.836 C 362.469 312.541,362.725 312.190,362.725 312.055 C 362.725 311.813,362.908 311.546,363.503 310.918 C 363.672 310.741,363.959 310.274,364.143 309.880 C 364.326 309.487,364.721 308.903,365.020 308.583 C 365.319 308.263,365.563 307.924,365.563 307.830 C 365.563 307.543,366.016 306.832,366.367 306.567 C 366.549 306.430,366.698 306.159,366.698 305.966 C 366.698 305.772,366.954 305.373,367.266 305.078 C 367.578 304.783,367.833 304.398,367.833 304.222 C 367.833 304.045,367.920 303.848,368.026 303.782 C 368.132 303.717,368.169 303.584,368.108 303.486 C 368.048 303.388,368.132 303.258,368.295 303.195 C 368.457 303.133,368.590 302.972,368.590 302.838 C 368.590 302.704,368.718 302.546,368.874 302.486 C 369.030 302.426,369.158 302.213,369.158 302.013 C 369.158 301.812,369.413 301.375,369.726 301.041 C 370.038 300.706,370.293 300.272,370.293 300.075 C 370.293 299.877,370.442 299.565,370.624 299.379 C 370.807 299.194,371.104 298.747,371.285 298.386 C 371.758 297.447,372.058 296.994,372.319 296.826 C 372.445 296.745,372.498 296.547,372.436 296.386 C 372.374 296.225,372.485 295.866,372.683 295.587 C 372.881 295.308,373.169 294.825,373.323 294.513 C 373.478 294.201,373.710 293.877,373.841 293.794 C 373.971 293.711,374.078 293.537,374.078 293.408 C 374.078 293.138,374.697 291.879,375.024 291.485 C 375.146 291.338,375.191 291.129,375.123 291.021 C 375.056 290.912,375.091 290.823,375.202 290.823 C 375.312 290.823,375.402 290.716,375.402 290.585 C 375.402 290.454,375.577 290.237,375.791 290.104 C 376.054 289.939,376.142 289.744,376.064 289.498 C 375.989 289.261,376.084 289.019,376.338 288.801 C 376.552 288.618,376.727 288.251,376.727 287.985 C 376.727 287.712,376.974 287.231,377.294 286.880 C 377.606 286.538,377.862 286.092,377.862 285.889 C 377.862 285.686,377.943 285.372,378.041 285.191 C 378.477 284.394,379.453 282.202,379.422 282.090 C 379.403 282.022,379.513 281.863,379.665 281.736 C 379.818 281.609,379.943 281.345,379.943 281.149 C 379.943 280.954,380.114 280.476,380.322 280.087 C 380.530 279.699,380.700 279.274,380.700 279.142 C 380.700 279.010,380.785 278.903,380.889 278.903 C 380.993 278.903,381.079 278.724,381.079 278.506 C 381.079 278.047,381.647 277.010,381.898 277.010 C 381.992 277.010,382.028 276.853,381.977 276.660 C 381.927 276.468,382.036 276.111,382.219 275.868 C 382.403 275.624,382.512 275.318,382.462 275.187 C 382.411 275.056,382.499 274.710,382.657 274.419 C 383.245 273.334,383.996 271.427,384.282 270.293 C 384.361 269.981,384.652 269.249,384.928 268.667 C 385.204 268.084,385.430 267.429,385.430 267.211 C 385.430 266.993,385.516 266.763,385.620 266.698 C 385.724 266.634,385.809 266.415,385.809 266.211 C 385.809 266.008,385.886 265.694,385.980 265.513 C 386.074 265.332,386.258 264.823,386.388 264.380 C 386.519 263.938,386.707 263.576,386.805 263.576 C 386.904 263.576,386.940 263.459,386.885 263.316 C 386.830 263.173,386.906 262.822,387.054 262.537 C 387.202 262.252,387.323 261.826,387.323 261.591 C 387.323 261.355,387.454 261.054,387.614 260.920 C 387.801 260.766,387.841 260.613,387.725 260.497 C 387.609 260.381,387.674 260.082,387.906 259.669 C 388.105 259.314,388.269 258.813,388.269 258.556 C 388.269 258.299,388.343 258.089,388.434 258.089 C 388.591 258.089,388.868 256.944,388.922 256.065 C 388.937 255.837,389.103 255.478,389.293 255.269 C 389.530 255.007,389.600 254.737,389.517 254.407 C 389.451 254.143,389.466 253.926,389.550 253.926 C 389.723 253.926,390.211 252.364,390.249 251.690 C 390.262 251.449,390.385 251.183,390.521 251.099 C 390.677 251.003,390.720 250.793,390.638 250.535 C 390.567 250.309,390.592 250.021,390.695 249.896 C 390.798 249.771,390.944 249.243,391.020 248.723 C 391.096 248.202,391.244 247.564,391.349 247.304 C 391.548 246.809,391.566 246.732,391.769 245.506 C 391.838 245.090,391.964 244.579,392.049 244.371 C 392.134 244.163,392.388 243.013,392.613 241.816 C 392.838 240.620,393.106 239.486,393.209 239.298 C 393.311 239.109,393.345 238.797,393.284 238.604 C 393.223 238.411,393.246 238.208,393.336 238.153 C 393.425 238.097,393.513 237.532,393.530 236.896 C 393.551 236.140,393.664 235.638,393.855 235.446 C 394.088 235.213,394.101 235.098,393.917 234.876 C 393.761 234.688,393.750 234.556,393.882 234.470 C 393.990 234.400,394.127 233.798,394.186 233.133 C 394.244 232.468,394.397 231.860,394.524 231.781 C 394.653 231.701,394.709 231.457,394.650 231.232 C 394.592 231.008,394.625 230.553,394.725 230.219 C 394.824 229.885,394.939 229.101,394.979 228.477 C 395.020 227.852,395.111 227.193,395.182 227.010 C 395.252 226.828,395.259 226.545,395.196 226.382 C 395.133 226.218,395.158 225.941,395.252 225.767 C 395.402 225.486,395.487 224.840,395.766 221.854 C 395.805 221.438,395.878 220.501,395.928 219.773 C 395.978 219.044,396.094 217.938,396.186 217.313 C 396.277 216.689,396.334 215.752,396.313 215.232 C 396.291 214.711,396.347 213.859,396.435 213.337 C 396.524 212.815,396.599 211.794,396.602 211.067 C 396.610 208.737,396.636 208.326,396.777 208.325 C 396.871 208.325,396.878 201.377,396.790 196.121 C 396.769 194.872,396.807 193.710,396.875 193.539 C 396.943 193.367,396.907 193.170,396.796 193.101 C 396.674 193.026,396.640 192.687,396.709 192.255 C 396.778 191.822,396.743 191.483,396.622 191.408 C 396.490 191.326,396.479 191.127,396.589 190.836 C 396.683 190.590,396.721 190.350,396.674 190.303 C 396.576 190.205,396.385 187.540,396.367 185.998 C 396.360 185.426,396.305 184.872,396.244 184.768 C 396.184 184.664,396.160 184.342,396.190 184.051 C 396.239 183.590,396.147 182.655,395.738 179.470 C 395.685 179.054,395.606 178.353,395.564 177.914 C 395.521 177.474,395.422 177.009,395.343 176.882 C 395.264 176.754,395.177 176.305,395.149 175.884 C 395.016 173.868,394.930 173.107,394.822 173.000 C 394.758 172.935,394.796 172.774,394.906 172.641 C 395.045 172.474,395.046 172.286,394.912 172.035 C 394.805 171.835,394.674 171.230,394.621 170.691 C 394.569 170.151,394.471 169.622,394.404 169.514 C 394.337 169.406,394.242 168.921,394.191 168.436 C 394.140 167.950,394.023 167.411,393.929 167.236 C 393.836 167.061,393.810 166.666,393.871 166.358 C 393.934 166.044,393.895 165.744,393.783 165.674 C 393.673 165.606,393.628 165.434,393.682 165.292 C 393.737 165.150,393.682 164.972,393.559 164.896 C 393.392 164.793,393.397 164.722,393.579 164.609 C 393.770 164.491,393.756 164.362,393.512 163.989 C 393.342 163.730,393.123 162.868,393.024 162.074 C 392.925 161.279,392.742 160.505,392.616 160.354 C 392.490 160.202,392.434 159.897,392.492 159.676 C 392.549 159.456,392.517 159.115,392.419 158.919 C 392.322 158.722,392.163 158.403,392.067 158.208 C 391.958 157.989,391.959 157.786,392.068 157.677 C 392.178 157.566,392.072 157.073,391.788 156.374 C 391.521 155.716,391.370 155.042,391.426 154.752 C 391.478 154.478,391.428 154.197,391.314 154.126 C 391.200 154.056,391.107 153.791,391.107 153.537 C 391.107 153.283,391.020 153.075,390.914 153.075 C 390.804 153.075,390.771 152.876,390.837 152.612 C 390.901 152.358,390.884 152.039,390.799 151.903 C 390.613 151.605,390.572 151.468,390.416 150.615 C 390.349 150.251,390.179 149.776,390.038 149.559 C 389.897 149.343,389.830 149.117,389.890 149.057 C 389.949 148.997,389.833 148.608,389.632 148.191 C 389.422 147.756,389.330 147.330,389.415 147.191 C 389.500 147.054,389.448 146.782,389.295 146.564 C 389.147 146.352,389.026 146.038,389.026 145.866 C 389.026 145.693,388.902 145.450,388.750 145.324 C 388.528 145.140,388.519 145.021,388.703 144.708 C 388.882 144.404,388.881 144.303,388.694 144.236 C 388.564 144.189,388.458 143.949,388.458 143.704 C 388.458 143.459,388.372 143.205,388.268 143.141 C 388.164 143.076,388.126 142.830,388.186 142.595 C 388.252 142.328,388.181 142.074,387.997 141.921 C 387.834 141.786,387.701 141.547,387.701 141.390 C 387.701 141.233,387.538 140.839,387.338 140.514 C 387.138 140.190,386.919 139.541,386.851 139.073 C 386.784 138.605,386.603 138.027,386.450 137.790 C 386.297 137.553,386.216 137.288,386.270 137.201 C 386.324 137.113,386.201 136.892,385.998 136.708 C 385.744 136.478,385.680 136.282,385.793 136.081 C 385.904 135.881,385.779 135.459,385.399 134.757 C 385.092 134.190,384.879 133.626,384.926 133.504 C 384.973 133.382,384.880 132.988,384.718 132.630 C 384.557 132.271,384.440 131.908,384.459 131.823 C 384.477 131.738,384.320 131.450,384.110 131.183 C 383.900 130.915,383.728 130.577,383.728 130.431 C 383.728 130.286,383.590 129.957,383.423 129.702 C 383.255 129.446,383.170 129.103,383.232 128.939 C 383.296 128.774,383.138 128.335,382.875 127.948 C 382.615 127.566,382.403 127.140,382.403 127.000 C 382.403 126.861,382.270 126.614,382.108 126.452 C 381.946 126.290,381.861 126.033,381.920 125.880 C 381.979 125.728,381.824 125.207,381.577 124.722 C 380.852 123.303,380.533 122.554,380.394 121.949 C 380.322 121.637,380.107 121.178,379.914 120.930 C 379.722 120.682,379.565 120.374,379.565 120.247 C 379.565 120.119,379.352 119.701,379.092 119.318 C 378.832 118.935,378.619 118.538,378.619 118.436 C 378.619 118.335,378.419 117.934,378.175 117.546 C 377.932 117.158,377.770 116.728,377.817 116.590 C 377.864 116.453,377.638 115.915,377.314 115.395 C 376.991 114.875,376.727 114.349,376.727 114.225 C 376.727 114.102,376.429 113.582,376.064 113.069 C 375.678 112.526,375.402 111.912,375.402 111.595 C 375.402 111.297,375.318 110.950,375.216 110.825 C 374.244 109.633,374.008 109.282,373.987 108.999 C 373.974 108.818,373.611 108.155,373.181 107.525 C 372.718 106.846,372.435 106.236,372.486 106.028 C 372.540 105.806,372.151 105.091,371.429 104.088 C 370.665 103.028,370.321 102.386,370.393 102.159 C 370.463 101.939,370.213 101.415,369.688 100.680 C 369.240 100.055,368.491 98.980,368.023 98.292 C 365.775 94.991,365.903 95.072,364.522 96.081 ",stroke:"none",fill:"#d1dc31","fill-rule":"evenodd"}),React.createElement("path",{id:"path10",d:"",stroke:"none",fill:"#99ff33","fill-rule":"evenodd"}),React.createElement("path",{id:"path11",d:"M85.380 215.516 C 85.380 215.880,85.419 216.029,85.466 215.847 C 85.514 215.665,85.514 215.367,85.466 215.184 C 85.419 215.002,85.380 215.151,85.380 215.516 ",stroke:"none",fill:"#ffff00","fill-rule":"evenodd"})));var f=u,d=wp.i18n.__,s=wp.element.RawHTML,p=wp.blocks.registerBlockType,h=wp.data.withSelect,y=lodash.omit,g=React.memo,b=h(function(C,e){return{Freeform:C("core/blocks").getBlockType("core/freeform")}})(g(function(C){C.isSelected=!0;var e=y(C,["Freeform"]),t=c(jQuery,C.Freeform.edit);return React.createElement(t,e)}));p("imagely/nextgen-gallery",{title:d("NextGEN Gallery"),desription:d("A block for adding NextGEN Galleries."),icon:f.nextgen,category:"common",attributes:{content:{type:"string",source:"html"}},supports:{className:!1,customClassName:!1},edit:b,save:function(C){var e=C.attributes.content;return React.createElement(s,null,e)}})}]);
2
  //# sourceMappingURL=block.min.js.map
1
+ !function(C){var e={};function t(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return C[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=C,t.c=e,t.d=function(C,e,n){t.o(C,e)||Object.defineProperty(C,e,{enumerable:!0,get:n})},t.r=function(C){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(C,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(C,"__esModule",{value:!0})},t.t=function(C,e){if(1&e&&(C=t(C)),8&e)return C;if(4&e&&"object"==typeof C&&C&&C.__esModule)return C;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:C}),2&e&&"string"!=typeof C)for(var r in C)t.d(n,r,function(e){return C[e]}.bind(null,r));return n},t.n=function(C){var e=C&&C.__esModule?function(){return C.default}:function(){return C};return t.d(e,"a",e),e},t.o=function(C,e){return Object.prototype.hasOwnProperty.call(C,e)},t.p="",t(t.s=0)}([function(C,e,t){"use strict";function n(C){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(C){return typeof C}:function(C){return C&&"function"==typeof Symbol&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C})(C)}function r(C,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(C,n.key,n)}}function o(C,e,t){return(o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(C,e,t){var n=function(C,e){for(;!Object.prototype.hasOwnProperty.call(C,e)&&null!==(C=l(C)););return C}(C,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(t):r.value}})(C,e,t||C)}function l(C){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)})(C)}function a(C,e){return(a=Object.setPrototypeOf||function(C,e){return C.__proto__=e,C})(C,e)}function i(C){if(void 0===C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}t.r(e);wp.i18n.__;var c=(0,lodash.memoize)(function(C,e){return function(t){function c(C){var e;return function(C,e){if(!(C instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),(e=function(C,e){return!e||"object"!==n(e)&&"function"!=typeof e?i(C):e}(this,l(c).call(this,C))).openIGW=e.openIGW.bind(i(i(e))),e.updateContent=e.updateContent.bind(i(i(e))),e.hasGallery=e.hasGallery.bind(i(i(e))),e.toggleAddGalleryBtn=e.toggleAddGalleryBtn.bind(i(i(e))),e}return function(C,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");C.prototype=Object.create(e&&e.prototype,{constructor:{value:C,writable:!0,configurable:!0}}),e&&a(C,e)}(c,e),function(C,e,t){e&&r(C.prototype,e),t&&r(C,t)}(c,[{key:"hasGallery",value:function(){return this.props.attributes.content&&this.props.attributes.content.length>0}},{key:"componentDidMount",value:function(){o(l(c.prototype),"componentDidMount",this).call(this),C(this.ref).addClass("freeform-toolbar").addClass("ngg-freeform-toolbar"),this.toggleAddGalleryBtn()}},{key:"componentDidUpdate",value:function(){this.toggleAddGalleryBtn()}},{key:"toggleAddGalleryBtn",value:function(){this.props.attributes.content?(C(this.ref).addClass("hidden"),C(this.ref).siblings(".add-ngg-gallery-wrap").hide()):(C(this.ref).removeClass("hidden"),C(this.ref).siblings(".add-ngg-gallery-wrap").show())}},{key:"updateContent",value:function(C){this.props.setAttributes({content:C})}},{key:"onSetup",value:function(C){o(l(c.prototype),"onSetup",this).call(this,C);var e=this.updateContent.bind(this);C.on("ngg-removed",function(){return e("")}),C.on("ngg-inserted",function(C){var t=C.shortcode;return e(t)})}},{key:"openIGW",value:function(){this.editor.execCommand("ngg_attach_to_post")}},{key:"render",value:function(){return[o(l(c.prototype),"render",this).call(this),React.createElement("div",{className:"add-ngg-gallery-wrap"},React.createElement("div",{className:"add-ngg-gallery",onClick:this.openIGW},ngg_tinymce_plugin.i18n.button_label))]}}]),c}()}),u={};u.nextgen=React.createElement("svg",{id:"svg",version:"1.1",width:"400",height:"385.8088930936613",viewBox:"0 0 400 385.8088930936613"},React.createElement("g",{id:"svgg"},React.createElement("path",{id:"path0",d:"",stroke:"none",fill:"#000055","fill-rule":"evenodd"}),React.createElement("path",{id:"path1",d:"",stroke:"none",fill:"#002424","fill-rule":"evenodd"}),React.createElement("path",{id:"path2",d:"M194.418 152.698 C 154.152 157.677,135.139 203.873,160.388 235.383 C 179.730 259.522,217.168 260.458,237.772 237.316 C 261.954 210.156,250.860 167.167,216.592 155.239 C 210.224 153.023,200.657 151.926,194.418 152.698 ",stroke:"none",fill:"#143650","fill-rule":"evenodd"}),React.createElement("path",{id:"path3",d:"",stroke:"none",fill:"#555500","fill-rule":"evenodd"}),React.createElement("path",{id:"path4",d:"M109.430 274.467 C 109.368 274.629,109.202 274.717,109.061 274.663 C 108.920 274.609,108.715 274.732,108.606 274.936 C 108.496 275.140,108.286 275.307,108.139 275.307 C 107.992 275.307,107.796 275.441,107.705 275.605 C 107.536 275.907,106.895 276.338,106.291 276.556 C 106.109 276.622,105.960 276.753,105.960 276.848 C 105.960 276.942,105.747 277.101,105.487 277.200 C 105.227 277.299,105.014 277.467,105.014 277.573 C 105.014 277.680,104.920 277.767,104.805 277.767 C 104.690 277.767,104.285 278.009,103.906 278.303 C 103.527 278.598,103.068 278.894,102.886 278.960 C 102.703 279.026,102.554 279.168,102.554 279.275 C 102.554 279.382,102.427 279.470,102.272 279.470 C 102.117 279.470,101.884 279.640,101.754 279.849 C 101.624 280.057,101.367 280.227,101.184 280.227 C 101.001 280.227,100.851 280.314,100.851 280.421 C 100.851 280.528,100.639 280.696,100.378 280.795 C 100.118 280.894,99.905 281.071,99.905 281.189 C 99.905 281.306,99.793 281.360,99.655 281.307 C 99.518 281.254,99.304 281.373,99.181 281.570 C 99.057 281.768,98.838 281.930,98.694 281.930 C 98.550 281.930,98.383 282.059,98.322 282.217 C 98.262 282.374,97.997 282.585,97.734 282.685 C 97.471 282.785,97.256 282.954,97.256 283.061 C 97.256 283.167,97.095 283.254,96.898 283.254 C 96.701 283.254,96.491 283.382,96.431 283.538 C 96.371 283.694,96.201 283.822,96.053 283.822 C 95.904 283.822,95.731 283.959,95.667 284.126 C 95.603 284.292,95.438 284.386,95.302 284.334 C 95.165 284.281,94.952 284.400,94.829 284.598 C 94.705 284.796,94.529 284.957,94.437 284.957 C 94.344 284.957,93.996 285.213,93.661 285.525 C 93.327 285.837,92.965 286.093,92.857 286.093 C 92.748 286.093,92.296 286.391,91.851 286.755 C 91.407 287.119,90.958 287.417,90.854 287.417 C 90.750 287.417,90.637 287.481,90.602 287.559 C 90.471 287.855,89.293 288.565,89.116 288.455 C 89.014 288.392,88.931 288.476,88.931 288.641 C 88.931 288.805,88.718 289.021,88.458 289.120 C 88.198 289.219,87.985 289.392,87.985 289.505 C 87.985 289.617,87.602 289.879,87.133 290.086 C 86.665 290.293,86.282 290.546,86.282 290.647 C 86.282 290.749,86.090 290.915,85.856 291.017 C 85.220 291.292,84.692 291.646,84.522 291.911 C 84.439 292.041,84.245 292.148,84.091 292.148 C 83.936 292.148,83.761 292.275,83.701 292.431 C 83.641 292.588,83.504 292.715,83.396 292.715 C 83.287 292.715,82.835 293.013,82.391 293.377 C 81.946 293.742,81.493 294.040,81.384 294.040 C 81.276 294.040,81.097 294.207,80.988 294.411 C 80.871 294.629,80.673 294.738,80.508 294.675 C 80.337 294.609,80.227 294.677,80.227 294.850 C 80.227 295.006,80.014 295.187,79.754 295.253 C 79.494 295.318,79.281 295.455,79.281 295.557 C 79.281 295.659,79.162 295.743,79.017 295.743 C 78.872 295.743,78.707 295.864,78.650 296.012 C 78.594 296.160,78.223 296.433,77.826 296.619 C 77.429 296.804,76.994 297.108,76.858 297.295 C 76.722 297.482,76.488 297.635,76.337 297.635 C 76.187 297.635,76.064 297.715,76.064 297.814 C 76.064 297.990,75.336 298.457,74.693 298.693 C 74.510 298.760,74.361 298.892,74.361 298.986 C 74.361 299.081,74.170 299.241,73.936 299.342 C 73.345 299.597,72.922 299.894,72.049 300.662 C 71.636 301.026,71.221 301.325,71.127 301.325 C 71.032 301.325,70.662 301.559,70.303 301.845 C 69.945 302.131,69.562 302.365,69.452 302.365 C 69.342 302.365,69.253 302.449,69.253 302.551 C 69.253 302.653,69.040 302.790,68.780 302.855 C 68.519 302.920,68.307 303.102,68.307 303.259 C 68.307 303.451,68.183 303.512,67.928 303.446 C 67.680 303.381,67.550 303.440,67.550 303.617 C 67.550 303.766,67.337 303.969,67.077 304.068 C 66.816 304.167,66.604 304.337,66.604 304.447 C 66.604 304.556,66.391 304.726,66.131 304.825 C 65.870 304.924,65.658 305.092,65.658 305.199 C 65.658 305.305,65.487 305.393,65.279 305.393 C 65.071 305.393,64.901 305.480,64.901 305.587 C 64.901 305.693,64.688 305.861,64.428 305.960 C 64.167 306.059,63.955 306.227,63.955 306.334 C 63.955 306.441,63.784 306.528,63.576 306.528 C 63.368 306.528,63.198 306.615,63.198 306.722 C 63.198 306.828,62.985 306.997,62.725 307.096 C 62.465 307.194,62.252 307.361,62.252 307.465 C 62.252 307.570,61.907 307.831,61.486 308.046 C 61.064 308.261,60.672 308.561,60.614 308.712 C 60.556 308.864,60.389 308.988,60.243 308.988 C 60.097 308.988,59.835 309.154,59.662 309.356 C 59.488 309.559,59.285 309.687,59.210 309.641 C 59.135 309.595,58.800 309.812,58.467 310.124 C 58.133 310.436,57.748 310.691,57.612 310.691 C 57.475 310.691,57.335 310.754,57.301 310.833 C 57.184 311.095,55.380 312.394,55.132 312.394 C 54.996 312.394,54.803 312.547,54.703 312.735 C 54.602 312.923,54.174 313.242,53.752 313.445 C 53.330 313.647,52.983 313.879,52.982 313.959 C 52.981 314.040,52.789 314.189,52.554 314.290 C 51.958 314.548,51.520 314.853,50.731 315.562 C 50.355 315.900,49.942 316.176,49.812 316.177 C 49.683 316.177,49.476 316.340,49.353 316.537 C 49.229 316.735,49.027 316.858,48.903 316.810 C 48.779 316.763,48.626 316.856,48.564 317.018 C 48.502 317.181,48.339 317.313,48.203 317.313 C 48.067 317.313,47.695 317.547,47.375 317.833 C 46.625 318.507,45.782 319.104,45.364 319.259 C 45.182 319.327,45.033 319.470,45.033 319.578 C 45.033 319.685,44.903 319.773,44.743 319.773 C 44.584 319.773,44.405 319.901,44.345 320.057 C 44.285 320.213,44.075 320.341,43.878 320.341 C 43.622 320.341,43.519 320.476,43.519 320.814 C 43.519 321.074,43.587 321.287,43.670 321.287 C 43.753 321.287,44.147 321.798,44.545 322.422 C 44.942 323.046,45.343 323.557,45.434 323.557 C 45.526 323.557,45.601 323.655,45.601 323.774 C 45.601 323.894,45.899 324.355,46.263 324.799 C 46.627 325.244,46.925 325.700,46.925 325.812 C 46.925 325.925,47.010 326.017,47.114 326.017 C 47.219 326.017,47.304 326.132,47.304 326.272 C 47.304 326.411,47.474 326.680,47.682 326.868 C 47.890 327.057,48.061 327.331,48.061 327.477 C 48.061 327.634,48.209 327.719,48.420 327.685 C 48.728 327.634,49.763 328.480,49.763 328.783 C 49.763 328.837,49.976 329.160,50.237 329.501 C 50.497 329.842,50.710 330.217,50.710 330.335 C 50.710 330.610,51.587 331.190,51.802 331.058 C 51.891 331.002,52.123 331.229,52.316 331.562 C 52.509 331.894,52.780 332.235,52.918 332.318 C 53.056 332.401,53.169 332.587,53.169 332.731 C 53.169 332.875,53.347 333.049,53.565 333.118 C 53.783 333.187,54.082 333.533,54.230 333.888 C 54.378 334.242,54.578 334.532,54.675 334.532 C 54.772 334.532,54.964 334.766,55.102 335.052 C 55.239 335.338,55.492 335.574,55.663 335.575 C 56.001 335.578,56.764 336.191,56.764 336.461 C 56.764 336.713,57.567 337.748,57.763 337.748 C 57.981 337.748,58.642 338.535,58.650 338.804 C 58.654 338.917,58.888 339.130,59.171 339.277 C 59.786 339.598,61.757 341.524,61.929 341.973 C 61.996 342.147,62.168 342.289,62.311 342.289 C 62.454 342.289,62.725 342.577,62.915 342.929 C 63.125 343.319,63.542 343.693,63.985 343.889 C 64.385 344.065,64.711 344.333,64.711 344.485 C 64.711 344.637,64.882 344.825,65.091 344.902 C 65.299 344.979,65.628 345.336,65.821 345.696 C 66.014 346.056,66.335 346.394,66.535 346.449 C 66.972 346.567,68.307 347.617,68.307 347.843 C 68.307 348.075,69.693 349.274,69.850 349.177 C 69.923 349.132,70.037 349.267,70.103 349.477 C 70.170 349.687,70.389 349.858,70.590 349.858 C 70.791 349.858,70.956 349.924,70.956 350.004 C 70.956 350.370,72.658 351.980,72.934 351.874 C 73.117 351.804,73.226 351.868,73.226 352.046 C 73.226 352.202,73.370 352.385,73.545 352.452 C 73.721 352.520,74.109 352.853,74.408 353.193 C 74.727 353.556,75.063 353.768,75.222 353.707 C 75.385 353.645,75.552 353.757,75.637 353.986 C 75.778 354.360,77.338 355.718,77.633 355.722 C 77.925 355.725,78.903 356.556,78.903 356.800 C 78.903 356.937,78.988 357.048,79.093 357.048 C 79.198 357.048,79.469 357.261,79.695 357.521 C 79.921 357.781,80.240 357.997,80.403 357.999 C 80.566 358.002,81.069 358.343,81.520 358.756 C 81.972 359.170,82.451 359.508,82.586 359.508 C 82.721 359.508,82.876 359.678,82.931 359.886 C 82.988 360.104,83.189 360.265,83.404 360.265 C 83.627 360.265,83.821 360.428,83.883 360.668 C 83.961 360.965,84.092 361.045,84.379 360.970 C 84.624 360.906,84.768 360.959,84.768 361.114 C 84.768 361.353,85.288 361.680,85.572 361.619 C 85.650 361.603,85.714 361.717,85.714 361.873 C 85.714 362.029,85.864 362.157,86.048 362.157 C 86.231 362.157,86.466 362.349,86.570 362.583 C 86.674 362.817,86.908 362.997,87.090 362.982 C 87.272 362.967,87.686 363.202,88.008 363.503 C 88.331 363.805,88.863 364.179,89.191 364.334 C 89.518 364.490,89.998 364.809,90.257 365.043 C 90.517 365.277,90.814 365.478,90.918 365.489 C 91.452 365.547,91.958 365.827,91.958 366.064 C 91.958 366.211,92.107 366.386,92.289 366.453 C 92.472 366.520,92.693 366.695,92.781 366.842 C 92.883 367.012,93.105 367.067,93.396 366.994 C 93.646 366.932,93.851 366.963,93.851 367.063 C 93.851 367.400,94.783 368.258,95.042 368.158 C 95.182 368.105,95.398 368.222,95.521 368.420 C 95.645 368.618,95.905 368.780,96.100 368.780 C 96.294 368.780,96.559 368.907,96.689 369.063 C 96.818 369.219,97.049 369.347,97.202 369.347 C 97.355 369.347,97.828 369.645,98.254 370.009 C 98.679 370.374,99.129 370.672,99.254 370.672 C 99.379 370.672,99.586 370.798,99.714 370.953 C 99.843 371.108,100.024 371.189,100.116 371.131 C 100.208 371.074,100.284 371.112,100.284 371.214 C 100.284 371.425,101.342 371.996,101.732 371.996 C 101.872 371.996,101.965 372.103,101.939 372.233 C 101.912 372.372,102.130 372.493,102.470 372.526 C 102.801 372.558,103.360 372.861,103.781 373.235 C 104.185 373.594,104.655 373.888,104.826 373.888 C 104.997 373.888,105.342 374.106,105.592 374.372 C 105.873 374.671,106.180 374.821,106.396 374.765 C 106.594 374.713,106.953 374.853,107.220 375.085 C 107.480 375.311,107.751 375.501,107.820 375.506 C 108.117 375.528,108.913 375.843,109.149 376.032 C 109.289 376.145,109.518 376.254,109.657 376.274 C 109.796 376.294,110.249 376.584,110.664 376.917 C 111.079 377.251,111.501 377.472,111.602 377.410 C 111.704 377.348,111.837 377.429,111.899 377.591 C 111.962 377.753,112.093 377.836,112.191 377.776 C 112.289 377.715,112.694 377.851,113.091 378.077 C 114.435 378.844,114.758 378.995,115.057 378.996 C 115.221 378.997,115.558 379.214,115.807 379.478 C 116.071 379.759,116.425 379.938,116.658 379.907 C 116.877 379.879,117.263 379.987,117.516 380.147 C 117.769 380.308,118.444 380.635,119.016 380.874 C 119.588 381.114,120.203 381.438,120.381 381.595 C 120.559 381.753,120.847 381.827,121.021 381.760 C 121.216 381.685,121.596 381.838,122.021 382.162 C 122.398 382.449,122.810 382.660,122.938 382.631 C 123.065 382.602,123.363 382.702,123.600 382.854 C 123.837 383.006,124.201 383.158,124.409 383.192 C 124.617 383.226,124.903 383.410,125.045 383.601 C 125.219 383.834,125.444 383.912,125.735 383.839 C 125.999 383.772,126.203 383.825,126.261 383.974 C 126.364 384.244,127.909 384.408,127.909 384.150 C 127.909 384.061,128.172 383.720,128.493 383.391 C 128.979 382.894,129.056 382.698,128.951 382.220 C 128.843 381.728,128.872 381.664,129.154 381.773 C 129.421 381.875,129.463 381.821,129.376 381.489 C 129.294 381.175,129.353 381.079,129.625 381.079 C 129.919 381.079,129.961 380.981,129.868 380.513 C 129.795 380.146,129.862 379.784,130.062 379.479 C 130.231 379.221,130.369 378.916,130.369 378.801 C 130.369 378.686,130.500 378.461,130.659 378.301 C 130.886 378.075,130.901 377.952,130.726 377.742 C 130.546 377.525,130.624 377.364,131.121 376.920 C 131.619 376.476,131.716 376.274,131.618 375.885 C 131.552 375.619,131.565 375.402,131.649 375.402 C 131.907 375.402,132.450 374.330,132.450 373.821 C 132.450 373.241,132.798 372.415,133.253 371.913 C 133.436 371.711,133.568 371.456,133.546 371.346 C 133.477 370.988,133.777 370.104,133.968 370.104 C 134.070 370.104,134.153 369.891,134.153 369.631 C 134.153 369.354,134.251 369.178,134.390 369.205 C 134.539 369.235,134.621 369.043,134.613 368.685 C 134.606 368.373,134.720 368.028,134.867 367.918 C 135.013 367.809,135.108 367.596,135.077 367.445 C 135.005 367.096,135.651 365.752,135.891 365.752 C 135.991 365.752,136.055 365.561,136.034 365.326 C 135.986 364.807,136.396 363.671,136.632 363.671 C 136.725 363.671,136.802 363.467,136.802 363.218 C 136.802 362.969,136.939 362.713,137.106 362.649 C 137.318 362.567,137.376 362.395,137.297 362.082 C 137.226 361.799,137.288 361.546,137.466 361.399 C 137.621 361.270,137.748 361.086,137.748 360.989 C 137.748 360.893,137.919 360.462,138.127 360.031 C 138.335 359.600,138.505 359.088,138.505 358.894 C 138.505 358.699,138.590 358.592,138.694 358.657 C 138.804 358.724,138.884 358.547,138.884 358.239 C 138.884 357.944,139.096 357.390,139.357 357.008 C 139.617 356.625,139.830 356.124,139.830 355.895 C 139.830 355.368,140.756 353.453,141.011 353.453 C 141.121 353.453,141.154 353.217,141.089 352.892 C 141.008 352.486,141.062 352.282,141.283 352.159 C 141.484 352.046,141.552 351.844,141.480 351.570 C 141.399 351.260,141.440 351.179,141.641 351.256 C 141.842 351.334,141.911 351.196,141.911 350.715 C 141.911 350.360,141.990 350.021,142.086 349.962 C 142.182 349.902,142.316 349.599,142.385 349.288 C 142.453 348.977,142.613 348.723,142.741 348.723 C 142.871 348.723,143.126 348.120,143.321 347.351 C 143.512 346.596,143.784 345.845,143.925 345.680 C 144.066 345.516,144.182 345.249,144.182 345.086 C 144.182 344.923,144.315 344.739,144.479 344.676 C 144.671 344.602,144.735 344.434,144.660 344.198 C 144.596 343.997,144.713 343.465,144.918 343.014 C 145.572 341.583,145.955 340.687,145.995 340.492 C 146.130 339.835,146.342 339.451,146.569 339.451 C 146.727 339.451,146.833 339.245,146.837 338.931 C 146.840 338.645,146.966 338.247,147.117 338.048 C 147.304 337.801,147.332 337.612,147.204 337.458 C 147.074 337.302,147.105 337.156,147.301 336.993 C 147.459 336.863,147.588 336.596,147.588 336.401 C 147.588 336.205,147.673 336.045,147.777 336.045 C 147.881 336.045,147.966 335.837,147.966 335.583 C 147.966 335.329,148.129 335.006,148.329 334.866 C 148.539 334.719,148.741 334.286,148.808 333.839 C 148.871 333.414,149.091 332.719,149.296 332.294 C 149.792 331.268,149.789 330.258,149.290 329.991 C 149.082 329.879,148.912 329.700,148.912 329.593 C 148.912 329.485,148.699 329.119,148.439 328.777 C 148.179 328.436,147.966 328.086,147.966 327.998 C 147.966 327.911,147.625 327.435,147.209 326.941 C 146.793 326.448,146.452 325.953,146.452 325.841 C 146.452 325.730,146.386 325.639,146.306 325.639 C 146.226 325.639,145.991 325.321,145.786 324.934 C 145.580 324.546,145.284 324.090,145.128 323.921 C 144.619 323.370,144.182 322.798,144.182 322.684 C 144.182 322.622,143.926 322.248,143.614 321.854 C 143.302 321.460,143.046 321.041,143.046 320.922 C 143.046 320.804,142.919 320.658,142.763 320.598 C 142.606 320.538,142.479 320.406,142.479 320.305 C 142.479 320.203,142.181 319.757,141.816 319.312 C 141.452 318.868,141.154 318.404,141.154 318.281 C 141.154 318.158,141.026 318.009,140.870 317.949 C 140.714 317.889,140.587 317.719,140.587 317.571 C 140.587 317.423,140.459 317.252,140.303 317.192 C 140.147 317.132,140.019 317.004,140.019 316.907 C 140.019 316.698,139.230 315.544,139.026 315.453 C 138.947 315.418,138.884 315.282,138.884 315.151 C 138.884 315.019,138.713 314.758,138.505 314.570 C 138.297 314.381,138.127 314.113,138.127 313.973 C 138.127 313.833,138.040 313.718,137.933 313.718 C 137.826 313.718,137.658 313.505,137.559 313.245 C 137.460 312.985,137.306 312.772,137.216 312.772 C 137.067 312.772,136.696 312.128,136.642 311.775 C 136.630 311.695,136.443 311.440,136.228 311.208 C 135.601 310.532,134.359 308.771,134.237 308.384 C 134.175 308.189,133.939 307.836,133.713 307.599 C 133.487 307.362,133.174 306.971,133.018 306.730 C 132.862 306.489,132.644 306.196,132.534 306.079 C 132.424 305.962,132.169 305.573,131.967 305.216 C 131.764 304.858,131.450 304.390,131.268 304.175 C 130.563 303.344,130.452 303.186,130.089 302.503 C 129.884 302.115,129.647 301.798,129.564 301.798 C 129.481 301.798,129.333 301.585,129.234 301.325 C 129.135 301.064,128.967 300.851,128.860 300.851 C 128.753 300.851,128.666 300.737,128.666 300.597 C 128.666 300.457,128.496 300.188,128.288 300.000 C 128.079 299.812,127.909 299.579,127.909 299.484 C 127.909 299.389,127.803 299.200,127.673 299.064 C 127.543 298.928,127.308 298.626,127.152 298.393 C 126.996 298.160,126.734 297.788,126.570 297.566 C 126.405 297.344,126.216 297.013,126.150 296.831 C 126.083 296.649,125.950 296.500,125.853 296.500 C 125.756 296.500,125.489 296.138,125.260 295.695 C 125.030 295.253,124.723 294.823,124.578 294.740 C 124.433 294.657,124.314 294.465,124.314 294.314 C 124.314 294.163,124.226 294.040,124.119 294.040 C 124.012 294.040,123.869 293.891,123.802 293.709 C 123.735 293.526,123.503 293.122,123.287 292.810 C 123.071 292.498,122.809 292.106,122.705 291.939 C 122.487 291.589,121.384 290.080,121.101 289.743 C 120.995 289.617,120.908 289.459,120.908 289.392 C 120.908 289.289,119.878 287.898,119.207 287.094 C 119.102 286.968,119.016 286.810,119.016 286.743 C 119.016 286.675,118.761 286.298,118.448 285.904 C 118.136 285.509,117.881 285.097,117.881 284.987 C 117.881 284.877,117.774 284.719,117.644 284.636 C 117.344 284.444,116.556 283.327,116.556 283.093 C 116.556 282.996,116.429 282.868,116.272 282.808 C 116.116 282.748,115.989 282.577,115.989 282.429 C 115.989 282.281,115.861 282.111,115.705 282.051 C 115.549 281.991,115.421 281.851,115.421 281.739 C 115.421 281.511,114.646 280.356,114.428 280.259 C 114.350 280.224,114.286 280.079,114.286 279.937 C 114.286 279.795,114.179 279.610,114.049 279.527 C 113.749 279.335,112.961 278.218,112.961 277.984 C 112.961 277.887,112.833 277.759,112.677 277.699 C 112.521 277.639,112.394 277.503,112.394 277.396 C 112.394 276.953,110.065 274.176,109.691 274.173 C 109.610 274.173,109.493 274.305,109.430 274.467 ",stroke:"none",fill:"#8ca516","fill-rule":"evenodd"}),React.createElement("path",{id:"path5",d:"",stroke:"none",fill:"#6db600","fill-rule":"evenodd"}),React.createElement("path",{id:"path6",d:"M79.186 45.256 C 78.978 45.372,78.369 45.838,77.832 46.291 C 77.295 46.744,76.809 47.114,76.752 47.114 C 76.696 47.114,76.441 47.306,76.186 47.540 C 75.500 48.170,75.046 48.533,74.934 48.540 C 74.693 48.557,73.983 49.116,73.983 49.289 C 73.982 49.611,72.116 51.366,71.950 51.200 C 71.890 51.140,71.722 51.260,71.577 51.468 C 71.431 51.675,71.190 51.845,71.039 51.845 C 70.889 51.845,70.766 52.019,70.766 52.232 C 70.766 52.464,70.539 52.748,70.200 52.942 C 69.888 53.119,69.633 53.328,69.632 53.406 C 69.632 53.484,69.461 53.548,69.253 53.548 C 69.044 53.548,68.874 53.634,68.874 53.739 C 68.874 53.992,67.915 55.061,67.688 55.061 C 67.590 55.061,67.342 55.274,67.137 55.535 C 66.933 55.795,66.647 56.008,66.502 56.008 C 66.357 56.008,66.137 56.197,66.013 56.429 C 65.743 56.933,65.537 57.138,64.871 57.564 C 64.594 57.741,64.126 58.227,63.830 58.644 C 63.452 59.177,63.194 59.371,62.961 59.300 C 62.776 59.244,62.630 59.297,62.630 59.421 C 62.630 59.747,61.733 60.786,61.150 61.136 C 60.865 61.307,60.668 61.576,60.699 61.751 C 60.730 61.922,60.634 62.062,60.487 62.062 C 60.249 62.062,59.039 63.359,58.877 63.788 C 58.843 63.879,58.688 63.955,58.533 63.955 C 58.258 63.955,57.711 64.387,57.711 64.603 C 57.711 64.663,57.561 64.867,57.379 65.056 C 57.197 65.246,56.793 65.714,56.482 66.097 C 56.170 66.480,55.804 66.793,55.668 66.793 C 55.532 66.793,55.296 67.091,55.144 67.455 C 54.992 67.819,54.762 68.121,54.633 68.125 C 54.505 68.130,53.463 69.275,52.318 70.671 C 51.173 72.067,50.086 73.262,49.903 73.326 C 49.719 73.390,49.605 73.501,49.649 73.573 C 49.805 73.824,49.216 74.409,48.921 74.296 C 48.711 74.216,48.627 74.303,48.625 74.604 C 48.622 75.122,48.429 75.402,48.074 75.402 C 47.926 75.402,47.741 75.638,47.663 75.927 C 47.586 76.216,47.349 76.642,47.137 76.874 C 46.126 77.977,44.276 80.266,44.276 80.414 C 44.276 80.505,44.106 80.634,43.898 80.700 C 43.690 80.766,43.519 80.985,43.519 81.186 C 43.519 81.387,43.390 81.701,43.233 81.883 C 41.478 83.908,40.527 85.119,40.618 85.210 C 40.679 85.271,40.378 85.740,39.948 86.253 C 39.519 86.766,39.167 87.281,39.167 87.396 C 39.167 87.512,39.040 87.606,38.884 87.606 C 38.728 87.606,38.600 87.763,38.600 87.954 C 38.600 88.146,38.324 88.625,37.988 89.019 C 37.651 89.413,37.374 89.838,37.373 89.964 C 37.371 90.090,36.944 90.679,36.424 91.275 C 35.904 91.870,35.500 92.441,35.527 92.542 C 35.554 92.644,35.398 92.916,35.181 93.147 C 34.964 93.378,34.676 93.822,34.542 94.134 C 34.408 94.447,34.074 94.941,33.800 95.232 C 33.526 95.524,33.302 95.856,33.302 95.971 C 33.302 96.086,33.089 96.459,32.829 96.800 C 32.569 97.141,32.356 97.527,32.356 97.657 C 32.356 97.788,32.194 98.070,31.996 98.285 C 31.656 98.654,31.110 99.547,30.515 100.706 C 30.370 100.990,30.171 101.272,30.073 101.332 C 29.976 101.392,29.896 101.592,29.896 101.776 C 29.896 101.960,29.683 102.310,29.423 102.554 C 29.163 102.799,28.950 103.139,28.950 103.311 C 28.950 103.483,28.745 103.816,28.495 104.051 C 28.245 104.286,27.983 104.780,27.914 105.149 C 27.845 105.518,27.539 106.085,27.233 106.410 C 26.928 106.735,26.716 107.099,26.761 107.220 C 26.806 107.340,26.678 107.587,26.477 107.769 C 26.276 107.951,26.112 108.252,26.112 108.438 C 26.112 108.624,26.032 108.825,25.934 108.886 C 25.725 109.015,25.166 110.097,25.166 110.374 C 25.166 110.480,25.049 110.701,24.908 110.865 C 24.766 111.029,24.497 111.573,24.310 112.072 C 24.124 112.572,23.805 113.098,23.602 113.240 C 23.388 113.390,23.291 113.594,23.372 113.724 C 23.448 113.848,23.409 114.012,23.285 114.089 C 23.161 114.166,23.040 114.357,23.017 114.513 C 22.994 114.669,22.842 115.001,22.679 115.251 C 22.516 115.500,22.320 115.918,22.245 116.178 C 22.005 117.008,21.524 117.971,21.276 118.117 C 21.144 118.196,20.979 118.600,20.908 119.016 C 20.838 119.432,20.703 119.773,20.608 119.773 C 20.513 119.773,20.435 119.909,20.435 120.075 C 20.435 120.390,19.954 121.350,19.531 121.878 C 19.395 122.047,19.304 122.260,19.328 122.351 C 19.423 122.710,19.048 123.830,18.710 124.192 C 18.514 124.402,18.354 124.722,18.354 124.902 C 18.354 125.081,18.265 125.258,18.156 125.294 C 18.048 125.331,17.934 125.593,17.904 125.878 C 17.874 126.163,17.792 126.453,17.723 126.522 C 17.654 126.591,17.597 126.800,17.597 126.985 C 17.597 127.171,17.456 127.402,17.284 127.498 C 17.104 127.598,17.019 127.797,17.083 127.965 C 17.148 128.134,17.072 128.303,16.903 128.368 C 16.743 128.430,16.659 128.604,16.718 128.756 C 16.776 128.908,16.742 129.083,16.643 129.144 C 16.543 129.206,16.462 129.496,16.462 129.789 C 16.462 130.083,16.337 130.426,16.184 130.553 C 16.031 130.680,15.913 130.839,15.922 130.907 C 15.975 131.306,15.854 131.666,15.559 131.989 C 15.375 132.191,15.231 132.483,15.240 132.640 C 15.254 132.898,14.806 134.251,14.394 135.194 C 14.034 136.017,13.441 137.881,13.325 138.555 C 13.257 138.946,13.127 139.313,13.034 139.370 C 12.942 139.427,12.867 139.724,12.867 140.030 C 12.867 140.336,12.781 140.587,12.677 140.587 C 12.573 140.587,12.488 140.752,12.488 140.954 C 12.488 141.156,12.403 141.374,12.299 141.438 C 12.195 141.502,12.108 141.784,12.106 142.064 C 12.103 142.344,11.940 142.928,11.743 143.362 C 11.546 143.796,11.432 144.198,11.489 144.255 C 11.547 144.312,11.412 144.782,11.189 145.299 C 10.967 145.816,10.785 146.405,10.785 146.608 C 10.785 146.811,10.658 147.220,10.503 147.519 C 10.347 147.817,10.219 148.290,10.219 148.570 C 10.218 148.850,10.144 149.124,10.054 149.180 C 9.964 149.236,9.832 149.645,9.760 150.090 C 9.514 151.625,8.933 154.114,8.690 154.683 C 8.531 155.055,8.445 155.436,7.841 158.467 C 7.675 159.300,7.457 160.135,7.357 160.323 C 7.256 160.510,7.122 161.216,7.060 161.890 C 6.997 162.564,6.873 163.160,6.784 163.215 C 6.695 163.270,6.621 163.586,6.620 163.918 C 6.618 164.251,6.490 165.061,6.335 165.719 C 6.180 166.377,6.010 167.271,5.957 167.706 C 5.904 168.140,5.815 168.794,5.757 169.158 C 5.700 169.522,5.628 170.076,5.597 170.388 C 5.566 170.700,5.489 171.083,5.425 171.239 C 5.361 171.395,5.221 172.247,5.113 173.132 C 5.006 174.016,4.874 174.995,4.821 175.307 C 4.767 175.620,4.675 176.471,4.616 177.200 C 4.557 177.928,4.436 178.612,4.347 178.719 C 4.258 178.827,4.184 179.337,4.182 179.854 C 4.180 180.372,4.133 181.306,4.077 181.930 C 4.021 182.554,3.937 183.576,3.890 184.201 C 3.843 184.825,3.790 185.336,3.772 185.336 C 3.711 185.336,3.445 190.033,3.343 192.917 C 3.310 193.860,3.223 194.729,3.149 194.847 C 3.017 195.060,3.058 195.456,3.313 196.452 C 3.388 196.743,3.369 196.973,3.271 196.973 C 2.976 196.973,3.139 207.939,3.515 213.434 C 3.575 214.319,3.650 215.511,3.680 216.083 C 3.711 216.656,3.841 218.188,3.969 219.489 C 4.098 220.790,4.193 222.138,4.181 222.485 C 4.170 222.833,4.219 223.211,4.291 223.327 C 4.449 223.584,4.491 223.880,4.653 225.875 C 4.722 226.734,4.832 227.436,4.897 227.436 C 4.961 227.436,5.029 227.670,5.047 227.956 C 5.081 228.509,5.332 230.268,5.686 232.450 C 5.804 233.179,5.892 234.009,5.880 234.295 C 5.869 234.581,5.927 234.816,6.010 234.816 C 6.092 234.816,6.155 235.163,6.149 235.587 C 6.144 236.012,6.205 236.400,6.286 236.450 C 6.367 236.500,6.433 236.797,6.433 237.110 C 6.433 237.423,6.516 237.833,6.617 238.023 C 6.719 238.212,6.898 238.994,7.016 239.760 C 7.134 240.527,7.282 241.239,7.344 241.342 C 7.407 241.445,7.471 241.785,7.488 242.099 C 7.504 242.412,7.616 243.024,7.736 243.460 C 7.857 243.896,7.937 244.321,7.916 244.406 C 7.894 244.491,8.052 245.128,8.267 245.821 C 8.482 246.515,8.615 247.303,8.564 247.572 C 8.511 247.851,8.557 248.061,8.673 248.061 C 8.785 248.061,8.929 248.380,8.994 248.770 C 9.059 249.160,9.162 249.607,9.224 249.763 C 9.286 249.920,9.352 250.218,9.370 250.426 C 9.389 250.634,9.502 251.044,9.622 251.337 C 9.741 251.630,9.839 252.027,9.839 252.220 C 9.839 252.413,9.929 252.600,10.040 252.637 C 10.150 252.674,10.245 253.071,10.251 253.519 C 10.258 254.029,10.360 254.371,10.524 254.434 C 10.668 254.489,10.785 254.736,10.785 254.982 C 10.785 255.505,11.579 258.598,11.996 259.697 C 12.153 260.114,12.286 260.593,12.291 260.764 C 12.295 260.934,12.426 261.317,12.582 261.615 C 12.737 261.913,12.865 262.292,12.865 262.457 C 12.866 262.621,12.926 262.815,12.998 262.888 C 13.071 262.960,13.152 263.123,13.179 263.251 C 13.404 264.299,13.720 265.234,13.934 265.483 C 14.076 265.648,14.191 265.999,14.191 266.264 C 14.191 266.529,14.319 266.852,14.475 266.982 C 14.631 267.112,14.759 267.458,14.759 267.751 C 14.759 268.044,14.838 268.333,14.936 268.393 C 15.033 268.454,15.252 268.991,15.423 269.587 C 15.594 270.184,15.898 270.953,16.098 271.297 C 16.298 271.642,16.462 272.082,16.462 272.275 C 16.462 272.469,16.558 272.659,16.675 272.698 C 16.792 272.737,16.907 272.936,16.929 273.139 C 17.027 274.010,17.279 274.723,17.524 274.816 C 17.668 274.872,17.786 275.128,17.786 275.385 C 17.786 275.642,17.871 275.905,17.975 275.970 C 18.079 276.034,18.165 276.232,18.165 276.409 C 18.165 276.587,18.335 277.050,18.543 277.438 C 18.751 277.827,18.925 278.294,18.928 278.476 C 18.932 278.659,19.137 279.055,19.384 279.357 C 19.631 279.659,19.788 280.024,19.733 280.169 C 19.678 280.313,19.771 280.583,19.940 280.770 C 20.109 280.957,20.375 281.538,20.530 282.062 C 20.686 282.585,20.983 283.230,21.192 283.495 C 21.400 283.760,21.570 284.084,21.570 284.216 C 21.570 284.347,21.687 284.589,21.830 284.753 C 21.973 284.918,22.233 285.494,22.409 286.035 C 22.585 286.575,22.882 287.214,23.070 287.454 C 23.257 287.694,23.476 288.103,23.555 288.363 C 23.635 288.623,23.944 289.172,24.243 289.583 C 24.542 289.994,24.787 290.569,24.787 290.860 C 24.787 291.152,24.852 291.391,24.931 291.391 C 25.093 291.391,25.194 291.562,26.053 293.295 C 26.385 293.965,26.875 294.806,27.141 295.164 C 27.407 295.523,27.625 295.999,27.625 296.223 C 27.625 296.447,27.796 296.784,28.004 296.973 C 28.212 297.161,28.382 297.402,28.382 297.507 C 28.382 297.613,28.501 297.834,28.647 297.998 C 29.249 298.678,29.679 299.668,29.465 299.882 C 29.311 300.036,29.391 300.234,29.765 300.624 C 30.045 300.917,30.274 301.258,30.274 301.382 C 30.274 301.507,30.346 301.608,30.433 301.608 C 30.521 301.608,30.692 301.800,30.815 302.034 C 30.937 302.268,31.289 302.800,31.596 303.217 C 31.903 303.633,32.157 304.086,32.160 304.224 C 32.164 304.361,32.273 304.592,32.403 304.737 C 32.948 305.345,33.113 305.575,33.113 305.728 C 33.113 305.817,33.367 306.133,33.678 306.431 C 34.339 307.065,34.665 306.968,36.013 305.736 C 36.434 305.351,36.848 305.079,36.934 305.132 C 37.019 305.184,37.140 305.094,37.202 304.932 C 37.265 304.769,37.430 304.636,37.569 304.636 C 37.708 304.636,37.940 304.466,38.086 304.259 C 38.231 304.051,38.408 303.939,38.479 304.011 C 38.550 304.082,38.739 303.953,38.899 303.726 C 39.058 303.498,39.308 303.311,39.453 303.311 C 39.598 303.311,39.784 303.205,39.868 303.075 C 39.951 302.945,40.307 302.677,40.660 302.481 C 41.013 302.284,41.460 301.986,41.653 301.819 C 41.847 301.651,42.169 301.372,42.368 301.198 C 42.568 301.025,42.783 300.935,42.846 300.998 C 42.909 301.061,43.091 300.926,43.251 300.698 C 43.410 300.470,43.655 300.284,43.794 300.284 C 43.933 300.284,44.098 300.151,44.160 299.988 C 44.222 299.825,44.350 299.739,44.443 299.797 C 44.536 299.854,44.941 299.597,45.343 299.225 C 45.745 298.853,46.383 298.390,46.760 298.195 C 47.137 298.000,47.497 297.709,47.558 297.548 C 47.620 297.388,47.790 297.256,47.937 297.256 C 48.083 297.256,48.309 297.130,48.437 296.975 C 48.566 296.820,48.747 296.740,48.840 296.797 C 48.933 296.855,49.061 296.768,49.123 296.605 C 49.186 296.442,49.544 296.163,49.920 295.985 C 50.295 295.806,50.746 295.530,50.921 295.371 C 51.096 295.211,51.463 294.877,51.737 294.629 C 52.011 294.381,52.289 294.231,52.354 294.297 C 52.420 294.362,52.593 294.245,52.740 294.035 C 52.886 293.826,53.080 293.701,53.171 293.757 C 53.261 293.813,53.404 293.750,53.489 293.618 C 53.635 293.389,54.125 293.034,54.633 292.790 C 54.761 292.728,55.229 292.345,55.673 291.939 C 56.117 291.534,56.558 291.202,56.652 291.202 C 56.746 291.202,57.129 290.968,57.503 290.682 C 57.877 290.396,58.245 290.182,58.320 290.207 C 58.395 290.232,58.547 290.082,58.658 289.875 C 58.768 289.668,58.987 289.499,59.142 289.499 C 59.298 289.499,59.476 289.366,59.538 289.204 C 59.601 289.042,59.753 288.948,59.877 288.996 C 60.001 289.043,60.204 288.921,60.327 288.723 C 60.451 288.525,60.636 288.363,60.740 288.363 C 60.843 288.363,61.097 288.214,61.306 288.032 C 61.514 287.850,61.861 287.545,62.078 287.354 C 62.295 287.163,62.515 287.050,62.567 287.102 C 62.619 287.154,62.825 287.055,63.024 286.881 C 63.224 286.708,63.550 286.424,63.750 286.250 C 63.949 286.077,64.164 285.987,64.227 286.050 C 64.290 286.113,64.472 285.978,64.632 285.750 C 64.792 285.522,65.025 285.336,65.150 285.336 C 65.275 285.336,65.484 285.166,65.614 284.957 C 65.744 284.749,65.950 284.579,66.073 284.579 C 66.196 284.579,66.784 284.196,67.380 283.728 C 67.976 283.259,68.556 282.876,68.669 282.876 C 68.782 282.876,68.874 282.801,68.874 282.709 C 68.874 282.617,69.023 282.488,69.205 282.422 C 69.809 282.204,70.450 281.773,70.619 281.471 C 70.710 281.307,70.904 281.173,71.050 281.173 C 71.196 281.173,71.383 281.056,71.466 280.912 C 71.550 280.769,71.919 280.491,72.286 280.296 C 72.944 279.946,73.261 279.714,74.012 279.029 C 74.222 278.838,74.434 278.722,74.483 278.772 C 74.533 278.822,74.773 278.680,75.017 278.457 C 75.752 277.784,76.020 277.596,76.111 277.688 C 76.159 277.735,76.572 277.432,77.030 277.014 C 77.487 276.596,77.959 276.254,78.078 276.254 C 78.197 276.254,78.347 276.117,78.411 275.950 C 78.475 275.783,78.639 275.690,78.776 275.742 C 78.912 275.794,79.127 275.672,79.253 275.470 C 79.379 275.269,79.561 275.152,79.656 275.211 C 79.752 275.270,79.922 275.145,80.035 274.934 C 80.148 274.723,80.356 274.551,80.497 274.551 C 80.639 274.551,80.803 274.423,80.863 274.267 C 80.923 274.111,81.092 273.983,81.239 273.983 C 81.385 273.983,81.609 273.858,81.736 273.705 C 81.863 273.552,82.022 273.446,82.090 273.469 C 82.158 273.491,82.405 273.340,82.640 273.132 C 82.874 272.923,83.243 272.597,83.459 272.406 C 83.676 272.215,83.903 272.108,83.963 272.168 C 84.023 272.229,84.191 272.108,84.336 271.900 C 84.482 271.693,84.723 271.523,84.874 271.523 C 85.024 271.523,85.147 271.438,85.147 271.334 C 85.147 271.230,85.296 271.145,85.480 271.145 C 85.663 271.145,85.921 270.971,86.053 270.759 C 86.186 270.547,86.367 270.418,86.457 270.474 C 86.546 270.529,86.758 270.362,86.928 270.102 C 87.098 269.843,87.362 269.631,87.516 269.631 C 87.670 269.631,87.796 269.554,87.796 269.461 C 87.796 269.367,88.158 269.103,88.600 268.874 C 89.042 268.644,89.472 268.337,89.555 268.192 C 89.639 268.047,89.830 267.928,89.981 267.928 C 90.132 267.928,90.255 267.841,90.255 267.734 C 90.255 267.628,90.468 267.459,90.728 267.360 C 90.989 267.262,91.202 267.113,91.202 267.030 C 91.202 266.947,91.521 266.713,91.911 266.511 C 92.632 266.138,92.857 265.977,93.614 265.288 C 93.848 265.075,94.105 264.922,94.185 264.948 C 94.328 264.994,94.626 264.780,95.394 264.081 C 95.603 263.890,95.823 263.783,95.883 263.843 C 95.943 263.903,96.111 263.782,96.257 263.575 C 96.402 263.367,96.641 263.198,96.787 263.198 C 96.934 263.198,97.145 263.027,97.256 262.819 C 97.368 262.611,97.566 262.441,97.696 262.441 C 97.826 262.441,98.228 262.189,98.588 261.881 C 98.948 261.573,99.345 261.318,99.470 261.313 C 99.595 261.309,99.765 261.199,99.849 261.069 C 99.932 260.939,100.170 260.738,100.378 260.623 C 100.865 260.354,100.977 259.783,100.587 259.564 C 100.420 259.471,100.284 259.324,100.284 259.238 C 100.284 259.151,99.986 258.586,99.622 257.981 C 99.257 257.376,98.959 256.766,98.959 256.626 C 98.959 256.485,98.803 256.202,98.612 255.997 C 98.421 255.792,97.979 255.051,97.629 254.350 C 97.279 253.648,96.927 253.047,96.847 253.014 C 96.766 252.980,96.644 252.639,96.575 252.257 C 96.507 251.874,96.369 251.458,96.270 251.333 C 95.977 250.964,95.364 249.702,95.364 249.469 C 95.364 249.350,95.194 249.057,94.986 248.817 C 94.778 248.577,94.607 248.192,94.607 247.960 C 94.607 247.729,94.480 247.433,94.324 247.304 C 94.167 247.174,94.039 246.972,94.039 246.855 C 94.038 246.737,93.928 246.429,93.794 246.168 C 93.659 245.908,93.364 245.142,93.137 244.465 C 92.909 243.789,92.551 242.898,92.341 242.486 C 92.131 242.074,91.958 241.551,91.958 241.324 C 91.958 241.097,91.831 240.862,91.675 240.802 C 91.518 240.742,91.391 240.480,91.391 240.219 C 91.391 239.959,91.175 239.258,90.912 238.663 C 90.648 238.067,90.474 237.471,90.525 237.339 C 90.576 237.207,90.536 237.048,90.436 236.986 C 90.337 236.925,90.255 236.743,90.255 236.583 C 90.255 236.423,90.138 236.024,89.994 235.696 C 89.633 234.873,89.405 234.170,89.035 232.734 C 88.860 232.058,88.638 231.243,88.540 230.923 C 88.443 230.604,88.363 230.199,88.363 230.024 C 88.363 229.850,88.269 229.707,88.154 229.707 C 88.038 229.707,87.997 229.569,88.062 229.399 C 88.127 229.230,88.106 228.995,88.014 228.879 C 87.923 228.762,87.793 228.249,87.727 227.739 C 87.660 227.229,87.529 226.718,87.435 226.604 C 87.341 226.489,87.205 225.885,87.133 225.260 C 87.061 224.636,86.875 223.674,86.720 223.122 C 86.565 222.570,86.365 221.506,86.276 220.757 C 86.039 218.777,85.722 216.991,85.531 216.556 C 85.440 216.348,85.312 215.241,85.247 214.096 C 85.073 211.034,84.952 209.437,84.844 208.798 C 84.589 207.284,84.477 198.358,84.678 195.553 C 84.730 194.825,84.809 193.718,84.853 193.094 C 84.897 192.469,85.030 190.851,85.149 189.499 C 85.269 188.146,85.391 186.729,85.421 186.350 C 85.452 185.972,85.521 185.588,85.574 185.499 C 85.628 185.409,85.733 184.697,85.808 183.917 C 85.884 183.136,86.031 182.392,86.135 182.264 C 86.239 182.135,86.272 181.893,86.208 181.726 C 86.144 181.559,86.155 181.324,86.233 181.203 C 86.311 181.083,86.476 180.345,86.598 179.565 C 86.721 178.784,86.878 177.933,86.947 177.673 C 87.017 177.412,87.119 176.753,87.174 176.206 C 87.230 175.660,87.347 175.213,87.434 175.213 C 87.522 175.213,87.650 174.785,87.719 174.263 C 87.789 173.740,87.916 173.269,88.001 173.216 C 88.087 173.163,88.214 172.612,88.284 171.990 C 88.355 171.369,88.477 170.861,88.556 170.861 C 88.679 170.861,88.867 170.215,89.051 169.158 C 89.178 168.428,89.542 167.132,89.766 166.612 C 90.345 165.264,90.429 164.986,90.334 164.738 C 90.279 164.594,90.375 164.422,90.548 164.356 C 90.726 164.287,90.816 164.116,90.756 163.959 C 90.698 163.807,90.732 163.633,90.831 163.571 C 90.931 163.510,91.012 163.214,91.012 162.914 C 91.012 162.614,91.097 162.316,91.202 162.252 C 91.306 162.187,91.391 161.991,91.392 161.815 C 91.393 161.639,91.520 161.251,91.676 160.953 C 91.831 160.655,91.958 160.303,91.958 160.172 C 91.958 160.040,92.086 159.827,92.242 159.697 C 92.398 159.568,92.526 159.217,92.526 158.917 C 92.526 158.618,92.611 158.373,92.715 158.373 C 92.819 158.373,92.904 158.207,92.904 158.005 C 92.904 157.803,92.990 157.586,93.094 157.521 C 93.198 157.457,93.283 157.239,93.283 157.037 C 93.283 156.835,93.368 156.670,93.472 156.670 C 93.576 156.670,93.661 156.457,93.661 156.197 C 93.661 155.937,93.746 155.724,93.851 155.724 C 93.955 155.724,94.040 155.558,94.040 155.356 C 94.040 155.154,94.114 154.943,94.205 154.887 C 94.295 154.831,94.424 154.513,94.491 154.179 C 94.557 153.846,94.732 153.439,94.879 153.276 C 95.025 153.113,95.173 152.854,95.207 152.701 C 95.242 152.547,95.372 152.311,95.498 152.175 C 95.624 152.039,95.683 151.814,95.629 151.675 C 95.576 151.535,95.668 151.368,95.835 151.304 C 96.002 151.240,96.122 151.080,96.101 150.949 C 96.052 150.643,96.622 149.354,96.875 149.198 C 96.981 149.132,97.067 148.918,97.067 148.722 C 97.067 148.526,97.247 148.240,97.466 148.086 C 97.686 147.933,97.814 147.725,97.753 147.625 C 97.691 147.525,97.809 147.228,98.016 146.965 C 98.223 146.702,98.392 146.357,98.392 146.197 C 98.392 146.037,98.472 145.857,98.570 145.797 C 98.668 145.736,98.936 145.310,99.166 144.849 C 99.396 144.389,99.678 144.029,99.792 144.049 C 99.907 144.070,99.973 143.930,99.940 143.737 C 99.907 143.545,99.992 143.247,100.129 143.075 C 100.434 142.693,100.816 142.036,101.254 141.139 C 101.437 140.767,101.719 140.352,101.881 140.218 C 102.043 140.083,102.176 139.856,102.176 139.712 C 102.176 139.569,102.472 139.124,102.835 138.723 C 103.197 138.322,103.444 137.944,103.382 137.883 C 103.256 137.756,104.837 135.667,105.059 135.667 C 105.138 135.667,105.203 135.517,105.203 135.334 C 105.203 135.151,105.500 134.661,105.862 134.246 C 106.224 133.831,106.522 133.385,106.524 133.254 C 106.526 133.124,106.627 133.039,106.748 133.065 C 106.869 133.091,107.018 132.927,107.079 132.700 C 107.192 132.281,107.820 131.433,108.930 130.202 C 109.269 129.825,109.549 129.414,109.551 129.288 C 109.553 129.161,109.726 128.967,109.934 128.855 C 110.142 128.744,110.312 128.528,110.312 128.376 C 110.312 128.223,110.405 128.098,110.518 128.098 C 110.815 128.098,111.434 127.306,111.441 126.916 C 111.445 126.717,111.593 126.585,111.813 126.585 C 112.072 126.585,112.197 126.432,112.239 126.064 C 112.280 125.705,112.401 125.552,112.630 125.570 C 112.812 125.585,112.961 125.521,112.961 125.429 C 112.961 125.337,113.259 124.931,113.623 124.528 C 113.988 124.125,114.286 123.699,114.286 123.582 C 114.286 123.464,114.413 123.368,114.570 123.368 C 114.726 123.368,114.854 123.304,114.854 123.226 C 114.855 122.992,116.210 121.476,116.417 121.476 C 116.688 121.476,117.111 120.877,117.118 120.482 C 117.121 120.297,117.270 120.149,117.455 120.147 C 117.637 120.144,118.031 119.811,118.331 119.405 C 118.654 118.970,118.982 118.709,119.135 118.768 C 119.278 118.823,119.395 118.791,119.395 118.698 C 119.395 118.605,119.733 118.149,120.146 117.685 C 120.559 117.220,120.900 116.776,120.903 116.698 C 120.906 116.620,121.026 116.556,121.170 116.556 C 121.313 116.556,121.656 116.262,121.930 115.901 C 122.243 115.491,122.534 115.287,122.710 115.354 C 122.884 115.421,122.990 115.348,122.990 115.161 C 122.990 114.996,123.181 114.810,123.415 114.748 C 123.649 114.687,124.120 114.259,124.462 113.799 C 124.804 113.338,125.169 112.961,125.275 112.961 C 125.625 112.961,126.383 111.929,126.388 111.447 C 126.391 111.052,125.869 110.217,124.884 109.043 C 124.779 108.917,124.689 108.747,124.685 108.665 C 124.681 108.582,124.425 108.220,124.117 107.860 C 123.809 107.499,123.557 107.123,123.557 107.024 C 123.557 106.925,123.427 106.709,123.269 106.544 C 122.761 106.017,121.665 104.476,121.665 104.289 C 121.665 104.190,121.537 104.060,121.381 104.000 C 121.225 103.940,121.097 103.790,121.097 103.668 C 121.097 103.545,120.799 103.081,120.435 102.637 C 120.071 102.192,119.773 101.736,119.773 101.624 C 119.773 101.511,119.688 101.419,119.584 101.419 C 119.480 101.419,119.395 101.305,119.395 101.165 C 119.395 101.025,119.224 100.756,119.016 100.568 C 118.808 100.379,118.638 100.120,118.638 99.991 C 118.638 99.862,118.510 99.708,118.354 99.648 C 118.198 99.588,118.070 99.413,118.070 99.258 C 118.070 99.104,117.959 98.910,117.823 98.827 C 117.687 98.744,117.373 98.335,117.124 97.919 C 116.875 97.502,116.561 97.094,116.425 97.010 C 116.289 96.927,116.178 96.766,116.178 96.652 C 116.178 96.537,115.880 96.080,115.516 95.636 C 115.151 95.191,114.853 94.753,114.853 94.663 C 114.853 94.573,114.601 94.204,114.293 93.843 C 113.985 93.483,113.730 93.121,113.726 93.038 C 113.722 92.956,113.632 92.786,113.527 92.660 C 112.772 91.760,112.204 90.922,112.204 90.709 C 112.204 90.571,112.034 90.367,111.826 90.255 C 111.618 90.144,111.447 89.926,111.447 89.770 C 111.447 89.614,111.320 89.438,111.164 89.378 C 111.008 89.318,110.880 89.189,110.880 89.092 C 110.880 88.883,110.091 87.729,109.886 87.638 C 109.808 87.603,109.745 87.459,109.745 87.316 C 109.745 87.174,109.638 86.990,109.508 86.906 C 109.195 86.706,108.420 85.593,108.420 85.344 C 108.420 85.235,108.333 85.147,108.226 85.147 C 108.120 85.147,107.951 84.934,107.852 84.674 C 107.753 84.413,107.585 84.201,107.479 84.201 C 107.372 84.201,107.285 84.112,107.285 84.004 C 107.285 83.795,106.542 82.672,106.274 82.476 C 106.086 82.338,105.636 81.589,105.472 81.139 C 105.408 80.964,105.236 80.775,105.090 80.719 C 104.944 80.663,104.825 80.496,104.825 80.348 C 104.825 80.200,104.697 80.029,104.541 79.969 C 104.385 79.910,104.257 79.743,104.257 79.600 C 104.257 79.457,104.087 79.186,103.879 78.997 C 103.671 78.809,103.500 78.582,103.500 78.493 C 103.500 78.404,103.032 77.698,102.460 76.924 C 101.887 76.150,101.419 75.467,101.419 75.407 C 101.419 75.346,101.100 74.885,100.710 74.382 C 100.319 73.879,99.872 73.278,99.716 73.046 C 99.560 72.815,99.262 72.431,99.054 72.193 C 98.846 71.956,98.505 71.477,98.297 71.129 C 98.089 70.781,97.769 70.280,97.585 70.016 C 97.402 69.752,97.200 69.387,97.138 69.205 C 97.075 69.023,96.946 68.874,96.851 68.874 C 96.757 68.874,96.598 68.661,96.500 68.401 C 96.401 68.141,96.232 67.928,96.126 67.928 C 96.019 67.928,95.932 67.836,95.932 67.723 C 95.932 67.611,95.634 67.155,95.270 66.711 C 94.905 66.266,94.607 65.805,94.607 65.685 C 94.607 65.566,94.520 65.468,94.413 65.468 C 94.307 65.468,94.137 65.277,94.036 65.043 C 93.750 64.382,93.408 63.889,93.046 63.616 C 92.864 63.478,92.715 63.261,92.715 63.133 C 92.715 63.004,92.463 62.605,92.155 62.245 C 91.847 61.884,91.592 61.522,91.588 61.440 C 91.583 61.357,91.494 61.187,91.389 61.061 C 90.740 60.285,89.688 58.868,89.688 58.772 C 89.688 58.668,88.254 56.616,87.796 56.063 C 87.692 55.937,87.606 55.776,87.606 55.704 C 87.606 55.632,87.308 55.210,86.944 54.765 C 86.580 54.321,86.282 53.872,86.282 53.768 C 86.282 53.664,86.218 53.551,86.140 53.516 C 85.977 53.444,85.147 52.290,85.147 52.136 C 85.147 52.080,84.998 51.870,84.816 51.669 C 84.309 51.111,84.132 50.868,83.637 50.047 C 83.386 49.631,83.070 49.222,82.934 49.139 C 82.798 49.056,82.687 48.894,82.687 48.780 C 82.687 48.666,82.389 48.209,82.025 47.764 C 81.660 47.320,81.362 46.864,81.362 46.752 C 81.362 46.639,81.277 46.547,81.173 46.547 C 81.069 46.547,80.984 46.433,80.984 46.294 C 80.984 46.033,79.963 45.029,79.708 45.039 C 79.629 45.042,79.395 45.140,79.186 45.256 ",stroke:"none",fill:"#9fbb1a","fill-rule":"evenodd"}),React.createElement("path",{id:"path7",d:"M190.728 4.092 C 190.364 4.223,189.799 4.285,189.473 4.229 C 189.135 4.172,188.824 4.219,188.750 4.338 C 188.679 4.453,188.530 4.491,188.419 4.423 C 188.117 4.236,186.136 4.191,185.800 4.363 C 185.639 4.446,184.674 4.555,183.655 4.606 C 182.637 4.658,181.757 4.746,181.700 4.803 C 181.643 4.860,181.445 4.825,181.260 4.726 C 181.028 4.602,180.702 4.639,180.211 4.844 C 179.819 5.008,179.236 5.103,178.916 5.056 C 178.597 5.009,178.153 5.054,177.930 5.155 C 177.665 5.276,177.408 5.275,177.188 5.151 C 176.939 5.012,176.677 5.060,176.193 5.332 C 175.705 5.606,175.498 5.643,175.395 5.476 C 175.317 5.350,175.150 5.315,175.018 5.396 C 174.731 5.574,173.781 5.731,173.132 5.709 C 172.871 5.700,172.531 5.745,172.375 5.809 C 172.219 5.872,171.835 5.942,171.523 5.964 C 171.211 5.986,170.805 6.068,170.621 6.145 C 170.437 6.223,170.057 6.243,169.775 6.189 C 169.494 6.135,168.963 6.205,168.596 6.343 C 168.229 6.481,167.673 6.577,167.360 6.556 C 167.048 6.534,166.553 6.631,166.259 6.771 C 165.966 6.910,165.540 7.007,165.313 6.985 C 165.086 6.963,164.773 6.996,164.617 7.059 C 164.461 7.122,163.936 7.213,163.450 7.261 C 162.965 7.310,162.403 7.437,162.203 7.544 C 162.003 7.651,161.464 7.761,161.005 7.788 C 160.547 7.815,159.865 7.985,159.491 8.166 C 159.117 8.347,158.627 8.447,158.401 8.388 C 158.176 8.329,157.886 8.367,157.757 8.472 C 157.627 8.576,157.223 8.661,156.859 8.658 C 156.495 8.656,155.899 8.785,155.535 8.945 C 155.170 9.104,154.532 9.288,154.115 9.354 C 153.699 9.419,153.018 9.570,152.602 9.689 C 152.185 9.809,151.771 9.888,151.680 9.865 C 151.589 9.842,151.079 9.974,150.545 10.156 C 150.011 10.339,149.404 10.494,149.196 10.501 C 148.988 10.508,148.711 10.580,148.582 10.660 C 148.452 10.741,148.160 10.842,147.933 10.886 C 147.706 10.930,147.466 11.054,147.399 11.162 C 147.333 11.270,146.854 11.388,146.337 11.424 C 145.819 11.460,145.229 11.581,145.025 11.691 C 144.416 12.023,143.918 12.170,143.561 12.126 C 143.375 12.103,142.854 12.291,142.402 12.543 C 141.806 12.877,141.492 12.953,141.259 12.823 C 141.031 12.696,140.841 12.731,140.605 12.944 C 140.423 13.110,140.221 13.245,140.158 13.245 C 140.095 13.245,139.804 13.342,139.511 13.461 C 139.218 13.580,138.851 13.703,138.694 13.735 C 137.405 14.000,136.837 14.157,136.471 14.348 C 135.438 14.886,135.267 14.948,134.805 14.948 C 134.536 14.948,134.188 15.076,134.032 15.232 C 133.876 15.388,133.551 15.516,133.311 15.516 C 133.071 15.516,132.768 15.644,132.638 15.802 C 132.460 16.015,132.336 16.035,132.148 15.879 C 131.958 15.721,131.744 15.777,131.277 16.110 C 130.937 16.353,130.518 16.527,130.348 16.498 C 130.177 16.469,129.991 16.567,129.934 16.715 C 129.877 16.863,129.210 17.172,128.451 17.403 C 127.692 17.633,126.900 17.942,126.691 18.088 C 126.482 18.234,126.171 18.354,126.000 18.354 C 125.829 18.354,125.479 18.520,125.221 18.722 C 124.961 18.927,124.590 19.048,124.387 18.995 C 124.177 18.940,123.727 19.099,123.331 19.367 C 122.952 19.625,122.597 19.791,122.543 19.736 C 122.488 19.682,122.192 19.817,121.883 20.036 C 121.575 20.256,121.143 20.435,120.923 20.435 C 120.702 20.435,120.185 20.648,119.773 20.908 C 119.361 21.168,118.958 21.383,118.878 21.385 C 118.798 21.387,117.966 21.769,117.029 22.235 C 116.093 22.701,115.172 23.082,114.983 23.083 C 114.794 23.084,114.368 23.289,114.037 23.539 C 113.705 23.789,113.117 24.124,112.729 24.284 C 112.341 24.444,111.836 24.750,111.605 24.965 C 111.172 25.369,111.017 25.422,110.449 25.364 C 110.263 25.345,109.604 25.675,108.984 26.099 C 108.364 26.522,107.767 26.868,107.657 26.868 C 107.548 26.868,106.986 27.217,106.409 27.643 C 105.732 28.143,105.231 28.384,104.995 28.322 C 104.763 28.262,104.208 28.515,103.479 29.014 C 102.847 29.447,102.189 29.886,102.016 29.991 C 101.844 30.095,101.650 30.253,101.585 30.342 C 101.520 30.431,101.290 30.448,101.075 30.380 C 100.804 30.294,100.435 30.433,99.869 30.835 C 99.421 31.154,98.845 31.562,98.591 31.743 C 98.336 31.924,97.760 32.349,97.312 32.687 C 96.863 33.025,96.412 33.302,96.309 33.302 C 96.206 33.302,96.121 33.387,96.121 33.491 C 96.121 33.595,96.032 33.680,95.924 33.680 C 95.815 33.680,95.624 33.763,95.498 33.865 C 95.372 33.966,95.019 34.252,94.713 34.501 L 94.157 34.952 94.848 35.972 C 95.229 36.533,96.117 37.818,96.824 38.829 C 97.530 39.840,98.482 41.202,98.939 41.857 C 99.396 42.511,100.152 43.600,100.618 44.276 C 101.085 44.953,101.626 45.682,101.821 45.897 C 102.016 46.112,102.176 46.351,102.176 46.428 C 102.176 46.506,102.474 46.969,102.838 47.457 C 103.690 48.598,103.846 48.816,104.594 49.902 C 105.327 50.967,108.212 55.098,108.792 55.913 C 109.014 56.225,109.932 57.545,110.832 58.846 C 111.732 60.147,112.515 61.254,112.573 61.306 C 112.631 61.358,112.934 61.783,113.246 62.252 C 113.557 62.720,113.878 63.188,113.957 63.292 C 114.786 64.376,115.421 65.277,115.421 65.371 C 115.421 65.434,115.825 66.032,116.320 66.700 C 117.956 68.911,118.920 70.264,119.016 70.484 C 119.068 70.604,119.648 71.461,120.305 72.390 C 124.511 78.336,125.354 79.540,126.329 80.984 C 126.926 81.868,127.674 82.929,127.993 83.340 C 128.311 83.751,128.657 84.236,128.761 84.418 C 128.933 84.718,130.457 86.906,132.027 89.106 C 132.367 89.582,133.022 90.525,133.484 91.202 C 133.945 91.878,134.716 92.985,135.198 93.661 C 135.680 94.338,136.301 95.232,136.580 95.648 C 136.858 96.064,137.171 96.501,137.275 96.618 C 137.379 96.736,137.574 96.991,137.707 97.186 C 137.840 97.381,138.421 98.221,138.998 99.054 C 139.575 99.886,140.190 100.801,140.364 101.087 C 140.778 101.764,141.053 101.743,142.264 100.946 C 142.817 100.581,143.341 100.326,143.427 100.380 C 143.513 100.433,143.697 100.366,143.835 100.231 C 144.299 99.780,145.901 98.770,146.152 98.770 C 146.289 98.770,146.618 98.600,146.882 98.392 C 147.147 98.184,147.483 98.013,147.628 98.013 C 147.774 98.013,148.059 97.888,148.261 97.735 C 148.463 97.583,148.726 97.455,148.846 97.452 C 148.965 97.448,149.509 97.145,150.055 96.778 C 150.600 96.411,151.089 96.153,151.140 96.205 C 151.192 96.257,151.483 96.122,151.786 95.906 C 152.118 95.670,152.519 95.548,152.792 95.600 C 153.102 95.659,153.457 95.512,153.915 95.135 C 154.284 94.831,154.661 94.630,154.754 94.687 C 154.846 94.744,155.137 94.622,155.400 94.416 C 155.663 94.209,156.064 94.040,156.292 94.040 C 156.699 94.040,156.919 93.949,158.510 93.124 C 158.950 92.896,159.546 92.677,159.835 92.638 C 160.332 92.572,161.122 92.273,162.479 91.639 C 162.812 91.484,163.157 91.402,163.247 91.457 C 163.337 91.513,163.916 91.315,164.534 91.018 C 165.152 90.721,165.730 90.547,165.818 90.631 C 165.907 90.716,166.439 90.574,167.002 90.317 C 167.565 90.059,168.344 89.809,168.733 89.762 C 169.521 89.665,170.644 89.319,170.995 89.064 C 171.120 88.973,171.298 88.945,171.391 89.002 C 171.483 89.059,171.986 88.944,172.508 88.746 C 173.207 88.480,173.512 88.441,173.668 88.597 C 173.824 88.753,173.972 88.725,174.230 88.491 C 174.423 88.317,174.760 88.174,174.980 88.174 C 175.200 88.174,175.429 88.095,175.489 87.997 C 175.549 87.900,175.894 87.869,176.255 87.927 C 176.638 87.989,177.025 87.941,177.181 87.811 C 177.329 87.688,177.822 87.566,178.277 87.539 C 178.732 87.512,179.217 87.420,179.356 87.335 C 179.494 87.249,180.025 87.157,180.536 87.129 C 181.047 87.102,181.577 86.986,181.715 86.871 C 181.852 86.757,182.016 86.715,182.079 86.778 C 182.142 86.841,182.631 86.787,183.166 86.659 C 183.701 86.530,184.664 86.406,185.305 86.382 C 185.946 86.358,186.641 86.288,186.850 86.226 C 187.397 86.063,191.399 85.731,194.229 85.613 C 198.932 85.416,201.514 85.397,201.514 85.558 C 201.514 85.654,201.635 85.665,201.783 85.582 C 201.992 85.464,204.170 85.524,206.339 85.706 C 206.505 85.720,207.806 85.733,209.555 85.737 C 209.868 85.738,210.251 85.786,210.407 85.844 C 210.703 85.954,211.110 86.005,212.895 86.157 C 213.483 86.207,214.121 86.329,214.314 86.429 C 214.507 86.528,214.771 86.571,214.901 86.524 C 215.032 86.477,216.032 86.579,217.124 86.751 C 218.216 86.922,219.182 87.017,219.271 86.962 C 219.360 86.907,219.595 86.980,219.792 87.124 C 220.057 87.317,220.216 87.331,220.402 87.177 C 220.589 87.022,220.696 87.038,220.821 87.240 C 220.913 87.390,221.141 87.528,221.327 87.547 C 221.513 87.566,222.067 87.623,222.558 87.674 C 223.049 87.725,223.519 87.808,223.603 87.860 C 223.686 87.911,224.136 88.011,224.602 88.080 C 225.068 88.150,225.542 88.284,225.656 88.378 C 225.770 88.472,225.910 88.502,225.967 88.445 C 226.024 88.388,226.570 88.486,227.179 88.664 C 227.789 88.841,228.415 89.001,228.571 89.019 C 228.728 89.037,229.111 89.160,229.423 89.293 C 229.735 89.426,230.309 89.547,230.699 89.564 C 231.089 89.580,231.408 89.657,231.409 89.735 C 231.409 89.813,231.527 89.877,231.669 89.877 C 231.812 89.877,232.329 90.054,232.818 90.270 C 233.308 90.487,233.820 90.621,233.956 90.568 C 234.093 90.516,234.380 90.596,234.594 90.746 C 234.809 90.896,235.053 90.997,235.136 90.971 C 235.220 90.944,235.544 91.016,235.856 91.130 C 236.168 91.244,236.764 91.446,237.181 91.578 C 237.597 91.710,238.273 91.977,238.683 92.172 C 239.092 92.367,239.620 92.526,239.854 92.526 C 240.089 92.526,240.333 92.611,240.397 92.715 C 240.462 92.819,240.672 92.904,240.866 92.904 C 241.059 92.904,241.246 92.970,241.280 93.049 C 241.315 93.129,242.092 93.441,243.007 93.742 C 243.922 94.043,244.740 94.414,244.825 94.566 C 244.910 94.718,245.209 94.868,245.491 94.899 C 245.772 94.930,246.657 95.268,247.457 95.650 C 248.834 96.308,249.689 96.696,250.331 96.956 C 250.487 97.020,250.870 97.234,251.183 97.434 C 251.495 97.633,251.870 97.803,252.016 97.810 C 252.162 97.818,252.561 98.037,252.902 98.297 C 253.243 98.557,253.630 98.770,253.762 98.770 C 253.893 98.770,254.317 98.989,254.704 99.257 C 255.091 99.526,255.524 99.762,255.666 99.783 C 255.808 99.804,256.191 100.010,256.516 100.242 C 256.841 100.473,257.206 100.662,257.327 100.662 C 257.449 100.662,257.667 100.769,257.812 100.899 C 258.456 101.477,258.653 101.600,259.113 101.716 C 259.382 101.783,259.603 101.966,259.603 102.122 C 259.603 102.289,259.713 102.363,259.871 102.303 C 260.018 102.246,260.183 102.314,260.236 102.453 C 260.289 102.592,260.632 102.804,260.996 102.924 C 261.361 103.045,261.982 103.439,262.376 103.799 C 262.770 104.160,263.182 104.421,263.291 104.379 C 263.401 104.336,263.783 104.590,264.139 104.942 C 264.496 105.294,264.924 105.582,265.091 105.582 C 265.258 105.582,265.962 106.050,266.656 106.623 C 267.350 107.195,268.005 107.663,268.112 107.663 C 268.219 107.663,268.307 107.748,268.307 107.852 C 268.307 107.956,268.436 108.042,268.594 108.042 C 268.753 108.042,268.979 108.254,269.098 108.515 C 269.221 108.785,269.472 108.988,269.684 108.988 C 269.887 108.988,270.385 109.329,270.790 109.746 C 271.194 110.163,271.706 110.532,271.926 110.565 C 272.147 110.599,272.441 110.832,272.581 111.084 C 272.720 111.336,272.837 111.460,272.841 111.360 C 272.845 111.261,273.167 111.516,273.557 111.928 C 274.300 112.712,274.800 113.086,275.355 113.273 C 275.537 113.334,275.686 113.449,275.686 113.528 C 275.686 113.825,277.572 115.636,277.760 115.520 C 277.868 115.453,278.135 115.702,278.353 116.072 C 278.572 116.442,278.827 116.698,278.921 116.640 C 279.015 116.582,279.258 116.817,279.462 117.162 C 279.665 117.507,280.105 117.951,280.439 118.148 C 281.049 118.508,282.687 120.109,282.687 120.345 C 282.687 120.579,283.386 121.281,283.503 121.164 C 283.567 121.101,283.720 121.271,283.844 121.542 C 283.968 121.814,284.213 122.082,284.388 122.138 C 284.564 122.193,284.820 122.449,284.957 122.706 C 285.095 122.962,285.369 123.224,285.567 123.287 C 285.765 123.349,286.020 123.606,286.135 123.857 C 286.249 124.109,286.414 124.314,286.502 124.314 C 286.589 124.314,286.660 124.442,286.660 124.598 C 286.660 124.754,286.740 124.882,286.837 124.882 C 286.934 124.882,287.066 125.048,287.130 125.250 C 287.195 125.453,287.395 125.666,287.575 125.723 C 287.755 125.781,288.042 126.062,288.213 126.348 C 288.945 127.577,289.576 128.101,289.881 127.732 C 290.035 127.546,290.416 127.253,290.728 127.080 C 291.041 126.907,291.807 126.381,292.431 125.911 C 293.056 125.441,293.716 125.007,293.898 124.947 C 294.080 124.887,294.229 124.767,294.229 124.681 C 294.229 124.595,294.437 124.413,294.691 124.277 C 295.220 123.994,297.304 122.597,297.446 122.430 C 297.498 122.369,297.753 122.176,298.013 122.002 C 298.273 121.828,298.912 121.380,299.432 121.007 C 299.953 120.634,300.712 120.108,301.120 119.839 C 301.529 119.569,302.034 119.189,302.244 118.993 C 302.454 118.798,302.730 118.638,302.858 118.638 C 302.986 118.638,303.119 118.570,303.154 118.487 C 303.188 118.404,303.898 117.873,304.730 117.306 C 305.563 116.740,306.287 116.225,306.339 116.161 C 306.391 116.097,306.807 115.798,307.263 115.497 C 308.823 114.465,309.129 114.251,310.763 113.052 C 311.192 112.738,312.053 112.146,312.677 111.736 C 313.302 111.326,313.898 110.924,314.002 110.843 C 314.520 110.440,315.959 109.416,316.457 109.096 C 316.766 108.897,317.187 108.578,317.391 108.388 C 317.596 108.197,317.848 108.042,317.952 108.042 C 318.055 108.042,318.334 107.859,318.571 107.637 C 318.808 107.414,319.161 107.138,319.356 107.022 C 319.885 106.708,321.547 105.551,323.463 104.163 C 324.399 103.484,325.302 102.866,325.469 102.789 C 325.636 102.712,326.019 102.458,326.321 102.224 C 326.622 101.991,327.252 101.502,327.720 101.138 C 328.188 100.774,328.644 100.476,328.733 100.475 C 328.822 100.474,329.163 100.259,329.490 99.997 C 329.817 99.735,330.177 99.448,330.289 99.358 C 330.401 99.268,330.860 98.950,331.308 98.651 C 331.756 98.352,332.440 97.895,332.829 97.635 C 333.217 97.375,333.902 96.917,334.350 96.619 C 334.798 96.320,335.256 95.996,335.368 95.900 C 335.608 95.694,337.379 94.421,338.282 93.806 C 338.627 93.570,339.150 93.186,339.444 92.952 C 339.738 92.718,340.066 92.526,340.172 92.526 C 340.279 92.526,340.394 92.456,340.429 92.371 C 340.488 92.225,340.999 91.856,343.992 89.798 C 344.669 89.333,345.310 88.877,345.416 88.785 C 345.523 88.692,345.864 88.454,346.173 88.255 C 346.483 88.057,347.086 87.638,347.515 87.324 C 349.323 86.002,351.509 84.476,352.195 84.057 C 352.492 83.876,353.295 83.314,353.981 82.808 C 354.667 82.303,355.425 81.799,355.665 81.690 C 356.209 81.442,356.225 80.909,355.707 80.361 C 355.489 80.131,354.905 79.342,354.408 78.606 C 351.941 74.954,351.625 74.551,351.234 74.551 C 350.972 74.551,350.426 74.114,350.426 73.903 C 350.426 73.567,348.578 71.305,348.232 71.218 C 348.005 71.161,347.506 70.660,347.123 70.104 C 346.740 69.549,346.319 69.053,346.186 69.002 C 346.053 68.951,345.633 68.440,345.253 67.866 C 344.872 67.293,344.262 66.640,343.898 66.415 C 343.534 66.189,343.236 65.944,343.236 65.869 C 343.236 65.795,342.767 65.243,342.195 64.642 C 341.623 64.042,341.154 63.478,341.154 63.389 C 341.154 63.301,340.835 63.035,340.445 62.798 C 340.054 62.561,339.661 62.246,339.571 62.098 C 339.481 61.950,339.077 61.488,338.672 61.071 C 338.268 60.655,337.938 60.245,337.938 60.160 C 337.938 60.076,337.773 59.954,337.573 59.891 C 337.372 59.827,337.035 59.481,336.822 59.121 C 336.610 58.762,336.306 58.467,336.146 58.467 C 335.987 58.467,335.856 58.382,335.856 58.278 C 335.856 58.174,335.772 58.089,335.669 58.089 C 335.566 58.089,335.162 57.736,334.771 57.304 C 333.770 56.200,332.960 55.440,332.783 55.440 C 332.588 55.440,330.937 53.717,330.937 53.514 C 330.937 53.428,330.824 53.359,330.687 53.359 C 330.550 53.359,330.151 53.103,329.801 52.791 C 329.452 52.479,329.114 52.223,329.051 52.223 C 328.988 52.223,328.786 51.968,328.602 51.656 C 328.417 51.343,328.149 51.088,328.006 51.088 C 327.863 51.088,327.691 50.918,327.625 50.710 C 327.510 50.348,327.323 50.254,326.836 50.314 C 326.713 50.329,326.559 50.169,326.492 49.958 C 326.425 49.747,326.254 49.574,326.112 49.574 C 325.970 49.574,325.676 49.325,325.458 49.019 C 325.241 48.714,324.873 48.437,324.641 48.404 C 324.409 48.371,324.135 48.153,324.033 47.919 C 323.930 47.684,323.743 47.493,323.616 47.493 C 323.490 47.493,323.319 47.380,323.236 47.242 C 323.152 47.103,322.807 46.830,322.469 46.633 C 322.131 46.437,321.854 46.209,321.854 46.128 C 321.854 46.046,321.764 45.979,321.654 45.979 C 321.544 45.979,321.037 45.543,320.526 45.010 C 319.887 44.344,319.501 44.078,319.289 44.160 C 319.083 44.239,318.950 44.158,318.886 43.916 C 318.834 43.717,318.629 43.512,318.431 43.460 C 318.232 43.408,318.070 43.239,318.070 43.084 C 318.070 42.779,317.569 42.510,317.304 42.673 C 317.214 42.729,316.817 42.432,316.422 42.012 C 316.028 41.593,315.573 41.249,315.411 41.249 C 315.250 41.249,314.654 40.842,314.087 40.345 C 313.520 39.847,312.822 39.338,312.535 39.213 C 312.249 39.089,312.015 38.899,312.015 38.793 C 312.015 38.687,311.890 38.600,311.738 38.600 C 311.586 38.600,311.366 38.423,311.250 38.207 C 311.135 37.990,310.932 37.855,310.799 37.906 C 310.667 37.957,310.232 37.708,309.834 37.353 C 309.435 36.998,308.961 36.708,308.781 36.708 C 308.601 36.708,308.243 36.457,307.985 36.151 C 307.727 35.844,307.476 35.633,307.427 35.682 C 307.379 35.731,307.231 35.641,307.099 35.482 C 306.968 35.324,306.714 35.194,306.536 35.194 C 306.358 35.194,305.964 34.941,305.661 34.632 C 305.357 34.322,304.965 34.067,304.789 34.064 C 304.614 34.061,304.200 33.812,303.870 33.510 C 303.540 33.209,303.030 32.914,302.737 32.856 C 302.443 32.797,301.882 32.427,301.488 32.034 C 301.079 31.625,300.628 31.343,300.434 31.376 C 300.247 31.408,300.095 31.343,300.095 31.232 C 300.095 31.122,299.971 31.031,299.820 31.031 C 299.669 31.031,299.463 30.883,299.361 30.702 C 299.260 30.520,299.116 30.433,299.042 30.507 C 298.890 30.659,297.824 30.087,297.824 29.855 C 297.824 29.774,297.695 29.707,297.538 29.707 C 297.142 29.707,296.529 29.332,295.890 28.700 C 295.593 28.406,295.247 28.204,295.121 28.250 C 294.995 28.296,294.636 28.145,294.324 27.915 C 294.011 27.685,293.511 27.436,293.213 27.362 C 292.914 27.289,292.546 27.105,292.395 26.954 C 292.244 26.803,291.961 26.679,291.767 26.679 C 291.572 26.679,291.360 26.593,291.295 26.488 C 291.230 26.383,290.629 26.040,289.959 25.727 C 289.290 25.414,288.742 25.075,288.742 24.973 C 288.742 24.871,288.593 24.785,288.411 24.783 C 288.228 24.781,287.867 24.612,287.606 24.409 C 287.346 24.205,286.989 24.037,286.813 24.034 C 286.637 24.032,286.440 23.944,286.375 23.838 C 286.309 23.732,286.189 23.687,286.108 23.737 C 286.027 23.787,285.775 23.655,285.547 23.443 C 285.320 23.231,285.030 23.092,284.903 23.136 C 284.777 23.179,284.546 23.071,284.390 22.896 C 284.148 22.624,283.364 22.302,282.814 22.248 C 282.727 22.240,282.540 22.073,282.397 21.878 C 282.246 21.672,282.014 21.570,281.844 21.635 C 281.683 21.697,281.552 21.665,281.552 21.565 C 281.552 21.464,281.432 21.381,281.287 21.381 C 281.141 21.381,280.537 21.126,279.943 20.814 C 279.350 20.501,278.738 20.246,278.583 20.246 C 278.429 20.246,277.698 19.948,276.958 19.584 C 276.219 19.219,275.457 18.921,275.266 18.921 C 275.074 18.921,274.868 18.794,274.808 18.638 C 274.748 18.482,274.494 18.354,274.244 18.354 C 273.994 18.354,273.641 18.279,273.460 18.187 C 273.279 18.095,272.876 17.913,272.564 17.783 C 272.252 17.653,271.826 17.473,271.618 17.383 C 271.410 17.293,271.068 17.196,270.859 17.167 C 270.650 17.138,270.269 16.968,270.013 16.788 C 269.757 16.609,269.370 16.462,269.154 16.462 C 268.938 16.462,268.680 16.394,268.581 16.312 C 268.482 16.230,267.763 15.953,266.982 15.697 C 266.202 15.441,265.535 15.168,265.500 15.090 C 265.465 15.012,265.230 14.948,264.977 14.948 C 264.724 14.948,264.369 14.873,264.189 14.781 C 263.474 14.417,262.885 14.167,262.622 14.114 C 262.470 14.084,262.219 14.011,262.062 13.952 C 261.906 13.893,261.523 13.780,261.211 13.702 C 260.899 13.624,260.601 13.546,260.549 13.529 C 260.497 13.512,260.199 13.434,259.886 13.357 C 259.310 13.213,258.639 12.958,258.044 12.655 C 257.863 12.563,257.549 12.488,257.346 12.488 C 257.142 12.488,256.929 12.413,256.873 12.321 C 256.816 12.229,256.214 12.049,255.535 11.921 C 254.856 11.792,254.253 11.611,254.195 11.517 C 254.137 11.423,254.013 11.394,253.919 11.452 C 253.825 11.510,253.494 11.426,253.184 11.266 C 252.874 11.106,252.408 10.974,252.149 10.974 C 251.890 10.974,251.632 10.901,251.577 10.811 C 251.490 10.670,251.059 10.569,249.571 10.339 C 249.413 10.314,249.194 10.239,249.085 10.171 C 248.975 10.104,248.679 10.009,248.426 9.962 C 247.537 9.795,246.829 9.596,246.641 9.460 C 246.537 9.385,246.325 9.320,246.168 9.316 C 246.012 9.312,245.246 9.168,244.465 8.996 C 243.685 8.824,242.833 8.654,242.573 8.617 C 242.313 8.581,241.845 8.451,241.533 8.330 C 241.220 8.209,240.922 8.121,240.870 8.134 C 240.596 8.206,238.851 7.878,238.653 7.718 C 238.526 7.615,237.917 7.515,237.300 7.494 C 236.683 7.474,236.043 7.345,235.878 7.208 C 235.712 7.071,235.441 7.011,235.274 7.075 C 235.107 7.139,234.872 7.128,234.751 7.051 C 234.630 6.974,234.149 6.900,233.680 6.887 C 233.212 6.874,232.573 6.753,232.261 6.618 C 231.949 6.483,231.626 6.387,231.543 6.406 C 231.460 6.424,230.524 6.303,229.462 6.136 C 228.400 5.969,227.190 5.798,226.774 5.755 C 226.358 5.713,225.634 5.632,225.166 5.576 C 224.697 5.520,223.974 5.439,223.557 5.396 C 223.141 5.354,222.800 5.309,222.800 5.296 C 222.800 5.284,222.460 5.239,222.044 5.196 C 220.557 5.042,219.570 4.935,218.638 4.825 C 217.114 4.646,215.912 4.545,214.096 4.444 C 211.620 4.306,210.155 4.179,209.893 4.078 C 209.766 4.030,209.610 4.075,209.545 4.179 C 209.481 4.282,209.244 4.308,209.019 4.235 C 208.606 4.101,206.004 4.009,202.176 3.994 C 201.031 3.989,199.924 3.983,199.716 3.979 C 198.221 3.955,194.042 3.995,193.188 4.042 C 192.616 4.074,191.977 4.044,191.769 3.977 C 191.561 3.910,191.093 3.962,190.728 4.092 ",stroke:"none",fill:"#b5cb2b","fill-rule":"evenodd"}),React.createElement("path",{id:"path8",d:"",stroke:"none",fill:"#55ff00","fill-rule":"evenodd"}),React.createElement("path",{id:"path9",d:"M364.522 96.081 C 363.619 96.742,362.897 97.244,359.648 99.478 C 358.854 100.024,357.583 100.938,356.822 101.509 C 356.062 102.080,355.333 102.549,355.203 102.551 C 355.073 102.553,354.967 102.627,354.967 102.715 C 354.967 102.851,354.376 103.279,352.707 104.352 C 352.545 104.456,351.944 104.889,351.372 105.314 C 350.799 105.740,350.024 106.293,349.648 106.544 C 347.578 107.929,346.136 108.917,345.885 109.122 C 345.631 109.330,344.163 110.365,341.471 112.233 C 340.970 112.582,340.270 113.079,339.916 113.340 C 339.562 113.600,338.581 114.281,337.736 114.853 C 336.890 115.426,335.705 116.256,335.103 116.698 C 334.500 117.140,333.921 117.502,333.816 117.502 C 333.712 117.502,333.577 117.631,333.516 117.789 C 333.456 117.947,333.212 118.162,332.976 118.267 C 332.595 118.436,331.562 119.112,331.031 119.541 C 330.927 119.624,330.118 120.192,329.234 120.801 C 328.349 121.410,327.597 121.981,327.562 122.071 C 327.528 122.160,327.408 122.233,327.296 122.233 C 327.185 122.233,326.787 122.467,326.413 122.752 C 326.039 123.038,325.180 123.649,324.503 124.109 C 323.827 124.570,323.231 124.997,323.179 125.058 C 323.127 125.119,322.709 125.424,322.250 125.735 C 321.792 126.046,321.229 126.429,320.999 126.585 C 320.769 126.741,320.047 127.252,319.395 127.720 C 318.742 128.188,318.015 128.699,317.780 128.855 C 316.016 130.025,314.359 131.179,313.150 132.081 C 312.370 132.663,311.582 133.194,311.400 133.262 C 311.218 133.329,311.069 133.472,311.069 133.580 C 311.069 133.687,310.971 133.775,310.851 133.775 C 310.731 133.775,310.284 134.034,309.858 134.351 C 308.177 135.600,305.993 137.141,304.778 137.938 C 304.075 138.398,303.500 138.831,303.500 138.901 C 303.500 138.970,303.253 139.129,302.952 139.254 C 302.650 139.379,302.209 139.688,301.972 139.940 C 301.736 140.191,301.463 140.397,301.366 140.397 C 301.269 140.397,300.879 140.639,300.500 140.934 C 300.121 141.228,299.662 141.524,299.480 141.590 C 299.001 141.764,299.066 142.077,299.811 143.183 C 300.175 143.724,300.473 144.297,300.473 144.456 C 300.473 144.615,300.856 145.249,301.325 145.865 C 301.793 146.480,302.176 147.071,302.176 147.178 C 302.176 147.284,302.473 147.940,302.836 148.637 C 303.199 149.333,303.455 149.967,303.406 150.046 C 303.358 150.125,303.615 150.580,303.979 151.057 C 304.343 151.534,304.627 151.991,304.609 152.073 C 304.592 152.156,304.718 152.540,304.890 152.927 C 305.063 153.314,305.203 153.766,305.203 153.933 C 305.203 154.099,305.416 154.514,305.676 154.855 C 305.937 155.197,306.149 155.646,306.149 155.854 C 306.149 156.062,306.308 156.376,306.501 156.551 C 306.726 156.754,306.820 157.034,306.764 157.328 C 306.709 157.616,306.825 157.978,307.075 158.295 C 307.294 158.574,307.474 158.951,307.474 159.132 C 307.474 159.313,307.592 159.560,307.737 159.680 C 307.882 159.800,308.057 160.277,308.127 160.740 C 308.196 161.202,308.339 161.634,308.444 161.699 C 308.549 161.764,308.592 161.928,308.540 162.064 C 308.488 162.200,308.604 162.454,308.798 162.630 C 308.993 162.806,309.105 163.070,309.048 163.218 C 308.992 163.366,309.060 163.625,309.201 163.794 C 309.341 163.963,309.431 164.295,309.400 164.530 C 309.369 164.766,309.434 165.015,309.544 165.083 C 309.654 165.151,309.745 165.404,309.745 165.646 C 309.745 165.887,309.860 166.180,310.002 166.298 C 310.147 166.418,310.220 166.715,310.170 166.976 C 310.117 167.253,310.205 167.564,310.386 167.745 C 310.554 167.913,310.691 168.251,310.691 168.498 C 310.691 168.745,310.776 168.999,310.880 169.063 C 310.984 169.128,311.069 169.388,311.069 169.641 C 311.069 169.895,311.232 170.592,311.432 171.191 C 311.631 171.790,311.849 172.682,311.916 173.174 C 311.982 173.666,312.109 174.113,312.198 174.168 C 312.286 174.223,312.313 174.438,312.259 174.646 C 312.204 174.855,312.254 175.139,312.370 175.279 C 312.485 175.418,312.526 175.585,312.460 175.651 C 312.394 175.717,312.456 175.912,312.599 176.084 C 312.742 176.256,312.881 176.748,312.909 177.177 C 312.958 177.938,313.431 180.323,313.646 180.889 C 313.705 181.045,313.785 181.514,313.822 181.930 C 313.981 183.680,314.099 184.354,314.286 184.579 C 314.413 184.733,314.421 184.979,314.309 185.275 C 314.203 185.553,314.203 185.856,314.307 186.044 C 314.403 186.214,314.514 186.720,314.554 187.169 C 314.594 187.618,314.680 188.453,314.744 189.026 C 315.128 192.434,315.238 194.787,315.312 201.135 C 315.348 204.241,315.301 206.811,315.207 206.929 C 315.114 207.045,315.068 207.746,315.106 208.487 C 315.143 209.228,315.123 209.885,315.061 209.947 C 314.999 210.009,314.935 210.627,314.919 211.321 C 314.894 212.420,314.508 215.779,314.177 217.786 C 314.117 218.150,314.070 218.615,314.073 218.818 C 314.076 219.021,313.991 219.294,313.883 219.424 C 313.775 219.554,313.743 219.839,313.813 220.057 C 313.882 220.275,313.846 220.565,313.734 220.700 C 313.621 220.836,313.534 221.151,313.540 221.401 C 313.558 222.105,312.777 225.972,312.566 226.227 C 312.462 226.352,312.433 226.675,312.501 226.945 C 312.574 227.240,312.544 227.436,312.426 227.436 C 312.317 227.436,312.170 227.841,312.100 228.335 C 311.917 229.615,311.490 231.225,311.260 231.503 C 311.151 231.633,311.112 231.869,311.172 232.026 C 311.233 232.183,311.029 232.869,310.720 233.550 C 310.412 234.231,310.201 234.831,310.253 234.882 C 310.359 234.989,309.875 236.529,308.877 239.262 C 308.801 239.470,308.752 239.704,308.768 239.782 C 308.785 239.860,308.719 239.924,308.621 239.924 C 308.523 239.924,308.442 240.073,308.439 240.255 C 308.431 240.809,307.965 242.384,307.809 242.384 C 307.729 242.384,307.663 242.549,307.663 242.751 C 307.663 242.953,307.578 243.171,307.474 243.236 C 307.370 243.300,307.285 243.551,307.285 243.794 C 307.285 244.037,307.147 244.288,306.979 244.353 C 306.794 244.424,306.710 244.609,306.767 244.825 C 306.820 245.029,306.672 245.410,306.417 245.721 C 306.173 246.019,305.971 246.415,305.967 246.601 C 305.963 246.787,305.828 247.140,305.667 247.385 C 305.506 247.631,305.331 248.075,305.278 248.372 C 305.224 248.669,305.101 248.993,305.003 249.092 C 304.905 249.191,304.825 249.418,304.825 249.596 C 304.825 249.775,304.758 249.950,304.677 249.984 C 304.596 250.019,304.257 250.622,303.924 251.325 C 303.592 252.027,303.232 252.602,303.126 252.602 C 303.020 252.602,302.930 252.793,302.927 253.027 C 302.924 253.262,302.796 253.618,302.643 253.820 C 302.490 254.022,302.365 254.364,302.365 254.579 C 302.365 254.795,302.069 255.311,301.707 255.726 C 301.344 256.141,301.046 256.600,301.044 256.747 C 301.042 256.893,300.828 257.292,300.568 257.633 C 300.307 257.974,300.095 258.386,300.095 258.548 C 300.095 258.710,299.906 259.059,299.676 259.324 C 299.446 259.589,299.169 260.077,299.061 260.409 C 298.953 260.740,298.668 261.110,298.427 261.229 C 298.186 261.349,297.995 261.500,298.001 261.565 C 298.060 262.145,297.957 262.497,297.635 262.819 C 297.427 263.027,297.256 263.277,297.256 263.374 C 297.256 263.471,297.078 263.607,296.861 263.676 C 296.594 263.761,296.495 263.915,296.556 264.148 C 296.612 264.366,296.408 264.755,296.005 265.195 C 295.653 265.579,295.364 266.007,295.364 266.145 C 295.364 266.474,294.426 267.471,294.183 267.400 C 294.079 267.370,294.040 267.466,294.097 267.615 C 294.241 267.992,293.752 268.691,292.337 270.133 C 292.077 270.398,291.862 270.718,291.861 270.843 C 291.859 270.968,291.518 271.416,291.104 271.839 C 290.689 272.261,290.326 272.742,290.297 272.907 C 290.267 273.073,289.926 273.542,289.540 273.950 C 288.536 275.010,287.803 275.939,287.799 276.159 C 287.796 276.263,287.540 276.518,287.228 276.727 C 286.916 276.935,286.661 277.198,286.661 277.312 C 286.661 277.425,286.362 277.679,285.998 277.875 C 285.594 278.093,285.336 278.374,285.336 278.596 C 285.336 278.965,283.437 280.984,283.090 280.984 C 282.987 280.984,282.843 281.167,282.773 281.390 C 282.593 281.958,280.226 284.201,279.808 284.201 C 279.726 284.201,279.659 284.330,279.659 284.489 C 279.659 284.648,279.447 284.859,279.186 284.957 C 278.910 285.062,278.713 285.287,278.713 285.497 C 278.713 285.719,278.495 285.948,278.146 286.093 C 277.833 286.222,277.578 286.446,277.578 286.591 C 277.578 286.736,277.131 287.143,276.585 287.497 C 276.038 287.850,275.367 288.381,275.093 288.677 C 274.558 289.254,274.365 289.412,273.557 289.930 C 272.807 290.412,272.879 290.641,274.487 292.876 C 275.285 293.984,276.285 295.402,276.710 296.026 C 277.135 296.651,277.532 297.204,277.592 297.256 C 277.651 297.308,277.757 297.479,277.825 297.635 C 277.894 297.791,278.418 298.557,278.989 299.338 C 279.561 300.118,280.409 301.310,280.875 301.987 C 281.340 302.663,282.300 304.043,283.008 305.054 C 283.716 306.065,284.551 307.256,284.863 307.702 C 285.175 308.148,286.147 309.535,287.022 310.784 C 288.475 312.858,289.115 313.775,290.954 316.414 C 291.298 316.909,291.895 317.760,292.279 318.307 C 292.664 318.853,294.253 321.131,295.810 323.368 C 297.367 325.605,298.805 327.649,299.004 327.909 C 299.363 328.377,302.341 332.638,303.542 334.403 C 303.883 334.905,304.253 335.415,304.364 335.538 C 304.474 335.661,305.113 336.564,305.783 337.545 C 306.977 339.294,307.255 339.694,309.416 342.763 C 310.003 343.595,310.973 345.000,311.573 345.885 C 312.173 346.769,312.714 347.535,312.775 347.588 C 312.836 347.640,313.265 348.236,313.728 348.912 C 314.191 349.588,314.616 350.184,314.672 350.237 C 314.729 350.289,315.155 350.893,315.618 351.580 C 318.330 355.596,319.517 357.226,319.734 357.232 C 319.869 357.235,320.961 356.535,322.162 355.676 C 323.363 354.818,324.573 353.969,324.850 353.790 C 325.894 353.117,326.206 352.823,326.206 352.517 C 326.206 352.225,327.371 351.257,328.471 350.635 C 329.111 350.273,329.423 349.937,329.423 349.610 C 329.423 349.458,329.820 349.048,330.304 348.698 C 330.789 348.347,331.449 347.799,331.771 347.479 C 332.092 347.159,332.654 346.694,333.018 346.445 C 333.921 345.827,334.153 345.582,334.153 345.249 C 334.153 345.092,334.430 344.773,334.768 344.539 C 335.106 344.306,335.649 343.853,335.973 343.533 C 336.298 343.213,336.809 342.735,337.109 342.470 C 337.408 342.205,337.872 341.737,338.138 341.430 C 338.404 341.122,339.149 340.384,339.793 339.790 C 340.438 339.196,340.965 338.621,340.965 338.513 C 340.965 338.405,341.071 338.313,341.202 338.310 C 341.585 338.300,342.523 337.379,342.421 337.113 C 342.367 336.972,342.600 336.721,342.970 336.522 C 343.324 336.331,343.614 336.062,343.614 335.924 C 343.614 335.785,343.950 335.450,344.360 335.179 C 344.772 334.906,345.132 334.502,345.164 334.277 C 345.196 334.053,345.413 333.786,345.646 333.683 C 345.879 333.581,346.050 333.373,346.025 333.221 C 346.000 333.069,346.173 332.845,346.410 332.725 C 346.647 332.604,347.158 332.085,347.545 331.571 C 348.386 330.457,349.674 329.157,350.232 328.858 C 350.489 328.720,350.614 328.496,350.578 328.236 C 350.539 327.966,350.667 327.757,350.958 327.610 C 351.199 327.489,351.390 327.336,351.384 327.271 C 351.350 326.931,351.406 326.848,351.791 326.677 C 352.022 326.574,352.256 326.300,352.312 326.069 C 352.367 325.837,352.843 325.198,353.370 324.648 C 353.896 324.099,354.449 323.372,354.599 323.034 C 354.749 322.695,355.021 322.370,355.203 322.312 C 355.385 322.255,355.535 322.127,355.535 322.030 C 355.535 321.932,355.747 321.667,356.008 321.441 C 356.268 321.214,356.481 320.872,356.481 320.679 C 356.481 320.486,356.608 320.280,356.764 320.220 C 356.921 320.160,357.048 320.011,357.048 319.888 C 357.048 319.766,357.307 319.512,357.624 319.325 C 358.051 319.073,358.170 318.892,358.084 318.621 C 358.009 318.386,358.073 318.217,358.265 318.143 C 358.428 318.081,358.562 317.917,358.562 317.779 C 358.562 317.641,358.720 317.478,358.914 317.416 C 359.107 317.355,359.423 316.956,359.615 316.529 C 359.807 316.103,360.330 315.378,360.777 314.918 C 361.224 314.458,361.589 313.922,361.589 313.727 C 361.589 313.532,361.845 313.131,362.157 312.836 C 362.469 312.541,362.725 312.190,362.725 312.055 C 362.725 311.813,362.908 311.546,363.503 310.918 C 363.672 310.741,363.959 310.274,364.143 309.880 C 364.326 309.487,364.721 308.903,365.020 308.583 C 365.319 308.263,365.563 307.924,365.563 307.830 C 365.563 307.543,366.016 306.832,366.367 306.567 C 366.549 306.430,366.698 306.159,366.698 305.966 C 366.698 305.772,366.954 305.373,367.266 305.078 C 367.578 304.783,367.833 304.398,367.833 304.222 C 367.833 304.045,367.920 303.848,368.026 303.782 C 368.132 303.717,368.169 303.584,368.108 303.486 C 368.048 303.388,368.132 303.258,368.295 303.195 C 368.457 303.133,368.590 302.972,368.590 302.838 C 368.590 302.704,368.718 302.546,368.874 302.486 C 369.030 302.426,369.158 302.213,369.158 302.013 C 369.158 301.812,369.413 301.375,369.726 301.041 C 370.038 300.706,370.293 300.272,370.293 300.075 C 370.293 299.877,370.442 299.565,370.624 299.379 C 370.807 299.194,371.104 298.747,371.285 298.386 C 371.758 297.447,372.058 296.994,372.319 296.826 C 372.445 296.745,372.498 296.547,372.436 296.386 C 372.374 296.225,372.485 295.866,372.683 295.587 C 372.881 295.308,373.169 294.825,373.323 294.513 C 373.478 294.201,373.710 293.877,373.841 293.794 C 373.971 293.711,374.078 293.537,374.078 293.408 C 374.078 293.138,374.697 291.879,375.024 291.485 C 375.146 291.338,375.191 291.129,375.123 291.021 C 375.056 290.912,375.091 290.823,375.202 290.823 C 375.312 290.823,375.402 290.716,375.402 290.585 C 375.402 290.454,375.577 290.237,375.791 290.104 C 376.054 289.939,376.142 289.744,376.064 289.498 C 375.989 289.261,376.084 289.019,376.338 288.801 C 376.552 288.618,376.727 288.251,376.727 287.985 C 376.727 287.712,376.974 287.231,377.294 286.880 C 377.606 286.538,377.862 286.092,377.862 285.889 C 377.862 285.686,377.943 285.372,378.041 285.191 C 378.477 284.394,379.453 282.202,379.422 282.090 C 379.403 282.022,379.513 281.863,379.665 281.736 C 379.818 281.609,379.943 281.345,379.943 281.149 C 379.943 280.954,380.114 280.476,380.322 280.087 C 380.530 279.699,380.700 279.274,380.700 279.142 C 380.700 279.010,380.785 278.903,380.889 278.903 C 380.993 278.903,381.079 278.724,381.079 278.506 C 381.079 278.047,381.647 277.010,381.898 277.010 C 381.992 277.010,382.028 276.853,381.977 276.660 C 381.927 276.468,382.036 276.111,382.219 275.868 C 382.403 275.624,382.512 275.318,382.462 275.187 C 382.411 275.056,382.499 274.710,382.657 274.419 C 383.245 273.334,383.996 271.427,384.282 270.293 C 384.361 269.981,384.652 269.249,384.928 268.667 C 385.204 268.084,385.430 267.429,385.430 267.211 C 385.430 266.993,385.516 266.763,385.620 266.698 C 385.724 266.634,385.809 266.415,385.809 266.211 C 385.809 266.008,385.886 265.694,385.980 265.513 C 386.074 265.332,386.258 264.823,386.388 264.380 C 386.519 263.938,386.707 263.576,386.805 263.576 C 386.904 263.576,386.940 263.459,386.885 263.316 C 386.830 263.173,386.906 262.822,387.054 262.537 C 387.202 262.252,387.323 261.826,387.323 261.591 C 387.323 261.355,387.454 261.054,387.614 260.920 C 387.801 260.766,387.841 260.613,387.725 260.497 C 387.609 260.381,387.674 260.082,387.906 259.669 C 388.105 259.314,388.269 258.813,388.269 258.556 C 388.269 258.299,388.343 258.089,388.434 258.089 C 388.591 258.089,388.868 256.944,388.922 256.065 C 388.937 255.837,389.103 255.478,389.293 255.269 C 389.530 255.007,389.600 254.737,389.517 254.407 C 389.451 254.143,389.466 253.926,389.550 253.926 C 389.723 253.926,390.211 252.364,390.249 251.690 C 390.262 251.449,390.385 251.183,390.521 251.099 C 390.677 251.003,390.720 250.793,390.638 250.535 C 390.567 250.309,390.592 250.021,390.695 249.896 C 390.798 249.771,390.944 249.243,391.020 248.723 C 391.096 248.202,391.244 247.564,391.349 247.304 C 391.548 246.809,391.566 246.732,391.769 245.506 C 391.838 245.090,391.964 244.579,392.049 244.371 C 392.134 244.163,392.388 243.013,392.613 241.816 C 392.838 240.620,393.106 239.486,393.209 239.298 C 393.311 239.109,393.345 238.797,393.284 238.604 C 393.223 238.411,393.246 238.208,393.336 238.153 C 393.425 238.097,393.513 237.532,393.530 236.896 C 393.551 236.140,393.664 235.638,393.855 235.446 C 394.088 235.213,394.101 235.098,393.917 234.876 C 393.761 234.688,393.750 234.556,393.882 234.470 C 393.990 234.400,394.127 233.798,394.186 233.133 C 394.244 232.468,394.397 231.860,394.524 231.781 C 394.653 231.701,394.709 231.457,394.650 231.232 C 394.592 231.008,394.625 230.553,394.725 230.219 C 394.824 229.885,394.939 229.101,394.979 228.477 C 395.020 227.852,395.111 227.193,395.182 227.010 C 395.252 226.828,395.259 226.545,395.196 226.382 C 395.133 226.218,395.158 225.941,395.252 225.767 C 395.402 225.486,395.487 224.840,395.766 221.854 C 395.805 221.438,395.878 220.501,395.928 219.773 C 395.978 219.044,396.094 217.938,396.186 217.313 C 396.277 216.689,396.334 215.752,396.313 215.232 C 396.291 214.711,396.347 213.859,396.435 213.337 C 396.524 212.815,396.599 211.794,396.602 211.067 C 396.610 208.737,396.636 208.326,396.777 208.325 C 396.871 208.325,396.878 201.377,396.790 196.121 C 396.769 194.872,396.807 193.710,396.875 193.539 C 396.943 193.367,396.907 193.170,396.796 193.101 C 396.674 193.026,396.640 192.687,396.709 192.255 C 396.778 191.822,396.743 191.483,396.622 191.408 C 396.490 191.326,396.479 191.127,396.589 190.836 C 396.683 190.590,396.721 190.350,396.674 190.303 C 396.576 190.205,396.385 187.540,396.367 185.998 C 396.360 185.426,396.305 184.872,396.244 184.768 C 396.184 184.664,396.160 184.342,396.190 184.051 C 396.239 183.590,396.147 182.655,395.738 179.470 C 395.685 179.054,395.606 178.353,395.564 177.914 C 395.521 177.474,395.422 177.009,395.343 176.882 C 395.264 176.754,395.177 176.305,395.149 175.884 C 395.016 173.868,394.930 173.107,394.822 173.000 C 394.758 172.935,394.796 172.774,394.906 172.641 C 395.045 172.474,395.046 172.286,394.912 172.035 C 394.805 171.835,394.674 171.230,394.621 170.691 C 394.569 170.151,394.471 169.622,394.404 169.514 C 394.337 169.406,394.242 168.921,394.191 168.436 C 394.140 167.950,394.023 167.411,393.929 167.236 C 393.836 167.061,393.810 166.666,393.871 166.358 C 393.934 166.044,393.895 165.744,393.783 165.674 C 393.673 165.606,393.628 165.434,393.682 165.292 C 393.737 165.150,393.682 164.972,393.559 164.896 C 393.392 164.793,393.397 164.722,393.579 164.609 C 393.770 164.491,393.756 164.362,393.512 163.989 C 393.342 163.730,393.123 162.868,393.024 162.074 C 392.925 161.279,392.742 160.505,392.616 160.354 C 392.490 160.202,392.434 159.897,392.492 159.676 C 392.549 159.456,392.517 159.115,392.419 158.919 C 392.322 158.722,392.163 158.403,392.067 158.208 C 391.958 157.989,391.959 157.786,392.068 157.677 C 392.178 157.566,392.072 157.073,391.788 156.374 C 391.521 155.716,391.370 155.042,391.426 154.752 C 391.478 154.478,391.428 154.197,391.314 154.126 C 391.200 154.056,391.107 153.791,391.107 153.537 C 391.107 153.283,391.020 153.075,390.914 153.075 C 390.804 153.075,390.771 152.876,390.837 152.612 C 390.901 152.358,390.884 152.039,390.799 151.903 C 390.613 151.605,390.572 151.468,390.416 150.615 C 390.349 150.251,390.179 149.776,390.038 149.559 C 389.897 149.343,389.830 149.117,389.890 149.057 C 389.949 148.997,389.833 148.608,389.632 148.191 C 389.422 147.756,389.330 147.330,389.415 147.191 C 389.500 147.054,389.448 146.782,389.295 146.564 C 389.147 146.352,389.026 146.038,389.026 145.866 C 389.026 145.693,388.902 145.450,388.750 145.324 C 388.528 145.140,388.519 145.021,388.703 144.708 C 388.882 144.404,388.881 144.303,388.694 144.236 C 388.564 144.189,388.458 143.949,388.458 143.704 C 388.458 143.459,388.372 143.205,388.268 143.141 C 388.164 143.076,388.126 142.830,388.186 142.595 C 388.252 142.328,388.181 142.074,387.997 141.921 C 387.834 141.786,387.701 141.547,387.701 141.390 C 387.701 141.233,387.538 140.839,387.338 140.514 C 387.138 140.190,386.919 139.541,386.851 139.073 C 386.784 138.605,386.603 138.027,386.450 137.790 C 386.297 137.553,386.216 137.288,386.270 137.201 C 386.324 137.113,386.201 136.892,385.998 136.708 C 385.744 136.478,385.680 136.282,385.793 136.081 C 385.904 135.881,385.779 135.459,385.399 134.757 C 385.092 134.190,384.879 133.626,384.926 133.504 C 384.973 133.382,384.880 132.988,384.718 132.630 C 384.557 132.271,384.440 131.908,384.459 131.823 C 384.477 131.738,384.320 131.450,384.110 131.183 C 383.900 130.915,383.728 130.577,383.728 130.431 C 383.728 130.286,383.590 129.957,383.423 129.702 C 383.255 129.446,383.170 129.103,383.232 128.939 C 383.296 128.774,383.138 128.335,382.875 127.948 C 382.615 127.566,382.403 127.140,382.403 127.000 C 382.403 126.861,382.270 126.614,382.108 126.452 C 381.946 126.290,381.861 126.033,381.920 125.880 C 381.979 125.728,381.824 125.207,381.577 124.722 C 380.852 123.303,380.533 122.554,380.394 121.949 C 380.322 121.637,380.107 121.178,379.914 120.930 C 379.722 120.682,379.565 120.374,379.565 120.247 C 379.565 120.119,379.352 119.701,379.092 119.318 C 378.832 118.935,378.619 118.538,378.619 118.436 C 378.619 118.335,378.419 117.934,378.175 117.546 C 377.932 117.158,377.770 116.728,377.817 116.590 C 377.864 116.453,377.638 115.915,377.314 115.395 C 376.991 114.875,376.727 114.349,376.727 114.225 C 376.727 114.102,376.429 113.582,376.064 113.069 C 375.678 112.526,375.402 111.912,375.402 111.595 C 375.402 111.297,375.318 110.950,375.216 110.825 C 374.244 109.633,374.008 109.282,373.987 108.999 C 373.974 108.818,373.611 108.155,373.181 107.525 C 372.718 106.846,372.435 106.236,372.486 106.028 C 372.540 105.806,372.151 105.091,371.429 104.088 C 370.665 103.028,370.321 102.386,370.393 102.159 C 370.463 101.939,370.213 101.415,369.688 100.680 C 369.240 100.055,368.491 98.980,368.023 98.292 C 365.775 94.991,365.903 95.072,364.522 96.081 ",stroke:"none",fill:"#d1dc31","fill-rule":"evenodd"}),React.createElement("path",{id:"path10",d:"",stroke:"none",fill:"#99ff33","fill-rule":"evenodd"}),React.createElement("path",{id:"path11",d:"M85.380 215.516 C 85.380 215.880,85.419 216.029,85.466 215.847 C 85.514 215.665,85.514 215.367,85.466 215.184 C 85.419 215.002,85.380 215.151,85.380 215.516 ",stroke:"none",fill:"#ffff00","fill-rule":"evenodd"})));var f=u;function d(){return(d=Object.assign||function(C){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(C[n]=t[n])}return C}).apply(this,arguments)}var s=wp.i18n.__,p=wp.element.RawHTML,h=wp.blocks.registerBlockType,y=wp.data.withSelect,g=lodash.omit,b=React.memo,m=y(function(C,e){return{Freeform:C("core/blocks").getBlockType("core/freeform")}})(b(function(C){var e=g(C,["Freeform"]),t=c(jQuery,C.Freeform.edit);return React.createElement(t,d({},e,{isSelected:!0}))}));h("imagely/nextgen-gallery",{title:s("NextGEN Gallery"),desription:s("A block for adding NextGEN Galleries."),icon:f.nextgen,category:"common",attributes:{content:{type:"string",source:"html"}},supports:{className:!1,customClassName:!1},edit:m,save:function(C){var e=C.attributes.content;return React.createElement(p,null,e)}})}]);
2
  //# sourceMappingURL=block.min.js.map
products/photocrati_nextgen/modules/nextgen_block/static/build/block.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./build/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_block/static/src/edit.min.js","webpack:///./build/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_block/static/src/icons.min.js","webpack:///./build/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_block/static/src/block.min.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","wp","i18n","__","createNggEditComponent","memoize","lodash","$","Freeform","_Freeform","NggEditor","props","_this","_classCallCheck","this","_possibleConstructorReturn","_getPrototypeOf","openIGW","_assertThisInitialized","updateContent","hasGallery","toggleAddGalleryBtn","_inherits","_createClass","attributes","content","length","_get","ref","addClass","siblings","hide","removeClass","show","setAttributes","editor","on","_ref","shortcode","execCommand","React","createElement","className","onClick","ngg_tinymce_plugin","button_label","icons","nextgen","id","version","width","height","viewBox","stroke","fill","fill-rule","RawHTML","element","registerBlockType","blocks","withSelect","data","omit","memo","edit","select","getBlockType","withFreeform","isSelected","editProps","NggEdit","jQuery","title","desription","icon","category","type","source","supports","customClassName","save"],"mappings":"aACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,aAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EAAAsB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAArB,EAAAqB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFA1B,EAAAkB,EAAAO,GACAX,OAAAC,eAAAU,EAAA,WAAyCT,YAAA,EAAAK,UACzC,EAAAE,GAAA,iBAAAF,EAAA,QAAAM,KAAAN,EAAArB,EAAAU,EAAAe,EAAAE,EAAA,SAAAA,GAAgH,OAAAN,EAAAM,IAAqBC,KAAA,KAAAD,IACrI,OAAAF,GAIAzB,EAAA6B,EAAA,SAAA1B,GACA,IAAAS,EAAAT,KAAAqB,WACA,WAA2B,OAAArB,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAH,EAAAU,EAAAE,EAAA,IAAAA,GACAA,GAIAZ,EAAAa,EAAA,SAAAiB,EAAAC,GAAsD,OAAAjB,OAAAkB,UAAAC,eAAA1B,KAAAuB,EAAAC,IAGtD/B,EAAAkC,EAAA,GAIAlC,IAAAmC,EAAA,mjCClFsBC,GAAGC,KAAjBC,OAIKC,GAAyBC,EAHhBC,OAAdD,SAGsC,SAACE,EAAGC,GAoE9C,OApE2D,SAAAC,GAEvD,SAAAC,EAAYC,GAAO,IAAAC,EAAA,mGAAAC,CAAAC,KAAAJ,IACfE,uEAAAG,CAAAD,KAAAE,EAAAN,GAAAtC,KAAA0C,KAAMH,KACDM,QAAqBL,EAAKK,QAAQxB,KAAbyB,IAAAN,KAC1BA,EAAKO,cAAqBP,EAAKO,cAAc1B,KAAnByB,IAAAN,KAC1BA,EAAKQ,WAAqBR,EAAKQ,WAAW3B,KAAhByB,IAAAN,KAC1BA,EAAKS,oBAAqBT,EAAKS,oBAAoB5B,KAAzByB,IAAAN,KALXA,EAFoC,yOAAAU,CAAAZ,EACnCF,iDADmCe,CAAAb,IAAAlB,IAAA,aAAAN,MAAA,WAWnD,OAAO4B,KAAKH,MAAMa,WAAWC,SAAWX,KAAKH,MAAMa,WAAWC,QAAQC,OAAS,KAX5BlC,IAAA,oBAAAN,MAAA,WAenDyC,EAAAX,EAAAN,EAAAb,WAAA,oBAAAiB,MAAA1C,KAAA0C,MACAP,EAAEO,KAAKc,KAAKC,SAAS,oBAAoBA,SAAS,wBAClDf,KAAKO,yBAjB8C7B,IAAA,qBAAAN,MAAA,WAsBnD4B,KAAKO,yBAtB8C7B,IAAA,sBAAAN,MAAA,WA2B/C4B,KAAKH,MAAMa,WAAWC,SACtBlB,EAAEO,KAAKc,KAAKC,SAAS,UACrBtB,EAAEO,KAAKc,KAAKE,SAAS,yBAAyBC,SAG9CxB,EAAEO,KAAKc,KAAKI,YAAY,UACxBzB,EAAEO,KAAKc,KAAKE,SAAS,yBAAyBG,WAjCCzC,IAAA,gBAAAN,MAAA,SAqCzCuC,GACVX,KAAKH,MAAMuB,eAAeT,eAtCyBjC,IAAA,UAAAN,MAAA,SAyC/CiD,GACJR,EAAAX,EAAAN,EAAAb,WAAA,UAAAiB,MAAA1C,KAAA0C,KAAcqB,GACd,IAAMhB,EAAoBL,KAAKK,cAAc1B,KAAKqB,MAIlDqB,EAAOC,GAAG,cAAe,kBAAMjB,EAAc,MAC7CgB,EAAOC,GAAG,eAAgB,SAAAC,GAAA,IAAEC,EAAFD,EAAEC,UAAF,OAAiBnB,EAAcmB,QAhDN9C,IAAA,UAAAN,MAAA,WAoDnD4B,KAAKqB,OAAOI,YAAY,yBApD2B/C,IAAA,SAAAN,MAAA,WAyDnD,OADayC,EAAAX,EAAAN,EAAAb,WAAA,SAAAiB,MAAA1C,KAAA0C,MAGT0B,MAAAC,cAAA,OAAKC,UAAU,wBACXF,MAAAC,cAAA,OAAKC,UAAU,kBAAkBC,QAAS7B,KAAKG,SAC1C2B,mBAAmB1C,KAAK2C,oBA7DcnC,EAAA,KCJzDoC,KAENA,EAAMC,QACNP,MAAAC,cAAA,OAAKO,GAAG,MAAMC,QAAQ,MAAMC,MAAM,MAAMC,OAAO,oBAAoBC,QAAQ,6BAC3EZ,MAAAC,cAAA,KAAGO,GAAG,QAAOR,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,GAAG8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,GAAG8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,4NAA4N8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,GAAG8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,6liBAA6liB8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,GAAG8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,2oyBAA2oyB8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,07pBAA07pB8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,GAAG8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,i3pBAAi3pB8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,SAASzE,EAAE,GAAG8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,SAASzE,EAAE,gKAAgK8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,cAGpxqFT,QCHP3C,EAAwBF,GAAGC,KAA3BC,GACAqD,EAAqCvD,GAAGwD,QAAxCD,QACAE,EAAsCzD,GAAG0D,OAAzCD,kBACAE,EAAsC3D,GAAG4D,KAAzCD,WACAE,EAAsCxD,OAAtCwD,KACAC,EAAsCvB,MAAtCuB,KAUFC,EAPeJ,EAAW,SAACK,EAAQtD,GACrC,OACIH,SAAUyD,EAAO,eAAeC,aAAa,mBAKxCC,CAAaJ,EAAK,SAAApD,GAC3BA,EAAMyD,YAAa,EACnB,IAAMC,EAAaP,EAAKnD,GAAQ,aAC1B2D,EAAUlE,EAAuBmE,OAAQ5D,EAAMH,SAASwD,MAC9D,OAAOxB,MAAAC,cAAC6B,EAAYD,MAIxBX,EAAkB,2BAEdc,MAAOrE,EAAG,mBAEVsE,WAAYtE,EAAG,yCAEfuE,KAAM5B,EAAMC,QAEZ4B,SAAU,SAEVnD,YACIC,SACImD,KAAM,SACNC,OAAQ,SAIhBC,UACIpC,WAAW,EACXqC,iBAAiB,GAGrBf,OAEAgB,KAxByC,SAAA3C,GAwBlB,IACXZ,EADWY,EAAfb,WACIC,QACR,OAAOe,MAAAC,cAACe,EAAD,KAAW/B","file":"block.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","const { __ } = wp.i18n;\nconst { memoize } = lodash\n\n// Given jQuery and the Freeform block settings, creates the Ngg Editor Component\nexport const createNggEditComponent = memoize(($, Freeform) => {\n class NggEditor extends Freeform {\n constructor(props) {\n super(props)\n this.openIGW = this.openIGW.bind(this)\n this.updateContent = this.updateContent.bind(this)\n this.hasGallery = this.hasGallery.bind(this)\n this.toggleAddGalleryBtn= this.toggleAddGalleryBtn.bind(this)\n }\n\n hasGallery() {\n return this.props.attributes.content && this.props.attributes.content.length > 0\n }\n\n componentDidMount() {\n super.componentDidMount()\n $(this.ref).addClass('freeform-toolbar').addClass('ngg-freeform-toolbar')\n this.toggleAddGalleryBtn();\n\n }\n\n componentDidUpdate() {\n this.toggleAddGalleryBtn();\n }\n\n toggleAddGalleryBtn() {\n // Determine the UI state\n if (this.props.attributes.content) {\n $(this.ref).addClass('hidden');\n $(this.ref).siblings('.add-ngg-gallery-wrap').hide()\n }\n else {\n $(this.ref).removeClass('hidden');\n $(this.ref).siblings('.add-ngg-gallery-wrap').show()\n }\n }\n\n updateContent(content) {\n this.props.setAttributes({content}) \n }\n\n onSetup(editor){\n super.onSetup(editor);\n const updateContent = this.updateContent.bind(this)\n\n // When NGG is added or removed, we must set the classic \"content\" attribute, \n // which will re-render our component\n editor.on('ngg-removed', () => updateContent(\"\"))\n editor.on('ngg-inserted', ({shortcode}) => updateContent(shortcode))\n }\n\n openIGW() {\n this.editor.execCommand('ngg_attach_to_post')\n }\n\n render(){\n const classic = super.render()\n return [\n classic,\n <div className=\"add-ngg-gallery-wrap\">\n <div className=\"add-ngg-gallery\" onClick={this.openIGW}>\n {ngg_tinymce_plugin.i18n.button_label}\n </div>\n </div>\n ]\n }\n }\n\n return NggEditor\n})","const icons = {};\n\nicons.nextgen =\n<svg id=\"svg\" version=\"1.1\" width=\"400\" height=\"385.8088930936613\" viewBox=\"0 0 400 385.8088930936613\">\n<g id=\"svgg\"><path id=\"path0\" d=\"\" stroke=\"none\" fill=\"#000055\" fill-rule=\"evenodd\"></path><path id=\"path1\" d=\"\" stroke=\"none\" fill=\"#002424\" fill-rule=\"evenodd\"></path><path id=\"path2\" d=\"M194.418 152.698 C 154.152 157.677,135.139 203.873,160.388 235.383 C 179.730 259.522,217.168 260.458,237.772 237.316 C 261.954 210.156,250.860 167.167,216.592 155.239 C 210.224 153.023,200.657 151.926,194.418 152.698 \" stroke=\"none\" fill=\"#143650\" fill-rule=\"evenodd\"></path><path id=\"path3\" d=\"\" stroke=\"none\" fill=\"#555500\" fill-rule=\"evenodd\"></path><path id=\"path4\" d=\"M109.430 274.467 C 109.368 274.629,109.202 274.717,109.061 274.663 C 108.920 274.609,108.715 274.732,108.606 274.936 C 108.496 275.140,108.286 275.307,108.139 275.307 C 107.992 275.307,107.796 275.441,107.705 275.605 C 107.536 275.907,106.895 276.338,106.291 276.556 C 106.109 276.622,105.960 276.753,105.960 276.848 C 105.960 276.942,105.747 277.101,105.487 277.200 C 105.227 277.299,105.014 277.467,105.014 277.573 C 105.014 277.680,104.920 277.767,104.805 277.767 C 104.690 277.767,104.285 278.009,103.906 278.303 C 103.527 278.598,103.068 278.894,102.886 278.960 C 102.703 279.026,102.554 279.168,102.554 279.275 C 102.554 279.382,102.427 279.470,102.272 279.470 C 102.117 279.470,101.884 279.640,101.754 279.849 C 101.624 280.057,101.367 280.227,101.184 280.227 C 101.001 280.227,100.851 280.314,100.851 280.421 C 100.851 280.528,100.639 280.696,100.378 280.795 C 100.118 280.894,99.905 281.071,99.905 281.189 C 99.905 281.306,99.793 281.360,99.655 281.307 C 99.518 281.254,99.304 281.373,99.181 281.570 C 99.057 281.768,98.838 281.930,98.694 281.930 C 98.550 281.930,98.383 282.059,98.322 282.217 C 98.262 282.374,97.997 282.585,97.734 282.685 C 97.471 282.785,97.256 282.954,97.256 283.061 C 97.256 283.167,97.095 283.254,96.898 283.254 C 96.701 283.254,96.491 283.382,96.431 283.538 C 96.371 283.694,96.201 283.822,96.053 283.822 C 95.904 283.822,95.731 283.959,95.667 284.126 C 95.603 284.292,95.438 284.386,95.302 284.334 C 95.165 284.281,94.952 284.400,94.829 284.598 C 94.705 284.796,94.529 284.957,94.437 284.957 C 94.344 284.957,93.996 285.213,93.661 285.525 C 93.327 285.837,92.965 286.093,92.857 286.093 C 92.748 286.093,92.296 286.391,91.851 286.755 C 91.407 287.119,90.958 287.417,90.854 287.417 C 90.750 287.417,90.637 287.481,90.602 287.559 C 90.471 287.855,89.293 288.565,89.116 288.455 C 89.014 288.392,88.931 288.476,88.931 288.641 C 88.931 288.805,88.718 289.021,88.458 289.120 C 88.198 289.219,87.985 289.392,87.985 289.505 C 87.985 289.617,87.602 289.879,87.133 290.086 C 86.665 290.293,86.282 290.546,86.282 290.647 C 86.282 290.749,86.090 290.915,85.856 291.017 C 85.220 291.292,84.692 291.646,84.522 291.911 C 84.439 292.041,84.245 292.148,84.091 292.148 C 83.936 292.148,83.761 292.275,83.701 292.431 C 83.641 292.588,83.504 292.715,83.396 292.715 C 83.287 292.715,82.835 293.013,82.391 293.377 C 81.946 293.742,81.493 294.040,81.384 294.040 C 81.276 294.040,81.097 294.207,80.988 294.411 C 80.871 294.629,80.673 294.738,80.508 294.675 C 80.337 294.609,80.227 294.677,80.227 294.850 C 80.227 295.006,80.014 295.187,79.754 295.253 C 79.494 295.318,79.281 295.455,79.281 295.557 C 79.281 295.659,79.162 295.743,79.017 295.743 C 78.872 295.743,78.707 295.864,78.650 296.012 C 78.594 296.160,78.223 296.433,77.826 296.619 C 77.429 296.804,76.994 297.108,76.858 297.295 C 76.722 297.482,76.488 297.635,76.337 297.635 C 76.187 297.635,76.064 297.715,76.064 297.814 C 76.064 297.990,75.336 298.457,74.693 298.693 C 74.510 298.760,74.361 298.892,74.361 298.986 C 74.361 299.081,74.170 299.241,73.936 299.342 C 73.345 299.597,72.922 299.894,72.049 300.662 C 71.636 301.026,71.221 301.325,71.127 301.325 C 71.032 301.325,70.662 301.559,70.303 301.845 C 69.945 302.131,69.562 302.365,69.452 302.365 C 69.342 302.365,69.253 302.449,69.253 302.551 C 69.253 302.653,69.040 302.790,68.780 302.855 C 68.519 302.920,68.307 303.102,68.307 303.259 C 68.307 303.451,68.183 303.512,67.928 303.446 C 67.680 303.381,67.550 303.440,67.550 303.617 C 67.550 303.766,67.337 303.969,67.077 304.068 C 66.816 304.167,66.604 304.337,66.604 304.447 C 66.604 304.556,66.391 304.726,66.131 304.825 C 65.870 304.924,65.658 305.092,65.658 305.199 C 65.658 305.305,65.487 305.393,65.279 305.393 C 65.071 305.393,64.901 305.480,64.901 305.587 C 64.901 305.693,64.688 305.861,64.428 305.960 C 64.167 306.059,63.955 306.227,63.955 306.334 C 63.955 306.441,63.784 306.528,63.576 306.528 C 63.368 306.528,63.198 306.615,63.198 306.722 C 63.198 306.828,62.985 306.997,62.725 307.096 C 62.465 307.194,62.252 307.361,62.252 307.465 C 62.252 307.570,61.907 307.831,61.486 308.046 C 61.064 308.261,60.672 308.561,60.614 308.712 C 60.556 308.864,60.389 308.988,60.243 308.988 C 60.097 308.988,59.835 309.154,59.662 309.356 C 59.488 309.559,59.285 309.687,59.210 309.641 C 59.135 309.595,58.800 309.812,58.467 310.124 C 58.133 310.436,57.748 310.691,57.612 310.691 C 57.475 310.691,57.335 310.754,57.301 310.833 C 57.184 311.095,55.380 312.394,55.132 312.394 C 54.996 312.394,54.803 312.547,54.703 312.735 C 54.602 312.923,54.174 313.242,53.752 313.445 C 53.330 313.647,52.983 313.879,52.982 313.959 C 52.981 314.040,52.789 314.189,52.554 314.290 C 51.958 314.548,51.520 314.853,50.731 315.562 C 50.355 315.900,49.942 316.176,49.812 316.177 C 49.683 316.177,49.476 316.340,49.353 316.537 C 49.229 316.735,49.027 316.858,48.903 316.810 C 48.779 316.763,48.626 316.856,48.564 317.018 C 48.502 317.181,48.339 317.313,48.203 317.313 C 48.067 317.313,47.695 317.547,47.375 317.833 C 46.625 318.507,45.782 319.104,45.364 319.259 C 45.182 319.327,45.033 319.470,45.033 319.578 C 45.033 319.685,44.903 319.773,44.743 319.773 C 44.584 319.773,44.405 319.901,44.345 320.057 C 44.285 320.213,44.075 320.341,43.878 320.341 C 43.622 320.341,43.519 320.476,43.519 320.814 C 43.519 321.074,43.587 321.287,43.670 321.287 C 43.753 321.287,44.147 321.798,44.545 322.422 C 44.942 323.046,45.343 323.557,45.434 323.557 C 45.526 323.557,45.601 323.655,45.601 323.774 C 45.601 323.894,45.899 324.355,46.263 324.799 C 46.627 325.244,46.925 325.700,46.925 325.812 C 46.925 325.925,47.010 326.017,47.114 326.017 C 47.219 326.017,47.304 326.132,47.304 326.272 C 47.304 326.411,47.474 326.680,47.682 326.868 C 47.890 327.057,48.061 327.331,48.061 327.477 C 48.061 327.634,48.209 327.719,48.420 327.685 C 48.728 327.634,49.763 328.480,49.763 328.783 C 49.763 328.837,49.976 329.160,50.237 329.501 C 50.497 329.842,50.710 330.217,50.710 330.335 C 50.710 330.610,51.587 331.190,51.802 331.058 C 51.891 331.002,52.123 331.229,52.316 331.562 C 52.509 331.894,52.780 332.235,52.918 332.318 C 53.056 332.401,53.169 332.587,53.169 332.731 C 53.169 332.875,53.347 333.049,53.565 333.118 C 53.783 333.187,54.082 333.533,54.230 333.888 C 54.378 334.242,54.578 334.532,54.675 334.532 C 54.772 334.532,54.964 334.766,55.102 335.052 C 55.239 335.338,55.492 335.574,55.663 335.575 C 56.001 335.578,56.764 336.191,56.764 336.461 C 56.764 336.713,57.567 337.748,57.763 337.748 C 57.981 337.748,58.642 338.535,58.650 338.804 C 58.654 338.917,58.888 339.130,59.171 339.277 C 59.786 339.598,61.757 341.524,61.929 341.973 C 61.996 342.147,62.168 342.289,62.311 342.289 C 62.454 342.289,62.725 342.577,62.915 342.929 C 63.125 343.319,63.542 343.693,63.985 343.889 C 64.385 344.065,64.711 344.333,64.711 344.485 C 64.711 344.637,64.882 344.825,65.091 344.902 C 65.299 344.979,65.628 345.336,65.821 345.696 C 66.014 346.056,66.335 346.394,66.535 346.449 C 66.972 346.567,68.307 347.617,68.307 347.843 C 68.307 348.075,69.693 349.274,69.850 349.177 C 69.923 349.132,70.037 349.267,70.103 349.477 C 70.170 349.687,70.389 349.858,70.590 349.858 C 70.791 349.858,70.956 349.924,70.956 350.004 C 70.956 350.370,72.658 351.980,72.934 351.874 C 73.117 351.804,73.226 351.868,73.226 352.046 C 73.226 352.202,73.370 352.385,73.545 352.452 C 73.721 352.520,74.109 352.853,74.408 353.193 C 74.727 353.556,75.063 353.768,75.222 353.707 C 75.385 353.645,75.552 353.757,75.637 353.986 C 75.778 354.360,77.338 355.718,77.633 355.722 C 77.925 355.725,78.903 356.556,78.903 356.800 C 78.903 356.937,78.988 357.048,79.093 357.048 C 79.198 357.048,79.469 357.261,79.695 357.521 C 79.921 357.781,80.240 357.997,80.403 357.999 C 80.566 358.002,81.069 358.343,81.520 358.756 C 81.972 359.170,82.451 359.508,82.586 359.508 C 82.721 359.508,82.876 359.678,82.931 359.886 C 82.988 360.104,83.189 360.265,83.404 360.265 C 83.627 360.265,83.821 360.428,83.883 360.668 C 83.961 360.965,84.092 361.045,84.379 360.970 C 84.624 360.906,84.768 360.959,84.768 361.114 C 84.768 361.353,85.288 361.680,85.572 361.619 C 85.650 361.603,85.714 361.717,85.714 361.873 C 85.714 362.029,85.864 362.157,86.048 362.157 C 86.231 362.157,86.466 362.349,86.570 362.583 C 86.674 362.817,86.908 362.997,87.090 362.982 C 87.272 362.967,87.686 363.202,88.008 363.503 C 88.331 363.805,88.863 364.179,89.191 364.334 C 89.518 364.490,89.998 364.809,90.257 365.043 C 90.517 365.277,90.814 365.478,90.918 365.489 C 91.452 365.547,91.958 365.827,91.958 366.064 C 91.958 366.211,92.107 366.386,92.289 366.453 C 92.472 366.520,92.693 366.695,92.781 366.842 C 92.883 367.012,93.105 367.067,93.396 366.994 C 93.646 366.932,93.851 366.963,93.851 367.063 C 93.851 367.400,94.783 368.258,95.042 368.158 C 95.182 368.105,95.398 368.222,95.521 368.420 C 95.645 368.618,95.905 368.780,96.100 368.780 C 96.294 368.780,96.559 368.907,96.689 369.063 C 96.818 369.219,97.049 369.347,97.202 369.347 C 97.355 369.347,97.828 369.645,98.254 370.009 C 98.679 370.374,99.129 370.672,99.254 370.672 C 99.379 370.672,99.586 370.798,99.714 370.953 C 99.843 371.108,100.024 371.189,100.116 371.131 C 100.208 371.074,100.284 371.112,100.284 371.214 C 100.284 371.425,101.342 371.996,101.732 371.996 C 101.872 371.996,101.965 372.103,101.939 372.233 C 101.912 372.372,102.130 372.493,102.470 372.526 C 102.801 372.558,103.360 372.861,103.781 373.235 C 104.185 373.594,104.655 373.888,104.826 373.888 C 104.997 373.888,105.342 374.106,105.592 374.372 C 105.873 374.671,106.180 374.821,106.396 374.765 C 106.594 374.713,106.953 374.853,107.220 375.085 C 107.480 375.311,107.751 375.501,107.820 375.506 C 108.117 375.528,108.913 375.843,109.149 376.032 C 109.289 376.145,109.518 376.254,109.657 376.274 C 109.796 376.294,110.249 376.584,110.664 376.917 C 111.079 377.251,111.501 377.472,111.602 377.410 C 111.704 377.348,111.837 377.429,111.899 377.591 C 111.962 377.753,112.093 377.836,112.191 377.776 C 112.289 377.715,112.694 377.851,113.091 378.077 C 114.435 378.844,114.758 378.995,115.057 378.996 C 115.221 378.997,115.558 379.214,115.807 379.478 C 116.071 379.759,116.425 379.938,116.658 379.907 C 116.877 379.879,117.263 379.987,117.516 380.147 C 117.769 380.308,118.444 380.635,119.016 380.874 C 119.588 381.114,120.203 381.438,120.381 381.595 C 120.559 381.753,120.847 381.827,121.021 381.760 C 121.216 381.685,121.596 381.838,122.021 382.162 C 122.398 382.449,122.810 382.660,122.938 382.631 C 123.065 382.602,123.363 382.702,123.600 382.854 C 123.837 383.006,124.201 383.158,124.409 383.192 C 124.617 383.226,124.903 383.410,125.045 383.601 C 125.219 383.834,125.444 383.912,125.735 383.839 C 125.999 383.772,126.203 383.825,126.261 383.974 C 126.364 384.244,127.909 384.408,127.909 384.150 C 127.909 384.061,128.172 383.720,128.493 383.391 C 128.979 382.894,129.056 382.698,128.951 382.220 C 128.843 381.728,128.872 381.664,129.154 381.773 C 129.421 381.875,129.463 381.821,129.376 381.489 C 129.294 381.175,129.353 381.079,129.625 381.079 C 129.919 381.079,129.961 380.981,129.868 380.513 C 129.795 380.146,129.862 379.784,130.062 379.479 C 130.231 379.221,130.369 378.916,130.369 378.801 C 130.369 378.686,130.500 378.461,130.659 378.301 C 130.886 378.075,130.901 377.952,130.726 377.742 C 130.546 377.525,130.624 377.364,131.121 376.920 C 131.619 376.476,131.716 376.274,131.618 375.885 C 131.552 375.619,131.565 375.402,131.649 375.402 C 131.907 375.402,132.450 374.330,132.450 373.821 C 132.450 373.241,132.798 372.415,133.253 371.913 C 133.436 371.711,133.568 371.456,133.546 371.346 C 133.477 370.988,133.777 370.104,133.968 370.104 C 134.070 370.104,134.153 369.891,134.153 369.631 C 134.153 369.354,134.251 369.178,134.390 369.205 C 134.539 369.235,134.621 369.043,134.613 368.685 C 134.606 368.373,134.720 368.028,134.867 367.918 C 135.013 367.809,135.108 367.596,135.077 367.445 C 135.005 367.096,135.651 365.752,135.891 365.752 C 135.991 365.752,136.055 365.561,136.034 365.326 C 135.986 364.807,136.396 363.671,136.632 363.671 C 136.725 363.671,136.802 363.467,136.802 363.218 C 136.802 362.969,136.939 362.713,137.106 362.649 C 137.318 362.567,137.376 362.395,137.297 362.082 C 137.226 361.799,137.288 361.546,137.466 361.399 C 137.621 361.270,137.748 361.086,137.748 360.989 C 137.748 360.893,137.919 360.462,138.127 360.031 C 138.335 359.600,138.505 359.088,138.505 358.894 C 138.505 358.699,138.590 358.592,138.694 358.657 C 138.804 358.724,138.884 358.547,138.884 358.239 C 138.884 357.944,139.096 357.390,139.357 357.008 C 139.617 356.625,139.830 356.124,139.830 355.895 C 139.830 355.368,140.756 353.453,141.011 353.453 C 141.121 353.453,141.154 353.217,141.089 352.892 C 141.008 352.486,141.062 352.282,141.283 352.159 C 141.484 352.046,141.552 351.844,141.480 351.570 C 141.399 351.260,141.440 351.179,141.641 351.256 C 141.842 351.334,141.911 351.196,141.911 350.715 C 141.911 350.360,141.990 350.021,142.086 349.962 C 142.182 349.902,142.316 349.599,142.385 349.288 C 142.453 348.977,142.613 348.723,142.741 348.723 C 142.871 348.723,143.126 348.120,143.321 347.351 C 143.512 346.596,143.784 345.845,143.925 345.680 C 144.066 345.516,144.182 345.249,144.182 345.086 C 144.182 344.923,144.315 344.739,144.479 344.676 C 144.671 344.602,144.735 344.434,144.660 344.198 C 144.596 343.997,144.713 343.465,144.918 343.014 C 145.572 341.583,145.955 340.687,145.995 340.492 C 146.130 339.835,146.342 339.451,146.569 339.451 C 146.727 339.451,146.833 339.245,146.837 338.931 C 146.840 338.645,146.966 338.247,147.117 338.048 C 147.304 337.801,147.332 337.612,147.204 337.458 C 147.074 337.302,147.105 337.156,147.301 336.993 C 147.459 336.863,147.588 336.596,147.588 336.401 C 147.588 336.205,147.673 336.045,147.777 336.045 C 147.881 336.045,147.966 335.837,147.966 335.583 C 147.966 335.329,148.129 335.006,148.329 334.866 C 148.539 334.719,148.741 334.286,148.808 333.839 C 148.871 333.414,149.091 332.719,149.296 332.294 C 149.792 331.268,149.789 330.258,149.290 329.991 C 149.082 329.879,148.912 329.700,148.912 329.593 C 148.912 329.485,148.699 329.119,148.439 328.777 C 148.179 328.436,147.966 328.086,147.966 327.998 C 147.966 327.911,147.625 327.435,147.209 326.941 C 146.793 326.448,146.452 325.953,146.452 325.841 C 146.452 325.730,146.386 325.639,146.306 325.639 C 146.226 325.639,145.991 325.321,145.786 324.934 C 145.580 324.546,145.284 324.090,145.128 323.921 C 144.619 323.370,144.182 322.798,144.182 322.684 C 144.182 322.622,143.926 322.248,143.614 321.854 C 143.302 321.460,143.046 321.041,143.046 320.922 C 143.046 320.804,142.919 320.658,142.763 320.598 C 142.606 320.538,142.479 320.406,142.479 320.305 C 142.479 320.203,142.181 319.757,141.816 319.312 C 141.452 318.868,141.154 318.404,141.154 318.281 C 141.154 318.158,141.026 318.009,140.870 317.949 C 140.714 317.889,140.587 317.719,140.587 317.571 C 140.587 317.423,140.459 317.252,140.303 317.192 C 140.147 317.132,140.019 317.004,140.019 316.907 C 140.019 316.698,139.230 315.544,139.026 315.453 C 138.947 315.418,138.884 315.282,138.884 315.151 C 138.884 315.019,138.713 314.758,138.505 314.570 C 138.297 314.381,138.127 314.113,138.127 313.973 C 138.127 313.833,138.040 313.718,137.933 313.718 C 137.826 313.718,137.658 313.505,137.559 313.245 C 137.460 312.985,137.306 312.772,137.216 312.772 C 137.067 312.772,136.696 312.128,136.642 311.775 C 136.630 311.695,136.443 311.440,136.228 311.208 C 135.601 310.532,134.359 308.771,134.237 308.384 C 134.175 308.189,133.939 307.836,133.713 307.599 C 133.487 307.362,133.174 306.971,133.018 306.730 C 132.862 306.489,132.644 306.196,132.534 306.079 C 132.424 305.962,132.169 305.573,131.967 305.216 C 131.764 304.858,131.450 304.390,131.268 304.175 C 130.563 303.344,130.452 303.186,130.089 302.503 C 129.884 302.115,129.647 301.798,129.564 301.798 C 129.481 301.798,129.333 301.585,129.234 301.325 C 129.135 301.064,128.967 300.851,128.860 300.851 C 128.753 300.851,128.666 300.737,128.666 300.597 C 128.666 300.457,128.496 300.188,128.288 300.000 C 128.079 299.812,127.909 299.579,127.909 299.484 C 127.909 299.389,127.803 299.200,127.673 299.064 C 127.543 298.928,127.308 298.626,127.152 298.393 C 126.996 298.160,126.734 297.788,126.570 297.566 C 126.405 297.344,126.216 297.013,126.150 296.831 C 126.083 296.649,125.950 296.500,125.853 296.500 C 125.756 296.500,125.489 296.138,125.260 295.695 C 125.030 295.253,124.723 294.823,124.578 294.740 C 124.433 294.657,124.314 294.465,124.314 294.314 C 124.314 294.163,124.226 294.040,124.119 294.040 C 124.012 294.040,123.869 293.891,123.802 293.709 C 123.735 293.526,123.503 293.122,123.287 292.810 C 123.071 292.498,122.809 292.106,122.705 291.939 C 122.487 291.589,121.384 290.080,121.101 289.743 C 120.995 289.617,120.908 289.459,120.908 289.392 C 120.908 289.289,119.878 287.898,119.207 287.094 C 119.102 286.968,119.016 286.810,119.016 286.743 C 119.016 286.675,118.761 286.298,118.448 285.904 C 118.136 285.509,117.881 285.097,117.881 284.987 C 117.881 284.877,117.774 284.719,117.644 284.636 C 117.344 284.444,116.556 283.327,116.556 283.093 C 116.556 282.996,116.429 282.868,116.272 282.808 C 116.116 282.748,115.989 282.577,115.989 282.429 C 115.989 282.281,115.861 282.111,115.705 282.051 C 115.549 281.991,115.421 281.851,115.421 281.739 C 115.421 281.511,114.646 280.356,114.428 280.259 C 114.350 280.224,114.286 280.079,114.286 279.937 C 114.286 279.795,114.179 279.610,114.049 279.527 C 113.749 279.335,112.961 278.218,112.961 277.984 C 112.961 277.887,112.833 277.759,112.677 277.699 C 112.521 277.639,112.394 277.503,112.394 277.396 C 112.394 276.953,110.065 274.176,109.691 274.173 C 109.610 274.173,109.493 274.305,109.430 274.467 \" stroke=\"none\" fill=\"#8ca516\" fill-rule=\"evenodd\"></path><path id=\"path5\" d=\"\" stroke=\"none\" fill=\"#6db600\" fill-rule=\"evenodd\"></path><path id=\"path6\" d=\"M79.186 45.256 C 78.978 45.372,78.369 45.838,77.832 46.291 C 77.295 46.744,76.809 47.114,76.752 47.114 C 76.696 47.114,76.441 47.306,76.186 47.540 C 75.500 48.170,75.046 48.533,74.934 48.540 C 74.693 48.557,73.983 49.116,73.983 49.289 C 73.982 49.611,72.116 51.366,71.950 51.200 C 71.890 51.140,71.722 51.260,71.577 51.468 C 71.431 51.675,71.190 51.845,71.039 51.845 C 70.889 51.845,70.766 52.019,70.766 52.232 C 70.766 52.464,70.539 52.748,70.200 52.942 C 69.888 53.119,69.633 53.328,69.632 53.406 C 69.632 53.484,69.461 53.548,69.253 53.548 C 69.044 53.548,68.874 53.634,68.874 53.739 C 68.874 53.992,67.915 55.061,67.688 55.061 C 67.590 55.061,67.342 55.274,67.137 55.535 C 66.933 55.795,66.647 56.008,66.502 56.008 C 66.357 56.008,66.137 56.197,66.013 56.429 C 65.743 56.933,65.537 57.138,64.871 57.564 C 64.594 57.741,64.126 58.227,63.830 58.644 C 63.452 59.177,63.194 59.371,62.961 59.300 C 62.776 59.244,62.630 59.297,62.630 59.421 C 62.630 59.747,61.733 60.786,61.150 61.136 C 60.865 61.307,60.668 61.576,60.699 61.751 C 60.730 61.922,60.634 62.062,60.487 62.062 C 60.249 62.062,59.039 63.359,58.877 63.788 C 58.843 63.879,58.688 63.955,58.533 63.955 C 58.258 63.955,57.711 64.387,57.711 64.603 C 57.711 64.663,57.561 64.867,57.379 65.056 C 57.197 65.246,56.793 65.714,56.482 66.097 C 56.170 66.480,55.804 66.793,55.668 66.793 C 55.532 66.793,55.296 67.091,55.144 67.455 C 54.992 67.819,54.762 68.121,54.633 68.125 C 54.505 68.130,53.463 69.275,52.318 70.671 C 51.173 72.067,50.086 73.262,49.903 73.326 C 49.719 73.390,49.605 73.501,49.649 73.573 C 49.805 73.824,49.216 74.409,48.921 74.296 C 48.711 74.216,48.627 74.303,48.625 74.604 C 48.622 75.122,48.429 75.402,48.074 75.402 C 47.926 75.402,47.741 75.638,47.663 75.927 C 47.586 76.216,47.349 76.642,47.137 76.874 C 46.126 77.977,44.276 80.266,44.276 80.414 C 44.276 80.505,44.106 80.634,43.898 80.700 C 43.690 80.766,43.519 80.985,43.519 81.186 C 43.519 81.387,43.390 81.701,43.233 81.883 C 41.478 83.908,40.527 85.119,40.618 85.210 C 40.679 85.271,40.378 85.740,39.948 86.253 C 39.519 86.766,39.167 87.281,39.167 87.396 C 39.167 87.512,39.040 87.606,38.884 87.606 C 38.728 87.606,38.600 87.763,38.600 87.954 C 38.600 88.146,38.324 88.625,37.988 89.019 C 37.651 89.413,37.374 89.838,37.373 89.964 C 37.371 90.090,36.944 90.679,36.424 91.275 C 35.904 91.870,35.500 92.441,35.527 92.542 C 35.554 92.644,35.398 92.916,35.181 93.147 C 34.964 93.378,34.676 93.822,34.542 94.134 C 34.408 94.447,34.074 94.941,33.800 95.232 C 33.526 95.524,33.302 95.856,33.302 95.971 C 33.302 96.086,33.089 96.459,32.829 96.800 C 32.569 97.141,32.356 97.527,32.356 97.657 C 32.356 97.788,32.194 98.070,31.996 98.285 C 31.656 98.654,31.110 99.547,30.515 100.706 C 30.370 100.990,30.171 101.272,30.073 101.332 C 29.976 101.392,29.896 101.592,29.896 101.776 C 29.896 101.960,29.683 102.310,29.423 102.554 C 29.163 102.799,28.950 103.139,28.950 103.311 C 28.950 103.483,28.745 103.816,28.495 104.051 C 28.245 104.286,27.983 104.780,27.914 105.149 C 27.845 105.518,27.539 106.085,27.233 106.410 C 26.928 106.735,26.716 107.099,26.761 107.220 C 26.806 107.340,26.678 107.587,26.477 107.769 C 26.276 107.951,26.112 108.252,26.112 108.438 C 26.112 108.624,26.032 108.825,25.934 108.886 C 25.725 109.015,25.166 110.097,25.166 110.374 C 25.166 110.480,25.049 110.701,24.908 110.865 C 24.766 111.029,24.497 111.573,24.310 112.072 C 24.124 112.572,23.805 113.098,23.602 113.240 C 23.388 113.390,23.291 113.594,23.372 113.724 C 23.448 113.848,23.409 114.012,23.285 114.089 C 23.161 114.166,23.040 114.357,23.017 114.513 C 22.994 114.669,22.842 115.001,22.679 115.251 C 22.516 115.500,22.320 115.918,22.245 116.178 C 22.005 117.008,21.524 117.971,21.276 118.117 C 21.144 118.196,20.979 118.600,20.908 119.016 C 20.838 119.432,20.703 119.773,20.608 119.773 C 20.513 119.773,20.435 119.909,20.435 120.075 C 20.435 120.390,19.954 121.350,19.531 121.878 C 19.395 122.047,19.304 122.260,19.328 122.351 C 19.423 122.710,19.048 123.830,18.710 124.192 C 18.514 124.402,18.354 124.722,18.354 124.902 C 18.354 125.081,18.265 125.258,18.156 125.294 C 18.048 125.331,17.934 125.593,17.904 125.878 C 17.874 126.163,17.792 126.453,17.723 126.522 C 17.654 126.591,17.597 126.800,17.597 126.985 C 17.597 127.171,17.456 127.402,17.284 127.498 C 17.104 127.598,17.019 127.797,17.083 127.965 C 17.148 128.134,17.072 128.303,16.903 128.368 C 16.743 128.430,16.659 128.604,16.718 128.756 C 16.776 128.908,16.742 129.083,16.643 129.144 C 16.543 129.206,16.462 129.496,16.462 129.789 C 16.462 130.083,16.337 130.426,16.184 130.553 C 16.031 130.680,15.913 130.839,15.922 130.907 C 15.975 131.306,15.854 131.666,15.559 131.989 C 15.375 132.191,15.231 132.483,15.240 132.640 C 15.254 132.898,14.806 134.251,14.394 135.194 C 14.034 136.017,13.441 137.881,13.325 138.555 C 13.257 138.946,13.127 139.313,13.034 139.370 C 12.942 139.427,12.867 139.724,12.867 140.030 C 12.867 140.336,12.781 140.587,12.677 140.587 C 12.573 140.587,12.488 140.752,12.488 140.954 C 12.488 141.156,12.403 141.374,12.299 141.438 C 12.195 141.502,12.108 141.784,12.106 142.064 C 12.103 142.344,11.940 142.928,11.743 143.362 C 11.546 143.796,11.432 144.198,11.489 144.255 C 11.547 144.312,11.412 144.782,11.189 145.299 C 10.967 145.816,10.785 146.405,10.785 146.608 C 10.785 146.811,10.658 147.220,10.503 147.519 C 10.347 147.817,10.219 148.290,10.219 148.570 C 10.218 148.850,10.144 149.124,10.054 149.180 C 9.964 149.236,9.832 149.645,9.760 150.090 C 9.514 151.625,8.933 154.114,8.690 154.683 C 8.531 155.055,8.445 155.436,7.841 158.467 C 7.675 159.300,7.457 160.135,7.357 160.323 C 7.256 160.510,7.122 161.216,7.060 161.890 C 6.997 162.564,6.873 163.160,6.784 163.215 C 6.695 163.270,6.621 163.586,6.620 163.918 C 6.618 164.251,6.490 165.061,6.335 165.719 C 6.180 166.377,6.010 167.271,5.957 167.706 C 5.904 168.140,5.815 168.794,5.757 169.158 C 5.700 169.522,5.628 170.076,5.597 170.388 C 5.566 170.700,5.489 171.083,5.425 171.239 C 5.361 171.395,5.221 172.247,5.113 173.132 C 5.006 174.016,4.874 174.995,4.821 175.307 C 4.767 175.620,4.675 176.471,4.616 177.200 C 4.557 177.928,4.436 178.612,4.347 178.719 C 4.258 178.827,4.184 179.337,4.182 179.854 C 4.180 180.372,4.133 181.306,4.077 181.930 C 4.021 182.554,3.937 183.576,3.890 184.201 C 3.843 184.825,3.790 185.336,3.772 185.336 C 3.711 185.336,3.445 190.033,3.343 192.917 C 3.310 193.860,3.223 194.729,3.149 194.847 C 3.017 195.060,3.058 195.456,3.313 196.452 C 3.388 196.743,3.369 196.973,3.271 196.973 C 2.976 196.973,3.139 207.939,3.515 213.434 C 3.575 214.319,3.650 215.511,3.680 216.083 C 3.711 216.656,3.841 218.188,3.969 219.489 C 4.098 220.790,4.193 222.138,4.181 222.485 C 4.170 222.833,4.219 223.211,4.291 223.327 C 4.449 223.584,4.491 223.880,4.653 225.875 C 4.722 226.734,4.832 227.436,4.897 227.436 C 4.961 227.436,5.029 227.670,5.047 227.956 C 5.081 228.509,5.332 230.268,5.686 232.450 C 5.804 233.179,5.892 234.009,5.880 234.295 C 5.869 234.581,5.927 234.816,6.010 234.816 C 6.092 234.816,6.155 235.163,6.149 235.587 C 6.144 236.012,6.205 236.400,6.286 236.450 C 6.367 236.500,6.433 236.797,6.433 237.110 C 6.433 237.423,6.516 237.833,6.617 238.023 C 6.719 238.212,6.898 238.994,7.016 239.760 C 7.134 240.527,7.282 241.239,7.344 241.342 C 7.407 241.445,7.471 241.785,7.488 242.099 C 7.504 242.412,7.616 243.024,7.736 243.460 C 7.857 243.896,7.937 244.321,7.916 244.406 C 7.894 244.491,8.052 245.128,8.267 245.821 C 8.482 246.515,8.615 247.303,8.564 247.572 C 8.511 247.851,8.557 248.061,8.673 248.061 C 8.785 248.061,8.929 248.380,8.994 248.770 C 9.059 249.160,9.162 249.607,9.224 249.763 C 9.286 249.920,9.352 250.218,9.370 250.426 C 9.389 250.634,9.502 251.044,9.622 251.337 C 9.741 251.630,9.839 252.027,9.839 252.220 C 9.839 252.413,9.929 252.600,10.040 252.637 C 10.150 252.674,10.245 253.071,10.251 253.519 C 10.258 254.029,10.360 254.371,10.524 254.434 C 10.668 254.489,10.785 254.736,10.785 254.982 C 10.785 255.505,11.579 258.598,11.996 259.697 C 12.153 260.114,12.286 260.593,12.291 260.764 C 12.295 260.934,12.426 261.317,12.582 261.615 C 12.737 261.913,12.865 262.292,12.865 262.457 C 12.866 262.621,12.926 262.815,12.998 262.888 C 13.071 262.960,13.152 263.123,13.179 263.251 C 13.404 264.299,13.720 265.234,13.934 265.483 C 14.076 265.648,14.191 265.999,14.191 266.264 C 14.191 266.529,14.319 266.852,14.475 266.982 C 14.631 267.112,14.759 267.458,14.759 267.751 C 14.759 268.044,14.838 268.333,14.936 268.393 C 15.033 268.454,15.252 268.991,15.423 269.587 C 15.594 270.184,15.898 270.953,16.098 271.297 C 16.298 271.642,16.462 272.082,16.462 272.275 C 16.462 272.469,16.558 272.659,16.675 272.698 C 16.792 272.737,16.907 272.936,16.929 273.139 C 17.027 274.010,17.279 274.723,17.524 274.816 C 17.668 274.872,17.786 275.128,17.786 275.385 C 17.786 275.642,17.871 275.905,17.975 275.970 C 18.079 276.034,18.165 276.232,18.165 276.409 C 18.165 276.587,18.335 277.050,18.543 277.438 C 18.751 277.827,18.925 278.294,18.928 278.476 C 18.932 278.659,19.137 279.055,19.384 279.357 C 19.631 279.659,19.788 280.024,19.733 280.169 C 19.678 280.313,19.771 280.583,19.940 280.770 C 20.109 280.957,20.375 281.538,20.530 282.062 C 20.686 282.585,20.983 283.230,21.192 283.495 C 21.400 283.760,21.570 284.084,21.570 284.216 C 21.570 284.347,21.687 284.589,21.830 284.753 C 21.973 284.918,22.233 285.494,22.409 286.035 C 22.585 286.575,22.882 287.214,23.070 287.454 C 23.257 287.694,23.476 288.103,23.555 288.363 C 23.635 288.623,23.944 289.172,24.243 289.583 C 24.542 289.994,24.787 290.569,24.787 290.860 C 24.787 291.152,24.852 291.391,24.931 291.391 C 25.093 291.391,25.194 291.562,26.053 293.295 C 26.385 293.965,26.875 294.806,27.141 295.164 C 27.407 295.523,27.625 295.999,27.625 296.223 C 27.625 296.447,27.796 296.784,28.004 296.973 C 28.212 297.161,28.382 297.402,28.382 297.507 C 28.382 297.613,28.501 297.834,28.647 297.998 C 29.249 298.678,29.679 299.668,29.465 299.882 C 29.311 300.036,29.391 300.234,29.765 300.624 C 30.045 300.917,30.274 301.258,30.274 301.382 C 30.274 301.507,30.346 301.608,30.433 301.608 C 30.521 301.608,30.692 301.800,30.815 302.034 C 30.937 302.268,31.289 302.800,31.596 303.217 C 31.903 303.633,32.157 304.086,32.160 304.224 C 32.164 304.361,32.273 304.592,32.403 304.737 C 32.948 305.345,33.113 305.575,33.113 305.728 C 33.113 305.817,33.367 306.133,33.678 306.431 C 34.339 307.065,34.665 306.968,36.013 305.736 C 36.434 305.351,36.848 305.079,36.934 305.132 C 37.019 305.184,37.140 305.094,37.202 304.932 C 37.265 304.769,37.430 304.636,37.569 304.636 C 37.708 304.636,37.940 304.466,38.086 304.259 C 38.231 304.051,38.408 303.939,38.479 304.011 C 38.550 304.082,38.739 303.953,38.899 303.726 C 39.058 303.498,39.308 303.311,39.453 303.311 C 39.598 303.311,39.784 303.205,39.868 303.075 C 39.951 302.945,40.307 302.677,40.660 302.481 C 41.013 302.284,41.460 301.986,41.653 301.819 C 41.847 301.651,42.169 301.372,42.368 301.198 C 42.568 301.025,42.783 300.935,42.846 300.998 C 42.909 301.061,43.091 300.926,43.251 300.698 C 43.410 300.470,43.655 300.284,43.794 300.284 C 43.933 300.284,44.098 300.151,44.160 299.988 C 44.222 299.825,44.350 299.739,44.443 299.797 C 44.536 299.854,44.941 299.597,45.343 299.225 C 45.745 298.853,46.383 298.390,46.760 298.195 C 47.137 298.000,47.497 297.709,47.558 297.548 C 47.620 297.388,47.790 297.256,47.937 297.256 C 48.083 297.256,48.309 297.130,48.437 296.975 C 48.566 296.820,48.747 296.740,48.840 296.797 C 48.933 296.855,49.061 296.768,49.123 296.605 C 49.186 296.442,49.544 296.163,49.920 295.985 C 50.295 295.806,50.746 295.530,50.921 295.371 C 51.096 295.211,51.463 294.877,51.737 294.629 C 52.011 294.381,52.289 294.231,52.354 294.297 C 52.420 294.362,52.593 294.245,52.740 294.035 C 52.886 293.826,53.080 293.701,53.171 293.757 C 53.261 293.813,53.404 293.750,53.489 293.618 C 53.635 293.389,54.125 293.034,54.633 292.790 C 54.761 292.728,55.229 292.345,55.673 291.939 C 56.117 291.534,56.558 291.202,56.652 291.202 C 56.746 291.202,57.129 290.968,57.503 290.682 C 57.877 290.396,58.245 290.182,58.320 290.207 C 58.395 290.232,58.547 290.082,58.658 289.875 C 58.768 289.668,58.987 289.499,59.142 289.499 C 59.298 289.499,59.476 289.366,59.538 289.204 C 59.601 289.042,59.753 288.948,59.877 288.996 C 60.001 289.043,60.204 288.921,60.327 288.723 C 60.451 288.525,60.636 288.363,60.740 288.363 C 60.843 288.363,61.097 288.214,61.306 288.032 C 61.514 287.850,61.861 287.545,62.078 287.354 C 62.295 287.163,62.515 287.050,62.567 287.102 C 62.619 287.154,62.825 287.055,63.024 286.881 C 63.224 286.708,63.550 286.424,63.750 286.250 C 63.949 286.077,64.164 285.987,64.227 286.050 C 64.290 286.113,64.472 285.978,64.632 285.750 C 64.792 285.522,65.025 285.336,65.150 285.336 C 65.275 285.336,65.484 285.166,65.614 284.957 C 65.744 284.749,65.950 284.579,66.073 284.579 C 66.196 284.579,66.784 284.196,67.380 283.728 C 67.976 283.259,68.556 282.876,68.669 282.876 C 68.782 282.876,68.874 282.801,68.874 282.709 C 68.874 282.617,69.023 282.488,69.205 282.422 C 69.809 282.204,70.450 281.773,70.619 281.471 C 70.710 281.307,70.904 281.173,71.050 281.173 C 71.196 281.173,71.383 281.056,71.466 280.912 C 71.550 280.769,71.919 280.491,72.286 280.296 C 72.944 279.946,73.261 279.714,74.012 279.029 C 74.222 278.838,74.434 278.722,74.483 278.772 C 74.533 278.822,74.773 278.680,75.017 278.457 C 75.752 277.784,76.020 277.596,76.111 277.688 C 76.159 277.735,76.572 277.432,77.030 277.014 C 77.487 276.596,77.959 276.254,78.078 276.254 C 78.197 276.254,78.347 276.117,78.411 275.950 C 78.475 275.783,78.639 275.690,78.776 275.742 C 78.912 275.794,79.127 275.672,79.253 275.470 C 79.379 275.269,79.561 275.152,79.656 275.211 C 79.752 275.270,79.922 275.145,80.035 274.934 C 80.148 274.723,80.356 274.551,80.497 274.551 C 80.639 274.551,80.803 274.423,80.863 274.267 C 80.923 274.111,81.092 273.983,81.239 273.983 C 81.385 273.983,81.609 273.858,81.736 273.705 C 81.863 273.552,82.022 273.446,82.090 273.469 C 82.158 273.491,82.405 273.340,82.640 273.132 C 82.874 272.923,83.243 272.597,83.459 272.406 C 83.676 272.215,83.903 272.108,83.963 272.168 C 84.023 272.229,84.191 272.108,84.336 271.900 C 84.482 271.693,84.723 271.523,84.874 271.523 C 85.024 271.523,85.147 271.438,85.147 271.334 C 85.147 271.230,85.296 271.145,85.480 271.145 C 85.663 271.145,85.921 270.971,86.053 270.759 C 86.186 270.547,86.367 270.418,86.457 270.474 C 86.546 270.529,86.758 270.362,86.928 270.102 C 87.098 269.843,87.362 269.631,87.516 269.631 C 87.670 269.631,87.796 269.554,87.796 269.461 C 87.796 269.367,88.158 269.103,88.600 268.874 C 89.042 268.644,89.472 268.337,89.555 268.192 C 89.639 268.047,89.830 267.928,89.981 267.928 C 90.132 267.928,90.255 267.841,90.255 267.734 C 90.255 267.628,90.468 267.459,90.728 267.360 C 90.989 267.262,91.202 267.113,91.202 267.030 C 91.202 266.947,91.521 266.713,91.911 266.511 C 92.632 266.138,92.857 265.977,93.614 265.288 C 93.848 265.075,94.105 264.922,94.185 264.948 C 94.328 264.994,94.626 264.780,95.394 264.081 C 95.603 263.890,95.823 263.783,95.883 263.843 C 95.943 263.903,96.111 263.782,96.257 263.575 C 96.402 263.367,96.641 263.198,96.787 263.198 C 96.934 263.198,97.145 263.027,97.256 262.819 C 97.368 262.611,97.566 262.441,97.696 262.441 C 97.826 262.441,98.228 262.189,98.588 261.881 C 98.948 261.573,99.345 261.318,99.470 261.313 C 99.595 261.309,99.765 261.199,99.849 261.069 C 99.932 260.939,100.170 260.738,100.378 260.623 C 100.865 260.354,100.977 259.783,100.587 259.564 C 100.420 259.471,100.284 259.324,100.284 259.238 C 100.284 259.151,99.986 258.586,99.622 257.981 C 99.257 257.376,98.959 256.766,98.959 256.626 C 98.959 256.485,98.803 256.202,98.612 255.997 C 98.421 255.792,97.979 255.051,97.629 254.350 C 97.279 253.648,96.927 253.047,96.847 253.014 C 96.766 252.980,96.644 252.639,96.575 252.257 C 96.507 251.874,96.369 251.458,96.270 251.333 C 95.977 250.964,95.364 249.702,95.364 249.469 C 95.364 249.350,95.194 249.057,94.986 248.817 C 94.778 248.577,94.607 248.192,94.607 247.960 C 94.607 247.729,94.480 247.433,94.324 247.304 C 94.167 247.174,94.039 246.972,94.039 246.855 C 94.038 246.737,93.928 246.429,93.794 246.168 C 93.659 245.908,93.364 245.142,93.137 244.465 C 92.909 243.789,92.551 242.898,92.341 242.486 C 92.131 242.074,91.958 241.551,91.958 241.324 C 91.958 241.097,91.831 240.862,91.675 240.802 C 91.518 240.742,91.391 240.480,91.391 240.219 C 91.391 239.959,91.175 239.258,90.912 238.663 C 90.648 238.067,90.474 237.471,90.525 237.339 C 90.576 237.207,90.536 237.048,90.436 236.986 C 90.337 236.925,90.255 236.743,90.255 236.583 C 90.255 236.423,90.138 236.024,89.994 235.696 C 89.633 234.873,89.405 234.170,89.035 232.734 C 88.860 232.058,88.638 231.243,88.540 230.923 C 88.443 230.604,88.363 230.199,88.363 230.024 C 88.363 229.850,88.269 229.707,88.154 229.707 C 88.038 229.707,87.997 229.569,88.062 229.399 C 88.127 229.230,88.106 228.995,88.014 228.879 C 87.923 228.762,87.793 228.249,87.727 227.739 C 87.660 227.229,87.529 226.718,87.435 226.604 C 87.341 226.489,87.205 225.885,87.133 225.260 C 87.061 224.636,86.875 223.674,86.720 223.122 C 86.565 222.570,86.365 221.506,86.276 220.757 C 86.039 218.777,85.722 216.991,85.531 216.556 C 85.440 216.348,85.312 215.241,85.247 214.096 C 85.073 211.034,84.952 209.437,84.844 208.798 C 84.589 207.284,84.477 198.358,84.678 195.553 C 84.730 194.825,84.809 193.718,84.853 193.094 C 84.897 192.469,85.030 190.851,85.149 189.499 C 85.269 188.146,85.391 186.729,85.421 186.350 C 85.452 185.972,85.521 185.588,85.574 185.499 C 85.628 185.409,85.733 184.697,85.808 183.917 C 85.884 183.136,86.031 182.392,86.135 182.264 C 86.239 182.135,86.272 181.893,86.208 181.726 C 86.144 181.559,86.155 181.324,86.233 181.203 C 86.311 181.083,86.476 180.345,86.598 179.565 C 86.721 178.784,86.878 177.933,86.947 177.673 C 87.017 177.412,87.119 176.753,87.174 176.206 C 87.230 175.660,87.347 175.213,87.434 175.213 C 87.522 175.213,87.650 174.785,87.719 174.263 C 87.789 173.740,87.916 173.269,88.001 173.216 C 88.087 173.163,88.214 172.612,88.284 171.990 C 88.355 171.369,88.477 170.861,88.556 170.861 C 88.679 170.861,88.867 170.215,89.051 169.158 C 89.178 168.428,89.542 167.132,89.766 166.612 C 90.345 165.264,90.429 164.986,90.334 164.738 C 90.279 164.594,90.375 164.422,90.548 164.356 C 90.726 164.287,90.816 164.116,90.756 163.959 C 90.698 163.807,90.732 163.633,90.831 163.571 C 90.931 163.510,91.012 163.214,91.012 162.914 C 91.012 162.614,91.097 162.316,91.202 162.252 C 91.306 162.187,91.391 161.991,91.392 161.815 C 91.393 161.639,91.520 161.251,91.676 160.953 C 91.831 160.655,91.958 160.303,91.958 160.172 C 91.958 160.040,92.086 159.827,92.242 159.697 C 92.398 159.568,92.526 159.217,92.526 158.917 C 92.526 158.618,92.611 158.373,92.715 158.373 C 92.819 158.373,92.904 158.207,92.904 158.005 C 92.904 157.803,92.990 157.586,93.094 157.521 C 93.198 157.457,93.283 157.239,93.283 157.037 C 93.283 156.835,93.368 156.670,93.472 156.670 C 93.576 156.670,93.661 156.457,93.661 156.197 C 93.661 155.937,93.746 155.724,93.851 155.724 C 93.955 155.724,94.040 155.558,94.040 155.356 C 94.040 155.154,94.114 154.943,94.205 154.887 C 94.295 154.831,94.424 154.513,94.491 154.179 C 94.557 153.846,94.732 153.439,94.879 153.276 C 95.025 153.113,95.173 152.854,95.207 152.701 C 95.242 152.547,95.372 152.311,95.498 152.175 C 95.624 152.039,95.683 151.814,95.629 151.675 C 95.576 151.535,95.668 151.368,95.835 151.304 C 96.002 151.240,96.122 151.080,96.101 150.949 C 96.052 150.643,96.622 149.354,96.875 149.198 C 96.981 149.132,97.067 148.918,97.067 148.722 C 97.067 148.526,97.247 148.240,97.466 148.086 C 97.686 147.933,97.814 147.725,97.753 147.625 C 97.691 147.525,97.809 147.228,98.016 146.965 C 98.223 146.702,98.392 146.357,98.392 146.197 C 98.392 146.037,98.472 145.857,98.570 145.797 C 98.668 145.736,98.936 145.310,99.166 144.849 C 99.396 144.389,99.678 144.029,99.792 144.049 C 99.907 144.070,99.973 143.930,99.940 143.737 C 99.907 143.545,99.992 143.247,100.129 143.075 C 100.434 142.693,100.816 142.036,101.254 141.139 C 101.437 140.767,101.719 140.352,101.881 140.218 C 102.043 140.083,102.176 139.856,102.176 139.712 C 102.176 139.569,102.472 139.124,102.835 138.723 C 103.197 138.322,103.444 137.944,103.382 137.883 C 103.256 137.756,104.837 135.667,105.059 135.667 C 105.138 135.667,105.203 135.517,105.203 135.334 C 105.203 135.151,105.500 134.661,105.862 134.246 C 106.224 133.831,106.522 133.385,106.524 133.254 C 106.526 133.124,106.627 133.039,106.748 133.065 C 106.869 133.091,107.018 132.927,107.079 132.700 C 107.192 132.281,107.820 131.433,108.930 130.202 C 109.269 129.825,109.549 129.414,109.551 129.288 C 109.553 129.161,109.726 128.967,109.934 128.855 C 110.142 128.744,110.312 128.528,110.312 128.376 C 110.312 128.223,110.405 128.098,110.518 128.098 C 110.815 128.098,111.434 127.306,111.441 126.916 C 111.445 126.717,111.593 126.585,111.813 126.585 C 112.072 126.585,112.197 126.432,112.239 126.064 C 112.280 125.705,112.401 125.552,112.630 125.570 C 112.812 125.585,112.961 125.521,112.961 125.429 C 112.961 125.337,113.259 124.931,113.623 124.528 C 113.988 124.125,114.286 123.699,114.286 123.582 C 114.286 123.464,114.413 123.368,114.570 123.368 C 114.726 123.368,114.854 123.304,114.854 123.226 C 114.855 122.992,116.210 121.476,116.417 121.476 C 116.688 121.476,117.111 120.877,117.118 120.482 C 117.121 120.297,117.270 120.149,117.455 120.147 C 117.637 120.144,118.031 119.811,118.331 119.405 C 118.654 118.970,118.982 118.709,119.135 118.768 C 119.278 118.823,119.395 118.791,119.395 118.698 C 119.395 118.605,119.733 118.149,120.146 117.685 C 120.559 117.220,120.900 116.776,120.903 116.698 C 120.906 116.620,121.026 116.556,121.170 116.556 C 121.313 116.556,121.656 116.262,121.930 115.901 C 122.243 115.491,122.534 115.287,122.710 115.354 C 122.884 115.421,122.990 115.348,122.990 115.161 C 122.990 114.996,123.181 114.810,123.415 114.748 C 123.649 114.687,124.120 114.259,124.462 113.799 C 124.804 113.338,125.169 112.961,125.275 112.961 C 125.625 112.961,126.383 111.929,126.388 111.447 C 126.391 111.052,125.869 110.217,124.884 109.043 C 124.779 108.917,124.689 108.747,124.685 108.665 C 124.681 108.582,124.425 108.220,124.117 107.860 C 123.809 107.499,123.557 107.123,123.557 107.024 C 123.557 106.925,123.427 106.709,123.269 106.544 C 122.761 106.017,121.665 104.476,121.665 104.289 C 121.665 104.190,121.537 104.060,121.381 104.000 C 121.225 103.940,121.097 103.790,121.097 103.668 C 121.097 103.545,120.799 103.081,120.435 102.637 C 120.071 102.192,119.773 101.736,119.773 101.624 C 119.773 101.511,119.688 101.419,119.584 101.419 C 119.480 101.419,119.395 101.305,119.395 101.165 C 119.395 101.025,119.224 100.756,119.016 100.568 C 118.808 100.379,118.638 100.120,118.638 99.991 C 118.638 99.862,118.510 99.708,118.354 99.648 C 118.198 99.588,118.070 99.413,118.070 99.258 C 118.070 99.104,117.959 98.910,117.823 98.827 C 117.687 98.744,117.373 98.335,117.124 97.919 C 116.875 97.502,116.561 97.094,116.425 97.010 C 116.289 96.927,116.178 96.766,116.178 96.652 C 116.178 96.537,115.880 96.080,115.516 95.636 C 115.151 95.191,114.853 94.753,114.853 94.663 C 114.853 94.573,114.601 94.204,114.293 93.843 C 113.985 93.483,113.730 93.121,113.726 93.038 C 113.722 92.956,113.632 92.786,113.527 92.660 C 112.772 91.760,112.204 90.922,112.204 90.709 C 112.204 90.571,112.034 90.367,111.826 90.255 C 111.618 90.144,111.447 89.926,111.447 89.770 C 111.447 89.614,111.320 89.438,111.164 89.378 C 111.008 89.318,110.880 89.189,110.880 89.092 C 110.880 88.883,110.091 87.729,109.886 87.638 C 109.808 87.603,109.745 87.459,109.745 87.316 C 109.745 87.174,109.638 86.990,109.508 86.906 C 109.195 86.706,108.420 85.593,108.420 85.344 C 108.420 85.235,108.333 85.147,108.226 85.147 C 108.120 85.147,107.951 84.934,107.852 84.674 C 107.753 84.413,107.585 84.201,107.479 84.201 C 107.372 84.201,107.285 84.112,107.285 84.004 C 107.285 83.795,106.542 82.672,106.274 82.476 C 106.086 82.338,105.636 81.589,105.472 81.139 C 105.408 80.964,105.236 80.775,105.090 80.719 C 104.944 80.663,104.825 80.496,104.825 80.348 C 104.825 80.200,104.697 80.029,104.541 79.969 C 104.385 79.910,104.257 79.743,104.257 79.600 C 104.257 79.457,104.087 79.186,103.879 78.997 C 103.671 78.809,103.500 78.582,103.500 78.493 C 103.500 78.404,103.032 77.698,102.460 76.924 C 101.887 76.150,101.419 75.467,101.419 75.407 C 101.419 75.346,101.100 74.885,100.710 74.382 C 100.319 73.879,99.872 73.278,99.716 73.046 C 99.560 72.815,99.262 72.431,99.054 72.193 C 98.846 71.956,98.505 71.477,98.297 71.129 C 98.089 70.781,97.769 70.280,97.585 70.016 C 97.402 69.752,97.200 69.387,97.138 69.205 C 97.075 69.023,96.946 68.874,96.851 68.874 C 96.757 68.874,96.598 68.661,96.500 68.401 C 96.401 68.141,96.232 67.928,96.126 67.928 C 96.019 67.928,95.932 67.836,95.932 67.723 C 95.932 67.611,95.634 67.155,95.270 66.711 C 94.905 66.266,94.607 65.805,94.607 65.685 C 94.607 65.566,94.520 65.468,94.413 65.468 C 94.307 65.468,94.137 65.277,94.036 65.043 C 93.750 64.382,93.408 63.889,93.046 63.616 C 92.864 63.478,92.715 63.261,92.715 63.133 C 92.715 63.004,92.463 62.605,92.155 62.245 C 91.847 61.884,91.592 61.522,91.588 61.440 C 91.583 61.357,91.494 61.187,91.389 61.061 C 90.740 60.285,89.688 58.868,89.688 58.772 C 89.688 58.668,88.254 56.616,87.796 56.063 C 87.692 55.937,87.606 55.776,87.606 55.704 C 87.606 55.632,87.308 55.210,86.944 54.765 C 86.580 54.321,86.282 53.872,86.282 53.768 C 86.282 53.664,86.218 53.551,86.140 53.516 C 85.977 53.444,85.147 52.290,85.147 52.136 C 85.147 52.080,84.998 51.870,84.816 51.669 C 84.309 51.111,84.132 50.868,83.637 50.047 C 83.386 49.631,83.070 49.222,82.934 49.139 C 82.798 49.056,82.687 48.894,82.687 48.780 C 82.687 48.666,82.389 48.209,82.025 47.764 C 81.660 47.320,81.362 46.864,81.362 46.752 C 81.362 46.639,81.277 46.547,81.173 46.547 C 81.069 46.547,80.984 46.433,80.984 46.294 C 80.984 46.033,79.963 45.029,79.708 45.039 C 79.629 45.042,79.395 45.140,79.186 45.256 \" stroke=\"none\" fill=\"#9fbb1a\" fill-rule=\"evenodd\"></path><path id=\"path7\" d=\"M190.728 4.092 C 190.364 4.223,189.799 4.285,189.473 4.229 C 189.135 4.172,188.824 4.219,188.750 4.338 C 188.679 4.453,188.530 4.491,188.419 4.423 C 188.117 4.236,186.136 4.191,185.800 4.363 C 185.639 4.446,184.674 4.555,183.655 4.606 C 182.637 4.658,181.757 4.746,181.700 4.803 C 181.643 4.860,181.445 4.825,181.260 4.726 C 181.028 4.602,180.702 4.639,180.211 4.844 C 179.819 5.008,179.236 5.103,178.916 5.056 C 178.597 5.009,178.153 5.054,177.930 5.155 C 177.665 5.276,177.408 5.275,177.188 5.151 C 176.939 5.012,176.677 5.060,176.193 5.332 C 175.705 5.606,175.498 5.643,175.395 5.476 C 175.317 5.350,175.150 5.315,175.018 5.396 C 174.731 5.574,173.781 5.731,173.132 5.709 C 172.871 5.700,172.531 5.745,172.375 5.809 C 172.219 5.872,171.835 5.942,171.523 5.964 C 171.211 5.986,170.805 6.068,170.621 6.145 C 170.437 6.223,170.057 6.243,169.775 6.189 C 169.494 6.135,168.963 6.205,168.596 6.343 C 168.229 6.481,167.673 6.577,167.360 6.556 C 167.048 6.534,166.553 6.631,166.259 6.771 C 165.966 6.910,165.540 7.007,165.313 6.985 C 165.086 6.963,164.773 6.996,164.617 7.059 C 164.461 7.122,163.936 7.213,163.450 7.261 C 162.965 7.310,162.403 7.437,162.203 7.544 C 162.003 7.651,161.464 7.761,161.005 7.788 C 160.547 7.815,159.865 7.985,159.491 8.166 C 159.117 8.347,158.627 8.447,158.401 8.388 C 158.176 8.329,157.886 8.367,157.757 8.472 C 157.627 8.576,157.223 8.661,156.859 8.658 C 156.495 8.656,155.899 8.785,155.535 8.945 C 155.170 9.104,154.532 9.288,154.115 9.354 C 153.699 9.419,153.018 9.570,152.602 9.689 C 152.185 9.809,151.771 9.888,151.680 9.865 C 151.589 9.842,151.079 9.974,150.545 10.156 C 150.011 10.339,149.404 10.494,149.196 10.501 C 148.988 10.508,148.711 10.580,148.582 10.660 C 148.452 10.741,148.160 10.842,147.933 10.886 C 147.706 10.930,147.466 11.054,147.399 11.162 C 147.333 11.270,146.854 11.388,146.337 11.424 C 145.819 11.460,145.229 11.581,145.025 11.691 C 144.416 12.023,143.918 12.170,143.561 12.126 C 143.375 12.103,142.854 12.291,142.402 12.543 C 141.806 12.877,141.492 12.953,141.259 12.823 C 141.031 12.696,140.841 12.731,140.605 12.944 C 140.423 13.110,140.221 13.245,140.158 13.245 C 140.095 13.245,139.804 13.342,139.511 13.461 C 139.218 13.580,138.851 13.703,138.694 13.735 C 137.405 14.000,136.837 14.157,136.471 14.348 C 135.438 14.886,135.267 14.948,134.805 14.948 C 134.536 14.948,134.188 15.076,134.032 15.232 C 133.876 15.388,133.551 15.516,133.311 15.516 C 133.071 15.516,132.768 15.644,132.638 15.802 C 132.460 16.015,132.336 16.035,132.148 15.879 C 131.958 15.721,131.744 15.777,131.277 16.110 C 130.937 16.353,130.518 16.527,130.348 16.498 C 130.177 16.469,129.991 16.567,129.934 16.715 C 129.877 16.863,129.210 17.172,128.451 17.403 C 127.692 17.633,126.900 17.942,126.691 18.088 C 126.482 18.234,126.171 18.354,126.000 18.354 C 125.829 18.354,125.479 18.520,125.221 18.722 C 124.961 18.927,124.590 19.048,124.387 18.995 C 124.177 18.940,123.727 19.099,123.331 19.367 C 122.952 19.625,122.597 19.791,122.543 19.736 C 122.488 19.682,122.192 19.817,121.883 20.036 C 121.575 20.256,121.143 20.435,120.923 20.435 C 120.702 20.435,120.185 20.648,119.773 20.908 C 119.361 21.168,118.958 21.383,118.878 21.385 C 118.798 21.387,117.966 21.769,117.029 22.235 C 116.093 22.701,115.172 23.082,114.983 23.083 C 114.794 23.084,114.368 23.289,114.037 23.539 C 113.705 23.789,113.117 24.124,112.729 24.284 C 112.341 24.444,111.836 24.750,111.605 24.965 C 111.172 25.369,111.017 25.422,110.449 25.364 C 110.263 25.345,109.604 25.675,108.984 26.099 C 108.364 26.522,107.767 26.868,107.657 26.868 C 107.548 26.868,106.986 27.217,106.409 27.643 C 105.732 28.143,105.231 28.384,104.995 28.322 C 104.763 28.262,104.208 28.515,103.479 29.014 C 102.847 29.447,102.189 29.886,102.016 29.991 C 101.844 30.095,101.650 30.253,101.585 30.342 C 101.520 30.431,101.290 30.448,101.075 30.380 C 100.804 30.294,100.435 30.433,99.869 30.835 C 99.421 31.154,98.845 31.562,98.591 31.743 C 98.336 31.924,97.760 32.349,97.312 32.687 C 96.863 33.025,96.412 33.302,96.309 33.302 C 96.206 33.302,96.121 33.387,96.121 33.491 C 96.121 33.595,96.032 33.680,95.924 33.680 C 95.815 33.680,95.624 33.763,95.498 33.865 C 95.372 33.966,95.019 34.252,94.713 34.501 L 94.157 34.952 94.848 35.972 C 95.229 36.533,96.117 37.818,96.824 38.829 C 97.530 39.840,98.482 41.202,98.939 41.857 C 99.396 42.511,100.152 43.600,100.618 44.276 C 101.085 44.953,101.626 45.682,101.821 45.897 C 102.016 46.112,102.176 46.351,102.176 46.428 C 102.176 46.506,102.474 46.969,102.838 47.457 C 103.690 48.598,103.846 48.816,104.594 49.902 C 105.327 50.967,108.212 55.098,108.792 55.913 C 109.014 56.225,109.932 57.545,110.832 58.846 C 111.732 60.147,112.515 61.254,112.573 61.306 C 112.631 61.358,112.934 61.783,113.246 62.252 C 113.557 62.720,113.878 63.188,113.957 63.292 C 114.786 64.376,115.421 65.277,115.421 65.371 C 115.421 65.434,115.825 66.032,116.320 66.700 C 117.956 68.911,118.920 70.264,119.016 70.484 C 119.068 70.604,119.648 71.461,120.305 72.390 C 124.511 78.336,125.354 79.540,126.329 80.984 C 126.926 81.868,127.674 82.929,127.993 83.340 C 128.311 83.751,128.657 84.236,128.761 84.418 C 128.933 84.718,130.457 86.906,132.027 89.106 C 132.367 89.582,133.022 90.525,133.484 91.202 C 133.945 91.878,134.716 92.985,135.198 93.661 C 135.680 94.338,136.301 95.232,136.580 95.648 C 136.858 96.064,137.171 96.501,137.275 96.618 C 137.379 96.736,137.574 96.991,137.707 97.186 C 137.840 97.381,138.421 98.221,138.998 99.054 C 139.575 99.886,140.190 100.801,140.364 101.087 C 140.778 101.764,141.053 101.743,142.264 100.946 C 142.817 100.581,143.341 100.326,143.427 100.380 C 143.513 100.433,143.697 100.366,143.835 100.231 C 144.299 99.780,145.901 98.770,146.152 98.770 C 146.289 98.770,146.618 98.600,146.882 98.392 C 147.147 98.184,147.483 98.013,147.628 98.013 C 147.774 98.013,148.059 97.888,148.261 97.735 C 148.463 97.583,148.726 97.455,148.846 97.452 C 148.965 97.448,149.509 97.145,150.055 96.778 C 150.600 96.411,151.089 96.153,151.140 96.205 C 151.192 96.257,151.483 96.122,151.786 95.906 C 152.118 95.670,152.519 95.548,152.792 95.600 C 153.102 95.659,153.457 95.512,153.915 95.135 C 154.284 94.831,154.661 94.630,154.754 94.687 C 154.846 94.744,155.137 94.622,155.400 94.416 C 155.663 94.209,156.064 94.040,156.292 94.040 C 156.699 94.040,156.919 93.949,158.510 93.124 C 158.950 92.896,159.546 92.677,159.835 92.638 C 160.332 92.572,161.122 92.273,162.479 91.639 C 162.812 91.484,163.157 91.402,163.247 91.457 C 163.337 91.513,163.916 91.315,164.534 91.018 C 165.152 90.721,165.730 90.547,165.818 90.631 C 165.907 90.716,166.439 90.574,167.002 90.317 C 167.565 90.059,168.344 89.809,168.733 89.762 C 169.521 89.665,170.644 89.319,170.995 89.064 C 171.120 88.973,171.298 88.945,171.391 89.002 C 171.483 89.059,171.986 88.944,172.508 88.746 C 173.207 88.480,173.512 88.441,173.668 88.597 C 173.824 88.753,173.972 88.725,174.230 88.491 C 174.423 88.317,174.760 88.174,174.980 88.174 C 175.200 88.174,175.429 88.095,175.489 87.997 C 175.549 87.900,175.894 87.869,176.255 87.927 C 176.638 87.989,177.025 87.941,177.181 87.811 C 177.329 87.688,177.822 87.566,178.277 87.539 C 178.732 87.512,179.217 87.420,179.356 87.335 C 179.494 87.249,180.025 87.157,180.536 87.129 C 181.047 87.102,181.577 86.986,181.715 86.871 C 181.852 86.757,182.016 86.715,182.079 86.778 C 182.142 86.841,182.631 86.787,183.166 86.659 C 183.701 86.530,184.664 86.406,185.305 86.382 C 185.946 86.358,186.641 86.288,186.850 86.226 C 187.397 86.063,191.399 85.731,194.229 85.613 C 198.932 85.416,201.514 85.397,201.514 85.558 C 201.514 85.654,201.635 85.665,201.783 85.582 C 201.992 85.464,204.170 85.524,206.339 85.706 C 206.505 85.720,207.806 85.733,209.555 85.737 C 209.868 85.738,210.251 85.786,210.407 85.844 C 210.703 85.954,211.110 86.005,212.895 86.157 C 213.483 86.207,214.121 86.329,214.314 86.429 C 214.507 86.528,214.771 86.571,214.901 86.524 C 215.032 86.477,216.032 86.579,217.124 86.751 C 218.216 86.922,219.182 87.017,219.271 86.962 C 219.360 86.907,219.595 86.980,219.792 87.124 C 220.057 87.317,220.216 87.331,220.402 87.177 C 220.589 87.022,220.696 87.038,220.821 87.240 C 220.913 87.390,221.141 87.528,221.327 87.547 C 221.513 87.566,222.067 87.623,222.558 87.674 C 223.049 87.725,223.519 87.808,223.603 87.860 C 223.686 87.911,224.136 88.011,224.602 88.080 C 225.068 88.150,225.542 88.284,225.656 88.378 C 225.770 88.472,225.910 88.502,225.967 88.445 C 226.024 88.388,226.570 88.486,227.179 88.664 C 227.789 88.841,228.415 89.001,228.571 89.019 C 228.728 89.037,229.111 89.160,229.423 89.293 C 229.735 89.426,230.309 89.547,230.699 89.564 C 231.089 89.580,231.408 89.657,231.409 89.735 C 231.409 89.813,231.527 89.877,231.669 89.877 C 231.812 89.877,232.329 90.054,232.818 90.270 C 233.308 90.487,233.820 90.621,233.956 90.568 C 234.093 90.516,234.380 90.596,234.594 90.746 C 234.809 90.896,235.053 90.997,235.136 90.971 C 235.220 90.944,235.544 91.016,235.856 91.130 C 236.168 91.244,236.764 91.446,237.181 91.578 C 237.597 91.710,238.273 91.977,238.683 92.172 C 239.092 92.367,239.620 92.526,239.854 92.526 C 240.089 92.526,240.333 92.611,240.397 92.715 C 240.462 92.819,240.672 92.904,240.866 92.904 C 241.059 92.904,241.246 92.970,241.280 93.049 C 241.315 93.129,242.092 93.441,243.007 93.742 C 243.922 94.043,244.740 94.414,244.825 94.566 C 244.910 94.718,245.209 94.868,245.491 94.899 C 245.772 94.930,246.657 95.268,247.457 95.650 C 248.834 96.308,249.689 96.696,250.331 96.956 C 250.487 97.020,250.870 97.234,251.183 97.434 C 251.495 97.633,251.870 97.803,252.016 97.810 C 252.162 97.818,252.561 98.037,252.902 98.297 C 253.243 98.557,253.630 98.770,253.762 98.770 C 253.893 98.770,254.317 98.989,254.704 99.257 C 255.091 99.526,255.524 99.762,255.666 99.783 C 255.808 99.804,256.191 100.010,256.516 100.242 C 256.841 100.473,257.206 100.662,257.327 100.662 C 257.449 100.662,257.667 100.769,257.812 100.899 C 258.456 101.477,258.653 101.600,259.113 101.716 C 259.382 101.783,259.603 101.966,259.603 102.122 C 259.603 102.289,259.713 102.363,259.871 102.303 C 260.018 102.246,260.183 102.314,260.236 102.453 C 260.289 102.592,260.632 102.804,260.996 102.924 C 261.361 103.045,261.982 103.439,262.376 103.799 C 262.770 104.160,263.182 104.421,263.291 104.379 C 263.401 104.336,263.783 104.590,264.139 104.942 C 264.496 105.294,264.924 105.582,265.091 105.582 C 265.258 105.582,265.962 106.050,266.656 106.623 C 267.350 107.195,268.005 107.663,268.112 107.663 C 268.219 107.663,268.307 107.748,268.307 107.852 C 268.307 107.956,268.436 108.042,268.594 108.042 C 268.753 108.042,268.979 108.254,269.098 108.515 C 269.221 108.785,269.472 108.988,269.684 108.988 C 269.887 108.988,270.385 109.329,270.790 109.746 C 271.194 110.163,271.706 110.532,271.926 110.565 C 272.147 110.599,272.441 110.832,272.581 111.084 C 272.720 111.336,272.837 111.460,272.841 111.360 C 272.845 111.261,273.167 111.516,273.557 111.928 C 274.300 112.712,274.800 113.086,275.355 113.273 C 275.537 113.334,275.686 113.449,275.686 113.528 C 275.686 113.825,277.572 115.636,277.760 115.520 C 277.868 115.453,278.135 115.702,278.353 116.072 C 278.572 116.442,278.827 116.698,278.921 116.640 C 279.015 116.582,279.258 116.817,279.462 117.162 C 279.665 117.507,280.105 117.951,280.439 118.148 C 281.049 118.508,282.687 120.109,282.687 120.345 C 282.687 120.579,283.386 121.281,283.503 121.164 C 283.567 121.101,283.720 121.271,283.844 121.542 C 283.968 121.814,284.213 122.082,284.388 122.138 C 284.564 122.193,284.820 122.449,284.957 122.706 C 285.095 122.962,285.369 123.224,285.567 123.287 C 285.765 123.349,286.020 123.606,286.135 123.857 C 286.249 124.109,286.414 124.314,286.502 124.314 C 286.589 124.314,286.660 124.442,286.660 124.598 C 286.660 124.754,286.740 124.882,286.837 124.882 C 286.934 124.882,287.066 125.048,287.130 125.250 C 287.195 125.453,287.395 125.666,287.575 125.723 C 287.755 125.781,288.042 126.062,288.213 126.348 C 288.945 127.577,289.576 128.101,289.881 127.732 C 290.035 127.546,290.416 127.253,290.728 127.080 C 291.041 126.907,291.807 126.381,292.431 125.911 C 293.056 125.441,293.716 125.007,293.898 124.947 C 294.080 124.887,294.229 124.767,294.229 124.681 C 294.229 124.595,294.437 124.413,294.691 124.277 C 295.220 123.994,297.304 122.597,297.446 122.430 C 297.498 122.369,297.753 122.176,298.013 122.002 C 298.273 121.828,298.912 121.380,299.432 121.007 C 299.953 120.634,300.712 120.108,301.120 119.839 C 301.529 119.569,302.034 119.189,302.244 118.993 C 302.454 118.798,302.730 118.638,302.858 118.638 C 302.986 118.638,303.119 118.570,303.154 118.487 C 303.188 118.404,303.898 117.873,304.730 117.306 C 305.563 116.740,306.287 116.225,306.339 116.161 C 306.391 116.097,306.807 115.798,307.263 115.497 C 308.823 114.465,309.129 114.251,310.763 113.052 C 311.192 112.738,312.053 112.146,312.677 111.736 C 313.302 111.326,313.898 110.924,314.002 110.843 C 314.520 110.440,315.959 109.416,316.457 109.096 C 316.766 108.897,317.187 108.578,317.391 108.388 C 317.596 108.197,317.848 108.042,317.952 108.042 C 318.055 108.042,318.334 107.859,318.571 107.637 C 318.808 107.414,319.161 107.138,319.356 107.022 C 319.885 106.708,321.547 105.551,323.463 104.163 C 324.399 103.484,325.302 102.866,325.469 102.789 C 325.636 102.712,326.019 102.458,326.321 102.224 C 326.622 101.991,327.252 101.502,327.720 101.138 C 328.188 100.774,328.644 100.476,328.733 100.475 C 328.822 100.474,329.163 100.259,329.490 99.997 C 329.817 99.735,330.177 99.448,330.289 99.358 C 330.401 99.268,330.860 98.950,331.308 98.651 C 331.756 98.352,332.440 97.895,332.829 97.635 C 333.217 97.375,333.902 96.917,334.350 96.619 C 334.798 96.320,335.256 95.996,335.368 95.900 C 335.608 95.694,337.379 94.421,338.282 93.806 C 338.627 93.570,339.150 93.186,339.444 92.952 C 339.738 92.718,340.066 92.526,340.172 92.526 C 340.279 92.526,340.394 92.456,340.429 92.371 C 340.488 92.225,340.999 91.856,343.992 89.798 C 344.669 89.333,345.310 88.877,345.416 88.785 C 345.523 88.692,345.864 88.454,346.173 88.255 C 346.483 88.057,347.086 87.638,347.515 87.324 C 349.323 86.002,351.509 84.476,352.195 84.057 C 352.492 83.876,353.295 83.314,353.981 82.808 C 354.667 82.303,355.425 81.799,355.665 81.690 C 356.209 81.442,356.225 80.909,355.707 80.361 C 355.489 80.131,354.905 79.342,354.408 78.606 C 351.941 74.954,351.625 74.551,351.234 74.551 C 350.972 74.551,350.426 74.114,350.426 73.903 C 350.426 73.567,348.578 71.305,348.232 71.218 C 348.005 71.161,347.506 70.660,347.123 70.104 C 346.740 69.549,346.319 69.053,346.186 69.002 C 346.053 68.951,345.633 68.440,345.253 67.866 C 344.872 67.293,344.262 66.640,343.898 66.415 C 343.534 66.189,343.236 65.944,343.236 65.869 C 343.236 65.795,342.767 65.243,342.195 64.642 C 341.623 64.042,341.154 63.478,341.154 63.389 C 341.154 63.301,340.835 63.035,340.445 62.798 C 340.054 62.561,339.661 62.246,339.571 62.098 C 339.481 61.950,339.077 61.488,338.672 61.071 C 338.268 60.655,337.938 60.245,337.938 60.160 C 337.938 60.076,337.773 59.954,337.573 59.891 C 337.372 59.827,337.035 59.481,336.822 59.121 C 336.610 58.762,336.306 58.467,336.146 58.467 C 335.987 58.467,335.856 58.382,335.856 58.278 C 335.856 58.174,335.772 58.089,335.669 58.089 C 335.566 58.089,335.162 57.736,334.771 57.304 C 333.770 56.200,332.960 55.440,332.783 55.440 C 332.588 55.440,330.937 53.717,330.937 53.514 C 330.937 53.428,330.824 53.359,330.687 53.359 C 330.550 53.359,330.151 53.103,329.801 52.791 C 329.452 52.479,329.114 52.223,329.051 52.223 C 328.988 52.223,328.786 51.968,328.602 51.656 C 328.417 51.343,328.149 51.088,328.006 51.088 C 327.863 51.088,327.691 50.918,327.625 50.710 C 327.510 50.348,327.323 50.254,326.836 50.314 C 326.713 50.329,326.559 50.169,326.492 49.958 C 326.425 49.747,326.254 49.574,326.112 49.574 C 325.970 49.574,325.676 49.325,325.458 49.019 C 325.241 48.714,324.873 48.437,324.641 48.404 C 324.409 48.371,324.135 48.153,324.033 47.919 C 323.930 47.684,323.743 47.493,323.616 47.493 C 323.490 47.493,323.319 47.380,323.236 47.242 C 323.152 47.103,322.807 46.830,322.469 46.633 C 322.131 46.437,321.854 46.209,321.854 46.128 C 321.854 46.046,321.764 45.979,321.654 45.979 C 321.544 45.979,321.037 45.543,320.526 45.010 C 319.887 44.344,319.501 44.078,319.289 44.160 C 319.083 44.239,318.950 44.158,318.886 43.916 C 318.834 43.717,318.629 43.512,318.431 43.460 C 318.232 43.408,318.070 43.239,318.070 43.084 C 318.070 42.779,317.569 42.510,317.304 42.673 C 317.214 42.729,316.817 42.432,316.422 42.012 C 316.028 41.593,315.573 41.249,315.411 41.249 C 315.250 41.249,314.654 40.842,314.087 40.345 C 313.520 39.847,312.822 39.338,312.535 39.213 C 312.249 39.089,312.015 38.899,312.015 38.793 C 312.015 38.687,311.890 38.600,311.738 38.600 C 311.586 38.600,311.366 38.423,311.250 38.207 C 311.135 37.990,310.932 37.855,310.799 37.906 C 310.667 37.957,310.232 37.708,309.834 37.353 C 309.435 36.998,308.961 36.708,308.781 36.708 C 308.601 36.708,308.243 36.457,307.985 36.151 C 307.727 35.844,307.476 35.633,307.427 35.682 C 307.379 35.731,307.231 35.641,307.099 35.482 C 306.968 35.324,306.714 35.194,306.536 35.194 C 306.358 35.194,305.964 34.941,305.661 34.632 C 305.357 34.322,304.965 34.067,304.789 34.064 C 304.614 34.061,304.200 33.812,303.870 33.510 C 303.540 33.209,303.030 32.914,302.737 32.856 C 302.443 32.797,301.882 32.427,301.488 32.034 C 301.079 31.625,300.628 31.343,300.434 31.376 C 300.247 31.408,300.095 31.343,300.095 31.232 C 300.095 31.122,299.971 31.031,299.820 31.031 C 299.669 31.031,299.463 30.883,299.361 30.702 C 299.260 30.520,299.116 30.433,299.042 30.507 C 298.890 30.659,297.824 30.087,297.824 29.855 C 297.824 29.774,297.695 29.707,297.538 29.707 C 297.142 29.707,296.529 29.332,295.890 28.700 C 295.593 28.406,295.247 28.204,295.121 28.250 C 294.995 28.296,294.636 28.145,294.324 27.915 C 294.011 27.685,293.511 27.436,293.213 27.362 C 292.914 27.289,292.546 27.105,292.395 26.954 C 292.244 26.803,291.961 26.679,291.767 26.679 C 291.572 26.679,291.360 26.593,291.295 26.488 C 291.230 26.383,290.629 26.040,289.959 25.727 C 289.290 25.414,288.742 25.075,288.742 24.973 C 288.742 24.871,288.593 24.785,288.411 24.783 C 288.228 24.781,287.867 24.612,287.606 24.409 C 287.346 24.205,286.989 24.037,286.813 24.034 C 286.637 24.032,286.440 23.944,286.375 23.838 C 286.309 23.732,286.189 23.687,286.108 23.737 C 286.027 23.787,285.775 23.655,285.547 23.443 C 285.320 23.231,285.030 23.092,284.903 23.136 C 284.777 23.179,284.546 23.071,284.390 22.896 C 284.148 22.624,283.364 22.302,282.814 22.248 C 282.727 22.240,282.540 22.073,282.397 21.878 C 282.246 21.672,282.014 21.570,281.844 21.635 C 281.683 21.697,281.552 21.665,281.552 21.565 C 281.552 21.464,281.432 21.381,281.287 21.381 C 281.141 21.381,280.537 21.126,279.943 20.814 C 279.350 20.501,278.738 20.246,278.583 20.246 C 278.429 20.246,277.698 19.948,276.958 19.584 C 276.219 19.219,275.457 18.921,275.266 18.921 C 275.074 18.921,274.868 18.794,274.808 18.638 C 274.748 18.482,274.494 18.354,274.244 18.354 C 273.994 18.354,273.641 18.279,273.460 18.187 C 273.279 18.095,272.876 17.913,272.564 17.783 C 272.252 17.653,271.826 17.473,271.618 17.383 C 271.410 17.293,271.068 17.196,270.859 17.167 C 270.650 17.138,270.269 16.968,270.013 16.788 C 269.757 16.609,269.370 16.462,269.154 16.462 C 268.938 16.462,268.680 16.394,268.581 16.312 C 268.482 16.230,267.763 15.953,266.982 15.697 C 266.202 15.441,265.535 15.168,265.500 15.090 C 265.465 15.012,265.230 14.948,264.977 14.948 C 264.724 14.948,264.369 14.873,264.189 14.781 C 263.474 14.417,262.885 14.167,262.622 14.114 C 262.470 14.084,262.219 14.011,262.062 13.952 C 261.906 13.893,261.523 13.780,261.211 13.702 C 260.899 13.624,260.601 13.546,260.549 13.529 C 260.497 13.512,260.199 13.434,259.886 13.357 C 259.310 13.213,258.639 12.958,258.044 12.655 C 257.863 12.563,257.549 12.488,257.346 12.488 C 257.142 12.488,256.929 12.413,256.873 12.321 C 256.816 12.229,256.214 12.049,255.535 11.921 C 254.856 11.792,254.253 11.611,254.195 11.517 C 254.137 11.423,254.013 11.394,253.919 11.452 C 253.825 11.510,253.494 11.426,253.184 11.266 C 252.874 11.106,252.408 10.974,252.149 10.974 C 251.890 10.974,251.632 10.901,251.577 10.811 C 251.490 10.670,251.059 10.569,249.571 10.339 C 249.413 10.314,249.194 10.239,249.085 10.171 C 248.975 10.104,248.679 10.009,248.426 9.962 C 247.537 9.795,246.829 9.596,246.641 9.460 C 246.537 9.385,246.325 9.320,246.168 9.316 C 246.012 9.312,245.246 9.168,244.465 8.996 C 243.685 8.824,242.833 8.654,242.573 8.617 C 242.313 8.581,241.845 8.451,241.533 8.330 C 241.220 8.209,240.922 8.121,240.870 8.134 C 240.596 8.206,238.851 7.878,238.653 7.718 C 238.526 7.615,237.917 7.515,237.300 7.494 C 236.683 7.474,236.043 7.345,235.878 7.208 C 235.712 7.071,235.441 7.011,235.274 7.075 C 235.107 7.139,234.872 7.128,234.751 7.051 C 234.630 6.974,234.149 6.900,233.680 6.887 C 233.212 6.874,232.573 6.753,232.261 6.618 C 231.949 6.483,231.626 6.387,231.543 6.406 C 231.460 6.424,230.524 6.303,229.462 6.136 C 228.400 5.969,227.190 5.798,226.774 5.755 C 226.358 5.713,225.634 5.632,225.166 5.576 C 224.697 5.520,223.974 5.439,223.557 5.396 C 223.141 5.354,222.800 5.309,222.800 5.296 C 222.800 5.284,222.460 5.239,222.044 5.196 C 220.557 5.042,219.570 4.935,218.638 4.825 C 217.114 4.646,215.912 4.545,214.096 4.444 C 211.620 4.306,210.155 4.179,209.893 4.078 C 209.766 4.030,209.610 4.075,209.545 4.179 C 209.481 4.282,209.244 4.308,209.019 4.235 C 208.606 4.101,206.004 4.009,202.176 3.994 C 201.031 3.989,199.924 3.983,199.716 3.979 C 198.221 3.955,194.042 3.995,193.188 4.042 C 192.616 4.074,191.977 4.044,191.769 3.977 C 191.561 3.910,191.093 3.962,190.728 4.092 \" stroke=\"none\" fill=\"#b5cb2b\" fill-rule=\"evenodd\"></path><path id=\"path8\" d=\"\" stroke=\"none\" fill=\"#55ff00\" fill-rule=\"evenodd\"></path><path id=\"path9\" d=\"M364.522 96.081 C 363.619 96.742,362.897 97.244,359.648 99.478 C 358.854 100.024,357.583 100.938,356.822 101.509 C 356.062 102.080,355.333 102.549,355.203 102.551 C 355.073 102.553,354.967 102.627,354.967 102.715 C 354.967 102.851,354.376 103.279,352.707 104.352 C 352.545 104.456,351.944 104.889,351.372 105.314 C 350.799 105.740,350.024 106.293,349.648 106.544 C 347.578 107.929,346.136 108.917,345.885 109.122 C 345.631 109.330,344.163 110.365,341.471 112.233 C 340.970 112.582,340.270 113.079,339.916 113.340 C 339.562 113.600,338.581 114.281,337.736 114.853 C 336.890 115.426,335.705 116.256,335.103 116.698 C 334.500 117.140,333.921 117.502,333.816 117.502 C 333.712 117.502,333.577 117.631,333.516 117.789 C 333.456 117.947,333.212 118.162,332.976 118.267 C 332.595 118.436,331.562 119.112,331.031 119.541 C 330.927 119.624,330.118 120.192,329.234 120.801 C 328.349 121.410,327.597 121.981,327.562 122.071 C 327.528 122.160,327.408 122.233,327.296 122.233 C 327.185 122.233,326.787 122.467,326.413 122.752 C 326.039 123.038,325.180 123.649,324.503 124.109 C 323.827 124.570,323.231 124.997,323.179 125.058 C 323.127 125.119,322.709 125.424,322.250 125.735 C 321.792 126.046,321.229 126.429,320.999 126.585 C 320.769 126.741,320.047 127.252,319.395 127.720 C 318.742 128.188,318.015 128.699,317.780 128.855 C 316.016 130.025,314.359 131.179,313.150 132.081 C 312.370 132.663,311.582 133.194,311.400 133.262 C 311.218 133.329,311.069 133.472,311.069 133.580 C 311.069 133.687,310.971 133.775,310.851 133.775 C 310.731 133.775,310.284 134.034,309.858 134.351 C 308.177 135.600,305.993 137.141,304.778 137.938 C 304.075 138.398,303.500 138.831,303.500 138.901 C 303.500 138.970,303.253 139.129,302.952 139.254 C 302.650 139.379,302.209 139.688,301.972 139.940 C 301.736 140.191,301.463 140.397,301.366 140.397 C 301.269 140.397,300.879 140.639,300.500 140.934 C 300.121 141.228,299.662 141.524,299.480 141.590 C 299.001 141.764,299.066 142.077,299.811 143.183 C 300.175 143.724,300.473 144.297,300.473 144.456 C 300.473 144.615,300.856 145.249,301.325 145.865 C 301.793 146.480,302.176 147.071,302.176 147.178 C 302.176 147.284,302.473 147.940,302.836 148.637 C 303.199 149.333,303.455 149.967,303.406 150.046 C 303.358 150.125,303.615 150.580,303.979 151.057 C 304.343 151.534,304.627 151.991,304.609 152.073 C 304.592 152.156,304.718 152.540,304.890 152.927 C 305.063 153.314,305.203 153.766,305.203 153.933 C 305.203 154.099,305.416 154.514,305.676 154.855 C 305.937 155.197,306.149 155.646,306.149 155.854 C 306.149 156.062,306.308 156.376,306.501 156.551 C 306.726 156.754,306.820 157.034,306.764 157.328 C 306.709 157.616,306.825 157.978,307.075 158.295 C 307.294 158.574,307.474 158.951,307.474 159.132 C 307.474 159.313,307.592 159.560,307.737 159.680 C 307.882 159.800,308.057 160.277,308.127 160.740 C 308.196 161.202,308.339 161.634,308.444 161.699 C 308.549 161.764,308.592 161.928,308.540 162.064 C 308.488 162.200,308.604 162.454,308.798 162.630 C 308.993 162.806,309.105 163.070,309.048 163.218 C 308.992 163.366,309.060 163.625,309.201 163.794 C 309.341 163.963,309.431 164.295,309.400 164.530 C 309.369 164.766,309.434 165.015,309.544 165.083 C 309.654 165.151,309.745 165.404,309.745 165.646 C 309.745 165.887,309.860 166.180,310.002 166.298 C 310.147 166.418,310.220 166.715,310.170 166.976 C 310.117 167.253,310.205 167.564,310.386 167.745 C 310.554 167.913,310.691 168.251,310.691 168.498 C 310.691 168.745,310.776 168.999,310.880 169.063 C 310.984 169.128,311.069 169.388,311.069 169.641 C 311.069 169.895,311.232 170.592,311.432 171.191 C 311.631 171.790,311.849 172.682,311.916 173.174 C 311.982 173.666,312.109 174.113,312.198 174.168 C 312.286 174.223,312.313 174.438,312.259 174.646 C 312.204 174.855,312.254 175.139,312.370 175.279 C 312.485 175.418,312.526 175.585,312.460 175.651 C 312.394 175.717,312.456 175.912,312.599 176.084 C 312.742 176.256,312.881 176.748,312.909 177.177 C 312.958 177.938,313.431 180.323,313.646 180.889 C 313.705 181.045,313.785 181.514,313.822 181.930 C 313.981 183.680,314.099 184.354,314.286 184.579 C 314.413 184.733,314.421 184.979,314.309 185.275 C 314.203 185.553,314.203 185.856,314.307 186.044 C 314.403 186.214,314.514 186.720,314.554 187.169 C 314.594 187.618,314.680 188.453,314.744 189.026 C 315.128 192.434,315.238 194.787,315.312 201.135 C 315.348 204.241,315.301 206.811,315.207 206.929 C 315.114 207.045,315.068 207.746,315.106 208.487 C 315.143 209.228,315.123 209.885,315.061 209.947 C 314.999 210.009,314.935 210.627,314.919 211.321 C 314.894 212.420,314.508 215.779,314.177 217.786 C 314.117 218.150,314.070 218.615,314.073 218.818 C 314.076 219.021,313.991 219.294,313.883 219.424 C 313.775 219.554,313.743 219.839,313.813 220.057 C 313.882 220.275,313.846 220.565,313.734 220.700 C 313.621 220.836,313.534 221.151,313.540 221.401 C 313.558 222.105,312.777 225.972,312.566 226.227 C 312.462 226.352,312.433 226.675,312.501 226.945 C 312.574 227.240,312.544 227.436,312.426 227.436 C 312.317 227.436,312.170 227.841,312.100 228.335 C 311.917 229.615,311.490 231.225,311.260 231.503 C 311.151 231.633,311.112 231.869,311.172 232.026 C 311.233 232.183,311.029 232.869,310.720 233.550 C 310.412 234.231,310.201 234.831,310.253 234.882 C 310.359 234.989,309.875 236.529,308.877 239.262 C 308.801 239.470,308.752 239.704,308.768 239.782 C 308.785 239.860,308.719 239.924,308.621 239.924 C 308.523 239.924,308.442 240.073,308.439 240.255 C 308.431 240.809,307.965 242.384,307.809 242.384 C 307.729 242.384,307.663 242.549,307.663 242.751 C 307.663 242.953,307.578 243.171,307.474 243.236 C 307.370 243.300,307.285 243.551,307.285 243.794 C 307.285 244.037,307.147 244.288,306.979 244.353 C 306.794 244.424,306.710 244.609,306.767 244.825 C 306.820 245.029,306.672 245.410,306.417 245.721 C 306.173 246.019,305.971 246.415,305.967 246.601 C 305.963 246.787,305.828 247.140,305.667 247.385 C 305.506 247.631,305.331 248.075,305.278 248.372 C 305.224 248.669,305.101 248.993,305.003 249.092 C 304.905 249.191,304.825 249.418,304.825 249.596 C 304.825 249.775,304.758 249.950,304.677 249.984 C 304.596 250.019,304.257 250.622,303.924 251.325 C 303.592 252.027,303.232 252.602,303.126 252.602 C 303.020 252.602,302.930 252.793,302.927 253.027 C 302.924 253.262,302.796 253.618,302.643 253.820 C 302.490 254.022,302.365 254.364,302.365 254.579 C 302.365 254.795,302.069 255.311,301.707 255.726 C 301.344 256.141,301.046 256.600,301.044 256.747 C 301.042 256.893,300.828 257.292,300.568 257.633 C 300.307 257.974,300.095 258.386,300.095 258.548 C 300.095 258.710,299.906 259.059,299.676 259.324 C 299.446 259.589,299.169 260.077,299.061 260.409 C 298.953 260.740,298.668 261.110,298.427 261.229 C 298.186 261.349,297.995 261.500,298.001 261.565 C 298.060 262.145,297.957 262.497,297.635 262.819 C 297.427 263.027,297.256 263.277,297.256 263.374 C 297.256 263.471,297.078 263.607,296.861 263.676 C 296.594 263.761,296.495 263.915,296.556 264.148 C 296.612 264.366,296.408 264.755,296.005 265.195 C 295.653 265.579,295.364 266.007,295.364 266.145 C 295.364 266.474,294.426 267.471,294.183 267.400 C 294.079 267.370,294.040 267.466,294.097 267.615 C 294.241 267.992,293.752 268.691,292.337 270.133 C 292.077 270.398,291.862 270.718,291.861 270.843 C 291.859 270.968,291.518 271.416,291.104 271.839 C 290.689 272.261,290.326 272.742,290.297 272.907 C 290.267 273.073,289.926 273.542,289.540 273.950 C 288.536 275.010,287.803 275.939,287.799 276.159 C 287.796 276.263,287.540 276.518,287.228 276.727 C 286.916 276.935,286.661 277.198,286.661 277.312 C 286.661 277.425,286.362 277.679,285.998 277.875 C 285.594 278.093,285.336 278.374,285.336 278.596 C 285.336 278.965,283.437 280.984,283.090 280.984 C 282.987 280.984,282.843 281.167,282.773 281.390 C 282.593 281.958,280.226 284.201,279.808 284.201 C 279.726 284.201,279.659 284.330,279.659 284.489 C 279.659 284.648,279.447 284.859,279.186 284.957 C 278.910 285.062,278.713 285.287,278.713 285.497 C 278.713 285.719,278.495 285.948,278.146 286.093 C 277.833 286.222,277.578 286.446,277.578 286.591 C 277.578 286.736,277.131 287.143,276.585 287.497 C 276.038 287.850,275.367 288.381,275.093 288.677 C 274.558 289.254,274.365 289.412,273.557 289.930 C 272.807 290.412,272.879 290.641,274.487 292.876 C 275.285 293.984,276.285 295.402,276.710 296.026 C 277.135 296.651,277.532 297.204,277.592 297.256 C 277.651 297.308,277.757 297.479,277.825 297.635 C 277.894 297.791,278.418 298.557,278.989 299.338 C 279.561 300.118,280.409 301.310,280.875 301.987 C 281.340 302.663,282.300 304.043,283.008 305.054 C 283.716 306.065,284.551 307.256,284.863 307.702 C 285.175 308.148,286.147 309.535,287.022 310.784 C 288.475 312.858,289.115 313.775,290.954 316.414 C 291.298 316.909,291.895 317.760,292.279 318.307 C 292.664 318.853,294.253 321.131,295.810 323.368 C 297.367 325.605,298.805 327.649,299.004 327.909 C 299.363 328.377,302.341 332.638,303.542 334.403 C 303.883 334.905,304.253 335.415,304.364 335.538 C 304.474 335.661,305.113 336.564,305.783 337.545 C 306.977 339.294,307.255 339.694,309.416 342.763 C 310.003 343.595,310.973 345.000,311.573 345.885 C 312.173 346.769,312.714 347.535,312.775 347.588 C 312.836 347.640,313.265 348.236,313.728 348.912 C 314.191 349.588,314.616 350.184,314.672 350.237 C 314.729 350.289,315.155 350.893,315.618 351.580 C 318.330 355.596,319.517 357.226,319.734 357.232 C 319.869 357.235,320.961 356.535,322.162 355.676 C 323.363 354.818,324.573 353.969,324.850 353.790 C 325.894 353.117,326.206 352.823,326.206 352.517 C 326.206 352.225,327.371 351.257,328.471 350.635 C 329.111 350.273,329.423 349.937,329.423 349.610 C 329.423 349.458,329.820 349.048,330.304 348.698 C 330.789 348.347,331.449 347.799,331.771 347.479 C 332.092 347.159,332.654 346.694,333.018 346.445 C 333.921 345.827,334.153 345.582,334.153 345.249 C 334.153 345.092,334.430 344.773,334.768 344.539 C 335.106 344.306,335.649 343.853,335.973 343.533 C 336.298 343.213,336.809 342.735,337.109 342.470 C 337.408 342.205,337.872 341.737,338.138 341.430 C 338.404 341.122,339.149 340.384,339.793 339.790 C 340.438 339.196,340.965 338.621,340.965 338.513 C 340.965 338.405,341.071 338.313,341.202 338.310 C 341.585 338.300,342.523 337.379,342.421 337.113 C 342.367 336.972,342.600 336.721,342.970 336.522 C 343.324 336.331,343.614 336.062,343.614 335.924 C 343.614 335.785,343.950 335.450,344.360 335.179 C 344.772 334.906,345.132 334.502,345.164 334.277 C 345.196 334.053,345.413 333.786,345.646 333.683 C 345.879 333.581,346.050 333.373,346.025 333.221 C 346.000 333.069,346.173 332.845,346.410 332.725 C 346.647 332.604,347.158 332.085,347.545 331.571 C 348.386 330.457,349.674 329.157,350.232 328.858 C 350.489 328.720,350.614 328.496,350.578 328.236 C 350.539 327.966,350.667 327.757,350.958 327.610 C 351.199 327.489,351.390 327.336,351.384 327.271 C 351.350 326.931,351.406 326.848,351.791 326.677 C 352.022 326.574,352.256 326.300,352.312 326.069 C 352.367 325.837,352.843 325.198,353.370 324.648 C 353.896 324.099,354.449 323.372,354.599 323.034 C 354.749 322.695,355.021 322.370,355.203 322.312 C 355.385 322.255,355.535 322.127,355.535 322.030 C 355.535 321.932,355.747 321.667,356.008 321.441 C 356.268 321.214,356.481 320.872,356.481 320.679 C 356.481 320.486,356.608 320.280,356.764 320.220 C 356.921 320.160,357.048 320.011,357.048 319.888 C 357.048 319.766,357.307 319.512,357.624 319.325 C 358.051 319.073,358.170 318.892,358.084 318.621 C 358.009 318.386,358.073 318.217,358.265 318.143 C 358.428 318.081,358.562 317.917,358.562 317.779 C 358.562 317.641,358.720 317.478,358.914 317.416 C 359.107 317.355,359.423 316.956,359.615 316.529 C 359.807 316.103,360.330 315.378,360.777 314.918 C 361.224 314.458,361.589 313.922,361.589 313.727 C 361.589 313.532,361.845 313.131,362.157 312.836 C 362.469 312.541,362.725 312.190,362.725 312.055 C 362.725 311.813,362.908 311.546,363.503 310.918 C 363.672 310.741,363.959 310.274,364.143 309.880 C 364.326 309.487,364.721 308.903,365.020 308.583 C 365.319 308.263,365.563 307.924,365.563 307.830 C 365.563 307.543,366.016 306.832,366.367 306.567 C 366.549 306.430,366.698 306.159,366.698 305.966 C 366.698 305.772,366.954 305.373,367.266 305.078 C 367.578 304.783,367.833 304.398,367.833 304.222 C 367.833 304.045,367.920 303.848,368.026 303.782 C 368.132 303.717,368.169 303.584,368.108 303.486 C 368.048 303.388,368.132 303.258,368.295 303.195 C 368.457 303.133,368.590 302.972,368.590 302.838 C 368.590 302.704,368.718 302.546,368.874 302.486 C 369.030 302.426,369.158 302.213,369.158 302.013 C 369.158 301.812,369.413 301.375,369.726 301.041 C 370.038 300.706,370.293 300.272,370.293 300.075 C 370.293 299.877,370.442 299.565,370.624 299.379 C 370.807 299.194,371.104 298.747,371.285 298.386 C 371.758 297.447,372.058 296.994,372.319 296.826 C 372.445 296.745,372.498 296.547,372.436 296.386 C 372.374 296.225,372.485 295.866,372.683 295.587 C 372.881 295.308,373.169 294.825,373.323 294.513 C 373.478 294.201,373.710 293.877,373.841 293.794 C 373.971 293.711,374.078 293.537,374.078 293.408 C 374.078 293.138,374.697 291.879,375.024 291.485 C 375.146 291.338,375.191 291.129,375.123 291.021 C 375.056 290.912,375.091 290.823,375.202 290.823 C 375.312 290.823,375.402 290.716,375.402 290.585 C 375.402 290.454,375.577 290.237,375.791 290.104 C 376.054 289.939,376.142 289.744,376.064 289.498 C 375.989 289.261,376.084 289.019,376.338 288.801 C 376.552 288.618,376.727 288.251,376.727 287.985 C 376.727 287.712,376.974 287.231,377.294 286.880 C 377.606 286.538,377.862 286.092,377.862 285.889 C 377.862 285.686,377.943 285.372,378.041 285.191 C 378.477 284.394,379.453 282.202,379.422 282.090 C 379.403 282.022,379.513 281.863,379.665 281.736 C 379.818 281.609,379.943 281.345,379.943 281.149 C 379.943 280.954,380.114 280.476,380.322 280.087 C 380.530 279.699,380.700 279.274,380.700 279.142 C 380.700 279.010,380.785 278.903,380.889 278.903 C 380.993 278.903,381.079 278.724,381.079 278.506 C 381.079 278.047,381.647 277.010,381.898 277.010 C 381.992 277.010,382.028 276.853,381.977 276.660 C 381.927 276.468,382.036 276.111,382.219 275.868 C 382.403 275.624,382.512 275.318,382.462 275.187 C 382.411 275.056,382.499 274.710,382.657 274.419 C 383.245 273.334,383.996 271.427,384.282 270.293 C 384.361 269.981,384.652 269.249,384.928 268.667 C 385.204 268.084,385.430 267.429,385.430 267.211 C 385.430 266.993,385.516 266.763,385.620 266.698 C 385.724 266.634,385.809 266.415,385.809 266.211 C 385.809 266.008,385.886 265.694,385.980 265.513 C 386.074 265.332,386.258 264.823,386.388 264.380 C 386.519 263.938,386.707 263.576,386.805 263.576 C 386.904 263.576,386.940 263.459,386.885 263.316 C 386.830 263.173,386.906 262.822,387.054 262.537 C 387.202 262.252,387.323 261.826,387.323 261.591 C 387.323 261.355,387.454 261.054,387.614 260.920 C 387.801 260.766,387.841 260.613,387.725 260.497 C 387.609 260.381,387.674 260.082,387.906 259.669 C 388.105 259.314,388.269 258.813,388.269 258.556 C 388.269 258.299,388.343 258.089,388.434 258.089 C 388.591 258.089,388.868 256.944,388.922 256.065 C 388.937 255.837,389.103 255.478,389.293 255.269 C 389.530 255.007,389.600 254.737,389.517 254.407 C 389.451 254.143,389.466 253.926,389.550 253.926 C 389.723 253.926,390.211 252.364,390.249 251.690 C 390.262 251.449,390.385 251.183,390.521 251.099 C 390.677 251.003,390.720 250.793,390.638 250.535 C 390.567 250.309,390.592 250.021,390.695 249.896 C 390.798 249.771,390.944 249.243,391.020 248.723 C 391.096 248.202,391.244 247.564,391.349 247.304 C 391.548 246.809,391.566 246.732,391.769 245.506 C 391.838 245.090,391.964 244.579,392.049 244.371 C 392.134 244.163,392.388 243.013,392.613 241.816 C 392.838 240.620,393.106 239.486,393.209 239.298 C 393.311 239.109,393.345 238.797,393.284 238.604 C 393.223 238.411,393.246 238.208,393.336 238.153 C 393.425 238.097,393.513 237.532,393.530 236.896 C 393.551 236.140,393.664 235.638,393.855 235.446 C 394.088 235.213,394.101 235.098,393.917 234.876 C 393.761 234.688,393.750 234.556,393.882 234.470 C 393.990 234.400,394.127 233.798,394.186 233.133 C 394.244 232.468,394.397 231.860,394.524 231.781 C 394.653 231.701,394.709 231.457,394.650 231.232 C 394.592 231.008,394.625 230.553,394.725 230.219 C 394.824 229.885,394.939 229.101,394.979 228.477 C 395.020 227.852,395.111 227.193,395.182 227.010 C 395.252 226.828,395.259 226.545,395.196 226.382 C 395.133 226.218,395.158 225.941,395.252 225.767 C 395.402 225.486,395.487 224.840,395.766 221.854 C 395.805 221.438,395.878 220.501,395.928 219.773 C 395.978 219.044,396.094 217.938,396.186 217.313 C 396.277 216.689,396.334 215.752,396.313 215.232 C 396.291 214.711,396.347 213.859,396.435 213.337 C 396.524 212.815,396.599 211.794,396.602 211.067 C 396.610 208.737,396.636 208.326,396.777 208.325 C 396.871 208.325,396.878 201.377,396.790 196.121 C 396.769 194.872,396.807 193.710,396.875 193.539 C 396.943 193.367,396.907 193.170,396.796 193.101 C 396.674 193.026,396.640 192.687,396.709 192.255 C 396.778 191.822,396.743 191.483,396.622 191.408 C 396.490 191.326,396.479 191.127,396.589 190.836 C 396.683 190.590,396.721 190.350,396.674 190.303 C 396.576 190.205,396.385 187.540,396.367 185.998 C 396.360 185.426,396.305 184.872,396.244 184.768 C 396.184 184.664,396.160 184.342,396.190 184.051 C 396.239 183.590,396.147 182.655,395.738 179.470 C 395.685 179.054,395.606 178.353,395.564 177.914 C 395.521 177.474,395.422 177.009,395.343 176.882 C 395.264 176.754,395.177 176.305,395.149 175.884 C 395.016 173.868,394.930 173.107,394.822 173.000 C 394.758 172.935,394.796 172.774,394.906 172.641 C 395.045 172.474,395.046 172.286,394.912 172.035 C 394.805 171.835,394.674 171.230,394.621 170.691 C 394.569 170.151,394.471 169.622,394.404 169.514 C 394.337 169.406,394.242 168.921,394.191 168.436 C 394.140 167.950,394.023 167.411,393.929 167.236 C 393.836 167.061,393.810 166.666,393.871 166.358 C 393.934 166.044,393.895 165.744,393.783 165.674 C 393.673 165.606,393.628 165.434,393.682 165.292 C 393.737 165.150,393.682 164.972,393.559 164.896 C 393.392 164.793,393.397 164.722,393.579 164.609 C 393.770 164.491,393.756 164.362,393.512 163.989 C 393.342 163.730,393.123 162.868,393.024 162.074 C 392.925 161.279,392.742 160.505,392.616 160.354 C 392.490 160.202,392.434 159.897,392.492 159.676 C 392.549 159.456,392.517 159.115,392.419 158.919 C 392.322 158.722,392.163 158.403,392.067 158.208 C 391.958 157.989,391.959 157.786,392.068 157.677 C 392.178 157.566,392.072 157.073,391.788 156.374 C 391.521 155.716,391.370 155.042,391.426 154.752 C 391.478 154.478,391.428 154.197,391.314 154.126 C 391.200 154.056,391.107 153.791,391.107 153.537 C 391.107 153.283,391.020 153.075,390.914 153.075 C 390.804 153.075,390.771 152.876,390.837 152.612 C 390.901 152.358,390.884 152.039,390.799 151.903 C 390.613 151.605,390.572 151.468,390.416 150.615 C 390.349 150.251,390.179 149.776,390.038 149.559 C 389.897 149.343,389.830 149.117,389.890 149.057 C 389.949 148.997,389.833 148.608,389.632 148.191 C 389.422 147.756,389.330 147.330,389.415 147.191 C 389.500 147.054,389.448 146.782,389.295 146.564 C 389.147 146.352,389.026 146.038,389.026 145.866 C 389.026 145.693,388.902 145.450,388.750 145.324 C 388.528 145.140,388.519 145.021,388.703 144.708 C 388.882 144.404,388.881 144.303,388.694 144.236 C 388.564 144.189,388.458 143.949,388.458 143.704 C 388.458 143.459,388.372 143.205,388.268 143.141 C 388.164 143.076,388.126 142.830,388.186 142.595 C 388.252 142.328,388.181 142.074,387.997 141.921 C 387.834 141.786,387.701 141.547,387.701 141.390 C 387.701 141.233,387.538 140.839,387.338 140.514 C 387.138 140.190,386.919 139.541,386.851 139.073 C 386.784 138.605,386.603 138.027,386.450 137.790 C 386.297 137.553,386.216 137.288,386.270 137.201 C 386.324 137.113,386.201 136.892,385.998 136.708 C 385.744 136.478,385.680 136.282,385.793 136.081 C 385.904 135.881,385.779 135.459,385.399 134.757 C 385.092 134.190,384.879 133.626,384.926 133.504 C 384.973 133.382,384.880 132.988,384.718 132.630 C 384.557 132.271,384.440 131.908,384.459 131.823 C 384.477 131.738,384.320 131.450,384.110 131.183 C 383.900 130.915,383.728 130.577,383.728 130.431 C 383.728 130.286,383.590 129.957,383.423 129.702 C 383.255 129.446,383.170 129.103,383.232 128.939 C 383.296 128.774,383.138 128.335,382.875 127.948 C 382.615 127.566,382.403 127.140,382.403 127.000 C 382.403 126.861,382.270 126.614,382.108 126.452 C 381.946 126.290,381.861 126.033,381.920 125.880 C 381.979 125.728,381.824 125.207,381.577 124.722 C 380.852 123.303,380.533 122.554,380.394 121.949 C 380.322 121.637,380.107 121.178,379.914 120.930 C 379.722 120.682,379.565 120.374,379.565 120.247 C 379.565 120.119,379.352 119.701,379.092 119.318 C 378.832 118.935,378.619 118.538,378.619 118.436 C 378.619 118.335,378.419 117.934,378.175 117.546 C 377.932 117.158,377.770 116.728,377.817 116.590 C 377.864 116.453,377.638 115.915,377.314 115.395 C 376.991 114.875,376.727 114.349,376.727 114.225 C 376.727 114.102,376.429 113.582,376.064 113.069 C 375.678 112.526,375.402 111.912,375.402 111.595 C 375.402 111.297,375.318 110.950,375.216 110.825 C 374.244 109.633,374.008 109.282,373.987 108.999 C 373.974 108.818,373.611 108.155,373.181 107.525 C 372.718 106.846,372.435 106.236,372.486 106.028 C 372.540 105.806,372.151 105.091,371.429 104.088 C 370.665 103.028,370.321 102.386,370.393 102.159 C 370.463 101.939,370.213 101.415,369.688 100.680 C 369.240 100.055,368.491 98.980,368.023 98.292 C 365.775 94.991,365.903 95.072,364.522 96.081 \" stroke=\"none\" fill=\"#d1dc31\" fill-rule=\"evenodd\"></path><path id=\"path10\" d=\"\" stroke=\"none\" fill=\"#99ff33\" fill-rule=\"evenodd\"></path><path id=\"path11\" d=\"M85.380 215.516 C 85.380 215.880,85.419 216.029,85.466 215.847 C 85.514 215.665,85.514 215.367,85.466 215.184 C 85.419 215.002,85.380 215.151,85.380 215.516 \" stroke=\"none\" fill=\"#ffff00\" fill-rule=\"evenodd\"></path></g>\n</svg>;\n\nexport default icons;","// Dependencies\nimport { createNggEditComponent } from './edit.min'\nimport icons from './icons.min';\n\nconst { __ } \t\t\t\t\t = wp.i18n\nconst { RawHTML } \t = wp.element\nconst { registerBlockType } = wp.blocks\nconst { withSelect} = wp.data\nconst { omit } = lodash\nconst { memo } = React\n\n// Provides a higher order component that is aware when the freeform block becomes available\nconst withFreeform = withSelect((select, props) => {\n return {\n Freeform: select('core/blocks').getBlockType('core/freeform')\n }\n})\n\n// When the freeform block is available, we create our edit component for NGG and render it\nconst edit = withFreeform(memo(props => {\n props.isSelected = true\n const editProps = omit(props, ['Freeform'])\n const NggEdit = createNggEditComponent(jQuery, props.Freeform.edit)\n return <NggEdit {...editProps}/>\n}))\n\n// Register our block\nregisterBlockType('imagely/nextgen-gallery', {\n\n title: __('NextGEN Gallery'),\n\n desription: __('A block for adding NextGEN Galleries.'),\n\n icon: icons.nextgen,\n\n category: 'common',\n\n attributes: {\n content: {\n type: 'string',\n source: 'html',\n },\n },\n\n supports: {\n className: false,\n customClassName: false,\n },\n\n edit,\n\n save( { attributes } ) {\n const { content } = attributes;\n return <RawHTML>{ content }</RawHTML>\n },\n});\n\n\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./build/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_block/static/src/edit.min.js","webpack:///./build/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_block/static/src/icons.min.js","webpack:///./build/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_block/static/src/block.min.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","wp","i18n","__","createNggEditComponent","memoize","lodash","$","Freeform","_Freeform","NggEditor","props","_this","_classCallCheck","this","_possibleConstructorReturn","_getPrototypeOf","openIGW","_assertThisInitialized","updateContent","hasGallery","toggleAddGalleryBtn","_inherits","_createClass","attributes","content","length","_get","ref","addClass","siblings","hide","removeClass","show","setAttributes","editor","on","_ref","shortcode","execCommand","React","createElement","className","onClick","ngg_tinymce_plugin","button_label","icons","nextgen","id","version","width","height","viewBox","stroke","fill","fill-rule","RawHTML","element","registerBlockType","blocks","withSelect","data","omit","memo","edit","select","getBlockType","withFreeform","editProps","NggEdit","jQuery","_extends","isSelected","title","desription","icon","category","type","source","supports","customClassName","save"],"mappings":"aACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,aAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EAAAsB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAArB,EAAAqB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFA1B,EAAAkB,EAAAO,GACAX,OAAAC,eAAAU,EAAA,WAAyCT,YAAA,EAAAK,UACzC,EAAAE,GAAA,iBAAAF,EAAA,QAAAM,KAAAN,EAAArB,EAAAU,EAAAe,EAAAE,EAAA,SAAAA,GAAgH,OAAAN,EAAAM,IAAqBC,KAAA,KAAAD,IACrI,OAAAF,GAIAzB,EAAA6B,EAAA,SAAA1B,GACA,IAAAS,EAAAT,KAAAqB,WACA,WAA2B,OAAArB,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAH,EAAAU,EAAAE,EAAA,IAAAA,GACAA,GAIAZ,EAAAa,EAAA,SAAAiB,EAAAC,GAAsD,OAAAjB,OAAAkB,UAAAC,eAAA1B,KAAAuB,EAAAC,IAGtD/B,EAAAkC,EAAA,GAIAlC,IAAAmC,EAAA,mjCClFsBC,GAAGC,KAAjBC,OAIKC,GAAyBC,EAHhBC,OAAdD,SAGsC,SAACE,EAAGC,GAoE9C,OApE2D,SAAAC,GAEvD,SAAAC,EAAYC,GAAO,IAAAC,EAAA,mGAAAC,CAAAC,KAAAJ,IACfE,uEAAAG,CAAAD,KAAAE,EAAAN,GAAAtC,KAAA0C,KAAMH,KACDM,QAAqBL,EAAKK,QAAQxB,KAAbyB,IAAAN,KAC1BA,EAAKO,cAAqBP,EAAKO,cAAc1B,KAAnByB,IAAAN,KAC1BA,EAAKQ,WAAqBR,EAAKQ,WAAW3B,KAAhByB,IAAAN,KAC1BA,EAAKS,oBAAqBT,EAAKS,oBAAoB5B,KAAzByB,IAAAN,KALXA,EAFoC,yOAAAU,CAAAZ,EACnCF,iDADmCe,CAAAb,IAAAlB,IAAA,aAAAN,MAAA,WAWnD,OAAO4B,KAAKH,MAAMa,WAAWC,SAAWX,KAAKH,MAAMa,WAAWC,QAAQC,OAAS,KAX5BlC,IAAA,oBAAAN,MAAA,WAenDyC,EAAAX,EAAAN,EAAAb,WAAA,oBAAAiB,MAAA1C,KAAA0C,MACAP,EAAEO,KAAKc,KAAKC,SAAS,oBAAoBA,SAAS,wBAClDf,KAAKO,yBAjB8C7B,IAAA,qBAAAN,MAAA,WAsBnD4B,KAAKO,yBAtB8C7B,IAAA,sBAAAN,MAAA,WA2B/C4B,KAAKH,MAAMa,WAAWC,SACtBlB,EAAEO,KAAKc,KAAKC,SAAS,UACrBtB,EAAEO,KAAKc,KAAKE,SAAS,yBAAyBC,SAG9CxB,EAAEO,KAAKc,KAAKI,YAAY,UACxBzB,EAAEO,KAAKc,KAAKE,SAAS,yBAAyBG,WAjCCzC,IAAA,gBAAAN,MAAA,SAqCzCuC,GACVX,KAAKH,MAAMuB,eAAeT,eAtCyBjC,IAAA,UAAAN,MAAA,SAyC/CiD,GACJR,EAAAX,EAAAN,EAAAb,WAAA,UAAAiB,MAAA1C,KAAA0C,KAAcqB,GACd,IAAMhB,EAAoBL,KAAKK,cAAc1B,KAAKqB,MAIlDqB,EAAOC,GAAG,cAAe,kBAAMjB,EAAc,MAC7CgB,EAAOC,GAAG,eAAgB,SAAAC,GAAA,IAAEC,EAAFD,EAAEC,UAAF,OAAiBnB,EAAcmB,QAhDN9C,IAAA,UAAAN,MAAA,WAoDnD4B,KAAKqB,OAAOI,YAAY,yBApD2B/C,IAAA,SAAAN,MAAA,WAyDnD,OADayC,EAAAX,EAAAN,EAAAb,WAAA,SAAAiB,MAAA1C,KAAA0C,MAGT0B,MAAAC,cAAA,OAAKC,UAAU,wBACXF,MAAAC,cAAA,OAAKC,UAAU,kBAAkBC,QAAS7B,KAAKG,SAC1C2B,mBAAmB1C,KAAK2C,oBA7DcnC,EAAA,KCJzDoC,KAENA,EAAMC,QACNP,MAAAC,cAAA,OAAKO,GAAG,MAAMC,QAAQ,MAAMC,MAAM,MAAMC,OAAO,oBAAoBC,QAAQ,6BAC3EZ,MAAAC,cAAA,KAAGO,GAAG,QAAOR,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,GAAG8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,GAAG8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,4NAA4N8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,GAAG8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,6liBAA6liB8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,GAAG8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,2oyBAA2oyB8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,07pBAA07pB8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,GAAG8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,QAAQzE,EAAE,i3pBAAi3pB8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,SAASzE,EAAE,GAAG8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,YAAiBf,MAAAC,cAAA,QAAMO,GAAG,SAASzE,EAAE,gKAAgK8E,OAAO,OAAOC,KAAK,UAAUC,YAAU,cAGpxqFT,2NCHP3C,EAAwBF,GAAGC,KAA3BC,GACAqD,EAAqCvD,GAAGwD,QAAxCD,QACAE,EAAsCzD,GAAG0D,OAAzCD,kBACAE,EAAsC3D,GAAG4D,KAAzCD,WACAE,EAAsCxD,OAAtCwD,KACAC,EAAsCvB,MAAtCuB,KAUFC,EAPeJ,EAAW,SAACK,EAAQtD,GACrC,OACIH,SAAUyD,EAAO,eAAeC,aAAa,mBAKxCC,CAAaJ,EAAK,SAAApD,GAC3B,IAAMyD,EAAaN,EAAKnD,GAAQ,aAC1B0D,EAAUjE,EAAuBkE,OAAQ3D,EAAMH,SAASwD,MAC9D,OAAOxB,MAAAC,cAAC4B,EAADE,KAAaH,GAAWI,YAAY,QAI/Cd,EAAkB,2BAEde,MAAOtE,EAAG,mBAEVuE,WAAYvE,EAAG,yCAEfwE,KAAM7B,EAAMC,QAEZ6B,SAAU,SAEVpD,YACIC,SACIoD,KAAM,SACNC,OAAQ,SAIhBC,UACIrC,WAAW,EACXsC,iBAAiB,GAGrBhB,OAEAiB,KAxByC,SAAA5C,GAwBlB,IACXZ,EADWY,EAAfb,WACIC,QACR,OAAOe,MAAAC,cAACe,EAAD,KAAW/B","file":"block.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","const { __ } = wp.i18n;\nconst { memoize } = lodash\n\n// Given jQuery and the Freeform block settings, creates the Ngg Editor Component\nexport const createNggEditComponent = memoize(($, Freeform) => {\n class NggEditor extends Freeform {\n constructor(props) {\n super(props)\n this.openIGW = this.openIGW.bind(this)\n this.updateContent = this.updateContent.bind(this)\n this.hasGallery = this.hasGallery.bind(this)\n this.toggleAddGalleryBtn= this.toggleAddGalleryBtn.bind(this)\n }\n\n hasGallery() {\n return this.props.attributes.content && this.props.attributes.content.length > 0\n }\n\n componentDidMount() {\n super.componentDidMount()\n $(this.ref).addClass('freeform-toolbar').addClass('ngg-freeform-toolbar')\n this.toggleAddGalleryBtn();\n\n }\n\n componentDidUpdate() {\n this.toggleAddGalleryBtn();\n }\n\n toggleAddGalleryBtn() {\n // Determine the UI state\n if (this.props.attributes.content) {\n $(this.ref).addClass('hidden');\n $(this.ref).siblings('.add-ngg-gallery-wrap').hide()\n }\n else {\n $(this.ref).removeClass('hidden');\n $(this.ref).siblings('.add-ngg-gallery-wrap').show()\n }\n }\n\n updateContent(content) {\n this.props.setAttributes({content}) \n }\n\n onSetup(editor){\n super.onSetup(editor);\n const updateContent = this.updateContent.bind(this)\n\n // When NGG is added or removed, we must set the classic \"content\" attribute, \n // which will re-render our component\n editor.on('ngg-removed', () => updateContent(\"\"))\n editor.on('ngg-inserted', ({shortcode}) => updateContent(shortcode))\n }\n\n openIGW() {\n this.editor.execCommand('ngg_attach_to_post')\n }\n\n render(){\n const classic = super.render()\n return [\n classic,\n <div className=\"add-ngg-gallery-wrap\">\n <div className=\"add-ngg-gallery\" onClick={this.openIGW}>\n {ngg_tinymce_plugin.i18n.button_label}\n </div>\n </div>\n ]\n }\n }\n\n return NggEditor\n})","const icons = {};\n\nicons.nextgen =\n<svg id=\"svg\" version=\"1.1\" width=\"400\" height=\"385.8088930936613\" viewBox=\"0 0 400 385.8088930936613\">\n<g id=\"svgg\"><path id=\"path0\" d=\"\" stroke=\"none\" fill=\"#000055\" fill-rule=\"evenodd\"></path><path id=\"path1\" d=\"\" stroke=\"none\" fill=\"#002424\" fill-rule=\"evenodd\"></path><path id=\"path2\" d=\"M194.418 152.698 C 154.152 157.677,135.139 203.873,160.388 235.383 C 179.730 259.522,217.168 260.458,237.772 237.316 C 261.954 210.156,250.860 167.167,216.592 155.239 C 210.224 153.023,200.657 151.926,194.418 152.698 \" stroke=\"none\" fill=\"#143650\" fill-rule=\"evenodd\"></path><path id=\"path3\" d=\"\" stroke=\"none\" fill=\"#555500\" fill-rule=\"evenodd\"></path><path id=\"path4\" d=\"M109.430 274.467 C 109.368 274.629,109.202 274.717,109.061 274.663 C 108.920 274.609,108.715 274.732,108.606 274.936 C 108.496 275.140,108.286 275.307,108.139 275.307 C 107.992 275.307,107.796 275.441,107.705 275.605 C 107.536 275.907,106.895 276.338,106.291 276.556 C 106.109 276.622,105.960 276.753,105.960 276.848 C 105.960 276.942,105.747 277.101,105.487 277.200 C 105.227 277.299,105.014 277.467,105.014 277.573 C 105.014 277.680,104.920 277.767,104.805 277.767 C 104.690 277.767,104.285 278.009,103.906 278.303 C 103.527 278.598,103.068 278.894,102.886 278.960 C 102.703 279.026,102.554 279.168,102.554 279.275 C 102.554 279.382,102.427 279.470,102.272 279.470 C 102.117 279.470,101.884 279.640,101.754 279.849 C 101.624 280.057,101.367 280.227,101.184 280.227 C 101.001 280.227,100.851 280.314,100.851 280.421 C 100.851 280.528,100.639 280.696,100.378 280.795 C 100.118 280.894,99.905 281.071,99.905 281.189 C 99.905 281.306,99.793 281.360,99.655 281.307 C 99.518 281.254,99.304 281.373,99.181 281.570 C 99.057 281.768,98.838 281.930,98.694 281.930 C 98.550 281.930,98.383 282.059,98.322 282.217 C 98.262 282.374,97.997 282.585,97.734 282.685 C 97.471 282.785,97.256 282.954,97.256 283.061 C 97.256 283.167,97.095 283.254,96.898 283.254 C 96.701 283.254,96.491 283.382,96.431 283.538 C 96.371 283.694,96.201 283.822,96.053 283.822 C 95.904 283.822,95.731 283.959,95.667 284.126 C 95.603 284.292,95.438 284.386,95.302 284.334 C 95.165 284.281,94.952 284.400,94.829 284.598 C 94.705 284.796,94.529 284.957,94.437 284.957 C 94.344 284.957,93.996 285.213,93.661 285.525 C 93.327 285.837,92.965 286.093,92.857 286.093 C 92.748 286.093,92.296 286.391,91.851 286.755 C 91.407 287.119,90.958 287.417,90.854 287.417 C 90.750 287.417,90.637 287.481,90.602 287.559 C 90.471 287.855,89.293 288.565,89.116 288.455 C 89.014 288.392,88.931 288.476,88.931 288.641 C 88.931 288.805,88.718 289.021,88.458 289.120 C 88.198 289.219,87.985 289.392,87.985 289.505 C 87.985 289.617,87.602 289.879,87.133 290.086 C 86.665 290.293,86.282 290.546,86.282 290.647 C 86.282 290.749,86.090 290.915,85.856 291.017 C 85.220 291.292,84.692 291.646,84.522 291.911 C 84.439 292.041,84.245 292.148,84.091 292.148 C 83.936 292.148,83.761 292.275,83.701 292.431 C 83.641 292.588,83.504 292.715,83.396 292.715 C 83.287 292.715,82.835 293.013,82.391 293.377 C 81.946 293.742,81.493 294.040,81.384 294.040 C 81.276 294.040,81.097 294.207,80.988 294.411 C 80.871 294.629,80.673 294.738,80.508 294.675 C 80.337 294.609,80.227 294.677,80.227 294.850 C 80.227 295.006,80.014 295.187,79.754 295.253 C 79.494 295.318,79.281 295.455,79.281 295.557 C 79.281 295.659,79.162 295.743,79.017 295.743 C 78.872 295.743,78.707 295.864,78.650 296.012 C 78.594 296.160,78.223 296.433,77.826 296.619 C 77.429 296.804,76.994 297.108,76.858 297.295 C 76.722 297.482,76.488 297.635,76.337 297.635 C 76.187 297.635,76.064 297.715,76.064 297.814 C 76.064 297.990,75.336 298.457,74.693 298.693 C 74.510 298.760,74.361 298.892,74.361 298.986 C 74.361 299.081,74.170 299.241,73.936 299.342 C 73.345 299.597,72.922 299.894,72.049 300.662 C 71.636 301.026,71.221 301.325,71.127 301.325 C 71.032 301.325,70.662 301.559,70.303 301.845 C 69.945 302.131,69.562 302.365,69.452 302.365 C 69.342 302.365,69.253 302.449,69.253 302.551 C 69.253 302.653,69.040 302.790,68.780 302.855 C 68.519 302.920,68.307 303.102,68.307 303.259 C 68.307 303.451,68.183 303.512,67.928 303.446 C 67.680 303.381,67.550 303.440,67.550 303.617 C 67.550 303.766,67.337 303.969,67.077 304.068 C 66.816 304.167,66.604 304.337,66.604 304.447 C 66.604 304.556,66.391 304.726,66.131 304.825 C 65.870 304.924,65.658 305.092,65.658 305.199 C 65.658 305.305,65.487 305.393,65.279 305.393 C 65.071 305.393,64.901 305.480,64.901 305.587 C 64.901 305.693,64.688 305.861,64.428 305.960 C 64.167 306.059,63.955 306.227,63.955 306.334 C 63.955 306.441,63.784 306.528,63.576 306.528 C 63.368 306.528,63.198 306.615,63.198 306.722 C 63.198 306.828,62.985 306.997,62.725 307.096 C 62.465 307.194,62.252 307.361,62.252 307.465 C 62.252 307.570,61.907 307.831,61.486 308.046 C 61.064 308.261,60.672 308.561,60.614 308.712 C 60.556 308.864,60.389 308.988,60.243 308.988 C 60.097 308.988,59.835 309.154,59.662 309.356 C 59.488 309.559,59.285 309.687,59.210 309.641 C 59.135 309.595,58.800 309.812,58.467 310.124 C 58.133 310.436,57.748 310.691,57.612 310.691 C 57.475 310.691,57.335 310.754,57.301 310.833 C 57.184 311.095,55.380 312.394,55.132 312.394 C 54.996 312.394,54.803 312.547,54.703 312.735 C 54.602 312.923,54.174 313.242,53.752 313.445 C 53.330 313.647,52.983 313.879,52.982 313.959 C 52.981 314.040,52.789 314.189,52.554 314.290 C 51.958 314.548,51.520 314.853,50.731 315.562 C 50.355 315.900,49.942 316.176,49.812 316.177 C 49.683 316.177,49.476 316.340,49.353 316.537 C 49.229 316.735,49.027 316.858,48.903 316.810 C 48.779 316.763,48.626 316.856,48.564 317.018 C 48.502 317.181,48.339 317.313,48.203 317.313 C 48.067 317.313,47.695 317.547,47.375 317.833 C 46.625 318.507,45.782 319.104,45.364 319.259 C 45.182 319.327,45.033 319.470,45.033 319.578 C 45.033 319.685,44.903 319.773,44.743 319.773 C 44.584 319.773,44.405 319.901,44.345 320.057 C 44.285 320.213,44.075 320.341,43.878 320.341 C 43.622 320.341,43.519 320.476,43.519 320.814 C 43.519 321.074,43.587 321.287,43.670 321.287 C 43.753 321.287,44.147 321.798,44.545 322.422 C 44.942 323.046,45.343 323.557,45.434 323.557 C 45.526 323.557,45.601 323.655,45.601 323.774 C 45.601 323.894,45.899 324.355,46.263 324.799 C 46.627 325.244,46.925 325.700,46.925 325.812 C 46.925 325.925,47.010 326.017,47.114 326.017 C 47.219 326.017,47.304 326.132,47.304 326.272 C 47.304 326.411,47.474 326.680,47.682 326.868 C 47.890 327.057,48.061 327.331,48.061 327.477 C 48.061 327.634,48.209 327.719,48.420 327.685 C 48.728 327.634,49.763 328.480,49.763 328.783 C 49.763 328.837,49.976 329.160,50.237 329.501 C 50.497 329.842,50.710 330.217,50.710 330.335 C 50.710 330.610,51.587 331.190,51.802 331.058 C 51.891 331.002,52.123 331.229,52.316 331.562 C 52.509 331.894,52.780 332.235,52.918 332.318 C 53.056 332.401,53.169 332.587,53.169 332.731 C 53.169 332.875,53.347 333.049,53.565 333.118 C 53.783 333.187,54.082 333.533,54.230 333.888 C 54.378 334.242,54.578 334.532,54.675 334.532 C 54.772 334.532,54.964 334.766,55.102 335.052 C 55.239 335.338,55.492 335.574,55.663 335.575 C 56.001 335.578,56.764 336.191,56.764 336.461 C 56.764 336.713,57.567 337.748,57.763 337.748 C 57.981 337.748,58.642 338.535,58.650 338.804 C 58.654 338.917,58.888 339.130,59.171 339.277 C 59.786 339.598,61.757 341.524,61.929 341.973 C 61.996 342.147,62.168 342.289,62.311 342.289 C 62.454 342.289,62.725 342.577,62.915 342.929 C 63.125 343.319,63.542 343.693,63.985 343.889 C 64.385 344.065,64.711 344.333,64.711 344.485 C 64.711 344.637,64.882 344.825,65.091 344.902 C 65.299 344.979,65.628 345.336,65.821 345.696 C 66.014 346.056,66.335 346.394,66.535 346.449 C 66.972 346.567,68.307 347.617,68.307 347.843 C 68.307 348.075,69.693 349.274,69.850 349.177 C 69.923 349.132,70.037 349.267,70.103 349.477 C 70.170 349.687,70.389 349.858,70.590 349.858 C 70.791 349.858,70.956 349.924,70.956 350.004 C 70.956 350.370,72.658 351.980,72.934 351.874 C 73.117 351.804,73.226 351.868,73.226 352.046 C 73.226 352.202,73.370 352.385,73.545 352.452 C 73.721 352.520,74.109 352.853,74.408 353.193 C 74.727 353.556,75.063 353.768,75.222 353.707 C 75.385 353.645,75.552 353.757,75.637 353.986 C 75.778 354.360,77.338 355.718,77.633 355.722 C 77.925 355.725,78.903 356.556,78.903 356.800 C 78.903 356.937,78.988 357.048,79.093 357.048 C 79.198 357.048,79.469 357.261,79.695 357.521 C 79.921 357.781,80.240 357.997,80.403 357.999 C 80.566 358.002,81.069 358.343,81.520 358.756 C 81.972 359.170,82.451 359.508,82.586 359.508 C 82.721 359.508,82.876 359.678,82.931 359.886 C 82.988 360.104,83.189 360.265,83.404 360.265 C 83.627 360.265,83.821 360.428,83.883 360.668 C 83.961 360.965,84.092 361.045,84.379 360.970 C 84.624 360.906,84.768 360.959,84.768 361.114 C 84.768 361.353,85.288 361.680,85.572 361.619 C 85.650 361.603,85.714 361.717,85.714 361.873 C 85.714 362.029,85.864 362.157,86.048 362.157 C 86.231 362.157,86.466 362.349,86.570 362.583 C 86.674 362.817,86.908 362.997,87.090 362.982 C 87.272 362.967,87.686 363.202,88.008 363.503 C 88.331 363.805,88.863 364.179,89.191 364.334 C 89.518 364.490,89.998 364.809,90.257 365.043 C 90.517 365.277,90.814 365.478,90.918 365.489 C 91.452 365.547,91.958 365.827,91.958 366.064 C 91.958 366.211,92.107 366.386,92.289 366.453 C 92.472 366.520,92.693 366.695,92.781 366.842 C 92.883 367.012,93.105 367.067,93.396 366.994 C 93.646 366.932,93.851 366.963,93.851 367.063 C 93.851 367.400,94.783 368.258,95.042 368.158 C 95.182 368.105,95.398 368.222,95.521 368.420 C 95.645 368.618,95.905 368.780,96.100 368.780 C 96.294 368.780,96.559 368.907,96.689 369.063 C 96.818 369.219,97.049 369.347,97.202 369.347 C 97.355 369.347,97.828 369.645,98.254 370.009 C 98.679 370.374,99.129 370.672,99.254 370.672 C 99.379 370.672,99.586 370.798,99.714 370.953 C 99.843 371.108,100.024 371.189,100.116 371.131 C 100.208 371.074,100.284 371.112,100.284 371.214 C 100.284 371.425,101.342 371.996,101.732 371.996 C 101.872 371.996,101.965 372.103,101.939 372.233 C 101.912 372.372,102.130 372.493,102.470 372.526 C 102.801 372.558,103.360 372.861,103.781 373.235 C 104.185 373.594,104.655 373.888,104.826 373.888 C 104.997 373.888,105.342 374.106,105.592 374.372 C 105.873 374.671,106.180 374.821,106.396 374.765 C 106.594 374.713,106.953 374.853,107.220 375.085 C 107.480 375.311,107.751 375.501,107.820 375.506 C 108.117 375.528,108.913 375.843,109.149 376.032 C 109.289 376.145,109.518 376.254,109.657 376.274 C 109.796 376.294,110.249 376.584,110.664 376.917 C 111.079 377.251,111.501 377.472,111.602 377.410 C 111.704 377.348,111.837 377.429,111.899 377.591 C 111.962 377.753,112.093 377.836,112.191 377.776 C 112.289 377.715,112.694 377.851,113.091 378.077 C 114.435 378.844,114.758 378.995,115.057 378.996 C 115.221 378.997,115.558 379.214,115.807 379.478 C 116.071 379.759,116.425 379.938,116.658 379.907 C 116.877 379.879,117.263 379.987,117.516 380.147 C 117.769 380.308,118.444 380.635,119.016 380.874 C 119.588 381.114,120.203 381.438,120.381 381.595 C 120.559 381.753,120.847 381.827,121.021 381.760 C 121.216 381.685,121.596 381.838,122.021 382.162 C 122.398 382.449,122.810 382.660,122.938 382.631 C 123.065 382.602,123.363 382.702,123.600 382.854 C 123.837 383.006,124.201 383.158,124.409 383.192 C 124.617 383.226,124.903 383.410,125.045 383.601 C 125.219 383.834,125.444 383.912,125.735 383.839 C 125.999 383.772,126.203 383.825,126.261 383.974 C 126.364 384.244,127.909 384.408,127.909 384.150 C 127.909 384.061,128.172 383.720,128.493 383.391 C 128.979 382.894,129.056 382.698,128.951 382.220 C 128.843 381.728,128.872 381.664,129.154 381.773 C 129.421 381.875,129.463 381.821,129.376 381.489 C 129.294 381.175,129.353 381.079,129.625 381.079 C 129.919 381.079,129.961 380.981,129.868 380.513 C 129.795 380.146,129.862 379.784,130.062 379.479 C 130.231 379.221,130.369 378.916,130.369 378.801 C 130.369 378.686,130.500 378.461,130.659 378.301 C 130.886 378.075,130.901 377.952,130.726 377.742 C 130.546 377.525,130.624 377.364,131.121 376.920 C 131.619 376.476,131.716 376.274,131.618 375.885 C 131.552 375.619,131.565 375.402,131.649 375.402 C 131.907 375.402,132.450 374.330,132.450 373.821 C 132.450 373.241,132.798 372.415,133.253 371.913 C 133.436 371.711,133.568 371.456,133.546 371.346 C 133.477 370.988,133.777 370.104,133.968 370.104 C 134.070 370.104,134.153 369.891,134.153 369.631 C 134.153 369.354,134.251 369.178,134.390 369.205 C 134.539 369.235,134.621 369.043,134.613 368.685 C 134.606 368.373,134.720 368.028,134.867 367.918 C 135.013 367.809,135.108 367.596,135.077 367.445 C 135.005 367.096,135.651 365.752,135.891 365.752 C 135.991 365.752,136.055 365.561,136.034 365.326 C 135.986 364.807,136.396 363.671,136.632 363.671 C 136.725 363.671,136.802 363.467,136.802 363.218 C 136.802 362.969,136.939 362.713,137.106 362.649 C 137.318 362.567,137.376 362.395,137.297 362.082 C 137.226 361.799,137.288 361.546,137.466 361.399 C 137.621 361.270,137.748 361.086,137.748 360.989 C 137.748 360.893,137.919 360.462,138.127 360.031 C 138.335 359.600,138.505 359.088,138.505 358.894 C 138.505 358.699,138.590 358.592,138.694 358.657 C 138.804 358.724,138.884 358.547,138.884 358.239 C 138.884 357.944,139.096 357.390,139.357 357.008 C 139.617 356.625,139.830 356.124,139.830 355.895 C 139.830 355.368,140.756 353.453,141.011 353.453 C 141.121 353.453,141.154 353.217,141.089 352.892 C 141.008 352.486,141.062 352.282,141.283 352.159 C 141.484 352.046,141.552 351.844,141.480 351.570 C 141.399 351.260,141.440 351.179,141.641 351.256 C 141.842 351.334,141.911 351.196,141.911 350.715 C 141.911 350.360,141.990 350.021,142.086 349.962 C 142.182 349.902,142.316 349.599,142.385 349.288 C 142.453 348.977,142.613 348.723,142.741 348.723 C 142.871 348.723,143.126 348.120,143.321 347.351 C 143.512 346.596,143.784 345.845,143.925 345.680 C 144.066 345.516,144.182 345.249,144.182 345.086 C 144.182 344.923,144.315 344.739,144.479 344.676 C 144.671 344.602,144.735 344.434,144.660 344.198 C 144.596 343.997,144.713 343.465,144.918 343.014 C 145.572 341.583,145.955 340.687,145.995 340.492 C 146.130 339.835,146.342 339.451,146.569 339.451 C 146.727 339.451,146.833 339.245,146.837 338.931 C 146.840 338.645,146.966 338.247,147.117 338.048 C 147.304 337.801,147.332 337.612,147.204 337.458 C 147.074 337.302,147.105 337.156,147.301 336.993 C 147.459 336.863,147.588 336.596,147.588 336.401 C 147.588 336.205,147.673 336.045,147.777 336.045 C 147.881 336.045,147.966 335.837,147.966 335.583 C 147.966 335.329,148.129 335.006,148.329 334.866 C 148.539 334.719,148.741 334.286,148.808 333.839 C 148.871 333.414,149.091 332.719,149.296 332.294 C 149.792 331.268,149.789 330.258,149.290 329.991 C 149.082 329.879,148.912 329.700,148.912 329.593 C 148.912 329.485,148.699 329.119,148.439 328.777 C 148.179 328.436,147.966 328.086,147.966 327.998 C 147.966 327.911,147.625 327.435,147.209 326.941 C 146.793 326.448,146.452 325.953,146.452 325.841 C 146.452 325.730,146.386 325.639,146.306 325.639 C 146.226 325.639,145.991 325.321,145.786 324.934 C 145.580 324.546,145.284 324.090,145.128 323.921 C 144.619 323.370,144.182 322.798,144.182 322.684 C 144.182 322.622,143.926 322.248,143.614 321.854 C 143.302 321.460,143.046 321.041,143.046 320.922 C 143.046 320.804,142.919 320.658,142.763 320.598 C 142.606 320.538,142.479 320.406,142.479 320.305 C 142.479 320.203,142.181 319.757,141.816 319.312 C 141.452 318.868,141.154 318.404,141.154 318.281 C 141.154 318.158,141.026 318.009,140.870 317.949 C 140.714 317.889,140.587 317.719,140.587 317.571 C 140.587 317.423,140.459 317.252,140.303 317.192 C 140.147 317.132,140.019 317.004,140.019 316.907 C 140.019 316.698,139.230 315.544,139.026 315.453 C 138.947 315.418,138.884 315.282,138.884 315.151 C 138.884 315.019,138.713 314.758,138.505 314.570 C 138.297 314.381,138.127 314.113,138.127 313.973 C 138.127 313.833,138.040 313.718,137.933 313.718 C 137.826 313.718,137.658 313.505,137.559 313.245 C 137.460 312.985,137.306 312.772,137.216 312.772 C 137.067 312.772,136.696 312.128,136.642 311.775 C 136.630 311.695,136.443 311.440,136.228 311.208 C 135.601 310.532,134.359 308.771,134.237 308.384 C 134.175 308.189,133.939 307.836,133.713 307.599 C 133.487 307.362,133.174 306.971,133.018 306.730 C 132.862 306.489,132.644 306.196,132.534 306.079 C 132.424 305.962,132.169 305.573,131.967 305.216 C 131.764 304.858,131.450 304.390,131.268 304.175 C 130.563 303.344,130.452 303.186,130.089 302.503 C 129.884 302.115,129.647 301.798,129.564 301.798 C 129.481 301.798,129.333 301.585,129.234 301.325 C 129.135 301.064,128.967 300.851,128.860 300.851 C 128.753 300.851,128.666 300.737,128.666 300.597 C 128.666 300.457,128.496 300.188,128.288 300.000 C 128.079 299.812,127.909 299.579,127.909 299.484 C 127.909 299.389,127.803 299.200,127.673 299.064 C 127.543 298.928,127.308 298.626,127.152 298.393 C 126.996 298.160,126.734 297.788,126.570 297.566 C 126.405 297.344,126.216 297.013,126.150 296.831 C 126.083 296.649,125.950 296.500,125.853 296.500 C 125.756 296.500,125.489 296.138,125.260 295.695 C 125.030 295.253,124.723 294.823,124.578 294.740 C 124.433 294.657,124.314 294.465,124.314 294.314 C 124.314 294.163,124.226 294.040,124.119 294.040 C 124.012 294.040,123.869 293.891,123.802 293.709 C 123.735 293.526,123.503 293.122,123.287 292.810 C 123.071 292.498,122.809 292.106,122.705 291.939 C 122.487 291.589,121.384 290.080,121.101 289.743 C 120.995 289.617,120.908 289.459,120.908 289.392 C 120.908 289.289,119.878 287.898,119.207 287.094 C 119.102 286.968,119.016 286.810,119.016 286.743 C 119.016 286.675,118.761 286.298,118.448 285.904 C 118.136 285.509,117.881 285.097,117.881 284.987 C 117.881 284.877,117.774 284.719,117.644 284.636 C 117.344 284.444,116.556 283.327,116.556 283.093 C 116.556 282.996,116.429 282.868,116.272 282.808 C 116.116 282.748,115.989 282.577,115.989 282.429 C 115.989 282.281,115.861 282.111,115.705 282.051 C 115.549 281.991,115.421 281.851,115.421 281.739 C 115.421 281.511,114.646 280.356,114.428 280.259 C 114.350 280.224,114.286 280.079,114.286 279.937 C 114.286 279.795,114.179 279.610,114.049 279.527 C 113.749 279.335,112.961 278.218,112.961 277.984 C 112.961 277.887,112.833 277.759,112.677 277.699 C 112.521 277.639,112.394 277.503,112.394 277.396 C 112.394 276.953,110.065 274.176,109.691 274.173 C 109.610 274.173,109.493 274.305,109.430 274.467 \" stroke=\"none\" fill=\"#8ca516\" fill-rule=\"evenodd\"></path><path id=\"path5\" d=\"\" stroke=\"none\" fill=\"#6db600\" fill-rule=\"evenodd\"></path><path id=\"path6\" d=\"M79.186 45.256 C 78.978 45.372,78.369 45.838,77.832 46.291 C 77.295 46.744,76.809 47.114,76.752 47.114 C 76.696 47.114,76.441 47.306,76.186 47.540 C 75.500 48.170,75.046 48.533,74.934 48.540 C 74.693 48.557,73.983 49.116,73.983 49.289 C 73.982 49.611,72.116 51.366,71.950 51.200 C 71.890 51.140,71.722 51.260,71.577 51.468 C 71.431 51.675,71.190 51.845,71.039 51.845 C 70.889 51.845,70.766 52.019,70.766 52.232 C 70.766 52.464,70.539 52.748,70.200 52.942 C 69.888 53.119,69.633 53.328,69.632 53.406 C 69.632 53.484,69.461 53.548,69.253 53.548 C 69.044 53.548,68.874 53.634,68.874 53.739 C 68.874 53.992,67.915 55.061,67.688 55.061 C 67.590 55.061,67.342 55.274,67.137 55.535 C 66.933 55.795,66.647 56.008,66.502 56.008 C 66.357 56.008,66.137 56.197,66.013 56.429 C 65.743 56.933,65.537 57.138,64.871 57.564 C 64.594 57.741,64.126 58.227,63.830 58.644 C 63.452 59.177,63.194 59.371,62.961 59.300 C 62.776 59.244,62.630 59.297,62.630 59.421 C 62.630 59.747,61.733 60.786,61.150 61.136 C 60.865 61.307,60.668 61.576,60.699 61.751 C 60.730 61.922,60.634 62.062,60.487 62.062 C 60.249 62.062,59.039 63.359,58.877 63.788 C 58.843 63.879,58.688 63.955,58.533 63.955 C 58.258 63.955,57.711 64.387,57.711 64.603 C 57.711 64.663,57.561 64.867,57.379 65.056 C 57.197 65.246,56.793 65.714,56.482 66.097 C 56.170 66.480,55.804 66.793,55.668 66.793 C 55.532 66.793,55.296 67.091,55.144 67.455 C 54.992 67.819,54.762 68.121,54.633 68.125 C 54.505 68.130,53.463 69.275,52.318 70.671 C 51.173 72.067,50.086 73.262,49.903 73.326 C 49.719 73.390,49.605 73.501,49.649 73.573 C 49.805 73.824,49.216 74.409,48.921 74.296 C 48.711 74.216,48.627 74.303,48.625 74.604 C 48.622 75.122,48.429 75.402,48.074 75.402 C 47.926 75.402,47.741 75.638,47.663 75.927 C 47.586 76.216,47.349 76.642,47.137 76.874 C 46.126 77.977,44.276 80.266,44.276 80.414 C 44.276 80.505,44.106 80.634,43.898 80.700 C 43.690 80.766,43.519 80.985,43.519 81.186 C 43.519 81.387,43.390 81.701,43.233 81.883 C 41.478 83.908,40.527 85.119,40.618 85.210 C 40.679 85.271,40.378 85.740,39.948 86.253 C 39.519 86.766,39.167 87.281,39.167 87.396 C 39.167 87.512,39.040 87.606,38.884 87.606 C 38.728 87.606,38.600 87.763,38.600 87.954 C 38.600 88.146,38.324 88.625,37.988 89.019 C 37.651 89.413,37.374 89.838,37.373 89.964 C 37.371 90.090,36.944 90.679,36.424 91.275 C 35.904 91.870,35.500 92.441,35.527 92.542 C 35.554 92.644,35.398 92.916,35.181 93.147 C 34.964 93.378,34.676 93.822,34.542 94.134 C 34.408 94.447,34.074 94.941,33.800 95.232 C 33.526 95.524,33.302 95.856,33.302 95.971 C 33.302 96.086,33.089 96.459,32.829 96.800 C 32.569 97.141,32.356 97.527,32.356 97.657 C 32.356 97.788,32.194 98.070,31.996 98.285 C 31.656 98.654,31.110 99.547,30.515 100.706 C 30.370 100.990,30.171 101.272,30.073 101.332 C 29.976 101.392,29.896 101.592,29.896 101.776 C 29.896 101.960,29.683 102.310,29.423 102.554 C 29.163 102.799,28.950 103.139,28.950 103.311 C 28.950 103.483,28.745 103.816,28.495 104.051 C 28.245 104.286,27.983 104.780,27.914 105.149 C 27.845 105.518,27.539 106.085,27.233 106.410 C 26.928 106.735,26.716 107.099,26.761 107.220 C 26.806 107.340,26.678 107.587,26.477 107.769 C 26.276 107.951,26.112 108.252,26.112 108.438 C 26.112 108.624,26.032 108.825,25.934 108.886 C 25.725 109.015,25.166 110.097,25.166 110.374 C 25.166 110.480,25.049 110.701,24.908 110.865 C 24.766 111.029,24.497 111.573,24.310 112.072 C 24.124 112.572,23.805 113.098,23.602 113.240 C 23.388 113.390,23.291 113.594,23.372 113.724 C 23.448 113.848,23.409 114.012,23.285 114.089 C 23.161 114.166,23.040 114.357,23.017 114.513 C 22.994 114.669,22.842 115.001,22.679 115.251 C 22.516 115.500,22.320 115.918,22.245 116.178 C 22.005 117.008,21.524 117.971,21.276 118.117 C 21.144 118.196,20.979 118.600,20.908 119.016 C 20.838 119.432,20.703 119.773,20.608 119.773 C 20.513 119.773,20.435 119.909,20.435 120.075 C 20.435 120.390,19.954 121.350,19.531 121.878 C 19.395 122.047,19.304 122.260,19.328 122.351 C 19.423 122.710,19.048 123.830,18.710 124.192 C 18.514 124.402,18.354 124.722,18.354 124.902 C 18.354 125.081,18.265 125.258,18.156 125.294 C 18.048 125.331,17.934 125.593,17.904 125.878 C 17.874 126.163,17.792 126.453,17.723 126.522 C 17.654 126.591,17.597 126.800,17.597 126.985 C 17.597 127.171,17.456 127.402,17.284 127.498 C 17.104 127.598,17.019 127.797,17.083 127.965 C 17.148 128.134,17.072 128.303,16.903 128.368 C 16.743 128.430,16.659 128.604,16.718 128.756 C 16.776 128.908,16.742 129.083,16.643 129.144 C 16.543 129.206,16.462 129.496,16.462 129.789 C 16.462 130.083,16.337 130.426,16.184 130.553 C 16.031 130.680,15.913 130.839,15.922 130.907 C 15.975 131.306,15.854 131.666,15.559 131.989 C 15.375 132.191,15.231 132.483,15.240 132.640 C 15.254 132.898,14.806 134.251,14.394 135.194 C 14.034 136.017,13.441 137.881,13.325 138.555 C 13.257 138.946,13.127 139.313,13.034 139.370 C 12.942 139.427,12.867 139.724,12.867 140.030 C 12.867 140.336,12.781 140.587,12.677 140.587 C 12.573 140.587,12.488 140.752,12.488 140.954 C 12.488 141.156,12.403 141.374,12.299 141.438 C 12.195 141.502,12.108 141.784,12.106 142.064 C 12.103 142.344,11.940 142.928,11.743 143.362 C 11.546 143.796,11.432 144.198,11.489 144.255 C 11.547 144.312,11.412 144.782,11.189 145.299 C 10.967 145.816,10.785 146.405,10.785 146.608 C 10.785 146.811,10.658 147.220,10.503 147.519 C 10.347 147.817,10.219 148.290,10.219 148.570 C 10.218 148.850,10.144 149.124,10.054 149.180 C 9.964 149.236,9.832 149.645,9.760 150.090 C 9.514 151.625,8.933 154.114,8.690 154.683 C 8.531 155.055,8.445 155.436,7.841 158.467 C 7.675 159.300,7.457 160.135,7.357 160.323 C 7.256 160.510,7.122 161.216,7.060 161.890 C 6.997 162.564,6.873 163.160,6.784 163.215 C 6.695 163.270,6.621 163.586,6.620 163.918 C 6.618 164.251,6.490 165.061,6.335 165.719 C 6.180 166.377,6.010 167.271,5.957 167.706 C 5.904 168.140,5.815 168.794,5.757 169.158 C 5.700 169.522,5.628 170.076,5.597 170.388 C 5.566 170.700,5.489 171.083,5.425 171.239 C 5.361 171.395,5.221 172.247,5.113 173.132 C 5.006 174.016,4.874 174.995,4.821 175.307 C 4.767 175.620,4.675 176.471,4.616 177.200 C 4.557 177.928,4.436 178.612,4.347 178.719 C 4.258 178.827,4.184 179.337,4.182 179.854 C 4.180 180.372,4.133 181.306,4.077 181.930 C 4.021 182.554,3.937 183.576,3.890 184.201 C 3.843 184.825,3.790 185.336,3.772 185.336 C 3.711 185.336,3.445 190.033,3.343 192.917 C 3.310 193.860,3.223 194.729,3.149 194.847 C 3.017 195.060,3.058 195.456,3.313 196.452 C 3.388 196.743,3.369 196.973,3.271 196.973 C 2.976 196.973,3.139 207.939,3.515 213.434 C 3.575 214.319,3.650 215.511,3.680 216.083 C 3.711 216.656,3.841 218.188,3.969 219.489 C 4.098 220.790,4.193 222.138,4.181 222.485 C 4.170 222.833,4.219 223.211,4.291 223.327 C 4.449 223.584,4.491 223.880,4.653 225.875 C 4.722 226.734,4.832 227.436,4.897 227.436 C 4.961 227.436,5.029 227.670,5.047 227.956 C 5.081 228.509,5.332 230.268,5.686 232.450 C 5.804 233.179,5.892 234.009,5.880 234.295 C 5.869 234.581,5.927 234.816,6.010 234.816 C 6.092 234.816,6.155 235.163,6.149 235.587 C 6.144 236.012,6.205 236.400,6.286 236.450 C 6.367 236.500,6.433 236.797,6.433 237.110 C 6.433 237.423,6.516 237.833,6.617 238.023 C 6.719 238.212,6.898 238.994,7.016 239.760 C 7.134 240.527,7.282 241.239,7.344 241.342 C 7.407 241.445,7.471 241.785,7.488 242.099 C 7.504 242.412,7.616 243.024,7.736 243.460 C 7.857 243.896,7.937 244.321,7.916 244.406 C 7.894 244.491,8.052 245.128,8.267 245.821 C 8.482 246.515,8.615 247.303,8.564 247.572 C 8.511 247.851,8.557 248.061,8.673 248.061 C 8.785 248.061,8.929 248.380,8.994 248.770 C 9.059 249.160,9.162 249.607,9.224 249.763 C 9.286 249.920,9.352 250.218,9.370 250.426 C 9.389 250.634,9.502 251.044,9.622 251.337 C 9.741 251.630,9.839 252.027,9.839 252.220 C 9.839 252.413,9.929 252.600,10.040 252.637 C 10.150 252.674,10.245 253.071,10.251 253.519 C 10.258 254.029,10.360 254.371,10.524 254.434 C 10.668 254.489,10.785 254.736,10.785 254.982 C 10.785 255.505,11.579 258.598,11.996 259.697 C 12.153 260.114,12.286 260.593,12.291 260.764 C 12.295 260.934,12.426 261.317,12.582 261.615 C 12.737 261.913,12.865 262.292,12.865 262.457 C 12.866 262.621,12.926 262.815,12.998 262.888 C 13.071 262.960,13.152 263.123,13.179 263.251 C 13.404 264.299,13.720 265.234,13.934 265.483 C 14.076 265.648,14.191 265.999,14.191 266.264 C 14.191 266.529,14.319 266.852,14.475 266.982 C 14.631 267.112,14.759 267.458,14.759 267.751 C 14.759 268.044,14.838 268.333,14.936 268.393 C 15.033 268.454,15.252 268.991,15.423 269.587 C 15.594 270.184,15.898 270.953,16.098 271.297 C 16.298 271.642,16.462 272.082,16.462 272.275 C 16.462 272.469,16.558 272.659,16.675 272.698 C 16.792 272.737,16.907 272.936,16.929 273.139 C 17.027 274.010,17.279 274.723,17.524 274.816 C 17.668 274.872,17.786 275.128,17.786 275.385 C 17.786 275.642,17.871 275.905,17.975 275.970 C 18.079 276.034,18.165 276.232,18.165 276.409 C 18.165 276.587,18.335 277.050,18.543 277.438 C 18.751 277.827,18.925 278.294,18.928 278.476 C 18.932 278.659,19.137 279.055,19.384 279.357 C 19.631 279.659,19.788 280.024,19.733 280.169 C 19.678 280.313,19.771 280.583,19.940 280.770 C 20.109 280.957,20.375 281.538,20.530 282.062 C 20.686 282.585,20.983 283.230,21.192 283.495 C 21.400 283.760,21.570 284.084,21.570 284.216 C 21.570 284.347,21.687 284.589,21.830 284.753 C 21.973 284.918,22.233 285.494,22.409 286.035 C 22.585 286.575,22.882 287.214,23.070 287.454 C 23.257 287.694,23.476 288.103,23.555 288.363 C 23.635 288.623,23.944 289.172,24.243 289.583 C 24.542 289.994,24.787 290.569,24.787 290.860 C 24.787 291.152,24.852 291.391,24.931 291.391 C 25.093 291.391,25.194 291.562,26.053 293.295 C 26.385 293.965,26.875 294.806,27.141 295.164 C 27.407 295.523,27.625 295.999,27.625 296.223 C 27.625 296.447,27.796 296.784,28.004 296.973 C 28.212 297.161,28.382 297.402,28.382 297.507 C 28.382 297.613,28.501 297.834,28.647 297.998 C 29.249 298.678,29.679 299.668,29.465 299.882 C 29.311 300.036,29.391 300.234,29.765 300.624 C 30.045 300.917,30.274 301.258,30.274 301.382 C 30.274 301.507,30.346 301.608,30.433 301.608 C 30.521 301.608,30.692 301.800,30.815 302.034 C 30.937 302.268,31.289 302.800,31.596 303.217 C 31.903 303.633,32.157 304.086,32.160 304.224 C 32.164 304.361,32.273 304.592,32.403 304.737 C 32.948 305.345,33.113 305.575,33.113 305.728 C 33.113 305.817,33.367 306.133,33.678 306.431 C 34.339 307.065,34.665 306.968,36.013 305.736 C 36.434 305.351,36.848 305.079,36.934 305.132 C 37.019 305.184,37.140 305.094,37.202 304.932 C 37.265 304.769,37.430 304.636,37.569 304.636 C 37.708 304.636,37.940 304.466,38.086 304.259 C 38.231 304.051,38.408 303.939,38.479 304.011 C 38.550 304.082,38.739 303.953,38.899 303.726 C 39.058 303.498,39.308 303.311,39.453 303.311 C 39.598 303.311,39.784 303.205,39.868 303.075 C 39.951 302.945,40.307 302.677,40.660 302.481 C 41.013 302.284,41.460 301.986,41.653 301.819 C 41.847 301.651,42.169 301.372,42.368 301.198 C 42.568 301.025,42.783 300.935,42.846 300.998 C 42.909 301.061,43.091 300.926,43.251 300.698 C 43.410 300.470,43.655 300.284,43.794 300.284 C 43.933 300.284,44.098 300.151,44.160 299.988 C 44.222 299.825,44.350 299.739,44.443 299.797 C 44.536 299.854,44.941 299.597,45.343 299.225 C 45.745 298.853,46.383 298.390,46.760 298.195 C 47.137 298.000,47.497 297.709,47.558 297.548 C 47.620 297.388,47.790 297.256,47.937 297.256 C 48.083 297.256,48.309 297.130,48.437 296.975 C 48.566 296.820,48.747 296.740,48.840 296.797 C 48.933 296.855,49.061 296.768,49.123 296.605 C 49.186 296.442,49.544 296.163,49.920 295.985 C 50.295 295.806,50.746 295.530,50.921 295.371 C 51.096 295.211,51.463 294.877,51.737 294.629 C 52.011 294.381,52.289 294.231,52.354 294.297 C 52.420 294.362,52.593 294.245,52.740 294.035 C 52.886 293.826,53.080 293.701,53.171 293.757 C 53.261 293.813,53.404 293.750,53.489 293.618 C 53.635 293.389,54.125 293.034,54.633 292.790 C 54.761 292.728,55.229 292.345,55.673 291.939 C 56.117 291.534,56.558 291.202,56.652 291.202 C 56.746 291.202,57.129 290.968,57.503 290.682 C 57.877 290.396,58.245 290.182,58.320 290.207 C 58.395 290.232,58.547 290.082,58.658 289.875 C 58.768 289.668,58.987 289.499,59.142 289.499 C 59.298 289.499,59.476 289.366,59.538 289.204 C 59.601 289.042,59.753 288.948,59.877 288.996 C 60.001 289.043,60.204 288.921,60.327 288.723 C 60.451 288.525,60.636 288.363,60.740 288.363 C 60.843 288.363,61.097 288.214,61.306 288.032 C 61.514 287.850,61.861 287.545,62.078 287.354 C 62.295 287.163,62.515 287.050,62.567 287.102 C 62.619 287.154,62.825 287.055,63.024 286.881 C 63.224 286.708,63.550 286.424,63.750 286.250 C 63.949 286.077,64.164 285.987,64.227 286.050 C 64.290 286.113,64.472 285.978,64.632 285.750 C 64.792 285.522,65.025 285.336,65.150 285.336 C 65.275 285.336,65.484 285.166,65.614 284.957 C 65.744 284.749,65.950 284.579,66.073 284.579 C 66.196 284.579,66.784 284.196,67.380 283.728 C 67.976 283.259,68.556 282.876,68.669 282.876 C 68.782 282.876,68.874 282.801,68.874 282.709 C 68.874 282.617,69.023 282.488,69.205 282.422 C 69.809 282.204,70.450 281.773,70.619 281.471 C 70.710 281.307,70.904 281.173,71.050 281.173 C 71.196 281.173,71.383 281.056,71.466 280.912 C 71.550 280.769,71.919 280.491,72.286 280.296 C 72.944 279.946,73.261 279.714,74.012 279.029 C 74.222 278.838,74.434 278.722,74.483 278.772 C 74.533 278.822,74.773 278.680,75.017 278.457 C 75.752 277.784,76.020 277.596,76.111 277.688 C 76.159 277.735,76.572 277.432,77.030 277.014 C 77.487 276.596,77.959 276.254,78.078 276.254 C 78.197 276.254,78.347 276.117,78.411 275.950 C 78.475 275.783,78.639 275.690,78.776 275.742 C 78.912 275.794,79.127 275.672,79.253 275.470 C 79.379 275.269,79.561 275.152,79.656 275.211 C 79.752 275.270,79.922 275.145,80.035 274.934 C 80.148 274.723,80.356 274.551,80.497 274.551 C 80.639 274.551,80.803 274.423,80.863 274.267 C 80.923 274.111,81.092 273.983,81.239 273.983 C 81.385 273.983,81.609 273.858,81.736 273.705 C 81.863 273.552,82.022 273.446,82.090 273.469 C 82.158 273.491,82.405 273.340,82.640 273.132 C 82.874 272.923,83.243 272.597,83.459 272.406 C 83.676 272.215,83.903 272.108,83.963 272.168 C 84.023 272.229,84.191 272.108,84.336 271.900 C 84.482 271.693,84.723 271.523,84.874 271.523 C 85.024 271.523,85.147 271.438,85.147 271.334 C 85.147 271.230,85.296 271.145,85.480 271.145 C 85.663 271.145,85.921 270.971,86.053 270.759 C 86.186 270.547,86.367 270.418,86.457 270.474 C 86.546 270.529,86.758 270.362,86.928 270.102 C 87.098 269.843,87.362 269.631,87.516 269.631 C 87.670 269.631,87.796 269.554,87.796 269.461 C 87.796 269.367,88.158 269.103,88.600 268.874 C 89.042 268.644,89.472 268.337,89.555 268.192 C 89.639 268.047,89.830 267.928,89.981 267.928 C 90.132 267.928,90.255 267.841,90.255 267.734 C 90.255 267.628,90.468 267.459,90.728 267.360 C 90.989 267.262,91.202 267.113,91.202 267.030 C 91.202 266.947,91.521 266.713,91.911 266.511 C 92.632 266.138,92.857 265.977,93.614 265.288 C 93.848 265.075,94.105 264.922,94.185 264.948 C 94.328 264.994,94.626 264.780,95.394 264.081 C 95.603 263.890,95.823 263.783,95.883 263.843 C 95.943 263.903,96.111 263.782,96.257 263.575 C 96.402 263.367,96.641 263.198,96.787 263.198 C 96.934 263.198,97.145 263.027,97.256 262.819 C 97.368 262.611,97.566 262.441,97.696 262.441 C 97.826 262.441,98.228 262.189,98.588 261.881 C 98.948 261.573,99.345 261.318,99.470 261.313 C 99.595 261.309,99.765 261.199,99.849 261.069 C 99.932 260.939,100.170 260.738,100.378 260.623 C 100.865 260.354,100.977 259.783,100.587 259.564 C 100.420 259.471,100.284 259.324,100.284 259.238 C 100.284 259.151,99.986 258.586,99.622 257.981 C 99.257 257.376,98.959 256.766,98.959 256.626 C 98.959 256.485,98.803 256.202,98.612 255.997 C 98.421 255.792,97.979 255.051,97.629 254.350 C 97.279 253.648,96.927 253.047,96.847 253.014 C 96.766 252.980,96.644 252.639,96.575 252.257 C 96.507 251.874,96.369 251.458,96.270 251.333 C 95.977 250.964,95.364 249.702,95.364 249.469 C 95.364 249.350,95.194 249.057,94.986 248.817 C 94.778 248.577,94.607 248.192,94.607 247.960 C 94.607 247.729,94.480 247.433,94.324 247.304 C 94.167 247.174,94.039 246.972,94.039 246.855 C 94.038 246.737,93.928 246.429,93.794 246.168 C 93.659 245.908,93.364 245.142,93.137 244.465 C 92.909 243.789,92.551 242.898,92.341 242.486 C 92.131 242.074,91.958 241.551,91.958 241.324 C 91.958 241.097,91.831 240.862,91.675 240.802 C 91.518 240.742,91.391 240.480,91.391 240.219 C 91.391 239.959,91.175 239.258,90.912 238.663 C 90.648 238.067,90.474 237.471,90.525 237.339 C 90.576 237.207,90.536 237.048,90.436 236.986 C 90.337 236.925,90.255 236.743,90.255 236.583 C 90.255 236.423,90.138 236.024,89.994 235.696 C 89.633 234.873,89.405 234.170,89.035 232.734 C 88.860 232.058,88.638 231.243,88.540 230.923 C 88.443 230.604,88.363 230.199,88.363 230.024 C 88.363 229.850,88.269 229.707,88.154 229.707 C 88.038 229.707,87.997 229.569,88.062 229.399 C 88.127 229.230,88.106 228.995,88.014 228.879 C 87.923 228.762,87.793 228.249,87.727 227.739 C 87.660 227.229,87.529 226.718,87.435 226.604 C 87.341 226.489,87.205 225.885,87.133 225.260 C 87.061 224.636,86.875 223.674,86.720 223.122 C 86.565 222.570,86.365 221.506,86.276 220.757 C 86.039 218.777,85.722 216.991,85.531 216.556 C 85.440 216.348,85.312 215.241,85.247 214.096 C 85.073 211.034,84.952 209.437,84.844 208.798 C 84.589 207.284,84.477 198.358,84.678 195.553 C 84.730 194.825,84.809 193.718,84.853 193.094 C 84.897 192.469,85.030 190.851,85.149 189.499 C 85.269 188.146,85.391 186.729,85.421 186.350 C 85.452 185.972,85.521 185.588,85.574 185.499 C 85.628 185.409,85.733 184.697,85.808 183.917 C 85.884 183.136,86.031 182.392,86.135 182.264 C 86.239 182.135,86.272 181.893,86.208 181.726 C 86.144 181.559,86.155 181.324,86.233 181.203 C 86.311 181.083,86.476 180.345,86.598 179.565 C 86.721 178.784,86.878 177.933,86.947 177.673 C 87.017 177.412,87.119 176.753,87.174 176.206 C 87.230 175.660,87.347 175.213,87.434 175.213 C 87.522 175.213,87.650 174.785,87.719 174.263 C 87.789 173.740,87.916 173.269,88.001 173.216 C 88.087 173.163,88.214 172.612,88.284 171.990 C 88.355 171.369,88.477 170.861,88.556 170.861 C 88.679 170.861,88.867 170.215,89.051 169.158 C 89.178 168.428,89.542 167.132,89.766 166.612 C 90.345 165.264,90.429 164.986,90.334 164.738 C 90.279 164.594,90.375 164.422,90.548 164.356 C 90.726 164.287,90.816 164.116,90.756 163.959 C 90.698 163.807,90.732 163.633,90.831 163.571 C 90.931 163.510,91.012 163.214,91.012 162.914 C 91.012 162.614,91.097 162.316,91.202 162.252 C 91.306 162.187,91.391 161.991,91.392 161.815 C 91.393 161.639,91.520 161.251,91.676 160.953 C 91.831 160.655,91.958 160.303,91.958 160.172 C 91.958 160.040,92.086 159.827,92.242 159.697 C 92.398 159.568,92.526 159.217,92.526 158.917 C 92.526 158.618,92.611 158.373,92.715 158.373 C 92.819 158.373,92.904 158.207,92.904 158.005 C 92.904 157.803,92.990 157.586,93.094 157.521 C 93.198 157.457,93.283 157.239,93.283 157.037 C 93.283 156.835,93.368 156.670,93.472 156.670 C 93.576 156.670,93.661 156.457,93.661 156.197 C 93.661 155.937,93.746 155.724,93.851 155.724 C 93.955 155.724,94.040 155.558,94.040 155.356 C 94.040 155.154,94.114 154.943,94.205 154.887 C 94.295 154.831,94.424 154.513,94.491 154.179 C 94.557 153.846,94.732 153.439,94.879 153.276 C 95.025 153.113,95.173 152.854,95.207 152.701 C 95.242 152.547,95.372 152.311,95.498 152.175 C 95.624 152.039,95.683 151.814,95.629 151.675 C 95.576 151.535,95.668 151.368,95.835 151.304 C 96.002 151.240,96.122 151.080,96.101 150.949 C 96.052 150.643,96.622 149.354,96.875 149.198 C 96.981 149.132,97.067 148.918,97.067 148.722 C 97.067 148.526,97.247 148.240,97.466 148.086 C 97.686 147.933,97.814 147.725,97.753 147.625 C 97.691 147.525,97.809 147.228,98.016 146.965 C 98.223 146.702,98.392 146.357,98.392 146.197 C 98.392 146.037,98.472 145.857,98.570 145.797 C 98.668 145.736,98.936 145.310,99.166 144.849 C 99.396 144.389,99.678 144.029,99.792 144.049 C 99.907 144.070,99.973 143.930,99.940 143.737 C 99.907 143.545,99.992 143.247,100.129 143.075 C 100.434 142.693,100.816 142.036,101.254 141.139 C 101.437 140.767,101.719 140.352,101.881 140.218 C 102.043 140.083,102.176 139.856,102.176 139.712 C 102.176 139.569,102.472 139.124,102.835 138.723 C 103.197 138.322,103.444 137.944,103.382 137.883 C 103.256 137.756,104.837 135.667,105.059 135.667 C 105.138 135.667,105.203 135.517,105.203 135.334 C 105.203 135.151,105.500 134.661,105.862 134.246 C 106.224 133.831,106.522 133.385,106.524 133.254 C 106.526 133.124,106.627 133.039,106.748 133.065 C 106.869 133.091,107.018 132.927,107.079 132.700 C 107.192 132.281,107.820 131.433,108.930 130.202 C 109.269 129.825,109.549 129.414,109.551 129.288 C 109.553 129.161,109.726 128.967,109.934 128.855 C 110.142 128.744,110.312 128.528,110.312 128.376 C 110.312 128.223,110.405 128.098,110.518 128.098 C 110.815 128.098,111.434 127.306,111.441 126.916 C 111.445 126.717,111.593 126.585,111.813 126.585 C 112.072 126.585,112.197 126.432,112.239 126.064 C 112.280 125.705,112.401 125.552,112.630 125.570 C 112.812 125.585,112.961 125.521,112.961 125.429 C 112.961 125.337,113.259 124.931,113.623 124.528 C 113.988 124.125,114.286 123.699,114.286 123.582 C 114.286 123.464,114.413 123.368,114.570 123.368 C 114.726 123.368,114.854 123.304,114.854 123.226 C 114.855 122.992,116.210 121.476,116.417 121.476 C 116.688 121.476,117.111 120.877,117.118 120.482 C 117.121 120.297,117.270 120.149,117.455 120.147 C 117.637 120.144,118.031 119.811,118.331 119.405 C 118.654 118.970,118.982 118.709,119.135 118.768 C 119.278 118.823,119.395 118.791,119.395 118.698 C 119.395 118.605,119.733 118.149,120.146 117.685 C 120.559 117.220,120.900 116.776,120.903 116.698 C 120.906 116.620,121.026 116.556,121.170 116.556 C 121.313 116.556,121.656 116.262,121.930 115.901 C 122.243 115.491,122.534 115.287,122.710 115.354 C 122.884 115.421,122.990 115.348,122.990 115.161 C 122.990 114.996,123.181 114.810,123.415 114.748 C 123.649 114.687,124.120 114.259,124.462 113.799 C 124.804 113.338,125.169 112.961,125.275 112.961 C 125.625 112.961,126.383 111.929,126.388 111.447 C 126.391 111.052,125.869 110.217,124.884 109.043 C 124.779 108.917,124.689 108.747,124.685 108.665 C 124.681 108.582,124.425 108.220,124.117 107.860 C 123.809 107.499,123.557 107.123,123.557 107.024 C 123.557 106.925,123.427 106.709,123.269 106.544 C 122.761 106.017,121.665 104.476,121.665 104.289 C 121.665 104.190,121.537 104.060,121.381 104.000 C 121.225 103.940,121.097 103.790,121.097 103.668 C 121.097 103.545,120.799 103.081,120.435 102.637 C 120.071 102.192,119.773 101.736,119.773 101.624 C 119.773 101.511,119.688 101.419,119.584 101.419 C 119.480 101.419,119.395 101.305,119.395 101.165 C 119.395 101.025,119.224 100.756,119.016 100.568 C 118.808 100.379,118.638 100.120,118.638 99.991 C 118.638 99.862,118.510 99.708,118.354 99.648 C 118.198 99.588,118.070 99.413,118.070 99.258 C 118.070 99.104,117.959 98.910,117.823 98.827 C 117.687 98.744,117.373 98.335,117.124 97.919 C 116.875 97.502,116.561 97.094,116.425 97.010 C 116.289 96.927,116.178 96.766,116.178 96.652 C 116.178 96.537,115.880 96.080,115.516 95.636 C 115.151 95.191,114.853 94.753,114.853 94.663 C 114.853 94.573,114.601 94.204,114.293 93.843 C 113.985 93.483,113.730 93.121,113.726 93.038 C 113.722 92.956,113.632 92.786,113.527 92.660 C 112.772 91.760,112.204 90.922,112.204 90.709 C 112.204 90.571,112.034 90.367,111.826 90.255 C 111.618 90.144,111.447 89.926,111.447 89.770 C 111.447 89.614,111.320 89.438,111.164 89.378 C 111.008 89.318,110.880 89.189,110.880 89.092 C 110.880 88.883,110.091 87.729,109.886 87.638 C 109.808 87.603,109.745 87.459,109.745 87.316 C 109.745 87.174,109.638 86.990,109.508 86.906 C 109.195 86.706,108.420 85.593,108.420 85.344 C 108.420 85.235,108.333 85.147,108.226 85.147 C 108.120 85.147,107.951 84.934,107.852 84.674 C 107.753 84.413,107.585 84.201,107.479 84.201 C 107.372 84.201,107.285 84.112,107.285 84.004 C 107.285 83.795,106.542 82.672,106.274 82.476 C 106.086 82.338,105.636 81.589,105.472 81.139 C 105.408 80.964,105.236 80.775,105.090 80.719 C 104.944 80.663,104.825 80.496,104.825 80.348 C 104.825 80.200,104.697 80.029,104.541 79.969 C 104.385 79.910,104.257 79.743,104.257 79.600 C 104.257 79.457,104.087 79.186,103.879 78.997 C 103.671 78.809,103.500 78.582,103.500 78.493 C 103.500 78.404,103.032 77.698,102.460 76.924 C 101.887 76.150,101.419 75.467,101.419 75.407 C 101.419 75.346,101.100 74.885,100.710 74.382 C 100.319 73.879,99.872 73.278,99.716 73.046 C 99.560 72.815,99.262 72.431,99.054 72.193 C 98.846 71.956,98.505 71.477,98.297 71.129 C 98.089 70.781,97.769 70.280,97.585 70.016 C 97.402 69.752,97.200 69.387,97.138 69.205 C 97.075 69.023,96.946 68.874,96.851 68.874 C 96.757 68.874,96.598 68.661,96.500 68.401 C 96.401 68.141,96.232 67.928,96.126 67.928 C 96.019 67.928,95.932 67.836,95.932 67.723 C 95.932 67.611,95.634 67.155,95.270 66.711 C 94.905 66.266,94.607 65.805,94.607 65.685 C 94.607 65.566,94.520 65.468,94.413 65.468 C 94.307 65.468,94.137 65.277,94.036 65.043 C 93.750 64.382,93.408 63.889,93.046 63.616 C 92.864 63.478,92.715 63.261,92.715 63.133 C 92.715 63.004,92.463 62.605,92.155 62.245 C 91.847 61.884,91.592 61.522,91.588 61.440 C 91.583 61.357,91.494 61.187,91.389 61.061 C 90.740 60.285,89.688 58.868,89.688 58.772 C 89.688 58.668,88.254 56.616,87.796 56.063 C 87.692 55.937,87.606 55.776,87.606 55.704 C 87.606 55.632,87.308 55.210,86.944 54.765 C 86.580 54.321,86.282 53.872,86.282 53.768 C 86.282 53.664,86.218 53.551,86.140 53.516 C 85.977 53.444,85.147 52.290,85.147 52.136 C 85.147 52.080,84.998 51.870,84.816 51.669 C 84.309 51.111,84.132 50.868,83.637 50.047 C 83.386 49.631,83.070 49.222,82.934 49.139 C 82.798 49.056,82.687 48.894,82.687 48.780 C 82.687 48.666,82.389 48.209,82.025 47.764 C 81.660 47.320,81.362 46.864,81.362 46.752 C 81.362 46.639,81.277 46.547,81.173 46.547 C 81.069 46.547,80.984 46.433,80.984 46.294 C 80.984 46.033,79.963 45.029,79.708 45.039 C 79.629 45.042,79.395 45.140,79.186 45.256 \" stroke=\"none\" fill=\"#9fbb1a\" fill-rule=\"evenodd\"></path><path id=\"path7\" d=\"M190.728 4.092 C 190.364 4.223,189.799 4.285,189.473 4.229 C 189.135 4.172,188.824 4.219,188.750 4.338 C 188.679 4.453,188.530 4.491,188.419 4.423 C 188.117 4.236,186.136 4.191,185.800 4.363 C 185.639 4.446,184.674 4.555,183.655 4.606 C 182.637 4.658,181.757 4.746,181.700 4.803 C 181.643 4.860,181.445 4.825,181.260 4.726 C 181.028 4.602,180.702 4.639,180.211 4.844 C 179.819 5.008,179.236 5.103,178.916 5.056 C 178.597 5.009,178.153 5.054,177.930 5.155 C 177.665 5.276,177.408 5.275,177.188 5.151 C 176.939 5.012,176.677 5.060,176.193 5.332 C 175.705 5.606,175.498 5.643,175.395 5.476 C 175.317 5.350,175.150 5.315,175.018 5.396 C 174.731 5.574,173.781 5.731,173.132 5.709 C 172.871 5.700,172.531 5.745,172.375 5.809 C 172.219 5.872,171.835 5.942,171.523 5.964 C 171.211 5.986,170.805 6.068,170.621 6.145 C 170.437 6.223,170.057 6.243,169.775 6.189 C 169.494 6.135,168.963 6.205,168.596 6.343 C 168.229 6.481,167.673 6.577,167.360 6.556 C 167.048 6.534,166.553 6.631,166.259 6.771 C 165.966 6.910,165.540 7.007,165.313 6.985 C 165.086 6.963,164.773 6.996,164.617 7.059 C 164.461 7.122,163.936 7.213,163.450 7.261 C 162.965 7.310,162.403 7.437,162.203 7.544 C 162.003 7.651,161.464 7.761,161.005 7.788 C 160.547 7.815,159.865 7.985,159.491 8.166 C 159.117 8.347,158.627 8.447,158.401 8.388 C 158.176 8.329,157.886 8.367,157.757 8.472 C 157.627 8.576,157.223 8.661,156.859 8.658 C 156.495 8.656,155.899 8.785,155.535 8.945 C 155.170 9.104,154.532 9.288,154.115 9.354 C 153.699 9.419,153.018 9.570,152.602 9.689 C 152.185 9.809,151.771 9.888,151.680 9.865 C 151.589 9.842,151.079 9.974,150.545 10.156 C 150.011 10.339,149.404 10.494,149.196 10.501 C 148.988 10.508,148.711 10.580,148.582 10.660 C 148.452 10.741,148.160 10.842,147.933 10.886 C 147.706 10.930,147.466 11.054,147.399 11.162 C 147.333 11.270,146.854 11.388,146.337 11.424 C 145.819 11.460,145.229 11.581,145.025 11.691 C 144.416 12.023,143.918 12.170,143.561 12.126 C 143.375 12.103,142.854 12.291,142.402 12.543 C 141.806 12.877,141.492 12.953,141.259 12.823 C 141.031 12.696,140.841 12.731,140.605 12.944 C 140.423 13.110,140.221 13.245,140.158 13.245 C 140.095 13.245,139.804 13.342,139.511 13.461 C 139.218 13.580,138.851 13.703,138.694 13.735 C 137.405 14.000,136.837 14.157,136.471 14.348 C 135.438 14.886,135.267 14.948,134.805 14.948 C 134.536 14.948,134.188 15.076,134.032 15.232 C 133.876 15.388,133.551 15.516,133.311 15.516 C 133.071 15.516,132.768 15.644,132.638 15.802 C 132.460 16.015,132.336 16.035,132.148 15.879 C 131.958 15.721,131.744 15.777,131.277 16.110 C 130.937 16.353,130.518 16.527,130.348 16.498 C 130.177 16.469,129.991 16.567,129.934 16.715 C 129.877 16.863,129.210 17.172,128.451 17.403 C 127.692 17.633,126.900 17.942,126.691 18.088 C 126.482 18.234,126.171 18.354,126.000 18.354 C 125.829 18.354,125.479 18.520,125.221 18.722 C 124.961 18.927,124.590 19.048,124.387 18.995 C 124.177 18.940,123.727 19.099,123.331 19.367 C 122.952 19.625,122.597 19.791,122.543 19.736 C 122.488 19.682,122.192 19.817,121.883 20.036 C 121.575 20.256,121.143 20.435,120.923 20.435 C 120.702 20.435,120.185 20.648,119.773 20.908 C 119.361 21.168,118.958 21.383,118.878 21.385 C 118.798 21.387,117.966 21.769,117.029 22.235 C 116.093 22.701,115.172 23.082,114.983 23.083 C 114.794 23.084,114.368 23.289,114.037 23.539 C 113.705 23.789,113.117 24.124,112.729 24.284 C 112.341 24.444,111.836 24.750,111.605 24.965 C 111.172 25.369,111.017 25.422,110.449 25.364 C 110.263 25.345,109.604 25.675,108.984 26.099 C 108.364 26.522,107.767 26.868,107.657 26.868 C 107.548 26.868,106.986 27.217,106.409 27.643 C 105.732 28.143,105.231 28.384,104.995 28.322 C 104.763 28.262,104.208 28.515,103.479 29.014 C 102.847 29.447,102.189 29.886,102.016 29.991 C 101.844 30.095,101.650 30.253,101.585 30.342 C 101.520 30.431,101.290 30.448,101.075 30.380 C 100.804 30.294,100.435 30.433,99.869 30.835 C 99.421 31.154,98.845 31.562,98.591 31.743 C 98.336 31.924,97.760 32.349,97.312 32.687 C 96.863 33.025,96.412 33.302,96.309 33.302 C 96.206 33.302,96.121 33.387,96.121 33.491 C 96.121 33.595,96.032 33.680,95.924 33.680 C 95.815 33.680,95.624 33.763,95.498 33.865 C 95.372 33.966,95.019 34.252,94.713 34.501 L 94.157 34.952 94.848 35.972 C 95.229 36.533,96.117 37.818,96.824 38.829 C 97.530 39.840,98.482 41.202,98.939 41.857 C 99.396 42.511,100.152 43.600,100.618 44.276 C 101.085 44.953,101.626 45.682,101.821 45.897 C 102.016 46.112,102.176 46.351,102.176 46.428 C 102.176 46.506,102.474 46.969,102.838 47.457 C 103.690 48.598,103.846 48.816,104.594 49.902 C 105.327 50.967,108.212 55.098,108.792 55.913 C 109.014 56.225,109.932 57.545,110.832 58.846 C 111.732 60.147,112.515 61.254,112.573 61.306 C 112.631 61.358,112.934 61.783,113.246 62.252 C 113.557 62.720,113.878 63.188,113.957 63.292 C 114.786 64.376,115.421 65.277,115.421 65.371 C 115.421 65.434,115.825 66.032,116.320 66.700 C 117.956 68.911,118.920 70.264,119.016 70.484 C 119.068 70.604,119.648 71.461,120.305 72.390 C 124.511 78.336,125.354 79.540,126.329 80.984 C 126.926 81.868,127.674 82.929,127.993 83.340 C 128.311 83.751,128.657 84.236,128.761 84.418 C 128.933 84.718,130.457 86.906,132.027 89.106 C 132.367 89.582,133.022 90.525,133.484 91.202 C 133.945 91.878,134.716 92.985,135.198 93.661 C 135.680 94.338,136.301 95.232,136.580 95.648 C 136.858 96.064,137.171 96.501,137.275 96.618 C 137.379 96.736,137.574 96.991,137.707 97.186 C 137.840 97.381,138.421 98.221,138.998 99.054 C 139.575 99.886,140.190 100.801,140.364 101.087 C 140.778 101.764,141.053 101.743,142.264 100.946 C 142.817 100.581,143.341 100.326,143.427 100.380 C 143.513 100.433,143.697 100.366,143.835 100.231 C 144.299 99.780,145.901 98.770,146.152 98.770 C 146.289 98.770,146.618 98.600,146.882 98.392 C 147.147 98.184,147.483 98.013,147.628 98.013 C 147.774 98.013,148.059 97.888,148.261 97.735 C 148.463 97.583,148.726 97.455,148.846 97.452 C 148.965 97.448,149.509 97.145,150.055 96.778 C 150.600 96.411,151.089 96.153,151.140 96.205 C 151.192 96.257,151.483 96.122,151.786 95.906 C 152.118 95.670,152.519 95.548,152.792 95.600 C 153.102 95.659,153.457 95.512,153.915 95.135 C 154.284 94.831,154.661 94.630,154.754 94.687 C 154.846 94.744,155.137 94.622,155.400 94.416 C 155.663 94.209,156.064 94.040,156.292 94.040 C 156.699 94.040,156.919 93.949,158.510 93.124 C 158.950 92.896,159.546 92.677,159.835 92.638 C 160.332 92.572,161.122 92.273,162.479 91.639 C 162.812 91.484,163.157 91.402,163.247 91.457 C 163.337 91.513,163.916 91.315,164.534 91.018 C 165.152 90.721,165.730 90.547,165.818 90.631 C 165.907 90.716,166.439 90.574,167.002 90.317 C 167.565 90.059,168.344 89.809,168.733 89.762 C 169.521 89.665,170.644 89.319,170.995 89.064 C 171.120 88.973,171.298 88.945,171.391 89.002 C 171.483 89.059,171.986 88.944,172.508 88.746 C 173.207 88.480,173.512 88.441,173.668 88.597 C 173.824 88.753,173.972 88.725,174.230 88.491 C 174.423 88.317,174.760 88.174,174.980 88.174 C 175.200 88.174,175.429 88.095,175.489 87.997 C 175.549 87.900,175.894 87.869,176.255 87.927 C 176.638 87.989,177.025 87.941,177.181 87.811 C 177.329 87.688,177.822 87.566,178.277 87.539 C 178.732 87.512,179.217 87.420,179.356 87.335 C 179.494 87.249,180.025 87.157,180.536 87.129 C 181.047 87.102,181.577 86.986,181.715 86.871 C 181.852 86.757,182.016 86.715,182.079 86.778 C 182.142 86.841,182.631 86.787,183.166 86.659 C 183.701 86.530,184.664 86.406,185.305 86.382 C 185.946 86.358,186.641 86.288,186.850 86.226 C 187.397 86.063,191.399 85.731,194.229 85.613 C 198.932 85.416,201.514 85.397,201.514 85.558 C 201.514 85.654,201.635 85.665,201.783 85.582 C 201.992 85.464,204.170 85.524,206.339 85.706 C 206.505 85.720,207.806 85.733,209.555 85.737 C 209.868 85.738,210.251 85.786,210.407 85.844 C 210.703 85.954,211.110 86.005,212.895 86.157 C 213.483 86.207,214.121 86.329,214.314 86.429 C 214.507 86.528,214.771 86.571,214.901 86.524 C 215.032 86.477,216.032 86.579,217.124 86.751 C 218.216 86.922,219.182 87.017,219.271 86.962 C 219.360 86.907,219.595 86.980,219.792 87.124 C 220.057 87.317,220.216 87.331,220.402 87.177 C 220.589 87.022,220.696 87.038,220.821 87.240 C 220.913 87.390,221.141 87.528,221.327 87.547 C 221.513 87.566,222.067 87.623,222.558 87.674 C 223.049 87.725,223.519 87.808,223.603 87.860 C 223.686 87.911,224.136 88.011,224.602 88.080 C 225.068 88.150,225.542 88.284,225.656 88.378 C 225.770 88.472,225.910 88.502,225.967 88.445 C 226.024 88.388,226.570 88.486,227.179 88.664 C 227.789 88.841,228.415 89.001,228.571 89.019 C 228.728 89.037,229.111 89.160,229.423 89.293 C 229.735 89.426,230.309 89.547,230.699 89.564 C 231.089 89.580,231.408 89.657,231.409 89.735 C 231.409 89.813,231.527 89.877,231.669 89.877 C 231.812 89.877,232.329 90.054,232.818 90.270 C 233.308 90.487,233.820 90.621,233.956 90.568 C 234.093 90.516,234.380 90.596,234.594 90.746 C 234.809 90.896,235.053 90.997,235.136 90.971 C 235.220 90.944,235.544 91.016,235.856 91.130 C 236.168 91.244,236.764 91.446,237.181 91.578 C 237.597 91.710,238.273 91.977,238.683 92.172 C 239.092 92.367,239.620 92.526,239.854 92.526 C 240.089 92.526,240.333 92.611,240.397 92.715 C 240.462 92.819,240.672 92.904,240.866 92.904 C 241.059 92.904,241.246 92.970,241.280 93.049 C 241.315 93.129,242.092 93.441,243.007 93.742 C 243.922 94.043,244.740 94.414,244.825 94.566 C 244.910 94.718,245.209 94.868,245.491 94.899 C 245.772 94.930,246.657 95.268,247.457 95.650 C 248.834 96.308,249.689 96.696,250.331 96.956 C 250.487 97.020,250.870 97.234,251.183 97.434 C 251.495 97.633,251.870 97.803,252.016 97.810 C 252.162 97.818,252.561 98.037,252.902 98.297 C 253.243 98.557,253.630 98.770,253.762 98.770 C 253.893 98.770,254.317 98.989,254.704 99.257 C 255.091 99.526,255.524 99.762,255.666 99.783 C 255.808 99.804,256.191 100.010,256.516 100.242 C 256.841 100.473,257.206 100.662,257.327 100.662 C 257.449 100.662,257.667 100.769,257.812 100.899 C 258.456 101.477,258.653 101.600,259.113 101.716 C 259.382 101.783,259.603 101.966,259.603 102.122 C 259.603 102.289,259.713 102.363,259.871 102.303 C 260.018 102.246,260.183 102.314,260.236 102.453 C 260.289 102.592,260.632 102.804,260.996 102.924 C 261.361 103.045,261.982 103.439,262.376 103.799 C 262.770 104.160,263.182 104.421,263.291 104.379 C 263.401 104.336,263.783 104.590,264.139 104.942 C 264.496 105.294,264.924 105.582,265.091 105.582 C 265.258 105.582,265.962 106.050,266.656 106.623 C 267.350 107.195,268.005 107.663,268.112 107.663 C 268.219 107.663,268.307 107.748,268.307 107.852 C 268.307 107.956,268.436 108.042,268.594 108.042 C 268.753 108.042,268.979 108.254,269.098 108.515 C 269.221 108.785,269.472 108.988,269.684 108.988 C 269.887 108.988,270.385 109.329,270.790 109.746 C 271.194 110.163,271.706 110.532,271.926 110.565 C 272.147 110.599,272.441 110.832,272.581 111.084 C 272.720 111.336,272.837 111.460,272.841 111.360 C 272.845 111.261,273.167 111.516,273.557 111.928 C 274.300 112.712,274.800 113.086,275.355 113.273 C 275.537 113.334,275.686 113.449,275.686 113.528 C 275.686 113.825,277.572 115.636,277.760 115.520 C 277.868 115.453,278.135 115.702,278.353 116.072 C 278.572 116.442,278.827 116.698,278.921 116.640 C 279.015 116.582,279.258 116.817,279.462 117.162 C 279.665 117.507,280.105 117.951,280.439 118.148 C 281.049 118.508,282.687 120.109,282.687 120.345 C 282.687 120.579,283.386 121.281,283.503 121.164 C 283.567 121.101,283.720 121.271,283.844 121.542 C 283.968 121.814,284.213 122.082,284.388 122.138 C 284.564 122.193,284.820 122.449,284.957 122.706 C 285.095 122.962,285.369 123.224,285.567 123.287 C 285.765 123.349,286.020 123.606,286.135 123.857 C 286.249 124.109,286.414 124.314,286.502 124.314 C 286.589 124.314,286.660 124.442,286.660 124.598 C 286.660 124.754,286.740 124.882,286.837 124.882 C 286.934 124.882,287.066 125.048,287.130 125.250 C 287.195 125.453,287.395 125.666,287.575 125.723 C 287.755 125.781,288.042 126.062,288.213 126.348 C 288.945 127.577,289.576 128.101,289.881 127.732 C 290.035 127.546,290.416 127.253,290.728 127.080 C 291.041 126.907,291.807 126.381,292.431 125.911 C 293.056 125.441,293.716 125.007,293.898 124.947 C 294.080 124.887,294.229 124.767,294.229 124.681 C 294.229 124.595,294.437 124.413,294.691 124.277 C 295.220 123.994,297.304 122.597,297.446 122.430 C 297.498 122.369,297.753 122.176,298.013 122.002 C 298.273 121.828,298.912 121.380,299.432 121.007 C 299.953 120.634,300.712 120.108,301.120 119.839 C 301.529 119.569,302.034 119.189,302.244 118.993 C 302.454 118.798,302.730 118.638,302.858 118.638 C 302.986 118.638,303.119 118.570,303.154 118.487 C 303.188 118.404,303.898 117.873,304.730 117.306 C 305.563 116.740,306.287 116.225,306.339 116.161 C 306.391 116.097,306.807 115.798,307.263 115.497 C 308.823 114.465,309.129 114.251,310.763 113.052 C 311.192 112.738,312.053 112.146,312.677 111.736 C 313.302 111.326,313.898 110.924,314.002 110.843 C 314.520 110.440,315.959 109.416,316.457 109.096 C 316.766 108.897,317.187 108.578,317.391 108.388 C 317.596 108.197,317.848 108.042,317.952 108.042 C 318.055 108.042,318.334 107.859,318.571 107.637 C 318.808 107.414,319.161 107.138,319.356 107.022 C 319.885 106.708,321.547 105.551,323.463 104.163 C 324.399 103.484,325.302 102.866,325.469 102.789 C 325.636 102.712,326.019 102.458,326.321 102.224 C 326.622 101.991,327.252 101.502,327.720 101.138 C 328.188 100.774,328.644 100.476,328.733 100.475 C 328.822 100.474,329.163 100.259,329.490 99.997 C 329.817 99.735,330.177 99.448,330.289 99.358 C 330.401 99.268,330.860 98.950,331.308 98.651 C 331.756 98.352,332.440 97.895,332.829 97.635 C 333.217 97.375,333.902 96.917,334.350 96.619 C 334.798 96.320,335.256 95.996,335.368 95.900 C 335.608 95.694,337.379 94.421,338.282 93.806 C 338.627 93.570,339.150 93.186,339.444 92.952 C 339.738 92.718,340.066 92.526,340.172 92.526 C 340.279 92.526,340.394 92.456,340.429 92.371 C 340.488 92.225,340.999 91.856,343.992 89.798 C 344.669 89.333,345.310 88.877,345.416 88.785 C 345.523 88.692,345.864 88.454,346.173 88.255 C 346.483 88.057,347.086 87.638,347.515 87.324 C 349.323 86.002,351.509 84.476,352.195 84.057 C 352.492 83.876,353.295 83.314,353.981 82.808 C 354.667 82.303,355.425 81.799,355.665 81.690 C 356.209 81.442,356.225 80.909,355.707 80.361 C 355.489 80.131,354.905 79.342,354.408 78.606 C 351.941 74.954,351.625 74.551,351.234 74.551 C 350.972 74.551,350.426 74.114,350.426 73.903 C 350.426 73.567,348.578 71.305,348.232 71.218 C 348.005 71.161,347.506 70.660,347.123 70.104 C 346.740 69.549,346.319 69.053,346.186 69.002 C 346.053 68.951,345.633 68.440,345.253 67.866 C 344.872 67.293,344.262 66.640,343.898 66.415 C 343.534 66.189,343.236 65.944,343.236 65.869 C 343.236 65.795,342.767 65.243,342.195 64.642 C 341.623 64.042,341.154 63.478,341.154 63.389 C 341.154 63.301,340.835 63.035,340.445 62.798 C 340.054 62.561,339.661 62.246,339.571 62.098 C 339.481 61.950,339.077 61.488,338.672 61.071 C 338.268 60.655,337.938 60.245,337.938 60.160 C 337.938 60.076,337.773 59.954,337.573 59.891 C 337.372 59.827,337.035 59.481,336.822 59.121 C 336.610 58.762,336.306 58.467,336.146 58.467 C 335.987 58.467,335.856 58.382,335.856 58.278 C 335.856 58.174,335.772 58.089,335.669 58.089 C 335.566 58.089,335.162 57.736,334.771 57.304 C 333.770 56.200,332.960 55.440,332.783 55.440 C 332.588 55.440,330.937 53.717,330.937 53.514 C 330.937 53.428,330.824 53.359,330.687 53.359 C 330.550 53.359,330.151 53.103,329.801 52.791 C 329.452 52.479,329.114 52.223,329.051 52.223 C 328.988 52.223,328.786 51.968,328.602 51.656 C 328.417 51.343,328.149 51.088,328.006 51.088 C 327.863 51.088,327.691 50.918,327.625 50.710 C 327.510 50.348,327.323 50.254,326.836 50.314 C 326.713 50.329,326.559 50.169,326.492 49.958 C 326.425 49.747,326.254 49.574,326.112 49.574 C 325.970 49.574,325.676 49.325,325.458 49.019 C 325.241 48.714,324.873 48.437,324.641 48.404 C 324.409 48.371,324.135 48.153,324.033 47.919 C 323.930 47.684,323.743 47.493,323.616 47.493 C 323.490 47.493,323.319 47.380,323.236 47.242 C 323.152 47.103,322.807 46.830,322.469 46.633 C 322.131 46.437,321.854 46.209,321.854 46.128 C 321.854 46.046,321.764 45.979,321.654 45.979 C 321.544 45.979,321.037 45.543,320.526 45.010 C 319.887 44.344,319.501 44.078,319.289 44.160 C 319.083 44.239,318.950 44.158,318.886 43.916 C 318.834 43.717,318.629 43.512,318.431 43.460 C 318.232 43.408,318.070 43.239,318.070 43.084 C 318.070 42.779,317.569 42.510,317.304 42.673 C 317.214 42.729,316.817 42.432,316.422 42.012 C 316.028 41.593,315.573 41.249,315.411 41.249 C 315.250 41.249,314.654 40.842,314.087 40.345 C 313.520 39.847,312.822 39.338,312.535 39.213 C 312.249 39.089,312.015 38.899,312.015 38.793 C 312.015 38.687,311.890 38.600,311.738 38.600 C 311.586 38.600,311.366 38.423,311.250 38.207 C 311.135 37.990,310.932 37.855,310.799 37.906 C 310.667 37.957,310.232 37.708,309.834 37.353 C 309.435 36.998,308.961 36.708,308.781 36.708 C 308.601 36.708,308.243 36.457,307.985 36.151 C 307.727 35.844,307.476 35.633,307.427 35.682 C 307.379 35.731,307.231 35.641,307.099 35.482 C 306.968 35.324,306.714 35.194,306.536 35.194 C 306.358 35.194,305.964 34.941,305.661 34.632 C 305.357 34.322,304.965 34.067,304.789 34.064 C 304.614 34.061,304.200 33.812,303.870 33.510 C 303.540 33.209,303.030 32.914,302.737 32.856 C 302.443 32.797,301.882 32.427,301.488 32.034 C 301.079 31.625,300.628 31.343,300.434 31.376 C 300.247 31.408,300.095 31.343,300.095 31.232 C 300.095 31.122,299.971 31.031,299.820 31.031 C 299.669 31.031,299.463 30.883,299.361 30.702 C 299.260 30.520,299.116 30.433,299.042 30.507 C 298.890 30.659,297.824 30.087,297.824 29.855 C 297.824 29.774,297.695 29.707,297.538 29.707 C 297.142 29.707,296.529 29.332,295.890 28.700 C 295.593 28.406,295.247 28.204,295.121 28.250 C 294.995 28.296,294.636 28.145,294.324 27.915 C 294.011 27.685,293.511 27.436,293.213 27.362 C 292.914 27.289,292.546 27.105,292.395 26.954 C 292.244 26.803,291.961 26.679,291.767 26.679 C 291.572 26.679,291.360 26.593,291.295 26.488 C 291.230 26.383,290.629 26.040,289.959 25.727 C 289.290 25.414,288.742 25.075,288.742 24.973 C 288.742 24.871,288.593 24.785,288.411 24.783 C 288.228 24.781,287.867 24.612,287.606 24.409 C 287.346 24.205,286.989 24.037,286.813 24.034 C 286.637 24.032,286.440 23.944,286.375 23.838 C 286.309 23.732,286.189 23.687,286.108 23.737 C 286.027 23.787,285.775 23.655,285.547 23.443 C 285.320 23.231,285.030 23.092,284.903 23.136 C 284.777 23.179,284.546 23.071,284.390 22.896 C 284.148 22.624,283.364 22.302,282.814 22.248 C 282.727 22.240,282.540 22.073,282.397 21.878 C 282.246 21.672,282.014 21.570,281.844 21.635 C 281.683 21.697,281.552 21.665,281.552 21.565 C 281.552 21.464,281.432 21.381,281.287 21.381 C 281.141 21.381,280.537 21.126,279.943 20.814 C 279.350 20.501,278.738 20.246,278.583 20.246 C 278.429 20.246,277.698 19.948,276.958 19.584 C 276.219 19.219,275.457 18.921,275.266 18.921 C 275.074 18.921,274.868 18.794,274.808 18.638 C 274.748 18.482,274.494 18.354,274.244 18.354 C 273.994 18.354,273.641 18.279,273.460 18.187 C 273.279 18.095,272.876 17.913,272.564 17.783 C 272.252 17.653,271.826 17.473,271.618 17.383 C 271.410 17.293,271.068 17.196,270.859 17.167 C 270.650 17.138,270.269 16.968,270.013 16.788 C 269.757 16.609,269.370 16.462,269.154 16.462 C 268.938 16.462,268.680 16.394,268.581 16.312 C 268.482 16.230,267.763 15.953,266.982 15.697 C 266.202 15.441,265.535 15.168,265.500 15.090 C 265.465 15.012,265.230 14.948,264.977 14.948 C 264.724 14.948,264.369 14.873,264.189 14.781 C 263.474 14.417,262.885 14.167,262.622 14.114 C 262.470 14.084,262.219 14.011,262.062 13.952 C 261.906 13.893,261.523 13.780,261.211 13.702 C 260.899 13.624,260.601 13.546,260.549 13.529 C 260.497 13.512,260.199 13.434,259.886 13.357 C 259.310 13.213,258.639 12.958,258.044 12.655 C 257.863 12.563,257.549 12.488,257.346 12.488 C 257.142 12.488,256.929 12.413,256.873 12.321 C 256.816 12.229,256.214 12.049,255.535 11.921 C 254.856 11.792,254.253 11.611,254.195 11.517 C 254.137 11.423,254.013 11.394,253.919 11.452 C 253.825 11.510,253.494 11.426,253.184 11.266 C 252.874 11.106,252.408 10.974,252.149 10.974 C 251.890 10.974,251.632 10.901,251.577 10.811 C 251.490 10.670,251.059 10.569,249.571 10.339 C 249.413 10.314,249.194 10.239,249.085 10.171 C 248.975 10.104,248.679 10.009,248.426 9.962 C 247.537 9.795,246.829 9.596,246.641 9.460 C 246.537 9.385,246.325 9.320,246.168 9.316 C 246.012 9.312,245.246 9.168,244.465 8.996 C 243.685 8.824,242.833 8.654,242.573 8.617 C 242.313 8.581,241.845 8.451,241.533 8.330 C 241.220 8.209,240.922 8.121,240.870 8.134 C 240.596 8.206,238.851 7.878,238.653 7.718 C 238.526 7.615,237.917 7.515,237.300 7.494 C 236.683 7.474,236.043 7.345,235.878 7.208 C 235.712 7.071,235.441 7.011,235.274 7.075 C 235.107 7.139,234.872 7.128,234.751 7.051 C 234.630 6.974,234.149 6.900,233.680 6.887 C 233.212 6.874,232.573 6.753,232.261 6.618 C 231.949 6.483,231.626 6.387,231.543 6.406 C 231.460 6.424,230.524 6.303,229.462 6.136 C 228.400 5.969,227.190 5.798,226.774 5.755 C 226.358 5.713,225.634 5.632,225.166 5.576 C 224.697 5.520,223.974 5.439,223.557 5.396 C 223.141 5.354,222.800 5.309,222.800 5.296 C 222.800 5.284,222.460 5.239,222.044 5.196 C 220.557 5.042,219.570 4.935,218.638 4.825 C 217.114 4.646,215.912 4.545,214.096 4.444 C 211.620 4.306,210.155 4.179,209.893 4.078 C 209.766 4.030,209.610 4.075,209.545 4.179 C 209.481 4.282,209.244 4.308,209.019 4.235 C 208.606 4.101,206.004 4.009,202.176 3.994 C 201.031 3.989,199.924 3.983,199.716 3.979 C 198.221 3.955,194.042 3.995,193.188 4.042 C 192.616 4.074,191.977 4.044,191.769 3.977 C 191.561 3.910,191.093 3.962,190.728 4.092 \" stroke=\"none\" fill=\"#b5cb2b\" fill-rule=\"evenodd\"></path><path id=\"path8\" d=\"\" stroke=\"none\" fill=\"#55ff00\" fill-rule=\"evenodd\"></path><path id=\"path9\" d=\"M364.522 96.081 C 363.619 96.742,362.897 97.244,359.648 99.478 C 358.854 100.024,357.583 100.938,356.822 101.509 C 356.062 102.080,355.333 102.549,355.203 102.551 C 355.073 102.553,354.967 102.627,354.967 102.715 C 354.967 102.851,354.376 103.279,352.707 104.352 C 352.545 104.456,351.944 104.889,351.372 105.314 C 350.799 105.740,350.024 106.293,349.648 106.544 C 347.578 107.929,346.136 108.917,345.885 109.122 C 345.631 109.330,344.163 110.365,341.471 112.233 C 340.970 112.582,340.270 113.079,339.916 113.340 C 339.562 113.600,338.581 114.281,337.736 114.853 C 336.890 115.426,335.705 116.256,335.103 116.698 C 334.500 117.140,333.921 117.502,333.816 117.502 C 333.712 117.502,333.577 117.631,333.516 117.789 C 333.456 117.947,333.212 118.162,332.976 118.267 C 332.595 118.436,331.562 119.112,331.031 119.541 C 330.927 119.624,330.118 120.192,329.234 120.801 C 328.349 121.410,327.597 121.981,327.562 122.071 C 327.528 122.160,327.408 122.233,327.296 122.233 C 327.185 122.233,326.787 122.467,326.413 122.752 C 326.039 123.038,325.180 123.649,324.503 124.109 C 323.827 124.570,323.231 124.997,323.179 125.058 C 323.127 125.119,322.709 125.424,322.250 125.735 C 321.792 126.046,321.229 126.429,320.999 126.585 C 320.769 126.741,320.047 127.252,319.395 127.720 C 318.742 128.188,318.015 128.699,317.780 128.855 C 316.016 130.025,314.359 131.179,313.150 132.081 C 312.370 132.663,311.582 133.194,311.400 133.262 C 311.218 133.329,311.069 133.472,311.069 133.580 C 311.069 133.687,310.971 133.775,310.851 133.775 C 310.731 133.775,310.284 134.034,309.858 134.351 C 308.177 135.600,305.993 137.141,304.778 137.938 C 304.075 138.398,303.500 138.831,303.500 138.901 C 303.500 138.970,303.253 139.129,302.952 139.254 C 302.650 139.379,302.209 139.688,301.972 139.940 C 301.736 140.191,301.463 140.397,301.366 140.397 C 301.269 140.397,300.879 140.639,300.500 140.934 C 300.121 141.228,299.662 141.524,299.480 141.590 C 299.001 141.764,299.066 142.077,299.811 143.183 C 300.175 143.724,300.473 144.297,300.473 144.456 C 300.473 144.615,300.856 145.249,301.325 145.865 C 301.793 146.480,302.176 147.071,302.176 147.178 C 302.176 147.284,302.473 147.940,302.836 148.637 C 303.199 149.333,303.455 149.967,303.406 150.046 C 303.358 150.125,303.615 150.580,303.979 151.057 C 304.343 151.534,304.627 151.991,304.609 152.073 C 304.592 152.156,304.718 152.540,304.890 152.927 C 305.063 153.314,305.203 153.766,305.203 153.933 C 305.203 154.099,305.416 154.514,305.676 154.855 C 305.937 155.197,306.149 155.646,306.149 155.854 C 306.149 156.062,306.308 156.376,306.501 156.551 C 306.726 156.754,306.820 157.034,306.764 157.328 C 306.709 157.616,306.825 157.978,307.075 158.295 C 307.294 158.574,307.474 158.951,307.474 159.132 C 307.474 159.313,307.592 159.560,307.737 159.680 C 307.882 159.800,308.057 160.277,308.127 160.740 C 308.196 161.202,308.339 161.634,308.444 161.699 C 308.549 161.764,308.592 161.928,308.540 162.064 C 308.488 162.200,308.604 162.454,308.798 162.630 C 308.993 162.806,309.105 163.070,309.048 163.218 C 308.992 163.366,309.060 163.625,309.201 163.794 C 309.341 163.963,309.431 164.295,309.400 164.530 C 309.369 164.766,309.434 165.015,309.544 165.083 C 309.654 165.151,309.745 165.404,309.745 165.646 C 309.745 165.887,309.860 166.180,310.002 166.298 C 310.147 166.418,310.220 166.715,310.170 166.976 C 310.117 167.253,310.205 167.564,310.386 167.745 C 310.554 167.913,310.691 168.251,310.691 168.498 C 310.691 168.745,310.776 168.999,310.880 169.063 C 310.984 169.128,311.069 169.388,311.069 169.641 C 311.069 169.895,311.232 170.592,311.432 171.191 C 311.631 171.790,311.849 172.682,311.916 173.174 C 311.982 173.666,312.109 174.113,312.198 174.168 C 312.286 174.223,312.313 174.438,312.259 174.646 C 312.204 174.855,312.254 175.139,312.370 175.279 C 312.485 175.418,312.526 175.585,312.460 175.651 C 312.394 175.717,312.456 175.912,312.599 176.084 C 312.742 176.256,312.881 176.748,312.909 177.177 C 312.958 177.938,313.431 180.323,313.646 180.889 C 313.705 181.045,313.785 181.514,313.822 181.930 C 313.981 183.680,314.099 184.354,314.286 184.579 C 314.413 184.733,314.421 184.979,314.309 185.275 C 314.203 185.553,314.203 185.856,314.307 186.044 C 314.403 186.214,314.514 186.720,314.554 187.169 C 314.594 187.618,314.680 188.453,314.744 189.026 C 315.128 192.434,315.238 194.787,315.312 201.135 C 315.348 204.241,315.301 206.811,315.207 206.929 C 315.114 207.045,315.068 207.746,315.106 208.487 C 315.143 209.228,315.123 209.885,315.061 209.947 C 314.999 210.009,314.935 210.627,314.919 211.321 C 314.894 212.420,314.508 215.779,314.177 217.786 C 314.117 218.150,314.070 218.615,314.073 218.818 C 314.076 219.021,313.991 219.294,313.883 219.424 C 313.775 219.554,313.743 219.839,313.813 220.057 C 313.882 220.275,313.846 220.565,313.734 220.700 C 313.621 220.836,313.534 221.151,313.540 221.401 C 313.558 222.105,312.777 225.972,312.566 226.227 C 312.462 226.352,312.433 226.675,312.501 226.945 C 312.574 227.240,312.544 227.436,312.426 227.436 C 312.317 227.436,312.170 227.841,312.100 228.335 C 311.917 229.615,311.490 231.225,311.260 231.503 C 311.151 231.633,311.112 231.869,311.172 232.026 C 311.233 232.183,311.029 232.869,310.720 233.550 C 310.412 234.231,310.201 234.831,310.253 234.882 C 310.359 234.989,309.875 236.529,308.877 239.262 C 308.801 239.470,308.752 239.704,308.768 239.782 C 308.785 239.860,308.719 239.924,308.621 239.924 C 308.523 239.924,308.442 240.073,308.439 240.255 C 308.431 240.809,307.965 242.384,307.809 242.384 C 307.729 242.384,307.663 242.549,307.663 242.751 C 307.663 242.953,307.578 243.171,307.474 243.236 C 307.370 243.300,307.285 243.551,307.285 243.794 C 307.285 244.037,307.147 244.288,306.979 244.353 C 306.794 244.424,306.710 244.609,306.767 244.825 C 306.820 245.029,306.672 245.410,306.417 245.721 C 306.173 246.019,305.971 246.415,305.967 246.601 C 305.963 246.787,305.828 247.140,305.667 247.385 C 305.506 247.631,305.331 248.075,305.278 248.372 C 305.224 248.669,305.101 248.993,305.003 249.092 C 304.905 249.191,304.825 249.418,304.825 249.596 C 304.825 249.775,304.758 249.950,304.677 249.984 C 304.596 250.019,304.257 250.622,303.924 251.325 C 303.592 252.027,303.232 252.602,303.126 252.602 C 303.020 252.602,302.930 252.793,302.927 253.027 C 302.924 253.262,302.796 253.618,302.643 253.820 C 302.490 254.022,302.365 254.364,302.365 254.579 C 302.365 254.795,302.069 255.311,301.707 255.726 C 301.344 256.141,301.046 256.600,301.044 256.747 C 301.042 256.893,300.828 257.292,300.568 257.633 C 300.307 257.974,300.095 258.386,300.095 258.548 C 300.095 258.710,299.906 259.059,299.676 259.324 C 299.446 259.589,299.169 260.077,299.061 260.409 C 298.953 260.740,298.668 261.110,298.427 261.229 C 298.186 261.349,297.995 261.500,298.001 261.565 C 298.060 262.145,297.957 262.497,297.635 262.819 C 297.427 263.027,297.256 263.277,297.256 263.374 C 297.256 263.471,297.078 263.607,296.861 263.676 C 296.594 263.761,296.495 263.915,296.556 264.148 C 296.612 264.366,296.408 264.755,296.005 265.195 C 295.653 265.579,295.364 266.007,295.364 266.145 C 295.364 266.474,294.426 267.471,294.183 267.400 C 294.079 267.370,294.040 267.466,294.097 267.615 C 294.241 267.992,293.752 268.691,292.337 270.133 C 292.077 270.398,291.862 270.718,291.861 270.843 C 291.859 270.968,291.518 271.416,291.104 271.839 C 290.689 272.261,290.326 272.742,290.297 272.907 C 290.267 273.073,289.926 273.542,289.540 273.950 C 288.536 275.010,287.803 275.939,287.799 276.159 C 287.796 276.263,287.540 276.518,287.228 276.727 C 286.916 276.935,286.661 277.198,286.661 277.312 C 286.661 277.425,286.362 277.679,285.998 277.875 C 285.594 278.093,285.336 278.374,285.336 278.596 C 285.336 278.965,283.437 280.984,283.090 280.984 C 282.987 280.984,282.843 281.167,282.773 281.390 C 282.593 281.958,280.226 284.201,279.808 284.201 C 279.726 284.201,279.659 284.330,279.659 284.489 C 279.659 284.648,279.447 284.859,279.186 284.957 C 278.910 285.062,278.713 285.287,278.713 285.497 C 278.713 285.719,278.495 285.948,278.146 286.093 C 277.833 286.222,277.578 286.446,277.578 286.591 C 277.578 286.736,277.131 287.143,276.585 287.497 C 276.038 287.850,275.367 288.381,275.093 288.677 C 274.558 289.254,274.365 289.412,273.557 289.930 C 272.807 290.412,272.879 290.641,274.487 292.876 C 275.285 293.984,276.285 295.402,276.710 296.026 C 277.135 296.651,277.532 297.204,277.592 297.256 C 277.651 297.308,277.757 297.479,277.825 297.635 C 277.894 297.791,278.418 298.557,278.989 299.338 C 279.561 300.118,280.409 301.310,280.875 301.987 C 281.340 302.663,282.300 304.043,283.008 305.054 C 283.716 306.065,284.551 307.256,284.863 307.702 C 285.175 308.148,286.147 309.535,287.022 310.784 C 288.475 312.858,289.115 313.775,290.954 316.414 C 291.298 316.909,291.895 317.760,292.279 318.307 C 292.664 318.853,294.253 321.131,295.810 323.368 C 297.367 325.605,298.805 327.649,299.004 327.909 C 299.363 328.377,302.341 332.638,303.542 334.403 C 303.883 334.905,304.253 335.415,304.364 335.538 C 304.474 335.661,305.113 336.564,305.783 337.545 C 306.977 339.294,307.255 339.694,309.416 342.763 C 310.003 343.595,310.973 345.000,311.573 345.885 C 312.173 346.769,312.714 347.535,312.775 347.588 C 312.836 347.640,313.265 348.236,313.728 348.912 C 314.191 349.588,314.616 350.184,314.672 350.237 C 314.729 350.289,315.155 350.893,315.618 351.580 C 318.330 355.596,319.517 357.226,319.734 357.232 C 319.869 357.235,320.961 356.535,322.162 355.676 C 323.363 354.818,324.573 353.969,324.850 353.790 C 325.894 353.117,326.206 352.823,326.206 352.517 C 326.206 352.225,327.371 351.257,328.471 350.635 C 329.111 350.273,329.423 349.937,329.423 349.610 C 329.423 349.458,329.820 349.048,330.304 348.698 C 330.789 348.347,331.449 347.799,331.771 347.479 C 332.092 347.159,332.654 346.694,333.018 346.445 C 333.921 345.827,334.153 345.582,334.153 345.249 C 334.153 345.092,334.430 344.773,334.768 344.539 C 335.106 344.306,335.649 343.853,335.973 343.533 C 336.298 343.213,336.809 342.735,337.109 342.470 C 337.408 342.205,337.872 341.737,338.138 341.430 C 338.404 341.122,339.149 340.384,339.793 339.790 C 340.438 339.196,340.965 338.621,340.965 338.513 C 340.965 338.405,341.071 338.313,341.202 338.310 C 341.585 338.300,342.523 337.379,342.421 337.113 C 342.367 336.972,342.600 336.721,342.970 336.522 C 343.324 336.331,343.614 336.062,343.614 335.924 C 343.614 335.785,343.950 335.450,344.360 335.179 C 344.772 334.906,345.132 334.502,345.164 334.277 C 345.196 334.053,345.413 333.786,345.646 333.683 C 345.879 333.581,346.050 333.373,346.025 333.221 C 346.000 333.069,346.173 332.845,346.410 332.725 C 346.647 332.604,347.158 332.085,347.545 331.571 C 348.386 330.457,349.674 329.157,350.232 328.858 C 350.489 328.720,350.614 328.496,350.578 328.236 C 350.539 327.966,350.667 327.757,350.958 327.610 C 351.199 327.489,351.390 327.336,351.384 327.271 C 351.350 326.931,351.406 326.848,351.791 326.677 C 352.022 326.574,352.256 326.300,352.312 326.069 C 352.367 325.837,352.843 325.198,353.370 324.648 C 353.896 324.099,354.449 323.372,354.599 323.034 C 354.749 322.695,355.021 322.370,355.203 322.312 C 355.385 322.255,355.535 322.127,355.535 322.030 C 355.535 321.932,355.747 321.667,356.008 321.441 C 356.268 321.214,356.481 320.872,356.481 320.679 C 356.481 320.486,356.608 320.280,356.764 320.220 C 356.921 320.160,357.048 320.011,357.048 319.888 C 357.048 319.766,357.307 319.512,357.624 319.325 C 358.051 319.073,358.170 318.892,358.084 318.621 C 358.009 318.386,358.073 318.217,358.265 318.143 C 358.428 318.081,358.562 317.917,358.562 317.779 C 358.562 317.641,358.720 317.478,358.914 317.416 C 359.107 317.355,359.423 316.956,359.615 316.529 C 359.807 316.103,360.330 315.378,360.777 314.918 C 361.224 314.458,361.589 313.922,361.589 313.727 C 361.589 313.532,361.845 313.131,362.157 312.836 C 362.469 312.541,362.725 312.190,362.725 312.055 C 362.725 311.813,362.908 311.546,363.503 310.918 C 363.672 310.741,363.959 310.274,364.143 309.880 C 364.326 309.487,364.721 308.903,365.020 308.583 C 365.319 308.263,365.563 307.924,365.563 307.830 C 365.563 307.543,366.016 306.832,366.367 306.567 C 366.549 306.430,366.698 306.159,366.698 305.966 C 366.698 305.772,366.954 305.373,367.266 305.078 C 367.578 304.783,367.833 304.398,367.833 304.222 C 367.833 304.045,367.920 303.848,368.026 303.782 C 368.132 303.717,368.169 303.584,368.108 303.486 C 368.048 303.388,368.132 303.258,368.295 303.195 C 368.457 303.133,368.590 302.972,368.590 302.838 C 368.590 302.704,368.718 302.546,368.874 302.486 C 369.030 302.426,369.158 302.213,369.158 302.013 C 369.158 301.812,369.413 301.375,369.726 301.041 C 370.038 300.706,370.293 300.272,370.293 300.075 C 370.293 299.877,370.442 299.565,370.624 299.379 C 370.807 299.194,371.104 298.747,371.285 298.386 C 371.758 297.447,372.058 296.994,372.319 296.826 C 372.445 296.745,372.498 296.547,372.436 296.386 C 372.374 296.225,372.485 295.866,372.683 295.587 C 372.881 295.308,373.169 294.825,373.323 294.513 C 373.478 294.201,373.710 293.877,373.841 293.794 C 373.971 293.711,374.078 293.537,374.078 293.408 C 374.078 293.138,374.697 291.879,375.024 291.485 C 375.146 291.338,375.191 291.129,375.123 291.021 C 375.056 290.912,375.091 290.823,375.202 290.823 C 375.312 290.823,375.402 290.716,375.402 290.585 C 375.402 290.454,375.577 290.237,375.791 290.104 C 376.054 289.939,376.142 289.744,376.064 289.498 C 375.989 289.261,376.084 289.019,376.338 288.801 C 376.552 288.618,376.727 288.251,376.727 287.985 C 376.727 287.712,376.974 287.231,377.294 286.880 C 377.606 286.538,377.862 286.092,377.862 285.889 C 377.862 285.686,377.943 285.372,378.041 285.191 C 378.477 284.394,379.453 282.202,379.422 282.090 C 379.403 282.022,379.513 281.863,379.665 281.736 C 379.818 281.609,379.943 281.345,379.943 281.149 C 379.943 280.954,380.114 280.476,380.322 280.087 C 380.530 279.699,380.700 279.274,380.700 279.142 C 380.700 279.010,380.785 278.903,380.889 278.903 C 380.993 278.903,381.079 278.724,381.079 278.506 C 381.079 278.047,381.647 277.010,381.898 277.010 C 381.992 277.010,382.028 276.853,381.977 276.660 C 381.927 276.468,382.036 276.111,382.219 275.868 C 382.403 275.624,382.512 275.318,382.462 275.187 C 382.411 275.056,382.499 274.710,382.657 274.419 C 383.245 273.334,383.996 271.427,384.282 270.293 C 384.361 269.981,384.652 269.249,384.928 268.667 C 385.204 268.084,385.430 267.429,385.430 267.211 C 385.430 266.993,385.516 266.763,385.620 266.698 C 385.724 266.634,385.809 266.415,385.809 266.211 C 385.809 266.008,385.886 265.694,385.980 265.513 C 386.074 265.332,386.258 264.823,386.388 264.380 C 386.519 263.938,386.707 263.576,386.805 263.576 C 386.904 263.576,386.940 263.459,386.885 263.316 C 386.830 263.173,386.906 262.822,387.054 262.537 C 387.202 262.252,387.323 261.826,387.323 261.591 C 387.323 261.355,387.454 261.054,387.614 260.920 C 387.801 260.766,387.841 260.613,387.725 260.497 C 387.609 260.381,387.674 260.082,387.906 259.669 C 388.105 259.314,388.269 258.813,388.269 258.556 C 388.269 258.299,388.343 258.089,388.434 258.089 C 388.591 258.089,388.868 256.944,388.922 256.065 C 388.937 255.837,389.103 255.478,389.293 255.269 C 389.530 255.007,389.600 254.737,389.517 254.407 C 389.451 254.143,389.466 253.926,389.550 253.926 C 389.723 253.926,390.211 252.364,390.249 251.690 C 390.262 251.449,390.385 251.183,390.521 251.099 C 390.677 251.003,390.720 250.793,390.638 250.535 C 390.567 250.309,390.592 250.021,390.695 249.896 C 390.798 249.771,390.944 249.243,391.020 248.723 C 391.096 248.202,391.244 247.564,391.349 247.304 C 391.548 246.809,391.566 246.732,391.769 245.506 C 391.838 245.090,391.964 244.579,392.049 244.371 C 392.134 244.163,392.388 243.013,392.613 241.816 C 392.838 240.620,393.106 239.486,393.209 239.298 C 393.311 239.109,393.345 238.797,393.284 238.604 C 393.223 238.411,393.246 238.208,393.336 238.153 C 393.425 238.097,393.513 237.532,393.530 236.896 C 393.551 236.140,393.664 235.638,393.855 235.446 C 394.088 235.213,394.101 235.098,393.917 234.876 C 393.761 234.688,393.750 234.556,393.882 234.470 C 393.990 234.400,394.127 233.798,394.186 233.133 C 394.244 232.468,394.397 231.860,394.524 231.781 C 394.653 231.701,394.709 231.457,394.650 231.232 C 394.592 231.008,394.625 230.553,394.725 230.219 C 394.824 229.885,394.939 229.101,394.979 228.477 C 395.020 227.852,395.111 227.193,395.182 227.010 C 395.252 226.828,395.259 226.545,395.196 226.382 C 395.133 226.218,395.158 225.941,395.252 225.767 C 395.402 225.486,395.487 224.840,395.766 221.854 C 395.805 221.438,395.878 220.501,395.928 219.773 C 395.978 219.044,396.094 217.938,396.186 217.313 C 396.277 216.689,396.334 215.752,396.313 215.232 C 396.291 214.711,396.347 213.859,396.435 213.337 C 396.524 212.815,396.599 211.794,396.602 211.067 C 396.610 208.737,396.636 208.326,396.777 208.325 C 396.871 208.325,396.878 201.377,396.790 196.121 C 396.769 194.872,396.807 193.710,396.875 193.539 C 396.943 193.367,396.907 193.170,396.796 193.101 C 396.674 193.026,396.640 192.687,396.709 192.255 C 396.778 191.822,396.743 191.483,396.622 191.408 C 396.490 191.326,396.479 191.127,396.589 190.836 C 396.683 190.590,396.721 190.350,396.674 190.303 C 396.576 190.205,396.385 187.540,396.367 185.998 C 396.360 185.426,396.305 184.872,396.244 184.768 C 396.184 184.664,396.160 184.342,396.190 184.051 C 396.239 183.590,396.147 182.655,395.738 179.470 C 395.685 179.054,395.606 178.353,395.564 177.914 C 395.521 177.474,395.422 177.009,395.343 176.882 C 395.264 176.754,395.177 176.305,395.149 175.884 C 395.016 173.868,394.930 173.107,394.822 173.000 C 394.758 172.935,394.796 172.774,394.906 172.641 C 395.045 172.474,395.046 172.286,394.912 172.035 C 394.805 171.835,394.674 171.230,394.621 170.691 C 394.569 170.151,394.471 169.622,394.404 169.514 C 394.337 169.406,394.242 168.921,394.191 168.436 C 394.140 167.950,394.023 167.411,393.929 167.236 C 393.836 167.061,393.810 166.666,393.871 166.358 C 393.934 166.044,393.895 165.744,393.783 165.674 C 393.673 165.606,393.628 165.434,393.682 165.292 C 393.737 165.150,393.682 164.972,393.559 164.896 C 393.392 164.793,393.397 164.722,393.579 164.609 C 393.770 164.491,393.756 164.362,393.512 163.989 C 393.342 163.730,393.123 162.868,393.024 162.074 C 392.925 161.279,392.742 160.505,392.616 160.354 C 392.490 160.202,392.434 159.897,392.492 159.676 C 392.549 159.456,392.517 159.115,392.419 158.919 C 392.322 158.722,392.163 158.403,392.067 158.208 C 391.958 157.989,391.959 157.786,392.068 157.677 C 392.178 157.566,392.072 157.073,391.788 156.374 C 391.521 155.716,391.370 155.042,391.426 154.752 C 391.478 154.478,391.428 154.197,391.314 154.126 C 391.200 154.056,391.107 153.791,391.107 153.537 C 391.107 153.283,391.020 153.075,390.914 153.075 C 390.804 153.075,390.771 152.876,390.837 152.612 C 390.901 152.358,390.884 152.039,390.799 151.903 C 390.613 151.605,390.572 151.468,390.416 150.615 C 390.349 150.251,390.179 149.776,390.038 149.559 C 389.897 149.343,389.830 149.117,389.890 149.057 C 389.949 148.997,389.833 148.608,389.632 148.191 C 389.422 147.756,389.330 147.330,389.415 147.191 C 389.500 147.054,389.448 146.782,389.295 146.564 C 389.147 146.352,389.026 146.038,389.026 145.866 C 389.026 145.693,388.902 145.450,388.750 145.324 C 388.528 145.140,388.519 145.021,388.703 144.708 C 388.882 144.404,388.881 144.303,388.694 144.236 C 388.564 144.189,388.458 143.949,388.458 143.704 C 388.458 143.459,388.372 143.205,388.268 143.141 C 388.164 143.076,388.126 142.830,388.186 142.595 C 388.252 142.328,388.181 142.074,387.997 141.921 C 387.834 141.786,387.701 141.547,387.701 141.390 C 387.701 141.233,387.538 140.839,387.338 140.514 C 387.138 140.190,386.919 139.541,386.851 139.073 C 386.784 138.605,386.603 138.027,386.450 137.790 C 386.297 137.553,386.216 137.288,386.270 137.201 C 386.324 137.113,386.201 136.892,385.998 136.708 C 385.744 136.478,385.680 136.282,385.793 136.081 C 385.904 135.881,385.779 135.459,385.399 134.757 C 385.092 134.190,384.879 133.626,384.926 133.504 C 384.973 133.382,384.880 132.988,384.718 132.630 C 384.557 132.271,384.440 131.908,384.459 131.823 C 384.477 131.738,384.320 131.450,384.110 131.183 C 383.900 130.915,383.728 130.577,383.728 130.431 C 383.728 130.286,383.590 129.957,383.423 129.702 C 383.255 129.446,383.170 129.103,383.232 128.939 C 383.296 128.774,383.138 128.335,382.875 127.948 C 382.615 127.566,382.403 127.140,382.403 127.000 C 382.403 126.861,382.270 126.614,382.108 126.452 C 381.946 126.290,381.861 126.033,381.920 125.880 C 381.979 125.728,381.824 125.207,381.577 124.722 C 380.852 123.303,380.533 122.554,380.394 121.949 C 380.322 121.637,380.107 121.178,379.914 120.930 C 379.722 120.682,379.565 120.374,379.565 120.247 C 379.565 120.119,379.352 119.701,379.092 119.318 C 378.832 118.935,378.619 118.538,378.619 118.436 C 378.619 118.335,378.419 117.934,378.175 117.546 C 377.932 117.158,377.770 116.728,377.817 116.590 C 377.864 116.453,377.638 115.915,377.314 115.395 C 376.991 114.875,376.727 114.349,376.727 114.225 C 376.727 114.102,376.429 113.582,376.064 113.069 C 375.678 112.526,375.402 111.912,375.402 111.595 C 375.402 111.297,375.318 110.950,375.216 110.825 C 374.244 109.633,374.008 109.282,373.987 108.999 C 373.974 108.818,373.611 108.155,373.181 107.525 C 372.718 106.846,372.435 106.236,372.486 106.028 C 372.540 105.806,372.151 105.091,371.429 104.088 C 370.665 103.028,370.321 102.386,370.393 102.159 C 370.463 101.939,370.213 101.415,369.688 100.680 C 369.240 100.055,368.491 98.980,368.023 98.292 C 365.775 94.991,365.903 95.072,364.522 96.081 \" stroke=\"none\" fill=\"#d1dc31\" fill-rule=\"evenodd\"></path><path id=\"path10\" d=\"\" stroke=\"none\" fill=\"#99ff33\" fill-rule=\"evenodd\"></path><path id=\"path11\" d=\"M85.380 215.516 C 85.380 215.880,85.419 216.029,85.466 215.847 C 85.514 215.665,85.514 215.367,85.466 215.184 C 85.419 215.002,85.380 215.151,85.380 215.516 \" stroke=\"none\" fill=\"#ffff00\" fill-rule=\"evenodd\"></path></g>\n</svg>;\n\nexport default icons;","// Dependencies\nimport { createNggEditComponent } from './edit.min'\nimport icons from './icons.min';\n\nconst { __ } \t\t\t\t\t = wp.i18n\nconst { RawHTML } \t = wp.element\nconst { registerBlockType } = wp.blocks\nconst { withSelect} = wp.data\nconst { omit } = lodash\nconst { memo } = React\n\n// Provides a higher order component that is aware when the freeform block becomes available\nconst withFreeform = withSelect((select, props) => {\n return {\n Freeform: select('core/blocks').getBlockType('core/freeform')\n }\n})\n\n// When the freeform block is available, we create our edit component for NGG and render it\nconst edit = withFreeform(memo(props => {\n const editProps = omit(props, ['Freeform'])\n const NggEdit = createNggEditComponent(jQuery, props.Freeform.edit)\n return <NggEdit {...editProps} isSelected={true}/>\n}))\n\n// Register our block\nregisterBlockType('imagely/nextgen-gallery', {\n\n title: __('NextGEN Gallery'),\n\n desription: __('A block for adding NextGEN Galleries.'),\n\n icon: icons.nextgen,\n\n category: 'common',\n\n attributes: {\n content: {\n type: 'string',\n source: 'html',\n },\n },\n\n supports: {\n className: false,\n customClassName: false,\n },\n\n edit,\n\n save( { attributes } ) {\n const { content } = attributes;\n return <RawHTML>{ content }</RawHTML>\n },\n});\n\n\n"],"sourceRoot":""}
products/photocrati_nextgen/modules/nextgen_block/static/src/block.min.js CHANGED
@@ -18,10 +18,9 @@ const withFreeform = withSelect((select, props) => {
18
 
19
  // When the freeform block is available, we create our edit component for NGG and render it
20
  const edit = withFreeform(memo(props => {
21
- props.isSelected = true
22
  const editProps = omit(props, ['Freeform'])
23
  const NggEdit = createNggEditComponent(jQuery, props.Freeform.edit)
24
- return <NggEdit {...editProps}/>
25
  }))
26
 
27
  // Register our block
18
 
19
  // When the freeform block is available, we create our edit component for NGG and render it
20
  const edit = withFreeform(memo(props => {
 
21
  const editProps = omit(props, ['Freeform'])
22
  const NggEdit = createNggEditComponent(jQuery, props.Freeform.edit)
23
+ return <NggEdit {...editProps} isSelected={true}/>
24
  }))
25
 
26
  // Register our block
products/photocrati_nextgen/modules/nextgen_data/module.nextgen_data.php CHANGED
@@ -22,7 +22,7 @@ class M_NextGen_Data extends C_Base_Module
22
  'photocrati-nextgen-data',
23
  'NextGEN Data Tier',
24
  "Provides a data tier for NextGEN gallery based on the DataMapper module",
25
- '3.1.6',
26
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
27
  'Imagely',
28
  'https://www.imagely.com'
@@ -165,6 +165,9 @@ class M_NextGen_Data extends C_Base_Module
165
  // Remove disallowed elements and content
166
  if ($data instanceof DOMElement) {
167
  foreach ($data->getElementsByTagName('script') as $deleteme) {
 
 
 
168
  $data->removeChild($deleteme);
169
  }
170
  }
@@ -196,7 +199,7 @@ class M_NextGen_Data extends C_Base_Module
196
  }
197
  }
198
  else {
199
- $dom = new DOMDocument();
200
 
201
  if (!empty($data))
202
  {
@@ -259,18 +262,22 @@ class M_NextGen_Data extends C_Base_Module
259
  'C_Gallery' => 'class.gallery.php',
260
  'C_Gallery_Mapper' => 'class.gallery_mapper.php',
261
  'C_Gallery_Storage' => 'class.gallery_storage.php',
262
- 'C_Gallerystorage_Base' => 'class.gallerystorage_base.php',
263
- 'C_Gallerystorage_Driver_Base' => 'class.gallerystorage_driver_base.php',
264
  'C_Image' => 'class.image.php',
265
  'C_Image_Mapper' => 'class.image_mapper.php',
266
  'C_Image_Wrapper' => 'class.image_wrapper.php',
267
  'C_Image_Wrapper_Collection' => 'class.image_wrapper_collection.php',
268
  'C_NextGen_Data_Installer' => 'class.nextgen_data_installer.php',
269
  'C_Nextgen_Metadata' => 'class.nextgen_metadata.php',
270
- 'C_Ngglegacy_Gallerystorage_Driver' => 'class.ngglegacy_gallerystorage_driver.php',
271
- 'C_Ngglegacy_Thumbnail' => 'class.ngglegacy_thumbnail.php',
272
- 'C_Wordpress_Gallerystorage_Driver' => 'class.wordpress_gallerystorage_driver.php',
273
- 'Mixin_NextGen_Table_Extras' => 'mixin.nextgen_table_extras.php'
 
 
 
 
 
 
274
  );
275
  }
276
  }
22
  'photocrati-nextgen-data',
23
  'NextGEN Data Tier',
24
  "Provides a data tier for NextGEN gallery based on the DataMapper module",
25
+ '3.1.10',
26
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
27
  'Imagely',
28
  'https://www.imagely.com'
165
  // Remove disallowed elements and content
166
  if ($data instanceof DOMElement) {
167
  foreach ($data->getElementsByTagName('script') as $deleteme) {
168
+ /**
169
+ * @var DOMNode $deleteme
170
+ */
171
  $data->removeChild($deleteme);
172
  }
173
  }
199
  }
200
  }
201
  else {
202
+ $dom = new DOMDocument('1.0', 'UTF-8');
203
 
204
  if (!empty($data))
205
  {
262
  'C_Gallery' => 'class.gallery.php',
263
  'C_Gallery_Mapper' => 'class.gallery_mapper.php',
264
  'C_Gallery_Storage' => 'class.gallery_storage.php',
 
 
265
  'C_Image' => 'class.image.php',
266
  'C_Image_Mapper' => 'class.image_mapper.php',
267
  'C_Image_Wrapper' => 'class.image_wrapper.php',
268
  'C_Image_Wrapper_Collection' => 'class.image_wrapper_collection.php',
269
  'C_NextGen_Data_Installer' => 'class.nextgen_data_installer.php',
270
  'C_Nextgen_Metadata' => 'class.nextgen_metadata.php',
271
+ 'C_Ngglegacy_Thumbnail' => 'class.ngglegacy_thumbnail.php',
272
+ 'C_Dynamic_Thumbnails_Manager' => 'class.dynamic_thumbnails_manager.php',
273
+ 'Mixin_NextGen_Table_Extras' => 'mixin.nextgen_table_extras.php',
274
+ 'Mixin_GalleryStorage_Base' => 'mixin.gallerystorage_base.php',
275
+ 'Mixin_GalleryStorage_Base_Dynamic' => 'mixin.gallerystorage_base_dynamic.php',
276
+ 'Mixin_GalleryStorage_Base_Getters' => 'mixin.gallerystorage_base_getters.php',
277
+ 'Mixin_GalleryStorage_Base_Management' => 'mixin.gallerystorage_base_management.php',
278
+ 'Mixin_GalleryStorage_Base_MediaLibrary' => 'mixin.gallerystorage_base_medialibrary.php',
279
+ 'Mixin_GalleryStorage_Base_Upload' => 'mixin.gallerystorage_base_upload.php'
280
+
281
  );
282
  }
283
  }
products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php CHANGED
@@ -70,14 +70,6 @@ class A_NextGen_Data_Factory extends Mixin
70
  {
71
  return new C_Album($properties, $mapper, $context);
72
  }
73
- function ngglegacy_gallery_storage($context = FALSE)
74
- {
75
- return new C_NggLegacy_GalleryStorage_Driver($context);
76
- }
77
- function wordpress_gallery_storage($context = FALSE)
78
- {
79
- return new C_WordPress_GalleryStorage_Driver($context);
80
- }
81
  function gallery_storage($context = FALSE)
82
  {
83
  return new C_Gallery_Storage($context);
@@ -236,6 +228,371 @@ class Mixin_Album_Mapper extends Mixin
236
  }
237
  }
238
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  class C_Exif_Writer_Wrapper
240
  {
241
  // Because our C_Exif_Writer class relies on PEL (a library which uses namespaces) we wrap
@@ -309,22 +666,15 @@ class Mixin_NextGen_Gallery_Validation
309
  }
310
  }
311
  // Set what will be the path to the gallery
 
312
  if (!$this->object->path) {
313
- $storage = C_Gallery_Storage::get_instance();
314
- $this->object->path = $storage->get_upload_relpath($this->object);
315
- unset($storage);
316
- } else {
317
- $this->object->path = M_NextGen_Data::strip_html($this->object->path);
318
- $this->object->path = str_replace(array('"', "''", ">", "<"), array('', '', '', ''), $this->object->path);
319
  }
320
  // Ensure that the gallery path is restricted to $fs->get_document_root('galleries')
321
  $fs = C_Fs::get_instance();
322
  $root = $fs->get_document_root('galleries');
323
- $gallery_abspath = $fs->get_absolute_path($fs->join_paths($root, $this->object->path));
324
- $storage = C_Gallery_Storage::get_instance();
325
- if ($gallery_abspath[0] != DIRECTORY_SEPARATOR) {
326
- $gallery_abspath = DIRECTORY_SEPARATOR . $gallery_abspath;
327
- }
328
  if (strpos($gallery_abspath, $root) === FALSE) {
329
  $this->object->add_error(sprintf(__("Gallery path must be located in %s", 'nggallery'), $root), 'gallerypath');
330
  $this->object->path = $storage->get_upload_relpath($this->object);
@@ -338,7 +688,7 @@ class Mixin_NextGen_Gallery_Validation
338
  // Establish some rules on where galleries can go
339
  $abspath = $storage->get_gallery_abspath($this->object);
340
  // Galleries should at least be a sub-folder, not directly in WP_CONTENT
341
- $not_directly_in = array('content' => WP_CONTENT_DIR, 'wordpress root' => $fs->get_document_root());
342
  if (!empty($_SERVER['DOCUMENT_ROOT'])) {
343
  $not_directly_in['document root'] = $_SERVER['DOCUMENT_ROOT'];
344
  }
@@ -347,8 +697,9 @@ class Mixin_NextGen_Gallery_Validation
347
  $this->object->add_error(sprintf(__("Gallery path must be a sub-directory under the %s directory", 'nggallery'), $label), 'gallerypath');
348
  }
349
  }
 
350
  // Disallow galleries from being under these directories at all
351
- $not_ever_in = array('plugins' => WP_PLUGIN_DIR, 'must use plugins' => WPMU_PLUGIN_DIR, 'wp-admin' => $fs->join_paths(ABSPATH, 'wp-admin'), 'wp-includes' => $fs->join_paths(ABSPATH, 'wp-admin'), 'themes' => get_theme_root());
352
  foreach ($not_ever_in as $label => $dir) {
353
  if (strpos($abspath, $dir) === 0) {
354
  $this->object->add_error(sprintf(__("Gallery path cannot be under %s directory", 'nggallery'), $label), 'gallerypath');
@@ -456,7 +807,7 @@ class C_Gallery_Mapper extends C_CustomTable_DataMapper_Driver
456
  */
457
  public static function get_instance($context = False)
458
  {
459
- if (is_null(self::$_instance)) {
460
  $klass = get_class();
461
  self::$_instance = new $klass($context);
462
  }
@@ -585,100 +936,6 @@ class Mixin_Gallery_Mapper extends Mixin
585
  $this->object->_set_default_value($entity, 'author', get_current_user_id());
586
  }
587
  }
588
- class GalleryStorageDriverNotSelectedException extends RuntimeException
589
- {
590
- function __construct($message = '', $code = NULL, $previous = NULL)
591
- {
592
- if (!$message) {
593
- $message = "No gallery storage driver selected.";
594
- }
595
- parent::__construct($message, $code, $previous);
596
- }
597
- }
598
- class Mixin_GalleryStorage extends Mixin
599
- {
600
- /**
601
- * Returns the name of the class which provides the gallerystorage implementation
602
- * @param string|bool $context (optional)
603
- * @return string
604
- */
605
- function _get_driver_factory_method($context = FALSE)
606
- {
607
- $factory_method = '';
608
- // No constant has been defined to establish a global gallerystorage driver
609
- if (!defined('GALLERYSTORAGE_DRIVER')) {
610
- // Get the datamapper configured in the database
611
- $factory_method = C_NextGen_Settings::get_instance()->gallerystorage_driver;
612
- // Define a constant and use this as the global gallerystorage driver,
613
- // unless running in a SimpleTest Environment
614
- if (!isset($GLOBALS['SIMPLE_TEST_RUNNING'])) {
615
- define('GALLERYSTORAGE_DRIVER', $factory_method);
616
- }
617
- } else {
618
- $factory_method = GALLERYSTORAGE_DRIVER;
619
- }
620
- return $factory_method;
621
- }
622
- }
623
- class C_GalleryStorage_Base extends C_Component
624
- {
625
- /**
626
- * Gets the url or path of an image of a particular size
627
- * @param string $method
628
- * @param array $args
629
- * @return mixed
630
- */
631
- function __call($method, $args)
632
- {
633
- if (preg_match("/^get_(\\w+)_(abspath|url|dimensions|html|size_params)\$/", $method, $match)) {
634
- if (isset($match[1]) && isset($match[2]) && !$this->has_method($method)) {
635
- $method = 'get_image_' . $match[2];
636
- $args[] = $match[1];
637
- // array($image, $size)
638
- return parent::__call($method, $args);
639
- }
640
- }
641
- return parent::__call($method, $args);
642
- }
643
- }
644
- /**
645
- * Class C_Gallery_Storage
646
- * @mixin Mixin_GalleryStorage
647
- * @implements I_Gallery_Storage
648
- */
649
- class C_Gallery_Storage extends C_GalleryStorage_Base
650
- {
651
- public static $_instances = array();
652
- function define($context = FALSE)
653
- {
654
- parent::define($context);
655
- $this->add_mixin('Mixin_GalleryStorage');
656
- $this->wrap('I_GalleryStorage_Driver', array(&$this, '_get_driver'), $context);
657
- $this->implement('I_Gallery_Storage');
658
- }
659
- /**
660
- * @param bool|string $context
661
- * @return C_Gallery_Storage
662
- */
663
- static function get_instance($context = False)
664
- {
665
- if (!isset(self::$_instances[$context])) {
666
- self::$_instances[$context] = new C_Gallery_Storage($context);
667
- }
668
- return self::$_instances[$context];
669
- }
670
- /**
671
- * Returns the implementation for the gallerystorage
672
- * @param string $context
673
- * @return mixed
674
- */
675
- function _get_driver($context)
676
- {
677
- $factory_method = $this->_get_driver_factory_method($context);
678
- $factory = C_Component_Factory::get_instance();
679
- return $factory->create($factory_method, FALSE, $context);
680
- }
681
- }
682
  class E_UploadException extends E_NggErrorException
683
  {
684
  function __construct($message = '', $code = NULL, $previous = NULL)
@@ -738,2855 +995,2519 @@ class E_No_Image_Library_Exception extends E_NggErrorException
738
  }
739
  }
740
  }
741
- class Mixin_GalleryStorage_Driver_Base extends Mixin
 
 
 
 
 
 
 
 
 
 
742
  {
743
- /**
744
- * Set correct file permissions (taken from wp core). Should be called
745
- * after writing any file
746
- *
747
- * @class nggAdmin
748
- * @param string $filename
749
- * @return bool $result
750
- */
751
- function _chmod($filename = '')
752
  {
753
- $stat = @stat(dirname($filename));
754
- $perms = $stat['mode'] & 0666;
755
- // Remove execute bits for files
756
- if (@chmod($filename, $perms)) {
757
- return TRUE;
758
- }
759
- return FALSE;
 
 
 
760
  }
761
  /**
762
- * Gets the id of a gallery, regardless of whether an integer
763
- * or object was passed as an argument
764
- * @param mixed $gallery_obj_or_id
765
- * @return null|int
 
 
 
766
  */
767
- function _get_gallery_id($gallery_obj_or_id)
768
  {
769
- $retval = NULL;
770
- $gallery_key = $this->object->_gallery_mapper->get_primary_key_column();
771
- if (is_object($gallery_obj_or_id)) {
772
- if (isset($gallery_obj_or_id->{$gallery_key})) {
773
- $retval = $gallery_obj_or_id->{$gallery_key};
774
  }
775
- } elseif (is_numeric($gallery_obj_or_id)) {
776
- $retval = $gallery_obj_or_id;
777
  }
778
- return $retval;
779
  }
780
  /**
781
- * Gets the id of an image, regardless of whether an integer
782
- * or object was passed as an argument
783
- * @param object|int $image_obj_or_id
784
- * @return null|int
785
  */
786
- function _get_image_id($image_obj_or_id)
787
- {
788
- $retval = NULL;
789
- $image_key = $this->object->_image_mapper->get_primary_key_column();
790
- if (is_object($image_obj_or_id)) {
791
- if (isset($image_obj_or_id->{$image_key})) {
792
- $retval = $image_obj_or_id->{$image_key};
793
- }
794
- } elseif (is_numeric($image_obj_or_id)) {
795
- $retval = $image_obj_or_id;
796
- }
797
- return $retval;
798
- }
799
- function convert_slashes($path)
800
  {
801
- $search = array('/', "\\");
802
- $replace = array(DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR);
803
- return str_replace($search, $replace, $path);
804
  }
805
- function delete_directory($abspath)
806
  {
807
- $retval = FALSE;
808
- if (@file_exists($abspath)) {
809
- $files = scandir($abspath);
810
- array_shift($files);
811
- array_shift($files);
812
- foreach ($files as $file) {
813
- $file_abspath = implode(DIRECTORY_SEPARATOR, array(rtrim($abspath, "/\\"), $file));
814
- if (is_dir($file_abspath)) {
815
- $this->object->delete_directory($file_abspath);
816
- } else {
817
- unlink($file_abspath);
818
- }
819
- }
820
- rmdir($abspath);
821
- $retval = @file_exists($abspath);
822
- }
823
- return $retval;
824
  }
825
  /**
826
- * Backs up an image file
827
- *
828
- * @param int|object $image
829
- * @return bool
830
  */
831
- function backup_image($image)
832
  {
833
- $retval = FALSE;
834
- $image_path = $this->object->get_image_abspath($image);
835
- if ($image_path && @file_exists($image_path)) {
836
- $retval = copy($image_path, $this->object->get_backup_abspath($image));
837
- // Store the dimensions of the image
838
- if (function_exists('getimagesize')) {
839
- $mapper = C_Image_Mapper::get_instance();
840
- if (!is_object($image)) {
841
- $image = $mapper->find($image);
842
- }
843
- if ($image) {
844
- if (!property_exists($image, 'meta_data')) {
845
- $image->meta_data = array();
846
- }
847
- $dimensions = getimagesize($image_path);
848
- $image->meta_data['backup'] = array('filename' => basename($image_path), 'width' => $dimensions[0], 'height' => $dimensions[1], 'generated' => microtime());
849
- $mapper->save($image);
850
- }
851
- }
852
  }
853
- return $retval;
854
  }
855
- /**
856
- * Copies images into another gallery
857
- * @param array $images
858
- * @param int|object $gallery
859
- * @param boolean $db optionally only copy the image files
860
- * @param boolean $move move the image instead of copying
861
- * @return bool
862
- */
863
- function copy_images($images, $gallery, $db = TRUE, $move = FALSE)
864
  {
865
- $retval = FALSE;
866
- // Ensure we have a valid gallery
867
- if ($gallery = $this->object->_get_gallery_id($gallery)) {
868
- $gallery_path = $this->object->get_gallery_abspath($gallery);
869
- $image_key = $this->object->_image_mapper->get_primary_key_column();
870
- $retval = TRUE;
871
- $fs = C_Fs::get_instance();
872
- // Iterate through each image to copy...
873
- foreach ($images as $image) {
874
- // Copy each image size
875
- foreach ($this->object->get_image_sizes() as $size) {
876
- $image_path = $this->object->get_image_abspath($image, $size);
877
- $dst = $fs->join_paths($gallery_path, M_I18n::mb_basename($image_path));
878
- $success = $move ? move($image_path, $dst) : copy($image_path, $dst);
879
- if (!$success) {
880
- $retval = FALSE;
881
- }
882
- }
883
- // Copy the db entry
884
- if ($db) {
885
- if (is_numeric($image)) {
886
- $this->object->_image_mapper($image);
887
- }
888
- unset($image->{$image_key});
889
- $image->galleryid = $gallery;
890
- }
891
- }
892
  }
893
- return $retval;
894
- }
895
- /**
896
- * Empties the gallery cache directory of content
897
- * @param object $gallery
898
- */
899
- function flush_cache($gallery)
900
- {
901
- $cache = C_Cache::get_instance();
902
- $cache->flush_directory($this->object->get_cache_abspath($gallery));
903
- }
904
- /**
905
- * Gets the absolute path of the backup of an original image
906
- * @param string $image
907
- * @return null|string
908
- */
909
- function get_backup_abspath($image)
910
- {
911
- $retval = null;
912
- if ($image_path = $this->object->get_image_abspath($image)) {
913
- $retval = $image_path . '_backup';
914
  }
915
- return $retval;
916
- }
917
- function get_backup_dimensions($image)
918
- {
919
- return $this->object->get_image_dimensions($image, 'backup');
 
920
  }
921
- function get_backup_url($image)
 
 
 
 
 
 
 
 
 
922
  {
923
- return $this->object->get_image_url($image, 'backup');
 
 
924
  }
925
  /**
926
- * Returns the absolute path to the cache directory of a gallery.
927
- *
928
- * Without the gallery parameter the legacy (pre 2.0) shared directory is returned.
929
- *
930
- * @param int|object|false|C_Gallery $gallery (optional)
931
- * @return string Absolute path to cache directory
932
  */
933
- function get_cache_abspath($gallery = FALSE)
934
  {
935
- $retval = NULL;
936
- if (FALSE == $gallery) {
937
- $gallerypath = C_NextGen_Settings::get_instance()->gallerypath;
938
- $retval = implode(DIRECTORY_SEPARATOR, array(rtrim(C_Fs::get_instance()->get_document_root('gallery'), "/\\"), rtrim($gallerypath, "/\\"), 'cache'));
939
- } else {
940
- if (is_numeric($gallery)) {
941
- $gallery = $this->object->_gallery_mapper->find($gallery);
942
- }
943
- $retval = rtrim(implode(DIRECTORY_SEPARATOR, array($this->object->get_gallery_abspath($gallery), 'dynamic')), "/\\");
944
  }
945
- return $retval;
946
  }
947
  /**
948
- * Gets the absolute path where the full-sized image is stored
949
- * @param int|object $image
950
- * @return null|string
951
  */
952
- function get_full_abspath($image)
953
  {
954
- return $this->object->get_image_abspath($image, 'full');
955
  }
 
 
 
 
 
 
 
 
 
 
956
  /**
957
- * Alias to get_image_dimensions()
958
- * @param int|object $image
959
- * @return array
960
  */
961
- function get_full_dimensions($image)
962
  {
963
- return $this->object->get_image_dimensions($image, 'full');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
964
  }
965
- /**
966
- * Alias to get_image_html()
967
- * @param int|object $image
968
- * @return string
969
- */
970
- function get_full_html($image)
971
  {
972
- return $this->object->get_image_html($image, 'full');
973
  }
974
  /**
975
- * Alias for get_original_url()
976
- *
977
- * @param int|stdClass|C_Image $image
978
- * @param bool $check_existance (optional)
979
- * @return string
980
  */
981
- function get_full_url($image, $check_existance = FALSE)
982
  {
983
- return $this->object->get_image_url($image, 'full', $check_existance);
 
 
 
 
984
  }
985
- function get_image_checksum($image, $size = 'full')
 
 
 
 
 
 
986
  {
987
- $retval = NULL;
988
- if ($image_abspath = $this->get_image_abspath($image, $size, TRUE)) {
989
- $retval = md5_file($image_abspath);
 
990
  }
 
 
991
  return $retval;
992
  }
993
- /**
994
- * Gets the dimensions for a particular-sized image
995
- *
996
- * @param int|object $image
997
- * @param string $size
998
- * @return null|array
999
- */
1000
- function get_image_dimensions($image, $size = 'full')
1001
  {
1002
- $retval = NULL;
1003
- // If an image id was provided, get the entity
1004
- if (is_numeric($image)) {
1005
- $image = $this->object->_image_mapper->find($image);
1006
- }
1007
- // Ensure we have a valid image
1008
- if ($image) {
1009
- // Adjust size parameter
1010
- switch ($size) {
1011
- case 'original':
1012
- $size = 'full';
1013
- break;
1014
- case 'thumbnails':
1015
- case 'thumbnail':
1016
- case 'thumb':
1017
- case 'thumbs':
1018
- $size = 'thumbnail';
1019
- break;
1020
- }
1021
- // Image dimensions are stored in the $image->meta_data
1022
- // property for all implementations
1023
- if (isset($image->meta_data) && isset($image->meta_data[$size])) {
1024
- $retval = $image->meta_data[$size];
1025
- } else {
1026
- $abspath = $this->object->get_image_abspath($image, $size);
1027
- if (@file_exists($abspath)) {
1028
- $dims = getimagesize($abspath);
1029
- if ($dims) {
1030
- $retval['width'] = $dims[0];
1031
- $retval['height'] = $dims[1];
1032
- }
1033
- } elseif ($size == 'backup') {
1034
- $retval = $this->object->get_image_dimensions($image, 'full');
1035
- }
1036
  }
 
1037
  }
1038
  return $retval;
1039
  }
1040
- /**
1041
- * Gets the HTML for an image
1042
- * @param int|object $image
1043
- * @param string $size
1044
- * @param array $attributes (optional)
1045
- * @return string
1046
- */
1047
- function get_image_html($image, $size = 'full', $attributes = array())
1048
  {
1049
- $retval = "";
1050
- if (is_numeric($image)) {
1051
- $image = $this->object->_image_mapper->find($image);
 
 
 
1052
  }
1053
- if ($image) {
1054
- // Set alt text if not already specified
1055
- if (!isset($attributes['alttext'])) {
1056
- $attributes['alt'] = esc_attr($image->alttext);
1057
- }
1058
- // Set the title if not already set
1059
- if (!isset($attributes['title'])) {
1060
- $attributes['title'] = esc_attr($image->alttext);
1061
- }
1062
- // Set the dimensions if not set already
1063
- if (!isset($attributes['width']) or !isset($attributes['height'])) {
1064
- $dimensions = $this->object->get_image_dimensions($image, $size);
1065
- if (!isset($attributes['width'])) {
1066
- $attributes['width'] = $dimensions['width'];
1067
- }
1068
- if (!isset($attributes['height'])) {
1069
- $attributes['height'] = $dimensions['height'];
1070
- }
1071
- }
1072
- // Set the url if not already specified
1073
- if (!isset($attributes['src'])) {
1074
- $attributes['src'] = $this->object->get_image_url($image, $size);
1075
- }
1076
- // Format attributes
1077
- $attribs = array();
1078
- foreach ($attributes as $attrib => $value) {
1079
- $attribs[] = "{$attrib}=\"{$value}\"";
1080
- }
1081
- $attribs = implode(" ", $attribs);
1082
- // Return HTML string
1083
- $retval = "<img {$attribs} />";
1084
  }
1085
- return $retval;
1086
- }
1087
- /**
1088
- * An alias for get_full_abspath()
1089
- * @param int|object $image
1090
- * @param bool $check_existance
1091
- * @return null|string
1092
- */
1093
- function get_original_abspath($image, $check_existance = FALSE)
1094
- {
1095
- return $this->object->get_image_abspath($image, 'full', $check_existance);
1096
- }
1097
- /**
1098
- * Alias to get_image_dimensions()
1099
- * @param int|object $image
1100
- * @return array
1101
- */
1102
- function get_original_dimensions($image)
1103
- {
1104
- return $this->object->get_image_dimensions($image, 'full');
1105
- }
1106
- /**
1107
- * Alias to get_image_html()
1108
- * @param int|object $image
1109
- * @return string
1110
- */
1111
- function get_original_html($image)
1112
- {
1113
- return $this->object->get_image_html($image, 'full');
1114
- }
1115
- /**
1116
- * Gets the url to the original-sized image
1117
- * @param int|stdClass|C_Image $image
1118
- * @param bool $check_existance (optional)
1119
- * @return string
1120
- */
1121
- function get_original_url($image, $check_existance = FALSE)
1122
- {
1123
- return $this->object->get_image_url($image, 'full', $check_existance);
1124
- }
1125
- /**
1126
- * Gets the upload path, optionally for a particular gallery
1127
- * @param int|C_Gallery|object|false $gallery (optional)
1128
- * @return string
1129
- */
1130
- function get_upload_relpath($gallery = FALSE)
1131
- {
1132
- $fs = C_Fs::get_instance();
1133
- $retval = str_replace($fs->get_document_root('gallery'), '', $this->object->get_upload_abspath($gallery));
1134
- return DIRECTORY_SEPARATOR . ltrim($retval, "/\\");
1135
  }
1136
  /**
1137
- * Moves images from to another gallery
1138
- * @param array $images
1139
- * @param int|object $gallery
1140
- * @param boolean $db optionally only move the image files, not the db entries
1141
- * @return boolean
1142
  */
1143
- function move_images($images, $gallery, $db = TRUE)
1144
- {
1145
- return $this->object->copy_images($images, $gallery, $db, TRUE);
1146
- }
1147
- function is_image_file($filename = NULL)
1148
  {
1149
  $retval = FALSE;
1150
- if (!$filename && isset($_FILES['file']) && $_FILES['file']['error'] == 0) {
1151
- $filename = $_FILES['file']['tmp_name'];
1152
- }
1153
- $valid_types = array('image/gif', 'image/jpg', 'image/jpeg', 'image/pjpeg', 'image/png');
1154
- // If we can, we'll verify the mime type
1155
- if (function_exists('exif_imagetype')) {
1156
- if (($image_type = @exif_imagetype($filename)) !== FALSE) {
1157
- $retval = in_array(image_type_to_mime_type($image_type), $valid_types);
1158
  }
1159
  } else {
1160
- $file_info = @getimagesize($filename);
1161
- if (isset($file_info[2])) {
1162
- $retval = in_array(image_type_to_mime_type($file_info[2]), $valid_types);
1163
- }
 
 
 
1164
  }
1165
  return $retval;
1166
  }
1167
- function is_zip()
1168
  {
1169
- $retval = FALSE;
1170
- if (isset($_FILES['file']) && $_FILES['file']['error'] == 0) {
1171
- $file_info = $_FILES['file'];
1172
- if (isset($file_info['type'])) {
1173
- $type = $file_info['type'];
1174
- $type_parts = explode('/', $type);
1175
- if (strtolower($type_parts[0]) == 'application') {
1176
- $spec = $type_parts[1];
1177
- $spec_parts = explode('-', $spec);
1178
- $spec_parts = array_map('strtolower', $spec_parts);
1179
- if (in_array($spec, array('zip', 'octet-stream')) || in_array('zip', $spec_parts)) {
1180
- $retval = true;
1181
- }
1182
- }
1183
- }
1184
- }
1185
- return $retval;
1186
  }
1187
- function upload_zip($gallery_id)
1188
  {
1189
- $memory_limit = intval(ini_get('memory_limit'));
1190
- if (!extension_loaded('suhosin') && $memory_limit < 256) {
1191
- @ini_set('memory_limit', '256M');
 
 
 
 
 
 
 
1192
  }
1193
- $retval = FALSE;
1194
- if ($this->object->is_zip()) {
1195
- $fs = C_Fs::get_instance();
1196
- // Uses the WordPress ZIP abstraction API
1197
- include_once $fs->join_paths(ABSPATH, 'wp-admin', 'includes', 'file.php');
1198
- WP_Filesystem();
1199
- // Ensure that we truly have the gallery id
1200
- $gallery_id = $this->_get_gallery_id($gallery_id);
1201
- $zipfile = $_FILES['file']['tmp_name'];
1202
- $dest_path = implode(DIRECTORY_SEPARATOR, array(rtrim(get_temp_dir(), "/\\"), 'unpacked-' . M_I18n::mb_basename($zipfile)));
1203
- wp_mkdir_p($dest_path);
1204
- if (unzip_file($zipfile, $dest_path) === TRUE) {
1205
- $dest_dir = $dest_path . DIRECTORY_SEPARATOR;
1206
- $files = glob($dest_dir . '*');
1207
- $size = 0;
1208
- foreach ($files as $file) {
1209
- if (is_file($dest_dir . $file)) {
1210
- $size += filesize($dest_dir . $file);
1211
- }
1212
- }
1213
- if ($size == 0) {
1214
- $this->object->delete_directory($dest_path);
1215
- $destination = wp_upload_dir();
1216
- $destination_path = $destination['basedir'];
1217
- $dest_path = implode(DIRECTORY_SEPARATOR, array(rtrim($destination_path, "/\\"), 'unpacked-' . M_I18n::mb_basename($zipfile)));
1218
- wp_mkdir_p($dest_path);
1219
- if (unzip_file($zipfile, $dest_path) === TRUE) {
1220
- $retval = $this->object->import_gallery_from_fs($dest_path, $gallery_id);
1221
- }
1222
- } else {
1223
- $retval = $this->object->import_gallery_from_fs($dest_path, $gallery_id);
1224
- }
1225
- }
1226
- $this->object->delete_directory($dest_path);
1227
  }
1228
- if (!extension_loaded('suhosin')) {
1229
- @ini_set('memory_limit', $memory_limit . 'M');
 
1230
  }
1231
- return $retval;
1232
- }
1233
- function is_current_user_over_quota()
1234
- {
1235
- $retval = FALSE;
1236
- $settings = C_NextGen_Settings::get_instance();
1237
- if (is_multisite() && $settings->get('wpmuQuotaCheck')) {
1238
- require_once ABSPATH . 'wp-admin/includes/ms.php';
1239
- $retval = upload_is_user_over_quota(FALSE);
1240
  }
1241
- return $retval;
 
 
1242
  }
1243
  /**
1244
- * Uploads base64 file to a gallery
1245
- * @param int|stdClass|C_Gallery $gallery
1246
- * @param $data base64-encoded string of data representing the image
1247
- * @param string|false (optional) $filename specifies the name of the file
1248
- * @param int|false $image_id (optional)
1249
- * @param bool $override (optional)
1250
- * @return C_Image
1251
  */
1252
- function upload_base64_image($gallery, $data, $filename = FALSE, $image_id = FALSE, $override = FALSE)
1253
  {
1254
- $settings = C_NextGen_Settings::get_instance();
1255
- $memory_limit = intval(ini_get('memory_limit'));
1256
- if (!extension_loaded('suhosin') && $memory_limit < 256) {
1257
- @ini_set('memory_limit', '256M');
1258
- }
1259
- $retval = NULL;
1260
- if ($gallery_id = $this->object->_get_gallery_id($gallery)) {
1261
- if ($this->object->is_current_user_over_quota()) {
1262
- $message = sprintf(__('Sorry, you have used your space allocation. Please delete some files to upload more files.', 'nggallery'));
1263
- throw new E_NoSpaceAvailableException($message);
1264
- }
1265
- // Get path information. The use of get_upload_abspath() might
1266
- // not be the best for some drivers. For example, if using the
1267
- // WordPress Media Library for uploading, then the wp_upload_bits()
1268
- // function should perhaps be used
1269
- $upload_dir = $this->object->get_upload_abspath($gallery);
1270
- // Perhaps a filename was given instead of base64 data?
1271
- if (preg_match("#/\\\\#", $data[0]) && @file_exists($data)) {
1272
- if (!$filename) {
1273
- $filename = M_I18n::mb_basename($data);
1274
- }
1275
- $data = file_get_contents($data);
1276
- }
1277
- // Determine filenames
1278
- $original_filename = $filename;
1279
- $filename = $filename ? sanitize_file_name($original_filename) : uniqid('nextgen-gallery');
1280
- if (preg_match("/\\-(png|jpg|gif|jpeg)\$/i", $filename, $match)) {
1281
- $filename = str_replace($match[0], '.' . $match[1], $filename);
1282
- }
1283
- $abs_filename = implode(DIRECTORY_SEPARATOR, array($upload_dir, $filename));
1284
- // Ensure that the filename is valid
1285
- if (!preg_match("/(png|jpeg|jpg|gif)\$/i", $abs_filename)) {
1286
- throw new E_UploadException(__('Invalid image file. Acceptable formats: JPG, GIF, and PNG.', 'nggallery'));
1287
- }
1288
- // Prevent duplicate filenames: check if the filename exists and
1289
- // begin appending '-i' until we find an open slot
1290
- if (!ini_get('safe_mode') && @file_exists($abs_filename) && !$override) {
1291
- $file_exists = TRUE;
1292
- $i = 0;
1293
- do {
1294
- $i++;
1295
- $parts = explode('.', $filename);
1296
- $extension = array_pop($parts);
1297
- $new_filename = implode('.', $parts) . '-' . $i . '.' . $extension;
1298
- $new_abs_filename = implode(DIRECTORY_SEPARATOR, array($upload_dir, $new_filename));
1299
- if (!@file_exists($new_abs_filename)) {
1300
- $file_exists = FALSE;
1301
- $filename = $new_filename;
1302
- $abs_filename = $new_abs_filename;
1303
- }
1304
- } while ($file_exists == TRUE);
1305
- }
1306
- // Create or retrieve the image object
1307
- $image = NULL;
1308
- if ($image_id) {
1309
- $image = $this->object->_image_mapper->find($image_id, TRUE);
1310
- if ($image) {
1311
- unset($image->meta_data['saved']);
1312
- }
1313
- }
1314
- if (!$image) {
1315
- $image = $this->object->_image_mapper->create();
1316
- }
1317
- $retval = $image;
1318
- // Create or update the database record
1319
- $image->alttext = str_replace('.' . M_I18n::mb_pathinfo($original_filename, PATHINFO_EXTENSION), '', M_I18n::mb_basename($original_filename));
1320
- $image->galleryid = $this->object->_get_gallery_id($gallery);
1321
- $image->filename = $filename;
1322
- $image->image_slug = nggdb::get_unique_slug(sanitize_title_with_dashes($image->alttext), 'image');
1323
- $image_key = $this->object->_image_mapper->get_primary_key_column();
1324
- // If we can't write to the directory, then there's no point in continuing
1325
- if (!@file_exists($upload_dir)) {
1326
- @wp_mkdir_p($upload_dir);
1327
- }
1328
- if (!is_writable($upload_dir)) {
1329
- throw new E_InsufficientWriteAccessException(FALSE, $upload_dir, FALSE);
1330
- }
1331
- try {
1332
- // Try writing the image
1333
- $fp = fopen($abs_filename, 'wb');
1334
- fwrite($fp, $this->maybe_base64_decode($data));
1335
- fclose($fp);
1336
- // Ensure that we're not vulerable to CVE-2017-2416 exploit
1337
- if (($dimensions = getimagesize($abs_filename)) !== FALSE) {
1338
- if (isset($dimensions[0]) && intval($dimensions[0]) > 30000 || isset($dimensions[1]) && intval($dimensions[1]) > 30000) {
1339
- unlink($abs_filename);
1340
- throw new E_UploadException(__('Image file too large. Maximum image dimensions supported are 30k x 30k.'));
1341
- }
1342
- }
1343
- // Save the image
1344
- $image_id = $this->object->_image_mapper->save($image);
1345
- if (!$image_id) {
1346
- $exception = '';
1347
- foreach ($image->get_errors() as $field => $errors) {
1348
- foreach ($errors as $error) {
1349
- if (!empty($exception)) {
1350
- $exception .= "<br/>";
1351
- }
1352
- $exception .= __(sprintf("Error while uploading %s: %s", $filename, $error), 'nextgen-gallery');
1353
- }
1354
- }
1355
- throw new E_UploadException($exception);
1356
- }
1357
- if ($settings->imgBackup) {
1358
- $this->object->backup_image($image);
1359
- }
1360
- if ($settings->imgAutoResize) {
1361
- $this->object->generate_image_clone($abs_filename, $abs_filename, $this->object->get_image_size_params($image_id, 'full'));
1362
- }
1363
- $this->object->_image_mapper->_use_cache = FALSE;
1364
- $image = $this->object->_image_mapper->find($image_id);
1365
- $this->object->_image_mapper->_use_cache = TRUE;
1366
- // Ensure that fullsize dimensions are added to metadata array
1367
- $dimensions = getimagesize($abs_filename);
1368
- $full_meta = array('width' => $dimensions[0], 'height' => $dimensions[1], 'md5' => $this->object->get_image_checksum($image, 'full'));
1369
- if (!isset($image->meta_data) or is_string($image->meta_data) && strlen($image->meta_data) == 0 or is_bool($image->meta_data)) {
1370
- $image->meta_data = array();
1371
  }
1372
- $image->meta_data = array_merge($image->meta_data, $full_meta);
1373
- $image->meta_data['full'] = $full_meta;
1374
- // Don't forget to append the 'full' entry in meta_data in the db
1375
- $this->object->_image_mapper->save($image);
1376
- // Generate a thumbnail for the image
1377
- $this->object->generate_thumbnail($image);
1378
- // Set gallery preview image if missing
1379
- C_Gallery_Mapper::get_instance()->set_preview_image($gallery, $image_id, TRUE);
1380
- // Notify other plugins that an image has been added
1381
- do_action('ngg_added_new_image', $image);
1382
- // delete dirsize after adding new images
1383
- delete_transient('dirsize_cache');
1384
- // Seems redundant to above hook. Maintaining for legacy purposes
1385
- do_action('ngg_after_new_images_added', $gallery_id, array($image->{$image_key}));
1386
- } catch (E_UploadException $ex) {
1387
- throw $ex;
1388
- } catch (E_No_Image_Library_Exception $ex) {
1389
- throw $ex;
1390
- } catch (E_Clean_Exit $ex) {
1391
- // pass
1392
- } catch (Exception $ex) {
1393
- throw new E_InsufficientWriteAccessException(FALSE, $abs_filename, FALSE, $ex);
1394
  }
1395
- } else {
1396
- throw new E_EntityNotFoundException();
1397
  }
1398
- if (!extension_loaded('suhosin')) {
1399
- @ini_set('memory_limit', $memory_limit . 'M');
1400
  }
1401
  return $retval;
1402
  }
1403
- function maybe_base64_decode($data)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1404
  {
1405
- $decoded = base64_decode($data);
1406
- if ($decoded === FALSE) {
1407
- return $data;
1408
  } else {
1409
- if (base64_encode($decoded) == $data) {
1410
- return base64_decode($data);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1411
  }
1412
  }
1413
- return $data;
 
 
 
 
 
 
1414
  }
1415
- function import_gallery_from_fs($abspath, $gallery_id = FALSE, $create_new_gallerypath = TRUE, $gallery_title = NULL, $filenames = array())
1416
  {
1417
- $retval = FALSE;
1418
- if (@file_exists($abspath)) {
1419
- $fs = C_Fs::get_instance();
1420
- // Ensure that this folder has images
1421
- // Ensure that this folder has images
1422
- $i = 0;
1423
- $files = array();
1424
- foreach (scandir($abspath) as $file) {
1425
- if ($file == '.' || $file == '..') {
1426
- continue;
1427
- }
1428
- $file_abspath = $fs->join_paths($abspath, $file);
1429
- // The first directory is considered valid
1430
- if (is_dir($file_abspath) && $i === 0) {
1431
- $files[] = $file_abspath;
1432
- } elseif ($this->is_image_file($file_abspath)) {
1433
- if ($filenames && array_search($file_abspath, $filenames) !== FALSE) {
1434
- $files[] = $file_abspath;
1435
- } else {
1436
- if (!$filenames) {
1437
- $files[] = $file_abspath;
1438
- }
1439
- }
1440
- }
1441
- }
1442
- if (!empty($files)) {
1443
- // Get needed utilities
1444
- $gallery_mapper = C_Gallery_Mapper::get_instance();
1445
- // Sometimes users try importing a directory, which actually has all images under another directory
1446
- if (is_dir($files[0])) {
1447
- return $this->import_gallery_from_fs($files[0], $gallery_id, $create_new_gallerypath, $gallery_title, $filenames);
1448
- }
1449
- // If no gallery has been specified, then use the directory name as the gallery name
1450
- if (!$gallery_id) {
1451
- // Create the gallery
1452
- $gallery = $gallery_mapper->create(array('title' => $gallery_title ? $gallery_title : M_I18n::mb_basename($abspath)));
1453
- if (!$create_new_gallerypath) {
1454
- $gallery->path = str_ireplace(ABSPATH, '', $abspath);
1455
- }
1456
- // Save the gallery
1457
- if ($gallery->save()) {
1458
- $gallery_id = $gallery->id();
1459
- }
1460
- }
1461
- // Ensure that we have a gallery id
1462
- if ($gallery_id) {
1463
- $retval = array('gallery_id' => $gallery_id, 'image_ids' => array());
1464
- foreach ($files as $file_abspath) {
1465
- if (!preg_match("/\\.(jpg|jpeg|gif|png)\$/i", $file_abspath)) {
1466
- continue;
1467
- }
1468
- $image = null;
1469
- if ($create_new_gallerypath) {
1470
- $image = $this->object->upload_base64_image($gallery_id, file_get_contents($file_abspath), str_replace(' ', '_', M_I18n::mb_basename($file_abspath)));
1471
- } else {
1472
- // Create the database record ... TODO cleanup, some duplication here from upload_base64_image
1473
- $factory = C_Component_Factory::get_instance();
1474
- $image = $factory->create('image');
1475
- $image->alttext = sanitize_title_with_dashes(str_replace('.' . M_I18n::mb_pathinfo($file_abspath, PATHINFO_EXTENSION), '', M_I18n::mb_basename($file_abspath)));
1476
- $image->galleryid = $this->object->_get_gallery_id($gallery_id);
1477
- $image->filename = M_I18n::mb_basename($file_abspath);
1478
- $image->image_slug = nggdb::get_unique_slug(sanitize_title_with_dashes($image->alttext), 'image');
1479
- $image_key = $this->object->_image_mapper->get_primary_key_column();
1480
- $abs_filename = $file_abspath;
1481
- if ($image_id = $this->object->_image_mapper->save($image)) {
1482
- try {
1483
- if (C_NextGen_settings::get_instance()->imgBackup) {
1484
- $this->object->backup_image($image);
1485
- }
1486
- # if ($settings->imgAutoResize)
1487
- # $this->object->generate_image_clone(
1488
- # $abs_filename,
1489
- # $abs_filename,
1490
- # $this->object->get_image_size_params($image_id, 'full')
1491
- # );
1492
- // Ensure that fullsize dimensions are added to metadata array
1493
- $dimensions = getimagesize($abs_filename);
1494
- $full_meta = array('width' => $dimensions[0], 'height' => $dimensions[1]);
1495
- if (!isset($image->meta_data) || is_string($image->meta_data) && strlen($image->meta_data) === 0) {
1496
- $image->meta_data = array();
1497
- } else {
1498
- if (is_string($image->meta_data)) {
1499
- // TODO: We should probably unserialize in this circumstance
1500
- }
1501
- }
1502
- $image->meta_data = array_merge($image->meta_data, $full_meta);
1503
- $image->meta_data['full'] = $full_meta;
1504
- // Generate a thumbnail for the image
1505
- $this->object->generate_thumbnail($image);
1506
- // Set gallery preview image if missing
1507
- C_Gallery_Mapper::get_instance()->set_preview_image($gallery, $image_id, TRUE);
1508
- // Notify other plugins that an image has been added
1509
- do_action('ngg_added_new_image', $image);
1510
- // delete dirsize after adding new images
1511
- delete_transient('dirsize_cache');
1512
- // Seems redundant to above hook. Maintaining for legacy purposes
1513
- do_action('ngg_after_new_images_added', $gallery_id, array($image->{$image_key}));
1514
- } catch (Exception $ex) {
1515
- throw new E_InsufficientWriteAccessException(FALSE, $abs_filename, FALSE, $ex);
1516
- }
1517
- } else {
1518
- throw new E_InvalidEntityException();
1519
- }
1520
- }
1521
- $retval['image_ids'][] = $image->{$image->id_field};
1522
- }
1523
- // Add the gallery name to the result
1524
- $gallery = $gallery_mapper->find($gallery_id);
1525
- $retval['gallery_name'] = $gallery->title;
1526
- unset($gallery);
1527
- }
1528
- }
1529
- }
1530
- return $retval;
1531
  }
1532
- function get_image_format_list()
1533
  {
1534
- $format_list = array(IMAGETYPE_GIF => 'gif', IMAGETYPE_JPEG => 'jpg', IMAGETYPE_PNG => 'png');
1535
- return $format_list;
 
 
 
1536
  }
1537
  /**
1538
- * Returns an array of properties of a resulting clone image if and when generated
1539
- * @param string $image_path
1540
- * @param string $clone_path
1541
- * @param array $params
1542
- * @return null|array
1543
  */
1544
- function calculate_image_clone_result($image_path, $clone_path, $params)
1545
  {
1546
- $width = isset($params['width']) ? $params['width'] : NULL;
1547
- $height = isset($params['height']) ? $params['height'] : NULL;
1548
- $quality = isset($params['quality']) ? $params['quality'] : NULL;
1549
- $type = isset($params['type']) ? $params['type'] : NULL;
1550
- $crop = isset($params['crop']) ? $params['crop'] : NULL;
1551
- $watermark = isset($params['watermark']) ? $params['watermark'] : NULL;
1552
- $rotation = isset($params['rotation']) ? $params['rotation'] : NULL;
1553
- $reflection = isset($params['reflection']) ? $params['reflection'] : NULL;
1554
- $crop_frame = isset($params['crop_frame']) ? $params['crop_frame'] : NULL;
1555
- $result = NULL;
1556
- // Ensure we have a valid image
1557
- if ($image_path && @file_exists($image_path)) {
1558
- // Ensure target directory exists, but only create 1 subdirectory
1559
- $image_dir = dirname($image_path);
1560
- $clone_dir = dirname($clone_path);
1561
- $image_extension = M_I18n::mb_pathinfo($image_path, PATHINFO_EXTENSION);
1562
- $image_extension_str = null;
1563
- $clone_extension = M_I18n::mb_pathinfo($clone_path, PATHINFO_EXTENSION);
1564
- $clone_extension_str = null;
1565
- if ($image_extension != null) {
1566
- $image_extension_str = '.' . $image_extension;
1567
- }
1568
- if ($clone_extension != null) {
1569
- $clone_extension_str = '.' . $clone_extension;
1570
- }
1571
- $image_basename = M_I18n::mb_basename($image_path);
1572
- $clone_basename = M_I18n::mb_basename($clone_path);
1573
- // We use a default suffix as passing in null as the suffix will make WordPress use a default
1574
- $clone_suffix = null;
1575
- $format_list = $this->object->get_image_format_list();
1576
- $clone_format = null;
1577
- // format is determined below and based on $type otherwise left to null
1578
- // suffix is only used to reconstruct paths for image_resize function
1579
- if (strpos($clone_basename, $image_basename) === 0) {
1580
- $clone_suffix = substr($clone_basename, strlen($image_basename));
1581
- }
1582
- if ($clone_suffix != null && $clone_suffix[0] == '-') {
1583
- // WordPress adds '-' on its own
1584
- $clone_suffix = substr($clone_suffix, 1);
1585
- }
1586
- // Get original image dimensions
1587
- $dimensions = getimagesize($image_path);
1588
- if ($width == null && $height == null) {
1589
- if ($dimensions != null) {
1590
- if ($width == null) {
1591
- $width = $dimensions[0];
1592
- }
1593
- if ($height == null) {
1594
- $height = $dimensions[1];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1595
  }
1596
- } else {
1597
- // XXX Don't think there's any other option here but to fail miserably...use some hard-coded defaults maybe?
1598
- return null;
1599
  }
1600
- }
1601
- if ($dimensions != null) {
1602
- $dimensions_ratio = $dimensions[0] / $dimensions[1];
1603
- if ($width == null) {
1604
- $width = (int) round($height * $dimensions_ratio);
1605
- if ($width == $dimensions[0] - 1) {
1606
- $width = $dimensions[0];
1607
  }
1608
- } else {
1609
- if ($height == null) {
1610
- $height = (int) round($width / $dimensions_ratio);
1611
- if ($height == $dimensions[1] - 1) {
1612
- $height = $dimensions[1];
1613
- }
1614
  }
 
 
1615
  }
1616
- if ($width > $dimensions[0]) {
1617
- $width = $dimensions[0];
1618
- }
1619
- if ($height > $dimensions[1]) {
1620
- $height = $dimensions[1];
1621
- }
1622
- $image_format = $dimensions[2];
1623
- if ($type != null) {
1624
- if (is_string($type)) {
1625
- $type = strtolower($type);
1626
- // Indexes in the $format_list array correspond to IMAGETYPE_XXX values appropriately
1627
- if (($index = array_search($type, $format_list)) !== false) {
1628
- $type = $index;
1629
- if ($type != $image_format) {
1630
- // Note: this only changes the FORMAT of the image but not the extension
1631
- $clone_format = $type;
1632
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
1633
  }
 
 
 
 
1634
  }
1635
  }
1636
- }
1637
- if ($width == null || $height == null) {
1638
- // Something went wrong...
1639
- return null;
1640
- }
1641
- $result['clone_path'] = $clone_path;
1642
- $result['clone_directory'] = $clone_dir;
1643
- $result['clone_suffix'] = $clone_suffix;
1644
- $result['clone_format'] = $clone_format;
1645
- $result['base_width'] = $dimensions[0];
1646
- $result['base_height'] = $dimensions[1];
1647
- // image_resize() has limitations:
1648
- // - no easy crop frame support
1649
- // - fails if the dimensions are unchanged
1650
- // - doesn't support filename prefix, only suffix so names like thumbs_original_name.jpg for $clone_path are not supported
1651
- // also suffix cannot be null as that will make WordPress use a default suffix...we could use an object that returns empty string from __toString() but for now just fallback to ngg generator
1652
- if (FALSE) {
1653
- // disabling the WordPress method for Iteration #6
1654
- // if (($crop_frame == null || !$crop) && ($dimensions[0] != $width && $dimensions[1] != $height) && $clone_suffix != null)
1655
- $result['method'] = 'wordpress';
1656
- $new_dims = image_resize_dimensions($dimensions[0], $dimensions[1], $width, $height, $crop);
1657
- if ($new_dims) {
1658
- list($dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) = $new_dims;
1659
- $width = $dst_w;
1660
- $height = $dst_h;
1661
  } else {
1662
- $result['error'] = new WP_Error('error_getting_dimensions', __('Could not calculate resized image dimensions'));
1663
  }
1664
- } else {
1665
- $result['method'] = 'nextgen';
1666
- $original_width = $dimensions[0];
1667
- $original_height = $dimensions[1];
1668
- $aspect_ratio = $width / $height;
1669
- $orig_ratio_x = $original_width / $width;
1670
- $orig_ratio_y = $original_height / $height;
1671
- if ($crop) {
1672
- $algo = 'shrink';
1673
- // either 'adapt' or 'shrink'
1674
- if ($crop_frame != null) {
1675
- $crop_x = (int) round($crop_frame['x']);
1676
- $crop_y = (int) round($crop_frame['y']);
1677
- $crop_width = (int) round($crop_frame['width']);
1678
- $crop_height = (int) round($crop_frame['height']);
1679
- $crop_final_width = (int) round($crop_frame['final_width']);
1680
- $crop_final_height = (int) round($crop_frame['final_height']);
1681
- $crop_width_orig = $crop_width;
1682
- $crop_height_orig = $crop_height;
1683
- $crop_factor_x = $crop_width / $crop_final_width;
1684
- $crop_factor_y = $crop_height / $crop_final_height;
1685
- $crop_ratio_x = $crop_width / $width;
1686
- $crop_ratio_y = $crop_height / $height;
1687
- if ($algo == 'adapt') {
1688
- // XXX not sure about this...don't use for now
1689
- # $crop_width = (int) round($width * $crop_factor_x);
1690
- # $crop_height = (int) round($height * $crop_factor_y);
1691
- } else {
1692
- if ($algo == 'shrink') {
1693
- if ($crop_ratio_x < $crop_ratio_y) {
1694
- $crop_width = max($crop_width, $width);
1695
- $crop_height = (int) round($crop_width / $aspect_ratio);
1696
- } else {
1697
- $crop_height = max($crop_height, $height);
1698
- $crop_width = (int) round($crop_height * $aspect_ratio);
1699
- }
1700
- if ($crop_width == $crop_width_orig - 1) {
1701
- $crop_width = $crop_width_orig;
1702
- }
1703
- if ($crop_height == $crop_height_orig - 1) {
1704
- $crop_height = $crop_height_orig;
1705
- }
1706
- }
1707
- }
1708
- $crop_diff_x = (int) round(($crop_width_orig - $crop_width) / 2);
1709
- $crop_diff_y = (int) round(($crop_height_orig - $crop_height) / 2);
1710
- $crop_x += $crop_diff_x;
1711
- $crop_y += $crop_diff_y;
1712
- $crop_max_x = $crop_x + $crop_width;
1713
- $crop_max_y = $crop_y + $crop_height;
1714
- // Check if we're overflowing borders
1715
- //
1716
- if ($crop_x < 0) {
1717
- $crop_x = 0;
1718
- } else {
1719
- if ($crop_max_x > $original_width) {
1720
- $crop_x -= $crop_max_x - $original_width;
1721
- }
1722
- }
1723
- if ($crop_y < 0) {
1724
- $crop_y = 0;
1725
- } else {
1726
- if ($crop_max_y > $original_height) {
1727
- $crop_y -= $crop_max_y - $original_height;
1728
- }
1729
- }
1730
- } else {
1731
- if ($orig_ratio_x < $orig_ratio_y) {
1732
- $crop_width = $original_width;
1733
- $crop_height = (int) round($height * $orig_ratio_x);
1734
- } else {
1735
- $crop_height = $original_height;
1736
- $crop_width = (int) round($width * $orig_ratio_y);
1737
- }
1738
- if ($crop_width == $width - 1) {
1739
- $crop_width = $width;
1740
- }
1741
- if ($crop_height == $height - 1) {
1742
- $crop_height = $height;
1743
- }
1744
- $crop_x = (int) round(($original_width - $crop_width) / 2);
1745
- $crop_y = (int) round(($original_height - $crop_height) / 2);
1746
- }
1747
- $result['crop_area'] = array('x' => $crop_x, 'y' => $crop_y, 'width' => $crop_width, 'height' => $crop_height);
1748
- } else {
1749
- // Just constraint dimensions to ensure there's no stretching or deformations
1750
- list($width, $height) = wp_constrain_dimensions($original_width, $original_height, $width, $height);
1751
- }
1752
- }
1753
- $result['width'] = $width;
1754
- $result['height'] = $height;
1755
- $result['quality'] = $quality;
1756
- $real_width = $width;
1757
- $real_height = $height;
1758
- if ($rotation && in_array(abs($rotation), array(90, 270))) {
1759
- $real_width = $height;
1760
- $real_height = $width;
1761
- }
1762
- if ($reflection) {
1763
- // default for nextgen was 40%, this is used in generate_image_clone as well
1764
- $reflection_amount = 40;
1765
- // Note, round() would probably be best here but using the same code that C_NggLegacy_Thumbnail uses for compatibility
1766
- $reflection_height = intval($real_height * ($reflection_amount / 100));
1767
- $real_height = $real_height + $reflection_height;
1768
- }
1769
- $result['real_width'] = $real_width;
1770
- $result['real_height'] = $real_height;
1771
  }
1772
- return $result;
 
 
 
 
 
1773
  }
1774
  /**
1775
- * Returns an array of dimensional properties (width, height, real_width, real_height) of a resulting clone image if and when generated
1776
- * @param string $image_path
1777
- * @param string $clone_path
1778
- * @param array $params
1779
- * @return null|array
1780
  */
1781
- function calculate_image_clone_dimensions($image_path, $clone_path, $params)
1782
  {
1783
- $retval = null;
1784
- $result = $this->object->calculate_image_clone_result($image_path, $clone_path, $params);
1785
- if ($result != null) {
1786
- $retval = array('width' => $result['width'], 'height' => $result['height'], 'real_width' => $result['real_width'], 'real_height' => $result['real_height']);
1787
  }
1788
- return $retval;
1789
  }
1790
  /**
1791
- * Generates a "clone" for an existing image, the clone can be altered using the $params array
1792
- * @param string $image_path
1793
- * @param string $clone_path
1794
- * @param array $params
1795
- * @return null|object
1796
  */
1797
- function generate_image_clone($image_path, $clone_path, $params)
1798
  {
1799
- $crop = isset($params['crop']) ? $params['crop'] : NULL;
1800
- $watermark = isset($params['watermark']) ? $params['watermark'] : NULL;
1801
- $reflection = isset($params['reflection']) ? $params['reflection'] : NULL;
1802
- $rotation = isset($params['rotation']) ? $params['rotation'] : NULL;
1803
- $flip = isset($params['flip']) ? $params['flip'] : NULL;
1804
- $destpath = NULL;
1805
- $thumbnail = NULL;
1806
- $result = $this->object->calculate_image_clone_result($image_path, $clone_path, $params);
1807
- // XXX this should maybe be removed and extra settings go into $params?
1808
- $settings = apply_filters('ngg_settings_during_image_generation', C_NextGen_Settings::get_instance()->to_array());
1809
- // Ensure we have a valid image
1810
- if ($image_path && @file_exists($image_path) && $result != null && !isset($result['error'])) {
1811
- $image_dir = dirname($image_path);
1812
- $clone_path = $result['clone_path'];
1813
- $clone_dir = $result['clone_directory'];
1814
- $clone_format = $result['clone_format'];
1815
- $format_list = $this->object->get_image_format_list();
1816
- // Ensure target directory exists, but only create 1 subdirectory
1817
- if (!@file_exists($clone_dir)) {
1818
- if (strtolower(realpath($image_dir)) != strtolower(realpath($clone_dir))) {
1819
- if (strtolower(realpath($image_dir)) == strtolower(realpath(dirname($clone_dir)))) {
1820
- wp_mkdir_p($clone_dir);
1821
- }
1822
- }
1823
- }
1824
- $method = $result['method'];
1825
- $width = $result['width'];
1826
- $height = $result['height'];
1827
- $quality = $result['quality'];
1828
- if ($quality == null) {
1829
- $quality = 100;
1830
- }
1831
- if ($method == 'wordpress') {
1832
- $original = wp_get_image_editor($image_path);
1833
- $destpath = $clone_path;
1834
- if (!is_wp_error($original)) {
1835
- $original->resize($width, $height, $crop);
1836
- $original->set_quality($quality);
1837
- $original->save($clone_path);
1838
- }
1839
- } else {
1840
- if ($method == 'nextgen') {
1841
- $destpath = $clone_path;
1842
- $thumbnail = new C_NggLegacy_Thumbnail($image_path, true);
1843
- if (!$thumbnail->error) {
1844
- if ($crop) {
1845
- $crop_area = $result['crop_area'];
1846
- $crop_x = $crop_area['x'];
1847
- $crop_y = $crop_area['y'];
1848
- $crop_width = $crop_area['width'];
1849
- $crop_height = $crop_area['height'];
1850
- $thumbnail->crop($crop_x, $crop_y, $crop_width, $crop_height);
1851
- }
1852
- $thumbnail->resize($width, $height);
1853
- } else {
1854
- $thumbnail = NULL;
1855
- }
1856
- }
1857
- }
1858
- // We successfully generated the thumbnail
1859
- if (is_string($destpath) && (@file_exists($destpath) || $thumbnail != null)) {
1860
- if ($clone_format != null) {
1861
- if (isset($format_list[$clone_format])) {
1862
- $clone_format_extension = $format_list[$clone_format];
1863
- $clone_format_extension_str = null;
1864
- if ($clone_format_extension != null) {
1865
- $clone_format_extension_str = '.' . $clone_format_extension;
1866
- }
1867
- $destpath_info = M_I18n::mb_pathinfo($destpath);
1868
- $destpath_extension = $destpath_info['extension'];
1869
- if (strtolower($destpath_extension) != strtolower($clone_format_extension)) {
1870
- $destpath_dir = $destpath_info['dirname'];
1871
- $destpath_basename = $destpath_info['filename'];
1872
- $destpath_new = $destpath_dir . DIRECTORY_SEPARATOR . $destpath_basename . $clone_format_extension_str;
1873
- if (@file_exists($destpath) && rename($destpath, $destpath_new) || $thumbnail != null) {
1874
- $destpath = $destpath_new;
1875
- }
1876
- }
1877
- }
1878
- }
1879
- if (is_null($thumbnail)) {
1880
- $thumbnail = new C_NggLegacy_Thumbnail($destpath, true);
1881
- if ($thumbnail->error) {
1882
- $thumbnail = null;
1883
- return null;
1884
- }
1885
- } else {
1886
- $thumbnail->fileName = $destpath;
1887
- }
1888
- // This is quite odd, when watermark equals int(0) it seems all statements below ($watermark == 'image') and ($watermark == 'text') both evaluate as true
1889
- // so we set it at null if it evaluates to any null-like value
1890
- if ($watermark == null) {
1891
- $watermark = null;
1892
- }
1893
- if ($watermark == 1 || $watermark === true) {
1894
- if (in_array(strval($settings['wmType']), array('image', 'text'))) {
1895
- $watermark = $settings['wmType'];
1896
- } else {
1897
- $watermark = 'text';
1898
- }
1899
- }
1900
- $watermark = strval($watermark);
1901
- if ($watermark == 'image') {
1902
- $thumbnail->watermarkImgPath = $settings['wmPath'];
1903
- $thumbnail->watermarkImage($settings['wmPos'], $settings['wmXpos'], $settings['wmYpos']);
1904
- } else {
1905
- if ($watermark == 'text') {
1906
- $thumbnail->watermarkText = $settings['wmText'];
1907
- $thumbnail->watermarkCreateText($settings['wmColor'], $settings['wmFont'], $settings['wmSize'], $settings['wmOpaque']);
1908
- $thumbnail->watermarkImage($settings['wmPos'], $settings['wmXpos'], $settings['wmYpos']);
1909
- }
1910
- }
1911
- if ($rotation && in_array(abs($rotation), array(90, 180, 270))) {
1912
- $thumbnail->rotateImageAngle($rotation);
1913
- }
1914
- $flip = strtolower($flip);
1915
- if ($flip && in_array($flip, array('h', 'v', 'hv'))) {
1916
- $flip_h = in_array($flip, array('h', 'hv'));
1917
- $flip_v = in_array($flip, array('v', 'hv'));
1918
- $thumbnail->flipImage($flip_h, $flip_v);
1919
- }
1920
- if ($reflection) {
1921
- $thumbnail->createReflection(40, 40, 50, FALSE, '#a4a4a4');
1922
- }
1923
- if ($clone_format != null && isset($format_list[$clone_format])) {
1924
- // Force format
1925
- $thumbnail->format = strtoupper($format_list[$clone_format]);
1926
- }
1927
- $thumbnail = apply_filters('ngg_before_save_thumbnail', $thumbnail);
1928
- $exif_iptc = @C_Exif_Writer_Wrapper::read_metadata($image_path);
1929
- $thumbnail->save($destpath, $quality);
1930
- @C_Exif_Writer_Wrapper::write_metadata($destpath, $exif_iptc);
1931
  }
1932
  }
1933
- return $thumbnail;
1934
- }
1935
- }
1936
- /**
1937
- * Class C_GalleryStorage_Driver_Base
1938
- * @mixin Mixin_GalleryStorage_Driver_Base
1939
- * @implements I_GalleryStorage_Driver
1940
- */
1941
- class C_GalleryStorage_Driver_Base extends C_GalleryStorage_Base
1942
- {
1943
- public static $_instances = array();
1944
- function define($context = FALSE)
1945
- {
1946
- parent::define($context);
1947
- $this->add_mixin('Mixin_GalleryStorage_Driver_Base');
1948
- $this->implement('I_GalleryStorage_Driver');
1949
- }
1950
- function initialize()
1951
- {
1952
- parent::initialize();
1953
- $this->_gallery_mapper = C_Gallery_Mapper::get_instance();
1954
- $this->_image_mapper = C_Image_Mapper::get_instance();
1955
  }
1956
  /**
1957
- * @param bool|string $context
1958
- * @return C_GalleryStorage_Driver_Base
 
1959
  */
1960
- public static function get_instance($context = False)
1961
  {
1962
- if (!isset(self::$_instances[$context])) {
1963
- self::$_instances[$context] = new C_GalleryStorage_Driver_Base($context);
1964
- }
1965
- return self::$_instances[$context];
1966
  }
1967
  /**
1968
- * Gets the class name of the driver used
1969
- * @return string
 
1970
  */
1971
- function get_driver_class_name()
1972
  {
1973
- return get_called_class();
1974
  }
1975
- }
1976
- class Mixin_NextGen_Gallery_Image_Validation extends Mixin
1977
- {
1978
- function validation()
 
 
 
 
 
1979
  {
1980
- // Additional checks...
1981
- if (isset($this->object->description)) {
1982
- $this->object->description = M_NextGen_Data::strip_html($this->object->description, TRUE);
 
 
 
 
1983
  }
1984
- if (isset($this->object->alttext)) {
1985
- $this->object->alttext = M_NextGen_Data::strip_html($this->object->alttext, TRUE);
1986
  }
1987
- $this->validates_presence_of('galleryid', 'filename', 'alttext', 'exclude', 'sortorder', 'imagedate');
1988
- $this->validates_numericality_of('galleryid');
1989
- $this->validates_numericality_of($this->id());
1990
- $this->validates_numericality_of('sortorder');
1991
- $this->validates_length_of('filename', 185, '<=', __('Image filenames may not be longer than 185 characters in length', 'nextgen-gallery'));
1992
- return $this->object->is_valid();
1993
  }
1994
- }
1995
- /**
1996
- * Model for NextGen Gallery Images
1997
- * @mixin Mixin_NextGen_Gallery_Image_Validation
1998
- * @implements I_Image
1999
- */
2000
- class C_Image extends C_DataMapper_Model
2001
- {
2002
- var $_mapper_interface = 'I_Image_Mapper';
2003
- function define($properties = array(), $mapper = FALSE, $context = FALSE)
2004
  {
2005
- parent::define($mapper, $properties, $context);
2006
- $this->add_mixin('Mixin_NextGen_Gallery_Image_Validation');
2007
- $this->implement('I_Image');
2008
  }
2009
  /**
2010
- * Instantiates a new model
2011
- * @param array|stdClass $properties (optional)
2012
- * @param C_Image_Mapper|false $mapper (optional)
2013
- * @param string|false $context (optional)
2014
  */
2015
- function initialize($properties = array(), $mapper = FALSE, $context = FALSE)
2016
  {
2017
- if (!$mapper) {
2018
- $mapper = $this->get_registry()->get_utility($this->_mapper_interface);
2019
- }
2020
- parent::initialize($mapper, $properties);
2021
  }
2022
  /**
2023
- * Returns the model representing the gallery associated with this image
2024
- * @param object|false $model (optional)
2025
- * @return C_Gallery|object
2026
  */
2027
- function get_gallery($model = FALSE)
2028
  {
2029
- return C_Gallery_Mapper::get_instance()->find($this->galleryid, $model);
2030
  }
2031
  }
2032
- /**
2033
- * Class C_Image_Mapper
2034
- * @mixin Mixin_NextGen_Table_Extras
2035
- * @mixin Mixin_Gallery_Image_Mapper
2036
- * @implements I_Image_Mapper
2037
- */
2038
- class C_Image_Mapper extends C_CustomTable_DataMapper_Driver
2039
  {
2040
- public static $_instance = NULL;
2041
- /**
2042
- * Defines the gallery image mapper
2043
- * @param string|false $context (optional)
2044
- * @param mixed $not_used
2045
- */
2046
- function define($context = FALSE, $not_used = FALSE)
2047
  {
2048
- // Add 'attachment' context
2049
- if (!is_array($context)) {
2050
- $context = array($context);
 
 
 
 
 
 
 
 
 
 
 
 
2051
  }
2052
- array_push($context, 'attachment');
2053
- // Define the mapper
2054
- $this->_primary_key_column = 'pid';
2055
- parent::define('ngg_pictures', $context);
2056
- $this->add_mixin('Mixin_NextGen_Table_Extras');
2057
- $this->add_mixin('Mixin_Gallery_Image_Mapper');
2058
- $this->implement('I_Image_Mapper');
2059
- $this->set_model_factory_method('image');
2060
- // Define the columns
2061
- $this->define_column('pid', 'BIGINT', 0);
2062
- $this->define_column('image_slug', 'VARCHAR(255)');
2063
- $this->define_column('post_id', 'BIGINT', 0);
2064
- $this->define_column('galleryid', 'BIGINT', 0);
2065
- $this->define_column('filename', 'VARCHAR(255)');
2066
- $this->define_column('description', 'TEXT');
2067
- $this->define_column('alttext', 'TEXT');
2068
- $this->define_column('imagedate', 'DATETIME');
2069
- $this->define_column('exclude', 'INT', 0);
2070
- $this->define_column('sortorder', 'BIGINT', 0);
2071
- $this->define_column('meta_data', 'TEXT');
2072
- $this->define_column('extras_post_id', 'BIGINT', 0);
2073
- $this->define_column('updated_at', 'BIGINT');
2074
- // Mark the columns which should be unserialized
2075
- $this->add_serialized_column('meta_data');
2076
  }
2077
- function initialize($object_name = FALSE)
2078
  {
2079
- parent::initialize('ngg_pictures');
2080
  }
2081
  /**
2082
- * @param bool|string $context
2083
- * @return C_Image_Mapper
 
 
2084
  */
2085
- static function get_instance($context = False)
2086
  {
2087
- if (is_null(self::$_instance)) {
2088
- $klass = get_class();
2089
- self::$_instance = new $klass($context);
2090
  }
2091
- return self::$_instance;
2092
  }
2093
  }
2094
- /**
2095
- * Sets the alttext property as the post title
2096
- */
2097
- class Mixin_Gallery_Image_Mapper extends Mixin
2098
  {
2099
- function destroy($image)
2100
  {
2101
- $retval = $this->call_parent('destroy', $image);
2102
- // Delete tag associations with the image
2103
- if (!is_numeric($image)) {
2104
- $image = $image->{$image->id_field};
2105
- }
2106
- wp_delete_object_term_relationships($image, 'ngg_tag');
2107
- C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering');
2108
- return $retval;
2109
  }
2110
- function _save_entity($entity)
2111
  {
2112
- $entity->updated_at = time();
2113
- // If successfully saved then import metadata
2114
- $retval = $this->call_parent('_save_entity', $entity);
2115
- if ($retval) {
2116
- include_once NGGALLERY_ABSPATH . '/admin/functions.php';
2117
- $image_id = $this->get_id($entity);
2118
- if (!isset($entity->meta_data['saved'])) {
2119
- nggAdmin::import_MetaData($image_id);
2120
- }
2121
- C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering');
2122
- }
2123
- return $retval;
2124
  }
2125
- function reimport_metadata($image_or_id)
2126
  {
2127
- // Get the image
2128
- $image = NULL;
2129
- if (is_int($image_or_id)) {
2130
- $image = $this->object->find($image_or_id);
2131
- } else {
2132
- $image = $image_or_id;
2133
- }
2134
- // Reset all image details that would have normally been imported
2135
- if (is_array($image->meta_data)) {
2136
- unset($image->meta_data['saved']);
2137
- }
2138
- nggAdmin::import_MetaData($image);
2139
- return $this->object->save($image);
2140
  }
2141
- /**
2142
- * Retrieves the id from an image
2143
- * @param $image
2144
- * @return bool
2145
- */
2146
- function get_id($image)
2147
  {
2148
- $retval = FALSE;
2149
- // Have we been passed an entity and is the id_field set?
2150
- if ($image instanceof stdClass) {
2151
- if (isset($image->id_field)) {
2152
- $retval = $image->{$image->id_field};
2153
- }
2154
- } else {
2155
- $retval = $image->id();
2156
- }
2157
- // If we still don't have an id, then we'll lookup the primary key
2158
- // and try fetching it manually
2159
- if (!$retval) {
2160
- $key = $this->object->get_primary_key_column();
2161
- $retval = $image->{$key};
 
 
 
 
2162
  }
2163
- return $retval;
2164
- }
2165
- function get_post_title($entity)
2166
- {
2167
- return $entity->alttext;
2168
  }
2169
- function set_defaults($entity)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2170
  {
2171
- // If not set already, we'll add an exclude property. This is used
2172
- // by NextGEN Gallery itself, as well as the Attach to Post module
2173
- $this->object->_set_default_value($entity, 'exclude', 0);
2174
- // Ensure that the object has a description attribute
2175
- $this->object->_set_default_value($entity, 'description', '');
2176
- // If not set already, set a default sortorder
2177
- $this->object->_set_default_value($entity, 'sortorder', 0);
2178
- // The imagedate must be set
2179
- if (!isset($entity->imagedate) or is_null($entity->imagedate) or $entity->imagedate == '0000-00-00 00:00:00') {
2180
- $entity->imagedate = date("Y-m-d H:i:s");
2181
- }
2182
- // If a filename is set, and no alttext is set, then set the alttext
2183
- // to the basename of the filename (legacy behavior)
2184
- if (isset($entity->filename)) {
2185
- $path_parts = M_I18n::mb_pathinfo($entity->filename);
2186
- $alttext = !isset($path_parts['filename']) ? substr($path_parts['basename'], 0, strpos($path_parts['basename'], '.')) : $path_parts['filename'];
2187
- $this->object->_set_default_value($entity, 'alttext', $alttext);
2188
  }
2189
- // Set unique slug
2190
- if (isset($entity->alttext) && empty($entity->image_slug)) {
2191
- $entity->image_slug = nggdb::get_unique_slug(sanitize_title_with_dashes($entity->alttext), 'image');
 
2192
  }
2193
- // Ensure that the exclude parameter is an integer or boolean-evaluated
2194
- // value
2195
- if (is_string($entity->exclude)) {
2196
- $entity->exclude = intval($entity->exclude);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2197
  }
2198
- // Trim alttext and description
2199
- $entity->description = trim($entity->description);
2200
- $entity->alttext = trim($entity->alttext);
2201
  }
2202
  /**
2203
- * Finds all images for a gallery
2204
- * @param $gallery
2205
- * @param bool $model
2206
  *
2207
- * @return array
 
 
2208
  */
2209
- function find_all_for_gallery($gallery, $model = FALSE)
2210
  {
2211
- $retval = array();
2212
- $gallery_id = 0;
2213
- if (is_object($gallery)) {
2214
- if (isset($gallery->id_field)) {
2215
- $gallery_id = $gallery->{$gallery->id_field};
2216
- } else {
2217
- $key = $this->object->get_primary_key_column();
2218
- if (isset($gallery->{$key})) {
2219
- $gallery_id = $gallery->{$key};
2220
- }
 
 
 
 
 
2221
  }
2222
- } elseif (is_numeric($gallery)) {
2223
- $gallery_id = $gallery;
2224
  }
2225
- if ($gallery_id) {
2226
- $retval = $this->object->select()->where(array("galleryid = %s", $gallery_id))->run_query(FALSE, $model);
 
2227
  }
2228
- return $retval;
2229
  }
2230
- }
2231
- /**
2232
- * This class provides a lazy-loading wrapper to the NextGen-Legacy "nggImage" class for use in legacy style templates
2233
- */
2234
- class C_Image_Wrapper
2235
- {
2236
- public $_cache;
2237
- // cache of retrieved values
2238
- public $_settings;
2239
- // I_Settings_Manager cache
2240
- public $_storage;
2241
- // I_Gallery_Storage cache
2242
- public $_galleries;
2243
- // cache of I_Gallery_Mapper (plural)
2244
- public $_orig_image;
2245
- // original provided image
2246
- public $_orig_image_id;
2247
- // original image ID
2248
- public $_cache_overrides;
2249
- // allow for forcing variable values
2250
- public $_legacy = FALSE;
2251
- public $_displayed_gallery;
2252
- // cached object
2253
  /**
2254
- * Constructor. Converts the image class into an array and fills from defaults any missing values
 
2255
  *
2256
- * @param object $image Individual result from displayed_gallery->get_entities()
2257
- * @param object $displayed_gallery Displayed gallery -- MAY BE NULL
2258
- * @param bool $legacy Whether the image source is from NextGen Legacy or NextGen
2259
- * @return void
2260
  */
2261
- public function __construct($image, $displayed_gallery = NULL, $legacy = FALSE)
2262
  {
2263
- // for clarity
2264
- if ($displayed_gallery && isset($displayed_gallery->display_settings['number_of_columns'])) {
2265
- $columns = $displayed_gallery->display_settings['number_of_columns'];
2266
- } else {
2267
- $columns = 0;
2268
  }
2269
- // Public variables
2270
- $defaults = array(
2271
- 'errmsg' => '',
2272
- // Error message to display, if any
2273
- 'error' => FALSE,
2274
- // Error state
2275
- 'imageURL' => '',
2276
- // URL Path to the image
2277
- 'thumbURL' => '',
2278
- // URL Path to the thumbnail
2279
- 'imagePath' => '',
2280
- // Server Path to the image
2281
- 'thumbPath' => '',
2282
- // Server Path to the thumbnail
2283
- 'href' => '',
2284
- // A href link code
2285
- // Mostly constant
2286
- 'thumbPrefix' => 'thumbs_',
2287
- // FolderPrefix to the thumbnail
2288
- 'thumbFolder' => '/thumbs/',
2289
- // Foldername to the thumbnail
2290
- // Image Data
2291
- 'galleryid' => 0,
2292
- // Gallery ID
2293
- 'pid' => 0,
2294
- // Image ID
2295
- 'filename' => '',
2296
- // Image filename
2297
- 'description' => '',
2298
- // Image description
2299
- 'alttext' => '',
2300
- // Image alttext
2301
- 'imagedate' => '',
2302
- // Image date/time
2303
- 'exclude' => '',
2304
- // Image exclude
2305
- 'thumbcode' => '',
2306
- // Image effect code
2307
- // Gallery Data
2308
- 'name' => '',
2309
- // Gallery name
2310
- 'path' => '',
2311
- // Gallery path
2312
- 'title' => '',
2313
- // Gallery title
2314
- 'pageid' => 0,
2315
- // Gallery page ID
2316
- 'previewpic' => 0,
2317
- // Gallery preview pic
2318
- 'style' => $columns > 0 ? 'style="width:' . floor(100 / $columns) . '%;"' : '',
2319
- 'hidden' => FALSE,
2320
- 'permalink' => '',
2321
- 'tags' => '',
2322
- );
2323
- // convert the image to an array and apply the defaults
2324
- $this->_orig_image = $image;
2325
- $image = (array) $image;
2326
- foreach ($defaults as $key => $val) {
2327
- if (!isset($image[$key])) {
2328
- $image[$key] = $val;
 
 
 
 
 
 
 
 
 
 
 
2329
  }
 
2330
  }
2331
- // cache the results
2332
- ksort($image);
2333
- $id_field = !empty($image['id_field']) ? $image['id_field'] : 'pid';
2334
- $this->_cache = (array) apply_filters('ngg_image_object', (object) $image, $image[$id_field]);
2335
- $this->_orig_image_id = $image[$id_field];
2336
- $this->_legacy = $legacy;
2337
- $this->_displayed_gallery = $displayed_gallery;
 
 
 
2338
  }
2339
- public function __set($name, $value)
 
2340
  {
2341
- $this->_cache[$name] = $value;
 
 
 
 
2342
  }
2343
- public function __isset($name)
 
2344
  {
2345
- return isset($this->_cache[$name]);
 
 
 
 
 
 
2346
  }
2347
- public function __unset($name)
 
 
 
 
 
 
2348
  {
2349
- unset($this->_cache[$name]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2350
  }
2351
  /**
2352
- * Lazy-loader for image variables.
 
 
2353
  *
2354
- * @param string $name Parameter name
2355
- * @return mixed
2356
  */
2357
- public function __get($name)
2358
  {
2359
- if (isset($this->_cache_overrides[$name])) {
2360
- return $this->_cache_overrides[$name];
 
 
 
 
 
 
 
 
 
 
2361
  }
2362
- // at the bottom we default to returning $this->_cache[$name].
2363
- switch ($name) {
2364
- case 'alttext':
2365
- $this->_cache['alttext'] = empty($this->_cache['alttext']) ? ' ' : html_entity_decode(stripslashes($this->_cache['alttext']));
2366
- return $this->_cache['alttext'];
2367
- case 'author':
2368
- $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
2369
- $this->_cache['author'] = $gallery->name;
2370
- return $this->_cache['author'];
2371
- case 'caption':
2372
- $caption = html_entity_decode(stripslashes($this->__get('description')));
2373
- if (empty($caption)) {
2374
- $caption = '&nbsp;';
2375
- }
2376
- $this->_cache['caption'] = $caption;
2377
- return $this->_cache['caption'];
2378
- case 'description':
2379
- $this->_cache['description'] = empty($this->_cache['description']) ? ' ' : html_entity_decode(stripslashes($this->_cache['description']));
2380
- return $this->_cache['description'];
2381
- case 'galdesc':
2382
- $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
2383
- $this->_cache['galdesc'] = $gallery->name;
2384
- return $this->_cache['galdesc'];
2385
- case 'gid':
2386
- $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
2387
- $this->_cache['gid'] = $gallery->{$gallery->id_field};
2388
- return $this->_cache['gid'];
2389
- case 'href':
2390
- return $this->__get('imageHTML');
2391
- case 'id':
2392
- return $this->_orig_image_id;
2393
- case 'imageHTML':
2394
- $tmp = '<a href="' . $this->__get('imageURL') . '" title="' . htmlspecialchars(stripslashes($this->__get('description'))) . '" ' . $this->get_thumbcode($this->__get('name')) . '>' . '<img alt="' . $this->__get('alttext') . '" src="' . $this->__get('imageURL') . '"/>' . '</a>';
2395
- $this->_cache['href'] = $tmp;
2396
- $this->_cache['imageHTML'] = $tmp;
2397
- return $this->_cache['imageHTML'];
2398
- case 'imagePath':
2399
- $storage = $this->get_storage();
2400
- $this->_cache['imagePath'] = $storage->get_image_abspath($this->_orig_image, 'full');
2401
- return $this->_cache['imagePath'];
2402
- case 'imageURL':
2403
- $storage = $this->get_storage();
2404
- $this->_cache['imageURL'] = $storage->get_image_url($this->_orig_image, 'full');
2405
- return $this->_cache['imageURL'];
2406
- case 'linktitle':
2407
- $this->_cache['linktitle'] = htmlspecialchars(stripslashes($this->__get('description')));
2408
- return $this->_cache['linktitle'];
2409
- case 'name':
2410
- $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
2411
- $this->_cache['name'] = $gallery->name;
2412
- return $this->_cache['name'];
2413
- case 'pageid':
2414
- $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
2415
- $this->_cache['pageid'] = $gallery->name;
2416
- return $this->_cache['pageid'];
2417
- case 'path':
2418
- $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
2419
- $this->_cache['path'] = $gallery->name;
2420
- return $this->_cache['path'];
2421
- case 'permalink':
2422
- $this->_cache['permalink'] = $this->__get('imageURL');
2423
- return $this->_cache['permalink'];
2424
- case 'pid':
2425
- return $this->_orig_image_id;
2426
- case 'id_field':
2427
- $this->_cache['id_field'] = !empty($this->_orig_image->id_field) ? $this->_orig_image->id_field : 'pid';
2428
- return $this->_cache['id_field'];
2429
- case 'pidlink':
2430
- $application = C_Router::get_instance()->get_routed_app();
2431
- $controller = C_Display_Type_Controller::get_instance();
2432
- $this->_cache['pidlink'] = $controller->set_param_for($application->get_routed_url(TRUE), 'pid', $this->__get('image_slug'));
2433
- return $this->_cache['pidlink'];
2434
- case 'previewpic':
2435
- $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
2436
- $this->_cache['previewpic'] = $gallery->name;
2437
- return $this->_cache['previewpic'];
2438
- case 'size':
2439
- $w = 0;
2440
- $h = 0;
2441
- if ($this->_displayed_gallery && isset($this->_displayed_gallery->display_settings)) {
2442
- $ds = $this->_displayed_gallery->display_settings;
2443
- if (isset($ds['override_thumbnail_settings']) && $ds['override_thumbnail_settings']) {
2444
- $w = $ds['thumbnail_width'];
2445
- $h = $ds['thumbnail_height'];
2446
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2447
  }
2448
- if (!$w || !$h) {
2449
- if (is_string($this->_orig_image->meta_data)) {
2450
- $this->_orig_image = C_NextGen_Serializable::unserialize($this->_orig_image->meta_data);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2451
  }
2452
- if (!isset($this->_orig_image->meta_data['thumbnail'])) {
2453
- $storage = $this->get_storage();
2454
- $storage->generate_thumbnail($this->_orig_image);
 
 
 
2455
  }
2456
- $w = $this->_orig_image->meta_data['thumbnail']['width'];
2457
- $h = $this->_orig_image->meta_data['thumbnail']['height'];
2458
- }
2459
- return "width='{$w}' height='{$h}'";
2460
- case 'slug':
2461
- $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
2462
- $this->_cache['slug'] = $gallery->name;
2463
- return $this->_cache['slug'];
2464
- case 'tags':
2465
- $this->_cache['tags'] = wp_get_object_terms($this->__get('id'), 'ngg_tag', 'fields=all');
2466
- return $this->_cache['tags'];
2467
- case 'thumbHTML':
2468
- $tmp = '<a href="' . $this->__get('imageURL') . '" title="' . htmlspecialchars(stripslashes($this->__get('description'))) . '" ' . $this->get_thumbcode($this->__get('name')) . '>' . '<img alt="' . $this->__get('alttext') . '" src="' . $this->thumbURL . '"/>' . '</a>';
2469
- $this->_cache['href'] = $tmp;
2470
- $this->_cache['thumbHTML'] = $tmp;
2471
- return $this->_cache['thumbHTML'];
2472
- case 'thumbPath':
2473
- $storage = $this->get_storage();
2474
- $this->_cache['thumbPath'] = $storage->get_image_abspath($this->_orig_image, 'thumbnail');
2475
- return $this->_cache['thumbPath'];
2476
- case 'thumbnailURL':
2477
- $storage = $this->get_storage();
2478
- $thumbnail_size_name = 'thumbnail';
2479
- if ($this->_displayed_gallery && isset($this->_displayed_gallery->display_settings)) {
2480
- $ds = $this->_displayed_gallery->display_settings;
2481
- if (isset($ds['override_thumbnail_settings']) && $ds['override_thumbnail_settings']) {
2482
- $dynthumbs = C_Component_Registry::get_instance()->get_utility('I_Dynamic_Thumbnails_Manager');
2483
- $dyn_params = array('width' => $ds['thumbnail_width'], 'height' => $ds['thumbnail_height']);
2484
- if ($ds['thumbnail_quality']) {
2485
- $dyn_params['quality'] = $ds['thumbnail_quality'];
2486
- }
2487
- if ($ds['thumbnail_crop']) {
2488
- $dyn_params['crop'] = TRUE;
2489
- }
2490
- if ($ds['thumbnail_watermark']) {
2491
- $dyn_params['watermark'] = TRUE;
2492
- }
2493
- $thumbnail_size_name = $dynthumbs->get_size_name($dyn_params);
2494
  }
 
 
 
 
 
2495
  }
2496
- $this->_cache['thumbnailURL'] = $storage->get_image_url($this->_orig_image, $thumbnail_size_name);
2497
- return $this->_cache['thumbnailURL'];
2498
- case 'thumbcode':
2499
- if ($this->_displayed_gallery && isset($this->_displayed_gallery->display_settings) && isset($this->_displayed_gallery->display_settings['use_imagebrowser_effect']) && $this->_displayed_gallery->display_settings['use_imagebrowser_effect'] && !empty($this->_orig_image->thumbcode)) {
2500
- $this->_cache['thumbcode'] = $this->_orig_image->thumbcode;
2501
- } else {
2502
- $this->_cache['thumbcode'] = $this->get_thumbcode($this->__get('name'));
2503
- }
2504
- return $this->_cache['thumbcode'];
2505
- case 'thumbURL':
2506
- return $this->__get('thumbnailURL');
2507
- case 'title':
2508
- $this->_cache['title'] = stripslashes($this->__get('name'));
2509
- return $this->_cache['title'];
2510
- case 'url':
2511
- $storage = $this->get_storage();
2512
- $this->_cache['url'] = $storage->get_image_url($this->_orig_image, 'full');
2513
- return $this->_cache['url'];
2514
- default:
2515
- return $this->_cache[$name];
2516
  }
2517
- }
2518
- // called on initial nggLegacy image at construction. not sure what to do with it now.
2519
- function construct_ngg_Image($gallery)
2520
- {
2521
- do_action_ref_array('ngg_get_image', array(&$this));
2522
- unset($this->tags);
2523
- }
2524
- /**
2525
- * Retrieves and caches an I_Settings_Manager instance
2526
- *
2527
- * @return mixed
2528
- */
2529
- function get_settings()
2530
- {
2531
- if (is_null($this->_settings)) {
2532
- $this->_settings = C_NextGen_Settings::get_instance();
2533
  }
2534
- return $this->_settings;
2535
  }
2536
  /**
2537
- * Retrieves and caches an I_Gallery_Storage instance
 
2538
  *
2539
- * @return mixed
2540
  */
2541
- function get_storage()
2542
  {
2543
- if (is_null($this->_storage)) {
2544
- $this->_storage = C_Gallery_Storage::get_instance();
 
 
 
 
 
 
 
 
 
 
 
2545
  }
2546
- return $this->_storage;
 
 
2547
  }
2548
- /**
2549
- * Retrieves I_Gallery_Mapper instance.
2550
- *
2551
- * @param int $gallery_id Gallery ID
2552
- * @return mixed
2553
- */
2554
- function get_gallery($gallery_id)
2555
  {
2556
- if (isset($this->container) && method_exists($this->container, 'get_gallery')) {
2557
- return $this->container->get_gallery($gallery_id);
 
 
 
 
 
 
 
 
 
 
 
 
 
2558
  }
2559
- return C_Gallery_Mapper::get_instance()->find($gallery_id);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2560
  }
2561
- /**
2562
- * Retrieves I_Gallery_Mapper instance.
2563
- *
2564
- * @param int $gallery_id Gallery ID
2565
- * @return mixed
2566
- */
2567
- function get_legacy_gallery($gallery_id)
2568
  {
2569
- return C_Gallery_Mapper::get_instance()->find($gallery_id);
2570
  }
2571
  /**
2572
- * Get the thumbnail code (to add effects on thumbnail click)
2573
  *
2574
- * Applies the filter 'ngg_get_thumbcode'
2575
- * @param string $gallery_name (optional) Default = ''
2576
- * @return string
2577
  */
2578
- function get_thumbcode($gallery_name = '')
2579
  {
2580
- if (empty($this->_displayed_gallery)) {
2581
- $effect_code = C_NextGen_Settings::get_instance()->thumbCode;
2582
- $effect_code = str_replace('%GALLERY_ID%', $gallery_name, $effect_code);
2583
- $effect_code = str_replace('%GALLERY_NAME%', $gallery_name, $effect_code);
2584
- $retval = $effect_code;
2585
- } else {
2586
- $controller = C_Display_Type_Controller::get_instance();
2587
- $retval = $controller->get_effect_code($this->_displayed_gallery);
2588
- // This setting requires that we disable the effect code
2589
- $ds = $this->_displayed_gallery->display_settings;
2590
- if (isset($ds['use_imagebrowser_effect']) && $ds['use_imagebrowser_effect']) {
2591
- $retval = '';
2592
- }
2593
- }
2594
- $retval = apply_filters('ngg_get_thumbcode', $retval, $this);
2595
- // ensure some additional data- fields are added; provides Pro-Lightbox compatibility
2596
- $retval .= ' data-image-id="' . $this->__get('id') . '"';
2597
- $retval .= ' data-src="' . $this->__get('imageURL') . '"';
2598
- $retval .= ' data-thumbnail="' . $this->__get('thumbnailURL') . '"';
2599
- $retval .= ' data-title="' . esc_attr($this->__get('alttext')) . '"';
2600
- $retval .= ' data-description="' . esc_attr($this->__get('description')) . '"';
2601
- $this->_cache['thumbcode'] = $retval;
2602
- return $retval;
2603
  }
2604
  /**
2605
- * For compatibility support
2606
  *
2607
- * @return mixed
2608
  */
2609
- function get_href_link()
2610
  {
2611
- return $this->__get('imageHTML');
2612
  }
2613
  /**
2614
- * For compatibility support
2615
  *
2616
- * @return mixed
2617
  */
2618
- function get_href_thumb_link()
2619
  {
2620
- return $this->__get('thumbHTML');
2621
  }
2622
  /**
2623
- * Function exists for legacy support but has been gutted to not do anything
2624
  *
2625
- * @param string|int $width (optional) Default = ''
2626
- * @param string|int $height (optional) Default = ''
2627
- * @param string $mode could be watermark | web20 | crop
2628
- * @return bool|string The url for the image or false if failed
2629
  */
2630
- function cached_singlepic_file($width = '', $height = '', $mode = '')
2631
  {
2632
- $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance();
2633
- $storage = $this->get_storage();
2634
- // determine what to do with 'mode'
2635
- $display_reflection = FALSE;
2636
- $display_watermark = FALSE;
2637
- if (!is_array($mode)) {
2638
- $mode = explode(',', $mode);
2639
- }
2640
- if (in_array('web20', $mode)) {
2641
- $display_reflection = TRUE;
2642
- }
2643
- if (in_array('watermark', $mode)) {
2644
- $display_watermark = TRUE;
2645
  }
2646
- // and go for it
2647
- $params = array('width' => $width, 'height' => $height, 'watermark' => $display_watermark, 'reflection' => $display_reflection);
2648
- return $storage->get_image_url((object) $this->_cache, $dynthumbs->get_size_name($params));
2649
  }
2650
  /**
2651
- * Get the tags associated to this image
 
 
 
 
2652
  */
2653
- function get_tags()
2654
  {
2655
- return $this->__get('tags');
 
 
 
 
 
2656
  }
2657
  /**
2658
- * Get the permalink to the image
2659
  *
2660
- * TODO: Get a permalink to a page presenting the image
 
 
2661
  */
2662
- function get_permalink()
2663
  {
2664
- return $this->__get('permalink');
 
 
 
 
 
2665
  }
2666
  /**
2667
- * Returns the _cache array; used by nggImage
2668
- * @return array
 
 
2669
  */
2670
- function _get_image()
2671
  {
2672
- return $this->_cache;
 
 
 
 
 
 
 
 
 
 
2673
  }
2674
- }
2675
- class C_Image_Wrapper_Collection implements ArrayAccess
2676
- {
2677
- public $container = array();
2678
- public $galleries = array();
2679
- public function offsetExists($offset)
 
2680
  {
2681
- return isset($this->container[$offset]);
 
 
2682
  }
2683
- public function offsetGet($offset)
 
 
 
 
2684
  {
2685
- return isset($this->container[$offset]) ? $this->container[$offset] : null;
 
 
 
 
 
 
 
 
2686
  }
2687
- public function offsetSet($offset, $value)
 
 
 
 
 
 
 
2688
  {
2689
- if (is_object($value)) {
2690
- $value->container = $this;
2691
  }
2692
- if (is_null($offset)) {
2693
- $this->container[] = $value;
 
 
2694
  } else {
2695
- $this->container[$offset] = $value;
2696
  }
2697
- }
2698
- public function offsetUnset($offset)
2699
- {
2700
- unset($this->container[$offset]);
 
 
2701
  }
2702
  /**
2703
- * Retrieves and caches an I_Gallery_Mapper instance for this gallery id
2704
  *
2705
- * @param int $gallery_id Gallery ID
2706
- * @return mixed
 
2707
  */
2708
- public function get_gallery($gallery_id)
2709
  {
2710
- if (!isset($this->galleries[$gallery_id]) || is_null($this->galleries[$gallery_id])) {
2711
- $this->galleries[$gallery_id] = C_Gallery_Mapper::get_instance();
2712
  }
2713
- return $this->galleries[$gallery_id];
2714
- }
2715
- }
2716
- class C_NextGen_Data_Installer extends C_NggLegacy_Installer
2717
- {
2718
- function get_registry()
2719
- {
2720
- return C_Component_Registry::get_instance();
2721
- }
2722
- function install()
2723
- {
2724
- $this->remove_table_extra_options();
2725
- }
2726
- function remove_table_extra_options()
2727
- {
2728
- global $wpdb;
2729
- $likes = array("option_name LIKE '%ngg_gallery%'", "option_name LIKE '%ngg_pictures%'", "option_name LIKE '%ngg_album%'");
2730
- $sql = "DELETE FROM {$wpdb->options} WHERE " . implode(" OR ", $likes);
2731
- $wpdb->query($sql);
2732
  }
2733
- function uninstall($hard = FALSE)
 
 
 
 
 
2734
  {
2735
- if ($hard) {
2736
- /* Yes: this is commented twice.
2737
- // TODO for now never delete galleries/albums/content
2738
- # $mappers = array(
2739
- # $this->get_registry()->get_utility('I_Album_Mapper'),
2740
- # $this->get_registry()->get_utility('I_Gallery_Mapper'),
2741
- # $this->get_registry()->get_utility('I_Image_Mapper'),
2742
- # );
2743
-
2744
- # foreach ($mappers as $mapper) {
2745
- # $mapper->delete()->run_query();
2746
- # }
2747
-
2748
- # // Remove ngg tags
2749
- # global $wpdb;
2750
- # $wpdb->query("DELETE FROM {$wpdb->terms} WHERE term_id IN (SELECT term_id FROM {$wpdb->term_taxonomy} WHERE taxonomy='ngg_tag')");
2751
- # $wpdb->query("DELETE FROM {$wpdb->term_taxonomy} WHERE taxonomy='ngg_tag'");
2752
- */
2753
  }
 
 
 
 
 
2754
  }
2755
- }
2756
- class C_NextGen_Metadata extends C_Component
2757
- {
2758
- // Image data
2759
- public $image = '';
2760
- // The image object
2761
- public $file_path = '';
2762
- // Path to the image file
2763
- public $size = FALSE;
2764
- // The image size
2765
- public $exif_data = FALSE;
2766
- // EXIF data array
2767
- public $iptc_data = FALSE;
2768
- // IPTC data array
2769
- public $xmp_data = FALSE;
2770
- // XMP data array
2771
- // Filtered Data
2772
- public $exif_array = FALSE;
2773
- // EXIF data array
2774
- public $iptc_array = FALSE;
2775
- // IPTC data array
2776
- public $xmp_array = FALSE;
2777
- // XMP data array
2778
- public $sanitize = FALSE;
2779
- // sanitize meta data on request
2780
  /**
2781
- * Class constructor
2782
- *
2783
- * @param int $image Image ID
2784
- * @param bool $onlyEXIF TRUE = will parse only EXIF data
2785
- * @return bool FALSE if the file does not exist or metadat could not be read
2786
  */
2787
- public function __construct($image, $onlyEXIF = FALSE)
2788
  {
2789
- if (is_numeric($image)) {
2790
- $image = C_Image_Mapper::get_instance()->find($image);
2791
  }
2792
- $this->image = apply_filters('ngg_find_image_meta', $image);
2793
- $this->file_path = C_Gallery_Storage::get_instance()->get_image_abspath($this->image);
2794
- if (!@file_exists($this->file_path)) {
2795
- return FALSE;
2796
  }
2797
- $this->size = @getimagesize($this->file_path, $metadata);
2798
- if ($this->size && is_array($metadata)) {
2799
- // get exif - data
2800
- if (is_callable('exif_read_data')) {
2801
- $this->exif_data = @exif_read_data($this->file_path, NULL, TRUE);
2802
- }
2803
- // stop here if we didn't need other meta data
2804
- if ($onlyEXIF) {
2805
- return TRUE;
2806
- }
2807
- // get the iptc data - should be in APP13
2808
- if (is_callable('iptcparse') && isset($metadata['APP13'])) {
2809
- $this->iptc_data = @iptcparse($metadata['APP13']);
2810
- }
2811
- // get the xmp data in a XML format
2812
- if (is_callable('xml_parser_create')) {
2813
- $this->xmp_data = $this->extract_XMP($this->file_path);
2814
- }
2815
- return TRUE;
2816
  }
2817
- return FALSE;
 
 
 
 
 
 
 
 
 
2818
  }
2819
  /**
2820
- * return the saved meta data from the database
2821
  *
2822
- * @since 1.4.0
2823
- * @param string $object (optional)
2824
- * @return array|mixed return either the complete array or the single object
 
2825
  */
2826
- function get_saved_meta($object = false)
2827
  {
2828
- $meta = $this->image->meta_data;
2829
- // Check if we already import the meta data to the database
2830
- if (!is_array($meta) || !isset($meta['saved']) || $meta['saved'] !== TRUE) {
2831
- return false;
2832
  }
2833
- // return one element if requested
2834
- if ($object) {
2835
- return $meta[$object];
2836
  }
2837
- //removed saved parameter we don't need that to show
2838
- unset($meta['saved']);
2839
- // and remove empty tags or arrays
2840
- foreach ($meta as $key => $value) {
2841
- if (empty($value) or is_array($value)) {
2842
- unset($meta[$key]);
2843
- }
2844
  }
2845
- // on request sanitize the output
2846
- if ($this->sanitize == true) {
2847
- array_walk($meta, 'esc_html');
2848
  }
2849
- return $meta;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2850
  }
2851
  /**
2852
- * nggMeta::get_EXIF()
2853
- * See also http://trac.wordpress.org/changeset/6313
2854
  *
2855
- * @return bool|array
 
2856
  */
2857
- function get_EXIF($object = false)
2858
  {
2859
- if (!$this->exif_data) {
2860
- return false;
2861
- }
2862
- if (!is_array($this->exif_array)) {
2863
- $meta = array();
2864
- if (isset($this->exif_data['EXIF'])) {
2865
- $exif = $this->exif_data['EXIF'];
2866
- if (!empty($exif['FNumber'])) {
2867
- $meta['aperture'] = 'F ' . round($this->exif_frac2dec($exif['FNumber']), 2);
2868
- }
2869
- if (!empty($exif['Model'])) {
2870
- $meta['camera'] = trim($exif['Model']);
2871
- }
2872
- if (!empty($exif['DateTimeDigitized'])) {
2873
- $meta['created_timestamp'] = $this->exif_date2ts($exif['DateTimeDigitized']);
2874
  } else {
2875
- if (!empty($exif['DateTimeOriginal'])) {
2876
- $meta['created_timestamp'] = $this->exif_date2ts($exif['DateTimeOriginal']);
2877
- } else {
2878
- if (!empty($exif['FileDateTime'])) {
2879
- $meta['created_timestamp'] = $this->exif_date2ts($exif['FileDateTime']);
2880
- }
2881
- }
2882
- }
2883
- if (!empty($exif['FocalLength'])) {
2884
- $meta['focal_length'] = $this->exif_frac2dec($exif['FocalLength']) . __(' mm', 'nggallery');
2885
- }
2886
- if (!empty($exif['ISOSpeedRatings'])) {
2887
- $meta['iso'] = $exif['ISOSpeedRatings'];
2888
- }
2889
- if (!empty($exif['ExposureTime'])) {
2890
- $meta['shutter_speed'] = $this->exif_frac2dec($exif['ExposureTime']);
2891
- $meta['shutter_speed'] = ($meta['shutter_speed'] > 0.0 and $meta['shutter_speed'] < 1.0) ? '1/' . round(1 / $meta['shutter_speed'], -1) : $meta['shutter_speed'];
2892
- $meta['shutter_speed'] .= __(' sec', 'nggallery');
2893
- }
2894
- //Bit 0 indicates the flash firing status
2895
- if (!empty($exif['Flash'])) {
2896
- $meta['flash'] = $exif['Flash'] & 1 ? __('Fired', 'nggallery') : __('Not fired', ' nggallery');
2897
- }
2898
- }
2899
- // additional information
2900
- if (isset($this->exif_data['IFD0'])) {
2901
- $exif = $this->exif_data['IFD0'];
2902
- if (!empty($exif['Model'])) {
2903
- $meta['camera'] = $exif['Model'];
2904
- }
2905
- if (!empty($exif['Make'])) {
2906
- $meta['make'] = $exif['Make'];
2907
- }
2908
- if (!empty($exif['ImageDescription'])) {
2909
- $meta['title'] = $this->utf8_encode($exif['ImageDescription']);
2910
- }
2911
- if (!empty($exif['Orientation'])) {
2912
- $meta['Orientation'] = $exif['Orientation'];
2913
- }
2914
- }
2915
- // this is done by Windows
2916
- if (isset($this->exif_data['WINXP'])) {
2917
- $exif = $this->exif_data['WINXP'];
2918
- if (!empty($exif['Title']) && empty($meta['title'])) {
2919
- $meta['title'] = $this->utf8_encode($exif['Title']);
2920
- }
2921
- if (!empty($exif['Author'])) {
2922
- $meta['author'] = $this->utf8_encode($exif['Author']);
2923
- }
2924
- if (!empty($exif['Keywords'])) {
2925
- $meta['keywords'] = $this->utf8_encode($exif['Keywords']);
2926
- }
2927
- if (!empty($exif['Subject'])) {
2928
- $meta['subject'] = $this->utf8_encode($exif['Subject']);
2929
  }
2930
- if (!empty($exif['Comments'])) {
2931
- $meta['caption'] = $this->utf8_encode($exif['Comments']);
 
 
 
 
 
2932
  }
2933
- }
2934
- $this->exif_array = $meta;
2935
- }
2936
- // return one element if requested
2937
- if ($object == true) {
2938
- $value = isset($this->exif_array[$object]) ? $this->exif_array[$object] : false;
2939
- return $value;
2940
- }
2941
- // on request sanitize the output
2942
- if ($this->sanitize == true) {
2943
- array_walk($this->exif_array, 'esc_html');
2944
  }
2945
- return $this->exif_array;
2946
  }
2947
- // convert a fraction string to a decimal
2948
- function exif_frac2dec($str)
 
 
 
 
 
 
2949
  {
2950
- @(list($n, $d) = explode('/', $str));
2951
- if (!empty($d)) {
2952
- return $n / $d;
 
2953
  }
2954
- return $str;
2955
- }
2956
- // convert the exif date format to a unix timestamp
2957
- function exif_date2ts($str)
2958
- {
2959
- $retval = is_numeric($str) ? $str : @strtotime($str);
2960
- if (!$retval && $str) {
2961
- @(list($date, $time) = explode(' ', trim($str)));
2962
- @(list($y, $m, $d) = explode(':', $date));
2963
- $retval = strtotime("{$y}-{$m}-{$d} {$time}");
2964
  }
2965
- return $retval;
2966
  }
2967
  /**
2968
- * nggMeta::readIPTC() - IPTC Data Information for EXIF Display
2969
  *
2970
- * @param object $object (optional)
2971
- * @return null|bool|array
 
 
 
2972
  */
2973
- function get_IPTC($object = false)
2974
  {
2975
- if (!$this->iptc_data) {
2976
- return false;
2977
- }
2978
- if (!is_array($this->iptc_array)) {
2979
- // --------- Set up Array Functions --------- //
2980
- $iptcTags = array("2#005" => 'title', "2#007" => 'status', "2#012" => 'subject', "2#015" => 'category', "2#025" => 'keywords', "2#055" => 'created_date', "2#060" => 'created_time', "2#080" => 'author', "2#085" => 'position', "2#090" => 'city', "2#092" => 'location', "2#095" => 'state', "2#100" => 'country_code', "2#101" => 'country', "2#105" => 'headline', "2#110" => 'credit', "2#115" => 'source', "2#116" => 'copyright', "2#118" => 'contact', "2#120" => 'caption');
2981
- $meta = array();
2982
- foreach ($iptcTags as $key => $value) {
2983
- if (isset($this->iptc_data[$key])) {
2984
- $meta[$value] = trim($this->utf8_encode(implode(", ", $this->iptc_data[$key])));
2985
- }
2986
- }
2987
- $this->iptc_array = $meta;
2988
- }
2989
- // return one element if requested
2990
- if ($object) {
2991
- return isset($this->iptc_array[$object]) ? $this->iptc_array[$object] : NULL;
2992
  }
2993
- // on request sanitize the output
2994
- if ($this->sanitize == true) {
2995
- array_walk($this->iptc_array, 'esc_html');
 
 
 
 
 
 
 
 
2996
  }
2997
- return $this->iptc_array;
 
 
 
2998
  }
2999
  /**
3000
- * nggMeta::extract_XMP()
3001
- * get XMP DATA
3002
- * code by Pekka Saarinen http://photography-on-the.net
3003
  *
3004
- * @param mixed $filename
3005
- * @return bool|string
 
3006
  */
3007
- function extract_XMP($filename)
3008
  {
3009
- //TODO:Require a lot of memory, could be better
3010
- ob_start();
3011
- @readfile($filename);
3012
- $source = ob_get_contents();
3013
- ob_end_clean();
3014
- $start = strpos($source, "<x:xmpmeta");
3015
- $end = strpos($source, "</x:xmpmeta>");
3016
- if (!$start === false && !$end === false) {
3017
- $lenght = $end - $start;
3018
- $xmp_data = substr($source, $start, $lenght + 12);
3019
- unset($source);
3020
- return $xmp_data;
3021
- }
3022
- unset($source);
3023
- return false;
3024
  }
3025
  /**
3026
- * nggMeta::get_XMP()
3027
  *
3028
- * @package Taken from http://php.net/manual/en/function.xml-parse-into-struct.php
3029
- * @author Alf Marius Foss Olsen & Alex Rabe
3030
- * @return bool|array
 
 
 
 
 
 
 
3031
  *
 
 
3032
  */
3033
- function get_XMP($object = false)
3034
  {
3035
- if (!$this->xmp_data) {
3036
- return false;
 
 
 
 
 
 
3037
  }
3038
- if (!is_array($this->xmp_array)) {
3039
- $parser = xml_parser_create();
3040
- xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
3041
- // Dont mess with my cAsE sEtTings
3042
- xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
3043
- // Dont bother with empty info
3044
- xml_parse_into_struct($parser, $this->xmp_data, $values);
3045
- xml_parser_free($parser);
3046
- $xmlarray = array();
3047
- // The XML array
3048
- $this->xmp_array = array();
3049
- // The returned array
3050
- $stack = array();
3051
- // tmp array used for stacking
3052
- $list_array = array();
3053
- // tmp array for list elements
3054
- $list_element = false;
3055
- // rdf:li indicator
3056
- foreach ($values as $val) {
3057
- if ($val['type'] == "open") {
3058
- array_push($stack, $val['tag']);
3059
- } elseif ($val['type'] == "close") {
3060
- // reset the compared stack
3061
- if ($list_element == false) {
3062
- array_pop($stack);
3063
- }
3064
- // reset the rdf:li indicator & array
3065
- $list_element = false;
3066
- $list_array = array();
3067
- } elseif ($val['type'] == "complete") {
3068
- if ($val['tag'] == "rdf:li") {
3069
- // first go one element back
3070
- if ($list_element == false) {
3071
- array_pop($stack);
3072
- }
3073
- $list_element = true;
3074
- // do not parse empty tags
3075
- if (empty($val['value'])) {
3076
- continue;
3077
- }
3078
- // save it in our temp array
3079
- $list_array[] = $val['value'];
3080
- // in the case it's a list element we seralize it
3081
- $value = implode(",", $list_array);
3082
- $this->setArrayValue($xmlarray, $stack, $value);
3083
- } else {
3084
- array_push($stack, $val['tag']);
3085
- // do not parse empty tags
3086
- if (!empty($val['value'])) {
3087
- $this->setArrayValue($xmlarray, $stack, $val['value']);
3088
  }
3089
- array_pop($stack);
3090
  }
3091
  }
3092
- }
3093
- // foreach
3094
- // don't parse a empty array
3095
- if (empty($xmlarray) || empty($xmlarray['x:xmpmeta'])) {
3096
- return false;
3097
- }
3098
- // cut off the useless tags
3099
- $xmlarray = $xmlarray['x:xmpmeta']['rdf:RDF']['rdf:Description'];
3100
- // --------- Some values from the XMP format--------- //
3101
- $xmpTags = array('xap:CreateDate' => 'created_timestamp', 'xap:ModifyDate' => 'last_modfied', 'xap:CreatorTool' => 'tool', 'dc:format' => 'format', 'dc:title' => 'title', 'dc:creator' => 'author', 'dc:subject' => 'keywords', 'dc:description' => 'caption', 'photoshop:AuthorsPosition' => 'position', 'photoshop:City' => 'city', 'photoshop:Country' => 'country');
3102
- foreach ($xmpTags as $key => $value) {
3103
- // if the kex exist
3104
- if (isset($xmlarray[$key])) {
3105
- switch ($key) {
3106
- case 'xap:CreateDate':
3107
- case 'xap:ModifyDate':
3108
- $this->xmp_array[$value] = strtotime($xmlarray[$key]);
3109
- break;
3110
- default:
3111
- $this->xmp_array[$value] = $xmlarray[$key];
3112
  }
3113
  }
3114
- }
3115
- }
3116
- // return one element if requested
3117
- if ($object != false) {
3118
- return isset($this->xmp_array[$object]) ? $this->xmp_array[$object] : false;
3119
  }
3120
- // on request sanitize the output
3121
- if ($this->sanitize == true) {
3122
- array_walk($this->xmp_array, 'esc_html');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3123
  }
3124
- return $this->xmp_array;
3125
  }
3126
- function setArrayValue(&$array, $stack, $value)
 
 
 
 
 
 
 
3127
  {
3128
- if ($stack) {
3129
- $key = array_shift($stack);
3130
- $this->setArrayValue($array[$key], $stack, $value);
3131
- return $array;
3132
  } else {
3133
- $array = $value;
 
 
3134
  }
3135
- return $array;
 
 
 
 
 
 
 
3136
  }
3137
  /**
3138
- * nggMeta::get_META() - return a meta value form the available list
 
3139
  *
3140
- * @param string $object
3141
- * @return mixed $value
 
 
3142
  */
3143
- function get_META($object = false)
3144
  {
3145
- // defined order first look into database, then XMP, IPTC and EXIF.
3146
- if ($value = $this->get_saved_meta($object)) {
3147
- return $value;
3148
- }
3149
- if ($value = $this->get_XMP($object)) {
3150
- return $value;
3151
  }
3152
- if ($object == 'created_timestamp' && ($d = $this->get_IPTC('created_date')) && ($t = $this->get_IPTC('created_time'))) {
3153
- return $this->exif_date2ts($d . ' ' . $t);
 
3154
  }
3155
- if ($value = $this->get_IPTC($object)) {
3156
- return $value;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3157
  }
3158
- if ($value = $this->get_EXIF($object)) {
3159
- return $value;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3160
  }
3161
- // nothing found ?
3162
- return false;
3163
  }
3164
  /**
3165
- * nggMeta::i8n_name() - localize the tag name
3166
  *
3167
- * @param mixed $key
3168
- * @return string Translated $key
 
 
3169
  */
3170
- function i18n_name($key)
3171
  {
3172
- $tagnames = array('aperture' => __('Aperture', 'nggallery'), 'credit' => __('Credit', 'nggallery'), 'camera' => __('Camera', 'nggallery'), 'caption' => __('Caption', 'nggallery'), 'created_timestamp' => __('Date/Time', 'nggallery'), 'copyright' => __('Copyright', 'nggallery'), 'focal_length' => __('Focal length', 'nggallery'), 'iso' => __('ISO', 'nggallery'), 'shutter_speed' => __('Shutter speed', 'nggallery'), 'title' => __('Title', 'nggallery'), 'author' => __('Author', 'nggallery'), 'tags' => __('Tags', 'nggallery'), 'subject' => __('Subject', 'nggallery'), 'make' => __('Make', 'nggallery'), 'status' => __('Edit Status', 'nggallery'), 'category' => __('Category', 'nggallery'), 'keywords' => __('Keywords', 'nggallery'), 'created_date' => __('Date Created', 'nggallery'), 'created_time' => __('Time Created', 'nggallery'), 'position' => __('Author Position', 'nggallery'), 'city' => __('City', 'nggallery'), 'location' => __('Location', 'nggallery'), 'state' => __('Province/State', 'nggallery'), 'country_code' => __('Country code', 'nggallery'), 'country' => __('Country', 'nggallery'), 'headline' => __('Headline', 'nggallery'), 'credit' => __('Credit', 'nggallery'), 'source' => __('Source', 'nggallery'), 'copyright' => __('Copyright Notice', 'nggallery'), 'contact' => __('Contact', 'nggallery'), 'last_modfied' => __('Last modified', 'nggallery'), 'tool' => __('Program tool', 'nggallery'), 'format' => __('Format', 'nggallery'), 'width' => __('Image Width', 'nggallery'), 'height' => __('Image Height', 'nggallery'), 'flash' => __('Flash', 'nggallery'));
3173
- if (isset($tagnames[$key])) {
3174
- $key = $tagnames[$key];
3175
  }
3176
- return $key;
3177
  }
3178
  /**
3179
- * Return the Timestamp from the image , if possible it's read from exif data
3180
- * @return string
 
 
 
 
 
 
3181
  */
3182
- function get_date_time()
3183
  {
3184
- $date = time();
3185
- // Try getting the created_timestamp field
3186
- $date = $this->exif_date2ts($this->get_META('created_timestamp'));
3187
- if (!$date) {
3188
- $image_path = C_Gallery_Storage::get_instance()->get_backup_abspath($this->image);
3189
- $date = @filectime($image_path);
3190
- }
3191
- // Failback
3192
- if (!$date) {
3193
- $date = time();
3194
- }
3195
- // Return the MySQL format
3196
- $date_time = date('Y-m-d H:i:s', $date);
3197
- return $date_time;
3198
  }
3199
  /**
3200
- * This function return the most common metadata, via a filter we can add more
3201
- * Reason : GD manipulation removes that options
3202
  *
3203
- * @since V1.4.0
3204
- * @return array|false
 
3205
  */
3206
- function get_common_meta()
3207
  {
3208
- global $wpdb;
3209
- $meta = array('aperture' => 0, 'credit' => '', 'camera' => '', 'caption' => '', 'created_timestamp' => 0, 'copyright' => '', 'focal_length' => 0, 'iso' => 0, 'shutter_speed' => 0, 'flash' => 0, 'title' => '', 'keywords' => '');
3210
- $meta = apply_filters('ngg_read_image_metadata', $meta);
3211
- // meta should be still an array
3212
- if (!is_array($meta)) {
3213
- return false;
 
 
 
 
 
 
 
 
 
 
 
3214
  }
3215
- foreach ($meta as $key => $value) {
3216
- $meta[$key] = $this->get_META($key);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3217
  }
3218
- //let's add now the size of the image
3219
- $meta['width'] = $this->size[0];
3220
- $meta['height'] = $this->size[1];
3221
- return $meta;
3222
  }
3223
  /**
3224
- * If needed sanitize each value before output
3225
- *
3226
- * @return void
3227
  */
3228
- function sanitize()
3229
  {
3230
- $this->sanitize = true;
 
 
 
3231
  }
3232
  /**
3233
- * Wrapper to utf8_encode() that avoids double encoding
3234
- *
3235
- * Regex adapted from http://www.w3.org/International/questions/qa-forms-utf-8.en.php
3236
- * to determine if the given string is already UTF-8. mb_detect_encoding() is not
3237
- * always available and is limited in accuracy
3238
- *
3239
- * @param string $str
3240
- * @return string
 
 
 
 
 
 
 
3241
  */
3242
- function utf8_encode($str)
3243
  {
3244
- $is_utf8 = preg_match('%^(?:
3245
- [\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII
3246
- | [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte
3247
- | \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs
3248
- | [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte
3249
- | \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates
3250
- | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3
3251
- | [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15
3252
- | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16
3253
- )*$%xs', $str);
3254
- if (!$is_utf8) {
3255
- utf8_encode($str);
3256
  }
3257
- return $str;
 
3258
  }
3259
  }
3260
- class Mixin_NggLegacy_GalleryStorage_Driver extends Mixin
 
 
 
 
3261
  {
3262
  /**
3263
- * Returns the named sizes available for images
3264
- * @return array
3265
- */
3266
- function get_image_sizes()
3267
- {
3268
- return array('full', 'thumbnail');
3269
- }
3270
- /**
3271
- * @param object|bool $gallery (optional)
3272
- * @return string
3273
- */
3274
- function get_upload_abspath($gallery = FALSE)
3275
- {
3276
- // Base upload path
3277
- $retval = C_NextGen_Settings::get_instance()->gallerypath;
3278
- $fs = C_Fs::get_instance();
3279
- // If a gallery has been specified, then we'll
3280
- // append the slug
3281
- if ($gallery) {
3282
- $retval = $this->get_gallery_abspath($gallery);
3283
- }
3284
- // We need to make this an absolute path
3285
- if (strpos($retval, $fs->get_document_root('gallery')) !== 0) {
3286
- $retval = rtrim($fs->join_paths($fs->get_document_root('gallery'), $retval), "/\\");
3287
- }
3288
- // Convert slashes
3289
- return $this->object->convert_slashes($retval);
3290
- }
3291
- /**
3292
- * Get the gallery path persisted in the database for the gallery
3293
- * @param int|object|C_Gallery $gallery
3294
- * @return string
3295
  */
3296
- function get_gallery_abspath($gallery)
3297
  {
3298
  $retval = NULL;
3299
- $fs = C_Fs::get_instance();
3300
- // Get the gallery entity from the database
3301
- if ($gallery) {
3302
- if (is_numeric($gallery)) {
3303
- $gallery = $this->object->_gallery_mapper->find($gallery);
3304
  }
 
 
3305
  }
3306
- // It just doesn't exist
3307
- if (!$gallery || is_numeric($gallery)) {
3308
- return $retval;
3309
- }
3310
- // We we have a gallery, determine it's path
3311
- if ($gallery) {
3312
- if (isset($gallery->path)) {
3313
- $retval = $gallery->path;
3314
- } elseif (isset($gallery->slug)) {
3315
- $fs = C_Fs::get_instance();
3316
- $basepath = C_NextGen_Settings::get_instance()->gallerypath;
3317
- $retval = $fs->join_paths($basepath, sanitize_file_name(sanitize_title($gallery->slug)));
3318
- }
3319
- }
3320
- $root_type = defined('NGG_GALLERY_ROOT_TYPE') ? NGG_GALLERY_ROOT_TYPE : 'site';
3321
- if ($root_type == 'content') {
3322
- // This requires explanation: in case our content root ends with the same directory name
3323
- // that the gallery path begins with we remove the duplicate name from $retval. This is
3324
- // necessary because the default WP_CONTENT_DIR setting ends in /wp-content/ and
3325
- // NextGEN's default gallery path begins with /wp-content/. This also allows gallery
3326
- // paths to also be expressed as simply "/gallery-name/"
3327
- $exploded_root = explode(DIRECTORY_SEPARATOR, trim($fs->get_document_root('content'), '/\\'));
3328
- $exploded_gallery = explode(DIRECTORY_SEPARATOR, trim($retval, '/\\'));
3329
- $exploded_gallery = array_values($exploded_gallery);
3330
- $last_gallery_dirname = $exploded_gallery[0];
3331
- $last_root_dirname = end($exploded_root);
3332
- if ($last_root_dirname === $last_gallery_dirname) {
3333
- unset($exploded_gallery[0]);
3334
- $retval = implode(DIRECTORY_SEPARATOR, $exploded_gallery);
3335
- }
3336
- }
3337
- // Ensure that the path is absolute
3338
- if (strpos($retval, $fs->get_document_root('gallery')) !== 0) {
3339
- $retval = rtrim($fs->join_paths($fs->get_document_root('gallery'), $retval), "/\\");
3340
- }
3341
- return $this->object->convert_slashes(rtrim($retval, "/\\"));
3342
  }
3343
  /**
3344
- * Gets the absolute path where the image is stored. Can optionally return the path for a particular sized image.
3345
- * @param int|object $image
3346
- * @param string $size (optional) Default = full
3347
- * @param bool $check_existance (optional) Default = false
3348
- * @return string
3349
  */
3350
- function get_image_abspath($image, $size = 'full', $check_existance = FALSE)
3351
  {
3352
- $retval = NULL;
3353
- $fs = C_Fs::get_instance();
3354
- // Ensure that we have a size
3355
- if (!$size) {
3356
- $size = 'full';
3357
- }
3358
- // If we have the id, get the actual image entity
3359
- if (is_numeric($image)) {
3360
- $image = $this->object->_image_mapper->find($image);
3361
- }
3362
- // Ensure we have the image entity - user could have passed in an
3363
- // incorrect id
3364
- if (is_object($image)) {
3365
- if ($gallery_path = $this->object->get_gallery_abspath($image->galleryid)) {
3366
- $folder = $prefix = $size;
3367
- switch ($size) {
3368
- # Images are stored in the associated gallery folder
3369
- case 'full':
3370
- case 'original':
3371
- case 'image':
3372
- $retval = $fs->join_paths($gallery_path, $image->filename);
3373
- break;
3374
- case 'backup':
3375
- $retval = $fs->join_paths($gallery_path, $image->filename . '_backup');
3376
- if ($check_existance && !@file_exists($retval)) {
3377
- $retval = $fs->join_paths($gallery_path, $image->filename);
3378
- }
3379
- break;
3380
- case 'thumbnails':
3381
- case 'thumbnail':
3382
- case 'thumb':
3383
- case 'thumbs':
3384
- $size = 'thumbnail';
3385
- $folder = 'thumbs';
3386
- $prefix = 'thumbs';
3387
- // deliberately no break here
3388
- // We assume any other size of image is stored in the a
3389
- //subdirectory of the same name within the gallery folder
3390
- // gallery folder, but with the size appended to the filename
3391
- // deliberately no break here
3392
- // We assume any other size of image is stored in the a
3393
- //subdirectory of the same name within the gallery folder
3394
- // gallery folder, but with the size appended to the filename
3395
- default:
3396
- $image_path = $fs->join_paths($gallery_path, $folder);
3397
- // NGG 2.0 stores relative filenames in the meta data of
3398
- // an image. It does this because it uses filenames
3399
- // that follow conventional WordPress naming scheme.
3400
- if (isset($image->meta_data) && isset($image->meta_data[$size]) && isset($image->meta_data[$size]['filename'])) {
3401
- $image_path = $fs->join_paths($image_path, $image->meta_data[$size]['filename']);
3402
- } else {
3403
- $image_path = $fs->join_paths($image_path, "{$prefix}_{$image->filename}");
3404
- }
3405
- $retval = $image_path;
3406
- break;
3407
- }
3408
  }
3409
  }
3410
- // Check the existance of the file
3411
- if ($retval && $check_existance) {
3412
- if (!@file_exists($retval)) {
3413
- $retval = NULL;
 
 
 
 
 
3414
  }
 
 
 
 
 
3415
  }
3416
- return $retval ? rtrim($retval, "/\\") : $retval;
3417
  }
3418
  /**
3419
- * Gets the url of a particular-sized image
3420
- * @param int|object $image
3421
- * @param string $size
3422
- * @return string
3423
  */
3424
- function get_image_url($image, $size = 'full', $check_existance = FALSE, $image_abspath = FALSE)
3425
  {
3426
- $retval = NULL;
3427
- $fs = C_Fs::get_instance();
3428
- $router = C_Router::get_instance();
3429
- if (!$image_abspath) {
3430
- $image_abspath = $this->object->get_image_abspath($image, $size, $check_existance);
 
3431
  }
3432
- if ($image_abspath) {
3433
- // Use multibyte pathinfo() in case of UTF8 gallery or file names
3434
- $parts = M_I18n::mb_pathinfo($image_abspath);
3435
- $image_abspath = $parts['dirname'] . DIRECTORY_SEPARATOR . $parts['basename'];
3436
- $doc_root = $fs->get_document_root('gallery');
3437
- if ($doc_root != null) {
3438
- $doc_root = rtrim($doc_root, "/\\") . DIRECTORY_SEPARATOR;
3439
- }
3440
- // if docroot is "/" we would generate urls like /wp-contentpluginsnextgen-galleryetcetc
3441
- if ($doc_root !== '/') {
3442
- $request_uri = str_replace($doc_root, '', $image_abspath);
3443
- } else {
3444
- $request_uri = $image_abspath;
3445
- }
3446
- $request_uri = '/' . ltrim(str_replace("\\", '/', $request_uri), "/");
3447
- // Because like%@this.jpg is a valid directory and filename
3448
- $request_uri = explode('/', $request_uri);
3449
- foreach ($request_uri as $ndx => $segment) {
3450
- $request_uri[$ndx] = rawurlencode($segment);
3451
- }
3452
- $request_uri = implode('/', $request_uri);
3453
- $retval = $router->remove_url_segment('/index.php', $router->get_url($request_uri, FALSE, 'gallery'));
3454
  }
3455
- return apply_filters('ngg_get_image_url', $retval, $image, $size);
3456
- }
3457
- /**
3458
- * Uploads an image for a particular gallerys
3459
- * @param int|object|C_Gallery $gallery
3460
- * @param string|bool $filename (optional) Specifies the name of the file
3461
- * @param string|bool $data (optional) If specified, expects base64 encoded string of data
3462
- * @return C_Image
3463
- */
3464
- function upload_image($gallery, $filename = FALSE, $data = FALSE)
3465
- {
3466
- $retval = NULL;
3467
- // Ensure that we have the data present that we require
3468
- if (isset($_FILES['file']) && $_FILES['file']['error'] == 0) {
3469
- // $_FILES = Array(
3470
- // [file] => Array (
3471
- // [name] => Canada_landscape4.jpg
3472
- // [type] => image/jpeg
3473
- // [tmp_name] => /private/var/tmp/php6KO7Dc
3474
- // [error] => 0
3475
- // [size] => 64975
3476
- // )
3477
- //
3478
- $file = $_FILES['file'];
3479
- if ($this->object->is_zip()) {
3480
- $retval = $this->object->upload_zip($gallery);
3481
- } else {
3482
- if ($this->is_image_file()) {
3483
- $retval = $this->object->upload_base64_image($gallery, file_get_contents($file['tmp_name']), $filename ? $filename : (isset($file['name']) ? $file['name'] : FALSE));
3484
- } else {
3485
- // Remove the non-valid (and potentially insecure) file from the PHP upload directory
3486
- if (isset($_FILES['file']['tmp_name'])) {
3487
- $filename = $_FILES['file']['tmp_name'];
3488
- @unlink($filename);
3489
- }
3490
- throw new E_UploadException(__('Invalid image file. Acceptable formats: JPG, GIF, and PNG.', 'nggallery'));
3491
  }
 
3492
  }
3493
- } elseif ($data) {
3494
- $retval = $this->object->upload_base64_image($filename, $data);
3495
- } else {
3496
- throw new E_UploadException();
3497
  }
3498
  return $retval;
3499
  }
3500
- function get_image_size_params($image, $size, $params = null, $skip_defaults = false)
3501
  {
3502
- // Get the image entity
3503
- if (is_numeric($image)) {
3504
- $image = $this->object->_image_mapper->find($image);
3505
- }
3506
- $params = apply_filters('ngg_get_image_size_params', $params, $size, $image);
3507
- // Ensure we have a valid image
3508
- if ($image) {
3509
- $settings = C_NextGen_Settings::get_instance();
3510
- if (!$skip_defaults) {
3511
- // Get default settings
3512
- if ($size == 'full') {
3513
- if (!isset($params['quality'])) {
3514
- $params['quality'] = $settings->imgQuality;
3515
- }
3516
- } else {
3517
- if (!isset($params['crop'])) {
3518
- $params['crop'] = $settings->thumbfix;
3519
- }
3520
- if (!isset($params['quality'])) {
3521
- $params['quality'] = $settings->thumbquality;
3522
- }
3523
- }
3524
- // Not sure why this was here... commenting out for now, always require watermark parameters to be explicit
3525
- # if (!isset($params['watermark'])) {
3526
- # $params['watermark'] = $settings->wmType;
3527
- # }
3528
- }
3529
- // width and height when omitted make generate_image_clone create a clone with original size, so try find defaults regardless of $skip_defaults
3530
- if (!isset($params['width']) || !isset($params['height'])) {
3531
- // First test if this is a "known" image size, i.e. if we store these sizes somewhere when users re-generate these sizes from the UI...this is required to be compatible with legacy
3532
- // try the 2 default built-in sizes, first thumbnail...
3533
- if ($size == 'thumbnail') {
3534
- if (!isset($params['width'])) {
3535
- $params['width'] = $settings->thumbwidth;
3536
- }
3537
- if (!isset($params['height'])) {
3538
- $params['height'] = $settings->thumbheight;
3539
- }
3540
- } else {
3541
- if ($size == 'full') {
3542
- if (!isset($params['width'])) {
3543
- if ($settings->imgAutoResize) {
3544
- $params['width'] = $settings->imgWidth;
3545
- }
3546
- }
3547
- if (!isset($params['height'])) {
3548
- if ($settings->imgAutoResize) {
3549
- $params['height'] = $settings->imgHeight;
3550
- }
3551
- }
3552
- } else {
3553
- if (isset($image->meta_data) && isset($image->meta_data[$size])) {
3554
- $dimensions = $image->meta_data[$size];
3555
- if (!isset($params['width'])) {
3556
- $params['width'] = $dimensions['width'];
3557
- }
3558
- if (!isset($params['height'])) {
3559
- $params['height'] = $dimensions['height'];
3560
- }
3561
- }
3562
- }
3563
- }
3564
- }
3565
- if (!isset($params['crop_frame'])) {
3566
- $crop_frame_size_name = 'thumbnail';
3567
- if (isset($image->meta_data[$size]['crop_frame'])) {
3568
- $crop_frame_size_name = $size;
3569
- }
3570
- if (isset($image->meta_data[$crop_frame_size_name]['crop_frame'])) {
3571
- $params['crop_frame'] = $image->meta_data[$crop_frame_size_name]['crop_frame'];
3572
- if (!isset($params['crop_frame']['final_width'])) {
3573
- $params['crop_frame']['final_width'] = $image->meta_data[$crop_frame_size_name]['width'];
3574
- }
3575
- if (!isset($params['crop_frame']['final_height'])) {
3576
- $params['crop_frame']['final_height'] = $image->meta_data[$crop_frame_size_name]['height'];
3577
- }
3578
- }
3579
- } else {
3580
- if (!isset($params['crop_frame']['final_width'])) {
3581
- $params['crop_frame']['final_width'] = $params['width'];
3582
- }
3583
- if (!isset($params['crop_frame']['final_height'])) {
3584
- $params['crop_frame']['final_height'] = $params['height'];
3585
- }
3586
- }
3587
- }
3588
- return $params;
3589
  }
 
 
 
 
 
 
3590
  /**
3591
  * Returns an array of dimensional properties (width, height, real_width, real_height) of a resulting clone image if and when generated
3592
  * @param object|int $image Image ID or an image object
@@ -3613,1596 +3534,1826 @@ class Mixin_NggLegacy_GalleryStorage_Driver extends Mixin
3613
  return $retval;
3614
  }
3615
  /**
3616
- * Generates a specific size for an image
3617
- * @param int|object|C_Image $image
3618
- * @param string $size
3619
- * @param array|null $params (optional)
3620
- * @param bool $skip_defaults (optional)
3621
- * @return bool|object
3622
  */
3623
- function generate_image_size($image, $size, $params = null, $skip_defaults = false)
3624
  {
3625
- $retval = FALSE;
3626
- // Get the image entity
3627
- if (is_numeric($image)) {
3628
- $image = $this->object->_image_mapper->find($image);
3629
- }
 
 
 
 
 
3630
  // Ensure we have a valid image
3631
- if ($image) {
3632
- $params = $this->object->get_image_size_params($image, $size, $params, $skip_defaults);
3633
- $settings = C_NextGen_Settings::get_instance();
3634
- // Get the image filename
3635
- $filename = $this->object->get_original_abspath($image, 'original');
3636
- $thumbnail = null;
3637
- if ($size == 'full' && $settings->imgBackup == 1) {
3638
- // XXX change this? 'full' should be the resized path and 'original' the _backup path
3639
- $backup_path = $this->object->get_backup_abspath($image);
3640
- if (!@file_exists($backup_path)) {
3641
- @copy($filename, $backup_path);
 
3642
  }
3643
  }
3644
- // Generate the thumbnail using WordPress
3645
- $existing_image_abpath = $this->object->get_image_abspath($image, $size);
3646
- $existing_image_dir = dirname($existing_image_abpath);
3647
- // removing the old thumbnail is actually not needed as generate_image_clone() will replace it, leaving commented in as reminder in case there are issues in the future
3648
- if (@file_exists($existing_image_abpath)) {
3649
- //unlink($existing_image_abpath);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3650
  }
3651
- wp_mkdir_p($existing_image_dir);
3652
- $clone_path = $existing_image_abpath;
3653
- $thumbnail = $this->object->generate_image_clone($filename, $clone_path, $params);
3654
  // We successfully generated the thumbnail
3655
- if ($thumbnail != null) {
3656
- $clone_path = $thumbnail->fileName;
3657
- if (function_exists('getimagesize')) {
3658
- $dimensions = getimagesize($clone_path);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3659
  } else {
3660
- $dimensions = array($params['width'], $params['height']);
3661
  }
3662
- if (!isset($image->meta_data)) {
3663
- $image->meta_data = array();
 
 
3664
  }
3665
- $size_meta = array('width' => $dimensions[0], 'height' => $dimensions[1], 'filename' => M_I18n::mb_basename($clone_path), 'generated' => microtime());
3666
- if (isset($params['crop_frame'])) {
3667
- $size_meta['crop_frame'] = $params['crop_frame'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3668
  }
3669
- $image->meta_data[$size] = $size_meta;
3670
- if ($size == 'full') {
3671
- $image->meta_data['width'] = $size_meta['width'];
3672
- $image->meta_data['height'] = $size_meta['height'];
 
3673
  }
3674
- $retval = $this->object->_image_mapper->save($image);
3675
- do_action('ngg_generated_image', $image, $size, $params);
3676
- if ($retval == 0) {
3677
- $retval = false;
3678
  }
3679
- if ($retval) {
3680
- $retval = $thumbnail;
 
3681
  }
3682
- } else {
3683
- // Something went wrong. Thumbnail generation failed!
 
 
3684
  }
3685
  }
3686
- return $retval;
3687
  }
3688
  /**
3689
- * Generates a thumbnail for an image
3690
- * @param int|stdClass|C_Image $image
3691
- * @return bool
 
 
3692
  */
3693
- function generate_thumbnail($image, $params = null, $skip_defaults = false)
3694
  {
3695
- $sized_image = $this->object->generate_image_size($image, 'thumbnail', $params, $skip_defaults);
3696
- $retval = false;
3697
- if ($sized_image != null) {
3698
- $retval = true;
3699
- $sized_image->destruct();
3700
  }
3701
  return $retval;
3702
  }
3703
  /**
3704
- * Outputs/renders an image
3705
- * @param int|stdClass|C_Image $image
3706
- * @return bool
 
 
3707
  */
3708
- function render_image($image, $size = FALSE)
3709
  {
3710
- $format_list = $this->object->get_image_format_list();
3711
- $abspath = $this->get_image_abspath($image, $size, true);
3712
- if ($abspath == null) {
3713
- $thumbnail = $this->object->generate_image_size($image, $size);
3714
- if ($thumbnail != null) {
3715
- $abspath = $thumbnail->fileName;
3716
- $thumbnail->destruct();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3717
  }
3718
- }
3719
- if ($abspath != null) {
3720
- $data = @getimagesize($abspath);
3721
- $format = 'jpg';
3722
- if ($data != null && is_array($data) && isset($format_list[$data[2]])) {
3723
- $format = $format_list[$data[2]];
3724
  }
3725
- // Clear output
3726
- while (ob_get_level() > 0) {
3727
- ob_end_clean();
 
 
 
 
 
 
 
3728
  }
3729
- $format = strtolower($format);
3730
- // output image and headers
3731
- header('Content-type: image/' . $format);
3732
- readfile($abspath);
3733
- return true;
3734
- }
3735
- return false;
3736
- }
3737
- function _delete_gallery_directory($abspath)
3738
- {
3739
- // Remove all image files and purge all empty directories left over
3740
- $iterator = new DirectoryIterator($abspath);
3741
- // Only delete image files! Other files may be stored incorrectly but it's not our place to delete them
3742
- $removable_extensions = apply_filters('ngg_allowed_file_types', array('jpeg', 'jpg', 'png', 'gif'));
3743
- foreach ($removable_extensions as $extension) {
3744
- $removable_extensions[] = $extension . '_backup';
3745
- }
3746
- foreach ($iterator as $file) {
3747
- if (in_array($file->getBasename(), array('.', '..'))) {
3748
- continue;
3749
- } elseif ($file->isFile() || $file->isLink()) {
3750
- $extension = strtolower(pathinfo($file->getPathname(), PATHINFO_EXTENSION));
3751
- if (in_array($extension, $removable_extensions, TRUE)) {
3752
- @unlink($file->getPathname());
3753
- }
3754
- } elseif ($file->isDir()) {
3755
- $this->object->_delete_gallery_directory($file->getPathname());
3756
  }
3757
- }
3758
- // DO NOT remove directories that still have files in them. Note: '.' and '..' are included with getSize()
3759
- $empty = TRUE;
3760
- foreach ($iterator as $file) {
3761
- if (in_array($file->getBasename(), array('.', '..'))) {
3762
- continue;
 
 
 
 
 
 
 
 
3763
  }
3764
- $empty = FALSE;
3765
- }
3766
- if ($empty) {
3767
- @rmdir($iterator->getPath());
3768
- }
3769
- }
3770
- function delete_gallery($gallery)
3771
- {
3772
- $fs = C_Fs::get_instance();
3773
- $safe_dirs = array(DIRECTORY_SEPARATOR, $fs->get_document_root('plugins'), $fs->get_document_root('plugins_mu'), $fs->get_document_root('templates'), $fs->get_document_root('stylesheets'), $fs->get_document_root('content'), $fs->get_document_root('galleries'), $fs->get_document_root());
3774
- $abspath = $this->object->get_gallery_abspath($gallery);
3775
- if ($abspath && file_exists($abspath) && !in_array(stripslashes($abspath), $safe_dirs)) {
3776
- $this->object->_delete_gallery_directory($abspath);
3777
- }
3778
- }
3779
- function delete_image($image, $size = FALSE)
3780
- {
3781
- $retval = FALSE;
3782
- // Ensure that we have the image entity
3783
- if (is_numeric($image)) {
3784
- $image = $this->object->_image_mapper->find($image);
3785
- }
3786
- if ($image) {
3787
- $image_id = $image->{$image->id_field};
3788
- do_action('ngg_delete_image', $image_id, $size);
3789
- // Delete only a particular image size
3790
- if ($size) {
3791
- $abspath = $this->object->get_image_abspath($image, $size);
3792
- if ($abspath && @file_exists($abspath)) {
3793
- unlink($abspath);
3794
  }
3795
- if (isset($image->meta_data) && isset($image->meta_data[$size])) {
3796
- unset($image->meta_data[$size]);
3797
- $this->object->_image_mapper->save($image);
3798
  }
3799
- } else {
3800
- // Get the paths to fullsize and thumbnail files
3801
- $abspaths = array($this->object->get_full_abspath($image), $this->object->get_thumb_abspath($image), $this->object->get_backup_abspath($image));
3802
- if (isset($image->meta_data)) {
3803
- foreach (array_keys($image->meta_data) as $size) {
3804
- $abspaths[] = $this->object->get_image_abspath($image, $size);
 
 
 
 
 
 
 
 
 
3805
  }
3806
  }
3807
- // Delete each image
3808
- foreach ($abspaths as $abspath) {
3809
- if ($abspath && @file_exists($abspath)) {
3810
- unlink($abspath);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3811
  }
 
 
 
 
3812
  }
3813
- // Delete the entity
3814
- $this->object->_image_mapper->destroy($image);
3815
- }
3816
- $retval = TRUE;
3817
- }
3818
- return $retval;
3819
- }
3820
- /**
3821
- * Determines if the given NGG image id has been uploaded to the media library
3822
- *
3823
- * @param integer $imageId
3824
- * @retval FALSE|int attachment_id
3825
- */
3826
- function is_in_media_library($imageId)
3827
- {
3828
- $retval = FALSE;
3829
- // Get the image
3830
- if (is_object($imageId)) {
3831
- $image = $imageId;
3832
- $imageId = $image->pid;
3833
- }
3834
- // Try to find an attachment for the given image_id
3835
- if ($imageId) {
3836
- $query = new WP_Query(array('post_type' => 'attachment', 'meta_key' => '_ngg_image_id', 'meta_value_num' => $imageId));
3837
- foreach ($query->get_posts() as $post) {
3838
- $retval = $post->ID;
3839
  }
3840
- }
3841
- return $retval;
3842
- }
3843
- /**
3844
- * Copies a NGG image to the media library and returns the attachment_id
3845
- * @param C_Image $image
3846
- * @retval FALSE|int attachment_id
3847
- */
3848
- function copy_to_media_library($image)
3849
- {
3850
- $retval = FALSE;
3851
- // Get the image
3852
- if (is_int($image)) {
3853
- $imageId = $image;
3854
- $mapper = C_Image_Mapper::get_instance();
3855
- $image = $mapper->find($imageId);
3856
- }
3857
- if ($image) {
3858
- $wordpress_upload_dir = wp_upload_dir();
3859
- // $wordpress_upload_dir['path'] is the full server path to wp-content/uploads/2017/05, for multisite works good as well
3860
- // $wordpress_upload_dir['url'] the absolute URL to the same folder, actually we do not need it, just to show the link to file
3861
- $i = 1;
3862
- // number of tries when the file with the same name is already exists
3863
- $image_abspath = C_Gallery_Storage::get_instance()->get_image_abspath($image, "full");
3864
- $new_file_path = $wordpress_upload_dir['path'] . '/' . $image->filename;
3865
- $new_file_mime = mime_content_type($image_abspath);
3866
- while (file_exists($new_file_path)) {
3867
- $i++;
3868
- $new_file_path = $wordpress_upload_dir['path'] . '/' . $i . '_' . $image->filename;
3869
  }
3870
- if (@copy($image_abspath, $new_file_path)) {
3871
- $upload_id = wp_insert_attachment(array('guid' => $new_file_path, 'post_mime_type' => $new_file_mime, 'post_title' => preg_replace('/\\.[^.]+$/', '', $image->alttext), 'post_content' => '', 'post_status' => 'inherit'), $new_file_path);
3872
- update_post_meta($upload_id, '_ngg_image_id', intval($image->pid));
3873
- // wp_generate_attachment_metadata() won't work if you do not include this file
3874
- require_once ABSPATH . 'wp-admin/includes/image.php';
3875
- $image_meta = wp_generate_attachment_metadata($upload_id, $new_file_path);
3876
- // Generate and save the attachment metas into the database
3877
- wp_update_attachment_metadata($upload_id, $image_meta);
3878
- $retval = $upload_id;
3879
  }
 
 
3880
  }
3881
- return $retval;
3882
  }
3883
  /**
3884
- * Sets a NGG image as a post thumbnail for the given post
 
 
 
 
 
3885
  */
3886
- function set_post_thumbnail($postId, $image, $only_create_attachment = FALSE)
3887
  {
3888
  $retval = FALSE;
3889
- // attachment_id or FALSE
3890
- // Get the post ID
3891
- if (is_object($postId)) {
3892
- $post = $postId;
3893
- $postId = isset($post->ID) ? $post->ID : $post->post_id;
3894
- }
3895
- // Get the image
3896
- if (is_int($image)) {
3897
- $imageId = $image;
3898
- $mapper = C_Image_Mapper::get_instance();
3899
- $image = $mapper->find($imageId);
3900
  }
3901
- if ($image && $postId) {
3902
- $attachment_id = $this->object->is_in_media_library($image->pid);
3903
- if ($attachment_id === FALSE) {
3904
- $attachment_id = $this->object->copy_to_media_library($image);
3905
- }
3906
- if ($attachment_id) {
3907
- if (!$only_create_attachment) {
3908
- set_post_thumbnail($postId, $attachment_id);
 
 
 
 
3909
  }
3910
- $retval = $attachment_id;
3911
- }
3912
- }
3913
- return $retval;
3914
- }
3915
- /**
3916
- * Delete the given NGG image from the media library
3917
- */
3918
- function delete_from_media_library($imageId)
3919
- {
3920
- // Get the image
3921
- if (!is_int($imageId)) {
3922
- $image = $imageId;
3923
- $imageId = $image->pid;
3924
- }
3925
- if ($postId = $this->object->is_in_media_library($imageId)) {
3926
- wp_delete_post($postId);
3927
- }
3928
- }
3929
- /**
3930
- * Copies (or moves) images into another gallery
3931
- *
3932
- * @param array $images
3933
- * @param int|object $gallery
3934
- * @param boolean $db optionally only copy the image files
3935
- * @param boolean $move move the image instead of copying
3936
- * @return mixed NULL on failure, array|image-ids on success
3937
- */
3938
- function copy_images($images, $gallery, $db = TRUE, $move = FALSE)
3939
- {
3940
- $new_image_pids = array();
3941
- // the return value
3942
- // legacy requires passing just a numeric ID
3943
- if (is_numeric($gallery)) {
3944
- $gallery = $this->object->_gallery_mapper->find($gallery);
3945
- }
3946
- // move_images() is a wrapper to this function so we implement both features here
3947
- $func = $move ? 'rename' : 'copy';
3948
- // legacy allows for arrays of just the ID
3949
- if (!is_array($images)) {
3950
- $images = array($images);
3951
- }
3952
- // Ensure we have a valid gallery
3953
- $gallery_id = $this->object->_get_gallery_id($gallery);
3954
- if (!$gallery_id) {
3955
- return array();
3956
- }
3957
- $image_key = $this->object->_image_mapper->get_primary_key_column();
3958
- $gallery_abspath = $this->object->get_gallery_abspath($gallery);
3959
- // Check for folder permission
3960
- if (!is_dir($gallery_abspath) && !wp_mkdir_p($gallery_abspath)) {
3961
- echo sprintf(__('Unable to create directory %s.', 'nggallery'), esc_html($gallery_abspath));
3962
- return $new_image_pids;
3963
- }
3964
- if (!is_writable($gallery_abspath)) {
3965
- echo sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'nggallery'), esc_html($gallery_abspath));
3966
- return $new_image_pids;
3967
- }
3968
- $old_gallery_ids = array();
3969
- $image_pid_map = array();
3970
- foreach ($images as $image) {
3971
- if ($this->object->is_current_user_over_quota()) {
3972
- throw new E_NoSpaceAvailableException(__('Sorry, you have used your space allocation. Please delete some files to upload more files.', 'nggallery'));
3973
  }
3974
- // again legacy requires that it be able to pass just a numeric ID
3975
- if (is_numeric($image)) {
3976
- $image = $this->object->_image_mapper->find($image);
3977
- }
3978
- $old_gallery_ids[] = $image->galleryid;
3979
- $old_pid = $image->{$image_key};
3980
- // update the DB if requested
3981
- $new_image = clone $image;
3982
- $new_pid = $old_pid;
3983
- if ($db) {
3984
- unset($new_image->extras_post_id);
3985
- $new_image->galleryid = $gallery_id;
3986
- if (!$move) {
3987
- $new_image->image_slug = nggdb::get_unique_slug(sanitize_title_with_dashes($image->alttext), 'image');
3988
- unset($new_image->{$image_key});
3989
  }
3990
- $new_pid = $this->object->_image_mapper->save($new_image);
3991
- }
3992
- if (!$new_pid) {
3993
- echo sprintf(__('Failed to copy database row for picture %s', 'nggallery'), $old_pid) . '<br />';
3994
- continue;
3995
- }
3996
- // 'backup' is not included in get_image_sizes()
3997
- $sizes = $this->object->get_image_sizes();
3998
- $sizes[] = 'backup';
3999
- // Copy each image size
4000
- foreach ($sizes as $size) {
4001
- // if backups are off there's no backup file to copy
4002
- if (!C_NextGen_Settings::get_instance()->imgBackup && $size == 'backup') {
4003
- continue;
4004
  }
4005
- $orig_path = $this->object->get_image_abspath($image, $size, TRUE);
4006
- if (!$orig_path || !@file_exists($orig_path)) {
4007
- echo sprintf(__('Failed to get image path for %s', 'nggallery'), esc_html(M_I18n::mb_basename($orig_path))) . '<br/>';
4008
- continue;
4009
  }
4010
- $new_path = $this->object->get_image_abspath($new_image, $size, FALSE);
4011
- // Prevent duplicate filenames: check if the filename exists and begin appending '-#'
4012
- if (!ini_get('safe_mode') && @file_exists($new_path)) {
4013
- // prevent get_image_abspath() from using the thumbnail filename in metadata
4014
- unset($new_image->meta_data['thumbnail']['filename']);
4015
- $file_exists = TRUE;
4016
- $i = 0;
4017
- do {
4018
- $i++;
4019
- $parts = explode('.', $image->filename);
4020
- $extension = array_pop($parts);
4021
- $tmp_filename = implode('.', $parts) . '-' . $i . '.' . $extension;
4022
- $new_image->filename = $tmp_filename;
4023
- $tmp_path = $this->object->get_image_abspath($new_image, $size, FALSE);
4024
- if (!@file_exists($tmp_path)) {
4025
- $file_exists = FALSE;
4026
- $new_path = $tmp_path;
4027
- if ($db) {
4028
- $this->object->_image_mapper->save($new_image);
4029
- }
4030
- }
4031
- } while ($file_exists == TRUE);
4032
  }
4033
- // Copy files
4034
- if (!@$func($orig_path, $new_path)) {
4035
- echo sprintf(__('Failed to copy image %1$s to %2$s', 'nggallery'), esc_html($orig_path), esc_html($new_path)) . '<br/>';
4036
- continue;
4037
  }
4038
- // disabling: this is a bit too verbose
4039
- // if (!empty($tmp_path))
4040
- // echo sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s) &raquo; The file already existed in the destination gallery.', 'nggallery'), $old_pid, esc_html($orig_path), $new_pid, esc_html($new_path)) . '<br />';
4041
- // else
4042
- // echo sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s)', 'nggallery'), $old_pid, esc_html($orig_path), $new_pid, esc_html($new_path)) . '<br />';
4043
- // Copy tags
4044
- if ($db) {
4045
- $tags = wp_get_object_terms($old_pid, 'ngg_tag', 'fields=ids');
4046
- $tags = array_map('intval', $tags);
4047
- wp_set_object_terms($new_pid, $tags, 'ngg_tag', true);
4048
  }
 
 
4049
  }
4050
- $new_image_pids[] = $new_pid;
4051
- $image_pid_map[$old_pid] = $new_pid;
4052
- }
4053
- $old_gallery_ids = array_unique($old_gallery_ids);
4054
- if ($move) {
4055
- do_action('ngg_moved_images', $images, $old_gallery_ids, $gallery_id);
4056
- } else {
4057
- do_action('ngg_copied_images', $image_pid_map, $old_gallery_ids, $gallery_id);
4058
  }
4059
- $title = '<a href="' . admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid=' . $gallery_id . '" >';
4060
- $title .= $gallery->title;
4061
- $title .= '</a>';
4062
- if ($move) {
4063
- $message = sprintf(__('Moved %1$s picture(s) to gallery %2$s .', 'nggallery'), count($new_image_pids), $title);
4064
- } else {
4065
- $message = sprintf(__('Copied %1$s picture(s) to gallery %2$s .', 'nggallery'), count($new_image_pids), $title);
 
 
 
 
 
 
 
 
 
 
4066
  }
4067
- echo '<div class="updated fade" id="message"><p>' . $message . '</p></div>';
4068
- // echo '<hr/>' . sprintf(__('Copied %1$s picture(s) to gallery %2$s .', 'nggallery'), count($new_image_pids), $title);
4069
- return $new_image_pids;
4070
  }
4071
  /**
4072
- * Recover image from backup copy and reprocess it
4073
- *
4074
  * @param int|stdClass|C_Image $image
4075
- * @return bool|string result code
4076
  */
4077
- function recover_image($image)
4078
  {
4079
- $retval = FALSE;
4080
- if (is_numeric($image)) {
4081
- $image = $this->object->_image_mapper->find($image);
4082
- }
4083
- if ($image) {
4084
- $full_abspath = $this->object->get_image_abspath($image);
4085
- $backup_abspath = $this->object->get_image_abspath($image, 'backup');
4086
- if ($backup_abspath != $full_abspath && @file_exists($backup_abspath)) {
4087
- if (is_writable($full_abspath) && is_writable(dirname($full_abspath))) {
4088
- // Copy the backup
4089
- if (@copy($backup_abspath, $full_abspath)) {
4090
- // Re-create non-fullsize image sizes
4091
- foreach ($this->object->get_image_sizes($image) as $named_size) {
4092
- if ($named_size == 'full') {
4093
- continue;
4094
- }
4095
- $this->object->generate_image_clone($backup_abspath, $this->object->get_image_abspath($image, $named_size), $this->object->get_image_size_params($image, $named_size));
4096
- }
4097
- do_action('ngg_recovered_image', $image);
4098
- // Reimport all metadata
4099
- $retval = $this->object->_image_mapper->reimport_metadata($image);
4100
- }
4101
- }
4102
- }
4103
  }
4104
  return $retval;
4105
  }
4106
  }
4107
  /**
4108
- * Class C_NggLegacy_GalleryStorage_Driver
4109
- * @mixin Mixin_NggLegacy_GalleryStorage_Driver
4110
- */
4111
- class C_NggLegacy_GalleryStorage_Driver extends C_GalleryStorage_Driver_Base
4112
- {
4113
- function define($context = FALSE)
4114
- {
4115
- parent::define($context);
4116
- $this->add_mixin('Mixin_NggLegacy_GalleryStorage_Driver');
4117
- }
4118
- }
4119
- /**
4120
- * gd.thumbnail.inc.php
4121
- *
4122
- * @author Ian Selby (ian@gen-x-design.com)
4123
- * @copyright Copyright 2006-2011
4124
- * @version 1.3.0 (based on 1.1.3)
4125
- * @modded by Alex Rabe
4126
- *
4127
- */
4128
- /**
4129
- * PHP class for dynamically resizing, cropping, and rotating images for thumbnail purposes and either displaying them on-the-fly or saving them.
4130
- *
4131
  */
4132
- class C_NggLegacy_Thumbnail
4133
  {
 
 
 
4134
  /**
4135
- * Error message to display, if any
4136
- *
4137
- * @var string
4138
- */
4139
- var $errmsg;
4140
- /**
4141
- * Whether or not there is an error
4142
- *
4143
- * @var boolean
4144
- */
4145
- var $error;
4146
- /**
4147
- * Format of the image file
4148
- *
4149
- * @var string
4150
- */
4151
- var $format;
4152
- /**
4153
- * File name and path of the image file
4154
- *
4155
- * @var string
4156
- */
4157
- var $fileName;
4158
- /**
4159
- * Current dimensions of working image
4160
- *
4161
- * @var array
4162
- */
4163
- var $currentDimensions;
4164
- /**
4165
- * New dimensions of working image
4166
- *
4167
- * @var array
4168
  */
4169
- var $newDimensions;
 
 
 
 
 
 
4170
  /**
4171
- * Image resource for newly manipulated image
4172
- *
4173
- * @var resource
4174
- * @access private
4175
  */
4176
- var $newImage;
 
 
 
 
4177
  /**
4178
- * Image resource for image before previous manipulation
4179
- *
4180
- * @var resource
4181
- * @access private
4182
  */
4183
- var $oldImage;
 
 
 
 
 
 
 
 
 
 
 
 
4184
  /**
4185
- * Image resource for image being currently manipulated
4186
- *
4187
- * @var resource
4188
- * @access private
4189
  */
4190
- var $workingImage;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4191
  /**
4192
- * Percentage to resize image by
4193
  *
4194
- * @var int
4195
- * @access private
4196
- */
4197
- var $percent;
4198
- /**
4199
- * Maximum width of image during resize
4200
  *
4201
- * @var int
4202
- * @access private
4203
  */
4204
- var $maxWidth;
 
 
 
4205
  /**
4206
- * Maximum height of image during resize
4207
- *
4208
- * @var int
4209
- * @access private
4210
  */
4211
- var $maxHeight;
 
 
 
4212
  /**
4213
- * Image for Watermark
4214
- *
4215
- * @var string
4216
- *
4217
  */
4218
- var $watermarkImgPath;
 
 
 
4219
  /**
4220
- * Text for Watermark
4221
- *
4222
- * @var string
4223
- *
4224
  */
4225
- var $watermarkText;
 
 
 
4226
  /**
4227
- * Image Resource ID for Watermark
4228
  *
4229
- * @var string
4230
- *
4231
  */
4232
- function __construct($fileName, $no_ErrorImage = false)
4233
  {
4234
- //make sure the GD library is installed
4235
- if (!function_exists("gd_info")) {
4236
- echo 'You do not have the GD Library installed. This class requires the GD library to function properly.' . "\n";
4237
- echo 'visit http://us2.php.net/manual/en/ref.image.php for more information';
4238
- throw new E_No_Image_Library_Exception();
4239
- }
4240
- //initialize variables
4241
- $this->errmsg = '';
4242
- $this->error = false;
4243
- $this->currentDimensions = array();
4244
- $this->newDimensions = array();
4245
- $this->fileName = $fileName;
4246
- $this->percent = 100;
4247
- $this->maxWidth = 0;
4248
- $this->maxHeight = 0;
4249
- $this->watermarkImgPath = '';
4250
- $this->watermarkText = '';
4251
- //check to see if file exists
4252
- if (!@file_exists($this->fileName)) {
4253
- $this->errmsg = 'File not found';
4254
- $this->error = true;
4255
- } elseif (!is_readable($this->fileName)) {
4256
- $this->errmsg = 'File is not readable';
4257
- $this->error = true;
4258
  }
4259
- $image_size = null;
4260
- //if there are no errors, determine the file format
4261
- if ($this->error == false) {
4262
- // set_time_limit(30);
4263
- @ini_set('memory_limit', -1);
4264
- $image_size = @getimagesize($this->fileName);
4265
- if (isset($image_size) && is_array($image_size)) {
4266
- $extensions = array('1' => 'GIF', '2' => 'JPG', '3' => 'PNG');
4267
- $extension = array_key_exists($image_size[2], $extensions) ? $extensions[$image_size[2]] : '';
4268
- if ($extension) {
4269
- $this->format = $extension;
4270
- } else {
4271
- $this->errmsg = 'Unknown file format';
4272
- $this->error = true;
4273
- }
4274
- } else {
4275
- $this->errmsg = 'File is not an image';
4276
- $this->error = true;
4277
  }
 
 
 
 
 
 
 
 
4278
  }
4279
- // increase memory-limit if possible, GD needs this for large images
4280
- if (!extension_loaded('suhosin')) {
4281
- @ini_set('memory_limit', '512M');
 
 
 
 
 
 
 
 
 
 
4282
  }
4283
- if ($this->error == false) {
4284
- // Check memory consumption if file exists
4285
- $this->checkMemoryForImage($this->fileName);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4286
  }
4287
- //initialize resources if no errors
4288
- if ($this->error == false) {
4289
- $img_err = null;
4290
- switch ($this->format) {
4291
- case 'GIF':
4292
- if (function_exists('ImageCreateFromGif')) {
4293
- $this->oldImage = @ImageCreateFromGif($this->fileName);
4294
- } else {
4295
- $img_err = __('Support for GIF format is missing.', 'nggallery');
4296
- }
4297
- break;
4298
- case 'JPG':
4299
- if (function_exists('ImageCreateFromJpeg')) {
4300
- $this->oldImage = @ImageCreateFromJpeg($this->fileName);
4301
- } else {
4302
- $img_err = __('Support for JPEG format is missing.', 'nggallery');
4303
- }
4304
- break;
4305
- case 'PNG':
4306
- if (function_exists('ImageCreateFromPng')) {
4307
- $this->oldImage = @ImageCreateFromPng($this->fileName);
4308
- } else {
4309
- $img_err = __('Support for PNG format is missing.', 'nggallery');
4310
- }
4311
- break;
4312
- }
4313
- if (!$this->oldImage) {
4314
- if ($img_err == null) {
4315
- $img_err = __('Check memory limit', 'nggallery');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4316
  }
4317
- $this->errmsg = sprintf(__('Create Image failed. %1$s', 'nggallery'), $img_err);
4318
- $this->error = true;
4319
- } else {
4320
- $this->currentDimensions = array('width' => $image_size[0], 'height' => $image_size[1]);
4321
- $this->newImage = $this->oldImage;
4322
  }
4323
  }
4324
- if ($this->error == true) {
4325
- if (!$no_ErrorImage) {
4326
- $this->showErrorImage();
4327
- }
4328
- return;
4329
  }
 
4330
  }
4331
  /**
4332
- * Calculate the memory limit
4333
- * @param string $filename
4334
- *
 
 
4335
  */
4336
- function checkMemoryForImage($filename)
4337
  {
4338
- $imageInfo = getimagesize($filename);
4339
- switch ($this->format) {
4340
- case 'GIF':
4341
- // measured factor 1 is better
4342
- $CHANNEL = 1;
4343
- break;
4344
- case 'JPG':
4345
- $CHANNEL = $imageInfo['channels'];
4346
- break;
4347
- case 'PNG':
4348
- // didn't get the channel for png
4349
- $CHANNEL = 3;
4350
- break;
4351
  }
4352
- $bits = !empty($imageInfo['bits']) ? $imageInfo['bits'] : 32;
4353
- // imgInfo[bits] is not always available
4354
- return $this->checkMemoryForData($imageInfo[0], $imageInfo[1], $CHANNEL, $bits);
4355
  }
4356
- function checkMemoryForData($width, $height, $channels = null, $bits = null)
4357
  {
4358
- $imageInfo = getimagesize($this->fileName);
4359
- if ($channels == null) {
4360
- switch ($this->format) {
4361
- case 'GIF':
4362
- // measured factor 1 is better
4363
- $channels = 1;
4364
- break;
4365
- case 'JPG':
4366
- $channels = $imageInfo['channels'];
4367
- break;
4368
- case 'PNG':
4369
- // didn't get the channel for png
4370
- $channels = 3;
4371
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4372
  }
4373
  }
4374
- if ($bits == null) {
4375
- $bits = !empty($imageInfo['bits']) ? $imageInfo['bits'] : 32;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4376
  }
4377
- // imgInfo[bits] is not always available
4378
- if (function_exists('memory_get_usage') && ini_get('memory_limit')) {
4379
- $MB = 1048576;
4380
- // number of bytes in 1M
4381
- $K64 = 65536;
4382
- // number of bytes in 64K
4383
- $TWEAKFACTOR = 1.68;
4384
- // Or whatever works for you
4385
- $memoryNeeded = round((doubleval($width * $height * $bits * $channels) / 8 + $K64) * $TWEAKFACTOR);
4386
- $memoryNeeded = memory_get_usage() + $memoryNeeded;
4387
- // get memory limit
4388
- $memory_limit = ini_get('memory_limit');
4389
- // PHP docs : Note that to have no memory limit, set this directive to -1.
4390
- if ($memory_limit == -1) {
4391
- return true;
4392
  }
4393
- // Just check megabyte limits, not higher
4394
- if (strtolower(substr($memory_limit, -1)) == 'm') {
4395
- if ($memory_limit != '') {
4396
- $memory_limit = intval(substr($memory_limit, 0, -1)) * 1024 * 1024;
 
 
 
 
 
4397
  }
4398
- if ($memoryNeeded > $memory_limit) {
4399
- $memoryNeeded = round($memoryNeeded / 1024 / 1024, 2);
4400
- $this->errmsg = 'Exceed Memory limit. Require : ' . $memoryNeeded . " MByte";
4401
- $this->error = true;
4402
- return false;
4403
  }
4404
  }
 
 
 
 
 
 
 
 
 
 
 
 
4405
  }
4406
- return true;
4407
- }
4408
- function __destruct()
4409
- {
4410
- $this->destruct();
4411
  }
4412
- /**
4413
- * Must be called to free up allocated memory after all manipulations are done
4414
- *
4415
- */
4416
- function destruct()
4417
  {
4418
- if (is_resource($this->newImage)) {
4419
- @ImageDestroy($this->newImage);
4420
- }
4421
- if (is_resource($this->oldImage)) {
4422
- @ImageDestroy($this->oldImage);
 
 
 
 
 
4423
  }
4424
- if (is_resource($this->workingImage)) {
4425
- @ImageDestroy($this->workingImage);
 
 
 
 
 
 
 
 
 
 
 
4426
  }
 
4427
  }
4428
- /**
4429
- * Returns the current width of the image
4430
- *
4431
- * @return int
4432
- */
4433
- function getCurrentWidth()
4434
- {
4435
- return $this->currentDimensions['width'];
4436
- }
4437
- /**
4438
- * Returns the current height of the image
4439
- *
4440
- * @return int
4441
- */
4442
- function getCurrentHeight()
4443
- {
4444
- return $this->currentDimensions['height'];
4445
- }
4446
- /**
4447
- * Calculates new image width
4448
- *
4449
- * @param int $width
4450
- * @param int $height
4451
- * @return array
4452
- */
4453
- function calcWidth($width, $height)
4454
  {
4455
- $newWp = 100 * $this->maxWidth / $width;
4456
- $newHeight = $height * $newWp / 100;
4457
- if (intval($newHeight) == $this->maxHeight - 1) {
4458
- $newHeight = $this->maxHeight;
 
 
 
 
 
 
 
 
 
 
4459
  }
4460
- return array('newWidth' => intval($this->maxWidth), 'newHeight' => intval($newHeight));
4461
  }
4462
  /**
4463
- * Calculates new image height
4464
- *
4465
- * @param int $width
4466
- * @param int $height
4467
- * @return array
4468
  */
4469
- function calcHeight($width, $height)
4470
  {
4471
- $newHp = 100 * $this->maxHeight / $height;
4472
- $newWidth = $width * $newHp / 100;
4473
- if (intval($newWidth) == $this->maxWidth - 1) {
4474
- $newWidth = $this->maxWidth;
 
4475
  }
4476
- return array('newWidth' => intval($newWidth), 'newHeight' => intval($this->maxHeight));
 
4477
  }
4478
  /**
4479
- * Calculates new image size based on percentage
4480
- *
4481
- * @param int $width
4482
- * @param int $height
4483
  * @return array
4484
  */
4485
- function calcPercent($width, $height, $percent = -1)
4486
  {
4487
- if ($percent == -1) {
4488
- $percent = $this->percent;
 
4489
  }
4490
- $newWidth = $width * $percent / 100;
4491
- $newHeight = $height * $percent / 100;
4492
- return array('newWidth' => intval($newWidth), 'newHeight' => intval($newHeight));
4493
- }
4494
- /**
4495
- * Calculates new image size based on width and height, while constraining to maxWidth and maxHeight
4496
- *
4497
- * @param int $width
4498
- * @param int $height
4499
- */
4500
- function calcImageSize($width, $height)
4501
- {
4502
- // $width and $height are the CURRENT image resolutions
4503
- $ratio_w = $this->maxWidth / $width;
4504
- $ratio_h = $this->maxHeight / $height;
4505
- if ($ratio_w >= $ratio_h) {
4506
- $width = $this->maxWidth;
4507
- $height = (int) round($height * $ratio_h, 0);
4508
- } else {
4509
- $height = $this->maxHeight;
4510
- $width = (int) round($width * $ratio_w, 0);
4511
  }
4512
- $this->newDimensions = array('newWidth' => $width, 'newHeight' => $height);
4513
  }
4514
- /**
4515
- * Calculates new image size based percentage
4516
- *
4517
- * @param int $width
4518
- * @param int $height
4519
- */
4520
- function calcImageSizePercent($width, $height)
4521
  {
4522
- if ($this->percent > 0) {
4523
- $this->newDimensions = $this->calcPercent($width, $height);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4524
  }
 
4525
  }
4526
  /**
4527
- * Displays error image
4528
- *
 
 
4529
  */
4530
- function showErrorImage()
4531
  {
4532
- header('Content-type: image/png');
4533
- $errImg = ImageCreate(220, 25);
4534
- $bgColor = imagecolorallocate($errImg, 0, 0, 0);
4535
- $fgColor1 = imagecolorallocate($errImg, 255, 255, 255);
4536
- $fgColor2 = imagecolorallocate($errImg, 255, 0, 0);
4537
- imagestring($errImg, 3, 6, 6, 'Error:', $fgColor2);
4538
- imagestring($errImg, 3, 55, 6, $this->errmsg, $fgColor1);
4539
- imagepng($errImg);
4540
- imagedestroy($errImg);
4541
  }
4542
  /**
4543
- * Resizes image to fixed Width x Height
4544
- *
4545
- * @param int $Width
4546
- * @param int $Height
4547
- * @param int $deprecated Unused
4548
  */
4549
- function resizeFix($Width = 0, $Height = 0, $deprecated = 3)
4550
  {
4551
- if (!$this->checkMemoryForData($Width, $Height)) {
4552
- return;
4553
- }
4554
- $this->newWidth = $Width;
4555
- $this->newHeight = $Height;
4556
- if (function_exists("ImageCreateTrueColor")) {
4557
- $this->workingImage = ImageCreateTrueColor($this->newWidth, $this->newHeight);
4558
- } else {
4559
- $this->workingImage = ImageCreate($this->newWidth, $this->newHeight);
4560
- }
4561
- // ImageCopyResampled(
4562
- $this->imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, 0, 0, $this->newWidth, $this->newHeight, $this->currentDimensions['width'], $this->currentDimensions['height']);
4563
- $this->oldImage = $this->workingImage;
4564
- $this->newImage = $this->workingImage;
4565
- $this->currentDimensions['width'] = $this->newWidth;
4566
- $this->currentDimensions['height'] = $this->newHeight;
4567
  }
4568
  /**
4569
- * Resizes image to maxWidth x maxHeight
4570
- *
4571
- * @param int $maxWidth
4572
- * @param int $maxHeight
4573
- * @param int $deprecated Unused
4574
  */
4575
- function resize($maxWidth = 0, $maxHeight = 0, $deprecated = 3)
4576
  {
4577
- if (!$this->checkMemoryForData($maxWidth, $maxHeight)) {
4578
- return;
4579
- }
4580
- $this->maxWidth = $maxWidth;
4581
- $this->maxHeight = $maxHeight;
4582
- $this->calcImageSize($this->currentDimensions['width'], $this->currentDimensions['height']);
4583
- if ($this->workingImage != null && $this->workingImage != $this->oldImage) {
4584
- ImageDestroy($this->workingImage);
4585
- $this->workingImage = null;
4586
- }
4587
- if (function_exists("ImageCreateTrueColor")) {
4588
- $this->workingImage = ImageCreateTrueColor($this->newDimensions['newWidth'], $this->newDimensions['newHeight']);
4589
- } else {
4590
- $this->workingImage = ImageCreate($this->newDimensions['newWidth'], $this->newDimensions['newHeight']);
4591
- }
4592
- // ImageCopyResampled(
4593
- $this->imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, 0, 0, $this->newDimensions['newWidth'], $this->newDimensions['newHeight'], $this->currentDimensions['width'], $this->currentDimensions['height']);
4594
- ImageDestroy($this->oldImage);
4595
- $this->oldImage = $this->workingImage;
4596
- $this->newImage = $this->workingImage;
4597
- $this->currentDimensions['width'] = $this->newDimensions['newWidth'];
4598
- $this->currentDimensions['height'] = $this->newDimensions['newHeight'];
4599
  }
4600
  /**
4601
- * Resizes the image by $percent percent
4602
- *
4603
- * @param int $percent
 
4604
  */
4605
- function resizePercent($percent = 0)
4606
  {
4607
- $dims = $this->calcPercent($this->currentDimensions['width'], $this->currentDimensions['height'], $percent);
4608
- if (!$this->checkMemoryForData($dims['newWidth'], $dims['newHeight'])) {
4609
- return;
4610
- }
4611
- $this->percent = $percent;
4612
- $this->calcImageSizePercent($this->currentDimensions['width'], $this->currentDimensions['height']);
4613
- if (function_exists("ImageCreateTrueColor")) {
4614
- $this->workingImage = ImageCreateTrueColor($this->newDimensions['newWidth'], $this->newDimensions['newHeight']);
4615
- } else {
4616
- $this->workingImage = ImageCreate($this->newDimensions['newWidth'], $this->newDimensions['newHeight']);
4617
- }
4618
- $this->ImageCopyResampled($this->workingImage, $this->oldImage, 0, 0, 0, 0, $this->newDimensions['newWidth'], $this->newDimensions['newHeight'], $this->currentDimensions['width'], $this->currentDimensions['height']);
4619
- $this->oldImage = $this->workingImage;
4620
- $this->newImage = $this->workingImage;
4621
- $this->currentDimensions['width'] = $this->newDimensions['newWidth'];
4622
- $this->currentDimensions['height'] = $this->newDimensions['newHeight'];
4623
  }
4624
  /**
4625
- * Crops the image from calculated center in a square of $cropSize pixels
4626
- *
4627
- * @param int $cropSize
4628
  */
4629
- function cropFromCenter($cropSize)
4630
  {
4631
- if ($cropSize > $this->currentDimensions['width']) {
4632
- $cropSize = $this->currentDimensions['width'];
4633
- }
4634
- if ($cropSize > $this->currentDimensions['height']) {
4635
- $cropSize = $this->currentDimensions['height'];
4636
- }
4637
- $cropX = intval(($this->currentDimensions['width'] - $cropSize) / 2);
4638
- $cropY = intval(($this->currentDimensions['height'] - $cropSize) / 2);
4639
- if ($this->workingImage != null && $this->workingImage != $this->oldImage) {
4640
- ImageDestroy($this->workingImage);
4641
- $this->workingImage = null;
4642
  }
4643
- if (function_exists("ImageCreateTrueColor")) {
4644
- $this->workingImage = ImageCreateTrueColor($cropSize, $cropSize);
4645
- } else {
4646
- $this->workingImage = ImageCreate($cropSize, $cropSize);
4647
  }
4648
- $this->imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, $cropX, $cropY, $cropSize, $cropSize, $cropSize, $cropSize);
4649
- $this->oldImage = $this->workingImage;
4650
- $this->newImage = $this->workingImage;
4651
- $this->currentDimensions['width'] = $cropSize;
4652
- $this->currentDimensions['height'] = $cropSize;
4653
  }
4654
  /**
4655
- * Advanced cropping function that crops an image using $startX and $startY as the upper-left hand corner.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4656
  *
4657
- * @param int $startX
4658
- * @param int $startY
4659
- * @param int $width
4660
- * @param int $height
4661
  */
4662
- function crop($startX, $startY, $width, $height)
4663
  {
4664
- if (!$this->checkMemoryForData($width, $height)) {
4665
- return;
4666
- }
4667
- //make sure the cropped area is not greater than the size of the image
4668
- if ($width > $this->currentDimensions['width']) {
4669
- $width = $this->currentDimensions['width'];
4670
- }
4671
- if ($height > $this->currentDimensions['height']) {
4672
- $height = $this->currentDimensions['height'];
4673
- }
4674
- //make sure not starting outside the image
4675
- if ($startX + $width > $this->currentDimensions['width']) {
4676
- $startX = $this->currentDimensions['width'] - $width;
4677
- }
4678
- if ($startY + $height > $this->currentDimensions['height']) {
4679
- $startY = $this->currentDimensions['height'] - $height;
4680
  }
4681
- if ($startX < 0) {
4682
- $startX = 0;
 
 
 
 
 
 
 
 
4683
  }
4684
- if ($startY < 0) {
4685
- $startY = 0;
 
 
 
 
 
 
 
 
 
4686
  }
4687
- if ($this->workingImage != null && $this->workingImage != $this->oldImage) {
4688
- ImageDestroy($this->workingImage);
4689
- $this->workingImage = null;
 
 
 
 
4690
  }
4691
- if (function_exists("ImageCreateTrueColor")) {
4692
- $this->workingImage = ImageCreateTrueColor($width, $height);
4693
- } else {
4694
- $this->workingImage = ImageCreate($width, $height);
4695
  }
4696
- $this->imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, $startX, $startY, $width, $height, $width, $height);
4697
- ImageDestroy($this->oldImage);
4698
- $this->oldImage = $this->workingImage;
4699
- $this->newImage = $this->workingImage;
4700
- $this->currentDimensions['width'] = $width;
4701
- $this->currentDimensions['height'] = $height;
4702
  }
4703
  /**
4704
- * Outputs the image to the screen, or saves to $name if supplied. Quality of JPEG images can be controlled with the $quality variable
4705
  *
4706
- * @param int $quality
4707
- * @param string $name
4708
  */
4709
- function show($quality = 100, $name = '')
4710
  {
4711
- switch ($this->format) {
4712
- case 'GIF':
4713
- if ($name != '') {
4714
- @ImageGif($this->newImage, $name) or $this->error = true;
4715
- } else {
4716
- header('Content-type: image/gif');
4717
- ImageGif($this->newImage);
4718
- }
4719
- break;
4720
- case 'JPG':
4721
- if ($name != '') {
4722
- @ImageJpeg($this->newImage, $name, $quality) or $this->error = true;
4723
- } else {
4724
- header('Content-type: image/jpeg');
4725
- ImageJpeg($this->newImage, NULL, $quality);
4726
- }
4727
- break;
4728
- case 'PNG':
4729
- if ($name != '') {
4730
- @ImagePng($this->newImage, $name) or $this->error = true;
4731
- } else {
4732
- header('Content-type: image/png');
4733
- ImagePng($this->newImage);
4734
  }
4735
- break;
 
 
 
 
 
 
 
 
 
 
4736
  }
 
4737
  }
4738
- /**
4739
- * Saves image as $name (can include file path), with quality of # percent if file is a jpeg
4740
- *
4741
- * @param string $name
4742
- * @param int $quality
4743
- * @return bool errorstate
4744
- */
4745
- function save($name, $quality = 100)
4746
  {
4747
- $this->show($quality, $name);
4748
- if ($this->error == true) {
4749
- $this->errmsg = 'Create Image failed. Check safe mode settings';
4750
- return false;
4751
- }
4752
- if (function_exists('do_action')) {
4753
- do_action('ngg_ajax_image_save', $name);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4754
  }
4755
- return true;
4756
  }
4757
  /**
4758
- * Creates Apple-style reflection under image, optionally adding a border to main image
4759
- *
4760
- * @param int $percent
4761
- * @param int $reflection
4762
- * @param int $white
4763
- * @param bool $border
4764
- * @param string $borderColor
4765
  */
4766
- function createReflection($percent, $reflection, $white, $border = true, $borderColor = '#a4a4a4')
4767
  {
4768
- $width = $this->currentDimensions['width'];
4769
- $height = $this->currentDimensions['height'];
4770
- $reflectionHeight = intval($height * ($reflection / 100));
4771
- $newHeight = $height + $reflectionHeight;
4772
- $reflectedPart = $height * ($percent / 100);
4773
- $this->workingImage = ImageCreateTrueColor($width, $newHeight);
4774
- ImageAlphaBlending($this->workingImage, true);
4775
- $colorToPaint = ImageColorAllocateAlpha($this->workingImage, 255, 255, 255, 0);
4776
- ImageFilledRectangle($this->workingImage, 0, 0, $width, $newHeight, $colorToPaint);
4777
- imagecopyresampled($this->workingImage, $this->newImage, 0, 0, 0, $reflectedPart, $width, $reflectionHeight, $width, $height - $reflectedPart);
4778
- $this->imageFlipVertical();
4779
- imagecopy($this->workingImage, $this->newImage, 0, 0, 0, 0, $width, $height);
4780
- imagealphablending($this->workingImage, true);
4781
- for ($i = 0; $i < $reflectionHeight; $i++) {
4782
- $colorToPaint = imagecolorallocatealpha($this->workingImage, 255, 255, 255, ($i / $reflectionHeight * -1 + 1) * $white);
4783
- imagefilledrectangle($this->workingImage, 0, $height + $i, $width, $height + $i, $colorToPaint);
4784
  }
4785
- if ($border == true) {
4786
- $rgb = $this->hex2rgb($borderColor, false);
4787
- $colorToPaint = imagecolorallocate($this->workingImage, $rgb[0], $rgb[1], $rgb[2]);
4788
- imageline($this->workingImage, 0, 0, $width, 0, $colorToPaint);
4789
- //top line
4790
- imageline($this->workingImage, 0, $height, $width, $height, $colorToPaint);
4791
- //bottom line
4792
- imageline($this->workingImage, 0, 0, 0, $height, $colorToPaint);
4793
- //left line
4794
- imageline($this->workingImage, $width - 1, 0, $width - 1, $height, $colorToPaint);
4795
- //right line
 
 
 
 
 
 
 
 
4796
  }
4797
- $this->oldImage = $this->workingImage;
4798
- $this->newImage = $this->workingImage;
4799
- $this->currentDimensions['width'] = $width;
4800
- $this->currentDimensions['height'] = $newHeight;
4801
  }
4802
- /**
4803
- * Flip an image.
4804
- *
4805
- * @param bool $horz flip the image in horizontal mode
4806
- * @param bool $vert flip the image in vertical mode
4807
- * @return true
4808
- */
4809
- function flipImage($horz = false, $vert = false)
4810
  {
4811
- $sx = $vert ? $this->currentDimensions['width'] - 1 : 0;
4812
- $sy = $horz ? $this->currentDimensions['height'] - 1 : 0;
4813
- $sw = $vert ? -$this->currentDimensions['width'] : $this->currentDimensions['width'];
4814
- $sh = $horz ? -$this->currentDimensions['height'] : $this->currentDimensions['height'];
4815
- $this->workingImage = imagecreatetruecolor($this->currentDimensions['width'], $this->currentDimensions['height']);
4816
- $this->imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, $sx, $sy, $this->currentDimensions['width'], $this->currentDimensions['height'], $sw, $sh);
4817
- $this->oldImage = $this->workingImage;
4818
- $this->newImage = $this->workingImage;
4819
- return true;
4820
  }
4821
- /**
4822
- * Rotate an image clockwise or counter clockwise
4823
- *
4824
- * @param string $dir Either CW or CCW
4825
- * @return bool
4826
- */
4827
- function rotateImage($dir = 'CW')
4828
  {
4829
- $angle = $dir == 'CW' ? 90 : -90;
4830
- return $this->rotateImageAngle($angle);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4831
  }
4832
  /**
4833
- * Rotate an image clockwise or counter clockwise
4834
  *
4835
- * @param int $angle Degrees to rotate the target image
4836
- * @return bool
4837
  */
4838
- function rotateImageAngle($angle = 90)
4839
  {
4840
- if (function_exists('imagerotate')) {
4841
- $this->workingImage = imagerotate($this->oldImage, 360 - $angle, 0);
4842
- // imagerotate() rotates CCW
4843
- $this->currentDimensions['width'] = imagesx($this->workingImage);
4844
- $this->currentDimensions['height'] = imagesy($this->workingImage);
4845
- $this->oldIm
70
  {
71
  return new C_Album($properties, $mapper, $context);
72
  }
 
 
 
 
 
 
 
 
73
  function gallery_storage($context = FALSE)
74
  {
75
  return new C_Gallery_Storage($context);
228
  }
229
  }
230
  }
231
+ class Mixin_Dynamic_Thumbnails_Manager extends Mixin
232
+ {
233
+ function get_route_name()
234
+ {
235
+ return C_NextGen_Settings::get_instance()->get('dynamic_thumbnail_slug');
236
+ }
237
+ function _get_params_sanitized($params)
238
+ {
239
+ if (isset($params['rotation'])) {
240
+ $rotation = intval($params['rotation']);
241
+ if ($rotation && in_array(abs($rotation), array(90, 180, 270))) {
242
+ $rotation = $rotation % 360;
243
+ if ($rotation < 0) {
244
+ $rotation = 360 - $rotation;
245
+ }
246
+ $params['rotation'] = $rotation;
247
+ } else {
248
+ unset($params['rotation']);
249
+ }
250
+ }
251
+ if (isset($params['flip'])) {
252
+ $flip = strtolower($params['flip']);
253
+ if (in_array($flip, array('h', 'v', 'hv'))) {
254
+ $params['flip'] = $flip;
255
+ } else {
256
+ unset($params['flip']);
257
+ }
258
+ }
259
+ return $params;
260
+ }
261
+ function get_uri_from_params($params)
262
+ {
263
+ $params = $this->object->_get_params_sanitized($params);
264
+ $image = isset($params['image']) ? $params['image'] : null;
265
+ $image_id = is_scalar($image) || is_null($image) ? (int) $image : $image->pid;
266
+ $image_width = isset($params['width']) ? $params['width'] : null;
267
+ $image_height = isset($params['height']) ? $params['height'] : null;
268
+ $image_quality = isset($params['quality']) ? $params['quality'] : null;
269
+ $image_type = isset($params['type']) ? $params['type'] : null;
270
+ $image_crop = isset($params['crop']) ? $params['crop'] : null;
271
+ $image_watermark = isset($params['watermark']) ? $params['watermark'] : null;
272
+ $image_rotation = isset($params['rotation']) ? $params['rotation'] : null;
273
+ $image_flip = isset($params['flip']) ? $params['flip'] : null;
274
+ $image_reflection = isset($params['reflection']) ? $params['reflection'] : null;
275
+ $uri = null;
276
+ $uri .= '/';
277
+ $uri .= $this->object->get_route_name() . '/';
278
+ $uri .= strval($image_id) . '/';
279
+ $uri .= strval($image_width) . 'x' . strval($image_height);
280
+ if ($image_quality != null) {
281
+ $uri .= 'x' . strval($image_quality);
282
+ }
283
+ $uri .= '/';
284
+ if ($image_type != null) {
285
+ $uri .= $image_type . '/';
286
+ }
287
+ if ($image_crop) {
288
+ $uri .= 'crop/';
289
+ }
290
+ if ($image_watermark) {
291
+ $uri .= 'watermark/';
292
+ }
293
+ if ($image_rotation) {
294
+ $uri .= 'rotation-' . $image_rotation . '/';
295
+ }
296
+ if ($image_flip) {
297
+ $uri .= 'flip-' . $image_flip . '/';
298
+ }
299
+ if ($image_reflection) {
300
+ $uri .= 'reflection/';
301
+ }
302
+ return $uri;
303
+ }
304
+ function get_image_uri($image, $params)
305
+ {
306
+ $params['image'] = $image;
307
+ $uri = $this->object->get_uri_from_params($params);
308
+ if (substr($uri, -1) != '/') {
309
+ $uri .= '/';
310
+ }
311
+ $uri .= wp_hash($uri) . '/';
312
+ return $uri;
313
+ }
314
+ function get_image_url($image, $params)
315
+ {
316
+ return C_Router::get_instance()->get_url($this->object->get_image_uri($image, $params), FALSE, 'root');
317
+ }
318
+ function get_params_from_uri($uri)
319
+ {
320
+ $regex = '/\\/?' . $this->object->get_route_name() . '\\/(\\d+)(?:\\/(.*))?/';
321
+ $match = null;
322
+ // XXX move this URL clean up to I_Router?
323
+ $uri = preg_replace('/\\/index.php\\//', '/', $uri, 1);
324
+ $uri = trim($uri, '/');
325
+ if (@preg_match($regex, $uri, $match) > 0) {
326
+ $image_id = $match[1];
327
+ $uri_args = isset($match[2]) ? explode('/', $match[2]) : array();
328
+ $params = array('image' => $image_id);
329
+ foreach ($uri_args as $uri_arg) {
330
+ $uri_arg_set = explode('-', $uri_arg);
331
+ $uri_arg_name = array_shift($uri_arg_set);
332
+ $uri_arg_value = $uri_arg_set ? array_shift($uri_arg_set) : null;
333
+ $size_match = null;
334
+ if ($uri_arg == 'watermark') {
335
+ $params['watermark'] = true;
336
+ } else {
337
+ if ($uri_arg_name == 'rotation') {
338
+ $params['rotation'] = $uri_arg_value;
339
+ } else {
340
+ if ($uri_arg_name == 'flip') {
341
+ $params['flip'] = $uri_arg_value;
342
+ } else {
343
+ if ($uri_arg == 'reflection') {
344
+ $params['reflection'] = true;
345
+ } else {
346
+ if ($uri_arg == 'crop') {
347
+ $params['crop'] = true;
348
+ } else {
349
+ if (in_array(strtolower($uri_arg), array('gif', 'jpg', 'png'))) {
350
+ $params['type'] = $uri_arg;
351
+ } else {
352
+ if (preg_match('/(\\d+)x(\\d+)(?:x(\\d+))?/i', $uri_arg, $size_match) > 0) {
353
+ $params['width'] = $size_match[1];
354
+ $params['height'] = $size_match[2];
355
+ if (isset($size_match[3])) {
356
+ $params['quality'] = $size_match[3];
357
+ }
358
+ }
359
+ }
360
+ }
361
+ }
362
+ }
363
+ }
364
+ }
365
+ }
366
+ return $this->object->_get_params_sanitized($params);
367
+ }
368
+ return null;
369
+ }
370
+ function _get_name_prefix_list()
371
+ {
372
+ return array('id' => 'nggid0', 'size' => 'ngg0dyn-', 'flags' => '00f0', 'flag' => array('w0' => 'watermark', 'c0' => 'crop', 'r1' => 'rotation', 'f1' => 'flip', 'r0' => 'reflection', 't0' => 'type'), 'flag_len' => 2, 'max_value_length' => 15);
373
+ }
374
+ function get_name_from_params($params, $only_size_name = false, $id_in_name = true)
375
+ {
376
+ $prefix_list = $this->object->_get_name_prefix_list();
377
+ $id_prefix = $prefix_list['id'];
378
+ $size_prefix = $prefix_list['size'];
379
+ $flags_prefix = $prefix_list['flags'];
380
+ $flags = $prefix_list['flag'];
381
+ $max_value_length = $prefix_list['max_value_length'];
382
+ $params = $this->object->_get_params_sanitized($params);
383
+ $image = isset($params['image']) ? $params['image'] : null;
384
+ $image_width = isset($params['width']) ? $params['width'] : null;
385
+ $image_height = isset($params['height']) ? $params['height'] : null;
386
+ $image_quality = isset($params['quality']) ? $params['quality'] : null;
387
+ $extension = null;
388
+ $name = null;
389
+ // if $only_size_name is false then we include the file name and image id for the image
390
+ if (!$only_size_name) {
391
+ if (is_int($image)) {
392
+ $imap = C_Image_Mapper::get_instance();
393
+ $image = $imap->find($image);
394
+ }
395
+ if ($image != null) {
396
+ // this is used to remove the extension and then add it back at the end of the name
397
+ $extension = M_I18n::mb_pathinfo($image->filename, PATHINFO_EXTENSION);
398
+ if ($extension != null) {
399
+ $extension = '.' . $extension;
400
+ }
401
+ $name .= M_I18n::mb_basename($image->filename);
402
+ $name .= '-';
403
+ if ($id_in_name) {
404
+ $image_id = strval($image->pid);
405
+ $id_len = min($max_value_length, strlen($image_id));
406
+ $id_len_hex = dechex($id_len);
407
+ // sanity check, should never occurr if $max_value_length is not messed up, ensure only 1 character is used to encode length or else skip parameter
408
+ if (strlen($id_len_hex) == 1) {
409
+ $name .= $id_prefix . $id_len . substr($image_id, 0, $id_len);
410
+ $name .= '-';
411
+ }
412
+ }
413
+ }
414
+ }
415
+ $name .= $size_prefix;
416
+ $name .= strval($image_width) . 'x' . strval($image_height);
417
+ if ($image_quality != null) {
418
+ $name .= 'x' . $image_quality;
419
+ }
420
+ $name .= '-';
421
+ $name .= $flags_prefix;
422
+ foreach ($flags as $flag_prefix => $flag_name) {
423
+ $flag_value = 0;
424
+ if (isset($params[$flag_name])) {
425
+ $flag_value = $params[$flag_name];
426
+ if (!is_string($flag_value)) {
427
+ // only strings or ints allowed, sprintf is required because intval(0) returns '' and not '0'
428
+ $flag_value = intval($flag_value);
429
+ $flag_value = sprintf('%d', $flag_value);
430
+ }
431
+ }
432
+ $flag_value = strval($flag_value);
433
+ $flag_len = min($max_value_length, strlen($flag_value));
434
+ $flag_len_hex = dechex($flag_len);
435
+ // sanity check, should never occurr if $max_value_length is not messed up, ensure only 1 character is used to encode length or else skip parameter
436
+ if (strlen($flag_len_hex) == 1) {
437
+ $name .= $flag_prefix . $flag_len . substr($flag_value, 0, $flag_len);
438
+ }
439
+ }
440
+ $name .= $extension;
441
+ return $name;
442
+ }
443
+ function get_size_name($params)
444
+ {
445
+ $name = $this->object->get_name_from_params($params, true);
446
+ return $name;
447
+ }
448
+ function get_image_name($image, $params)
449
+ {
450
+ $params['image'] = $image;
451
+ $name = $this->object->get_name_from_params($params);
452
+ return $name;
453
+ }
454
+ function get_params_from_name($name, $is_only_size_name = false)
455
+ {
456
+ $prefix_list = $this->object->_get_name_prefix_list();
457
+ $id_prefix = $prefix_list['id'];
458
+ $size_prefix = $prefix_list['size'];
459
+ $flags_prefix = $prefix_list['flags'];
460
+ $max_value_length = $prefix_list['max_value_length'];
461
+ $size_name = null;
462
+ $id_name = null;
463
+ $params = array();
464
+ if (!$is_only_size_name) {
465
+ $extension = M_I18n::mb_pathinfo($name, PATHINFO_EXTENSION);
466
+ if ($extension != null) {
467
+ $extension = '.' . $extension;
468
+ }
469
+ $name = M_I18n::mb_basename($name);
470
+ }
471
+ $size_index = strrpos($name, $size_prefix);
472
+ if ($size_index > 0 || $size_index === 0) {
473
+ // check if name contains dynamic size/params info by looking for prefix
474
+ $size_name = substr($name, $size_index);
475
+ }
476
+ if (!$is_only_size_name) {
477
+ // name should contain the image id, search for prefix
478
+ $id_index = strrpos($name, $id_prefix);
479
+ if ($id_index > 0 || $id_index === 0) {
480
+ if ($size_index > 0 && $size_index > $id_index) {
481
+ $id_name = substr($name, $id_index, $size_index - $id_index);
482
+ } else {
483
+ $id_name = substr($name, $id_index);
484
+ }
485
+ }
486
+ }
487
+ // Double check we got a correct dynamic size/params string
488
+ if (substr($size_name, 0, strlen($size_prefix)) == $size_prefix) {
489
+ $flags = $prefix_list['flag'];
490
+ // get the length of the flag id (the key in the $flags array) in the string (how many characters to consume)
491
+ $flag_id_len = $prefix_list['flag_len'];
492
+ $params_str = substr($size_name, strlen($size_prefix));
493
+ $params_parts = explode('-', $params_str);
494
+ // $param_part is a single param, separated by '-'
495
+ foreach ($params_parts as $param_part) {
496
+ // Parse WxHxQ - Q=quality
497
+ $param_size = explode('x', $param_part);
498
+ $param_size_count = count($param_size);
499
+ if (substr($param_part, 0, strlen($flags_prefix)) == $flags_prefix) {
500
+ /* Set flags, using $flags keys as prefixes */
501
+ // move string pointer up (after the main flags prefix)
502
+ $param_flags = substr($param_part, strlen($flags_prefix));
503
+ $param_flags_len = strlen($param_flags);
504
+ $flags_todo = $flags;
505
+ while (true) {
506
+ // ensure we don't run into an infinite loop ;)
507
+ if (count($flags_todo) == 0 || strlen($param_flags) == 0) {
508
+ break;
509
+ }
510
+ // get the flag prefix (a key in the $flags array) using flag id length
511
+ $flag_prefix = substr($param_flags, 0, $flag_id_len);
512
+ // move string pointer up (after the single flag prefix)
513
+ $param_flags = substr($param_flags, $flag_id_len);
514
+ // get the length of the flag value in the string (how many characters to consume)
515
+ // flag value length is stored in a single hexadecimal character next to the flag prefix
516
+ $flag_value_len = min(hexdec(substr($param_flags, 0, 1)), min($max_value_length, strlen($param_flags) - 1));
517
+ // get the flag value
518
+ $flag_value = substr($param_flags, 1, $flag_value_len);
519
+ // move string pointer up (after the entire flag)
520
+ $param_flags = substr($param_flags, $flag_value_len + 1);
521
+ // make sure the flag is supported
522
+ if (isset($flags[$flag_prefix])) {
523
+ $flag_name = $flags[$flag_prefix];
524
+ if (is_numeric($flag_value)) {
525
+ // convert numerical flags to integers
526
+ $flag_value = intval($flag_value);
527
+ }
528
+ $params[$flag_name] = $flag_value;
529
+ if (isset($flags_todo[$flag_prefix])) {
530
+ unset($flags_todo[$flag_prefix]);
531
+ }
532
+ } else {
533
+ // XXX unknown flag?
534
+ }
535
+ }
536
+ } else {
537
+ if ($param_size_count == 2 || $param_size_count == 3) {
538
+ // Set W H Q
539
+ $params['width'] = intval($param_size[0]);
540
+ $params['height'] = intval($param_size[1]);
541
+ if (isset($param_size[2]) && intval($param_size[2]) > 0) {
542
+ $params['quality'] = intval($param_size[2]);
543
+ }
544
+ }
545
+ }
546
+ }
547
+ }
548
+ // Double check we got a correct id string
549
+ if (substr($id_name, 0, strlen($id_prefix)) == $id_prefix) {
550
+ // move string pointer up (after the prefix)
551
+ $id_name = substr($id_name, strlen($id_prefix));
552
+ // get the length of the image id in the string (how many characters to consume)
553
+ $id_len = min(hexdec(substr($id_name, 0, 1)), min($max_value_length, strlen($id_name) - 1));
554
+ // get the id based on old position and id length
555
+ $image_id = intval(substr($id_name, 1, $id_len));
556
+ if ($image_id > 0) {
557
+ $params['image'] = $image_id;
558
+ }
559
+ }
560
+ return $this->object->_get_params_sanitized($params);
561
+ }
562
+ function is_size_dynamic($name, $is_only_size_name = false)
563
+ {
564
+ $params = $this->object->get_params_from_name($name, $is_only_size_name);
565
+ if (isset($params['width']) && isset($params['height'])) {
566
+ return true;
567
+ }
568
+ return false;
569
+ }
570
+ }
571
+ /**
572
+ * Class C_Dynamic_Thumbnails_Manager
573
+ * @mixin Mixin_Dynamic_Thumbnails_Manager
574
+ */
575
+ class C_Dynamic_Thumbnails_Manager extends C_Component
576
+ {
577
+ static $_instances = array();
578
+ function define($context = FALSE)
579
+ {
580
+ parent::define($context);
581
+ $this->implement('I_Dynamic_Thumbnails_Manager');
582
+ $this->add_mixin('Mixin_Dynamic_Thumbnails_Manager');
583
+ }
584
+ /**
585
+ * @param bool|string $context
586
+ * @return C_Dynamic_Thumbnails_Manager
587
+ */
588
+ static function get_instance($context = False)
589
+ {
590
+ if (!isset(self::$_instances[$context])) {
591
+ self::$_instances[$context] = new C_Dynamic_Thumbnails_Manager($context);
592
+ }
593
+ return self::$_instances[$context];
594
+ }
595
+ }
596
  class C_Exif_Writer_Wrapper
597
  {
598
  // Because our C_Exif_Writer class relies on PEL (a library which uses namespaces) we wrap
666
  }
667
  }
668
  // Set what will be the path to the gallery
669
+ $storage = C_Gallery_Storage::get_instance();
670
  if (!$this->object->path) {
671
+ $this->object->path = $storage->get_gallery_relpath($this->object);
 
 
 
 
 
672
  }
673
  // Ensure that the gallery path is restricted to $fs->get_document_root('galleries')
674
  $fs = C_Fs::get_instance();
675
  $root = $fs->get_document_root('galleries');
676
+ $storage->flush_gallery_path_cache($this->object);
677
+ $gallery_abspath = $storage->get_gallery_abspath($this->object);
 
 
 
678
  if (strpos($gallery_abspath, $root) === FALSE) {
679
  $this->object->add_error(sprintf(__("Gallery path must be located in %s", 'nggallery'), $root), 'gallerypath');
680
  $this->object->path = $storage->get_upload_relpath($this->object);
688
  // Establish some rules on where galleries can go
689
  $abspath = $storage->get_gallery_abspath($this->object);
690
  // Galleries should at least be a sub-folder, not directly in WP_CONTENT
691
+ $not_directly_in = array('content' => wp_normalize_path(WP_CONTENT_DIR), 'wordpress root' => $fs->get_document_root());
692
  if (!empty($_SERVER['DOCUMENT_ROOT'])) {
693
  $not_directly_in['document root'] = $_SERVER['DOCUMENT_ROOT'];
694
  }
697
  $this->object->add_error(sprintf(__("Gallery path must be a sub-directory under the %s directory", 'nggallery'), $label), 'gallerypath');
698
  }
699
  }
700
+ $ABSPATH = wp_normalize_path(ABSPATH);
701
  // Disallow galleries from being under these directories at all
702
+ $not_ever_in = array('plugins' => wp_normalize_path(WP_PLUGIN_DIR), 'must use plugins' => wp_normalize_path(WPMU_PLUGIN_DIR), 'wp-admin' => $fs->join_paths($ABSPATH, 'wp-admin'), 'wp-includes' => $fs->join_paths($ABSPATH, 'wp-admin'), 'themes' => get_theme_root());
703
  foreach ($not_ever_in as $label => $dir) {
704
  if (strpos($abspath, $dir) === 0) {
705
  $this->object->add_error(sprintf(__("Gallery path cannot be under %s directory", 'nggallery'), $label), 'gallerypath');
807
  */
808
  public static function get_instance($context = False)
809
  {
810
+ if (!self::$_instance) {
811
  $klass = get_class();
812
  self::$_instance = new $klass($context);
813
  }
936
  $this->object->_set_default_value($entity, 'author', get_current_user_id());
937
  }
938
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
939
  class E_UploadException extends E_NggErrorException
940
  {
941
  function __construct($message = '', $code = NULL, $previous = NULL)
995
  }
996
  }
997
  }
998
+ /**
999
+ * Class C_Gallery_Storage
1000
+ * @implements I_Gallery_Storage
1001
+ * @mixin Mixin_GalleryStorage_Base
1002
+ * @mixin Mixin_GalleryStorage_Base_Dynamic
1003
+ * @mixin Mixin_GalleryStorage_Base_Getters
1004
+ * @mixin Mixin_GalleryStorage_Base_Management
1005
+ * @mixin Mixin_GalleryStorage_Base_MediaLibrary
1006
+ * @mixin Mixin_GalleryStorage_Base_Upload
1007
+ */
1008
+ class C_Gallery_Storage extends C_Component
1009
  {
1010
+ public static $_instances = array();
1011
+ function define($context = FALSE)
 
 
 
 
 
 
 
1012
  {
1013
+ parent::define($context);
1014
+ $this->add_mixin('Mixin_GalleryStorage_Base');
1015
+ $this->add_mixin('Mixin_GalleryStorage_Base_Dynamic');
1016
+ $this->add_mixin('Mixin_GalleryStorage_Base_Getters');
1017
+ $this->add_mixin('Mixin_GalleryStorage_Base_Management');
1018
+ $this->add_mixin('Mixin_GalleryStorage_Base_MediaLibrary');
1019
+ $this->add_mixin('Mixin_GalleryStorage_Base_Upload');
1020
+ $this->implement('I_Gallery_Storage');
1021
+ $this->implement('I_GalleryStorage_Driver');
1022
+ // backwards compatibility
1023
  }
1024
  /**
1025
+ * Provides some aliases to defined methods; thanks to this a call to C_Gallery_Storage->get_thumb_url() is
1026
+ * translated to C_Gallery_Storage->get_image_url('thumb').
1027
+ * TODO: Remove this 'magic' method so that our code is always understandable without needing deep context
1028
+ * @param string $method
1029
+ * @param array $args
1030
+ * @return mixed
1031
+ * @throws Exception
1032
  */
1033
+ function __call($method, $args)
1034
  {
1035
+ if (preg_match("/^get_(\\w+)_(abspath|url|dimensions|html|size_params)\$/", $method, $match)) {
1036
+ if (isset($match[1]) && isset($match[2]) && !$this->has_method($method)) {
1037
+ $method = 'get_image_' . $match[2];
1038
+ $args[] = $match[1];
1039
+ return parent::__call($method, $args);
1040
  }
 
 
1041
  }
1042
+ return parent::__call($method, $args);
1043
  }
1044
  /**
1045
+ * For compatibility reasons, we include this method. This used to be used to get the underlying storage driver.
1046
+ * Necessary for Imagify integration
 
 
1047
  */
1048
+ function &get_wrapped_instance()
 
 
 
 
 
 
 
 
 
 
 
 
 
1049
  {
1050
+ return $this;
 
 
1051
  }
1052
+ function initialize()
1053
  {
1054
+ parent::initialize();
1055
+ $this->_gallery_mapper = C_Gallery_Mapper::get_instance();
1056
+ $this->_image_mapper = C_Image_Mapper::get_instance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1057
  }
1058
  /**
1059
+ * @param bool|string $context
1060
+ * @return C_Gallery_Storage
 
 
1061
  */
1062
+ static function get_instance($context = False)
1063
  {
1064
+ if (!isset(self::$_instances[$context])) {
1065
+ self::$_instances[$context] = new C_Gallery_Storage($context);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1066
  }
1067
+ return self::$_instances[$context];
1068
  }
1069
+ }
1070
+ class Mixin_NextGen_Gallery_Image_Validation extends Mixin
1071
+ {
1072
+ function validation()
 
 
 
 
 
1073
  {
1074
+ // Additional checks...
1075
+ if (isset($this->object->description)) {
1076
+ $this->object->description = M_NextGen_Data::strip_html($this->object->description, TRUE);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1077
  }
1078
+ if (isset($this->object->alttext)) {
1079
+ $this->object->alttext = M_NextGen_Data::strip_html($this->object->alttext, TRUE);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1080
  }
1081
+ $this->validates_presence_of('galleryid', 'filename', 'alttext', 'exclude', 'sortorder', 'imagedate');
1082
+ $this->validates_numericality_of('galleryid');
1083
+ $this->validates_numericality_of($this->id());
1084
+ $this->validates_numericality_of('sortorder');
1085
+ $this->validates_length_of('filename', 185, '<=', __('Image filenames may not be longer than 185 characters in length', 'nextgen-gallery'));
1086
+ return $this->object->is_valid();
1087
  }
1088
+ }
1089
+ /**
1090
+ * Model for NextGen Gallery Images
1091
+ * @mixin Mixin_NextGen_Gallery_Image_Validation
1092
+ * @implements I_Image
1093
+ */
1094
+ class C_Image extends C_DataMapper_Model
1095
+ {
1096
+ var $_mapper_interface = 'I_Image_Mapper';
1097
+ function define($properties = array(), $mapper = FALSE, $context = FALSE)
1098
  {
1099
+ parent::define($mapper, $properties, $context);
1100
+ $this->add_mixin('Mixin_NextGen_Gallery_Image_Validation');
1101
+ $this->implement('I_Image');
1102
  }
1103
  /**
1104
+ * Instantiates a new model
1105
+ * @param array|stdClass $properties (optional)
1106
+ * @param C_Image_Mapper|false $mapper (optional)
1107
+ * @param string|false $context (optional)
 
 
1108
  */
1109
+ function initialize($properties = array(), $mapper = FALSE, $context = FALSE)
1110
  {
1111
+ if (!$mapper) {
1112
+ $mapper = $this->get_registry()->get_utility($this->_mapper_interface);
 
 
 
 
 
 
 
1113
  }
1114
+ parent::initialize($mapper, $properties);
1115
  }
1116
  /**
1117
+ * Returns the model representing the gallery associated with this image
1118
+ * @param object|false $model (optional)
1119
+ * @return C_Gallery|object
1120
  */
1121
+ function get_gallery($model = FALSE)
1122
  {
1123
+ return C_Gallery_Mapper::get_instance()->find($this->galleryid, $model);
1124
  }
1125
+ }
1126
+ /**
1127
+ * Class C_Image_Mapper
1128
+ * @mixin Mixin_NextGen_Table_Extras
1129
+ * @mixin Mixin_Gallery_Image_Mapper
1130
+ * @implements I_Image_Mapper
1131
+ */
1132
+ class C_Image_Mapper extends C_CustomTable_DataMapper_Driver
1133
+ {
1134
+ public static $_instance = NULL;
1135
  /**
1136
+ * Defines the gallery image mapper
1137
+ * @param string|false $context (optional)
1138
+ * @param mixed $not_used
1139
  */
1140
+ function define($context = FALSE, $not_used = FALSE)
1141
  {
1142
+ // Add 'attachment' context
1143
+ if (!is_array($context)) {
1144
+ $context = array($context);
1145
+ }
1146
+ array_push($context, 'attachment');
1147
+ // Define the mapper
1148
+ $this->_primary_key_column = 'pid';
1149
+ parent::define('ngg_pictures', $context);
1150
+ $this->add_mixin('Mixin_NextGen_Table_Extras');
1151
+ $this->add_mixin('Mixin_Gallery_Image_Mapper');
1152
+ $this->implement('I_Image_Mapper');
1153
+ $this->set_model_factory_method('image');
1154
+ // Define the columns
1155
+ $this->define_column('pid', 'BIGINT', 0);
1156
+ $this->define_column('image_slug', 'VARCHAR(255)');
1157
+ $this->define_column('post_id', 'BIGINT', 0);
1158
+ $this->define_column('galleryid', 'BIGINT', 0);
1159
+ $this->define_column('filename', 'VARCHAR(255)');
1160
+ $this->define_column('description', 'TEXT');
1161
+ $this->define_column('alttext', 'TEXT');
1162
+ $this->define_column('imagedate', 'DATETIME');
1163
+ $this->define_column('exclude', 'INT', 0);
1164
+ $this->define_column('sortorder', 'BIGINT', 0);
1165
+ $this->define_column('meta_data', 'TEXT');
1166
+ $this->define_column('extras_post_id', 'BIGINT', 0);
1167
+ $this->define_column('updated_at', 'BIGINT');
1168
+ // Mark the columns which should be unserialized
1169
+ $this->add_serialized_column('meta_data');
1170
  }
1171
+ function initialize($object_name = FALSE)
 
 
 
 
 
1172
  {
1173
+ parent::initialize('ngg_pictures');
1174
  }
1175
  /**
1176
+ * @param bool|string $context
1177
+ * @return C_Image_Mapper
 
 
 
1178
  */
1179
+ static function get_instance($context = False)
1180
  {
1181
+ if (is_null(self::$_instance)) {
1182
+ $klass = get_class();
1183
+ self::$_instance = new $klass($context);
1184
+ }
1185
+ return self::$_instance;
1186
  }
1187
+ }
1188
+ /**
1189
+ * Sets the alttext property as the post title
1190
+ */
1191
+ class Mixin_Gallery_Image_Mapper extends Mixin
1192
+ {
1193
+ function destroy($image)
1194
  {
1195
+ $retval = $this->call_parent('destroy', $image);
1196
+ // Delete tag associations with the image
1197
+ if (!is_numeric($image)) {
1198
+ $image = $image->{$image->id_field};
1199
  }
1200
+ wp_delete_object_term_relationships($image, 'ngg_tag');
1201
+ C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering');
1202
  return $retval;
1203
  }
1204
+ function _save_entity($entity)
 
 
 
 
 
 
 
1205
  {
1206
+ $entity->updated_at = time();
1207
+ // If successfully saved then import metadata
1208
+ $retval = $this->call_parent('_save_entity', $entity);
1209
+ if ($retval) {
1210
+ include_once NGGALLERY_ABSPATH . '/admin/functions.php';
1211
+ $image_id = $this->get_id($entity);
1212
+ if (!isset($entity->meta_data['saved'])) {
1213
+ nggAdmin::import_MetaData($image_id);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1214
  }
1215
+ C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering');
1216
  }
1217
  return $retval;
1218
  }
1219
+ function reimport_metadata($image_or_id)
 
 
 
 
 
 
 
1220
  {
1221
+ // Get the image
1222
+ $image = NULL;
1223
+ if (is_int($image_or_id)) {
1224
+ $image = $this->object->find($image_or_id);
1225
+ } else {
1226
+ $image = $image_or_id;
1227
  }
1228
+ // Reset all image details that would have normally been imported
1229
+ if (is_array($image->meta_data)) {
1230
+ unset($image->meta_data['saved']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1231
  }
1232
+ nggAdmin::import_MetaData($image);
1233
+ return $this->object->save($image);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1234
  }
1235
  /**
1236
+ * Retrieves the id from an image
1237
+ * @param $image
1238
+ * @return bool
 
 
1239
  */
1240
+ function get_id($image)
 
 
 
 
1241
  {
1242
  $retval = FALSE;
1243
+ // Have we been passed an entity and is the id_field set?
1244
+ if ($image instanceof stdClass) {
1245
+ if (isset($image->id_field)) {
1246
+ $retval = $image->{$image->id_field};
 
 
 
 
1247
  }
1248
  } else {
1249
+ $retval = $image->id();
1250
+ }
1251
+ // If we still don't have an id, then we'll lookup the primary key
1252
+ // and try fetching it manually
1253
+ if (!$retval) {
1254
+ $key = $this->object->get_primary_key_column();
1255
+ $retval = $image->{$key};
1256
  }
1257
  return $retval;
1258
  }
1259
+ function get_post_title($entity)
1260
  {
1261
+ return $entity->alttext;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1262
  }
1263
+ function set_defaults($entity)
1264
  {
1265
+ // If not set already, we'll add an exclude property. This is used
1266
+ // by NextGEN Gallery itself, as well as the Attach to Post module
1267
+ $this->object->_set_default_value($entity, 'exclude', 0);
1268
+ // Ensure that the object has a description attribute
1269
+ $this->object->_set_default_value($entity, 'description', '');
1270
+ // If not set already, set a default sortorder
1271
+ $this->object->_set_default_value($entity, 'sortorder', 0);
1272
+ // The imagedate must be set
1273
+ if (!isset($entity->imagedate) or is_null($entity->imagedate) or $entity->imagedate == '0000-00-00 00:00:00') {
1274
+ $entity->imagedate = date("Y-m-d H:i:s");
1275
  }
1276
+ // If a filename is set, and no alttext is set, then set the alttext
1277
+ // to the basename of the filename (legacy behavior)
1278
+ if (isset($entity->filename)) {
1279
+ $path_parts = M_I18n::mb_pathinfo($entity->filename);
1280
+ $alttext = !isset($path_parts['filename']) ? substr($path_parts['basename'], 0, strpos($path_parts['basename'], '.')) : $path_parts['filename'];
1281
+ $this->object->_set_default_value($entity, 'alttext', $alttext);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1282
  }
1283
+ // Set unique slug
1284
+ if (isset($entity->alttext) && empty($entity->image_slug)) {
1285
+ $entity->image_slug = nggdb::get_unique_slug(sanitize_title_with_dashes($entity->alttext), 'image');
1286
  }
1287
+ // Ensure that the exclude parameter is an integer or boolean-evaluated
1288
+ // value
1289
+ if (is_string($entity->exclude)) {
1290
+ $entity->exclude = intval($entity->exclude);
 
 
 
 
 
1291
  }
1292
+ // Trim alttext and description
1293
+ $entity->description = trim($entity->description);
1294
+ $entity->alttext = trim($entity->alttext);
1295
  }
1296
  /**
1297
+ * Finds all images for a gallery
1298
+ * @param $gallery
1299
+ * @param bool $model
1300
+ *
1301
+ * @return array
 
 
1302
  */
1303
+ function find_all_for_gallery($gallery, $model = FALSE)
1304
  {
1305
+ $retval = array();
1306
+ $gallery_id = 0;
1307
+ if (is_object($gallery)) {
1308
+ if (isset($gallery->id_field)) {
1309
+ $gallery_id = $gallery->{$gallery->id_field};
1310
+ } else {
1311
+ $key = $this->object->get_primary_key_column();
1312
+ if (isset($gallery->{$key})) {
1313
+ $gallery_id = $gallery->{$key};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1314
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1315
  }
1316
+ } elseif (is_numeric($gallery)) {
1317
+ $gallery_id = $gallery;
1318
  }
1319
+ if ($gallery_id) {
1320
+ $retval = $this->object->select()->where(array("galleryid = %s", $gallery_id))->run_query(FALSE, $model);
1321
  }
1322
  return $retval;
1323
  }
1324
+ }
1325
+ /**
1326
+ * This class provides a lazy-loading wrapper to the NextGen-Legacy "nggImage" class for use in legacy style templates
1327
+ */
1328
+ class C_Image_Wrapper
1329
+ {
1330
+ public $_cache;
1331
+ // cache of retrieved values
1332
+ public $_settings;
1333
+ // I_Settings_Manager cache
1334
+ public $_storage;
1335
+ // I_Gallery_Storage cache
1336
+ public $_galleries;
1337
+ // cache of I_Gallery_Mapper (plural)
1338
+ public $_orig_image;
1339
+ // original provided image
1340
+ public $_orig_image_id;
1341
+ // original image ID
1342
+ public $_cache_overrides;
1343
+ // allow for forcing variable values
1344
+ public $_legacy = FALSE;
1345
+ public $_displayed_gallery;
1346
+ // cached object
1347
+ /**
1348
+ * Constructor. Converts the image class into an array and fills from defaults any missing values
1349
+ *
1350
+ * @param object $image Individual result from displayed_gallery->get_entities()
1351
+ * @param object $displayed_gallery Displayed gallery -- MAY BE NULL
1352
+ * @param bool $legacy Whether the image source is from NextGen Legacy or NextGen
1353
+ * @return void
1354
+ */
1355
+ public function __construct($image, $displayed_gallery = NULL, $legacy = FALSE)
1356
  {
1357
+ // for clarity
1358
+ if ($displayed_gallery && isset($displayed_gallery->display_settings['number_of_columns'])) {
1359
+ $columns = $displayed_gallery->display_settings['number_of_columns'];
1360
  } else {
1361
+ $columns = 0;
1362
+ }
1363
+ // Public variables
1364
+ $defaults = array(
1365
+ 'errmsg' => '',
1366
+ // Error message to display, if any
1367
+ 'error' => FALSE,
1368
+ // Error state
1369
+ 'imageURL' => '',
1370
+ // URL Path to the image
1371
+ 'thumbURL' => '',
1372
+ // URL Path to the thumbnail
1373
+ 'imagePath' => '',
1374
+ // Server Path to the image
1375
+ 'thumbPath' => '',
1376
+ // Server Path to the thumbnail
1377
+ 'href' => '',
1378
+ // A href link code
1379
+ // Mostly constant
1380
+ 'thumbPrefix' => 'thumbs_',
1381
+ // FolderPrefix to the thumbnail
1382
+ 'thumbFolder' => '/thumbs/',
1383
+ // Foldername to the thumbnail
1384
+ // Image Data
1385
+ 'galleryid' => 0,
1386
+ // Gallery ID
1387
+ 'pid' => 0,
1388
+ // Image ID
1389
+ 'filename' => '',
1390
+ // Image filename
1391
+ 'description' => '',
1392
+ // Image description
1393
+ 'alttext' => '',
1394
+ // Image alttext
1395
+ 'imagedate' => '',
1396
+ // Image date/time
1397
+ 'exclude' => '',
1398
+ // Image exclude
1399
+ 'thumbcode' => '',
1400
+ // Image effect code
1401
+ // Gallery Data
1402
+ 'name' => '',
1403
+ // Gallery name
1404
+ 'path' => '',
1405
+ // Gallery path
1406
+ 'title' => '',
1407
+ // Gallery title
1408
+ 'pageid' => 0,
1409
+ // Gallery page ID
1410
+ 'previewpic' => 0,
1411
+ // Gallery preview pic
1412
+ 'style' => $columns > 0 ? 'style="width:' . floor(100 / $columns) . '%;"' : '',
1413
+ 'hidden' => FALSE,
1414
+ 'permalink' => '',
1415
+ 'tags' => '',
1416
+ );
1417
+ // convert the image to an array and apply the defaults
1418
+ $this->_orig_image = $image;
1419
+ $image = (array) $image;
1420
+ foreach ($defaults as $key => $val) {
1421
+ if (!isset($image[$key])) {
1422
+ $image[$key] = $val;
1423
  }
1424
  }
1425
+ // cache the results
1426
+ ksort($image);
1427
+ $id_field = !empty($image['id_field']) ? $image['id_field'] : 'pid';
1428
+ $this->_cache = (array) apply_filters('ngg_image_object', (object) $image, $image[$id_field]);
1429
+ $this->_orig_image_id = $image[$id_field];
1430
+ $this->_legacy = $legacy;
1431
+ $this->_displayed_gallery = $displayed_gallery;
1432
  }
1433
+ public function __set($name, $value)
1434
  {
1435
+ $this->_cache[$name] = $value;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1436
  }
1437
+ public function __isset($name)
1438
  {
1439
+ return isset($this->_cache[$name]);
1440
+ }
1441
+ public function __unset($name)
1442
+ {
1443
+ unset($this->_cache[$name]);
1444
  }
1445
  /**
1446
+ * Lazy-loader for image variables.
1447
+ *
1448
+ * @param string $name Parameter name
1449
+ * @return mixed
 
1450
  */
1451
+ public function __get($name)
1452
  {
1453
+ if (isset($this->_cache_overrides[$name])) {
1454
+ return $this->_cache_overrides[$name];
1455
+ }
1456
+ // at the bottom we default to returning $this->_cache[$name].
1457
+ switch ($name) {
1458
+ case 'alttext':
1459
+ $this->_cache['alttext'] = empty($this->_cache['alttext']) ? ' ' : html_entity_decode(stripslashes($this->_cache['alttext']));
1460
+ return $this->_cache['alttext'];
1461
+ case 'author':
1462
+ $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
1463
+ $this->_cache['author'] = $gallery->name;
1464
+ return $this->_cache['author'];
1465
+ case 'caption':
1466
+ $caption = html_entity_decode(stripslashes($this->__get('description')));
1467
+ if (empty($caption)) {
1468
+ $caption = '&nbsp;';
1469
+ }
1470
+ $this->_cache['caption'] = $caption;
1471
+ return $this->_cache['caption'];
1472
+ case 'description':
1473
+ $this->_cache['description'] = empty($this->_cache['description']) ? ' ' : html_entity_decode(stripslashes($this->_cache['description']));
1474
+ return $this->_cache['description'];
1475
+ case 'galdesc':
1476
+ $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
1477
+ $this->_cache['galdesc'] = $gallery->name;
1478
+ return $this->_cache['galdesc'];
1479
+ case 'gid':
1480
+ $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
1481
+ $this->_cache['gid'] = $gallery->{$gallery->id_field};
1482
+ return $this->_cache['gid'];
1483
+ case 'href':
1484
+ return $this->__get('imageHTML');
1485
+ case 'id':
1486
+ return $this->_orig_image_id;
1487
+ case 'imageHTML':
1488
+ $tmp = '<a href="' . $this->__get('imageURL') . '" title="' . htmlspecialchars(stripslashes($this->__get('description'))) . '" ' . $this->get_thumbcode($this->__get('name')) . '>' . '<img alt="' . $this->__get('alttext') . '" src="' . $this->__get('imageURL') . '"/>' . '</a>';
1489
+ $this->_cache['href'] = $tmp;
1490
+ $this->_cache['imageHTML'] = $tmp;
1491
+ return $this->_cache['imageHTML'];
1492
+ case 'imagePath':
1493
+ $storage = $this->get_storage();
1494
+ $this->_cache['imagePath'] = $storage->get_image_abspath($this->_orig_image, 'full');
1495
+ return $this->_cache['imagePath'];
1496
+ case 'imageURL':
1497
+ $storage = $this->get_storage();
1498
+ $this->_cache['imageURL'] = $storage->get_image_url($this->_orig_image, 'full');
1499
+ return $this->_cache['imageURL'];
1500
+ case 'linktitle':
1501
+ $this->_cache['linktitle'] = htmlspecialchars(stripslashes($this->__get('description')));
1502
+ return $this->_cache['linktitle'];
1503
+ case 'name':
1504
+ $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
1505
+ $this->_cache['name'] = $gallery->name;
1506
+ return $this->_cache['name'];
1507
+ case 'pageid':
1508
+ $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
1509
+ $this->_cache['pageid'] = $gallery->name;
1510
+ return $this->_cache['pageid'];
1511
+ case 'path':
1512
+ $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
1513
+ $this->_cache['path'] = $gallery->name;
1514
+ return $this->_cache['path'];
1515
+ case 'permalink':
1516
+ $this->_cache['permalink'] = $this->__get('imageURL');
1517
+ return $this->_cache['permalink'];
1518
+ case 'pid':
1519
+ return $this->_orig_image_id;
1520
+ case 'id_field':
1521
+ $this->_cache['id_field'] = !empty($this->_orig_image->id_field) ? $this->_orig_image->id_field : 'pid';
1522
+ return $this->_cache['id_field'];
1523
+ case 'pidlink':
1524
+ $application = C_Router::get_instance()->get_routed_app();
1525
+ $controller = C_Display_Type_Controller::get_instance();
1526
+ $this->_cache['pidlink'] = $controller->set_param_for($application->get_routed_url(TRUE), 'pid', $this->__get('image_slug'));
1527
+ return $this->_cache['pidlink'];
1528
+ case 'previewpic':
1529
+ $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
1530
+ $this->_cache['previewpic'] = $gallery->name;
1531
+ return $this->_cache['previewpic'];
1532
+ case 'size':
1533
+ $w = 0;
1534
+ $h = 0;
1535
+ if ($this->_displayed_gallery && isset($this->_displayed_gallery->display_settings)) {
1536
+ $ds = $this->_displayed_gallery->display_settings;
1537
+ if (isset($ds['override_thumbnail_settings']) && $ds['override_thumbnail_settings']) {
1538
+ $w = $ds['thumbnail_width'];
1539
+ $h = $ds['thumbnail_height'];
1540
  }
 
 
 
1541
  }
1542
+ if (!$w || !$h) {
1543
+ if (is_string($this->_orig_image->meta_data)) {
1544
+ $this->_orig_image = C_NextGen_Serializable::unserialize($this->_orig_image->meta_data);
 
 
 
 
1545
  }
1546
+ if (!isset($this->_orig_image->meta_data['thumbnail'])) {
1547
+ $storage = $this->get_storage();
1548
+ $storage->generate_thumbnail($this->_orig_image);
 
 
 
1549
  }
1550
+ $w = $this->_orig_image->meta_data['thumbnail']['width'];
1551
+ $h = $this->_orig_image->meta_data['thumbnail']['height'];
1552
  }
1553
+ return "width='{$w}' height='{$h}'";
1554
+ case 'slug':
1555
+ $gallery = $this->get_legacy_gallery($this->__get('galleryid'));
1556
+ $this->_cache['slug'] = $gallery->name;
1557
+ return $this->_cache['slug'];
1558
+ case 'tags':
1559
+ $this->_cache['tags'] = wp_get_object_terms($this->__get('id'), 'ngg_tag', 'fields=all');
1560
+ return $this->_cache['tags'];
1561
+ case 'thumbHTML':
1562
+ $tmp = '<a href="' . $this->__get('imageURL') . '" title="' . htmlspecialchars(stripslashes($this->__get('description'))) . '" ' . $this->get_thumbcode($this->__get('name')) . '>' . '<img alt="' . $this->__get('alttext') . '" src="' . $this->thumbURL . '"/>' . '</a>';
1563
+ $this->_cache['href'] = $tmp;
1564
+ $this->_cache['thumbHTML'] = $tmp;
1565
+ return $this->_cache['thumbHTML'];
1566
+ case 'thumbPath':
1567
+ $storage = $this->get_storage();
1568
+ $this->_cache['thumbPath'] = $storage->get_image_abspath($this->_orig_image, 'thumbnail');
1569
+ return $this->_cache['thumbPath'];
1570
+ case 'thumbnailURL':
1571
+ $storage = $this->get_storage();
1572
+ $thumbnail_size_name = 'thumbnail';
1573
+ if ($this->_displayed_gallery && isset($this->_displayed_gallery->display_settings)) {
1574
+ $ds = $this->_displayed_gallery->display_settings;
1575
+ if (isset($ds['override_thumbnail_settings']) && $ds['override_thumbnail_settings']) {
1576
+ $dynthumbs = C_Component_Registry::get_instance()->get_utility('I_Dynamic_Thumbnails_Manager');
1577
+ $dyn_params = array('width' => $ds['thumbnail_width'], 'height' => $ds['thumbnail_height']);
1578
+ if ($ds['thumbnail_quality']) {
1579
+ $dyn_params['quality'] = $ds['thumbnail_quality'];
1580
+ }
1581
+ if ($ds['thumbnail_crop']) {
1582
+ $dyn_params['crop'] = TRUE;
1583
  }
1584
+ if ($ds['thumbnail_watermark']) {
1585
+ $dyn_params['watermark'] = TRUE;
1586
+ }
1587
+ $thumbnail_size_name = $dynthumbs->get_size_name($dyn_params);
1588
  }
1589
  }
1590
+ $this->_cache['thumbnailURL'] = $storage->get_image_url($this->_orig_image, $thumbnail_size_name);
1591
+ return $this->_cache['thumbnailURL'];
1592
+ case 'thumbcode':
1593
+ if ($this->_displayed_gallery && isset($this->_displayed_gallery->display_settings) && isset($this->_displayed_gallery->display_settings['use_imagebrowser_effect']) && $this->_displayed_gallery->display_settings['use_imagebrowser_effect'] && !empty($this->_orig_image->thumbcode)) {
1594
+ $this->_cache['thumbcode'] = $this->_orig_image->thumbcode;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1595
  } else {
1596
+ $this->_cache['thumbcode'] = $this->get_thumbcode($this->__get('name'));
1597
  }
1598
+ return $this->_cache['thumbcode'];
1599
+ case 'thumbURL':
1600
+ return $this->__get('thumbnailURL');
1601
+ case 'title':
1602
+ $this->_cache['title'] = stripslashes($this->__get('name'));
1603
+ return $this->_cache['title'];
1604
+ case 'url':
1605
+ $storage = $this->get_storage();
1606
+ $this->_cache['url'] = $storage->get_image_url($this->_orig_image, 'full');
1607
+ return $this->_cache['url'];
1608
+ default:
1609
+ return $this->_cache[$name];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1610
  }
1611
+ }
1612
+ // called on initial nggLegacy image at construction. not sure what to do with it now.
1613
+ function construct_ngg_Image($gallery)
1614
+ {
1615
+ do_action_ref_array('ngg_get_image', array(&$this));
1616
+ unset($this->tags);
1617
  }
1618
  /**
1619
+ * Retrieves and caches an I_Settings_Manager instance
1620
+ *
1621
+ * @return mixed
 
 
1622
  */
1623
+ function get_settings()
1624
  {
1625
+ if (is_null($this->_settings)) {
1626
+ $this->_settings = C_NextGen_Settings::get_instance();
 
 
1627
  }
1628
+ return $this->_settings;
1629
  }
1630
  /**
1631
+ * Retrieves and caches an I_Gallery_Storage instance
1632
+ *
1633
+ * @return mixed
 
 
1634
  */
1635
+ function get_storage()
1636
  {
1637
+ if (is_null($this->_storage)) {
1638
+ $this->_storage = C_Gallery_Storage::get_instance();
1639
+ }
1640
+ return $this->_storage;
1641
+ }
1642
+ /**
1643
+ * Retrieves I_Gallery_Mapper instance.
1644
+ *
1645
+ * @param int $gallery_id Gallery ID
1646
+ * @return mixed
1647
+ */
1648
+ function get_gallery($gallery_id)
1649
+ {
1650
+ if (isset($this->container) && method_exists($this->container, 'get_gallery')) {
1651
+ return $this->container->get_gallery($gallery_id);
1652
+ }
1653
+ return C_Gallery_Mapper::get_instance()->find($gallery_id);
1654
+ }
1655
+ /**
1656
+ * Retrieves I_Gallery_Mapper instance.
1657
+ *
1658
+ * @param int $gallery_id Gallery ID
1659
+ * @return mixed
1660
+ */
1661
+ function get_legacy_gallery($gallery_id)
1662
+ {
1663
+ return C_Gallery_Mapper::get_instance()->find($gallery_id);
1664
+ }
1665
+ /**
1666
+ * Get the thumbnail code (to add effects on thumbnail click)
1667
+ *
1668
+ * Applies the filter 'ngg_get_thumbcode'
1669
+ * @param string $gallery_name (optional) Default = ''
1670
+ * @return string
1671
+ */
1672
+ function get_thumbcode($gallery_name = '')
1673
+ {
1674
+ if (empty($this->_displayed_gallery)) {
1675
+ $effect_code = C_NextGen_Settings::get_instance()->thumbCode;
1676
+ $effect_code = str_replace('%GALLERY_ID%', $gallery_name, $effect_code);
1677
+ $effect_code = str_replace('%GALLERY_NAME%', $gallery_name, $effect_code);
1678
+ $retval = $effect_code;
1679
+ } else {
1680
+ $controller = C_Display_Type_Controller::get_instance();
1681
+ $retval = $controller->get_effect_code($this->_displayed_gallery);
1682
+ // This setting requires that we disable the effect code
1683
+ $ds = $this->_displayed_gallery->display_settings;
1684
+ if (isset($ds['use_imagebrowser_effect']) && $ds['use_imagebrowser_effect']) {
1685
+ $retval = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1686
  }
1687
  }
1688
+ $retval = apply_filters('ngg_get_thumbcode', $retval, $this);
1689
+ // ensure some additional data- fields are added; provides Pro-Lightbox compatibility
1690
+ $retval .= ' data-image-id="' . $this->__get('id') . '"';
1691
+ $retval .= ' data-src="' . $this->__get('imageURL') . '"';
1692
+ $retval .= ' data-thumbnail="' . $this->__get('thumbnailURL') . '"';
1693
+ $retval .= ' data-title="' . esc_attr($this->__get('alttext')) . '"';
1694
+ $retval .= ' data-description="' . esc_attr($this->__get('description')) . '"';
1695
+ $this->_cache['thumbcode'] = $retval;
1696
+ return $retval;
 
 
 
 
 
 
 
 
 
 
 
 
 
1697
  }
1698
  /**
1699
+ * For compatibility support
1700
+ *
1701
+ * @return mixed
1702
  */
1703
+ function get_href_link()
1704
  {
1705
+ return $this->__get('imageHTML');
 
 
 
1706
  }
1707
  /**
1708
+ * For compatibility support
1709
+ *
1710
+ * @return mixed
1711
  */
1712
+ function get_href_thumb_link()
1713
  {
1714
+ return $this->__get('thumbHTML');
1715
  }
1716
+ /**
1717
+ * Function exists for legacy support but has been gutted to not do anything
1718
+ *
1719
+ * @param string|int $width (optional) Default = ''
1720
+ * @param string|int $height (optional) Default = ''
1721
+ * @param string $mode could be watermark | web20 | crop
1722
+ * @return bool|string The url for the image or false if failed
1723
+ */
1724
+ function cached_singlepic_file($width = '', $height = '', $mode = '')
1725
  {
1726
+ $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance();
1727
+ $storage = $this->get_storage();
1728
+ // determine what to do with 'mode'
1729
+ $display_reflection = FALSE;
1730
+ $display_watermark = FALSE;
1731
+ if (!is_array($mode)) {
1732
+ $mode = explode(',', $mode);
1733
  }
1734
+ if (in_array('web20', $mode)) {
1735
+ $display_reflection = TRUE;
1736
  }
1737
+ if (in_array('watermark', $mode)) {
1738
+ $display_watermark = TRUE;
1739
+ }
1740
+ // and go for it
1741
+ $params = array('width' => $width, 'height' => $height, 'watermark' => $display_watermark, 'reflection' => $display_reflection);
1742
+ return $storage->get_image_url((object) $this->_cache, $dynthumbs->get_size_name($params));
1743
  }
1744
+ /**
1745
+ * Get the tags associated to this image
1746
+ */
1747
+ function get_tags()
 
 
 
 
 
 
1748
  {
1749
+ return $this->__get('tags');
 
 
1750
  }
1751
  /**
1752
+ * Get the permalink to the image
1753
+ *
1754
+ * TODO: Get a permalink to a page presenting the image
 
1755
  */
1756
+ function get_permalink()
1757
  {
1758
+ return $this->__get('permalink');
 
 
 
1759
  }
1760
  /**
1761
+ * Returns the _cache array; used by nggImage
1762
+ * @return array
 
1763
  */
1764
+ function _get_image()
1765
  {
1766
+ return $this->_cache;
1767
  }
1768
  }
1769
+ class C_Image_Wrapper_Collection implements ArrayAccess
 
 
 
 
 
 
1770
  {
1771
+ public $container = array();
1772
+ public $galleries = array();
1773
+ public function offsetExists($offset)
 
 
 
 
1774
  {
1775
+ return isset($this->container[$offset]);
1776
+ }
1777
+ public function offsetGet($offset)
1778
+ {
1779
+ return isset($this->container[$offset]) ? $this->container[$offset] : null;
1780
+ }
1781
+ public function offsetSet($offset, $value)
1782
+ {
1783
+ if (is_object($value)) {
1784
+ $value->container = $this;
1785
+ }
1786
+ if (is_null($offset)) {
1787
+ $this->container[] = $value;
1788
+ } else {
1789
+ $this->container[$offset] = $value;
1790
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1791
  }
1792
+ public function offsetUnset($offset)
1793
  {
1794
+ unset($this->container[$offset]);
1795
  }
1796
  /**
1797
+ * Retrieves and caches an I_Gallery_Mapper instance for this gallery id
1798
+ *
1799
+ * @param int $gallery_id Gallery ID
1800
+ * @return mixed
1801
  */
1802
+ public function get_gallery($gallery_id)
1803
  {
1804
+ if (!isset($this->galleries[$gallery_id]) || is_null($this->galleries[$gallery_id])) {
1805
+ $this->galleries[$gallery_id] = C_Gallery_Mapper::get_instance();
 
1806
  }
1807
+ return $this->galleries[$gallery_id];
1808
  }
1809
  }
1810
+ class C_NextGen_Data_Installer extends C_NggLegacy_Installer
 
 
 
1811
  {
1812
+ function get_registry()
1813
  {
1814
+ return C_Component_Registry::get_instance();
 
 
 
 
 
 
 
1815
  }
1816
+ function install()
1817
  {
1818
+ $this->remove_table_extra_options();
 
 
 
 
 
 
 
 
 
 
 
1819
  }
1820
+ function remove_table_extra_options()
1821
  {
1822
+ global $wpdb;
1823
+ $likes = array("option_name LIKE '%ngg_gallery%'", "option_name LIKE '%ngg_pictures%'", "option_name LIKE '%ngg_album%'");
1824
+ $sql = "DELETE FROM {$wpdb->options} WHERE " . implode(" OR ", $likes);
1825
+ $wpdb->query($sql);
 
 
 
 
 
 
 
 
 
1826
  }
1827
+ function uninstall($hard = FALSE)
 
 
 
 
 
1828
  {
1829
+ if ($hard) {
1830
+ /* Yes: this is commented twice.
1831
+ // TODO for now never delete galleries/albums/content
1832
+ # $mappers = array(
1833
+ # $this->get_registry()->get_utility('I_Album_Mapper'),
1834
+ # $this->get_registry()->get_utility('I_Gallery_Mapper'),
1835
+ # $this->get_registry()->get_utility('I_Image_Mapper'),
1836
+ # );
1837
+
1838
+ # foreach ($mappers as $mapper) {
1839
+ # $mapper->delete()->run_query();
1840
+ # }
1841
+
1842
+ # // Remove ngg tags
1843
+ # global $wpdb;
1844
+ # $wpdb->query("DELETE FROM {$wpdb->terms} WHERE term_id IN (SELECT term_id FROM {$wpdb->term_taxonomy} WHERE taxonomy='ngg_tag')");
1845
+ # $wpdb->query("DELETE FROM {$wpdb->term_taxonomy} WHERE taxonomy='ngg_tag'");
1846
+ */
1847
  }
 
 
 
 
 
1848
  }
1849
+ }
1850
+ class C_NextGen_Metadata extends C_Component
1851
+ {
1852
+ // Image data
1853
+ public $image = '';
1854
+ // The image object
1855
+ public $file_path = '';
1856
+ // Path to the image file
1857
+ public $size = FALSE;
1858
+ // The image size
1859
+ public $exif_data = FALSE;
1860
+ // EXIF data array
1861
+ public $iptc_data = FALSE;
1862
+ // IPTC data array
1863
+ public $xmp_data = FALSE;
1864
+ // XMP data array
1865
+ // Filtered Data
1866
+ public $exif_array = FALSE;
1867
+ // EXIF data array
1868
+ public $iptc_array = FALSE;
1869
+ // IPTC data array
1870
+ public $xmp_array = FALSE;
1871
+ // XMP data array
1872
+ public $sanitize = FALSE;
1873
+ // sanitize meta data on request
1874
+ /**
1875
+ * Class constructor
1876
+ *
1877
+ * @param int $image Image ID
1878
+ * @param bool $onlyEXIF TRUE = will parse only EXIF data
1879
+ * @return bool FALSE if the file does not exist or metadat could not be read
1880
+ */
1881
+ public function __construct($image, $onlyEXIF = FALSE)
1882
  {
1883
+ if (is_numeric($image)) {
1884
+ $image = C_Image_Mapper::get_instance()->find($image);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1885
  }
1886
+ $this->image = apply_filters('ngg_find_image_meta', $image);
1887
+ $this->file_path = C_Gallery_Storage::get_instance()->get_image_abspath($this->image);
1888
+ if (!@file_exists($this->file_path)) {
1889
+ return FALSE;
1890
  }
1891
+ $this->size = @getimagesize($this->file_path, $metadata);
1892
+ if ($this->size && is_array($metadata)) {
1893
+ // get exif - data
1894
+ if (is_callable('exif_read_data')) {
1895
+ $this->exif_data = @exif_read_data($this->file_path, NULL, TRUE);
1896
+ }
1897
+ // stop here if we didn't need other meta data
1898
+ if ($onlyEXIF) {
1899
+ return TRUE;
1900
+ }
1901
+ // get the iptc data - should be in APP13
1902
+ if (is_callable('iptcparse') && isset($metadata['APP13'])) {
1903
+ $this->iptc_data = @iptcparse($metadata['APP13']);
1904
+ }
1905
+ // get the xmp data in a XML format
1906
+ if (is_callable('xml_parser_create')) {
1907
+ $this->xmp_data = $this->extract_XMP($this->file_path);
1908
+ }
1909
+ return TRUE;
1910
  }
1911
+ return FALSE;
 
 
1912
  }
1913
  /**
1914
+ * return the saved meta data from the database
 
 
1915
  *
1916
+ * @since 1.4.0
1917
+ * @param string $object (optional)
1918
+ * @return array|mixed return either the complete array or the single object
1919
  */
1920
+ function get_saved_meta($object = false)
1921
  {
1922
+ $meta = $this->image->meta_data;
1923
+ // Check if we already import the meta data to the database
1924
+ if (!is_array($meta) || !isset($meta['saved']) || $meta['saved'] !== TRUE) {
1925
+ return false;
1926
+ }
1927
+ // return one element if requested
1928
+ if ($object) {
1929
+ return $meta[$object];
1930
+ }
1931
+ //removed saved parameter we don't need that to show
1932
+ unset($meta['saved']);
1933
+ // and remove empty tags or arrays
1934
+ foreach ($meta as $key => $value) {
1935
+ if (empty($value) or is_array($value)) {
1936
+ unset($meta[$key]);
1937
  }
 
 
1938
  }
1939
+ // on request sanitize the output
1940
+ if ($this->sanitize == true) {
1941
+ array_walk($meta, 'esc_html');
1942
  }
1943
+ return $meta;
1944
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1945
  /**
1946
+ * nggMeta::get_EXIF()
1947
+ * See also http://trac.wordpress.org/changeset/6313
1948
  *
1949
+ * @return bool|array
 
 
 
1950
  */
1951
+ function get_EXIF($object = false)
1952
  {
1953
+ if (!$this->exif_data) {
1954
+ return false;
 
 
 
1955
  }
1956
+ if (!is_array($this->exif_array)) {
1957
+ $meta = array();
1958
+ if (isset($this->exif_data['EXIF'])) {
1959
+ $exif = $this->exif_data['EXIF'];
1960
+ if (!empty($exif['FNumber'])) {
1961
+ $meta['aperture'] = 'F ' . round($this->exif_frac2dec($exif['FNumber']), 2);
1962
+ }
1963
+ if (!empty($exif['Model'])) {
1964
+ $meta['camera'] = trim($exif['Model']);
1965
+ }
1966
+ if (!empty($exif['DateTimeDigitized'])) {
1967
+ $meta['created_timestamp'] = $this->exif_date2ts($exif['DateTimeDigitized']);
1968
+ } else {
1969
+ if (!empty($exif['DateTimeOriginal'])) {
1970
+ $meta['created_timestamp'] = $this->exif_date2ts($exif['DateTimeOriginal']);
1971
+ } else {
1972
+ if (!empty($exif['FileDateTime'])) {
1973
+ $meta['created_timestamp'] = $this->exif_date2ts($exif['FileDateTime']);
1974
+ }
1975
+ }
1976
+ }
1977
+ if (!empty($exif['FocalLength'])) {
1978
+ $meta['focal_length'] = $this->exif_frac2dec($exif['FocalLength']) . __(' mm', 'nggallery');
1979
+ }
1980
+ if (!empty($exif['ISOSpeedRatings'])) {
1981
+ $meta['iso'] = $exif['ISOSpeedRatings'];
1982
+ }
1983
+ if (!empty($exif['ExposureTime'])) {
1984
+ $meta['shutter_speed'] = $this->exif_frac2dec($exif['ExposureTime']);
1985
+ $meta['shutter_speed'] = ($meta['shutter_speed'] > 0.0 and $meta['shutter_speed'] < 1.0) ? '1/' . round(1 / $meta['shutter_speed'], -1) : $meta['shutter_speed'];
1986
+ $meta['shutter_speed'] .= __(' sec', 'nggallery');
1987
+ }
1988
+ //Bit 0 indicates the flash firing status
1989
+ if (!empty($exif['Flash'])) {
1990
+ $meta['flash'] = $exif['Flash'] & 1 ? __('Fired', 'nggallery') : __('Not fired', ' nggallery');
1991
+ }
1992
+ }
1993
+ // additional information
1994
+ if (isset($this->exif_data['IFD0'])) {
1995
+ $exif = $this->exif_data['IFD0'];
1996
+ if (!empty($exif['Model'])) {
1997
+ $meta['camera'] = $exif['Model'];
1998
+ }
1999
+ if (!empty($exif['Make'])) {
2000
+ $meta['make'] = $exif['Make'];
2001
+ }
2002
+ if (!empty($exif['ImageDescription'])) {
2003
+ $meta['title'] = $this->utf8_encode($exif['ImageDescription']);
2004
+ }
2005
+ if (!empty($exif['Orientation'])) {
2006
+ $meta['Orientation'] = $exif['Orientation'];
2007
+ }
2008
+ }
2009
+ // this is done by Windows
2010
+ if (isset($this->exif_data['WINXP'])) {
2011
+ $exif = $this->exif_data['WINXP'];
2012
+ if (!empty($exif['Title']) && empty($meta['title'])) {
2013
+ $meta['title'] = $this->utf8_encode($exif['Title']);
2014
+ }
2015
+ if (!empty($exif['Author'])) {
2016
+ $meta['author'] = $this->utf8_encode($exif['Author']);
2017
+ }
2018
+ if (!empty($exif['Keywords'])) {
2019
+ $meta['keywords'] = $this->utf8_encode($exif['Keywords']);
2020
+ }
2021
+ if (!empty($exif['Subject'])) {
2022
+ $meta['subject'] = $this->utf8_encode($exif['Subject']);
2023
+ }
2024
+ if (!empty($exif['Comments'])) {
2025
+ $meta['caption'] = $this->utf8_encode($exif['Comments']);
2026
+ }
2027
  }
2028
+ $this->exif_array = $meta;
2029
  }
2030
+ // return one element if requested
2031
+ if ($object == true) {
2032
+ $value = isset($this->exif_array[$object]) ? $this->exif_array[$object] : false;
2033
+ return $value;
2034
+ }
2035
+ // on request sanitize the output
2036
+ if ($this->sanitize == true) {
2037
+ array_walk($this->exif_array, 'esc_html');
2038
+ }
2039
+ return $this->exif_array;
2040
  }
2041
+ // convert a fraction string to a decimal
2042
+ function exif_frac2dec($str)
2043
  {
2044
+ @(list($n, $d) = explode('/', $str));
2045
+ if (!empty($d)) {
2046
+ return $n / $d;
2047
+ }
2048
+ return $str;
2049
  }
2050
+ // convert the exif date format to a unix timestamp
2051
+ function exif_date2ts($str)
2052
  {
2053
+ $retval = is_numeric($str) ? $str : @strtotime($str);
2054
+ if (!$retval && $str) {
2055
+ @(list($date, $time) = explode(' ', trim($str)));
2056
+ @(list($y, $m, $d) = explode(':', $date));
2057
+ $retval = strtotime("{$y}-{$m}-{$d} {$time}");
2058
+ }
2059
+ return $retval;
2060
  }
2061
+ /**
2062
+ * nggMeta::readIPTC() - IPTC Data Information for EXIF Display
2063
+ *
2064
+ * @param object $object (optional)
2065
+ * @return null|bool|array
2066
+ */
2067
+ function get_IPTC($object = false)
2068
  {
2069
+ if (!$this->iptc_data) {
2070
+ return false;
2071
+ }
2072
+ if (!is_array($this->iptc_array)) {
2073
+ // --------- Set up Array Functions --------- //
2074
+ $iptcTags = array("2#005" => 'title', "2#007" => 'status', "2#012" => 'subject', "2#015" => 'category', "2#025" => 'keywords', "2#055" => 'created_date', "2#060" => 'created_time', "2#080" => 'author', "2#085" => 'position', "2#090" => 'city', "2#092" => 'location', "2#095" => 'state', "2#100" => 'country_code', "2#101" => 'country', "2#105" => 'headline', "2#110" => 'credit', "2#115" => 'source', "2#116" => 'copyright', "2#118" => 'contact', "2#120" => 'caption');
2075
+ $meta = array();
2076
+ foreach ($iptcTags as $key => $value) {
2077
+ if (isset($this->iptc_data[$key])) {
2078
+ $meta[$value] = trim($this->utf8_encode(implode(", ", $this->iptc_data[$key])));
2079
+ }
2080
+ }
2081
+ $this->iptc_array = $meta;
2082
+ }
2083
+ // return one element if requested
2084
+ if ($object) {
2085
+ return isset($this->iptc_array[$object]) ? $this->iptc_array[$object] : NULL;
2086
+ }
2087
+ // on request sanitize the output
2088
+ if ($this->sanitize == true) {
2089
+ array_walk($this->iptc_array, 'esc_html');
2090
+ }
2091
+ return $this->iptc_array;
2092
  }
2093
  /**
2094
+ * nggMeta::extract_XMP()
2095
+ * get XMP DATA
2096
+ * code by Pekka Saarinen http://photography-on-the.net
2097
  *
2098
+ * @param mixed $filename
2099
+ * @return bool|string
2100
  */
2101
+ function extract_XMP($filename)
2102
  {
2103
+ //TODO:Require a lot of memory, could be better
2104
+ ob_start();
2105
+ @readfile($filename);
2106
+ $source = ob_get_contents();
2107
+ ob_end_clean();
2108
+ $start = strpos($source, "<x:xmpmeta");
2109
+ $end = strpos($source, "</x:xmpmeta>");
2110
+ if (!$start === false && !$end === false) {
2111
+ $lenght = $end - $start;
2112
+ $xmp_data = substr($source, $start, $lenght + 12);
2113
+ unset($source);
2114
+ return $xmp_data;
2115
  }
2116
+ unset($source);
2117
+ return false;
2118
+ }
2119
+ /**
2120
+ * nggMeta::get_XMP()
2121
+ *
2122
+ * @package Taken from http://php.net/manual/en/function.xml-parse-into-struct.php
2123
+ * @author Alf Marius Foss Olsen & Alex Rabe
2124
+ * @return bool|array
2125
+ *
2126
+ */
2127
+ function get_XMP($object = false)
2128
+ {
2129
+ if (!$this->xmp_data) {
2130
+ return false;
2131
+ }
2132
+ if (!is_array($this->xmp_array)) {
2133
+ $parser = xml_parser_create();
2134
+ xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
2135
+ // Dont mess with my cAsE sEtTings
2136
+ xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
2137
+ // Dont bother with empty info
2138
+ xml_parse_into_struct($parser, $this->xmp_data, $values);
2139
+ xml_parser_free($parser);
2140
+ $xmlarray = array();
2141
+ // The XML array
2142
+ $this->xmp_array = array();
2143
+ // The returned array
2144
+ $stack = array();
2145
+ // tmp array used for stacking
2146
+ $list_array = array();
2147
+ // tmp array for list elements
2148
+ $list_element = false;
2149
+ // rdf:li indicator
2150
+ foreach ($values as $val) {
2151
+ if ($val['type'] == "open") {
2152
+ array_push($stack, $val['tag']);
2153
+ } elseif ($val['type'] == "close") {
2154
+ // reset the compared stack
2155
+ if ($list_element == false) {
2156
+ array_pop($stack);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2157
  }
2158
+ // reset the rdf:li indicator & array
2159
+ $list_element = false;
2160
+ $list_array = array();
2161
+ } elseif ($val['type'] == "complete") {
2162
+ if ($val['tag'] == "rdf:li") {
2163
+ // first go one element back
2164
+ if ($list_element == false) {
2165
+ array_pop($stack);
2166
+ }
2167
+ $list_element = true;
2168
+ // do not parse empty tags
2169
+ if (empty($val['value'])) {
2170
+ continue;
2171
+ }
2172
+ // save it in our temp array
2173
+ $list_array[] = $val['value'];
2174
+ // in the case it's a list element we seralize it
2175
+ $value = implode(",", $list_array);
2176
+ $this->setArrayValue($xmlarray, $stack, $value);
2177
+ } else {
2178
+ array_push($stack, $val['tag']);
2179
+ // do not parse empty tags
2180
+ if (!empty($val['value'])) {
2181
+ $this->setArrayValue($xmlarray, $stack, $val['value']);
2182
+ }
2183
+ array_pop($stack);
2184
+ }
2185
+ }
2186
+ }
2187
+ // foreach
2188
+ // don't parse a empty array
2189
+ if (empty($xmlarray) || empty($xmlarray['x:xmpmeta'])) {
2190
+ return false;
2191
+ }
2192
+ // cut off the useless tags
2193
+ $xmlarray = $xmlarray['x:xmpmeta']['rdf:RDF']['rdf:Description'];
2194
+ // --------- Some values from the XMP format--------- //
2195
+ $xmpTags = array('xap:CreateDate' => 'created_timestamp', 'xap:ModifyDate' => 'last_modfied', 'xap:CreatorTool' => 'tool', 'dc:format' => 'format', 'dc:title' => 'title', 'dc:creator' => 'author', 'dc:subject' => 'keywords', 'dc:description' => 'caption', 'photoshop:AuthorsPosition' => 'position', 'photoshop:City' => 'city', 'photoshop:Country' => 'country');
2196
+ foreach ($xmpTags as $key => $value) {
2197
+ // if the kex exist
2198
+ if (isset($xmlarray[$key])) {
2199
+ switch ($key) {
2200
+ case 'xap:CreateDate':
2201
+ case 'xap:ModifyDate':
2202
+ $this->xmp_array[$value] = strtotime($xmlarray[$key]);
2203
+ break;
2204
+ default:
2205
+ $this->xmp_array[$value] = $xmlarray[$key];
2206
+ }
2207
+ }
2208
+ }
2209
+ }
2210
+ // return one element if requested
2211
+ if ($object != false) {
2212
+ return isset($this->xmp_array[$object]) ? $this->xmp_array[$object] : false;
2213
+ }
2214
+ // on request sanitize the output
2215
+ if ($this->sanitize == true) {
2216
+ array_walk($this->xmp_array, 'esc_html');
2217
+ }
2218
+ return $this->xmp_array;
2219
+ }
2220
+ function setArrayValue(&$array, $stack, $value)
2221
+ {
2222
+ if ($stack) {
2223
+ $key = array_shift($stack);
2224
+ $this->setArrayValue($array[$key], $stack, $value);
2225
+ return $array;
2226
+ } else {
2227
+ $array = $value;
2228
+ }
2229
+ return $array;
2230
+ }
2231
+ /**
2232
+ * nggMeta::get_META() - return a meta value form the available list
2233
+ *
2234
+ * @param string $object
2235
+ * @return mixed $value
2236
+ */
2237
+ function get_META($object = false)
2238
+ {
2239
+ // defined order first look into database, then XMP, IPTC and EXIF.
2240
+ if ($value = $this->get_saved_meta($object)) {
2241
+ return $value;
2242
+ }
2243
+ if ($value = $this->get_XMP($object)) {
2244
+ return $value;
2245
+ }
2246
+ if ($object == 'created_timestamp' && ($d = $this->get_IPTC('created_date')) && ($t = $this->get_IPTC('created_time'))) {
2247
+ return $this->exif_date2ts($d . ' ' . $t);
2248
+ }
2249
+ if ($value = $this->get_IPTC($object)) {
2250
+ return $value;
2251
+ }
2252
+ if ($value = $this->get_EXIF($object)) {
2253
+ return $value;
2254
+ }
2255
+ // nothing found ?
2256
+ return false;
2257
+ }
2258
+ /**
2259
+ * nggMeta::i8n_name() - localize the tag name
2260
+ *
2261
+ * @param mixed $key
2262
+ * @return string Translated $key
2263
+ */
2264
+ function i18n_name($key)
2265
+ {
2266
+ $tagnames = array('aperture' => __('Aperture', 'nggallery'), 'credit' => __('Credit', 'nggallery'), 'camera' => __('Camera', 'nggallery'), 'caption' => __('Caption', 'nggallery'), 'created_timestamp' => __('Date/Time', 'nggallery'), 'copyright' => __('Copyright', 'nggallery'), 'focal_length' => __('Focal length', 'nggallery'), 'iso' => __('ISO', 'nggallery'), 'shutter_speed' => __('Shutter speed', 'nggallery'), 'title' => __('Title', 'nggallery'), 'author' => __('Author', 'nggallery'), 'tags' => __('Tags', 'nggallery'), 'subject' => __('Subject', 'nggallery'), 'make' => __('Make', 'nggallery'), 'status' => __('Edit Status', 'nggallery'), 'category' => __('Category', 'nggallery'), 'keywords' => __('Keywords', 'nggallery'), 'created_date' => __('Date Created', 'nggallery'), 'created_time' => __('Time Created', 'nggallery'), 'position' => __('Author Position', 'nggallery'), 'city' => __('City', 'nggallery'), 'location' => __('Location', 'nggallery'), 'state' => __('Province/State', 'nggallery'), 'country_code' => __('Country code', 'nggallery'), 'country' => __('Country', 'nggallery'), 'headline' => __('Headline', 'nggallery'), 'credit' => __('Credit', 'nggallery'), 'source' => __('Source', 'nggallery'), 'copyright' => __('Copyright Notice', 'nggallery'), 'contact' => __('Contact', 'nggallery'), 'last_modfied' => __('Last modified', 'nggallery'), 'tool' => __('Program tool', 'nggallery'), 'format' => __('Format', 'nggallery'), 'width' => __('Image Width', 'nggallery'), 'height' => __('Image Height', 'nggallery'), 'flash' => __('Flash', 'nggallery'));
2267
+ if (isset($tagnames[$key])) {
2268
+ $key = $tagnames[$key];
2269
+ }
2270
+ return $key;
2271
+ }
2272
+ /**
2273
+ * Return the Timestamp from the image , if possible it's read from exif data
2274
+ * @return string
2275
+ */
2276
+ function get_date_time()
2277
+ {
2278
+ $date = time();
2279
+ // Try getting the created_timestamp field
2280
+ $date = $this->exif_date2ts($this->get_META('created_timestamp'));
2281
+ if (!$date) {
2282
+ $image_path = C_Gallery_Storage::get_instance()->get_backup_abspath($this->image);
2283
+ $date = @filectime($image_path);
2284
+ }
2285
+ // Failback
2286
+ if (!$date) {
2287
+ $date = time();
2288
+ }
2289
+ // Return the MySQL format
2290
+ $date_time = date('Y-m-d H:i:s', $date);
2291
+ return $date_time;
2292
+ }
2293
+ /**
2294
+ * This function return the most common metadata, via a filter we can add more
2295
+ * Reason : GD manipulation removes that options
2296
+ *
2297
+ * @since V1.4.0
2298
+ * @return array|false
2299
+ */
2300
+ function get_common_meta()
2301
+ {
2302
+ global $wpdb;
2303
+ $meta = array('aperture' => 0, 'credit' => '', 'camera' => '', 'caption' => '', 'created_timestamp' => 0, 'copyright' => '', 'focal_length' => 0, 'iso' => 0, 'shutter_speed' => 0, 'flash' => 0, 'title' => '', 'keywords' => '');
2304
+ $meta = apply_filters('ngg_read_image_metadata', $meta);
2305
+ // meta should be still an array
2306
+ if (!is_array($meta)) {
2307
+ return false;
2308
+ }
2309
+ foreach ($meta as $key => $value) {
2310
+ $meta[$key] = $this->get_META($key);
2311
+ }
2312
+ //let's add now the size of the image
2313
+ $meta['width'] = $this->size[0];
2314
+ $meta['height'] = $this->size[1];
2315
+ return $meta;
2316
+ }
2317
+ /**
2318
+ * If needed sanitize each value before output
2319
+ *
2320
+ * @return void
2321
+ */
2322
+ function sanitize()
2323
+ {
2324
+ $this->sanitize = true;
2325
+ }
2326
+ /**
2327
+ * Wrapper to utf8_encode() that avoids double encoding
2328
+ *
2329
+ * Regex adapted from http://www.w3.org/International/questions/qa-forms-utf-8.en.php
2330
+ * to determine if the given string is already UTF-8. mb_detect_encoding() is not
2331
+ * always available and is limited in accuracy
2332
+ *
2333
+ * @param string $str
2334
+ * @return string
2335
+ */
2336
+ function utf8_encode($str)
2337
+ {
2338
+ $is_utf8 = preg_match('%^(?:
2339
+ [\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII
2340
+ | [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte
2341
+ | \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs
2342
+ | [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte
2343
+ | \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates
2344
+ | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3
2345
+ | [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15
2346
+ | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16
2347
+ )*$%xs', $str);
2348
+ if (!$is_utf8) {
2349
+ utf8_encode($str);
2350
+ }
2351
+ return $str;
2352
+ }
2353
+ }
2354
+ /**
2355
+ * gd.thumbnail.inc.php
2356
+ *
2357
+ * @author Ian Selby (ian@gen-x-design.com)
2358
+ * @copyright Copyright 2006-2011
2359
+ * @version 1.3.0 (based on 1.1.3)
2360
+ * @modded by Alex Rabe
2361
+ *
2362
+ */
2363
+ /**
2364
+ * PHP class for dynamically resizing, cropping, and rotating images for thumbnail purposes and either displaying them on-the-fly or saving them.
2365
+ *
2366
+ */
2367
+ class C_NggLegacy_Thumbnail
2368
+ {
2369
+ /**
2370
+ * Error message to display, if any
2371
+ *
2372
+ * @var string
2373
+ */
2374
+ var $errmsg;
2375
+ /**
2376
+ * Whether or not there is an error
2377
+ *
2378
+ * @var boolean
2379
+ */
2380
+ var $error;
2381
+ /**
2382
+ * Format of the image file
2383
+ *
2384
+ * @var string
2385
+ */
2386
+ var $format;
2387
+ /**
2388
+ * File name and path of the image file
2389
+ *
2390
+ * @var string
2391
+ */
2392
+ var $fileName;
2393
+ /**
2394
+ * Current dimensions of working image
2395
+ *
2396
+ * @var array
2397
+ */
2398
+ var $currentDimensions;
2399
+ /**
2400
+ * New dimensions of working image
2401
+ *
2402
+ * @var array
2403
+ */
2404
+ var $newDimensions;
2405
+ /**
2406
+ * Image resource for newly manipulated image
2407
+ *
2408
+ * @var resource
2409
+ * @access private
2410
+ */
2411
+ var $newImage;
2412
+ /**
2413
+ * Image resource for image before previous manipulation
2414
+ *
2415
+ * @var resource
2416
+ * @access private
2417
+ */
2418
+ var $oldImage;
2419
+ /**
2420
+ * Image resource for image being currently manipulated
2421
+ *
2422
+ * @var resource
2423
+ * @access private
2424
+ */
2425
+ var $workingImage;
2426
+ /**
2427
+ * Percentage to resize image by
2428
+ *
2429
+ * @var int
2430
+ * @access private
2431
+ */
2432
+ var $percent;
2433
+ /**
2434
+ * Maximum width of image during resize
2435
+ *
2436
+ * @var int
2437
+ * @access private
2438
+ */
2439
+ var $maxWidth;
2440
+ /**
2441
+ * Maximum height of image during resize
2442
+ *
2443
+ * @var int
2444
+ * @access private
2445
+ */
2446
+ var $maxHeight;
2447
+ /**
2448
+ * Image for Watermark
2449
+ *
2450
+ * @var string
2451
+ *
2452
+ */
2453
+ var $watermarkImgPath;
2454
+ /**
2455
+ * Text for Watermark
2456
+ *
2457
+ * @var string
2458
+ *
2459
+ */
2460
+ var $watermarkText;
2461
+ /**
2462
+ * Image Resource ID for Watermark
2463
+ *
2464
+ * @var string
2465
+ *
2466
+ */
2467
+ function __construct($fileName, $no_ErrorImage = false)
2468
+ {
2469
+ //make sure the GD library is installed
2470
+ if (!function_exists("gd_info")) {
2471
+ echo 'You do not have the GD Library installed. This class requires the GD library to function properly.' . "\n";
2472
+ echo 'visit http://us2.php.net/manual/en/ref.image.php for more information';
2473
+ throw new E_No_Image_Library_Exception();
2474
+ }
2475
+ //initialize variables
2476
+ $this->errmsg = '';
2477
+ $this->error = false;
2478
+ $this->currentDimensions = array();
2479
+ $this->newDimensions = array();
2480
+ $this->fileName = $fileName;
2481
+ $this->percent = 100;
2482
+ $this->maxWidth = 0;
2483
+ $this->maxHeight = 0;
2484
+ $this->watermarkImgPath = '';
2485
+ $this->watermarkText = '';
2486
+ //check to see if file exists
2487
+ if (!@file_exists($this->fileName)) {
2488
+ $this->errmsg = 'File not found';
2489
+ $this->error = true;
2490
+ } elseif (!is_readable($this->fileName)) {
2491
+ $this->errmsg = 'File is not readable';
2492
+ $this->error = true;
2493
+ }
2494
+ $image_size = null;
2495
+ //if there are no errors, determine the file format
2496
+ if ($this->error == false) {
2497
+ // set_time_limit(30);
2498
+ @ini_set('memory_limit', -1);
2499
+ $image_size = @getimagesize($this->fileName);
2500
+ if (isset($image_size) && is_array($image_size)) {
2501
+ $extensions = array('1' => 'GIF', '2' => 'JPG', '3' => 'PNG');
2502
+ $extension = array_key_exists($image_size[2], $extensions) ? $extensions[$image_size[2]] : '';
2503
+ if ($extension) {
2504
+ $this->format = $extension;
2505
+ } else {
2506
+ $this->errmsg = 'Unknown file format';
2507
+ $this->error = true;
2508
  }
2509
+ } else {
2510
+ $this->errmsg = 'File is not an image';
2511
+ $this->error = true;
2512
+ }
2513
+ }
2514
+ // increase memory-limit if possible, GD needs this for large images
2515
+ if (!extension_loaded('suhosin')) {
2516
+ @ini_set('memory_limit', '512M');
2517
+ }
2518
+ if ($this->error == false) {
2519
+ // Check memory consumption if file exists
2520
+ $this->checkMemoryForImage($this->fileName);
2521
+ }
2522
+ //initialize resources if no errors
2523
+ if ($this->error == false) {
2524
+ $img_err = null;
2525
+ switch ($this->format) {
2526
+ case 'GIF':
2527
+ if (function_exists('ImageCreateFromGif')) {
2528
+ $this->oldImage = @ImageCreateFromGif($this->fileName);
2529
+ } else {
2530
+ $img_err = __('Support for GIF format is missing.', 'nggallery');
2531
  }
2532
+ break;
2533
+ case 'JPG':
2534
+ if (function_exists('ImageCreateFromJpeg')) {
2535
+ $this->oldImage = @ImageCreateFromJpeg($this->fileName);
2536
+ } else {
2537
+ $img_err = __('Support for JPEG format is missing.', 'nggallery');
2538
  }
2539
+ break;
2540
+ case 'PNG':
2541
+ if (function_exists('ImageCreateFromPng')) {
2542
+ $this->oldImage = @ImageCreateFromPng($this->fileName);
2543
+ } else {
2544
+ $img_err = __('Support for PNG format is missing.', 'nggallery');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2545
  }
2546
+ break;
2547
+ }
2548
+ if (!$this->oldImage) {
2549
+ if ($img_err == null) {
2550
+ $img_err = __('Check memory limit', 'nggallery');
2551
  }
2552
+ $this->errmsg = sprintf(__('Create Image failed. %1$s', 'nggallery'), $img_err);
2553
+ $this->error = true;
2554
+ } else {
2555
+ $this->currentDimensions = array('width' => $image_size[0], 'height' => $image_size[1]);
2556
+ $this->newImage = $this->oldImage;
2557
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2558
  }
2559
+ if ($this->error == true) {
2560
+ if (!$no_ErrorImage) {
2561
+ $this->showErrorImage();
2562
+ }
2563
+ return;
 
 
 
 
 
 
 
 
 
 
 
2564
  }
 
2565
  }
2566
  /**
2567
+ * Calculate the memory limit
2568
+ * @param string $filename
2569
  *
 
2570
  */
2571
+ function checkMemoryForImage($filename)
2572
  {
2573
+ $imageInfo = getimagesize($filename);
2574
+ switch ($this->format) {
2575
+ case 'GIF':
2576
+ // measured factor 1 is better
2577
+ $CHANNEL = 1;
2578
+ break;
2579
+ case 'JPG':
2580
+ $CHANNEL = $imageInfo['channels'];
2581
+ break;
2582
+ case 'PNG':
2583
+ // didn't get the channel for png
2584
+ $CHANNEL = 3;
2585
+ break;
2586
  }
2587
+ $bits = !empty($imageInfo['bits']) ? $imageInfo['bits'] : 32;
2588
+ // imgInfo[bits] is not always available
2589
+ return $this->checkMemoryForData($imageInfo[0], $imageInfo[1], $CHANNEL, $bits);
2590
  }
2591
+ function checkMemoryForData($width, $height, $channels = null, $bits = null)
 
 
 
 
 
 
2592
  {
2593
+ $imageInfo = getimagesize($this->fileName);
2594
+ if ($channels == null) {
2595
+ switch ($this->format) {
2596
+ case 'GIF':
2597
+ // measured factor 1 is better
2598
+ $channels = 1;
2599
+ break;
2600
+ case 'JPG':
2601
+ $channels = $imageInfo['channels'];
2602
+ break;
2603
+ case 'PNG':
2604
+ // didn't get the channel for png
2605
+ $channels = 3;
2606
+ break;
2607
+ }
2608
  }
2609
+ if ($bits == null) {
2610
+ $bits = !empty($imageInfo['bits']) ? $imageInfo['bits'] : 32;
2611
+ }
2612
+ // imgInfo[bits] is not always available
2613
+ if (function_exists('memory_get_usage') && ini_get('memory_limit')) {
2614
+ $MB = 1048576;
2615
+ // number of bytes in 1M
2616
+ $K64 = 65536;
2617
+ // number of bytes in 64K
2618
+ $TWEAKFACTOR = 1.68;
2619
+ // Or whatever works for you
2620
+ $memoryNeeded = round((doubleval($width * $height * $bits * $channels) / 8 + $K64) * $TWEAKFACTOR);
2621
+ $memoryNeeded = memory_get_usage() + $memoryNeeded;
2622
+ // get memory limit
2623
+ $memory_limit = ini_get('memory_limit');
2624
+ // PHP docs : Note that to have no memory limit, set this directive to -1.
2625
+ if ($memory_limit == -1) {
2626
+ return true;
2627
+ }
2628
+ // Just check megabyte limits, not higher
2629
+ if (strtolower(substr($memory_limit, -1)) == 'm') {
2630
+ if ($memory_limit != '') {
2631
+ $memory_limit = intval(substr($memory_limit, 0, -1)) * 1024 * 1024;
2632
+ }
2633
+ if ($memoryNeeded > $memory_limit) {
2634
+ $memoryNeeded = round($memoryNeeded / 1024 / 1024, 2);
2635
+ $this->errmsg = 'Exceed Memory limit. Require : ' . $memoryNeeded . " MByte";
2636
+ $this->error = true;
2637
+ return false;
2638
+ }
2639
+ }
2640
+ }
2641
+ return true;
2642
  }
2643
+ function __destruct()
 
 
 
 
 
 
2644
  {
2645
+ $this->destruct();
2646
  }
2647
  /**
2648
+ * Must be called to free up allocated memory after all manipulations are done
2649
  *
 
 
 
2650
  */
2651
+ function destruct()
2652
  {
2653
+ if (is_resource($this->newImage)) {
2654
+ @ImageDestroy($this->newImage);
2655
+ }
2656
+ if (is_resource($this->oldImage)) {
2657
+ @ImageDestroy($this->oldImage);
2658
+ }
2659
+ if (is_resource($this->workingImage)) {
2660
+ @ImageDestroy($this->workingImage);
2661
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2662
  }
2663
  /**
2664
+ * Returns the current width of the image
2665
  *
2666
+ * @return int
2667
  */
2668
+ function getCurrentWidth()
2669
  {
2670
+ return $this->currentDimensions['width'];
2671
  }
2672
  /**
2673
+ * Returns the current height of the image
2674
  *
2675
+ * @return int
2676
  */
2677
+ function getCurrentHeight()
2678
  {
2679
+ return $this->currentDimensions['height'];
2680
  }
2681
  /**
2682
+ * Calculates new image width
2683
  *
2684
+ * @param int $width
2685
+ * @param int $height
2686
+ * @return array
 
2687
  */
2688
+ function calcWidth($width, $height)
2689
  {
2690
+ $newWp = 100 * $this->maxWidth / $width;
2691
+ $newHeight = $height * $newWp / 100;
2692
+ if (intval($newHeight) == $this->maxHeight - 1) {
2693
+ $newHeight = $this->maxHeight;
 
 
 
 
 
 
 
 
 
2694
  }
2695
+ return array('newWidth' => intval($this->maxWidth), 'newHeight' => intval($newHeight));
 
 
2696
  }
2697
  /**
2698
+ * Calculates new image height
2699
+ *
2700
+ * @param int $width
2701
+ * @param int $height
2702
+ * @return array
2703
  */
2704
+ function calcHeight($width, $height)
2705
  {
2706
+ $newHp = 100 * $this->maxHeight / $height;
2707
+ $newWidth = $width * $newHp / 100;
2708
+ if (intval($newWidth) == $this->maxWidth - 1) {
2709
+ $newWidth = $this->maxWidth;
2710
+ }
2711
+ return array('newWidth' => intval($newWidth), 'newHeight' => intval($this->maxHeight));
2712
  }
2713
  /**
2714
+ * Calculates new image size based on percentage
2715
  *
2716
+ * @param int $width
2717
+ * @param int $height
2718
+ * @return array
2719
  */
2720
+ function calcPercent($width, $height, $percent = -1)
2721
  {
2722
+ if ($percent == -1) {
2723
+ $percent = $this->percent;
2724
+ }
2725
+ $newWidth = $width * $percent / 100;
2726
+ $newHeight = $height * $percent / 100;
2727
+ return array('newWidth' => intval($newWidth), 'newHeight' => intval($newHeight));
2728
  }
2729
  /**
2730
+ * Calculates new image size based on width and height, while constraining to maxWidth and maxHeight
2731
+ *
2732
+ * @param int $width
2733
+ * @param int $height
2734
  */
2735
+ function calcImageSize($width, $height)
2736
  {
2737
+ // $width and $height are the CURRENT image resolutions
2738
+ $ratio_w = $this->maxWidth / $width;
2739
+ $ratio_h = $this->maxHeight / $height;
2740
+ if ($ratio_w >= $ratio_h) {
2741
+ $width = $this->maxWidth;
2742
+ $height = (int) round($height * $ratio_h, 0);
2743
+ } else {
2744
+ $height = $this->maxHeight;
2745
+ $width = (int) round($width * $ratio_w, 0);
2746
+ }
2747
+ $this->newDimensions = array('newWidth' => $width, 'newHeight' => $height);
2748
  }
2749
+ /**
2750
+ * Calculates new image size based percentage
2751
+ *
2752
+ * @param int $width
2753
+ * @param int $height
2754
+ */
2755
+ function calcImageSizePercent($width, $height)
2756
  {
2757
+ if ($this->percent > 0) {
2758
+ $this->newDimensions = $this->calcPercent($width, $height);
2759
+ }
2760
  }
2761
+ /**
2762
+ * Displays error image
2763
+ *
2764
+ */
2765
+ function showErrorImage()
2766
  {
2767
+ header('Content-type: image/png');
2768
+ $errImg = ImageCreate(220, 25);
2769
+ $bgColor = imagecolorallocate($errImg, 0, 0, 0);
2770
+ $fgColor1 = imagecolorallocate($errImg, 255, 255, 255);
2771
+ $fgColor2 = imagecolorallocate($errImg, 255, 0, 0);
2772
+ imagestring($errImg, 3, 6, 6, 'Error:', $fgColor2);
2773
+ imagestring($errImg, 3, 55, 6, $this->errmsg, $fgColor1);
2774
+ imagepng($errImg);
2775
+ imagedestroy($errImg);
2776
  }
2777
+ /**
2778
+ * Resizes image to fixed Width x Height
2779
+ *
2780
+ * @param int $Width
2781
+ * @param int $Height
2782
+ * @param int $deprecated Unused
2783
+ */
2784
+ function resizeFix($Width = 0, $Height = 0, $deprecated = 3)
2785
  {
2786
+ if (!$this->checkMemoryForData($Width, $Height)) {
2787
+ return;
2788
  }
2789
+ $this->newWidth = $Width;
2790
+ $this->newHeight = $Height;
2791
+ if (function_exists("ImageCreateTrueColor")) {
2792
+ $this->workingImage = ImageCreateTrueColor($this->newWidth, $this->newHeight);
2793
  } else {
2794
+ $this->workingImage = ImageCreate($this->newWidth, $this->newHeight);
2795
  }
2796
+ // ImageCopyResampled(
2797
+ $this->imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, 0, 0, $this->newWidth, $this->newHeight, $this->currentDimensions['width'], $this->currentDimensions['height']);
2798
+ $this->oldImage = $this->workingImage;
2799
+ $this->newImage = $this->workingImage;
2800
+ $this->currentDimensions['width'] = $this->newWidth;
2801
+ $this->currentDimensions['height'] = $this->newHeight;
2802
  }
2803
  /**
2804
+ * Resizes image to maxWidth x maxHeight
2805
  *
2806
+ * @param int $maxWidth
2807
+ * @param int $maxHeight
2808
+ * @param int $deprecated Unused
2809
  */
2810
+ function resize($maxWidth = 0, $maxHeight = 0, $deprecated = 3)
2811
  {
2812
+ if (!$this->checkMemoryForData($maxWidth, $maxHeight)) {
2813
+ return;
2814
  }
2815
+ $this->maxWidth = $maxWidth;
2816
+ $this->maxHeight = $maxHeight;
2817
+ $this->calcImageSize($this->currentDimensions['width'], $this->currentDimensions['height']);
2818
+ if ($this->workingImage != null && $this->workingImage != $this->oldImage) {
2819
+ ImageDestroy($this->workingImage);
2820
+ $this->workingImage = null;
2821
+ }
2822
+ if (function_exists("ImageCreateTrueColor")) {
2823
+ $this->workingImage = ImageCreateTrueColor($this->newDimensions['newWidth'], $this->newDimensions['newHeight']);
2824
+ } else {
2825
+ $this->workingImage = ImageCreate($this->newDimensions['newWidth'], $this->newDimensions['newHeight']);
2826
+ }
2827
+ // ImageCopyResampled(
2828
+ $this->imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, 0, 0, $this->newDimensions['newWidth'], $this->newDimensions['newHeight'], $this->currentDimensions['width'], $this->currentDimensions['height']);
2829
+ ImageDestroy($this->oldImage);
2830
+ $this->oldImage = $this->workingImage;
2831
+ $this->newImage = $this->workingImage;
2832
+ $this->currentDimensions['width'] = $this->newDimensions['newWidth'];
2833
+ $this->currentDimensions['height'] = $this->newDimensions['newHeight'];
2834
  }
2835
+ /**
2836
+ * Resizes the image by $percent percent
2837
+ *
2838
+ * @param int $percent
2839
+ */
2840
+ function resizePercent($percent = 0)
2841
  {
2842
+ $dims = $this->calcPercent($this->currentDimensions['width'], $this->currentDimensions['height'], $percent);
2843
+ if (!$this->checkMemoryForData($dims['newWidth'], $dims['newHeight'])) {
2844
+ return;
2845
+ }
2846
+ $this->percent = $percent;
2847
+ $this->calcImageSizePercent($this->currentDimensions['width'], $this->currentDimensions['height']);
2848
+ if (function_exists("ImageCreateTrueColor")) {
2849
+ $this->workingImage = ImageCreateTrueColor($this->newDimensions['newWidth'], $this->newDimensions['newHeight']);
2850
+ } else {
2851
+ $this->workingImage = ImageCreate($this->newDimensions['newWidth'], $this->newDimensions['newHeight']);
 
 
 
 
 
 
 
 
2852
  }
2853
+ $this->ImageCopyResampled($this->workingImage, $this->oldImage, 0, 0, 0, 0, $this->newDimensions['newWidth'], $this->newDimensions['newHeight'], $this->currentDimensions['width'], $this->currentDimensions['height']);
2854
+ $this->oldImage = $this->workingImage;
2855
+ $this->newImage = $this->workingImage;
2856
+ $this->currentDimensions['width'] = $this->newDimensions['newWidth'];
2857
+ $this->currentDimensions['height'] = $this->newDimensions['newHeight'];
2858
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2859
  /**
2860
+ * Crops the image from calculated center in a square of $cropSize pixels
2861
+ *
2862
+ * @param int $cropSize
 
 
2863
  */
2864
+ function cropFromCenter($cropSize)
2865
  {
2866
+ if ($cropSize > $this->currentDimensions['width']) {
2867
+ $cropSize = $this->currentDimensions['width'];
2868
  }
2869
+ if ($cropSize > $this->currentDimensions['height']) {
2870
+ $cropSize = $this->currentDimensions['height'];
 
 
2871
  }
2872
+ $cropX = intval(($this->currentDimensions['width'] - $cropSize) / 2);
2873
+ $cropY = intval(($this->currentDimensions['height'] - $cropSize) / 2);
2874
+ if ($this->workingImage != null && $this->workingImage != $this->oldImage) {
2875
+ ImageDestroy($this->workingImage);
2876
+ $this->workingImage = null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2877
  }
2878
+ if (function_exists("ImageCreateTrueColor")) {
2879
+ $this->workingImage = ImageCreateTrueColor($cropSize, $cropSize);
2880
+ } else {
2881
+ $this->workingImage = ImageCreate($cropSize, $cropSize);
2882
+ }
2883
+ $this->imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, $cropX, $cropY, $cropSize, $cropSize, $cropSize, $cropSize);
2884
+ $this->oldImage = $this->workingImage;
2885
+ $this->newImage = $this->workingImage;
2886
+ $this->currentDimensions['width'] = $cropSize;
2887
+ $this->currentDimensions['height'] = $cropSize;
2888
  }
2889
  /**
2890
+ * Advanced cropping function that crops an image using $startX and $startY as the upper-left hand corner.
2891
  *
2892
+ * @param int $startX
2893
+ * @param int $startY
2894
+ * @param int $width
2895
+ * @param int $height
2896
  */
2897
+ function crop($startX, $startY, $width, $height)
2898
  {
2899
+ if (!$this->checkMemoryForData($width, $height)) {
2900
+ return;
 
 
2901
  }
2902
+ //make sure the cropped area is not greater than the size of the image
2903
+ if ($width > $this->currentDimensions['width']) {
2904
+ $width = $this->currentDimensions['width'];
2905
  }
2906
+ if ($height > $this->currentDimensions['height']) {
2907
+ $height = $this->currentDimensions['height'];
 
 
 
 
 
2908
  }
2909
+ //make sure not starting outside the image
2910
+ if ($startX + $width > $this->currentDimensions['width']) {
2911
+ $startX = $this->currentDimensions['width'] - $width;
2912
  }
2913
+ if ($startY + $height > $this->currentDimensions['height']) {
2914
+ $startY = $this->currentDimensions['height'] - $height;
2915
+ }
2916
+ if ($startX < 0) {
2917
+ $startX = 0;
2918
+ }
2919
+ if ($startY < 0) {
2920
+ $startY = 0;
2921
+ }
2922
+ if ($this->workingImage != null && $this->workingImage != $this->oldImage) {
2923
+ ImageDestroy($this->workingImage);
2924
+ $this->workingImage = null;
2925
+ }
2926
+ if (function_exists("ImageCreateTrueColor")) {
2927
+ $this->workingImage = ImageCreateTrueColor($width, $height);
2928
+ } else {
2929
+ $this->workingImage = ImageCreate($width, $height);
2930
+ }
2931
+ $this->imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, $startX, $startY, $width, $height, $width, $height);
2932
+ ImageDestroy($this->oldImage);
2933
+ $this->oldImage = $this->workingImage;
2934
+ $this->newImage = $this->workingImage;
2935
+ $this->currentDimensions['width'] = $width;
2936
+ $this->currentDimensions['height'] = $height;
2937
  }
2938
  /**
2939
+ * Outputs the image to the screen, or saves to $name if supplied. Quality of JPEG images can be controlled with the $quality variable
 
2940
  *
2941
+ * @param int $quality
2942
+ * @param string $name
2943
  */
2944
+ function show($quality = 100, $name = '')
2945
  {
2946
+ switch ($this->format) {
2947
+ case 'GIF':
2948
+ if ($name != '') {
2949
+ @ImageGif($this->newImage, $name) or $this->error = true;
 
 
 
 
 
 
 
 
 
 
 
2950
  } else {
2951
+ header('Content-type: image/gif');
2952
+ ImageGif($this->newImage);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2953
  }
2954
+ break;
2955
+ case 'JPG':
2956
+ if ($name != '') {
2957
+ @ImageJpeg($this->newImage, $name, $quality) or $this->error = true;
2958
+ } else {
2959
+ header('Content-type: image/jpeg');
2960
+ ImageJpeg($this->newImage, NULL, $quality);
2961
  }
2962
+ break;
2963
+ case 'PNG':
2964
+ if ($name != '') {
2965
+ @ImagePng($this->newImage, $name) or $this->error = true;
2966
+ } else {
2967
+ header('Content-type: image/png');
2968
+ ImagePng($this->newImage);
2969
+ }
2970
+ break;
 
 
2971
  }
 
2972
  }
2973
+ /**
2974
+ * Saves image as $name (can include file path), with quality of # percent if file is a jpeg
2975
+ *
2976
+ * @param string $name
2977
+ * @param int $quality
2978
+ * @return bool errorstate
2979
+ */
2980
+ function save($name, $quality = 100)
2981
  {
2982
+ $this->show($quality, $name);
2983
+ if ($this->error == true) {
2984
+ $this->errmsg = 'Create Image failed. Check safe mode settings';
2985
+ return false;
2986
  }
2987
+ if (function_exists('do_action')) {
2988
+ do_action('ngg_ajax_image_save', $name);
 
 
 
 
 
 
 
 
2989
  }
2990
+ return true;
2991
  }
2992
  /**
2993
+ * Creates Apple-style reflection under image, optionally adding a border to main image
2994
  *
2995
+ * @param int $percent
2996
+ * @param int $reflection
2997
+ * @param int $white
2998
+ * @param bool $border
2999
+ * @param string $borderColor
3000
  */
3001
+ function createReflection($percent, $reflection, $white, $border = true, $borderColor = '#a4a4a4')
3002
  {
3003
+ $width = $this->currentDimensions['width'];
3004
+ $height = $this->currentDimensions['height'];
3005
+ $reflectionHeight = intval($height * ($reflection / 100));
3006
+ $newHeight = $height + $reflectionHeight;
3007
+ $reflectedPart = $height * ($percent / 100);
3008
+ $this->workingImage = ImageCreateTrueColor($width, $newHeight);
3009
+ ImageAlphaBlending($this->workingImage, true);
3010
+ $colorToPaint = ImageColorAllocateAlpha($this->workingImage, 255, 255, 255, 0);
3011
+ ImageFilledRectangle($this->workingImage, 0, 0, $width, $newHeight, $colorToPaint);
3012
+ imagecopyresampled($this->workingImage, $this->newImage, 0, 0, 0, $reflectedPart, $width, $reflectionHeight, $width, $height - $reflectedPart);
3013
+ $this->imageFlipVertical();
3014
+ imagecopy($this->workingImage, $this->newImage, 0, 0, 0, 0, $width, $height);
3015
+ imagealphablending($this->workingImage, true);
3016
+ for ($i = 0; $i < $reflectionHeight; $i++) {
3017
+ $colorToPaint = imagecolorallocatealpha($this->workingImage, 255, 255, 255, ($i / $reflectionHeight * -1 + 1) * $white);
3018
+ imagefilledrectangle($this->workingImage, 0, $height + $i, $width, $height + $i, $colorToPaint);
 
3019
  }
3020
+ if ($border == true) {
3021
+ $rgb = $this->hex2rgb($borderColor, false);
3022
+ $colorToPaint = imagecolorallocate($this->workingImage, $rgb[0], $rgb[1], $rgb[2]);
3023
+ imageline($this->workingImage, 0, 0, $width, 0, $colorToPaint);
3024
+ //top line
3025
+ imageline($this->workingImage, 0, $height, $width, $height, $colorToPaint);
3026
+ //bottom line
3027
+ imageline($this->workingImage, 0, 0, 0, $height, $colorToPaint);
3028
+ //left line
3029
+ imageline($this->workingImage, $width - 1, 0, $width - 1, $height, $colorToPaint);
3030
+ //right line
3031
  }
3032
+ $this->oldImage = $this->workingImage;
3033
+ $this->newImage = $this->workingImage;
3034
+ $this->currentDimensions['width'] = $width;
3035
+ $this->currentDimensions['height'] = $newHeight;
3036
  }
3037
  /**
3038
+ * Flip an image.
 
 
3039
  *
3040
+ * @param bool $horz flip the image in horizontal mode
3041
+ * @param bool $vert flip the image in vertical mode
3042
+ * @return true
3043
  */
3044
+ function flipImage($horz = false, $vert = false)
3045
  {
3046
+ $sx = $vert ? $this->currentDimensions['width'] - 1 : 0;
3047
+ $sy = $horz ? $this->currentDimensions['height'] - 1 : 0;
3048
+ $sw = $vert ? -$this->currentDimensions['width'] : $this->currentDimensions['width'];
3049
+ $sh = $horz ? -$this->currentDimensions['height'] : $this->currentDimensions['height'];
3050
+ $this->workingImage = imagecreatetruecolor($this->currentDimensions['width'], $this->currentDimensions['height']);
3051
+ $this->imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, $sx, $sy, $this->currentDimensions['width'], $this->currentDimensions['height'], $sw, $sh);
3052
+ $this->oldImage = $this->workingImage;
3053
+ $this->newImage = $this->workingImage;
3054
+ return true;
 
 
 
 
 
 
3055
  }
3056
  /**
3057
+ * Rotate an image clockwise or counter clockwise
3058
  *
3059
+ * @param string $dir Either CW or CCW
3060
+ * @return bool
3061
+ */
3062
+ function rotateImage($dir = 'CW')
3063
+ {
3064
+ $angle = $dir == 'CW' ? 90 : -90;
3065
+ return $this->rotateImageAngle($angle);
3066
+ }
3067
+ /**
3068
+ * Rotate an image clockwise or counter clockwise
3069
  *
3070
+ * @param int $angle Degrees to rotate the target image
3071
+ * @return bool
3072
  */
3073
+ function rotateImageAngle($angle = 90)
3074
  {
3075
+ if (function_exists('imagerotate')) {
3076
+ $this->workingImage = imagerotate($this->oldImage, 360 - $angle, 0);
3077
+ // imagerotate() rotates CCW
3078
+ $this->currentDimensions['width'] = imagesx($this->workingImage);
3079
+ $this->currentDimensions['height'] = imagesy($this->workingImage);
3080
+ $this->oldImage = $this->workingImage;
3081
+ $this->newImage = $this->workingImage;
3082
+ return true;
3083
  }
3084
+ $this->workingImage = imagecreatetruecolor($this->currentDimensions['height'], $this->currentDimensions['width']);
3085
+ imagealphablending($this->workingImage, false);
3086
+ imagesavealpha($this->workingImage, true);
3087
+ switch ($angle) {
3088
+ case 90:
3089
+ for ($x = 0; $x < $this->currentDimensions['width']; $x++) {
3090
+ for ($y = 0; $y < $this->currentDimensions['height']; $y++) {
3091
+ if (!imagecopy($this->workingImage, $this->oldImage, $this->currentDimensions['height'] - $y - 1, $x, $x, $y, 1, 1)) {
3092
+ return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3093
  }
 
3094
  }
3095
  }
3096
+ break;
3097
+ case -90:
3098
+ for ($x = 0; $x < $this->currentDimensions['width']; $x++) {
3099
+ for ($y = 0; $y < $this->currentDimensions['height']; $y++) {
3100
+ if (!imagecopy($this->workingImage, $this->oldImage, $y, $this->currentDimensions['width'] - $x - 1, $x, $y, 1, 1)) {
3101
+ return false;
3102
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
3103
  }
3104
  }
3105
+ break;
3106
+ default:
3107
+ return false;
 
 
3108
  }
3109
+ $this->currentDimensions['width'] = imagesx($this->workingImage);
3110
+ $this->currentDimensions['height'] = imagesy($this->workingImage);
3111
+ $this->oldImage = $this->workingImage;
3112
+ $this->newImage = $this->workingImage;
3113
+ return true;
3114
+ }
3115
+ /**
3116
+ * Inverts working image, used by reflection function
3117
+ *
3118
+ * @access private
3119
+ */
3120
+ function imageFlipVertical()
3121
+ {
3122
+ $x_i = imagesx($this->workingImage);
3123
+ $y_i = imagesy($this->workingImage);
3124
+ for ($x = 0; $x < $x_i; $x++) {
3125
+ for ($y = 0; $y < $y_i; $y++) {
3126
+ imagecopy($this->workingImage, $this->workingImage, $x, $y_i - $y - 1, $x, $y, 1, 1);
3127
+ }
3128
  }
 
3129
  }
3130
+ /**
3131
+ * Converts hexidecimal color value to rgb values and returns as array/string
3132
+ *
3133
+ * @param string $hex
3134
+ * @param bool $asString
3135
+ * @return array|string
3136
+ */
3137
+ function hex2rgb($hex, $asString = false)
3138
  {
3139
+ // strip off any leading #
3140
+ if (0 === strpos($hex, '#')) {
3141
+ $hex = substr($hex, 1);
 
3142
  } else {
3143
+ if (0 === strpos($hex, '&H')) {
3144
+ $hex = substr($hex, 2);
3145
+ }
3146
  }
3147
+ // break into hex 3-tuple
3148
+ $cutpoint = ceil(strlen($hex) / 2) - 1;
3149
+ $rgb = explode(':', wordwrap($hex, $cutpoint, ':', $cutpoint), 3);
3150
+ // convert each tuple to decimal
3151
+ $rgb[0] = isset($rgb[0]) ? hexdec($rgb[0]) : 0;
3152
+ $rgb[1] = isset($rgb[1]) ? hexdec($rgb[1]) : 0;
3153
+ $rgb[2] = isset($rgb[2]) ? hexdec($rgb[2]) : 0;
3154
+ return $asString ? "{$rgb[0]} {$rgb[1]} {$rgb[2]}" : $rgb;
3155
  }
3156
  /**
3157
+ * Based on the Watermark function by Marek Malcherek
3158
+ * http://www.malcherek.de
3159
  *
3160
+ * @param string $color
3161
+ * @param string $wmFont
3162
+ * @param int $wmSize
3163
+ * @param int $wmOpaque
3164
  */
3165
+ function watermarkCreateText($color = '000000', $wmFont, $wmSize = 10, $wmOpaque = 90)
3166
  {
3167
+ // set font path
3168
+ $wmFontPath = NGGALLERY_ABSPATH . "fonts/" . $wmFont;
3169
+ if (!is_readable($wmFontPath)) {
3170
+ return;
 
 
3171
  }
3172
+ // This function requires both the GD library and the FreeType library.
3173
+ if (!function_exists('ImageTTFBBox')) {
3174
+ return;
3175
  }
3176
+ $words = preg_split('/ /', $this->watermarkText);
3177
+ $lines = array();
3178
+ $line = '';
3179
+ $watermark_image_width = 0;
3180
+ // attempt adding a new word until the width is too large; then start a new line and start again
3181
+ foreach ($words as $word) {
3182
+ // sanitize the text being input; imagettftext() can be sensitive
3183
+ $TextSize = $this->ImageTTFBBoxDimensions($wmSize, 0, $this->correct_gd_unc_path($wmFontPath), $line . preg_replace('~^(&([a-zA-Z0-9]);)~', htmlentities('${1}'), mb_convert_encoding($word, "HTML-ENTITIES", "UTF-8")));
3184
+ if ($watermark_image_width == 0) {
3185
+ $watermark_image_width = $TextSize['width'];
3186
+ }
3187
+ if ($TextSize['width'] > $this->newDimensions['newWidth']) {
3188
+ $lines[] = trim($line);
3189
+ $line = '';
3190
+ } else {
3191
+ if ($TextSize['width'] > $watermark_image_width) {
3192
+ $watermark_image_width = $TextSize['width'];
3193
+ }
3194
+ }
3195
+ $line .= $word . ' ';
3196
  }
3197
+ $lines[] = trim($line);
3198
+ // use this string to determine our largest possible line height
3199
+ $line_dimensions = $this->ImageTTFBBoxDimensions($wmSize, 0, $this->correct_gd_unc_path($wmFontPath), 'MXQJALYmxqjabdfghjklpqry019`@$^&*(,!132');
3200
+ $line_height = $line_dimensions['height'] * 1.05;
3201
+ // Create an image to apply our text to
3202
+ $this->workingImage = ImageCreateTrueColor($watermark_image_width, count($lines) * $line_height);
3203
+ ImageSaveAlpha($this->workingImage, true);
3204
+ ImageAlphaBlending($this->workingImage, false);
3205
+ $bgText = imagecolorallocatealpha($this->workingImage, 255, 255, 255, 127);
3206
+ imagefill($this->workingImage, 0, 0, $bgText);
3207
+ $wmTransp = 127 - $wmOpaque * 1.27;
3208
+ $rgb = $this->hex2rgb($color, false);
3209
+ $TextColor = imagecolorallocatealpha($this->workingImage, $rgb[0], $rgb[1], $rgb[2], $wmTransp);
3210
+ // Put text on the image, line-by-line
3211
+ $y_pos = $wmSize;
3212
+ foreach ($lines as $line) {
3213
+ imagettftext($this->workingImage, $wmSize, 0, 0, $y_pos, $TextColor, $this->correct_gd_unc_path($wmFontPath), $line);
3214
+ $y_pos += $line_height;
3215
  }
3216
+ $this->watermarkImgPath = $this->workingImage;
3217
+ return;
3218
  }
3219
  /**
3220
+ * Returns a path that can be used with imagettftext() and ImageTTFBBox()
3221
  *
3222
+ * imagettftext() and ImageTTFBBox() cannot load resources from Windows UNC paths
3223
+ * and require they be mangled to be like //server\filename instead of \\server\filename
3224
+ * @param string $path Absolute file path
3225
+ * @return string $path Mangled absolute file path
3226
  */
3227
+ public function correct_gd_unc_path($path)
3228
  {
3229
+ if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' && substr($path, 0, 2) === '\\\\') {
3230
+ $path = ltrim($path, '\\\\');
3231
+ $path = '//' . $path;
3232
  }
3233
+ return $path;
3234
  }
3235
  /**
3236
+ * Calculates the width & height dimensions of ImageTTFBBox().
3237
+ *
3238
+ * Note: ImageTTFBBox() is unreliable with large font sizes
3239
+ * @param $wmSize
3240
+ * @param $fontAngle
3241
+ * @param $wmFontPath
3242
+ * @param $text
3243
+ * @return array
3244
  */
3245
+ function ImageTTFBBoxDimensions($wmSize, $fontAngle, $wmFontPath, $text)
3246
  {
3247
+ $box = @ImageTTFBBox($wmSize, $fontAngle, $this->correct_gd_unc_path($wmFontPath), $text);
3248
+ $max_x = max(array($box[0], $box[2], $box[4], $box[6]));
3249
+ $max_y = max(array($box[1], $box[3], $box[5], $box[7]));
3250
+ $min_x = min(array($box[0], $box[2], $box[4], $box[6]));
3251
+ $min_y = min(array($box[1], $box[3], $box[5], $box[7]));
3252
+ return array("width" => $max_x - $min_x, "height" => $max_y - $min_y);
3253
+ }
3254
+ function applyFilter($filterType)
3255
+ {
3256
+ $args = func_get_args();
3257
+ array_unshift($args, $this->newImage);
3258
+ return call_user_func_array('imagefilter', $args);
 
 
3259
  }
3260
  /**
3261
+ * Modfied Watermark function by Steve Peart
3262
+ * http://parasitehosting.com/
3263
  *
3264
+ * @param string $relPOS
3265
+ * @param int $xPOS
3266
+ * @param int $yPOS
3267
  */
3268
+ function watermarkImage($relPOS = 'botRight', $xPOS = 0, $yPOS = 0)
3269
  {
3270
+ // if it's a resource ID take it as watermark text image
3271
+ if (is_resource($this->watermarkImgPath)) {
3272
+ $this->workingImage = $this->watermarkImgPath;
3273
+ } else {
3274
+ // (possibly) search for the file from the document root
3275
+ if (!is_file($this->watermarkImgPath)) {
3276
+ $fs = C_Fs::get_instance();
3277
+ if (is_file($fs->join_paths($fs->get_document_root('content'), $this->watermarkImgPath))) {
3278
+ $this->watermarkImgPath = $fs->get_document_root('content') . $this->watermarkImgPath;
3279
+ }
3280
+ }
3281
+ // Would you really want to use anything other than a png?
3282
+ $this->workingImage = @imagecreatefrompng($this->watermarkImgPath);
3283
+ // if it's not a valid file die...
3284
+ if (empty($this->workingImage) or !$this->workingImage) {
3285
+ return;
3286
+ }
3287
  }
3288
+ imagealphablending($this->workingImage, false);
3289
+ imagesavealpha($this->workingImage, true);
3290
+ $sourcefile_width = imageSX($this->oldImage);
3291
+ $sourcefile_height = imageSY($this->oldImage);
3292
+ $watermarkfile_width = imageSX($this->workingImage);
3293
+ $watermarkfile_height = imageSY($this->workingImage);
3294
+ switch (substr($relPOS, 0, 3)) {
3295
+ case 'top':
3296
+ $dest_y = 0 + $yPOS;
3297
+ break;
3298
+ case 'mid':
3299
+ $dest_y = $sourcefile_height / 2 - $watermarkfile_height / 2;
3300
+ break;
3301
+ case 'bot':
3302
+ $dest_y = $sourcefile_height - $watermarkfile_height - $yPOS;
3303
+ break;
3304
+ default:
3305
+ $dest_y = 0;
3306
+ break;
3307
+ }
3308
+ switch (substr($relPOS, 3)) {
3309
+ case 'Left':
3310
+ $dest_x = 0 + $xPOS;
3311
+ break;
3312
+ case 'Center':
3313
+ $dest_x = $sourcefile_width / 2 - $watermarkfile_width / 2;
3314
+ break;
3315
+ case 'Right':
3316
+ $dest_x = $sourcefile_width - $watermarkfile_width - $xPOS;
3317
+ break;
3318
+ default:
3319
+ $dest_x = 0;
3320
+ break;
3321
+ }
3322
+ // debug
3323
+ // $this->errmsg = 'X '.$dest_x.' Y '.$dest_y;
3324
+ // $this->showErrorImage();
3325
+ // if a gif, we have to upsample it to a truecolor image
3326
+ if ($this->format == 'GIF') {
3327
+ $tempimage = imagecreatetruecolor($sourcefile_width, $sourcefile_height);
3328
+ imagecopy($tempimage, $this->oldImage, 0, 0, 0, 0, $sourcefile_width, $sourcefile_height);
3329
+ $this->newImage = $tempimage;
3330
  }
3331
+ $this->imagecopymerge_alpha($this->newImage, $this->workingImage, $dest_x, $dest_y, 0, 0, $watermarkfile_width, $watermarkfile_height, 100);
 
 
 
3332
  }
3333
  /**
3334
+ * Wrapper to imagecopymerge() that allows PNG transparency
 
 
3335
  */
3336
+ function imagecopymerge_alpha($destination_image, $source_image, $destination_x, $destination_y, $source_x, $source_y, $source_w, $source_h, $pct)
3337
  {
3338
+ $cut = imagecreatetruecolor($source_w, $source_h);
3339
+ imagecopy($cut, $destination_image, 0, 0, $destination_x, $destination_y, $source_w, $source_h);
3340
+ imagecopy($cut, $source_image, 0, 0, $source_x, $source_y, $source_w, $source_h);
3341
+ imagecopymerge($destination_image, $cut, $destination_x, $destination_y, 0, 0, $source_w, $source_h, $pct);
3342
  }
3343
  /**
3344
+ * Modfied imagecopyresampled function to save transparent images
3345
+ * See : http://www.akemapa.com/2008/07/10/php-gd-resize-transparent-image-png-gif/
3346
+ * @since 1.9.0
3347
+ *
3348
+ * @param resource $dst_image
3349
+ * @param resource $src_image
3350
+ * @param int $dst_x
3351
+ * @param int $dst_y
3352
+ * @param int $src_x
3353
+ * @param int $src_y
3354
+ * @param int $dst_w
3355
+ * @param int $dst_h
3356
+ * @param int $src_w
3357
+ * @param int $src_h
3358
+ * @return bool
3359
  */
3360
+ function imagecopyresampled(&$dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h)
3361
  {
3362
+ // Check if this image is PNG or GIF, then set if Transparent
3363
+ if ($this->format == 'GIF' || $this->format == 'PNG') {
3364
+ imagealphablending($dst_image, false);
3365
+ imagesavealpha($dst_image, true);
3366
+ $transparent = imagecolorallocatealpha($dst_image, 255, 255, 255, 127);
3367
+ imagefilledrectangle($dst_image, 0, 0, $dst_w, $dst_h, $transparent);
 
 
 
 
 
 
3368
  }
3369
+ imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
3370
+ return true;
3371
  }
3372
  }
3373
+ /**
3374
+ * Basic gallery storage methods; please consult the other available mixin.gallerystorage_base_(.*).php files before
3375
+ * adding new methods to this class: new methods may be more appropriately defined in other mixins.
3376
+ */
3377
+ class Mixin_GalleryStorage_Base extends Mixin
3378
  {
3379
  /**
3380
+ * Gets the id of a gallery, regardless of whether an integer
3381
+ * or object was passed as an argument
3382
+ * @param mixed $gallery_obj_or_id
3383
+ * @return null|int
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3384
  */
3385
+ function _get_gallery_id($gallery_obj_or_id)
3386
  {
3387
  $retval = NULL;
3388
+ $gallery_key = $this->object->_gallery_mapper->get_primary_key_column();
3389
+ if (is_object($gallery_obj_or_id)) {
3390
+ if (isset($gallery_obj_or_id->{$gallery_key})) {
3391
+ $retval = $gallery_obj_or_id->{$gallery_key};
 
3392
  }
3393
+ } elseif (is_numeric($gallery_obj_or_id)) {
3394
+ $retval = $gallery_obj_or_id;
3395
  }
3396
+ return $retval;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3397
  }
3398
  /**
3399
+ * Outputs/renders an image
3400
+ * @param int|stdClass|C_Image $image
3401
+ * @return bool
 
 
3402
  */
3403
+ function render_image($image, $size = FALSE)
3404
  {
3405
+ $format_list = $this->object->get_image_format_list();
3406
+ $abspath = $this->get_image_abspath($image, $size, true);
3407
+ if ($abspath == null) {
3408
+ $thumbnail = $this->object->generate_image_size($image, $size);
3409
+ if ($thumbnail != null) {
3410
+ $abspath = $thumbnail->fileName;
3411
+ $thumbnail->destruct();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3412
  }
3413
  }
3414
+ if ($abspath != null) {
3415
+ $data = @getimagesize($abspath);
3416
+ $format = 'jpg';
3417
+ if ($data != null && is_array($data) && isset($format_list[$data[2]])) {
3418
+ $format = $format_list[$data[2]];
3419
+ }
3420
+ // Clear output
3421
+ while (ob_get_level() > 0) {
3422
+ ob_end_clean();
3423
  }
3424
+ $format = strtolower($format);
3425
+ // output image and headers
3426
+ header('Content-type: image/' . $format);
3427
+ readfile($abspath);
3428
+ return true;
3429
  }
3430
+ return false;
3431
  }
3432
  /**
3433
+ * Sets a NGG image as a post thumbnail for the given post
 
 
 
3434
  */
3435
+ function set_post_thumbnail($postId, $image, $only_create_attachment = FALSE)
3436
  {
3437
+ $retval = FALSE;
3438
+ // attachment_id or FALSE
3439
+ // Get the post ID
3440
+ if (is_object($postId)) {
3441
+ $post = $postId;
3442
+ $postId = isset($post->ID) ? $post->ID : $post->post_id;
3443
  }
3444
+ // Get the image
3445
+ if (is_int($image)) {
3446
+ $imageId = $image;
3447
+ $mapper = C_Image_Mapper::get_instance();
3448
+ $image = $mapper->find($imageId);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3449
  }
3450
+ if ($image && $postId) {
3451
+ $attachment_id = $this->object->is_in_media_library($image->pid);
3452
+ if ($attachment_id === FALSE) {
3453
+ $attachment_id = $this->object->copy_to_media_library($image);
3454
+ }
3455
+ if ($attachment_id) {
3456
+ if (!$only_create_attachment) {
3457
+ set_post_thumbnail($postId, $attachment_id);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3458
  }
3459
+ $retval = $attachment_id;
3460
  }
 
 
 
 
3461
  }
3462
  return $retval;
3463
  }
3464
+ function convert_slashes($path)
3465
  {
3466
+ $search = array('/', "\\");
3467
+ $replace = array(DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR);
3468
+ return str_replace($search, $replace, $path);
3469
+ }
3470
+ /**
3471
+ * Empties the gallery cache directory of content
3472
+ * @param object $gallery
3473
+ */
3474
+ function flush_cache($gallery)
3475
+ {
3476
+ $cache = C_Cache::get_instance();
3477
+ $cache->flush_directory($this->object->get_cache_abspath($gallery));
3478
+ }
3479
+ /**
3480
+ * Sanitizes a directory path, replacing whitespace with dashes.
3481
+ *
3482
+ * Taken from WP' sanitize_file_name() and modified to not act on file extensions.
3483
+ *
3484
+ * Removes special characters that are illegal in filenames on certain
3485
+ * operating systems and special characters requiring special escaping
3486
+ * to manipulate at the command line. Replaces spaces and consecutive
3487
+ * dashes with a single dash. Trims period, dash and underscore from beginning
3488
+ * and end of filename. It is not guaranteed that this function will return a
3489
+ * filename that is allowed to be uploaded.
3490
+ * @param string $dirname The directory name to be sanitized
3491
+ * @return string The sanitized directory name
3492
+ */
3493
+ public function sanitize_directory_name($dirname)
3494
+ {
3495
+ $dirname_raw = $dirname;
3496
+ $special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "\$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", "%", "+", chr(0));
3497
+ $special_chars = apply_filters('sanitize_file_name_chars', $special_chars, $dirname_raw);
3498
+ $dirname = preg_replace("#\\x{00a0}#siu", ' ', $dirname);
3499
+ $dirname = str_replace($special_chars, '', $dirname);
3500
+ $dirname = str_replace(array('%20', '+'), '-', $dirname);
3501
+ $dirname = preg_replace('/[\\r\\n\\t -]+/', '-', $dirname);
3502
+ $dirname = trim($dirname, '.-_');
3503
+ return $dirname;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3504
  }
3505
+ }
3506
+ /**
3507
+ * Provides methods to C_Gallery_Storage related to dynamic images, thumbnails, clones, etc
3508
+ */
3509
+ class Mixin_GalleryStorage_Base_Dynamic extends Mixin
3510
+ {
3511
  /**
3512
  * Returns an array of dimensional properties (width, height, real_width, real_height) of a resulting clone image if and when generated
3513
  * @param object|int $image Image ID or an image object
3534
  return $retval;
3535
  }
3536
  /**
3537
+ * Generates a "clone" for an existing image, the clone can be altered using the $params array
3538
+ * @param string $image_path
3539
+ * @param string $clone_path
3540
+ * @param array $params
3541
+ * @return null|object
 
3542
  */
3543
+ function generate_image_clone($image_path, $clone_path, $params)
3544
  {
3545
+ $crop = isset($params['crop']) ? $params['crop'] : NULL;
3546
+ $watermark = isset($params['watermark']) ? $params['watermark'] : NULL;
3547
+ $reflection = isset($params['reflection']) ? $params['reflection'] : NULL;
3548
+ $rotation = isset($params['rotation']) ? $params['rotation'] : NULL;
3549
+ $flip = isset($params['flip']) ? $params['flip'] : NULL;
3550
+ $destpath = NULL;
3551
+ $thumbnail = NULL;
3552
+ $result = $this->object->calculate_image_clone_result($image_path, $clone_path, $params);
3553
+ // XXX this should maybe be removed and extra settings go into $params?
3554
+ $settings = apply_filters('ngg_settings_during_image_generation', C_NextGen_Settings::get_instance()->to_array());
3555
  // Ensure we have a valid image
3556
+ if ($image_path && @file_exists($image_path) && $result != null && !isset($result['error'])) {
3557
+ $image_dir = dirname($image_path);
3558
+ $clone_path = $result['clone_path'];
3559
+ $clone_dir = $result['clone_directory'];
3560
+ $clone_format = $result['clone_format'];
3561
+ $format_list = $this->object->get_image_format_list();
3562
+ // Ensure target directory exists, but only create 1 subdirectory
3563
+ if (!@file_exists($clone_dir)) {
3564
+ if (strtolower(realpath($image_dir)) != strtolower(realpath($clone_dir))) {
3565
+ if (strtolower(realpath($image_dir)) == strtolower(realpath(dirname($clone_dir)))) {
3566
+ wp_mkdir_p($clone_dir);
3567
+ }
3568
  }
3569
  }
3570
+ $method = $result['method'];
3571
+ $width = $result['width'];
3572
+ $height = $result['height'];
3573
+ $quality = $result['quality'];
3574
+ if ($quality == null) {
3575
+ $quality = 100;
3576
+ }
3577
+ if ($method == 'wordpress') {
3578
+ $original = wp_get_image_editor($image_path);
3579
+ $destpath = $clone_path;
3580
+ if (!is_wp_error($original)) {
3581
+ $original->resize($width, $height, $crop);
3582
+ $original->set_quality($quality);
3583
+ $original->save($clone_path);
3584
+ }
3585
+ } else {
3586
+ if ($method == 'nextgen') {
3587
+ $destpath = $clone_path;
3588
+ $thumbnail = new C_NggLegacy_Thumbnail($image_path, true);
3589
+ if (!$thumbnail->error) {
3590
+ if ($crop) {
3591
+ $crop_area = $result['crop_area'];
3592
+ $crop_x = $crop_area['x'];
3593
+ $crop_y = $crop_area['y'];
3594
+ $crop_width = $crop_area['width'];
3595
+ $crop_height = $crop_area['height'];
3596
+ $thumbnail->crop($crop_x, $crop_y, $crop_width, $crop_height);
3597
+ }
3598
+ $thumbnail->resize($width, $height);
3599
+ } else {
3600
+ $thumbnail = NULL;
3601
+ }
3602
+ }
3603
  }
 
 
 
3604
  // We successfully generated the thumbnail
3605
+ if (is_string($destpath) && (@file_exists($destpath) || $thumbnail != null)) {
3606
+ if ($clone_format != null) {
3607
+ if (isset($format_list[$clone_format])) {
3608
+ $clone_format_extension = $format_list[$clone_format];
3609
+ $clone_format_extension_str = null;
3610
+ if ($clone_format_extension != null) {
3611
+ $clone_format_extension_str = '.' . $clone_format_extension;
3612
+ }
3613
+ $destpath_info = M_I18n::mb_pathinfo($destpath);
3614
+ $destpath_extension = $destpath_info['extension'];
3615
+ if (strtolower($destpath_extension) != strtolower($clone_format_extension)) {
3616
+ $destpath_dir = $destpath_info['dirname'];
3617
+ $destpath_basename = $destpath_info['filename'];
3618
+ $destpath_new = $destpath_dir . DIRECTORY_SEPARATOR . $destpath_basename . $clone_format_extension_str;
3619
+ if (@file_exists($destpath) && rename($destpath, $destpath_new) || $thumbnail != null) {
3620
+ $destpath = $destpath_new;
3621
+ }
3622
+ }
3623
+ }
3624
+ }
3625
+ if (is_null($thumbnail)) {
3626
+ $thumbnail = new C_NggLegacy_Thumbnail($destpath, true);
3627
+ if ($thumbnail->error) {
3628
+ $thumbnail = null;
3629
+ return null;
3630
+ }
3631
  } else {
3632
+ $thumbnail->fileName = $destpath;
3633
  }
3634
+ // This is quite odd, when watermark equals int(0) it seems all statements below ($watermark == 'image') and ($watermark == 'text') both evaluate as true
3635
+ // so we set it at null if it evaluates to any null-like value
3636
+ if ($watermark == null) {
3637
+ $watermark = null;
3638
  }
3639
+ if ($watermark == 1 || $watermark === true) {
3640
+ $watermark_setting_keys = array('wmFont', 'wmType', 'wmPos', 'wmXpos', 'wmYpos', 'wmPath', 'wmText', 'wmOpaque', 'wmFont', 'wmSize', 'wmColor');
3641
+ foreach ($watermark_setting_keys as $watermark_key) {
3642
+ if (!isset($params[$watermark_key])) {
3643
+ $params[$watermark_key] = $settings[$watermark_key];
3644
+ }
3645
+ }
3646
+ if (in_array(strval($params['wmType']), array('image', 'text'))) {
3647
+ $watermark = $params['wmType'];
3648
+ } else {
3649
+ $watermark = 'text';
3650
+ }
3651
+ }
3652
+ $watermark = strval($watermark);
3653
+ if ($watermark == 'image') {
3654
+ $thumbnail->watermarkImgPath = $params['wmPath'];
3655
+ $thumbnail->watermarkImage($params['wmPos'], $params['wmXpos'], $params['wmYpos']);
3656
+ } else {
3657
+ if ($watermark == 'text') {
3658
+ $thumbnail->watermarkText = $params['wmText'];
3659
+ $thumbnail->watermarkCreateText($params['wmColor'], $params['wmFont'], $params['wmSize'], $params['wmOpaque']);
3660
+ $thumbnail->watermarkImage($params['wmPos'], $params['wmXpos'], $params['wmYpos']);
3661
+ }
3662
+ }
3663
+ if ($rotation && in_array(abs($rotation), array(90, 180, 270))) {
3664
+ $thumbnail->rotateImageAngle($rotation);
3665
  }
3666
+ $flip = strtolower($flip);
3667
+ if ($flip && in_array($flip, array('h', 'v', 'hv'))) {
3668
+ $flip_h = in_array($flip, array('h', 'hv'));
3669
+ $flip_v = in_array($flip, array('v', 'hv'));
3670
+ $thumbnail->flipImage($flip_h, $flip_v);
3671
  }
3672
+ if ($reflection) {
3673
+ $thumbnail->createReflection(40, 40, 50, FALSE, '#a4a4a4');
 
 
3674
  }
3675
+ if ($clone_format != null && isset($format_list[$clone_format])) {
3676
+ // Force format
3677
+ $thumbnail->format = strtoupper($format_list[$clone_format]);
3678
  }
3679
+ $thumbnail = apply_filters('ngg_before_save_thumbnail', $thumbnail);
3680
+ $exif_iptc = @C_Exif_Writer_Wrapper::read_metadata($image_path);
3681
+ $thumbnail->save($destpath, $quality);
3682
+ @C_Exif_Writer_Wrapper::write_metadata($destpath, $exif_iptc);
3683
  }
3684
  }
3685
+ return $thumbnail;
3686
  }
3687
  /**
3688
+ * Returns an array of dimensional properties (width, height, real_width, real_height) of a resulting clone image if and when generated
3689
+ * @param string $image_path
3690
+ * @param string $clone_path
3691
+ * @param array $params
3692
+ * @return null|array
3693
  */
3694
+ function calculate_image_clone_dimensions($image_path, $clone_path, $params)
3695
  {
3696
+ $retval = null;
3697
+ $result = $this->object->calculate_image_clone_result($image_path, $clone_path, $params);
3698
+ if ($result != null) {
3699
+ $retval = array('width' => $result['width'], 'height' => $result['height'], 'real_width' => $result['real_width'], 'real_height' => $result['real_height']);
 
3700
  }
3701
  return $retval;
3702
  }
3703
  /**
3704
+ * Returns an array of properties of a resulting clone image if and when generated
3705
+ * @param string $image_path
3706
+ * @param string $clone_path
3707
+ * @param array $params
3708
+ * @return null|array
3709
  */
3710
+ function calculate_image_clone_result($image_path, $clone_path, $params)
3711
  {
3712
+ $width = isset($params['width']) ? $params['width'] : NULL;
3713
+ $height = isset($params['height']) ? $params['height'] : NULL;
3714
+ $quality = isset($params['quality']) ? $params['quality'] : NULL;
3715
+ $type = isset($params['type']) ? $params['type'] : NULL;
3716
+ $crop = isset($params['crop']) ? $params['crop'] : NULL;
3717
+ $watermark = isset($params['watermark']) ? $params['watermark'] : NULL;
3718
+ $rotation = isset($params['rotation']) ? $params['rotation'] : NULL;
3719
+ $reflection = isset($params['reflection']) ? $params['reflection'] : NULL;
3720
+ $crop_frame = isset($params['crop_frame']) ? $params['crop_frame'] : NULL;
3721
+ $result = NULL;
3722
+ // Ensure we have a valid image
3723
+ if ($image_path && @file_exists($image_path)) {
3724
+ // Ensure target directory exists, but only create 1 subdirectory
3725
+ $image_dir = dirname($image_path);
3726
+ $clone_dir = dirname($clone_path);
3727
+ $image_extension = M_I18n::mb_pathinfo($image_path, PATHINFO_EXTENSION);
3728
+ $image_extension_str = null;
3729
+ $clone_extension = M_I18n::mb_pathinfo($clone_path, PATHINFO_EXTENSION);
3730
+ $clone_extension_str = null;
3731
+ if ($image_extension != null) {
3732
+ $image_extension_str = '.' . $image_extension;
3733
  }
3734
+ if ($clone_extension != null) {
3735
+ $clone_extension_str = '.' . $clone_extension;
 
 
 
 
3736
  }
3737
+ $image_basename = M_I18n::mb_basename($image_path);
3738
+ $clone_basename = M_I18n::mb_basename($clone_path);
3739
+ // We use a default suffix as passing in null as the suffix will make WordPress use a default
3740
+ $clone_suffix = null;
3741
+ $format_list = $this->object->get_image_format_list();
3742
+ $clone_format = null;
3743
+ // format is determined below and based on $type otherwise left to null
3744
+ // suffix is only used to reconstruct paths for image_resize function
3745
+ if (strpos($clone_basename, $image_basename) === 0) {
3746
+ $clone_suffix = substr($clone_basename, strlen($image_basename));
3747
  }
3748
+ if ($clone_suffix != null && $clone_suffix[0] == '-') {
3749
+ // WordPress adds '-' on its own
3750
+ $clone_suffix = substr($clone_suffix, 1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3751
  }
3752
+ // Get original image dimensions
3753
+ $dimensions = getimagesize($image_path);
3754
+ if ($width == null && $height == null) {
3755
+ if ($dimensions != null) {
3756
+ if ($width == null) {
3757
+ $width = $dimensions[0];
3758
+ }
3759
+ if ($height == null) {
3760
+ $height = $dimensions[1];
3761
+ }
3762
+ } else {
3763
+ // XXX Don't think there's any other option here but to fail miserably...use some hard-coded defaults maybe?
3764
+ return null;
3765
+ }
3766
  }
3767
+ if ($dimensions != null) {
3768
+ $dimensions_ratio = $dimensions[0] / $dimensions[1];
3769
+ if ($width == null) {
3770
+ $width = (int) round($height * $dimensions_ratio);
3771
+ if ($width == $dimensions[0] - 1) {
3772
+ $width = $dimensions[0];
3773
+ }
3774
+ } else {
3775
+ if ($height == null) {
3776
+ $height = (int) round($width / $dimensions_ratio);
3777
+ if ($height == $dimensions[1] - 1) {
3778
+ $height = $dimensions[1];
3779
+ }
3780
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3781
  }
3782
+ if ($width > $dimensions[0]) {
3783
+ $width = $dimensions[0];
 
3784
  }
3785
+ if ($height > $dimensions[1]) {
3786
+ $height = $dimensions[1];
3787
+ }
3788
+ $image_format = $dimensions[2];
3789
+ if ($type != null) {
3790
+ if (is_string($type)) {
3791
+ $type = strtolower($type);
3792
+ // Indexes in the $format_list array correspond to IMAGETYPE_XXX values appropriately
3793
+ if (($index = array_search($type, $format_list)) !== false) {
3794
+ $type = $index;
3795
+ if ($type != $image_format) {
3796
+ // Note: this only changes the FORMAT of the image but not the extension
3797
+ $clone_format = $type;
3798
+ }
3799
+ }
3800
  }
3801
  }
3802
+ }
3803
+ if ($width == null || $height == null) {
3804
+ // Something went wrong...
3805
+ return null;
3806
+ }
3807
+ $result['clone_path'] = $clone_path;
3808
+ $result['clone_directory'] = $clone_dir;
3809
+ $result['clone_suffix'] = $clone_suffix;
3810
+ $result['clone_format'] = $clone_format;
3811
+ $result['base_width'] = $dimensions[0];
3812
+ $result['base_height'] = $dimensions[1];
3813
+ // image_resize() has limitations:
3814
+ // - no easy crop frame support
3815
+ // - fails if the dimensions are unchanged
3816
+ // - doesn't support filename prefix, only suffix so names like thumbs_original_name.jpg for $clone_path are not supported
3817
+ // also suffix cannot be null as that will make WordPress use a default suffix...we could use an object that returns empty string from __toString() but for now just fallback to ngg generator
3818
+ if (FALSE) {
3819
+ // disabling the WordPress method for Iteration #6
3820
+ // if (($crop_frame == null || !$crop) && ($dimensions[0] != $width && $dimensions[1] != $height) && $clone_suffix != null)
3821
+ $result['method'] = 'wordpress';
3822
+ $new_dims = image_resize_dimensions($dimensions[0], $dimensions[1], $width, $height, $crop);
3823
+ if ($new_dims) {
3824
+ list($dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) = $new_dims;
3825
+ $width = $dst_w;
3826
+ $height = $dst_h;
3827
+ } else {
3828
+ $result['error'] = new WP_Error('error_getting_dimensions', __('Could not calculate resized image dimensions'));
3829
+ }
3830
+ } else {
3831
+ $result['method'] = 'nextgen';
3832
+ $original_width = $dimensions[0];
3833
+ $original_height = $dimensions[1];
3834
+ $aspect_ratio = $width / $height;
3835
+ $orig_ratio_x = $original_width / $width;
3836
+ $orig_ratio_y = $original_height / $height;
3837
+ if ($crop) {
3838
+ $algo = 'shrink';
3839
+ // either 'adapt' or 'shrink'
3840
+ if ($crop_frame != null) {
3841
+ $crop_x = (int) round($crop_frame['x']);
3842
+ $crop_y = (int) round($crop_frame['y']);
3843
+ $crop_width = (int) round($crop_frame['width']);
3844
+ $crop_height = (int) round($crop_frame['height']);
3845
+ $crop_final_width = (int) round($crop_frame['final_width']);
3846
+ $crop_final_height = (int) round($crop_frame['final_height']);
3847
+ $crop_width_orig = $crop_width;
3848
+ $crop_height_orig = $crop_height;
3849
+ $crop_factor_x = $crop_width / $crop_final_width;
3850
+ $crop_factor_y = $crop_height / $crop_final_height;
3851
+ $crop_ratio_x = $crop_width / $width;
3852
+ $crop_ratio_y = $crop_height / $height;
3853
+ if ($algo == 'adapt') {
3854
+ // XXX not sure about this...don't use for now
3855
+ # $crop_width = (int) round($width * $crop_factor_x);
3856
+ # $crop_height = (int) round($height * $crop_factor_y);
3857
+ } else {
3858
+ if ($algo == 'shrink') {
3859
+ if ($crop_ratio_x < $crop_ratio_y) {
3860
+ $crop_width = max($crop_width, $width);
3861
+ $crop_height = (int) round($crop_width / $aspect_ratio);
3862
+ } else {
3863
+ $crop_height = max($crop_height, $height);
3864
+ $crop_width = (int) round($crop_height * $aspect_ratio);
3865
+ }
3866
+ if ($crop_width == $crop_width_orig - 1) {
3867
+ $crop_width = $crop_width_orig;
3868
+ }
3869
+ if ($crop_height == $crop_height_orig - 1) {
3870
+ $crop_height = $crop_height_orig;
3871
+ }
3872
+ }
3873
+ }
3874
+ $crop_diff_x = (int) round(($crop_width_orig - $crop_width) / 2);
3875
+ $crop_diff_y = (int) round(($crop_height_orig - $crop_height) / 2);
3876
+ $crop_x += $crop_diff_x;
3877
+ $crop_y += $crop_diff_y;
3878
+ $crop_max_x = $crop_x + $crop_width;
3879
+ $crop_max_y = $crop_y + $crop_height;
3880
+ // Check if we're overflowing borders
3881
+ //
3882
+ if ($crop_x < 0) {
3883
+ $crop_x = 0;
3884
+ } else {
3885
+ if ($crop_max_x > $original_width) {
3886
+ $crop_x -= $crop_max_x - $original_width;
3887
+ }
3888
+ }
3889
+ if ($crop_y < 0) {
3890
+ $crop_y = 0;
3891
+ } else {
3892
+ if ($crop_max_y > $original_height) {
3893
+ $crop_y -= $crop_max_y - $original_height;
3894
+ }
3895
+ }
3896
+ } else {
3897
+ if ($orig_ratio_x < $orig_ratio_y) {
3898
+ $crop_width = $original_width;
3899
+ $crop_height = (int) round($height * $orig_ratio_x);
3900
+ } else {
3901
+ $crop_height = $original_height;
3902
+ $crop_width = (int) round($width * $orig_ratio_y);
3903
+ }
3904
+ if ($crop_width == $width - 1) {
3905
+ $crop_width = $width;
3906
+ }
3907
+ if ($crop_height == $height - 1) {
3908
+ $crop_height = $height;
3909
+ }
3910
+ $crop_x = (int) round(($original_width - $crop_width) / 2);
3911
+ $crop_y = (int) round(($original_height - $crop_height) / 2);
3912
  }
3913
+ $result['crop_area'] = array('x' => $crop_x, 'y' => $crop_y, 'width' => $crop_width, 'height' => $crop_height);
3914
+ } else {
3915
+ // Just constraint dimensions to ensure there's no stretching or deformations
3916
+ list($width, $height) = wp_constrain_dimensions($original_width, $original_height, $width, $height);
3917
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3918
  }
3919
+ $result['width'] = $width;
3920
+ $result['height'] = $height;
3921
+ $result['quality'] = $quality;
3922
+ $real_width = $width;
3923
+ $real_height = $height;
3924
+ if ($rotation && in_array(abs($rotation), array(90, 270))) {
3925
+ $real_width = $height;
3926
+ $real_height = $width;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3927
  }
3928
+ if ($reflection) {
3929
+ // default for nextgen was 40%, this is used in generate_image_clone as well
3930
+ $reflection_amount = 40;
3931
+ // Note, round() would probably be best here but using the same code that C_NggLegacy_Thumbnail uses for compatibility
3932
+ $reflection_height = intval($real_height * ($reflection_amount / 100));
3933
+ $real_height = $real_height + $reflection_height;
 
 
 
3934
  }
3935
+ $result['real_width'] = $real_width;
3936
+ $result['real_height'] = $real_height;
3937
  }
3938
+ return $result;
3939
  }
3940
  /**
3941
+ * Generates a specific size for an image
3942
+ * @param int|object|C_Image $image
3943
+ * @param string $size
3944
+ * @param array|null $params (optional)
3945
+ * @param bool $skip_defaults (optional)
3946
+ * @return bool|object
3947
  */
3948
+ function generate_image_size($image, $size, $params = null, $skip_defaults = false)
3949
  {
3950
  $retval = FALSE;
3951
+ // Get the image entity
3952
+ if (is_numeric($image)) {
3953
+ $image = $this->object->_image_mapper->find($image);
 
 
 
 
 
 
 
 
3954
  }
3955
+ // Ensure we have a valid image
3956
+ if ($image) {
3957
+ $params = $this->object->get_image_size_params($image, $size, $params, $skip_defaults);
3958
+ $settings = C_NextGen_Settings::get_instance();
3959
+ // Get the image filename
3960
+ $filename = $this->object->get_original_abspath($image, 'original');
3961
+ $thumbnail = null;
3962
+ if ($size == 'full' && $settings->imgBackup == 1) {
3963
+ // XXX change this? 'full' should be the resized path and 'original' the _backup path
3964
+ $backup_path = $this->object->get_backup_abspath($image);
3965
+ if (!@file_exists($backup_path)) {
3966
+ @copy($filename, $backup_path);
3967
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3968
  }
3969
+ // Generate the thumbnail using WordPress
3970
+ $existing_image_abpath = $this->object->get_image_abspath($image, $size);
3971
+ $existing_image_dir = dirname($existing_image_abpath);
3972
+ wp_mkdir_p($existing_image_dir);
3973
+ $clone_path = $existing_image_abpath;
3974
+ $thumbnail = $this->object->generate_image_clone($filename, $clone_path, $params);
3975
+ // We successfully generated the thumbnail
3976
+ if ($thumbnail != null) {
3977
+ $clone_path = $thumbnail->fileName;
3978
+ if (function_exists('getimagesize')) {
3979
+ $dimensions = getimagesize($clone_path);
3980
+ } else {
3981
+ $dimensions = array($params['width'], $params['height']);
 
 
3982
  }
3983
+ if (!isset($image->meta_data)) {
3984
+ $image->meta_data = array();
 
 
 
 
 
 
 
 
 
 
 
 
3985
  }
3986
+ $size_meta = array('width' => $dimensions[0], 'height' => $dimensions[1], 'filename' => M_I18n::mb_basename($clone_path), 'generated' => microtime());
3987
+ if (isset($params['crop_frame'])) {
3988
+ $size_meta['crop_frame'] = $params['crop_frame'];
 
3989
  }
3990
+ $image->meta_data[$size] = $size_meta;
3991
+ if ($size == 'full') {
3992
+ $image->meta_data['width'] = $size_meta['width'];
3993
+ $image->meta_data['height'] = $size_meta['height'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3994
  }
3995
+ $retval = $this->object->_image_mapper->save($image);
3996
+ do_action('ngg_generated_image', $image, $size, $params);
3997
+ if ($retval == 0) {
3998
+ $retval = false;
3999
  }
4000
+ if ($retval) {
4001
+ $retval = $thumbnail;
 
 
 
 
 
 
 
 
4002
  }
4003
+ } else {
4004
+ // Something went wrong. Thumbnail generation failed!
4005
  }
 
 
 
 
 
 
 
 
4006
  }
4007
+ return $retval;
4008
+ }
4009
+ function generate_resized_image($image, $save = TRUE)
4010
+ {
4011
+ $image_abspath = $this->object->get_image_abspath($image, 'full');
4012
+ $generated = $this->object->generate_image_clone($image_abspath, $image_abspath, $this->object->get_image_size_params($image, 'full'));
4013
+ if ($generated && $save) {
4014
+ // Ensure that fullsize dimensions are added to metadata array
4015
+ $dimensions = getimagesize($image_abspath);
4016
+ $full_meta = array('width' => $dimensions[0], 'height' => $dimensions[1], 'md5' => $this->object->get_image_checksum($image, 'full'));
4017
+ if (!isset($image->meta_data) or is_string($image->meta_data) && strlen($image->meta_data) == 0 or is_bool($image->meta_data)) {
4018
+ $image->meta_data = array();
4019
+ }
4020
+ $image->meta_data = array_merge($image->meta_data, $full_meta);
4021
+ $image->meta_data['full'] = $full_meta;
4022
+ // Don't forget to append the 'full' entry in meta_data in the db
4023
+ $this->object->_image_mapper->save($image);
4024
  }
 
 
 
4025
  }
4026
  /**
4027
+ * Generates a thumbnail for an image
 
4028
  * @param int|stdClass|C_Image $image
4029
+ * @return bool
4030
  */
4031
+ function generate_thumbnail($image, $params = null, $skip_defaults = false)
4032
  {
4033
+ $sized_image = $this->object->generate_image_size($image, 'thumbnail', $params, $skip_defaults);
4034
+ $retval = false;
4035
+ if ($sized_image != null) {
4036
+ $retval = true;
4037
+ $sized_image->destruct();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4038
  }
4039
  return $retval;
4040
  }
4041
  }
4042
  /**
4043
+ * Provides getter methods to C_Gallery_Storage for determining absolute paths, URL, etc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4044
  */
4045
+ class Mixin_GalleryStorage_Base_Getters extends Mixin
4046
  {
4047
+ static $gallery_abspath_cache = array();
4048
+ static $image_abspath_cache = array();
4049
+ static $image_url_cache = array();
4050
  /**
4051
+ * Flushes the cache we use for path/url calculation for images
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4052
  */
4053
+ function flush_image_path_cache($image, $size)
4054
+ {
4055
+ $image = is_numeric($image) ? $image : $image->pid;
4056
+ $key = strval($image) . $size;
4057
+ unset(self::$image_abspath_cache[$key]);
4058
+ unset(self::$image_url_cache[$key]);
4059
+ }
4060
  /**
4061
+ * Flushes the cache we use for path/url calculation for galleries
 
 
 
4062
  */
4063
+ function flush_gallery_path_cache($gallery)
4064
+ {
4065
+ $gallery = is_numeric($gallery) ? $gallery : $gallery->gid;
4066
+ unset(self::$gallery_abspath_cache[$gallery]);
4067
+ }
4068
  /**
4069
+ * Gets the id of an image, regardless of whether an integer
4070
+ * or object was passed as an argument
4071
+ * @param object|int $image_obj_or_id
4072
+ * @return null|int
4073
  */
4074
+ function _get_image_id($image_obj_or_id)
4075
+ {
4076
+ $retval = NULL;
4077
+ $image_key = $this->object->_image_mapper->get_primary_key_column();
4078
+ if (is_object($image_obj_or_id)) {
4079
+ if (isset($image_obj_or_id->{$image_key})) {
4080
+ $retval = $image_obj_or_id->{$image_key};
4081
+ }
4082
+ } elseif (is_numeric($image_obj_or_id)) {
4083
+ $retval = $image_obj_or_id;
4084
+ }
4085
+ return $retval;
4086
+ }
4087
  /**
4088
+ * Gets the absolute path of the backup of an original image
4089
+ * @param string $image
4090
+ * @return null|string
 
4091
  */
4092
+ function get_backup_abspath($image)
4093
+ {
4094
+ $retval = null;
4095
+ if ($image_path = $this->object->get_image_abspath($image)) {
4096
+ $retval = $image_path . '_backup';
4097
+ }
4098
+ return $retval;
4099
+ }
4100
+ function get_backup_dimensions($image)
4101
+ {
4102
+ return $this->object->get_image_dimensions($image, 'backup');
4103
+ }
4104
+ function get_backup_url($image)
4105
+ {
4106
+ return $this->object->get_image_url($image, 'backup');
4107
+ }
4108
  /**
4109
+ * Returns the absolute path to the cache directory of a gallery.
4110
  *
4111
+ * Without the gallery parameter the legacy (pre 2.0) shared directory is returned.
 
 
 
 
 
4112
  *
4113
+ * @param int|object|false|C_Gallery $gallery (optional)
4114
+ * @return string Absolute path to cache directory
4115
  */
4116
+ function get_cache_abspath($gallery = FALSE)
4117
+ {
4118
+ return path_join($this->object->get_gallery_abspath($gallery), 'cache');
4119
+ }
4120
  /**
4121
+ * Gets the absolute path where the full-sized image is stored
4122
+ * @param int|object $image
4123
+ * @return null|string
 
4124
  */
4125
+ function get_full_abspath($image)
4126
+ {
4127
+ return $this->object->get_image_abspath($image, 'full');
4128
+ }
4129
  /**
4130
+ * Alias to get_image_dimensions()
4131
+ * @param int|object $image
4132
+ * @return array
 
4133
  */
4134
+ function get_full_dimensions($image)
4135
+ {
4136
+ return $this->object->get_image_dimensions($image, 'full');
4137
+ }
4138
  /**
4139
+ * Alias to get_image_html()
4140
+ * @param int|object $image
4141
+ * @return string
 
4142
  */
4143
+ function get_full_html($image)
4144
+ {
4145
+ return $this->object->get_image_html($image, 'full');
4146
+ }
4147
  /**
4148
+ * Alias for get_original_url()
4149
  *
4150
+ * @param int|stdClass|C_Image $image
4151
+ * @return string
4152
  */
4153
+ function get_full_url($image)
4154
  {
4155
+ return $this->object->get_image_url($image, 'full');
4156
+ }
4157
+ function get_gallery_root()
4158
+ {
4159
+ return wp_normalize_path(NGG_GALLERY_ROOT_TYPE == 'content' ? WP_CONTENT_DIR : ABSPATH);
4160
+ }
4161
+ function _get_computed_gallery_abspath($gallery)
4162
+ {
4163
+ $retval = NULL;
4164
+ $gallery_root = $this->get_gallery_root();
4165
+ // Get the gallery entity from the database
4166
+ if ($gallery) {
4167
+ if (is_numeric($gallery)) {
4168
+ $gallery = $this->object->_gallery_mapper->find($gallery);
4169
+ }
 
 
 
 
 
 
 
 
 
4170
  }
4171
+ // It just doesn't exist
4172
+ if (!$gallery) {
4173
+ return $retval;
4174
+ }
4175
+ // We we have a gallery, determine it's path
4176
+ if ($gallery) {
4177
+ if (isset($gallery->path)) {
4178
+ $retval = $gallery->path;
4179
+ } elseif (isset($gallery->slug)) {
4180
+ $basepath = wp_normalize_path(C_NextGen_Settings::get_instance()->gallerypath);
4181
+ $retval = path_join($basepath, $this->object->sanitize_directory_name(sanitize_title($gallery->slug)));
4182
+ }
4183
+ // Normalize the gallery path. If the gallery path starts with /wp-content, and
4184
+ // NGG_GALLERY_ROOT_TYPE is set to 'content', then we need to strip out the /wp-content
4185
+ // from the start of the gallery path
4186
+ if (NGG_GALLERY_ROOT_TYPE === 'content') {
4187
+ $retval = preg_replace("#^/?wp-content#", "", $retval);
 
4188
  }
4189
+ // Ensure that the path is absolute
4190
+ if (strpos($retval, $gallery_root) !== 0) {
4191
+ // path_join() behaves funny - if the second argument starts with a slash,
4192
+ // it won't join the two paths together
4193
+ $retval = preg_replace("#^/#", "", $retval);
4194
+ $retval = path_join($gallery_root, $retval);
4195
+ }
4196
+ $retval = wp_normalize_path($retval);
4197
  }
4198
+ return $retval;
4199
+ }
4200
+ /**
4201
+ * Get the abspath to the gallery folder for the given gallery
4202
+ * The gallery may or may not already be persisted
4203
+ * @param int|object|C_Gallery $gallery
4204
+ * @return string
4205
+ */
4206
+ function get_gallery_abspath($gallery)
4207
+ {
4208
+ $gallery_id = is_numeric($gallery) ? $gallery : (is_object($gallery) && isset($gallery->gid) ? $gallery->gid : NULL);
4209
+ if (!$gallery_id || !isset(self::$gallery_abspath_cache[$gallery_id])) {
4210
+ self::$gallery_abspath_cache[$gallery_id] = $this->object->_get_computed_gallery_abspath($gallery);
4211
  }
4212
+ return self::$gallery_abspath_cache[$gallery_id];
4213
+ }
4214
+ function get_gallery_relpath($gallery)
4215
+ {
4216
+ return str_replace($this->object->get_gallery_root(), '', $this->get_gallery_abspath($gallery));
4217
+ }
4218
+ /**
4219
+ * Gets the absolute path where the image is stored. Can optionally return the path for a particular sized image.
4220
+ * @param int|object $image
4221
+ * @param string $size (optional) Default = full
4222
+ * @return string
4223
+ */
4224
+ function _get_computed_image_abspath($image, $size = 'full', $check_existance = FALSE)
4225
+ {
4226
+ $retval = NULL;
4227
+ $fs = C_Fs::get_instance();
4228
+ // If we have the id, get the actual image entity
4229
+ if (is_numeric($image)) {
4230
+ $image = $this->object->_image_mapper->find($image);
4231
  }
4232
+ // Ensure we have the image entity - user could have passed in an
4233
+ // incorrect id
4234
+ if (is_object($image)) {
4235
+ if ($gallery_path = $this->object->get_gallery_abspath($image->galleryid)) {
4236
+ $folder = $prefix = $size;
4237
+ switch ($size) {
4238
+ # Images are stored in the associated gallery folder
4239
+ case 'full':
4240
+ $retval = path_join($gallery_path, $image->filename);
4241
+ break;
4242
+ case 'backup':
4243
+ $retval = path_join($gallery_path, $image->filename . '_backup');
4244
+ if (!@file_exists($retval)) {
4245
+ $retval = path_join($gallery_path, $image->filename);
4246
+ }
4247
+ break;
4248
+ case 'thumbnail':
4249
+ $size = 'thumbnail';
4250
+ $folder = 'thumbs';
4251
+ $prefix = 'thumbs';
4252
+ // deliberately no break here
4253
+ // deliberately no break here
4254
+ default:
4255
+ // NGG 2.0 stores relative filenames in the meta data of
4256
+ // an image. It does this because it uses filenames
4257
+ // that follow conventional WordPress naming scheme.
4258
+ $image_path = NULL;
4259
+ $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance();
4260
+ if (isset($image->meta_data) && isset($image->meta_data[$size]) && isset($image->meta_data[$size]['filename'])) {
4261
+ if ($dynthumbs && $dynthumbs->is_size_dynamic($size)) {
4262
+ $image_path = path_join($this->object->get_cache_abspath($image->galleryid), $image->meta_data[$size]['filename']);
4263
+ } else {
4264
+ $image_path = path_join($gallery_path, $folder);
4265
+ $image_path = path_join($image_path, $image->meta_data[$size]['filename']);
4266
+ }
4267
+ } else {
4268
+ if ($dynthumbs && $dynthumbs->is_size_dynamic($size)) {
4269
+ $params = $dynthumbs->get_params_from_name($size, true);
4270
+ $image_path = path_join($this->object->get_cache_abspath($image->galleryid), $dynthumbs->get_image_name($image, $params));
4271
+ // Filename is not found in meta, nor dynamic
4272
+ } else {
4273
+ $image_path = path_join($gallery_path, $folder);
4274
+ $image_path = path_join($image_path, "{$prefix}_{$image->filename}");
4275
+ }
4276
+ }
4277
+ $retval = $image_path;
4278
+ break;
4279
  }
 
 
 
 
 
4280
  }
4281
  }
4282
+ if ($retval && $check_existance && !@file_exists($retval)) {
4283
+ $retval = NULL;
 
 
 
4284
  }
4285
+ return $retval;
4286
  }
4287
  /**
4288
+ * Gets the absolute path where the image is stored. Can optionally return the path for a particular sized image.
4289
+ * @param int|object $image
4290
+ * @param string $size (optional) Default = full
4291
+ * @param bool $check_existance (optional) Default = false
4292
+ * @return string
4293
  */
4294
+ function get_image_abspath($image, $size = 'full', $check_existance = FALSE)
4295
  {
4296
+ $image_id = is_numeric($image) ? $image : $image->pid;
4297
+ $size = $this->object->normalize_image_size_name($size);
4298
+ $key = strval($image_id) . $size;
4299
+ if ($check_existance || !isset(self::$image_abspath_cache[$key])) {
4300
+ $retval = $this->object->_get_computed_image_abspath($image, $size, $check_existance);
4301
+ self::$image_abspath_cache[$key] = $retval;
 
 
 
 
 
 
 
4302
  }
4303
+ $retval = self::$image_abspath_cache[$key];
4304
+ return $retval;
 
4305
  }
4306
+ function get_image_checksum($image, $size = 'full')
4307
  {
4308
+ $retval = NULL;
4309
+ if ($image_abspath = $this->get_image_abspath($image, $size, TRUE)) {
4310
+ $retval = md5_file($image_abspath);
4311
+ }
4312
+ return $retval;
4313
+ }
4314
+ /**
4315
+ * Gets the dimensions for a particular-sized image
4316
+ *
4317
+ * @param int|object $image
4318
+ * @param string $size
4319
+ * @return null|array
4320
+ */
4321
+ function get_image_dimensions($image, $size = 'full')
4322
+ {
4323
+ $retval = NULL;
4324
+ // If an image id was provided, get the entity
4325
+ if (is_numeric($image)) {
4326
+ $image = $this->object->_image_mapper->find($image);
4327
+ }
4328
+ // Ensure we have a valid image
4329
+ if ($image) {
4330
+ $size = $this->normalize_image_size_name($size);
4331
+ if (!$size) {
4332
+ $size = 'full';
4333
+ }
4334
+ // Image dimensions are stored in the $image->meta_data
4335
+ // property for all implementations
4336
+ if (isset($image->meta_data) && isset($image->meta_data[$size])) {
4337
+ $retval = $image->meta_data[$size];
4338
+ } else {
4339
+ $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance();
4340
+ $abspath = $this->object->get_image_abspath($image, $size, TRUE);
4341
+ if ($abspath) {
4342
+ $dims = getimagesize($abspath);
4343
+ if ($dims) {
4344
+ $retval['width'] = $dims[0];
4345
+ $retval['height'] = $dims[1];
4346
+ }
4347
+ } elseif ($size == 'backup') {
4348
+ $retval = $this->object->get_image_dimensions($image, 'full');
4349
+ } else {
4350
+ if ($dynthumbs && $dynthumbs->is_size_dynamic($size)) {
4351
+ $new_dims = $this->object->calculate_image_size_dimensions($image, $size);
4352
+ $retval = array('width' => $new_dims['real_width'], 'height' => $new_dims['real_height']);
4353
+ }
4354
+ }
4355
  }
4356
  }
4357
+ return $retval;
4358
+ }
4359
+ function get_image_format_list()
4360
+ {
4361
+ $format_list = array(IMAGETYPE_GIF => 'gif', IMAGETYPE_JPEG => 'jpg', IMAGETYPE_PNG => 'png');
4362
+ return $format_list;
4363
+ }
4364
+ /**
4365
+ * Gets the HTML for an image
4366
+ * @param int|object $image
4367
+ * @param string $size
4368
+ * @param array $attributes (optional)
4369
+ * @return string
4370
+ */
4371
+ function get_image_html($image, $size = 'full', $attributes = array())
4372
+ {
4373
+ $retval = "";
4374
+ if (is_numeric($image)) {
4375
+ $image = $this->object->_image_mapper->find($image);
4376
  }
4377
+ if ($image) {
4378
+ // Set alt text if not already specified
4379
+ if (!isset($attributes['alttext'])) {
4380
+ $attributes['alt'] = esc_attr($image->alttext);
 
 
 
 
 
 
 
 
 
 
 
4381
  }
4382
+ // Set the title if not already set
4383
+ if (!isset($attributes['title'])) {
4384
+ $attributes['title'] = esc_attr($image->alttext);
4385
+ }
4386
+ // Set the dimensions if not set already
4387
+ if (!isset($attributes['width']) or !isset($attributes['height'])) {
4388
+ $dimensions = $this->object->get_image_dimensions($image, $size);
4389
+ if (!isset($attributes['width'])) {
4390
+ $attributes['width'] = $dimensions['width'];
4391
  }
4392
+ if (!isset($attributes['height'])) {
4393
+ $attributes['height'] = $dimensions['height'];
 
 
 
4394
  }
4395
  }
4396
+ // Set the url if not already specified
4397
+ if (!isset($attributes['src'])) {
4398
+ $attributes['src'] = $this->object->get_image_url($image, $size);
4399
+ }
4400
+ // Format attributes
4401
+ $attribs = array();
4402
+ foreach ($attributes as $attrib => $value) {
4403
+ $attribs[] = "{$attrib}=\"{$value}\"";
4404
+ }
4405
+ $attribs = implode(" ", $attribs);
4406
+ // Return HTML string
4407
+ $retval = "<img {$attribs} />";
4408
  }
4409
+ return $retval;
 
 
 
 
4410
  }
4411
+ function _get_computed_image_url($image, $size = 'full')
 
 
 
 
4412
  {
4413
+ $retval = NULL;
4414
+ $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance();
4415
+ // Get the image abspath
4416
+ $image_abspath = $this->object->get_image_abspath($image, $size);
4417
+ if ($dynthumbs->is_size_dynamic($size) && !file_exists($image_abspath)) {
4418
+ $params = array('watermark' => false, 'reflection' => false, 'crop' => true);
4419
+ $result = $this->generate_image_size($image, $size, $params);
4420
+ if ($result) {
4421
+ $image_abspath = $this->object->get_image_abspath($image, $size);
4422
+ }
4423
  }
4424
+ // Assuming we have an abspath, we can translate that to a url
4425
+ if ($image_abspath) {
4426
+ // Replace the gallery root with the proper url segment
4427
+ $gallery_root = preg_quote($this->get_gallery_root(), '#');
4428
+ $image_uri = preg_replace("#^{$gallery_root}#", "", $image_abspath);
4429
+ // Url encode each uri segment
4430
+ $segments = explode("/", $image_uri);
4431
+ $segments = array_map('rawurlencode', $segments);
4432
+ $image_uri = preg_replace("#^/#", "", implode("/", $segments));
4433
+ // Join gallery root and image uri
4434
+ $gallery_root = trailingslashit(NGG_GALLERY_ROOT_TYPE == 'site' ? site_url() : WP_CONTENT_URL);
4435
+ $gallery_root = is_ssl() ? str_replace('http:', 'https:', $gallery_root) : $gallery_root;
4436
+ $retval = $gallery_root . $image_uri;
4437
  }
4438
+ return $retval;
4439
  }
4440
+ function normalize_image_size_name($size = 'full')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4441
  {
4442
+ switch ($size) {
4443
+ case 'full':
4444
+ case 'original':
4445
+ case 'image':
4446
+ case 'orig':
4447
+ case 'resized':
4448
+ $size = 'full';
4449
+ break;
4450
+ case 'thumbnails':
4451
+ case 'thumbnail':
4452
+ case 'thumb':
4453
+ case 'thumbs':
4454
+ $size = 'thumbnail';
4455
+ break;
4456
  }
4457
+ return $size;
4458
  }
4459
  /**
4460
+ * Gets the url of a particular-sized image
4461
+ * @param int|object $image
4462
+ * @param string $size
4463
+ * @return string
 
4464
  */
4465
+ function get_image_url($image, $size = 'full')
4466
  {
4467
+ $retval = NULL;
4468
+ $image_id = is_numeric($image) ? $image : $image->pid;
4469
+ $key = strval($image_id) . $size;
4470
+ if (!isset(self::$image_url_cache[$key])) {
4471
+ self::$image_url_cache[$key] = $this->object->_get_computed_image_url($image, $size);
4472
  }
4473
+ $retval = self::$image_url_cache[$key];
4474
+ return apply_filters('ngg_get_image_url', $retval, $image, $size);
4475
  }
4476
  /**
4477
+ * Returns the named sizes available for images
 
 
 
4478
  * @return array
4479
  */
4480
+ function get_image_sizes($image)
4481
  {
4482
+ $retval = array('full', 'thumbnail');
4483
+ if (is_numeric($image)) {
4484
+ $image = C_Image_Mapper::get_instance()->find($image);
4485
  }
4486
+ if ($image) {
4487
+ if ($image->meta_data) {
4488
+ $meta_data = is_object($image->meta_data) ? get_object_vars($image->meta_data) : $image->meta_data;
4489
+ foreach ($meta_data as $key => $value) {
4490
+ if (is_array($value) && isset($value['width'])) {
4491
+ $retval[] = $key;
4492
+ }
4493
+ }
4494
+ }
 
 
 
 
 
 
 
 
 
 
 
 
4495
  }
4496
+ return $retval;
4497
  }
4498
+ function get_image_size_params($image, $size, $params = array(), $skip_defaults = false)
 
 
 
 
 
 
4499
  {
4500
+ // Get the image entity
4501
+ if (is_numeric($image)) {
4502
+ $image = $this->object->_image_mapper->find($image);
4503
+ }
4504
+ $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance();
4505
+ if ($dynthumbs && $dynthumbs->is_size_dynamic($size)) {
4506
+ $named_params = $dynthumbs->get_params_from_name($size, true);
4507
+ if (!$params) {
4508
+ $params = array();
4509
+ }
4510
+ $params = array_merge($params, $named_params);
4511
+ }
4512
+ $params = apply_filters('ngg_get_image_size_params', $params, $size, $image);
4513
+ // Ensure we have a valid image
4514
+ if ($image) {
4515
+ $settings = C_NextGen_Settings::get_instance();
4516
+ if (!$skip_defaults) {
4517
+ // Get default settings
4518
+ if ($size == 'full') {
4519
+ if (!isset($params['quality'])) {
4520
+ $params['quality'] = $settings->imgQuality;
4521
+ }
4522
+ } else {
4523
+ if (!isset($params['crop'])) {
4524
+ $params['crop'] = $settings->thumbfix;
4525
+ }
4526
+ if (!isset($params['quality'])) {
4527
+ $params['quality'] = $settings->thumbquality;
4528
+ }
4529
+ }
4530
+ }
4531
+ // width and height when omitted make generate_image_clone create a clone with original size, so try find defaults regardless of $skip_defaults
4532
+ if (!isset($params['width']) || !isset($params['height'])) {
4533
+ // First test if this is a "known" image size, i.e. if we store these sizes somewhere when users re-generate these sizes from the UI...this is required to be compatible with legacy
4534
+ // try the 2 default built-in sizes, first thumbnail...
4535
+ if ($size == 'thumbnail') {
4536
+ if (!isset($params['width'])) {
4537
+ $params['width'] = $settings->thumbwidth;
4538
+ }
4539
+ if (!isset($params['height'])) {
4540
+ $params['height'] = $settings->thumbheight;
4541
+ }
4542
+ } else {
4543
+ if ($size == 'full') {
4544
+ if (!isset($params['width'])) {
4545
+ if ($settings->imgAutoResize) {
4546
+ $params['width'] = $settings->imgWidth;
4547
+ }
4548
+ }
4549
+ if (!isset($params['height'])) {
4550
+ if ($settings->imgAutoResize) {
4551
+ $params['height'] = $settings->imgHeight;
4552
+ }
4553
+ }
4554
+ } else {
4555
+ if (isset($image->meta_data) && isset($image->meta_data[$size])) {
4556
+ $dimensions = $image->meta_data[$size];
4557
+ if (!isset($params['width'])) {
4558
+ $params['width'] = $dimensions['width'];
4559
+ }
4560
+ if (!isset($params['height'])) {
4561
+ $params['height'] = $dimensions['height'];
4562
+ }
4563
+ }
4564
+ }
4565
+ }
4566
+ }
4567
+ if (!isset($params['crop_frame'])) {
4568
+ $crop_frame_size_name = 'thumbnail';
4569
+ if (isset($image->meta_data[$size]['crop_frame'])) {
4570
+ $crop_frame_size_name = $size;
4571
+ }
4572
+ if (isset($image->meta_data[$crop_frame_size_name]['crop_frame'])) {
4573
+ $params['crop_frame'] = $image->meta_data[$crop_frame_size_name]['crop_frame'];
4574
+ if (!isset($params['crop_frame']['final_width'])) {
4575
+ $params['crop_frame']['final_width'] = $image->meta_data[$crop_frame_size_name]['width'];
4576
+ }
4577
+ if (!isset($params['crop_frame']['final_height'])) {
4578
+ $params['crop_frame']['final_height'] = $image->meta_data[$crop_frame_size_name]['height'];
4579
+ }
4580
+ }
4581
+ } else {
4582
+ if (!isset($params['crop_frame']['final_width'])) {
4583
+ $params['crop_frame']['final_width'] = $params['width'];
4584
+ }
4585
+ if (!isset($params['crop_frame']['final_height'])) {
4586
+ $params['crop_frame']['final_height'] = $params['height'];
4587
+ }
4588
+ }
4589
  }
4590
+ return $params;
4591
  }
4592
  /**
4593
+ * An alias for get_full_abspath()
4594
+ * @param int|object $image
4595
+ * @param bool $check_existance
4596
+ * @return null|string
4597
  */
4598
+ function get_original_abspath($image, $check_existance = FALSE)
4599
  {
4600
+ return $this->object->get_image_abspath($image, 'full', $check_existance);
 
 
 
 
 
 
 
 
4601
  }
4602
  /**
4603
+ * Alias to get_image_dimensions()
4604
+ * @param int|object $image
4605
+ * @return array
 
 
4606
  */
4607
+ function get_original_dimensions($image)
4608
  {
4609
+ return $this->object->get_image_dimensions($image, 'full');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4610
  }
4611
  /**
4612
+ * Alias to get_image_html()
4613
+ * @param int|object $image
4614
+ * @return string
 
 
4615
  */
4616
+ function get_original_html($image)
4617
  {
4618
+ return $this->object->get_image_html($image, 'full');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4619
  }
4620
  /**
4621
+ * Gets the url to the original-sized image
4622
+ * @param int|stdClass|C_Image $image
4623
+ * @param bool $check_existance (optional)
4624
+ * @return string
4625
  */
4626
+ function get_original_url($image, $check_existance = FALSE)
4627
  {
4628
+ return $this->object->get_image_url($image, 'full', $check_existance);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4629
  }
4630
  /**
4631
+ * @param object|bool $gallery (optional)
4632
+ * @return string
 
4633
  */
4634
+ function get_upload_abspath($gallery = FALSE)
4635
  {
4636
+ // Base upload path
4637
+ $retval = C_NextGen_Settings::get_instance()->gallerypath;
4638
+ $fs = C_Fs::get_instance();
4639
+ // If a gallery has been specified, then we'll
4640
+ // append the slug
4641
+ if ($gallery) {
4642
+ $retval = $this->get_gallery_abspath($gallery);
 
 
 
 
4643
  }
4644
+ // We need to make this an absolute path
4645
+ if (strpos($retval, $fs->get_document_root('gallery')) !== 0) {
4646
+ $retval = rtrim($fs->join_paths($fs->get_document_root('gallery'), $retval), "/\\");
 
4647
  }
4648
+ // Convert slashes
4649
+ return wp_normalize_path($retval);
 
 
 
4650
  }
4651
  /**
4652
+ * Gets the upload path, optionally for a particular gallery
4653
+ * @param int|C_Gallery|object|false $gallery (optional)
4654
+ * @return string
4655
+ */
4656
+ function get_upload_relpath($gallery = FALSE)
4657
+ {
4658
+ $fs = C_Fs::get_instance();
4659
+ $retval = str_replace($fs->get_document_root('gallery'), '', $this->object->get_upload_abspath($gallery));
4660
+ return '/' . wp_normalize_path(ltrim($retval, "/"));
4661
+ }
4662
+ }
4663
+ /**
4664
+ * Provides the basic methods of gallery management to C_Gallery_Storage
4665
+ */
4666
+ class Mixin_GalleryStorage_Base_Management extends Mixin
4667
+ {
4668
+ /**
4669
+ * Set correct file permissions (taken from wp core). Should be called
4670
+ * after writing any file
4671
  *
4672
+ * @class nggAdmin
4673
+ * @param string $filename
4674
+ * @return bool $result
 
4675
  */
4676
+ function _chmod($filename = '')
4677
  {
4678
+ $stat = @stat(dirname($filename));
4679
+ $perms = $stat['mode'] & 0666;
4680
+ // Remove execute bits for files
4681
+ if (@chmod($filename, $perms)) {
4682
+ return TRUE;
 
 
 
 
 
 
 
 
 
 
 
4683
  }
4684
+ return FALSE;
4685
+ }
4686
+ function _delete_gallery_directory($abspath)
4687
+ {
4688
+ // Remove all image files and purge all empty directories left over
4689
+ $iterator = new DirectoryIterator($abspath);
4690
+ // Only delete image files! Other files may be stored incorrectly but it's not our place to delete them
4691
+ $removable_extensions = apply_filters('ngg_allowed_file_types', array('jpeg', 'jpg', 'png', 'gif'));
4692
+ foreach ($removable_extensions as $extension) {
4693
+ $removable_extensions[] = $extension . '_backup';
4694
  }
4695
+ foreach ($iterator as $file) {
4696
+ if (in_array($file->getBasename(), array('.', '..'))) {
4697
+ continue;
4698
+ } elseif ($file->isFile() || $file->isLink()) {
4699
+ $extension = strtolower(pathinfo($file->getPathname(), PATHINFO_EXTENSION));
4700
+ if (in_array($extension, $removable_extensions, TRUE)) {
4701
+ @unlink($file->getPathname());
4702
+ }
4703
+ } elseif ($file->isDir()) {
4704
+ $this->object->_delete_gallery_directory($file->getPathname());
4705
+ }
4706
  }
4707
+ // DO NOT remove directories that still have files in them. Note: '.' and '..' are included with getSize()
4708
+ $empty = TRUE;
4709
+ foreach ($iterator as $file) {
4710
+ if (in_array($file->getBasename(), array('.', '..'))) {
4711
+ continue;
4712
+ }
4713
+ $empty = FALSE;
4714
  }
4715
+ if ($empty) {
4716
+ @rmdir($iterator->getPath());
 
 
4717
  }
 
 
 
 
 
 
4718
  }
4719
  /**
4720
+ * Backs up an image file
4721
  *
4722
+ * @param int|object $image
4723
+ * @return bool
4724
  */
4725
+ function backup_image($image, $save = TRUE)
4726
  {
4727
+ $retval = FALSE;
4728
+ $image_path = $this->object->get_image_abspath($image);
4729
+ if ($image_path && @file_exists($image_path)) {
4730
+ $retval = copy($image_path, $this->object->get_backup_abspath($image));
4731
+ // Store the dimensions of the image
4732
+ if (function_exists('getimagesize')) {
4733
+ $mapper = C_Image_Mapper::get_instance();
4734
+ if (!is_object($image)) {
4735
+ $image = $mapper->find($image);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4736
  }
4737
+ if ($image) {
4738
+ if (!property_exists($image, 'meta_data')) {
4739
+ $image->meta_data = array();
4740
+ }
4741
+ $dimensions = getimagesize($image_path);
4742
+ $image->meta_data['backup'] = array('filename' => basename($image_path), 'width' => $dimensions[0], 'height' => $dimensions[1], 'generated' => microtime());
4743
+ if ($save) {
4744
+ $mapper->save($image);
4745
+ }
4746
+ }
4747
+ }
4748
  }
4749
+ return $retval;
4750
  }
4751
+ function copy_images($images, $dst_gallery)
 
 
 
 
 
 
 
4752
  {
4753
+ $retval = array();
4754
+ // Ensure that the image ids we have are valid
4755
+ $image_mapper = C_Image_Mapper::get_instance();
4756
+ foreach ($images as $image) {
4757
+ if (is_numeric($image)) {
4758
+ $image = $image_mapper->find($image);
4759
+ }
4760
+ if ($image_abspath = $this->object->get_image_abspath($image)) {
4761
+ // Import the image
4762
+ $new_image_id = $this->object->import_image_file($dst_gallery, $image_abspath, $image->filename);
4763
+ if ($new_image_id) {
4764
+ // Copy the properties of the old image
4765
+ foreach (get_object_vars($image) as $key => $value) {
4766
+ if (in_array($key, array('pid', 'galleryid', 'meta_data', 'filename', 'sortorder', 'extras_post_id'))) {
4767
+ continue;
4768
+ }
4769
+ $new_image = $image_mapper->find($new_image_id);
4770
+ $new_image->{$key} = $value;
4771
+ $image_mapper->save($new_image);
4772
+ }
4773
+ // Copy tags
4774
+ $tags = wp_get_object_terms($image->pid, 'ngg_tag', 'fields=ids');
4775
+ $tags = array_map('intval', $tags);
4776
+ wp_set_object_terms($new_image_id, $tags, 'ngg_tag', true);
4777
+ // Mark as done
4778
+ $retval[] = $new_image_id;
4779
+ }
4780
+ }
4781
  }
4782
+ return $retval;
4783
  }
4784
  /**
4785
+ * Moves images from to another gallery
4786
+ * @param array $images
4787
+ * @param int|object $gallery
4788
+ * @param boolean $db optionally only move the image files, not the db entries
4789
+ * @return boolean
 
 
4790
  */
4791
+ function move_images($images, $gallery)
4792
  {
4793
+ $retval = $this->object->copy_images($images, $gallery, TRUE);
4794
+ if ($images) {
4795
+ foreach ($images as $image_id) {
4796
+ $this->object->delete_image($image_id);
4797
+ }
 
 
 
 
 
 
 
 
 
 
 
4798
  }
4799
+ return $retval;
4800
+ }
4801
+ function delete_directory($abspath)
4802
+ {
4803
+ $retval = FALSE;
4804
+ if (@file_exists($abspath)) {
4805
+ $files = scandir($abspath);
4806
+ array_shift($files);
4807
+ array_shift($files);
4808
+ foreach ($files as $file) {
4809
+ $file_abspath = implode(DIRECTORY_SEPARATOR, array(rtrim($abspath, "/\\"), $file));
4810
+ if (is_dir($file_abspath)) {
4811
+ $this->object->delete_directory($file_abspath);
4812
+ } else {
4813
+ unlink($file_abspath);
4814
+ }
4815
+ }
4816
+ rmdir($abspath);
4817
+ $retval = @file_exists($abspath);
4818
  }
4819
+ return $retval;
 
 
 
4820
  }
4821
+ function delete_gallery($gallery)
 
 
 
 
 
 
 
4822
  {
4823
+ $fs = C_Fs::get_instance();
4824
+ $safe_dirs = array(DIRECTORY_SEPARATOR, $fs->get_document_root('plugins'), $fs->get_document_root('plugins_mu'), $fs->get_document_root('templates'), $fs->get_document_root('stylesheets'), $fs->get_document_root('content'), $fs->get_document_root('galleries'), $fs->get_document_root());
4825
+ $abspath = $this->object->get_gallery_abspath($gallery);
4826
+ if ($abspath && file_exists($abspath) && !in_array(stripslashes($abspath), $safe_dirs)) {
4827
+ $this->object->_delete_gallery_directory($abspath);
4828
+ }
 
 
 
4829
  }
4830
+ function delete_image($image, $size = FALSE)
 
 
 
 
 
 
4831
  {
4832
+ $retval = FALSE;
4833
+ // Ensure that we have the image entity
4834
+ if (is_numeric($image)) {
4835
+ $image = $this->object->_image_mapper->find($image);
4836
+ }
4837
+ if ($image) {
4838
+ $image_id = $image->{$image->id_field};
4839
+ do_action('ngg_delete_image', $image_id, $size);
4840
+ // Delete only a particular image size
4841
+ if ($size) {
4842
+ $abspath = $this->object->get_image_abspath($image, $size);
4843
+ if ($abspath && @file_exists($abspath)) {
4844
+ @unlink($abspath);
4845
+ }
4846
+ if (isset($image->meta_data) && isset($image->meta_data[$size])) {
4847
+ unset($image->meta_data[$size]);
4848
+ $this->object->_image_mapper->save($image);
4849
+ }
4850
+ } else {
4851
+ foreach ($this->get_image_sizes($image) as $named_size) {
4852
+ $image_abspath = $this->object->get_image_abspath($image, $named_size);
4853
+ @unlink($image_abspath);
4854
+ }
4855
+ // Delete the entity
4856
+ $this->object->_image_mapper->destroy($image);
4857
+ }
4858
+ $retval = TRUE;
4859
+ }
4860
+ return $retval;
4861
  }
4862
  /**
4863
+ * Recover image from backup copy and reprocess it
4864
  *
4865
+ * @param int|stdClass|C_Image $image
4866
+ * @return bool|string result code
4867
  */
4868
+ function recover_image($image)
4869
  {