Export WordPress data to XML/CSV - Version 1.2.7

Version Description

  • maintenance: compatibility with WordPress v5.5 jQuery changes
Download this release

Release Info

Developer soflyy
Plugin Icon 128x128 Export WordPress data to XML/CSV
Version 1.2.7
Comparing to
See all releases

Code changes from version 1.2.6 to 1.2.7

Files changed (67) hide show
  1. actions/admin_init.php +1 -1
  2. actions/wp_ajax_wpae_filtering.php +2 -2
  3. controllers/admin/export.php +14 -0
  4. controllers/controller/admin.php +22 -20
  5. dist/app.js +1 -1
  6. dist/app.min.js +11 -10
  7. dist/styles.css +4 -0
  8. libraries/XmlExportEngine.php +2 -2
  9. libraries/XmlExportWooCommerceOrder.php +1 -1
  10. readme.txt +5 -3
  11. src/App/Controller/ExportController.php +6 -1
  12. src/App/Service/CategoriesService.php +32 -0
  13. src/Scheduling/views/ConnectionIcon.php +2 -3
  14. src/Scheduling/views/ManualScheduling.php +1 -1
  15. src/WordPress/AdminDismissibleNotice.php +44 -0
  16. src/WordPress/AdminErrorNotice.php +12 -0
  17. src/WordPress/AdminNotice.php +30 -0
  18. static/css/admin.css +20 -5
  19. static/js/admin.js +140 -89
  20. static/js/jquery/jquery.tipsy.js +290 -71
  21. trunk/actions/admin_head.php +0 -26
  22. trunk/actions/admin_init.php +0 -5
  23. trunk/actions/admin_menu.php +0 -22
  24. trunk/actions/admin_notices.php +0 -19
  25. trunk/actions/init.php +0 -8
  26. trunk/actions/pmxe_after_export.php +0 -417
  27. trunk/actions/pmxe_before_export.php +0 -42
  28. trunk/actions/pmxe_exported_post.php +0 -26
  29. trunk/actions/wp_ajax_dismiss_export_warnings.php +0 -23
  30. trunk/actions/wp_ajax_generate_zapier_api_key.php +0 -18
  31. trunk/actions/wp_ajax_redirect_after_addon_installed.php +0 -24
  32. trunk/actions/wp_ajax_save_scheduling.php +0 -56
  33. trunk/actions/wp_ajax_scheduling_dialog_content.php +0 -853
  34. trunk/actions/wp_ajax_wpae_available_rules.php +0 -106
  35. trunk/actions/wp_ajax_wpae_filtering.php +0 -91
  36. trunk/actions/wp_ajax_wpae_filtering_count.php +0 -372
  37. trunk/actions/wp_ajax_wpae_preview.php +0 -436
  38. trunk/actions/wp_ajax_wpallexport.php +0 -327
  39. trunk/actions/wp_loaded.php +0 -251
  40. trunk/actions/wpmu_new_blog.php +0 -21
  41. trunk/banner-772x250.png +0 -0
  42. trunk/classes/CdataStrategy.php +0 -7
  43. trunk/classes/CdataStrategyAlways.php +0 -12
  44. trunk/classes/CdataStrategyFactory.php +0 -22
  45. trunk/classes/CdataStrategyIllegalCharacters.php +0 -24
  46. trunk/classes/CdataStrategyIllegalCharactersHtmlEntities.php +0 -12
  47. trunk/classes/CdataStrategyNever.php +0 -12
  48. trunk/classes/XMLWriter.php +0 -420
  49. trunk/classes/chunk.php +0 -274
  50. trunk/classes/config.php +0 -99
  51. trunk/classes/download.php +0 -58
  52. trunk/classes/handler.php +0 -134
  53. trunk/classes/helper.php +0 -139
  54. trunk/classes/input.php +0 -81
  55. trunk/classes/installer.php +0 -40
  56. trunk/classes/session.php +0 -96
  57. trunk/classes/wpallimport.php +0 -582
  58. trunk/classes/zip.php +0 -54
  59. trunk/config/options.php +0 -22
  60. trunk/controllers/admin/export.php +0 -563
  61. trunk/controllers/admin/feedback.php +0 -12
  62. trunk/controllers/admin/help.php +0 -12
  63. trunk/controllers/admin/manage.php +0 -526
  64. trunk/controllers/admin/settings.php +0 -178
  65. trunk/controllers/controller.php +0 -182
  66. trunk/controllers/controller/admin.php +0 -129
  67. trunk/dist/app.js +0 -2850
actions/admin_init.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
 
3
  function pmxe_admin_init(){
4
- wp_enqueue_script('pmxe-script', PMXE_ROOT_URL . '/static/js/pmxe.js', array('jquery'), PMXE_VERSION);
5
  }
1
  <?php
2
 
3
  function pmxe_admin_init(){
4
+ wp_enqueue_script('pmxe-script', PMXE_ROOT_URL . '/static/js/pmxe.js', array('jquery'), PMXE_VERSION.PMXE_ASSETS_VERSION);
5
  }
actions/wp_ajax_wpae_filtering.php CHANGED
@@ -57,12 +57,12 @@ function pmxe_wp_ajax_wpae_filtering(){
57
  if ( XmlExportEngine::$is_auto_generate_enabled ):
58
  ?>
59
  <div class="wpallexport-free-edition-notice" id="migrate-orders-notice" style="padding: 20px; margin-bottom: 10px; display: none;">
60
- <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=118611&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=migrate-orders"><?php _e('Upgrade to the Pro edition of WP All Export to Migrate Orders', PMXE_Plugin::LANGUAGE_DOMAIN);?></a>
61
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', PMXE_Plugin::LANGUAGE_DOMAIN);?></p>
62
  </div>
63
 
64
  <div class="wpallexport-free-edition-notice" id="migrate-users-notice" style="padding: 20px; margin-bottom: 10px; display: none;">
65
- <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=118611&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=migrate-users"><?php _e('Upgrade to the Pro edition of WP All Export to Migrate Users', PMXE_Plugin::LANGUAGE_DOMAIN);?></a>
66
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', PMXE_Plugin::LANGUAGE_DOMAIN);?></p>
67
  </div>
68
 
57
  if ( XmlExportEngine::$is_auto_generate_enabled ):
58
  ?>
59
  <div class="wpallexport-free-edition-notice" id="migrate-orders-notice" style="padding: 20px; margin-bottom: 10px; display: none;">
60
+ <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=2707173&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=migrate-orders"><?php _e('Upgrade to the Pro edition of WP All Export to Migrate Orders', PMXE_Plugin::LANGUAGE_DOMAIN);?></a>
61
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', PMXE_Plugin::LANGUAGE_DOMAIN);?></p>
62
  </div>
63
 
64
  <div class="wpallexport-free-edition-notice" id="migrate-users-notice" style="padding: 20px; margin-bottom: 10px; display: none;">
65
+ <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=2707173&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=migrate-users"><?php _e('Upgrade to the Pro edition of WP All Export to Migrate Users', PMXE_Plugin::LANGUAGE_DOMAIN);?></a>
66
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', PMXE_Plugin::LANGUAGE_DOMAIN);?></p>
67
  </div>
68
 
controllers/admin/export.php CHANGED
@@ -560,4 +560,18 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin
560
  return $friendly_name;
561
  }
562
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
563
  }
560
  return $friendly_name;
561
  }
562
  }
563
+
564
+ function insertAfter($input, $index, $newKey, $element) {
565
+ if (!array_key_exists($index, $input)) {
566
+ throw new Exception("Index not found");
567
+ }
568
+ $tmpArray = array();
569
+ foreach ($input as $key => $value) {
570
+ $tmpArray[$key] = $value;
571
+ if ($key === $index) {
572
+ $tmpArray[$newKey] = $element;
573
+ }
574
+ }
575
+ return $tmpArray;
576
+ }
577
  }
controllers/controller/admin.php CHANGED
@@ -43,14 +43,14 @@ abstract class PMXE_Controller_Admin extends PMXE_Controller {
43
 
44
  wp_enqueue_style('jquery-ui', PMXE_ROOT_URL . '/static/js/jquery/css/redmond/jquery-ui.css', array('media-views'));
45
  wp_enqueue_style('jquery-tipsy', PMXE_ROOT_URL . '/static/js/jquery/css/smoothness/jquery.tipsy.css', array('media-views'));
46
- wp_enqueue_style('pmxe-admin-style', PMXE_ROOT_URL . '/static/css/admin.css',array('media-views'), PMXE_VERSION);
47
  wp_enqueue_style('pmxe-admin-style-ie', PMXE_ROOT_URL . '/static/css/admin-ie.css', array('media-views'));
48
  wp_enqueue_style('jquery-select2', PMXE_ROOT_URL . '/static/js/jquery/css/select2/select2.css', array('media-views'));
49
  wp_enqueue_style('jquery-select2', PMXE_ROOT_URL . '/static/js/jquery/css/select2/select2-bootstrap.css', array('media-views'));
50
  wp_enqueue_style('jquery-chosen', PMXE_ROOT_URL . '/static/js/jquery/css/chosen/chosen.css', array('media-views'));
51
- wp_enqueue_style('jquery-codemirror', PMXE_ROOT_URL . '/static/codemirror/codemirror.css', array('media-views'), PMXE_VERSION);
52
- wp_enqueue_style('jquery-timepicker', PMXE_ROOT_URL . '/static/js/jquery/css/timepicker/jquery.timepicker.css', array('media-views'), PMXE_VERSION);
53
- wp_enqueue_style('pmxe-angular-scss', PMXE_ROOT_URL . '/dist/styles.css', array('media-views'), PMXE_VERSION);
54
 
55
  $wp_styles->add_data('pmxe-admin-style-ie', 'conditional', 'lte IE 7');
56
  wp_enqueue_style('wp-pointer');
@@ -67,33 +67,35 @@ abstract class PMXE_Controller_Admin extends PMXE_Controller {
67
  if (is_file(PMXE_Plugin::ROOT_DIR . '/static/css/admin-colors-' . $scheme_color . '.css')) {
68
  wp_enqueue_style('pmxe-admin-style-color', PMXE_ROOT_URL . '/static/css/admin-colors-' . $scheme_color . '.css', array('media-views'));
69
  }
70
-
71
- wp_enqueue_script('jquery-ui-datepicker', PMXE_ROOT_URL . '/static/js/jquery/ui.datepicker.js', 'jquery-ui-core');
 
 
72
  wp_enqueue_script('jquery-tipsy', PMXE_ROOT_URL . '/static/js/jquery/jquery.tipsy.js', 'jquery');
73
  wp_enqueue_script('jquery-pmxe-nestable', PMXE_ROOT_URL . '/static/js/jquery/jquery.mjs.pmxe_nestedSortable.js', array('jquery', 'jquery-ui-dialog', 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-tabs', 'jquery-ui-progressbar'));
74
  wp_enqueue_script('jquery-select2', PMXE_ROOT_URL . '/static/js/jquery/select2.min.js', 'jquery');
75
  wp_enqueue_script('jquery-ddslick', PMXE_ROOT_URL . '/static/js/jquery/jquery.ddslick.min.js', 'jquery');
76
  wp_enqueue_script('jquery-chosen', PMXE_ROOT_URL . '/static/js/jquery/chosen.jquery.js', 'jquery');
77
- wp_enqueue_script('jquery-codemirror', PMXE_ROOT_URL . '/static/codemirror/codemirror.js', array(), PMXE_VERSION);
78
- wp_enqueue_script('jquery-codemirror-matchbrackets', PMXE_ROOT_URL . '/static/codemirror/matchbrackets.js', array('jquery-codemirror'), PMXE_VERSION);
79
- wp_enqueue_script('jquery-codemirror-htmlmixed', PMXE_ROOT_URL . '/static/codemirror/htmlmixed.js', array('jquery-codemirror-matchbrackets'), PMXE_VERSION);
80
- wp_enqueue_script('jquery-codemirror-xml', PMXE_ROOT_URL . '/static/codemirror/xml.js', array('jquery-codemirror-htmlmixed'), PMXE_VERSION);
81
- wp_enqueue_script('jquery-codemirror-javascript', PMXE_ROOT_URL . '/static/codemirror/javascript.js', array('jquery-codemirror-xml'), PMXE_VERSION);
82
- wp_enqueue_script('jquery-codemirror-clike', PMXE_ROOT_URL . '/static/codemirror/clike.js', array('jquery-codemirror-javascript'), PMXE_VERSION);
83
- wp_enqueue_script('jquery-codemirror-php', PMXE_ROOT_URL . '/static/codemirror/php.js', array('jquery-codemirror-clike'), PMXE_VERSION);
84
- wp_enqueue_script('jquery-codemirror-autorefresh', PMXE_ROOT_URL . '/static/codemirror/autorefresh.js', array('jquery-codemirror'), PMXE_VERSION);
85
- wp_enqueue_script('jquery-timepicker', PMXE_ROOT_URL . '/static/js/jquery/jquery.timepicker.js', array('jquery'), PMXE_VERSION);
86
 
87
  wp_enqueue_script('wp-pointer');
88
 
89
- /* load plupload scripts */
90
- wp_enqueue_script('pmxe-admin-script', PMXE_ROOT_URL . '/static/js/admin.js', array('jquery', 'jquery-ui-dialog', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position', 'jquery-ui-autocomplete', 'updates' ), PMXE_VERSION);
91
- wp_enqueue_script('pmxe-admin-validate-braces', PMXE_ROOT_URL . '/static/js/validate-braces.js', array('pmxe-admin-script' ), PMXE_VERSION);
92
 
93
  if(getenv('WPAE_DEV')) {
94
- wp_enqueue_script('pmxe-angular-app', PMXE_ROOT_URL . '/dist/app.js', array('jquery'), PMXE_VERSION);
95
  } else {
96
- wp_enqueue_script('pmxe-angular-app', PMXE_ROOT_URL . '/dist/app.min.js', array('jquery'), PMXE_VERSION);
97
  }
98
  }
99
 
43
 
44
  wp_enqueue_style('jquery-ui', PMXE_ROOT_URL . '/static/js/jquery/css/redmond/jquery-ui.css', array('media-views'));
45
  wp_enqueue_style('jquery-tipsy', PMXE_ROOT_URL . '/static/js/jquery/css/smoothness/jquery.tipsy.css', array('media-views'));
46
+ wp_enqueue_style('pmxe-admin-style', PMXE_ROOT_URL . '/static/css/admin.css',array('media-views'), PMXE_VERSION.PMXE_ASSETS_VERSION);
47
  wp_enqueue_style('pmxe-admin-style-ie', PMXE_ROOT_URL . '/static/css/admin-ie.css', array('media-views'));
48
  wp_enqueue_style('jquery-select2', PMXE_ROOT_URL . '/static/js/jquery/css/select2/select2.css', array('media-views'));
49
  wp_enqueue_style('jquery-select2', PMXE_ROOT_URL . '/static/js/jquery/css/select2/select2-bootstrap.css', array('media-views'));
50
  wp_enqueue_style('jquery-chosen', PMXE_ROOT_URL . '/static/js/jquery/css/chosen/chosen.css', array('media-views'));
51
+ wp_enqueue_style('jquery-codemirror', PMXE_ROOT_URL . '/static/codemirror/codemirror.css', array('media-views'), PMXE_VERSION.PMXE_ASSETS_VERSION);
52
+ wp_enqueue_style('jquery-timepicker', PMXE_ROOT_URL . '/static/js/jquery/css/timepicker/jquery.timepicker.css', array('media-views'), PMXE_VERSION.PMXE_ASSETS_VERSION);
53
+ wp_enqueue_style('pmxe-angular-scss', PMXE_ROOT_URL . '/dist/styles.css', array('media-views'), PMXE_VERSION.PMXE_ASSETS_VERSION);
54
 
55
  $wp_styles->add_data('pmxe-admin-style-ie', 'conditional', 'lte IE 7');
56
  wp_enqueue_style('wp-pointer');
67
  if (is_file(PMXE_Plugin::ROOT_DIR . '/static/css/admin-colors-' . $scheme_color . '.css')) {
68
  wp_enqueue_style('pmxe-admin-style-color', PMXE_ROOT_URL . '/static/css/admin-colors-' . $scheme_color . '.css', array('media-views'));
69
  }
70
+
71
+ wp_deregister_script('wp-codemirror');
72
+
73
+ wp_enqueue_script('jquery-ui-datepicker', PMXE_ROOT_URL . '/static/js/jquery/ui.datepicker.js', 'jquery-ui-core');
74
  wp_enqueue_script('jquery-tipsy', PMXE_ROOT_URL . '/static/js/jquery/jquery.tipsy.js', 'jquery');
75
  wp_enqueue_script('jquery-pmxe-nestable', PMXE_ROOT_URL . '/static/js/jquery/jquery.mjs.pmxe_nestedSortable.js', array('jquery', 'jquery-ui-dialog', 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-tabs', 'jquery-ui-progressbar'));
76
  wp_enqueue_script('jquery-select2', PMXE_ROOT_URL . '/static/js/jquery/select2.min.js', 'jquery');
77
  wp_enqueue_script('jquery-ddslick', PMXE_ROOT_URL . '/static/js/jquery/jquery.ddslick.min.js', 'jquery');
78
  wp_enqueue_script('jquery-chosen', PMXE_ROOT_URL . '/static/js/jquery/chosen.jquery.js', 'jquery');
79
+ wp_enqueue_script('jquery-codemirror', PMXE_ROOT_URL . '/static/codemirror/codemirror.js', array(), PMXE_VERSION.PMXE_ASSETS_VERSION);
80
+ wp_enqueue_script('jquery-codemirror-matchbrackets', PMXE_ROOT_URL . '/static/codemirror/matchbrackets.js', array('jquery-codemirror'), PMXE_VERSION.PMXE_ASSETS_VERSION);
81
+ wp_enqueue_script('jquery-codemirror-htmlmixed', PMXE_ROOT_URL . '/static/codemirror/htmlmixed.js', array('jquery-codemirror-matchbrackets'), PMXE_VERSION.PMXE_ASSETS_VERSION);
82
+ wp_enqueue_script('jquery-codemirror-xml', PMXE_ROOT_URL . '/static/codemirror/xml.js', array('jquery-codemirror-htmlmixed'), PMXE_VERSION.PMXE_ASSETS_VERSION);
83
+ wp_enqueue_script('jquery-codemirror-javascript', PMXE_ROOT_URL . '/static/codemirror/javascript.js', array('jquery-codemirror-xml'), PMXE_VERSION.PMXE_ASSETS_VERSION);
84
+ wp_enqueue_script('jquery-codemirror-clike', PMXE_ROOT_URL . '/static/codemirror/clike.js', array('jquery-codemirror-javascript'), PMXE_VERSION.PMXE_ASSETS_VERSION);
85
+ wp_enqueue_script('jquery-codemirror-php', PMXE_ROOT_URL . '/static/codemirror/php.js', array('jquery-codemirror-clike'), PMXE_VERSION.PMXE_ASSETS_VERSION);
86
+ wp_enqueue_script('jquery-codemirror-autorefresh', PMXE_ROOT_URL . '/static/codemirror/autorefresh.js', array('jquery-codemirror'), PMXE_VERSION.PMXE_ASSETS_VERSION);
87
+ wp_enqueue_script('jquery-timepicker', PMXE_ROOT_URL . '/static/js/jquery/jquery.timepicker.js', array('jquery'), PMXE_VERSION.PMXE_ASSETS_VERSION);
88
 
89
  wp_enqueue_script('wp-pointer');
90
 
91
+ /* load plupload scripts */
92
+ wp_enqueue_script('pmxe-admin-script', PMXE_ROOT_URL . '/static/js/admin.js', array('jquery', 'jquery-ui-dialog', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position', 'jquery-ui-autocomplete' ), PMXE_VERSION);
93
+ wp_enqueue_script('pmxe-admin-validate-braces', PMXE_ROOT_URL . '/static/js/validate-braces.js', array('pmxe-admin-script' ), PMXE_VERSION.PMXE_ASSETS_VERSION);
94
 
95
  if(getenv('WPAE_DEV')) {
96
+ wp_enqueue_script('pmxe-angular-app', PMXE_ROOT_URL . '/dist/app.js', array('jquery'), PMXE_VERSION.PMXE_ASSETS_VERSION);
97
  } else {
98
+ wp_enqueue_script('pmxe-angular-app', PMXE_ROOT_URL . '/dist/app.min.js', array('jquery'), PMXE_VERSION.PMXE_ASSETS_VERSION);
99
  }
100
  }
101
 
dist/app.js CHANGED
@@ -39911,7 +39911,7 @@ GoogleMerchants.directive('tipsy', ['$document', function($document) {
39911
  }
39912
  return ver + hor;
39913
  },
39914
- live: true,
39915
  html: true,
39916
  opacity: 1
39917
  });
39911
  }
39912
  return ver + hor;
39913
  },
39914
+ live: '.wpallexport-help',
39915
  html: true,
39916
  opacity: 1
39917
  });
dist/app.min.js CHANGED
@@ -1,10 +1,11 @@
1
- function chosen(a){var b,c,d,e;return b=[{onChange:"change"},{onReady:"chosen:ready"},{onMaxSelected:"chosen:maxselected"},{onShowDropdown:"chosen:showing_dropdown"},{onHideDropdown:"chosen:hiding_dropdown"},{onNoResult:"chosen:no_results"}],c={options:"=",ngModel:"=",ngDisabled:"="},e=[],Object.keys(c).forEach(function(a){e.push(a)}),b.forEach(function(a){var b=Object.keys(a)[0];c[b]="="}),d=function(c,d,f){var g=parseInt(f.maxSelection,10),h=parseInt(f.searchThreshold,10);(isNaN(g)||g===1/0)&&(g=void 0),(isNaN(h)||h===1/0)&&(h=void 0);var i=void 0!==d.attr("allow-single-deselect"),j=void 0!==d.attr("no-results-text")?f.noResultsText:"No results found.";d.chosen({width:"100%",max_selected_options:g,disable_search_threshold:h,search_contains:!0,allow_single_deselect:i,no_results_text:j}),d.on("change",function(){d.trigger("chosen:updated")}),c.$watchGroup(e,function(){a(function(){d.trigger("chosen:updated")},100)}),c.$on("chosen:updated",function(){d.trigger("chosen:updated")}),b.forEach(function(a){var b=Object.keys(a)[0];"function"==typeof c[b]&&d.on(a[b],function(a){c.$apply(function(){c[b](a)})})})},{name:"chosen",scope:c,restrict:"A",link:d}}!function(a){"use strict";function b(a){if(!v(a))return Wd;u(a.objectMaxDepth)&&(Wd.objectMaxDepth=c(a.objectMaxDepth)?a.objectMaxDepth:NaN)}function c(a){return y(a)&&a>0}function d(a,b){return b=b||Error,function(){var c,d,e=arguments[0],f=arguments[1],g="["+(a?a+":":"")+e+"] ",h=V(arguments,2).map(function(a){return xa(a,Wd.objectMaxDepth)});for(g+=f.replace(/\{\d+\}/g,function(a){var b=+a.slice(1,-1);return b<h.length?h[b]:a}),g+="\nhttp://errors.angularjs.org/1.6.6/"+(a?a+"/":"")+e,d=0,c="?";d<h.length;d++,c="&")g+=c+"p"+d+"="+encodeURIComponent(h[d]);return new b(g)}}function e(a){if(null==a||D(a))return!1;if(pe(a)||x(a)||de&&a instanceof de)return!0;var b="length"in Object(a)&&a.length;return y(b)&&(b>=0&&(b-1 in a||a instanceof Array)||"function"==typeof a.item)}function f(a,b,c){var d,g;if(a)if(B(a))for(d in a)"prototype"!==d&&"length"!==d&&"name"!==d&&a.hasOwnProperty(d)&&b.call(c,a[d],d,a);else if(pe(a)||e(a)){var h="object"!=typeof a;for(d=0,g=a.length;d<g;d++)(h||d in a)&&b.call(c,a[d],d,a)}else if(a.forEach&&a.forEach!==f)a.forEach(b,c,a);else if(w(a))for(d in a)b.call(c,a[d],d,a);else if("function"==typeof a.hasOwnProperty)for(d in a)a.hasOwnProperty(d)&&b.call(c,a[d],d,a);else for(d in a)Zd.call(a,d)&&b.call(c,a[d],d,a);return a}function g(a,b,c){for(var d=Object.keys(a).sort(),e=0;e<d.length;e++)b.call(c,a[d[e]],d[e]);return d}function h(a){return function(b,c){a(c,b)}}function i(){return++ne}function j(a,b){b?a.$$hashKey=b:delete a.$$hashKey}function k(a,b,c){for(var d=a.$$hashKey,e=0,f=b.length;e<f;++e){var g=b[e];if(v(g)||B(g))for(var h=Object.keys(g),i=0,l=h.length;i<l;i++){var m=h[i],n=g[m];c&&v(n)?z(n)?a[m]=new Date(n.valueOf()):C(n)?a[m]=new RegExp(n):n.nodeName?a[m]=n.cloneNode(!0):M(n)?a[m]=n.clone():(v(a[m])||(a[m]=pe(n)?[]:{}),k(a[m],[n],!0)):a[m]=n}}return j(a,d),a}function l(a){return k(a,ge.call(arguments,1),!1)}function m(a){return k(a,ge.call(arguments,1),!0)}function n(a){return parseInt(a,10)}function o(a,b){return l(Object.create(a),b)}function p(){}function q(a){return a}function r(a){return function(){return a}}function s(a){return B(a.toString)&&a.toString!==je}function t(a){return void 0===a}function u(a){return void 0!==a}function v(a){return null!==a&&"object"==typeof a}function w(a){return null!==a&&"object"==typeof a&&!ke(a)}function x(a){return"string"==typeof a}function y(a){return"number"==typeof a}function z(a){return"[object Date]"===je.call(a)}function A(a){switch(je.call(a)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return a instanceof Error}}function B(a){return"function"==typeof a}function C(a){return"[object RegExp]"===je.call(a)}function D(a){return a&&a.window===a}function E(a){return a&&a.$evalAsync&&a.$watch}function F(a){return"[object File]"===je.call(a)}function G(a){return"[object FormData]"===je.call(a)}function H(a){return"[object Blob]"===je.call(a)}function I(a){return"boolean"==typeof a}function J(a){return a&&B(a.then)}function K(a){return a&&y(a.length)&&qe.test(je.call(a))}function L(a){return"[object ArrayBuffer]"===je.call(a)}function M(a){return!(!a||!(a.nodeName||a.prop&&a.attr&&a.find))}function N(a){var b,c={},d=a.split(",");for(b=0;b<d.length;b++)c[d[b]]=!0;return c}function O(a){return $d(a.nodeName||a[0]&&a[0].nodeName)}function P(a,b){return-1!==Array.prototype.indexOf.call(a,b)}function Q(a,b){var c=a.indexOf(b);return c>=0&&a.splice(c,1),c}function R(a,b,d){function e(a,b,c){if(--c<0)return"...";var d,e=b.$$hashKey;if(pe(a))for(var f=0,h=a.length;f<h;f++)b.push(g(a[f],c));else if(w(a))for(d in a)b[d]=g(a[d],c);else if(a&&"function"==typeof a.hasOwnProperty)for(d in a)a.hasOwnProperty(d)&&(b[d]=g(a[d],c));else for(d in a)Zd.call(a,d)&&(b[d]=g(a[d],c));return j(b,e),b}function g(a,b){if(!v(a))return a;var c=i.indexOf(a);if(-1!==c)return k[c];if(D(a)||E(a))throw le("cpws","Can't copy! Making copies of Window or Scope instances is not supported.");var d=!1,f=h(a);return void 0===f&&(f=pe(a)?[]:Object.create(ke(a)),d=!0),i.push(a),k.push(f),d?e(a,f,b):f}function h(a){switch(je.call(a)){case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Float32Array]":case"[object Float64Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return new a.constructor(g(a.buffer),a.byteOffset,a.length);case"[object ArrayBuffer]":if(!a.slice){var b=new ArrayBuffer(a.byteLength);return new Uint8Array(b).set(new Uint8Array(a)),b}return a.slice(0);case"[object Boolean]":case"[object Number]":case"[object String]":case"[object Date]":return new a.constructor(a.valueOf());case"[object RegExp]":var c=new RegExp(a.source,a.toString().match(/[^\/]*$/)[0]);return c.lastIndex=a.lastIndex,c;case"[object Blob]":return new a.constructor([a],{type:a.type})}if(B(a.cloneNode))return a.cloneNode(!0)}var i=[],k=[];if(d=c(d)?d:NaN,b){if(K(b)||L(b))throw le("cpta","Can't copy! TypedArray destination cannot be mutated.");if(a===b)throw le("cpi","Can't copy! Source and destination are identical.");return pe(b)?b.length=0:f(b,function(a,c){"$$hashKey"!==c&&delete b[c]}),i.push(a),k.push(b),e(a,b,d)}return g(a,d)}function S(a,b){return a===b||a!==a&&b!==b}function T(a,b){if(a===b)return!0;if(null===a||null===b)return!1;if(a!==a&&b!==b)return!0;var c,d,e,f=typeof a,g=typeof b;if(f===g&&"object"===f){if(!pe(a)){if(z(a))return!!z(b)&&S(a.getTime(),b.getTime());if(C(a))return!!C(b)&&a.toString()===b.toString();if(E(a)||E(b)||D(a)||D(b)||pe(b)||z(b)||C(b))return!1;e=sa();for(d in a)if("$"!==d.charAt(0)&&!B(a[d])){if(!T(a[d],b[d]))return!1;e[d]=!0}for(d in b)if(!(d in e)&&"$"!==d.charAt(0)&&u(b[d])&&!B(b[d]))return!1;return!0}if(!pe(b))return!1;if((c=a.length)===b.length){for(d=0;d<c;d++)if(!T(a[d],b[d]))return!1;return!0}}return!1}function U(a,b,c){return a.concat(ge.call(b,c))}function V(a,b){return ge.call(a,b||0)}function W(a,b){var c=arguments.length>2?V(arguments,2):[];return!B(b)||b instanceof RegExp?b:c.length?function(){return arguments.length?b.apply(a,U(c,arguments,0)):b.apply(a,c)}:function(){return arguments.length?b.apply(a,arguments):b.call(a)}}function X(b,c){var d=c;return"string"==typeof b&&"$"===b.charAt(0)&&"$"===b.charAt(1)?d=void 0:D(c)?d="$WINDOW":c&&a.document===c?d="$DOCUMENT":E(c)&&(d="$SCOPE"),d}function Y(a,b){if(!t(a))return y(b)||(b=b?2:null),JSON.stringify(a,X,b)}function Z(a){return x(a)?JSON.parse(a):a}function $(a,b){a=a.replace(ve,"");var c=Date.parse("Jan 01, 1970 00:00:00 "+a)/6e4;return oe(c)?b:c}function _(a,b){return a=new Date(a.getTime()),a.setMinutes(a.getMinutes()+b),a}function aa(a,b,c){c=c?-1:1;var d=a.getTimezoneOffset();return _(a,c*($(b,d)-d))}function ba(a){a=de(a).clone().empty();var b=de("<div>").append(a).html();try{return a[0].nodeType===Be?$d(b):b.match(/^(<[^>]+>)/)[1].replace(/^<([\w-]+)/,function(a,b){return"<"+$d(b)})}catch(a){return $d(b)}}function ca(a){try{return decodeURIComponent(a)}catch(a){}}function da(a){var b={};return f((a||"").split("&"),function(a){var c,d,e;a&&(d=a=a.replace(/\+/g,"%20"),c=a.indexOf("="),-1!==c&&(d=a.substring(0,c),e=a.substring(c+1)),d=ca(d),u(d)&&(e=!u(e)||ca(e),Zd.call(b,d)?pe(b[d])?b[d].push(e):b[d]=[b[d],e]:b[d]=e))}),b}function ea(a){var b=[];return f(a,function(a,c){pe(a)?f(a,function(a){b.push(ga(c,!0)+(!0===a?"":"="+ga(a,!0)))}):b.push(ga(c,!0)+(!0===a?"":"="+ga(a,!0)))}),b.length?b.join("&"):""}function fa(a){return ga(a,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ga(a,b){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,b?"%20":"+")}function ha(a,b){var c,d,e=we.length;for(d=0;d<e;++d)if(c=we[d]+b,x(c=a.getAttribute(c)))return c;return null}function ia(b,c){var d,e,g={};if(f(we,function(a){var c=a+"app";!d&&b.hasAttribute&&b.hasAttribute(c)&&(d=b,e=b.getAttribute(c))}),f(we,function(a){var c,f=a+"app";!d&&(c=b.querySelector("["+f.replace(":","\\:")+"]"))&&(d=c,e=c.getAttribute(f))}),d){if(!xe)return void a.console.error("Angular: disabling automatic bootstrap. <script> protocol indicates an extension, document.location.href does not match.");g.strictDi=null!==ha(d,"strict-di"),c(d,e?[e]:[],g)}}function ja(b,c,d){v(d)||(d={}),d=l({strictDi:!1},d);var e=function(){if(b=de(b),b.injector()){var e=b[0]===a.document?"document":ba(b);throw le("btstrpd","App already bootstrapped with this element '{0}'",e.replace(/</,"&lt;").replace(/>/,"&gt;"))}c=c||[],c.unshift(["$provide",function(a){a.value("$rootElement",b)}]),d.debugInfoEnabled&&c.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]),c.unshift("ng");var f=jb(c,d.strictDi);return f.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d),c(b)(a)})}]),f},g=/^NG_ENABLE_DEBUG_INFO!/,h=/^NG_DEFER_BOOTSTRAP!/;if(a&&g.test(a.name)&&(d.debugInfoEnabled=!0,a.name=a.name.replace(g,"")),a&&!h.test(a.name))return e();a.name=a.name.replace(h,""),me.resumeBootstrap=function(a){return f(a,function(a){c.push(a)}),e()},B(me.resumeDeferredBootstrap)&&me.resumeDeferredBootstrap()}function ka(){a.name="NG_ENABLE_DEBUG_INFO!"+a.name,a.location.reload()}function la(a){var b=me.element(a).injector();if(!b)throw le("test","no injector found for element argument to getTestability");return b.get("$$testability")}function ma(a,b){return b=b||"_",a.replace(ye,function(a,c){return(c?b:"")+a.toLowerCase()})}function na(a,b,c){if(!a)throw le("areq","Argument '{0}' is {1}",b||"?",c||"required");return a}function oa(a,b,c){return c&&pe(a)&&(a=a[a.length-1]),na(B(a),b,"not a function, got "+(a&&"object"==typeof a?a.constructor.name||"Object":typeof a)),a}function pa(a,b){if("hasOwnProperty"===a)throw le("badname","hasOwnProperty is not a valid {0} name",b)}function qa(a,b,c){if(!b)return a;for(var d,e=b.split("."),f=a,g=e.length,h=0;h<g;h++)d=e[h],a&&(a=(f=a)[d]);return!c&&B(a)?W(f,a):a}function ra(a){for(var b,c=a[0],d=a[a.length-1],e=1;c!==d&&(c=c.nextSibling);e++)(b||a[e]!==c)&&(b||(b=de(ge.call(a,0,e))),b.push(c));return b||a}function sa(){return Object.create(null)}function ta(a){if(null==a)return"";switch(typeof a){case"string":break;case"number":a=""+a;break;default:a=!s(a)||pe(a)||z(a)?Y(a):a.toString()}return a}function ua(a){function b(a,b,c){return a[b]||(a[b]=c())}var c=d("$injector"),e=d("ng"),f=b(a,"angular",Object);return f.$$minErr=f.$$minErr||d,b(f,"module",function(){var a={};return function(d,f,g){var h={};return function(a,b){if("hasOwnProperty"===a)throw e("badname","hasOwnProperty is not a valid {0} name",b)}(d,"module"),f&&a.hasOwnProperty(d)&&(a[d]=null),b(a,d,function(){function a(a,b,c,d){return d||(d=i),function(){return d[c||"push"]([a,b,arguments]),m}}function b(a,b,c){return c||(c=i),function(e,f){return f&&B(f)&&(f.$$moduleName=d),c.push([a,b,arguments]),m}}if(!f)throw c("nomod","Module '{0}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.",d);var i=[],j=[],k=[],l=a("$injector","invoke","push",j),m={_invokeQueue:i,_configBlocks:j,_runBlocks:k,info:function(a){if(u(a)){if(!v(a))throw e("aobj","Argument '{0}' must be an object","value");return h=a,this}return h},requires:f,name:d,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),decorator:b("$provide","decorator",j),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider","register"),directive:b("$compileProvider","directive"),component:b("$compileProvider","component"),config:l,run:function(a){return k.push(a),this}};return g&&l(g),m})}})}function va(a,b){if(pe(a)){b=b||[];for(var c=0,d=a.length;c<d;c++)b[c]=a[c]}else if(v(a)){b=b||{};for(var e in a)"$"===e.charAt(0)&&"$"===e.charAt(1)||(b[e]=a[e])}return b||a}function wa(a,b){var d=[];return c(b)&&(a=me.copy(a,null,b)),JSON.stringify(a,function(a,b){if(b=X(a,b),v(b)){if(d.indexOf(b)>=0)return"...";d.push(b)}return b})}function xa(a,b){return"function"==typeof a?a.toString().replace(/ \{[\s\S]*$/,""):t(a)?"undefined":"string"!=typeof a?wa(a,b):a}function ya(){return++He}function za(a){return Ba(a.replace(Je,"ms-"))}function Aa(a,b){return b.toUpperCase()}function Ba(a){return a.replace(Ie,Aa)}function Ca(a){return!Ne.test(a)}function Da(a){var b=a.nodeType;return b===Ae||!b||b===De}function Ea(a){for(var b in Ge[a.ng339])return!0;return!1}function Fa(a,b){var c,d,e,g,h=b.createDocumentFragment(),i=[];if(Ca(a))i.push(b.createTextNode(a));else{for(c=h.appendChild(b.createElement("div")),d=(Oe.exec(a)||["",""])[1].toLowerCase(),e=Qe[d]||Qe._default,c.innerHTML=e[1]+a.replace(Pe,"<$1></$2>")+e[2],g=e[0];g--;)c=c.lastChild;i=U(i,c.childNodes),c=h.firstChild,c.textContent=""}return h.textContent="",h.innerHTML="",f(i,function(a){h.appendChild(a)}),h}function Ga(b,c){c=c||a.document;var d;return(d=Me.exec(b))?[c.createElement(d[1])]:(d=Fa(b,c))?d.childNodes:[]}function Ha(a,b){var c=a.parentNode;c&&c.replaceChild(b,a),b.appendChild(a)}function Ia(a){if(a instanceof Ia)return a;var b;if(x(a)&&(a=re(a),b=!0),!(this instanceof Ia)){if(b&&"<"!==a.charAt(0))throw Le("nosel","Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element");return new Ia(a)}b?Sa(this,Ga(a)):B(a)?Ya(a):Sa(this,a)}function Ja(a){return a.cloneNode(!0)}function Ka(a,b){!b&&Da(a)&&de.cleanData([a]),a.querySelectorAll&&de.cleanData(a.querySelectorAll("*"))}function La(a,b,c,d){if(u(d))throw Le("offargs","jqLite#off() does not support the `selector` argument");var e=Na(a),g=e&&e.events,h=e&&e.handle;if(h)if(b){var i=function(b){var d=g[b];u(c)&&Q(d||[],c),u(c)&&d&&d.length>0||(a.removeEventListener(b,h),delete g[b])};f(b.split(" "),function(a){i(a),Ke[a]&&i(Ke[a])})}else for(b in g)"$destroy"!==b&&a.removeEventListener(b,h),delete g[b]}function Ma(a,b){var c=a.ng339,d=c&&Ge[c];if(d){if(b)return void delete d.data[b];d.handle&&(d.events.$destroy&&d.handle({},"$destroy"),La(a)),delete Ge[c],a.ng339=void 0}}function Na(a,b){var c=a.ng339,d=c&&Ge[c];return b&&!d&&(a.ng339=c=ya(),d=Ge[c]={events:{},data:{},handle:void 0}),d}function Oa(a,b,c){if(Da(a)){var d,e=u(c),f=!e&&b&&!v(b),g=!b,h=Na(a,!f),i=h&&h.data;if(e)i[Ba(b)]=c;else{if(g)return i;if(f)return i&&i[Ba(b)];for(d in b)i[Ba(d)]=b[d]}}}function Pa(a,b){return!!a.getAttribute&&(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+b+" ")>-1}function Qa(a,b){b&&a.setAttribute&&f(b.split(" "),function(b){a.setAttribute("class",re((" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+re(b)+" "," ")))})}function Ra(a,b){if(b&&a.setAttribute){var c=(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");f(b.split(" "),function(a){a=re(a),-1===c.indexOf(" "+a+" ")&&(c+=a+" ")}),a.setAttribute("class",re(c))}}function Sa(a,b){if(b)if(b.nodeType)a[a.length++]=b;else{var c=b.length;if("number"==typeof c&&b.window!==b){if(c)for(var d=0;d<c;d++)a[a.length++]=b[d]}else a[a.length++]=b}}function Ta(a,b){return Ua(a,"$"+(b||"ngController")+"Controller")}function Ua(a,b,c){a.nodeType===De&&(a=a.documentElement);for(var d=pe(b)?b:[b];a;){for(var e=0,f=d.length;e<f;e++)if(u(c=de.data(a,d[e])))return c;a=a.parentNode||a.nodeType===Ee&&a.host}}function Va(a){for(Ka(a,!0);a.firstChild;)a.removeChild(a.firstChild)}function Wa(a,b){b||Ka(a);var c=a.parentNode;c&&c.removeChild(a)}function Xa(b,c){c=c||a,"complete"===c.document.readyState?c.setTimeout(b):de(c).on("load",b)}function Ya(b){function c(){a.document.removeEventListener("DOMContentLoaded",c),a.removeEventListener("load",c),b()}"complete"===a.document.readyState?a.setTimeout(b):(a.document.addEventListener("DOMContentLoaded",c),a.addEventListener("load",c))}function Za(a,b){var c=Te[b.toLowerCase()];return c&&Ue[O(a)]&&c}function $a(a){return Ve[a]}function _a(a,b){var c=function(c,d){c.isDefaultPrevented=function(){return c.defaultPrevented};var e=b[d||c.type],f=e?e.length:0;if(f){if(t(c.immediatePropagationStopped)){var g=c.stopImmediatePropagation;c.stopImmediatePropagation=function(){c.immediatePropagationStopped=!0,c.stopPropagation&&c.stopPropagation(),g&&g.call(c)}}c.isImmediatePropagationStopped=function(){return!0===c.immediatePropagationStopped};var h=e.specialHandlerWrapper||ab;f>1&&(e=va(e));for(var i=0;i<f;i++)c.isImmediatePropagationStopped()||h(a,c,e[i])}};return c.elem=a,c}function ab(a,b,c){c.call(a,b)}function bb(a,b,c){var d=b.relatedTarget;d&&(d===a||Re.call(a,d))||c.call(a,b)}function cb(){this.$get=function(){return l(Ia,{hasClass:function(a,b){return a.attr&&(a=a[0]),Pa(a,b)},addClass:function(a,b){return a.attr&&(a=a[0]),Ra(a,b)},removeClass:function(a,b){return a.attr&&(a=a[0]),Qa(a,b)}})}}function db(a,b){var c=a&&a.$$hashKey;if(c)return"function"==typeof c&&(c=a.$$hashKey()),c;var d=typeof a;return c="function"===d||"object"===d&&null!==a?a.$$hashKey=d+":"+(b||i)():d+":"+a}function eb(){this._keys=[],this._values=[],this._lastKey=NaN,this._lastIndex=-1}function fb(a){return Function.prototype.toString.call(a)}function gb(a){var b=fb(a).replace(bf,"");return b.match(Ze)||b.match($e)}function hb(a){var b=gb(a);return b?"function("+(b[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function ib(a,b,c){var d,e,g;if("function"==typeof a){if(!(d=a.$inject)){if(d=[],a.length){if(b)throw x(c)&&c||(c=a.name||hb(a)),cf("strictdi","{0} is not using explicit annotation and cannot be invoked in strict mode",c);e=gb(a),f(e[1].split(_e),function(a){a.replace(af,function(a,b,c){d.push(c)})})}a.$inject=d}}else pe(a)?(g=a.length-1,oa(a[g],"fn"),d=a.slice(0,g)):oa(a,"fn",!0);return d}function jb(a,b){function c(a){return function(b,c){if(!v(b))return a(b,c);f(b,h(a))}}function d(a,b){if(pa(a,"service"),(B(b)||pe(b))&&(b=w.instantiate(b)),!b.$get)throw cf("pget","Provider '{0}' must define $get factory method.",a);return u[a+p]=b}function e(a,b){return function(){var c=A.invoke(b,this);if(t(c))throw cf("undef","Provider '{0}' must return a value from $get factory method.",a);return c}}function g(a,b,c){return d(a,{$get:!1!==c?e(a,b):b})}function i(a,b){return g(a,["$injector",function(a){return a.instantiate(b)}])}function j(a,b){return g(a,r(b),!1)}function k(a,b){pa(a,"constant"),u[a]=b,y[a]=b}function l(a,b){var c=w.get(a+p),d=c.$get;c.$get=function(){var a=A.invoke(d,c);return A.invoke(b,null,{$delegate:a})}}function m(a){na(t(a)||pe(a),"modulesToLoad","not an array");var b,c=[];return f(a,function(a){function d(a){var b,c;for(b=0,c=a.length;b<c;b++){var d=a[b],e=w.get(d[0]);e[d[1]].apply(e,d[2])}}if(!s.get(a)){s.set(a,!0);try{x(a)?(b=fe(a),A.modules[a]=b,c=c.concat(m(b.requires)).concat(b._runBlocks),d(b._invokeQueue),d(b._configBlocks)):B(a)?c.push(w.invoke(a)):pe(a)?c.push(w.invoke(a)):oa(a,"module")}catch(b){throw pe(a)&&(a=a[a.length-1]),b.message&&b.stack&&-1===b.stack.indexOf(b.message)&&(b=b.message+"\n"+b.stack),cf("modulerr","Failed to instantiate module {0} due to:\n{1}",a,b.stack||b.message||b)}}}),c}function n(a,c){function d(b,d){if(a.hasOwnProperty(b)){if(a[b]===o)throw cf("cdep","Circular dependency found: {0}",b+" <- "+q.join(" <- "));return a[b]}try{return q.unshift(b),a[b]=o,a[b]=c(b,d),a[b]}catch(c){throw a[b]===o&&delete a[b],c}finally{q.shift()}}function e(a,c,e){for(var f=[],g=jb.$$annotate(a,b,e),h=0,i=g.length;h<i;h++){var j=g[h];if("string"!=typeof j)throw cf("itkn","Incorrect injection token! Expected service name as string, got {0}",j);f.push(c&&c.hasOwnProperty(j)?c[j]:d(j,e))}return f}function f(a){if(ce||"function"!=typeof a)return!1;var b=a.$$ngIsClass;return I(b)||(b=a.$$ngIsClass=/^(?:class\b|constructor\()/.test(fb(a))),b}function g(a,b,c,d){"string"==typeof c&&(d=c,c=null);var g=e(a,c,d);return pe(a)&&(a=a[a.length-1]),f(a)?(g.unshift(null),new(Function.prototype.bind.apply(a,g))):a.apply(b,g)}function h(a,b,c){var d=pe(a)?a[a.length-1]:a,f=e(a,b,c);return f.unshift(null),new(Function.prototype.bind.apply(d,f))}return{invoke:g,instantiate:h,get:d,annotate:jb.$$annotate,has:function(b){return u.hasOwnProperty(b+p)||a.hasOwnProperty(b)}}}b=!0===b;var o={},p="Provider",q=[],s=new Xe,u={$provide:{provider:c(d),factory:c(g),service:c(i),value:c(j),constant:c(k),decorator:l}},w=u.$injector=n(u,function(a,b){throw me.isString(b)&&q.push(b),cf("unpr","Unknown provider: {0}",q.join(" <- "))}),y={},z=n(y,function(a,b){var c=w.get(a+p,b);return A.invoke(c.$get,c,void 0,a)}),A=z;u["$injector"+p]={$get:r(z)},A.modules=w.modules=sa();var C=m(a);return A=z.get("$injector"),A.strictDi=b,f(C,function(a){a&&A.invoke(a)}),A}function kb(){var a=!0;this.disableAutoScrolling=function(){a=!1},this.$get=["$window","$location","$rootScope",function(b,c,d){function e(a){var b=null;return Array.prototype.some.call(a,function(a){if("a"===O(a))return b=a,!0}),b}function f(){var a=h.yOffset;if(B(a))a=a();else if(M(a)){var c=a[0],d=b.getComputedStyle(c);a="fixed"!==d.position?0:c.getBoundingClientRect().bottom}else y(a)||(a=0);return a}function g(a){if(a){a.scrollIntoView();var c=f();if(c){var d=a.getBoundingClientRect().top;b.scrollBy(0,d-c)}}else b.scrollTo(0,0)}function h(a){a=x(a)?a:y(a)?a.toString():c.hash();var b;a?(b=i.getElementById(a))?g(b):(b=e(i.getElementsByName(a)))?g(b):"top"===a&&g(null):g(null)}var i=b.document;return a&&d.$watch(function(){return c.hash()},function(a,b){a===b&&""===a||Xa(function(){d.$evalAsync(h)})}),h}]}function lb(a,b){return a||b?a?b?(pe(a)&&(a=a.join(" ")),pe(b)&&(b=b.join(" ")),a+" "+b):a:b:""}function mb(a){for(var b=0;b<a.length;b++){var c=a[b];if(c.nodeType===ef)return c}}function nb(a){x(a)&&(a=a.split(" "));var b=sa();return f(a,function(a){a.length&&(b[a]=!0)}),b}function ob(a){return v(a)?a:{}}function pb(a,b,c,d){function e(a){try{a.apply(null,V(arguments,1))}finally{if(0===--r)for(;s.length;)try{s.pop()()}catch(a){c.error(a)}}}function g(a){var b=a.indexOf("#");return-1===b?"":a.substr(b)}function h(){y=null,j()}function i(){u=z(),u=t(u)?null:u,T(u,C)&&(u=C),C=u,v=u}function j(){var a=v;i(),w===k.url()&&a===u||(w=k.url(),v=u,f(A,function(a){a(k.url(),u)}))}var k=this,l=a.location,m=a.history,n=a.setTimeout,o=a.clearTimeout,q={};k.isMock=!1;var r=0,s=[];k.$$completeOutstandingRequest=e,k.$$incOutstandingRequestCount=function(){r++},k.notifyWhenNoOutstandingRequests=function(a){0===r?a():s.push(a)};var u,v,w=l.href,x=b.find("base"),y=null,z=d.history?function(){try{return m.state}catch(a){}}:p;i(),k.url=function(b,c,e){if(t(e)&&(e=null),l!==a.location&&(l=a.location),m!==a.history&&(m=a.history),b){var f=v===e;if(w===b&&(!d.history||f))return k;var h=w&&Yb(w)===Yb(b);return w=b,v=e,!d.history||h&&f?(h||(y=b),c?l.replace(b):h?l.hash=g(b):l.href=b,l.href!==b&&(y=b)):(m[c?"replaceState":"pushState"](e,"",b),i()),y&&(y=b),k}return y||l.href.replace(/%27/g,"'")},k.state=function(){return u};var A=[],B=!1,C=null;k.onUrlChange=function(b){return B||(d.history&&de(a).on("popstate",h),de(a).on("hashchange",h),B=!0),A.push(b),b},k.$$applicationDestroyed=function(){de(a).off("hashchange popstate",h)},k.$$checkUrlChange=j,k.baseHref=function(){var a=x.attr("href");return a?a.replace(/^(https?:)?\/\/[^\/]*/,""):""},k.defer=function(a,b){var c;return r++,c=n(function(){delete q[c],e(a)},b||0),q[c]=!0,c},k.defer.cancel=function(a){return!!q[a]&&(delete q[a],o(a),e(p),!0)}}function qb(){this.$get=["$window","$log","$sniffer","$document",function(a,b,c,d){return new pb(a,d,b,c)}]}function rb(){this.$get=function(){function a(a,c){function e(a){a!==m&&(n?n===a&&(n=a.n):n=a,f(a.n,a.p),f(a,m),m=a,m.n=null)}function f(a,b){a!==b&&(a&&(a.p=b),b&&(b.n=a))}if(a in b)throw d("$cacheFactory")("iid","CacheId '{0}' is already taken!",a);var g=0,h=l({},c,{id:a}),i=sa(),j=c&&c.capacity||Number.MAX_VALUE,k=sa(),m=null,n=null;return b[a]={put:function(a,b){if(!t(b)){if(j<Number.MAX_VALUE){e(k[a]||(k[a]={key:a}))}return a in i||g++,i[a]=b,g>j&&this.remove(n.key),b}},get:function(a){if(j<Number.MAX_VALUE){var b=k[a];if(!b)return;e(b)}return i[a]},remove:function(a){if(j<Number.MAX_VALUE){var b=k[a];if(!b)return;b===m&&(m=b.p),b===n&&(n=b.n),f(b.n,b.p),delete k[a]}a in i&&(delete i[a],g--)},removeAll:function(){i=sa(),g=0,k=sa(),m=n=null},destroy:function(){i=null,h=null,k=null,delete b[a]},info:function(){return l({},h,{size:g})}}}var b={};return a.info=function(){var a={};return f(b,function(b,c){a[c]=b.info()}),a},a.get=function(a){return b[a]},a}}function sb(){this.$get=["$cacheFactory",function(a){return a("templates")}]}function tb(){}function ub(b,c){function d(a,b,c){var d=/^\s*([@&<]|=(\*?))(\??)\s*([\w$]*)\s*$/,e=sa();return f(a,function(a,f){if(a in C)return void(e[f]=C[a]);var g=a.match(d);if(!g)throw mf("iscp","Invalid {3} for directive '{0}'. Definition: {... {1}: '{2}' ...}",b,f,a,c?"controller bindings definition":"isolate scope definition");e[f]={mode:g[1][0],collection:"*"===g[2],optional:"?"===g[3],attrName:g[4]||f},g[4]&&(C[a]=e[f])}),e}function e(a,b){var c={isolateScope:null,bindToController:null};if(v(a.scope)&&(!0===a.bindToController?(c.bindToController=d(a.scope,b,!0),c.isolateScope={}):c.isolateScope=d(a.scope,b,!1)),v(a.bindToController)&&(c.bindToController=d(a.bindToController,b,!0)),c.bindToController&&!a.controller)throw mf("noctrl","Cannot bind to controller without directive '{0}'s controller.",b);return c}function g(a){var b=a.charAt(0);if(!b||b!==$d(b))throw mf("baddir","Directive/Component name '{0}' is invalid. The first character must be a lowercase letter",a);if(a!==a.trim())throw mf("baddir","Directive/Component name '{0}' is invalid. The name should not contain leading or trailing whitespaces",a)}function i(a){var b=a.require||a.controller&&a.name;return!pe(b)&&v(b)&&f(b,function(a,c){var d=a.match(y);a.substring(d[0].length)||(b[c]=d[0]+c)}),b}function j(a,b){if(a&&(!x(a)||!/[EACM]/.test(a)))throw mf("badrestrict","Restrict property '{0}' of directive '{1}' is invalid",a,b);return a||"EA"}var k={},m="Directive",n=/^\s*directive:\s*([\w-]+)\s+(.*)$/,s=/(([\w-]+)(?::([^;]+))?;?)/,w=N("ngSrc,ngSrcset,src,srcset"),y=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,z=/^(on[a-z]+|formaction)$/,C=sa();this.directive=function a(c,d){return na(c,"name"),pa(c,"directive"),x(c)?(g(c),na(d,"directiveFactory"),k.hasOwnProperty(c)||(k[c]=[],b.factory(c+m,["$injector","$exceptionHandler",function(a,b){var d=[];return f(k[c],function(e,f){try{var g=a.invoke(e);B(g)?g={compile:r(g)}:!g.compile&&g.link&&(g.compile=r(g.link)),g.priority=g.priority||0,g.index=f,g.name=g.name||c,g.require=i(g),g.restrict=j(g.restrict,c),g.$$moduleName=e.$$moduleName,d.push(g)}catch(a){b(a)}}),d}])),k[c].push(d)):f(c,h(a)),this},this.component=function a(b,c){function d(a){function b(b){return B(b)||pe(b)?function(c,d){return a.invoke(b,this,{$element:c,$attrs:d})}:b}var d=c.template||c.templateUrl?c.template:"",g={controller:e,controllerAs:zb(c.controller)||c.controllerAs||"$ctrl",template:b(d),templateUrl:b(c.templateUrl),transclude:c.transclude,scope:{},bindToController:c.bindings||{},restrict:"E",require:c.require};return f(c,function(a,b){"$"===b.charAt(0)&&(g[b]=a)}),g}if(!x(b))return f(b,h(W(this,a))),this;var e=c.controller||function(){};return f(c,function(a,b){"$"===b.charAt(0)&&(d[b]=a,B(e)&&(e[b]=a))}),d.$inject=["$injector"],this.directive(b,d)},this.aHrefSanitizationWhitelist=function(a){return u(a)?(c.aHrefSanitizationWhitelist(a),this):c.aHrefSanitizationWhitelist()},this.imgSrcSanitizationWhitelist=function(a){return u(a)?(c.imgSrcSanitizationWhitelist(a),this):c.imgSrcSanitizationWhitelist()};var D=!0;this.debugInfoEnabled=function(a){return u(a)?(D=a,this):D};var F=!1;this.preAssignBindingsEnabled=function(a){return u(a)?(F=a,this):F};var G=!1;this.strictComponentBindingsEnabled=function(a){return u(a)?(G=a,this):G};var H=10;this.onChangesTtl=function(a){return arguments.length?(H=a,this):H};var J=!0;this.commentDirectivesEnabled=function(a){return arguments.length?(J=a,this):J};var K=!0;this.cssClassDirectivesEnabled=function(a){return arguments.length?(K=a,this):K},this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$sce","$animate","$$sanitizeUri",function(b,c,d,g,h,i,j,r,C,L){function M(){try{if(!--Ha)throw Ba=void 0,mf("infchng","{0} $onChanges() iterations reached. Aborting!\n",H);j.$apply(function(){for(var a=[],b=0,c=Ba.length;b<c;++b)try{Ba[b]()}catch(b){a.push(b)}if(Ba=void 0,a.length)throw a})}finally{Ha++}}function N(a,b){if(b){var c,d,e,f=Object.keys(b);for(c=0,d=f.length;c<d;c++)e=f[c],this[e]=b[e]}else this.$attr={};this.$$element=a}function P(a,b,c){Ea.innerHTML="<span "+b+">";var d=Ea.firstChild.attributes,e=d[0];d.removeNamedItem(e.name),e.value=c,a.attributes.setNamedItem(e)}function R(a,b){try{a.addClass(b)}catch(a){}}function U(a,b,c,d,e){a instanceof de||(a=de(a));var f=Y(a,b,a,c,d,e);U.$$addScopeClass(a);var g=null;return function(b,c,d){if(!a)throw mf("multilink","This element has already been linked.");na(b,"scope"),e&&e.needsNewScope&&(b=b.$parent.$new()),d=d||{};var h=d.parentBoundTranscludeFn,i=d.transcludeControllers,j=d.futureParentElement;h&&h.$$boundTransclude&&(h=h.$$boundTransclude),g||(g=X(j));var k;if(k="html"!==g?de(ta(g,de("<div>").append(a).html())):c?Se.clone.call(a):a,i)for(var l in i)k.data("$"+l+"Controller",i[l].instance);return U.$$addScopeInfo(k,b),c&&c(k,b),f&&f(b,k,k,h),c||(a=f=null),k}}function X(a){var b=a&&a[0];return b&&"foreignobject"!==O(b)&&je.call(b).match(/SVG/)?"svg":"html"}function Y(a,b,c,d,e,f){function g(a,c,d,e){var f,g,h,i,j,k,l,m,p;if(n){var q=c.length;for(p=new Array(q),j=0;j<o.length;j+=3)l=o[j],p[l]=c[l]}else p=c;for(j=0,k=o.length;j<k;)h=p[o[j++]],f=o[j++],g=o[j++],f?(f.scope?(i=a.$new(),U.$$addScopeInfo(de(h),i)):i=a,m=f.transcludeOnThisElement?$(a,f.transclude,e):!f.templateOnThisElement&&e?e:!e&&b?$(a,b):null,f(g,i,h,d,m)):g&&g(a,h.childNodes,void 0,e)}for(var h,i,j,k,l,m,n,o=[],p=pe(a)||a instanceof de,q=0;q<a.length;q++)h=new N,11===ce&&Z(a,q,p),i=_(a[q],[],h,0===q?d:void 0,e),j=i.length?fa(i,a[q],h,b,c,null,[],[],f):null,j&&j.scope&&U.$$addScopeClass(h.$$element),l=j&&j.terminal||!(k=a[q].childNodes)||!k.length?null:Y(k,j?(j.transcludeOnThisElement||!j.templateOnThisElement)&&j.transclude:b),(j||l)&&(o.push(q,j,l),m=!0,n=n||j),f=null;return m?g:null}function Z(a,b,c){var d,e=a[b],f=e.parentNode;if(e.nodeType===Be)for(;;){if(!(d=f?e.nextSibling:a[b+1])||d.nodeType!==Be)break;e.nodeValue=e.nodeValue+d.nodeValue,d.parentNode&&d.parentNode.removeChild(d),c&&d===a[b+1]&&a.splice(b+1,1)}}function $(a,b,c){function d(d,e,f,g,h){return d||(d=a.$new(!1,h),d.$$transcluded=!0),b(d,e,{parentBoundTranscludeFn:c,transcludeControllers:f,futureParentElement:g})}var e=d.$$slots=sa()
2
- ;for(var f in b.$$slots)b.$$slots[f]?e[f]=$(a,b.$$slots[f],c):e[f]=null;return d}function _(a,b,c,d,e){var f,g,h,i=a.nodeType,j=c.$attr;switch(i){case Ae:g=O(a),ja(b,wb(g),"E",d,e);for(var k,l,m,n,o,p,q=a.attributes,r=0,t=q&&q.length;r<t;r++){var u=!1,w=!1;k=q[r],l=k.name,o=k.value,n=wb(l),p=Ma.test(n),p&&(l=l.replace(of,"").substr(8).replace(/_(.)/g,function(a,b){return b.toUpperCase()}));var y=n.match(Na);y&&ka(y[1])&&(u=l,w=l.substr(0,l.length-5)+"end",l=l.substr(0,l.length-6)),m=wb(l.toLowerCase()),j[m]=l,!p&&c.hasOwnProperty(m)||(c[m]=o,Za(a,m)&&(c[m]=!0)),va(a,b,o,m,p),ja(b,m,"A",d,e,u,w)}if("input"===g&&"hidden"===a.getAttribute("type")&&a.setAttribute("autocomplete","off"),!Ga)break;if(h=a.className,v(h)&&(h=h.animVal),x(h)&&""!==h)for(;f=s.exec(h);)m=wb(f[2]),ja(b,m,"C",d,e)&&(c[m]=re(f[3])),h=h.substr(f.index+f[0].length);break;case Be:ra(b,a.nodeValue);break;case Ce:if(!Fa)break;aa(a,b,c,d,e)}return b.sort(pa),b}function aa(a,b,c,d,e){try{var f=n.exec(a.nodeValue);if(f){var g=wb(f[1]);ja(b,g,"M",d,e)&&(c[g]=re(f[2]))}}catch(a){}}function ca(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b))do{if(!a)throw mf("uterdir","Unterminated attribute, found '{0}' but no matching '{1}' found.",b,c);a.nodeType===Ae&&(a.hasAttribute(b)&&e++,a.hasAttribute(c)&&e--),d.push(a),a=a.nextSibling}while(e>0);else d.push(a);return de(d)}function da(a,b,c){return function(d,e,f,g,h){return e=ca(e[0],b,c),a(d,e,f,g,h)}}function ea(a,b,c,d,e,f){var g;return a?U(b,c,d,e,f):function(){return g||(g=U(b,c,d,e,f),b=c=f=null),g.apply(this,arguments)}}function fa(a,b,c,e,g,h,i,j,k){function m(a,b,c,d){a&&(c&&(a=da(a,c,d)),a.require=o.require,a.directiveName=p,(y===o||o.$$isolateScope)&&(a=xa(a,{isolateScope:!0})),i.push(a)),b&&(c&&(b=da(b,c,d)),b.require=o.require,b.directiveName=p,(y===o||o.$$isolateScope)&&(b=xa(b,{isolateScope:!0})),j.push(b))}function n(a,e,g,h,k){function m(a,b,c,d){var e;if(E(a)||(d=c,c=b,b=a,a=void 0),G&&(e=s),c||(c=G?A.parent():A),!d)return k(a,b,e,c,M);var f=k.$$slots[d];if(f)return f(a,b,e,c,M);if(t(f))throw mf("noslot",'No parent directive that requires a transclusion with slot name "{0}". Element: {1}',d,ba(A))}var n,o,p,q,r,s,u,A,C,D;b===g?(C=c,A=c.$$element):(A=de(g),C=new N(A,c)),r=e,y?q=e.$new(!0):w&&(r=e.$parent),k&&(u=m,u.$$boundTransclude=k,u.isSlotFilled=function(a){return!!k.$$slots[a]}),x&&(s=ha(A,C,u,x,q,e,y)),y&&(U.$$addScopeInfo(A,q,!0,!(z&&(z===y||z===y.$$originalDirective))),U.$$addScopeClass(A,!0),q.$$isolateBindings=y.$$isolateBindings,D=Aa(e,C,q,q.$$isolateBindings,y),D.removeWatches&&q.$on("$destroy",D.removeWatches));for(var H in s){var I=x[H],J=s[H],K=I.$$bindings.bindToController;if(F){J.bindingInfo=K?Aa(r,C,J.instance,K,I):{};var L=J();L!==J.instance&&(J.instance=L,A.data("$"+I.name+"Controller",L),J.bindingInfo.removeWatches&&J.bindingInfo.removeWatches(),J.bindingInfo=Aa(r,C,J.instance,K,I))}else J.instance=J(),A.data("$"+I.name+"Controller",J.instance),J.bindingInfo=Aa(r,C,J.instance,K,I)}for(f(x,function(a,b){var c=a.require;a.bindToController&&!pe(c)&&v(c)&&l(s[b].instance,ga(b,c,A,s))}),f(s,function(a){var b=a.instance;if(B(b.$onChanges))try{b.$onChanges(a.bindingInfo.initialChanges)}catch(a){d(a)}if(B(b.$onInit))try{b.$onInit()}catch(a){d(a)}B(b.$doCheck)&&(r.$watch(function(){b.$doCheck()}),b.$doCheck()),B(b.$onDestroy)&&r.$on("$destroy",function(){b.$onDestroy()})}),n=0,o=i.length;n<o;n++)p=i[n],ya(p,p.isolateScope?q:e,A,C,p.require&&ga(p.directiveName,p.require,A,s),u);var M=e;for(y&&(y.template||null===y.templateUrl)&&(M=q),a&&a(M,g.childNodes,void 0,k),n=j.length-1;n>=0;n--)p=j[n],ya(p,p.isolateScope?q:e,A,C,p.require&&ga(p.directiveName,p.require,A,s),u);f(s,function(a){var b=a.instance;B(b.$postLink)&&b.$postLink()})}k=k||{};for(var o,p,q,r,s,u=-Number.MAX_VALUE,w=k.newScopeDirective,x=k.controllerDirectives,y=k.newIsolateScopeDirective,z=k.templateDirective,A=k.nonTlbTranscludeDirective,C=!1,D=!1,G=k.hasElementTranscludeDirective,H=c.$$element=de(b),I=h,J=e,K=!1,L=!1,M=0,P=a.length;M<P;M++){o=a[M];var Q=o.$$start,R=o.$$end;if(Q&&(H=ca(b,Q,R)),q=void 0,u>o.priority)break;if(s=o.scope,s&&(o.templateUrl||(v(s)?(qa("new/isolated scope",y||w,o,H),y=o):qa("new/isolated scope",y,o,H)),w=w||o),p=o.name,!K&&(o.replace&&(o.templateUrl||o.template)||o.transclude&&!o.$$tlb)){for(var S,T=M+1;S=a[T++];)if(S.transclude&&!S.$$tlb||S.replace&&(S.templateUrl||S.template)){L=!0;break}K=!0}if(!o.templateUrl&&o.controller&&(x=x||sa(),qa("'"+p+"' controller",x[p],o,H),x[p]=o),s=o.transclude)if(C=!0,o.$$tlb||(qa("transclusion",A,o,H),A=o),"element"===s)G=!0,u=o.priority,q=H,H=c.$$element=de(U.$$createComment(p,c[p])),b=H[0],wa(g,V(q),b),q[0].$$parentNode=q[0].parentNode,J=ea(L,q,e,u,I&&I.name,{nonTlbTranscludeDirective:A});else{var X=sa();if(v(s)){q=[];var Y=sa(),Z=sa();f(s,function(a,b){var c="?"===a.charAt(0);a=c?a.substring(1):a,Y[a]=b,X[b]=null,Z[b]=c}),f(H.contents(),function(a){var b=Y[wb(O(a))];b?(Z[b]=!0,X[b]=X[b]||[],X[b].push(a)):q.push(a)}),f(Z,function(a,b){if(!a)throw mf("reqslot","Required transclusion slot `{0}` was not filled.",b)});for(var $ in X)X[$]&&(X[$]=ea(L,X[$],e))}else q=de(Ja(b)).contents();H.empty(),J=ea(L,q,e,void 0,void 0,{needsNewScope:o.$$isolateScope||o.$$newScope}),J.$$slots=X}if(o.template)if(D=!0,qa("template",z,o,H),z=o,s=B(o.template)?o.template(H,c):o.template,s=La(s),o.replace){if(I=o,q=Ca(s)?[]:yb(ta(o.templateNamespace,re(s))),b=q[0],1!==q.length||b.nodeType!==Ae)throw mf("tplrt","Template for directive '{0}' must have exactly one root element. {1}",p,"");wa(g,H,b);var aa={$attr:{}},fa=_(b,[],aa),ja=a.splice(M+1,a.length-(M+1));(y||w)&&ia(fa,y,w),a=a.concat(fa).concat(ja),la(c,aa),P=a.length}else H.html(s);if(o.templateUrl)D=!0,qa("template",z,o,H),z=o,o.replace&&(I=o),n=oa(a.splice(M,a.length-M),H,c,g,C&&J,i,j,{controllerDirectives:x,newScopeDirective:w!==o&&w,newIsolateScopeDirective:y,templateDirective:z,nonTlbTranscludeDirective:A}),P=a.length;else if(o.compile)try{r=o.compile(H,c,J);var ka=o.$$originalDirective||o;B(r)?m(null,W(ka,r),Q,R):r&&m(W(ka,r.pre),W(ka,r.post),Q,R)}catch(a){d(a,ba(H))}o.terminal&&(n.terminal=!0,u=Math.max(u,o.priority))}return n.scope=w&&!0===w.scope,n.transcludeOnThisElement=C,n.templateOnThisElement=D,n.transclude=J,k.hasElementTranscludeDirective=G,n}function ga(a,b,c,d){var e;if(x(b)){var g=b.match(y),h=b.substring(g[0].length),i=g[1]||g[3],j="?"===g[2];if("^^"===i?c=c.parent():(e=d&&d[h],e=e&&e.instance),!e){var k="$"+h+"Controller";e=i?c.inheritedData(k):c.data(k)}if(!e&&!j)throw mf("ctreq","Controller '{0}', required by directive '{1}', can't be found!",h,a)}else if(pe(b)){e=[];for(var l=0,m=b.length;l<m;l++)e[l]=ga(a,b[l],c,d)}else v(b)&&(e={},f(b,function(b,f){e[f]=ga(a,b,c,d)}));return e||null}function ha(a,b,c,d,e,f,g){var h=sa();for(var j in d){var k=d[j],l={$scope:k===g||k.$$isolateScope?e:f,$element:a,$attrs:b,$transclude:c},m=k.controller;"@"===m&&(m=b[k.name]);var n=i(m,l,!0,k.controllerAs);h[k.name]=n,a.data("$"+k.name+"Controller",n.instance)}return h}function ia(a,b,c){for(var d=0,e=a.length;d<e;d++)a[d]=o(a[d],{$$isolateScope:b,$$newScope:c})}function ja(a,c,d,f,g,h,i){if(c===g)return null;var j=null;if(k.hasOwnProperty(c))for(var l,n=b.get(c+m),p=0,q=n.length;p<q;p++)if(l=n[p],(t(f)||f>l.priority)&&-1!==l.restrict.indexOf(d)){if(h&&(l=o(l,{$$start:h,$$end:i})),!l.$$bindings){var r=l.$$bindings=e(l,l.name);v(r.isolateScope)&&(l.$$isolateBindings=r.isolateScope)}a.push(l),j=l}return j}function ka(a){if(k.hasOwnProperty(a))for(var c,d=b.get(a+m),e=0,f=d.length;e<f;e++)if(c=d[e],c.multiElement)return!0;return!1}function la(a,b){var c=b.$attr,d=a.$attr;f(a,function(d,e){"$"!==e.charAt(0)&&(b[e]&&b[e]!==d&&(d.length?d+=("style"===e?";":" ")+b[e]:d=b[e]),a.$set(e,d,!0,c[e]))}),f(b,function(b,e){a.hasOwnProperty(e)||"$"===e.charAt(0)||(a[e]=b,"class"!==e&&"style"!==e&&(d[e]=c[e]))})}function oa(a,b,c,e,h,i,j,k){var l,m,n=[],p=b[0],q=a.shift(),r=o(q,{templateUrl:null,transclude:null,replace:null,$$originalDirective:q}),s=B(q.templateUrl)?q.templateUrl(b,c):q.templateUrl,t=q.templateNamespace;return b.empty(),g(s).then(function(d){var g,o,u,w;if(d=La(d),q.replace){if(u=Ca(d)?[]:yb(ta(t,re(d))),g=u[0],1!==u.length||g.nodeType!==Ae)throw mf("tplrt","Template for directive '{0}' must have exactly one root element. {1}",q.name,s);o={$attr:{}},wa(e,b,g);var x=_(g,[],o);v(q.scope)&&ia(x,!0),a=x.concat(a),la(c,o)}else g=p,b.html(d);for(a.unshift(r),l=fa(a,g,c,h,b,q,i,j,k),f(e,function(a,c){a===g&&(e[c]=b[0])}),m=Y(b[0].childNodes,h);n.length;){var y=n.shift(),z=n.shift(),A=n.shift(),B=n.shift(),C=b[0];if(!y.$$destroyed){if(z!==p){var D=z.className;k.hasElementTranscludeDirective&&q.replace||(C=Ja(g)),wa(A,de(z),C),R(de(C),D)}w=l.transcludeOnThisElement?$(y,l.transclude,B):B,l(m,y,C,e,w)}}n=null}).catch(function(a){A(a)&&d(a)}),function(a,b,c,d,e){var f=e;b.$$destroyed||(n?n.push(b,c,d,f):(l.transcludeOnThisElement&&(f=$(b,l.transclude,e)),l(m,b,c,d,f)))}}function pa(a,b){var c=b.priority-a.priority;return 0!==c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function qa(a,b,c,d){function e(a){return a?" (module: "+a+")":""}if(b)throw mf("multidir","Multiple directives [{0}{1}, {2}{3}] asking for {4} on: {5}",b.name,e(b.$$moduleName),c.name,e(c.$$moduleName),a,ba(d))}function ra(a,b){var d=c(b,!0);d&&a.push({priority:0,compile:function(a){var b=a.parent(),c=!!b.length;return c&&U.$$addBindingClass(b),function(a,b){var e=b.parent();c||U.$$addBindingClass(e),U.$$addBindingInfo(e,d.expressions),a.$watch(d,function(a){b[0].nodeValue=a})}}})}function ta(b,c){switch(b=$d(b||"html")){case"svg":case"math":var d=a.document.createElement("div");return d.innerHTML="<"+b+">"+c+"</"+b+">",d.childNodes[0].childNodes;default:return c}}function ua(a,b){if("srcdoc"===b)return r.HTML;var c=O(a);if("src"===b||"ngSrc"===b){if(-1===["img","video","audio","source","track"].indexOf(c))return r.RESOURCE_URL}else if("xlinkHref"===b||"form"===c&&"action"===b||"link"===c&&"href"===b)return r.RESOURCE_URL}function va(a,b,d,e,f){var g=ua(a,e),h=!f,i=w[e]||f,j=c(d,h,g,i);if(j){if("multiple"===e&&"select"===O(a))throw mf("selmulti","Binding to the 'multiple' attribute is not supported. Element: {0}",ba(a));if(z.test(e))throw mf("nodomevents","Interpolations for HTML DOM event attributes are disallowed. Please use the ng- versions (such as ng-click instead of onclick) instead.");b.push({priority:100,compile:function(){return{pre:function(a,b,f){var h=f.$$observers||(f.$$observers=sa()),k=f[e];k!==d&&(j=k&&c(k,!0,g,i),d=k),j&&(f[e]=j(a),(h[e]||(h[e]=[])).$$inter=!0,(f.$$observers&&f.$$observers[e].$$scope||a).$watch(j,function(a,b){"class"===e&&a!==b?f.$updateClass(a,b):f.$set(e,a)}))}}}})}}function wa(b,c,d){var e,f,g=c[0],h=c.length,i=g.parentNode;if(b)for(e=0,f=b.length;e<f;e++)if(b[e]===g){b[e++]=d;for(var j=e,k=j+h-1,l=b.length;j<l;j++,k++)k<l?b[j]=b[k]:delete b[j];b.length-=h-1,b.context===g&&(b.context=d);break}i&&i.replaceChild(d,g);var m=a.document.createDocumentFragment();for(e=0;e<h;e++)m.appendChild(c[e]);for(de.hasData(g)&&(de.data(d,de.data(g)),de(g).off("$destroy")),de.cleanData(m.querySelectorAll("*")),e=1;e<h;e++)delete c[e];c[0]=d,c.length=1}function xa(a,b){return l(function(){return a.apply(null,arguments)},a,b)}function ya(a,b,c,e,f,g){try{a(b,c,e,f,g)}catch(a){d(a,ba(c))}}function za(a,b){if(G)throw mf("missingattr","Attribute '{0}' of '{1}' is non-optional and must be set!",a,b)}function Aa(a,b,d,e,g){function i(b,c,e){B(d.$onChanges)&&!S(c,e)&&(Ba||(a.$$postDigest(M),Ba=[]),k||(k={},Ba.push(j)),k[b]&&(e=k[b].previousValue),k[b]=new vb(e,c))}function j(){d.$onChanges(k),k=void 0}var k,l=[],m={};return f(e,function(e,f){var j,k,n,o,q,r=e.attrName,s=e.optional,t=e.mode;switch(t){case"@":s||Zd.call(b,r)||(za(r,g.name),d[f]=b[r]=void 0),q=b.$observe(r,function(a){if(x(a)||I(a)){var b=d[f];i(f,a,b),d[f]=a}}),b.$$observers[r].$$scope=a,j=b[r],x(j)?d[f]=c(j)(a):I(j)&&(d[f]=j),m[f]=new vb(nf,d[f]),l.push(q);break;case"=":if(!Zd.call(b,r)){if(s)break;za(r,g.name),b[r]=void 0}if(s&&!b[r])break;k=h(b[r]),o=k.literal?T:S,n=k.assign||function(){throw j=d[f]=k(a),mf("nonassign","Expression '{0}' in attribute '{1}' used with directive '{2}' is non-assignable!",b[r],r,g.name)},j=d[f]=k(a);var u=function(b){return o(b,d[f])||(o(b,j)?n(a,b=d[f]):d[f]=b),j=b};u.$stateful=!0,q=e.collection?a.$watchCollection(b[r],u):a.$watch(h(b[r],u),null,k.literal),l.push(q);break;case"<":if(!Zd.call(b,r)){if(s)break;za(r,g.name),b[r]=void 0}if(s&&!b[r])break;k=h(b[r]);var v=k.literal,w=d[f]=k(a);m[f]=new vb(nf,d[f]),q=a.$watch(k,function(a,b){if(b===a){if(b===w||v&&T(b,w))return;b=w}i(f,a,b),d[f]=a},v),l.push(q);break;case"&":if(s||Zd.call(b,r)||za(r,g.name),(k=b.hasOwnProperty(r)?h(b[r]):p)===p&&s)break;d[f]=function(b){return k(a,b)}}}),{initialChanges:m,removeWatches:l.length&&function(){for(var a=0,b=l.length;a<b;++a)l[a]()}}}var Ba,Da=/^\w/,Ea=a.document.createElement("div"),Fa=J,Ga=K,Ha=H;N.prototype={$normalize:wb,$addClass:function(a){a&&a.length>0&&C.addClass(this.$$element,a)},$removeClass:function(a){a&&a.length>0&&C.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=xb(a,b);c&&c.length&&C.addClass(this.$$element,c);var d=xb(b,a);d&&d.length&&C.removeClass(this.$$element,d)},$set:function(a,b,c,e){var g,h=this.$$element[0],i=Za(h,a),j=$a(a),k=a;if(i?(this.$$element.prop(a,b),e=i):j&&(this[j]=b,k=j),this[a]=b,e?this.$attr[a]=e:(e=this.$attr[a])||(this.$attr[a]=e=ma(a,"-")),"a"===(g=O(this.$$element))&&("href"===a||"xlinkHref"===a)||"img"===g&&"src"===a)this[a]=b=L(b,"src"===a);else if("img"===g&&"srcset"===a&&u(b)){for(var l="",m=re(b),n=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,o=/\s/.test(m)?n:/(,)/,p=m.split(o),q=Math.floor(p.length/2),r=0;r<q;r++){var s=2*r;l+=L(re(p[s]),!0),l+=" "+re(p[s+1])}var v=re(p[2*r]).split(/\s/);l+=L(re(v[0]),!0),2===v.length&&(l+=" "+re(v[1])),this[a]=b=l}!1!==c&&(null===b||t(b)?this.$$element.removeAttr(e):Da.test(e)?this.$$element.attr(e,b):P(this.$$element[0],e,b));var w=this.$$observers;w&&f(w[k],function(a){try{a(b)}catch(a){d(a)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers=sa()),e=d[a]||(d[a]=[]);return e.push(b),j.$evalAsync(function(){e.$$inter||!c.hasOwnProperty(a)||t(c[a])||b(c[a])}),function(){Q(e,b)}}};var Ia=c.startSymbol(),Ka=c.endSymbol(),La="{{"===Ia&&"}}"===Ka?q:function(a){return a.replace(/\{\{/g,Ia).replace(/}}/g,Ka)},Ma=/^ngAttr[A-Z]/,Na=/^(.+)Start$/;return U.$$addBindingInfo=D?function(a,b){var c=a.data("$binding")||[];pe(b)?c=c.concat(b):c.push(b),a.data("$binding",c)}:p,U.$$addBindingClass=D?function(a){R(a,"ng-binding")}:p,U.$$addScopeInfo=D?function(a,b,c,d){var e=c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope";a.data(e,b)}:p,U.$$addScopeClass=D?function(a,b){R(a,b?"ng-isolate-scope":"ng-scope")}:p,U.$$createComment=function(b,c){var d="";return D&&(d=" "+(b||"")+": ",c&&(d+=c+" ")),a.document.createComment(d)},U}]}function vb(a,b){this.previousValue=a,this.currentValue=b}function wb(a){return a.replace(of,"").replace(pf,Aa)}function xb(a,b){var c="",d=a.split(/\s+/),e=b.split(/\s+/);a:for(var f=0;f<d.length;f++){for(var g=d[f],h=0;h<e.length;h++)if(g===e[h])continue a;c+=(c.length>0?" ":"")+g}return c}function yb(a){a=de(a);var b=a.length;if(b<=1)return a;for(;b--;){var c=a[b];(c.nodeType===Ce||c.nodeType===Be&&""===c.nodeValue.trim())&&he.call(a,b,1)}return a}function zb(a,b){if(b&&x(b))return b;if(x(a)){var c=rf.exec(a);if(c)return c[3]}}function Ab(){var a={},b=!1;this.has=function(b){return a.hasOwnProperty(b)},this.register=function(b,c){pa(b,"controller"),v(b)?l(a,b):a[b]=c},this.allowGlobals=function(){b=!0},this.$get=["$injector","$window",function(c,e){function f(a,b,c,e){if(!a||!v(a.$scope))throw d("$controller")("noscp","Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",e,b);a.$scope[b]=c}return function(d,g,h,i){var j,k,m,n;if(h=!0===h,i&&x(i)&&(n=i),x(d)){if(!(k=d.match(rf)))throw qf("ctrlfmt","Badly formed controller string '{0}'. Must match `__name__ as __id__` or `__name__`.",d);if(m=k[1],n=n||k[3],!(d=a.hasOwnProperty(m)?a[m]:qa(g.$scope,m,!0)||(b?qa(e,m,!0):void 0)))throw qf("ctrlreg","The controller with the name '{0}' is not registered.",m);oa(d,m,!0)}if(h){var o=(pe(d)?d[d.length-1]:d).prototype;return j=Object.create(o||null),n&&f(g,n,j,m||d.name),l(function(){var a=c.invoke(d,j,g,m);return a!==j&&(v(a)||B(a))&&(j=a,n&&f(g,n,j,m||d.name)),j},{instance:j,identifier:n})}return j=c.instantiate(d,g,m),n&&f(g,n,j,m||d.name),j}}]}function Bb(){this.$get=["$window",function(a){return de(a.document)}]}function Cb(){this.$get=["$document","$rootScope",function(a,b){function c(){e=d.hidden}var d=a[0],e=d&&d.hidden;return a.on("visibilitychange",c),b.$on("$destroy",function(){a.off("visibilitychange",c)}),function(){return e}}]}function Db(){this.$get=["$log",function(a){return function(b,c){a.error.apply(a,arguments)}}]}function Eb(a){return v(a)?z(a)?a.toISOString():Y(a):a}function Fb(){this.$get=function(){return function(a){if(!a)return"";var b=[];return g(a,function(a,c){null===a||t(a)||B(a)||(pe(a)?f(a,function(a){b.push(ga(c)+"="+ga(Eb(a)))}):b.push(ga(c)+"="+ga(Eb(a))))}),b.join("&")}}}function Gb(){this.$get=function(){return function(a){function b(a,d,e){null===a||t(a)||(pe(a)?f(a,function(a,c){b(a,d+"["+(v(a)?c:"")+"]")}):v(a)&&!z(a)?g(a,function(a,c){b(a,d+(e?"":"[")+c+(e?"":"]"))}):c.push(ga(d)+"="+ga(Eb(a))))}if(!a)return"";var c=[];return b(a,"",!0),c.join("&")}}}function Hb(a,b){if(x(a)){var c=a.replace(xf,"").trim();if(c){var d=b("Content-Type"),e=d&&0===d.indexOf(tf);if(e||Ib(c))try{a=Z(c)}catch(b){if(!e)return a;throw yf("baddata",'Data must be a valid JSON object. Received: "{0}". Parse error: "{1}"',a,b)}}}return a}function Ib(a){var b=a.match(vf);return b&&wf[b[0]].test(a)}function Jb(a){function b(a,b){a&&(d[a]=d[a]?d[a]+", "+b:b)}var c,d=sa();return x(a)?f(a.split("\n"),function(a){c=a.indexOf(":"),b($d(re(a.substr(0,c))),re(a.substr(c+1)))}):v(a)&&f(a,function(a,c){b($d(c),re(a))}),d}function Kb(a){var b;return function(c){if(b||(b=Jb(a)),c){var d=b[$d(c)];return void 0===d&&(d=null),d}return b}}function Lb(a,b,c,d){return B(d)?d(a,b,c):(f(d,function(d){a=d(a,b,c)}),a)}function Mb(a){return 200<=a&&a<300}function Nb(){var a=this.defaults={transformResponse:[Hb],transformRequest:[function(a){return!v(a)||F(a)||H(a)||G(a)?a:Y(a)}],headers:{common:{Accept:"application/json, text/plain, */*"},post:va(uf),put:va(uf),patch:va(uf)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer",jsonpCallbackParam:"callback"},b=!1;this.useApplyAsync=function(a){return u(a)?(b=!!a,this):b};var c=this.interceptors=[];this.$get=["$browser","$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector","$sce",function(e,g,h,i,j,k,m,n){function o(b){function c(a,b){for(var c=0,d=b.length;c<d;){var e=b[c++],f=b[c++];a=a.then(e,f)}return b.length=0,a}function g(){e.$$completeOutstandingRequest(p)}function h(a,b){var c,d={};return f(a,function(a,e){B(a)?null!=(c=a(b))&&(d[e]=c):d[e]=a}),d}function i(b){var c=b.headers,d=Lb(b.data,Kb(c),void 0,b.transformRequest);return t(d)&&f(c,function(a,b){"content-type"===$d(b)&&delete c[b]}),t(b.withCredentials)&&!t(a.withCredentials)&&(b.withCredentials=a.withCredentials),q(b,d).then(j,j)}function j(a){var b=l({},a);return b.data=Lb(a.data,a.headers,a.status,o.transformResponse),Mb(a.status)?b:k.reject(b)}if(!v(b))throw d("$http")("badreq","Http request configuration must be an object. Received: {0}",b);if(!x(n.valueOf(b.url)))throw d("$http")("badreq","Http request configuration url must be a string or a $sce trusted object. Received: {0}",b.url);var o=l({method:"get",transformRequest:a.transformRequest,transformResponse:a.transformResponse,paramSerializer:a.paramSerializer,jsonpCallbackParam:a.jsonpCallbackParam},b);o.headers=function(b){var c,d,e,f=a.headers,g=l({},b.headers);f=l({},f.common,f[$d(b.method)]);a:for(c in f){d=$d(c);for(e in g)if($d(e)===d)continue a;g[c]=f[c]}return h(g,va(b))}(b),o.method=_d(o.method),o.paramSerializer=x(o.paramSerializer)?m.get(o.paramSerializer):o.paramSerializer,e.$$incOutstandingRequestCount();var r=[],s=[],u=k.resolve(o);return f(y,function(a){(a.request||a.requestError)&&r.unshift(a.request,a.requestError),(a.response||a.responseError)&&s.push(a.response,a.responseError)}),u=c(u,r),u=u.then(i),u=c(u,s),u=u.finally(g)}function q(c,d){function e(a){if(a){var c={};return f(a,function(a,d){c[d]=function(c){function d(){a(c)}b?j.$applyAsync(d):j.$$phase?d():j.$apply(d)}}),c}}function i(a,c,d,e,f){function g(){l(c,a,d,e,f)}q&&(Mb(a)?q.put(D,[a,c,Jb(d),e,f]):q.remove(D)),b?j.$applyAsync(g):(g(),j.$$phase||j.$apply())}function l(a,b,d,e,f){b=b>=-1?b:0,(Mb(b)?z.resolve:z.reject)({data:a,status:b,headers:Kb(d),config:c,statusText:e,xhrStatus:f})}function m(a){l(a.data,a.status,va(a.headers()),a.statusText,a.xhrStatus)}function p(){var a=o.pendingRequests.indexOf(c);-1!==a&&o.pendingRequests.splice(a,1)}var q,y,z=k.defer(),A=z.promise,B=c.headers,C="jsonp"===$d(c.method),D=c.url;if(C?D=n.getTrustedResourceUrl(D):x(D)||(D=n.valueOf(D)),D=r(D,c.paramSerializer(c.params)),C&&(D=s(D,c.jsonpCallbackParam)),o.pendingRequests.push(c),A.then(p,p),!c.cache&&!a.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(q=v(c.cache)?c.cache:v(a.cache)?a.cache:w),q&&(y=q.get(D),u(y)?J(y)?y.then(m,m):pe(y)?l(y[1],y[0],va(y[2]),y[3],y[4]):l(y,200,{},"OK","complete"):q.put(D,A)),t(y)){var E=Qc(c.url)?h()[c.xsrfCookieName||a.xsrfCookieName]:void 0;E&&(B[c.xsrfHeaderName||a.xsrfHeaderName]=E),g(c.method,D,d,i,B,c.timeout,c.withCredentials,c.responseType,e(c.eventHandlers),e(c.uploadEventHandlers))}return A}function r(a,b){return b.length>0&&(a+=(-1===a.indexOf("?")?"?":"&")+b),a}function s(a,b){if(/[&?][^=]+=JSON_CALLBACK/.test(a))throw yf("badjsonp",'Illegal use of JSON_CALLBACK in url, "{0}"',a);if(new RegExp("[&?]"+b+"=").test(a))throw yf("badjsonp",'Illegal use of callback param, "{0}", in url, "{1}"',b,a);return a+=(-1===a.indexOf("?")?"?":"&")+b+"=JSON_CALLBACK"}var w=i("$http");a.paramSerializer=x(a.paramSerializer)?m.get(a.paramSerializer):a.paramSerializer;var y=[];return f(c,function(a){y.unshift(x(a)?m.get(a):m.invoke(a))}),o.pendingRequests=[],function(a){f(arguments,function(a){o[a]=function(b,c){return o(l({},c||{},{method:a,url:b}))}})}("get","delete","head","jsonp"),function(a){f(arguments,function(a){o[a]=function(b,c,d){return o(l({},d||{},{method:a,url:b,data:c}))}})}("post","put","patch"),o.defaults=a,o}]}function Ob(){this.$get=function(){return function(){return new a.XMLHttpRequest}}}function Pb(){this.$get=["$browser","$jsonpCallbacks","$document","$xhrFactory",function(a,b,c,d){return Qb(a,d,a.defer,b,c[0])}]}function Qb(a,b,c,d,e){function g(a,b,c){a=a.replace("JSON_CALLBACK",b);var f=e.createElement("script"),g=null;return f.type="text/javascript",f.src=a,f.async=!0,g=function(a){f.removeEventListener("load",g),f.removeEventListener("error",g),e.body.removeChild(f),f=null;var h=-1,i="unknown";a&&("load"!==a.type||d.wasCalled(b)||(a={type:"error"}),i=a.type,h="error"===a.type?404:200),c&&c(h,i)},f.addEventListener("load",g),f.addEventListener("error",g),e.body.appendChild(f),g}return function(e,h,i,j,k,l,m,n,o,p){function q(){v&&v(),w&&w.abort()}function r(a,b,d,e,f,g){u(A)&&c.cancel(A),v=w=null,a(b,d,e,f,g)}if(h=h||a.url(),"jsonp"===$d(e))var s=d.createCallback(h),v=g(h,s,function(a,b){var c=200===a&&d.getResponse(s);r(j,a,c,"",b,"complete"),d.removeCallback(s)});else{var w=b(e,h);w.open(e,h,!0),f(k,function(a,b){u(a)&&w.setRequestHeader(b,a)}),w.onload=function(){var a=w.statusText||"",b="response"in w?w.response:w.responseText,c=1223===w.status?204:w.status;0===c&&(c=b?200:"file"===Pc(h).protocol?404:0),r(j,c,b,w.getAllResponseHeaders(),a,"complete")};var x=function(){r(j,-1,null,null,"","error")},y=function(){r(j,-1,null,null,"","abort")},z=function(){r(j,-1,null,null,"","timeout")};if(w.onerror=x,w.onabort=y,w.ontimeout=z,f(o,function(a,b){w.addEventListener(b,a)}),f(p,function(a,b){w.upload.addEventListener(b,a)}),m&&(w.withCredentials=!0),n)try{w.responseType=n}catch(a){if("json"!==n)throw a}w.send(t(i)?null:i)}if(l>0)var A=c(q,l);else J(l)&&l.then(q)}}function Rb(){var a="{{",b="}}";this.startSymbol=function(b){return b?(a=b,this):a},this.endSymbol=function(a){return a?(b=a,this):b},this.$get=["$parse","$exceptionHandler","$sce",function(c,d,e){function f(a){return"\\\\\\"+a}function g(c){return c.replace(m,a).replace(n,b)}function h(a,b,c,d){var e=a.$watch(function(a){return e(),d(a)},b,c);return e}function i(f,i,m,n){function o(a){try{return a=E(a),n&&!u(a)?a:ta(a)}catch(a){d(zf.interr(f,a))}}if(!f.length||-1===f.indexOf(a)){var p;if(!i){p=r(g(f)),p.exp=f,p.expressions=[],p.$$watchDelegate=h}return p}n=!!n;for(var q,s,v,w=0,x=[],y=[],z=f.length,A=[],C=[];w<z;){if(-1===(q=f.indexOf(a,w))||-1===(s=f.indexOf(b,q+j))){w!==z&&A.push(g(f.substring(w)));break}w!==q&&A.push(g(f.substring(w,q))),v=f.substring(q+j,s),x.push(v),y.push(c(v,o)),w=s+k,C.push(A.length),A.push("")}if(m&&A.length>1&&zf.throwNoconcat(f),!i||x.length){var D=function(a){for(var b=0,c=x.length;b<c;b++){if(n&&t(a[b]))return;A[C[b]]=a[b]}return A.join("")},E=function(a){return m?e.getTrusted(m,a):e.valueOf(a)};return l(function(a){var b=0,c=x.length,e=new Array(c);try{for(;b<c;b++)e[b]=y[b](a);return D(e)}catch(a){d(zf.interr(f,a))}},{exp:f,expressions:x,$$watchDelegate:function(a,b){var c;return a.$watchGroup(y,function(d,e){var f=D(d);B(b)&&b.call(this,f,d!==e?c:f,a),c=f})}})}}var j=a.length,k=b.length,m=new RegExp(a.replace(/./g,f),"g"),n=new RegExp(b.replace(/./g,f),"g");return i.startSymbol=function(){return a},i.endSymbol=function(){return b},i}]}function Sb(){this.$get=["$rootScope","$window","$q","$$q","$browser",function(a,b,c,d,e){function f(f,h,i,j){function k(){l?f.apply(null,m):f(p)}var l=arguments.length>4,m=l?V(arguments,4):[],n=b.setInterval,o=b.clearInterval,p=0,q=u(j)&&!j,r=(q?d:c).defer(),s=r.promise;return i=u(i)?i:0,s.$$intervalId=n(function(){q?e.defer(k):a.$evalAsync(k),r.notify(p++),i>0&&p>=i&&(r.resolve(p),o(s.$$intervalId),delete g[s.$$intervalId]),q||a.$apply()},h),g[s.$$intervalId]=r,s}var g={};return f.cancel=function(a){return!!(a&&a.$$intervalId in g)&&(Cc(g[a.$$intervalId].promise),g[a.$$intervalId].reject("canceled"),b.clearInterval(a.$$intervalId),delete g[a.$$intervalId],!0)},f}]}function Tb(a){for(var b=a.split("/"),c=b.length;c--;)b[c]=fa(b[c]);return b.join("/")}function Ub(a,b){var c=Pc(a);b.$$protocol=c.protocol,b.$$host=c.hostname,b.$$port=n(c.port)||Cf[c.protocol]||null}function Vb(a,b){if(Ef.test(a))throw Df("badpath",'Invalid url "{0}".',a);var c="/"!==a.charAt(0);c&&(a="/"+a);var d=Pc(a);b.$$path=decodeURIComponent(c&&"/"===d.pathname.charAt(0)?d.pathname.substring(1):d.pathname),b.$$search=da(d.search),b.$$hash=decodeURIComponent(d.hash),b.$$path&&"/"!==b.$$path.charAt(0)&&(b.$$path="/"+b.$$path)}function Wb(a,b){return a.slice(0,b.length)===b}function Xb(a,b){if(Wb(b,a))return b.substr(a.length)}function Yb(a){var b=a.indexOf("#");return-1===b?a:a.substr(0,b)}function Zb(a){return a.replace(/(#.+)|#$/,"$1")}function $b(a){return a.substr(0,Yb(a).lastIndexOf("/")+1)}function _b(a){return a.substring(0,a.indexOf("/",a.indexOf("//")+2))}function ac(a,b,c){this.$$html5=!0,c=c||"",Ub(a,this),this.$$parse=function(a){var c=Xb(b,a);if(!x(c))throw Df("ipthprfx",'Invalid url "{0}", missing path prefix "{1}".',a,b);Vb(c,this),this.$$path||(this.$$path="/"),this.$$compose()},this.$$compose=function(){var a=ea(this.$$search),c=this.$$hash?"#"+fa(this.$$hash):"";this.$$url=Tb(this.$$path)+(a?"?"+a:"")+c,this.$$absUrl=b+this.$$url.substr(1),this.$$urlUpdatedByLocation=!0},this.$$parseLinkUrl=function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g,h;return u(f=Xb(a,d))?(g=f,h=c&&u(f=Xb(c,f))?b+(Xb("/",f)||f):a+g):u(f=Xb(b,d))?h=b+f:b===d+"/"&&(h=b),h&&this.$$parse(h),!!h}}function bc(a,b,c){Ub(a,this),this.$$parse=function(d){var e,f=Xb(a,d)||Xb(b,d);t(f)||"#"!==f.charAt(0)?this.$$html5?e=f:(e="",t(f)&&(a=d,this.replace())):(e=Xb(c,f),t(e)&&(e=f)),Vb(e,this),this.$$path=function(a,b,c){var d,e=/^\/[A-Z]:(\/.*)/;return Wb(b,c)&&(b=b.replace(c,"")),e.exec(b)?a:(d=e.exec(a),d?d[1]:a)}(this.$$path,e,a),this.$$compose()},this.$$compose=function(){var b=ea(this.$$search),d=this.$$hash?"#"+fa(this.$$hash):"";this.$$url=Tb(this.$$path)+(b?"?"+b:"")+d,this.$$absUrl=a+(this.$$url?c+this.$$url:""),this.$$urlUpdatedByLocation=!0},this.$$parseLinkUrl=function(b,c){return Yb(a)===Yb(b)&&(this.$$parse(b),!0)}}function cc(a,b,c){this.$$html5=!0,bc.apply(this,arguments),this.$$parseLinkUrl=function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;return a===Yb(d)?f=d:(g=Xb(b,d))?f=a+c+g:b===d+"/"&&(f=b),f&&this.$$parse(f),!!f},this.$$compose=function(){var b=ea(this.$$search),d=this.$$hash?"#"+fa(this.$$hash):"";this.$$url=Tb(this.$$path)+(b?"?"+b:"")+d,this.$$absUrl=a+c+this.$$url,this.$$urlUpdatedByLocation=!0}}function dc(a){return function(){return this[a]}}function ec(a,b){return function(c){return t(c)?this[a]:(this[a]=b(c),this.$$compose(),this)}}function fc(){var a="!",b={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(b){return u(b)?(a=b,this):a},this.html5Mode=function(a){return I(a)?(b.enabled=a,this):v(a)?(I(a.enabled)&&(b.enabled=a.enabled),I(a.requireBase)&&(b.requireBase=a.requireBase),(I(a.rewriteLinks)||x(a.rewriteLinks))&&(b.rewriteLinks=a.rewriteLinks),this):b},this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(c,d,e,f,g){function h(a,b,c){var e=j.url(),f=j.$$state;try{d.url(a,b,c),j.$$state=d.state()}catch(a){throw j.url(e),j.$$state=f,a}}function i(a,b){c.$broadcast("$locationChangeSuccess",j.absUrl(),a,j.$$state,b)}var j,k,l,m=d.baseHref(),n=d.url();if(b.enabled){if(!m&&b.requireBase)throw Df("nobase","$location in HTML5 mode requires a <base> tag to be present!");l=_b(n)+(m||"/"),k=e.history?ac:cc}else l=Yb(n),k=bc;var o=$b(l);j=new k(l,o,"#"+a),j.$$parseLinkUrl(n,n),j.$$state=d.state();var p=/^\s*(javascript|mailto):/i;f.on("click",function(a){var e=b.rewriteLinks;if(e&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&2!==a.which&&2!==a.button){for(var h=de(a.target);"a"!==O(h[0]);)if(h[0]===f[0]||!(h=h.parent())[0])return;if(!x(e)||!t(h.attr(e))){var i=h.prop("href"),k=h.attr("href")||h.attr("xlink:href");v(i)&&"[object SVGAnimatedString]"===i.toString()&&(i=Pc(i.animVal).href),p.test(i)||!i||h.attr("target")||a.isDefaultPrevented()||j.$$parseLinkUrl(i,k)&&(a.preventDefault(),j.absUrl()!==d.url()&&(c.$apply(),g.angular["ff-684208-preventDefault"]=!0))}}}),Zb(j.absUrl())!==Zb(n)&&d.url(j.absUrl(),!0);var q=!0;return d.onUrlChange(function(a,b){if(!Wb(a,o))return void(g.location.href=a);c.$evalAsync(function(){var d,e=j.absUrl(),f=j.$$state;a=Zb(a),j.$$parse(a),j.$$state=b,d=c.$broadcast("$locationChangeStart",a,e,b,f).defaultPrevented,j.absUrl()===a&&(d?(j.$$parse(e),j.$$state=f,h(e,!1,f)):(q=!1,i(e,f)))}),c.$$phase||c.$digest()}),c.$watch(function(){if(q||j.$$urlUpdatedByLocation){j.$$urlUpdatedByLocation=!1;var a=Zb(d.url()),b=Zb(j.absUrl()),f=d.state(),g=j.$$replace,k=a!==b||j.$$html5&&e.history&&f!==j.$$state;(q||k)&&(q=!1,c.$evalAsync(function(){var b=j.absUrl(),d=c.$broadcast("$locationChangeStart",b,a,j.$$state,f).defaultPrevented;j.absUrl()===b&&(d?(j.$$parse(a),j.$$state=f):(k&&h(b,g,f===j.$$state?null:j.$$state),i(a,f)))}))}j.$$replace=!1}),j}]}function gc(){var a=!0,b=this;this.debugEnabled=function(b){return u(b)?(a=b,this):a},this.$get=["$window",function(c){function d(a){return A(a)&&(a.stack&&g?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line)),a}function e(a){var b=c.console||{},e=b[a]||b.log||p;return function(){var a=[];return f(arguments,function(b){a.push(d(b))}),Function.prototype.apply.call(e,b,a)}}var g=ce||/\bEdge\//.test(c.navigator&&c.navigator.userAgent);return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),
3
- debug:function(){var c=e("debug");return function(){a&&c.apply(b,arguments)}}()}}]}function hc(a){return a+""}function ic(a,b){return void 0!==a?a:b}function jc(a,b){return void 0===a?b:void 0===b?a:a+b}function kc(a,b){return!a(b).$stateful}function lc(a,b){switch(a.type){case Lf.MemberExpression:if(a.computed)return!1;break;case Lf.UnaryExpression:return Mf;case Lf.BinaryExpression:return"+"!==a.operator&&Mf;case Lf.CallExpression:return!1}return void 0===b?Nf:b}function mc(a,b,c){var d,e,g,h=a.isPure=lc(a,c);switch(a.type){case Lf.Program:d=!0,f(a.body,function(a){mc(a.expression,b,h),d=d&&a.expression.constant}),a.constant=d;break;case Lf.Literal:a.constant=!0,a.toWatch=[];break;case Lf.UnaryExpression:mc(a.argument,b,h),a.constant=a.argument.constant,a.toWatch=a.argument.toWatch;break;case Lf.BinaryExpression:mc(a.left,b,h),mc(a.right,b,h),a.constant=a.left.constant&&a.right.constant,a.toWatch=a.left.toWatch.concat(a.right.toWatch);break;case Lf.LogicalExpression:mc(a.left,b,h),mc(a.right,b,h),a.constant=a.left.constant&&a.right.constant,a.toWatch=a.constant?[]:[a];break;case Lf.ConditionalExpression:mc(a.test,b,h),mc(a.alternate,b,h),mc(a.consequent,b,h),a.constant=a.test.constant&&a.alternate.constant&&a.consequent.constant,a.toWatch=a.constant?[]:[a];break;case Lf.Identifier:a.constant=!1,a.toWatch=[a];break;case Lf.MemberExpression:mc(a.object,b,h),a.computed&&mc(a.property,b,h),a.constant=a.object.constant&&(!a.computed||a.property.constant),a.toWatch=a.constant?[]:[a];break;case Lf.CallExpression:g=!!a.filter&&kc(b,a.callee.name),d=g,e=[],f(a.arguments,function(a){mc(a,b,h),d=d&&a.constant,e.push.apply(e,a.toWatch)}),a.constant=d,a.toWatch=g?e:[a];break;case Lf.AssignmentExpression:mc(a.left,b,h),mc(a.right,b,h),a.constant=a.left.constant&&a.right.constant,a.toWatch=[a];break;case Lf.ArrayExpression:d=!0,e=[],f(a.elements,function(a){mc(a,b,h),d=d&&a.constant,e.push.apply(e,a.toWatch)}),a.constant=d,a.toWatch=e;break;case Lf.ObjectExpression:d=!0,e=[],f(a.properties,function(a){mc(a.value,b,h),d=d&&a.value.constant,e.push.apply(e,a.value.toWatch),a.computed&&(mc(a.key,b,!1),d=d&&a.key.constant,e.push.apply(e,a.key.toWatch))}),a.constant=d,a.toWatch=e;break;case Lf.ThisExpression:case Lf.LocalsExpression:a.constant=!1,a.toWatch=[]}}function nc(a){if(1===a.length){var b=a[0].expression,c=b.toWatch;return 1!==c.length?c:c[0]!==b?c:void 0}}function oc(a){return a.type===Lf.Identifier||a.type===Lf.MemberExpression}function pc(a){if(1===a.body.length&&oc(a.body[0].expression))return{type:Lf.AssignmentExpression,left:a.body[0].expression,right:{type:Lf.NGValueParameter},operator:"="}}function qc(a){return 0===a.body.length||1===a.body.length&&(a.body[0].expression.type===Lf.Literal||a.body[0].expression.type===Lf.ArrayExpression||a.body[0].expression.type===Lf.ObjectExpression)}function rc(a){return a.constant}function sc(a){this.$filter=a}function tc(a){this.$filter=a}function uc(a,b,c){this.ast=new Lf(a,c),this.astCompiler=c.csp?new tc(b):new sc(b)}function vc(a){return B(a.valueOf)?a.valueOf():Hf.call(a)}function wc(){var a,b,c=sa(),d={true:!0,false:!1,null:null,undefined:void 0};this.addLiteral=function(a,b){d[a]=b},this.setIdentifierFns=function(c,d){return a=c,b=d,this},this.$get=["$filter",function(e){function g(a,b){var d,f,g;switch(typeof a){case"string":if(a=a.trim(),g=a,!(d=c[g])){":"===a.charAt(0)&&":"===a.charAt(1)&&(f=!0,a=a.substring(2));d=new uc(new Kf(o),e,o).parse(a),d.constant?d.$$watchDelegate=l:f?d.$$watchDelegate=d.literal?k:j:d.inputs&&(d.$$watchDelegate=i),c[g]=d}return m(d,b);case"function":return m(a,b);default:return m(p,b)}}function h(a,b,c){return null==a||null==b?a===b:!("object"==typeof a&&"object"==typeof(a=vc(a))&&!c)&&(a===b||a!==a&&b!==b)}function i(a,b,c,d,e){var f,g=d.inputs;if(1===g.length){var i=h;return g=g[0],a.$watch(function(a){var b=g(a);return h(b,i,g.isPure)||(f=d(a,void 0,void 0,[b]),i=b&&vc(b)),f},b,c,e)}for(var j=[],k=[],l=0,m=g.length;l<m;l++)j[l]=h,k[l]=null;return a.$watch(function(a){for(var b=!1,c=0,e=g.length;c<e;c++){var i=g[c](a);(b||(b=!h(i,j[c],g[c].isPure)))&&(k[c]=i,j[c]=i&&vc(i))}return b&&(f=d(a,void 0,void 0,k)),f},b,c,e)}function j(a,b,c,d,e){function f(a){return d(a)}function g(a,c,d){j=a,B(b)&&b(a,c,d),u(a)&&d.$$postDigest(function(){u(j)&&h()})}var h,j;return h=d.inputs?i(a,g,c,d,e):a.$watch(f,g,c)}function k(a,b,c,d){function e(a){var b=!0;return f(a,function(a){u(a)||(b=!1)}),b}var g,h;return g=a.$watch(function(a){return d(a)},function(a,c,d){h=a,B(b)&&b(a,c,d),e(a)&&d.$$postDigest(function(){e(h)&&g()})},c)}function l(a,b,c,d){var e=a.$watch(function(a){return e(),d(a)},b,c);return e}function m(a,b){if(!b)return a;var c=a.$$watchDelegate,d=!1,e=c!==k&&c!==j,f=e?function(c,e,f,g){var h=d&&g?g[0]:a(c,e,f,g);return b(h,c,e)}:function(c,d,e,f){var g=a(c,d,e,f),h=b(g,c,d);return u(g)?h:g};return d=!a.inputs,c&&c!==i?(f.$$watchDelegate=c,f.inputs=a.inputs):b.$stateful||(f.$$watchDelegate=i,f.inputs=a.inputs?a.inputs:[a]),f.inputs&&(f.inputs=f.inputs.map(function(a){return a.isPure===Nf?function(b){return a(b)}:a})),f}var n=te().noUnsafeEval,o={csp:n,literals:R(d),isIdentifierStart:B(a)&&a,isIdentifierContinue:B(b)&&b};return g}]}function xc(){var a=!0;this.$get=["$rootScope","$exceptionHandler",function(b,c){return zc(function(a){b.$evalAsync(a)},c,a)}],this.errorOnUnhandledRejections=function(b){return u(b)?(a=b,this):a}}function yc(){var a=!0;this.$get=["$browser","$exceptionHandler",function(b,c){return zc(function(a){b.defer(a)},c,a)}],this.errorOnUnhandledRejections=function(b){return u(b)?(a=b,this):a}}function zc(a,b,c){function e(){return new g}function g(){var a=this.promise=new h;this.resolve=function(b){m(a,b)},this.reject=function(b){o(a,b)},this.notify=function(b){q(a,b)}}function h(){this.$$state={status:0}}function i(b){var d,e,f;f=b.pending,b.processScheduled=!1,b.pending=void 0;try{for(var g=0,h=f.length;g<h;++g){Bc(b),e=f[g][0],d=f[g][b.status];try{B(d)?m(e,d(b.value)):1===b.status?m(e,b.value):o(e,b.value)}catch(a){o(e,a)}}}finally{--C,c&&0===C&&a(j)}}function j(){for(;!C&&D.length;){var a=D.shift();if(!Ac(a)){Bc(a);var c="Possibly unhandled rejection: "+xa(a.value);A(a.value)?b(a.value,c):b(c)}}}function k(b){!c||b.pending||2!==b.status||Ac(b)||(0===C&&0===D.length&&a(j),D.push(b)),!b.processScheduled&&b.pending&&(b.processScheduled=!0,++C,a(function(){i(b)}))}function m(a,b){a.$$state.status||(b===a?p(a,z("qcycle","Expected promise to be resolved with value other than itself '{0}'",b)):n(a,b))}function n(a,b){function c(b){g||(g=!0,n(a,b))}function d(b){g||(g=!0,p(a,b))}function e(b){q(a,b)}var f,g=!1;try{(v(b)||B(b))&&(f=b.then),B(f)?(a.$$state.status=-1,f.call(b,c,d,e)):(a.$$state.value=b,a.$$state.status=1,k(a.$$state))}catch(a){d(a)}}function o(a,b){a.$$state.status||p(a,b)}function p(a,b){a.$$state.value=b,a.$$state.status=2,k(a.$$state)}function q(c,d){var e=c.$$state.pending;c.$$state.status<=0&&e&&e.length&&a(function(){for(var a,c,f=0,g=e.length;f<g;f++){c=e[f][0],a=e[f][3];try{q(c,B(a)?a(d):d)}catch(a){b(a)}}})}function r(a){var b=new h;return o(b,a),b}function s(a,b,c){var d=null;try{B(c)&&(d=c())}catch(a){return r(a)}return J(d)?d.then(function(){return b(a)},r):b(a)}function u(a,b,c,d){var e=new h;return m(e,a),e.then(b,c,d)}function w(a){var b=new h,c=0,d=pe(a)?[]:{};return f(a,function(a,e){c++,u(a).then(function(a){d[e]=a,--c||m(b,d)},function(a){o(b,a)})}),0===c&&m(b,d),b}function x(a){var b=e();return f(a,function(a){u(a).then(b.resolve,b.reject)}),b.promise}function y(a){function b(a){m(d,a)}function c(a){o(d,a)}if(!B(a))throw z("norslvr","Expected resolverFn, got '{0}'",a);var d=new h;return a(b,c),d}var z=d("$q",TypeError),C=0,D=[];l(h.prototype,{then:function(a,b,c){if(t(a)&&t(b)&&t(c))return this;var d=new h;return this.$$state.pending=this.$$state.pending||[],this.$$state.pending.push([d,a,b,c]),this.$$state.status>0&&k(this.$$state),d},catch:function(a){return this.then(null,a)},finally:function(a,b){return this.then(function(b){return s(b,E,a)},function(b){return s(b,r,a)},b)}});var E=u;return y.prototype=h.prototype,y.defer=e,y.reject=r,y.when=u,y.resolve=E,y.all=w,y.race=x,y}function Ac(a){return!!a.pur}function Bc(a){a.pur=!0}function Cc(a){Bc(a.$$state)}function Dc(){this.$get=["$window","$timeout",function(a,b){var c=a.requestAnimationFrame||a.webkitRequestAnimationFrame,d=a.cancelAnimationFrame||a.webkitCancelAnimationFrame||a.webkitCancelRequestAnimationFrame,e=!!c,f=e?function(a){var b=c(a);return function(){d(b)}}:function(a){var c=b(a,16.66,!1);return function(){b.cancel(c)}};return f.supported=e,f}]}function Ec(){function a(a){function b(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null,this.$$listeners={},this.$$listenerCount={},this.$$watchersCount=0,this.$id=i(),this.$$ChildScope=null}return b.prototype=a,b}var b=10,c=d("$rootScope"),g=null,h=null;this.digestTtl=function(a){return arguments.length&&(b=a),b},this.$get=["$exceptionHandler","$parse","$browser",function(d,j,k){function l(a){a.currentScope.$$destroyed=!0}function m(a){9===ce&&(a.$$childHead&&m(a.$$childHead),a.$$nextSibling&&m(a.$$nextSibling)),a.$parent=a.$$nextSibling=a.$$prevSibling=a.$$childHead=a.$$childTail=a.$root=a.$$watchers=null}function n(){this.$id=i(),this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null,this.$root=this,this.$$destroyed=!1,this.$$listeners={},this.$$listenerCount={},this.$$watchersCount=0,this.$$isolateBindings=null}function o(a){if(y.$$phase)throw c("inprog","{0} already in progress",y.$$phase);y.$$phase=a}function q(){y.$$phase=null}function r(a,b){do{a.$$watchersCount+=b}while(a=a.$parent)}function s(a,b,c){do{a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c]}while(a=a.$parent)}function u(){}function w(){for(;C.length;)try{C.shift()()}catch(a){d(a)}h=null}function x(){null===h&&(h=k.defer(function(){y.$apply(w)}))}n.prototype={constructor:n,$new:function(b,c){var d;return c=c||this,b?(d=new n,d.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=a(this)),d=new this.$$ChildScope),d.$parent=c,d.$$prevSibling=c.$$childTail,c.$$childHead?(c.$$childTail.$$nextSibling=d,c.$$childTail=d):c.$$childHead=c.$$childTail=d,(b||c!==this)&&d.$on("$destroy",l),d},$watch:function(a,b,c,d){var e=j(a);if(e.$$watchDelegate)return e.$$watchDelegate(this,b,c,e,a);var f=this,h=f.$$watchers,i={fn:b,last:u,get:e,exp:d||a,eq:!!c};return g=null,B(b)||(i.fn=p),h||(h=f.$$watchers=[],h.$$digestWatchIndex=-1),h.unshift(i),h.$$digestWatchIndex++,r(this,1),function(){var a=Q(h,i);a>=0&&(r(f,-1),a<h.$$digestWatchIndex&&h.$$digestWatchIndex--),g=null}},$watchGroup:function(a,b){function c(){i=!1,j?(j=!1,b(e,e,h)):b(e,d,h)}var d=new Array(a.length),e=new Array(a.length),g=[],h=this,i=!1,j=!0;if(!a.length){var k=!0;return h.$evalAsync(function(){k&&b(e,e,h)}),function(){k=!1}}return 1===a.length?this.$watch(a[0],function(a,c,f){e[0]=a,d[0]=c,b(e,a===c?e:d,f)}):(f(a,function(a,b){var f=h.$watch(a,function(a,f){e[b]=a,d[b]=f,i||(i=!0,h.$evalAsync(c))});g.push(f)}),function(){for(;g.length;)g.shift()()})},$watchCollection:function(a,b){function c(a){f=a;var b,c,d,h;if(!t(f)){if(v(f))if(e(f)){g!==n&&(g=n,q=g.length=0,l++),b=f.length,q!==b&&(l++,g.length=q=b);for(var i=0;i<b;i++)h=g[i],d=f[i],h!==h&&d!==d||h===d||(l++,g[i]=d)}else{g!==o&&(g=o={},q=0,l++),b=0;for(c in f)Zd.call(f,c)&&(b++,d=f[c],h=g[c],c in g?h!==h&&d!==d||h===d||(l++,g[c]=d):(q++,g[c]=d,l++));if(q>b){l++;for(c in g)Zd.call(f,c)||(q--,delete g[c])}}else g!==f&&(g=f,l++);return l}}function d(){if(p?(p=!1,b(f,f,i)):b(f,h,i),k)if(v(f))if(e(f)){h=new Array(f.length);for(var a=0;a<f.length;a++)h[a]=f[a]}else{h={};for(var c in f)Zd.call(f,c)&&(h[c]=f[c])}else h=f}c.$stateful=!0;var f,g,h,i=this,k=b.length>1,l=0,m=j(a,c),n=[],o={},p=!0,q=0;return this.$watch(m,d)},$digest:function(){var a,e,f,i,j,l,m,n,p,r,s,t=b,v=this,x=[];o("$digest"),k.$$checkUrlChange(),this===y&&null!==h&&(k.defer.cancel(h),w()),g=null;do{m=!1,p=v;for(var C=0;C<z.length;C++){try{s=z[C],i=s.fn,i(s.scope,s.locals)}catch(a){d(a)}g=null}z.length=0;a:do{if(l=p.$$watchers)for(l.$$digestWatchIndex=l.length;l.$$digestWatchIndex--;)try{if(a=l[l.$$digestWatchIndex])if(j=a.get,(e=j(p))===(f=a.last)||(a.eq?T(e,f):oe(e)&&oe(f))){if(a===g){m=!1;break a}}else m=!0,g=a,a.last=a.eq?R(e,null):e,i=a.fn,i(e,f===u?e:f,p),t<5&&(r=4-t,x[r]||(x[r]=[]),x[r].push({msg:B(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):a.exp,newVal:e,oldVal:f}))}catch(a){d(a)}if(!(n=p.$$watchersCount&&p.$$childHead||p!==v&&p.$$nextSibling))for(;p!==v&&!(n=p.$$nextSibling);)p=p.$parent}while(p=n);if((m||z.length)&&!t--)throw q(),c("infdig","{0} $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: {1}",b,x)}while(m||z.length);for(q();D<A.length;)try{A[D++]()}catch(a){d(a)}A.length=D=0,k.$$checkUrlChange()},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy"),this.$$destroyed=!0,this===y&&k.$$applicationDestroyed(),r(this,-this.$$watchersCount);for(var b in this.$$listenerCount)s(this,this.$$listenerCount[b],b);a&&a.$$childHead===this&&(a.$$childHead=this.$$nextSibling),a&&a.$$childTail===this&&(a.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=p,this.$on=this.$watch=this.$watchGroup=function(){return p},this.$$listeners={},this.$$nextSibling=null,m(this)}},$eval:function(a,b){return j(a)(this,b)},$evalAsync:function(a,b){y.$$phase||z.length||k.defer(function(){z.length&&y.$digest()}),z.push({scope:this,fn:j(a),locals:b})},$$postDigest:function(a){A.push(a)},$apply:function(a){try{o("$apply");try{return this.$eval(a)}finally{q()}}catch(a){d(a)}finally{try{y.$digest()}catch(a){throw d(a),a}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&C.push(b),a=j(a),x()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]),c.push(b);var d=this;do{d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++}while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(c[d]=null,s(e,1,a))}},$emit:function(a,b){var c,e,f,g=[],h=this,i=!1,j={name:a,targetScope:h,stopPropagation:function(){i=!0},preventDefault:function(){j.defaultPrevented=!0},defaultPrevented:!1},k=U([j],arguments,1);do{for(c=h.$$listeners[a]||g,j.currentScope=h,e=0,f=c.length;e<f;e++)if(c[e])try{c[e].apply(null,k)}catch(a){d(a)}else c.splice(e,1),e--,f--;if(i)return j.currentScope=null,j;h=h.$parent}while(h);return j.currentScope=null,j},$broadcast:function(a,b){var c=this,e=c,f=c,g={name:a,targetScope:c,preventDefault:function(){g.defaultPrevented=!0},defaultPrevented:!1};if(!c.$$listenerCount[a])return g;for(var h,i,j,k=U([g],arguments,1);e=f;){for(g.currentScope=e,h=e.$$listeners[a]||[],i=0,j=h.length;i<j;i++)if(h[i])try{h[i].apply(null,k)}catch(a){d(a)}else h.splice(i,1),i--,j--;if(!(f=e.$$listenerCount[a]&&e.$$childHead||e!==c&&e.$$nextSibling))for(;e!==c&&!(f=e.$$nextSibling);)e=e.$parent}return g.currentScope=null,g}};var y=new n,z=y.$$asyncQueue=[],A=y.$$postDigestQueue=[],C=y.$$applyAsyncQueue=[],D=0;return y}]}function Fc(){var a=/^\s*(https?|ftp|mailto|tel|file):/,b=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(b){return u(b)?(a=b,this):a},this.imgSrcSanitizationWhitelist=function(a){return u(a)?(b=a,this):b},this.$get=function(){return function(c,d){var e,f=d?b:a;return e=Pc(c).href,""===e||e.match(f)?c:"unsafe:"+e}}}function Gc(a){return a.replace(Qf,Aa)}function Hc(a){if("self"===a)return a;if(x(a)){if(a.indexOf("***")>-1)throw Of("iwcard","Illegal sequence *** in string matcher. String: {0}",a);return a=se(a).replace(/\\\*\\\*/g,".*").replace(/\\\*/g,"[^:/.?&;]*"),new RegExp("^"+a+"$")}if(C(a))return new RegExp("^"+a.source+"$");throw Of("imatcher",'Matchers may only be "self", string patterns or RegExp objects')}function Ic(a){var b=[];return u(a)&&f(a,function(a){b.push(Hc(a))}),b}function Jc(){this.SCE_CONTEXTS=Pf;var a=["self"],b=[];this.resourceUrlWhitelist=function(b){return arguments.length&&(a=Ic(b)),a},this.resourceUrlBlacklist=function(a){return arguments.length&&(b=Ic(a)),b},this.$get=["$injector",function(c){function d(a,b){return"self"===a?Qc(b):!!a.exec(b.href)}function e(c){var e,f,g=Pc(c.toString()),h=!1;for(e=0,f=a.length;e<f;e++)if(d(a[e],g)){h=!0;break}if(h)for(e=0,f=b.length;e<f;e++)if(d(b[e],g)){h=!1;break}return h}function f(a){var b=function(a){this.$$unwrapTrustedValue=function(){return a}};return a&&(b.prototype=new a),b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()},b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()},b}function g(a,b){var c=l.hasOwnProperty(a)?l[a]:null;if(!c)throw Of("icontext","Attempted to trust a value in invalid context. Context: {0}; Value: {1}",a,b);if(null===b||t(b)||""===b)return b;if("string"!=typeof b)throw Of("itype","Attempted to trust a non-string value in a content requiring a string: Context: {0}",a);return new c(b)}function h(a){return a instanceof k?a.$$unwrapTrustedValue():a}function i(a,b){if(null===b||t(b)||""===b)return b;var c=l.hasOwnProperty(a)?l[a]:null;if(c&&b instanceof c)return b.$$unwrapTrustedValue();if(a===Pf.RESOURCE_URL){if(e(b))return b;throw Of("insecurl","Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}",b.toString())}if(a===Pf.HTML)return j(b);throw Of("unsafe","Attempting to use an unsafe value in a safe context.")}var j=function(a){throw Of("unsafe","Attempting to use an unsafe value in a safe context.")};c.has("$sanitize")&&(j=c.get("$sanitize"));var k=f(),l={};return l[Pf.HTML]=f(k),l[Pf.CSS]=f(k),l[Pf.URL]=f(k),l[Pf.JS]=f(k),l[Pf.RESOURCE_URL]=f(l[Pf.URL]),{trustAs:g,getTrusted:i,valueOf:h}}]}function Kc(){var a=!0;this.enabled=function(b){return arguments.length&&(a=!!b),a},this.$get=["$parse","$sceDelegate",function(b,c){if(a&&ce<8)throw Of("iequirks","Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks mode. You can fix this by adding the text <!doctype html> to the top of your HTML document. See http://docs.angularjs.org/api/ng.$sce for more information.");var d=va(Pf);d.isEnabled=function(){return a},d.trustAs=c.trustAs,d.getTrusted=c.getTrusted,d.valueOf=c.valueOf,a||(d.trustAs=d.getTrusted=function(a,b){return b},d.valueOf=q),d.parseAs=function(a,c){var e=b(c);return e.literal&&e.constant?e:b(c,function(b){return d.getTrusted(a,b)})};var e=d.parseAs,g=d.getTrusted,h=d.trustAs;return f(Pf,function(a,b){var c=$d(b);d[Gc("parse_as_"+c)]=function(b){return e(a,b)},d[Gc("get_trusted_"+c)]=function(b){return g(a,b)},d[Gc("trust_as_"+c)]=function(b){return h(a,b)}}),d}]}function Lc(){this.$get=["$window","$document",function(a,b){var c={},d=a.nw&&a.nw.process,e=!d&&a.chrome&&(a.chrome.app&&a.chrome.app.runtime||!a.chrome.app&&a.chrome.runtime&&a.chrome.runtime.id),f=!e&&a.history&&a.history.pushState,g=n((/android (\d+)/.exec($d((a.navigator||{}).userAgent))||[])[1]),h=/Boxee/i.test((a.navigator||{}).userAgent),i=b[0]||{},j=i.body&&i.body.style,k=!1,l=!1;return j&&(k=!!("transition"in j||"webkitTransition"in j),l=!!("animation"in j||"webkitAnimation"in j)),{history:!(!f||g<4||h),hasEvent:function(a){if("input"===a&&ce)return!1;if(t(c[a])){var b=i.createElement("div");c[a]="on"+a in b}return c[a]},csp:te(),transitions:k,animations:l,android:g}}]}function Mc(){var a;this.httpOptions=function(b){return b?(a=b,this):a},this.$get=["$exceptionHandler","$templateCache","$http","$q","$sce",function(b,c,d,e,f){function g(h,i){function j(a){return i||(a=Rf("tpload","Failed to load template: {0} (HTTP status: {1} {2})",h,a.status,a.statusText),b(a)),e.reject(a)}g.totalPendingRequests++,x(h)&&!t(c.get(h))||(h=f.getTrustedResourceUrl(h));var k=d.defaults&&d.defaults.transformResponse;return pe(k)?k=k.filter(function(a){return a!==Hb}):k===Hb&&(k=null),d.get(h,l({cache:c,transformResponse:k},a)).finally(function(){g.totalPendingRequests--}).then(function(a){return c.put(h,a.data),a.data},j)}return g.totalPendingRequests=0,g}]}function Nc(){this.$get=["$rootScope","$browser","$location",function(a,b,c){var d={};return d.findBindings=function(a,b,c){var d=a.getElementsByClassName("ng-binding"),e=[];return f(d,function(a){var d=me.element(a).data("$binding");d&&f(d,function(d){if(c){new RegExp("(^|\\s)"+se(b)+"(\\s|\\||$)").test(d)&&e.push(a)}else-1!==d.indexOf(b)&&e.push(a)})}),e},d.findModels=function(a,b,c){for(var d=["ng-","data-ng-","ng\\:"],e=0;e<d.length;++e){var f=c?"=":"*=",g="["+d[e]+"model"+f+'"'+b+'"]',h=a.querySelectorAll(g);if(h.length)return h}},d.getLocation=function(){return c.url()},d.setLocation=function(b){b!==c.url()&&(c.url(b),a.$digest())},d.whenStable=function(a){b.notifyWhenNoOutstandingRequests(a)},d}]}function Oc(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",function(a,b,c,d,e){function f(f,h,i){B(f)||(i=h,h=f,f=p);var j,k=V(arguments,3),l=u(i)&&!i,m=(l?d:c).defer(),n=m.promise;return j=b.defer(function(){try{m.resolve(f.apply(null,k))}catch(a){m.reject(a),e(a)}finally{delete g[n.$$timeoutId]}l||a.$apply()},h),n.$$timeoutId=j,g[j]=m,n}var g={};return f.cancel=function(a){return!!(a&&a.$$timeoutId in g)&&(Cc(g[a.$$timeoutId].promise),g[a.$$timeoutId].reject("canceled"),delete g[a.$$timeoutId],b.defer.cancel(a.$$timeoutId))},f}]}function Pc(a){var b=a;return ce&&(Sf.setAttribute("href",b),b=Sf.href),Sf.setAttribute("href",b),{href:Sf.href,protocol:Sf.protocol?Sf.protocol.replace(/:$/,""):"",host:Sf.host,search:Sf.search?Sf.search.replace(/^\?/,""):"",hash:Sf.hash?Sf.hash.replace(/^#/,""):"",hostname:Sf.hostname,port:Sf.port,pathname:"/"===Sf.pathname.charAt(0)?Sf.pathname:"/"+Sf.pathname}}function Qc(a){var b=x(a)?Pc(a):a;return b.protocol===Tf.protocol&&b.host===Tf.host}function Rc(){this.$get=r(a)}function Sc(a){function b(a){try{return a.cookie||""}catch(a){return""}}function c(a){try{return decodeURIComponent(a)}catch(b){return a}}var d=a[0]||{},e={},f="";return function(){var a,g,h,i,j,k=b(d);if(k!==f)for(f=k,a=f.split("; "),e={},h=0;h<a.length;h++)g=a[h],(i=g.indexOf("="))>0&&(j=c(g.substring(0,i)),t(e[j])&&(e[j]=c(g.substring(i+1))));return e}}function Tc(){this.$get=Sc}function Uc(a){function b(d,e){if(v(d)){var g={};return f(d,function(a,c){g[c]=b(c,a)}),g}return a.factory(d+c,e)}var c="Filter";this.register=b,this.$get=["$injector",function(a){return function(b){return a.get(b+c)}}],b("currency",Zc),b("date",md),b("filter",Vc),b("json",nd),b("limitTo",od),b("lowercase",$f),b("number",$c),b("orderBy",qd),b("uppercase",_f)}function Vc(){return function(a,b,c,f){if(!e(a)){if(null==a)return a;throw d("filter")("notarray","Expected array but received: {0}",a)}f=f||"$";var g,h,i=Yc(b);switch(i){case"function":g=b;break;case"boolean":case"null":case"number":case"string":h=!0;case"object":g=Wc(b,c,f,h);break;default:return a}return Array.prototype.filter.call(a,g)}}function Wc(a,b,c,d){var e=v(a)&&c in a;return!0===b?b=T:B(b)||(b=function(a,b){return!t(a)&&(null===a||null===b?a===b:!(v(b)||v(a)&&!s(a))&&(a=$d(""+a),b=$d(""+b),-1!==a.indexOf(b)))}),function(f){return e&&!v(f)?Xc(f,a[c],b,c,!1):Xc(f,a,b,c,d)}}function Xc(a,b,c,d,e,f){var g=Yc(a),h=Yc(b);if("string"===h&&"!"===b.charAt(0))return!Xc(a,b.substring(1),c,d,e);if(pe(a))return a.some(function(a){return Xc(a,b,c,d,e)});switch(g){case"object":var i;if(e){for(i in a)if(i.charAt&&"$"!==i.charAt(0)&&Xc(a[i],b,c,d,!0))return!0;return!f&&Xc(a,b,c,d,!1)}if("object"===h){for(i in b){var j=b[i];if(!B(j)&&!t(j)){var k=i===d;if(!Xc(k?a:a[i],j,c,d,k,k))return!1}}return!0}return c(a,b);case"function":return!1;default:return c(a,b)}}function Yc(a){return null===a?"null":typeof a}function Zc(a){var b=a.NUMBER_FORMATS;return function(a,c,d){return t(c)&&(c=b.CURRENCY_SYM),t(d)&&(d=b.PATTERNS[1].maxFrac),null==a?a:bd(a,b.PATTERNS[1],b.GROUP_SEP,b.DECIMAL_SEP,d).replace(/\u00A4/g,c)}}function $c(a){var b=a.NUMBER_FORMATS;return function(a,c){return null==a?a:bd(a,b.PATTERNS[0],b.GROUP_SEP,b.DECIMAL_SEP,c)}}function _c(a){var b,c,d,e,f,g=0;for((c=a.indexOf(Vf))>-1&&(a=a.replace(Vf,"")),(d=a.search(/e/i))>0?(c<0&&(c=d),c+=+a.slice(d+1),a=a.substring(0,d)):c<0&&(c=a.length),d=0;a.charAt(d)===Wf;d++);if(d===(f=a.length))b=[0],c=1;else{for(f--;a.charAt(f)===Wf;)f--;for(c-=d,b=[],e=0;d<=f;d++,e++)b[e]=+a.charAt(d)}return c>Uf&&(b=b.splice(0,Uf-1),g=c-1,c=1),{d:b,e:g,i:c}}function ad(a,b,c,d){var e=a.d,f=e.length-a.i;b=t(b)?Math.min(Math.max(c,f),d):+b;var g=b+a.i,h=e[g];if(g>0){e.splice(Math.max(a.i,g));for(var i=g;i<e.length;i++)e[i]=0}else{f=Math.max(0,f),a.i=1,e.length=Math.max(1,g=b+1),e[0]=0;for(var j=1;j<g;j++)e[j]=0}if(h>=5)if(g-1<0){for(var k=0;k>g;k--)e.unshift(0),a.i++;e.unshift(1),a.i++}else e[g-1]++;for(;f<Math.max(0,b);f++)e.push(0);var l=e.reduceRight(function(a,b,c,d){return b+=a,d[c]=b%10,Math.floor(b/10)},0);l&&(e.unshift(l),a.i++)}function bd(a,b,c,d,e){if(!x(a)&&!y(a)||isNaN(a))return"";var f,g=!isFinite(a),h=!1,i=Math.abs(a)+"",j="";if(g)j="∞";else{f=_c(i),ad(f,e,b.minFrac,b.maxFrac);var k=f.d,l=f.i,m=f.e,n=[];for(h=k.reduce(function(a,b){return a&&!b},!0);l<0;)k.unshift(0),l++;l>0?n=k.splice(l,k.length):(n=k,k=[0]);var o=[];for(k.length>=b.lgSize&&o.unshift(k.splice(-b.lgSize,k.length).join(""));k.length>b.gSize;)o.unshift(k.splice(-b.gSize,k.length).join(""));k.length&&o.unshift(k.join("")),j=o.join(c),n.length&&(j+=d+n.join("")),m&&(j+="e+"+m)}return a<0&&!h?b.negPre+j+b.negSuf:b.posPre+j+b.posSuf}function cd(a,b,c,d){var e="";for((a<0||d&&a<=0)&&(d?a=1-a:(a=-a,e="-")),a=""+a;a.length<b;)a=Wf+a;return c&&(a=a.substr(a.length-b)),e+a}function dd(a,b,c,d,e){return c=c||0,function(f){var g=f["get"+a]();return(c>0||g>-c)&&(g+=c),0===g&&-12===c&&(g=12),cd(g,b,d,e)}}function ed(a,b,c){return function(d,e){var f=d["get"+a]();return e[_d((c?"STANDALONE":"")+(b?"SHORT":"")+a)][f]}}function fd(a,b,c){var d=-1*c,e=d>=0?"+":"";return e+=cd(Math[d>0?"floor":"ceil"](d/60),2)+cd(Math.abs(d%60),2)}function gd(a){var b=new Date(a,0,1).getDay();return new Date(a,0,(b<=4?5:12)-b)}function hd(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate()+(4-a.getDay()))}function id(a){return function(b){var c=gd(b.getFullYear()),d=hd(b),e=+d-+c;return cd(1+Math.round(e/6048e5),a)}}function jd(a,b){return a.getHours()<12?b.AMPMS[0]:b.AMPMS[1]}function kd(a,b){return a.getFullYear()<=0?b.ERAS[0]:b.ERAS[1]}function ld(a,b){return a.getFullYear()<=0?b.ERANAMES[0]:b.ERANAMES[1]}function md(a){function b(a){var b;if(b=a.match(c)){var d=new Date(0),e=0,f=0,g=b[8]?d.setUTCFullYear:d.setFullYear,h=b[8]?d.setUTCHours:d.setHours;b[9]&&(e=n(b[9]+b[10]),f=n(b[9]+b[11])),g.call(d,n(b[1]),n(b[2])-1,n(b[3]));var i=n(b[4]||0)-e,j=n(b[5]||0)-f,k=n(b[6]||0),l=Math.round(1e3*parseFloat("0."+(b[7]||0)));return h.call(d,i,j,k,l),d}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,d,e){var g,h,i="",j=[];if(d=d||"mediumDate",d=a.DATETIME_FORMATS[d]||d,x(c)&&(c=Zf.test(c)?n(c):b(c)),y(c)&&(c=new Date(c)),!z(c)||!isFinite(c.getTime()))return c;for(;d;)h=Yf.exec(d),h?(j=U(j,h,1),d=j.pop()):(j.push(d),d=null);var k=c.getTimezoneOffset();return e&&(k=$(e,k),c=aa(c,e,!0)),f(j,function(b){g=Xf[b],i+=g?g(c,a.DATETIME_FORMATS,k):"''"===b?"'":b.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),i}}function nd(){return function(a,b){return t(b)&&(b=2),Y(a,b)}}function od(){return function(a,b,c){return b=Math.abs(Number(b))===1/0?Number(b):n(b),oe(b)?a:(y(a)&&(a=a.toString()),e(a)?(c=!c||isNaN(c)?0:n(c),c=c<0?Math.max(0,a.length+c):c,b>=0?pd(a,c,c+b):0===c?pd(a,b,a.length):pd(a,Math.max(0,c+b),c)):a)}}function pd(a,b,c){return x(a)?a.slice(b,c):ge.call(a,b,c)}function qd(a){function b(b){return b.map(function(b){var c=1,d=q;if(B(b))d=b;else if(x(b)&&("+"!==b.charAt(0)&&"-"!==b.charAt(0)||(c="-"===b.charAt(0)?-1:1,b=b.substring(1)),""!==b&&(d=a(b),d.constant))){var e=d();d=function(a){return a[e]}}return{get:d,descending:c}})}function c(a){switch(typeof a){case"number":case"boolean":case"string":return!0;default:return!1}}function f(a){return B(a.valueOf)&&(a=a.valueOf(),c(a))?a:(s(a)&&(a=a.toString(),c(a)),a)}function g(a,b){var c=typeof a;return null===a?(c="string",a="null"):"object"===c&&(a=f(a)),{value:a,type:c,index:b}}function h(a,b){var c=0,d=a.type,e=b.type;if(d===e){var f=a.value,g=b.value;"string"===d?(f=f.toLowerCase(),g=g.toLowerCase()):"object"===d&&(v(f)&&(f=a.index),v(g)&&(g=b.index)),f!==g&&(c=f<g?-1:1)}else c=d<e?-1:1;return c}return function(a,c,f,i){function j(a,b){return{value:a,tieBreaker:{value:b,type:"number",index:b},predicateValues:l.map(function(c){return g(c.get(a),b)})}}function k(a,b){for(var c=0,d=l.length;c<d;c++){var e=n(a.predicateValues[c],b.predicateValues[c]);if(e)return e*l[c].descending*m}return(n(a.tieBreaker,b.tieBreaker)||h(a.tieBreaker,b.tieBreaker))*m}if(null==a)return a;if(!e(a))throw d("orderBy")("notarray","Expected array but received: {0}",a);pe(c)||(c=[c]),0===c.length&&(c=["+"]);var l=b(c),m=f?-1:1,n=B(i)?i:h,o=Array.prototype.map.call(a,j);return o.sort(k),a=o.map(function(a){return a.value})}}function rd(a){return B(a)&&(a={link:a}),a.restrict=a.restrict||"AC",r(a)}function sd(a,b){a.$name=b}function td(a,b,c,d,e){this.$$controls=[],this.$error={},this.$$success={},this.$pending=void 0,this.$name=e(b.name||b.ngForm||"")(c),this.$dirty=!1,this.$pristine=!0,this.$valid=!0,this.$invalid=!1,this.$submitted=!1,this.$$parentForm=cg,this.$$element=a,this.$$animate=d,ud(this)}function ud(a){a.$$classCache={},a.$$classCache[Ng]=!(a.$$classCache[Mg]=a.$$element.hasClass(Mg))}function vd(a){function b(a,b,c,d){a[b]||(a[b]={}),g(a[b],c,d)}function c(a,b,c,d){a[b]&&h(a[b],c,d),wd(a[b])&&(a[b]=void 0)}function d(a,b,c){c&&!a.$$classCache[b]?(a.$$animate.addClass(a.$$element,b),a.$$classCache[b]=!0):!c&&a.$$classCache[b]&&(a.$$animate.removeClass(a.$$element,b),a.$$classCache[b]=!1)}function e(a,b,c){b=b?"-"+ma(b,"-"):"",d(a,Mg+b,!0===c),d(a,Ng+b,!1===c)}var f=a.clazz,g=a.set,h=a.unset;f.prototype.$setValidity=function(a,f,i){t(f)?b(this,"$pending",a,i):c(this,"$pending",a,i),I(f)?f?(h(this.$error,a,i),g(this.$$success,a,i)):(g(this.$error,a,i),h(this.$$success,a,i)):(h(this.$error,a,i),h(this.$$success,a,i)),this.$pending?(d(this,dg,!0),this.$valid=this.$invalid=void 0,e(this,"",null)):(d(this,dg,!1),this.$valid=wd(this.$error),this.$invalid=!this.$valid,e(this,"",this.$valid));var j;j=this.$pending&&this.$pending[a]?void 0:!this.$error[a]&&(!!this.$$success[a]||null),e(this,a,j),this.$$parentForm.$setValidity(a,j,this)}}function wd(a){if(a)for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}function xd(a){a.$formatters.push(function(b){return a.$isEmpty(b)?b:b.toString()})}function yd(a,b,c,d,e,f){zd(a,b,c,d,e,f),xd(d)}function zd(a,b,c,d,e,f){var g=$d(b[0].type);if(!e.android){var h=!1;b.on("compositionstart",function(){h=!0}),b.on("compositionend",function(){h=!1,j()})}var i,j=function(a){if(i&&(f.defer.cancel(i),i=null),!h){var e=b.val(),j=a&&a.type;"password"===g||c.ngTrim&&"false"===c.ngTrim||(e=re(e)),(d.$viewValue!==e||""===e&&d.$$hasNativeValidators)&&d.$setViewValue(e,j)}};if(e.hasEvent("input"))b.on("input",j);else{var k=function(a,b,c){i||(i=f.defer(function(){i=null,b&&b.value===c||j(a)}))};b.on("keydown",function(a){var b=a.keyCode;91===b||15<b&&b<19||37<=b&&b<=40||k(a,this,this.value)}),e.hasEvent("paste")&&b.on("paste cut",k)}b.on("change",j),rg[g]&&d.$$hasNativeValidators&&g===c.type&&b.on(qg,function(a){if(!i){var b=this[Yd],c=b.badInput,d=b.typeMismatch;i=f.defer(function(){i=null,b.badInput===c&&b.typeMismatch===d||j(a)})}}),d.$render=function(){var a=d.$isEmpty(d.$viewValue)?"":d.$viewValue;b.val()!==a&&b.val(a)}}function Ad(a,b){if(z(a))return a;if(x(a)){ng.lastIndex=0;var c=ng.exec(a);if(c){var d=+c[1],e=+c[2],f=0,g=0,h=0,i=0,j=gd(d),k=7*(e-1);return b&&(f=b.getHours(),g=b.getMinutes(),
4
- h=b.getSeconds(),i=b.getMilliseconds()),new Date(d,0,j.getDate()+k,f,g,h,i)}}return NaN}function Bd(a,b){return function(c,d){var e,g;if(z(c))return c;if(x(c)){if('"'===c.charAt(0)&&'"'===c.charAt(c.length-1)&&(c=c.substring(1,c.length-1)),hg.test(c))return new Date(c);if(a.lastIndex=0,e=a.exec(c))return e.shift(),g=d?{yyyy:d.getFullYear(),MM:d.getMonth()+1,dd:d.getDate(),HH:d.getHours(),mm:d.getMinutes(),ss:d.getSeconds(),sss:d.getMilliseconds()/1e3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},f(e,function(a,c){c<b.length&&(g[b[c]]=+a)}),new Date(g.yyyy,g.MM-1,g.dd,g.HH,g.mm,g.ss||0,1e3*g.sss||0)}return NaN}}function Cd(a,b,c,d){return function(e,f,g,h,i,j,k){function l(a){return a&&!(a.getTime&&a.getTime()!==a.getTime())}function m(a){return u(a)&&!z(a)?c(a)||void 0:a}Dd(e,f,g,h),zd(e,f,g,h,i,j);var n,o=h&&h.$options.getOption("timezone");if(h.$$parserName=a,h.$parsers.push(function(a){if(h.$isEmpty(a))return null;if(b.test(a)){var d=c(a,n);return o&&(d=aa(d,o)),d}}),h.$formatters.push(function(a){if(a&&!z(a))throw Qg("datefmt","Expected `{0}` to be a date",a);return l(a)?(n=a,n&&o&&(n=aa(n,o,!0)),k("date")(a,d,o)):(n=null,"")}),u(g.min)||g.ngMin){var p;h.$validators.min=function(a){return!l(a)||t(p)||c(a)>=p},g.$observe("min",function(a){p=m(a),h.$validate()})}if(u(g.max)||g.ngMax){var q;h.$validators.max=function(a){return!l(a)||t(q)||c(a)<=q},g.$observe("max",function(a){q=m(a),h.$validate()})}}}function Dd(a,b,c,d){var e=b[0];(d.$$hasNativeValidators=v(e.validity))&&d.$parsers.push(function(a){var c=b.prop(Yd)||{};return c.badInput||c.typeMismatch?void 0:a})}function Ed(a){a.$$parserName="number",a.$parsers.push(function(b){return a.$isEmpty(b)?null:kg.test(b)?parseFloat(b):void 0}),a.$formatters.push(function(b){if(!a.$isEmpty(b)){if(!y(b))throw Qg("numfmt","Expected `{0}` to be a number",b);b=b.toString()}return b})}function Fd(a){return u(a)&&!y(a)&&(a=parseFloat(a)),oe(a)?void 0:a}function Gd(a){return(0|a)===a}function Hd(a){var b=a.toString(),c=b.indexOf(".");if(-1===c){if(-1<a&&a<1){var d=/e-(\d+)$/.exec(b);if(d)return Number(d[1])}return 0}return b.length-c-1}function Id(a,b,c){var d=Number(a),e=!Gd(d),f=!Gd(b),g=!Gd(c);if(e||f||g){var h=e?Hd(d):0,i=f?Hd(b):0,j=g?Hd(c):0,k=Math.max(h,i,j),l=Math.pow(10,k);d*=l,b*=l,c*=l,e&&(d=Math.round(d)),f&&(b=Math.round(b)),g&&(c=Math.round(c))}return(d-b)%c==0}function Jd(a,b,c,d,e,f){Dd(a,b,c,d),Ed(d),zd(a,b,c,d,e,f);var g,h;if((u(c.min)||c.ngMin)&&(d.$validators.min=function(a){return d.$isEmpty(a)||t(g)||a>=g},c.$observe("min",function(a){g=Fd(a),d.$validate()})),(u(c.max)||c.ngMax)&&(d.$validators.max=function(a){return d.$isEmpty(a)||t(h)||a<=h},c.$observe("max",function(a){h=Fd(a),d.$validate()})),u(c.step)||c.ngStep){var i;d.$validators.step=function(a,b){return d.$isEmpty(b)||t(i)||Id(b,g||0,i)},c.$observe("step",function(a){i=Fd(a),d.$validate()})}}function Kd(a,b,c,d,e,f){function g(a,d){b.attr(a,c[a]),c.$observe(a,d)}function h(a){if(l=Fd(a),!oe(d.$modelValue))if(k){var c=b.val();l>c&&(c=l,b.val(c)),d.$setViewValue(c)}else d.$validate()}function i(a){if(m=Fd(a),!oe(d.$modelValue))if(k){var c=b.val();m<c&&(b.val(m),c=m<l?l:m),d.$setViewValue(c)}else d.$validate()}function j(a){n=Fd(a),oe(d.$modelValue)||(k&&d.$viewValue!==b.val()?d.$setViewValue(b.val()):d.$validate())}Dd(a,b,c,d),Ed(d),zd(a,b,c,d,e,f);var k=d.$$hasNativeValidators&&"range"===b[0].type,l=k?0:void 0,m=k?100:void 0,n=k?1:void 0,o=b[0].validity,p=u(c.min),q=u(c.max),r=u(c.step),s=d.$render;d.$render=k&&u(o.rangeUnderflow)&&u(o.rangeOverflow)?function(){s(),d.$setViewValue(b.val())}:s,p&&(d.$validators.min=k?function(){return!0}:function(a,b){return d.$isEmpty(b)||t(l)||b>=l},g("min",h)),q&&(d.$validators.max=k?function(){return!0}:function(a,b){return d.$isEmpty(b)||t(m)||b<=m},g("max",i)),r&&(d.$validators.step=k?function(){return!o.stepMismatch}:function(a,b){return d.$isEmpty(b)||t(n)||Id(b,l||0,n)},g("step",j))}function Ld(a,b,c,d,e,f){zd(a,b,c,d,e,f),xd(d),d.$$parserName="url",d.$validators.url=function(a,b){var c=a||b;return d.$isEmpty(c)||ig.test(c)}}function Md(a,b,c,d,e,f){zd(a,b,c,d,e,f),xd(d),d.$$parserName="email",d.$validators.email=function(a,b){var c=a||b;return d.$isEmpty(c)||jg.test(c)}}function Nd(a,b,c,d){var e=!c.ngTrim||"false"!==re(c.ngTrim);t(c.name)&&b.attr("name",i());var f=function(a){var f;b[0].checked&&(f=c.value,e&&(f=re(f)),d.$setViewValue(f,a&&a.type))};b.on("click",f),d.$render=function(){var a=c.value;e&&(a=re(a)),b[0].checked=a===d.$viewValue},c.$observe("value",d.$render)}function Od(a,b,c,d,e){var f;if(u(d)){if(f=a(d),!f.constant)throw Qg("constexpr","Expected constant expression for `{0}`, but saw `{1}`.",c,d);return f(b)}return e}function Pd(a,b,c,d,e,f,g,h){var i=Od(h,a,"ngTrueValue",c.ngTrueValue,!0),j=Od(h,a,"ngFalseValue",c.ngFalseValue,!1),k=function(a){d.$setViewValue(b[0].checked,a&&a.type)};b.on("click",k),d.$render=function(){b[0].checked=d.$viewValue},d.$isEmpty=function(a){return!1===a},d.$formatters.push(function(a){return T(a,i)}),d.$parsers.push(function(a){return a?i:j})}function Qd(a,b){function c(a,b){if(!a||!a.length)return[];if(!b||!b.length)return a;var c=[];a:for(var d=0;d<a.length;d++){for(var e=a[d],f=0;f<b.length;f++)if(e===b[f])continue a;c.push(e)}return c}function d(a){return a&&a.split(" ")}function e(a){var b=a;return pe(a)?b=a.map(e).join(" "):v(a)&&(b=Object.keys(a).filter(function(b){return a[b]}).join(" ")),b}function g(a){var b=a;if(pe(a))b=a.map(g);else if(v(a)){var c=!1;b=Object.keys(a).filter(function(b){var d=a[b];return!c&&t(d)&&(c=!0),d}),c&&b.push(void 0)}return b}a="ngClass"+a;var h;return["$parse",function(i){return{restrict:"AC",link:function(j,k,l){function m(a){a=p(d(a),1),l.$addClass(a)}function n(a){a=p(d(a),-1),l.$removeClass(a)}function o(a,b){var e=d(a),f=d(b),g=c(e,f),h=c(f,e),i=p(g,-1),j=p(h,1);l.$addClass(j),l.$removeClass(i)}function p(a,b){var c=[];return f(a,function(a){(b>0||z[a])&&(z[a]=(z[a]||0)+b,z[a]===+(b>0)&&c.push(a))}),c.join(" ")}function q(a){a===b?m(t):n(t),A=a}function r(a){var b=e(a);b!==t&&s(b)}function s(a){A===b&&o(t,a),t=a}var t,u=l[a].trim(),v=":"===u.charAt(0)&&":"===u.charAt(1),w=v?g:e,x=i(u,w),y=v?r:s,z=k.data("$classCounts"),A=!0;z||(z=sa(),k.data("$classCounts",z)),"ngClass"!==a&&(h||(h=i("$index",function(a){return 1&a})),j.$watch(h,q)),j.$watch(x,y,v)}}}]}function Rd(a,b,c,d,e,f,g,h,i){this.$viewValue=Number.NaN,this.$modelValue=Number.NaN,this.$$rawModelValue=void 0,this.$validators={},this.$asyncValidators={},this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$untouched=!0,this.$touched=!1,this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$error={},this.$$success={},this.$pending=void 0,this.$name=i(c.name||"",!1)(a),this.$$parentForm=cg,this.$options=Rg,this.$$parsedNgModel=e(c.ngModel),this.$$parsedNgModelAssign=this.$$parsedNgModel.assign,this.$$ngModelGet=this.$$parsedNgModel,this.$$ngModelSet=this.$$parsedNgModelAssign,this.$$pendingDebounce=null,this.$$parserValid=void 0,this.$$currentValidationRunId=0,Object.defineProperty(this,"$$scope",{value:a}),this.$$attr=c,this.$$element=d,this.$$animate=f,this.$$timeout=g,this.$$parse=e,this.$$q=h,this.$$exceptionHandler=b,ud(this),Sd(this)}function Sd(a){a.$$scope.$watch(function(b){var c=a.$$ngModelGet(b);if(c!==a.$modelValue&&(a.$modelValue===a.$modelValue||c===c)){a.$modelValue=a.$$rawModelValue=c,a.$$parserValid=void 0;for(var d=a.$formatters,e=d.length,f=c;e--;)f=d[e](f);a.$viewValue!==f&&(a.$$updateEmptyClasses(f),a.$viewValue=a.$$lastCommittedViewValue=f,a.$render(),a.$$runValidators(a.$modelValue,a.$viewValue,p))}return c})}function Td(a){this.$$options=a}function Ud(a,b){f(b,function(b,c){u(a[c])||(a[c]=b)})}function Vd(a,b){a.prop("selected",b),a.attr("selected",b)}var Wd={objectMaxDepth:5},Xd=/^\/(.+)\/([a-z]*)$/,Yd="validity",Zd=Object.prototype.hasOwnProperty,$d=function(a){return x(a)?a.toLowerCase():a},_d=function(a){return x(a)?a.toUpperCase():a},ae=function(a){return x(a)?a.replace(/[A-Z]/g,function(a){return String.fromCharCode(32|a.charCodeAt(0))}):a},be=function(a){return x(a)?a.replace(/[a-z]/g,function(a){return String.fromCharCode(-33&a.charCodeAt(0))}):a};"i"!=="I".toLowerCase()&&($d=ae,_d=be);var ce,de,ee,fe,ge=[].slice,he=[].splice,ie=[].push,je=Object.prototype.toString,ke=Object.getPrototypeOf,le=d("ng"),me=a.angular||(a.angular={}),ne=0;ce=a.document.documentMode;var oe=Number.isNaN||function(a){return a!==a};p.$inject=[],q.$inject=[];var pe=Array.isArray,qe=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/,re=function(a){return x(a)?a.trim():a},se=function(a){return a.replace(/([-()[\]{}+?*.$^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},te=function(){if(!u(te.rules)){var b=a.document.querySelector("[ng-csp]")||a.document.querySelector("[data-ng-csp]");if(b){var c=b.getAttribute("ng-csp")||b.getAttribute("data-ng-csp");te.rules={noUnsafeEval:!c||-1!==c.indexOf("no-unsafe-eval"),noInlineStyle:!c||-1!==c.indexOf("no-inline-style")}}else te.rules={noUnsafeEval:function(){try{return new Function(""),!1}catch(a){return!0}}(),noInlineStyle:!1}}return te.rules},ue=function(){if(u(ue.name_))return ue.name_;var b,c,d,e,f=we.length;for(c=0;c<f;++c)if(d=we[c],b=a.document.querySelector("["+d.replace(":","\\:")+"jq]")){e=b.getAttribute(d+"jq");break}return ue.name_=e},ve=/:/g,we=["ng-","data-ng-","ng:","x-ng-"],xe=function(b){var c=b.currentScript;if(!c)return!0;if(!(c instanceof a.HTMLScriptElement||c instanceof a.SVGScriptElement))return!1;var d=c.attributes;return[d.getNamedItem("src"),d.getNamedItem("href"),d.getNamedItem("xlink:href")].every(function(a){if(!a)return!0;if(!a.value)return!1;var c=b.createElement("a");if(c.href=a.value,b.location.origin===c.origin)return!0;switch(c.protocol){case"http:":case"https:":case"ftp:":case"blob:":case"file:":case"data:":return!0;default:return!1}})}(a.document),ye=/[A-Z]/g,ze=!1,Ae=1,Be=3,Ce=8,De=9,Ee=11,Fe={full:"1.6.6",major:1,minor:6,dot:6,codeName:"interdimensional-cable"};Ia.expando="ng339";var Ge=Ia.cache={},He=1;Ia._data=function(a){return this.cache[a[this.expando]]||{}};var Ie=/-([a-z])/g,Je=/^-ms-/,Ke={mouseleave:"mouseout",mouseenter:"mouseover"},Le=d("jqLite"),Me=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,Ne=/<|&#?\w+;/,Oe=/<([\w:-]+)/,Pe=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,Qe={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Qe.optgroup=Qe.option,Qe.tbody=Qe.tfoot=Qe.colgroup=Qe.caption=Qe.thead,Qe.th=Qe.td;var Re=a.Node.prototype.contains||function(a){return!!(16&this.compareDocumentPosition(a))},Se=Ia.prototype={ready:Ya,toString:function(){var a=[];return f(this,function(b){a.push(""+b)}),"["+a.join(", ")+"]"},eq:function(a){return de(a>=0?this[a]:this[this.length+a])},length:0,push:ie,sort:[].sort,splice:[].splice},Te={};f("multiple,selected,checked,disabled,readOnly,required,open".split(","),function(a){Te[$d(a)]=a});var Ue={};f("input,select,option,textarea,button,form,details".split(","),function(a){Ue[a]=!0});var Ve={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern",ngStep:"step"};f({data:Oa,removeData:Ma,hasData:Ea,cleanData:function(a){for(var b=0,c=a.length;b<c;b++)Ma(a[b])}},function(a,b){Ia[b]=a}),f({data:Oa,inheritedData:Ua,scope:function(a){return de.data(a,"$scope")||Ua(a.parentNode||a,["$isolateScope","$scope"])},isolateScope:function(a){return de.data(a,"$isolateScope")||de.data(a,"$isolateScopeNoTemplate")},controller:Ta,injector:function(a){return Ua(a,"$injector")},removeAttr:function(a,b){a.removeAttribute(b)},hasClass:Pa,css:function(a,b,c){if(b=za(b),!u(c))return a.style[b];a.style[b]=c},attr:function(a,b,c){var d,e=a.nodeType;if(e!==Be&&2!==e&&e!==Ce&&a.getAttribute){var f=$d(b),g=Te[f];if(!u(c))return d=a.getAttribute(b),g&&null!==d&&(d=f),null===d?void 0:d;null===c||!1===c&&g?a.removeAttribute(b):a.setAttribute(b,g?f:c)}},prop:function(a,b,c){if(!u(c))return a[b];a[b]=c},text:function(){function a(a,b){if(t(b)){var c=a.nodeType;return c===Ae||c===Be?a.textContent:""}a.textContent=b}return a.$dv="",a}(),val:function(a,b){if(t(b)){if(a.multiple&&"select"===O(a)){var c=[];return f(a.options,function(a){a.selected&&c.push(a.value||a.text)}),c}return a.value}a.value=b},html:function(a,b){if(t(b))return a.innerHTML;Ka(a,!0),a.innerHTML=b},empty:Va},function(a,b){Ia.prototype[b]=function(b,c){var d,e,f=this.length;if(a!==Va&&t(2===a.length&&a!==Pa&&a!==Ta?b:c)){if(v(b)){for(d=0;d<f;d++)if(a===Oa)a(this[d],b);else for(e in b)a(this[d],e,b[e]);return this}for(var g=a.$dv,h=t(g)?Math.min(f,1):f,i=0;i<h;i++){var j=a(this[i],b,c);g=g?g+j:j}return g}for(d=0;d<f;d++)a(this[d],b,c);return this}}),f({removeData:Ma,on:function(a,b,c,d){if(u(d))throw Le("onargs","jqLite#on() does not support the `selector` or `eventData` parameters");if(Da(a)){var e=Na(a,!0),f=e.events,g=e.handle;g||(g=e.handle=_a(a,f));for(var h=b.indexOf(" ")>=0?b.split(" "):[b],i=h.length,j=function(b,d,e){var h=f[b];h||(h=f[b]=[],h.specialHandlerWrapper=d,"$destroy"===b||e||a.addEventListener(b,g)),h.push(c)};i--;)b=h[i],Ke[b]?(j(Ke[b],bb),j(b,void 0,!0)):j(b)}},off:La,one:function(a,b,c){a=de(a),a.on(b,function d(){a.off(b,c),a.off(b,d)}),a.on(b,c)},replaceWith:function(a,b){var c,d=a.parentNode;Ka(a),f(new Ia(b),function(b){c?d.insertBefore(b,c.nextSibling):d.replaceChild(b,a),c=b})},children:function(a){var b=[];return f(a.childNodes,function(a){a.nodeType===Ae&&b.push(a)}),b},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,b){var c=a.nodeType;if(c===Ae||c===Ee){b=new Ia(b);for(var d=0,e=b.length;d<e;d++){var f=b[d];a.appendChild(f)}}},prepend:function(a,b){if(a.nodeType===Ae){var c=a.firstChild;f(new Ia(b),function(b){a.insertBefore(b,c)})}},wrap:function(a,b){Ha(a,de(b).eq(0).clone()[0])},remove:Wa,detach:function(a){Wa(a,!0)},after:function(a,b){var c=a,d=a.parentNode;if(d){b=new Ia(b);for(var e=0,f=b.length;e<f;e++){var g=b[e];d.insertBefore(g,c.nextSibling),c=g}}},addClass:Ra,removeClass:Qa,toggleClass:function(a,b,c){b&&f(b.split(" "),function(b){var d=c;t(d)&&(d=!Pa(a,b)),(d?Ra:Qa)(a,b)})},parent:function(a){var b=a.parentNode;return b&&b.nodeType!==Ee?b:null},next:function(a){return a.nextElementSibling},find:function(a,b){return a.getElementsByTagName?a.getElementsByTagName(b):[]},clone:Ja,triggerHandler:function(a,b,c){var d,e,g,h=b.type||b,i=Na(a),j=i&&i.events,k=j&&j[h];k&&(d={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:p,type:h,target:a},b.type&&(d=l(d,b)),e=va(k),g=c?[d].concat(c):[d],f(e,function(b){d.isImmediatePropagationStopped()||b.apply(a,g)}))}},function(a,b){Ia.prototype[b]=function(b,c,d){for(var e,f=0,g=this.length;f<g;f++)t(e)?(e=a(this[f],b,c,d),u(e)&&(e=de(e))):Sa(e,a(this[f],b,c,d));return u(e)?e:this}}),Ia.prototype.bind=Ia.prototype.on,Ia.prototype.unbind=Ia.prototype.off;var We=Object.create(null);eb.prototype={_idx:function(a){return a===this._lastKey?this._lastIndex:(this._lastKey=a,this._lastIndex=this._keys.indexOf(a),this._lastIndex)},_transformKey:function(a){return oe(a)?We:a},get:function(a){a=this._transformKey(a);var b=this._idx(a);if(-1!==b)return this._values[b]},set:function(a,b){a=this._transformKey(a);var c=this._idx(a);-1===c&&(c=this._lastIndex=this._keys.length),this._keys[c]=a,this._values[c]=b},delete:function(a){a=this._transformKey(a);var b=this._idx(a);return-1!==b&&(this._keys.splice(b,1),this._values.splice(b,1),this._lastKey=NaN,this._lastIndex=-1,!0)}};var Xe=eb,Ye=[function(){this.$get=[function(){return Xe}]}],Ze=/^([^(]+?)=>/,$e=/^[^(]*\(\s*([^)]*)\)/m,_e=/,/,af=/^\s*(_?)(\S+?)\1\s*$/,bf=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,cf=d("$injector");jb.$$annotate=ib;var df=d("$animate"),ef=1,ff=function(){this.$get=p},gf=function(){var a=new Xe,b=[];this.$get=["$$AnimateRunner","$rootScope",function(c,d){function e(a,b,c){var d=!1;return b&&(b=x(b)?b.split(" "):pe(b)?b:[],f(b,function(b){b&&(d=!0,a[b]=c)})),d}function g(){f(b,function(b){var c=a.get(b);if(c){var d=nb(b.attr("class")),e="",g="";f(c,function(a,b){a!==!!d[b]&&(a?e+=(e.length?" ":"")+b:g+=(g.length?" ":"")+b)}),f(b,function(a){e&&Ra(a,e),g&&Qa(a,g)}),a.delete(b)}}),b.length=0}function h(c,f,h){var i=a.get(c)||{},j=e(i,f,!0),k=e(i,h,!1);(j||k)&&(a.set(c,i),b.push(c),1===b.length&&d.$$postDigest(g))}return{enabled:p,on:p,off:p,pin:p,push:function(a,b,d,e){e&&e(),d=d||{},d.from&&a.css(d.from),d.to&&a.css(d.to),(d.addClass||d.removeClass)&&h(a,d.addClass,d.removeClass);var f=new c;return f.complete(),f}}}]},hf=["$provide",function(a){var b=this,c=null,d=null;this.$$registeredAnimations=Object.create(null),this.register=function(c,d){if(c&&"."!==c.charAt(0))throw df("notcsel","Expecting class selector starting with '.' got '{0}'.",c);var e=c+"-animation";b.$$registeredAnimations[c.substr(1)]=e,a.factory(e,d)},this.customFilter=function(a){return 1===arguments.length&&(d=B(a)?a:null),d},this.classNameFilter=function(a){if(1===arguments.length&&(c=a instanceof RegExp?a:null)){if(new RegExp("[(\\s|\\/)]ng-animate[(\\s|\\/)]").test(c.toString()))throw c=null,df("nongcls",'$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the "{0}" CSS class.',"ng-animate")}return c},this.$get=["$$animateQueue",function(a){function b(a,b,c){if(c){var d=mb(c);!d||d.parentNode||d.previousElementSibling||(c=null)}c?c.after(a):b.prepend(a)}return{on:a.on,off:a.off,pin:a.pin,enabled:a.enabled,cancel:function(a){a.end&&a.end()},enter:function(c,d,e,f){return d=d&&de(d),e=e&&de(e),d=d||e.parent(),b(c,d,e),a.push(c,"enter",ob(f))},move:function(c,d,e,f){return d=d&&de(d),e=e&&de(e),d=d||e.parent(),b(c,d,e),a.push(c,"move",ob(f))},leave:function(b,c){return a.push(b,"leave",ob(c),function(){b.remove()})},addClass:function(b,c,d){return d=ob(d),d.addClass=lb(d.addclass,c),a.push(b,"addClass",d)},removeClass:function(b,c,d){return d=ob(d),d.removeClass=lb(d.removeClass,c),a.push(b,"removeClass",d)},setClass:function(b,c,d,e){return e=ob(e),e.addClass=lb(e.addClass,c),e.removeClass=lb(e.removeClass,d),a.push(b,"setClass",e)},animate:function(b,c,d,e,f){return f=ob(f),f.from=f.from?l(f.from,c):c,f.to=f.to?l(f.to,d):d,e=e||"ng-inline-animate",f.tempClasses=lb(f.tempClasses,e),a.push(b,"animate",f)}}}]}],jf=function(){this.$get=["$$rAF",function(a){function b(b){c.push(b),c.length>1||a(function(){for(var a=0;a<c.length;a++)c[a]();c=[]})}var c=[];return function(){var a=!1;return b(function(){a=!0}),function(c){a?c():b(c)}}}]},kf=function(){this.$get=["$q","$sniffer","$$animateAsyncRun","$$isDocumentHidden","$timeout",function(a,b,c,d,e){function g(a){this.setHost(a);var b=c(),f=function(a){e(a,0,!1)};this._doneCallbacks=[],this._tick=function(a){d()?f(a):b(a)},this._state=0}return g.chain=function(a,b){function c(){if(d===a.length)return void b(!0);a[d](function(a){if(!1===a)return void b(!1);d++,c()})}var d=0;c()},g.all=function(a,b){function c(c){e=e&&c,++d===a.length&&b(e)}var d=0,e=!0;f(a,function(a){a.done(c)})},g.prototype={setHost:function(a){this.host=a||{}},done:function(a){2===this._state?a():this._doneCallbacks.push(a)},progress:p,getPromise:function(){if(!this.promise){var b=this;this.promise=a(function(a,c){b.done(function(b){!1===b?c():a()})})}return this.promise},then:function(a,b){return this.getPromise().then(a,b)},catch:function(a){return this.getPromise().catch(a)},finally:function(a){return this.getPromise().finally(a)},pause:function(){this.host.pause&&this.host.pause()},resume:function(){this.host.resume&&this.host.resume()},end:function(){this.host.end&&this.host.end(),this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel(),this._resolve(!1)},complete:function(a){var b=this;0===b._state&&(b._state=1,b._tick(function(){b._resolve(a)}))},_resolve:function(a){2!==this._state&&(f(this._doneCallbacks,function(b){b(a)}),this._doneCallbacks.length=0,this._state=2)}},g}]},lf=function(){this.$get=["$$rAF","$q","$$AnimateRunner",function(a,b,c){return function(b,d){function e(){return a(function(){f(),h||i.complete(),h=!0}),i}function f(){g.addClass&&(b.addClass(g.addClass),g.addClass=null),g.removeClass&&(b.removeClass(g.removeClass),g.removeClass=null),g.to&&(b.css(g.to),g.to=null)}var g=d||{};g.$$prepared||(g=R(g)),g.cleanupStyles&&(g.from=g.to=null),g.from&&(b.css(g.from),g.from=null);var h,i=new c;return{start:e,end:e}}}]},mf=d("$compile"),nf=new tb;ub.$inject=["$provide","$$sanitizeUriProvider"],vb.prototype.isFirstChange=function(){return this.previousValue===nf};var of=/^((?:x|data)[:\-_])/i,pf=/[:\-_]+(.)/g,qf=d("$controller"),rf=/^(\S+)(\s+as\s+([\w$]+))?$/,sf=function(){this.$get=["$document",function(a){return function(b){return b?!b.nodeType&&b instanceof de&&(b=b[0]):b=a[0].body,b.offsetWidth+1}}]},tf="application/json",uf={"Content-Type":tf+";charset=utf-8"},vf=/^\[|^\{(?!\{)/,wf={"[":/]$/,"{":/}$/},xf=/^\)]\}',?\n/,yf=d("$http"),zf=me.$interpolateMinErr=d("$interpolate");zf.throwNoconcat=function(a){throw zf("noconcat","Error while interpolating: {0}\nStrict Contextual Escaping disallows interpolations that concatenate multiple expressions when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce",a)},zf.interr=function(a,b){return zf("interr","Can't interpolate: {0}\n{1}",a,b.toString())};var Af=function(){this.$get=function(){function a(a){var b=function(a){b.data=a,b.called=!0};return b.id=a,b}var b=me.callbacks,c={};return{createCallback:function(d){var e="_"+(b.$$counter++).toString(36),f="angular.callbacks."+e,g=a(e);return c[f]=b[e]=g,f},wasCalled:function(a){return c[a].called},getResponse:function(a){return c[a].data},removeCallback:function(a){var d=c[a];delete b[d.id],delete c[a]}}}},Bf=/^([^?#]*)(\?([^#]*))?(#(.*))?$/,Cf={http:80,https:443,ftp:21},Df=d("$location"),Ef=/^\s*[\\/]{2,}/,Ff={$$absUrl:"",$$html5:!1,$$replace:!1,absUrl:dc("$$absUrl"),url:function(a){if(t(a))return this.$$url;var b=Bf.exec(a);return(b[1]||""===a)&&this.path(decodeURIComponent(b[1])),(b[2]||b[1]||""===a)&&this.search(b[3]||""),this.hash(b[5]||""),this},protocol:dc("$$protocol"),host:dc("$$host"),port:dc("$$port"),path:ec("$$path",function(a){return a=null!==a?a.toString():"","/"===a.charAt(0)?a:"/"+a}),search:function(a,b){switch(arguments.length){case 0:return this.$$search;case 1:if(x(a)||y(a))a=a.toString(),this.$$search=da(a);else{if(!v(a))throw Df("isrcharg","The first argument of the `$location#search()` call must be a string or an object.");a=R(a,{}),f(a,function(b,c){null==b&&delete a[c]}),this.$$search=a}break;default:t(b)||null===b?delete this.$$search[a]:this.$$search[a]=b}return this.$$compose(),this},hash:ec("$$hash",function(a){return null!==a?a.toString():""}),replace:function(){return this.$$replace=!0,this}};f([cc,bc,ac],function(a){a.prototype=Object.create(Ff),a.prototype.state=function(b){if(!arguments.length)return this.$$state;if(a!==ac||!this.$$html5)throw Df("nostate","History API state support is available only in HTML5 mode and only in browsers supporting HTML5 History API");return this.$$state=t(b)?null:b,this.$$urlUpdatedByLocation=!0,this}});var Gf=d("$parse"),Hf={}.constructor.prototype.valueOf,If=sa();f("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(a){If[a]=!0});var Jf={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},Kf=function(a){this.options=a};Kf.prototype={constructor:Kf,lex:function(a){for(this.text=a,this.index=0,this.tokens=[];this.index<this.text.length;){var b=this.text.charAt(this.index);if('"'===b||"'"===b)this.readString(b);else if(this.isNumber(b)||"."===b&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdentifierStart(this.peekMultichar()))this.readIdent();else if(this.is(b,"(){}[].,;:?"))this.tokens.push({index:this.index,text:b}),this.index++;else if(this.isWhitespace(b))this.index++;else{var c=b+this.peek(),d=c+this.peek(2),e=If[b],f=If[c],g=If[d];if(e||f||g){var h=g?d:f?c:b;this.tokens.push({index:this.index,text:h,operator:!0}),this.index+=h.length}else this.throwError("Unexpected next character ",this.index,this.index+1)}}return this.tokens},is:function(a,b){return-1!==b.indexOf(a)},peek:function(a){var b=a||1;return this.index+b<this.text.length&&this.text.charAt(this.index+b)},isNumber:function(a){return"0"<=a&&a<="9"&&"string"==typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||" "===a},isIdentifierStart:function(a){return this.options.isIdentifierStart?this.options.isIdentifierStart(a,this.codePointAt(a)):this.isValidIdentifierStart(a)},isValidIdentifierStart:function(a){return"a"<=a&&a<="z"||"A"<=a&&a<="Z"||"_"===a||"$"===a},isIdentifierContinue:function(a){return this.options.isIdentifierContinue?this.options.isIdentifierContinue(a,this.codePointAt(a)):this.isValidIdentifierContinue(a)},isValidIdentifierContinue:function(a,b){return this.isValidIdentifierStart(a,b)||this.isNumber(a)},codePointAt:function(a){return 1===a.length?a.charCodeAt(0):(a.charCodeAt(0)<<10)+a.charCodeAt(1)-56613888},peekMultichar:function(){var a=this.text.charAt(this.index),b=this.peek();if(!b)return a;var c=a.charCodeAt(0),d=b.charCodeAt(0);return c>=55296&&c<=56319&&d>=56320&&d<=57343?a+b:a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,b,c){c=c||this.index;var d=u(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,c)+"]":" "+c;throw Gf("lexerr","Lexer Error: {0} at column{1} in expression [{2}].",a,d,this.text)},readNumber:function(){for(var a="",b=this.index;this.index<this.text.length;){var c=$d(this.text.charAt(this.index));if("."===c||this.isNumber(c))a+=c;else{var d=this.peek();if("e"===c&&this.isExpOperator(d))a+=c;else if(this.isExpOperator(c)&&d&&this.isNumber(d)&&"e"===a.charAt(a.length-1))a+=c;else{if(!this.isExpOperator(c)||d&&this.isNumber(d)||"e"!==a.charAt(a.length-1))break;this.throwError("Invalid exponent")}}this.index++}this.tokens.push({index:b,text:a,constant:!0,value:Number(a)})},readIdent:function(){var a=this.index;for(this.index+=this.peekMultichar().length;this.index<this.text.length;){var b=this.peekMultichar();if(!this.isIdentifierContinue(b))break;this.index+=b.length}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var b=this.index;this.index++;for(var c="",d=a,e=!1;this.index<this.text.length;){var f=this.text.charAt(this.index);if(d+=f,e){if("u"===f){var g=this.text.substring(this.index+1,this.index+5);g.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+g+"]"),this.index+=4,c+=String.fromCharCode(parseInt(g,16))}else{c+=Jf[f]||f}e=!1}else if("\\"===f)e=!0;else{if(f===a)return this.index++,void this.tokens.push({index:b,text:d,constant:!0,value:c});c+=f}this.index++}this.throwError("Unterminated quote",b)}};var Lf=function(a,b){this.lexer=a,this.options=b};Lf.Program="Program",Lf.ExpressionStatement="ExpressionStatement",Lf.AssignmentExpression="AssignmentExpression",Lf.ConditionalExpression="ConditionalExpression",Lf.LogicalExpression="LogicalExpression",Lf.BinaryExpression="BinaryExpression",Lf.UnaryExpression="UnaryExpression",Lf.CallExpression="CallExpression",Lf.MemberExpression="MemberExpression",Lf.Identifier="Identifier",Lf.Literal="Literal",Lf.ArrayExpression="ArrayExpression",Lf.Property="Property",Lf.ObjectExpression="ObjectExpression",Lf.ThisExpression="ThisExpression",Lf.LocalsExpression="LocalsExpression",Lf.NGValueParameter="NGValueParameter",Lf.prototype={ast:function(a){this.text=a,this.tokens=this.lexer.lex(a);var b=this.program();return 0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]),b},program:function(){for(var a=[];;)if(this.tokens.length>0&&!this.peek("}",")",";","]")&&a.push(this.expressionStatement()),!this.expect(";"))return{type:Lf.Program,body:a}},expressionStatement:function(){return{type:Lf.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var a=this.expression();this.expect("|");)a=this.filter(a);return a},expression:function(){return this.assignment()},assignment:function(){var a=this.ternary();if(this.expect("=")){if(!oc(a))throw Gf("lval","Trying to assign a value to a non l-value");a={type:Lf.AssignmentExpression,left:a,right:this.assignment(),operator:"="}}return a},ternary:function(){var a,b,c=this.logicalOR();return this.expect("?")&&(a=this.expression(),this.consume(":"))?(b=this.expression(),{type:Lf.ConditionalExpression,test:c,alternate:a,consequent:b}):c},logicalOR:function(){for(var a=this.logicalAND();this.expect("||");)a={type:Lf.LogicalExpression,operator:"||",left:a,right:this.logicalAND()};return a},logicalAND:function(){for(var a=this.equality();this.expect("&&");)a={type:Lf.LogicalExpression,operator:"&&",left:a,right:this.equality()};return a},equality:function(){for(var a,b=this.relational();a=this.expect("==","!=","===","!==");)b={type:Lf.BinaryExpression,operator:a.text,left:b,right:this.relational()};return b},relational:function(){for(var a,b=this.additive();a=this.expect("<",">","<=",">=");)b={type:Lf.BinaryExpression,operator:a.text,left:b,right:this.additive()};return b},additive:function(){for(var a,b=this.multiplicative();a=this.expect("+","-");)b={type:Lf.BinaryExpression,operator:a.text,left:b,right:this.multiplicative()};return b},multiplicative:function(){for(var a,b=this.unary();a=this.expect("*","/","%");)b={type:Lf.BinaryExpression,operator:a.text,left:b,right:this.unary()};return b},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:Lf.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.selfReferential.hasOwnProperty(this.peek().text)?a=R(this.selfReferential[this.consume().text]):this.options.literals.hasOwnProperty(this.peek().text)?a={type:Lf.Literal,value:this.options.literals[this.consume().text]}:this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var b;b=this.expect("(","[",".");)"("===b.text?(a={type:Lf.CallExpression,callee:a,arguments:this.parseArguments()},this.consume(")")):"["===b.text?(a={type:Lf.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===b.text?a={type:Lf.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){for(var b=[a],c={type:Lf.CallExpression,callee:this.identifier(),arguments:b,filter:!0};this.expect(":");)b.push(this.expression());return c},parseArguments:function(){var a=[];if(")"!==this.peekToken().text)do{a.push(this.filterChain())}while(this.expect(","));return a},identifier:function(){var a=this.consume();return a.identifier||this.throwError("is not a valid identifier",a),{type:Lf.Identifier,name:a.text}},constant:function(){return{type:Lf.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text)do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","));return this.consume("]"),{type:Lf.ArrayExpression,elements:a}},object:function(){var a,b=[];if("}"!==this.peekToken().text)do{if(this.peek("}"))break;a={type:Lf.Property,kind:"init"},this.peek().constant?(a.key=this.constant(),a.computed=!1,this.consume(":"),a.value=this.expression()):this.peek().identifier?(a.key=this.identifier(),a.computed=!1,this.peek(":")?(this.consume(":"),a.value=this.expression()):a.value=a.key):this.peek("[")?(this.consume("["),a.key=this.expression(),this.consume("]"),a.computed=!0,
5
- this.consume(":"),a.value=this.expression()):this.throwError("invalid key",this.peek()),b.push(a)}while(this.expect(","));return this.consume("}"),{type:Lf.ObjectExpression,properties:b}},throwError:function(a,b){throw Gf("syntax","Syntax Error: Token '{0}' {1} at column {2} of the expression [{3}] starting at [{4}].",b.text,a,b.index+1,this.text,this.text.substring(b.index))},consume:function(a){if(0===this.tokens.length)throw Gf("ueoe","Unexpected end of expression: {0}",this.text);var b=this.expect(a);return b||this.throwError("is unexpected, expecting ["+a+"]",this.peek()),b},peekToken:function(){if(0===this.tokens.length)throw Gf("ueoe","Unexpected end of expression: {0}",this.text);return this.tokens[0]},peek:function(a,b,c,d){return this.peekAhead(0,a,b,c,d)},peekAhead:function(a,b,c,d,e){if(this.tokens.length>a){var f=this.tokens[a],g=f.text;if(g===b||g===c||g===d||g===e||!b&&!c&&!d&&!e)return f}return!1},expect:function(a,b,c,d){var e=this.peek(a,b,c,d);return!!e&&(this.tokens.shift(),e)},selfReferential:{this:{type:Lf.ThisExpression},$locals:{type:Lf.LocalsExpression}}};var Mf=1,Nf=2;sc.prototype={compile:function(a){var b=this;this.state={nextId:0,filters:{},fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]},mc(a,b.$filter);var c,d="";if(this.stage="assign",c=pc(a)){this.state.computing="assign";var e=this.nextId();this.recurse(c,e),this.return_(e),d="fn.assign="+this.generateFunction("assign","s,v,l")}var g=nc(a.body);b.stage="inputs",f(g,function(a,c){var d="fn"+c;b.state[d]={vars:[],body:[],own:{}},b.state.computing=d;var e=b.nextId();b.recurse(a,e),b.return_(e),b.state.inputs.push({name:d,isPure:a.isPure}),a.watchId=c}),this.state.computing="fn",this.stage="main",this.recurse(a);var h='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+d+this.watchFns()+"return fn;",i=new Function("$filter","getStringValue","ifDefined","plus",h)(this.$filter,hc,ic,jc);return this.state=this.stage=void 0,i},USE:"use",STRICT:"strict",watchFns:function(){var a=[],b=this.state.inputs,c=this;return f(b,function(b){a.push("var "+b.name+"="+c.generateFunction(b.name,"s")),b.isPure&&a.push(b.name,".isPure="+JSON.stringify(b.isPure)+";")}),b.length&&a.push("fn.inputs=["+b.map(function(a){return a.name}).join(",")+"];"),a.join("")},generateFunction:function(a,b){return"function("+b+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],b=this;return f(this.state.filters,function(c,d){a.push(c+"=$filter("+b.escape(d)+")")}),a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,b,c,d,e,g){var h,i,j,k,l,m=this;if(d=d||p,!g&&u(a.watchId))return b=b||this.nextId(),void this.if_("i",this.lazyAssign(b,this.computedMember("i",a.watchId)),this.lazyRecurse(a,b,c,d,e,!0));switch(a.type){case Lf.Program:f(a.body,function(b,c){m.recurse(b.expression,void 0,void 0,function(a){i=a}),c!==a.body.length-1?m.current().body.push(i,";"):m.return_(i)});break;case Lf.Literal:k=this.escape(a.value),this.assign(b,k),d(b||k);break;case Lf.UnaryExpression:this.recurse(a.argument,void 0,void 0,function(a){i=a}),k=a.operator+"("+this.ifDefined(i,0)+")",this.assign(b,k),d(k);break;case Lf.BinaryExpression:this.recurse(a.left,void 0,void 0,function(a){h=a}),this.recurse(a.right,void 0,void 0,function(a){i=a}),k="+"===a.operator?this.plus(h,i):"-"===a.operator?this.ifDefined(h,0)+a.operator+this.ifDefined(i,0):"("+h+")"+a.operator+"("+i+")",this.assign(b,k),d(k);break;case Lf.LogicalExpression:b=b||this.nextId(),m.recurse(a.left,b),m.if_("&&"===a.operator?b:m.not(b),m.lazyRecurse(a.right,b)),d(b);break;case Lf.ConditionalExpression:b=b||this.nextId(),m.recurse(a.test,b),m.if_(b,m.lazyRecurse(a.alternate,b),m.lazyRecurse(a.consequent,b)),d(b);break;case Lf.Identifier:b=b||this.nextId(),c&&(c.context="inputs"===m.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",a.name)+"?l:s"),c.computed=!1,c.name=a.name),m.if_("inputs"===m.stage||m.not(m.getHasOwnProperty("l",a.name)),function(){m.if_("inputs"===m.stage||"s",function(){e&&1!==e&&m.if_(m.isNull(m.nonComputedMember("s",a.name)),m.lazyAssign(m.nonComputedMember("s",a.name),"{}")),m.assign(b,m.nonComputedMember("s",a.name))})},b&&m.lazyAssign(b,m.nonComputedMember("l",a.name))),d(b);break;case Lf.MemberExpression:h=c&&(c.context=this.nextId())||this.nextId(),b=b||this.nextId(),m.recurse(a.object,h,void 0,function(){m.if_(m.notNull(h),function(){a.computed?(i=m.nextId(),m.recurse(a.property,i),m.getStringValue(i),e&&1!==e&&m.if_(m.not(m.computedMember(h,i)),m.lazyAssign(m.computedMember(h,i),"{}")),k=m.computedMember(h,i),m.assign(b,k),c&&(c.computed=!0,c.name=i)):(e&&1!==e&&m.if_(m.isNull(m.nonComputedMember(h,a.property.name)),m.lazyAssign(m.nonComputedMember(h,a.property.name),"{}")),k=m.nonComputedMember(h,a.property.name),m.assign(b,k),c&&(c.computed=!1,c.name=a.property.name))},function(){m.assign(b,"undefined")}),d(b)},!!e);break;case Lf.CallExpression:b=b||this.nextId(),a.filter?(i=m.filter(a.callee.name),j=[],f(a.arguments,function(a){var b=m.nextId();m.recurse(a,b),j.push(b)}),k=i+"("+j.join(",")+")",m.assign(b,k),d(b)):(i=m.nextId(),h={},j=[],m.recurse(a.callee,i,h,function(){m.if_(m.notNull(i),function(){f(a.arguments,function(b){m.recurse(b,a.constant?void 0:m.nextId(),void 0,function(a){j.push(a)})}),k=h.name?m.member(h.context,h.name,h.computed)+"("+j.join(",")+")":i+"("+j.join(",")+")",m.assign(b,k)},function(){m.assign(b,"undefined")}),d(b)}));break;case Lf.AssignmentExpression:i=this.nextId(),h={},this.recurse(a.left,void 0,h,function(){m.if_(m.notNull(h.context),function(){m.recurse(a.right,i),k=m.member(h.context,h.name,h.computed)+a.operator+i,m.assign(b,k),d(b||k)})},1);break;case Lf.ArrayExpression:j=[],f(a.elements,function(b){m.recurse(b,a.constant?void 0:m.nextId(),void 0,function(a){j.push(a)})}),k="["+j.join(",")+"]",this.assign(b,k),d(b||k);break;case Lf.ObjectExpression:j=[],l=!1,f(a.properties,function(a){a.computed&&(l=!0)}),l?(b=b||this.nextId(),this.assign(b,"{}"),f(a.properties,function(a){a.computed?(h=m.nextId(),m.recurse(a.key,h)):h=a.key.type===Lf.Identifier?a.key.name:""+a.key.value,i=m.nextId(),m.recurse(a.value,i),m.assign(m.member(b,h,a.computed),i)})):(f(a.properties,function(b){m.recurse(b.value,a.constant?void 0:m.nextId(),void 0,function(a){j.push(m.escape(b.key.type===Lf.Identifier?b.key.name:""+b.key.value)+":"+a)})}),k="{"+j.join(",")+"}",this.assign(b,k)),d(b||k);break;case Lf.ThisExpression:this.assign(b,"s"),d(b||"s");break;case Lf.LocalsExpression:this.assign(b,"l"),d(b||"l");break;case Lf.NGValueParameter:this.assign(b,"v"),d(b||"v")}},getHasOwnProperty:function(a,b){var c=a+"."+b,d=this.current().own;return d.hasOwnProperty(c)||(d[c]=this.nextId(!1,a+"&&("+this.escape(b)+" in "+a+")")),d[c]},assign:function(a,b){if(a)return this.current().body.push(a,"=",b,";"),a},filter:function(a){return this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0)),this.state.filters[a]},ifDefined:function(a,b){return"ifDefined("+a+","+this.escape(b)+")"},plus:function(a,b){return"plus("+a+","+b+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,b,c){if(!0===a)b();else{var d=this.current().body;d.push("if(",a,"){"),b(),d.push("}"),c&&(d.push("else{"),c(),d.push("}"))}},not:function(a){return"!("+a+")"},isNull:function(a){return a+"==null"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,b){var c=/^[$_a-zA-Z][$_a-zA-Z0-9]*$/,d=/[^$_a-zA-Z0-9]/g;return c.test(b)?a+"."+b:a+'["'+b.replace(d,this.stringEscapeFn)+'"]'},computedMember:function(a,b){return a+"["+b+"]"},member:function(a,b,c){return c?this.computedMember(a,b):this.nonComputedMember(a,b)},getStringValue:function(a){this.assign(a,"getStringValue("+a+")")},lazyRecurse:function(a,b,c,d,e,f){var g=this;return function(){g.recurse(a,b,c,d,e,f)}},lazyAssign:function(a,b){var c=this;return function(){c.assign(a,b)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(x(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(y(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if(void 0===a)return"undefined";throw Gf("esc","IMPOSSIBLE")},nextId:function(a,b){var c="v"+this.state.nextId++;return a||this.current().vars.push(c+(b?"="+b:"")),c},current:function(){return this.state[this.state.computing]}},tc.prototype={compile:function(a){var b=this;mc(a,b.$filter);var c,d;(c=pc(a))&&(d=this.recurse(c));var e,g=nc(a.body);g&&(e=[],f(g,function(a,c){var d=b.recurse(a);d.isPure=a.isPure,a.input=d,e.push(d),a.watchId=c}));var h=[];f(a.body,function(a){h.push(b.recurse(a.expression))});var i=0===a.body.length?p:1===a.body.length?h[0]:function(a,b){var c;return f(h,function(d){c=d(a,b)}),c};return d&&(i.assign=function(a,b,c){return d(a,c,b)}),e&&(i.inputs=e),i},recurse:function(a,b,c){var d,e,g,h=this;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case Lf.Literal:return this.value(a.value,b);case Lf.UnaryExpression:return e=this.recurse(a.argument),this["unary"+a.operator](e,b);case Lf.BinaryExpression:case Lf.LogicalExpression:return d=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](d,e,b);case Lf.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),b);case Lf.Identifier:return h.identifier(a.name,b,c);case Lf.MemberExpression:return d=this.recurse(a.object,!1,!!c),a.computed||(e=a.property.name),a.computed&&(e=this.recurse(a.property)),a.computed?this.computedMember(d,e,b,c):this.nonComputedMember(d,e,b,c);case Lf.CallExpression:return g=[],f(a.arguments,function(a){g.push(h.recurse(a))}),a.filter&&(e=this.$filter(a.callee.name)),a.filter||(e=this.recurse(a.callee,!0)),a.filter?function(a,c,d,f){for(var h=[],i=0;i<g.length;++i)h.push(g[i](a,c,d,f));var j=e.apply(void 0,h,f);return b?{context:void 0,name:void 0,value:j}:j}:function(a,c,d,f){var h,i=e(a,c,d,f);if(null!=i.value){for(var j=[],k=0;k<g.length;++k)j.push(g[k](a,c,d,f));h=i.value.apply(i.context,j)}return b?{value:h}:h};case Lf.AssignmentExpression:return d=this.recurse(a.left,!0,1),e=this.recurse(a.right),function(a,c,f,g){var h=d(a,c,f,g),i=e(a,c,f,g);return h.context[h.name]=i,b?{value:i}:i};case Lf.ArrayExpression:return g=[],f(a.elements,function(a){g.push(h.recurse(a))}),function(a,c,d,e){for(var f=[],h=0;h<g.length;++h)f.push(g[h](a,c,d,e));return b?{value:f}:f};case Lf.ObjectExpression:return g=[],f(a.properties,function(a){a.computed?g.push({key:h.recurse(a.key),computed:!0,value:h.recurse(a.value)}):g.push({key:a.key.type===Lf.Identifier?a.key.name:""+a.key.value,computed:!1,value:h.recurse(a.value)})}),function(a,c,d,e){for(var f={},h=0;h<g.length;++h)g[h].computed?f[g[h].key(a,c,d,e)]=g[h].value(a,c,d,e):f[g[h].key]=g[h].value(a,c,d,e);return b?{value:f}:f};case Lf.ThisExpression:return function(a){return b?{value:a}:a};case Lf.LocalsExpression:return function(a,c){return b?{value:c}:c};case Lf.NGValueParameter:return function(a,c,d){return b?{value:d}:d}}},"unary+":function(a,b){return function(c,d,e,f){var g=a(c,d,e,f);return g=u(g)?+g:0,b?{value:g}:g}},"unary-":function(a,b){return function(c,d,e,f){var g=a(c,d,e,f);return g=u(g)?-g:-0,b?{value:g}:g}},"unary!":function(a,b){return function(c,d,e,f){var g=!a(c,d,e,f);return b?{value:g}:g}},"binary+":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g),i=b(d,e,f,g),j=jc(h,i);return c?{value:j}:j}},"binary-":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g),i=b(d,e,f,g),j=(u(h)?h:0)-(u(i)?i:0);return c?{value:j}:j}},"binary*":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)*b(d,e,f,g);return c?{value:h}:h}},"binary/":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)/b(d,e,f,g);return c?{value:h}:h}},"binary%":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)%b(d,e,f,g);return c?{value:h}:h}},"binary===":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)===b(d,e,f,g);return c?{value:h}:h}},"binary!==":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)!==b(d,e,f,g);return c?{value:h}:h}},"binary==":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)==b(d,e,f,g);return c?{value:h}:h}},"binary!=":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)!=b(d,e,f,g);return c?{value:h}:h}},"binary<":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)<b(d,e,f,g);return c?{value:h}:h}},"binary>":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)>b(d,e,f,g);return c?{value:h}:h}},"binary<=":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)<=b(d,e,f,g);return c?{value:h}:h}},"binary>=":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)>=b(d,e,f,g);return c?{value:h}:h}},"binary&&":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)&&b(d,e,f,g);return c?{value:h}:h}},"binary||":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)||b(d,e,f,g);return c?{value:h}:h}},"ternary?:":function(a,b,c,d){return function(e,f,g,h){var i=a(e,f,g,h)?b(e,f,g,h):c(e,f,g,h);return d?{value:i}:i}},value:function(a,b){return function(){return b?{context:void 0,name:void 0,value:a}:a}},identifier:function(a,b,c){return function(d,e,f,g){var h=e&&a in e?e:d;c&&1!==c&&h&&null==h[a]&&(h[a]={});var i=h?h[a]:void 0;return b?{context:h,name:a,value:i}:i}},computedMember:function(a,b,c,d){return function(e,f,g,h){var i,j,k=a(e,f,g,h);return null!=k&&(i=b(e,f,g,h),i=hc(i),d&&1!==d&&k&&!k[i]&&(k[i]={}),j=k[i]),c?{context:k,name:i,value:j}:j}},nonComputedMember:function(a,b,c,d){return function(e,f,g,h){var i=a(e,f,g,h);d&&1!==d&&i&&null==i[b]&&(i[b]={});var j=null!=i?i[b]:void 0;return c?{context:i,name:b,value:j}:j}},inputs:function(a,b){return function(c,d,e,f){return f?f[b]:a(c,d,e)}}},uc.prototype={constructor:uc,parse:function(a){var b=this.ast.ast(a),c=this.astCompiler.compile(b);return c.literal=qc(b),c.constant=rc(b),c}};var Of=d("$sce"),Pf={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},Qf=/_([a-z])/g,Rf=d("$compile"),Sf=a.document.createElement("a"),Tf=Pc(a.location.href);Sc.$inject=["$document"],Uc.$inject=["$provide"];var Uf=22,Vf=".",Wf="0";Zc.$inject=["$locale"],$c.$inject=["$locale"];var Xf={yyyy:dd("FullYear",4,0,!1,!0),yy:dd("FullYear",2,0,!0,!0),y:dd("FullYear",1,0,!1,!0),MMMM:ed("Month"),MMM:ed("Month",!0),MM:dd("Month",2,1),M:dd("Month",1,1),LLLL:ed("Month",!1,!0),dd:dd("Date",2),d:dd("Date",1),HH:dd("Hours",2),H:dd("Hours",1),hh:dd("Hours",2,-12),h:dd("Hours",1,-12),mm:dd("Minutes",2),m:dd("Minutes",1),ss:dd("Seconds",2),s:dd("Seconds",1),sss:dd("Milliseconds",3),EEEE:ed("Day"),EEE:ed("Day",!0),a:jd,Z:fd,ww:id(2),w:id(1),G:kd,GG:kd,GGG:kd,GGGG:ld},Yf=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\s\S]*)/,Zf=/^-?\d+$/;md.$inject=["$locale"];var $f=r($d),_f=r(_d);qd.$inject=["$parse"];var ag=r({restrict:"E",compile:function(a,b){if(!b.href&&!b.xlinkHref)return function(a,b){if("a"===b[0].nodeName.toLowerCase()){var c="[object SVGAnimatedString]"===je.call(b.prop("href"))?"xlink:href":"href";b.on("click",function(a){b.attr(c)||a.preventDefault()})}}}}),bg={};f(Te,function(a,b){function c(a,c,e){a.$watch(e[d],function(a){e.$set(b,!!a)})}if("multiple"!==a){var d=wb("ng-"+b),e=c;"checked"===a&&(e=function(a,b,e){e.ngModel!==e[d]&&c(a,b,e)}),bg[d]=function(){return{restrict:"A",priority:100,link:e}}}}),f(Ve,function(a,b){bg[b]=function(){return{priority:100,link:function(a,c,d){if("ngPattern"===b&&"/"===d.ngPattern.charAt(0)){var e=d.ngPattern.match(Xd);if(e)return void d.$set("ngPattern",new RegExp(e[1],e[2]))}a.$watch(d[b],function(a){d.$set(b,a)})}}}}),f(["src","srcset","href"],function(a){var b=wb("ng-"+a);bg[b]=function(){return{priority:99,link:function(c,d,e){var f=a,g=a;"href"===a&&"[object SVGAnimatedString]"===je.call(d.prop("href"))&&(g="xlinkHref",e.$attr[g]="xlink:href",f=null),e.$observe(b,function(b){if(!b)return void("href"===a&&e.$set(g,null));e.$set(g,b),ce&&f&&d.prop(f,e[g])})}}}});var cg={$addControl:p,$$renameControl:sd,$removeControl:p,$setValidity:p,$setDirty:p,$setPristine:p,$setSubmitted:p},dg="ng-pending";td.$inject=["$element","$attrs","$scope","$animate","$interpolate"],td.prototype={$rollbackViewValue:function(){f(this.$$controls,function(a){a.$rollbackViewValue()})},$commitViewValue:function(){f(this.$$controls,function(a){a.$commitViewValue()})},$addControl:function(a){pa(a.$name,"input"),this.$$controls.push(a),a.$name&&(this[a.$name]=a),a.$$parentForm=this},$$renameControl:function(a,b){var c=a.$name;this[c]===a&&delete this[c],this[b]=a,a.$name=b},$removeControl:function(a){a.$name&&this[a.$name]===a&&delete this[a.$name],f(this.$pending,function(b,c){this.$setValidity(c,null,a)},this),f(this.$error,function(b,c){this.$setValidity(c,null,a)},this),f(this.$$success,function(b,c){this.$setValidity(c,null,a)},this),Q(this.$$controls,a),a.$$parentForm=cg},$setDirty:function(){this.$$animate.removeClass(this.$$element,Og),this.$$animate.addClass(this.$$element,Pg),this.$dirty=!0,this.$pristine=!1,this.$$parentForm.$setDirty()},$setPristine:function(){this.$$animate.setClass(this.$$element,Og,Pg+" ng-submitted"),this.$dirty=!1,this.$pristine=!0,this.$submitted=!1,f(this.$$controls,function(a){a.$setPristine()})},$setUntouched:function(){f(this.$$controls,function(a){a.$setUntouched()})},$setSubmitted:function(){this.$$animate.addClass(this.$$element,"ng-submitted"),this.$submitted=!0,this.$$parentForm.$setSubmitted()}},vd({clazz:td,set:function(a,b,c){var d=a[b];if(d){-1===d.indexOf(c)&&d.push(c)}else a[b]=[c]},unset:function(a,b,c){var d=a[b];d&&(Q(d,c),0===d.length&&delete a[b])}});var eg=function(a){return["$timeout","$parse",function(b,c){function d(a){return""===a?c('this[""]').assign:c(a).assign||p}return{name:"form",restrict:a?"EAC":"E",require:["form","^^?form"],controller:td,compile:function(c,e){c.addClass(Og).addClass(Mg);var f=e.name?"name":!(!a||!e.ngForm)&&"ngForm";return{pre:function(a,c,e,g){var h=g[0];if(!("action"in e)){var i=function(b){a.$apply(function(){h.$commitViewValue(),h.$setSubmitted()}),b.preventDefault()};c[0].addEventListener("submit",i),c.on("$destroy",function(){b(function(){c[0].removeEventListener("submit",i)},0,!1)})}(g[1]||h.$$parentForm).$addControl(h);var j=f?d(h.$name):p;f&&(j(a,h),e.$observe(f,function(b){h.$name!==b&&(j(a,void 0),h.$$parentForm.$$renameControl(h,b),(j=d(h.$name))(a,h))})),c.on("$destroy",function(){h.$$parentForm.$removeControl(h),j(a,void 0),l(h,cg)})}}}}}]},fg=eg(),gg=eg(!0),hg=/^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/,ig=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:\/?#]+|\[[a-f\d:]+])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,jg=/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,kg=/^\s*(-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,lg=/^(\d{4,})-(\d{2})-(\d{2})$/,mg=/^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,ng=/^(\d{4,})-W(\d\d)$/,og=/^(\d{4,})-(\d\d)$/,pg=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,qg="keydown wheel mousedown",rg=sa();f("date,datetime-local,month,time,week".split(","),function(a){rg[a]=!0});var sg={text:yd,date:Cd("date",lg,Bd(lg,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":Cd("datetimelocal",mg,Bd(mg,["yyyy","MM","dd","HH","mm","ss","sss"]),"yyyy-MM-ddTHH:mm:ss.sss"),time:Cd("time",pg,Bd(pg,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:Cd("week",ng,Ad,"yyyy-Www"),month:Cd("month",og,Bd(og,["yyyy","MM"]),"yyyy-MM"),number:Jd,url:Ld,email:Md,radio:Nd,range:Kd,checkbox:Pd,hidden:p,button:p,submit:p,reset:p,file:p},tg=["$browser","$sniffer","$filter","$parse",function(a,b,c,d){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,f,g,h){h[0]&&(sg[$d(g.type)]||sg.text)(e,f,g,h[0],b,a,c,d)}}}}],ug=/^(true|false|\d+)$/,vg=function(){function a(a,b,c){var d=u(c)?c:9===ce?"":null;a.prop("value",d),b.$set("value",c)}return{restrict:"A",priority:100,compile:function(b,c){return ug.test(c.ngValue)?function(b,c,d){a(c,d,b.$eval(d.ngValue))}:function(b,c,d){b.$watch(d.ngValue,function(b){a(c,d,b)})}}}},wg=["$compile",function(a){return{restrict:"AC",compile:function(b){return a.$$addBindingClass(b),function(b,c,d){a.$$addBindingInfo(c,d.ngBind),c=c[0],b.$watch(d.ngBind,function(a){c.textContent=ta(a)})}}}}],xg=["$interpolate","$compile",function(a,b){return{compile:function(c){return b.$$addBindingClass(c),function(c,d,e){var f=a(d.attr(e.$attr.ngBindTemplate));b.$$addBindingInfo(d,f.expressions),d=d[0],e.$observe("ngBindTemplate",function(a){d.textContent=t(a)?"":a})}}}}],yg=["$sce","$parse","$compile",function(a,b,c){return{restrict:"A",compile:function(d,e){var f=b(e.ngBindHtml),g=b(e.ngBindHtml,function(b){return a.valueOf(b)});return c.$$addBindingClass(d),function(b,d,e){c.$$addBindingInfo(d,e.ngBindHtml),b.$watch(g,function(){var c=f(b);d.html(a.getTrustedHtml(c)||"")})}}}}],zg=r({restrict:"A",require:"ngModel",link:function(a,b,c,d){d.$viewChangeListeners.push(function(){a.$eval(c.ngChange)})}}),Ag=Qd("",!0),Bg=Qd("Odd",0),Cg=Qd("Even",1),Dg=rd({compile:function(a,b){b.$set("ngCloak",void 0),a.removeClass("ng-cloak")}}),Eg=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],Fg={},Gg={blur:!0,focus:!0};f("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var b=wb("ng-"+a);Fg[b]=["$parse","$rootScope",function(c,d){return{restrict:"A",compile:function(e,f){var g=c(f[b]);return function(b,c){c.on(a,function(c){var e=function(){g(b,{$event:c})};Gg[a]&&d.$$phase?b.$evalAsync(e):b.$apply(e)})}}}}]});var Hg=["$animate","$compile",function(a,b){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(c,d,e,f,g){var h,i,j;c.$watch(e.ngIf,function(c){c?i||g(function(c,f){i=f,c[c.length++]=b.$$createComment("end ngIf",e.ngIf),h={clone:c},a.enter(c,d.parent(),d)}):(j&&(j.remove(),j=null),i&&(i.$destroy(),i=null),h&&(j=ra(h.clone),a.leave(j).done(function(a){!1!==a&&(j=null)}),h=null))})}}}],Ig=["$templateRequest","$anchorScroll","$animate",function(a,b,c){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:me.noop,compile:function(d,e){var f=e.ngInclude||e.src,g=e.onload||"",h=e.autoscroll;return function(d,e,i,j,k){var l,m,n,o=0,p=function(){m&&(m.remove(),m=null),l&&(l.$destroy(),l=null),n&&(c.leave(n).done(function(a){!1!==a&&(m=null)}),m=n,n=null)};d.$watch(f,function(f){var i=function(a){!1===a||!u(h)||h&&!d.$eval(h)||b()},m=++o;f?(a(f,!0).then(function(a){if(!d.$$destroyed&&m===o){var b=d.$new();j.template=a;var h=k(b,function(a){p(),c.enter(a,null,e).done(i)});l=b,n=h,l.$emit("$includeContentLoaded",f),d.$eval(g)}},function(){d.$$destroyed||m===o&&(p(),d.$emit("$includeContentError",f))}),d.$emit("$includeContentRequested",f)):(p(),j.template=null)})}}}}],Jg=["$compile",function(b){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(c,d,e,f){if(je.call(d[0]).match(/SVG/))return d.empty(),void b(Fa(f.template,a.document).childNodes)(c,function(a){d.append(a)},{futureParentElement:d});d.html(f.template),b(d.contents())(c)}}}],Kg=rd({priority:450,compile:function(){return{pre:function(a,b,c){a.$eval(c.ngInit)}}}}),Lg=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,b,c,d){var e=c.ngList||", ",g="false"!==c.ngTrim,h=g?re(e):e,i=function(a){if(!t(a)){var b=[];return a&&f(a.split(h),function(a){a&&b.push(g?re(a):a)}),b}};d.$parsers.push(i),d.$formatters.push(function(a){if(pe(a))return a.join(e)}),d.$isEmpty=function(a){return!a||!a.length}}}},Mg="ng-valid",Ng="ng-invalid",Og="ng-pristine",Pg="ng-dirty",Qg=d("ngModel");Rd.$inject=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$q","$interpolate"],Rd.prototype={$$initGetterSetters:function(){if(this.$options.getOption("getterSetter")){var a=this.$$parse(this.$$attr.ngModel+"()"),b=this.$$parse(this.$$attr.ngModel+"($$$p)");this.$$ngModelGet=function(b){var c=this.$$parsedNgModel(b);return B(c)&&(c=a(b)),c},this.$$ngModelSet=function(a,c){B(this.$$parsedNgModel(a))?b(a,{$$$p:c}):this.$$parsedNgModelAssign(a,c)}}else if(!this.$$parsedNgModel.assign)throw Qg("nonassign","Expression '{0}' is non-assignable. Element: {1}",this.$$attr.ngModel,ba(this.$$element))},$render:p,$isEmpty:function(a){return t(a)||""===a||null===a||a!==a},$$updateEmptyClasses:function(a){this.$isEmpty(a)?(this.$$animate.removeClass(this.$$element,"ng-not-empty"),this.$$animate.addClass(this.$$element,"ng-empty")):(this.$$animate.removeClass(this.$$element,"ng-empty"),this.$$animate.addClass(this.$$element,"ng-not-empty"))},$setPristine:function(){this.$dirty=!1,this.$pristine=!0,this.$$animate.removeClass(this.$$element,Pg),this.$$animate.addClass(this.$$element,Og)},$setDirty:function(){this.$dirty=!0,this.$pristine=!1,this.$$animate.removeClass(this.$$element,Og),this.$$animate.addClass(this.$$element,Pg),this.$$parentForm.$setDirty()},$setUntouched:function(){this.$touched=!1,this.$untouched=!0,this.$$animate.setClass(this.$$element,"ng-untouched","ng-touched")},$setTouched:function(){this.$touched=!0,this.$untouched=!1,this.$$animate.setClass(this.$$element,"ng-touched","ng-untouched")},$rollbackViewValue:function(){this.$$timeout.cancel(this.$$pendingDebounce),this.$viewValue=this.$$lastCommittedViewValue,this.$render()},$validate:function(){if(!oe(this.$modelValue)){var a=this.$$lastCommittedViewValue,b=this.$$rawModelValue,c=this.$valid,d=this.$modelValue,e=this.$options.getOption("allowInvalid"),f=this;this.$$runValidators(b,a,function(a){e||c===a||(f.$modelValue=a?b:void 0,f.$modelValue!==d&&f.$$writeModelToScope())})}},$$runValidators:function(a,b,c){function d(a,b){g===h.$$currentValidationRunId&&h.$setValidity(a,b)}function e(a){g===h.$$currentValidationRunId&&c(a)}this.$$currentValidationRunId++;var g=this.$$currentValidationRunId,h=this;return function(){var a=h.$$parserName||"parse";return t(h.$$parserValid)?(d(a,null),!0):(h.$$parserValid||(f(h.$validators,function(a,b){d(b,null)}),f(h.$asyncValidators,function(a,b){d(b,null)})),d(a,h.$$parserValid),h.$$parserValid)}()&&function(){var c=!0;return f(h.$validators,function(e,f){var g=Boolean(e(a,b));c=c&&g,d(f,g)}),!!c||(f(h.$asyncValidators,function(a,b){d(b,null)}),!1)}()?void function(){var c=[],g=!0;f(h.$asyncValidators,function(e,f){var h=e(a,b);if(!J(h))throw Qg("nopromise","Expected asynchronous validator to return a promise but got '{0}' instead.",h);d(f,void 0),c.push(h.then(function(){d(f,!0)},function(){g=!1,d(f,!1)}))}),c.length?h.$$q.all(c).then(function(){e(g)},p):e(!0)}():void e(!1)},$commitViewValue:function(){var a=this.$viewValue;this.$$timeout.cancel(this.$$pendingDebounce),(this.$$lastCommittedViewValue!==a||""===a&&this.$$hasNativeValidators)&&(this.$$updateEmptyClasses(a),this.$$lastCommittedViewValue=a,this.$pristine&&this.$setDirty(),this.$$parseAndValidate())},$$parseAndValidate:function(){function a(){d.$modelValue!==f&&d.$$writeModelToScope()}var b=this.$$lastCommittedViewValue,c=b,d=this;if(this.$$parserValid=!t(c)||void 0,this.$$parserValid)for(var e=0;e<this.$parsers.length;e++)if(c=this.$parsers[e](c),t(c)){this.$$parserValid=!1;break}oe(this.$modelValue)&&(this.$modelValue=this.$$ngModelGet(this.$$scope));var f=this.$modelValue,g=this.$options.getOption("allowInvalid");this.$$rawModelValue=c,g&&(this.$modelValue=c,a()),this.$$runValidators(c,this.$$lastCommittedViewValue,function(b){g||(d.$modelValue=b?c:void 0,a())})},$$writeModelToScope:function(){this.$$ngModelSet(this.$$scope,this.$modelValue),f(this.$viewChangeListeners,function(a){try{a()}catch(a){this.$$exceptionHandler(a)}},this)},$setViewValue:function(a,b){this.$viewValue=a,this.$options.getOption("updateOnDefault")&&this.$$debounceViewValueCommit(b)},$$debounceViewValueCommit:function(a){var b=this.$options.getOption("debounce");y(b[a])?b=b[a]:y(b.default)&&(b=b.default),this.$$timeout.cancel(this.$$pendingDebounce);var c=this;b>0?this.$$pendingDebounce=this.$$timeout(function(){c.$commitViewValue()},b):this.$$scope.$root.$$phase?this.$commitViewValue():this.$$scope.$apply(function(){c.$commitViewValue()})},$overrideModelOptions:function(a){this.$options=this.$options.createChild(a)}},vd({clazz:Rd,set:function(a,b){a[b]=!0},unset:function(a,b){delete a[b]}});var Rg,Sg=["$rootScope",function(a){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:Rd,priority:1,compile:function(b){return b.addClass(Og).addClass("ng-untouched").addClass(Mg),{pre:function(a,b,c,d){var e=d[0],f=d[1]||e.$$parentForm,g=d[2];g&&(e.$options=g.$options),e.$$initGetterSetters(),f.$addControl(e),c.$observe("name",function(a){e.$name!==a&&e.$$parentForm.$$renameControl(e,a)}),a.$on("$destroy",function(){e.$$parentForm.$removeControl(e)})},post:function(b,c,d,e){function f(){g.$setTouched()}var g=e[0];g.$options.getOption("updateOn")&&c.on(g.$options.getOption("updateOn"),function(a){g.$$debounceViewValueCommit(a&&a.type)}),c.on("blur",function(){g.$touched||(a.$$phase?b.$evalAsync(f):b.$apply(f))})}}}}}],Tg=/(\s+|^)default(\s+|$)/;Td.prototype={getOption:function(a){return this.$$options[a]},createChild:function(a){var b=!1;return a=l({},a),f(a,function(c,d){"$inherit"===c?"*"===d?b=!0:(a[d]=this.$$options[d],"updateOn"===d&&(a.updateOnDefault=this.$$options.updateOnDefault)):"updateOn"===d&&(a.updateOnDefault=!1,a[d]=re(c.replace(Tg,function(){return a.updateOnDefault=!0," "})))},this),b&&(delete a["*"],Ud(a,this.$$options)),Ud(a,Rg.$$options),new Td(a)}},Rg=new Td({updateOn:"",updateOnDefault:!0,debounce:0,getterSetter:!1,allowInvalid:!1,timezone:null});var Ug=function(){function a(a,b){this.$$attrs=a,this.$$scope=b}return a.$inject=["$attrs","$scope"],a.prototype={$onInit:function(){var a=this.parentCtrl?this.parentCtrl.$options:Rg,b=this.$$scope.$eval(this.$$attrs.ngModelOptions);this.$options=a.createChild(b)}},{restrict:"A",priority:10,require:{parentCtrl:"?^^ngModelOptions"},bindToController:!0,controller:a}},Vg=rd({terminal:!0,priority:1e3}),Wg=d("ngOptions"),Xg=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([$\w][$\w]*)|(?:\(\s*([$\w][$\w]*)\s*,\s*([$\w][$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,Yg=["$compile","$document","$parse",function(b,c,d){function g(a,b,c){function f(a,b,c,d,e){this.selectValue=a,this.viewValue=b,this.label=c,this.group=d,this.disabled=e}function g(a){var b;if(!j&&e(a))b=a;else{b=[];for(var c in a)a.hasOwnProperty(c)&&"$"!==c.charAt(0)&&b.push(c)}return b}var h=a.match(Xg);if(!h)throw Wg("iexp","Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}",a,ba(b));var i=h[5]||h[7],j=h[6],k=/ as /.test(h[0])&&h[1],l=h[9],m=d(h[2]?h[1]:i),n=k&&d(k),o=n||m,p=l&&d(l),q=l?function(a,b){return p(c,b)}:function(a){return db(a)},r=function(a,b){return q(a,x(a,b))},s=d(h[2]||h[1]),t=d(h[3]||""),u=d(h[4]||""),v=d(h[8]),w={},x=j?function(a,b){return w[j]=b,w[i]=a,w}:function(a){return w[i]=a,w};return{trackBy:l,getTrackByValue:r,getWatchables:d(v,function(a){var b=[];a=a||[];for(var d=g(a),e=d.length,f=0;f<e;f++){var i=a===d?f:d[f],j=a[i],k=x(j,i),l=q(j,k);if(b.push(l),h[2]||h[1]){var m=s(c,k);b.push(m)}if(h[4]){var n=u(c,k);b.push(n)}}return b}),getOptions:function(){for(var a=[],b={},d=v(c)||[],e=g(d),h=e.length,i=0;i<h;i++){var j=d===e?i:e[i],k=d[j],m=x(k,j),n=o(c,m),p=q(n,m),w=s(c,m),y=t(c,m),z=u(c,m),A=new f(p,n,w,y,z);a.push(A),b[p]=A}return{items:a,selectValueMap:b,getOptionFromViewValue:function(a){return b[r(a)]},
6
- getViewValueFromOption:function(a){return l?R(a.viewValue):a.viewValue}}}}}function h(a,d,e,h){function k(a,b){var c=i.cloneNode(!1);b.appendChild(c),m(a,c)}function l(a){var b=w.getOptionFromViewValue(a),c=b&&b.element;return c&&!c.selected&&(c.selected=!0),b}function m(a,b){a.element=b,b.disabled=a.disabled,a.label!==b.label&&(b.label=a.label,b.textContent=a.label),b.value=a.selectValue}function n(){var a=w&&o.readValue();if(w)for(var b=w.items.length-1;b>=0;b--){var c=w.items[b];Wa(u(c.group)?c.element.parentNode:c.element)}w=x.getOptions();var e={};if(w.items.forEach(function(a){var b;u(a.group)?(b=e[a.group],b||(b=j.cloneNode(!1),y.appendChild(b),b.label=null===a.group?"null":a.group,e[a.group]=b),k(a,b)):k(a,y)}),d[0].appendChild(y),p.$render(),!p.$isEmpty(a)){var f=o.readValue();(x.trackBy||q?T(a,f):a===f)||(p.$setViewValue(f),p.$render())}}for(var o=h[0],p=h[1],q=e.multiple,r=0,s=d.children(),t=s.length;r<t;r++)if(""===s[r].value){o.hasEmptyOption=!0,o.emptyOption=s.eq(r);break}d.empty();var v=!!o.emptyOption;de(i.cloneNode(!1)).val("?");var w,x=g(e.ngOptions,d,a),y=c[0].createDocumentFragment();o.generateUnknownOptionValue=function(a){return"?"},q?(o.writeValue=function(a){if(w){var b=a&&a.map(l)||[];w.items.forEach(function(a){a.element.selected&&!P(b,a)&&(a.element.selected=!1)})}},o.readValue=function(){var a=d.val()||[],b=[];return f(a,function(a){var c=w.selectValueMap[a];c&&!c.disabled&&b.push(w.getViewValueFromOption(c))}),b},x.trackBy&&a.$watchCollection(function(){if(pe(p.$viewValue))return p.$viewValue.map(function(a){return x.getTrackByValue(a)})},function(){p.$render()})):(o.writeValue=function(a){if(w){var b=d[0].options[d[0].selectedIndex],c=w.getOptionFromViewValue(a);b&&b.removeAttribute("selected"),c?(d[0].value!==c.selectValue&&(o.removeUnknownOption(),d[0].value=c.selectValue,c.element.selected=!0),c.element.setAttribute("selected","selected")):o.selectUnknownOrEmptyOption(a)}},o.readValue=function(){var a=w.selectValueMap[d.val()];return a&&!a.disabled?(o.unselectEmptyOption(),o.removeUnknownOption(),w.getViewValueFromOption(a)):null},x.trackBy&&a.$watch(function(){return x.getTrackByValue(p.$viewValue)},function(){p.$render()})),v&&(b(o.emptyOption)(a),d.prepend(o.emptyOption),o.emptyOption[0].nodeType===Ce?(o.hasEmptyOption=!1,o.registerOption=function(a,b){""===b.val()&&(o.hasEmptyOption=!0,o.emptyOption=b,o.emptyOption.removeClass("ng-scope"),p.$render(),b.on("$destroy",function(){var a=o.$isEmptyOptionSelected();o.hasEmptyOption=!1,o.emptyOption=void 0,a&&p.$render()}))}):o.emptyOption.removeClass("ng-scope")),a.$watchCollection(x.getWatchables,n)}var i=a.document.createElement("option"),j=a.document.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","ngModel"],link:{pre:function(a,b,c,d){d[0].registerOption=p},post:h}}}],Zg=["$locale","$interpolate","$log",function(a,b,c){var d=/{}/g,e=/^when(Minus)?(.+)$/;return{link:function(g,h,i){function j(a){h.text(a||"")}var k,l=i.count,m=i.$attr.when&&h.attr(i.$attr.when),n=i.offset||0,o=g.$eval(m)||{},q={},r=b.startSymbol(),s=b.endSymbol(),u=r+l+"-"+n+s,v=me.noop;f(i,function(a,b){var c=e.exec(b);if(c){var d=(c[1]?"-":"")+$d(c[2]);o[d]=h.attr(i.$attr[b])}}),f(o,function(a,c){q[c]=b(a.replace(d,u))}),g.$watch(l,function(b){var d=parseFloat(b),e=oe(d);if(e||d in o||(d=a.pluralCat(d-n)),!(d===k||e&&oe(k))){v();var f=q[d];t(f)?(null!=b&&c.debug("ngPluralize: no rule defined for '"+d+"' in "+m),v=p,j()):v=g.$watch(f,j),k=d}})}}}],$g=["$parse","$animate","$compile",function(a,b,c){var g=d("ngRepeat"),h=function(a,b,c,d,e,f,g){a[c]=d,e&&(a[e]=f),a.$index=b,a.$first=0===b,a.$last=b===g-1,a.$middle=!(a.$first||a.$last),a.$odd=!(a.$even=0==(1&b))},i=function(a){return a.clone[0]},j=function(a){return a.clone[a.clone.length-1]};return{restrict:"A",multiElement:!0,transclude:"element",priority:1e3,terminal:!0,$$tlb:!0,compile:function(d,k){var l=k.ngRepeat,m=c.$$createComment("end ngRepeat",l),n=l.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!n)throw g("iexp","Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",l);var o=n[1],p=n[2],q=n[3],r=n[4];if(!(n=o.match(/^(?:(\s*[$\w]+)|\(\s*([$\w]+)\s*,\s*([$\w]+)\s*\))$/)))throw g("iidexp","'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",o);var s=n[3]||n[1],t=n[2];if(q&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(q)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(q)))throw g("badident","alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.",q);var u,v,w,x,y={$id:db};return r?u=a(r):(w=function(a,b){return db(b)},x=function(a){return a}),function(a,c,d,k,n){u&&(v=function(b,c,d){return t&&(y[t]=b),y[s]=c,y.$index=d,u(a,y)});var o=sa();a.$watchCollection(p,function(d){var k,p,r,u,y,z,A,B,C,D,E,F,G=c[0],H=sa();if(q&&(a[q]=d),e(d))C=d,B=v||w;else{B=v||x,C=[];for(var I in d)Zd.call(d,I)&&"$"!==I.charAt(0)&&C.push(I)}for(u=C.length,E=new Array(u),k=0;k<u;k++)if(y=d===C?k:C[k],z=d[y],A=B(y,z,k),o[A])D=o[A],delete o[A],H[A]=D,E[k]=D;else{if(H[A])throw f(E,function(a){a&&a.scope&&(o[a.id]=a)}),g("dupes","Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}",l,A,z);E[k]={id:A,scope:void 0,clone:void 0},H[A]=!0}for(var J in o){if(D=o[J],F=ra(D.clone),b.leave(F),F[0].parentNode)for(k=0,p=F.length;k<p;k++)F[k].$$NG_REMOVED=!0;D.scope.$destroy()}for(k=0;k<u;k++)if(y=d===C?k:C[k],z=d[y],D=E[k],D.scope){r=G;do{r=r.nextSibling}while(r&&r.$$NG_REMOVED);i(D)!==r&&b.move(ra(D.clone),null,G),G=j(D),h(D.scope,k,s,z,t,y,u)}else n(function(a,c){D.scope=c;var d=m.cloneNode(!1);a[a.length++]=d,b.enter(a,null,G),G=d,D.clone=a,H[D.id]=D,h(D.scope,k,s,z,t,y,u)});o=H})}}}}],_g=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,c,d){b.$watch(d.ngShow,function(b){a[b?"removeClass":"addClass"](c,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],ah=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,c,d){b.$watch(d.ngHide,function(b){a[b?"addClass":"removeClass"](c,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],bh=rd(function(a,b,c){a.$watch(c.ngStyle,function(a,c){c&&a!==c&&f(c,function(a,c){b.css(c,"")}),a&&b.css(a)},!0)}),ch=["$animate","$compile",function(a,b){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(c,d,e,g){var h=e.ngSwitch||e.on,i=[],j=[],k=[],l=[],m=function(a,b){return function(c){!1!==c&&a.splice(b,1)}};c.$watch(h,function(c){for(var d,e;k.length;)a.cancel(k.pop());for(d=0,e=l.length;d<e;++d){var h=ra(j[d].clone);l[d].$destroy();(k[d]=a.leave(h)).done(m(k,d))}j.length=0,l.length=0,(i=g.cases["!"+c]||g.cases["?"])&&f(i,function(c){c.transclude(function(d,e){l.push(e);var f=c.element;d[d.length++]=b.$$createComment("end ngSwitchWhen");var g={clone:d};j.push(g),a.enter(d,f.parent(),f)})})})}}}],dh=rd({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,c,d,e){f(c.ngSwitchWhen.split(c.ngSwitchWhenSeparator).sort().filter(function(a,b,c){return c[b-1]!==a}),function(a){d.cases["!"+a]=d.cases["!"+a]||[],d.cases["!"+a].push({transclude:e,element:b})})}}),eh=rd({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,c,d,e){d.cases["?"]=d.cases["?"]||[],d.cases["?"].push({transclude:e,element:b})}}),fh=d("ngTransclude"),gh=["$compile",function(a){return{restrict:"EAC",terminal:!0,compile:function(b){var c=a(b.contents());return b.empty(),function(a,b,d,e,f){function g(a,c){a.length&&i(a)?b.append(a):(h(),c.$destroy())}function h(){c(a,function(a){b.append(a)})}function i(a){for(var b=0,c=a.length;b<c;b++){var d=a[b];if(d.nodeType!==Be||d.nodeValue.trim())return!0}}if(!f)throw fh("orphan","Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: {0}",ba(b));d.ngTransclude===d.$attr.ngTransclude&&(d.ngTransclude="");var j=d.ngTransclude||d.ngTranscludeSlot;f(g,null,j),j&&!f.isSlotFilled(j)&&h()}}}}],hh=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(b,c){if("text/ng-template"===c.type){var d=c.id,e=b[0].text;a.put(d,e)}}}}],ih={$setViewValue:p,$render:p},jh=["$element","$scope",function(b,c){function d(){h||(h=!0,c.$$postDigest(function(){h=!1,f.ngModelCtrl.$render()}))}function e(a){i||(i=!0,c.$$postDigest(function(){c.$$destroyed||(i=!1,f.ngModelCtrl.$setViewValue(f.readValue()),a&&f.ngModelCtrl.$render())}))}var f=this,g=new Xe;f.selectValueMap={},f.ngModelCtrl=ih,f.multiple=!1,f.unknownOption=de(a.document.createElement("option")),f.hasEmptyOption=!1,f.emptyOption=void 0,f.renderUnknownOption=function(a){var c=f.generateUnknownOptionValue(a);f.unknownOption.val(c),b.prepend(f.unknownOption),Vd(f.unknownOption,!0),b.val(c)},f.updateUnknownOption=function(a){var c=f.generateUnknownOptionValue(a);f.unknownOption.val(c),Vd(f.unknownOption,!0),b.val(c)},f.generateUnknownOptionValue=function(a){return"? "+db(a)+" ?"},f.removeUnknownOption=function(){f.unknownOption.parent()&&f.unknownOption.remove()},f.selectEmptyOption=function(){f.emptyOption&&(b.val(""),Vd(f.emptyOption,!0))},f.unselectEmptyOption=function(){f.hasEmptyOption&&Vd(f.emptyOption,!1)},c.$on("$destroy",function(){f.renderUnknownOption=p}),f.readValue=function(){var a=b.val(),c=a in f.selectValueMap?f.selectValueMap[a]:a;return f.hasOption(c)?c:null},f.writeValue=function(a){var c=b[0].options[b[0].selectedIndex];if(c&&Vd(de(c),!1),f.hasOption(a)){f.removeUnknownOption();var d=db(a);b.val(d in f.selectValueMap?d:a);var e=b[0].options[b[0].selectedIndex];Vd(de(e),!0)}else f.selectUnknownOrEmptyOption(a)},f.addOption=function(a,b){if(b[0].nodeType!==Ce){pa(a,'"option value"'),""===a&&(f.hasEmptyOption=!0,f.emptyOption=b);var c=g.get(a)||0;g.set(a,c+1),d()}},f.removeOption=function(a){var b=g.get(a);b&&(1===b?(g.delete(a),""===a&&(f.hasEmptyOption=!1,f.emptyOption=void 0)):g.set(a,b-1))},f.hasOption=function(a){return!!g.get(a)},f.$hasEmptyOption=function(){return f.hasEmptyOption},f.$isUnknownOptionSelected=function(){return b[0].options[0]===f.unknownOption[0]},f.$isEmptyOptionSelected=function(){return f.hasEmptyOption&&b[0].options[b[0].selectedIndex]===f.emptyOption[0]},f.selectUnknownOrEmptyOption=function(a){null==a&&f.emptyOption?(f.removeUnknownOption(),f.selectEmptyOption()):f.unknownOption.parent().length?f.updateUnknownOption(a):f.renderUnknownOption(a)};var h=!1,i=!1;f.registerOption=function(a,b,c,g,h){if(c.$attr.ngValue){var i,j=NaN;c.$observe("value",function(a){var c,d=b.prop("selected");u(j)&&(f.removeOption(i),delete f.selectValueMap[j],c=!0),j=db(a),i=a,f.selectValueMap[j]=a,f.addOption(a,b),b.attr("value",j),c&&d&&e()})}else g?c.$observe("value",function(a){f.readValue();var c,d=b.prop("selected");u(i)&&(f.removeOption(i),c=!0),i=a,f.addOption(a,b),c&&d&&e()}):h?a.$watch(h,function(a,d){c.$set("value",a);var g=b.prop("selected");d!==a&&f.removeOption(d),f.addOption(a,b),d&&g&&e()}):f.addOption(c.value,b);c.$observe("disabled",function(a){("true"===a||a&&b.prop("selected"))&&(f.multiple?e(!0):(f.ngModelCtrl.$setViewValue(null),f.ngModelCtrl.$render()))}),b.on("$destroy",function(){var a=f.readValue(),b=c.value;f.removeOption(b),d(),(f.multiple&&a&&-1!==a.indexOf(b)||a===b)&&e(!0)})}}],kh=function(){function a(a,b,c,d){var e=d[0],g=d[1];if(!g)return void(e.registerOption=p);if(e.ngModelCtrl=g,b.on("change",function(){e.removeUnknownOption(),a.$apply(function(){g.$setViewValue(e.readValue())})}),c.multiple){e.multiple=!0,e.readValue=function(){var a=[];return f(b.find("option"),function(b){if(b.selected&&!b.disabled){var c=b.value;a.push(c in e.selectValueMap?e.selectValueMap[c]:c)}}),a},e.writeValue=function(a){f(b.find("option"),function(b){var c=!!a&&(P(a,b.value)||P(a,e.selectValueMap[b.value]));c!==b.selected&&Vd(de(b),c)})};var h,i=NaN;a.$watch(function(){i!==g.$viewValue||T(h,g.$viewValue)||(h=va(g.$viewValue),g.$render()),i=g.$viewValue}),g.$isEmpty=function(a){return!a||0===a.length}}}function b(a,b,c,d){var e=d[1];if(e){var f=d[0];e.$render=function(){f.writeValue(e.$viewValue)}}}return{restrict:"E",require:["select","?ngModel"],controller:jh,priority:1,link:{pre:a,post:b}}},lh=["$interpolate",function(a){return{restrict:"E",priority:100,compile:function(b,c){var d,e;return u(c.ngValue)||(u(c.value)?d=a(c.value,!0):(e=a(b.text(),!0))||c.$set("value",b.text())),function(a,b,c){var f=b.parent(),g=f.data("$selectController")||f.parent().data("$selectController");g&&g.registerOption(a,b,c,d,e)}}}}],mh=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,c,d){d&&(c.required=!0,d.$validators.required=function(a,b){return!c.required||!d.$isEmpty(b)},c.$observe("required",function(){d.$validate()}))}}},nh=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,c,e){if(e){var f,g=c.ngPattern||c.pattern;c.$observe("pattern",function(a){if(x(a)&&a.length>0&&(a=new RegExp("^"+a+"$")),a&&!a.test)throw d("ngPattern")("noregexp","Expected {0} to be a RegExp but was {1}. Element: {2}",g,a,ba(b));f=a||void 0,e.$validate()}),e.$validators.pattern=function(a,b){return e.$isEmpty(b)||t(f)||f.test(b)}}}}},oh=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,c,d){if(d){var e=-1;c.$observe("maxlength",function(a){var b=n(a);e=oe(b)?-1:b,d.$validate()}),d.$validators.maxlength=function(a,b){return e<0||d.$isEmpty(b)||b.length<=e}}}}},ph=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,c,d){if(d){var e=0;c.$observe("minlength",function(a){e=n(a)||0,d.$validate()}),d.$validators.minlength=function(a,b){return d.$isEmpty(b)||b.length>=e}}}}};if(a.angular.bootstrap)return void(a.console&&console.log("WARNING: Tried to load angular more than once."));!function(){var b;if(!ze){var c=ue();ee=t(c)?a.jQuery:c?a[c]:void 0,ee&&ee.fn.on?(de=ee,l(ee.fn,{scope:Se.scope,isolateScope:Se.isolateScope,controller:Se.controller,injector:Se.injector,inheritedData:Se.inheritedData}),b=ee.cleanData,ee.cleanData=function(a){for(var c,d,e=0;null!=(d=a[e]);e++)(c=ee._data(d,"events"))&&c.$destroy&&ee(d).triggerHandler("$destroy");b(a)}):de=Ia,me.element=de,ze=!0}}(),function(c){l(c,{errorHandlingConfig:b,bootstrap:ja,copy:R,extend:l,merge:m,equals:T,element:de,forEach:f,injector:jb,noop:p,bind:W,toJson:Y,fromJson:Z,identity:q,isUndefined:t,isDefined:u,isString:x,isFunction:B,isObject:v,isNumber:y,isElement:M,isArray:pe,version:Fe,isDate:z,lowercase:$d,uppercase:_d,callbacks:{$$counter:0},getTestability:la,reloadWithDebugInfo:ka,$$minErr:d,$$csp:te,$$encodeUriSegment:fa,$$encodeUriQuery:ga,$$stringify:ta}),fe=ua(a),fe("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:Fc}),a.provider("$compile",ub).directive({a:ag,input:tg,textarea:tg,form:fg,script:hh,select:kh,option:lh,ngBind:wg,ngBindHtml:yg,ngBindTemplate:xg,ngClass:Ag,ngClassEven:Cg,ngClassOdd:Bg,ngCloak:Dg,ngController:Eg,ngForm:gg,ngHide:ah,ngIf:Hg,ngInclude:Ig,ngInit:Kg,ngNonBindable:Vg,ngPluralize:Zg,ngRepeat:$g,ngShow:_g,ngStyle:bh,ngSwitch:ch,ngSwitchWhen:dh,ngSwitchDefault:eh,ngOptions:Yg,ngTransclude:gh,ngModel:Sg,ngList:Lg,ngChange:zg,pattern:nh,ngPattern:nh,required:mh,ngRequired:mh,minlength:ph,ngMinlength:ph,maxlength:oh,ngMaxlength:oh,ngValue:vg,ngModelOptions:Ug}).directive({ngInclude:Jg}).directive(bg).directive(Fg),a.provider({$anchorScroll:kb,$animate:hf,$animateCss:lf,$$animateJs:ff,$$animateQueue:gf,$$AnimateRunner:kf,$$animateAsyncRun:jf,$browser:qb,$cacheFactory:rb,$controller:Ab,$document:Bb,$$isDocumentHidden:Cb,$exceptionHandler:Db,$filter:Uc,$$forceReflow:sf,$interpolate:Rb,$interval:Sb,$http:Nb,$httpParamSerializer:Fb,$httpParamSerializerJQLike:Gb,$httpBackend:Pb,$xhrFactory:Ob,$jsonpCallbacks:Af,$location:fc,$log:gc,$parse:wc,$rootScope:Ec,$q:xc,$$q:yc,$sce:Kc,$sceDelegate:Jc,$sniffer:Lc,$templateCache:sb,$templateRequest:Mc,$$testability:Nc,$timeout:Oc,$window:Rc,$$rAF:Dc,$$jqLite:cb,$$Map:Ye,$$cookieReader:Tc})}]).info({angularVersion:"1.6.6"})}(me),me.module("ngLocale",[],["$provide",function(a){function b(a){a+="";var b=a.indexOf(".");return-1==b?0:a.length-b-1}function c(a,c){var d=c;void 0===d&&(d=Math.min(b(a),3));var e=Math.pow(10,d);return{v:d,f:(a*e|0)%e}}var d={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:["January","February","March","April","May","June","July","August","September","October","November","December"],SHORTDAY:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],SHORTMONTH:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],STANDALONEMONTH:["January","February","March","April","May","June","July","August","September","October","November","December"],WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a",short:"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-¤",negSuf:"",posPre:"¤",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(a,b){var e=0|a,f=c(a,b);return 1==e&&0==f.v?d.ONE:d.OTHER}})}]),de(function(){ia(a.document,ja)})}(window),!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>'),function(){"use strict";angular.module("ng-slide-down",[]).directive("ngSlideDown",["$timeout",function(a){var b,c;return b=function(a,b){return void 0!==b.lazyRender?"<div ng-if='lazyRender' ng-transclude></div>":"<div ng-transclude></div>"},c=function(b,c,d,e,f){var g,h,i,j,k,l,m,n,o,p,q;return h=d.duration||1,q=d.timingFunction||"ease-in-out",i=c.scope(),j=d.emitOnClose,n=d.onClose,m=void 0!==d.lazyRender,g=null,o=null,k=function(a){var b,d,e,f,g;for(e=0,d=c.children(),f=0,g=d.length;f<g;f++)b=d[f],e+=b.clientHeight;return e+"px"},p=function(){return g&&a.cancel(g),m&&(b.lazyRender=!0),a(function(){return o&&a.cancel(o),c.css({overflow:"hidden",transitionProperty:"height",transitionDuration:h+"s",transitionTimingFunction:q,height:k()}),o=a(function(){return c.css({overflow:"visible",transition:"none",height:"auto"})},1e3*h)})},l=function(){if(o&&a.cancel(o),c.css({overflow:"hidden",transitionProperty:"height",transitionDuration:h+"s",transitionTimingFunction:q,height:"0px"}),j||n||m)return g=a(function(){if(j&&b.$emit(j,{}),n&&i.$eval(n),m)return b.lazyRender=!1},1e3*h)},b.$watch("expanded",function(b,d){return b?a(p):(null!=b&&(c.css({height:k()}),c[0].clientHeight),a(l))})},{restrict:"A",scope:{expanded:"=ngSlideDown"},transclude:!0,link:c,template:function(a,c){return b(a,c)}}}])}.call(this),function(a,b){"use strict";function c(a,b,c){if(!a)throw ia("areq","Argument '{0}' is {1}",b||"?",c||"required");return a}function d(a,b){return a||b?a?b?(U(a)&&(a=a.join(" ")),U(b)&&(b=b.join(" ")),a+" "+b):a:b:""}function e(a){var b={};return a&&(a.to||a.from)&&(b.to=a.to,b.from=a.from),b}function f(a,b,c){var d="";return a=U(a)?a:a&&Z(a)&&a.length?a.split(/\s+/):[],T(a,function(a,e){a&&a.length>0&&(d+=e>0?" ":"",d+=c?b+a:a+b)}),d}function g(a,b){var c=a.indexOf(b);b>=0&&a.splice(c,1)}function h(a){if(a instanceof _)switch(a.length){case 0:return a;case 1:if(a[0].nodeType===L)return a;break;default:return _(i(a))}if(a.nodeType===L)return _(a)}function i(a){if(!a[0])return a;for(var b=0;b<a.length;b++){var c=a[b];if(c.nodeType===L)return c}}function j(a,b,c){T(b,function(b){a.addClass(b,c)})}function k(a,b,c){T(b,function(b){a.removeClass(b,c)})}function l(a){return function(b,c){c.addClass&&(j(a,b,c.addClass),c.addClass=null),c.removeClass&&(k(a,b,c.removeClass),c.removeClass=null)}}function m(a){if(a=a||{},!a.$$prepared){var b=a.domOperation||aa;a.domOperation=function(){a.$$domOperationFired=!0,b(),b=aa},a.$$prepared=!0}return a}function n(a,b){o(a,b),p(a,b)}function o(a,b){b.from&&(a.css(b.from),b.from=null)}function p(a,b){b.to&&(a.css(b.to),b.to=null)}function q(a,b,c){var d=b.options||{},e=c.options||{},f=(d.addClass||"")+" "+(e.addClass||""),g=(d.removeClass||"")+" "+(e.removeClass||""),h=r(a.attr("class"),f,g);e.preparationClasses&&(d.preparationClasses=y(e.preparationClasses,d.preparationClasses),delete e.preparationClasses);var i=d.domOperation!==aa?d.domOperation:null;return S(d,e),i&&(d.domOperation=i),h.addClass?d.addClass=h.addClass:d.addClass=null,h.removeClass?d.removeClass=h.removeClass:d.removeClass=null,b.addClass=d.addClass,b.removeClass=d.removeClass,d}function r(a,b,c){function d(a){Z(a)&&(a=a.split(" "));var b={};return T(a,function(a){a.length&&(b[a]=!0)}),b}var e={};a=d(a),b=d(b),T(b,function(a,b){e[b]=1}),c=d(c),T(c,function(a,b){e[b]=1===e[b]?null:-1});var f={addClass:"",removeClass:""};return T(e,function(b,c){var d,e;1===b?(d="addClass",e=!a[c]||a[c+N]):-1===b&&(d="removeClass",e=a[c]||a[c+M]),e&&(f[d].length&&(f[d]+=" "),f[d]+=c)}),f}function s(a){return a instanceof _?a[0]:a}function t(a,b,c){var d="";b&&(d=f(b,O,!0)),c.addClass&&(d=y(d,f(c.addClass,M))),c.removeClass&&(d=y(d,f(c.removeClass,N))),d.length&&(c.preparationClasses=d,a.addClass(d))}function u(a,b){b.preparationClasses&&(a.removeClass(b.preparationClasses),b.preparationClasses=null),b.activeClasses&&(a.removeClass(b.activeClasses),b.activeClasses=null)}function v(a,b){var c=b?"-"+b+"s":"";return x(a,[ga,c]),[ga,c]}function w(a,b){var c=b?"paused":"",d=J+da;return x(a,[d,c]),[d,c]}function x(a,b){var c=b[0],d=b[1];a.style[c]=d}function y(a,b){return a?b?a+" "+b:a:b}function z(a){return[fa,a+"s"]}function A(a,b){return[b?ea:ga,a+"s"]}function B(a,b,c){var d=Object.create(null),e=a.getComputedStyle(b)||{};return T(c,function(a,b){var c=e[a];if(c){var f=c.charAt(0);("-"===f||"+"===f||f>=0)&&(c=C(c)),0===c&&(c=null),d[b]=c}}),d}function C(a){var b=0,c=a.split(/\s*,\s*/);return T(c,function(a){"s"===a.charAt(a.length-1)&&(a=a.substring(0,a.length-1)),a=parseFloat(a)||0,b=b?Math.max(a,b):a}),b}function D(a){return 0===a||null!=a}function E(a,b){var c=H,d=a+"s";return b?c+=ba:d+=" linear all",[c,d]}function F(){var a=Object.create(null);return{flush:function(){a=Object.create(null)},count:function(b){var c=a[b];return c?c.total:0},get:function(b){var c=a[b];return c&&c.value},put:function(b,c){a[b]?a[b].total++:a[b]={total:1,value:c}}}}function G(a,b,c){T(c,function(c){a[c]=V(a[c])?a[c]:b.style.getPropertyValue(c)})}var H,I,J,K,L=1,M="-add",N="-remove",O="ng-",P="ng-animate",Q="$$ngAnimateChildren";void 0===a.ontransitionend&&void 0!==a.onwebkittransitionend?("-webkit-",H="WebkitTransition",I="webkitTransitionEnd transitionend"):(H="transition",I="transitionend"),void 0===a.onanimationend&&void 0!==a.onwebkitanimationend?("-webkit-",J="WebkitAnimation",K="webkitAnimationEnd animationend"):(J="animation",K="animationend");var R,S,T,U,V,W,X,Y,Z,$,_,aa,ba="Duration",ca="TimingFunction",da="PlayState",ea=J+"Delay",fa=J+ba,ga=H+"Delay",ha=H+ba,ia=b.$$minErr("ng"),ja=["$$rAF",function(a){function b(a){d=d.concat(a),c()}function c(){if(d.length){for(var b=d.shift(),f=0;f<b.length;f++)b[f]();e||a(function(){e||c()})}}var d,e;return d=b.queue=[],b.waitUntilQuiet=function(b){e&&e(),e=a(function(){e=null,b(),c()})},b}],ka=["$interpolate",function(a){return{link:function(b,c,d){function e(a){a="on"===a||"true"===a,c.data(Q,a)}var f=d.ngAnimateChildren;Z(f)&&0===f.length?c.data(Q,!0):(e(a(f)(b)),d.$observe("ngAnimateChildren",e))}}}],la="$$animateCss",ma=1e3,na=3,oa=1.5,pa={transitionDuration:ha,transitionDelay:ga,transitionProperty:H+"Property",animationDuration:fa,animationDelay:ea,animationIterationCount:J+"IterationCount"},qa={transitionDuration:ha,transitionDelay:ga,animationDuration:fa,animationDelay:ea},ra=["$animateProvider",function(a){var b=F(),c=F();this.$get=["$window","$$jqLite","$$AnimateRunner","$timeout","$$forceReflow","$sniffer","$$rAFScheduler","$$animateQueue",function(a,d,h,i,j,k,q,r){function t(a,b){var c="$$ngAnimateParentKey",d=a.parentNode;return(d[c]||(d[c]=++P))+"-"+a.getAttribute("class")+"-"+b}function u(c,d,e,f){var g=b.get(e);return g||(g=B(a,c,f),"infinite"===g.animationIterationCount&&(g.animationIterationCount=1)),b.put(e,g),g}function y(e,g,h,i){var j;if(b.count(h)>0&&!(j=c.get(h))){var k=f(g,"-stagger");d.addClass(e,k),j=B(a,e,i),j.animationDuration=Math.max(j.animationDuration,0),j.transitionDuration=Math.max(j.transitionDuration,0),d.removeClass(e,k),c.put(h,j)}return j||{}}function C(a){Q.push(a),q.waitUntilQuiet(function(){b.flush(),c.flush();for(var a=j(),d=0;d<Q.length;d++)Q[d](a);Q.length=0})}function F(a,b,c){var d=u(a,b,c,pa),e=d.animationDelay,f=d.transitionDelay;return d.maxDelay=e&&f?Math.max(e,f):e||f,d.maxDuration=Math.max(d.animationDuration*d.animationIterationCount,d.transitionDuration),d}var L=l(d),P=0,Q=[];return function(a,c){function j(){q()}function l(){q(!0)}function q(b){if(!(X||Z&&Y)){X=!0,Y=!1,S.$$skipPreparationClasses||d.removeClass(a,ua),d.removeClass(a,wa),w(W,!1),v(W,!1),T(ha,function(a){W.style[a[0]]=""}),L(a,S),n(a,S),Object.keys(V).length&&T(V,function(a,b){a?W.style.setProperty(b,a):W.style.removeProperty(b)}),S.onDone&&S.onDone(),ka&&ka.length&&a.off(ka.join(" "),P);var c=a.data(la);c&&(i.cancel(c[0].timer),a.removeData(la)),$&&$.complete(!b)}}function u(a){Ja.blockTransition&&v(W,a),Ja.blockKeyframeAnimation&&w(W,!!a)}function B(){return $=new h({end:j,cancel:l}),C(aa),q(),{$$willAnimate:!1,start:function(){return $},end:j}}function P(a){a.stopPropagation();var b=a.originalEvent||a,c=b.$manualTimeStamp||Date.now(),d=parseFloat(b.elapsedTime.toFixed(na));Math.max(c-ga,0)>=da&&d>=ea&&(Z=!0,q())}function Q(){function b(){if(!X){if(u(!1),T(ha,function(a){var b=a[0],c=a[1];W.style[b]=c}),L(a,S),d.addClass(a,wa),Ja.recalculateTimingStyles){if(va=W.getAttribute("class")+" "+ua,ya=t(W,va),Ha=F(W,va,ya),Ia=Ha.maxDelay,ba=Math.max(Ia,0),0===(ea=Ha.maxDuration))return void q();Ja.hasTransitions=Ha.transitionDuration>0,Ja.hasAnimations=Ha.animationDuration>0}if(Ja.applyAnimationDelay&&(Ia="boolean"!=typeof S.delay&&D(S.delay)?parseFloat(S.delay):Ia,ba=Math.max(Ia,0),Ha.animationDelay=Ia,Ka=A(Ia,!0),ha.push(Ka),W.style[Ka[0]]=Ka[1]),da=ba*ma,fa=ea*ma,S.easing){var b,e=S.easing;Ja.hasTransitions&&(b=H+ca,ha.push([b,e]),W.style[b]=e),Ja.hasAnimations&&(b=J+ca,ha.push([b,e]),W.style[b]=e)}Ha.transitionDuration&&ka.push(I),Ha.animationDuration&&ka.push(K),ga=Date.now();var f=da+oa*fa,g=ga+f,h=a.data(la)||[],j=!0;if(h.length){var k=h[0];j=g>k.expectedEndTime,j?i.cancel(k.timer):h.push(q)}if(j){var l=i(c,f,!1);h[0]={timer:l,expectedEndTime:g},h.push(q),a.data(la,h)}ka.length&&a.on(ka.join(" "),P),S.to&&(S.cleanupStyles&&G(V,W,Object.keys(S.to)),p(a,S))}}function c(){var b=a.data(la);if(b){for(var c=1;c<b.length;c++)b[c]();a.removeData(la)}}if(!X){if(!W.parentNode)return void q();var e=function(a){if(Z)Y&&a&&(Y=!1,q());else if(Y=!a,Ha.animationDuration){var b=w(W,Y);Y?ha.push(b):g(ha,b)}},f=Fa>0&&(Ha.transitionDuration&&0===za.transitionDuration||Ha.animationDuration&&0===za.animationDuration)&&Math.max(za.animationDelay,za.transitionDelay);f?i(b,Math.floor(f*Fa*ma),!1):b(),_.resume=function(){e(!0)},_.pause=function(){e(!1)}}}var S=c||{};S.$$prepared||(S=m(R(S)));var V={},W=s(a);if(!W||!W.parentNode||!r.enabled())return B();var X,Y,Z,$,_,ba,da,ea,fa,ga,ha=[],ia=a.attr("class"),ja=e(S),ka=[];if(0===S.duration||!k.animations&&!k.transitions)return B();var pa=S.event&&U(S.event)?S.event.join(" "):S.event,ra=pa&&S.structural,sa="",ta="";ra?sa=f(pa,O,!0):pa&&(sa=pa),S.addClass&&(ta+=f(S.addClass,M)),S.removeClass&&(ta.length&&(ta+=" "),ta+=f(S.removeClass,N)),S.applyClassesEarly&&ta.length&&L(a,S);var ua=[sa,ta].join(" ").trim(),va=ia+" "+ua,wa=f(ua,"-active"),xa=ja.to&&Object.keys(ja.to).length>0;if(!((S.keyframeStyle||"").length>0||xa||ua))return B();var ya,za;if(S.stagger>0){var Aa=parseFloat(S.stagger);za={transitionDelay:Aa,animationDelay:Aa,transitionDuration:0,animationDuration:0}}else ya=t(W,va),za=y(W,ua,ya,qa);S.$$skipPreparationClasses||d.addClass(a,ua);var Ba;if(S.transitionStyle){var Ca=[H,S.transitionStyle];x(W,Ca),ha.push(Ca)}if(S.duration>=0){Ba=W.style[H].length>0;var Da=E(S.duration,Ba);x(W,Da),ha.push(Da)}if(S.keyframeStyle){var Ea=[J,S.keyframeStyle];x(W,Ea),ha.push(Ea)}var Fa=za?S.staggerIndex>=0?S.staggerIndex:b.count(ya):0,Ga=0===Fa;Ga&&!S.skipBlocking&&v(W,9999);var Ha=F(W,va,ya),Ia=Ha.maxDelay;ba=Math.max(Ia,0),ea=Ha.maxDuration;var Ja={};if(Ja.hasTransitions=Ha.transitionDuration>0,Ja.hasAnimations=Ha.animationDuration>0,Ja.hasTransitionAll=Ja.hasTransitions&&"all"===Ha.transitionProperty,Ja.applyTransitionDuration=xa&&(Ja.hasTransitions&&!Ja.hasTransitionAll||Ja.hasAnimations&&!Ja.hasTransitions),Ja.applyAnimationDuration=S.duration&&Ja.hasAnimations,Ja.applyTransitionDelay=D(S.delay)&&(Ja.applyTransitionDuration||Ja.hasTransitions),Ja.applyAnimationDelay=D(S.delay)&&Ja.hasAnimations,Ja.recalculateTimingStyles=ta.length>0,(Ja.applyTransitionDuration||Ja.applyAnimationDuration)&&(ea=S.duration?parseFloat(S.duration):ea,Ja.applyTransitionDuration&&(Ja.hasTransitions=!0,Ha.transitionDuration=ea,Ba=W.style[H+"Property"].length>0,ha.push(E(ea,Ba))),Ja.applyAnimationDuration&&(Ja.hasAnimations=!0,Ha.animationDuration=ea,ha.push(z(ea)))),0===ea&&!Ja.recalculateTimingStyles)return B();if(null!=S.delay){var Ka;"boolean"!=typeof S.delay&&(Ka=parseFloat(S.delay),ba=Math.max(Ka,0)),Ja.applyTransitionDelay&&ha.push(A(Ka)),Ja.applyAnimationDelay&&ha.push(A(Ka,!0))}return null==S.duration&&Ha.transitionDuration>0&&(Ja.recalculateTimingStyles=Ja.recalculateTimingStyles||Ga),da=ba*ma,fa=ea*ma,S.skipBlocking||(Ja.blockTransition=Ha.transitionDuration>0,Ja.blockKeyframeAnimation=Ha.animationDuration>0&&za.animationDelay>0&&0===za.animationDuration),S.from&&(S.cleanupStyles&&G(V,W,Object.keys(S.from)),o(a,S)),Ja.blockTransition||Ja.blockKeyframeAnimation?u(ea):S.skipBlocking||v(W,!1),{$$willAnimate:!0,end:j,start:function(){if(!X)return _={end:j,cancel:l,resume:null,pause:null},$=new h(_),C(Q),$}}}}]}],sa=["$$animationProvider",function(a){function b(a){return a.parentNode&&11===a.parentNode.nodeType}a.drivers.push("$$animateCssDriver");var c="ng-animate-shim",d="ng-anchor-out";this.$get=["$animateCss","$rootScope","$$AnimateRunner","$rootElement","$sniffer","$$jqLite","$document",function(a,e,f,g,h,i,j){function k(a){return a.replace(/\bng-\S+\b/g,"")}function l(a,b){return Z(a)&&(a=a.split(" ")),Z(b)&&(b=b.split(" ")),a.filter(function(a){return-1===b.indexOf(a)}).join(" ")}function m(b,e,g){function h(a){var b={},c=s(a).getBoundingClientRect();return T(["width","height","top","left"],function(a){var d=c[a];switch(a){case"top":d+=p.scrollTop;break;case"left":d+=p.scrollLeft}b[a]=Math.floor(d)+"px"}),b}function i(a){return a.attr("class")||""}function j(){var b=k(i(g)),c=l(b,o),e=l(o,b),f=a(n,{to:h(g),addClass:"ng-anchor-in "+c,removeClass:d+" "+e,delay:!0});return f.$$willAnimate?f:null}function m(){n.remove(),e.removeClass(c),g.removeClass(c)}var n=_(s(e).cloneNode(!0)),o=k(i(n));e.addClass(c),g.addClass(c),n.addClass("ng-anchor"),r.append(n);var q,t=function(){var b=a(n,{addClass:d,delay:!0,from:h(e)});return b.$$willAnimate?b:null}();if(!t&&!(q=j()))return m();var u=t||q;return{start:function(){function a(){c&&c.end()}var b,c=u.start();return c.done(function(){if(c=null,!q&&(q=j()))return c=q.start(),c.done(function(){c=null,m(),b.complete()}),c;m(),b.complete()}),b=new f({end:a,cancel:a})}}}function n(a,b,c,d){
7
- var e=o(a),g=o(b),h=[];if(T(d,function(a){var b=a.out,d=a.in,e=m(c,b,d);e&&h.push(e)}),e||g||0!==h.length)return{start:function(){function a(){T(b,function(a){a.end()})}var b=[];e&&b.push(e.start()),g&&b.push(g.start()),T(h,function(a){b.push(a.start())});var c=new f({end:a,cancel:a});return f.all(b,function(a){c.complete(a)}),c}}}function o(b){var c=b.element,d=b.options||{};b.structural&&(d.event=b.event,d.structural=!0,d.applyClassesEarly=!0,"leave"===b.event&&(d.onDone=d.domOperation)),d.preparationClasses&&(d.event=y(d.event,d.preparationClasses));var e=a(c,d);return e.$$willAnimate?e:null}if(!h.animations&&!h.transitions)return aa;var p=j[0].body,q=s(g),r=_(b(q)||p.contains(q)?q:p);return function(a){return a.from&&a.to?n(a.from,a.to,a.classes,a.anchors):o(a)}}]}],ta=["$animateProvider",function(a){this.$get=["$injector","$$AnimateRunner","$$jqLite",function(b,c,d){function e(c){c=U(c)?c:c.split(" ");for(var d=[],e={},f=0;f<c.length;f++){var g=c[f],h=a.$$registeredAnimations[g];h&&!e[g]&&(d.push(b.get(h)),e[g]=!0)}return d}var f=l(d);return function(a,b,d,g){function h(){g.domOperation(),f(a,g)}function i(){o=!0,h(),n(a,g)}function j(a,b,d,e,f){var g;switch(d){case"animate":g=[b,e.from,e.to,f];break;case"setClass":g=[b,r,s,f];break;case"addClass":g=[b,r,f];break;case"removeClass":g=[b,s,f];break;default:g=[b,f]}g.push(e);var h=a.apply(a,g);if(h)if(X(h.start)&&(h=h.start()),h instanceof c)h.done(f);else if(X(h))return h;return aa}function k(a,b,d,e,f){var g=[];return T(e,function(e){var h=e[f];h&&g.push(function(){var e,f,g=!1,i=function(a){g||(g=!0,(f||aa)(a),e.complete(!a))};return e=new c({end:function(){i()},cancel:function(){i(!0)}}),f=j(h,a,b,d,function(a){i(!1===a)}),e})}),g}function l(a,b,d,e,f){var g=k(a,b,d,e,f);if(0===g.length){var h,i;"beforeSetClass"===f?(h=k(a,"removeClass",d,e,"beforeRemoveClass"),i=k(a,"addClass",d,e,"beforeAddClass")):"setClass"===f&&(h=k(a,"removeClass",d,e,"removeClass"),i=k(a,"addClass",d,e,"addClass")),h&&(g=g.concat(h)),i&&(g=g.concat(i))}if(0!==g.length)return function(a){var b=[];return g.length&&T(g,function(a){b.push(a())}),b.length?c.all(b,a):a(),function(a){T(b,function(b){a?b.cancel():b.end()})}}}var o=!1;3===arguments.length&&Y(d)&&(g=d,d=null),g=m(g),d||(d=a.attr("class")||"",g.addClass&&(d+=" "+g.addClass),g.removeClass&&(d+=" "+g.removeClass));var p,q,r=g.addClass,s=g.removeClass,t=e(d);if(t.length){var u,v;"leave"===b?(v="leave",u="afterLeave"):(v="before"+b.charAt(0).toUpperCase()+b.substr(1),u=b),"enter"!==b&&"move"!==b&&(p=l(a,b,g,t,v)),q=l(a,b,g,t,u)}if(p||q){var w;return{$$willAnimate:!0,end:function(){return w?w.end():(i(),w=new c,w.complete(!0)),w},start:function(){function a(a){i(a),w.complete(a)}function b(b){o||((d||aa)(b),a(b))}if(w)return w;w=new c;var d,e=[];return p&&e.push(function(a){d=p(a)}),e.length?e.push(function(a){h(),a(!0)}):h(),q&&e.push(function(a){d=q(a)}),w.setHost({end:function(){b()},cancel:function(){b(!0)}}),c.chain(e,a),w}}}}}]}],ua=["$$animationProvider",function(a){a.drivers.push("$$animateJsDriver"),this.$get=["$$animateJs","$$AnimateRunner",function(a,b){function c(b){var c=b.element,d=b.event,e=b.options,f=b.classes;return a(c,d,f,e)}return function(a){if(a.from&&a.to){var d=c(a.from),e=c(a.to);if(!d&&!e)return;return{start:function(){function a(){return function(){T(f,function(a){a.end()})}}function c(a){g.complete(a)}var f=[];d&&f.push(d.start()),e&&f.push(e.start()),b.all(f,c);var g=new b({end:a(),cancel:a()});return g}}}return c(a)}}]}],va="data-ng-animate",wa="$ngAnimatePin",xa=["$animateProvider",function(b){function d(a){if(!a)return null;var b=a.split(o),c=Object.create(null);return T(b,function(a){c[a]=!0}),c}function e(a,b){if(a&&b){var c=d(b);return a.split(o).some(function(a){return c[a]})}}function f(a,b,c){return p[a].some(function(a){return a(b,c)})}function g(a,b){var c=(a.addClass||"").length>0,d=(a.removeClass||"").length>0;return b?c&&d:c||d}var j=1,k=2,o=" ",p=this.rules={skip:[],cancel:[],join:[]};p.join.push(function(a,b){return!a.structural&&g(a)}),p.skip.push(function(a,b){return!a.structural&&!g(a)}),p.skip.push(function(a,b){return"leave"===b.event&&a.structural}),p.skip.push(function(a,b){return b.structural&&b.state===k&&!a.structural}),p.cancel.push(function(a,b){return b.structural&&a.structural}),p.cancel.push(function(a,b){return b.state===k&&a.structural}),p.cancel.push(function(a,b){if(b.structural)return!1;var c=a.addClass,d=a.removeClass,f=b.addClass,g=b.removeClass;return!($(c)&&$(d)||$(f)&&$(g))&&(e(c,g)||e(d,f))}),this.$get=["$$rAF","$rootScope","$rootElement","$document","$$Map","$$animation","$$AnimateRunner","$templateRequest","$$jqLite","$$forceReflow","$$isDocumentHidden",function(d,e,o,p,r,v,w,x,y,z,A){function B(){var a=!1;return function(b){a?b():e.$$postDigest(function(){a=!0,b()})}}function C(a,b){return q(a,b,{})}function D(a,b,c){var d=[],e=X[c];return e&&T(e,function(e){ga.call(e.node,b)?d.push(e.callback):"leave"===c&&ga.call(e.node,a)&&d.push(e.callback)}),d}function E(a,b,c){var d=i(b);return a.filter(function(a){return!(a.node===d&&(!c||a.callback===c))})}function F(a,b){"close"!==a||b.parentNode||ha.off(b)}function G(a,b,c){function i(a,b,c,e){z(function(){var a=D(x,r,b);a.length?d(function(){T(a,function(a){a(p,c,e)}),F(c,r)}):F(c,r)}),a.progress(b,c,e)}function l(a){u(p,o),fa(p,o),n(p,o),o.domOperation(),y.complete(!a)}var o=R(c),p=h(a),r=s(p),x=r&&r.parentNode;o=m(o);var y=new w,z=B();if(U(o.addClass)&&(o.addClass=o.addClass.join(" ")),o.addClass&&!Z(o.addClass)&&(o.addClass=null),U(o.removeClass)&&(o.removeClass=o.removeClass.join(" ")),o.removeClass&&!Z(o.removeClass)&&(o.removeClass=null),o.from&&!Y(o.from)&&(o.from=null),o.to&&!Y(o.to)&&(o.to=null),!(O&&r&&da(r,b,c)&&ea(r,o)))return l(),y;var E=["enter","move","leave"].indexOf(b)>=0,G=A(),L=G||N.get(r),P=!L&&M.get(r)||{},Q=!!P.state;if(L||Q&&P.state===j||(L=!J(r,x,b)),L)return G&&i(y,b,"start"),l(),G&&i(y,b,"close"),y;E&&H(r);var S={structural:E,element:p,event:b,addClass:o.addClass,removeClass:o.removeClass,close:l,options:o,runner:y};if(Q){if(f("skip",S,P))return P.state===k?(l(),y):(q(p,P,S),P.runner);if(f("cancel",S,P))if(P.state===k)P.runner.end();else{if(!P.structural)return q(p,P,S),P.runner;P.close()}else{if(f("join",S,P)){if(P.state!==k)return t(p,E?b:null,o),b=S.event=P.event,o=q(p,P,S),P.runner;C(p,S)}}}else C(p,S);var V=S.structural;if(V||(V="animate"===S.event&&Object.keys(S.options.to||{}).length>0||g(S)),!V)return l(),I(r),y;var W=(P.counter||0)+1;return S.counter=W,K(r,j,S),e.$$postDigest(function(){p=h(a);var c=M.get(r),d=!c;c=c||{};var e=p.parent()||[],f=e.length>0&&("animate"===c.event||c.structural||g(c));if(d||c.counter!==W||!f)return d&&(fa(p,o),n(p,o)),(d||E&&c.event!==b)&&(o.domOperation(),y.end()),void(f||I(r));b=!c.structural&&g(c,!0)?"setClass":c.event,K(r,k);var j=v(p,b,c.options);y.setHost(j),i(y,b,"start",{}),j.done(function(a){l(!a);var c=M.get(r);c&&c.counter===W&&I(r),i(y,b,"close",{})})}),y}function H(a){var b=a.querySelectorAll("["+va+"]");T(b,function(a){var b=parseInt(a.getAttribute(va),10),c=M.get(a);if(c)switch(b){case k:c.runner.end();case j:M.delete(a)}})}function I(a){a.removeAttribute(va),M.delete(a)}function J(a,b,c){var d,e=p[0].body,f=s(o),g=a===e||"HTML"===a.nodeName,h=a===f,i=!1,j=N.get(a),k=_.data(a,wa);for(k&&(b=s(k));b&&(h||(h=b===f),b.nodeType===L);){var l=M.get(b)||{};if(!i){var m=N.get(b);if(!0===m&&!1!==j){j=!0;break}!1===m&&(j=!1),i=l.structural}if($(d)||!0===d){var n=_.data(b,Q);V(n)&&(d=n)}if(i&&!1===d)break;if(g||(g=b===e),g&&h)break;b=h||!(k=_.data(b,wa))?b.parentNode:s(k)}return(!i||d)&&!0!==j&&h&&g}function K(a,b,c){c=c||{},c.state=b,a.setAttribute(va,b);var d=M.get(a),e=d?S(d,c):c;M.set(a,e)}var M=new r,N=new r,O=null,P=e.$watch(function(){return 0===x.totalPendingRequests},function(a){a&&(P(),e.$$postDigest(function(){e.$$postDigest(function(){null===O&&(O=!0)})}))}),X=Object.create(null),aa=b.customFilter(),ba=b.classNameFilter(),ca=function(){return!0},da=aa||ca,ea=ba?function(a,b){var c=[a.getAttribute("class"),b.addClass,b.removeClass].join(" ");return ba.test(c)}:ca,fa=l(y),ga=a.Node.prototype.contains||function(a){return this===a||!!(16&this.compareDocumentPosition(a))},ha={on:function(a,b,c){var d=i(b);X[a]=X[a]||[],X[a].push({node:d,callback:c}),_(b).on("$destroy",function(){M.get(d)||ha.off(a,b,c)})},off:function(a,b,c){if(1!==arguments.length||Z(arguments[0])){var d=X[a];d&&(X[a]=1===arguments.length?null:E(d,b,c))}else{b=arguments[0];for(var e in X)X[e]=E(X[e],b)}},pin:function(a,b){c(W(a),"element","not an element"),c(W(b),"parentElement","not an element"),a.data(wa,b)},push:function(a,b,c,d){return c=c||{},c.domOperation=d,G(a,b,c)},enabled:function(a,b){var c=arguments.length;if(0===c)b=!!O;else{if(W(a)){var d=s(a);1===c?b=!N.get(d):N.set(d,!b)}else b=O=!!a}return b}};return ha}]}],ya=["$animateProvider",function(a){function b(a,b){a.data(h,b)}function c(a){a.removeData(h)}function e(a){return a.data(h)}var f="ng-animate-ref",g=this.drivers=[],h="$$animationRunner";this.$get=["$$jqLite","$rootScope","$injector","$$AnimateRunner","$$Map","$$rAFScheduler",function(a,h,i,j,k,o){function p(a){function b(a){if(a.processed)return a;a.processed=!0;var c=a.domNode,f=c.parentNode;e.set(c,a);for(var g;f;){if(g=e.get(f)){g.processed||(g=b(g));break}f=f.parentNode}return(g||d).children.push(a),a}var c,d={children:[]},e=new k;for(c=0;c<a.length;c++){var f=a[c];e.set(f.domNode,a[c]={domNode:f.domNode,fn:f.fn,children:[]})}for(c=0;c<a.length;c++)b(a[c]);return function(a){var b,c=[],d=[];for(b=0;b<a.children.length;b++)d.push(a.children[b]);var e=d.length,f=0,g=[];for(b=0;b<d.length;b++){var h=d[b];e<=0&&(e=f,f=0,c.push(g),g=[]),g.push(h.fn),h.children.forEach(function(a){f++,d.push(a)}),e--}return g.length&&c.push(g),c}(d)}var q=[],r=l(a);return function(k,l,t){function u(a){var b="["+f+"]",c=a.hasAttribute(f)?[a]:a.querySelectorAll(b),d=[];return T(c,function(a){var b=a.getAttribute(f);b&&b.length&&d.push(a)}),d}function v(a){var b=[],c={};T(a,function(a,d){var e=a.element,g=s(e),h=a.event,i=["enter","move"].indexOf(h)>=0,j=a.structural?u(g):[];if(j.length){var k=i?"to":"from";T(j,function(a){var b=a.getAttribute(f);c[b]=c[b]||{},c[b][k]={animationID:d,element:_(a)}})}else b.push(a)});var d={},e={};return T(c,function(c,f){var g=c.from,h=c.to;if(!g||!h){var i=g?g.animationID:h.animationID,j=i.toString();return void(d[j]||(d[j]=!0,b.push(a[i])))}var k=a[g.animationID],l=a[h.animationID],m=g.animationID.toString();if(!e[m]){var n=e[m]={structural:!0,beforeStart:function(){k.beforeStart(),l.beforeStart()},close:function(){k.close(),l.close()},classes:w(k.classes,l.classes),from:k,to:l,anchors:[]};n.classes.length?b.push(n):(b.push(k),b.push(l))}e[m].anchors.push({out:g.element,in:h.element})}),b}function w(a,b){a=a.split(" "),b=b.split(" ");for(var c=[],d=0;d<a.length;d++){var e=a[d];if("ng-"!==e.substring(0,3))for(var f=0;f<b.length;f++)if(e===b[f]){c.push(e);break}}return c.join(" ")}function x(a){for(var b=g.length-1;b>=0;b--){var c=g[b],d=i.get(c),e=d(a);if(e)return e}}function y(){k.addClass(P),F&&a.addClass(k,F),G&&(a.removeClass(k,G),G=null)}function z(a,b){function c(a){var c=e(a);c&&c.setHost(b)}a.from&&a.to?(c(a.from.element),c(a.to.element)):c(a.element)}function A(){var a=e(k);!a||"leave"===l&&t.$$domOperationFired||a.end()}function B(b){k.off("$destroy",A),c(k),r(k,t),n(k,t),t.domOperation(),F&&a.removeClass(k,F),k.removeClass(P),D.complete(!b)}t=m(t);var C=["enter","move","leave"].indexOf(l)>=0,D=new j({end:function(){B()},cancel:function(){B(!0)}});if(!g.length)return B(),D;b(k,D);var E=d(k.attr("class"),d(t.addClass,t.removeClass)),F=t.tempClasses;F&&(E+=" "+F,t.tempClasses=null);var G;return C&&(G="ng-"+l+"-prepare",a.addClass(k,G)),q.push({element:k,classes:E,event:l,structural:C,options:t,beforeStart:y,close:B}),k.on("$destroy",A),q.length>1?D:(h.$$postDigest(function(){var a=[];T(q,function(b){e(b.element)?a.push(b):b.close()}),q.length=0;var b=v(a),c=[];T(b,function(a){c.push({domNode:s(a.from?a.from.element:a.element),fn:function(){a.beforeStart();var b,c=a.close;if(e(a.anchors?a.from.element||a.to.element:a.element)){var d=x(a);d&&(b=d.start)}if(b){var f=b();f.done(function(a){c(!a)}),z(a,f)}else c()}})}),o(p(c))}),D)}}]}],za=["$animate","$rootScope",function(a,b){return{restrict:"A",transclude:"element",terminal:!0,priority:600,link:function(b,c,d,e,f){var g,h;b.$watchCollection(d.ngAnimateSwap||d.for,function(d){g&&a.leave(g),h&&(h.$destroy(),h=null),(d||0===d)&&(h=b.$new(),f(h,function(b){g=b,a.enter(b,null,c)}))})}}}];b.module("ngAnimate",[],function(){aa=b.noop,R=b.copy,S=b.extend,_=b.element,T=b.forEach,U=b.isArray,Z=b.isString,Y=b.isObject,$=b.isUndefined,V=b.isDefined,X=b.isFunction,W=b.isElement}).info({angularVersion:"1.6.6"}).directive("ngAnimateSwap",za).directive("ngAnimateChildren",ka).factory("$$rAFScheduler",ja).provider("$$animateQueue",xa).provider("$$animation",ya).provider("$animateCss",ra).provider("$$animateCssDriver",sa).provider("$$animateJs",ta).provider("$$animateJsDriver",ua)}(window,window.angular),function(a,b){"use strict";function c(){function c(a,b){var c,d={},e=a.split(",");for(c=0;c<e.length;c++)d[b?i(e[c]):e[c]]=!0;return d}function d(a,b){null===a||void 0===a?a="":"string"!=typeof a&&(a=""+a);var c=J(a);if(!c)return"";var d=5;do{if(0===d)throw n("uinput","Failed to sanitize html because the input is unstable");d--,a=c.innerHTML,c=J(a)}while(a!==c.innerHTML);for(var e=c.firstChild;e;){switch(e.nodeType){case 1:b.start(e.nodeName.toLowerCase(),o(e.attributes));break;case 3:b.chars(e.textContent)}var f;if(!((f=e.firstChild)||(1===e.nodeType&&b.end(e.nodeName.toLowerCase()),f=s("nextSibling",e))))for(;null==f&&(e=s("parentNode",e))!==c;)f=s("nextSibling",e),1===e.nodeType&&b.end(e.nodeName.toLowerCase());e=f}for(;e=c.firstChild;)c.removeChild(e)}function o(a){for(var b={},c=0,d=a.length;c<d;c++){var e=a[c];b[e.name]=e.value}return b}function p(a){return a.replace(/&/g,"&amp;").replace(u,function(a){return"&#"+(1024*(a.charCodeAt(0)-55296)+(a.charCodeAt(1)-56320)+65536)+";"}).replace(v,function(a){return"&#"+a.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function q(a,b){var c=!1,d=e(a,a.push);return{start:function(a,e){a=i(a),!c&&D[a]&&(c=a),c||!0!==E[a]||(d("<"),d(a),g(e,function(c,e){var f=i(e),g="img"===a&&"src"===f||"background"===f;!0!==I[f]||!0===F[f]&&!b(c,g)||(d(" "),d(e),d('="'),d(p(c)),d('"'))}),d(">"))},end:function(a){a=i(a),c||!0!==E[a]||!0===w[a]||(d("</"),d(a),d(">")),a==c&&(c=!1)},chars:function(a){c||d(p(a))}}}function r(b){for(;b;){if(b.nodeType===a.Node.ELEMENT_NODE)for(var c=b.attributes,d=0,e=c.length;d<e;d++){var f=c[d],g=f.name.toLowerCase();"xmlns:ns1"!==g&&0!==g.lastIndexOf("ns1:",0)||(b.removeAttributeNode(f),d--,e--)}var h=b.firstChild;h&&r(h),b=s("nextSibling",b)}}function s(a,b){var c=b[a];if(c&&k.call(b,c))throw n("elclob","Failed to sanitize html because the element is clobbered: {0}",b.outerHTML||b.outerText);return c}var t=!1;this.$get=["$$sanitizeUri",function(a){return t&&f(E,C),function(b){var c=[];return l(b,m(c,function(b,c){return!/^unsafe:/.test(a(b,c))})),c.join("")}}],this.enableSvg=function(a){return h(a)?(t=a,this):t},e=b.bind,f=b.extend,g=b.forEach,h=b.isDefined,i=b.lowercase,j=b.noop,l=d,m=q,k=a.Node.prototype.contains||function(a){return!!(16&this.compareDocumentPosition(a))};var u=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,v=/([^#-~ |!])/g,w=c("area,br,col,hr,img,wbr"),x=c("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),y=c("rp,rt"),z=f({},y,x),A=f({},x,c("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),B=f({},y,c("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),C=c("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),D=c("script,style"),E=f({},w,A,B,z),F=c("background,cite,href,longdesc,src,xlink:href"),G=c("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),H=c("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",!0),I=f({},F,H,G),J=function(a,b){function c(b){b="<remove></remove>"+b;try{b=encodeURI(b)}catch(a){return}var c=new a.XMLHttpRequest;c.responseType="document",c.open("GET","data:text/html;charset=utf-8,"+b,!1),c.send(null);var d=c.response.body;return d.firstChild.remove(),d}function d(b){b="<remove></remove>"+b;try{var c=(new a.DOMParser).parseFromString(b,"text/html").body;return c.firstChild.remove(),c}catch(a){return}}function e(a){return g.innerHTML=a,b.documentMode&&r(g),g}var f;if(!b||!b.implementation)throw n("noinert","Can't create an inert html document");f=b.implementation.createHTMLDocument("inert");var g=(f.documentElement||f.getDocumentElement()).querySelector("body");return g.innerHTML='<svg><g onload="this.parentNode.remove()"></g></svg>',g.querySelector("svg")?(g.innerHTML='<svg><p><style><img src="</style><img src=x onerror=alert(1)//">',g.querySelector("svg img")?d:e):c}(a,a.document)}function d(a){var b=[];return m(b,j).chars(a),b.join("")}var e,f,g,h,i,j,k,l,m,n=b.$$minErr("$sanitize");b.module("ngSanitize",[]).provider("$sanitize",c).info({angularVersion:"1.6.6"}),b.module("ngSanitize").filter("linky",["$sanitize",function(a){var c=/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,e=/^mailto:/i,f=b.$$minErr("linky"),g=b.isDefined,h=b.isFunction,i=b.isObject,j=b.isString;return function(b,k,l){function m(a){a&&s.push(d(a))}if(null==b||""===b)return b;if(!j(b))throw f("notstring","Expected string but received: {0}",b);for(var n,o,p,q=h(l)?l:i(l)?function(){return l}:function(){return{}},r=b,s=[];n=r.match(c);)o=n[0],n[2]||n[4]||(o=(n[3]?"http://":"mailto:")+o),p=n.index,m(r.substr(0,p)),function(a,b){var c,d=q(a);s.push("<a ");for(c in d)s.push(c+'="'+d[c]+'" ');!g(k)||"target"in d||s.push('target="',k,'" '),s.push('href="',a.replace(/"/g,"&quot;"),'">'),m(b),s.push("</a>")}(o,n[0].replace(e,"")),r=r.substring(p+n[0].length);return m(r),a(s.join(""))}}])}(window,window.angular),function(){function a(){return{restrict:"AEC",require:"dxStartWith",controller:"dxStartWithCtrl",scope:!0,terminal:!0,transclude:!0,multiElement:!0,$$tlb:!0,compile:function(a,b){var c=b.dxStartWith||b.root,e=c.match(d),f=e[1],g=e[3]||"";return function(a,b,c,d,e){d.alias=g,d.transclude=e,d.transclude(a,function(a,c){function d(a){c.$dxPrior=a,""!==g&&(c[g]=a)}b.append(a),c.$dxLevel=0,c.$dxIsRoot=!0,c.$watch(f,d)})}}}}function b(){return{restrict:"AEC",require:"^dxStartWith",scope:!0,terminal:!0,multiElement:!0,compile:function(a,b){var c=b.dxConnect||b.connect;return function(a,b,d,e){alias=e.alias||"",e.transclude(a,function(a,d){function e(a){d.$dxPrior=a,""!==alias&&(d[alias]=a)}b.append(a),d.$dxLevel=d.$dxLevel+1,d.$dxIsRoot=!1,d.$watch(c,e)})}}}}var c=angular.module("dotjem.angular.tree",[]),d=/^(\S+)(\s+as\s+(\w+))?$/;c.controller("dxStartWithCtrl",[function(){}]),c.directive("dxStartWith",a),c.directive("dxConnect",b)}(),function(){"use strict";function a(a,b,c){return{restrict:"A",link:function(d,e,f){c(function(){function g(a){var g,h,k,l,m,n;if(!angular.element(e).hasClass("ng-hide")&&a&&a.target){for(h=a.target;h;h=h.parentNode){if(h===e[0])return;if(l=h.id,m=h.className,n=j.length,m&&void 0!==m.baseVal&&(m=m.baseVal),m||l)for(g=0;g<n;g++)if(k=new RegExp("\\b"+j[g]+"\\b"),void 0!==l&&l===j[g]||m&&k.test(m))return}c(function(){(i=b(f.clickOutside))(d,{event:a})})}}function h(){return"ontouchstart"in window||navigator.maxTouchPoints}var i,j=void 0!==f.outsideIfNot?f.outsideIfNot.split(/[ ,]+/):[];h()&&a.on("touchstart",g),a.on("click",g),d.$on("$destroy",function(){h()&&a.off("touchstart",g),a.off("click",g)})})}}}angular.module("angular-click-outside",[]).directive("clickOutside",["$document","$parse","$timeout",a])}();var GoogleMerchants=angular.module("GoogleMerchants",["templates-dist","dotjem.angular.tree","ngSanitize","ngAnimate","ng-slide-down","angular-click-outside"]);GoogleMerchants.constant("BACKEND",ajaxurl+"?action=wpae_api&q="),GoogleMerchants.filter("safe",["$sce",function(a){return a.trustAsHtml}]),GoogleMerchants.controller("advancedAttributesController",["$scope","$log","attributesService",function(a,b,c){a.attributes=[],a.cats=[],a.attributes=c.getAttributes()}]),GoogleMerchants.directive("advancedAttributes",function(){return{restrict:"E",scope:{advancedAttributes:"=information"},templateUrl:"advancedAttributes/advancedAttributes.tpl.html",controller:"advancedAttributesController"}}),GoogleMerchants.controller("availabilityPriceController",["$scope","currencyService",function(a,b){a.currency=b.getCurrency()}]),GoogleMerchants.directive("availabilityPrice",function(){return{restrict:"E",scope:{availabilityPrice:"=information"},templateUrl:"availabilityPrice/availabilityPrice.tpl.html",controller:"availabilityPriceController"}}),GoogleMerchants.controller("basicInformationController",["$scope",function(a){}]),GoogleMerchants.directive("basicInformation",function(){return{restrict:"E",scope:{basicInformation:"=information"},templateUrl:"basicInformation/basicInformation.tpl.html",controller:"basicInformationController"}}),GoogleMerchants.directive("chosen",["$timeout",chosen]),GoogleMerchants.factory("attributesService",["$rootScope","$q","$log","wpHttp",function(a,b,c,d){var e=!1;return{setAttributes:function(a){e=a},getAttributes:function(){return e}}}]),GoogleMerchants.directive("autodetect",["attributesService",function(a){return{restrict:"A",require:"^ngModel",link:{post:function(b,c,d,e){var f=d.autodetect;d=a.getAttributes(),angular.forEach(d,function(a){a.label.toLowerCase()!=f.toLowerCase()&&a.name.toLowerCase()!=f.toLowerCase()||(e.$setViewValue("{"+a.name+"}"),e.$render())})}}}}]),GoogleMerchants.directive("cascade",[function(){return{restrict:"A",controller:["$scope",function(a){function b(c,d){var e,f;for(e=0;e<d.children.length;e+=1)f=d.children[e],a.mappings[f.id]=c,b(c,f);return!1}a.select=function(){console.log("Changing to ",a.mappings[a.node.id]),b(a.mappings[a.node.id],a.node)}}]}}]),GoogleMerchants.directive("contenteditable",["$sce",function(a){return{restrict:"A",require:"?ngModel",link:function(b,c,d,e){function f(){var a=c.html();d.stripBr&&"<br>"===a&&(a=""),e.$setViewValue(a)}e&&(e.$render=function(){c.html(a.getTrustedHtml(e.$viewValue||""))},c.on("blur keyup change",function(){b.$evalAsync(f)}),f())}}}]),GoogleMerchants.factory("currencyService",[function(){var a=null,b=null;return{setCurrency:function(c,d){a=c,b=d},getCurrency:function(){return a},getCurrencyCode:function(){return b}}}]),GoogleMerchants.directive("droppable",[function(){return{restrict:"A",require:"^ngModel",link:function(a,b,c,d){function e(a,b){return-1!==a.find("input[name^=cc_type]").val().indexOf("image_")&&(b="Image "+b),-1!==a.find("input[name^=cc_type]").val().indexOf("attachment_")&&(b="Attachment "+b),b}var f;f=angular.element(b),f.addClass("google-merchants-droppable"),f.droppable({drop:function(a,b){var c=b.draggable.find(".custom_column"),g=c.find("input[name^=cc_name]").val();g=e(c,g),f.val(f.val()+"{"+g+"}"),d.$setViewValue(f.val()),d.$render()}})}}}]),GoogleMerchants.factory("exportService",["$q","$log","wpHttp",function(a,b,c){return{getExport:function(d){var e=a.defer(),f="export/get";return null!==d&&(f=f+"&id="+d),c.get(f).then(function(a){e.resolve(a)},function(a,c){e.reject(a,c),b.error("There was a problem getting the export")}),e.promise},saveExport:function(d){var e=a.defer();return c.post("export/save",d).then(function(a){e.resolve(a)},function(a,c){e.reject(a),b.error(a,c)}),e.promise}}}]),GoogleMerchants.directive("focusMeWhenEnabled",function(a){return{priority:-1,link:function(b,c){b.$watch(function(){return b.$eval(c.attr("ng-disabled"))},function(b){0==b&&a(function(){c[0].focus()})})}}}),GoogleMerchants.factory("googleCategoriesService",["$rootScope","$q","$log","wpHttp",function(a,b,c,d){return{searchCategories:function(a){return d.get("googleCategories/get&parent=0"+a)},getChildCategories:function(a){return d.get("googleCategories/get&parent="+a)},categorySelected:function(b){a.$broadcast("wpae.category.selected",b)}}}]),GoogleMerchants.controller("mainController",["$scope","$rootScope","$timeout","$window","$document","$location","$log","templateService","exportService","currencyService","attributesService","wpHttp",function(a,b,c,d,e,f,g,h,i,j,k,l){function m(a,b){b||(b=window.location.href),a=a.replace(/[\[\]]/g,"\\$&");var c=new RegExp("[?&]"+a+"(=([^&#]*)|&|#|$)"),d=c.exec(b);return d?d[2]?decodeURIComponent(d[2].replace(/\+/g," ")):"":null}function n(){b.cats.children.length||(a.merchantsFeedData.productCategories.productCategories="customValue")}var o=[{mapFrom:"",mapTo:""}];a.cats=[],a.templateId=!1,a.merchantsFeedData={basicInformation:{open:!0,itemTitle:"productTitle",hasVariations:!0,useParentTitleForVariableProducts:!0,additionalImageLink:"productImages",itemDescription:"productDescription",itemImageLink:"useProductFeaturedImage",itemLink:"productLink",condition:"new",conditionMappings:angular.copy(o),userVariationDescriptionForVariableProducts:!0,addVariationAttributesToProductUrl:!0,useVariationImage:!0,useFeaturedImageIfThereIsNoVariationImage:!0,useParentDescirptionIfThereIsNoVariationDescirption:!0,useVariationDescriptionForVariableProducts:!0},detailedInformation:{open:!1,color:"selectFromWooCommerceProductAttributes",size:"selectFromWooCommerceProductAttributes",gender:"selectFromWooCommerceProductAttributes",setTheGroupId:"automatically",mappings:angular.copy(o),ageGroup:"selectFromWooCommerceProductAttributes",material:"selectFromWooCommerceProductAttributes",pattern:"selectFromWooCommerceProductAttributes",genderAutodetect:"keepBlank",sizeSystem:"",adjustPrice:!1,adjustSalePrice:!1,genderCats:{},ageGroupCats:{},sizeTypeMappings:angular.copy(o)},availabilityPrice:{open:!1,price:"useProductPrice",salePrice:"useProductSalePrice",availability:"useWooCommerceStockValues",adjustPriceValue:"",adjustPriceType:"%",adjustSalePriceType:"%",adjustSalePriceValue:"",currency:null},productCategories:{open:!1,productType:"useWooCommerceProductCategories",productCategories:"mapProductCategories",catMappings:{}},uniqueIdentifiers:{open:!1,identifierExists:1},shipping:{dimensions:"useWooCommerceProductValues",convertTo:"cm",adjustPriceType:"%",weight:"",shippingHeight:"",shippingLength:"",shippingWidth:""},template:{save:!1,name:""},advancedAttributes:{adult:"no",unitPricingBaseMeasureUnit:"kg",excludedDestination:"no",customLabel0Mappings:angular.copy(o),customLabel1Mappings:angular.copy(o),customLabel2Mappings:angular.copy(o),customLabel3Mappings:angular.copy(o),customLabel4Mappings:angular.copy(o),energyEfficiencyClassMappings:angular.copy(o),promotionIdMappings:angular.copy(o)}},a.init=function(b,c,d){k.setAttributes(wpae_product_attributes),a.isGoogleMerchantExport=!1,j.setCurrency(b,c),a.templateId=d},a.selectGoogleMerchantsInitially=function(){a.selectGoogleMerchants()},a.selectGoogleMerchants=function(){jQuery(".wpallexport-element-label").parent().parent().slideUp(),a.isGoogleMerchantExport=!0;var c=m("id");i.getExport(c).then(function(b){angular.isObject(b)&&(b.template={save:!1,name:""},a.merchantsFeedData=b)}),a.templateId&&(console.log("Loading template with id "+a.templateId),h.getTemplate(a.templateId).then(function(b){a.merchantsFeedData=b.google_merchants_post_data})),l.get("categories/index").then(function(a){b.cats=a,console.log("Broadcasting loaded categories..."),b.$broadcast("categories.loaded"),n()},function(){g.error("There was a problem loading the WordPress categories")}),null==a.merchantsFeedData.availabilityPrice.currency&&(a.merchantsFeedData.availabilityPrice.currency=j.getCurrencyCode())},a.$on("googleMerchantsSelected",function(b,d){a.selectGoogleMerchants(),a.merchantsFeedData.basicInformation.hasVariations=d,jQuery(".wpallexport-element-label").parent().parent().slideUp(),c(function(){a.isGoogleMerchantExport=!0})}),a.$on("googleMerchantsDeselected",function(){jQuery(".wpallexport-element-label").parent().parent().slideDown(),c(function(){a.isGoogleMerchantExport=!1})}),a.$on("googleMerchantsSubmitted",function(b,c){a.merchantsFeedData.template.name=c.templateName,a.process()}),a.$on("templateShouldBeSaved",function(b,c){a.merchantsFeedData.template.save=!0,a.merchantsFeedData.template.name=c}),a.$on("templateShouldNotBeSaved",function(){a.merchantsFeedData.template.save=!1}),a.$on("selectedTemplate",function(b,c){h.getTemplate(c).then(function(b){a.merchantsFeedData=b.google_merchants_post_data})}),a.process=function(){a.merchantsFeedData.extraData=jQuery("#templateForm").serialize(),a.merchantsFeedData.filteringData=jQuery("input[name=filter_rules_hierarhy]").val(),a.merchantsFeedData.template.save=jQuery("#save_template_as").prop("checked");var b=m("id");b&&(a.merchantsFeedData.exportId=b,a.merchantsFeedData.update=!0),i.saveExport(a.merchantsFeedData).then(function(a){a.redirect?d.location.href=a.redirect:d.location.href="admin.php?page=pmxe-admin-export&action=options"})}}]),GoogleMerchants.controller("mappingController",["$scope",function(a){a.show=!1,a.mappingsBackup=null,a.removeMapping=function(b){a.mappings.length>1&&a.mappings.splice(a.mappings.indexOf(b),1)},a.$watch("show",function(b){b&&(a.mappingsBackup=a.mappings)}),a.addMapping=function(){a.mappings.push({})},a.close=function(){a.mappings=a.mappingsBackup,a.show=!1},a.saveMappings=function(){a.show=!1}}]),GoogleMerchants.directive("mapping",function(){return{restrict:"E",scope:{mappings:"=",show:"=",context:"=",tooltip:"@"},templateUrl:"common/mapping/mapping.tpl.html",controller:"mappingController"}}),GoogleMerchants.directive("styledInput",function(a){return{priority:-1,scope:{placeholder:"=",ngModel:"="},template:'<div class="editable" contenteditable="true" ng-model="ngModel" placeholder="{{placeholder}}"></div>',link:function(a,b){b.bind("keydown",function(a){return(!a.ctrlKey&&!a.metaKey||65==a.which||88==a.which||67==a.which||86==a.which)&&(13!=a.which&&void 0)})}}}),GoogleMerchants.factory("templateService",["$q","$log","wpHttp",function(a,b,c){return{getTemplate:function(d){var e=a.defer();return c.get("templates/get&templateId="+d).then(function(a){e.resolve(a)},function(a,c){e.reject(a,c),b.error("There was a problem getting the export")}),e.promise}}}]),
8
- GoogleMerchants.directive("tipsy",["$document",function(a){return{restrict:"A",link:function(b,c,d){c.attr("original-title",d.tipsy),c.tipsy({gravity:function(){var b="n";a.scrollTop()<c.offset().top-angular.element(".tipsy").height()-2&&(b="s");var d="";return c.offset().left+angular.element(".tipsy").width()<a.width()+a.scrollLeft()?d="w":c.offset().left-angular.element(".tipsy").width()>a.scrollLeft()&&(d="e"),b+d},live:!0,html:!0,opacity:1})}}}]),GoogleMerchants.factory("wpHttp",["$http","$q","$log","BACKEND","NONCE",function(a,b,c,d,e){return{post:function(c,f){var g=b.defer();return a.post(d+c+"&security="+e,f).then(function(a){g.resolve(a.data)},function(a,b){g.reject(a,b)}),g.promise},get:function(c){var f=b.defer();return a.get(d+c+"&security="+e).then(function(a){f.resolve(a.data)},function(a,b){f.reject(a,b)}),f.promise}}}]),GoogleMerchants.controller("detailedInformationController",["$scope","$log","attributesService",function(a,b,c){a.attributes=[],a.cats=[],a.attributes=c.getAttributes()}]),GoogleMerchants.directive("detailedInformation",function(){return{restrict:"E",scope:{detailedInformation:"=information"},templateUrl:"detailedInformation/detailedInformation.tpl.html",controller:"detailedInformationController"}}),GoogleMerchants.controller("categoryMapperController",["$scope","$rootScope","$interval","$timeout",function(a,b,c,d){a.dialogVisible=!0,a.selectedCategory="",a.selectedCategoryId=0,a.parentWidth=!1,a.siteCats=[],a.initialized=!1,a.innerMapping=!1,a.limits=100,a.catMappings=[],b.$on("categories.loaded",function(){a.innerMapping=b.cats}),a.innerMapping=b.cats,a.initialize=function(){a.initialized||(d(function(){c(function(){a.limits<a.innerMapping.length&&(a.limits+=20)},10)},100),a.initialized=!0,a.afterInitialize())},a.afterInitialize=function(){angular.forEach(a.cats,function(a,b){})},angular.isUndefined(a.context)&&(a.context="categories"),a.expandNode=function(a){a.children.length&&(a.expanded=!a.expanded)},a.getTimes=function(a){return new Array(a)},a.toggleDialog=function(){a.dialogVisible=!a.dialogVisible},a.getPlaceholder=function(){return a.visible?"":"Select Google Product Category"}}]),GoogleMerchants.directive("categoryMapper",function(){return{restrict:"E",scope:{mappings:"=",grey:"=",context:"@?"},templateUrl:"productCategories/categoryMapper/categoryMapper.tpl.html",controller:"categoryMapperController"}}),GoogleMerchants.controller("googleCategorySelectorController",["$scope","$log","$window","googleCategoriesService",function(a,b,c,d){function e(b,c,d){var f,g;for(f=0;f<d.children.length;f+=1){if(g=d.children[f],angular.isDefined(a.mappings[g.id])){if(!a.mappings[g.id].byUser){var h={id:b,name:c,byUser:!1};a.mappings[g.id]=h}}else a.mappings[g.id]={id:b,name:c,byUser:!1};e(b,c,g)}return!1}var f=[];a.categories=[],a.level=1,a.search="",a.loading=!1,a.hasResults=!0,a.byUser=!1,a.select=function(b){var c=b.name.replace("<strong>","").replace("</strong>","").replace("<b>","").replace("</b>","");a.visible=!1,a.selectedCategory=c,a.mappings[a.node.id]={id:b.id,name:c,byUser:!0},e(b.id,c,a.node)},a.loadCategories=function(b){a.loading=!0;var c="";b&&(c="&search="+b),d.searchCategories(c).then(function(b){a.categories=b}).finally(function(){a.loading=!1})},a.expand=function(c){if(c.opened)return void(c.opened=!1);a.loading=!0,d.getChildCategories(c.id).then(function(a){"null"!=a&&(c.children=a,c.opened=!0)},function(){b.error("There was a problem loading the categories")}).finally(function(){a.loading=!1})},a.matchSearch=function(a){return function(b){return b.name===a.name}},a.$watch("search",function(b,c){if(""==c&&(f=a.categories),""==b)return void(a.categories=f);a.loadCategories(b)},!0),a.categoryChanged=function(){a.loadCategories(a.selectedCategory)},a.categoryClicked=function(){a.selectedCategory;a.visible||(a.visible=!0),a.byUser||(a.selectedCategory=""),a.search="",a.categoryChanged()},a.closeMe=function(){a.visible&&(a.visible=!1)}}]),GoogleMerchants.directive("googleCategorySelector",["$rootScope",function(a){return{restrict:"E",templateUrl:"productCategories/googleCategorySelector/googleCategorySelector.tpl.html",controller:"googleCategorySelectorController"}}]),GoogleMerchants.controller("productCategoriesController",["$scope",function(a){}]),GoogleMerchants.directive("productCategories",function(){return{restrict:"E",scope:{productCategories:"=information"},templateUrl:"productCategories/productCategories.tpl.html",controller:"productCategoriesController"}}),GoogleMerchants.controller("shippingController",["$scope","currencyService",function(a,b){a.currency=b.getCurrency()}]),GoogleMerchants.directive("shipping",function(){return{restrict:"E",scope:{shipping:"=information"},templateUrl:"shipping/shipping.tpl.html",controller:"shippingController"}}),GoogleMerchants.controller("uniqueIdentifiersController",["$scope",function(a){}]),GoogleMerchants.directive("uniqueIdentifiers",function(){return{restrict:"E",scope:{uniqueIdentifiers:"=information"},templateUrl:"uniqueIdentifiers/uniqueIdentifiers.tpl.html",controller:"uniqueIdentifiersController"}}),angular.module("templates-dist",["advancedAttributes/advancedAttributes.tpl.html","availabilityPrice/availabilityPrice.tpl.html","basicInformation/basicInformation.tpl.html","common/mapping/mapping.tpl.html","detailedInformation/detailedInformation.tpl.html","productCategories/categoryMapper/categoryMapper.tpl.html","productCategories/categoryMapper/noCategoriesNotice.tpl.html","productCategories/googleCategorySelector/googleCategorySelector.tpl.html","productCategories/productCategories.tpl.html","shipping/shipping.tpl.html","uniqueIdentifiers/uniqueIdentifiers.tpl.html"]),angular.module("advancedAttributes/advancedAttributes.tpl.html",[]).run(["$templateCache",function(a){a.put("advancedAttributes/advancedAttributes.tpl.html",'<div class="wpallexport-collapsed wpallexport-section" ng-class="{closed: !advancedAttributes.open }">\n <div class="wpallexport-content-section">\n <div class="wpallexport-collapsed-header disable-jquery"\n ng-click="advancedAttributes.open = !advancedAttributes.open">\n <h3>Advanced Attributes</h3>\n </div>\n <div class="wpallexport-collapsed-content" id="advanced-attributes"\n ng-slide-down="advancedAttributes.open" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n <h3 class="inner-title">Product Type</h3>\n <h4>Multipack</h4>\n <p>\n Multipacks are packages that include several identical products to create a larger unit of sale,\n submitted as a single item.\n For example, if the product for sale is a 6-pack of soda, the multipack value would be 6.\n </p>\n <div class="input">\n <label><input type="text" ng-model="advancedAttributes.multipack" class="wpae-default-input" droppable/></label>\n </div>\n\n <h4>Adult</h4>\n <div class="input">\n <label><input type="radio" ng-model="advancedAttributes.adult" value="no"/>False</label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="advancedAttributes.adult" value="yes"/>True</label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="advancedAttributes.adult" value="customValue"/>Custom data</label>\n <div ng-slide-down="advancedAttributes.adult == \'customValue\'" duration="0.2" class="input inner">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.adultCV" droppable />\n </div>\n </div>\n\n <h3 class="inner-title">Adwords &amp; Shopping Campaigns</h3>\n <h4>Adwords Redirect</h4>\n <p>If provided, make sure that the URL redirects to the same URL as given in the \'link\' attribute.</p>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.adwordsRedirect" droppable />\n </div>\n\n <h4>Custom Labels</h4>\n <p>\n You can use custom labels to subdivide products in your campaign using any values\n of your choosing. For example, you can use custom labels to indicate that products\n are seasonal, on clearance, best sellers, etc. (<a href="https://support.google.com/adwords/answer/6275295" target="_blank">Learn more about how to set up Shopping campaigns.</a>)\n </p>\n <div style="margin-top:10px;">Custom Label 0</div>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.customLabel0" droppable />\n <a href="" class="wpae-field-mapping" ng-click="showCustomLabel0Mappings=true">Data Mapping</a>\n <div style="position: relative">\n <mapping mappings="advancedAttributes.customLabel0Mappings" show="showCustomLabel0Mappings" context="text" tooltip="For example, if you have products tagged \'reduced price\' and \'on sale\' and you want both to be listed as \'clearance\' in your export:<br/><br/>Create two sets of data mappings, with \'Exported Data\' set to \'reduced price\' for one and \'on sale\' for the other. \'Translated To\' for both would be \'clearance\'." />\n </div>\n </div>\n <div style="margin-top:10px;">Custom Label 1</div>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.customLabel1" droppable />\n <a href="" class="wpae-field-mapping" ng-click="showCustomLabel1Mappings=true">Data Mapping</a>\n <div style="position: relative">\n <mapping mappings="advancedAttributes.customLabel1Mappings" show="showCustomLabel1Mappings" context="text" tooltip="For example, if you have products tagged \'reduced price\' and \'on sale\' and you want both to be listed as \'clearance\' in your export:<br/><br/>Create two sets of data mappings, with \'Exported Data\' set to \'reduced price\' for one and \'on sale\' for the other. \'Translated To\' for both would be \'clearance\'." />\n </div>\n </div>\n <div style="margin-top:10px;">Custom Label 2</div>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.customLabel2" droppable />\n <a href="" class="wpae-field-mapping" ng-click="showCustomLabel2Mappings=true">Data Mapping</a>\n <div style="position: relative">\n <mapping mappings="advancedAttributes.customLabel2Mappings" show="showCustomLabel2Mappings" context="text" tooltip="For example, if you have products tagged \'reduced price\' and \'on sale\' and you want both to be listed as \'clearance\' in your export:<br/><br/>Create two sets of data mappings, with \'Exported Data\' set to \'reduced price\' for one and \'on sale\' for the other. \'Translated To\' for both would be \'clearance\'." />\n </div>\n </div>\n <div style="margin-top:10px;">Custom Label 3</div>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.customLabel3" droppable />\n <a href="" class="wpae-field-mapping" ng-click="showCustomLabel3Mappings=true">Data Mapping</a>\n <div style="position: relative">\n <mapping mappings="advancedAttributes.customLabel3Mappings" show="showCustomLabel3Mappings" context="text" tooltip="For example, if you have products tagged \'reduced price\' and \'on sale\' and you want both to be listed as \'clearance\' in your export:<br/><br/>Create two sets of data mappings, with \'Exported Data\' set to \'reduced price\' for one and \'on sale\' for the other. \'Translated To\' for both would be \'clearance\'." />\n </div>\n </div>\n <div style="margin-top:10px;">Custom Label 4</div>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.customLabel4" droppable />\n <a href="" class="wpae-field-mapping" ng-click="showCustomLabel4Mappings=true">Data Mapping</a>\n <div style="position: relative">\n <mapping mappings="advancedAttributes.customLabel4Mappings" show="showCustomLabel4Mappings" context="text" tooltip="For example, if you have products tagged \'reduced price\' and \'on sale\' and you want both to be listed as \'clearance\' in your export:<br/><br/>Create two sets of data mappings, with \'Exported Data\' set to \'reduced price\' for one and \'on sale\' for the other. \'Translated To\' for both would be \'clearance\'." />\n </div>\n </div>\n\n <hr/>\n\n <h3 class="inner-title">Unit Prices</h3>\n <p>\n These attributes allow you to submit pricing for products that rely on unit pricing.\n The \'unit pricing measure\' attribute defines the measure and dimension of an item (e.g. 150g).\n The \'unit pricing base measure attribute specifies your preference of the denominator of the unit price (e.g. 100g).\n </p>\n <p>\n For example, if the \'price\' is 3 USD, \'unit pricing measure\' is 150g and \'unit pricing base measure\' is 100g, the unit price would be \'2 USD/200g\'.\n </p>\n\n <h4>Unit Pricing Measure</h4>\n <div class="input">\n <input type="text" ng-model="advancedAttributes.unitPricingMeasure" class="wpae-default-input" droppable />\n </div>\n <h4>Unit Pricing Base Measure</h4>\n <div class="input">\n <input type="text" ng-model="advancedAttributes.unitPricingBaseMeasure" class="wpae-default-input" droppable />\n <select style="width: 170px;" ng-model="advancedAttributes.unitPricingBaseMeasureUnit">\n <option value="kg">Kilograms (kg)</option>\n <option value="g">Ounces (oz)</option>\n <option value="lb">Pounds (lb)</option>\n <option value="mg">Milligrams (mg)</option>\n <option value="g">Grams (g)</option>\n </select>\n </div>\n <hr/>\n <h3 class="inner-title">Additional Attributes</h3>\n <h4>Expiration Date</h4>\n <p>\n This is the date that an item listing will expire. If you do not provide this attribute, items\n will expire and no longer appear in Google Shopping results after 30 days.\n <strong>You cannot use thi attribute to extend the expiration period to longer than 30 days.</strong>\n </p>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.expirationDate" droppable />\n </div>\n\n <h4>Energy Efficiency Class</h4>\n <p>\n This attribute allows you to submit the energy label for your applicable products in feeds targeting\n European Union countries and switzerland.\n </p>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.energyEfficiencyClass" droppable />\n <a href="" class="wpae-field-mapping" ng-click="showEnergyEfficiencyMappings=true">Data Mapping</a>\n <div style="position: relative">\n <mapping mappings="advancedAttributes.energyEfficiencyClassMappings" show="showEnergyEfficiencyMappings" tooltip="For example, if you have products tagged \'energy efficient\' and \'low power\' and you want both to be listed as \'A+++\' in your export:\n<br/><br/>\nCreate two sets of data mappings, with \'Exported Data\' set to \'energy efficient\' for one and \'low power\' for the other. \'Translated To\' for both would be \'A+++\'." />\n </div>\n </div>\n <h4>Promotion ID</h4>\n <p>\n If using Merchant Promotions, the \'promotion id\' attribute is used in both your products\n feed and your promotions feed to match products to promotions across the two feeds.\n </p>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.promotionId" droppable />\n <a href="" class="wpae-field-mapping" ng-click="showPromotionIdMappings=true">Data Mapping</a>\n <div style="position: relative">\n <mapping mappings="advancedAttributes.promotionIdMappings" show="showPromotionIdMappings" tooltip="For example, if your products are tagged \'reduced price\' and \'on sale\' and you want both to be listed with a specific promotion ID in your export:\n<br/><br/>\n'+"Create two sets of data mappings, with 'Exported Data' set to 'reduced price' for one and 'on sale' for the other. 'Translated To' for both would be the desired promotion ID.\" />\n </div>\n </div>\n\n </div>\n </div>\n </div>\n</div>")}]),angular.module("availabilityPrice/availabilityPrice.tpl.html",[]).run(["$templateCache",function(a){a.put("availabilityPrice/availabilityPrice.tpl.html",'<div class="wpallexport-collapsed wpallexport-section" ng-class="{closed: !availabilityPrice.open}">\n <div class="wpallexport-content-section">\n <div class="wpallexport-collapsed-header disable-jquery" ng-click="availabilityPrice.open = !availabilityPrice.open">\n <h3>Availability &amp; Price</h3>\n </div>\n <div class="wpallexport-collapsed-content" id="availability-price" ng-slide-down="availabilityPrice.open" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n <h4>Price</h4>\n <div class="input">\n <label><input type="radio" ng-model="availabilityPrice.price" value="useProductPrice" /> Use the product\'s price</label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="availabilityPrice.price" value="customValue" /> Custom data</label>\n\n <div class="input inner" ng-slide-down="availabilityPrice.price == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="availabilityPrice.priceCV" droppable />\n </div>\n </div>\n\n <div class="input inner">\n <a href="" ng-click="availabilityPrice.adjustPrice = !availabilityPrice.adjustPrice" class="adjust-price-link">\n <span class="open-indicator" ng-if="availabilityPrice.adjustPrice">-</span>\n <span class="open-indicator" ng-if="!availabilityPrice.adjustPrice">+</span> Adjust Price\n </a>\n <div ng-slide-down="availabilityPrice.adjustPrice" class="adjust-price" duration="0.2">\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="availabilityPrice.adjustPriceValue" droppable /><select ng-model="availabilityPrice.adjustPriceType">\n <option value="%">%</option>\n <option value="USD">{{currency}}</option>\n </select>\n\n <div ng-show="availabilityPrice.adjustPriceType == \'%\'" class="tooltip-container">\n <a href="#" ng-cloak="" class="wpallexport-help"\n tipsy="Leave blank or enter in 100% to keep the price as is. Enter in 110% to markup by 10%. Enter in 50% to cut prices in half.">?</a>\n </div>\n <div ng-show="availabilityPrice.adjustPriceType == \'USD\'" class="tooltip-container">\n <a href="#" ng-cloak="" class="wpallexport-help"\n tipsy="Enter a negative number to reduce prices.">?</a>\n </div>\n </div>\n </div>\n </div>\n <h4>Sale Price</h4>\n <div class="input">\n <label><input type="radio" ng-model="availabilityPrice.salePrice" value="useProductSalePrice"/>Use the product\'s sale price</label>\n </div>\n <div class="input">\n <div class="input">\n <label><input type="radio" ng-model="availabilityPrice.salePrice" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="availabilityPrice.salePrice == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="availabilityPrice.salePriceCV" droppable/>\n </div>\n </div>\n </div>\n <div class="input inner">\n <a href="" ng-click="availabilityPrice.adjustSalePrice = !availabilityPrice.adjustSalePrice" ng-init="availabilityPrice.adjustSalePrice= false" class="adjust-price-link">\n <span class="open-indicator" ng-if="availabilityPrice.adjustSalePrice">-</span>\n <span class="open-indicator" ng-if="!availabilityPrice.adjustSalePrice">+</span> Adjust Sale Price\n </a>\n <div ng-slide-down="availabilityPrice.adjustSalePrice" class="adjust-price" duration="0.2">\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="availabilityPrice.adjustSalePriceValue" droppable /><select ng-model="availabilityPrice.adjustSalePriceType">\n <option value="%">%</option>\n <option value="USD">{{currency}}</option>\n </select>\n <div ng-show="availabilityPrice.adjustSalePriceType == \'%\'" class="tooltip-container">\n <a href="#" ng-cloak="" class="wpallexport-help"\n tipsy="Leave blank or enter in 100% to keep the price as is. Enter in 110% to markup by 10%. Enter in 50% to cut prices in half.">?</a>\n </div>\n <div ng-show="availabilityPrice.adjustSalePriceType == \'USD\'" class="tooltip-container">\n <a href="#" ng-cloak="" class="wpallexport-help"\n tipsy="Enter a negative number to reduce prices.">?</a>\n </div>\n </div>\n </div>\n </div>\n <h4>Availability</h4>\n <div class="input">\n <label><input type="radio" ng-model="availabilityPrice.availability" value="useWooCommerceStockValues"/>Use WooCommerce stock values</label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="availabilityPrice.availability" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="availabilityPrice.availability == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="availabilityPrice.availabilityCV" droppable />\n </div>\n </div>\n </div>\n <div class="wpallexport-collapsed wpallexport-section wpallexport-google-merchants-advanced-options" ng-init="advancedOptionsOpen = false" ng-class="{closed: !advancedOptionsOpen} ">\n <div class="wpallexport-content-section rad0">\n <div class="wpallexport-collapsed-header wpallexport-advanced-options-header disable-jquery" ng-click="advancedOptionsOpen = !advancedOptionsOpen">\n <h3 class="advanced-options">Advanced Options</h3>\n </div>\n <div class="wpallexport-collapsed-content wpallexport-advanced-options-content" ng-slide-down="advancedOptionsOpen" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n <div class="input">\n <h4>Currency</h4>\n <div class="input">\n <div class="select-container" style="padding-left: 0px;">\n <select class="custom-value" chosen ng-model="availabilityPrice.currency">\n <option value="AUD">Australian Dollars (AUD)</option>\n <option value="BRL">Brazilian Reals (BRL)</option>\n <option value="GBP">British Pounds (GBP)</option>\n <option value="CAD">Canadian Dollars (CAD)</option>\n <option value="CZK">Czech Crowns (CZK)</option>\n <option value="DKK">Danish Krone (DKK)</option>\n <option value="EUR">Euros (EUR)</option>\n <option value="INR">Indian Rupees (INR)</option>\n <option value="JPY">Japanese Yen (JPY)</option>\n <option value="MXN">Mexican Pesos (MXN)</option>\n <option value="NZD">New Zealand Dollars (NZD)</option>\n <option value="NOK">Norwegian Krone (NOK)</option>\n <option value="PLN">Polish Złoty (PLN)</option>\n <option value="RUB">Russian Rubles (RUB)</option>\n <option value="SGD">Singapore Dollars (SGD)</option>\n <option value="ZAR">South Africa Rand (ZAR)</option>\n <option value="SEK">Swedish Krona (SEK)</option>\n <option value="CHF">Swiss Franc (CHF)</option>\n <option value="TRY">Turkish Lira (TRY)</option>\n <option value="USD">United States Dollars (USD)</option>\n </select>\n </div>\n </div>\n <h4>Availability Date</h4>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="availabilityPrice.availabilityDate" droppable />\n </div>\n <h4>Sale Price Effective Date</h4>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="availabilityPrice.salePriceEffectiveDate" droppable />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>')}]),angular.module("basicInformation/basicInformation.tpl.html",[]).run(["$templateCache",function(a){
9
- a.put("basicInformation/basicInformation.tpl.html",'<div class="wpallexport-collapsed wpallexport-section" ng-class="{closed: !basicInformation.open}">\n <div class="wpallexport-content-section">\n <div class="wpallexport-collapsed-header disable-jquery" ng-click="basicInformation.open = !basicInformation.open">\n <h3>Basic Product Information</h3>\n </div>\n <div class="wpallexport-collapsed-content" id="basic-product-information" ng-slide-down="basicInformation.open" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n\n <h4>Item Title <a style="margin-top: 7px;" class="wpallexport-help" tipsy="Google Merchant Center only shows the first 70 characters of titles and crops everything over 150 characters.">?</a></h4>\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.itemTitle" value="productTitle"/>Use the product title</label>\n </div>\n <div class="input">\n <label><input type="radio" id="title-custom-data-select" ng-model="basicInformation.itemTitle" value="customValue" />Custom data</label>\n <div class="input inner" id="title-custom-data-container" ng-slide-down="basicInformation.itemTitle == \'customValue\'" duration="0.2">\n <input type="text" id="title-custom-data-value" class="wpae-default-input" ng-model="basicInformation.itemTitleCV" droppable />\n </div>\n </div>\n\n <div class="input checkbox" ng-if="basicInformation.hasVariations">\n <label><input type="checkbox" ng-model="basicInformation.useParentTitleForVariableProducts" value="1" />For variable products, use the parent product title</label>\n </div>\n\n <h4>Item Description</h4>\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.itemDescription" id="use-product-description" value="productDescription"/>Use the product description</label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.itemDescription" id="use-product-short-description" value="productShortDescription"/>Use the product short description</label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.itemDescription" id="product-description-custom-data" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="basicInformation.itemDescription == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" id="description-custom-data-value" ng-model="basicInformation.itemDescriptionCV" droppable />\n </div>\n </div>\n\n <div class="input checkbox">\n <label><input type="checkbox" ng-model="basicInformation.useVariationDescriptionForVariableProducts" value="1" />Use the variation description for variable products</label>\n </div>\n <div class="input checkbox inner" ng-slide-down="basicInformation.useVariationDescriptionForVariableProducts" duration="0.2">\n <label><input type="checkbox" ng-model="basicInformation.useParentDescirptionIfThereIsNoVariationDescirption" value="1" />If there is no variation description, use the parent product description</label>\n </div>\n\n <h4>Link</h4>\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.itemLink" id="use-product-permalinks" value="productLink"/>Use the product permalink</label>\n </div>\n\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.itemLink" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="basicInformation.itemLink == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="basicInformation.itemLinkCV" droppable />\n </div>\n </div>\n\n <div class="input checkbox">\n <label><input type="checkbox" ng-model="basicInformation.addVariationAttributesToProductUrl" />For variable products, add variation attributes to product URL</label>\n </div>\n\n <h4>Main Image Link</h4>\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.itemImageLink" value="useProductFeaturedImage"/>Use product featured image</label>\n </div>\n\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.itemImageLink" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="basicInformation.itemImageLink == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="basicInformation.itemImageLinkCV" droppable />\n </div>\n </div>\n\n <div class="input checkbox">\n <label><input type="checkbox" ng-model="basicInformation.useVariationImage" />For variable products, use variation image</label>\n </div>\n\n <div class="input checkbox inner" ng-slide-down="basicInformation.useVariationImage" duration="0.2">\n <label><input type="checkbox" ng-model="basicInformation.useFeaturedImageIfThereIsNoVariationImage" value="1" />If there is no variation image, use the featured image</label>\n </div>\n\n <h4>Additional Image Link</h4>\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.additionalImageLink" value="productImages"/>Use images from product gallery</label>\n </div>\n\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.additionalImageLink" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="basicInformation.additionalImageLink == \'customValue\'" duration="0.2">\n <input type="text"class="wpae-default-input" ng-model="basicInformation.additionalImageLinkCV" droppable />\n </div>\n </div>\n </div>\n <div class="wpallexport-collapsed wpallexport-section wpallexport-google-merchants-advanced-options" ng-init="advancedOptionsOpen = false" ng-class="{closed: !advancedOptionsOpen}">\n <div class="wpallexport-content-section rad0">\n <div class="wpallexport-collapsed-header wpallexport-advanced-options-header disable-jquery" ng-click="advancedOptionsOpen = !advancedOptionsOpen">\n <h3>Advanced Options</h3>\n </div>\n <div class="wpallexport-collapsed-content wpallexport-advanced-options-content" ng-slide-down="advancedOptionsOpen" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n <div class="input">\n <h4>Item ID</h4>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="basicInformation.itemId" droppable />\n </div>\n <h4>Item Condition</h4>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="basicInformation.condition" droppable />\n <a href="" class="wpae-field-mapping" ng-click="showConditionMappings=true">Data Mapping</a>\n <mapping mappings="basicInformation.conditionMappings" show="showConditionMappings" context="condition" />\n <a style="margin-top: 7px;" class="wpallexport-help" tipsy="The condition or state of the item. Google Shopping allows the promotion of quality second-hand items. There are only 3 accepted values: \'new\', \'refurbished\', and \'used\'">?</a>\n </div>\n <h4>Mobile Link</h4>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="basicInformation.mobileLink" droppable />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>')}]),angular.module("common/mapping/mapping.tpl.html",[]).run(["$templateCache",function(a){a.put("common/mapping/mapping.tpl.html",'<div class="wp-pointer wp-pointer-right" style="width: 450px; display: block; position: absolute; top: -70px; left: -23px;" ng-if="show">\n <div class="wp-pointer-content">\n <h4 style="padding-left:25px; margin-bottom:0; padding-bottom:0; margin-top:20px;">\n Data Mapping\n <a style="margin-top: 7px;" ng-if="tooltip" class="wpallexport-help"\n tipsy="{{ tooltip }}">?\n </a>\n </h4>\n\n <fieldset style="margin-top: 0; padding-top: 0; padding-bottom: 0;">\n <table cellpadding="0" cellspacing="0" class="cf-form-table" rel="cf_mapping_0" style="margin-left: 5px; margin-top: 15px;">\n <thead>\n <tr>\n <td><div style="padding-bottom:5px">Exported Data</div></td>\n <td><div style="padding-bottom:5px;">Translated To</div></td>\n <td>&nbsp;</td>\n </tr>\n </thead>\n <tbody>\n <tr class="form-field" ng-repeat="mapping in mappings">\n <td style="width: 50%;">\n <input type="text" ng-model="mapping.mapFrom" style="margin-left:0;"/>\n </td>\n <td style="width: 50%;">\n <div ng-if="context == \'sizeType\'">\n <select chosen ng-model="mapping.mapTo" >\n <option value="">Please select</option>\n <option value="regular">Regular</option>\n <option value="petite">Petite</option>\n <option value="plus">Plus</option>\n <option value="big and tall">Big and tall</option>\n <option value="maternity">Maternity</option>\n </select>\n </div>\n <div ng-if="context == \'condition\' ">\n <select chosen ng-model="mapping.mapTo">\n <option value="new">New</option>\n <option value="refurbished">Refurbished</option>\n <option value="used">Used</option>\n </select>\n </div>\n <div ng-if="context != \'sizeType\' && context != \'condition\'">\n <input type="text" ng-model="mapping.mapTo" />\n </div>\n </td>\n <td class="action remove">\n <a href="" ng-click="removeMapping(mapping)" ng-show="$index > 0"\n style="right:-10px;"></a>\n </td>\n </tr>\n <tr>\n <td colspan="3">\n <a href="" ng-click="addMapping()" title="Add Another" class="action add-new-key add-new-entry" style="margin-top: 15px; margin-bottom:15px; margin-left: 0;">\n Add Another\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n <input type="hidden" name="custom_mapping_rules[]" value="">\n </fieldset>\n <div class="wp-pointer-buttons">\n <a class="close" href="" ng-click="close()">Close</a>\n <a class="save_popup save_mr" style="position:static; margin-right: 15px;" href="" ng-click="saveMappings()">Save Rules</a>\n </div>\n </div>\n <div class="wp-pointer-arrow">\n <div class="wp-pointer-arrow-inner"></div>\n </div>\n</div>')}]),angular.module("detailedInformation/detailedInformation.tpl.html",[]).run(["$templateCache",function(a){a.put("detailedInformation/detailedInformation.tpl.html",'<div class="wpallexport-collapsed wpallexport-section" ng-class="{closed: !detailedInformation.open }">\n <div class="wpallexport-content-section">\n <div class="wpallexport-collapsed-header disable-jquery" ng-click="detailedInformation.open = !detailedInformation.open ">\n <h3>Detailed Product Attributes &amp; Item Grouping</h3>\n </div>\n <div class="wpallexport-collapsed-content" id="detailed-product-information" ng-slide-down="detailedInformation.open" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n <h4>Item Group ID</h4>\n <p>\n For variable products, each variant is exported as a separate product.\n Variants that belong to the same group must all have the same Item Group ID\n so that Google knows they are related.\n </p>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.setTheGroupId" value="automatically" />Automatically set the item group ID</label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.setTheGroupId" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="detailedInformation.setTheGroupId == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="detailedInformation.setTheGroupIdCV" droppable />\n </div>\n </div>\n <h4>Color</h4>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.color" value="selectFromWooCommerceProductAttributes" />Select from WooCommerce product attributes</label>\n <div ng-slide-down="detailedInformation.color == \'selectFromWooCommerceProductAttributes\'" duration="0.2">\n <div class="select-container" ng-if="attributes.length">\n <select autodetect="Color" chosen ng-options="\'{\' + i.name + \'}\' as i.name for i in attributes" ng-model="detailedInformation.colorAttribute" class="inner">\n <option value="">Leave Blank</option>\n </select>\n </div>\n <div class="no-attributes" ng-if="!attributes.length">\n The products in this export have no product attributes. Add attributes to your products in order to map them to a color.\n </div>\n </div>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.color" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="detailedInformation.color == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="detailedInformation.colorCV" droppable />\n </div>\n </div>\n\n <h4>Size</h4>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.size" value="selectFromWooCommerceProductAttributes" />Select from WooCommerce product attributes</label>\n <div ng-slide-down="detailedInformation.size == \'selectFromWooCommerceProductAttributes\'" duration="0.2">\n <div class="select-container" ng-if="attributes.length">\n <select id="sizeAttribute" autodetect="Size" chosen ng-options="\'{\' + i.name + \'}\' as i.name for i in attributes" ng-model="detailedInformation.sizeAttribute" class="inner">\n <option value="">Leave Blank</option>\n </select>\n </div>\n <div class="no-attributes" ng-if="!attributes.length">\n The products in this export have no product attributes. Add attributes to your products in order to map them to a size.\n </div>\n </div>\n </div>\n <div class="input">\n <label>\n <input type="radio" ng-model="detailedInformation.size" value="customValue" />Custom data\n </label>\n <div class="input inner" ng-slide-down="detailedInformation.size== \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="detailedInformation.sizeCV" droppable />\n </div>\n </div>\n\n <h4>Gender</h4>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.gender" value="selectFromWooCommerceProductAttributes" />Select from WooCommerce product attributes</label>\n <div class="clear"></div>\n <div ng-slide-down="detailedInformation.gender == \'selectFromWooCommerceProductAttributes\'" duration="0.2">\n <div class="select-container" ng-if="attributes.length">\n <select autodetect="Gender" chosen ng-options="\'{\' + i.name + \'}\' as i.name for i in attributes" ng-model="detailedInformation.genderAttribute" class="inner">\n <option value="">Leave Blank</option>\n </select>\n </div>\n <div class="no-attributes" ng-if="!attributes.length">\n The products in this export have no product attributes. Add attributes to your products in order to map them to a gender.\n </div>\n </div>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.gender" value="autodetectBasedOnProductTaxonomies"/>Autodetect based on WooCommerce product categories</label>\n <div ng-slide-down="detailedInformation.gender == \'autodetectBasedOnProductTaxonomies\'" duration="0.2">\n <div class="inner">\n <div class="input">\n <label>\n <input type="radio" ng-model="detailedInformation.genderAutodetect" value="keepBlank"/>Leave gender blank if unable to detect gender\n </label>\n </div>\n <div class="input">\n <label>\n <input type="radio" ng-model="detailedInformation.genderAutodetect" value="setToUnisex" />Set gender to unisex if unable to detect gender\n </label>\n </div>\n </div>\n </div>\n </div>\n <div class="input">\n <label>\n <input type="radio" ng-model="detailedInformation.gender" value="selectProductTaxonomies" />Select from WooCommerce product categories\n </label>\n <div ng-slide-down="detailedInformation.gender == \'selectProductTaxonomies\'" duration="0.2">\n <category-mapper mappings="detailedInformation.genderCats" context="gender" />\n </div>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.gender" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="detailedInformation.gender == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="detailedInformation.genderCV" droppable />\n </div>\n </div>\n </div>\n\n <div class="wpallexport-collapsed wpallexport-section wpallexport-google-merchants-advanced-options" ng-class="{closed: !advancedOptionsOpen}">\n <div class="wpallexport-content-section rad0">\n <div class="wpallexport-collapsed-header wpallexport-advanced-options-header disable-jquery" ng-click="advancedOptionsOpen = !advancedOptionsOpen">\n <h3>Advanced Options</h3>\n </div>\n <div class="wpallexport-collapsed-content wpallexport-advanced-options-content" ng-slide-down="advancedOptionsOpen" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n <h4>Size Type</h4>\n <div class="input">\n <div style="display: inline-block;">\n <input type="text" class="wpae-default-input" ng-model="detailedInformation.sizeType" droppable />\n </div>\n <a href="" class="wpae-field-mapping" ng-click="showMappings=true">Data Mapping</a>\n <div style="position: relative">\n <mapping mappings="detailedInformation.sizeTypeMappings" show="showMappings" context="sizeType" />\n </div>\n </div>\n <h4>Size System</h4>\n <div class="input">\n <div class="select-container" style="padding-left: 0;">\n <select chosen ng-model="detailedInformation.sizeSystem" class="inner">\n <option value="">Leave Blank</option>\n <option value="US">US</option>\n <option value="UK">UK</option>\n <option value="EU">EU</option>\n <option value="DE">DE</option>\n <option value="FR">FR</option>\n <option value="JP">JP</option>\n <option value="CN">CN (China)</option>\n <option value="IT">IT</option>\n <option value="BR">BR</option>\n <option value="MEX">MEX</option>\n <option value="AU">AU</option>\n </select>\n </div>\n </div>\n <h4>Age Group</h4>\n <div class="input">\n <label>\n <input type="radio" ng-model="detailedInformation.ageGroup" value="selectFromWooCommerceProductAttributes"/>Select from WooCommerce product attributes\n </label>\n <div ng-slide-down="detailedInformation.ageGroup == \'selectFromWooCommerceProductAttributes\'" duration="0.2">\n <div class="select-container" ng-if="attributes.length">\n <select chosen ng-options="\'{\' + i.name + \'}\' as i.name for i in attributes" ng-model="detailedInformation.ageGroupAttribute" class="inner">\n <option value="">Leave Blank</option>\n </select>\n </div>\n <div class="no-attributes" ng-if="!attributes.length">\n The products in this export have no product attributes. Add attributes to your products in order to map them to an age group.\n </div>\n </div>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.ageGroup" value="selectFromProductTaxonomies" />Select from WooCommerce product categories</label>\n <div ng-slide-down="detailedInformation.ageGroup == \'selectFromProductTaxonomies\' " duration="0.5" >\n <div ng-show="detailedInformation.ageGroup == \'selectFromProductTaxonomies\' ">\n <category-mapper mappings="detailedInformation.ageGroupCats" grey="1" context="ageGroup" />\n </div>\n </div>\n </div>\n <div class="input">\n <label>\n <input type="radio" ng-model="detailedInformation.ageGroup" value="customValue" />Custom data\n </label>\n <div class="input inner" ng-slide-down="detailedInformation.ageGroup== \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="detailedInformation.ageGroupCV" droppable />\n </div>\n </div>\n <h4>Material</h4>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.material" value="selectFromWooCommerceProductAttributes" />Select from WooCommerce product attributes</label>\n <div ng-slide-down="detailedInformation.material == \'selectFromWooCommerceProductAttributes\'" duration="0.2">\n <div class="select-container" ng-if="attributes.length">\n <select chosen ng-options="\'{\' + i.name + \'}\' as i.name for i in attributes" ng-model="detailedInformation.materialAttribute" class="inner">\n <option value="">Leave Blank</option>\n </select>\n </div>\n <div class="no-attributes outer" ng-if="!attributes.length">\n The products in this export have no product attributes. Add attributes to your products in order to map them to a material.\n </div>\n </div>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.material" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="detailedInformation.material == \'customValue\'" duration="0.2">\n <div class="input inner" ng-slide-down="detailedInformation.material == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="detailedInformation.materialCV" droppable />\n </div>\n </div>\n\n <h4>Pattern</h4>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.pattern" value="selectFromWooCommerceProductAttributes" />Select from WooCommerce product attributes</label>\n <div ng-slide-down="detailedInformation.pattern == \'selectFromWooCommerceProductAttributes\'" duration="0.2">\n <div class="select-container" ng-if="attributes.length">\n <select chosen ng-options="\'{\' + i.name + \'}\' as i.name for i in attributes" ng-model="detailedInformation.patternAttribute" class="inner">\n <option value="">Leave Blank</option>\n </select>\n </div>\n <div class="no-attributes outer" ng-if="!attributes.length">\n The products in this export have no product attributes. Add attributes to your products in order to map them to a pattern.\n </div>\n </div>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.pattern" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="detailedInformation.pattern == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="detailedInformation.patternCV" droppable />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>')}]),angular.module("productCategories/categoryMapper/categoryMapper.tpl.html",[]).run(["$templateCache",function(a){
10
- a.put("productCategories/categoryMapper/categoryMapper.tpl.html",'<div class="category-mapper">\n <div>\n <div class="woocommerce-categories-title" style="float:left; padding: 13px 13px 13px 31px;">\n <h4 style="margin: 0; padding: 0; font-size:13px; color:#000;">WooCommerce Categories</h4>\n </div>\n\n <div class="google-categories-title" style="float:right; padding:13px; margin-right: 278px;" ng-if="::(context==\'categories\')">\n <h4 style="margin:0; padding:0; font-size:13px; color:#000; ">Google Categories</h4>\n </div>\n\n <div class="google-categories-title" style="float:right; padding:13px; margin-right: 288px;" ng-if="::(context==\'gender\')">\n <h4 style="margin:0; padding:0; font-size:13px; color:#000; ">Google Genders</h4>\n </div>\n\n <div class="google-categories-title" style="float:right; padding:13px; margin-right: 268px;" ng-if="::(context==\'ageGroup\')">\n <h4 style="margin:0; padding:0; font-size:13px; color:#000; ">Google Age Groups</h4>\n </div>\n </div>\n\n <ul dx-start-with="innerMapping" class="tree" ng-class="::{ \'root\' : $dxLevel == 0 }" ng-init="initialize()" style="width: 100%; float:left; margin-top: 0px;" ng-if="innerMapping">\n <li ng-repeat="node in $dxPrior.children | limitTo: limits" style="display: block;">\n <div class="category-container" style="position: relative;" ng-class="::{ \'with-children\' : node.children.length, \'without-children\' : (!node.children.length) }">\n <div class="hline"></div>\n <div class="category-icon-container" style="float:left;">\n <div class="vline" ng-if="::(($index > 0 && $dxLevel == 0) || $dxLevel > 0)"></div>\n <div class="vline noborder" ng-if="::(!(($index > 0 && $dxLevel == 0) || $dxLevel > 0))"></div>\n <span ng-if="node.expanded" class="minus" ng-click="expandNode(node)">\n <svg width="9" height="9" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">\n <path d="M1600 736v192q0 40-28 68t-68 28h-1216q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h1216q40 0 68 28t28 68z"/>\n </svg>\n </span>\n <span ng-if="!node.expanded && node.children.length" class="plus" ng-click="expandNode(node)">\n <svg width="9" height="9" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">\n <path d="M1600 736v192q0 40-28 68t-68 28h-416v416q0 40-28 68t-68 28h-192q-40 0-68-28t-28-68v-416h-416q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h416v-416q0-40 28-68t68-28h192q40 0 68 28t28 68v416h416q40 0 68 28t28 68z"/>\n </svg>\n </span>\n <span ng-if="::(!node.children.length)" class="plus blank" style="cursor: default;"></span>\n <div class="vline bottom"></div>\n </div>\n <div class="category-name-container">\n <span class="dot" ng-repeat="i in ::getTimes($dxLevel) track by $index"></span>\n <div class="category">\n <a class="category-title" href="" ng-click="expandNode(node)" ng-bind-html="::node.title | safe"></a>\n <br ng-if="::node.children.length"/>\n <span ng-if="::node.children.length" class="children-number">\n {{ ::node.children.length }} child <span ng-if="::node.children.length == 1">category</span><span ng-if="::node.children.length > 1">categories</span>\n </span>\n </div>\n </div>\n <div class="line" ></div>\n <div class="mapping" ng-if="::(context == \'categories\')" >\n <div style="position: relative" ng-init="visible=false">\n <input type="text" style="width: 402px; font-size:13px; padding-left: 8px;" placeholder="{{ getPlaceholder() }}"\n ng-class="{ \'selected-automatically\' : !mappings[node.id].byUser, \'opened\' : visible }"\n ng-model="selectedCategory"\n ng-value="mappings[node.id].name"\n ng-change="categoryChanged()"\n ng-click="categoryClicked()"\n class="wpae-google-category-input"\n ng-model-options="{ debounce: 200 }"\n />\n <google-category-selector />\n </div>\n </div>\n <div class="mapping gender" ng-if="::(context == \'gender\')" style="border: none;">\n <select chosen cascade ng-model="mappings[node.id]" ng-change="select()">\n <option value="male">Male</option>\n <option value="female">Female</option>\n <option value="unisex">Unisex</option>\n </select>\n </div>\n <div class="mapping" ng-if="::(context == \'ageGroup\')" style="border: none; background-color: #F1F1F1; padding:0; margin-top: 5px;" >\n <select chosen cascade ng-model="mappings[node.id]" ng-change="select()">\n <option value="newborn">Newborn</option>\n <option value="infant">Infant</option>\n <option value="toddler">Toddler</option>\n <option value="kids">Kids</option>\n <option value="adult">Adult</option>\n </select>\n </div>\n <div style="clear:both;"></div>\n </div>\n <ul dx-connect="node" ng-if="node.expanded==true"/>\n </li>\n </ul>\n <div class=\'catList\' style="clear:both;"></div>\n <div class="mask" ng-class="::{ grey : grey == 1}"></div>\n</div>\n<div ng-if="initialized && !innerMapping.children.length">\n <div ng-include="\'productCategories/categoryMapper/noCategoriesNotice.tpl.html\'"></div>\n</div>')}]),angular.module("productCategories/categoryMapper/noCategoriesNotice.tpl.html",[]).run(["$templateCache",function(a){a.put("productCategories/categoryMapper/noCategoriesNotice.tpl.html",'<div class="no-categories-notice" ng-if="context == \'categories\' ">\n The products in this export are uncategorized. Add WooCommerce Product Categories to your products in order to map them to Google Product Categories.\n</div>\n\n<div class="no-categories-notice" ng-if="context == \'gender\' ">\n The products in this export are uncategorized. Add WooCommerce Product Categories to your products in order to map them to a gender.\n</div>\n\n<div class="no-categories-notice" ng-if="context == \'ageGroup\' ">\n The products in this export are uncategorized. Add WooCommerce Product Categories to your products in order to map them to an age group.\n</div>\n')}]),angular.module("productCategories/googleCategorySelector/googleCategorySelector.tpl.html",[]).run(["$templateCache",function(a){a.put("productCategories/googleCategorySelector/googleCategorySelector.tpl.html",'<div class="google-category-selector" ng-init="loadCategories()" ng-if="visible" click-outside="closeMe()" outside-if-not="wpae-google-category-input">\n <ul class="categories" dx-start-with="categories">\n <li ng-repeat="category in $dxPrior.children" style="position: relative;">\n <div class="div-content">\n <div class="expand-button" ng-click="expand(category); $event.preventDefault();">\n <div ng-if="category.hasChildren > 0" class="chevron">\n <svg ng-if="!category.opened" width="10" height="10" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">\n <path d="M1683 1331l-166 165q-19 19-45 19t-45-19l-531-531-531 531q-19 19-45 19t-45-19l-166-165q-19-19-19-45.5t19-45.5l742-741q19-19 45-19t45 19l742 741q19 19 19 45.5t-19 45.5z"/>\n </svg>\n <svg ng-if="category.opened" width="10" height="10" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">\n <path d="M1683 808l-742 741q-19 19-45 19t-45-19l-742-741q-19-19-19-45.5t19-45.5l166-165q19-19 45-19t45 19l531 531 531-531q19-19 45-19t45 19l166 165q19 19 19 45.5t-19 45.5z"/>\n </svg>\n </div>\n </div>\n <div ng-bind-html="category.name | safe" ng-click="select(category)" class="google-category-name-container">\n </div>\n <div class="clear"></div>\n </div>\n <ul dx-connect="category" class="categories inner-categories" ng-if="category.opened" />\n </li>\n </ul>\n <div ng-if="!categories.children.length" class="google-no-results-found">\n No results found\n </div>\n</div>')}]),angular.module("productCategories/productCategories.tpl.html",[]).run(["$templateCache",function(a){a.put("productCategories/productCategories.tpl.html",'<div class="wpallexport-collapsed wpallexport-section" ng-class="{closed: !productCategories.open}">\n <div class="wpallexport-content-section">\n <div class="wpallexport-collapsed-header disable-jquery" ng-click="productCategories.open = !productCategories.open">\n <h3>Product Categories</h3>\n </div>\n <div class="wpallexport-collapsed-content" ng-slide-down="productCategories.open" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n <h4>Product Type</h4>\n <p>Use this attribute to classify the product using your own categories. The categories here don\'t need to match Google\'s list of acceptable product categories.</p>\n <div class="input">\n <label>\n <input type="radio" ng-model="productCategories.productType" value="useWooCommerceProductCategories" />Use WooCommerce\'s product category\n </label>\n </div>\n <div class="input">\n <label>\n <input type="radio" ng-model="productCategories.productType" value="customValue" />Custom data\n </label>\n <div class="input inner" ng-slide-down="productCategories.productType == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="productCategories.productTypeCV" droppable />\n </div>\n </div>\n <h4>Product Category</h4>\n <p>\n Products added to Google Merchant Center must be categorized according to Google\'s list of product categories. Each product may only be assigned one Google product category. <a href="https://support.google.com/merchants/answer/160081" target="_blank">Read more about Google product categories.</a>\n </p>\n <div class="input">\n <label>\n <input type="radio" ng-model="productCategories.productCategories" value="mapProductCategories" />Map WooCommerce\'s product categories to Google\'s product categories\n <a href="#" class="wpallexport-help" style="margin-top:5px; margin-left: 2px;"\n tipsy="Products assigned more than one WooCommerce product category and mapped to more than one Google product category will be mapped to the most specific, deepest Google product category selected for that product.">?</a>\n </label>\n </div>\n <div ng-slide-down="productCategories.productCategories == \'mapProductCategories\'" duration="0.5">\n <category-mapper mappings="productCategories.catMappings" />\n </div>\n\n <div class="input">\n <label>\n <input type="radio" ng-model="productCategories.productCategories" value="useWooCommerceProductCategories" />Use WooCommerce\'s product categories\n <a href="#" class="wpallexport-help" style="margin-top:5px; margin-left: 2px;"\n tipsy="Products assigned to more than one WooCommerce product category will only have the most specific, deepest product category exported.">?</a>\n </label>\n <p class="no-categories-notice" ng-slide-down="productCategories.productCategories == \'useWooCommerceProductCategories\'" duration="0.2">\n If your WooCommerce product categories do not exactly match Google\'s, your feed will fail when uploaded to Google.\n </p>\n <div ng-slide-down="!$root.cats.children.length && productCategories.productCategories == \'useWooCommerceProductCategories\'" duration="0.2">\n <div ng-include="\'productCategories/categoryMapper/noCategoriesNotice.tpl.html\'" ng-init="context = \'categories\' "></div>\n </div>\n </div>\n\n <div class="input">\n <label>\n <input type="radio" ng-model="productCategories.productCategories" value="customValue" />Custom data\n </label>\n <div class="input inner" ng-slide-down="productCategories.productCategories == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="productCategories.productCategoriesCV" droppable />\n </div>\n </div>\n </div>\n\n </div>\n </div>\n</div>')}]),angular.module("shipping/shipping.tpl.html",[]).run(["$templateCache",function(a){a.put("shipping/shipping.tpl.html",'<div class="wpallexport-collapsed wpallexport-section" ng-class="{closed: !shipping.open }">\n <div class="wpallexport-content-section">\n <div class="wpallexport-collapsed-header disable-jquery"\n ng-click="shipping.open = !shipping.open ">\n <h3>Shipping</h3>\n </div>\n <div class="wpallexport-collapsed-content" id="shipping" ng-slide-down="shipping.open" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n <h4>Shipping Price</h4>\n <p>\n This attribute allows Google to provide a shipping estimate for the product.\n This overrides the default shipping price configured in the Google Merchant Center.\n </p>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="shipping.shippingPrice" droppable />\n <a href="" ng-click="shipping.adjustShippingPrice = !shipping.adjustShippingPrice" class="adjust-price-link">\n <span ng-if="!shipping.adjustShippingPrice" style="width: 6px; display: inline-block;">+</span>\n <span ng-if="shipping.adjustShippingPrice" style="width: 6px; display: inline-block;">-</span>\n Adjust Shipping Price</a>\n <input type="hidden" ng-model="shipping.shippingHeight"/>\n <input type="hidden" ng-model="shipping.shippingLength"/>\n <input type="hidden" ng-model="shipping.shippingWidth"/>\n <div ng-slide-down="shipping.adjustShippingPrice" class="adjust-price" duration="0.2" style="margin-top: 5px; ">\n <input type="text" style="margin-top: 0; margin-right: 0;" class="wpae-default-input" ng-model="shipping.adjustShippingPriceValue" droppable /><select style="margin-top:5px;" ng-model="shipping.adjustPriceType">\n <option value="%">%</option>\n <option value="USD">{{currency}}</option>\n </select>\n\n <div ng-show="shipping.adjustPriceType == \'%\'" class="tooltip-container">\n <a href="#" ng-cloak="" class="wpallexport-help" style="top:0;"\n tipsy="Leave blank or enter in 100% to keep the price as is. Enter in 110% to markup by 10%. Enter in 50% to cut prices in half.">?</a>\n </div>\n <div ng-show="shipping.adjustPriceType == \'USD\'" class="tooltip-container">\n <a href="#" style="top:0;" ng-cloak="" class="wpallexport-help" tipsy="Enter a negative number to reduce prices.">?</a>\n </div>\n </div>\n </div>\n\n <h4>Length, Width, Height</h4>\n <div class="input">\n <label>\n <input type="radio" ng-model="shipping.dimensions" value="useWooCommerceProductValues"/>Use WooCommerce\'s product values and convert them to\n <select ng-model="shipping.convertTo" style="width: 175px; height: 30px; padding: 0 0 0 8px; margin-left: 5px; margin-top: 5px; ">\n <option value="cm">Centimeters (cm)</option>\n <option value="in">Inches (in)</option>\n </select>\n </label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="shipping.dimensions" value="customValue"/>Custom data</label>\n <div ng-slide-down="shipping.dimensions == \'customValue\'" duration="0.2" class="input inner">\n <input type="text" class="wpae-default-input" ng-model="shipping.dimensionsCV" droppable />\n </div>\n </div>\n\n <h4>Shipping Weight</h4>\n <div class="input">\n <label>\n <input type="radio" ng-model="shipping.weight" value=""/>Do not include in the feed\n </label>\n </div>\n <div class="input">\n <label>\n <input type="radio" ng-model="shipping.weight" value="useWooCommerceProductValues"/>Use WooCommerce\'s product values\n </label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="shipping.weight" value="customValue"/>Custom data</label>\n <div ng-slide-down="shipping.weight == \'customValue\'" duration="0.2" class="input inner">\n <input type="text" class="wpae-default-input" ng-model="shipping.weightCV" droppable />\n </div>\n </div>\n\n <h4>Shipping Label</h4>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="shipping.shippingLabel" droppable />\n </div>\n </div>\n </div>\n </div>\n</div>')}]),angular.module("uniqueIdentifiers/uniqueIdentifiers.tpl.html",[]).run(["$templateCache",function(a){a.put("uniqueIdentifiers/uniqueIdentifiers.tpl.html",'<div class="wpallexport-collapsed wpallexport-section" ng-class="{closed: !uniqueIdentifiers.open}">\n <div class="wpallexport-content-section">\n <div class="wpallexport-collapsed-header disable-jquery" ng-click="uniqueIdentifiers.open = !uniqueIdentifiers.open">\n <h3>Unique Identifiers</h3>\n </div>\n <div class="wpallexport-collapsed-content slide-toggle" id="unique-identifiers" ng-slide-down="uniqueIdentifiers.open" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n <p>\n Unique product identifiers are product codes associated with your products.\n Products submitted without unique identifiers are difficult to classify and may not be able to take advantage of all Google shopping features.\n <a href="https://support.google.com/merchants/answer/7052112?hl=en&ref_topic=3404778#intro-product-identifiers" target="_blank">Read more about unique product identifiers</a>.\n </p>\n <h4>GTIN</h4>\n <p>\n Global Trade Item Numbers include UPC, EAN (in Europe), JAN (in Japan), and ISBN. <a href="https://support.google.com/merchants/answer/6219078" target="_blank">Read how to find your products\' GTIN</a>.\n </p>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="uniqueIdentifiers.gtin" droppable />\n </div>\n\n <h4>MPN</h4>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="uniqueIdentifiers.mpn" droppable />\n </div>\n\n <h4>Brand</h4>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="uniqueIdentifiers.brand" droppable />\n </div>\n\n <h4>Identifier Exists</h4>\n <div class="input">\n <label><input type="radio" ng-model="uniqueIdentifiers.identifierExists" value="1" />Set to false if product has no GTIN or MPN\n <a style="margin-top: 0; margin-bottom: 0; margin-left: 0; padding-bottom: 0;" class="wpallexport-help" tipsy="If your product has neither an MPN or GTIN, Google requires the attribute \'identifier_exists\' to be set to false. WP All Export will do this automatically if this option is enabled.">?</a>\n </label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="uniqueIdentifiers.identifierExists" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="uniqueIdentifiers.identifierExists == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="uniqueIdentifiers.identifierExistsCV" droppable />\n </div>\n </div>\n\n </div>\n </div>\n </div>\n</div>')}]);
 
1
+ function chosen(a){var b,c,d,e;return b=[{onChange:"change"},{onReady:"chosen:ready"},{onMaxSelected:"chosen:maxselected"},{onShowDropdown:"chosen:showing_dropdown"},{onHideDropdown:"chosen:hiding_dropdown"},{onNoResult:"chosen:no_results"}],c={options:"=",ngModel:"=",ngDisabled:"="},e=[],Object.keys(c).forEach(function(a){e.push(a)}),b.forEach(function(a){var b=Object.keys(a)[0];c[b]="="}),d=function(c,d,f){var g=parseInt(f.maxSelection,10),h=parseInt(f.searchThreshold,10);(isNaN(g)||g===1/0)&&(g=void 0),(isNaN(h)||h===1/0)&&(h=void 0);var i=void 0!==d.attr("allow-single-deselect"),j=void 0!==d.attr("no-results-text")?f.noResultsText:"No results found.";d.chosen({width:"100%",max_selected_options:g,disable_search_threshold:h,search_contains:!0,allow_single_deselect:i,no_results_text:j}),d.on("change",function(){d.trigger("chosen:updated")}),c.$watchGroup(e,function(){a(function(){d.trigger("chosen:updated")},100)}),c.$on("chosen:updated",function(){d.trigger("chosen:updated")}),b.forEach(function(a){var b=Object.keys(a)[0];"function"==typeof c[b]&&d.on(a[b],function(a){c.$apply(function(){c[b](a)})})})},{name:"chosen",scope:c,restrict:"A",link:d}}!function(a){"use strict";function b(a){if(!v(a))return oe;u(a.objectMaxDepth)&&(oe.objectMaxDepth=c(a.objectMaxDepth)?a.objectMaxDepth:NaN),u(a.urlErrorParamsEnabled)&&J(a.urlErrorParamsEnabled)&&(oe.urlErrorParamsEnabled=a.urlErrorParamsEnabled)}function c(a){return y(a)&&a>0}function d(a,b){b=b||Error;var c="https://errors.angularjs.org/1.7.6/",d=c.replace(".","\\.")+"[\\s\\S]*",e=new RegExp(d,"g");return function(){var d,f,g=arguments[0],h=arguments[1],i="["+(a?a+":":"")+g+"] ",j=W(arguments,2).map(function(a){return ya(a,oe.objectMaxDepth)});if(i+=h.replace(/\{\d+\}/g,function(a){var b=+a.slice(1,-1);return b<j.length?j[b].replace(e,""):a}),i+="\n"+c+(a?a+"/":"")+g,oe.urlErrorParamsEnabled)for(f=0,d="?";f<j.length;f++,d="&")i+=d+"p"+f+"="+encodeURIComponent(j[f]);return new b(i)}}function e(a){if(null==a||E(a))return!1;if(A(a)||x(a)||le&&a instanceof le)return!0;var b="length"in Object(a)&&a.length;return y(b)&&(b>=0&&b-1 in a||"function"==typeof a.item)}function f(a,b,c){var d,g;if(a)if(C(a))for(d in a)"prototype"!==d&&"length"!==d&&"name"!==d&&a.hasOwnProperty(d)&&b.call(c,a[d],d,a);else if(A(a)||e(a)){var h="object"!=typeof a;for(d=0,g=a.length;d<g;d++)(h||d in a)&&b.call(c,a[d],d,a)}else if(a.forEach&&a.forEach!==f)a.forEach(b,c,a);else if(w(a))for(d in a)b.call(c,a[d],d,a);else if("function"==typeof a.hasOwnProperty)for(d in a)a.hasOwnProperty(d)&&b.call(c,a[d],d,a);else for(d in a)re.call(a,d)&&b.call(c,a[d],d,a);return a}function g(a,b,c){for(var d=Object.keys(a).sort(),e=0;e<d.length;e++)b.call(c,a[d[e]],d[e]);return d}function h(a){return function(b,c){a(c,b)}}function i(){return++Be}function j(a,b){b?a.$$hashKey=b:delete a.$$hashKey}function k(a,b,c){for(var d=a.$$hashKey,e=0,f=b.length;e<f;++e){var g=b[e];if(v(g)||C(g))for(var h=Object.keys(g),i=0,l=h.length;i<l;i++){var m=h[i],n=g[m];c&&v(n)?z(n)?a[m]=new Date(n.valueOf()):D(n)?a[m]=new RegExp(n):n.nodeName?a[m]=n.cloneNode(!0):N(n)?a[m]=n.clone():(v(a[m])||(a[m]=A(n)?[]:{}),k(a[m],[n],!0)):a[m]=n}}return j(a,d),a}function l(a){return k(a,ue.call(arguments,1),!1)}function m(a){return k(a,ue.call(arguments,1),!0)}function n(a){return parseInt(a,10)}function o(a,b){return l(Object.create(a),b)}function p(){}function q(a){return a}function r(a){return function(){return a}}function s(a){return C(a.toString)&&a.toString!==xe}function t(a){return void 0===a}function u(a){return void 0!==a}function v(a){return null!==a&&"object"==typeof a}function w(a){return null!==a&&"object"==typeof a&&!ye(a)}function x(a){return"string"==typeof a}function y(a){return"number"==typeof a}function z(a){return"[object Date]"===xe.call(a)}function A(a){return Array.isArray(a)||a instanceof Array}function B(a){switch(xe.call(a)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return a instanceof Error}}function C(a){return"function"==typeof a}function D(a){return"[object RegExp]"===xe.call(a)}function E(a){return a&&a.window===a}function F(a){return a&&a.$evalAsync&&a.$watch}function G(a){return"[object File]"===xe.call(a)}function H(a){return"[object FormData]"===xe.call(a)}function I(a){return"[object Blob]"===xe.call(a)}function J(a){return"boolean"==typeof a}function K(a){return a&&C(a.then)}function L(a){return a&&y(a.length)&&De.test(xe.call(a))}function M(a){return"[object ArrayBuffer]"===xe.call(a)}function N(a){return!(!a||!(a.nodeName||a.prop&&a.attr&&a.find))}function O(a){var b,c={},d=a.split(",");for(b=0;b<d.length;b++)c[d[b]]=!0;return c}function P(a){return se(a.nodeName||a[0]&&a[0].nodeName)}function Q(a,b){return-1!==Array.prototype.indexOf.call(a,b)}function R(a,b){var c=a.indexOf(b);return c>=0&&a.splice(c,1),c}function S(a,b,d){function e(a,b,c){if(--c<0)return"...";var d,e=b.$$hashKey;if(A(a))for(var f=0,h=a.length;f<h;f++)b.push(g(a[f],c));else if(w(a))for(d in a)b[d]=g(a[d],c);else if(a&&"function"==typeof a.hasOwnProperty)for(d in a)a.hasOwnProperty(d)&&(b[d]=g(a[d],c));else for(d in a)re.call(a,d)&&(b[d]=g(a[d],c));return j(b,e),b}function g(a,b){if(!v(a))return a;var c=i.indexOf(a);if(-1!==c)return k[c];if(E(a)||F(a))throw ze("cpws","Can't copy! Making copies of Window or Scope instances is not supported.");var d=!1,f=h(a);return void 0===f&&(f=A(a)?[]:Object.create(ye(a)),d=!0),i.push(a),k.push(f),d?e(a,f,b):f}function h(a){switch(xe.call(a)){case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Float32Array]":case"[object Float64Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return new a.constructor(g(a.buffer),a.byteOffset,a.length);case"[object ArrayBuffer]":if(!a.slice){var b=new ArrayBuffer(a.byteLength);return new Uint8Array(b).set(new Uint8Array(a)),b}return a.slice(0);case"[object Boolean]":case"[object Number]":case"[object String]":case"[object Date]":return new a.constructor(a.valueOf());case"[object RegExp]":var c=new RegExp(a.source,a.toString().match(/[^\/]*$/)[0]);return c.lastIndex=a.lastIndex,c;case"[object Blob]":return new a.constructor([a],{type:a.type})}if(C(a.cloneNode))return a.cloneNode(!0)}var i=[],k=[];if(d=c(d)?d:NaN,b){if(L(b)||M(b))throw ze("cpta","Can't copy! TypedArray destination cannot be mutated.");if(a===b)throw ze("cpi","Can't copy! Source and destination are identical.");return A(b)?b.length=0:f(b,function(a,c){"$$hashKey"!==c&&delete b[c]}),i.push(a),k.push(b),e(a,b,d)}return g(a,d)}function T(a,b){return a===b||a!==a&&b!==b}function U(a,b){if(a===b)return!0;if(null===a||null===b)return!1;if(a!==a&&b!==b)return!0;var c,d,e,f=typeof a,g=typeof b;if(f===g&&"object"===f){if(!A(a)){if(z(a))return!!z(b)&&T(a.getTime(),b.getTime());if(D(a))return!!D(b)&&a.toString()===b.toString();if(F(a)||F(b)||E(a)||E(b)||A(b)||z(b)||D(b))return!1;e=ta();for(d in a)if("$"!==d.charAt(0)&&!C(a[d])){if(!U(a[d],b[d]))return!1;e[d]=!0}for(d in b)if(!(d in e)&&"$"!==d.charAt(0)&&u(b[d])&&!C(b[d]))return!1;return!0}if(!A(b))return!1;if((c=a.length)===b.length){for(d=0;d<c;d++)if(!U(a[d],b[d]))return!1;return!0}}return!1}function V(a,b,c){return a.concat(ue.call(b,c))}function W(a,b){return ue.call(a,b||0)}function X(a,b){var c=arguments.length>2?W(arguments,2):[];return!C(b)||b instanceof RegExp?b:c.length?function(){return arguments.length?b.apply(a,V(c,arguments,0)):b.apply(a,c)}:function(){return arguments.length?b.apply(a,arguments):b.call(a)}}function Y(b,c){var d=c;return"string"==typeof b&&"$"===b.charAt(0)&&"$"===b.charAt(1)?d=void 0:E(c)?d="$WINDOW":c&&a.document===c?d="$DOCUMENT":F(c)&&(d="$SCOPE"),d}function Z(a,b){if(!t(a))return y(b)||(b=b?2:null),JSON.stringify(a,Y,b)}function $(a){return x(a)?JSON.parse(a):a}function _(a,b){a=a.replace(Ie,"");var c=Date.parse("Jan 01, 1970 00:00:00 "+a)/6e4;return Ce(c)?b:c}function aa(a,b){return a=new Date(a.getTime()),a.setMinutes(a.getMinutes()+b),a}function ba(a,b,c){c=c?-1:1;var d=a.getTimezoneOffset();return aa(a,c*(_(b,d)-d))}function ca(a){a=le(a).clone().empty();var b=le("<div></div>").append(a).html();try{return a[0].nodeType===Oe?se(b):b.match(/^(<[^>]+>)/)[1].replace(/^<([\w-]+)/,function(a,b){return"<"+se(b)})}catch(a){return se(b)}}function da(a){try{return decodeURIComponent(a)}catch(a){}}function ea(a){var b={};return f((a||"").split("&"),function(a){var c,d,e;a&&(d=a=a.replace(/\+/g,"%20"),c=a.indexOf("="),-1!==c&&(d=a.substring(0,c),e=a.substring(c+1)),d=da(d),u(d)&&(e=!u(e)||da(e),re.call(b,d)?A(b[d])?b[d].push(e):b[d]=[b[d],e]:b[d]=e))}),b}function fa(a){var b=[];return f(a,function(a,c){A(a)?f(a,function(a){b.push(ha(c,!0)+(!0===a?"":"="+ha(a,!0)))}):b.push(ha(c,!0)+(!0===a?"":"="+ha(a,!0)))}),b.length?b.join("&"):""}function ga(a){return ha(a,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ha(a,b){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,b?"%20":"+")}function ia(a,b){var c,d,e=Je.length;for(d=0;d<e;++d)if(c=Je[d]+b,x(c=a.getAttribute(c)))return c;return null}function ja(b,c){var d,e,g={};if(f(Je,function(a){var c=a+"app";!d&&b.hasAttribute&&b.hasAttribute(c)&&(d=b,e=b.getAttribute(c))}),f(Je,function(a){var c,f=a+"app";!d&&(c=b.querySelector("["+f.replace(":","\\:")+"]"))&&(d=c,e=c.getAttribute(f))}),d){if(!Ke)return void a.console.error("AngularJS: disabling automatic bootstrap. <script> protocol indicates an extension, document.location.href does not match.");g.strictDi=null!==ia(d,"strict-di"),c(d,e?[e]:[],g)}}function ka(b,c,d){v(d)||(d={}),d=l({strictDi:!1},d);var e=function(){if(b=le(b),b.injector()){var e=b[0]===a.document?"document":ca(b);throw ze("btstrpd","App already bootstrapped with this element '{0}'",e.replace(/</,"&lt;").replace(/>/,"&gt;"))}c=c||[],c.unshift(["$provide",function(a){a.value("$rootElement",b)}]),d.debugInfoEnabled&&c.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]),c.unshift("ng");var f=mb(c,d.strictDi);return f.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d),c(b)(a)})}]),f},g=/^NG_ENABLE_DEBUG_INFO!/,h=/^NG_DEFER_BOOTSTRAP!/;if(a&&g.test(a.name)&&(d.debugInfoEnabled=!0,a.name=a.name.replace(g,"")),a&&!h.test(a.name))return e();a.name=a.name.replace(h,""),Ae.resumeBootstrap=function(a){return f(a,function(a){c.push(a)}),e()},C(Ae.resumeDeferredBootstrap)&&Ae.resumeDeferredBootstrap()}function la(){a.name="NG_ENABLE_DEBUG_INFO!"+a.name,a.location.reload()}function ma(a){var b=Ae.element(a).injector();if(!b)throw ze("test","no injector found for element argument to getTestability");return b.get("$$testability")}function na(a,b){return b=b||"_",a.replace(Le,function(a,c){return(c?b:"")+a.toLowerCase()})}function oa(a,b,c){if(!a)throw ze("areq","Argument '{0}' is {1}",b||"?",c||"required");return a}function pa(a,b,c){return c&&A(a)&&(a=a[a.length-1]),oa(C(a),b,"not a function, got "+(a&&"object"==typeof a?a.constructor.name||"Object":typeof a)),a}function qa(a,b){if("hasOwnProperty"===a)throw ze("badname","hasOwnProperty is not a valid {0} name",b)}function ra(a,b,c){if(!b)return a;for(var d,e=b.split("."),f=a,g=e.length,h=0;h<g;h++)d=e[h],a&&(a=(f=a)[d]);return!c&&C(a)?X(f,a):a}function sa(a){for(var b,c=a[0],d=a[a.length-1],e=1;c!==d&&(c=c.nextSibling);e++)(b||a[e]!==c)&&(b||(b=le(ue.call(a,0,e))),b.push(c));return b||a}function ta(){return Object.create(null)}function ua(a){if(null==a)return"";switch(typeof a){case"string":break;case"number":a=""+a;break;default:a=!s(a)||A(a)||z(a)?Z(a):a.toString()}return a}function va(a){function b(a,b,c){return a[b]||(a[b]=c())}var c=d("$injector"),e=d("ng"),f=b(a,"angular",Object);return f.$$minErr=f.$$minErr||d,b(f,"module",function(){var a={};return function(d,f,g){var h={};return function(a,b){if("hasOwnProperty"===a)throw e("badname","hasOwnProperty is not a valid {0} name",b)}(d,"module"),f&&a.hasOwnProperty(d)&&(a[d]=null),b(a,d,function(){function a(a,b,c,d){return d||(d=i),function(){return d[c||"push"]([a,b,arguments]),m}}function b(a,b,c){return c||(c=i),function(e,f){return f&&C(f)&&(f.$$moduleName=d),c.push([a,b,arguments]),m}}if(!f)throw c("nomod","Module '{0}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.",d);var i=[],j=[],k=[],l=a("$injector","invoke","push",j),m={_invokeQueue:i,_configBlocks:j,_runBlocks:k,info:function(a){if(u(a)){if(!v(a))throw e("aobj","Argument '{0}' must be an object","value");return h=a,this}return h},requires:f,name:d,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),decorator:b("$provide","decorator",j),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider","register"),directive:b("$compileProvider","directive"),component:b("$compileProvider","component"),config:l,run:function(a){return k.push(a),this}};return g&&l(g),m})}})}function wa(a,b){if(A(a)){b=b||[];for(var c=0,d=a.length;c<d;c++)b[c]=a[c]}else if(v(a)){b=b||{};for(var e in a)"$"===e.charAt(0)&&"$"===e.charAt(1)||(b[e]=a[e])}return b||a}function xa(a,b){var d=[];return c(b)&&(a=Ae.copy(a,null,b)),JSON.stringify(a,function(a,b){if(b=Y(a,b),v(b)){if(d.indexOf(b)>=0)return"...";d.push(b)}return b})}function ya(a,b){return"function"==typeof a?a.toString().replace(/ \{[\s\S]*$/,""):t(a)?"undefined":"string"!=typeof a?xa(a,b):a}function za(){return++Ue}function Aa(a){return Ca(a.replace(We,"ms-"))}function Ba(a,b){return b.toUpperCase()}function Ca(a){return a.replace(Ve,Ba)}function Da(a){return!$e.test(a)}function Ea(a){var b=a.nodeType;return b===Ne||!b||b===Qe}function Fa(a){for(var b in Te[a.ng339])return!0;return!1}function Ga(a,b){var c,d,e,g,h=b.createDocumentFragment(),i=[];if(Da(a))i.push(b.createTextNode(a));else{for(c=h.appendChild(b.createElement("div")),d=(_e.exec(a)||["",""])[1].toLowerCase(),e=bf[d]||bf._default,c.innerHTML=e[1]+a.replace(af,"<$1></$2>")+e[2],g=e[0];g--;)c=c.lastChild;i=V(i,c.childNodes),c=h.firstChild,c.textContent=""}return h.textContent="",h.innerHTML="",f(i,function(a){h.appendChild(a)}),h}function Ha(b,c){c=c||a.document;var d;return(d=Ze.exec(b))?[c.createElement(d[1])]:(d=Ga(b,c))?d.childNodes:[]}function Ia(a,b){var c=a.parentNode;c&&c.replaceChild(b,a),b.appendChild(a)}function Ja(a){if(a instanceof Ja)return a;var b;if(x(a)&&(a=Ee(a),b=!0),!(this instanceof Ja)){if(b&&"<"!==a.charAt(0))throw Ye("nosel","Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element");return new Ja(a)}b?Va(this,Ha(a)):C(a)?_a(a):Va(this,a)}function Ka(a){return a.cloneNode(!0)}function La(a,b){!b&&Ea(a)&&le.cleanData([a]),a.querySelectorAll&&le.cleanData(a.querySelectorAll("*"))}function Ma(a){var b;for(b in a)return!1;return!0}function Na(a){var b=a.ng339,c=b&&Te[b],d=c&&c.events,e=c&&c.data;e&&!Ma(e)||d&&!Ma(d)||(delete Te[b],a.ng339=void 0)}function Oa(a,b,c,d){if(u(d))throw Ye("offargs","jqLite#off() does not support the `selector` argument");var e=Qa(a),g=e&&e.events,h=e&&e.handle;if(h){if(b){var i=function(b){var d=g[b];u(c)&&R(d||[],c),u(c)&&d&&d.length>0||(a.removeEventListener(b,h),delete g[b])};f(b.split(" "),function(a){i(a),Xe[a]&&i(Xe[a])})}else for(b in g)"$destroy"!==b&&a.removeEventListener(b,h),delete g[b];Na(a)}}function Pa(a,b){var c=a.ng339,d=c&&Te[c];d&&(b?delete d.data[b]:d.data={},Na(a))}function Qa(a,b){var c=a.ng339,d=c&&Te[c];return b&&!d&&(a.ng339=c=za(),d=Te[c]={events:{},data:{},handle:void 0}),d}function Ra(a,b,c){if(Ea(a)){var d,e=u(c),f=!e&&b&&!v(b),g=!b,h=Qa(a,!f),i=h&&h.data;if(e)i[Ca(b)]=c;else{if(g)return i;if(f)return i&&i[Ca(b)];for(d in b)i[Ca(d)]=b[d]}}}function Sa(a,b){return!!a.getAttribute&&(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+b+" ")>-1}function Ta(a,b){if(b&&a.setAttribute){var c=(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),d=c;f(b.split(" "),function(a){a=Ee(a),d=d.replace(" "+a+" "," ")}),d!==c&&a.setAttribute("class",Ee(d))}}function Ua(a,b){if(b&&a.setAttribute){var c=(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),d=c;f(b.split(" "),function(a){a=Ee(a),-1===d.indexOf(" "+a+" ")&&(d+=a+" ")}),d!==c&&a.setAttribute("class",Ee(d))}}function Va(a,b){if(b)if(b.nodeType)a[a.length++]=b;else{var c=b.length;if("number"==typeof c&&b.window!==b){if(c)for(var d=0;d<c;d++)a[a.length++]=b[d]}else a[a.length++]=b}}function Wa(a,b){return Xa(a,"$"+(b||"ngController")+"Controller")}function Xa(a,b,c){a.nodeType===Qe&&(a=a.documentElement);for(var d=A(b)?b:[b];a;){for(var e=0,f=d.length;e<f;e++)if(u(c=le.data(a,d[e])))return c;a=a.parentNode||a.nodeType===Re&&a.host}}function Ya(a){for(La(a,!0);a.firstChild;)a.removeChild(a.firstChild)}function Za(a,b){b||La(a);var c=a.parentNode;c&&c.removeChild(a)}function $a(b,c){c=c||a,"complete"===c.document.readyState?c.setTimeout(b):le(c).on("load",b)}function _a(b){function c(){a.document.removeEventListener("DOMContentLoaded",c),a.removeEventListener("load",c),b()}"complete"===a.document.readyState?a.setTimeout(b):(a.document.addEventListener("DOMContentLoaded",c),a.addEventListener("load",c))}function ab(a,b){var c=ef[b.toLowerCase()];return c&&ff[P(a)]&&c}function bb(a){return gf[a]}function cb(a,b){var c=function(c,d){c.isDefaultPrevented=function(){return c.defaultPrevented};var e=b[d||c.type],f=e?e.length:0;if(f){if(t(c.immediatePropagationStopped)){var g=c.stopImmediatePropagation;c.stopImmediatePropagation=function(){c.immediatePropagationStopped=!0,c.stopPropagation&&c.stopPropagation(),g&&g.call(c)}}c.isImmediatePropagationStopped=function(){return!0===c.immediatePropagationStopped};var h=e.specialHandlerWrapper||db;f>1&&(e=wa(e));for(var i=0;i<f;i++)c.isImmediatePropagationStopped()||h(a,c,e[i])}};return c.elem=a,c}function db(a,b,c){c.call(a,b)}function eb(a,b,c){var d=b.relatedTarget;d&&(d===a||cf.call(a,d))||c.call(a,b)}function fb(){this.$get=function(){return l(Ja,{hasClass:function(a,b){return a.attr&&(a=a[0]),Sa(a,b)},addClass:function(a,b){return a.attr&&(a=a[0]),Ua(a,b)},removeClass:function(a,b){return a.attr&&(a=a[0]),Ta(a,b)}})}}function gb(a,b){var c=a&&a.$$hashKey;if(c)return"function"==typeof c&&(c=a.$$hashKey()),c;var d=typeof a;return c="function"===d||"object"===d&&null!==a?a.$$hashKey=d+":"+(b||i)():d+":"+a}function hb(){this._keys=[],this._values=[],this._lastKey=NaN,this._lastIndex=-1}function ib(a){return Function.prototype.toString.call(a)}function jb(a){var b=ib(a).replace(pf,"");return b.match(lf)||b.match(mf)}function kb(a){var b=jb(a);return b?"function("+(b[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function lb(a,b,c){var d,e,g;if("function"==typeof a){if(!(d=a.$inject)){if(d=[],a.length){if(b)throw x(c)&&c||(c=a.name||kb(a)),qf("strictdi","{0} is not using explicit annotation and cannot be invoked in strict mode",c);e=jb(a),f(e[1].split(nf),function(a){a.replace(of,function(a,b,c){d.push(c)})})}a.$inject=d}}else A(a)?(g=a.length-1,pa(a[g],"fn"),d=a.slice(0,g)):pa(a,"fn",!0);return d}function mb(a,b){function c(a){return function(b,c){if(!v(b))return a(b,c);f(b,h(a))}}function d(a,b){if(qa(a,"service"),(C(b)||A(b))&&(b=w.instantiate(b)),!b.$get)throw qf("pget","Provider '{0}' must define $get factory method.",a);return u[a+p]=b}function e(a,b){return function(){var c=B.invoke(b,this);if(t(c))throw qf("undef","Provider '{0}' must return a value from $get factory method.",a);return c}}function g(a,b,c){return d(a,{$get:!1!==c?e(a,b):b})}function i(a,b){return g(a,["$injector",function(a){return a.instantiate(b)}])}function j(a,b){return g(a,r(b),!1)}function k(a,b){qa(a,"constant"),u[a]=b,y[a]=b}function l(a,b){var c=w.get(a+p),d=c.$get;c.$get=function(){var a=B.invoke(d,c);return B.invoke(b,null,{$delegate:a})}}function m(a){oa(t(a)||A(a),"modulesToLoad","not an array");var b,c=[];return f(a,function(a){function d(a){var b,c;for(b=0,c=a.length;b<c;b++){var d=a[b],e=w.get(d[0]);e[d[1]].apply(e,d[2])}}if(!s.get(a)){s.set(a,!0);try{x(a)?(b=ne(a),B.modules[a]=b,c=c.concat(m(b.requires)).concat(b._runBlocks),d(b._invokeQueue),d(b._configBlocks)):C(a)?c.push(w.invoke(a)):A(a)?c.push(w.invoke(a)):pa(a,"module")}catch(b){throw A(a)&&(a=a[a.length-1]),b.message&&b.stack&&-1===b.stack.indexOf(b.message)&&(b=b.message+"\n"+b.stack),qf("modulerr","Failed to instantiate module {0} due to:\n{1}",a,b.stack||b.message||b)}}}),c}function n(a,c){function d(b,d){if(a.hasOwnProperty(b)){if(a[b]===o)throw qf("cdep","Circular dependency found: {0}",b+" <- "+q.join(" <- "));return a[b]}try{return q.unshift(b),a[b]=o,a[b]=c(b,d),a[b]}catch(c){throw a[b]===o&&delete a[b],c}finally{q.shift()}}function e(a,c,e){for(var f=[],g=mb.$$annotate(a,b,e),h=0,i=g.length;h<i;h++){var j=g[h];if("string"!=typeof j)throw qf("itkn","Incorrect injection token! Expected service name as string, got {0}",j);f.push(c&&c.hasOwnProperty(j)?c[j]:d(j,e))}return f}function f(a){if(ke||"function"!=typeof a)return!1;var b=a.$$ngIsClass;return J(b)||(b=a.$$ngIsClass=/^class\b/.test(ib(a))),b}function g(a,b,c,d){"string"==typeof c&&(d=c,c=null);var g=e(a,c,d);return A(a)&&(a=a[a.length-1]),f(a)?(g.unshift(null),new(Function.prototype.bind.apply(a,g))):a.apply(b,g)}function h(a,b,c){var d=A(a)?a[a.length-1]:a,f=e(a,b,c);return f.unshift(null),new(Function.prototype.bind.apply(d,f))}return{invoke:g,instantiate:h,get:d,annotate:mb.$$annotate,has:function(b){return u.hasOwnProperty(b+p)||a.hasOwnProperty(b)}}}b=!0===b;var o={},p="Provider",q=[],s=new jf,u={$provide:{provider:c(d),factory:c(g),service:c(i),value:c(j),constant:c(k),decorator:l}},w=u.$injector=n(u,function(a,b){throw Ae.isString(b)&&q.push(b),qf("unpr","Unknown provider: {0}",q.join(" <- "))}),y={},z=n(y,function(a,b){var c=w.get(a+p,b);return B.invoke(c.$get,c,void 0,a)}),B=z;u["$injector"+p]={$get:r(z)},B.modules=w.modules=ta();var D=m(a);return B=z.get("$injector"),B.strictDi=b,f(D,function(a){a&&B.invoke(a)}),B.loadNewModules=function(a){f(m(a),function(a){a&&B.invoke(a)})},B}function nb(){var a=!0;this.disableAutoScrolling=function(){a=!1},this.$get=["$window","$location","$rootScope",function(b,c,d){function e(a){var b=null;return Array.prototype.some.call(a,function(a){if("a"===P(a))return b=a,!0}),b}function f(){var a=h.yOffset;if(C(a))a=a();else if(N(a)){var c=a[0],d=b.getComputedStyle(c);a="fixed"!==d.position?0:c.getBoundingClientRect().bottom}else y(a)||(a=0);return a}function g(a){if(a){a.scrollIntoView();var c=f();if(c){var d=a.getBoundingClientRect().top;b.scrollBy(0,d-c)}}else b.scrollTo(0,0)}function h(a){a=x(a)?a:y(a)?a.toString():c.hash();var b;a?(b=i.getElementById(a))?g(b):(b=e(i.getElementsByName(a)))?g(b):"top"===a&&g(null):g(null)}var i=b.document;return a&&d.$watch(function(){return c.hash()},function(a,b){a===b&&""===a||$a(function(){d.$evalAsync(h)})}),h}]}function ob(a,b){return a||b?a?b?(A(a)&&(a=a.join(" ")),A(b)&&(b=b.join(" ")),a+" "+b):a:b:""}function pb(a){for(var b=0;b<a.length;b++){var c=a[b];if(c.nodeType===sf)return c}}function qb(a){x(a)&&(a=a.split(" "));var b=ta();return f(a,function(a){a.length&&(b[a]=!0)}),b}function rb(a){return v(a)?a:{}}function sb(a){var b=a.indexOf("#");return-1===b?"":a.substr(b)}function tb(a){return a.replace(/#$/,"")}function ub(a,b,c,d,e){function g(){w=null,i()}function h(){r=x(),r=t(r)?null:r,U(r,A)&&(r=A),A=r,s=r}function i(){var a=s;h(),u===j.url()&&a===r||(u=j.url(),s=r,f(y,function(a){a(j.url(),r)}))}var j=this,k=a.location,l=a.history,m=a.setTimeout,n=a.clearTimeout,o={},q=e(c);j.isMock=!1,j.$$completeOutstandingRequest=q.completeTask,j.$$incOutstandingRequestCount=q.incTaskCount,j.notifyWhenNoOutstandingRequests=q.notifyWhenNoPendingTasks;var r,s,u=k.href,v=b.find("base"),w=null,x=d.history?function(){try{return l.state}catch(a){}}:p;h(),j.url=function(b,c,e){if(t(e)&&(e=null),k!==a.location&&(k=a.location),l!==a.history&&(l=a.history),b){var f=s===e;if(b=Yc(b).href,u===b&&(!d.history||f))return j;var g=u&&ec(u)===ec(b);return u=b,s=e,!d.history||g&&f?(g||(w=b),c?k.replace(b):g?k.hash=sb(b):k.href=b,k.href!==b&&(w=b)):(l[c?"replaceState":"pushState"](e,"",b),h()),w&&(w=b),j}return tb(w||k.href)},j.state=function(){return r};var y=[],z=!1,A=null;j.onUrlChange=function(b){return z||(d.history&&le(a).on("popstate",g),le(a).on("hashchange",g),z=!0),y.push(b),b},j.$$applicationDestroyed=function(){le(a).off("hashchange popstate",g)},j.$$checkUrlChange=i,j.baseHref=function(){var a=v.attr("href");return a?a.replace(/^(https?:)?\/\/[^\/]*/,""):""},j.defer=function(a,b,c){var d;return b=b||0,c=c||q.DEFAULT_TASK_TYPE,q.incTaskCount(c),d=m(function(){delete o[d],q.completeTask(a,c)},b),o[d]=c,d},j.defer.cancel=function(a){if(o.hasOwnProperty(a)){var b=o[a];return delete o[a],n(a),q.completeTask(p,b),!0}return!1}}function vb(){this.$get=["$window","$log","$sniffer","$document","$$taskTrackerFactory",function(a,b,c,d,e){return new ub(a,d,b,c,e)}]}function wb(){this.$get=function(){function a(a,c){function e(a){a!==m&&(n?n===a&&(n=a.n):n=a,f(a.n,a.p),f(a,m),m=a,m.n=null)}function f(a,b){a!==b&&(a&&(a.p=b),b&&(b.n=a))}if(a in b)throw d("$cacheFactory")("iid","CacheId '{0}' is already taken!",a);var g=0,h=l({},c,{id:a}),i=ta(),j=c&&c.capacity||Number.MAX_VALUE,k=ta(),m=null,n=null;return b[a]={put:function(a,b){if(!t(b)){if(j<Number.MAX_VALUE){e(k[a]||(k[a]={key:a}))}return a in i||g++,i[a]=b,g>j&&this.remove(n.key),b}},get:function(a){if(j<Number.MAX_VALUE){var b=k[a];if(!b)return;e(b)}return i[a]},remove:function(a){if(j<Number.MAX_VALUE){var b=k[a];if(!b)return;b===m&&(m=b.p),b===n&&(n=b.n),f(b.n,b.p),delete k[a]}a in i&&(delete i[a],g--)},removeAll:function(){i=ta(),g=0,k=ta(),m=n=null},destroy:function(){i=null,h=null,k=null,delete b[a]},info:function(){return l({},h,{size:g})}}}var b={};return a.info=function(){var a={};return f(b,function(b,c){a[c]=b.info()}),a},a.get=function(a){return b[a]},a}}function xb(){this.$get=["$cacheFactory",function(a){return a("templates")}]}function yb(){}function zb(b,c){function d(a,b,c){var d=/^([@&]|[=<](\*?))(\??)\s*([\w$]*)$/,e=ta();return f(a,function(a,f){if((a=a.trim())in D)return void(e[f]=D[a]);var g=a.match(d);if(!g)throw zf("iscp","Invalid {3} for directive '{0}'. Definition: {... {1}: '{2}' ...}",b,f,a,c?"controller bindings definition":"isolate scope definition");e[f]={mode:g[1][0],collection:"*"===g[2],optional:"?"===g[3],attrName:g[4]||f},g[4]&&(D[a]=e[f])}),e}function e(a,b){var c={isolateScope:null,bindToController:null};if(v(a.scope)&&(!0===a.bindToController?(c.bindToController=d(a.scope,b,!0),c.isolateScope={}):c.isolateScope=d(a.scope,b,!1)),v(a.bindToController)&&(c.bindToController=d(a.bindToController,b,!0)),c.bindToController&&!a.controller)throw zf("noctrl","Cannot bind to controller without directive '{0}'s controller.",b);return c}function g(a){var b=a.charAt(0);if(!b||b!==se(b))throw zf("baddir","Directive/Component name '{0}' is invalid. The first character must be a lowercase letter",a);if(a!==a.trim())throw zf("baddir","Directive/Component name '{0}' is invalid. The name should not contain leading or trailing whitespaces",a)}function i(a){var b=a.require||a.controller&&a.name;return!A(b)&&v(b)&&f(b,function(a,c){var d=a.match(y);a.substring(d[0].length)||(b[c]=d[0]+c)}),b}function j(a,b){if(a&&(!x(a)||!/[EACM]/.test(a)))throw zf("badrestrict","Restrict property '{0}' of directive '{1}' is invalid",a,b);return a||"EA"}var k={},m="Directive",n=/^\s*directive:\s*([\w-]+)\s+(.*)$/,s=/(([\w-]+)(?::([^;]+))?;?)/,w=O("ngSrc,ngSrcset,src,srcset"),y=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,z=/^(on[a-z]+|formaction)$/,D=ta();this.directive=function a(c,d){return oa(c,"name"),qa(c,"directive"),x(c)?(g(c),oa(d,"directiveFactory"),k.hasOwnProperty(c)||(k[c]=[],b.factory(c+m,["$injector","$exceptionHandler",function(a,b){var d=[];return f(k[c],function(e,f){try{var g=a.invoke(e);C(g)?g={compile:r(g)}:!g.compile&&g.link&&(g.compile=r(g.link)),g.priority=g.priority||0,g.index=f,g.name=g.name||c,g.require=i(g),g.restrict=j(g.restrict,c),g.$$moduleName=e.$$moduleName,d.push(g)}catch(a){b(a)}}),d}])),k[c].push(d)):f(c,h(a)),this},this.component=function a(b,c){function d(a){function b(b){return C(b)||A(b)?function(c,d){return a.invoke(b,this,{$element:c,$attrs:d})}:b}var d=c.template||c.templateUrl?c.template:"",g={controller:e,controllerAs:Eb(c.controller)||c.controllerAs||"$ctrl",template:b(d),templateUrl:b(c.templateUrl),transclude:c.transclude,scope:{},bindToController:c.bindings||{},restrict:"E",require:c.require};return f(c,function(a,b){"$"===b.charAt(0)&&(g[b]=a)}),g}if(!x(b))return f(b,h(X(this,a))),this;var e=c.controller||function(){};return f(c,function(a,b){"$"===b.charAt(0)&&(d[b]=a,C(e)&&(e[b]=a))}),d.$inject=["$injector"],this.directive(b,d)},this.aHrefSanitizationWhitelist=function(a){return u(a)?(c.aHrefSanitizationWhitelist(a),this):c.aHrefSanitizationWhitelist()},this.imgSrcSanitizationWhitelist=function(a){return u(a)?(c.imgSrcSanitizationWhitelist(a),this):c.imgSrcSanitizationWhitelist()};var E=!0;this.debugInfoEnabled=function(a){return u(a)?(E=a,this):E};var G=!1;this.strictComponentBindingsEnabled=function(a){return u(a)?(G=a,this):G};var H=10;this.onChangesTtl=function(a){return arguments.length?(H=a,this):H};var I=!0;this.commentDirectivesEnabled=function(a){return arguments.length?(I=a,this):I};var K=!0;this.cssClassDirectivesEnabled=function(a){return arguments.length?(K=a,this):K};var L=ta();this.addPropertySecurityContext=function(a,b,c){var d=a.toLowerCase()+"|"+b.toLowerCase();if(d in L&&L[d]!==c)throw zf("ctxoverride","Property context '{0}.{1}' already set to '{2}', cannot override to '{3}'.",a,b,L[d],c);return L[d]=c,this},function(){function a(a,b){f(b,function(b){L[b.toLowerCase()]=a})}a(cg.HTML,["iframe|srcdoc","*|innerHTML","*|outerHTML"]),a(cg.CSS,["*|style"]),a(cg.URL,["area|href","area|ping","a|href","a|ping","blockquote|cite","body|background","del|cite","input|src","ins|cite","q|cite"]),a(cg.MEDIA_URL,["audio|src","img|src","img|srcset","source|src","source|srcset","track|src","video|src","video|poster"]),a(cg.RESOURCE_URL,["*|formAction","applet|code","applet|codebase","base|href","embed|src","frame|src","form|action","head|profile","html|manifest","iframe|src","link|href","media|src","object|codebase","object|data","script|src"])}(),this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$sce","$animate",function(b,c,d,g,h,i,j,r,u){function D(){try{if(!--Ma)throw Ga=void 0,zf("infchng","{0} $onChanges() iterations reached. Aborting!\n",H);j.$apply(function(){for(var a=0,b=Ga.length;a<b;++a)try{Ga[a]()}catch(a){d(a)}Ga=void 0})}finally{Ma++}}function M(a,b){if(!a)return a;if(!x(a))throw zf("srcset",'Can\'t pass trusted values to `{0}`: "{1}"',b,a.toString());for(var c="",d=Ee(a),e=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,f=/\s/.test(d)?e:/(,)/,g=d.split(f),h=Math.floor(g.length/2),i=0;i<h;i++){var j=2*i;c+=r.getTrustedMediaUrl(Ee(g[j])),c+=" "+Ee(g[j+1])}var k=Ee(g[2*i]).split(/\s/);return c+=r.getTrustedMediaUrl(Ee(k[0])),2===k.length&&(c+=" "+Ee(k[1])),c}function N(a,b){if(b){var c,d,e,f=Object.keys(b);for(c=0,d=f.length;c<d;c++)e=f[c],this[e]=b[e]}else this.$attr={};this.$$element=a}function O(a,b,c){Ia.innerHTML="<span "+b+">";var d=Ia.firstChild.attributes,e=d[0];d.removeNamedItem(e.name),e.value=c,a.attributes.setNamedItem(e)}function Q(a,b){try{a.addClass(b)}catch(a){}}function S(a,b,c,d,e){a instanceof le||(a=le(a));var f=Y(a,b,a,c,d,e);S.$$addScopeClass(a);var g=null;return function(b,c,d){if(!a)throw zf("multilink","This element has already been linked.");oa(b,"scope"),e&&e.needsNewScope&&(b=b.$parent.$new()),d=d||{}
2
+ ;var h=d.parentBoundTranscludeFn,i=d.transcludeControllers,j=d.futureParentElement;h&&h.$$boundTransclude&&(h=h.$$boundTransclude),g||(g=V(j));var k;if(k="html"!==g?le(sa(g,le("<div></div>").append(a).html())):c?df.clone.call(a):a,i)for(var l in i)k.data("$"+l+"Controller",i[l].instance);return S.$$addScopeInfo(k,b),c&&c(k,b),f&&f(b,k,k,h),c||(a=f=null),k}}function V(a){var b=a&&a[0];return b&&"foreignobject"!==P(b)&&xe.call(b).match(/SVG/)?"svg":"html"}function Y(a,b,c,d,e,f){function g(a,c,d,e){var f,g,h,i,j,k,l,m,p;if(n){var q=c.length;for(p=new Array(q),j=0;j<o.length;j+=3)l=o[j],p[l]=c[l]}else p=c;for(j=0,k=o.length;j<k;)h=p[o[j++]],f=o[j++],g=o[j++],f?(f.scope?(i=a.$new(),S.$$addScopeInfo(le(h),i)):i=a,m=f.transcludeOnThisElement?$(a,f.transclude,e):!f.templateOnThisElement&&e?e:!e&&b?$(a,b):null,f(g,i,h,d,m)):g&&g(a,h.childNodes,void 0,e)}for(var h,i,j,k,l,m,n,o=[],p=A(a)||a instanceof le,q=0;q<a.length;q++)h=new N,11===ke&&Z(a,q,p),i=_(a[q],[],h,0===q?d:void 0,e),j=i.length?fa(i,a[q],h,b,c,null,[],[],f):null,j&&j.scope&&S.$$addScopeClass(h.$$element),l=j&&j.terminal||!(k=a[q].childNodes)||!k.length?null:Y(k,j?(j.transcludeOnThisElement||!j.templateOnThisElement)&&j.transclude:b),(j||l)&&(o.push(q,j,l),m=!0,n=n||j),f=null;return m?g:null}function Z(a,b,c){var d,e=a[b],f=e.parentNode;if(e.nodeType===Oe)for(;;){if(!(d=f?e.nextSibling:a[b+1])||d.nodeType!==Oe)break;e.nodeValue=e.nodeValue+d.nodeValue,d.parentNode&&d.parentNode.removeChild(d),c&&d===a[b+1]&&a.splice(b+1,1)}}function $(a,b,c){function d(d,e,f,g,h){return d||(d=a.$new(!1,h),d.$$transcluded=!0),b(d,e,{parentBoundTranscludeFn:c,transcludeControllers:f,futureParentElement:g})}var e=d.$$slots=ta();for(var f in b.$$slots)b.$$slots[f]?e[f]=$(a,b.$$slots[f],c):e[f]=null;return d}function _(a,b,c,d,e){var f,g,h,i=a.nodeType,j=c.$attr;switch(i){case Ne:g=P(a),ja(b,Bb(g),"E",d,e);for(var k,l,m,n,o,p=a.attributes,q=0,r=p&&p.length;q<r;q++){var t,u=!1,w=!1,y=!1,z=!1,A=!1;k=p[q],l=k.name,n=k.value,m=Bb(l.toLowerCase()),(o=m.match(Qa))?(y="Attr"===o[1],z="Prop"===o[1],A="On"===o[1],l=l.replace(Bf,"").toLowerCase().substr(4+o[1].length).replace(/_(.)/g,function(a,b){return b.toUpperCase()})):(t=m.match(Ra))&&ka(t[1])&&(u=l,w=l.substr(0,l.length-5)+"end",l=l.substr(0,l.length-6)),z||A?(c[m]=n,j[m]=k.name,z?xa(a,b,m,l):ya(b,m,l)):(m=Bb(l.toLowerCase()),j[m]=l,!y&&c.hasOwnProperty(m)||(c[m]=n,ab(a,m)&&(c[m]=!0)),za(a,b,n,m,y),ja(b,m,"A",d,e,u,w))}if("input"===g&&"hidden"===a.getAttribute("type")&&a.setAttribute("autocomplete","off"),!La)break;if(h=a.className,v(h)&&(h=h.animVal),x(h)&&""!==h)for(;f=s.exec(h);)m=Bb(f[2]),ja(b,m,"C",d,e)&&(c[m]=Ee(f[3])),h=h.substr(f.index+f[0].length);break;case Oe:ra(b,a.nodeValue);break;case Pe:if(!Ja)break;aa(a,b,c,d,e)}return b.sort(pa),b}function aa(a,b,c,d,e){try{var f=n.exec(a.nodeValue);if(f){var g=Bb(f[1]);ja(b,g,"M",d,e)&&(c[g]=Ee(f[2]))}}catch(a){}}function ba(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b))do{if(!a)throw zf("uterdir","Unterminated attribute, found '{0}' but no matching '{1}' found.",b,c);a.nodeType===Ne&&(a.hasAttribute(b)&&e++,a.hasAttribute(c)&&e--),d.push(a),a=a.nextSibling}while(e>0);else d.push(a);return le(d)}function da(a,b,c){return function(d,e,f,g,h){return e=ba(e[0],b,c),a(d,e,f,g,h)}}function ea(a,b,c,d,e,f){var g;return a?S(b,c,d,e,f):function(){return g||(g=S(b,c,d,e,f),b=c=f=null),g.apply(this,arguments)}}function fa(b,c,e,g,h,i,j,k,m){function n(a,b,c,d){a&&(c&&(a=da(a,c,d)),a.require=p.require,a.directiveName=q,(z===p||p.$$isolateScope)&&(a=Ba(a,{isolateScope:!0})),j.push(a)),b&&(c&&(b=da(b,c,d)),b.require=p.require,b.directiveName=q,(z===p||p.$$isolateScope)&&(b=Ba(b,{isolateScope:!0})),k.push(b))}function o(a,b,g,h,i){function m(a,b,c,d){var e;if(F(a)||(d=c,c=b,b=a,a=void 0),H&&(e=s),c||(c=H?w.parent():w),!d)return i(a,b,e,c,L);var f=i.$$slots[d];if(f)return f(a,b,e,c,L);if(t(f))throw zf("noslot",'No parent directive that requires a transclusion with slot name "{0}". Element: {1}',d,ca(w))}var n,o,p,q,r,s,u,w,D,E;c===g?(D=e,w=e.$$element):(w=le(g),D=new N(w,e)),r=b,z?q=b.$new(!0):x&&(r=b.$parent),i&&(u=m,u.$$boundTransclude=i,u.isSlotFilled=function(a){return!!i.$$slots[a]}),y&&(s=ha(w,D,u,y,q,b,z)),z&&(S.$$addScopeInfo(w,q,!0,!(B&&(B===z||B===z.$$originalDirective))),S.$$addScopeClass(w,!0),q.$$isolateBindings=z.$$isolateBindings,E=Fa(b,D,q,q.$$isolateBindings,z),E.removeWatches&&q.$on("$destroy",E.removeWatches));for(var G in s){var I=y[G],J=s[G],K=I.$$bindings.bindToController;J.instance=J(),w.data("$"+I.name+"Controller",J.instance),J.bindingInfo=Fa(r,D,J.instance,K,I)}for(f(y,function(a,b){var c=a.require;a.bindToController&&!A(c)&&v(c)&&l(s[b].instance,ga(b,c,w,s))}),f(s,function(a){var b=a.instance;if(C(b.$onChanges))try{b.$onChanges(a.bindingInfo.initialChanges)}catch(a){d(a)}if(C(b.$onInit))try{b.$onInit()}catch(a){d(a)}C(b.$doCheck)&&(r.$watch(function(){b.$doCheck()}),b.$doCheck()),C(b.$onDestroy)&&r.$on("$destroy",function(){b.$onDestroy()})}),n=0,o=j.length;n<o;n++)p=j[n],Ca(p,p.isolateScope?q:b,w,D,p.require&&ga(p.directiveName,p.require,w,s),u);var L=b;for(z&&(z.template||null===z.templateUrl)&&(L=q),a&&a(L,g.childNodes,void 0,i),n=k.length-1;n>=0;n--)p=k[n],Ca(p,p.isolateScope?q:b,w,D,p.require&&ga(p.directiveName,p.require,w,s),u);f(s,function(a){var b=a.instance;C(b.$postLink)&&b.$postLink()})}m=m||{};for(var p,q,r,s,u,w=-Number.MAX_VALUE,x=m.newScopeDirective,y=m.controllerDirectives,z=m.newIsolateScopeDirective,B=m.templateDirective,D=m.nonTlbTranscludeDirective,E=!1,G=!1,H=m.hasElementTranscludeDirective,I=e.$$element=le(c),J=i,K=g,L=!1,M=!1,O=0,Q=b.length;O<Q;O++){p=b[O];var R=p.$$start,T=p.$$end;if(R&&(I=ba(c,R,T)),r=void 0,w>p.priority)break;if(u=p.scope,u&&(p.templateUrl||(v(u)?(qa("new/isolated scope",z||x,p,I),z=p):qa("new/isolated scope",z,p,I)),x=x||p),q=p.name,!L&&(p.replace&&(p.templateUrl||p.template)||p.transclude&&!p.$$tlb)){for(var U,V=O+1;U=b[V++];)if(U.transclude&&!U.$$tlb||U.replace&&(U.templateUrl||U.template)){M=!0;break}L=!0}if(!p.templateUrl&&p.controller&&(y=y||ta(),qa("'"+q+"' controller",y[q],p,I),y[q]=p),u=p.transclude)if(E=!0,p.$$tlb||(qa("transclusion",D,p,I),D=p),"element"===u)H=!0,w=p.priority,r=I,I=e.$$element=le(S.$$createComment(q,e[q])),c=I[0],Aa(h,W(r),c),K=ea(M,r,g,w,J&&J.name,{nonTlbTranscludeDirective:D});else{var Y=ta();if(v(u)){r=a.document.createDocumentFragment();var Z=ta(),$=ta();f(u,function(a,b){var c="?"===a.charAt(0);a=c?a.substring(1):a,Z[a]=b,Y[b]=null,$[b]=c}),f(I.contents(),function(b){var c=Z[Bb(P(b))];c?($[c]=!0,Y[c]=Y[c]||a.document.createDocumentFragment(),Y[c].appendChild(b)):r.appendChild(b)}),f($,function(a,b){if(!a)throw zf("reqslot","Required transclusion slot `{0}` was not filled.",b)});for(var aa in Y)if(Y[aa]){var fa=le(Y[aa].childNodes);Y[aa]=ea(M,fa,g)}r=le(r.childNodes)}else r=le(Ka(c)).contents();I.empty(),K=ea(M,r,g,void 0,void 0,{needsNewScope:p.$$isolateScope||p.$$newScope}),K.$$slots=Y}if(p.template)if(G=!0,qa("template",B,p,I),B=p,u=C(p.template)?p.template(I,e):p.template,u=Pa(u),p.replace){if(J=p,r=Da(u)?[]:Db(sa(p.templateNamespace,Ee(u))),c=r[0],1!==r.length||c.nodeType!==Ne)throw zf("tplrt","Template for directive '{0}' must have exactly one root element. {1}",q,"");Aa(h,I,c);var ja={$attr:{}},ka=_(c,[],ja),na=b.splice(O+1,b.length-(O+1));(z||x)&&ia(ka,z,x),b=b.concat(ka).concat(na),la(e,ja),Q=b.length}else I.html(u);if(p.templateUrl)G=!0,qa("template",B,p,I),B=p,p.replace&&(J=p),o=ma(b.splice(O,b.length-O),I,e,h,E&&K,j,k,{controllerDirectives:y,newScopeDirective:x!==p&&x,newIsolateScopeDirective:z,templateDirective:B,nonTlbTranscludeDirective:D}),Q=b.length;else if(p.compile)try{s=p.compile(I,e,K);var oa=p.$$originalDirective||p;C(s)?n(null,X(oa,s),R,T):s&&n(X(oa,s.pre),X(oa,s.post),R,T)}catch(a){d(a,ca(I))}p.terminal&&(o.terminal=!0,w=Math.max(w,p.priority))}return o.scope=x&&!0===x.scope,o.transcludeOnThisElement=E,o.templateOnThisElement=G,o.transclude=K,m.hasElementTranscludeDirective=H,o}function ga(a,b,c,d){var e;if(x(b)){var g=b.match(y),h=b.substring(g[0].length),i=g[1]||g[3],j="?"===g[2];if("^^"===i?c=c.parent():(e=d&&d[h],e=e&&e.instance),!e){var k="$"+h+"Controller";e="^^"===i&&c[0]&&c[0].nodeType===Qe?null:i?c.inheritedData(k):c.data(k)}if(!e&&!j)throw zf("ctreq","Controller '{0}', required by directive '{1}', can't be found!",h,a)}else if(A(b)){e=[];for(var l=0,m=b.length;l<m;l++)e[l]=ga(a,b[l],c,d)}else v(b)&&(e={},f(b,function(b,f){e[f]=ga(a,b,c,d)}));return e||null}function ha(a,b,c,d,e,f,g){var h=ta();for(var j in d){var k=d[j],l={$scope:k===g||k.$$isolateScope?e:f,$element:a,$attrs:b,$transclude:c},m=k.controller;"@"===m&&(m=b[k.name]);var n=i(m,l,!0,k.controllerAs);h[k.name]=n,a.data("$"+k.name+"Controller",n.instance)}return h}function ia(a,b,c){for(var d=0,e=a.length;d<e;d++)a[d]=o(a[d],{$$isolateScope:b,$$newScope:c})}function ja(a,c,d,f,g,h,i){if(c===g)return null;var j=null;if(k.hasOwnProperty(c))for(var l,n=b.get(c+m),p=0,q=n.length;p<q;p++)if(l=n[p],(t(f)||f>l.priority)&&-1!==l.restrict.indexOf(d)){if(h&&(l=o(l,{$$start:h,$$end:i})),!l.$$bindings){var r=l.$$bindings=e(l,l.name);v(r.isolateScope)&&(l.$$isolateBindings=r.isolateScope)}a.push(l),j=l}return j}function ka(a){if(k.hasOwnProperty(a))for(var c,d=b.get(a+m),e=0,f=d.length;e<f;e++)if(c=d[e],c.multiElement)return!0;return!1}function la(a,b){var c=b.$attr,d=a.$attr;f(a,function(d,e){"$"!==e.charAt(0)&&(b[e]&&b[e]!==d&&(d.length?d+=("style"===e?";":" ")+b[e]:d=b[e]),a.$set(e,d,!0,c[e]))}),f(b,function(b,e){a.hasOwnProperty(e)||"$"===e.charAt(0)||(a[e]=b,"class"!==e&&"style"!==e&&(d[e]=c[e]))})}function ma(a,b,c,e,h,i,j,k){var l,m,n=[],p=b[0],q=a.shift(),r=o(q,{templateUrl:null,transclude:null,replace:null,$$originalDirective:q}),s=C(q.templateUrl)?q.templateUrl(b,c):q.templateUrl,t=q.templateNamespace;return b.empty(),g(s).then(function(d){var g,o,u,w;if(d=Pa(d),q.replace){if(u=Da(d)?[]:Db(sa(t,Ee(d))),g=u[0],1!==u.length||g.nodeType!==Ne)throw zf("tplrt","Template for directive '{0}' must have exactly one root element. {1}",q.name,s);o={$attr:{}},Aa(e,b,g);var x=_(g,[],o);v(q.scope)&&ia(x,!0),a=x.concat(a),la(c,o)}else g=p,b.html(d);for(a.unshift(r),l=fa(a,g,c,h,b,q,i,j,k),f(e,function(a,c){a===g&&(e[c]=b[0])}),m=Y(b[0].childNodes,h);n.length;){var y=n.shift(),z=n.shift(),A=n.shift(),B=n.shift(),C=b[0];if(!y.$$destroyed){if(z!==p){var D=z.className;k.hasElementTranscludeDirective&&q.replace||(C=Ka(g)),Aa(A,le(z),C),Q(le(C),D)}w=l.transcludeOnThisElement?$(y,l.transclude,B):B,l(m,y,C,e,w)}}n=null}).catch(function(a){B(a)&&d(a)}),function(a,b,c,d,e){var f=e;b.$$destroyed||(n?n.push(b,c,d,f):(l.transcludeOnThisElement&&(f=$(b,l.transclude,e)),l(m,b,c,d,f)))}}function pa(a,b){var c=b.priority-a.priority;return 0!==c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function qa(a,b,c,d){function e(a){return a?" (module: "+a+")":""}if(b)throw zf("multidir","Multiple directives [{0}{1}, {2}{3}] asking for {4} on: {5}",b.name,e(b.$$moduleName),c.name,e(c.$$moduleName),a,ca(d))}function ra(a,b){var d=c(b,!0);d&&a.push({priority:0,compile:function(a){var b=a.parent(),c=!!b.length;return c&&S.$$addBindingClass(b),function(a,b){var e=b.parent();c||S.$$addBindingClass(e),S.$$addBindingInfo(e,d.expressions),a.$watch(d,function(a){b[0].nodeValue=a})}}})}function sa(b,c){switch(b=se(b||"html")){case"svg":case"math":var d=a.document.createElement("div");return d.innerHTML="<"+b+">"+c+"</"+b+">",d.childNodes[0].childNodes;default:return c}}function ua(a,b){return"srcdoc"===b?r.HTML:"src"===b||"ngSrc"===b?-1===["img","video","audio","source","track"].indexOf(a)?r.RESOURCE_URL:r.MEDIA_URL:"xlinkHref"===b?"image"===a?r.MEDIA_URL:"a"===a?r.URL:r.RESOURCE_URL:"form"===a&&"action"===b||"base"===a&&"href"===b||"link"===a&&"href"===b?r.RESOURCE_URL:"a"!==a||"href"!==b&&"ngHref"!==b?void 0:r.URL}function va(a,b){var c=b.toLowerCase();return L[a+"|"+c]||L["*|"+c]}function wa(a){return M(r.valueOf(a),"ng-prop-srcset")}function xa(a,b,c,d){if(z.test(d))throw zf("nodomevents","Property bindings for HTML DOM event properties are disallowed");var e=P(a),f=va(e,d),g=q;"srcset"!==d||"img"!==e&&"source"!==e?f&&(g=r.getTrusted.bind(r,f)):g=wa,b.push({priority:100,compile:function(a,b){var e=h(b[c]),f=h(b[c],function(a){return r.valueOf(a)});return{pre:function(a,b){function c(){var c=e(a);b[0][d]=g(c)}c(),a.$watch(f,c)}}}})}function ya(a,b,c){a.push(ce(h,j,d,b,c,!1))}function za(a,b,d,e,f){var g=P(a),h=ua(g,e),i=!f,j=w[e]||f,k=c(d,i,h,j);if(k){if("multiple"===e&&"select"===g)throw zf("selmulti","Binding to the 'multiple' attribute is not supported. Element: {0}",ca(a));if(z.test(e))throw zf("nodomevents","Interpolations for HTML DOM event attributes are disallowed");b.push({priority:100,compile:function(){return{pre:function(a,b,f){var g=f.$$observers||(f.$$observers=ta()),i=f[e];i!==d&&(k=i&&c(i,!0,h,j),d=i),k&&(f[e]=k(a),(g[e]||(g[e]=[])).$$inter=!0,(f.$$observers&&f.$$observers[e].$$scope||a).$watch(k,function(a,b){"class"===e&&a!==b?f.$updateClass(a,b):f.$set(e,a)}))}}}})}}function Aa(b,c,d){var e,f,g=c[0],h=c.length,i=g.parentNode;if(b)for(e=0,f=b.length;e<f;e++)if(b[e]===g){b[e++]=d;for(var j=e,k=j+h-1,l=b.length;j<l;j++,k++)k<l?b[j]=b[k]:delete b[j];b.length-=h-1,b.context===g&&(b.context=d);break}i&&i.replaceChild(d,g);var m=a.document.createDocumentFragment();for(e=0;e<h;e++)m.appendChild(c[e]);for(le.hasData(g)&&(le.data(d,le.data(g)),le(g).off("$destroy")),le.cleanData(m.querySelectorAll("*")),e=1;e<h;e++)delete c[e];c[0]=d,c.length=1}function Ba(a,b){return l(function(){return a.apply(null,arguments)},a,b)}function Ca(a,b,c,e,f,g){try{a(b,c,e,f,g)}catch(a){d(a,ca(c))}}function Ea(a,b){if(G)throw zf("missingattr","Attribute '{0}' of '{1}' is non-optional and must be set!",a,b)}function Fa(a,b,d,e,g){function i(b,c,e){C(d.$onChanges)&&!T(c,e)&&(Ga||(a.$$postDigest(D),Ga=[]),k||(k={},Ga.push(j)),k[b]&&(e=k[b].previousValue),k[b]=new Ab(e,c))}function j(){d.$onChanges(k),k=void 0}var k,l=[],m={};return f(e,function(e,f){var j,k,n,o,q,r=e.attrName,s=e.optional,t=e.mode;switch(t){case"@":s||re.call(b,r)||(Ea(r,g.name),d[f]=b[r]=void 0),q=b.$observe(r,function(a){if(x(a)||J(a)){var b=d[f];i(f,a,b),d[f]=a}}),b.$$observers[r].$$scope=a,j=b[r],x(j)?d[f]=c(j)(a):J(j)&&(d[f]=j),m[f]=new Ab(Af,d[f]),l.push(q);break;case"=":if(!re.call(b,r)){if(s)break;Ea(r,g.name),b[r]=void 0}if(s&&!b[r])break;k=h(b[r]),o=k.literal?U:T,n=k.assign||function(){throw j=d[f]=k(a),zf("nonassign","Expression '{0}' in attribute '{1}' used with directive '{2}' is non-assignable!",b[r],r,g.name)},j=d[f]=k(a);var u=function(b){return o(b,d[f])||(o(b,j)?n(a,b=d[f]):d[f]=b),j=b};u.$stateful=!0,q=e.collection?a.$watchCollection(b[r],u):a.$watch(h(b[r],u),null,k.literal),l.push(q);break;case"<":if(!re.call(b,r)){if(s)break;Ea(r,g.name),b[r]=void 0}if(s&&!b[r])break;k=h(b[r]);var v=k.literal,w=d[f]=k(a);m[f]=new Ab(Af,d[f]),q=a[e.collection?"$watchCollection":"$watch"](k,function(a,b){if(b===a){if(b===w||v&&U(b,w))return;b=w}i(f,a,b),d[f]=a}),l.push(q);break;case"&":if(s||re.call(b,r)||Ea(r,g.name),(k=b.hasOwnProperty(r)?h(b[r]):p)===p&&s)break;d[f]=function(b){return k(a,b)}}}),{initialChanges:m,removeWatches:l.length&&function(){for(var a=0,b=l.length;a<b;++a)l[a]()}}}var Ga,Ha=/^\w/,Ia=a.document.createElement("div"),Ja=I,La=K,Ma=H;N.prototype={$normalize:Bb,$addClass:function(a){a&&a.length>0&&u.addClass(this.$$element,a)},$removeClass:function(a){a&&a.length>0&&u.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=Cb(a,b);c&&c.length&&u.addClass(this.$$element,c);var d=Cb(b,a);d&&d.length&&u.removeClass(this.$$element,d)},$set:function(a,b,c,e){var g,h=this.$$element[0],i=ab(h,a),j=bb(a),k=a;i?(this.$$element.prop(a,b),e=i):j&&(this[j]=b,k=j),this[a]=b,e?this.$attr[a]=e:(e=this.$attr[a])||(this.$attr[a]=e=na(a,"-")),g=P(this.$$element),"img"===g&&"srcset"===a&&(this[a]=b=M(b,"$set('srcset', value)")),!1!==c&&(null===b||t(b)?this.$$element.removeAttr(e):Ha.test(e)?i&&!1===b?this.$$element.removeAttr(e):this.$$element.attr(e,b):O(this.$$element[0],e,b));var l=this.$$observers;l&&f(l[k],function(a){try{a(b)}catch(a){d(a)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers=ta()),e=d[a]||(d[a]=[]);return e.push(b),j.$evalAsync(function(){e.$$inter||!c.hasOwnProperty(a)||t(c[a])||b(c[a])}),function(){R(e,b)}}};var Na=c.startSymbol(),Oa=c.endSymbol(),Pa="{{"===Na&&"}}"===Oa?q:function(a){return a.replace(/\{\{/g,Na).replace(/}}/g,Oa)},Qa=/^ng(Attr|Prop|On)([A-Z].*)$/,Ra=/^(.+)Start$/;return S.$$addBindingInfo=E?function(a,b){var c=a.data("$binding")||[];A(b)?c=c.concat(b):c.push(b),a.data("$binding",c)}:p,S.$$addBindingClass=E?function(a){Q(a,"ng-binding")}:p,S.$$addScopeInfo=E?function(a,b,c,d){var e=c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope";a.data(e,b)}:p,S.$$addScopeClass=E?function(a,b){Q(a,b?"ng-isolate-scope":"ng-scope")}:p,S.$$createComment=function(b,c){var d="";return E&&(d=" "+(b||"")+": ",c&&(d+=c+" ")),a.document.createComment(d)},S}]}function Ab(a,b){this.previousValue=a,this.currentValue=b}function Bb(a){return a.replace(Bf,"").replace(Cf,function(a,b,c){return c?b.toUpperCase():b})}function Cb(a,b){var c="",d=a.split(/\s+/),e=b.split(/\s+/);a:for(var f=0;f<d.length;f++){for(var g=d[f],h=0;h<e.length;h++)if(g===e[h])continue a;c+=(c.length>0?" ":"")+g}return c}function Db(a){a=le(a);var b=a.length;if(b<=1)return a;for(;b--;){var c=a[b];(c.nodeType===Pe||c.nodeType===Oe&&""===c.nodeValue.trim())&&ve.call(a,b,1)}return a}function Eb(a,b){if(b&&x(b))return b;if(x(a)){var c=Ef.exec(a);if(c)return c[3]}}function Fb(){var a={};this.has=function(b){return a.hasOwnProperty(b)},this.register=function(b,c){qa(b,"controller"),v(b)?l(a,b):a[b]=c},this.$get=["$injector",function(b){function c(a,b,c,e){if(!a||!v(a.$scope))throw d("$controller")("noscp","Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",e,b);a.$scope[b]=c}return function(d,e,f,g){var h,i,j,k;if(f=!0===f,g&&x(g)&&(k=g),x(d)){if(!(i=d.match(Ef)))throw Df("ctrlfmt","Badly formed controller string '{0}'. Must match `__name__ as __id__` or `__name__`.",d);if(j=i[1],k=k||i[3],!(d=a.hasOwnProperty(j)?a[j]:ra(e.$scope,j,!0)))throw Df("ctrlreg","The controller with the name '{0}' is not registered.",j);pa(d,j,!0)}if(f){var m=(A(d)?d[d.length-1]:d).prototype;return h=Object.create(m||null),k&&c(e,k,h,j||d.name),l(function(){var a=b.invoke(d,h,e,j);return a!==h&&(v(a)||C(a))&&(h=a,k&&c(e,k,h,j||d.name)),h},{instance:h,identifier:k})}return h=b.instantiate(d,e,j),k&&c(e,k,h,j||d.name),h}}]}function Gb(){this.$get=["$window",function(a){return le(a.document)}]}function Hb(){this.$get=["$document","$rootScope",function(a,b){function c(){e=d.hidden}var d=a[0],e=d&&d.hidden;return a.on("visibilitychange",c),b.$on("$destroy",function(){a.off("visibilitychange",c)}),function(){return e}}]}function Ib(){this.$get=["$log",function(a){return function(b,c){a.error.apply(a,arguments)}}]}function Jb(a){return v(a)?z(a)?a.toISOString():Z(a):a}function Kb(){this.$get=function(){return function(a){if(!a)return"";var b=[];return g(a,function(a,c){null===a||t(a)||C(a)||(A(a)?f(a,function(a){b.push(ha(c)+"="+ha(Jb(a)))}):b.push(ha(c)+"="+ha(Jb(a))))}),b.join("&")}}}function Lb(){this.$get=function(){return function(a){function b(a,d,e){A(a)?f(a,function(a,c){b(a,d+"["+(v(a)?c:"")+"]")}):v(a)&&!z(a)?g(a,function(a,c){b(a,d+(e?"":"[")+c+(e?"":"]"))}):(C(a)&&(a=a()),c.push(ha(d)+"="+(null==a?"":ha(Jb(a)))))}if(!a)return"";var c=[];return b(a,"",!0),c.join("&")}}}function Mb(a,b){if(x(a)){var c=a.replace(Kf,"").trim();if(c){var d=b("Content-Type"),e=d&&0===d.indexOf(Gf);if(e||Nb(c))try{a=$(c)}catch(b){if(!e)return a;throw Lf("baddata",'Data must be a valid JSON object. Received: "{0}". Parse error: "{1}"',a,b)}}}return a}function Nb(a){var b=a.match(If);return b&&Jf[b[0]].test(a)}function Ob(a){function b(a,b){a&&(d[a]=d[a]?d[a]+", "+b:b)}var c,d=ta();return x(a)?f(a.split("\n"),function(a){c=a.indexOf(":"),b(se(Ee(a.substr(0,c))),Ee(a.substr(c+1)))}):v(a)&&f(a,function(a,c){b(se(c),Ee(a))}),d}function Pb(a){var b;return function(c){if(b||(b=Ob(a)),c){var d=b[se(c)];return void 0===d&&(d=null),d}return b}}function Qb(a,b,c,d){return C(d)?d(a,b,c):(f(d,function(d){a=d(a,b,c)}),a)}function Rb(a){return 200<=a&&a<300}function Sb(){var a=this.defaults={transformResponse:[Mb],transformRequest:[function(a){return!v(a)||G(a)||I(a)||H(a)?a:Z(a)}],headers:{common:{Accept:"application/json, text/plain, */*"},post:wa(Hf),put:wa(Hf),patch:wa(Hf)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer",jsonpCallbackParam:"callback"},b=!1;this.useApplyAsync=function(a){return u(a)?(b=!!a,this):b};var c=this.interceptors=[],e=this.xsrfWhitelistedOrigins=[];this.$get=["$browser","$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector","$sce",function(g,h,i,j,k,m,n,o){function q(b){function c(a,b){for(var c=0,d=b.length;c<d;){var e=b[c++],f=b[c++];a=a.then(e,f)}return b.length=0,a}function e(){g.$$completeOutstandingRequest(p,"$http")}function h(a,b){var c,d={};return f(a,function(a,e){C(a)?null!=(c=a(b))&&(d[e]=c):d[e]=a}),d}function i(b){var c=b.headers,d=Qb(b.data,Pb(c),void 0,b.transformRequest);return t(d)&&f(c,function(a,b){"content-type"===se(b)&&delete c[b]}),t(b.withCredentials)&&!t(a.withCredentials)&&(b.withCredentials=a.withCredentials),r(b,d).then(j,j)}function j(a){var b=l({},a);return b.data=Qb(a.data,a.headers,a.status,k.transformResponse),Rb(a.status)?b:m.reject(b)}if(!v(b))throw d("$http")("badreq","Http request configuration must be an object. Received: {0}",b);if(!x(o.valueOf(b.url)))throw d("$http")("badreq","Http request configuration url must be a string or a $sce trusted object. Received: {0}",b.url);var k=l({method:"get",transformRequest:a.transformRequest,transformResponse:a.transformResponse,paramSerializer:a.paramSerializer,jsonpCallbackParam:a.jsonpCallbackParam},b);k.headers=function(b){var c,d,e,f=a.headers,g=l({},b.headers);f=l({},f.common,f[se(b.method)]);a:for(c in f){d=se(c);for(e in g)if(se(e)===d)continue a;g[c]=f[c]}return h(g,wa(b))}(b),k.method=te(k.method),k.paramSerializer=x(k.paramSerializer)?n.get(k.paramSerializer):k.paramSerializer,g.$$incOutstandingRequestCount("$http");var q=[],s=[],u=m.resolve(k);return f(z,function(a){(a.request||a.requestError)&&q.unshift(a.request,a.requestError),(a.response||a.responseError)&&s.push(a.response,a.responseError)}),u=c(u,q),u=u.then(i),u=c(u,s),u=u.finally(e)}function r(c,d){function e(a){if(a){var c={};return f(a,function(a,d){c[d]=function(c){function d(){a(c)}b?k.$applyAsync(d):k.$$phase?d():k.$apply(d)}}),c}}function g(a,c,d,e,f){function g(){j(c,a,d,e,f)}p&&(Rb(a)?p.put(F,[a,c,Ob(d),e,f]):p.remove(F)),b?k.$applyAsync(g):(g(),k.$$phase||k.$apply())}function j(a,b,d,e,f){b=b>=-1?b:0,(Rb(b)?z.resolve:z.reject)({data:a,status:b,headers:Pb(d),config:c,statusText:e,xhrStatus:f})}function l(a){j(a.data,a.status,wa(a.headers()),a.statusText,a.xhrStatus)}function n(){var a=q.pendingRequests.indexOf(c);-1!==a&&q.pendingRequests.splice(a,1)}var p,r,z=m.defer(),C=z.promise,D=c.headers,E="jsonp"===se(c.method),F=c.url;if(E?F=o.getTrustedResourceUrl(F):x(F)||(F=o.valueOf(F)),F=s(F,c.paramSerializer(c.params)),E&&(F=w(F,c.jsonpCallbackParam)),q.pendingRequests.push(c),C.then(n,n),!c.cache&&!a.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(p=v(c.cache)?c.cache:v(a.cache)?a.cache:y),p&&(r=p.get(F),u(r)?K(r)?r.then(l,l):A(r)?j(r[1],r[0],wa(r[2]),r[3],r[4]):j(r,200,{},"OK","complete"):p.put(F,C)),t(r)){var G=B(c.url)?i()[c.xsrfCookieName||a.xsrfCookieName]:void 0;G&&(D[c.xsrfHeaderName||a.xsrfHeaderName]=G),h(c.method,F,d,g,D,c.timeout,c.withCredentials,c.responseType,e(c.eventHandlers),e(c.uploadEventHandlers))}return C}function s(a,b){return b.length>0&&(a+=(-1===a.indexOf("?")?"?":"&")+b),a}function w(a,b){var c=a.split("?");if(c.length>2)throw Lf("badjsonp",'Illegal use more than one "?", in url, "{1}"',a);return f(ea(c[1]),function(c,d){if("JSON_CALLBACK"===c)throw Lf("badjsonp",'Illegal use of JSON_CALLBACK in url, "{0}"',a);if(d===b)throw Lf("badjsonp",'Illegal use of callback param, "{0}", in url, "{1}"',b,a)}),a+=(-1===a.indexOf("?")?"?":"&")+b+"=JSON_CALLBACK"}var y=j("$http");a.paramSerializer=x(a.paramSerializer)?n.get(a.paramSerializer):a.paramSerializer;var z=[];f(c,function(a){z.unshift(x(a)?n.get(a):n.invoke(a))});var B=_c(e);return q.pendingRequests=[],function(a){f(arguments,function(a){q[a]=function(b,c){return q(l({},c||{},{method:a,url:b}))}})}("get","delete","head","jsonp"),function(a){f(arguments,function(a){q[a]=function(b,c,d){return q(l({},d||{},{method:a,url:b,data:c}))}})}("post","put","patch"),q.defaults=a,q}]}function Tb(){this.$get=function(){return function(){return new a.XMLHttpRequest}}}function Ub(){this.$get=["$browser","$jsonpCallbacks","$document","$xhrFactory",function(a,b,c,d){return Vb(a,d,a.defer,b,c[0])}]}function Vb(a,b,c,d,e){function g(a,b,c){a=a.replace("JSON_CALLBACK",b);var f=e.createElement("script"),g=null;return f.type="text/javascript",f.src=a,f.async=!0,g=function(a){f.removeEventListener("load",g),f.removeEventListener("error",g),e.body.removeChild(f),f=null;var h=-1,i="unknown";a&&("load"!==a.type||d.wasCalled(b)||(a={type:"error"}),i=a.type,h="error"===a.type?404:200),c&&c(h,i)},f.addEventListener("load",g),f.addEventListener("error",g),e.body.appendChild(f),g}return function(e,h,i,j,k,l,m,n,o,p){function q(a){x="timeout"===a,v&&v(),w&&w.abort()}function r(a,b,d,e,f,g){u(B)&&c.cancel(B),v=w=null,a(b,d,e,f,g)}if(h=h||a.url(),"jsonp"===se(e))var s=d.createCallback(h),v=g(h,s,function(a,b){var c=200===a&&d.getResponse(s);r(j,a,c,"",b,"complete"),d.removeCallback(s)});else{var w=b(e,h),x=!1;w.open(e,h,!0),f(k,function(a,b){u(a)&&w.setRequestHeader(b,a)}),w.onload=function(){var a=w.statusText||"",b="response"in w?w.response:w.responseText,c=1223===w.status?204:w.status;0===c&&(c=b?200:"file"===Yc(h).protocol?404:0),r(j,c,b,w.getAllResponseHeaders(),a,"complete")};var y=function(){r(j,-1,null,null,"","error")},z=function(){r(j,-1,null,null,"",x?"timeout":"abort")},A=function(){r(j,-1,null,null,"","timeout")};if(w.onerror=y,w.ontimeout=A,w.onabort=z,f(o,function(a,b){w.addEventListener(b,a)}),f(p,function(a,b){w.upload.addEventListener(b,a)}),m&&(w.withCredentials=!0),n)try{w.responseType=n}catch(a){if("json"!==n)throw a}w.send(t(i)?null:i)}if(l>0)var B=c(function(){q("timeout")},l);else K(l)&&l.then(function(){q(u(l.$$timeoutId)?"timeout":"abort")})}}function Wb(){var a="{{",b="}}";this.startSymbol=function(b){return b?(a=b,this):a},this.endSymbol=function(a){return a?(b=a,this):b},this.$get=["$parse","$exceptionHandler","$sce",function(c,d,e){function f(a){return"\\\\\\"+a}function g(c){return c.replace(m,a).replace(n,b)}function h(a,b,c,d){var e=a.$watch(function(a){return e(),d(a)},b,c);return e}function i(f,i,m,n){function o(a){try{return a=m&&!p?e.getTrusted(m,a):e.valueOf(a),n&&!u(a)?a:ua(a)}catch(a){d(Mf.interr(f,a))}}var p=m===e.URL||m===e.MEDIA_URL;if(!f.length||-1===f.indexOf(a)){if(i)return;var q=g(f);p&&(q=e.getTrusted(m,q));var s=r(q);return s.exp=f,s.expressions=[],s.$$watchDelegate=h,s}n=!!n;for(var v,w,x,y,z,A=0,B=[],C=f.length,D=[],E=[];A<C;){if(-1===(v=f.indexOf(a,A))||-1===(w=f.indexOf(b,v+j))){A!==C&&D.push(g(f.substring(A)));break}A!==v&&D.push(g(f.substring(A,v))),y=f.substring(v+j,w),B.push(y),A=w+k,E.push(D.length),D.push("")}z=1===D.length&&1===E.length;var F=p&&z?void 0:o;if(x=B.map(function(a){return c(a,F)}),!i||B.length){var G=function(a){for(var b=0,c=B.length;b<c;b++){if(n&&t(a[b]))return;D[E[b]]=a[b]}return p?e.getTrusted(m,z?D[0]:D.join("")):(m&&D.length>1&&Mf.throwNoconcat(f),D.join(""))};return l(function(a){var b=0,c=B.length,e=new Array(c);try{for(;b<c;b++)e[b]=x[b](a);return G(e)}catch(a){d(Mf.interr(f,a))}},{exp:f,expressions:B,$$watchDelegate:function(a,b){var c;return a.$watchGroup(x,function(d,e){var f=G(d);b.call(this,f,d!==e?c:f,a),c=f})}})}}var j=a.length,k=b.length,m=new RegExp(a.replace(/./g,f),"g"),n=new RegExp(b.replace(/./g,f),"g");return i.startSymbol=function(){return a},i.endSymbol=function(){return b},i}]}function Xb(){this.$get=["$$intervalFactory","$window",function(a,b){var c={},d=function(a,d,e){var f=b.setInterval(a,d);return c[f]=e,f},e=function(a){b.clearInterval(a),delete c[a]},f=a(d,e);return f.cancel=function(a){if(!a)return!1;if(!a.hasOwnProperty("$$intervalId"))throw Nf("badprom","`$interval.cancel()` called with a promise that was not generated by `$interval()`.");if(!c.hasOwnProperty(a.$$intervalId))return!1;var b=a.$$intervalId,d=c[b];return Jc(d.promise),d.reject("canceled"),e(b),!0},f}]}function Yb(){this.$get=["$browser","$q","$$q","$rootScope",function(a,b,c,d){return function(e,f){return function(g,h,i,j){function k(){m?g.apply(null,n):g(o)}function l(){p?a.defer(k):d.$evalAsync(k),q.notify(o++),i>0&&o>=i&&(q.resolve(o),f(r.$$intervalId)),p||d.$apply()}var m=arguments.length>4,n=m?W(arguments,4):[],o=0,p=u(j)&&!j,q=(p?c:b).defer(),r=q.promise;return i=u(i)?i:0,r.$$intervalId=e(l,h,q,p),r}}}]}function Zb(a){for(var b=a.split("/"),c=b.length;c--;)b[c]=ga(b[c].replace(/%2F/g,"/"));return b.join("/")}function $b(a,b){for(var c=a.split("/"),d=c.length;d--;)c[d]=decodeURIComponent(c[d]),b&&(c[d]=c[d].replace(/\//g,"%2F"));return c.join("/")}function _b(a,b,c){var d=fa(b),e=c?"#"+ga(c):"";return Zb(a)+(d?"?"+d:"")+e}function ac(a,b){var c=Yc(a);b.$$protocol=c.protocol,b.$$host=c.hostname,b.$$port=n(c.port)||Qf[c.protocol]||null}function bc(a,b,c){if(Sf.test(a))throw Rf("badpath",'Invalid url "{0}".',a);var d="/"!==a.charAt(0);d&&(a="/"+a);var e=Yc(a),f=d&&"/"===e.pathname.charAt(0)?e.pathname.substring(1):e.pathname;b.$$path=$b(f,c),b.$$search=ea(e.search),b.$$hash=decodeURIComponent(e.hash),b.$$path&&"/"!==b.$$path.charAt(0)&&(b.$$path="/"+b.$$path)}function cc(a,b){return a.slice(0,b.length)===b}function dc(a,b){if(cc(b,a))return b.substr(a.length)}function ec(a){var b=a.indexOf("#");return-1===b?a:a.substr(0,b)}function fc(a){return a.substr(0,ec(a).lastIndexOf("/")+1)}function gc(a){return a.substring(0,a.indexOf("/",a.indexOf("//")+2))}function hc(a,b,c){this.$$html5=!0,c=c||"",ac(a,this),this.$$parse=function(a){var c=dc(b,a);if(!x(c))throw Rf("ipthprfx",'Invalid url "{0}", missing path prefix "{1}".',a,b);bc(c,this,!0),this.$$path||(this.$$path="/"),this.$$compose()},this.$$normalizeUrl=function(a){return b+a.substr(1)},this.$$parseLinkUrl=function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g,h;return u(f=dc(a,d))?(g=f,h=c&&u(f=dc(c,f))?b+(dc("/",f)||f):a+g):u(f=dc(b,d))?h=b+f:b===d+"/"&&(h=b),h&&this.$$parse(h),!!h}}function ic(a,b,c){ac(a,this),this.$$parse=function(d){var e,f=dc(a,d)||dc(b,d);t(f)||"#"!==f.charAt(0)?this.$$html5?e=f:(e="",t(f)&&(a=d,this.replace())):(e=dc(c,f),t(e)&&(e=f)),bc(e,this,!1),this.$$path=function(a,b,c){var d,e=/^\/[A-Z]:(\/.*)/;return cc(b,c)&&(b=b.replace(c,"")),e.exec(b)?a:(d=e.exec(a),d?d[1]:a)}(this.$$path,e,a),this.$$compose()},this.$$normalizeUrl=function(b){return a+(b?c+b:"")},this.$$parseLinkUrl=function(b,c){return ec(a)===ec(b)&&(this.$$parse(b),!0)}}function jc(a,b,c){this.$$html5=!0,ic.apply(this,arguments),this.$$parseLinkUrl=function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;return a===ec(d)?f=d:(g=dc(b,d))?f=a+c+g:b===d+"/"&&(f=b),f&&this.$$parse(f),!!f},this.$$normalizeUrl=function(b){return a+c+b}}function kc(a){return function(){return this[a]}}function lc(a,b){return function(c){return t(c)?this[a]:(this[a]=b(c),this.$$compose(),this)}}function mc(){var a="!",b={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(b){return u(b)?(a=b,this):a},this.html5Mode=function(a){return J(a)?(b.enabled=a,this):v(a)?(J(a.enabled)&&(b.enabled=a.enabled),J(a.requireBase)&&(b.requireBase=a.requireBase),(J(a.rewriteLinks)||x(a.rewriteLinks))&&(b.rewriteLinks=a.rewriteLinks),this):b},this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(c,d,e,f,g){
3
+ function h(a,b){return a===b||Yc(a).href===Yc(b).href}function i(a,b,c){var e=k.url(),f=k.$$state;try{d.url(a,b,c),k.$$state=d.state()}catch(a){throw k.url(e),k.$$state=f,a}}function j(a,b){c.$broadcast("$locationChangeSuccess",k.absUrl(),a,k.$$state,b)}var k,l,m,n=d.baseHref(),o=d.url();if(b.enabled){if(!n&&b.requireBase)throw Rf("nobase","$location in HTML5 mode requires a <base> tag to be present!");m=gc(o)+(n||"/"),l=e.history?hc:jc}else m=ec(o),l=ic;var p=fc(m);k=new l(m,p,"#"+a),k.$$parseLinkUrl(o,o),k.$$state=d.state();var q=/^\s*(javascript|mailto):/i;f.on("click",function(a){var e=b.rewriteLinks;if(e&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&2!==a.which&&2!==a.button){for(var g=le(a.target);"a"!==P(g[0]);)if(g[0]===f[0]||!(g=g.parent())[0])return;if(!x(e)||!t(g.attr(e))){var h=g.prop("href"),i=g.attr("href")||g.attr("xlink:href");v(h)&&"[object SVGAnimatedString]"===h.toString()&&(h=Yc(h.animVal).href),q.test(h)||!h||g.attr("target")||a.isDefaultPrevented()||k.$$parseLinkUrl(h,i)&&(a.preventDefault(),k.absUrl()!==d.url()&&c.$apply())}}}),k.absUrl()!==o&&d.url(k.absUrl(),!0);var r=!0;return d.onUrlChange(function(a,b){if(!cc(a,p))return void(g.location.href=a);c.$evalAsync(function(){var d,e=k.absUrl(),f=k.$$state;k.$$parse(a),k.$$state=b,d=c.$broadcast("$locationChangeStart",a,e,b,f).defaultPrevented,k.absUrl()===a&&(d?(k.$$parse(e),k.$$state=f,i(e,!1,f)):(r=!1,j(e,f)))}),c.$$phase||c.$digest()}),c.$watch(function(){if(r||k.$$urlUpdatedByLocation){k.$$urlUpdatedByLocation=!1;var a=d.url(),b=k.absUrl(),f=d.state(),g=k.$$replace,l=!h(a,b)||k.$$html5&&e.history&&f!==k.$$state;(r||l)&&(r=!1,c.$evalAsync(function(){var b=k.absUrl(),d=c.$broadcast("$locationChangeStart",b,a,k.$$state,f).defaultPrevented;k.absUrl()===b&&(d?(k.$$parse(a),k.$$state=f):(l&&i(b,g,f===k.$$state?null:k.$$state),j(a,f)))}))}k.$$replace=!1}),k}]}function nc(){var a=!0,b=this;this.debugEnabled=function(b){return u(b)?(a=b,this):a},this.$get=["$window",function(c){function d(a){return B(a)&&(a.stack&&g?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line)),a}function e(a){var b=c.console||{},e=b[a]||b.log||p;return function(){var a=[];return f(arguments,function(b){a.push(d(b))}),Function.prototype.apply.call(e,b,a)}}var g=ke||/\bEdge\//.test(c.navigator&&c.navigator.userAgent);return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){a&&c.apply(b,arguments)}}()}}]}function oc(a){return a+""}function pc(a,b){return void 0!==a?a:b}function qc(a,b){return void 0===a?b:void 0===b?a:a+b}function rc(a,b){return!a(b).$stateful}function sc(a,b){switch(a.type){case Zf.MemberExpression:if(a.computed)return!1;break;case Zf.UnaryExpression:return $f;case Zf.BinaryExpression:return"+"!==a.operator&&$f;case Zf.CallExpression:return!1}return void 0===b?_f:b}function tc(a,b,c){var d,e,g,h=a.isPure=sc(a,c);switch(a.type){case Zf.Program:d=!0,f(a.body,function(a){tc(a.expression,b,h),d=d&&a.expression.constant}),a.constant=d;break;case Zf.Literal:a.constant=!0,a.toWatch=[];break;case Zf.UnaryExpression:tc(a.argument,b,h),a.constant=a.argument.constant,a.toWatch=a.argument.toWatch;break;case Zf.BinaryExpression:tc(a.left,b,h),tc(a.right,b,h),a.constant=a.left.constant&&a.right.constant,a.toWatch=a.left.toWatch.concat(a.right.toWatch);break;case Zf.LogicalExpression:tc(a.left,b,h),tc(a.right,b,h),a.constant=a.left.constant&&a.right.constant,a.toWatch=a.constant?[]:[a];break;case Zf.ConditionalExpression:tc(a.test,b,h),tc(a.alternate,b,h),tc(a.consequent,b,h),a.constant=a.test.constant&&a.alternate.constant&&a.consequent.constant,a.toWatch=a.constant?[]:[a];break;case Zf.Identifier:a.constant=!1,a.toWatch=[a];break;case Zf.MemberExpression:tc(a.object,b,h),a.computed&&tc(a.property,b,h),a.constant=a.object.constant&&(!a.computed||a.property.constant),a.toWatch=a.constant?[]:[a];break;case Zf.CallExpression:g=!!a.filter&&rc(b,a.callee.name),d=g,e=[],f(a.arguments,function(a){tc(a,b,h),d=d&&a.constant,e.push.apply(e,a.toWatch)}),a.constant=d,a.toWatch=g?e:[a];break;case Zf.AssignmentExpression:tc(a.left,b,h),tc(a.right,b,h),a.constant=a.left.constant&&a.right.constant,a.toWatch=[a];break;case Zf.ArrayExpression:d=!0,e=[],f(a.elements,function(a){tc(a,b,h),d=d&&a.constant,e.push.apply(e,a.toWatch)}),a.constant=d,a.toWatch=e;break;case Zf.ObjectExpression:d=!0,e=[],f(a.properties,function(a){tc(a.value,b,h),d=d&&a.value.constant,e.push.apply(e,a.value.toWatch),a.computed&&(tc(a.key,b,!1),d=d&&a.key.constant,e.push.apply(e,a.key.toWatch))}),a.constant=d,a.toWatch=e;break;case Zf.ThisExpression:case Zf.LocalsExpression:a.constant=!1,a.toWatch=[]}}function uc(a){if(1===a.length){var b=a[0].expression,c=b.toWatch;return 1!==c.length?c:c[0]!==b?c:void 0}}function vc(a){return a.type===Zf.Identifier||a.type===Zf.MemberExpression}function wc(a){if(1===a.body.length&&vc(a.body[0].expression))return{type:Zf.AssignmentExpression,left:a.body[0].expression,right:{type:Zf.NGValueParameter},operator:"="}}function xc(a){return 0===a.body.length||1===a.body.length&&(a.body[0].expression.type===Zf.Literal||a.body[0].expression.type===Zf.ArrayExpression||a.body[0].expression.type===Zf.ObjectExpression)}function yc(a){return a.constant}function zc(a){this.$filter=a}function Ac(a){this.$filter=a}function Bc(a,b,c){this.ast=new Zf(a,c),this.astCompiler=c.csp?new Ac(b):new zc(b)}function Cc(a){return C(a.valueOf)?a.valueOf():Vf.call(a)}function Dc(){var a,b,c=ta(),d={true:!0,false:!1,null:null,undefined:void 0};this.addLiteral=function(a,b){d[a]=b},this.setIdentifierFns=function(c,d){return a=c,b=d,this},this.$get=["$filter",function(e){function g(a,b){var d,f;switch(typeof a){case"string":if(a=a.trim(),f=a,!(d=c[f])){d=new Bc(new Yf(t),e,t).parse(a),c[f]=n(d)}return r(d,b);case"function":return r(a,b);default:return r(p,b)}}function h(a){return new Bc(new Yf(t),e,t).getAst(a).ast}function i(a,b,c){return null==a||null==b?a===b:!("object"==typeof a&&"object"==typeof(a=Cc(a))&&!c)&&(a===b||a!==a&&b!==b)}function j(a,b,c,d,e){var f,g=d.inputs;if(1===g.length){var h=i;return g=g[0],a.$watch(function(a){var b=g(a);return i(b,h,g.isPure)||(f=d(a,void 0,void 0,[b]),h=b&&Cc(b)),f},b,c,e)}for(var j=[],k=[],l=0,m=g.length;l<m;l++)j[l]=i,k[l]=null;return a.$watch(function(a){for(var b=!1,c=0,e=g.length;c<e;c++){var h=g[c](a);(b||(b=!i(h,j[c],g[c].isPure)))&&(k[c]=h,j[c]=h&&Cc(h))}return b&&(f=d(a,void 0,void 0,k)),f},b,c,e)}function k(a,b,c,d,e){function f(){j(i)&&h()}function g(a,b,c,d){return i=o&&d?d[0]:k(a,b,c,d),j(i)&&a.$$postDigest(f),m(i)}var h,i,j=d.literal?l:u,k=d.$$intercepted||d,m=d.$$interceptor||q,o=d.inputs&&!k.inputs;return g.literal=d.literal,g.constant=d.constant,g.inputs=d.inputs,n(g),h=a.$watch(g,b,c,e)}function l(a){var b=!0;return f(a,function(a){u(a)||(b=!1)}),b}function m(a,b,c,d){var e=a.$watch(function(a){return e(),d(a)},b,c);return e}function n(a){return a.constant?a.$$watchDelegate=m:a.oneTime?a.$$watchDelegate=k:a.inputs&&(a.$$watchDelegate=j),a}function o(a,b){function c(c){return b(a(c))}return c.$stateful=a.$stateful||b.$stateful,c.$$pure=a.$$pure&&b.$$pure,c}function r(a,b){if(!b)return a;a.$$interceptor&&(b=o(a.$$interceptor,b),a=a.$$intercepted);var c=!1,d=function(d,e,f,g){var h=c&&g?g[0]:a(d,e,f,g);return b(h)};return d.$$intercepted=a,d.$$interceptor=b,d.literal=a.literal,d.oneTime=a.oneTime,d.constant=a.constant,b.$stateful||(c=!a.inputs,d.inputs=a.inputs?a.inputs:[a],b.$$pure||(d.inputs=d.inputs.map(function(a){return a.isPure===_f?function(b){return a(b)}:a}))),n(d)}var s=Ge().noUnsafeEval,t={csp:s,literals:S(d),isIdentifierStart:C(a)&&a,isIdentifierContinue:C(b)&&b};return g.$$getAst=h,g}]}function Ec(){var a=!0;this.$get=["$rootScope","$exceptionHandler",function(b,c){return Gc(function(a){b.$evalAsync(a)},c,a)}],this.errorOnUnhandledRejections=function(b){return u(b)?(a=b,this):a}}function Fc(){var a=!0;this.$get=["$browser","$exceptionHandler",function(b,c){return Gc(function(a){b.defer(a)},c,a)}],this.errorOnUnhandledRejections=function(b){return u(b)?(a=b,this):a}}function Gc(a,b,c){function e(){return new g}function g(){var a=this.promise=new h;this.resolve=function(b){m(a,b)},this.reject=function(b){o(a,b)},this.notify=function(b){q(a,b)}}function h(){this.$$state={status:0}}function i(d){var e,f,g;g=d.pending,d.processScheduled=!1,d.pending=void 0;try{for(var h=0,i=g.length;h<i;++h){Ic(d),f=g[h][0],e=g[h][d.status];try{C(e)?m(f,e(d.value)):1===d.status?m(f,d.value):o(f,d.value)}catch(a){o(f,a),a&&!0===a.$$passToExceptionHandler&&b(a)}}}finally{--D,c&&0===D&&a(j)}}function j(){for(;!D&&E.length;){var a=E.shift();if(!Hc(a)){Ic(a);var c="Possibly unhandled rejection: "+ya(a.value);B(a.value)?b(a.value,c):b(c)}}}function k(b){!c||b.pending||2!==b.status||Hc(b)||(0===D&&0===E.length&&a(j),E.push(b)),!b.processScheduled&&b.pending&&(b.processScheduled=!0,++D,a(function(){i(b)}))}function m(a,b){a.$$state.status||(b===a?p(a,z("qcycle","Expected promise to be resolved with value other than itself '{0}'",b)):n(a,b))}function n(a,b){function c(b){g||(g=!0,n(a,b))}function d(b){g||(g=!0,p(a,b))}function e(b){q(a,b)}var f,g=!1;try{(v(b)||C(b))&&(f=b.then),C(f)?(a.$$state.status=-1,f.call(b,c,d,e)):(a.$$state.value=b,a.$$state.status=1,k(a.$$state))}catch(a){d(a)}}function o(a,b){a.$$state.status||p(a,b)}function p(a,b){a.$$state.value=b,a.$$state.status=2,k(a.$$state)}function q(c,d){var e=c.$$state.pending;c.$$state.status<=0&&e&&e.length&&a(function(){for(var a,c,f=0,g=e.length;f<g;f++){c=e[f][0],a=e[f][3];try{q(c,C(a)?a(d):d)}catch(a){b(a)}}})}function r(a){var b=new h;return o(b,a),b}function s(a,b,c){var d=null;try{C(c)&&(d=c())}catch(a){return r(a)}return K(d)?d.then(function(){return b(a)},r):b(a)}function u(a,b,c,d){var e=new h;return m(e,a),e.then(b,c,d)}function w(a){var b=new h,c=0,d=A(a)?[]:{};return f(a,function(a,e){c++,u(a).then(function(a){d[e]=a,--c||m(b,d)},function(a){o(b,a)})}),0===c&&m(b,d),b}function x(a){var b=e();return f(a,function(a){u(a).then(b.resolve,b.reject)}),b.promise}function y(a){function b(a){m(d,a)}function c(a){o(d,a)}if(!C(a))throw z("norslvr","Expected resolverFn, got '{0}'",a);var d=new h;return a(b,c),d}var z=d("$q",TypeError),D=0,E=[];l(h.prototype,{then:function(a,b,c){if(t(a)&&t(b)&&t(c))return this;var d=new h;return this.$$state.pending=this.$$state.pending||[],this.$$state.pending.push([d,a,b,c]),this.$$state.status>0&&k(this.$$state),d},catch:function(a){return this.then(null,a)},finally:function(a,b){return this.then(function(b){return s(b,F,a)},function(b){return s(b,r,a)},b)}});var F=u;return y.prototype=h.prototype,y.defer=e,y.reject=r,y.when=u,y.resolve=F,y.all=w,y.race=x,y}function Hc(a){return!!a.pur}function Ic(a){a.pur=!0}function Jc(a){a.$$state&&Ic(a.$$state)}function Kc(){this.$get=["$window","$timeout",function(a,b){var c=a.requestAnimationFrame||a.webkitRequestAnimationFrame,d=a.cancelAnimationFrame||a.webkitCancelAnimationFrame||a.webkitCancelRequestAnimationFrame,e=!!c,f=e?function(a){var b=c(a);return function(){d(b)}}:function(a){var c=b(a,16.66,!1);return function(){b.cancel(c)}};return f.supported=e,f}]}function Lc(){function a(a){function b(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null,this.$$listeners={},this.$$listenerCount={},this.$$watchersCount=0,this.$id=i(),this.$$ChildScope=null,this.$$suspended=!1}return b.prototype=a,b}var b=10,c=d("$rootScope"),g=null,h=null;this.digestTtl=function(a){return arguments.length&&(b=a),b},this.$get=["$exceptionHandler","$parse","$browser",function(d,j,k){function l(a){a.currentScope.$$destroyed=!0}function m(a){9===ke&&(a.$$childHead&&m(a.$$childHead),a.$$nextSibling&&m(a.$$nextSibling)),a.$parent=a.$$nextSibling=a.$$prevSibling=a.$$childHead=a.$$childTail=a.$root=a.$$watchers=null}function n(){this.$id=i(),this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null,this.$root=this,this.$$destroyed=!1,this.$$suspended=!1,this.$$listeners={},this.$$listenerCount={},this.$$watchersCount=0,this.$$isolateBindings=null}function o(a){if(y.$$phase)throw c("inprog","{0} already in progress",y.$$phase);y.$$phase=a}function q(){y.$$phase=null}function r(a,b){do{a.$$watchersCount+=b}while(a=a.$parent)}function s(a,b,c){do{a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c]}while(a=a.$parent)}function u(){}function w(){for(;B.length;)try{B.shift()()}catch(a){d(a)}h=null}function x(){null===h&&(h=k.defer(function(){y.$apply(w)},null,"$applyAsync"))}n.prototype={constructor:n,$new:function(b,c){var d;return c=c||this,b?(d=new n,d.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=a(this)),d=new this.$$ChildScope),d.$parent=c,d.$$prevSibling=c.$$childTail,c.$$childHead?(c.$$childTail.$$nextSibling=d,c.$$childTail=d):c.$$childHead=c.$$childTail=d,(b||c!==this)&&d.$on("$destroy",l),d},$watch:function(a,b,c,d){var e=j(a),f=C(b)?b:p;if(e.$$watchDelegate)return e.$$watchDelegate(this,f,c,e,a);var h=this,i=h.$$watchers,k={fn:f,last:u,get:e,exp:d||a,eq:!!c};return g=null,i||(i=h.$$watchers=[],i.$$digestWatchIndex=-1),i.unshift(k),i.$$digestWatchIndex++,r(this,1),function(){var a=R(i,k);a>=0&&(r(h,-1),a<i.$$digestWatchIndex&&i.$$digestWatchIndex--),g=null}},$watchGroup:function(a,b){function c(){i=!1;try{j?(j=!1,b(e,e,h)):b(e,d,h)}finally{for(var c=0;c<a.length;c++)d[c]=e[c]}}var d=new Array(a.length),e=new Array(a.length),g=[],h=this,i=!1,j=!0;if(!a.length){var k=!0;return h.$evalAsync(function(){k&&b(e,e,h)}),function(){k=!1}}return 1===a.length?this.$watch(a[0],function(a,c,f){e[0]=a,d[0]=c,b(e,a===c?e:d,f)}):(f(a,function(a,b){var d=h.$watch(a,function(a){e[b]=a,i||(i=!0,h.$evalAsync(c))});g.push(d)}),function(){for(;g.length;)g.shift()()})},$watchCollection:function(a,b){function c(a){f=a;var b,c,d,h;if(!t(f)){if(v(f))if(e(f)){g!==n&&(g=n,q=g.length=0,l++),b=f.length,q!==b&&(l++,g.length=q=b);for(var i=0;i<b;i++)h=g[i],d=f[i],h!==h&&d!==d||h===d||(l++,g[i]=d)}else{g!==o&&(g=o={},q=0,l++),b=0;for(c in f)re.call(f,c)&&(b++,d=f[c],h=g[c],c in g?h!==h&&d!==d||h===d||(l++,g[c]=d):(q++,g[c]=d,l++));if(q>b){l++;for(c in g)re.call(f,c)||(q--,delete g[c])}}else g!==f&&(g=f,l++);return l}}function d(){if(p?(p=!1,b(f,f,i)):b(f,h,i),k)if(v(f))if(e(f)){h=new Array(f.length);for(var a=0;a<f.length;a++)h[a]=f[a]}else{h={};for(var c in f)re.call(f,c)&&(h[c]=f[c])}else h=f}c.$$pure=j(a).literal,c.$stateful=!c.$$pure;var f,g,h,i=this,k=b.length>1,l=0,m=j(a,c),n=[],o={},p=!0,q=0;return this.$watch(m,d)},$digest:function(){var a,e,f,i,j,l,m,n,p,r,s,t=b,v=z.length?y:this,x=[];o("$digest"),k.$$checkUrlChange(),this===y&&null!==h&&(k.defer.cancel(h),w()),g=null;do{m=!1,p=v;for(var B=0;B<z.length;B++){try{s=z[B],i=s.fn,i(s.scope,s.locals)}catch(a){d(a)}g=null}z.length=0;a:do{if(l=!p.$$suspended&&p.$$watchers)for(l.$$digestWatchIndex=l.length;l.$$digestWatchIndex--;)try{if(a=l[l.$$digestWatchIndex])if(j=a.get,(e=j(p))===(f=a.last)||(a.eq?U(e,f):Ce(e)&&Ce(f))){if(a===g){m=!1;break a}}else m=!0,g=a,a.last=a.eq?S(e,null):e,i=a.fn,i(e,f===u?e:f,p),t<5&&(r=4-t,x[r]||(x[r]=[]),x[r].push({msg:C(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):a.exp,newVal:e,oldVal:f}))}catch(a){d(a)}if(!(n=!p.$$suspended&&p.$$watchersCount&&p.$$childHead||p!==v&&p.$$nextSibling))for(;p!==v&&!(n=p.$$nextSibling);)p=p.$parent}while(p=n);if((m||z.length)&&!t--)throw q(),c("infdig","{0} $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: {1}",b,x)}while(m||z.length);for(q();D<A.length;)try{A[D++]()}catch(a){d(a)}A.length=D=0,k.$$checkUrlChange()},$suspend:function(){this.$$suspended=!0},$isSuspended:function(){return this.$$suspended},$resume:function(){this.$$suspended=!1},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy"),this.$$destroyed=!0,this===y&&k.$$applicationDestroyed(),r(this,-this.$$watchersCount);for(var b in this.$$listenerCount)s(this,this.$$listenerCount[b],b);a&&a.$$childHead===this&&(a.$$childHead=this.$$nextSibling),a&&a.$$childTail===this&&(a.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=p,this.$on=this.$watch=this.$watchGroup=function(){return p},this.$$listeners={},this.$$nextSibling=null,m(this)}},$eval:function(a,b){return j(a)(this,b)},$evalAsync:function(a,b){y.$$phase||z.length||k.defer(function(){z.length&&y.$digest()},null,"$evalAsync"),z.push({scope:this,fn:j(a),locals:b})},$$postDigest:function(a){A.push(a)},$apply:function(a){try{o("$apply");try{return this.$eval(a)}finally{q()}}catch(a){d(a)}finally{try{y.$digest()}catch(a){throw d(a),a}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&B.push(b),a=j(a),x()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]),c.push(b);var d=this;do{d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++}while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(delete c[d],s(e,1,a))}},$emit:function(a,b){var c,e,f,g=[],h=this,i=!1,j={name:a,targetScope:h,stopPropagation:function(){i=!0},preventDefault:function(){j.defaultPrevented=!0},defaultPrevented:!1},k=V([j],arguments,1);do{for(c=h.$$listeners[a]||g,j.currentScope=h,e=0,f=c.length;e<f;e++)if(c[e])try{c[e].apply(null,k)}catch(a){d(a)}else c.splice(e,1),e--,f--;if(i)break;h=h.$parent}while(h);return j.currentScope=null,j},$broadcast:function(a,b){var c=this,e=c,f=c,g={name:a,targetScope:c,preventDefault:function(){g.defaultPrevented=!0},defaultPrevented:!1};if(!c.$$listenerCount[a])return g;for(var h,i,j,k=V([g],arguments,1);e=f;){for(g.currentScope=e,h=e.$$listeners[a]||[],i=0,j=h.length;i<j;i++)if(h[i])try{h[i].apply(null,k)}catch(a){d(a)}else h.splice(i,1),i--,j--;if(!(f=e.$$listenerCount[a]&&e.$$childHead||e!==c&&e.$$nextSibling))for(;e!==c&&!(f=e.$$nextSibling);)e=e.$parent}return g.currentScope=null,g}};var y=new n,z=y.$$asyncQueue=[],A=y.$$postDigestQueue=[],B=y.$$applyAsyncQueue=[],D=0;return y}]}function Mc(){var a=/^\s*(https?|s?ftp|mailto|tel|file):/,b=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(b){return u(b)?(a=b,this):a},this.imgSrcSanitizationWhitelist=function(a){return u(a)?(b=a,this):b},this.$get=function(){return function(c,d){var e=d?b:a,f=Yc(c&&c.trim()).href;return""===f||f.match(e)?c:"unsafe:"+f}}}function Nc(a){return a.replace(dg,Ba)}function Oc(a){if("self"===a)return a;if(x(a)){if(a.indexOf("***")>-1)throw bg("iwcard","Illegal sequence *** in string matcher. String: {0}",a);return a=Fe(a).replace(/\\\*\\\*/g,".*").replace(/\\\*/g,"[^:/.?&;]*"),new RegExp("^"+a+"$")}if(D(a))return new RegExp("^"+a.source+"$");throw bg("imatcher",'Matchers may only be "self", string patterns or RegExp objects')}function Pc(a){var b=[];return u(a)&&f(a,function(a){b.push(Oc(a))}),b}function Qc(){this.SCE_CONTEXTS=cg;var a=["self"],b=[];this.resourceUrlWhitelist=function(b){return arguments.length&&(a=Pc(b)),a},this.resourceUrlBlacklist=function(a){return arguments.length&&(b=Pc(a)),b},this.$get=["$injector","$$sanitizeUri",function(c,d){function e(a,b){return"self"===a?Zc(b)||$c(b):!!a.exec(b.href)}function f(c){var d,f,g=Yc(c.toString()),h=!1;for(d=0,f=a.length;d<f;d++)if(e(a[d],g)){h=!0;break}if(h)for(d=0,f=b.length;d<f;d++)if(e(b[d],g)){h=!1;break}return h}function g(a){var b=function(a){this.$$unwrapTrustedValue=function(){return a}};return a&&(b.prototype=new a),b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()},b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()},b}function h(a,b){var c=m.hasOwnProperty(a)?m[a]:null;if(!c)throw bg("icontext","Attempted to trust a value in invalid context. Context: {0}; Value: {1}",a,b);if(null===b||t(b)||""===b)return b;if("string"!=typeof b)throw bg("itype","Attempted to trust a non-string value in a content requiring a string: Context: {0}",a);return new c(b)}function i(a){return a instanceof l?a.$$unwrapTrustedValue():a}function j(a,b){if(null===b||t(b)||""===b)return b;var c=m.hasOwnProperty(a)?m[a]:null;if(c&&b instanceof c)return b.$$unwrapTrustedValue();if(C(b.$$unwrapTrustedValue)&&(b=b.$$unwrapTrustedValue()),a===cg.MEDIA_URL||a===cg.URL)return d(b.toString(),a===cg.MEDIA_URL);if(a===cg.RESOURCE_URL){if(f(b))return b;throw bg("insecurl","Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}",b.toString())}if(a===cg.HTML)return k(b);throw bg("unsafe","Attempting to use an unsafe value in a safe context.")}var k=function(a){throw bg("unsafe","Attempting to use an unsafe value in a safe context.")};c.has("$sanitize")&&(k=c.get("$sanitize"));var l=g(),m={};return m[cg.HTML]=g(l),m[cg.CSS]=g(l),m[cg.MEDIA_URL]=g(l),m[cg.URL]=g(m[cg.MEDIA_URL]),m[cg.JS]=g(l),m[cg.RESOURCE_URL]=g(m[cg.URL]),{trustAs:h,getTrusted:j,valueOf:i}}]}function Rc(){var a=!0;this.enabled=function(b){return arguments.length&&(a=!!b),a},this.$get=["$parse","$sceDelegate",function(b,c){if(a&&ke<8)throw bg("iequirks","Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks mode. You can fix this by adding the text <!doctype html> to the top of your HTML document. See http://docs.angularjs.org/api/ng.$sce for more information.");var d=wa(cg);d.isEnabled=function(){return a},d.trustAs=c.trustAs,d.getTrusted=c.getTrusted,d.valueOf=c.valueOf,a||(d.trustAs=d.getTrusted=function(a,b){return b},d.valueOf=q),d.parseAs=function(a,c){var e=b(c);return e.literal&&e.constant?e:b(c,function(b){return d.getTrusted(a,b)})};var e=d.parseAs,g=d.getTrusted,h=d.trustAs;return f(cg,function(a,b){var c=se(b);d[Nc("parse_as_"+c)]=function(b){return e(a,b)},d[Nc("get_trusted_"+c)]=function(b){return g(a,b)},d[Nc("trust_as_"+c)]=function(b){return h(a,b)}}),d}]}function Sc(){this.$get=["$window","$document",function(a,b){var c={},d=a.nw&&a.nw.process,e=!d&&a.chrome&&(a.chrome.app&&a.chrome.app.runtime||!a.chrome.app&&a.chrome.runtime&&a.chrome.runtime.id),f=!e&&a.history&&a.history.pushState,g=n((/android (\d+)/.exec(se((a.navigator||{}).userAgent))||[])[1]),h=/Boxee/i.test((a.navigator||{}).userAgent),i=b[0]||{},j=i.body&&i.body.style,k=!1,l=!1;return j&&(k=!!("transition"in j||"webkitTransition"in j),l=!!("animation"in j||"webkitAnimation"in j)),{history:!(!f||g<4||h),hasEvent:function(a){if("input"===a&&ke)return!1;if(t(c[a])){var b=i.createElement("div");c[a]="on"+a in b}return c[a]},csp:Ge(),transitions:k,animations:l,android:g}}]}function Tc(){this.$get=r(function(a){return new Uc(a)})}function Uc(a){function b(b,f){f=f||l;try{b()}finally{c(f);var g=i[f],h=i[k];if(!h||!g)for(var j,m=h?e:d;j=m(f);)try{j()}catch(b){a.error(b)}}}function c(a){a=a||l,i[a]&&(i[a]--,i[k]--)}function d(){var a=j.pop();return a&&a.cb}function e(a){for(var b=j.length-1;b>=0;--b){var c=j[b];if(c.type===a)return j.splice(b,1),c.cb}}function f(a){a=a||l,i[a]=(i[a]||0)+1,i[k]=(i[k]||0)+1}function g(a,b){b=b||k,i[b]?j.push({type:b,cb:a}):a()}var h=this,i={},j=[],k=h.ALL_TASKS_TYPE="$$all$$",l=h.DEFAULT_TASK_TYPE="$$default$$";h.completeTask=b,h.incTaskCount=f,h.notifyWhenNoPendingTasks=g}function Vc(){var a;this.httpOptions=function(b){return b?(a=b,this):a},this.$get=["$exceptionHandler","$templateCache","$http","$q","$sce",function(b,c,d,e,f){function g(h,i){function j(a){return i||(a=eg("tpload","Failed to load template: {0} (HTTP status: {1} {2})",h,a.status,a.statusText),b(a)),e.reject(a)}g.totalPendingRequests++,x(h)&&!t(c.get(h))||(h=f.getTrustedResourceUrl(h));var k=d.defaults&&d.defaults.transformResponse;return A(k)?k=k.filter(function(a){return a!==Mb}):k===Mb&&(k=null),d.get(h,l({cache:c,transformResponse:k},a)).finally(function(){g.totalPendingRequests--}).then(function(a){return c.put(h,a.data)},j)}return g.totalPendingRequests=0,g}]}function Wc(){this.$get=["$rootScope","$browser","$location",function(a,b,c){var d={};return d.findBindings=function(a,b,c){var d=a.getElementsByClassName("ng-binding"),e=[];return f(d,function(a){var d=Ae.element(a).data("$binding");d&&f(d,function(d){if(c){new RegExp("(^|\\s)"+Fe(b)+"(\\s|\\||$)").test(d)&&e.push(a)}else-1!==d.indexOf(b)&&e.push(a)})}),e},d.findModels=function(a,b,c){for(var d=["ng-","data-ng-","ng\\:"],e=0;e<d.length;++e){var f=c?"=":"*=",g="["+d[e]+"model"+f+'"'+b+'"]',h=a.querySelectorAll(g);if(h.length)return h}},d.getLocation=function(){return c.url()},d.setLocation=function(b){b!==c.url()&&(c.url(b),a.$digest())},d.whenStable=function(a){b.notifyWhenNoOutstandingRequests(a)},d}]}function Xc(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",function(a,b,c,d,e){function f(f,h,i){C(f)||(i=h,h=f,f=p);var j,k=W(arguments,3),l=u(i)&&!i,m=(l?d:c).defer(),n=m.promise;return j=b.defer(function(){try{m.resolve(f.apply(null,k))}catch(a){m.reject(a),e(a)}finally{delete g[n.$$timeoutId]}l||a.$apply()},h,"$timeout"),n.$$timeoutId=j,g[j]=m,n}var g={};return f.cancel=function(a){if(!a)return!1;if(!a.hasOwnProperty("$$timeoutId"))throw fg("badprom","`$timeout.cancel()` called with a promise that was not generated by `$timeout()`.");if(!g.hasOwnProperty(a.$$timeoutId))return!1;var c=a.$$timeoutId,d=g[c];return Jc(d.promise),d.reject("canceled"),delete g[c],b.defer.cancel(c)},f}]}function Yc(a){if(!x(a))return a;var b=a;ke&&(gg.setAttribute("href",b),b=gg.href),gg.setAttribute("href",b);var c=gg.hostname;return!ig&&c.indexOf(":")>-1&&(c="["+c+"]"),{href:gg.href,protocol:gg.protocol?gg.protocol.replace(/:$/,""):"",host:gg.host,search:gg.search?gg.search.replace(/^\?/,""):"",hash:gg.hash?gg.hash.replace(/^#/,""):"",hostname:c,port:gg.port,pathname:"/"===gg.pathname.charAt(0)?gg.pathname:"/"+gg.pathname}}function Zc(a){return ad(a,hg)}function $c(a){return ad(a,bd())}function _c(a){var b=[hg].concat(a.map(Yc));return function(a){var c=Yc(a);return b.some(ad.bind(null,c))}}function ad(a,b){return a=Yc(a),b=Yc(b),a.protocol===b.protocol&&a.host===b.host}function bd(){return a.document.baseURI?a.document.baseURI:(ag||(ag=a.document.createElement("a"),ag.href=".",ag=ag.cloneNode(!1)),ag.href)}function cd(){this.$get=r(a)}function dd(a){function b(a){try{return a.cookie||""}catch(a){return""}}function c(a){try{return decodeURIComponent(a)}catch(b){return a}}var d=a[0]||{},e={},f="";return function(){var a,g,h,i,j,k=b(d);if(k!==f)for(f=k,a=f.split("; "),e={},h=0;h<a.length;h++)g=a[h],(i=g.indexOf("="))>0&&(j=c(g.substring(0,i)),t(e[j])&&(e[j]=c(g.substring(i+1))));return e}}function ed(){this.$get=dd}function fd(a){function b(d,e){if(v(d)){var g={};return f(d,function(a,c){g[c]=b(c,a)}),g}return a.factory(d+c,e)}var c="Filter";this.register=b,this.$get=["$injector",function(a){return function(b){return a.get(b+c)}}],b("currency",kd),b("date",zd),b("filter",gd),b("json",Ad),b("limitTo",Bd),b("lowercase",pg),b("number",ld),b("orderBy",Dd),b("uppercase",qg)}function gd(){return function(a,b,c,f){if(!e(a)){if(null==a)return a;throw d("filter")("notarray","Expected array but received: {0}",a)}f=f||"$";var g,h,i=jd(b);switch(i){case"function":g=b;break;case"boolean":case"null":case"number":case"string":h=!0;case"object":g=hd(b,c,f,h);break;default:return a}return Array.prototype.filter.call(a,g)}}function hd(a,b,c,d){var e=v(a)&&c in a;return!0===b?b=U:C(b)||(b=function(a,b){return!t(a)&&(null===a||null===b?a===b:!(v(b)||v(a)&&!s(a))&&(a=se(""+a),b=se(""+b),-1!==a.indexOf(b)))}),function(f){return e&&!v(f)?id(f,a[c],b,c,!1):id(f,a,b,c,d)}}function id(a,b,c,d,e,f){var g=jd(a),h=jd(b);if("string"===h&&"!"===b.charAt(0))return!id(a,b.substring(1),c,d,e);if(A(a))return a.some(function(a){return id(a,b,c,d,e)});switch(g){case"object":var i;if(e){for(i in a)if(i.charAt&&"$"!==i.charAt(0)&&id(a[i],b,c,d,!0))return!0;return!f&&id(a,b,c,d,!1)}if("object"===h){for(i in b){var j=b[i];if(!C(j)&&!t(j)){var k=i===d;if(!id(k?a:a[i],j,c,d,k,k))return!1}}return!0}return c(a,b);case"function":return!1;default:return c(a,b)}}function jd(a){return null===a?"null":typeof a}function kd(a){var b=a.NUMBER_FORMATS;return function(a,c,d){t(c)&&(c=b.CURRENCY_SYM),t(d)&&(d=b.PATTERNS[1].maxFrac);var e=c?/\u00A4/g:/\s*\u00A4\s*/g;return null==a?a:od(a,b.PATTERNS[1],b.GROUP_SEP,b.DECIMAL_SEP,d).replace(e,c)}}function ld(a){var b=a.NUMBER_FORMATS;return function(a,c){return null==a?a:od(a,b.PATTERNS[0],b.GROUP_SEP,b.DECIMAL_SEP,c)}}function md(a){var b,c,d,e,f,g=0;for((c=a.indexOf(kg))>-1&&(a=a.replace(kg,"")),(d=a.search(/e/i))>0?(c<0&&(c=d),c+=+a.slice(d+1),a=a.substring(0,d)):c<0&&(c=a.length),d=0;a.charAt(d)===lg;d++);if(d===(f=a.length))b=[0],c=1;else{for(f--;a.charAt(f)===lg;)f--;for(c-=d,b=[],e=0;d<=f;d++,e++)b[e]=+a.charAt(d)}return c>jg&&(b=b.splice(0,jg-1),g=c-1,c=1),{d:b,e:g,i:c}}function nd(a,b,c,d){var e=a.d,f=e.length-a.i;b=t(b)?Math.min(Math.max(c,f),d):+b;var g=b+a.i,h=e[g];if(g>0){e.splice(Math.max(a.i,g));for(var i=g;i<e.length;i++)e[i]=0}else{f=Math.max(0,f),a.i=1,e.length=Math.max(1,g=b+1),e[0]=0;for(var j=1;j<g;j++)e[j]=0}if(h>=5)if(g-1<0){for(var k=0;k>g;k--)e.unshift(0),a.i++;e.unshift(1),a.i++}else e[g-1]++;for(;f<Math.max(0,b);f++)e.push(0);var l=e.reduceRight(function(a,b,c,d){return b+=a,d[c]=b%10,Math.floor(b/10)},0);l&&(e.unshift(l),a.i++)}function od(a,b,c,d,e){if(!x(a)&&!y(a)||isNaN(a))return"";var f,g=!isFinite(a),h=!1,i=Math.abs(a)+"",j="";if(g)j="∞";else{f=md(i),nd(f,e,b.minFrac,b.maxFrac);var k=f.d,l=f.i,m=f.e,n=[];for(h=k.reduce(function(a,b){return a&&!b},!0);l<0;)k.unshift(0),l++;l>0?n=k.splice(l,k.length):(n=k,k=[0]);var o=[];for(k.length>=b.lgSize&&o.unshift(k.splice(-b.lgSize,k.length).join(""));k.length>b.gSize;)o.unshift(k.splice(-b.gSize,k.length).join(""));k.length&&o.unshift(k.join("")),j=o.join(c),n.length&&(j+=d+n.join("")),m&&(j+="e+"+m)}return a<0&&!h?b.negPre+j+b.negSuf:b.posPre+j+b.posSuf}function pd(a,b,c,d){var e="";for((a<0||d&&a<=0)&&(d?a=1-a:(a=-a,e="-")),a=""+a;a.length<b;)a=lg+a;return c&&(a=a.substr(a.length-b)),e+a}function qd(a,b,c,d,e){return c=c||0,function(f){var g=f["get"+a]();return(c>0||g>-c)&&(g+=c),0===g&&-12===c&&(g=12),pd(g,b,d,e)}}function rd(a,b,c){return function(d,e){var f=d["get"+a]();return e[te((c?"STANDALONE":"")+(b?"SHORT":"")+a)][f]}}function sd(a,b,c){var d=-1*c,e=d>=0?"+":"";return e+=pd(Math[d>0?"floor":"ceil"](d/60),2)+pd(Math.abs(d%60),2)}function td(a){var b=new Date(a,0,1).getDay();return new Date(a,0,(b<=4?5:12)-b)}function ud(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate()+(4-a.getDay()))}function vd(a){return function(b){var c=td(b.getFullYear()),d=ud(b),e=+d-+c;return pd(1+Math.round(e/6048e5),a)}}function wd(a,b){return a.getHours()<12?b.AMPMS[0]:b.AMPMS[1]}function xd(a,b){return a.getFullYear()<=0?b.ERAS[0]:b.ERAS[1]}function yd(a,b){return a.getFullYear()<=0?b.ERANAMES[0]:b.ERANAMES[1]}function zd(a){function b(a){var b;if(b=a.match(c)){var d=new Date(0),e=0,f=0,g=b[8]?d.setUTCFullYear:d.setFullYear,h=b[8]?d.setUTCHours:d.setHours;b[9]&&(e=n(b[9]+b[10]),f=n(b[9]+b[11])),g.call(d,n(b[1]),n(b[2])-1,n(b[3]));var i=n(b[4]||0)-e,j=n(b[5]||0)-f,k=n(b[6]||0),l=Math.round(1e3*parseFloat("0."+(b[7]||0)));return h.call(d,i,j,k,l),d}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,d,e){var g,h,i="",j=[];if(d=d||"mediumDate",d=a.DATETIME_FORMATS[d]||d,x(c)&&(c=og.test(c)?n(c):b(c)),y(c)&&(c=new Date(c)),!z(c)||!isFinite(c.getTime()))return c;for(;d;)h=ng.exec(d),h?(j=V(j,h,1),d=j.pop()):(j.push(d),d=null);var k=c.getTimezoneOffset();return e&&(k=_(e,k),c=ba(c,e,!0)),f(j,function(b){g=mg[b],i+=g?g(c,a.DATETIME_FORMATS,k):"''"===b?"'":b.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),i}}function Ad(){return function(a,b){return t(b)&&(b=2),Z(a,b)}}function Bd(){return function(a,b,c){return b=Math.abs(Number(b))===1/0?Number(b):n(b),Ce(b)?a:(y(a)&&(a=a.toString()),e(a)?(c=!c||isNaN(c)?0:n(c),c=c<0?Math.max(0,a.length+c):c,
4
+ b>=0?Cd(a,c,c+b):0===c?Cd(a,b,a.length):Cd(a,Math.max(0,c+b),c)):a)}}function Cd(a,b,c){return x(a)?a.slice(b,c):ue.call(a,b,c)}function Dd(a){function b(b){return b.map(function(b){var c=1,d=q;if(C(b))d=b;else if(x(b)&&("+"!==b.charAt(0)&&"-"!==b.charAt(0)||(c="-"===b.charAt(0)?-1:1,b=b.substring(1)),""!==b&&(d=a(b),d.constant))){var e=d();d=function(a){return a[e]}}return{get:d,descending:c}})}function c(a){switch(typeof a){case"number":case"boolean":case"string":return!0;default:return!1}}function f(a){return C(a.valueOf)&&(a=a.valueOf(),c(a))?a:(s(a)&&(a=a.toString(),c(a)),a)}function g(a,b){var c=typeof a;return null===a?c="null":"object"===c&&(a=f(a)),{value:a,type:c,index:b}}function h(a,b){var c=0,d=a.type,e=b.type;if(d===e){var f=a.value,g=b.value;"string"===d?(f=f.toLowerCase(),g=g.toLowerCase()):"object"===d&&(v(f)&&(f=a.index),v(g)&&(g=b.index)),f!==g&&(c=f<g?-1:1)}else c="undefined"===d?1:"undefined"===e?-1:"null"===d?1:"null"===e?-1:d<e?-1:1;return c}return function(a,c,f,i){function j(a,b){return{value:a,tieBreaker:{value:b,type:"number",index:b},predicateValues:l.map(function(c){return g(c.get(a),b)})}}function k(a,b){for(var c=0,d=l.length;c<d;c++){var e=n(a.predicateValues[c],b.predicateValues[c]);if(e)return e*l[c].descending*m}return(n(a.tieBreaker,b.tieBreaker)||h(a.tieBreaker,b.tieBreaker))*m}if(null==a)return a;if(!e(a))throw d("orderBy")("notarray","Expected array but received: {0}",a);A(c)||(c=[c]),0===c.length&&(c=["+"]);var l=b(c),m=f?-1:1,n=C(i)?i:h,o=Array.prototype.map.call(a,j);return o.sort(k),a=o.map(function(a){return a.value})}}function Ed(a){return C(a)&&(a={link:a}),a.restrict=a.restrict||"AC",r(a)}function Fd(a,b){a.$name=b}function Gd(a,b,c,d,e){this.$$controls=[],this.$error={},this.$$success={},this.$pending=void 0,this.$name=e(b.name||b.ngForm||"")(c),this.$dirty=!1,this.$pristine=!0,this.$valid=!0,this.$invalid=!1,this.$submitted=!1,this.$$parentForm=tg,this.$$element=a,this.$$animate=d,Hd(this)}function Hd(a){a.$$classCache={},a.$$classCache[dh]=!(a.$$classCache[ch]=a.$$element.hasClass(ch))}function Id(a){function b(a,b,c,d){a[b]||(a[b]={}),g(a[b],c,d)}function c(a,b,c,d){a[b]&&h(a[b],c,d),Jd(a[b])&&(a[b]=void 0)}function d(a,b,c){c&&!a.$$classCache[b]?(a.$$animate.addClass(a.$$element,b),a.$$classCache[b]=!0):!c&&a.$$classCache[b]&&(a.$$animate.removeClass(a.$$element,b),a.$$classCache[b]=!1)}function e(a,b,c){b=b?"-"+na(b,"-"):"",d(a,ch+b,!0===c),d(a,dh+b,!1===c)}var f=a.clazz,g=a.set,h=a.unset;f.prototype.$setValidity=function(a,f,i){t(f)?b(this,"$pending",a,i):c(this,"$pending",a,i),J(f)?f?(h(this.$error,a,i),g(this.$$success,a,i)):(g(this.$error,a,i),h(this.$$success,a,i)):(h(this.$error,a,i),h(this.$$success,a,i)),this.$pending?(d(this,ug,!0),this.$valid=this.$invalid=void 0,e(this,"",null)):(d(this,ug,!1),this.$valid=Jd(this.$error),this.$invalid=!this.$valid,e(this,"",this.$valid));var j;j=this.$pending&&this.$pending[a]?void 0:!this.$error[a]&&(!!this.$$success[a]||null),e(this,a,j),this.$$parentForm.$setValidity(a,j,this)}}function Jd(a){if(a)for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}function Kd(a){a.$formatters.push(function(b){return a.$isEmpty(b)?b:b.toString()})}function Ld(a,b,c,d,e,f){Md(a,b,c,d,e,f),Kd(d)}function Md(a,b,c,d,e,f){var g=se(b[0].type);if(!e.android){var h=!1;b.on("compositionstart",function(){h=!0}),b.on("compositionupdate",function(a){(t(a.data)||""===a.data)&&(h=!1)}),b.on("compositionend",function(){h=!1,j()})}var i,j=function(a){if(i&&(f.defer.cancel(i),i=null),!h){var e=b.val(),j=a&&a.type;"password"===g||c.ngTrim&&"false"===c.ngTrim||(e=Ee(e)),(d.$viewValue!==e||""===e&&d.$$hasNativeValidators)&&d.$setViewValue(e,j)}};if(e.hasEvent("input"))b.on("input",j);else{var k=function(a,b,c){i||(i=f.defer(function(){i=null,b&&b.value===c||j(a)}))};b.on("keydown",function(a){var b=a.keyCode;91===b||15<b&&b<19||37<=b&&b<=40||k(a,this,this.value)}),e.hasEvent("paste")&&b.on("paste cut drop",k)}b.on("change",j),Ig[g]&&d.$$hasNativeValidators&&g===c.type&&b.on(Hg,function(a){if(!i){var b=this[qe],c=b.badInput,d=b.typeMismatch;i=f.defer(function(){i=null,b.badInput===c&&b.typeMismatch===d||j(a)})}}),d.$render=function(){var a=d.$isEmpty(d.$viewValue)?"":d.$viewValue;b.val()!==a&&b.val(a)}}function Nd(a,b){if(z(a))return a;if(x(a)){Eg.lastIndex=0;var c=Eg.exec(a);if(c){var d=+c[1],e=+c[2],f=0,g=0,h=0,i=0,j=td(d),k=7*(e-1);return b&&(f=b.getHours(),g=b.getMinutes(),h=b.getSeconds(),i=b.getMilliseconds()),new Date(d,0,j.getDate()+k,f,g,h,i)}}return NaN}function Od(a,b){return function(c,d){var e,g;if(z(c))return c;if(x(c)){if('"'===c.charAt(0)&&'"'===c.charAt(c.length-1)&&(c=c.substring(1,c.length-1)),yg.test(c))return new Date(c);if(a.lastIndex=0,e=a.exec(c)){e.shift(),g=d?{yyyy:d.getFullYear(),MM:d.getMonth()+1,dd:d.getDate(),HH:d.getHours(),mm:d.getMinutes(),ss:d.getSeconds(),sss:d.getMilliseconds()/1e3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},f(e,function(a,c){c<b.length&&(g[b[c]]=+a)});var h=new Date(g.yyyy,g.MM-1,g.dd,g.HH,g.mm,g.ss||0,1e3*g.sss||0);return g.yyyy<100&&h.setFullYear(g.yyyy),h}}return NaN}}function Pd(a,b,c,d){return function(e,f,g,h,i,j,k,l){function m(a){return a&&!(a.getTime&&a.getTime()!==a.getTime())}function n(a){return u(a)&&!z(a)?o(a)||void 0:a}function o(a,b){var d=h.$options.getOption("timezone");r&&r!==d&&(b=aa(b,_(r)));var e=c(a,b);return!isNaN(e)&&d&&(e=ba(e,d)),e}function p(a,b){var c=d;s&&x(h.$options.getOption("timeSecondsFormat"))&&(c=d.replace("ss.sss",h.$options.getOption("timeSecondsFormat")).replace(/:$/,""));var e=k("date")(a,c,b);return s&&h.$options.getOption("timeStripZeroSeconds")&&(e=e.replace(/(?::00)?(?:\.000)?$/,"")),e}Qd(e,f,g,h,a),Md(e,f,g,h,i,j);var q,r,s="time"===a||"datetimelocal"===a;if(h.$parsers.push(function(c){return h.$isEmpty(c)?null:b.test(c)?o(c,q):void(h.$$parserName=a)}),h.$formatters.push(function(a){if(a&&!z(a))throw gh("datefmt","Expected `{0}` to be a date",a);if(m(a)){q=a;var b=h.$options.getOption("timezone");return b&&(r=b,q=ba(q,b,!0)),p(a,b)}return q=null,r=null,""}),u(g.min)||g.ngMin){var v=g.min||l(g.ngMin)(e),w=n(v);h.$validators.min=function(a){return!m(a)||t(w)||c(a)>=w},g.$observe("min",function(a){a!==v&&(w=n(a),v=a,h.$validate())})}if(u(g.max)||g.ngMax){var y=g.max||l(g.ngMax)(e),A=n(y);h.$validators.max=function(a){return!m(a)||t(A)||c(a)<=A},g.$observe("max",function(a){a!==y&&(A=n(a),y=a,h.$validate())})}}}function Qd(a,b,c,d,e){var f=b[0];(d.$$hasNativeValidators=v(f.validity))&&d.$parsers.push(function(a){var c=b.prop(qe)||{};return c.badInput||c.typeMismatch?void(d.$$parserName=e):a})}function Rd(a){a.$parsers.push(function(b){return a.$isEmpty(b)?null:Bg.test(b)?parseFloat(b):void(a.$$parserName="number")}),a.$formatters.push(function(b){if(!a.$isEmpty(b)){if(!y(b))throw gh("numfmt","Expected `{0}` to be a number",b);b=b.toString()}return b})}function Sd(a){return u(a)&&!y(a)&&(a=parseFloat(a)),Ce(a)?void 0:a}function Td(a){return(0|a)===a}function Ud(a){var b=a.toString(),c=b.indexOf(".");if(-1===c){if(-1<a&&a<1){var d=/e-(\d+)$/.exec(b);if(d)return Number(d[1])}return 0}return b.length-c-1}function Vd(a,b,c){var d=Number(a),e=!Td(d),f=!Td(b),g=!Td(c);if(e||f||g){var h=e?Ud(d):0,i=f?Ud(b):0,j=g?Ud(c):0,k=Math.max(h,i,j),l=Math.pow(10,k);d*=l,b*=l,c*=l,e&&(d=Math.round(d)),f&&(b=Math.round(b)),g&&(c=Math.round(c))}return(d-b)%c==0}function Wd(a,b,c,d,e,f,g,h){Qd(a,b,c,d,"number"),Rd(d),Md(a,b,c,d,e,f);var i;if(u(c.min)||c.ngMin){var j=c.min||h(c.ngMin)(a);i=Sd(j),d.$validators.min=function(a,b){return d.$isEmpty(b)||t(i)||b>=i},c.$observe("min",function(a){a!==j&&(i=Sd(a),j=a,d.$validate())})}if(u(c.max)||c.ngMax){var k=c.max||h(c.ngMax)(a),l=Sd(k);d.$validators.max=function(a,b){return d.$isEmpty(b)||t(l)||b<=l},c.$observe("max",function(a){a!==k&&(l=Sd(a),k=a,d.$validate())})}if(u(c.step)||c.ngStep){var m=c.step||h(c.ngStep)(a),n=Sd(m);d.$validators.step=function(a,b){return d.$isEmpty(b)||t(n)||Vd(b,i||0,n)},c.$observe("step",function(a){a!==m&&(n=Sd(a),m=a,d.$validate())})}}function Xd(a,b,c,d,e,f){function g(a,d){b.attr(a,c[a]);var e=c[a];c.$observe(a,function(a){a!==e&&(e=a,d(a))})}function h(a){if(l=Sd(a),!Ce(d.$modelValue))if(k){var c=b.val();l>c&&(c=l,b.val(c)),d.$setViewValue(c)}else d.$validate()}function i(a){if(m=Sd(a),!Ce(d.$modelValue))if(k){var c=b.val();m<c&&(b.val(m),c=m<l?l:m),d.$setViewValue(c)}else d.$validate()}function j(a){n=Sd(a),Ce(d.$modelValue)||(k?d.$viewValue!==b.val()&&d.$setViewValue(b.val()):d.$validate())}Qd(a,b,c,d,"range"),Rd(d),Md(a,b,c,d,e,f);var k=d.$$hasNativeValidators&&"range"===b[0].type,l=k?0:void 0,m=k?100:void 0,n=k?1:void 0,o=b[0].validity,p=u(c.min),q=u(c.max),r=u(c.step),s=d.$render;d.$render=k&&u(o.rangeUnderflow)&&u(o.rangeOverflow)?function(){s(),d.$setViewValue(b.val())}:s,p&&(l=Sd(c.min),d.$validators.min=k?function(){return!0}:function(a,b){return d.$isEmpty(b)||t(l)||b>=l},g("min",h)),q&&(m=Sd(c.max),d.$validators.max=k?function(){return!0}:function(a,b){return d.$isEmpty(b)||t(m)||b<=m},g("max",i)),r&&(n=Sd(c.step),d.$validators.step=k?function(){return!o.stepMismatch}:function(a,b){return d.$isEmpty(b)||t(n)||Vd(b,l||0,n)},g("step",j))}function Yd(a,b,c,d,e,f){Md(a,b,c,d,e,f),Kd(d),d.$validators.url=function(a,b){var c=a||b;return d.$isEmpty(c)||zg.test(c)}}function Zd(a,b,c,d,e,f){Md(a,b,c,d,e,f),Kd(d),d.$validators.email=function(a,b){var c=a||b;return d.$isEmpty(c)||Ag.test(c)}}function $d(a,b,c,d){var e=!c.ngTrim||"false"!==Ee(c.ngTrim);t(c.name)&&b.attr("name",i());var f=function(a){var f;b[0].checked&&(f=c.value,e&&(f=Ee(f)),d.$setViewValue(f,a&&a.type))};b.on("change",f),d.$render=function(){var a=c.value;e&&(a=Ee(a)),b[0].checked=a===d.$viewValue},c.$observe("value",d.$render)}function _d(a,b,c,d,e){var f;if(u(d)){if(f=a(d),!f.constant)throw gh("constexpr","Expected constant expression for `{0}`, but saw `{1}`.",c,d);return f(b)}return e}function ae(a,b,c,d,e,f,g,h){var i=_d(h,a,"ngTrueValue",c.ngTrueValue,!0),j=_d(h,a,"ngFalseValue",c.ngFalseValue,!1),k=function(a){d.$setViewValue(b[0].checked,a&&a.type)};b.on("change",k),d.$render=function(){b[0].checked=d.$viewValue},d.$isEmpty=function(a){return!1===a},d.$formatters.push(function(a){return U(a,i)}),d.$parsers.push(function(a){return a?i:j})}function be(a,b){function c(a,b){if(!a||!a.length)return[];if(!b||!b.length)return a;var c=[];a:for(var d=0;d<a.length;d++){for(var e=a[d],f=0;f<b.length;f++)if(e===b[f])continue a;c.push(e)}return c}function d(a){return a&&a.split(" ")}function e(a){if(!a)return a;var b=a;return A(a)?b=a.map(e).join(" "):v(a)?b=Object.keys(a).filter(function(b){return a[b]}).join(" "):x(a)||(b=a+""),b}a="ngClass"+a;var g;return["$parse",function(h){return{restrict:"AC",link:function(i,j,k){function l(a){a=o(d(a),1),k.$addClass(a)}function m(a){a=o(d(a),-1),k.$removeClass(a)}function n(a,b){var e=d(a),f=d(b),g=c(e,f),h=c(f,e),i=o(g,-1),j=o(h,1);k.$addClass(j),k.$removeClass(i)}function o(a,b){var c=[];return f(a,function(a){(b>0||s[a])&&(s[a]=(s[a]||0)+b,s[a]===+(b>0)&&c.push(a))}),c.join(" ")}function p(a){a===b?l(r):m(r),t=a}function q(a){t===b&&n(r,a),r=a}var r,s=j.data("$classCounts"),t=!0;s||(s=ta(),j.data("$classCounts",s)),"ngClass"!==a&&(g||(g=h("$index",function(a){return 1&a})),i.$watch(g,p)),i.$watch(h(k[a],e),q)}}}]}function ce(a,b,c,d,e,f){return{restrict:"A",compile:function(g,h){var i=a(h[d]);return function(a,d){d.on(e,function(d){var e=function(){i(a,{$event:d})};if(b.$$phase)if(f)a.$evalAsync(e);else try{e()}catch(a){c(a)}else a.$apply(e)})}}}}function de(a,b,c,d,e,f,g,h,i){this.$viewValue=Number.NaN,this.$modelValue=Number.NaN,this.$$rawModelValue=void 0,this.$validators={},this.$asyncValidators={},this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$untouched=!0,this.$touched=!1,this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$error={},this.$$success={},this.$pending=void 0,this.$name=i(c.name||"",!1)(a),this.$$parentForm=tg,this.$options=hh,this.$$updateEvents="",this.$$updateEventHandler=this.$$updateEventHandler.bind(this),this.$$parsedNgModel=e(c.ngModel),this.$$parsedNgModelAssign=this.$$parsedNgModel.assign,this.$$ngModelGet=this.$$parsedNgModel,this.$$ngModelSet=this.$$parsedNgModelAssign,this.$$pendingDebounce=null,this.$$parserValid=void 0,this.$$parserName="parse",this.$$currentValidationRunId=0,this.$$scope=a,this.$$rootScope=a.$root,this.$$attr=c,this.$$element=d,this.$$animate=f,this.$$timeout=g,this.$$parse=e,this.$$q=h,this.$$exceptionHandler=b,Hd(this),ee(this)}function ee(a){a.$$scope.$watch(function(b){var c=a.$$ngModelGet(b);return c===a.$modelValue||a.$modelValue!==a.$modelValue&&c!==c||a.$$setModelValue(c),c})}function fe(a){this.$$options=a}function ge(a,b){f(b,function(b,c){u(a[c])||(a[c]=b)})}function he(a,b){a.prop("selected",b),a.attr("selected",b)}function ie(a,b,c){if(a){if(x(a)&&(a=new RegExp("^"+a+"$")),!a.test)throw d("ngPattern")("noregexp","Expected {0} to be a RegExp but was {1}. Element: {2}",b,a,ca(c));return a}}function je(a){var b=n(a);return Ce(b)?-1:b}var ke,le,me,ne,oe={objectMaxDepth:5,urlErrorParamsEnabled:!0},pe=/^\/(.+)\/([a-z]*)$/,qe="validity",re=Object.prototype.hasOwnProperty,se=function(a){return x(a)?a.toLowerCase():a},te=function(a){return x(a)?a.toUpperCase():a},ue=[].slice,ve=[].splice,we=[].push,xe=Object.prototype.toString,ye=Object.getPrototypeOf,ze=d("ng"),Ae=a.angular||(a.angular={}),Be=0;ke=a.document.documentMode;var Ce=Number.isNaN||function(a){return a!==a};p.$inject=[],q.$inject=[];var De=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/,Ee=function(a){return x(a)?a.trim():a},Fe=function(a){return a.replace(/([-()[\]{}+?*.$^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},Ge=function(){if(!u(Ge.rules)){var b=a.document.querySelector("[ng-csp]")||a.document.querySelector("[data-ng-csp]");if(b){var c=b.getAttribute("ng-csp")||b.getAttribute("data-ng-csp");Ge.rules={noUnsafeEval:!c||-1!==c.indexOf("no-unsafe-eval"),noInlineStyle:!c||-1!==c.indexOf("no-inline-style")}}else Ge.rules={noUnsafeEval:function(){try{return new Function(""),!1}catch(a){return!0}}(),noInlineStyle:!1}}return Ge.rules},He=function(){if(u(He.name_))return He.name_;var b,c,d,e,f=Je.length;for(c=0;c<f;++c)if(d=Je[c],b=a.document.querySelector("["+d.replace(":","\\:")+"jq]")){e=b.getAttribute(d+"jq");break}return He.name_=e},Ie=/:/g,Je=["ng-","data-ng-","ng:","x-ng-"],Ke=function(b){var c=b.currentScript;if(!c)return!0;if(!(c instanceof a.HTMLScriptElement||c instanceof a.SVGScriptElement))return!1;var d=c.attributes;return[d.getNamedItem("src"),d.getNamedItem("href"),d.getNamedItem("xlink:href")].every(function(a){if(!a)return!0;if(!a.value)return!1;var c=b.createElement("a");if(c.href=a.value,b.location.origin===c.origin)return!0;switch(c.protocol){case"http:":case"https:":case"ftp:":case"blob:":case"file:":case"data:":return!0;default:return!1}})}(a.document),Le=/[A-Z]/g,Me=!1,Ne=1,Oe=3,Pe=8,Qe=9,Re=11,Se={full:"1.7.6",major:1,minor:7,dot:6,codeName:"gravity-manipulation"};Ja.expando="ng339";var Te=Ja.cache={},Ue=1;Ja._data=function(a){return this.cache[a[this.expando]]||{}};var Ve=/-([a-z])/g,We=/^-ms-/,Xe={mouseleave:"mouseout",mouseenter:"mouseover"},Ye=d("jqLite"),Ze=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,$e=/<|&#?\w+;/,_e=/<([\w:-]+)/,af=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,bf={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td;var cf=a.Node.prototype.contains||function(a){return!!(16&this.compareDocumentPosition(a))},df=Ja.prototype={ready:_a,toString:function(){var a=[];return f(this,function(b){a.push(""+b)}),"["+a.join(", ")+"]"},eq:function(a){return le(a>=0?this[a]:this[this.length+a])},length:0,push:we,sort:[].sort,splice:[].splice},ef={};f("multiple,selected,checked,disabled,readOnly,required,open".split(","),function(a){ef[se(a)]=a});var ff={};f("input,select,option,textarea,button,form,details".split(","),function(a){ff[a]=!0});var gf={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern",ngStep:"step"};f({data:Ra,removeData:Pa,hasData:Fa,cleanData:function(a){for(var b=0,c=a.length;b<c;b++)Pa(a[b]),Oa(a[b])}},function(a,b){Ja[b]=a}),f({data:Ra,inheritedData:Xa,scope:function(a){return le.data(a,"$scope")||Xa(a.parentNode||a,["$isolateScope","$scope"])},isolateScope:function(a){return le.data(a,"$isolateScope")||le.data(a,"$isolateScopeNoTemplate")},controller:Wa,injector:function(a){return Xa(a,"$injector")},removeAttr:function(a,b){a.removeAttribute(b)},hasClass:Sa,css:function(a,b,c){if(b=Aa(b),!u(c))return a.style[b];a.style[b]=c},attr:function(a,b,c){var d,e=a.nodeType;if(e!==Oe&&2!==e&&e!==Pe&&a.getAttribute){var f=se(b),g=ef[f];if(!u(c))return d=a.getAttribute(b),g&&null!==d&&(d=f),null===d?void 0:d;null===c||!1===c&&g?a.removeAttribute(b):a.setAttribute(b,g?f:c)}},prop:function(a,b,c){if(!u(c))return a[b];a[b]=c},text:function(){function a(a,b){if(t(b)){var c=a.nodeType;return c===Ne||c===Oe?a.textContent:""}a.textContent=b}return a.$dv="",a}(),val:function(a,b){if(t(b)){if(a.multiple&&"select"===P(a)){var c=[];return f(a.options,function(a){a.selected&&c.push(a.value||a.text)}),c}return a.value}a.value=b},html:function(a,b){if(t(b))return a.innerHTML;La(a,!0),a.innerHTML=b},empty:Ya},function(a,b){Ja.prototype[b]=function(b,c){var d,e,f=this.length;if(a!==Ya&&t(2===a.length&&a!==Sa&&a!==Wa?b:c)){if(v(b)){for(d=0;d<f;d++)if(a===Ra)a(this[d],b);else for(e in b)a(this[d],e,b[e]);return this}for(var g=a.$dv,h=t(g)?Math.min(f,1):f,i=0;i<h;i++){var j=a(this[i],b,c);g=g?g+j:j}return g}for(d=0;d<f;d++)a(this[d],b,c);return this}}),f({removeData:Pa,on:function(a,b,c,d){if(u(d))throw Ye("onargs","jqLite#on() does not support the `selector` or `eventData` parameters");if(Ea(a)){var e=Qa(a,!0),f=e.events,g=e.handle;g||(g=e.handle=cb(a,f));for(var h=b.indexOf(" ")>=0?b.split(" "):[b],i=h.length,j=function(b,d,e){var h=f[b];h||(h=f[b]=[],h.specialHandlerWrapper=d,"$destroy"===b||e||a.addEventListener(b,g)),h.push(c)};i--;)b=h[i],Xe[b]?(j(Xe[b],eb),j(b,void 0,!0)):j(b)}},off:Oa,one:function(a,b,c){a=le(a),a.on(b,function d(){a.off(b,c),a.off(b,d)}),a.on(b,c)},replaceWith:function(a,b){var c,d=a.parentNode;La(a),f(new Ja(b),function(b){c?d.insertBefore(b,c.nextSibling):d.replaceChild(b,a),c=b})},children:function(a){var b=[];return f(a.childNodes,function(a){a.nodeType===Ne&&b.push(a)}),b},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,b){var c=a.nodeType;if(c===Ne||c===Re){b=new Ja(b);for(var d=0,e=b.length;d<e;d++){var f=b[d];a.appendChild(f)}}},prepend:function(a,b){if(a.nodeType===Ne){var c=a.firstChild;f(new Ja(b),function(b){a.insertBefore(b,c)})}},wrap:function(a,b){Ia(a,le(b).eq(0).clone()[0])},remove:Za,detach:function(a){Za(a,!0)},after:function(a,b){var c=a,d=a.parentNode;if(d){b=new Ja(b);for(var e=0,f=b.length;e<f;e++){var g=b[e];d.insertBefore(g,c.nextSibling),c=g}}},addClass:Ua,removeClass:Ta,toggleClass:function(a,b,c){b&&f(b.split(" "),function(b){var d=c;t(d)&&(d=!Sa(a,b)),(d?Ua:Ta)(a,b)})},parent:function(a){var b=a.parentNode;return b&&b.nodeType!==Re?b:null},next:function(a){return a.nextElementSibling},find:function(a,b){return a.getElementsByTagName?a.getElementsByTagName(b):[]},clone:Ka,triggerHandler:function(a,b,c){var d,e,g,h=b.type||b,i=Qa(a),j=i&&i.events,k=j&&j[h];k&&(d={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:p,type:h,target:a},b.type&&(d=l(d,b)),e=wa(k),g=c?[d].concat(c):[d],f(e,function(b){d.isImmediatePropagationStopped()||b.apply(a,g)}))}},function(a,b){Ja.prototype[b]=function(b,c,d){for(var e,f=0,g=this.length;f<g;f++)t(e)?(e=a(this[f],b,c,d),u(e)&&(e=le(e))):Va(e,a(this[f],b,c,d));return u(e)?e:this}}),Ja.prototype.bind=Ja.prototype.on,Ja.prototype.unbind=Ja.prototype.off;var hf=Object.create(null);hb.prototype={_idx:function(a){return a!==this._lastKey&&(this._lastKey=a,this._lastIndex=this._keys.indexOf(a)),this._lastIndex},_transformKey:function(a){return Ce(a)?hf:a},get:function(a){a=this._transformKey(a);var b=this._idx(a);if(-1!==b)return this._values[b]},has:function(a){return a=this._transformKey(a),-1!==this._idx(a)},set:function(a,b){a=this._transformKey(a);var c=this._idx(a);-1===c&&(c=this._lastIndex=this._keys.length),this._keys[c]=a,this._values[c]=b},delete:function(a){a=this._transformKey(a);var b=this._idx(a);return-1!==b&&(this._keys.splice(b,1),this._values.splice(b,1),this._lastKey=NaN,this._lastIndex=-1,!0)}};var jf=hb,kf=[function(){this.$get=[function(){return jf}]}],lf=/^([^(]+?)=>/,mf=/^[^(]*\(\s*([^)]*)\)/m,nf=/,/,of=/^\s*(_?)(\S+?)\1\s*$/,pf=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,qf=d("$injector");mb.$$annotate=lb;var rf=d("$animate"),sf=1,tf=function(){this.$get=p},uf=function(){var a=new jf,b=[];this.$get=["$$AnimateRunner","$rootScope",function(c,d){function e(a,b,c){var d=!1;return b&&(b=x(b)?b.split(" "):A(b)?b:[],f(b,function(b){b&&(d=!0,a[b]=c)})),d}function g(){f(b,function(b){var c=a.get(b);if(c){var d=qb(b.attr("class")),e="",g="";f(c,function(a,b){a!==!!d[b]&&(a?e+=(e.length?" ":"")+b:g+=(g.length?" ":"")+b)}),f(b,function(a){e&&Ua(a,e),g&&Ta(a,g)}),a.delete(b)}}),b.length=0}function h(c,f,h){var i=a.get(c)||{},j=e(i,f,!0),k=e(i,h,!1);(j||k)&&(a.set(c,i),b.push(c),1===b.length&&d.$$postDigest(g))}return{enabled:p,on:p,off:p,pin:p,push:function(a,b,d,e){e&&e(),d=d||{},d.from&&a.css(d.from),d.to&&a.css(d.to),(d.addClass||d.removeClass)&&h(a,d.addClass,d.removeClass);var f=new c;return f.complete(),f}}}]},vf=["$provide",function(a){var b=this,c=null,d=null;this.$$registeredAnimations=Object.create(null),this.register=function(c,d){if(c&&"."!==c.charAt(0))throw rf("notcsel","Expecting class selector starting with '.' got '{0}'.",c);var e=c+"-animation";b.$$registeredAnimations[c.substr(1)]=e,a.factory(e,d)},this.customFilter=function(a){return 1===arguments.length&&(d=C(a)?a:null),d},this.classNameFilter=function(a){if(1===arguments.length&&(c=a instanceof RegExp?a:null)){if(new RegExp("[(\\s|\\/)]ng-animate[(\\s|\\/)]").test(c.toString()))throw c=null,rf("nongcls",'$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the "{0}" CSS class.',"ng-animate")}return c},this.$get=["$$animateQueue",function(a){function b(a,b,c){if(c){var d=pb(c);!d||d.parentNode||d.previousElementSibling||(c=null)}c?c.after(a):b.prepend(a)}return{on:a.on,off:a.off,pin:a.pin,enabled:a.enabled,cancel:function(a){a.cancel&&a.cancel()},enter:function(c,d,e,f){return d=d&&le(d),e=e&&le(e),d=d||e.parent(),b(c,d,e),a.push(c,"enter",rb(f))},move:function(c,d,e,f){return d=d&&le(d),e=e&&le(e),d=d||e.parent(),b(c,d,e),a.push(c,"move",rb(f))},leave:function(b,c){return a.push(b,"leave",rb(c),function(){b.remove()})},addClass:function(b,c,d){return d=rb(d),d.addClass=ob(d.addclass,c),a.push(b,"addClass",d)},removeClass:function(b,c,d){return d=rb(d),d.removeClass=ob(d.removeClass,c),a.push(b,"removeClass",d)},setClass:function(b,c,d,e){return e=rb(e),e.addClass=ob(e.addClass,c),e.removeClass=ob(e.removeClass,d),a.push(b,"setClass",e)},animate:function(b,c,d,e,f){return f=rb(f),f.from=f.from?l(f.from,c):c,f.to=f.to?l(f.to,d):d,e=e||"ng-inline-animate",f.tempClasses=ob(f.tempClasses,e),a.push(b,"animate",f)}}}]}],wf=function(){this.$get=["$$rAF",function(a){function b(b){c.push(b),c.length>1||a(function(){for(var a=0;a<c.length;a++)c[a]();c=[]})}var c=[];return function(){var a=!1;return b(function(){a=!0}),function(c){a?c():b(c)}}}]},xf=function(){this.$get=["$q","$sniffer","$$animateAsyncRun","$$isDocumentHidden","$timeout",function(a,b,c,d,e){function g(a){this.setHost(a);var b=c(),f=function(a){e(a,0,!1)};this._doneCallbacks=[],this._tick=function(a){d()?f(a):b(a)},this._state=0}return g.chain=function(a,b){function c(){if(d===a.length)return void b(!0);a[d](function(a){if(!1===a)return void b(!1);d++,c()})}var d=0;c()},g.all=function(a,b){function c(c){e=e&&c,++d===a.length&&b(e)}var d=0,e=!0;f(a,function(a){a.done(c)})},g.prototype={setHost:function(a){this.host=a||{}},done:function(a){2===this._state?a():this._doneCallbacks.push(a)},progress:p,getPromise:function(){if(!this.promise){var b=this;this.promise=a(function(a,c){b.done(function(b){!1===b?c():a()})})}return this.promise},then:function(a,b){return this.getPromise().then(a,b)},catch:function(a){return this.getPromise().catch(a)},finally:function(a){return this.getPromise().finally(a)},pause:function(){this.host.pause&&this.host.pause()},resume:function(){this.host.resume&&this.host.resume()},end:function(){this.host.end&&this.host.end(),this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel(),this._resolve(!1)},complete:function(a){var b=this;0===b._state&&(b._state=1,b._tick(function(){b._resolve(a)}))},_resolve:function(a){2!==this._state&&(f(this._doneCallbacks,function(b){b(a)}),this._doneCallbacks.length=0,this._state=2)}},g}]},yf=function(){this.$get=["$$rAF","$q","$$AnimateRunner",function(a,b,c){return function(b,d){function e(){return a(function(){f(),h||i.complete(),h=!0}),i}function f(){g.addClass&&(b.addClass(g.addClass),g.addClass=null),g.removeClass&&(b.removeClass(g.removeClass),g.removeClass=null),g.to&&(b.css(g.to),g.to=null)}var g=d||{};g.$$prepared||(g=S(g)),g.cleanupStyles&&(g.from=g.to=null),g.from&&(b.css(g.from),g.from=null);var h,i=new c;return{start:e,end:e}}}]},zf=d("$compile"),Af=new yb;zb.$inject=["$provide","$$sanitizeUriProvider"],Ab.prototype.isFirstChange=function(){return this.previousValue===Af};var Bf=/^((?:x|data)[:\-_])/i,Cf=/[:\-_]+(.)/g,Df=d("$controller"),Ef=/^(\S+)(\s+as\s+([\w$]+))?$/,Ff=function(){this.$get=["$document",function(a){return function(b){return b?!b.nodeType&&b instanceof le&&(b=b[0]):b=a[0].body,b.offsetWidth+1}}]},Gf="application/json",Hf={"Content-Type":Gf+";charset=utf-8"},If=/^\[|^\{(?!\{)/,Jf={"[":/]$/,"{":/}$/},Kf=/^\)]\}',?\n/,Lf=d("$http"),Mf=Ae.$interpolateMinErr=d("$interpolate");Mf.throwNoconcat=function(a){throw Mf("noconcat","Error while interpolating: {0}\nStrict Contextual Escaping disallows interpolations that concatenate multiple expressions when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce",a)},Mf.interr=function(a,b){return Mf("interr","Can't interpolate: {0}\n{1}",a,b.toString())};var Nf=d("$interval"),Of=function(){this.$get=function(){function a(a){var b=function(a){b.data=a,b.called=!0};return b.id=a,b}var b=Ae.callbacks,c={};return{createCallback:function(d){var e="_"+(b.$$counter++).toString(36),f="angular.callbacks."+e,g=a(e);return c[f]=b[e]=g,f},wasCalled:function(a){return c[a].called},getResponse:function(a){return c[a].data},removeCallback:function(a){var d=c[a];delete b[d.id],delete c[a]}}}},Pf=/^([^?#]*)(\?([^#]*))?(#(.*))?$/,Qf={http:80,https:443,ftp:21},Rf=d("$location"),Sf=/^\s*[\\\/]{2,}/,Tf={$$absUrl:"",$$html5:!1,$$replace:!1,$$compose:function(){this.$$url=_b(this.$$path,this.$$search,this.$$hash),this.$$absUrl=this.$$normalizeUrl(this.$$url),this.$$urlUpdatedByLocation=!0},absUrl:kc("$$absUrl"),url:function(a){if(t(a))return this.$$url;var b=Pf.exec(a);return(b[1]||""===a)&&this.path(decodeURIComponent(b[1])),(b[2]||b[1]||""===a)&&this.search(b[3]||""),this.hash(b[5]||""),this},protocol:kc("$$protocol"),host:kc("$$host"),port:kc("$$port"),path:lc("$$path",function(a){return a=null!==a?a.toString():"","/"===a.charAt(0)?a:"/"+a}),search:function(a,b){switch(arguments.length){case 0:return this.$$search;case 1:if(x(a)||y(a))a=a.toString(),this.$$search=ea(a);else{if(!v(a))throw Rf("isrcharg","The first argument of the `$location#search()` call must be a string or an object.");a=S(a,{}),f(a,function(b,c){null==b&&delete a[c]}),this.$$search=a}break;default:t(b)||null===b?delete this.$$search[a]:this.$$search[a]=b}return this.$$compose(),this},hash:lc("$$hash",function(a){return null!==a?a.toString():""}),replace:function(){return this.$$replace=!0,this}};f([jc,ic,hc],function(a){a.prototype=Object.create(Tf),a.prototype.state=function(b){if(!arguments.length)return this.$$state;if(a!==hc||!this.$$html5)throw Rf("nostate","History API state support is available only in HTML5 mode and only in browsers supporting HTML5 History API");return this.$$state=t(b)?null:b,this.$$urlUpdatedByLocation=!0,this}});var Uf=d("$parse"),Vf={}.constructor.prototype.valueOf,Wf=ta();f("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(a){Wf[a]=!0});var Xf={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},Yf=function(a){this.options=a};Yf.prototype={constructor:Yf,lex:function(a){for(this.text=a,this.index=0,this.tokens=[];this.index<this.text.length;){var b=this.text.charAt(this.index);if('"'===b||"'"===b)this.readString(b);else if(this.isNumber(b)||"."===b&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdentifierStart(this.peekMultichar()))this.readIdent();else if(this.is(b,"(){}[].,;:?"))this.tokens.push({index:this.index,text:b}),this.index++;else if(this.isWhitespace(b))this.index++;else{var c=b+this.peek(),d=c+this.peek(2),e=Wf[b],f=Wf[c],g=Wf[d];if(e||f||g){var h=g?d:f?c:b;this.tokens.push({index:this.index,text:h,operator:!0}),this.index+=h.length}else this.throwError("Unexpected next character ",this.index,this.index+1)}}return this.tokens},is:function(a,b){return-1!==b.indexOf(a)},peek:function(a){var b=a||1;return this.index+b<this.text.length&&this.text.charAt(this.index+b)},isNumber:function(a){return"0"<=a&&a<="9"&&"string"==typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||" "===a},isIdentifierStart:function(a){return this.options.isIdentifierStart?this.options.isIdentifierStart(a,this.codePointAt(a)):this.isValidIdentifierStart(a)},isValidIdentifierStart:function(a){return"a"<=a&&a<="z"||"A"<=a&&a<="Z"||"_"===a||"$"===a},isIdentifierContinue:function(a){return this.options.isIdentifierContinue?this.options.isIdentifierContinue(a,this.codePointAt(a)):this.isValidIdentifierContinue(a)},isValidIdentifierContinue:function(a,b){return this.isValidIdentifierStart(a,b)||this.isNumber(a)},codePointAt:function(a){return 1===a.length?a.charCodeAt(0):(a.charCodeAt(0)<<10)+a.charCodeAt(1)-56613888},peekMultichar:function(){var a=this.text.charAt(this.index),b=this.peek();if(!b)return a;var c=a.charCodeAt(0),d=b.charCodeAt(0);return c>=55296&&c<=56319&&d>=56320&&d<=57343?a+b:a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,b,c){c=c||this.index;var d=u(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,c)+"]":" "+c;throw Uf("lexerr","Lexer Error: {0} at column{1} in expression [{2}].",a,d,this.text)},readNumber:function(){for(var a="",b=this.index;this.index<this.text.length;){var c=se(this.text.charAt(this.index));if("."===c||this.isNumber(c))a+=c;else{var d=this.peek();if("e"===c&&this.isExpOperator(d))a+=c;else if(this.isExpOperator(c)&&d&&this.isNumber(d)&&"e"===a.charAt(a.length-1))a+=c;else{if(!this.isExpOperator(c)||d&&this.isNumber(d)||"e"!==a.charAt(a.length-1))break;this.throwError("Invalid exponent")}}this.index++}this.tokens.push({index:b,text:a,constant:!0,value:Number(a)})},readIdent:function(){var a=this.index;for(this.index+=this.peekMultichar().length;this.index<this.text.length;){var b=this.peekMultichar();if(!this.isIdentifierContinue(b))break;this.index+=b.length}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var b=this.index;this.index++;for(var c="",d=a,e=!1;this.index<this.text.length;){var f=this.text.charAt(this.index);if(d+=f,e){if("u"===f){
5
+ var g=this.text.substring(this.index+1,this.index+5);g.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+g+"]"),this.index+=4,c+=String.fromCharCode(parseInt(g,16))}else{c+=Xf[f]||f}e=!1}else if("\\"===f)e=!0;else{if(f===a)return this.index++,void this.tokens.push({index:b,text:d,constant:!0,value:c});c+=f}this.index++}this.throwError("Unterminated quote",b)}};var Zf=function(a,b){this.lexer=a,this.options=b};Zf.Program="Program",Zf.ExpressionStatement="ExpressionStatement",Zf.AssignmentExpression="AssignmentExpression",Zf.ConditionalExpression="ConditionalExpression",Zf.LogicalExpression="LogicalExpression",Zf.BinaryExpression="BinaryExpression",Zf.UnaryExpression="UnaryExpression",Zf.CallExpression="CallExpression",Zf.MemberExpression="MemberExpression",Zf.Identifier="Identifier",Zf.Literal="Literal",Zf.ArrayExpression="ArrayExpression",Zf.Property="Property",Zf.ObjectExpression="ObjectExpression",Zf.ThisExpression="ThisExpression",Zf.LocalsExpression="LocalsExpression",Zf.NGValueParameter="NGValueParameter",Zf.prototype={ast:function(a){this.text=a,this.tokens=this.lexer.lex(a);var b=this.program();return 0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]),b},program:function(){for(var a=[];;)if(this.tokens.length>0&&!this.peek("}",")",";","]")&&a.push(this.expressionStatement()),!this.expect(";"))return{type:Zf.Program,body:a}},expressionStatement:function(){return{type:Zf.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var a=this.expression();this.expect("|");)a=this.filter(a);return a},expression:function(){return this.assignment()},assignment:function(){var a=this.ternary();if(this.expect("=")){if(!vc(a))throw Uf("lval","Trying to assign a value to a non l-value");a={type:Zf.AssignmentExpression,left:a,right:this.assignment(),operator:"="}}return a},ternary:function(){var a,b,c=this.logicalOR();return this.expect("?")&&(a=this.expression(),this.consume(":"))?(b=this.expression(),{type:Zf.ConditionalExpression,test:c,alternate:a,consequent:b}):c},logicalOR:function(){for(var a=this.logicalAND();this.expect("||");)a={type:Zf.LogicalExpression,operator:"||",left:a,right:this.logicalAND()};return a},logicalAND:function(){for(var a=this.equality();this.expect("&&");)a={type:Zf.LogicalExpression,operator:"&&",left:a,right:this.equality()};return a},equality:function(){for(var a,b=this.relational();a=this.expect("==","!=","===","!==");)b={type:Zf.BinaryExpression,operator:a.text,left:b,right:this.relational()};return b},relational:function(){for(var a,b=this.additive();a=this.expect("<",">","<=",">=");)b={type:Zf.BinaryExpression,operator:a.text,left:b,right:this.additive()};return b},additive:function(){for(var a,b=this.multiplicative();a=this.expect("+","-");)b={type:Zf.BinaryExpression,operator:a.text,left:b,right:this.multiplicative()};return b},multiplicative:function(){for(var a,b=this.unary();a=this.expect("*","/","%");)b={type:Zf.BinaryExpression,operator:a.text,left:b,right:this.unary()};return b},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:Zf.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.selfReferential.hasOwnProperty(this.peek().text)?a=S(this.selfReferential[this.consume().text]):this.options.literals.hasOwnProperty(this.peek().text)?a={type:Zf.Literal,value:this.options.literals[this.consume().text]}:this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var b;b=this.expect("(","[",".");)"("===b.text?(a={type:Zf.CallExpression,callee:a,arguments:this.parseArguments()},this.consume(")")):"["===b.text?(a={type:Zf.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===b.text?a={type:Zf.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){for(var b=[a],c={type:Zf.CallExpression,callee:this.identifier(),arguments:b,filter:!0};this.expect(":");)b.push(this.expression());return c},parseArguments:function(){var a=[];if(")"!==this.peekToken().text)do{a.push(this.filterChain())}while(this.expect(","));return a},identifier:function(){var a=this.consume();return a.identifier||this.throwError("is not a valid identifier",a),{type:Zf.Identifier,name:a.text}},constant:function(){return{type:Zf.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text)do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","));return this.consume("]"),{type:Zf.ArrayExpression,elements:a}},object:function(){var a,b=[];if("}"!==this.peekToken().text)do{if(this.peek("}"))break;a={type:Zf.Property,kind:"init"},this.peek().constant?(a.key=this.constant(),a.computed=!1,this.consume(":"),a.value=this.expression()):this.peek().identifier?(a.key=this.identifier(),a.computed=!1,this.peek(":")?(this.consume(":"),a.value=this.expression()):a.value=a.key):this.peek("[")?(this.consume("["),a.key=this.expression(),this.consume("]"),a.computed=!0,this.consume(":"),a.value=this.expression()):this.throwError("invalid key",this.peek()),b.push(a)}while(this.expect(","));return this.consume("}"),{type:Zf.ObjectExpression,properties:b}},throwError:function(a,b){throw Uf("syntax","Syntax Error: Token '{0}' {1} at column {2} of the expression [{3}] starting at [{4}].",b.text,a,b.index+1,this.text,this.text.substring(b.index))},consume:function(a){if(0===this.tokens.length)throw Uf("ueoe","Unexpected end of expression: {0}",this.text);var b=this.expect(a);return b||this.throwError("is unexpected, expecting ["+a+"]",this.peek()),b},peekToken:function(){if(0===this.tokens.length)throw Uf("ueoe","Unexpected end of expression: {0}",this.text);return this.tokens[0]},peek:function(a,b,c,d){return this.peekAhead(0,a,b,c,d)},peekAhead:function(a,b,c,d,e){if(this.tokens.length>a){var f=this.tokens[a],g=f.text;if(g===b||g===c||g===d||g===e||!b&&!c&&!d&&!e)return f}return!1},expect:function(a,b,c,d){var e=this.peek(a,b,c,d);return!!e&&(this.tokens.shift(),e)},selfReferential:{this:{type:Zf.ThisExpression},$locals:{type:Zf.LocalsExpression}}};var $f=1,_f=2;zc.prototype={compile:function(a){var b=this;this.state={nextId:0,filters:{},fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]},tc(a,b.$filter);var c,d="";if(this.stage="assign",c=wc(a)){this.state.computing="assign";var e=this.nextId();this.recurse(c,e),this.return_(e),d="fn.assign="+this.generateFunction("assign","s,v,l")}var g=uc(a.body);b.stage="inputs",f(g,function(a,c){var d="fn"+c;b.state[d]={vars:[],body:[],own:{}},b.state.computing=d;var e=b.nextId();b.recurse(a,e),b.return_(e),b.state.inputs.push({name:d,isPure:a.isPure}),a.watchId=c}),this.state.computing="fn",this.stage="main",this.recurse(a);var h='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+d+this.watchFns()+"return fn;",i=new Function("$filter","getStringValue","ifDefined","plus",h)(this.$filter,oc,pc,qc);return this.state=this.stage=void 0,i},USE:"use",STRICT:"strict",watchFns:function(){var a=[],b=this.state.inputs,c=this;return f(b,function(b){a.push("var "+b.name+"="+c.generateFunction(b.name,"s")),b.isPure&&a.push(b.name,".isPure="+JSON.stringify(b.isPure)+";")}),b.length&&a.push("fn.inputs=["+b.map(function(a){return a.name}).join(",")+"];"),a.join("")},generateFunction:function(a,b){return"function("+b+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],b=this;return f(this.state.filters,function(c,d){a.push(c+"=$filter("+b.escape(d)+")")}),a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,b,c,d,e,g){var h,i,j,k,l,m=this;if(d=d||p,!g&&u(a.watchId))return b=b||this.nextId(),void this.if_("i",this.lazyAssign(b,this.computedMember("i",a.watchId)),this.lazyRecurse(a,b,c,d,e,!0));switch(a.type){case Zf.Program:f(a.body,function(b,c){m.recurse(b.expression,void 0,void 0,function(a){i=a}),c!==a.body.length-1?m.current().body.push(i,";"):m.return_(i)});break;case Zf.Literal:k=this.escape(a.value),this.assign(b,k),d(b||k);break;case Zf.UnaryExpression:this.recurse(a.argument,void 0,void 0,function(a){i=a}),k=a.operator+"("+this.ifDefined(i,0)+")",this.assign(b,k),d(k);break;case Zf.BinaryExpression:this.recurse(a.left,void 0,void 0,function(a){h=a}),this.recurse(a.right,void 0,void 0,function(a){i=a}),k="+"===a.operator?this.plus(h,i):"-"===a.operator?this.ifDefined(h,0)+a.operator+this.ifDefined(i,0):"("+h+")"+a.operator+"("+i+")",this.assign(b,k),d(k);break;case Zf.LogicalExpression:b=b||this.nextId(),m.recurse(a.left,b),m.if_("&&"===a.operator?b:m.not(b),m.lazyRecurse(a.right,b)),d(b);break;case Zf.ConditionalExpression:b=b||this.nextId(),m.recurse(a.test,b),m.if_(b,m.lazyRecurse(a.alternate,b),m.lazyRecurse(a.consequent,b)),d(b);break;case Zf.Identifier:b=b||this.nextId(),c&&(c.context="inputs"===m.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",a.name)+"?l:s"),c.computed=!1,c.name=a.name),m.if_("inputs"===m.stage||m.not(m.getHasOwnProperty("l",a.name)),function(){m.if_("inputs"===m.stage||"s",function(){e&&1!==e&&m.if_(m.isNull(m.nonComputedMember("s",a.name)),m.lazyAssign(m.nonComputedMember("s",a.name),"{}")),m.assign(b,m.nonComputedMember("s",a.name))})},b&&m.lazyAssign(b,m.nonComputedMember("l",a.name))),d(b);break;case Zf.MemberExpression:h=c&&(c.context=this.nextId())||this.nextId(),b=b||this.nextId(),m.recurse(a.object,h,void 0,function(){m.if_(m.notNull(h),function(){a.computed?(i=m.nextId(),m.recurse(a.property,i),m.getStringValue(i),e&&1!==e&&m.if_(m.not(m.computedMember(h,i)),m.lazyAssign(m.computedMember(h,i),"{}")),k=m.computedMember(h,i),m.assign(b,k),c&&(c.computed=!0,c.name=i)):(e&&1!==e&&m.if_(m.isNull(m.nonComputedMember(h,a.property.name)),m.lazyAssign(m.nonComputedMember(h,a.property.name),"{}")),k=m.nonComputedMember(h,a.property.name),m.assign(b,k),c&&(c.computed=!1,c.name=a.property.name))},function(){m.assign(b,"undefined")}),d(b)},!!e);break;case Zf.CallExpression:b=b||this.nextId(),a.filter?(i=m.filter(a.callee.name),j=[],f(a.arguments,function(a){var b=m.nextId();m.recurse(a,b),j.push(b)}),k=i+"("+j.join(",")+")",m.assign(b,k),d(b)):(i=m.nextId(),h={},j=[],m.recurse(a.callee,i,h,function(){m.if_(m.notNull(i),function(){f(a.arguments,function(b){m.recurse(b,a.constant?void 0:m.nextId(),void 0,function(a){j.push(a)})}),k=h.name?m.member(h.context,h.name,h.computed)+"("+j.join(",")+")":i+"("+j.join(",")+")",m.assign(b,k)},function(){m.assign(b,"undefined")}),d(b)}));break;case Zf.AssignmentExpression:i=this.nextId(),h={},this.recurse(a.left,void 0,h,function(){m.if_(m.notNull(h.context),function(){m.recurse(a.right,i),k=m.member(h.context,h.name,h.computed)+a.operator+i,m.assign(b,k),d(b||k)})},1);break;case Zf.ArrayExpression:j=[],f(a.elements,function(b){m.recurse(b,a.constant?void 0:m.nextId(),void 0,function(a){j.push(a)})}),k="["+j.join(",")+"]",this.assign(b,k),d(b||k);break;case Zf.ObjectExpression:j=[],l=!1,f(a.properties,function(a){a.computed&&(l=!0)}),l?(b=b||this.nextId(),this.assign(b,"{}"),f(a.properties,function(a){a.computed?(h=m.nextId(),m.recurse(a.key,h)):h=a.key.type===Zf.Identifier?a.key.name:""+a.key.value,i=m.nextId(),m.recurse(a.value,i),m.assign(m.member(b,h,a.computed),i)})):(f(a.properties,function(b){m.recurse(b.value,a.constant?void 0:m.nextId(),void 0,function(a){j.push(m.escape(b.key.type===Zf.Identifier?b.key.name:""+b.key.value)+":"+a)})}),k="{"+j.join(",")+"}",this.assign(b,k)),d(b||k);break;case Zf.ThisExpression:this.assign(b,"s"),d(b||"s");break;case Zf.LocalsExpression:this.assign(b,"l"),d(b||"l");break;case Zf.NGValueParameter:this.assign(b,"v"),d(b||"v")}},getHasOwnProperty:function(a,b){var c=a+"."+b,d=this.current().own;return d.hasOwnProperty(c)||(d[c]=this.nextId(!1,a+"&&("+this.escape(b)+" in "+a+")")),d[c]},assign:function(a,b){if(a)return this.current().body.push(a,"=",b,";"),a},filter:function(a){return this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0)),this.state.filters[a]},ifDefined:function(a,b){return"ifDefined("+a+","+this.escape(b)+")"},plus:function(a,b){return"plus("+a+","+b+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,b,c){if(!0===a)b();else{var d=this.current().body;d.push("if(",a,"){"),b(),d.push("}"),c&&(d.push("else{"),c(),d.push("}"))}},not:function(a){return"!("+a+")"},isNull:function(a){return a+"==null"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,b){var c=/^[$_a-zA-Z][$_a-zA-Z0-9]*$/,d=/[^$_a-zA-Z0-9]/g;return c.test(b)?a+"."+b:a+'["'+b.replace(d,this.stringEscapeFn)+'"]'},computedMember:function(a,b){return a+"["+b+"]"},member:function(a,b,c){return c?this.computedMember(a,b):this.nonComputedMember(a,b)},getStringValue:function(a){this.assign(a,"getStringValue("+a+")")},lazyRecurse:function(a,b,c,d,e,f){var g=this;return function(){g.recurse(a,b,c,d,e,f)}},lazyAssign:function(a,b){var c=this;return function(){c.assign(a,b)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(x(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(y(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if(void 0===a)return"undefined";throw Uf("esc","IMPOSSIBLE")},nextId:function(a,b){var c="v"+this.state.nextId++;return a||this.current().vars.push(c+(b?"="+b:"")),c},current:function(){return this.state[this.state.computing]}},Ac.prototype={compile:function(a){var b=this;tc(a,b.$filter);var c,d;(c=wc(a))&&(d=this.recurse(c));var e,g=uc(a.body);g&&(e=[],f(g,function(a,c){var d=b.recurse(a);d.isPure=a.isPure,a.input=d,e.push(d),a.watchId=c}));var h=[];f(a.body,function(a){h.push(b.recurse(a.expression))});var i=0===a.body.length?p:1===a.body.length?h[0]:function(a,b){var c;return f(h,function(d){c=d(a,b)}),c};return d&&(i.assign=function(a,b,c){return d(a,c,b)}),e&&(i.inputs=e),i},recurse:function(a,b,c){var d,e,g,h=this;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case Zf.Literal:return this.value(a.value,b);case Zf.UnaryExpression:return e=this.recurse(a.argument),this["unary"+a.operator](e,b);case Zf.BinaryExpression:case Zf.LogicalExpression:return d=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](d,e,b);case Zf.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),b);case Zf.Identifier:return h.identifier(a.name,b,c);case Zf.MemberExpression:return d=this.recurse(a.object,!1,!!c),a.computed||(e=a.property.name),a.computed&&(e=this.recurse(a.property)),a.computed?this.computedMember(d,e,b,c):this.nonComputedMember(d,e,b,c);case Zf.CallExpression:return g=[],f(a.arguments,function(a){g.push(h.recurse(a))}),a.filter&&(e=this.$filter(a.callee.name)),a.filter||(e=this.recurse(a.callee,!0)),a.filter?function(a,c,d,f){for(var h=[],i=0;i<g.length;++i)h.push(g[i](a,c,d,f));var j=e.apply(void 0,h,f);return b?{context:void 0,name:void 0,value:j}:j}:function(a,c,d,f){var h,i=e(a,c,d,f);if(null!=i.value){for(var j=[],k=0;k<g.length;++k)j.push(g[k](a,c,d,f));h=i.value.apply(i.context,j)}return b?{value:h}:h};case Zf.AssignmentExpression:return d=this.recurse(a.left,!0,1),e=this.recurse(a.right),function(a,c,f,g){var h=d(a,c,f,g),i=e(a,c,f,g);return h.context[h.name]=i,b?{value:i}:i};case Zf.ArrayExpression:return g=[],f(a.elements,function(a){g.push(h.recurse(a))}),function(a,c,d,e){for(var f=[],h=0;h<g.length;++h)f.push(g[h](a,c,d,e));return b?{value:f}:f};case Zf.ObjectExpression:return g=[],f(a.properties,function(a){a.computed?g.push({key:h.recurse(a.key),computed:!0,value:h.recurse(a.value)}):g.push({key:a.key.type===Zf.Identifier?a.key.name:""+a.key.value,computed:!1,value:h.recurse(a.value)})}),function(a,c,d,e){for(var f={},h=0;h<g.length;++h)g[h].computed?f[g[h].key(a,c,d,e)]=g[h].value(a,c,d,e):f[g[h].key]=g[h].value(a,c,d,e);return b?{value:f}:f};case Zf.ThisExpression:return function(a){return b?{value:a}:a};case Zf.LocalsExpression:return function(a,c){return b?{value:c}:c};case Zf.NGValueParameter:return function(a,c,d){return b?{value:d}:d}}},"unary+":function(a,b){return function(c,d,e,f){var g=a(c,d,e,f);return g=u(g)?+g:0,b?{value:g}:g}},"unary-":function(a,b){return function(c,d,e,f){var g=a(c,d,e,f);return g=u(g)?-g:-0,b?{value:g}:g}},"unary!":function(a,b){return function(c,d,e,f){var g=!a(c,d,e,f);return b?{value:g}:g}},"binary+":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g),i=b(d,e,f,g),j=qc(h,i);return c?{value:j}:j}},"binary-":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g),i=b(d,e,f,g),j=(u(h)?h:0)-(u(i)?i:0);return c?{value:j}:j}},"binary*":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)*b(d,e,f,g);return c?{value:h}:h}},"binary/":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)/b(d,e,f,g);return c?{value:h}:h}},"binary%":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)%b(d,e,f,g);return c?{value:h}:h}},"binary===":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)===b(d,e,f,g);return c?{value:h}:h}},"binary!==":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)!==b(d,e,f,g);return c?{value:h}:h}},"binary==":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)==b(d,e,f,g);return c?{value:h}:h}},"binary!=":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)!=b(d,e,f,g);return c?{value:h}:h}},"binary<":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)<b(d,e,f,g);return c?{value:h}:h}},"binary>":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)>b(d,e,f,g);return c?{value:h}:h}},"binary<=":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)<=b(d,e,f,g);return c?{value:h}:h}},"binary>=":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)>=b(d,e,f,g);return c?{value:h}:h}},"binary&&":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)&&b(d,e,f,g);return c?{value:h}:h}},"binary||":function(a,b,c){return function(d,e,f,g){var h=a(d,e,f,g)||b(d,e,f,g);return c?{value:h}:h}},"ternary?:":function(a,b,c,d){return function(e,f,g,h){var i=a(e,f,g,h)?b(e,f,g,h):c(e,f,g,h);return d?{value:i}:i}},value:function(a,b){return function(){return b?{context:void 0,name:void 0,value:a}:a}},identifier:function(a,b,c){return function(d,e,f,g){var h=e&&a in e?e:d;c&&1!==c&&h&&null==h[a]&&(h[a]={});var i=h?h[a]:void 0;return b?{context:h,name:a,value:i}:i}},computedMember:function(a,b,c,d){return function(e,f,g,h){var i,j,k=a(e,f,g,h);return null!=k&&(i=b(e,f,g,h),i=oc(i),d&&1!==d&&k&&!k[i]&&(k[i]={}),j=k[i]),c?{context:k,name:i,value:j}:j}},nonComputedMember:function(a,b,c,d){return function(e,f,g,h){var i=a(e,f,g,h);d&&1!==d&&i&&null==i[b]&&(i[b]={});var j=null!=i?i[b]:void 0;return c?{context:i,name:b,value:j}:j}},inputs:function(a,b){return function(c,d,e,f){return f?f[b]:a(c,d,e)}}},Bc.prototype={constructor:Bc,parse:function(a){var b=this.getAst(a),c=this.astCompiler.compile(b.ast);return c.literal=xc(b.ast),c.constant=yc(b.ast),c.oneTime=b.oneTime,c},getAst:function(a){var b=!1;return a=a.trim(),":"===a.charAt(0)&&":"===a.charAt(1)&&(b=!0,a=a.substring(2)),{ast:this.ast.ast(a),oneTime:b}}};var ag,bg=d("$sce"),cg={HTML:"html",CSS:"css",MEDIA_URL:"mediaUrl",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},dg=/_([a-z])/g,eg=d("$templateRequest"),fg=d("$timeout"),gg=a.document.createElement("a"),hg=Yc(a.location.href);gg.href="http://[::1]";var ig="[::1]"===gg.hostname;dd.$inject=["$document"],fd.$inject=["$provide"];var jg=22,kg=".",lg="0";kd.$inject=["$locale"],ld.$inject=["$locale"];var mg={yyyy:qd("FullYear",4,0,!1,!0),yy:qd("FullYear",2,0,!0,!0),y:qd("FullYear",1,0,!1,!0),MMMM:rd("Month"),MMM:rd("Month",!0),MM:qd("Month",2,1),M:qd("Month",1,1),LLLL:rd("Month",!1,!0),dd:qd("Date",2),d:qd("Date",1),HH:qd("Hours",2),H:qd("Hours",1),hh:qd("Hours",2,-12),h:qd("Hours",1,-12),mm:qd("Minutes",2),m:qd("Minutes",1),ss:qd("Seconds",2),s:qd("Seconds",1),sss:qd("Milliseconds",3),EEEE:rd("Day"),EEE:rd("Day",!0),a:wd,Z:sd,ww:vd(2),w:vd(1),G:xd,GG:xd,GGG:xd,GGGG:yd},ng=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\s\S]*)/,og=/^-?\d+$/;zd.$inject=["$locale"];var pg=r(se),qg=r(te);Dd.$inject=["$parse"];var rg=r({restrict:"E",compile:function(a,b){if(!b.href&&!b.xlinkHref)return function(a,b){if("a"===b[0].nodeName.toLowerCase()){var c="[object SVGAnimatedString]"===xe.call(b.prop("href"))?"xlink:href":"href";b.on("click",function(a){b.attr(c)||a.preventDefault()})}}}}),sg={};f(ef,function(a,b){function c(a,c,e){a.$watch(e[d],function(a){e.$set(b,!!a)})}if("multiple"!==a){var d=Bb("ng-"+b),e=c;"checked"===a&&(e=function(a,b,e){e.ngModel!==e[d]&&c(a,b,e)}),sg[d]=function(){return{restrict:"A",priority:100,link:e}}}}),f(gf,function(a,b){sg[b]=function(){return{priority:100,link:function(a,c,d){if("ngPattern"===b&&"/"===d.ngPattern.charAt(0)){var e=d.ngPattern.match(pe);if(e)return void d.$set("ngPattern",new RegExp(e[1],e[2]))}a.$watch(d[b],function(a){d.$set(b,a)})}}}}),f(["src","srcset","href"],function(a){var b=Bb("ng-"+a);sg[b]=["$sce",function(c){return{priority:99,link:function(d,e,f){var g=a,h=a;"href"===a&&"[object SVGAnimatedString]"===xe.call(e.prop("href"))&&(h="xlinkHref",f.$attr[h]="xlink:href",g=null),f.$set(b,c.getTrustedMediaUrl(f[b])),f.$observe(b,function(b){if(!b)return void("href"===a&&f.$set(h,null));f.$set(h,b),ke&&g&&e.prop(g,f[h])})}}}]});var tg={$addControl:p,$getControls:r([]),$$renameControl:Fd,$removeControl:p,$setValidity:p,$setDirty:p,$setPristine:p,$setSubmitted:p,$$setSubmitted:p},ug="ng-pending";Gd.$inject=["$element","$attrs","$scope","$animate","$interpolate"],Gd.prototype={$rollbackViewValue:function(){f(this.$$controls,function(a){a.$rollbackViewValue()})},$commitViewValue:function(){f(this.$$controls,function(a){a.$commitViewValue()})},$addControl:function(a){qa(a.$name,"input"),this.$$controls.push(a),a.$name&&(this[a.$name]=a),a.$$parentForm=this},$getControls:function(){return wa(this.$$controls)},$$renameControl:function(a,b){var c=a.$name;this[c]===a&&delete this[c],this[b]=a,a.$name=b},$removeControl:function(a){a.$name&&this[a.$name]===a&&delete this[a.$name],f(this.$pending,function(b,c){this.$setValidity(c,null,a)},this),f(this.$error,function(b,c){this.$setValidity(c,null,a)},this),f(this.$$success,function(b,c){this.$setValidity(c,null,a)},this),R(this.$$controls,a),a.$$parentForm=tg},$setDirty:function(){this.$$animate.removeClass(this.$$element,eh),this.$$animate.addClass(this.$$element,fh),this.$dirty=!0,this.$pristine=!1,this.$$parentForm.$setDirty()},$setPristine:function(){this.$$animate.setClass(this.$$element,eh,fh+" ng-submitted"),this.$dirty=!1,this.$pristine=!0,this.$submitted=!1,f(this.$$controls,function(a){a.$setPristine()})},$setUntouched:function(){f(this.$$controls,function(a){a.$setUntouched()})},$setSubmitted:function(){for(var a=this;a.$$parentForm&&a.$$parentForm!==tg;)a=a.$$parentForm;a.$$setSubmitted()},$$setSubmitted:function(){this.$$animate.addClass(this.$$element,"ng-submitted"),this.$submitted=!0,f(this.$$controls,function(a){a.$$setSubmitted&&a.$$setSubmitted()})}},Id({clazz:Gd,set:function(a,b,c){var d=a[b];if(d){-1===d.indexOf(c)&&d.push(c)}else a[b]=[c]},unset:function(a,b,c){var d=a[b];d&&(R(d,c),0===d.length&&delete a[b])}});var vg=function(a){return["$timeout","$parse",function(b,c){function d(a){return""===a?c('this[""]').assign:c(a).assign||p}return{name:"form",restrict:a?"EAC":"E",require:["form","^^?form"],controller:Gd,compile:function(c,e){c.addClass(eh).addClass(ch);var f=e.name?"name":!(!a||!e.ngForm)&&"ngForm";return{pre:function(a,c,e,g){var h=g[0];if(!("action"in e)){var i=function(b){a.$apply(function(){h.$commitViewValue(),h.$setSubmitted()}),b.preventDefault()};c[0].addEventListener("submit",i),c.on("$destroy",function(){b(function(){c[0].removeEventListener("submit",i)},0,!1)})}(g[1]||h.$$parentForm).$addControl(h);var j=f?d(h.$name):p;f&&(j(a,h),e.$observe(f,function(b){h.$name!==b&&(j(a,void 0),h.$$parentForm.$$renameControl(h,b),(j=d(h.$name))(a,h))})),c.on("$destroy",function(){h.$$parentForm.$removeControl(h),j(a,void 0),l(h,tg)})}}}}}]},wg=vg(),xg=vg(!0),yg=/^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/,zg=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:\/?#]+|\[[a-f\d:]+])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,Ag=/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,Bg=/^\s*(-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,Cg=/^(\d{4,})-(\d{2})-(\d{2})$/,Dg=/^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Eg=/^(\d{4,})-W(\d\d)$/,Fg=/^(\d{4,})-(\d\d)$/,Gg=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Hg="keydown wheel mousedown",Ig=ta();f("date,datetime-local,month,time,week".split(","),function(a){Ig[a]=!0});var Jg={text:Ld,date:Pd("date",Cg,Od(Cg,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":Pd("datetimelocal",Dg,Od(Dg,["yyyy","MM","dd","HH","mm","ss","sss"]),"yyyy-MM-ddTHH:mm:ss.sss"),time:Pd("time",Gg,Od(Gg,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:Pd("week",Eg,Nd,"yyyy-Www"),month:Pd("month",Fg,Od(Fg,["yyyy","MM"]),"yyyy-MM"),number:Wd,url:Yd,email:Zd,radio:$d,range:Xd,checkbox:ae,hidden:p,button:p,submit:p,reset:p,file:p},Kg=["$browser","$sniffer","$filter","$parse",function(a,b,c,d){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,f,g,h){h[0]&&(Jg[se(g.type)]||Jg.text)(e,f,g,h[0],b,a,c,d)}}}}],Lg=function(){var a={configurable:!0,enumerable:!1,get:function(){return this.getAttribute("value")||""},set:function(a){this.setAttribute("value",a)}};return{restrict:"E",priority:200,compile:function(b,c){if("hidden"===se(c.type))return{pre:function(b,c,d,e){var f=c[0];f.parentNode&&f.parentNode.insertBefore(f,f.nextSibling),Object.defineProperty&&Object.defineProperty(f,"value",a)}}}}},Mg=/^(true|false|\d+)$/,Ng=function(){function a(a,b,c){var d=u(c)?c:9===ke?"":null;a.prop("value",d),b.$set("value",c)}return{restrict:"A",priority:100,compile:function(b,c){return Mg.test(c.ngValue)?function(b,c,d){a(c,d,b.$eval(d.ngValue))}:function(b,c,d){b.$watch(d.ngValue,function(b){a(c,d,b)})}}}},Og=["$compile",function(a){return{restrict:"AC",compile:function(b){return a.$$addBindingClass(b),function(b,c,d){a.$$addBindingInfo(c,d.ngBind),c=c[0],b.$watch(d.ngBind,function(a){c.textContent=ua(a)})}}}}],Pg=["$interpolate","$compile",function(a,b){return{compile:function(c){return b.$$addBindingClass(c),function(c,d,e){var f=a(d.attr(e.$attr.ngBindTemplate));b.$$addBindingInfo(d,f.expressions),d=d[0],e.$observe("ngBindTemplate",function(a){d.textContent=t(a)?"":a})}}}}],Qg=["$sce","$parse","$compile",function(a,b,c){return{restrict:"A",compile:function(d,e){var f=b(e.ngBindHtml),g=b(e.ngBindHtml,function(b){return a.valueOf(b)});return c.$$addBindingClass(d),function(b,d,e){c.$$addBindingInfo(d,e.ngBindHtml),b.$watch(g,function(){var c=f(b);d.html(a.getTrustedHtml(c)||"")})}}}}],Rg=r({restrict:"A",require:"ngModel",link:function(a,b,c,d){d.$viewChangeListeners.push(function(){a.$eval(c.ngChange)})}}),Sg=be("",!0),Tg=be("Odd",0),Ug=be("Even",1),Vg=Ed({compile:function(a,b){b.$set("ngCloak",void 0),a.removeClass("ng-cloak")}}),Wg=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],Xg={},Yg={blur:!0,focus:!0};f("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var b=Bb("ng-"+a);Xg[b]=["$parse","$rootScope","$exceptionHandler",function(c,d,e){return ce(c,d,e,b,a,Yg[a])}]});var Zg=["$animate","$compile",function(a,b){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(c,d,e,f,g){var h,i,j;c.$watch(e.ngIf,function(c){c?i||g(function(c,f){i=f,c[c.length++]=b.$$createComment("end ngIf",e.ngIf),h={clone:c},a.enter(c,d.parent(),d)}):(j&&(j.remove(),j=null),i&&(i.$destroy(),i=null),h&&(j=sa(h.clone),a.leave(j).done(function(a){!1!==a&&(j=null)}),h=null))})}}}],$g=["$templateRequest","$anchorScroll","$animate",function(a,b,c){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:Ae.noop,compile:function(d,e){var f=e.ngInclude||e.src,g=e.onload||"",h=e.autoscroll;return function(d,e,i,j,k){var l,m,n,o=0,p=function(){m&&(m.remove(),m=null),l&&(l.$destroy(),l=null),n&&(c.leave(n).done(function(a){!1!==a&&(m=null)}),m=n,n=null)};d.$watch(f,function(f){var i=function(a){!1===a||!u(h)||h&&!d.$eval(h)||b()},m=++o;f?(a(f,!0).then(function(a){if(!d.$$destroyed&&m===o){var b=d.$new();j.template=a;var h=k(b,function(a){p(),c.enter(a,null,e).done(i)});l=b,n=h,l.$emit("$includeContentLoaded",f),d.$eval(g)}},function(){d.$$destroyed||m===o&&(p(),d.$emit("$includeContentError",f))}),d.$emit("$includeContentRequested",f)):(p(),j.template=null)})}}}}],_g=["$compile",function(b){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(c,d,e,f){if(xe.call(d[0]).match(/SVG/))return d.empty(),void b(Ga(f.template,a.document).childNodes)(c,function(a){d.append(a)},{futureParentElement:d});d.html(f.template),b(d.contents())(c)}}}],ah=Ed({priority:450,compile:function(){return{pre:function(a,b,c){a.$eval(c.ngInit)}}}}),bh=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,b,c,d){var e=c.ngList||", ",g="false"!==c.ngTrim,h=g?Ee(e):e,i=function(a){if(!t(a)){var b=[];return a&&f(a.split(h),function(a){a&&b.push(g?Ee(a):a)}),b}};d.$parsers.push(i),d.$formatters.push(function(a){if(A(a))return a.join(e)}),d.$isEmpty=function(a){return!a||!a.length}}}},ch="ng-valid",dh="ng-invalid",eh="ng-pristine",fh="ng-dirty",gh=d("ngModel");de.$inject=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$q","$interpolate"],de.prototype={$$initGetterSetters:function(){if(this.$options.getOption("getterSetter")){var a=this.$$parse(this.$$attr.ngModel+"()"),b=this.$$parse(this.$$attr.ngModel+"($$$p)");this.$$ngModelGet=function(b){var c=this.$$parsedNgModel(b);return C(c)&&(c=a(b)),c},this.$$ngModelSet=function(a,c){C(this.$$parsedNgModel(a))?b(a,{$$$p:c}):this.$$parsedNgModelAssign(a,c)}}else if(!this.$$parsedNgModel.assign)throw gh("nonassign","Expression '{0}' is non-assignable. Element: {1}",this.$$attr.ngModel,ca(this.$$element))},$render:p,$isEmpty:function(a){return t(a)||""===a||null===a||a!==a},$$updateEmptyClasses:function(a){this.$isEmpty(a)?(this.$$animate.removeClass(this.$$element,"ng-not-empty"),this.$$animate.addClass(this.$$element,"ng-empty")):(this.$$animate.removeClass(this.$$element,"ng-empty"),this.$$animate.addClass(this.$$element,"ng-not-empty"))},$setPristine:function(){this.$dirty=!1,this.$pristine=!0,this.$$animate.removeClass(this.$$element,fh),this.$$animate.addClass(this.$$element,eh)},$setDirty:function(){this.$dirty=!0,this.$pristine=!1,this.$$animate.removeClass(this.$$element,eh),this.$$animate.addClass(this.$$element,fh),this.$$parentForm.$setDirty()},$setUntouched:function(){this.$touched=!1,this.$untouched=!0,this.$$animate.setClass(this.$$element,"ng-untouched","ng-touched")},$setTouched:function(){this.$touched=!0,this.$untouched=!1,this.$$animate.setClass(this.$$element,"ng-touched","ng-untouched")},$rollbackViewValue:function(){this.$$timeout.cancel(this.$$pendingDebounce),this.$viewValue=this.$$lastCommittedViewValue,this.$render()},$validate:function(){if(!Ce(this.$modelValue)){
6
+ var a=this.$$lastCommittedViewValue,b=this.$$rawModelValue,c=this.$valid,d=this.$modelValue,e=this.$options.getOption("allowInvalid"),f=this;this.$$runValidators(b,a,function(a){e||c===a||(f.$modelValue=a?b:void 0,f.$modelValue!==d&&f.$$writeModelToScope())})}},$$runValidators:function(a,b,c){function d(a,b){g===h.$$currentValidationRunId&&h.$setValidity(a,b)}function e(a){g===h.$$currentValidationRunId&&c(a)}this.$$currentValidationRunId++;var g=this.$$currentValidationRunId,h=this;return function(){var a=h.$$parserName;return t(h.$$parserValid)?(d(a,null),!0):(h.$$parserValid||(f(h.$validators,function(a,b){d(b,null)}),f(h.$asyncValidators,function(a,b){d(b,null)})),d(a,h.$$parserValid),h.$$parserValid)}()&&function(){var c=!0;return f(h.$validators,function(e,f){var g=Boolean(e(a,b));c=c&&g,d(f,g)}),!!c||(f(h.$asyncValidators,function(a,b){d(b,null)}),!1)}()?void function(){var c=[],g=!0;f(h.$asyncValidators,function(e,f){var h=e(a,b);if(!K(h))throw gh("nopromise","Expected asynchronous validator to return a promise but got '{0}' instead.",h);d(f,void 0),c.push(h.then(function(){d(f,!0)},function(){g=!1,d(f,!1)}))}),c.length?h.$$q.all(c).then(function(){e(g)},p):e(!0)}():void e(!1)},$commitViewValue:function(){var a=this.$viewValue;this.$$timeout.cancel(this.$$pendingDebounce),(this.$$lastCommittedViewValue!==a||""===a&&this.$$hasNativeValidators)&&(this.$$updateEmptyClasses(a),this.$$lastCommittedViewValue=a,this.$pristine&&this.$setDirty(),this.$$parseAndValidate())},$$parseAndValidate:function(){function a(){d.$modelValue!==f&&d.$$writeModelToScope()}var b=this.$$lastCommittedViewValue,c=b,d=this;if(this.$$parserValid=!t(c)||void 0,this.$setValidity(this.$$parserName,null),this.$$parserName="parse",this.$$parserValid)for(var e=0;e<this.$parsers.length;e++)if(c=this.$parsers[e](c),t(c)){this.$$parserValid=!1;break}Ce(this.$modelValue)&&(this.$modelValue=this.$$ngModelGet(this.$$scope));var f=this.$modelValue,g=this.$options.getOption("allowInvalid");this.$$rawModelValue=c,g&&(this.$modelValue=c,a()),this.$$runValidators(c,this.$$lastCommittedViewValue,function(b){g||(d.$modelValue=b?c:void 0,a())})},$$writeModelToScope:function(){this.$$ngModelSet(this.$$scope,this.$modelValue),f(this.$viewChangeListeners,function(a){try{a()}catch(a){this.$$exceptionHandler(a)}},this)},$setViewValue:function(a,b){this.$viewValue=a,this.$options.getOption("updateOnDefault")&&this.$$debounceViewValueCommit(b)},$$debounceViewValueCommit:function(a){var b=this.$options.getOption("debounce");y(b[a])?b=b[a]:y(b.default)&&-1===this.$options.getOption("updateOn").indexOf(a)?b=b.default:y(b["*"])&&(b=b["*"]),this.$$timeout.cancel(this.$$pendingDebounce);var c=this;b>0?this.$$pendingDebounce=this.$$timeout(function(){c.$commitViewValue()},b):this.$$rootScope.$$phase?this.$commitViewValue():this.$$scope.$apply(function(){c.$commitViewValue()})},$overrideModelOptions:function(a){this.$options=this.$options.createChild(a),this.$$setUpdateOnEvents()},$processModelValue:function(){var a=this.$$format();this.$viewValue!==a&&(this.$$updateEmptyClasses(a),this.$viewValue=this.$$lastCommittedViewValue=a,this.$render(),this.$$runValidators(this.$modelValue,this.$viewValue,p))},$$format:function(){for(var a=this.$formatters,b=a.length,c=this.$modelValue;b--;)c=a[b](c);return c},$$setModelValue:function(a){this.$modelValue=this.$$rawModelValue=a,this.$$parserValid=void 0,this.$processModelValue()},$$setUpdateOnEvents:function(){this.$$updateEvents&&this.$$element.off(this.$$updateEvents,this.$$updateEventHandler),this.$$updateEvents=this.$options.getOption("updateOn"),this.$$updateEvents&&this.$$element.on(this.$$updateEvents,this.$$updateEventHandler)},$$updateEventHandler:function(a){this.$$debounceViewValueCommit(a&&a.type)}},Id({clazz:de,set:function(a,b){a[b]=!0},unset:function(a,b){delete a[b]}});var hh,ih=["$rootScope",function(a){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:de,priority:1,compile:function(b){return b.addClass(eh).addClass("ng-untouched").addClass(ch),{pre:function(a,b,c,d){var e=d[0],f=d[1]||e.$$parentForm,g=d[2];g&&(e.$options=g.$options),e.$$initGetterSetters(),f.$addControl(e),c.$observe("name",function(a){e.$name!==a&&e.$$parentForm.$$renameControl(e,a)}),a.$on("$destroy",function(){e.$$parentForm.$removeControl(e)})},post:function(b,c,d,e){function f(){g.$setTouched()}var g=e[0];g.$$setUpdateOnEvents(),c.on("blur",function(){g.$touched||(a.$$phase?b.$evalAsync(f):b.$apply(f))})}}}}}],jh=/(\s+|^)default(\s+|$)/;fe.prototype={getOption:function(a){return this.$$options[a]},createChild:function(a){var b=!1;return a=l({},a),f(a,function(c,d){"$inherit"===c?"*"===d?b=!0:(a[d]=this.$$options[d],"updateOn"===d&&(a.updateOnDefault=this.$$options.updateOnDefault)):"updateOn"===d&&(a.updateOnDefault=!1,a[d]=Ee(c.replace(jh,function(){return a.updateOnDefault=!0," "})))},this),b&&(delete a["*"],ge(a,this.$$options)),ge(a,hh.$$options),new fe(a)}},hh=new fe({updateOn:"",updateOnDefault:!0,debounce:0,getterSetter:!1,allowInvalid:!1,timezone:null});var kh=function(){function a(a,b){this.$$attrs=a,this.$$scope=b}return a.$inject=["$attrs","$scope"],a.prototype={$onInit:function(){var a=this.parentCtrl?this.parentCtrl.$options:hh,b=this.$$scope.$eval(this.$$attrs.ngModelOptions);this.$options=a.createChild(b)}},{restrict:"A",priority:10,require:{parentCtrl:"?^^ngModelOptions"},bindToController:!0,controller:a}},lh=Ed({terminal:!0,priority:1e3}),mh=d("ngOptions"),nh=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([$\w][$\w]*)|(?:\(\s*([$\w][$\w]*)\s*,\s*([$\w][$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,oh=["$compile","$document","$parse",function(b,c,d){function g(a,b,c){function f(a,b,c,d,e){this.selectValue=a,this.viewValue=b,this.label=c,this.group=d,this.disabled=e}function g(a){var b;if(!j&&e(a))b=a;else{b=[];for(var c in a)a.hasOwnProperty(c)&&"$"!==c.charAt(0)&&b.push(c)}return b}var h=a.match(nh);if(!h)throw mh("iexp","Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}",a,ca(b));var i=h[5]||h[7],j=h[6],k=/ as /.test(h[0])&&h[1],l=h[9],m=d(h[2]?h[1]:i),n=k&&d(k),o=n||m,p=l&&d(l),q=l?function(a,b){return p(c,b)}:function(a){return gb(a)},r=function(a,b){return q(a,x(a,b))},s=d(h[2]||h[1]),t=d(h[3]||""),u=d(h[4]||""),v=d(h[8]),w={},x=j?function(a,b){return w[j]=b,w[i]=a,w}:function(a){return w[i]=a,w};return{trackBy:l,getTrackByValue:r,getWatchables:d(v,function(a){var b=[];a=a||[];for(var d=g(a),e=d.length,f=0;f<e;f++){var i=a===d?f:d[f],j=a[i],k=x(j,i),l=q(j,k);if(b.push(l),h[2]||h[1]){var m=s(c,k);b.push(m)}if(h[4]){var n=u(c,k);b.push(n)}}return b}),getOptions:function(){for(var a=[],b={},d=v(c)||[],e=g(d),h=e.length,i=0;i<h;i++){var j=d===e?i:e[i],k=d[j],m=x(k,j),n=o(c,m),p=q(n,m),w=s(c,m),y=t(c,m),z=u(c,m),A=new f(p,n,w,y,z);a.push(A),b[p]=A}return{items:a,selectValueMap:b,getOptionFromViewValue:function(a){return b[r(a)]},getViewValueFromOption:function(a){return l?S(a.viewValue):a.viewValue}}}}}function h(a,d,e,h){function k(a,b){var c=i.cloneNode(!1);b.appendChild(c),m(a,c)}function l(a){var b=w.getOptionFromViewValue(a),c=b&&b.element;return c&&!c.selected&&(c.selected=!0),b}function m(a,b){a.element=b,b.disabled=a.disabled,a.label!==b.label&&(b.label=a.label,b.textContent=a.label),b.value=a.selectValue}function n(){var a=w&&o.readValue();if(w)for(var b=w.items.length-1;b>=0;b--){var c=w.items[b];Za(u(c.group)?c.element.parentNode:c.element)}w=x.getOptions();var e={};if(w.items.forEach(function(a){var b;u(a.group)?(b=e[a.group],b||(b=j.cloneNode(!1),y.appendChild(b),b.label=null===a.group?"null":a.group,e[a.group]=b),k(a,b)):k(a,y)}),d[0].appendChild(y),p.$render(),!p.$isEmpty(a)){var f=o.readValue();(x.trackBy||q?U(a,f):a===f)||(p.$setViewValue(f),p.$render())}}for(var o=h[0],p=h[1],q=e.multiple,r=0,s=d.children(),t=s.length;r<t;r++)if(""===s[r].value){o.hasEmptyOption=!0,o.emptyOption=s.eq(r);break}d.empty();var v=!!o.emptyOption;le(i.cloneNode(!1)).val("?");var w,x=g(e.ngOptions,d,a),y=c[0].createDocumentFragment();o.generateUnknownOptionValue=function(a){return"?"},q?(o.writeValue=function(a){if(w){var b=a&&a.map(l)||[];w.items.forEach(function(a){a.element.selected&&!Q(b,a)&&(a.element.selected=!1)})}},o.readValue=function(){var a=d.val()||[],b=[];return f(a,function(a){var c=w.selectValueMap[a];c&&!c.disabled&&b.push(w.getViewValueFromOption(c))}),b},x.trackBy&&a.$watchCollection(function(){if(A(p.$viewValue))return p.$viewValue.map(function(a){return x.getTrackByValue(a)})},function(){p.$render()})):(o.writeValue=function(a){if(w){var b=d[0].options[d[0].selectedIndex],c=w.getOptionFromViewValue(a);b&&b.removeAttribute("selected"),c?(d[0].value!==c.selectValue&&(o.removeUnknownOption(),d[0].value=c.selectValue,c.element.selected=!0),c.element.setAttribute("selected","selected")):o.selectUnknownOrEmptyOption(a)}},o.readValue=function(){var a=w.selectValueMap[d.val()];return a&&!a.disabled?(o.unselectEmptyOption(),o.removeUnknownOption(),w.getViewValueFromOption(a)):null},x.trackBy&&a.$watch(function(){return x.getTrackByValue(p.$viewValue)},function(){p.$render()})),v&&(b(o.emptyOption)(a),d.prepend(o.emptyOption),o.emptyOption[0].nodeType===Pe?(o.hasEmptyOption=!1,o.registerOption=function(a,b){""===b.val()&&(o.hasEmptyOption=!0,o.emptyOption=b,o.emptyOption.removeClass("ng-scope"),p.$render(),b.on("$destroy",function(){var a=o.$isEmptyOptionSelected();o.hasEmptyOption=!1,o.emptyOption=void 0,a&&p.$render()}))}):o.emptyOption.removeClass("ng-scope")),a.$watchCollection(x.getWatchables,n)}var i=a.document.createElement("option"),j=a.document.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","ngModel"],link:{pre:function(a,b,c,d){d[0].registerOption=p},post:h}}}],ph=["$locale","$interpolate","$log",function(a,b,c){var d=/{}/g,e=/^when(Minus)?(.+)$/;return{link:function(g,h,i){function j(a){h.text(a||"")}var k,l=i.count,m=i.$attr.when&&h.attr(i.$attr.when),n=i.offset||0,o=g.$eval(m)||{},q={},r=b.startSymbol(),s=b.endSymbol(),u=r+l+"-"+n+s,v=Ae.noop;f(i,function(a,b){var c=e.exec(b);if(c){var d=(c[1]?"-":"")+se(c[2]);o[d]=h.attr(i.$attr[b])}}),f(o,function(a,c){q[c]=b(a.replace(d,u))}),g.$watch(l,function(b){var d=parseFloat(b),e=Ce(d);if(e||d in o||(d=a.pluralCat(d-n)),!(d===k||e&&Ce(k))){v();var f=q[d];t(f)?(null!=b&&c.debug("ngPluralize: no rule defined for '"+d+"' in "+m),v=p,j()):v=g.$watch(f,j),k=d}})}}}],qh=d("ngRef"),rh=["$parse",function(a){return{priority:-1,restrict:"A",compile:function(b,c){var d=Bb(P(b)),e=a(c.ngRef),f=e.assign||function(){throw qh("nonassign",'Expression in ngRef="{0}" is non-assignable!',c.ngRef)};return function(a,b,g){var h;if(g.hasOwnProperty("ngRefRead")){if("$element"===g.ngRefRead)h=b;else if(!(h=b.data("$"+g.ngRefRead+"Controller")))throw qh("noctrl",'The controller for ngRefRead="{0}" could not be found on ngRef="{1}"',g.ngRefRead,c.ngRef)}else h=b.data("$"+d+"Controller");h=h||b,f(a,h),b.on("$destroy",function(){e(a)===h&&f(a,null)})}}}}],sh=["$parse","$animate","$compile",function(a,b,c){var g=d("ngRepeat"),h=function(a,b,c,d,e,f,g){a[c]=d,e&&(a[e]=f),a.$index=b,a.$first=0===b,a.$last=b===g-1,a.$middle=!(a.$first||a.$last),a.$odd=!(a.$even=0==(1&b))},i=function(a){return a.clone[0]},j=function(a){return a.clone[a.clone.length-1]},k=function(a,b,c){return gb(c)},l=function(a,b){return b};return{restrict:"A",multiElement:!0,transclude:"element",priority:1e3,terminal:!0,$$tlb:!0,compile:function(d,m){var n=m.ngRepeat,o=c.$$createComment("end ngRepeat",n),p=n.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!p)throw g("iexp","Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",n);var q=p[1],r=p[2],s=p[3],t=p[4];if(!(p=q.match(/^(?:(\s*[$\w]+)|\(\s*([$\w]+)\s*,\s*([$\w]+)\s*\))$/)))throw g("iidexp","'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",q);var u=p[3]||p[1],v=p[2];if(s&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(s)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(s)))throw g("badident","alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.",s);var w;if(t){var x={$id:gb},y=a(t);w=function(a,b,c,d){return v&&(x[v]=b),x[u]=c,x.$index=d,y(a,x)}}return function(a,c,d,m,p){var q=ta();a.$watchCollection(r,function(d){var m,r,t,y,z,A,B,C,D,E,F,G,H=c[0],I=ta();if(s&&(a[s]=d),e(d))D=d,C=w||k;else{C=w||l,D=[];for(var J in d)re.call(d,J)&&"$"!==J.charAt(0)&&D.push(J)}for(y=D.length,F=new Array(y),m=0;m<y;m++)if(z=d===D?m:D[m],A=d[z],B=C(a,z,A,m),q[B])E=q[B],delete q[B],I[B]=E,F[m]=E;else{if(I[B])throw f(F,function(a){a&&a.scope&&(q[a.id]=a)}),g("dupes","Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}",n,B,A);F[m]={id:B,scope:void 0,clone:void 0},I[B]=!0}x&&(x[u]=void 0);for(var K in q){if(E=q[K],G=sa(E.clone),b.leave(G),G[0].parentNode)for(m=0,r=G.length;m<r;m++)G[m].$$NG_REMOVED=!0;E.scope.$destroy()}for(m=0;m<y;m++)if(z=d===D?m:D[m],A=d[z],E=F[m],E.scope){t=H;do{t=t.nextSibling}while(t&&t.$$NG_REMOVED);i(E)!==t&&b.move(sa(E.clone),null,H),H=j(E),h(E.scope,m,u,A,v,z,y)}else p(function(a,c){E.scope=c;var d=o.cloneNode(!1);a[a.length++]=d,b.enter(a,null,H),H=d,E.clone=a,I[E.id]=E,h(E.scope,m,u,A,v,z,y)});q=I})}}}}],th=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,c,d){b.$watch(d.ngShow,function(b){a[b?"removeClass":"addClass"](c,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],uh=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,c,d){b.$watch(d.ngHide,function(b){a[b?"addClass":"removeClass"](c,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],vh=Ed(function(a,b,c){a.$watchCollection(c.ngStyle,function(a,c){c&&a!==c&&(a||(a={}),f(c,function(b,c){null==a[c]&&(a[c]="")})),a&&b.css(a)})}),wh=["$animate","$compile",function(a,b){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(c,d,e,g){var h=e.ngSwitch||e.on,i=[],j=[],k=[],l=[],m=function(a,b){return function(c){!1!==c&&a.splice(b,1)}};c.$watch(h,function(c){for(var d,e;k.length;)a.cancel(k.pop());for(d=0,e=l.length;d<e;++d){var h=sa(j[d].clone);l[d].$destroy();(k[d]=a.leave(h)).done(m(k,d))}j.length=0,l.length=0,(i=g.cases["!"+c]||g.cases["?"])&&f(i,function(c){c.transclude(function(d,e){l.push(e);var f=c.element;d[d.length++]=b.$$createComment("end ngSwitchWhen");var g={clone:d};j.push(g),a.enter(d,f.parent(),f)})})})}}}],xh=Ed({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,c,d,e){f(c.ngSwitchWhen.split(c.ngSwitchWhenSeparator).sort().filter(function(a,b,c){return c[b-1]!==a}),function(a){d.cases["!"+a]=d.cases["!"+a]||[],d.cases["!"+a].push({transclude:e,element:b})})}}),yh=Ed({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,c,d,e){d.cases["?"]=d.cases["?"]||[],d.cases["?"].push({transclude:e,element:b})}}),zh=d("ngTransclude"),Ah=["$compile",function(a){return{restrict:"EAC",compile:function(b){var c=a(b.contents());return b.empty(),function(a,b,d,e,f){function g(a,c){a.length&&i(a)?b.append(a):(h(),c.$destroy())}function h(){c(a,function(a){b.append(a)})}function i(a){for(var b=0,c=a.length;b<c;b++){var d=a[b];if(d.nodeType!==Oe||d.nodeValue.trim())return!0}}if(!f)throw zh("orphan","Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: {0}",ca(b));d.ngTransclude===d.$attr.ngTransclude&&(d.ngTransclude="");var j=d.ngTransclude||d.ngTranscludeSlot;f(g,null,j),j&&!f.isSlotFilled(j)&&h()}}}}],Bh=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(b,c){if("text/ng-template"===c.type){var d=c.id,e=b[0].text;a.put(d,e)}}}}],Ch={$setViewValue:p,$render:p},Dh=["$element","$scope",function(b,c){function d(){h||(h=!0,c.$$postDigest(function(){h=!1,f.ngModelCtrl.$render()}))}function e(a){i||(i=!0,c.$$postDigest(function(){c.$$destroyed||(i=!1,f.ngModelCtrl.$setViewValue(f.readValue()),a&&f.ngModelCtrl.$render())}))}var f=this,g=new jf;f.selectValueMap={},f.ngModelCtrl=Ch,f.multiple=!1,f.unknownOption=le(a.document.createElement("option")),f.hasEmptyOption=!1,f.emptyOption=void 0,f.renderUnknownOption=function(a){var c=f.generateUnknownOptionValue(a);f.unknownOption.val(c),b.prepend(f.unknownOption),he(f.unknownOption,!0),b.val(c)},f.updateUnknownOption=function(a){var c=f.generateUnknownOptionValue(a);f.unknownOption.val(c),he(f.unknownOption,!0),b.val(c)},f.generateUnknownOptionValue=function(a){return"? "+gb(a)+" ?"},f.removeUnknownOption=function(){f.unknownOption.parent()&&f.unknownOption.remove()},f.selectEmptyOption=function(){f.emptyOption&&(b.val(""),he(f.emptyOption,!0))},f.unselectEmptyOption=function(){f.hasEmptyOption&&he(f.emptyOption,!1)},c.$on("$destroy",function(){f.renderUnknownOption=p}),f.readValue=function(){var a=b.val(),c=a in f.selectValueMap?f.selectValueMap[a]:a;return f.hasOption(c)?c:null},f.writeValue=function(a){var c=b[0].options[b[0].selectedIndex];if(c&&he(le(c),!1),f.hasOption(a)){f.removeUnknownOption();var d=gb(a);b.val(d in f.selectValueMap?d:a);var e=b[0].options[b[0].selectedIndex];he(le(e),!0)}else f.selectUnknownOrEmptyOption(a)},f.addOption=function(a,b){if(b[0].nodeType!==Pe){qa(a,'"option value"'),""===a&&(f.hasEmptyOption=!0,f.emptyOption=b);var c=g.get(a)||0;g.set(a,c+1),d()}},f.removeOption=function(a){var b=g.get(a);b&&(1===b?(g.delete(a),""===a&&(f.hasEmptyOption=!1,f.emptyOption=void 0)):g.set(a,b-1))},f.hasOption=function(a){return!!g.get(a)},f.$hasEmptyOption=function(){return f.hasEmptyOption},f.$isUnknownOptionSelected=function(){return b[0].options[0]===f.unknownOption[0]},f.$isEmptyOptionSelected=function(){return f.hasEmptyOption&&b[0].options[b[0].selectedIndex]===f.emptyOption[0]},f.selectUnknownOrEmptyOption=function(a){null==a&&f.emptyOption?(f.removeUnknownOption(),f.selectEmptyOption()):f.unknownOption.parent().length?f.updateUnknownOption(a):f.renderUnknownOption(a)};var h=!1,i=!1;f.registerOption=function(a,b,c,g,h){if(c.$attr.ngValue){var i,j;c.$observe("value",function(a){var c,d=b.prop("selected");u(j)&&(f.removeOption(i),delete f.selectValueMap[j],c=!0),j=gb(a),i=a,f.selectValueMap[j]=a,f.addOption(a,b),b.attr("value",j),c&&d&&e()})}else g?c.$observe("value",function(a){f.readValue();var c,d=b.prop("selected");u(i)&&(f.removeOption(i),c=!0),i=a,f.addOption(a,b),c&&d&&e()}):h?a.$watch(h,function(a,d){c.$set("value",a);var g=b.prop("selected");d!==a&&f.removeOption(d),f.addOption(a,b),d&&g&&e()}):f.addOption(c.value,b);c.$observe("disabled",function(a){("true"===a||a&&b.prop("selected"))&&(f.multiple?e(!0):(f.ngModelCtrl.$setViewValue(null),f.ngModelCtrl.$render()))}),b.on("$destroy",function(){var a=f.readValue(),b=c.value;f.removeOption(b),d(),(f.multiple&&a&&-1!==a.indexOf(b)||a===b)&&e(!0)})}}],Eh=function(){function a(a,b,c,d){var e=d[0],g=d[1];if(!g)return void(e.registerOption=p);if(e.ngModelCtrl=g,b.on("change",function(){e.removeUnknownOption(),a.$apply(function(){g.$setViewValue(e.readValue())})}),c.multiple){e.multiple=!0,e.readValue=function(){var a=[];return f(b.find("option"),function(b){if(b.selected&&!b.disabled){var c=b.value;a.push(c in e.selectValueMap?e.selectValueMap[c]:c)}}),a},e.writeValue=function(a){f(b.find("option"),function(b){var c=!!a&&(Q(a,b.value)||Q(a,e.selectValueMap[b.value]));c!==b.selected&&he(le(b),c)})};var h,i=NaN;a.$watch(function(){i!==g.$viewValue||U(h,g.$viewValue)||(h=wa(g.$viewValue),g.$render()),i=g.$viewValue}),g.$isEmpty=function(a){return!a||0===a.length}}}function b(a,b,c,d){var e=d[1];if(e){var f=d[0];e.$render=function(){f.writeValue(e.$viewValue)}}}return{restrict:"E",require:["select","?ngModel"],controller:Dh,priority:1,link:{pre:a,post:b}}},Fh=["$interpolate",function(a){return{restrict:"E",priority:100,compile:function(b,c){var d,e;return u(c.ngValue)||(u(c.value)?d=a(c.value,!0):(e=a(b.text(),!0))||c.$set("value",b.text())),function(a,b,c){var f=b.parent(),g=f.data("$selectController")||f.parent().data("$selectController");g&&g.registerOption(a,b,c,d,e)}}}}],Gh=["$parse",function(a){return{restrict:"A",require:"?ngModel",link:function(b,c,d,e){if(e){var f=d.required||a(d.ngRequired)(b);d.required=!0,e.$validators.required=function(a,b){return!d.required||!e.$isEmpty(b)},d.$observe("required",function(a){f!==a&&(f=a,e.$validate())})}}}}],Hh=["$parse",function(a){return{restrict:"A",require:"?ngModel",compile:function(b,c){var d,e;return c.ngPattern&&(d=c.ngPattern,e="/"===c.ngPattern.charAt(0)&&pe.test(c.ngPattern)?function(){return c.ngPattern}:a(c.ngPattern)),function(a,b,c,f){if(f){var g=c.pattern;c.ngPattern?g=e(a):d=c.pattern;var h=ie(g,d,b);c.$observe("pattern",function(a){var c=h;h=ie(a,d,b),(c&&c.toString())!==(h&&h.toString())&&f.$validate()}),f.$validators.pattern=function(a,b){return f.$isEmpty(b)||t(h)||h.test(b)}}}}}}],Ih=["$parse",function(a){return{restrict:"A",require:"?ngModel",link:function(b,c,d,e){if(e){var f=d.maxlength||a(d.ngMaxlength)(b),g=je(f);d.$observe("maxlength",function(a){f!==a&&(g=je(a),f=a,e.$validate())}),e.$validators.maxlength=function(a,b){return g<0||e.$isEmpty(b)||b.length<=g}}}}}],Jh=["$parse",function(a){return{restrict:"A",require:"?ngModel",link:function(b,c,d,e){if(e){var f=d.minlength||a(d.ngMinlength)(b),g=je(f)||-1;d.$observe("minlength",function(a){f!==a&&(g=je(a)||-1,f=a,e.$validate())}),e.$validators.minlength=function(a,b){return e.$isEmpty(b)||b.length>=g}}}}}];if(a.angular.bootstrap)return void(a.console&&console.log("WARNING: Tried to load AngularJS more than once."));!function(){var b;if(!Me){var c=He();me=t(c)?a.jQuery:c?a[c]:void 0,me&&me.fn.on?(le=me,l(me.fn,{scope:df.scope,isolateScope:df.isolateScope,controller:df.controller,injector:df.injector,inheritedData:df.inheritedData})):le=Ja,b=le.cleanData,le.cleanData=function(a){for(var c,d,e=0;null!=(d=a[e]);e++)(c=(le._data(d)||{}).events)&&c.$destroy&&le(d).triggerHandler("$destroy");b(a)},Ae.element=le,Me=!0}}(),function(c){l(c,{errorHandlingConfig:b,bootstrap:ka,copy:S,extend:l,merge:m,equals:U,element:le,forEach:f,injector:mb,noop:p,bind:X,toJson:Z,fromJson:$,identity:q,isUndefined:t,isDefined:u,isString:x,isFunction:C,isObject:v,isNumber:y,isElement:N,isArray:A,version:Se,isDate:z,callbacks:{$$counter:0},getTestability:ma,reloadWithDebugInfo:la,$$minErr:d,$$csp:Ge,$$encodeUriSegment:ga,$$encodeUriQuery:ha,$$lowercase:se,$$stringify:ua,$$uppercase:te}),ne=va(a),ne("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:Mc}),a.provider("$compile",zb).directive({a:rg,input:Kg,textarea:Kg,form:wg,script:Bh,select:Eh,option:Fh,ngBind:Og,ngBindHtml:Qg,ngBindTemplate:Pg,ngClass:Sg,ngClassEven:Ug,ngClassOdd:Tg,ngCloak:Vg,ngController:Wg,ngForm:xg,ngHide:uh,ngIf:Zg,ngInclude:$g,ngInit:ah,ngNonBindable:lh,ngPluralize:ph,ngRef:rh,ngRepeat:sh,ngShow:th,ngStyle:vh,ngSwitch:wh,ngSwitchWhen:xh,ngSwitchDefault:yh,ngOptions:oh,ngTransclude:Ah,ngModel:ih,ngList:bh,ngChange:Rg,pattern:Hh,ngPattern:Hh,required:Gh,ngRequired:Gh,minlength:Jh,ngMinlength:Jh,maxlength:Ih,ngMaxlength:Ih,ngValue:Ng,ngModelOptions:kh}).directive({ngInclude:_g,input:Lg}).directive(sg).directive(Xg),a.provider({$anchorScroll:nb,$animate:vf,$animateCss:yf,$$animateJs:tf,$$animateQueue:uf,$$AnimateRunner:xf,$$animateAsyncRun:wf,$browser:vb,$cacheFactory:wb,$controller:Fb,$document:Gb,$$isDocumentHidden:Hb,$exceptionHandler:Ib,$filter:fd,$$forceReflow:Ff,$interpolate:Wb,$interval:Xb,$$intervalFactory:Yb,$http:Sb,$httpParamSerializer:Kb,$httpParamSerializerJQLike:Lb,$httpBackend:Ub,$xhrFactory:Tb,$jsonpCallbacks:Of,$location:mc,$log:nc,$parse:Dc,$rootScope:Lc,$q:Ec,$$q:Fc,$sce:Rc,$sceDelegate:Qc,$sniffer:Sc,$$taskTrackerFactory:Tc,$templateCache:xb,$templateRequest:Vc,$$testability:Wc,$timeout:Xc,$window:cd,$$rAF:Kc,$$jqLite:fb,$$Map:kf,$$cookieReader:ed})}]).info({angularVersion:"1.7.6"})}(Ae),Ae.module("ngLocale",[],["$provide",function(a){function b(a){a+="";var b=a.indexOf(".");return-1==b?0:a.length-b-1}function c(a,c){var d=c;void 0===d&&(d=Math.min(b(a),3));var e=Math.pow(10,d);return{v:d,f:(a*e|0)%e}}var d={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:["January","February","March","April","May","June","July","August","September","October","November","December"],SHORTDAY:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],SHORTMONTH:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],STANDALONEMONTH:["January","February","March","April","May","June","July","August","September","October","November","December"],WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a",short:"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-¤",negSuf:"",posPre:"¤",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(a,b){var e=0|a,f=c(a,b);return 1==e&&0==f.v?d.ONE:d.OTHER}})}]),le(function(){ja(a.document,ka)})}(window),!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>'),function(){"use strict";angular.module("ng-slide-down",[]).directive("ngSlideDown",["$timeout",function(a){var b,c;return b=function(a,b){return void 0!==b.lazyRender?"<div ng-if='lazyRender' ng-transclude></div>":"<div ng-transclude></div>"},c=function(b,c,d,e,f){var g,h,i,j,k,l,m,n,o,p,q;return h=d.duration||1,q=d.timingFunction||"ease-in-out",i=c.scope(),j=d.emitOnClose,n=d.onClose,m=void 0!==d.lazyRender,g=null,o=null,k=function(a){var b,d,e,f,g;for(e=0,d=c.children(),f=0,g=d.length;f<g;f++)b=d[f],e+=b.clientHeight;return e+"px"},p=function(){return g&&a.cancel(g),m&&(b.lazyRender=!0),a(function(){return o&&a.cancel(o),c.css({overflow:"hidden",transitionProperty:"height",transitionDuration:h+"s",transitionTimingFunction:q,height:k()}),o=a(function(){return c.css({overflow:"visible",transition:"none",height:"auto"})},1e3*h)})},l=function(){if(o&&a.cancel(o),c.css({overflow:"hidden",transitionProperty:"height",transitionDuration:h+"s",transitionTimingFunction:q,height:"0px"}),j||n||m)return g=a(function(){if(j&&b.$emit(j,{}),n&&i.$eval(n),m)return b.lazyRender=!1},1e3*h)},b.$watch("expanded",function(b,d){return b?a(p):(null!=b&&(c.css({height:k()}),c[0].clientHeight),a(l))})},{restrict:"A",scope:{expanded:"=ngSlideDown"},transclude:!0,link:c,template:function(a,c){return b(a,c)}}}])}.call(this),function(a,b){"use strict";function c(a,b,c){if(!a)throw ga("areq","Argument '{0}' is {1}",b||"?",c||"required");return a}function d(a,b){return a||b?a?b?(S(a)&&(a=a.join(" ")),S(b)&&(b=b.join(" ")),a+" "+b):a:b:""}function e(a){var b={};return a&&(a.to||a.from)&&(b.to=a.to,b.from=a.from),b}function f(a,b,c){var d="";return a=S(a)?a:a&&X(a)&&a.length?a.split(/\s+/):[],R(a,function(a,e){a&&a.length>0&&(d+=e>0?" ":"",d+=c?b+a:a+b)}),d}function g(a,b){var c=a.indexOf(b);b>=0&&a.splice(c,1)}function h(a){if(a instanceof Z)switch(a.length){case 0:return a;case 1:if(a[0].nodeType===J)return a;break;default:return Z(i(a))}if(a.nodeType===J)return Z(a)}function i(a){if(!a[0])return a;for(var b=0;b<a.length;b++){var c=a[b];if(c.nodeType===J)return c}}function j(a,b,c){R(b,function(b){a.addClass(b,c)})}function k(a,b,c){R(b,function(b){a.removeClass(b,c)})}function l(a){return function(b,c){c.addClass&&(j(a,b,c.addClass),c.addClass=null),c.removeClass&&(k(a,b,c.removeClass),c.removeClass=null)}}function m(a){if(a=a||{},!a.$$prepared){var b=a.domOperation||$;a.domOperation=function(){a.$$domOperationFired=!0,b(),b=$},a.$$prepared=!0}return a}function n(a,b){o(a,b),p(a,b)}function o(a,b){b.from&&(a.css(b.from),b.from=null)}function p(a,b){b.to&&(a.css(b.to),b.to=null)}function q(a,b,c){var d=b.options||{},e=c.options||{},f=(d.addClass||"")+" "+(e.addClass||""),g=(d.removeClass||"")+" "+(e.removeClass||""),h=r(a.attr("class"),f,g);e.preparationClasses&&(d.preparationClasses=x(e.preparationClasses,d.preparationClasses),delete e.preparationClasses);var i=d.domOperation!==$?d.domOperation:null;return Q(d,e),i&&(d.domOperation=i),h.addClass?d.addClass=h.addClass:d.addClass=null,h.removeClass?d.removeClass=h.removeClass:d.removeClass=null,b.addClass=d.addClass,b.removeClass=d.removeClass,d}function r(a,b,c){function d(a){X(a)&&(a=a.split(" "));var b={};return R(a,function(a){a.length&&(b[a]=!0)}),b}var e={};a=d(a),b=d(b),R(b,function(a,b){e[b]=1}),c=d(c),R(c,function(a,b){e[b]=1===e[b]?null:-1});var f={addClass:"",removeClass:""};return R(e,function(b,c){var d,e;1===b?(d="addClass",e=!a[c]||a[c+L]):-1===b&&(d="removeClass",e=a[c]||a[c+K]),e&&(f[d].length&&(f[d]+=" "),f[d]+=c)}),f}function s(a){return a instanceof Z?a[0]:a}function t(a,b,c,d){var e="";c&&(e=f(c,M,!0)),d.addClass&&(e=x(e,f(d.addClass,K))),d.removeClass&&(e=x(e,f(d.removeClass,L))),e.length&&(d.preparationClasses=e,b.addClass(e))}function u(a,b){b.preparationClasses&&(a.removeClass(b.preparationClasses),b.preparationClasses=null),b.activeClasses&&(a.removeClass(b.activeClasses),b.activeClasses=null)}function v(a,b){var c=b?"paused":"",d=H+ba;return w(a,[d,c]),[d,c]}function w(a,b){var c=b[0],d=b[1];a.style[c]=d}function x(a,b){return a?b?a+" "+b:a:b}function y(a){return[da,a+"s"]}function z(a,b){return[b?ca:ea,a+"s"]}function A(a,b,c){var d=Object.create(null),e=a.getComputedStyle(b)||{};return R(c,function(a,b){var c=e[a];if(c){var f=c.charAt(0);("-"===f||"+"===f||f>=0)&&(c=B(c)),0===c&&(c=null),d[b]=c}}),d}function B(a){var b=0,c=a.split(/\s*,\s*/);return R(c,function(a){"s"===a.charAt(a.length-1)&&(a=a.substring(0,a.length-1)),a=parseFloat(a)||0,b=b?Math.max(a,b):a}),b}function C(a){return 0===a||null!=a}function D(a,b){var c=F,d=a+"s";return b?c+=_:d+=" linear all",[c,d]}function E(a,b,c){R(c,function(c){a[c]=T(a[c])?a[c]:b.style.getPropertyValue(c)})}var F,G,H,I,J=1,K="-add",L="-remove",M="ng-",N="ng-animate",O="$$ngAnimateChildren";void 0===a.ontransitionend&&void 0!==a.onwebkittransitionend?("-webkit-",F="WebkitTransition",G="webkitTransitionEnd transitionend"):(F="transition",G="transitionend"),void 0===a.onanimationend&&void 0!==a.onwebkitanimationend?("-webkit-",H="WebkitAnimation",I="webkitAnimationEnd animationend"):(H="animation",I="animationend");var P,Q,R,S,T,U,V,W,X,Y,Z,$,_="Duration",aa="TimingFunction",ba="PlayState",ca=H+"Delay",da=H+_,ea=F+"Delay",fa=F+_,ga=b.$$minErr("ng"),ha={blockTransitions:function(a,b){var c=b?"-"+b+"s":"";return w(a,[ea,c]),[ea,c]}},ia=["$$rAF",function(a){function b(a){d=d.concat(a),c()}function c(){if(d.length){for(var b=d.shift(),f=0;f<b.length;f++)b[f]();e||a(function(){e||c()})}}var d,e;return d=b.queue=[],b.waitUntilQuiet=function(b){e&&e(),e=a(function(){e=null,b(),c()})},b}],ja=["$interpolate",function(a){return{link:function(b,c,d){function e(a){a="on"===a||"true"===a,c.data(O,a)}var f=d.ngAnimateChildren;X(f)&&0===f.length?c.data(O,!0):(e(a(f)(b)),d.$observe("ngAnimateChildren",e))}}}],ka="$$animateCss",la=1e3,ma=3,na=1.5,oa={transitionDuration:fa,transitionDelay:ea,transitionProperty:F+"Property",animationDuration:da,animationDelay:ca,animationIterationCount:H+"IterationCount"},pa={transitionDuration:fa,
7
+ transitionDelay:ea,animationDuration:da,animationDelay:ca},qa=["$animateProvider",function(a){this.$get=["$window","$$jqLite","$$AnimateRunner","$timeout","$$animateCache","$$forceReflow","$sniffer","$$rAFScheduler","$$animateQueue",function(a,b,c,d,h,i,j,k,q){function r(b,c,d,e,f){var g=h.get(d);g||(g=A(a,b,f),"infinite"===g.animationIterationCount&&(g.animationIterationCount=1));var i=e||g.transitionDuration>0||g.animationDuration>0;return h.put(d,g,i),g}function t(c,d,e,g){var i,j="stagger-"+e;if(h.count(e)>0&&!(i=h.get(j))){var k=f(d,"-stagger");b.addClass(c,k),i=A(a,c,g),i.animationDuration=Math.max(i.animationDuration,0),i.transitionDuration=Math.max(i.transitionDuration,0),b.removeClass(c,k),h.put(j,i,!0)}return i||{}}function u(a){J.push(a),k.waitUntilQuiet(function(){h.flush();for(var a=i(),b=0;b<J.length;b++)J[b](a);J.length=0})}function x(a,b,c,d){var e=r(a,b,c,d,oa),f=e.animationDelay,g=e.transitionDelay;return e.maxDelay=f&&g?Math.max(f,g):f||g,e.maxDuration=Math.max(e.animationDuration*e.animationIterationCount,e.transitionDuration),e}var B=l(b),J=[];return function(a,i){function k(){r()}function l(){r(!0)}function r(c){if(!(V||X&&W)){V=!0,W=!1,ta&&!Q.$$skipPreparationClasses&&b.removeClass(a,ta),Ia&&b.removeClass(a,Ia),v(U,!1),ha.blockTransitions(U,!1),R(fa,function(a){U.style[a[0]]=""}),B(a,Q),n(a,Q),Object.keys(T).length&&R(T,function(a,b){a?U.style.setProperty(b,a):U.style.removeProperty(b)}),Q.onDone&&Q.onDone(),ja&&ja.length&&a.off(ja.join(" "),N);var e=a.data(ka);e&&(d.cancel(e[0].timer),a.removeData(ka)),Y&&Y.complete(!c)}}function A(a){Ha.blockTransition&&ha.blockTransitions(U,a),Ha.blockKeyframeAnimation&&v(U,!!a)}function J(){return Y=new c({end:k,cancel:l}),u($),r(),{$$willAnimate:!1,start:function(){return Y},end:k}}function N(a){a.stopPropagation();var b=a.originalEvent||a;if(b.target===U){var c=b.$manualTimeStamp||Date.now(),d=parseFloat(b.elapsedTime.toFixed(ma));Math.max(c-ea,0)>=ba&&d>=ca&&(X=!0,r())}}function O(){function c(){if(!V){if(A(!1),R(fa,function(a){var b=a[0],c=a[1];U.style[b]=c}),B(a,Q),b.addClass(a,Ia),Ha.recalculateTimingStyles){if(ua=U.getAttribute("class")+" "+ta,xa=h.cacheKey(U,oa,Q.addClass,Q.removeClass),Fa=x(U,ua,xa,!1),Ga=Fa.maxDelay,_=Math.max(Ga,0),0===(ca=Fa.maxDuration))return void r();Ha.hasTransitions=Fa.transitionDuration>0,Ha.hasAnimations=Fa.animationDuration>0}if(Ha.applyAnimationDelay&&(Ga="boolean"!=typeof Q.delay&&C(Q.delay)?parseFloat(Q.delay):Ga,_=Math.max(Ga,0),Fa.animationDelay=Ga,Ja=z(Ga,!0),fa.push(Ja),U.style[Ja[0]]=Ja[1]),ba=_*la,da=ca*la,Q.easing){var c,f=Q.easing;Ha.hasTransitions&&(c=F+aa,fa.push([c,f]),U.style[c]=f),Ha.hasAnimations&&(c=H+aa,fa.push([c,f]),U.style[c]=f)}Fa.transitionDuration&&ja.push(G),Fa.animationDuration&&ja.push(I),ea=Date.now();var g=ba+na*da,i=ea+g,j=a.data(ka)||[],k=!0;if(j.length){var l=j[0];k=i>l.expectedEndTime,k?d.cancel(l.timer):j.push(r)}if(k){var m=d(e,g,!1);j[0]={timer:m,expectedEndTime:i},j.push(r),a.data(ka,j)}ja.length&&a.on(ja.join(" "),N),Q.to&&(Q.cleanupStyles&&E(T,U,Object.keys(Q.to)),p(a,Q))}}function e(){var b=a.data(ka);if(b){for(var c=1;c<b.length;c++)b[c]();a.removeData(ka)}}if(!V){if(!U.parentNode)return void r();var f=function(a){if(X)W&&a&&(W=!1,r());else if(W=!a,Fa.animationDuration){var b=v(U,W);W?fa.push(b):g(fa,b)}},i=Da>0&&(Fa.transitionDuration&&0===wa.transitionDuration||Fa.animationDuration&&0===wa.animationDuration)&&Math.max(wa.animationDelay,wa.transitionDelay);i?d(c,Math.floor(i*Da*la),!1):c(),Z.resume=function(){f(!0)},Z.pause=function(){f(!1)}}}var Q=i||{};Q.$$prepared||(Q=m(P(Q)));var T={},U=s(a);if(!U||!U.parentNode||!q.enabled())return J();var V,W,X,Y,Z,_,ba,ca,da,ea,fa=[],ga=a.attr("class"),ia=e(Q),ja=[];if(0===Q.duration||!j.animations&&!j.transitions)return J();var oa=Q.event&&S(Q.event)?Q.event.join(" "):Q.event,qa=oa&&Q.structural,ra="",sa="";qa?ra=f(oa,M,!0):oa&&(ra=oa),Q.addClass&&(sa+=f(Q.addClass,K)),Q.removeClass&&(sa.length&&(sa+=" "),sa+=f(Q.removeClass,L)),Q.applyClassesEarly&&sa.length&&B(a,Q);var ta=[ra,sa].join(" ").trim(),ua=ga+" "+ta,va=ia.to&&Object.keys(ia.to).length>0;if(!((Q.keyframeStyle||"").length>0||va||ta))return J();var wa,xa=h.cacheKey(U,oa,Q.addClass,Q.removeClass);if(h.containsCachedAnimationWithoutDuration(xa))return ta=null,J();if(Q.stagger>0){var ya=parseFloat(Q.stagger);wa={transitionDelay:ya,animationDelay:ya,transitionDuration:0,animationDuration:0}}else wa=t(U,ta,xa,pa);Q.$$skipPreparationClasses||b.addClass(a,ta);var za;if(Q.transitionStyle){var Aa=[F,Q.transitionStyle];w(U,Aa),fa.push(Aa)}if(Q.duration>=0){za=U.style[F].length>0;var Ba=D(Q.duration,za);w(U,Ba),fa.push(Ba)}if(Q.keyframeStyle){var Ca=[H,Q.keyframeStyle];w(U,Ca),fa.push(Ca)}var Da=wa?Q.staggerIndex>=0?Q.staggerIndex:h.count(xa):0,Ea=0===Da;Ea&&!Q.skipBlocking&&ha.blockTransitions(U,9999);var Fa=x(U,ua,xa,!qa),Ga=Fa.maxDelay;_=Math.max(Ga,0),ca=Fa.maxDuration;var Ha={};if(Ha.hasTransitions=Fa.transitionDuration>0,Ha.hasAnimations=Fa.animationDuration>0,Ha.hasTransitionAll=Ha.hasTransitions&&"all"===Fa.transitionProperty,Ha.applyTransitionDuration=va&&(Ha.hasTransitions&&!Ha.hasTransitionAll||Ha.hasAnimations&&!Ha.hasTransitions),Ha.applyAnimationDuration=Q.duration&&Ha.hasAnimations,Ha.applyTransitionDelay=C(Q.delay)&&(Ha.applyTransitionDuration||Ha.hasTransitions),Ha.applyAnimationDelay=C(Q.delay)&&Ha.hasAnimations,Ha.recalculateTimingStyles=sa.length>0,(Ha.applyTransitionDuration||Ha.applyAnimationDuration)&&(ca=Q.duration?parseFloat(Q.duration):ca,Ha.applyTransitionDuration&&(Ha.hasTransitions=!0,Fa.transitionDuration=ca,za=U.style[F+"Property"].length>0,fa.push(D(ca,za))),Ha.applyAnimationDuration&&(Ha.hasAnimations=!0,Fa.animationDuration=ca,fa.push(y(ca)))),0===ca&&!Ha.recalculateTimingStyles)return J();var Ia=f(ta,"-active");if(null!=Q.delay){var Ja;"boolean"!=typeof Q.delay&&(Ja=parseFloat(Q.delay),_=Math.max(Ja,0)),Ha.applyTransitionDelay&&fa.push(z(Ja)),Ha.applyAnimationDelay&&fa.push(z(Ja,!0))}return null==Q.duration&&Fa.transitionDuration>0&&(Ha.recalculateTimingStyles=Ha.recalculateTimingStyles||Ea),ba=_*la,da=ca*la,Q.skipBlocking||(Ha.blockTransition=Fa.transitionDuration>0,Ha.blockKeyframeAnimation=Fa.animationDuration>0&&wa.animationDelay>0&&0===wa.animationDuration),Q.from&&(Q.cleanupStyles&&E(T,U,Object.keys(Q.from)),o(a,Q)),Ha.blockTransition||Ha.blockKeyframeAnimation?A(ca):Q.skipBlocking||ha.blockTransitions(U,!1),{$$willAnimate:!0,end:k,start:function(){if(!V)return Z={end:k,cancel:l,resume:null,pause:null},Y=new c(Z),u(O),Y}}}}]}],ra=["$$animationProvider",function(a){function b(a){return a.parentNode&&11===a.parentNode.nodeType}a.drivers.push("$$animateCssDriver");var c="ng-animate-shim",d="ng-anchor-out";this.$get=["$animateCss","$rootScope","$$AnimateRunner","$rootElement","$sniffer","$$jqLite","$document",function(a,e,f,g,h,i,j){function k(a){return a.replace(/\bng-\S+\b/g,"")}function l(a,b){return X(a)&&(a=a.split(" ")),X(b)&&(b=b.split(" ")),a.filter(function(a){return-1===b.indexOf(a)}).join(" ")}function m(b,e,g){function h(a){var b={},c=s(a).getBoundingClientRect();return R(["width","height","top","left"],function(a){var d=c[a];switch(a){case"top":d+=p.scrollTop;break;case"left":d+=p.scrollLeft}b[a]=Math.floor(d)+"px"}),b}function i(a){return a.attr("class")||""}function j(){var b=k(i(g)),c=l(b,o),e=l(o,b),f=a(n,{to:h(g),addClass:"ng-anchor-in "+c,removeClass:d+" "+e,delay:!0});return f.$$willAnimate?f:null}function m(){n.remove(),e.removeClass(c),g.removeClass(c)}var n=Z(s(e).cloneNode(!0)),o=k(i(n));e.addClass(c),g.addClass(c),n.addClass("ng-anchor"),r.append(n);var q,t=function(){var b=a(n,{addClass:d,delay:!0,from:h(e)});return b.$$willAnimate?b:null}();if(!t&&!(q=j()))return m();var u=t||q;return{start:function(){function a(){c&&c.end()}var b,c=u.start();return c.done(function(){if(c=null,!q&&(q=j()))return c=q.start(),c.done(function(){c=null,m(),b.complete()}),c;m(),b.complete()}),b=new f({end:a,cancel:a})}}}function n(a,b,c,d){var e=o(a),g=o(b),h=[];if(R(d,function(a){var b=a.out,d=a.in,e=m(c,b,d);e&&h.push(e)}),e||g||0!==h.length)return{start:function(){function a(){R(b,function(a){a.end()})}var b=[];e&&b.push(e.start()),g&&b.push(g.start()),R(h,function(a){b.push(a.start())});var c=new f({end:a,cancel:a});return f.all(b,function(a){c.complete(a)}),c}}}function o(b){var c=b.element,d=b.options||{};b.structural&&(d.event=b.event,d.structural=!0,d.applyClassesEarly=!0,"leave"===b.event&&(d.onDone=d.domOperation)),d.preparationClasses&&(d.event=x(d.event,d.preparationClasses));var e=a(c,d);return e.$$willAnimate?e:null}if(!h.animations&&!h.transitions)return $;var p=j[0].body,q=s(g),r=Z(b(q)||p.contains(q)?q:p);return function(a){return a.from&&a.to?n(a.from,a.to,a.classes,a.anchors):o(a)}}]}],sa=["$animateProvider",function(a){this.$get=["$injector","$$AnimateRunner","$$jqLite",function(b,c,d){function e(c){c=S(c)?c:c.split(" ");for(var d=[],e={},f=0;f<c.length;f++){var g=c[f],h=a.$$registeredAnimations[g];h&&!e[g]&&(d.push(b.get(h)),e[g]=!0)}return d}var f=l(d);return function(a,b,d,g){function h(){g.domOperation(),f(a,g)}function i(){o=!0,h(),n(a,g)}function j(a,b,d,e,f){var g;switch(d){case"animate":g=[b,e.from,e.to,f];break;case"setClass":g=[b,r,s,f];break;case"addClass":g=[b,r,f];break;case"removeClass":g=[b,s,f];break;default:g=[b,f]}g.push(e);var h=a.apply(a,g);if(h)if(V(h.start)&&(h=h.start()),h instanceof c)h.done(f);else if(V(h))return h;return $}function k(a,b,d,e,f){var g=[];return R(e,function(e){var h=e[f];h&&g.push(function(){var e,f,g=!1,i=function(a){g||(g=!0,(f||$)(a),e.complete(!a))};return e=new c({end:function(){i()},cancel:function(){i(!0)}}),f=j(h,a,b,d,function(a){i(!1===a)}),e})}),g}function l(a,b,d,e,f){var g=k(a,b,d,e,f);if(0===g.length){var h,i;"beforeSetClass"===f?(h=k(a,"removeClass",d,e,"beforeRemoveClass"),i=k(a,"addClass",d,e,"beforeAddClass")):"setClass"===f&&(h=k(a,"removeClass",d,e,"removeClass"),i=k(a,"addClass",d,e,"addClass")),h&&(g=g.concat(h)),i&&(g=g.concat(i))}if(0!==g.length)return function(a){var b=[];return g.length&&R(g,function(a){b.push(a())}),b.length?c.all(b,a):a(),function(a){R(b,function(b){a?b.cancel():b.end()})}}}var o=!1;3===arguments.length&&W(d)&&(g=d,d=null),g=m(g),d||(d=a.attr("class")||"",g.addClass&&(d+=" "+g.addClass),g.removeClass&&(d+=" "+g.removeClass));var p,q,r=g.addClass,s=g.removeClass,t=e(d);if(t.length){var u,v;"leave"===b?(v="leave",u="afterLeave"):(v="before"+b.charAt(0).toUpperCase()+b.substr(1),u=b),"enter"!==b&&"move"!==b&&(p=l(a,b,g,t,v)),q=l(a,b,g,t,u)}if(p||q){var w;return{$$willAnimate:!0,end:function(){return w?w.end():(i(),w=new c,w.complete(!0)),w},start:function(){function a(a){i(a),w.complete(a)}function b(b){o||((d||$)(b),a(b))}if(w)return w;w=new c;var d,e=[];return p&&e.push(function(a){d=p(a)}),e.length?e.push(function(a){h(),a(!0)}):h(),q&&e.push(function(a){d=q(a)}),w.setHost({end:function(){b()},cancel:function(){b(!0)}}),c.chain(e,a),w}}}}}]}],ta=["$$animationProvider",function(a){a.drivers.push("$$animateJsDriver"),this.$get=["$$animateJs","$$AnimateRunner",function(a,b){function c(b){var c=b.element,d=b.event,e=b.options,f=b.classes;return a(c,d,f,e)}return function(a){if(a.from&&a.to){var d=c(a.from),e=c(a.to);if(!d&&!e)return;return{start:function(){function a(){return function(){R(f,function(a){a.end()})}}function c(a){g.complete(a)}var f=[];d&&f.push(d.start()),e&&f.push(e.start()),b.all(f,c);var g=new b({end:a(),cancel:a()});return g}}}return c(a)}}]}],ua="data-ng-animate",va="$ngAnimatePin",wa=["$animateProvider",function(b){function d(a){return{addClass:a.addClass,removeClass:a.removeClass,from:a.from,to:a.to}}function e(a){if(!a)return null;var b=a.split(p),c=Object.create(null);return R(b,function(a){c[a]=!0}),c}function f(a,b){if(a&&b){var c=e(b);return a.split(p).some(function(a){return c[a]})}}function g(a,b,c){return r[a].some(function(a){return a(b,c)})}function j(a,b){var c=(a.addClass||"").length>0,d=(a.removeClass||"").length>0;return b?c&&d:c||d}var k=1,o=2,p=" ",r=this.rules={skip:[],cancel:[],join:[]};r.join.push(function(a,b){return!a.structural&&j(a)}),r.skip.push(function(a,b){return!a.structural&&!j(a)}),r.skip.push(function(a,b){return"leave"===b.event&&a.structural}),r.skip.push(function(a,b){return b.structural&&b.state===o&&!a.structural}),r.cancel.push(function(a,b){return b.structural&&a.structural}),r.cancel.push(function(a,b){return b.state===o&&a.structural}),r.cancel.push(function(a,b){if(b.structural)return!1;var c=a.addClass,d=a.removeClass,e=b.addClass,g=b.removeClass;return!(Y(c)&&Y(d)||Y(e)&&Y(g))&&(f(c,g)||f(d,e))}),this.$get=["$$rAF","$rootScope","$rootElement","$document","$$Map","$$animation","$$AnimateRunner","$templateRequest","$$jqLite","$$forceReflow","$$isDocumentHidden",function(e,f,p,r,v,w,x,y,z,A,B){function C(a){$.delete(a.target)}function D(){var a=!1;return function(b){a?b():f.$$postDigest(function(){a=!0,b()})}}function E(a,b){return q(a,b,{})}function F(a,b,c){var d=[],e=ba[c];return e&&R(e,function(e){ia.call(e.node,b)?d.push(e.callback):"leave"===c&&ia.call(e.node,a)&&d.push(e.callback)}),d}function G(a,b,c){var d=i(b);return a.filter(function(a){return!(a.node===d&&(!c||a.callback===c))})}function H(a,b){"close"!==a||b.parentNode||ja.off(b)}function I(a,b,c){function i(a,b,c,d){C(function(){var a=F(y,v,b);a.length?e(function(){R(a,function(a){a(r,c,d)}),H(c,v)}):H(c,v)}),a.progress(b,c,d)}function l(a){u(r,p),ha(r,p),n(r,p),p.domOperation(),A.complete(!a)}var p=P(c),r=h(a),v=s(r),y=v&&v.parentNode;p=m(p);var A=new x,C=D();if(S(p.addClass)&&(p.addClass=p.addClass.join(" ")),p.addClass&&!X(p.addClass)&&(p.addClass=null),S(p.removeClass)&&(p.removeClass=p.removeClass.join(" ")),p.removeClass&&!X(p.removeClass)&&(p.removeClass=null),p.from&&!W(p.from)&&(p.from=null),p.to&&!W(p.to)&&(p.to=null),!(_&&v&&fa(v,b,c)&&ga(v,p)))return l(),A;var G=["enter","move","leave"].indexOf(b)>=0,I=B(),J=I||$.get(v),O=!J&&V.get(v)||{},Q=!!O.state;if(J||Q&&O.state===k||(J=!M(v,y,b)),J)return I&&i(A,b,"start",d(p)),l(),I&&i(A,b,"close",d(p)),A;G&&K(v);var T={structural:G,element:r,event:b,addClass:p.addClass,removeClass:p.removeClass,close:l,options:p,runner:A};if(Q){if(g("skip",T,O))return O.state===o?(l(),A):(q(r,O,T),O.runner);if(g("cancel",T,O))if(O.state===o)O.runner.end();else{if(!O.structural)return q(r,O,T),O.runner;O.close()}else{if(g("join",T,O)){if(O.state!==o)return t(z,r,G?b:null,p),b=T.event=O.event,p=q(r,O,T),O.runner;E(r,T)}}}else E(r,T);var U=T.structural;if(U||(U="animate"===T.event&&Object.keys(T.options.to||{}).length>0||j(T)),!U)return l(),L(v),A;var Y=(O.counter||0)+1;return T.counter=Y,N(v,k,T),f.$$postDigest(function(){r=h(a);var c=V.get(v),e=!c;c=c||{};var f=r.parent()||[],g=f.length>0&&("animate"===c.event||c.structural||j(c));if(e||c.counter!==Y||!g)return e&&(ha(r,p),n(r,p)),(e||G&&c.event!==b)&&(p.domOperation(),A.end()),void(g||L(v));b=!c.structural&&j(c,!0)?"setClass":c.event,N(v,o);var k=w(r,b,c.options);A.setHost(k),i(A,b,"start",d(p)),k.done(function(a){l(!a);var c=V.get(v);c&&c.counter===Y&&L(v),i(A,b,"close",d(p))})}),A}function K(a){var b=a.querySelectorAll("["+ua+"]");R(b,function(a){var b=parseInt(a.getAttribute(ua),10),c=V.get(a);if(c)switch(b){case o:c.runner.end();case k:V.delete(a)}})}function L(a){a.removeAttribute(ua),V.delete(a)}function M(a,b,c){var d,e=r[0].body,f=s(p),g=a===e||"HTML"===a.nodeName,h=a===f,i=!1,j=$.get(a),k=Z.data(a,va);for(k&&(b=s(k));b&&(h||(h=b===f),b.nodeType===J);){var l=V.get(b)||{};if(!i){var m=$.get(b);if(!0===m&&!1!==j){j=!0;break}!1===m&&(j=!1),i=l.structural}if(Y(d)||!0===d){var n=Z.data(b,O);T(n)&&(d=n)}if(i&&!1===d)break;if(g||(g=b===e),g&&h)break;b=h||!(k=Z.data(b,va))?b.parentNode:s(k)}return(!i||d)&&!0!==j&&h&&g}function N(a,b,c){c=c||{},c.state=b,a.setAttribute(ua,b);var d=V.get(a),e=d?Q(d,c):c;V.set(a,e)}var V=new v,$=new v,_=null,aa=f.$watch(function(){return 0===y.totalPendingRequests},function(a){a&&(aa(),f.$$postDigest(function(){f.$$postDigest(function(){null===_&&(_=!0)})}))}),ba=Object.create(null),ca=b.customFilter(),da=b.classNameFilter(),ea=function(){return!0},fa=ca||ea,ga=da?function(a,b){var c=[a.getAttribute("class"),b.addClass,b.removeClass].join(" ");return da.test(c)}:ea,ha=l(z),ia=a.Node.prototype.contains||function(a){return this===a||!!(16&this.compareDocumentPosition(a))},ja={on:function(a,b,c){var d=i(b);ba[a]=ba[a]||[],ba[a].push({node:d,callback:c}),Z(b).on("$destroy",function(){V.get(d)||ja.off(a,b,c)})},off:function(a,b,c){if(1!==arguments.length||X(arguments[0])){var d=ba[a];d&&(ba[a]=1===arguments.length?null:G(d,b,c))}else{b=arguments[0];for(var e in ba)ba[e]=G(ba[e],b)}},pin:function(a,b){c(U(a),"element","not an element"),c(U(b),"parentElement","not an element"),a.data(va,b)},push:function(a,b,c,d){return c=c||{},c.domOperation=d,I(a,b,c)},enabled:function(a,b){var c=arguments.length;if(0===c)b=!!_;else{if(U(a)){var d=s(a);1===c?b=!$.get(d):($.has(d)||Z(a).on("$destroy",C),$.set(d,!b))}else b=_=!!a}return b}};return ja}]}],xa=function(){var a="$$ngAnimateParentKey",b=0,c=Object.create(null);this.$get=[function(){return{cacheKey:function(c,d,e,f){var g=c.parentNode,h=g[a]||(g[a]=++b),i=[h,d,c.getAttribute("class")];return e&&i.push(e),f&&i.push(f),i.join(" ")},containsCachedAnimationWithoutDuration:function(a){var b=c[a];return b&&!b.isValid||!1},flush:function(){c=Object.create(null)},count:function(a){var b=c[a];return b?b.total:0},get:function(a){var b=c[a];return b&&b.value},put:function(a,b,d){c[a]?(c[a].total++,c[a].value=b):c[a]={total:1,value:b,isValid:d}}}}]},ya=["$animateProvider",function(a){function b(a,b){a.data(h,b)}function c(a){a.removeData(h)}function e(a){return a.data(h)}var f="ng-animate-ref",g=this.drivers=[],h="$$animationRunner",i="$$animatePrepareClasses";this.$get=["$$jqLite","$rootScope","$injector","$$AnimateRunner","$$Map","$$rAFScheduler","$$animateCache",function(a,h,j,k,o,p,q){function r(a){function b(a){if(a.processed)return a;a.processed=!0;var c=a.domNode,f=c.parentNode;e.set(c,a);for(var g;f;){if(g=e.get(f)){g.processed||(g=b(g));break}f=f.parentNode}return(g||d).children.push(a),a}var c,d={children:[]},e=new o;for(c=0;c<a.length;c++){var f=a[c];e.set(f.domNode,a[c]={domNode:f.domNode,element:f.element,fn:f.fn,children:[]})}for(c=0;c<a.length;c++)b(a[c]);return function(a){var b,c=[],d=[];for(b=0;b<a.children.length;b++)d.push(a.children[b]);var e=d.length,f=0,g=[];for(b=0;b<d.length;b++){var h=d[b];e<=0&&(e=f,f=0,c.push(g),g=[]),g.push(h),h.children.forEach(function(a){f++,d.push(a)}),e--}return g.length&&c.push(g),c}(d)}var t=[],u=l(a);return function(l,o,v){function w(a){var b="["+f+"]",c=a.hasAttribute(f)?[a]:a.querySelectorAll(b),d=[];return R(c,function(a){var b=a.getAttribute(f);b&&b.length&&d.push(a)}),d}function x(a){var b=[],c={};R(a,function(a,d){var e=a.element,g=s(e),h=a.event,i=["enter","move"].indexOf(h)>=0,j=a.structural?w(g):[];if(j.length){var k=i?"to":"from";R(j,function(a){var b=a.getAttribute(f);c[b]=c[b]||{},c[b][k]={animationID:d,element:Z(a)}})}else b.push(a)});var d={},e={};return R(c,function(c,f){var g=c.from,h=c.to;if(!g||!h){var i=g?g.animationID:h.animationID,j=i.toString();return void(d[j]||(d[j]=!0,b.push(a[i])))}var k=a[g.animationID],l=a[h.animationID],m=g.animationID.toString();if(!e[m]){var n=e[m]={structural:!0,beforeStart:function(){k.beforeStart(),l.beforeStart()},close:function(){k.close(),l.close()},classes:y(k.classes,l.classes),from:k,to:l,anchors:[]};n.classes.length?b.push(n):(b.push(k),b.push(l))}e[m].anchors.push({out:g.element,in:h.element})}),b}function y(a,b){a=a.split(" "),b=b.split(" ");for(var c=[],d=0;d<a.length;d++){var e=a[d];if("ng-"!==e.substring(0,3))for(var f=0;f<b.length;f++)if(e===b[f]){c.push(e);break}}return c.join(" ")}function z(a){for(var b=g.length-1;b>=0;b--){var c=g[b],d=j.get(c),e=d(a);if(e)return e}}function A(){H=(H?H+" ":"")+N,a.addClass(l,H);var b=l.data(i);b&&(a.removeClass(l,b),b=null)}function B(a,b){function c(a){var c=e(a);c&&c.setHost(b)}a.from&&a.to?(c(a.from.element),c(a.to.element)):c(a.element)}function C(){var a=e(l);!a||"leave"===o&&v.$$domOperationFired||a.end()}function D(b){l.off("$destroy",C),c(l),u(l,v),n(l,v),v.domOperation(),H&&a.removeClass(l,H),F.complete(!b)}v=m(v);var E=["enter","move","leave"].indexOf(o)>=0,F=new k({end:function(){D()},cancel:function(){D(!0)}});if(!g.length)return D(),F;var G=d(l.attr("class"),d(v.addClass,v.removeClass)),H=v.tempClasses;return H&&(G+=" "+H,v.tempClasses=null),E&&l.data(i,"ng-"+o+"-prepare"),b(l,F),t.push({element:l,classes:G,event:o,structural:E,options:v,beforeStart:A,close:D}),l.on("$destroy",C),t.length>1?F:(h.$$postDigest(function(){var b=[];R(t,function(a){e(a.element)?b.push(a):a.close()}),t.length=0;var c=x(b),d=[];R(c,function(a){var b=a.from?a.from.element:a.element,c=v.addClass;c=(c?c+" ":"")+N;var f=q.cacheKey(b[0],a.event,c,v.removeClass);d.push({element:b,domNode:s(b),fn:function(){var b,c=a.close;if(q.containsCachedAnimationWithoutDuration(f))return void c();if(a.beforeStart(),e(a.anchors?a.from.element||a.to.element:a.element)){var d=z(a);d&&(b=d.start)}if(b){var g=b();g.done(function(a){c(!a)}),B(a,g)}else c()}})});for(var f=r(d),g=0;g<f.length;g++)for(var h=f[g],j=0;j<h.length;j++){var k=h[j],l=k.element;if(f[g][j]=k.fn,0!==g){var m=l.data(i);m&&a.addClass(l,m)}else l.removeData(i)}p(f)}),F)}}]}],za=["$animate",function(a){return{restrict:"A",transclude:"element",terminal:!0,priority:550,link:function(b,c,d,e,f){var g,h;b.$watchCollection(d.ngAnimateSwap||d.for,function(b){g&&a.leave(g),h&&(h.$destroy(),h=null),(b||0===b)&&f(function(b,d){g=b,h=d,a.enter(b,null,c)})})}}}];b.module("ngAnimate",[],function(){$=b.noop,P=b.copy,Q=b.extend,Z=b.element,R=b.forEach,S=b.isArray,X=b.isString,W=b.isObject,Y=b.isUndefined,T=b.isDefined,V=b.isFunction,U=b.isElement}).info({angularVersion:"1.7.6"}).directive("ngAnimateSwap",za).directive("ngAnimateChildren",ja).factory("$$rAFScheduler",ia).provider("$$animateQueue",wa).provider("$$animateCache",xa).provider("$$animation",ya).provider("$animateCss",qa).provider("$$animateCssDriver",ra).provider("$$animateJs",sa).provider("$$animateJsDriver",ta)}(window,window.angular),function(a,b){"use strict";function c(){function c(a,b){return d(a.split(","),b)}function d(a,b){var c,d={};for(c=0;c<a.length;c++)d[b?j(a[c]):a[c]]=!0;return d}function p(a,b){b&&b.length&&f(a,d(b))}function q(a,b){null===a||void 0===a?a="":"string"!=typeof a&&(a=""+a);var c=N(a);if(!c)return"";var d=5;do{if(0===d)throw o("uinput","Failed to sanitize html because the input is unstable");d--,a=c.innerHTML,c=N(a)}while(a!==c.innerHTML);for(var e=c.firstChild;e;){switch(e.nodeType){case 1:b.start(e.nodeName.toLowerCase(),r(e.attributes));break;case 3:b.chars(e.textContent)}var f;if(!((f=e.firstChild)||(1===e.nodeType&&b.end(e.nodeName.toLowerCase()),f=v("nextSibling",e))))for(;null==f&&(e=v("parentNode",e))!==c;)f=v("nextSibling",e),1===e.nodeType&&b.end(e.nodeName.toLowerCase());e=f}for(;e=c.firstChild;)c.removeChild(e)}function r(a){for(var b={},c=0,d=a.length;c<d;c++){var e=a[c];b[e.name]=e.value}return b}function s(a){return a.replace(/&/g,"&amp;").replace(y,function(a){return"&#"+(1024*(a.charCodeAt(0)-55296)+(a.charCodeAt(1)-56320)+65536)+";"}).replace(z,function(a){return"&#"+a.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function t(a,b){var c=!1,d=e(a,a.push);return{start:function(a,e){a=j(a),!c&&H[a]&&(c=a),c||!0!==I[a]||(d("<"),d(a),g(e,function(c,e){var f=j(e),g="img"===a&&"src"===f||"background"===f;!0!==M[f]||!0===J[f]&&!b(c,g)||(d(" "),d(e),d('="'),d(s(c)),d('"'))}),d(">"))},end:function(a){a=j(a),c||!0!==I[a]||!0===A[a]||(d("</"),d(a),d(">")),a==c&&(c=!1)},chars:function(a){c||d(s(a))}}}function u(b){for(;b;){if(b.nodeType===a.Node.ELEMENT_NODE)for(var c=b.attributes,d=0,e=c.length;d<e;d++){var f=c[d],g=f.name.toLowerCase();"xmlns:ns1"!==g&&0!==g.lastIndexOf("ns1:",0)||(b.removeAttributeNode(f),d--,e--)}var h=b.firstChild;h&&u(h),b=v("nextSibling",b)}}function v(a,b){var c=b[a];if(c&&l.call(b,c))throw o("elclob","Failed to sanitize html because the element is clobbered: {0}",b.outerHTML||b.outerText);return c}var w=!1,x=!1;this.$get=["$$sanitizeUri",function(a){return w=!0,x&&f(I,G),function(b){var c=[];return m(b,n(c,function(b,c){return!/^unsafe:/.test(a(b,c))})),c.join("")}}],this.enableSvg=function(a){return i(a)?(x=a,this):x},this.addValidElements=function(a){return w||(h(a)&&(a={htmlElements:a}),p(G,a.svgElements),p(A,a.htmlVoidElements),p(I,a.htmlVoidElements),p(I,a.htmlElements)),this},this.addValidAttrs=function(a){return w||f(M,d(a,!0)),this},e=b.bind,f=b.extend,g=b.forEach,h=b.isArray,i=b.isDefined,j=b.$$lowercase,k=b.noop,m=q,n=t,l=a.Node.prototype.contains||function(a){return!!(16&this.compareDocumentPosition(a))};var y=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,z=/([^#-~ |!])/g,A=c("area,br,col,hr,img,wbr"),B=c("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),C=c("rp,rt"),D=f({},C,B),E=f({},B,c("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),F=f({},C,c("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),G=c("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),H=c("script,style"),I=f({},A,E,F,D),J=c("background,cite,href,longdesc,src,xlink:href,xml:base"),K=c("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),L=c("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",!0),M=f({},J,L,K),N=function(a,b){function c(b){b="<remove></remove>"+b;try{b=encodeURI(b)}catch(a){return}var c=new a.XMLHttpRequest;c.responseType="document",c.open("GET","data:text/html;charset=utf-8,"+b,!1),c.send(null);var d=c.response.body;return d.firstChild.remove(),d}function d(b){b="<remove></remove>"+b;try{var c=(new a.DOMParser).parseFromString(b,"text/html").body;return c.firstChild.remove(),c}catch(a){return}}function e(a){return g.innerHTML=a,b.documentMode&&u(g),g}var f;if(!b||!b.implementation)throw o("noinert","Can't create an inert html document");f=b.implementation.createHTMLDocument("inert");var g=(f.documentElement||f.getDocumentElement()).querySelector("body");return g.innerHTML='<svg><g onload="this.parentNode.remove()"></g></svg>',g.querySelector("svg")?(g.innerHTML='<svg><p><style><img src="</style><img src=x onerror=alert(1)//">',g.querySelector("svg img")?d:e):c}(a,a.document)}function d(a){var b=[];return n(b,k).chars(a),b.join("")}var e,f,g,h,i,j,k,l,m,n,o=b.$$minErr("$sanitize");b.module("ngSanitize",[]).provider("$sanitize",c).info({angularVersion:"1.7.6"}),b.module("ngSanitize").filter("linky",["$sanitize",function(a){var c=/((s?ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,e=/^mailto:/i,f=b.$$minErr("linky"),g=b.isDefined,h=b.isFunction,i=b.isObject,j=b.isString;return function(b,k,l){function m(a){a&&s.push(d(a))}if(null==b||""===b)return b;if(!j(b))throw f("notstring","Expected string but received: {0}",b);for(var n,o,p,q=h(l)?l:i(l)?function(){return l}:function(){return{}},r=b,s=[];n=r.match(c);)o=n[0],n[2]||n[4]||(o=(n[3]?"http://":"mailto:")+o),p=n.index,m(r.substr(0,p)),function(a,b){var c,d=q(a);s.push("<a ");for(c in d)s.push(c+'="'+d[c]+'" ');!g(k)||"target"in d||s.push('target="',k,'" '),s.push('href="',a.replace(/"/g,"&quot;"),'">'),m(b),s.push("</a>")}(o,n[0].replace(e,"")),r=r.substring(p+n[0].length);return m(r),a(s.join(""))}}])}(window,window.angular),function(){function a(){return{restrict:"AEC",require:"dxStartWith",controller:"dxStartWithCtrl",scope:!0,terminal:!0,transclude:!0,multiElement:!0,$$tlb:!0,compile:function(a,b){var c=b.dxStartWith||b.root,e=c.match(d),f=e[1],g=e[3]||"";return function(a,b,c,d,e){d.alias=g,d.transclude=e,d.transclude(a,function(a,c){function d(a){c.$dxPrior=a,""!==g&&(c[g]=a)}b.append(a),c.$dxLevel=0,c.$dxIsRoot=!0,c.$watch(f,d)})}}}}function b(){return{restrict:"AEC",require:"^dxStartWith",scope:!0,terminal:!0,multiElement:!0,compile:function(a,b){var c=b.dxConnect||b.connect;return function(a,b,d,e){alias=e.alias||"",e.transclude(a,function(a,d){function e(a){d.$dxPrior=a,""!==alias&&(d[alias]=a)}b.append(a),d.$dxLevel=d.$dxLevel+1,d.$dxIsRoot=!1,d.$watch(c,e)})}}}}var c=angular.module("dotjem.angular.tree",[]),d=/^(\S+)(\s+as\s+(\w+))?$/;c.controller("dxStartWithCtrl",[function(){}]),c.directive("dxStartWith",a),c.directive("dxConnect",b)}(),function(){"use strict";function a(a,b,c){return{restrict:"A",link:function(d,e,f){c(function(){function g(a){var g,h,k,l,m,n;if(!angular.element(e).hasClass("ng-hide")&&a&&a.target){for(h=a.target;h;h=h.parentNode){if(h===e[0])return;if(l=h.id,m=h.className,n=j.length,m&&void 0!==m.baseVal&&(m=m.baseVal),m||l)for(g=0;g<n;g++)if(k=new RegExp("\\b"+j[g]+"\\b"),void 0!==l&&l===j[g]||m&&k.test(m))return}c(function(){(i=b(f.clickOutside))(d,{event:a})})}}function h(){return"ontouchstart"in window||navigator.maxTouchPoints}var i,j=void 0!==f.outsideIfNot?f.outsideIfNot.split(/[ ,]+/):[];h()&&a.on("touchstart",g),a.on("click",g),d.$on("$destroy",function(){h()&&a.off("touchstart",g),a.off("click",g)})})}}}angular.module("angular-click-outside",[]).directive("clickOutside",["$document","$parse","$timeout",a])}();var GoogleMerchants=angular.module("GoogleMerchants",["templates-dist","dotjem.angular.tree","ngSanitize","ngAnimate","ng-slide-down","angular-click-outside"]);GoogleMerchants.constant("BACKEND",ajaxurl+"?action=wpae_api&q="),GoogleMerchants.filter("safe",["$sce",function(a){return a.trustAsHtml}]),GoogleMerchants.controller("advancedAttributesController",["$scope","$log","attributesService",function(a,b,c){a.attributes=[],a.cats=[],a.attributes=c.getAttributes()}]),GoogleMerchants.directive("advancedAttributes",function(){return{restrict:"E",scope:{advancedAttributes:"=information"},templateUrl:"advancedAttributes/advancedAttributes.tpl.html",controller:"advancedAttributesController"}}),GoogleMerchants.controller("availabilityPriceController",["$scope","currencyService",function(a,b){a.currency=b.getCurrency()}]),GoogleMerchants.directive("availabilityPrice",function(){return{restrict:"E",scope:{availabilityPrice:"=information"},templateUrl:"availabilityPrice/availabilityPrice.tpl.html",controller:"availabilityPriceController"}}),
8
+ GoogleMerchants.controller("basicInformationController",["$scope",function(a){}]),GoogleMerchants.directive("basicInformation",function(){return{restrict:"E",scope:{basicInformation:"=information"},templateUrl:"basicInformation/basicInformation.tpl.html",controller:"basicInformationController"}}),GoogleMerchants.directive("chosen",["$timeout",chosen]),GoogleMerchants.factory("attributesService",["$rootScope","$q","$log","wpHttp",function(a,b,c,d){var e=!1;return{setAttributes:function(a){e=a},getAttributes:function(){return e}}}]),GoogleMerchants.directive("autodetect",["attributesService",function(a){return{restrict:"A",require:"^ngModel",link:{post:function(b,c,d,e){var f=d.autodetect;d=a.getAttributes(),angular.forEach(d,function(a){a.label.toLowerCase()!=f.toLowerCase()&&a.name.toLowerCase()!=f.toLowerCase()||(e.$setViewValue("{"+a.name+"}"),e.$render())})}}}}]),GoogleMerchants.directive("cascade",[function(){return{restrict:"A",controller:["$scope",function(a){function b(c,d){var e,f;for(e=0;e<d.children.length;e+=1)f=d.children[e],a.mappings[f.id]=c,b(c,f);return!1}a.select=function(){console.log("Changing to ",a.mappings[a.node.id]),b(a.mappings[a.node.id],a.node)}}]}}]),GoogleMerchants.directive("contenteditable",["$sce",function(a){return{restrict:"A",require:"?ngModel",link:function(b,c,d,e){function f(){var a=c.html();d.stripBr&&"<br>"===a&&(a=""),e.$setViewValue(a)}e&&(e.$render=function(){c.html(a.getTrustedHtml(e.$viewValue||""))},c.on("blur keyup change",function(){b.$evalAsync(f)}),f())}}}]),GoogleMerchants.factory("currencyService",[function(){var a=null,b=null;return{setCurrency:function(c,d){a=c,b=d},getCurrency:function(){return a},getCurrencyCode:function(){return b}}}]),GoogleMerchants.directive("droppable",[function(){return{restrict:"A",require:"^ngModel",link:function(a,b,c,d){function e(a,b){return-1!==a.find("input[name^=cc_type]").val().indexOf("image_")&&(b="Image "+b),-1!==a.find("input[name^=cc_type]").val().indexOf("attachment_")&&(b="Attachment "+b),b}var f;f=angular.element(b),f.addClass("google-merchants-droppable"),f.droppable({drop:function(a,b){var c=b.draggable.find(".custom_column"),g=c.find("input[name^=cc_name]").val();g=e(c,g),f.val(f.val()+"{"+g+"}"),d.$setViewValue(f.val()),d.$render()}})}}}]),GoogleMerchants.factory("exportService",["$q","$log","wpHttp",function(a,b,c){return{getExport:function(d){var e=a.defer(),f="export/get";return null!==d&&(f=f+"&id="+d),c.get(f).then(function(a){e.resolve(a)},function(a,c){e.reject(a,c),b.error("There was a problem getting the export")}),e.promise},saveExport:function(d){var e=a.defer();return c.post("export/save",d).then(function(a){e.resolve(a)},function(a,c){e.reject(a),b.error(a,c)}),e.promise}}}]),GoogleMerchants.directive("focusMeWhenEnabled",function(a){return{priority:-1,link:function(b,c){b.$watch(function(){return b.$eval(c.attr("ng-disabled"))},function(b){0==b&&a(function(){c[0].focus()})})}}}),GoogleMerchants.factory("googleCategoriesService",["$rootScope","$q","$log","wpHttp",function(a,b,c,d){return{searchCategories:function(a){return d.get("googleCategories/get&parent=0"+a)},getChildCategories:function(a){return d.get("googleCategories/get&parent="+a)},categorySelected:function(b){a.$broadcast("wpae.category.selected",b)}}}]),GoogleMerchants.controller("mainController",["$scope","$rootScope","$timeout","$window","$document","$location","$log","templateService","exportService","currencyService","attributesService","wpHttp",function(a,b,c,d,e,f,g,h,i,j,k,l){function m(a,b){b||(b=window.location.href),a=a.replace(/[\[\]]/g,"\\$&");var c=new RegExp("[?&]"+a+"(=([^&#]*)|&|#|$)"),d=c.exec(b);return d?d[2]?decodeURIComponent(d[2].replace(/\+/g," ")):"":null}function n(){b.cats.children.length||(a.merchantsFeedData.productCategories.productCategories="customValue")}var o=[{mapFrom:"",mapTo:""}];a.cats=[],a.templateId=!1,a.merchantsFeedData={basicInformation:{open:!0,itemTitle:"productTitle",hasVariations:!0,useParentTitleForVariableProducts:!0,additionalImageLink:"productImages",itemDescription:"productDescription",itemImageLink:"useProductFeaturedImage",itemLink:"productLink",condition:"new",conditionMappings:angular.copy(o),userVariationDescriptionForVariableProducts:!0,addVariationAttributesToProductUrl:!0,useVariationImage:!0,useFeaturedImageIfThereIsNoVariationImage:!0,useParentDescirptionIfThereIsNoVariationDescirption:!0,useVariationDescriptionForVariableProducts:!0},detailedInformation:{open:!1,color:"selectFromWooCommerceProductAttributes",size:"selectFromWooCommerceProductAttributes",gender:"selectFromWooCommerceProductAttributes",setTheGroupId:"automatically",mappings:angular.copy(o),ageGroup:"selectFromWooCommerceProductAttributes",material:"selectFromWooCommerceProductAttributes",pattern:"selectFromWooCommerceProductAttributes",genderAutodetect:"keepBlank",sizeSystem:"",adjustPrice:!1,adjustSalePrice:!1,genderCats:{},ageGroupCats:{},sizeTypeMappings:angular.copy(o)},availabilityPrice:{open:!1,price:"useProductPrice",salePrice:"useProductSalePrice",availability:"useWooCommerceStockValues",adjustPriceValue:"",adjustPriceType:"%",adjustSalePriceType:"%",adjustSalePriceValue:"",currency:null},productCategories:{open:!1,productType:"useWooCommerceProductCategories",productCategories:"mapProductCategories",catMappings:{}},uniqueIdentifiers:{open:!1,identifierExists:"1"},shipping:{dimensions:"useWooCommerceProductValues",convertTo:"cm",adjustPriceType:"%",weight:"",shippingHeight:"",shippingLength:"",shippingWidth:""},template:{save:!1,name:""},advancedAttributes:{adult:"no",unitPricingBaseMeasureUnit:"kg",excludedDestination:"no",customLabel0Mappings:angular.copy(o),customLabel1Mappings:angular.copy(o),customLabel2Mappings:angular.copy(o),customLabel3Mappings:angular.copy(o),customLabel4Mappings:angular.copy(o),energyEfficiencyClassMappings:angular.copy(o),promotionIdMappings:angular.copy(o)}},a.init=function(b,c,d){k.setAttributes(wpae_product_attributes),a.isGoogleMerchantExport=!1,j.setCurrency(b,c),a.templateId=d},a.selectGoogleMerchantsInitially=function(){a.selectGoogleMerchants()},a.selectGoogleMerchants=function(){jQuery(".wpallexport-element-label").parent().parent().slideUp(),a.isGoogleMerchantExport=!0;var c=m("id");i.getExport(c).then(function(b){angular.isObject(b)&&(b.template={save:!1,name:""},a.merchantsFeedData=b)}),a.templateId&&(console.log("Loading template with id "+a.templateId),h.getTemplate(a.templateId).then(function(b){a.merchantsFeedData=b.google_merchants_post_data})),l.get("categories/index").then(function(a){b.cats=a,console.log("Broadcasting loaded categories..."),b.$broadcast("categories.loaded"),n()},function(){g.error("There was a problem loading the WordPress categories")}),null==a.merchantsFeedData.availabilityPrice.currency&&(a.merchantsFeedData.availabilityPrice.currency=j.getCurrencyCode())},a.$on("googleMerchantsSelected",function(b,d){a.selectGoogleMerchants(),a.merchantsFeedData.basicInformation.hasVariations=d,jQuery(".wpallexport-element-label").parent().parent().slideUp(),c(function(){a.isGoogleMerchantExport=!0})}),a.$on("googleMerchantsDeselected",function(){jQuery(".wpallexport-element-label").parent().parent().slideDown(),c(function(){a.isGoogleMerchantExport=!1})}),a.$on("googleMerchantsSubmitted",function(b,c){a.merchantsFeedData.template.name=c.templateName,a.process()}),a.$on("templateShouldBeSaved",function(b,c){a.merchantsFeedData.template.save=!0,a.merchantsFeedData.template.name=c}),a.$on("templateShouldNotBeSaved",function(){a.merchantsFeedData.template.save=!1}),a.$on("selectedTemplate",function(b,c){h.getTemplate(c).then(function(b){a.merchantsFeedData=b.google_merchants_post_data})}),a.process=function(){a.merchantsFeedData.extraData=jQuery("#templateForm").serialize(),a.merchantsFeedData.filteringData=jQuery("input[name=filter_rules_hierarhy]").val(),a.merchantsFeedData.template.save=jQuery("#save_template_as").prop("checked");var b=m("id");b&&(a.merchantsFeedData.exportId=b,a.merchantsFeedData.update=!0),i.saveExport(a.merchantsFeedData).then(function(a){a.redirect?d.location.href=a.redirect:d.location.href="admin.php?page=pmxe-admin-export&action=options"})}}]),GoogleMerchants.controller("mappingController",["$scope",function(a){a.show=!1,a.mappingsBackup=null,a.removeMapping=function(b){a.mappings.length>1&&a.mappings.splice(a.mappings.indexOf(b),1)},a.$watch("show",function(b){b&&(a.mappingsBackup=a.mappings)}),a.addMapping=function(){a.mappings.push({})},a.close=function(){a.mappings=a.mappingsBackup,a.show=!1},a.saveMappings=function(){a.show=!1}}]),GoogleMerchants.directive("mapping",function(){return{restrict:"E",scope:{mappings:"=",show:"=",context:"=",tooltip:"@"},templateUrl:"common/mapping/mapping.tpl.html",controller:"mappingController"}}),GoogleMerchants.directive("styledInput",function(a){return{priority:-1,scope:{placeholder:"=",ngModel:"="},template:'<div class="editable" contenteditable="true" ng-model="ngModel" placeholder="{{placeholder}}"></div>',link:function(a,b){b.bind("keydown",function(a){return(!a.ctrlKey&&!a.metaKey||65==a.which||88==a.which||67==a.which||86==a.which)&&(13!=a.which&&void 0)})}}}),GoogleMerchants.factory("templateService",["$q","$log","wpHttp",function(a,b,c){return{getTemplate:function(d){var e=a.defer();return c.get("templates/get&templateId="+d).then(function(a){e.resolve(a)},function(a,c){e.reject(a,c),b.error("There was a problem getting the export")}),e.promise}}}]),GoogleMerchants.directive("tipsy",["$document",function(a){return{restrict:"A",link:function(b,c,d){c.attr("original-title",d.tipsy),c.attr("title",d.tipsy),jQuery(c).parent().tipsy({gravity:function(){console.log("setting gravity");var b="n";a.scrollTop()<c.offset().top-angular.element(".tipsy").height()-2&&(b="s");var d="";return c.offset().left+angular.element(".tipsy").width()<a.width()+a.scrollLeft()?d="w":c.offset().left-angular.element(".tipsy").width()>a.scrollLeft()&&(d="e"),b+d},live:".wpallexport-help",html:!0,opacity:1})}}}]),GoogleMerchants.factory("wpHttp",["$http","$q","$log","BACKEND","NONCE",function(a,b,c,d,e){return{post:function(c,f){var g=b.defer();return a.post(d+c+"&security="+e,f).then(function(a){g.resolve(a.data)},function(a,b){g.reject(a,b)}),g.promise},get:function(c){var f=b.defer();return a.get(d+c+"&security="+e).then(function(a){f.resolve(a.data)},function(a,b){f.reject(a,b)}),f.promise}}}]),GoogleMerchants.controller("detailedInformationController",["$scope","$log","attributesService",function(a,b,c){a.attributes=[],a.cats=[],a.attributes=c.getAttributes()}]),GoogleMerchants.directive("detailedInformation",function(){return{restrict:"E",scope:{detailedInformation:"=information"},templateUrl:"detailedInformation/detailedInformation.tpl.html",controller:"detailedInformationController"}}),GoogleMerchants.controller("categoryMapperController",["$scope","$rootScope","$interval","$timeout",function(a,b,c,d){a.dialogVisible=!0,a.selectedCategory="",a.selectedCategoryId=0,a.parentWidth=!1,a.siteCats=[],a.initialized=!1,a.innerMapping=!1,a.limits=350,a.catMappings=[],b.$on("categories.loaded",function(){a.innerMapping=b.cats}),a.innerMapping=b.cats,a.initialize=function(){a.initialized||(d(function(){c(function(){a.limits<a.innerMapping.length&&(a.limits+=20)},10)},100),a.initialized=!0,a.afterInitialize())},a.afterInitialize=function(){angular.forEach(a.cats,function(a,b){})},angular.isUndefined(a.context)&&(a.context="categories"),a.expandNode=function(a){a.children.length&&(a.expanded=!a.expanded)},a.getTimes=function(a){return new Array(a)},a.toggleDialog=function(){a.dialogVisible=!a.dialogVisible},a.getPlaceholder=function(){return a.visible?"":"Select Google Product Category"}}]),GoogleMerchants.directive("categoryMapper",function(){return{restrict:"E",scope:{mappings:"=",grey:"=",context:"@?"},templateUrl:"productCategories/categoryMapper/categoryMapper.tpl.html",controller:"categoryMapperController"}}),GoogleMerchants.controller("googleCategorySelectorController",["$scope","$log","$window","googleCategoriesService",function(a,b,c,d){function e(b,c,d){var f,g;for(f=0;f<d.children.length;f+=1){if(g=d.children[f],angular.isDefined(a.mappings[g.id])){if(!a.mappings[g.id].byUser){var h={id:b,name:c,byUser:!1};a.mappings[g.id]=h}}else a.mappings[g.id]={id:b,name:c,byUser:!1};e(b,c,g)}return!1}var f=[];a.categories=[],a.level=1,a.search="",a.loading=!1,a.hasResults=!0,a.byUser=!1,a.select=function(b){var c=b.name.replace("<strong>","").replace("</strong>","").replace("<b>","").replace("</b>","");a.visible=!1,a.selectedCategory=c,a.mappings[a.node.id]={id:b.id,name:c,byUser:!0},e(b.id,c,a.node)},a.loadCategories=function(b){a.loading=!0;var c="";b&&(c="&search="+b),d.searchCategories(c).then(function(b){a.categories=b}).finally(function(){a.loading=!1})},a.expand=function(c){if(c.opened)return void(c.opened=!1);a.loading=!0,d.getChildCategories(c.id).then(function(a){"null"!=a&&(c.children=a,c.opened=!0)},function(){b.error("There was a problem loading the categories")}).finally(function(){a.loading=!1})},a.matchSearch=function(a){return function(b){return b.name===a.name}},a.$watch("search",function(b,c){if(""==c&&(f=a.categories),""==b)return void(a.categories=f);a.loadCategories(b)},!0),a.categoryChanged=function(){a.loadCategories(a.selectedCategory)},a.categoryClicked=function(){a.selectedCategory;a.visible||(a.visible=!0),a.byUser||(a.selectedCategory=""),a.search="",a.categoryChanged()},a.closeMe=function(){a.visible&&(a.visible=!1)}}]),GoogleMerchants.directive("googleCategorySelector",["$rootScope",function(a){return{restrict:"E",templateUrl:"productCategories/googleCategorySelector/googleCategorySelector.tpl.html",controller:"googleCategorySelectorController"}}]),GoogleMerchants.controller("productCategoriesController",["$scope",function(a){}]),GoogleMerchants.directive("productCategories",function(){return{restrict:"E",scope:{productCategories:"=information"},templateUrl:"productCategories/productCategories.tpl.html",controller:"productCategoriesController"}}),GoogleMerchants.controller("shippingController",["$scope","currencyService",function(a,b){a.currency=b.getCurrency()}]),GoogleMerchants.directive("shipping",function(){return{restrict:"E",scope:{shipping:"=information"},templateUrl:"shipping/shipping.tpl.html",controller:"shippingController"}}),GoogleMerchants.controller("uniqueIdentifiersController",["$scope",function(a){}]),GoogleMerchants.directive("uniqueIdentifiers",function(){return{restrict:"E",scope:{uniqueIdentifiers:"=information"},templateUrl:"uniqueIdentifiers/uniqueIdentifiers.tpl.html",controller:"uniqueIdentifiersController"}}),angular.module("templates-dist",["advancedAttributes/advancedAttributes.tpl.html","availabilityPrice/availabilityPrice.tpl.html","basicInformation/basicInformation.tpl.html","common/mapping/mapping.tpl.html","detailedInformation/detailedInformation.tpl.html","productCategories/categoryMapper/categoryMapper.tpl.html","productCategories/categoryMapper/noCategoriesNotice.tpl.html","productCategories/googleCategorySelector/googleCategorySelector.tpl.html","productCategories/productCategories.tpl.html","shipping/shipping.tpl.html","uniqueIdentifiers/uniqueIdentifiers.tpl.html"]),angular.module("advancedAttributes/advancedAttributes.tpl.html",[]).run(["$templateCache",function(a){a.put("advancedAttributes/advancedAttributes.tpl.html",'<div class="wpallexport-collapsed wpallexport-section" ng-class="{closed: !advancedAttributes.open }">\n <div class="wpallexport-content-section">\n <div class="wpallexport-collapsed-header disable-jquery"\n ng-click="advancedAttributes.open = !advancedAttributes.open">\n <h3>Advanced Attributes</h3>\n </div>\n <div class="wpallexport-collapsed-content" id="advanced-attributes"\n ng-slide-down="advancedAttributes.open" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n <h3 class="inner-title">Product Type</h3>\n <h4>Multipack</h4>\n <p>\n Multipacks are packages that include several identical products to create a larger unit of sale,\n submitted as a single item.\n For example, if the product for sale is a 6-pack of soda, the multipack value would be 6.\n </p>\n <div class="input">\n <label><input type="text" ng-model="advancedAttributes.multipack" class="wpae-default-input" droppable/></label>\n </div>\n\n <h4>Adult</h4>\n <div class="input">\n <label><input type="radio" ng-model="advancedAttributes.adult" value="no"/>False</label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="advancedAttributes.adult" value="yes"/>True</label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="advancedAttributes.adult" value="customValue"/>Custom data</label>\n <div ng-slide-down="advancedAttributes.adult == \'customValue\'" duration="0.2" class="input inner">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.adultCV" droppable />\n </div>\n </div>\n\n <h3 class="inner-title">Adwords &amp; Shopping Campaigns</h3>\n <h4>Adwords Redirect</h4>\n <p>If provided, make sure that the URL redirects to the same URL as given in the \'link\' attribute.</p>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.adwordsRedirect" droppable />\n </div>\n\n <h4>Custom Labels</h4>\n <p>\n You can use custom labels to subdivide products in your campaign using any values\n of your choosing. For example, you can use custom labels to indicate that products\n are seasonal, on clearance, best sellers, etc. (<a href="https://support.google.com/adwords/answer/6275295" target="_blank">Learn more about how to set up Shopping campaigns.</a>)\n </p>\n <div style="margin-top:10px;">Custom Label 0</div>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.customLabel0" droppable />\n <a href="" class="wpae-field-mapping" ng-click="showCustomLabel0Mappings=true">Data Mapping</a>\n <div style="position: relative">\n <mapping mappings="advancedAttributes.customLabel0Mappings" show="showCustomLabel0Mappings" context="text" tooltip="For example, if you have products tagged \'reduced price\' and \'on sale\' and you want both to be listed as \'clearance\' in your export:<br/><br/>Create two sets of data mappings, with \'Exported Data\' set to \'reduced price\' for one and \'on sale\' for the other. \'Translated To\' for both would be \'clearance\'." />\n </div>\n </div>\n <div style="margin-top:10px;">Custom Label 1</div>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.customLabel1" droppable />\n <a href="" class="wpae-field-mapping" ng-click="showCustomLabel1Mappings=true">Data Mapping</a>\n <div style="position: relative">\n <mapping mappings="advancedAttributes.customLabel1Mappings" show="showCustomLabel1Mappings" context="text" tooltip="For example, if you have products tagged \'reduced price\' and \'on sale\' and you want both to be listed as \'clearance\' in your export:<br/><br/>Create two sets of data mappings, with \'Exported Data\' set to \'reduced price\' for one and \'on sale\' for the other. \'Translated To\' for both would be \'clearance\'." />\n </div>\n </div>\n <div style="margin-top:10px;">Custom Label 2</div>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.customLabel2" droppable />\n <a href="" class="wpae-field-mapping" ng-click="showCustomLabel2Mappings=true">Data Mapping</a>\n <div style="position: relative">\n <mapping mappings="advancedAttributes.customLabel2Mappings" show="showCustomLabel2Mappings" context="text" tooltip="For example, if you have products tagged \'reduced price\' and \'on sale\' and you want both to be listed as \'clearance\' in your export:<br/><br/>Create two sets of data mappings, with \'Exported Data\' set to \'reduced price\' for one and \'on sale\' for the other. \'Translated To\' for both would be \'clearance\'." />\n </div>\n </div>\n <div style="margin-top:10px;">Custom Label 3</div>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.customLabel3" droppable />\n <a href="" class="wpae-field-mapping" ng-click="showCustomLabel3Mappings=true">Data Mapping</a>\n <div style="position: relative">\n <mapping mappings="advancedAttributes.customLabel3Mappings" show="showCustomLabel3Mappings" context="text" tooltip="For example, if you have products tagged \'reduced price\' and \'on sale\' and you want both to be listed as \'clearance\' in your export:<br/><br/>Create two sets of data mappings, with \'Exported Data\' set to \'reduced price\' for one and \'on sale\' for the other. \'Translated To\' for both would be \'clearance\'." />\n </div>\n </div>\n <div style="margin-top:10px;">Custom Label 4</div>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.customLabel4" droppable />\n <a href="" class="wpae-field-mapping" ng-click="showCustomLabel4Mappings=true">Data Mapping</a>\n <div style="position: relative">\n <mapping mappings="advancedAttributes.customLabel4Mappings" show="showCustomLabel4Mappings" context="text" tooltip="For example, if you have products tagged \'reduced price\' and \'on sale\' and you want both to be listed as \'clearance\' in your export:<br/><br/>Create two sets of data mappings, with \'Exported Data\' set to \'reduced price\' for one and \'on sale\' for the other. \'Translated To\' for both would be \'clearance\'." />\n </div>\n </div>\n\n <hr/>\n\n <h3 class="inner-title">Unit Prices</h3>\n <p>\n These attributes allow you to submit pricing for products that rely on unit pricing.\n The \'unit pricing measure\' attribute defines the measure and dimension of an item (e.g. 150g).\n The \'unit pricing base measure attribute specifies your preference of the denominator of the unit price (e.g. 100g).\n </p>\n <p>\n For example, if the \'price\' is 3 USD, \'unit pricing measure\' is 150g and \'unit pricing base measure\' is 100g, the unit price would be \'2 USD/200g\'.\n </p>\n\n <h4>Unit Pricing Measure</h4>\n <div class="input">\n <input type="text" ng-model="advancedAttributes.unitPricingMeasure" class="wpae-default-input" droppable />\n </div>\n <h4>Unit Pricing Base Measure</h4>\n <div class="input">\n <input type="text" ng-model="advancedAttributes.unitPricingBaseMeasure" class="wpae-default-input" droppable />\n <select style="width: 170px;" ng-model="advancedAttributes.unitPricingBaseMeasureUnit">\n <option value="kg">Kilograms (kg)</option>\n <option value="oz">Ounces (oz)</option>\n <option value="lb">Pounds (lb)</option>\n <option value="mg">Milligrams (mg)</option>\n <option value="g">Grams (g)</option>\n <option value="floz">Fluid Ounces (floz)</option>\n <option value="pt">Pints (pt)</option>\n <option value="qt">Quarts (qt)</option>\n <option value="gal">Gallons (gal)</option>\n <option value="ml">Milliliters (ml)</option>\n <option value="cl">Centiliters (cl)</option>\n <option value="l">Liters (l)</option>\n <option value="cbm">Cubic Meters (cbm)</option>\n <option value="in">Inches (in)</option>\n <option value="ft">Feet (ft)</option>\n <option value="yd">Yards (yd)</option>\n <option value="cm">Centimeters (cm)</option>\n <option value="m">Meters (m)</option>\n <option value="sqft">Square Feet (sqft)</option>\n <option value="sqm">Square Meters (sqm)</option>\n <option value="ct">Per Unit Count (ct)</option>\n </select>\n </div>\n <hr/>\n <h3 class="inner-title">Additional Attributes</h3>\n <h4>Expiration Date</h4>\n <p>\n This is the date that an item listing will expire. If you do not provide this attribute, items\n will expire and no longer appear in Google Shopping results after 30 days.\n <strong>You cannot use thi attribute to extend the expiration period to longer than 30 days.</strong>\n </p>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.expirationDate" droppable />\n </div>\n\n <h4>Energy Efficiency Class</h4>\n <p>\n This attribute allows you to submit the energy label for your applicable products in feeds targeting\n European Union countries and switzerland.\n </p>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.energyEfficiencyClass" droppable />\n <a href="" class="wpae-field-mapping" ng-click="showEnergyEfficiencyMappings=true">Data Mapping</a>\n <div style="position: relative">\n <mapping mappings="advancedAttributes.energyEfficiencyClassMappings" show="showEnergyEfficiencyMappings" tooltip="For example, if you have products tagged \'energy efficient\' and \'low power\' and you want both to be listed as \'A+++\' in your export:\n<br/><br/>\nCreate two sets of data mappings, with \'Exported Data\' set to \'energy efficient\' for one and \'low power\' for the other. \'Translated To\' for both would be \'A+++\'." />\n </div>\n </div>\n <h4>Promotion ID</h4>\n <p>\n If using Merchant Promotions, the \'promotion id\' attribute is used in both your products\n feed and your promotions feed to match products to promotions across the two feeds.\n </p>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="advancedAttributes.promotionId" droppable />\n <a href="" class="wpae-field-mapping" ng-click="showPromotionIdMappings=true">Data Mapping</a>\n <div style="position: relative">\n <mapping mappings="advancedAttributes.promotionIdMappings" show="showPromotionIdMappings" tooltip="For example, if your products are tagged \'reduced price\' and \'on sale\' and you want both to be listed with a specific promotion ID in your export:\n<br/><br/>\n'+"Create two sets of data mappings, with 'Exported Data' set to 'reduced price' for one and 'on sale' for the other. 'Translated To' for both would be the desired promotion ID.\" />\n </div>\n </div>\n\n </div>\n </div>\n </div>\n</div>")}]),angular.module("availabilityPrice/availabilityPrice.tpl.html",[]).run(["$templateCache",function(a){
9
+ a.put("availabilityPrice/availabilityPrice.tpl.html",'<div class="wpallexport-collapsed wpallexport-section" ng-class="{closed: !availabilityPrice.open}">\n <div class="wpallexport-content-section">\n <div class="wpallexport-collapsed-header disable-jquery" ng-click="availabilityPrice.open = !availabilityPrice.open">\n <h3>Availability &amp; Price</h3>\n </div>\n <div class="wpallexport-collapsed-content" id="availability-price" ng-slide-down="availabilityPrice.open" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n <h4>Price</h4>\n <div class="input">\n <label><input type="radio" ng-model="availabilityPrice.price" value="useProductPrice" /> Use the product\'s price</label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="availabilityPrice.price" value="customValue" /> Custom data</label>\n\n <div class="input inner" ng-slide-down="availabilityPrice.price == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="availabilityPrice.priceCV" droppable />\n </div>\n </div>\n\n <div class="input inner">\n <a href="" ng-click="availabilityPrice.adjustPrice = !availabilityPrice.adjustPrice" class="adjust-price-link">\n <span class="open-indicator" ng-if="availabilityPrice.adjustPrice">-</span>\n <span class="open-indicator" ng-if="!availabilityPrice.adjustPrice">+</span> Adjust Price\n </a>\n <div ng-slide-down="availabilityPrice.adjustPrice" class="adjust-price" duration="0.2">\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="availabilityPrice.adjustPriceValue" droppable /><select ng-model="availabilityPrice.adjustPriceType">\n <option value="%">%</option>\n <option value="USD">{{currency}}</option>\n </select>\n\n <div ng-show="availabilityPrice.adjustPriceType == \'%\'" class="tooltip-container">\n <a href="#" ng-cloak="" class="wpallexport-help"\n tipsy="Leave blank or enter in 100% to keep the price as is. Enter in 110% to markup by 10%. Enter in 50% to cut prices in half.">?</a>\n </div>\n <div ng-show="availabilityPrice.adjustPriceType == \'USD\'" class="tooltip-container">\n <a href="#" ng-cloak="" class="wpallexport-help"\n tipsy="Enter a negative number to reduce prices.">?</a>\n </div>\n </div>\n </div>\n </div>\n <h4>Sale Price</h4>\n <div class="input">\n <label><input type="radio" ng-model="availabilityPrice.salePrice" value="useProductSalePrice"/>Use the product\'s sale price</label>\n </div>\n <div class="input">\n <div class="input">\n <label><input type="radio" ng-model="availabilityPrice.salePrice" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="availabilityPrice.salePrice == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="availabilityPrice.salePriceCV" droppable/>\n </div>\n </div>\n </div>\n <div class="input inner">\n <a href="" ng-click="availabilityPrice.adjustSalePrice = !availabilityPrice.adjustSalePrice" ng-init="availabilityPrice.adjustSalePrice= false" class="adjust-price-link">\n <span class="open-indicator" ng-if="availabilityPrice.adjustSalePrice">-</span>\n <span class="open-indicator" ng-if="!availabilityPrice.adjustSalePrice">+</span> Adjust Sale Price\n </a>\n <div ng-slide-down="availabilityPrice.adjustSalePrice" class="adjust-price" duration="0.2">\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="availabilityPrice.adjustSalePriceValue" droppable /><select ng-model="availabilityPrice.adjustSalePriceType">\n <option value="%">%</option>\n <option value="USD">{{currency}}</option>\n </select>\n <div ng-show="availabilityPrice.adjustSalePriceType == \'%\'" class="tooltip-container">\n <a href="#" ng-cloak="" class="wpallexport-help"\n tipsy="Leave blank or enter in 100% to keep the price as is. Enter in 110% to markup by 10%. Enter in 50% to cut prices in half.">?</a>\n </div>\n <div ng-show="availabilityPrice.adjustSalePriceType == \'USD\'" class="tooltip-container">\n <a href="#" ng-cloak="" class="wpallexport-help"\n tipsy="Enter a negative number to reduce prices.">?</a>\n </div>\n </div>\n </div>\n </div>\n <h4>Availability</h4>\n <div class="input">\n <label><input type="radio" ng-model="availabilityPrice.availability" value="useWooCommerceStockValues"/>Use WooCommerce stock values</label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="availabilityPrice.availability" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="availabilityPrice.availability == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="availabilityPrice.availabilityCV" droppable />\n </div>\n </div>\n </div>\n <div class="wpallexport-collapsed wpallexport-section wpallexport-google-merchants-advanced-options" ng-init="advancedOptionsOpen = false" ng-class="{closed: !advancedOptionsOpen} ">\n <div class="wpallexport-content-section rad0">\n <div class="wpallexport-collapsed-header wpallexport-advanced-options-header disable-jquery" ng-click="advancedOptionsOpen = !advancedOptionsOpen">\n <h3 class="advanced-options">Advanced Options</h3>\n </div>\n <div class="wpallexport-collapsed-content wpallexport-advanced-options-content" ng-slide-down="advancedOptionsOpen" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n <div class="input">\n <h4>Currency</h4>\n <div class="input">\n <div class="select-container" style="padding-left: 0px;">\n <select class="custom-value" chosen ng-model="availabilityPrice.currency">\n <option value="AUD">Australian Dollars (AUD)</option>\n <option value="BRL">Brazilian Reals (BRL)</option>\n <option value="GBP">British Pounds (GBP)</option>\n <option value="CAD">Canadian Dollars (CAD)</option>\n <option value="CZK">Czech Crowns (CZK)</option>\n <option value="DKK">Danish Krone (DKK)</option>\n <option value="EUR">Euros (EUR)</option>\n <option value="INR">Indian Rupees (INR)</option>\n <option value="IDR">Indonesian Rupiah (IDR)</option>\n <option value="JPY">Japanese Yen (JPY)</option>\n <option value="MXN">Mexican Pesos (MXN)</option>\n <option value="NZD">New Zealand Dollars (NZD)</option>\n <option value="NOK">Norwegian Krone (NOK)</option>\n <option value="PLN">Polish Złoty (PLN)</option>\n <option value="RUB">Russian Rubles (RUB)</option>\n <option value="SAR">Saudi Arabian Riyal (SAR)</option>\n <option value="SGD">Singapore Dollars (SGD)</option>\n <option value="ZAR">South Africa Rand (ZAR)</option>\n <option value="SEK">Swedish Krona (SEK)</option>\n <option value="CHF">Swiss Franc (CHF)</option>\n <option value="TRY">Turkish Lira (TRY)</option>\n <option value="THB">Thai Baht (THB)</option>\n <option value="UAH">Ukrainian Hryvnia (UAH)</option>\n <option value="USD">United States Dollars (USD)</option>\n </select>\n </div>\n </div>\n <h4>Availability Date</h4>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="availabilityPrice.availabilityDate" droppable />\n </div>\n <h4>Sale Price Effective Date</h4>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="availabilityPrice.salePriceEffectiveDate" droppable />\n </div>\n <h4>Cost Of Goods Sold</h4>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="availabilityPrice.costOfGoodsSold" droppable />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n')}]),angular.module("basicInformation/basicInformation.tpl.html",[]).run(["$templateCache",function(a){a.put("basicInformation/basicInformation.tpl.html",'<div class="wpallexport-collapsed wpallexport-section" ng-class="{closed: !basicInformation.open}">\n <div class="wpallexport-content-section">\n <div class="wpallexport-collapsed-header disable-jquery" ng-click="basicInformation.open = !basicInformation.open">\n <h3>Basic Product Information</h3>\n </div>\n <div class="wpallexport-collapsed-content" id="basic-product-information" ng-slide-down="basicInformation.open" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n\n <h4>Item Title <a style="margin-top: 7px;" class="wpallexport-help" tipsy="Google Merchant Center only shows the first 70 characters of titles and crops everything over 150 characters.">?</a></h4>\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.itemTitle" value="productTitle"/>Use the product title</label>\n </div>\n <div class="input">\n <label><input type="radio" id="title-custom-data-select" ng-model="basicInformation.itemTitle" value="customValue" />Custom data</label>\n <div class="input inner" id="title-custom-data-container" ng-slide-down="basicInformation.itemTitle == \'customValue\'" duration="0.2">\n <input type="text" id="title-custom-data-value" class="wpae-default-input" ng-model="basicInformation.itemTitleCV" droppable />\n </div>\n </div>\n\n <div class="input checkbox" ng-if="basicInformation.hasVariations">\n <label><input type="checkbox" ng-model="basicInformation.useParentTitleForVariableProducts" value="1" />For variable products, use the parent product title</label>\n </div>\n\n <h4>Item Description</h4>\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.itemDescription" id="use-product-description" value="productDescription"/>Use the product description</label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.itemDescription" id="use-product-short-description" value="productShortDescription"/>Use the product short description</label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.itemDescription" id="product-description-custom-data" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="basicInformation.itemDescription == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" id="description-custom-data-value" ng-model="basicInformation.itemDescriptionCV" droppable />\n </div>\n </div>\n\n <div class="input checkbox">\n <label><input type="checkbox" ng-model="basicInformation.useVariationDescriptionForVariableProducts" value="1" />Use the variation description for variable products</label>\n </div>\n <div class="input checkbox inner" ng-slide-down="basicInformation.useVariationDescriptionForVariableProducts" duration="0.2">\n <label><input type="checkbox" ng-model="basicInformation.useParentDescirptionIfThereIsNoVariationDescirption" value="1" />If there is no variation description, use the parent product description</label>\n </div>\n\n <h4>Link</h4>\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.itemLink" id="use-product-permalinks" value="productLink"/>Use the product permalink</label>\n </div>\n\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.itemLink" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="basicInformation.itemLink == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="basicInformation.itemLinkCV" droppable />\n </div>\n </div>\n\n <div class="input checkbox">\n <label><input type="checkbox" ng-model="basicInformation.addVariationAttributesToProductUrl" />For variable products, add variation attributes to product URL</label>\n </div>\n\n <h4>Main Image Link</h4>\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.itemImageLink" value="useProductFeaturedImage"/>Use product featured image</label>\n </div>\n\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.itemImageLink" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="basicInformation.itemImageLink == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="basicInformation.itemImageLinkCV" droppable />\n </div>\n </div>\n\n <div class="input checkbox">\n <label><input type="checkbox" ng-model="basicInformation.useVariationImage" />For variable products, use variation image</label>\n </div>\n\n <div class="input checkbox inner" ng-slide-down="basicInformation.useVariationImage" duration="0.2">\n <label><input type="checkbox" ng-model="basicInformation.useFeaturedImageIfThereIsNoVariationImage" value="1" />If there is no variation image, use the featured image</label>\n </div>\n\n <h4>Additional Image Link</h4>\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.additionalImageLink" value="productImages"/>Use images from product gallery</label>\n </div>\n\n <div class="input">\n <label><input type="radio" ng-model="basicInformation.additionalImageLink" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="basicInformation.additionalImageLink == \'customValue\'" duration="0.2">\n <input type="text"class="wpae-default-input" ng-model="basicInformation.additionalImageLinkCV" droppable />\n </div>\n </div>\n </div>\n <div class="wpallexport-collapsed wpallexport-section wpallexport-google-merchants-advanced-options" ng-init="advancedOptionsOpen = false" ng-class="{closed: !advancedOptionsOpen}">\n <div class="wpallexport-content-section rad0">\n <div class="wpallexport-collapsed-header wpallexport-advanced-options-header disable-jquery" ng-click="advancedOptionsOpen = !advancedOptionsOpen">\n <h3>Advanced Options</h3>\n </div>\n <div class="wpallexport-collapsed-content wpallexport-advanced-options-content" ng-slide-down="advancedOptionsOpen" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n <div class="input">\n <h4>Item ID</h4>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="basicInformation.itemId" droppable />\n </div>\n <h4>Item Condition</h4>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="basicInformation.condition" droppable />\n <a href="" class="wpae-field-mapping" ng-click="showConditionMappings=true">Data Mapping</a>\n <mapping mappings="basicInformation.conditionMappings" show="showConditionMappings" context="condition" />\n <a style="margin-top: 7px;" class="wpallexport-help" tipsy="The condition or state of the item. Google Shopping allows the promotion of quality second-hand items. There are only 3 accepted values: \'new\', \'refurbished\', and \'used\'">?</a>\n </div>\n <h4>Mobile Link</h4>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="basicInformation.mobileLink" droppable />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>')}]),angular.module("common/mapping/mapping.tpl.html",[]).run(["$templateCache",function(a){a.put("common/mapping/mapping.tpl.html",'<div class="wp-pointer wp-pointer-right" style="width: 450px; display: block; position: absolute; top: -70px; left: -23px;" ng-if="show">\n <div class="wp-pointer-content">\n <h4 style="padding-left:25px; margin-bottom:0; padding-bottom:0; margin-top:20px;">\n Data Mapping\n <a style="margin-top: 7px;" ng-if="tooltip" class="wpallexport-help"\n tipsy="{{ tooltip }}">?\n </a>\n </h4>\n\n <fieldset style="margin-top: 0; padding-top: 0; padding-bottom: 0;">\n <table cellpadding="0" cellspacing="0" class="cf-form-table" rel="cf_mapping_0" style="margin-left: 5px; margin-top: 15px;">\n <thead>\n <tr>\n <td><div style="padding-bottom:5px">Exported Data</div></td>\n <td><div style="padding-bottom:5px;">Translated To</div></td>\n <td>&nbsp;</td>\n </tr>\n </thead>\n <tbody>\n <tr class="form-field" ng-repeat="mapping in mappings">\n <td style="width: 50%;">\n <input type="text" ng-model="mapping.mapFrom" style="margin-left:0;"/>\n </td>\n <td style="width: 50%;">\n <div ng-if="context == \'sizeType\'">\n <select chosen ng-model="mapping.mapTo" >\n <option value="">Please select</option>\n <option value="regular">Regular</option>\n <option value="petite">Petite</option>\n <option value="plus">Plus</option>\n <option value="big and tall">Big and tall</option>\n <option value="maternity">Maternity</option>\n </select>\n </div>\n <div ng-if="context == \'condition\' ">\n <select chosen ng-model="mapping.mapTo">\n <option value="new">New</option>\n <option value="refurbished">Refurbished</option>\n <option value="used">Used</option>\n </select>\n </div>\n <div ng-if="context != \'sizeType\' && context != \'condition\'">\n <input type="text" ng-model="mapping.mapTo" />\n </div>\n </td>\n <td class="action remove">\n <a href="" ng-click="removeMapping(mapping)" ng-show="$index > 0"\n style="right:-10px;"></a>\n </td>\n </tr>\n <tr>\n <td colspan="3">\n <a href="" ng-click="addMapping()" title="Add Another" class="action add-new-key add-new-entry" style="margin-top: 15px; margin-bottom:15px; margin-left: 0;">\n Add Another\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n <input type="hidden" name="custom_mapping_rules[]" value="">\n </fieldset>\n <div class="wp-pointer-buttons">\n <a class="close" href="" ng-click="close()">Close</a>\n <a class="save_popup save_mr" style="position:static; margin-right: 15px;" href="" ng-click="saveMappings()">Save Rules</a>\n </div>\n </div>\n <div class="wp-pointer-arrow">\n <div class="wp-pointer-arrow-inner"></div>\n </div>\n</div>')}]),angular.module("detailedInformation/detailedInformation.tpl.html",[]).run(["$templateCache",function(a){
10
+ a.put("detailedInformation/detailedInformation.tpl.html",'<div class="wpallexport-collapsed wpallexport-section" ng-class="{closed: !detailedInformation.open }">\n <div class="wpallexport-content-section">\n <div class="wpallexport-collapsed-header disable-jquery" ng-click="detailedInformation.open = !detailedInformation.open ">\n <h3>Detailed Product Attributes &amp; Item Grouping</h3>\n </div>\n <div class="wpallexport-collapsed-content" id="detailed-product-information" ng-slide-down="detailedInformation.open" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n <h4>Item Group ID</h4>\n <p>\n For variable products, each variant is exported as a separate product.\n Variants that belong to the same group must all have the same Item Group ID\n so that Google knows they are related.\n </p>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.setTheGroupId" value="automatically" />Automatically set the item group ID</label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.setTheGroupId" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="detailedInformation.setTheGroupId == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="detailedInformation.setTheGroupIdCV" droppable />\n </div>\n </div>\n <h4>Color</h4>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.color" value="selectFromWooCommerceProductAttributes" />Select from WooCommerce product attributes</label>\n <div ng-slide-down="detailedInformation.color == \'selectFromWooCommerceProductAttributes\'" duration="0.2">\n <div class="select-container" ng-if="attributes.length">\n <select autodetect="Color" chosen ng-options="\'{\' + i.name + \'}\' as i.name for i in attributes" ng-model="detailedInformation.colorAttribute" class="inner">\n <option value="">Leave Blank</option>\n </select>\n </div>\n <div class="no-attributes" ng-if="!attributes.length">\n The products in this export have no product attributes. Add attributes to your products in order to map them to a color.\n </div>\n </div>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.color" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="detailedInformation.color == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="detailedInformation.colorCV" droppable />\n </div>\n </div>\n\n <h4>Size</h4>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.size" value="selectFromWooCommerceProductAttributes" />Select from WooCommerce product attributes</label>\n <div ng-slide-down="detailedInformation.size == \'selectFromWooCommerceProductAttributes\'" duration="0.2">\n <div class="select-container" ng-if="attributes.length">\n <select id="sizeAttribute" autodetect="Size" chosen ng-options="\'{\' + i.name + \'}\' as i.name for i in attributes" ng-model="detailedInformation.sizeAttribute" class="inner">\n <option value="">Leave Blank</option>\n </select>\n </div>\n <div class="no-attributes" ng-if="!attributes.length">\n The products in this export have no product attributes. Add attributes to your products in order to map them to a size.\n </div>\n </div>\n </div>\n <div class="input">\n <label>\n <input type="radio" ng-model="detailedInformation.size" value="customValue" />Custom data\n </label>\n <div class="input inner" ng-slide-down="detailedInformation.size== \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="detailedInformation.sizeCV" droppable />\n </div>\n </div>\n\n <h4>Gender</h4>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.gender" value="selectFromWooCommerceProductAttributes" />Select from WooCommerce product attributes</label>\n <div class="clear"></div>\n <div ng-slide-down="detailedInformation.gender == \'selectFromWooCommerceProductAttributes\'" duration="0.2">\n <div class="select-container" ng-if="attributes.length">\n <select autodetect="Gender" chosen ng-options="\'{\' + i.name + \'}\' as i.name for i in attributes" ng-model="detailedInformation.genderAttribute" class="inner">\n <option value="">Leave Blank</option>\n </select>\n </div>\n <div class="no-attributes" ng-if="!attributes.length">\n The products in this export have no product attributes. Add attributes to your products in order to map them to a gender.\n </div>\n </div>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.gender" value="autodetectBasedOnProductTaxonomies"/>Autodetect based on WooCommerce product categories</label>\n <div ng-slide-down="detailedInformation.gender == \'autodetectBasedOnProductTaxonomies\'" duration="0.2">\n <div class="inner">\n <div class="input">\n <label>\n <input type="radio" ng-model="detailedInformation.genderAutodetect" value="keepBlank"/>Leave gender blank if unable to detect gender\n </label>\n </div>\n <div class="input">\n <label>\n <input type="radio" ng-model="detailedInformation.genderAutodetect" value="setToUnisex" />Set gender to unisex if unable to detect gender\n </label>\n </div>\n </div>\n </div>\n </div>\n <div class="input">\n <label>\n <input type="radio" ng-model="detailedInformation.gender" value="selectProductTaxonomies" />Select from WooCommerce product categories\n </label>\n <div ng-slide-down="detailedInformation.gender == \'selectProductTaxonomies\'" duration="0.2">\n <category-mapper mappings="detailedInformation.genderCats" context="gender" />\n </div>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.gender" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="detailedInformation.gender == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="detailedInformation.genderCV" droppable />\n </div>\n </div>\n </div>\n\n <div class="wpallexport-collapsed wpallexport-section wpallexport-google-merchants-advanced-options" ng-class="{closed: !advancedOptionsOpen}">\n <div class="wpallexport-content-section rad0">\n <div class="wpallexport-collapsed-header wpallexport-advanced-options-header disable-jquery" ng-click="advancedOptionsOpen = !advancedOptionsOpen">\n <h3>Advanced Options</h3>\n </div>\n <div class="wpallexport-collapsed-content wpallexport-advanced-options-content" ng-slide-down="advancedOptionsOpen" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n <h4>Size Type</h4>\n <div class="input">\n <div style="display: inline-block;">\n <input type="text" class="wpae-default-input" ng-model="detailedInformation.sizeType" droppable />\n </div>\n <a href="" class="wpae-field-mapping" ng-click="showMappings=true">Data Mapping</a>\n <div style="position: relative">\n <mapping mappings="detailedInformation.sizeTypeMappings" show="showMappings" context="sizeType" />\n </div>\n </div>\n <h4>Size System</h4>\n <div class="input">\n <div class="select-container" style="padding-left: 0;">\n <select chosen ng-model="detailedInformation.sizeSystem" class="inner">\n <option value="">Leave Blank</option>\n <option value="US">US</option>\n <option value="UK">UK</option>\n <option value="EU">EU</option>\n <option value="DE">DE</option>\n <option value="FR">FR</option>\n <option value="JP">JP</option>\n <option value="CN">CN (China)</option>\n <option value="IT">IT</option>\n <option value="BR">BR</option>\n <option value="MEX">MEX</option>\n <option value="AU">AU</option>\n </select>\n </div>\n </div>\n <h4>Age Group</h4>\n <div class="input">\n <label>\n <input type="radio" ng-model="detailedInformation.ageGroup" value="selectFromWooCommerceProductAttributes"/>Select from WooCommerce product attributes\n </label>\n <div ng-slide-down="detailedInformation.ageGroup == \'selectFromWooCommerceProductAttributes\'" duration="0.2">\n <div class="select-container" ng-if="attributes.length">\n <select chosen ng-options="\'{\' + i.name + \'}\' as i.name for i in attributes" ng-model="detailedInformation.ageGroupAttribute" class="inner">\n <option value="">Leave Blank</option>\n </select>\n </div>\n <div class="no-attributes" ng-if="!attributes.length">\n The products in this export have no product attributes. Add attributes to your products in order to map them to an age group.\n </div>\n </div>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.ageGroup" value="selectFromProductTaxonomies" />Select from WooCommerce product categories</label>\n <div ng-slide-down="detailedInformation.ageGroup == \'selectFromProductTaxonomies\' " duration="0.5" >\n <div ng-show="detailedInformation.ageGroup == \'selectFromProductTaxonomies\' ">\n <category-mapper mappings="detailedInformation.ageGroupCats" grey="1" context="ageGroup" />\n </div>\n </div>\n </div>\n <div class="input">\n <label>\n <input type="radio" ng-model="detailedInformation.ageGroup" value="customValue" />Custom data\n </label>\n <div class="input inner" ng-slide-down="detailedInformation.ageGroup== \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="detailedInformation.ageGroupCV" droppable />\n </div>\n </div>\n <h4>Material</h4>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.material" value="selectFromWooCommerceProductAttributes" />Select from WooCommerce product attributes</label>\n <div ng-slide-down="detailedInformation.material == \'selectFromWooCommerceProductAttributes\'" duration="0.2">\n <div class="select-container" ng-if="attributes.length">\n <select chosen ng-options="\'{\' + i.name + \'}\' as i.name for i in attributes" ng-model="detailedInformation.materialAttribute" class="inner">\n <option value="">Leave Blank</option>\n </select>\n </div>\n <div class="no-attributes outer" ng-if="!attributes.length">\n The products in this export have no product attributes. Add attributes to your products in order to map them to a material.\n </div>\n </div>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.material" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="detailedInformation.material == \'customValue\'" duration="0.2">\n <div class="input inner" ng-slide-down="detailedInformation.material == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="detailedInformation.materialCV" droppable />\n </div>\n </div>\n\n <h4>Pattern</h4>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.pattern" value="selectFromWooCommerceProductAttributes" />Select from WooCommerce product attributes</label>\n <div ng-slide-down="detailedInformation.pattern == \'selectFromWooCommerceProductAttributes\'" duration="0.2">\n <div class="select-container" ng-if="attributes.length">\n <select chosen ng-options="\'{\' + i.name + \'}\' as i.name for i in attributes" ng-model="detailedInformation.patternAttribute" class="inner">\n <option value="">Leave Blank</option>\n </select>\n </div>\n <div class="no-attributes outer" ng-if="!attributes.length">\n The products in this export have no product attributes. Add attributes to your products in order to map them to a pattern.\n </div>\n </div>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="detailedInformation.pattern" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="detailedInformation.pattern == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="detailedInformation.patternCV" droppable />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>')}]),angular.module("productCategories/categoryMapper/categoryMapper.tpl.html",[]).run(["$templateCache",function(a){a.put("productCategories/categoryMapper/categoryMapper.tpl.html",'<div class="category-mapper">\n <div>\n <div class="woocommerce-categories-title" style="float:left; padding: 13px 13px 13px 31px;">\n <h4 style="margin: 0; padding: 0; font-size:13px; color:#000;">WooCommerce Categories</h4>\n </div>\n\n <div class="google-categories-title" style="float:right; padding:13px; margin-right: 278px;" ng-if="::(context==\'categories\')">\n <h4 style="margin:0; padding:0; font-size:13px; color:#000; ">Google Categories</h4>\n </div>\n\n <div class="google-categories-title" style="float:right; padding:13px; margin-right: 288px;" ng-if="::(context==\'gender\')">\n <h4 style="margin:0; padding:0; font-size:13px; color:#000; ">Google Genders</h4>\n </div>\n\n <div class="google-categories-title" style="float:right; padding:13px; margin-right: 268px;" ng-if="::(context==\'ageGroup\')">\n <h4 style="margin:0; padding:0; font-size:13px; color:#000; ">Google Age Groups</h4>\n </div>\n </div>\n\n <ul dx-start-with="innerMapping" class="tree" ng-class="::{ \'root\' : $dxLevel == 0 }" ng-init="initialize()" style="width: 100%; float:left; margin-top: 0px;" ng-if="innerMapping">\n <li ng-repeat="node in $dxPrior.children | limitTo: limits" style="display: block;">\n <div class="category-container" style="position: relative;" ng-class="::{ \'with-children\' : node.children.length, \'without-children\' : (!node.children.length) }">\n <div class="hline"></div>\n <div class="category-icon-container" style="float:left;">\n <div class="vline" ng-if="::(($index > 0 && $dxLevel == 0) || $dxLevel > 0)"></div>\n <div class="vline noborder" ng-if="::(!(($index > 0 && $dxLevel == 0) || $dxLevel > 0))"></div>\n <span ng-if="node.expanded" class="minus" ng-click="expandNode(node)">\n <svg width="9" height="9" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">\n <path d="M1600 736v192q0 40-28 68t-68 28h-1216q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h1216q40 0 68 28t28 68z"/>\n </svg>\n </span>\n <span ng-if="!node.expanded && node.children.length" class="plus" ng-click="expandNode(node)">\n <svg width="9" height="9" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">\n <path d="M1600 736v192q0 40-28 68t-68 28h-416v416q0 40-28 68t-68 28h-192q-40 0-68-28t-28-68v-416h-416q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h416v-416q0-40 28-68t68-28h192q40 0 68 28t28 68v416h416q40 0 68 28t28 68z"/>\n </svg>\n </span>\n <span ng-if="::(!node.children.length)" class="plus blank" style="cursor: default;"></span>\n <div class="vline bottom"></div>\n </div>\n <div class="category-name-container">\n <span class="dot" ng-repeat="i in ::getTimes($dxLevel) track by $index"></span>\n <div class="category">\n <a class="category-title" href="" ng-click="expandNode(node)" ng-bind-html="::node.title | safe"></a>\n <br ng-if="::node.children.length"/>\n <span ng-if="::node.children.length" class="children-number">\n {{ ::node.children.length }} child <span ng-if="::node.children.length == 1">category</span><span ng-if="::node.children.length > 1">categories</span>\n </span>\n </div>\n </div>\n <div class="line" ></div>\n <div class="mapping" ng-if="::(context == \'categories\')" >\n <div style="position: relative" ng-init="visible=false">\n <input type="text" style="width: 402px; font-size:13px; padding-left: 8px;" placeholder="{{ getPlaceholder() }}"\n ng-class="{ \'selected-automatically\' : !mappings[node.id].byUser, \'opened\' : visible }"\n ng-model="selectedCategory"\n ng-value="mappings[node.id].name"\n ng-change="categoryChanged()"\n ng-click="categoryClicked()"\n class="wpae-google-category-input"\n ng-model-options="{ debounce: 200 }"\n />\n <google-category-selector />\n </div>\n </div>\n <div class="mapping gender" ng-if="::(context == \'gender\')" style="border: none;">\n <select chosen cascade ng-model="mappings[node.id]" ng-change="select()">\n <option value="male">Male</option>\n <option value="female">Female</option>\n <option value="unisex">Unisex</option>\n </select>\n </div>\n <div class="mapping" ng-if="::(context == \'ageGroup\')" style="border: none; background-color: #F1F1F1; padding:0; margin-top: 5px;" >\n <select chosen cascade ng-model="mappings[node.id]" ng-change="select()">\n <option value="newborn">Newborn</option>\n <option value="infant">Infant</option>\n <option value="toddler">Toddler</option>\n <option value="kids">Kids</option>\n <option value="adult">Adult</option>\n </select>\n </div>\n <div style="clear:both;"></div>\n </div>\n <ul dx-connect="node" ng-if="node.expanded==true"/>\n </li>\n </ul>\n <div class=\'catList\' style="clear:both;"></div>\n <div class="mask" ng-class="::{ grey : grey == 1}"></div>\n</div>\n<div ng-if="initialized && !innerMapping.children.length">\n <div ng-include="\'productCategories/categoryMapper/noCategoriesNotice.tpl.html\'"></div>\n</div>')}]),angular.module("productCategories/categoryMapper/noCategoriesNotice.tpl.html",[]).run(["$templateCache",function(a){a.put("productCategories/categoryMapper/noCategoriesNotice.tpl.html",'<div class="no-categories-notice" ng-if="context == \'categories\' ">\n The products in this export are uncategorized. Add WooCommerce Product Categories to your products in order to map them to Google Product Categories.\n</div>\n\n<div class="no-categories-notice" ng-if="context == \'gender\' ">\n The products in this export are uncategorized. Add WooCommerce Product Categories to your products in order to map them to a gender.\n</div>\n\n<div class="no-categories-notice" ng-if="context == \'ageGroup\' ">\n The products in this export are uncategorized. Add WooCommerce Product Categories to your products in order to map them to an age group.\n</div>\n')}]),angular.module("productCategories/googleCategorySelector/googleCategorySelector.tpl.html",[]).run(["$templateCache",function(a){a.put("productCategories/googleCategorySelector/googleCategorySelector.tpl.html",'<div class="google-category-selector" ng-init="loadCategories()" ng-if="visible" click-outside="closeMe()" outside-if-not="wpae-google-category-input">\n <ul class="categories" dx-start-with="categories">\n <li ng-repeat="category in $dxPrior.children" style="position: relative;">\n <div class="div-content">\n <div class="expand-button" ng-click="expand(category); $event.preventDefault();">\n <div ng-if="category.hasChildren > 0" class="chevron">\n <svg ng-if="!category.opened" width="10" height="10" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">\n <path d="M1683 1331l-166 165q-19 19-45 19t-45-19l-531-531-531 531q-19 19-45 19t-45-19l-166-165q-19-19-19-45.5t19-45.5l742-741q19-19 45-19t45 19l742 741q19 19 19 45.5t-19 45.5z"/>\n </svg>\n <svg ng-if="category.opened" width="10" height="10" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">\n <path d="M1683 808l-742 741q-19 19-45 19t-45-19l-742-741q-19-19-19-45.5t19-45.5l166-165q19-19 45-19t45 19l531 531 531-531q19-19 45-19t45 19l166 165q19 19 19 45.5t-19 45.5z"/>\n </svg>\n </div>\n </div>\n <div ng-bind-html="category.name | safe" ng-click="select(category)" class="google-category-name-container">\n </div>\n <div class="clear"></div>\n </div>\n <ul dx-connect="category" class="categories inner-categories" ng-if="category.opened" />\n </li>\n </ul>\n <div ng-if="!categories.children.length" class="google-no-results-found">\n No results found\n </div>\n</div>')}]),angular.module("productCategories/productCategories.tpl.html",[]).run(["$templateCache",function(a){a.put("productCategories/productCategories.tpl.html",'<div class="wpallexport-collapsed wpallexport-section" ng-class="{closed: !productCategories.open}">\n <div class="wpallexport-content-section">\n <div class="wpallexport-collapsed-header disable-jquery" ng-click="productCategories.open = !productCategories.open">\n <h3>Product Categories</h3>\n </div>\n <div class="wpallexport-collapsed-content" ng-slide-down="productCategories.open" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n <h4>Product Type</h4>\n <p>Use this attribute to classify the product using your own categories. The categories here don\'t need to match Google\'s list of acceptable product categories.</p>\n <div class="input">\n <label>\n <input type="radio" ng-model="productCategories.productType" value="useWooCommerceProductCategories" />Use WooCommerce\'s product category\n </label>\n </div>\n <div class="input">\n <label>\n <input type="radio" ng-model="productCategories.productType" value="customValue" />Custom data\n </label>\n <div class="input inner" ng-slide-down="productCategories.productType == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="productCategories.productTypeCV" droppable />\n </div>\n </div>\n <h4>Product Category</h4>\n <p>\n Products added to Google Merchant Center must be categorized according to Google\'s list of product categories. Each product may only be assigned one Google product category. <a href="https://support.google.com/merchants/answer/160081" target="_blank">Read more about Google product categories.</a>\n </p>\n <div class="input">\n <label>\n <input type="radio" ng-model="productCategories.productCategories" value="mapProductCategories" />Map WooCommerce\'s product categories to Google\'s product categories\n <a href="#" class="wpallexport-help" style="margin-top:5px; margin-left: 2px;"\n tipsy="Products assigned more than one WooCommerce product category and mapped to more than one Google product category will be mapped to the most specific, deepest Google product category selected for that product.">?</a>\n </label>\n </div>\n <div ng-slide-down="productCategories.productCategories == \'mapProductCategories\'" duration="0.5">\n <category-mapper mappings="productCategories.catMappings" />\n </div>\n\n <div class="input">\n <label>\n <input type="radio" ng-model="productCategories.productCategories" value="useWooCommerceProductCategories" />Use WooCommerce\'s product categories\n <a href="#" class="wpallexport-help" style="margin-top:5px; margin-left: 2px;"\n tipsy="Products assigned to more than one WooCommerce product category will only have the most specific, deepest product category exported.">?</a>\n </label>\n <p class="no-categories-notice" ng-slide-down="productCategories.productCategories == \'useWooCommerceProductCategories\'" duration="0.2">\n If your WooCommerce product categories do not exactly match Google\'s, your feed will fail when uploaded to Google.\n </p>\n <div ng-slide-down="!$root.cats.children.length && productCategories.productCategories == \'useWooCommerceProductCategories\'" duration="0.2">\n <div ng-include="\'productCategories/categoryMapper/noCategoriesNotice.tpl.html\'" ng-init="context = \'categories\' "></div>\n </div>\n </div>\n\n <div class="input">\n <label>\n <input type="radio" ng-model="productCategories.productCategories" value="customValue" />Custom data\n </label>\n <div class="input inner" ng-slide-down="productCategories.productCategories == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="productCategories.productCategoriesCV" droppable />\n </div>\n </div>\n </div>\n\n </div>\n </div>\n</div>')}]),angular.module("shipping/shipping.tpl.html",[]).run(["$templateCache",function(a){
11
+ a.put("shipping/shipping.tpl.html",'<div class="wpallexport-collapsed wpallexport-section" ng-class="{closed: !shipping.open }">\n <div class="wpallexport-content-section">\n <div class="wpallexport-collapsed-header disable-jquery"\n ng-click="shipping.open = !shipping.open ">\n <h3>Shipping</h3>\n </div>\n <div class="wpallexport-collapsed-content" id="shipping" ng-slide-down="shipping.open" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n <h4>Shipping Price</h4>\n <p>\n This attribute allows Google to provide a shipping estimate for the product.\n This overrides the default shipping price configured in the Google Merchant Center.\n </p>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="shipping.shippingPrice" droppable />\n <a href="" ng-click="shipping.adjustShippingPrice = !shipping.adjustShippingPrice" class="adjust-price-link">\n <span ng-if="!shipping.adjustShippingPrice" style="width: 6px; display: inline-block;">+</span>\n <span ng-if="shipping.adjustShippingPrice" style="width: 6px; display: inline-block;">-</span>\n Adjust Shipping Price</a>\n <input type="hidden" ng-model="shipping.shippingHeight"/>\n <input type="hidden" ng-model="shipping.shippingLength"/>\n <input type="hidden" ng-model="shipping.shippingWidth"/>\n <div ng-slide-down="shipping.adjustShippingPrice" class="adjust-price" duration="0.2" style="margin-top: 5px; ">\n <input type="text" style="margin-top: 0; margin-right: 0;" class="wpae-default-input" ng-model="shipping.adjustShippingPriceValue" droppable /><select style="margin-top:5px;" ng-model="shipping.adjustPriceType">\n <option value="%">%</option>\n <option value="USD">{{currency}}</option>\n </select>\n\n <div ng-show="shipping.adjustPriceType == \'%\'" class="tooltip-container">\n <a href="#" ng-cloak="" class="wpallexport-help" style="top:0;"\n tipsy="Leave blank or enter in 100% to keep the price as is. Enter in 110% to markup by 10%. Enter in 50% to cut prices in half.">?</a>\n </div>\n <div ng-show="shipping.adjustPriceType == \'USD\'" class="tooltip-container">\n <a href="#" style="top:0;" ng-cloak="" class="wpallexport-help" tipsy="Enter a negative number to reduce prices.">?</a>\n </div>\n </div>\n </div>\n\n <h4>Length, Width, Height</h4>\n <div class="input">\n <label>\n <input type="radio" ng-model="shipping.dimensions" value="useWooCommerceProductValues"/>Use WooCommerce\'s product values and convert them to\n <select ng-model="shipping.convertTo" style="width: 175px; height: 30px; padding: 0 0 0 8px; margin-left: 5px; margin-top: 5px; ">\n <option value="cm">Centimeters (cm)</option>\n <option value="in">Inches (in)</option>\n </select>\n </label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="shipping.dimensions" value="customValue"/>Custom data</label>\n <div ng-slide-down="shipping.dimensions == \'customValue\'" duration="0.2" class="input inner">\n <input type="text" class="wpae-default-input" ng-model="shipping.dimensionsCV" droppable />\n </div>\n </div>\n\n <h4>Shipping Weight</h4>\n <div class="input">\n <label>\n <input type="radio" ng-model="shipping.weight" value=""/>Do not include in the feed\n </label>\n </div>\n <div class="input">\n <label>\n <input type="radio" ng-model="shipping.weight" value="useWooCommerceProductValues"/>Use WooCommerce\'s product values\n </label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="shipping.weight" value="customValue"/>Custom data</label>\n <div ng-slide-down="shipping.weight == \'customValue\'" duration="0.2" class="input inner">\n <input type="text" class="wpae-default-input" ng-model="shipping.weightCV" droppable />\n </div>\n </div>\n\n <h4>Shipping Label</h4>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="shipping.shippingLabel" droppable />\n </div>\n </div>\n </div>\n </div>\n</div>')}]),angular.module("uniqueIdentifiers/uniqueIdentifiers.tpl.html",[]).run(["$templateCache",function(a){a.put("uniqueIdentifiers/uniqueIdentifiers.tpl.html",'<div class="wpallexport-collapsed wpallexport-section" ng-class="{closed: !uniqueIdentifiers.open}">\n <div class="wpallexport-content-section">\n <div class="wpallexport-collapsed-header disable-jquery" ng-click="uniqueIdentifiers.open = !uniqueIdentifiers.open">\n <h3>Unique Identifiers</h3>\n </div>\n <div class="wpallexport-collapsed-content slide-toggle" id="unique-identifiers" ng-slide-down="uniqueIdentifiers.open" duration="0.5">\n <div class="wpallexport-collapsed-content-inner">\n <p>\n Unique product identifiers are product codes associated with your products.\n Products submitted without unique identifiers are difficult to classify and may not be able to take advantage of all Google shopping features.\n <a href="https://support.google.com/merchants/answer/7052112?hl=en&ref_topic=3404778#intro-product-identifiers" target="_blank">Read more about unique product identifiers</a>.\n </p>\n <h4>GTIN</h4>\n <p>\n Global Trade Item Numbers include UPC, EAN (in Europe), JAN (in Japan), and ISBN. <a href="https://support.google.com/merchants/answer/6219078" target="_blank">Read how to find your products\' GTIN</a>.\n </p>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="uniqueIdentifiers.gtin" droppable />\n </div>\n\n <h4>MPN</h4>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="uniqueIdentifiers.mpn" droppable />\n </div>\n\n <h4>Brand</h4>\n <div class="input">\n <input type="text" class="wpae-default-input" ng-model="uniqueIdentifiers.brand" droppable />\n </div>\n\n <h4>Identifier Exists</h4>\n <div class="input">\n <label><input type="radio" ng-model="uniqueIdentifiers.identifierExists" value="1" />Set to false if product has no GTIN or MPN\n <a style="margin-top: 0; margin-bottom: 0; margin-left: 0; padding-bottom: 0;" class="wpallexport-help" tipsy="If your product has neither an MPN or GTIN, Google requires the attribute \'identifier_exists\' to be set to false. WP All Export will do this automatically if this option is enabled.">?</a>\n </label>\n </div>\n <div class="input">\n <label><input type="radio" ng-model="uniqueIdentifiers.identifierExists" value="customValue" />Custom data</label>\n <div class="input inner" ng-slide-down="uniqueIdentifiers.identifierExists == \'customValue\'" duration="0.2">\n <input type="text" class="wpae-default-input" ng-model="uniqueIdentifiers.identifierExistsCV" droppable />\n </div>\n </div>\n\n </div>\n </div>\n </div>\n</div>')}]);
dist/styles.css CHANGED
@@ -17,3 +17,7 @@
17
  .slide-toggle{transition:0.6s ease-in-out;-webkit-transition:0.6s ease-in-out}#googleMerchants .adjust-price input{border-radius:5px 0 0 5px !important;border-right:none}#googleMerchants .adjust-price select{margin-left:0;width:50px;border-radius:0 5px 5px 0 !important;background-position:right 5px top 9px}#googleMerchants .adjust-price .tooltip-container{margin-top:5px}#googleMerchants .adjust-price-link{display:block;margin-top:5px}#googleMerchants div.input label{color:#000}#googleMerchants p{margin-top:0}#googleMerchants select{width:400px;margin:10px 0 10px 0;-webkit-appearance:none;height:40px;border:1px solid #ddd;border-radius:4px;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;color:#777;font-size:15px;position:relative;padding-left:9px;cursor:pointer;top:0;background-image:url(../static/img/ddown.png);background-repeat:no-repeat;background-position:right 9px top 5px}#googleMerchants select:focus{outline:none}#googleMerchants select.inner{margin-left:26px}#googleMerchants .pointer{cursor:pointer}#googleMerchants .wpallexport-collapsed-content{display:block;padding:0}#googleMerchants .wpallexport-collapsed-content-inner{padding-top:5px}#googleMerchants .wpallexport-section{display:block}#googleMerchants .wpallexport-content-section{padding-bottom:0;margin-bottom:10px}#googleMerchants .wpallexport-help{position:relative;top:-2px}#googleMerchants .wpallexport-collapsed-header:not(.wpallexport-advanced-options-header){margin-bottom:15px;padding-left:24px}#googleMerchants .advanced-options{color:#40acad}#googleMerchants div.inner{margin-left:23px;margin-top:5px;margin-bottom:5px}#googleMerchants .input.inner{margin-left:26px;margin-top:5px}#googleMerchants .input.checkbox.inner{margin-left:26px;margin-top:10px}#googleMerchants .wpallexport-google-merchants-advanced-options .wpallexport-advanced-options-header h3{color:#40acad}#googleMerchants .wpallexport-google-merchants-advanced-options .wpallexport-content-section{border-top:1px solid #ddd;border-right-style:none;border-bottom-style:none;border-left-style:none;background:#f1f2f2;padding-bottom:15px;margin:5px 0 0}#googleMerchants .wpallexport-google-merchants-advanced-options .wpallexport-advanced-options-content{display:block}#googleMerchants .wpallexport-help{color:#fff;font-weight:900;border-radius:50%}#googleMerchants input.custom-value,#googleMerchants select.custom-value{font-size:12px !important;height:35px;border:1px solid #ddd;border-radius:4px;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;color:#000;position:relative;top:0;width:250px;margin-left:1px}#googleMerchants input.custom-value{padding-left:9px;margin-left:2px}#googleMerchants select.custom-value{color:#777}#googleMerchants input[type=radio],#googleMerchants input[type=checkbox]{margin-right:8px}#googleMerchants .wpallexport-advanced-options-header{padding-left:25px}#googleMerchants .wpallexport-advanced-options-content input,#googleMerchants .wpallexport-advanced-options-content select{margin-left:0}#googleMerchants .fade.ng-hide{opacity:0}#googleMerchants .fade.ng-hide-remove,#googleMerchants .fade.ng-hide-add{display:block !important}#googleMerchants .fade.ng-hide-remove{transition:all linear 300ms}#googleMerchants .fade.ng-hide-add{transition:all linear 200ms}#googleMerchants .wpallexport-advanced-options{padding:0 0 0 5px}#googleMerchants .editable{font-size:12px !important;-moz-appearance:textfield;-webkit-appearance:textfield;margin:10px;width:auto;background-color:#fff;border:1px solid #ddd;border-radius:4px;-moz-border-radius:4px;padding:10px;-khtml-border-radius:4px;-webkit-border-radius:4px;color:#000;position:relative;top:0;margin-left:1px}#googleMerchants .editable:empty:before{content:attr(placeholder);cursor:text;opacity:0.7;display:block}#googleMerchants .select-container{width:300px;padding:10px 10px 10px 25px}#googleMerchants .chosen-search input{margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:#fff url(../static/js/jquery/css/chosen/chosen-sprite.png) no-repeat 100% -20px;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}#googleMerchants input.wpae-default-input{width:300px;max-width:300px;padding:13px;border-radius:5px}#googleMerchants .no-attributes{padding:5px;margin-left:23px}#googleMerchants .no-attributes.outer{margin-left:20px}#googleMerchants .wpae-highlight-droppable{cursor:copy !important}.ng-cloak{display:none}.tooltip-container{display:inline-block}.wpae-field-mapping{padding:9px;border:1px solid #ddd;margin-bottom:10px;font-size:12px;color:#40acad;text-decoration:none;position:static;margin-left:10px}google-category-selector{position:absolute;z-index:100;top:41px;left:1px}
18
 
19
  #unique-identifiers .input.checkbox{padding-left:4px}#unique-identifiers .input.inner h4{margin-top:5px}#unique-identifiers h4{margin-bottom:5px}#unique-identifiers .input{margin-bottom:5px}
 
 
 
 
17
  .slide-toggle{transition:0.6s ease-in-out;-webkit-transition:0.6s ease-in-out}#googleMerchants .adjust-price input{border-radius:5px 0 0 5px !important;border-right:none}#googleMerchants .adjust-price select{margin-left:0;width:50px;border-radius:0 5px 5px 0 !important;background-position:right 5px top 9px}#googleMerchants .adjust-price .tooltip-container{margin-top:5px}#googleMerchants .adjust-price-link{display:block;margin-top:5px}#googleMerchants div.input label{color:#000}#googleMerchants p{margin-top:0}#googleMerchants select{width:400px;margin:10px 0 10px 0;-webkit-appearance:none;height:40px;border:1px solid #ddd;border-radius:4px;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;color:#777;font-size:15px;position:relative;padding-left:9px;cursor:pointer;top:0;background-image:url(../static/img/ddown.png);background-repeat:no-repeat;background-position:right 9px top 5px}#googleMerchants select:focus{outline:none}#googleMerchants select.inner{margin-left:26px}#googleMerchants .pointer{cursor:pointer}#googleMerchants .wpallexport-collapsed-content{display:block;padding:0}#googleMerchants .wpallexport-collapsed-content-inner{padding-top:5px}#googleMerchants .wpallexport-section{display:block}#googleMerchants .wpallexport-content-section{padding-bottom:0;margin-bottom:10px}#googleMerchants .wpallexport-help{position:relative;top:-2px}#googleMerchants .wpallexport-collapsed-header:not(.wpallexport-advanced-options-header){margin-bottom:15px;padding-left:24px}#googleMerchants .advanced-options{color:#40acad}#googleMerchants div.inner{margin-left:23px;margin-top:5px;margin-bottom:5px}#googleMerchants .input.inner{margin-left:26px;margin-top:5px}#googleMerchants .input.checkbox.inner{margin-left:26px;margin-top:10px}#googleMerchants .wpallexport-google-merchants-advanced-options .wpallexport-advanced-options-header h3{color:#40acad}#googleMerchants .wpallexport-google-merchants-advanced-options .wpallexport-content-section{border-top:1px solid #ddd;border-right-style:none;border-bottom-style:none;border-left-style:none;background:#f1f2f2;padding-bottom:15px;margin:5px 0 0}#googleMerchants .wpallexport-google-merchants-advanced-options .wpallexport-advanced-options-content{display:block}#googleMerchants .wpallexport-help{color:#fff;font-weight:900;border-radius:50%}#googleMerchants input.custom-value,#googleMerchants select.custom-value{font-size:12px !important;height:35px;border:1px solid #ddd;border-radius:4px;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;color:#000;position:relative;top:0;width:250px;margin-left:1px}#googleMerchants input.custom-value{padding-left:9px;margin-left:2px}#googleMerchants select.custom-value{color:#777}#googleMerchants input[type=radio],#googleMerchants input[type=checkbox]{margin-right:8px}#googleMerchants .wpallexport-advanced-options-header{padding-left:25px}#googleMerchants .wpallexport-advanced-options-content input,#googleMerchants .wpallexport-advanced-options-content select{margin-left:0}#googleMerchants .fade.ng-hide{opacity:0}#googleMerchants .fade.ng-hide-remove,#googleMerchants .fade.ng-hide-add{display:block !important}#googleMerchants .fade.ng-hide-remove{transition:all linear 300ms}#googleMerchants .fade.ng-hide-add{transition:all linear 200ms}#googleMerchants .wpallexport-advanced-options{padding:0 0 0 5px}#googleMerchants .editable{font-size:12px !important;-moz-appearance:textfield;-webkit-appearance:textfield;margin:10px;width:auto;background-color:#fff;border:1px solid #ddd;border-radius:4px;-moz-border-radius:4px;padding:10px;-khtml-border-radius:4px;-webkit-border-radius:4px;color:#000;position:relative;top:0;margin-left:1px}#googleMerchants .editable:empty:before{content:attr(placeholder);cursor:text;opacity:0.7;display:block}#googleMerchants .select-container{width:300px;padding:10px 10px 10px 25px}#googleMerchants .chosen-search input{margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:#fff url(../static/js/jquery/css/chosen/chosen-sprite.png) no-repeat 100% -20px;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}#googleMerchants input.wpae-default-input{width:300px;max-width:300px;padding:13px;border-radius:5px}#googleMerchants .no-attributes{padding:5px;margin-left:23px}#googleMerchants .no-attributes.outer{margin-left:20px}#googleMerchants .wpae-highlight-droppable{cursor:copy !important}.ng-cloak{display:none}.tooltip-container{display:inline-block}.wpae-field-mapping{padding:9px;border:1px solid #ddd;margin-bottom:10px;font-size:12px;color:#40acad;text-decoration:none;position:static;margin-left:10px}google-category-selector{position:absolute;z-index:100;top:41px;left:1px}
18
 
19
  #unique-identifiers .input.checkbox{padding-left:4px}#unique-identifiers .input.inner h4{margin-top:5px}#unique-identifiers h4{margin-bottom:5px}#unique-identifiers .input{margin-bottom:5px}
20
+
21
+ #googleMerchants .wpallexport-help {
22
+ cursor: pointer;
23
+ }
libraries/XmlExportEngine.php CHANGED
@@ -710,7 +710,7 @@ if ( ! class_exists('XmlExportEngine') ){
710
  if($slug == 'cf' && XmlExportEngine::$is_user_export) {
711
  ?>
712
  <div class="wpallexport-free-edition-notice">
713
- <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=118611&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=export-user-meta">Upgrade to the Pro edition of WP All Export to Export User Meta</a>
714
  </div>
715
  <?php
716
  }
@@ -719,7 +719,7 @@ if ( ! class_exists('XmlExportEngine') ){
719
  if($slug == 'other' && XmlExportEngine::$is_user_export) {
720
  ?>
721
  <div class="wpallexport-free-edition-notice">
722
- <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=118611&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=export-advanced-user-data">Upgrade to the Pro edition of WP All Export to Export Advanced Fields</a>
723
  </div>
724
  <?php
725
  }
710
  if($slug == 'cf' && XmlExportEngine::$is_user_export) {
711
  ?>
712
  <div class="wpallexport-free-edition-notice">
713
+ <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=2707173&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=export-user-meta">Upgrade to the Pro edition of WP All Export to Export User Meta</a>
714
  </div>
715
  <?php
716
  }
719
  if($slug == 'other' && XmlExportEngine::$is_user_export) {
720
  ?>
721
  <div class="wpallexport-free-edition-notice">
722
+ <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=2707173&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=export-advanced-user-data">Upgrade to the Pro edition of WP All Export to Export Advanced Fields</a>
723
  </div>
724
  <?php
725
  }
libraries/XmlExportWooCommerceOrder.php CHANGED
@@ -992,7 +992,7 @@ if ( ! class_exists('XmlExportWooCommerceOrder') )
992
  <div class="wpae-custom-field">
993
  <?php if ( ! in_array($slug, array('order', 'customer', 'cf', 'other'))) : ?>
994
  <div class="wpallexport-free-edition-notice">
995
- <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=118611&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=export-wooco-order-data"><?php _e('Upgrade to the Pro edition of WP All Export to Export Order Data','wp_all_export_plugin');?></a>
996
  </div>
997
  <?php endif; ?>
998
  <ul>
992
  <div class="wpae-custom-field">
993
  <?php if ( ! in_array($slug, array('order', 'customer', 'cf', 'other'))) : ?>
994
  <div class="wpallexport-free-edition-notice">
995
+ <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=2707173&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=export-wooco-order-data"><?php _e('Upgrade to the Pro edition of WP All Export to Export Order Data','wp_all_export_plugin');?></a>
996
  </div>
997
  <?php endif; ?>
998
  <ul>
readme.txt CHANGED
@@ -1,9 +1,8 @@
1
  === Export any WordPress data to XML/CSV ===
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 4.1
4
- Tested up to: 5.4.1
5
- Stable tag: 1.2.6
6
-
7
  Tags: export, wordpress csv export, wordpress xml export, export woocommerce, migrate, export csv from wordpress, export xml from wordpress, advanced xml export, advanced csv export, export data, bulk csv export, export custom post type, export woocommerce products, export woocommerce orders, migrate woocommerce, csv export, export csv, xml export, export xml, csv exporter, datafeed
8
 
9
  Easily export any data from WordPress. Drag & drop to create a completely custom spreadsheet, CSV, or XML file.
@@ -92,6 +91,9 @@ Either: -
92
 
93
  == Changelog ==
94
 
 
 
 
95
  = 1.2.6 =
96
  * improvement: disable scheduled exports via Automatic Scheduling UI
97
  * API: add new filter wp_all_export_no_cache to avoid server cache for export files
1
  === Export any WordPress data to XML/CSV ===
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 4.1
4
+ Tested up to: 5.7
5
+ Stable tag: 1.2.7
 
6
  Tags: export, wordpress csv export, wordpress xml export, export woocommerce, migrate, export csv from wordpress, export xml from wordpress, advanced xml export, advanced csv export, export data, bulk csv export, export custom post type, export woocommerce products, export woocommerce orders, migrate woocommerce, csv export, export csv, xml export, export xml, csv exporter, datafeed
7
 
8
  Easily export any data from WordPress. Drag & drop to create a completely custom spreadsheet, CSV, or XML file.
91
 
92
  == Changelog ==
93
 
94
+ = 1.2.7 =
95
+ * maintenance: compatibility with WordPress v5.5 jQuery changes
96
+
97
  = 1.2.6 =
98
  * improvement: disable scheduled exports via Automatic Scheduling UI
99
  * API: add new filter wp_all_export_no_cache to avoid server cache for export files
src/App/Controller/ExportController.php CHANGED
@@ -33,7 +33,12 @@ class ExportController extends BaseController
33
  {
34
  if(!$request->get('id')) {
35
  $sessionData = PMXE_Plugin::$session->get_session_data();
36
- $exportData = unserialize($sessionData['google_merchants_post_data']);
 
 
 
 
 
37
  } else {
38
  $id = intval($_GET['id']);
39
  $export = new \PMXE_Export_Record();
33
  {
34
  if(!$request->get('id')) {
35
  $sessionData = PMXE_Plugin::$session->get_session_data();
36
+ if(isset($sessionData['google_merchants_post_data'])) {
37
+ $exportData = unserialize($sessionData['google_merchants_post_data']);
38
+ }
39
+ else {
40
+ $exportData = false;
41
+ }
42
  } else {
43
  $id = intval($_GET['id']);
44
  $export = new \PMXE_Export_Record();
src/App/Service/CategoriesService.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Wpae\App\Service;
4
+
5
+
6
+ class CategoriesService
7
+ {
8
+ public function getTaxonomyHierarchy($parent = 0)
9
+ {
10
+ $termsConfig = array(
11
+ 'taxonomy' => 'product_cat',
12
+ 'hide_empty' => false,
13
+ 'parent' => $parent
14
+ );
15
+
16
+ $terms = \get_categories($termsConfig);
17
+
18
+ $children = array();
19
+
20
+ foreach ($terms as $term) {
21
+
22
+ $item = array(
23
+ 'id' => $term->term_id,
24
+ 'title' => $term->name,
25
+ 'children' => $this->getTaxonomyHierarchy($term->term_id)
26
+ );
27
+ $children[] = $item;
28
+ }
29
+
30
+ return $children;
31
+ }
32
+ }
src/Scheduling/views/ConnectionIcon.php CHANGED
@@ -3,10 +3,9 @@ $scheduling = \Wpae\Scheduling\Scheduling::create();
3
  ?>
4
  <span class="wpai-no-license" <?php if ($scheduling->checkLicense()) { ?> style="display: none;" <?php } ?> >
5
 
6
- <a href="#" style="z-index: 1000; top: -4px; position: absolute; left: 0;" class="help_scheduling tipsy"
7
  title="Automatic Scheduling is a paid service from Soflyy. Click for more info.">
8
- <img style="width: 16px;"
9
- src="<?php echo PMXE_ROOT_URL; ?>/static/img/s-question.png"/>
10
  </a>
11
  </span>
12
 
3
  ?>
4
  <span class="wpai-no-license" <?php if ($scheduling->checkLicense()) { ?> style="display: none;" <?php } ?> >
5
 
6
+ <a href="#" style="z-index: 1000;" class="wpallexport-help help_scheduling"
7
  title="Automatic Scheduling is a paid service from Soflyy. Click for more info.">
8
+
 
9
  </a>
10
  </span>
11
 
src/Scheduling/views/ManualScheduling.php CHANGED
@@ -9,7 +9,7 @@
9
  <div style="<?php if ($post['scheduling_enable'] != 2) { ?> display: none; <?php } ?>" class="manual-scheduling">
10
 
11
  <div class="wpallexport-free-edition-notice" style="margin: 15px 0; width: 90%; padding-left: 10px; padding-right: 10px;">
12
- <a style="font-size: 1.3em;" class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=118611&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=manual-scheduling"><?php _e('Upgrade to the Pro edition of WP All Export for Manual Scheduling','wp_all_export_plugin');?></a>
13
  <p>
14
  <?php _e('If you already own it, remove the free edition and install the Pro edition.','wp_all_export_plugin');?>
15
  </p>
9
  <div style="<?php if ($post['scheduling_enable'] != 2) { ?> display: none; <?php } ?>" class="manual-scheduling">
10
 
11
  <div class="wpallexport-free-edition-notice" style="margin: 15px 0; width: 90%; padding-left: 10px; padding-right: 10px;">
12
+ <a style="font-size: 1.3em;" class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=2707173&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=manual-scheduling"><?php _e('Upgrade to the Pro edition of WP All Export for Manual Scheduling','wp_all_export_plugin');?></a>
13
  <p>
14
  <?php _e('If you already own it, remove the free edition and install the Pro edition.','wp_all_export_plugin');?>
15
  </p>
src/WordPress/AdminDismissibleNotice.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Wpae\WordPress;
4
+
5
+
6
+ class AdminDismissibleNotice extends AdminNotice
7
+ {
8
+ private $noticeId;
9
+
10
+ public function __construct($message, $noticeId)
11
+ {
12
+ parent::__construct($message);
13
+ $this->noticeId = $noticeId;
14
+ }
15
+
16
+ public function showNotice()
17
+ {
18
+ ?>
19
+ <div class="<?php echo $this->getType();?>" style="position: relative;"><p>
20
+ <?php echo $this->message; ?>
21
+ </p>
22
+ <button class="notice-dismiss wpae-general-notice-dismiss" type="button" data-noticeId="<?php echo $this->noticeId; ?>"><span class="screen-reader-text">Dismiss this notice.</span></button>
23
+ </div>
24
+ <?php
25
+ }
26
+
27
+ public function render()
28
+ {
29
+ add_action('admin_notices', array($this, 'showNotice'));
30
+ }
31
+
32
+ public function getType()
33
+ {
34
+ return 'error';
35
+ }
36
+
37
+ public function isDismissed()
38
+ {
39
+ $optionName = 'wpae_dismiss_warnings_'.$this->noticeId;
40
+ $optionValue = get_option($optionName, false);
41
+
42
+ return $optionValue;
43
+ }
44
+ }
src/WordPress/AdminErrorNotice.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Wpae\WordPress;
4
+
5
+
6
+ class AdminErrorNotice extends AdminNotice
7
+ {
8
+ public function getType()
9
+ {
10
+ return 'error';
11
+ }
12
+ }
src/WordPress/AdminNotice.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Wpae\WordPress;
4
+
5
+
6
+ abstract class AdminNotice
7
+ {
8
+ protected $message;
9
+
10
+ public function __construct($message)
11
+ {
12
+ $this->message = $message;
13
+ }
14
+
15
+ public function showNotice()
16
+ {
17
+ ?>
18
+ <div class="<?php echo $this->getType();?>"><p>
19
+ <?php echo $this->message; ?>
20
+ </p></div>
21
+ <?php
22
+ }
23
+
24
+ public function render()
25
+ {
26
+ add_action('admin_notices', array($this, 'showNotice'));
27
+ }
28
+
29
+ abstract function getType();
30
+ }
static/css/admin.css CHANGED
@@ -573,14 +573,12 @@
573
  background-position: center;
574
  }
575
  .wpallexport-plugin .preload {
576
- background-image: url("../img/loading-step-2.gif");
577
- background-repeat: no-repeat;
578
  background-position: 50% 10px;
579
  min-height: 35px;
580
  }
581
  .wpallexport-plugin .wpallexport-preview-preload {
582
- background-image: url("../img/loading-step-2.gif");
583
- background-repeat: no-repeat;
584
  background-position: 50% 20px;
585
  height: 80px;
586
  }
@@ -1771,8 +1769,9 @@ a.wpallexport-import-to-format span.wpallexport-import-to-title {
1771
  .wpallexport-plugin #file_selector .dd-option .dashicon-cpt:before,
1772
  .wpallexport-plugin #file_selector .dd-selected .dashicon-cpt:before{
1773
  font-family: "dashicons";
1774
- content: "\f333";
1775
  color: #555;
 
1776
  }
1777
  .wpallexport-plugin #file_selector .dd-option .dashicon-users:before,
1778
  .wpallexport-plugin #file_selector .dd-selected .dashicon-users:before{
@@ -1800,6 +1799,22 @@ a.wpallexport-import-to-format span.wpallexport-import-to-title {
1800
  color:#46ba69;
1801
  line-height: 24px;
1802
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1803
  .wpallexport-plugin input[name=url]{
1804
  font-size: 18px !important;
1805
  height: 49px;
573
  background-position: center;
574
  }
575
  .wpallexport-plugin .preload {
576
+ background-repeat: no-repeat;
 
577
  background-position: 50% 10px;
578
  min-height: 35px;
579
  }
580
  .wpallexport-plugin .wpallexport-preview-preload {
581
+ background-repeat: no-repeat;
 
582
  background-position: 50% 20px;
583
  height: 80px;
584
  }
1769
  .wpallexport-plugin #file_selector .dd-option .dashicon-cpt:before,
1770
  .wpallexport-plugin #file_selector .dd-selected .dashicon-cpt:before{
1771
  font-family: "dashicons";
1772
+ content: "\f111";
1773
  color: #555;
1774
+ margin-top: -2px;
1775
  }
1776
  .wpallexport-plugin #file_selector .dd-option .dashicon-users:before,
1777
  .wpallexport-plugin #file_selector .dd-selected .dashicon-users:before{
1799
  color:#46ba69;
1800
  line-height: 24px;
1801
  }
1802
+
1803
+ .wpallexport-plugin #file_selector .dd-option .dashicon-review:before,
1804
+ .wpallexport-plugin #file_selector .dd-selected .dashicon-review:before{
1805
+ content: '';
1806
+ background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' standalone='no'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 20010904//EN' 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'%3E%3Csvg version='1.0' xmlns='http://www.w3.org/2000/svg' width='1280.000000pt' height='1222.000000pt' viewBox='0 0 1280.000000 1222.000000' preserveAspectRatio='xMidYMid meet'%3E%3Cmetadata%3E%0ACreated by potrace 1.15, written by Peter Selinger 2001-2017%0A%3C/metadata%3E%3Cg transform='translate(0.000000,1222.000000) scale(0.100000,-0.100000)'%0Afill='%23555' stroke='none'%3E%3Cpath d='M6273 12205 c-115 -32 -205 -96 -266 -187 -19 -29 -304 -602 -635%0A-1273 -330 -671 -719 -1461 -864 -1755 l-264 -535 -220 -32 c-3672 -539 -3667%0A-538 -3722 -557 -100 -35 -199 -123 -248 -219 -76 -148 -69 -309 18 -454 23%0A-37 448 -457 1450 -1430 1270 -1233 1418 -1380 1413 -1403 -2 -14 -39 -223%0A-80 -465 -42 -242 -111 -645 -155 -895 -43 -250 -124 -718 -180 -1040 -56%0A-322 -135 -778 -176 -1015 -90 -512 -92 -552 -30 -680 102 -216 358 -320 574%0A-233 31 13 836 432 1788 931 l1731 906 804 -420 c442 -231 1223 -640 1734%0A-907 512 -268 953 -495 980 -504 63 -22 202 -23 268 -3 111 33 228 129 277%0A225 29 57 50 146 50 212 0 32 -41 292 -90 578 -138 795 -261 1506 -371 2145%0A-56 319 -124 716 -153 882 l-52 303 1422 1392 c965 944 1432 1408 1453 1442%0A43 71 62 130 68 211 16 208 -126 413 -324 468 -32 9 -379 61 -770 117 -392 55%0A-1034 145 -1425 200 -392 56 -868 123 -1058 150 -190 26 -419 58 -510 71 -91%0A12 -170 27 -177 33 -6 6 -399 799 -873 1761 -473 963 -877 1774 -898 1804 -44%0A65 -131 131 -210 161 -74 29 -207 36 -279 15z'/%3E%3C/g%3E%3C/svg%3E");
1807
+ background-size: 22px 22px;
1808
+ background-repeat: no-repeat;
1809
+ margin-top: -2px;
1810
+ width: 22px;
1811
+ height: 22px;
1812
+ }
1813
+ .wpallexport-plugin #file_selector .dd-selected .dashicon-review:before {
1814
+ background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' standalone='no'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 20010904//EN' 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'%3E%3Csvg version='1.0' xmlns='http://www.w3.org/2000/svg' width='1280.000000pt' height='1222.000000pt' viewBox='0 0 1280.000000 1222.000000' preserveAspectRatio='xMidYMid meet'%3E%3Cmetadata%3E%0ACreated by potrace 1.15, written by Peter Selinger 2001-2017%0A%3C/metadata%3E%3Cg transform='translate(0.000000,1222.000000) scale(0.100000,-0.100000)'%0Afill='%2346ba69' stroke='none'%3E%3Cpath d='M6273 12205 c-115 -32 -205 -96 -266 -187 -19 -29 -304 -602 -635%0A-1273 -330 -671 -719 -1461 -864 -1755 l-264 -535 -220 -32 c-3672 -539 -3667%0A-538 -3722 -557 -100 -35 -199 -123 -248 -219 -76 -148 -69 -309 18 -454 23%0A-37 448 -457 1450 -1430 1270 -1233 1418 -1380 1413 -1403 -2 -14 -39 -223%0A-80 -465 -42 -242 -111 -645 -155 -895 -43 -250 -124 -718 -180 -1040 -56%0A-322 -135 -778 -176 -1015 -90 -512 -92 -552 -30 -680 102 -216 358 -320 574%0A-233 31 13 836 432 1788 931 l1731 906 804 -420 c442 -231 1223 -640 1734%0A-907 512 -268 953 -495 980 -504 63 -22 202 -23 268 -3 111 33 228 129 277%0A225 29 57 50 146 50 212 0 32 -41 292 -90 578 -138 795 -261 1506 -371 2145%0A-56 319 -124 716 -153 882 l-52 303 1422 1392 c965 944 1432 1408 1453 1442%0A43 71 62 130 68 211 16 208 -126 413 -324 468 -32 9 -379 61 -770 117 -392 55%0A-1034 145 -1425 200 -392 56 -868 123 -1058 150 -190 26 -419 58 -510 71 -91%0A12 -170 27 -177 33 -6 6 -399 799 -873 1761 -473 963 -877 1774 -898 1804 -44%0A65 -131 131 -210 161 -74 29 -207 36 -279 15z'/%3E%3C/g%3E%3C/svg%3E");
1815
+ margin-top: 2px;
1816
+ }
1817
+
1818
  .wpallexport-plugin input[name=url]{
1819
  font-size: 18px !important;
1820
  height: 49px;
static/js/admin.js CHANGED
@@ -18,7 +18,17 @@
18
  'hasVariations' : false,
19
  'availableDataSelector': $('.right.template-sidebar .wpae_available_data'),
20
  'availableDataSelectorInModal' : $('fieldset.optionsset .wpae_available_data'),
21
- 'modeEnabled' : true
 
 
 
 
 
 
 
 
 
 
22
  };
23
 
24
  function processElementName($element, $elementName){
@@ -231,30 +241,29 @@
231
  $('table.wpallexport-layout').length && $('table.wpallexport-layout td.left h2:first-child').css('margin-top', $('.wrap').offset().top - $('table.wpallexport-layout').offset().top);
232
  }, 10);
233
 
234
- // help icons
235
- $('.wpallexport-help, .help_scheduling').tipsy({
236
- gravity: function() {
237
- var ver = 'n';
238
- if ($(document).scrollTop() < $(this).offset().top - $('.tipsy').height() - 2) {
239
- ver = 's';
240
- }
241
- var hor = '';
242
- if ($(this).offset().left + $('.tipsy').width() < $(window).width() + $(document).scrollLeft()) {
243
- hor = 'w';
244
- } else if ($(this).offset().left - $('.tipsy').width() > $(document).scrollLeft()) {
245
- hor = 'e';
246
- }
247
- return ver + hor;
248
- },
249
- live: true,
250
- html: true,
251
- opacity: 1
252
- }).live('click', function () {
253
- return false;
254
- }).each(function () { // fix tipsy title for IE
255
- $(this).attr('original-title', $(this).attr('title'));
256
- $(this).removeAttr('title');
257
- });
258
 
259
  if ($('#wp_all_export_code').length){
260
  var editor = CodeMirror.fromTextArea(document.getElementById("wp_all_export_code"), {
@@ -317,7 +326,7 @@
317
  }
318
 
319
  // swither show/hide logic
320
- $('input.switcher').live('change', function (e) {
321
 
322
  if ($(this).is(':radio:checked')) {
323
  $(this).parents('form').find('input.switcher:radio[name="' + $(this).attr('name') + '"]').not(this).change();
@@ -336,7 +345,7 @@
336
  }).change();
337
 
338
  // swither show/hide logic
339
- $('input.switcher-horizontal').live('change', function (e) {
340
 
341
  if ($(this).is(':checked')) {
342
  $(this).parents('form').find('input.switcher-horizontal[name="' + $(this).attr('name') + '"]').not(this).change();
@@ -353,7 +362,7 @@
353
  }).change();
354
 
355
  // autoselect input content on click
356
- $('input.selectable').live('click', function () {
357
  $(this).select();
358
  });
359
 
@@ -375,7 +384,7 @@
375
 
376
  });
377
 
378
- $('.wpallexport-collapsed').find('.wpallexport-collapsed-header:not(.disable-jquery)').live('click', function(){
379
 
380
  var $parent = $(this).parents('.wpallexport-collapsed:first');
381
 
@@ -783,7 +792,7 @@
783
 
784
  switch ($(this).attr('rel')){
785
  case 'specific_type':
786
-
787
  $('.wpallexport-user-export-notice').hide();
788
  $('.wpallexport-shop_customer-export-notice').hide();
789
  $('.wpallexport-comments-export-notice').hide();
@@ -792,36 +801,36 @@
792
  {
793
  if (postType == 'users'){
794
  $('.wpallexport-user-export-notice').show();
795
- showImportType = false;
796
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
797
- }
798
  else if (postType == 'comments')
799
  {
800
  $('.wpallexport-comments-export-notice').show();
801
- showImportType = false;
802
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
803
  }
804
  else if (postType == 'shop_customer')
805
  {
806
  $('.wpallexport-customer-export-notice').show();
807
- showImportType = false;
808
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
809
  }
810
  else if (postType == 'taxonomies'){
811
- showImportType = false;
812
  $('.taxonomy_to_export_wrapper').slideDown();
813
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
814
  }
815
  else
816
- {
817
- showImportType = true;
818
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
819
- }
820
-
821
- $('.wpallexport-filtering-wrapper').show();
822
- }
823
  break;
824
- case 'advanced_type':
825
 
826
  $('.wpallexport-user-export-notice').hide();
827
  $('.wpallexport-comments-export-notice').hide();
@@ -830,20 +839,20 @@
830
  if ($('input[name=wp_query_selector]').val() == 'wp_user_query')
831
  {
832
  $('.wpallexport-user-export-notice').show();
833
- $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
834
- showImportType = false;
835
  }
836
  else if ($('input[name=wp_query_selector]').val() == 'wp_comment_query')
837
  {
838
  $('.wpallexport-comments-export-notice').show();
839
- $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
840
- showImportType = false;
841
  }
842
  else
843
- {
844
- $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
845
- showImportType = true;
846
- }
847
  $('.wpallexport-filtering-wrapper').hide();
848
  filtering();
849
  break;
@@ -873,6 +882,7 @@
873
 
874
  $('.wpallexport-user-export-notice').hide();
875
  $('.wpallexport-comments-export-notice').hide();
 
876
  $('.wpallexport-shop_customer-export-notice').hide();
877
  $('.wpallexport-taxonomies-export-notice').hide();
878
 
@@ -896,15 +906,14 @@
896
  }
897
  else{
898
  $('.wpallexport-choose-file').find('.wpallexport-filtering-wrapper').slideUp();
899
- $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
900
  }
901
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
902
  }
903
  else{
904
  $('.taxonomy_to_export_wrapper').slideUp();
905
 
906
- if (postType == 'users' && !$('#pmxe_user_addon_free_installed').val()
907
- )
908
  {
909
  $('.wpallexport-user-export-notice').show();
910
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
@@ -912,20 +921,24 @@
912
  else if (postType == 'comments')
913
  {
914
  $('.wpallexport-comments-export-notice').show();
915
- $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
916
  }
 
 
 
 
 
917
  else if (postType == 'shop_customer')
918
  {
919
  $('.wpallexport-shop_customer-export-notice').show();
920
- $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
921
- }
922
  else
923
- {
924
- $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
925
- }
926
-
927
  filtering(postType);
928
- }
929
  }
930
  else
931
  {
@@ -947,7 +960,7 @@
947
  }
948
  });
949
 
950
- $('a.auto-generate-template').live('click', function(){
951
 
952
  var export_type = $('input[name="cpt"]').val();
953
 
@@ -988,14 +1001,14 @@
988
  });
989
 
990
  $('#wp_query_selector').ddslick({
991
- width: 600,
992
- onSelected: function(selectedData){
993
-
994
  $('.wpallexport-user-export-notice').hide();
995
  $('.wpallexport-comments-export-notice').hide();
996
  $('.wpallexport-shop_customer-export-notice').hide();
997
  $('.wpallexport-taxonomies-export-notice').hide();
998
-
999
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
1000
 
1001
  if (selectedData.selectedData.value != ""){
@@ -1008,15 +1021,15 @@
1008
  }
1009
  if(queryType == 'wp_user_query')
1010
  {
1011
- $('.wpallexport-user-export-notice').show();
1012
  $('textarea[name=wp_query]').attr("placeholder", "'role' => 'Administrator'");
1013
- $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
1014
- }
1015
  else if(queryType == 'wp_comment_query')
1016
- {
1017
  $('.wpallexport-comments-export-notice').show();
1018
- $('textarea[name=wp_query]').attr("placeholder", "'meta_key' => 'featured', 'meta_value' => '1'");
1019
- $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
1020
  }
1021
  $('input[name=wp_query_selector]').val(queryType);
1022
  }
@@ -1037,9 +1050,9 @@
1037
 
1038
  $('#taxonomy_to_export').find('.dd-selected').css({'color':'#555'});
1039
  $('input[name=taxonomy_to_export]').val(selectedData.selectedData.value);
1040
- filtering($('input[name=cpt]').val());
1041
  $('.wpallexport-taxonomies-export-notice').show();
1042
- $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
1043
  }
1044
  else{
1045
  $('#taxonomy_to_export').find('.dd-selected').css({'color':'#cfceca'});
@@ -1471,7 +1484,7 @@
1471
  });
1472
 
1473
  // Clicking on column for edit
1474
- $('#columns').find('.custom_column').live('click', function(){
1475
 
1476
  $('.add-new-field-notice').hide();
1477
 
@@ -1728,7 +1741,7 @@
1728
 
1729
  $preview.parent('.wp-pointer-content').removeClass('wp-pointer-content').addClass('wpallexport-pointer-content');
1730
 
1731
- $preview.find('.navigation a').unbind('click').die('click').live('click', function () {
1732
 
1733
  tagno += '#prev' == $(this).attr('href') ? -1 : 1;
1734
 
@@ -1801,7 +1814,7 @@
1801
  if ($mode == '+') $(this).find('.wpae-expander').text('-'); else $(this).find('.wpae-expander').text('+');
1802
  });
1803
 
1804
- $('.pmxe_remove_column').live('click', function(){
1805
  $(this).parents('li:first').remove();
1806
  });
1807
 
@@ -1818,7 +1831,7 @@
1818
  $('.pmxe_date_format_wrapper').show();
1819
  });
1820
 
1821
- $('.xml-expander').live('click', function () {
1822
  var method;
1823
  if ('-' == $(this).text()) {
1824
  $(this).text('+');
@@ -1902,6 +1915,19 @@
1902
  vm.availableDataSelector.find('li.wp_all_export_auto_generate, li.pmxe_cats').each(function(i, e){
1903
  var $clone = $(this).clone();
1904
  $clone.attr('rel', i);
 
 
 
 
 
 
 
 
 
 
 
 
 
1905
  $( "<li></li>" ).html( $clone.html() ).appendTo( $( "#columns_to_export ol" ) );
1906
  });
1907
  }
@@ -1932,7 +1958,7 @@
1932
 
1933
  });
1934
 
1935
- $('.wp_all_export_clear_all_data').live('click', function(){
1936
  $('ol#columns').find('li:not(.placeholder)').remove();
1937
  $('ol#columns').find('li.placeholder').fadeIn();
1938
  });
@@ -2017,14 +2043,14 @@
2017
  } else {
2018
  submitButton.parents('form:first').submit();
2019
  }
2020
- });
2021
- }
2022
 
2023
  if ( $('input[name=export_to]').val() == 'csv' && $('#export_to_sheet').val() == 'xls' && $('#export_to_sheet').val() == 'xlsx'){
2024
  $('.export_to_xls_upgrade_notice').show();
2025
  $('.wpallexport-submit-template').attr('disabled', 'disabled');
2026
  $('.wpallexport-submit-buttons').hide();
2027
- }
2028
  else{
2029
  $('.export_to_xls_upgrade_notice').hide();
2030
  $('.wpallexport-submit-template').removeAttr('disabled');
@@ -2073,7 +2099,7 @@
2073
  $('.wpallexport-submit-template').removeAttr('disabled');
2074
  $('.wpallexport-submit-buttons').show();
2075
  }
2076
-
2077
  $('.custom_xml_upgrade_notice').hide();
2078
  }
2079
  else
@@ -2104,7 +2130,7 @@
2104
  });
2105
 
2106
  // template form: auto submit when `load template` list value is picked
2107
- $(this).find('select[name="load_template"]').live('change', function () {
2108
 
2109
  var template = $(this).find('option:selected').val();
2110
  var exportMode = $('.xml_template_type').find('option:selected').val();
@@ -2222,7 +2248,7 @@
2222
  // [ Additional functionality ]
2223
 
2224
  // Add new filtering rule
2225
- $('#wp_all_export_add_rule').live('click', function(){
2226
 
2227
  var $el = $('#wp_all_export_xml_element');
2228
  var $rule = $('#wp_all_export_rule');
@@ -2268,10 +2294,10 @@
2268
  });
2269
 
2270
  // Re-count posts when clicking "OR" | "AND" clauses
2271
- $('input[name^=rule]').live('click', function(){
2272
  liveFiltering();
2273
  });
2274
- $('input.wpml_lang').live('click', function(){
2275
  var inputName = $(this).attr('name');
2276
  var value = $('input[name='+inputName +']:checked').val();
2277
  var $thisInput = $('.wpml_lang[value='+value +']');
@@ -2281,11 +2307,11 @@
2281
  liveFiltering();
2282
  });
2283
  // Re-count posts when changing product matching mode in filtering section
2284
- $('select[name^=product_matching_mode]').live('change', function(){
2285
  liveFiltering();
2286
  });
2287
  // Re-count posts when deleting a filtering rule
2288
- $('.wp_all_export_filtering_rules').find('.remove-ico').live('click', function(){
2289
  $(this).parents('li:first').remove();
2290
  if ( ! $('.wp_all_export_filtering_rules').find('li').length)
2291
  {
@@ -2641,6 +2667,31 @@
2641
  $('.save-changes ').addClass('disabled');
2642
  }
2643
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2644
  $(".save-changes").unbind('click').click(function () {
2645
  if($(this).hasClass('disabled')) {
2646
  return false;
18
  'hasVariations' : false,
19
  'availableDataSelector': $('.right.template-sidebar .wpae_available_data'),
20
  'availableDataSelectorInModal' : $('fieldset.optionsset .wpae_available_data'),
21
+ 'modeEnabled' : true,
22
+ 'fixImageFieldNames' : function($clone) {
23
+
24
+ if ( $clone.find('input[name^=cc_type]').val().indexOf('attachment_') !== -1 )
25
+ {
26
+ $clone.find('.wpallexport-xml-element').html('Attachment ' + $clone.find('input[name^=cc_name]').val());
27
+ $clone.find('input[name^=cc_name]').val('Attachment ' + $clone.find('input[name^=cc_name]').val());
28
+ }
29
+
30
+ return $clone;
31
+ }
32
  };
33
 
34
  function processElementName($element, $elementName){
241
  $('table.wpallexport-layout').length && $('table.wpallexport-layout td.left h2:first-child').css('margin-top', $('.wrap').offset().top - $('table.wpallexport-layout').offset().top);
242
  }, 10);
243
 
244
+ // help icons
245
+ $('.wpallexport-help').tipsy({
246
+ gravity: function() {
247
+ var ver = 'n';
248
+ if ($(document).scrollTop() < $(this).offset().top - $('.tipsy').height() - 2) {
249
+ ver = 's';
250
+ }
251
+ var hor = '';
252
+ if ($(this).offset().left + $('.tipsy').width() < $(window).width() + $(document).scrollLeft()) {
253
+ hor = 'w';
254
+ } else if ($(this).offset().left - $('.tipsy').width() > $(document).scrollLeft()) {
255
+ hor = 'e';
256
+ }
257
+ return ver + hor;
258
+ },
259
+ html: true,
260
+ opacity: 1
261
+ }).click(function () {
262
+ return false;
263
+ }).each(function () { // fix tipsy title for IE
264
+ $(this).attr('original-title', $(this).attr('title'));
265
+ $(this).removeAttr('title');
266
+ });
 
267
 
268
  if ($('#wp_all_export_code').length){
269
  var editor = CodeMirror.fromTextArea(document.getElementById("wp_all_export_code"), {
326
  }
327
 
328
  // swither show/hide logic
329
+ $('input.switcher').change(function (e) {
330
 
331
  if ($(this).is(':radio:checked')) {
332
  $(this).parents('form').find('input.switcher:radio[name="' + $(this).attr('name') + '"]').not(this).change();
345
  }).change();
346
 
347
  // swither show/hide logic
348
+ $('input.switcher-horizontal').change('change', function (e) {
349
 
350
  if ($(this).is(':checked')) {
351
  $(this).parents('form').find('input.switcher-horizontal[name="' + $(this).attr('name') + '"]').not(this).change();
362
  }).change();
363
 
364
  // autoselect input content on click
365
+ $(document).on('click', 'input.selectable', function () {
366
  $(this).select();
367
  });
368
 
384
 
385
  });
386
 
387
+ $(document).on('click', '.wpallexport-collapsed .wpallexport-collapsed-header:not(.disable-jquery)',function(){
388
 
389
  var $parent = $(this).parents('.wpallexport-collapsed:first');
390
 
792
 
793
  switch ($(this).attr('rel')){
794
  case 'specific_type':
795
+
796
  $('.wpallexport-user-export-notice').hide();
797
  $('.wpallexport-shop_customer-export-notice').hide();
798
  $('.wpallexport-comments-export-notice').hide();
801
  {
802
  if (postType == 'users'){
803
  $('.wpallexport-user-export-notice').show();
804
+ showImportType = false;
805
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
806
+ }
807
  else if (postType == 'comments')
808
  {
809
  $('.wpallexport-comments-export-notice').show();
810
+ showImportType = false;
811
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
812
  }
813
  else if (postType == 'shop_customer')
814
  {
815
  $('.wpallexport-customer-export-notice').show();
816
+ showImportType = false;
817
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
818
  }
819
  else if (postType == 'taxonomies'){
820
+ showImportType = false;
821
  $('.taxonomy_to_export_wrapper').slideDown();
822
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
823
  }
824
  else
825
+ {
826
+ showImportType = true;
827
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
828
+ }
829
+
830
+ $('.wpallexport-filtering-wrapper').show();
831
+ }
832
  break;
833
+ case 'advanced_type':
834
 
835
  $('.wpallexport-user-export-notice').hide();
836
  $('.wpallexport-comments-export-notice').hide();
839
  if ($('input[name=wp_query_selector]').val() == 'wp_user_query')
840
  {
841
  $('.wpallexport-user-export-notice').show();
842
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
843
+ showImportType = false;
844
  }
845
  else if ($('input[name=wp_query_selector]').val() == 'wp_comment_query')
846
  {
847
  $('.wpallexport-comments-export-notice').show();
848
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
849
+ showImportType = false;
850
  }
851
  else
852
+ {
853
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
854
+ showImportType = true;
855
+ }
856
  $('.wpallexport-filtering-wrapper').hide();
857
  filtering();
858
  break;
882
 
883
  $('.wpallexport-user-export-notice').hide();
884
  $('.wpallexport-comments-export-notice').hide();
885
+ $('.wpallexport-reviews-export-notice').hide();
886
  $('.wpallexport-shop_customer-export-notice').hide();
887
  $('.wpallexport-taxonomies-export-notice').hide();
888
 
906
  }
907
  else{
908
  $('.wpallexport-choose-file').find('.wpallexport-filtering-wrapper').slideUp();
909
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
910
  }
911
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
912
  }
913
  else{
914
  $('.taxonomy_to_export_wrapper').slideUp();
915
 
916
+ if (postType == 'users' && !$('#pmxe_user_addon_free_installed').val())
 
917
  {
918
  $('.wpallexport-user-export-notice').show();
919
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
921
  else if (postType == 'comments')
922
  {
923
  $('.wpallexport-comments-export-notice').show();
924
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
925
  }
926
+ else if (postType == 'shop_review')
927
+ {
928
+ $('.wpallexport-reviews-export-notice').show();
929
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
930
+ }
931
  else if (postType == 'shop_customer')
932
  {
933
  $('.wpallexport-shop_customer-export-notice').show();
934
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
935
+ }
936
  else
937
+ {
938
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
939
+ }
 
940
  filtering(postType);
941
+ }
942
  }
943
  else
944
  {
960
  }
961
  });
962
 
963
+ $(document).on('click', 'a.auto-generate-template', function(){
964
 
965
  var export_type = $('input[name="cpt"]').val();
966
 
1001
  });
1002
 
1003
  $('#wp_query_selector').ddslick({
1004
+ width: 600,
1005
+ onSelected: function(selectedData){
1006
+
1007
  $('.wpallexport-user-export-notice').hide();
1008
  $('.wpallexport-comments-export-notice').hide();
1009
  $('.wpallexport-shop_customer-export-notice').hide();
1010
  $('.wpallexport-taxonomies-export-notice').hide();
1011
+
1012
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
1013
 
1014
  if (selectedData.selectedData.value != ""){
1021
  }
1022
  if(queryType == 'wp_user_query')
1023
  {
1024
+ $('.wpallexport-user-export-notice').show();
1025
  $('textarea[name=wp_query]').attr("placeholder", "'role' => 'Administrator'");
1026
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
1027
+ }
1028
  else if(queryType == 'wp_comment_query')
1029
+ {
1030
  $('.wpallexport-comments-export-notice').show();
1031
+ $('textarea[name=wp_query]').attr("placeholder", "'meta_key' => 'featured', 'meta_value' => '1'");
1032
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
1033
  }
1034
  $('input[name=wp_query_selector]').val(queryType);
1035
  }
1050
 
1051
  $('#taxonomy_to_export').find('.dd-selected').css({'color':'#555'});
1052
  $('input[name=taxonomy_to_export]').val(selectedData.selectedData.value);
1053
+ filtering($('input[name=cpt]').val());
1054
  $('.wpallexport-taxonomies-export-notice').show();
1055
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
1056
  }
1057
  else{
1058
  $('#taxonomy_to_export').find('.dd-selected').css({'color':'#cfceca'});
1484
  });
1485
 
1486
  // Clicking on column for edit
1487
+ $('#columns').on('click', '.custom_column', function(){
1488
 
1489
  $('.add-new-field-notice').hide();
1490
 
1741
 
1742
  $preview.parent('.wp-pointer-content').removeClass('wp-pointer-content').addClass('wpallexport-pointer-content');
1743
 
1744
+ $preview.find('.navigation a').unbind('click').click(function () {
1745
 
1746
  tagno += '#prev' == $(this).attr('href') ? -1 : 1;
1747
 
1814
  if ($mode == '+') $(this).find('.wpae-expander').text('-'); else $(this).find('.wpae-expander').text('+');
1815
  });
1816
 
1817
+ $(document).on('click', '.pmxe_remove_column', function(){
1818
  $(this).parents('li:first').remove();
1819
  });
1820
 
1831
  $('.pmxe_date_format_wrapper').show();
1832
  });
1833
 
1834
+ $(document).on('click', '.xml-expander', function () {
1835
  var method;
1836
  if ('-' == $(this).text()) {
1837
  $(this).text('+');
1915
  vm.availableDataSelector.find('li.wp_all_export_auto_generate, li.pmxe_cats').each(function(i, e){
1916
  var $clone = $(this).clone();
1917
  $clone.attr('rel', i);
1918
+
1919
+ if ( $clone.find('input[name^=cc_type]').val().indexOf('image_') !== -1 )
1920
+ {
1921
+ $clone.find('.wpallexport-xml-element').html('Image ' + $clone.find('input[name^=cc_name]').val());
1922
+ $clone.find('input[name^=cc_name]').val('Image ' + $clone.find('input[name^=cc_name]').val());
1923
+ }
1924
+
1925
+ if ( $clone.find('input[name^=cc_type]').val().indexOf('attachment_') !== -1 )
1926
+ {
1927
+ $clone.find('.wpallexport-xml-element').html('Attachment ' + $clone.find('input[name^=cc_name]').val());
1928
+ $clone.find('input[name^=cc_name]').val('Attachment ' + $clone.find('input[name^=cc_name]').val());
1929
+ }
1930
+
1931
  $( "<li></li>" ).html( $clone.html() ).appendTo( $( "#columns_to_export ol" ) );
1932
  });
1933
  }
1958
 
1959
  });
1960
 
1961
+ $(document).on('click', '.wp_all_export_clear_all_data', function(){
1962
  $('ol#columns').find('li:not(.placeholder)').remove();
1963
  $('ol#columns').find('li.placeholder').fadeIn();
1964
  });
2043
  } else {
2044
  submitButton.parents('form:first').submit();
2045
  }
2046
+ });
2047
+ }
2048
 
2049
  if ( $('input[name=export_to]').val() == 'csv' && $('#export_to_sheet').val() == 'xls' && $('#export_to_sheet').val() == 'xlsx'){
2050
  $('.export_to_xls_upgrade_notice').show();
2051
  $('.wpallexport-submit-template').attr('disabled', 'disabled');
2052
  $('.wpallexport-submit-buttons').hide();
2053
+ }
2054
  else{
2055
  $('.export_to_xls_upgrade_notice').hide();
2056
  $('.wpallexport-submit-template').removeAttr('disabled');
2099
  $('.wpallexport-submit-template').removeAttr('disabled');
2100
  $('.wpallexport-submit-buttons').show();
2101
  }
2102
+
2103
  $('.custom_xml_upgrade_notice').hide();
2104
  }
2105
  else
2130
  });
2131
 
2132
  // template form: auto submit when `load template` list value is picked
2133
+ $(this).find('select[name="load_template"]').change(function () {
2134
 
2135
  var template = $(this).find('option:selected').val();
2136
  var exportMode = $('.xml_template_type').find('option:selected').val();
2248
  // [ Additional functionality ]
2249
 
2250
  // Add new filtering rule
2251
+ $(document).on('click', '#wp_all_export_add_rule', function(){
2252
 
2253
  var $el = $('#wp_all_export_xml_element');
2254
  var $rule = $('#wp_all_export_rule');
2294
  });
2295
 
2296
  // Re-count posts when clicking "OR" | "AND" clauses
2297
+ $(document).on('click', 'input[name^=rule]', function(){
2298
  liveFiltering();
2299
  });
2300
+ $(document).on('click', 'input.wpml_lang', function(){
2301
  var inputName = $(this).attr('name');
2302
  var value = $('input[name='+inputName +']:checked').val();
2303
  var $thisInput = $('.wpml_lang[value='+value +']');
2307
  liveFiltering();
2308
  });
2309
  // Re-count posts when changing product matching mode in filtering section
2310
+ $(document).on('change', 'select[name^=product_matching_mode]', function(){
2311
  liveFiltering();
2312
  });
2313
  // Re-count posts when deleting a filtering rule
2314
+ $(document).on('click', '.wp_all_export_filtering_rules > .remove-ico', function(){
2315
  $(this).parents('li:first').remove();
2316
  if ( ! $('.wp_all_export_filtering_rules').find('li').length)
2317
  {
2667
  $('.save-changes ').addClass('disabled');
2668
  }
2669
 
2670
+
2671
+ // help icons
2672
+ $('.wpallexport-help').tipsy({
2673
+ gravity: function() {
2674
+ var ver = 'n';
2675
+ if ($(document).scrollTop() < $(this).offset().top - $('.tipsy').height() - 2) {
2676
+ ver = 's';
2677
+ }
2678
+ var hor = '';
2679
+ if ($(this).offset().left + $('.tipsy').width() < $(window).width() + $(document).scrollLeft()) {
2680
+ hor = 'w';
2681
+ } else if ($(this).offset().left - $('.tipsy').width() > $(document).scrollLeft()) {
2682
+ hor = 'e';
2683
+ }
2684
+ return ver + hor;
2685
+ },
2686
+ html: true,
2687
+ opacity: 1
2688
+ }).click(function () {
2689
+ return false;
2690
+ }).each(function () { // fix tipsy title for IE
2691
+ $(this).attr('original-title', $(this).attr('title'));
2692
+ $(this).removeAttr('title');
2693
+ });
2694
+
2695
  $(".save-changes").unbind('click').click(function () {
2696
  if($(this).hasClass('disabled')) {
2697
  return false;
static/js/jquery/jquery.tipsy.js CHANGED
@@ -1,43 +1,81 @@
1
  // tipsy, facebook style tooltips for jquery
2
- // version 1.0.0a
3
  // (c) 2008-2010 jason frame [jason@onehackoranother.com]
4
- // releated under the MIT license
5
 
6
- (function($) {
7
-
8
- function fixTitle($ele) {
9
- if ($ele.attr('title') || typeof($ele.attr('original-title')) != 'string') {
10
- $ele.attr('original-title', $ele.attr('title') || '').removeAttr('title');
 
 
 
 
11
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  }
13
-
14
  function Tipsy(element, options) {
15
  this.$element = $(element);
16
  this.options = options;
17
  this.enabled = true;
18
- fixTitle(this.$element);
19
  }
20
-
21
  Tipsy.prototype = {
22
  show: function() {
23
- var title = this.getTitle();
24
- if (title && this.enabled) {
 
 
 
 
 
 
 
 
25
  var $tip = this.tip();
26
-
27
- $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
28
- $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity
29
- $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).appendTo(document.body);
30
-
31
- var pos = $.extend({}, this.$element.offset(), {
32
- width: this.$element[0].offsetWidth,
33
- height: this.$element[0].offsetHeight
34
- });
35
-
36
- var actualWidth = $tip[0].offsetWidth, actualHeight = $tip[0].offsetHeight;
37
- var gravity = (typeof this.options.gravity == 'function')
38
- ? this.options.gravity.call(this.$element[0])
39
- : this.options.gravity;
40
-
 
 
 
 
 
 
 
 
 
 
 
41
  var tp;
42
  switch (gravity.charAt(0)) {
43
  case 'n':
@@ -52,8 +90,10 @@
52
  case 'w':
53
  tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
54
  break;
 
 
55
  }
56
-
57
  if (gravity.length == 2) {
58
  if (gravity.charAt(1) == 'w') {
59
  tp.left = pos.left + pos.width / 2 - 15;
@@ -61,45 +101,78 @@
61
  tp.left = pos.left + pos.width / 2 - actualWidth + 15;
62
  }
63
  }
64
-
65
- $tip.css(tp).addClass('tipsy-' + gravity);
66
-
 
67
  if (this.options.fade) {
68
- $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
 
 
69
  } else {
70
  $tip.css({visibility: 'visible', opacity: this.options.opacity});
71
  }
 
 
 
 
 
 
72
  }
73
  },
74
-
75
  hide: function() {
76
  if (this.options.fade) {
77
- this.tip().stop().fadeOut(function() { $(this).remove(); });
78
  } else {
79
  this.tip().remove();
80
  }
 
 
 
81
  },
82
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  getTitle: function() {
84
  var title, $e = this.$element, o = this.options;
85
- fixTitle($e);
86
- var title, o = this.options;
87
  if (typeof o.title == 'string') {
88
- title = $e.attr(o.title == 'title' ? 'original-title' : o.title);
89
  } else if (typeof o.title == 'function') {
90
  title = o.title.call($e[0]);
91
  }
92
  title = ('' + title).replace(/(^\s*|\s*$)/, "");
93
  return title || o.fallback;
94
  },
95
-
96
  tip: function() {
 
 
97
  if (!this.$tip) {
98
- this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"/></div>');
 
 
 
99
  }
100
  return this.$tip;
101
  },
102
-
103
  validate: function() {
104
  if (!this.$element[0].parentNode) {
105
  this.hide();
@@ -107,22 +180,29 @@
107
  this.options = null;
108
  }
109
  },
110
-
111
  enable: function() { this.enabled = true; },
112
  disable: function() { this.enabled = false; },
113
  toggleEnabled: function() { this.enabled = !this.enabled; }
114
  };
115
-
116
  $.fn.tipsy = function(options) {
117
-
 
 
118
  if (options === true) {
119
  return this.data('tipsy');
120
  } else if (typeof options == 'string') {
121
- return this.data('tipsy')[options]();
 
 
122
  }
123
-
124
  options = $.extend({}, $.fn.tipsy.defaults, options);
125
-
 
 
 
126
  function get(ele) {
127
  var tipsy = $.data(ele, 'tipsy');
128
  if (!tipsy) {
@@ -131,44 +211,84 @@
131
  }
132
  return tipsy;
133
  }
134
-
135
  function enter() {
 
 
 
136
  var tipsy = get(this);
137
  tipsy.hoverState = 'in';
138
- if (options.delayIn == 0) {
139
  tipsy.show();
140
  } else {
141
- setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn);
 
 
 
 
 
142
  }
143
- };
144
-
145
  function leave() {
146
  var tipsy = get(this);
147
  tipsy.hoverState = 'out';
148
- if (options.delayOut == 0) {
149
  tipsy.hide();
150
  } else {
151
- setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut);
152
  }
153
- };
154
-
155
  if (!options.live) this.each(function() { get(this); });
156
-
157
  if (options.trigger != 'manual') {
158
- var binder = options.live ? 'live' : 'bind',
159
- eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
160
- eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
161
- this[binder](eventIn, enter)[binder](eventOut, leave);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  }
163
-
164
  return this;
165
-
166
  };
167
-
168
  $.fn.tipsy.defaults = {
 
 
 
169
  delayIn: 0,
170
  delayOut: 0,
171
  fade: false,
 
 
 
 
 
 
172
  fallback: '',
173
  gravity: 'n',
174
  html: false,
@@ -176,23 +296,122 @@
176
  offset: 0,
177
  opacity: 0.8,
178
  title: 'title',
179
- trigger: 'hover'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  };
181
-
182
  // Overwrite this method to provide options on a per-element basis.
183
  // For example, you could store the gravity in a 'tipsy-gravity' attribute:
184
- // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
185
  // (remember - do not modify 'options' in place!)
186
  $.fn.tipsy.elementOptions = function(ele, options) {
187
  return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
188
  };
189
-
190
  $.fn.tipsy.autoNS = function() {
191
  return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
192
  };
193
-
194
  $.fn.tipsy.autoWE = function() {
195
  return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
196
  };
197
-
198
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  // tipsy, facebook style tooltips for jquery
2
+ // version 1.0.2
3
  // (c) 2008-2010 jason frame [jason@onehackoranother.com]
4
+ // released under the MIT license
5
 
6
+ (function($, window, undefined) {
7
+
8
+ function maybeCall(thing, ctx) {
9
+ return (typeof thing == 'function') ? (thing.call(ctx)) : thing;
10
+ }
11
+
12
+ function isElementInDOM(ele) {
13
+ while (ele = ele.parentNode) {
14
+ if (ele == document) return true;
15
  }
16
+ return false;
17
+ }
18
+
19
+ // Returns true if it is a DOM element
20
+ // http://stackoverflow.com/a/384380/999
21
+ function isElement(o){
22
+ return (
23
+ typeof HTMLElement === "object" ? o instanceof HTMLElement : //DOM2
24
+ o && typeof o === "object" && o.nodeType === 1 && typeof o.nodeName==="string"
25
+ );
26
+ }
27
+
28
+ var tipsyIDcounter = 0;
29
+ function tipsyID() {
30
+ return "tipsyuid" + (tipsyIDcounter++);
31
  }
32
+
33
  function Tipsy(element, options) {
34
  this.$element = $(element);
35
  this.options = options;
36
  this.enabled = true;
37
+ this.fixTitle();
38
  }
39
+
40
  Tipsy.prototype = {
41
  show: function() {
42
+ if (!isElementInDOM(this.$element[0])) {
43
+ return;
44
+ }
45
+
46
+ if (isElement(this.$element) && !this.$element.is(':visible')) {
47
+ return;
48
+ }
49
+
50
+ var title;
51
+ if (this.enabled && (title = this.getTitle())) {
52
  var $tip = this.tip();
53
+
54
+ $tip.find('.tipsy-inner' + this.options.theme)[this.options.html ? 'html' : 'text'](title);
55
+
56
+ $tip[0].className = 'tipsy' + this.options.theme; // reset classname in case of dynamic gravity
57
+ if (this.options.className) {
58
+ $tip.addClass(maybeCall(this.options.className, this.$element[0]));
59
+ }
60
+
61
+ $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block', 'z-index': '1000000000000'}).prependTo(document.body);
62
+
63
+ var pos = $.extend({}, this.$element.offset());
64
+
65
+ // If the element is contained in a SVG object, use getBBox
66
+ if (this.$element.parents('svg').size() > 0) {
67
+ pos = $.extend(pos, this.$element[0].getBBox());
68
+ } else {
69
+ pos = $.extend(pos, {
70
+ width: this.$element[0].offsetWidth || 0,
71
+ height: this.$element[0].offsetHeight || 0
72
+ });
73
+ }
74
+
75
+ var actualWidth = $tip[0].offsetWidth,
76
+ actualHeight = $tip[0].offsetHeight,
77
+ gravity = maybeCall(this.options.gravity, this.$element[0]);
78
+
79
  var tp;
80
  switch (gravity.charAt(0)) {
81
  case 'n':
90
  case 'w':
91
  tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
92
  break;
93
+ default:
94
+ break;
95
  }
96
+
97
  if (gravity.length == 2) {
98
  if (gravity.charAt(1) == 'w') {
99
  tp.left = pos.left + pos.width / 2 - 15;
101
  tp.left = pos.left + pos.width / 2 - actualWidth + 15;
102
  }
103
  }
104
+
105
+ $tip.css(tp).addClass('tipsy-' + gravity + this.options.theme);
106
+ $tip.find('.tipsy-arrow' + this.options.theme)[0].className = 'tipsy-arrow' + this.options.theme + ' tipsy-arrow-' + gravity.charAt(0) + this.options.theme;
107
+
108
  if (this.options.fade) {
109
+ if(this.options.shadow)
110
+ $(".tipsy-inner").css({'box-shadow': '0px 0px '+this.options.shadowBlur+'px '+this.options.shadowSpread+'px rgba(0, 0, 0, '+this.options.shadowOpacity+')', '-webkit-box-shadow': '0px 0px '+this.options.shadowBlur+'px '+this.options.shadowSpread+'px rgba(0, 0, 0, '+this.options.shadowOpacity+')'});
111
+ $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity}, this.options.fadeInTime);
112
  } else {
113
  $tip.css({visibility: 'visible', opacity: this.options.opacity});
114
  }
115
+
116
+ if (this.options.aria) {
117
+ var $tipID = tipsyID();
118
+ $tip.attr("id", $tipID);
119
+ this.$element.attr("aria-describedby", $tipID);
120
+ }
121
  }
122
  },
123
+
124
  hide: function() {
125
  if (this.options.fade) {
126
+ this.tip().stop().fadeOut(this.options.fadeOutTime, function() { $(this).remove(); });
127
  } else {
128
  this.tip().remove();
129
  }
130
+ if (this.options.aria) {
131
+ this.$element.removeAttr("aria-describedby");
132
+ }
133
  },
134
+
135
+ fixTitle: function() {
136
+ var $e = this.$element,
137
+ id = maybeCall(this.options.id, this.$element[0]);
138
+ if ($e.prop('title') || typeof($e.prop('original-title')) != 'string') {
139
+ $e.prop('original-title', $e.prop('title') || '').removeAttr('title');
140
+ // add aria-describedby pointing to the tooltip's id
141
+ $e.attr('aria-describedby', id);
142
+ // if it doesn't already have a tabindex, force the trigger element into the tab cycle
143
+ // to make it keyboard accessible with tabindex=0. this automatically makes elements
144
+ // that are not normally keyboard accessible (div or span) that have been tipsy-fied
145
+ // also operable with the keyboard.
146
+ if ($e.attr('tabindex') === undefined) {
147
+ $e.attr('tabindex', 0);
148
+ }
149
+ }
150
+ },
151
+
152
  getTitle: function() {
153
  var title, $e = this.$element, o = this.options;
154
+ this.fixTitle();
 
155
  if (typeof o.title == 'string') {
156
+ title = $e.prop(o.title == 'title' ? 'original-title' : o.title);
157
  } else if (typeof o.title == 'function') {
158
  title = o.title.call($e[0]);
159
  }
160
  title = ('' + title).replace(/(^\s*|\s*$)/, "");
161
  return title || o.fallback;
162
  },
163
+
164
  tip: function() {
165
+ var id = maybeCall(this.options.id, this.$element[0]);
166
+
167
  if (!this.$tip) {
168
+ // generate tooltip, with appropriate ARIA role and an 'id' (can be set in options),
169
+ // so it can be targetted by aria-describedby in the trigger element
170
+ this.$tip = $('<div class="tipsy' + this.options.theme + '" id="'+id+'" role="tooltip"></div>').html('<div class="tipsy-arrow' + this.options.theme + '"></div><div class="tipsy-inner' + this.options.theme + '"></div>').attr("role","tooltip");
171
+ this.$tip.data('tipsy-pointee', this.$element[0]);
172
  }
173
  return this.$tip;
174
  },
175
+
176
  validate: function() {
177
  if (!this.$element[0].parentNode) {
178
  this.hide();
180
  this.options = null;
181
  }
182
  },
183
+
184
  enable: function() { this.enabled = true; },
185
  disable: function() { this.enabled = false; },
186
  toggleEnabled: function() { this.enabled = !this.enabled; }
187
  };
188
+
189
  $.fn.tipsy = function(options) {
190
+
191
+ $.fn.tipsy.enable();
192
+
193
  if (options === true) {
194
  return this.data('tipsy');
195
  } else if (typeof options == 'string') {
196
+ var tipsy = this.data('tipsy');
197
+ if (tipsy) tipsy[options]();
198
+ return this;
199
  }
200
+
201
  options = $.extend({}, $.fn.tipsy.defaults, options);
202
+
203
+ // Establish theme
204
+ options.theme = (options.theme && options.theme !== '') ? '-' + options.theme : '';
205
+
206
  function get(ele) {
207
  var tipsy = $.data(ele, 'tipsy');
208
  if (!tipsy) {
211
  }
212
  return tipsy;
213
  }
214
+
215
  function enter() {
216
+ if ($.fn.tipsy.enabled !== true) {
217
+ return;
218
+ }
219
  var tipsy = get(this);
220
  tipsy.hoverState = 'in';
221
+ if (options.delayIn === 0) {
222
  tipsy.show();
223
  } else {
224
+ tipsy.fixTitle();
225
+ setTimeout(function() {
226
+ if (tipsy.hoverState == 'in' && isElementInDOM(tipsy.$element)) {
227
+ tipsy.show();
228
+ }
229
+ }, options.delayIn);
230
  }
231
+ }
232
+
233
  function leave() {
234
  var tipsy = get(this);
235
  tipsy.hoverState = 'out';
236
+ if (options.delayOut === 0) {
237
  tipsy.hide();
238
  } else {
239
+ setTimeout(function() { if (tipsy.hoverState == 'out' || !tipsy.$element || !tipsy.$element.is(':visible')) tipsy.hide(); }, options.delayOut);
240
  }
241
+ }
242
+
243
  if (!options.live) this.each(function() { get(this); });
244
+
245
  if (options.trigger != 'manual') {
246
+ // one of the biggest changes from 1.0.0a: by default, bind to BOTH mouseenter/mouseleave AND focus/blur
247
+ // this ensures out-of-the-box keyboard accessibility, showing tooltips when users TAB to a (focusable) element
248
+ // sites that still use 'hover' will also get this new interactive behavior automatically, only those who
249
+ // explicitly set 'focus' will only get focus/blur (for forms, for instance)
250
+
251
+ if (options.live && options.live !== true) {
252
+ if (options.trigger != 'focus') {
253
+ $(this).on('mouseenter', options.live, enter);
254
+ $(this).on('mouseleave', options.live, leave);
255
+ }
256
+ if (options.trigger != 'blur') {
257
+ $(this).on('focus', options.live, enter);
258
+ $(this).on('blur', options.live, leave);
259
+ }
260
+ } else {
261
+ if (options.live && !$.live) {
262
+ //live === true and using jQuery >= 1.9
263
+ throw "Since jQuery 1.9, pass selector as live argument. eg. $(document).tipsy({live: 'a.live'});";
264
+ }
265
+ var binder = options.live ? 'live' : 'bind';
266
+ if (options.trigger != 'focus') {
267
+ this[binder]('mouseenter', enter)[binder]('mouseleave', leave);
268
+ }
269
+ if (options.trigger != 'blur') {
270
+ this[binder]('focus', enter)[binder]('blur', leave);
271
+ }
272
+ }
273
  }
274
+
275
  return this;
276
+
277
  };
278
+
279
  $.fn.tipsy.defaults = {
280
+ aria: false,
281
+ className: null,
282
+ id: 'tipsy',
283
  delayIn: 0,
284
  delayOut: 0,
285
  fade: false,
286
+ fadeInTime: 400,
287
+ fadeOutTime: 400,
288
+ shadow: false,
289
+ shadowBlur: 8,
290
+ shadowOpacity: 1,
291
+ shadowSpread: 0,
292
  fallback: '',
293
  gravity: 'n',
294
  html: false,
296
  offset: 0,
297
  opacity: 0.8,
298
  title: 'title',
299
+ trigger: 'interactive',
300
+ theme: ''
301
+ };
302
+
303
+ $.fn.tipsy.revalidate = function() {
304
+ $('.tipsy').each(function() {
305
+ var pointee = $.data(this, 'tipsy-pointee');
306
+ if (!pointee || !isElementInDOM(pointee)) {
307
+ $(this).remove();
308
+ }
309
+ });
310
+ };
311
+
312
+ $.fn.tipsy.enable = function() {
313
+ $.fn.tipsy.enabled = true;
314
+ };
315
+
316
+ $.fn.tipsy.disable = function() {
317
+ $.fn.tipsy.enabled = false;
318
  };
319
+
320
  // Overwrite this method to provide options on a per-element basis.
321
  // For example, you could store the gravity in a 'tipsy-gravity' attribute:
322
+ // return $.extend({}, options, {gravity: $(ele).prop('tipsy-gravity') || 'n' });
323
  // (remember - do not modify 'options' in place!)
324
  $.fn.tipsy.elementOptions = function(ele, options) {
325
  return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
326
  };
327
+
328
  $.fn.tipsy.autoNS = function() {
329
  return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
330
  };
331
+
332
  $.fn.tipsy.autoWE = function() {
333
  return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
334
  };
335
+
336
+ $.fn.tipsy.autoNWNE = function() {
337
+ return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'ne' : 'nw';
338
+ };
339
+
340
+ $.fn.tipsy.autoSWSE = function() {
341
+ return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'se' : 'sw';
342
+ };
343
+
344
+ /**
345
+ * yields a closure of the supplied parameters, producing a function that takes
346
+ * no arguments and is suitable for use as an autogravity function like so:
347
+ *
348
+ * @param marginNorth (int) - distance from the viewable region top edge that an
349
+ * element should be before setting its tooltip's gravity to be away
350
+ * from that edge.
351
+ * @param marginEast (int) - distance from the viewable region right edge that an
352
+ * element should be before setting its tooltip's gravity to be away
353
+ * from that edge.
354
+ * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer
355
+ * if there are no viewable region edges effecting the tooltip's
356
+ * gravity. It will try to vary from this minimally, for example,
357
+ * if 'sw' is preferred and an element is near the right viewable
358
+ * region edge, but not the top edge, it will set the gravity for
359
+ * that element's tooltip to be 'se', preserving the southern
360
+ * component.
361
+ */
362
+ $.fn.tipsy.autoBounds = function(marginNorth, marginEast, prefer) {
363
+ return function() {
364
+ var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)},
365
+ boundTop = $(document).scrollTop() + marginNorth,
366
+ boundLeft = $(document).scrollLeft() + marginEast,
367
+ $this = $(this);
368
+
369
+ if ($this.offset().top < boundTop) dir.ns = 'n';
370
+ if ($this.offset().left < boundLeft) dir.ew = 'w';
371
+ if ($(window).width() + $(document).scrollLeft() - $this.offset().left < marginEast) dir.ew = 'e';
372
+ if ($(window).height() + $(document).scrollTop() - $this.offset().top < marginNorth) dir.ns = 's';
373
+
374
+ return dir.ns + (dir.ew ? dir.ew : '');
375
+ };
376
+ };
377
+
378
+ /**
379
+ * Improved version of autoBounds for automatic placement of chunky tips
380
+ * The original autoBounds failed in two regards: 1. it would never return a 'w' or 'e', gravity even if they
381
+ * were preferred and/or optimal, 2. it only respected the margin between the left hand side of an element and
382
+ * left hand side of the viewport, and the top of an element and the top of the viewport. This version checks
383
+ * to see if the bottom of an element is too close to the bottom of the screen, similarly for the right hand side
384
+ */
385
+ $.fn.tipsy.autoBounds2 = function(margin, prefer) {
386
+ return function() {
387
+ var dir = {},
388
+ boundTop = $(document).scrollTop() + margin,
389
+ boundLeft = $(document).scrollLeft() + margin,
390
+ $this = $(this);
391
+
392
+ // bi-directional string (ne, se, sw, etc...)
393
+ if (prefer.length > 1) {
394
+ dir.ns = prefer[0];
395
+ dir.ew = prefer[1];
396
+ } else {
397
+ // single direction string (e, w, n or s)
398
+ if (prefer[0] == 'e' || prefer[0] == 'w') {
399
+ dir.ew = prefer[0];
400
+ } else {
401
+ dir.ns = prefer[0];
402
+ }
403
+ }
404
+
405
+ if ($this.offset().top < boundTop) dir.ns = 'n';
406
+ if ($this.offset().left < boundLeft) dir.ew = 'w';
407
+ if ($(window).width() + $(document).scrollLeft() - ($this.offset().left + $this.width()) < margin) dir.ew = 'e';
408
+ if ($(window).height() + $(document).scrollTop() - ($this.offset().top + $this.height()) < margin) dir.ns = 's';
409
+
410
+ if (dir.ns) {
411
+ return dir.ns + (dir.ew ? dir.ew : '');
412
+ }
413
+ return dir.ew;
414
+ }
415
+ };
416
+
417
+ })(jQuery, window);
trunk/actions/admin_head.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
- function pmxe_admin_head(){
3
- $input = new PMXE_Input();
4
- $export_id = $input->get('id', false);
5
- $export_action = $input->get('action', false);
6
- if ($export_id){
7
- ?>
8
- <script type="text/javascript">
9
- var export_id = '<?php echo $export_id; ?>';
10
- </script>
11
- <?php
12
- }
13
-
14
- $wp_all_export_ajax_nonce = wp_create_nonce("wp_all_export_secure");
15
-
16
- ?>
17
- <script type="text/javascript" id="googleMerchantsInit">
18
- if(typeof GoogleMerchants != 'undefined') {
19
- GoogleMerchants.constant('NONCE', '<?php echo $wp_all_export_ajax_nonce; ?>');
20
- }
21
- var ajaxurl = '<?php echo admin_url( "admin-ajax.php" ); ?>';
22
- var export_action = '<?php echo $export_action; ?>';
23
- var wp_all_export_security = '<?php echo $wp_all_export_ajax_nonce; ?>';
24
- </script>
25
- <?php
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/actions/admin_init.php DELETED
@@ -1,5 +0,0 @@
1
- <?php
2
-
3
- function pmxe_admin_init(){
4
- wp_enqueue_script('pmxe-script', PMXE_ROOT_URL . '/static/js/pmxe.js', array('jquery'), PMXE_VERSION);
5
- }
 
 
 
 
 
trunk/actions/admin_menu.php DELETED
@@ -1,22 +0,0 @@
1
- <?php
2
- /**
3
- * Register plugin specific admin menu
4
- */
5
-
6
- function pmxe_admin_menu() {
7
- global $menu, $submenu;
8
-
9
- if (current_user_can( PMXE_Plugin::$capabilities )) { // admin management options
10
-
11
- add_menu_page(__('WP All Export', 'wp_all_export_plugin'), __('All Export', 'wp_all_export_plugin'), PMXE_Plugin::$capabilities, 'pmxe-admin-home', array(PMXE_Plugin::getInstance(), 'adminDispatcher'), PMXE_Plugin::ROOT_URL . '/static/img/xmlicon.png', 111);
12
- // workaround to rename 1st option to `Home`
13
- $submenu['pmxe-admin-home'] = array();
14
- add_submenu_page('pmxe-admin-home', __('Export to XML', 'wp_all_export_plugin') . ' &lsaquo; ' . __('WP All Export', 'wp_all_export_plugin'), __('New Export', 'wp_all_export_plugin'), PMXE_Plugin::$capabilities, 'pmxe-admin-export', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
15
- add_submenu_page('pmxe-admin-home', __('Manage Exports', 'wp_all_export_plugin') . ' &lsaquo; ' . __('WP All Export', 'wp_all_export_plugin'), __('Manage Exports', 'wp_all_export_plugin'), PMXE_Plugin::$capabilities, 'pmxe-admin-manage', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
16
- add_submenu_page('pmxe-admin-home', __('Settings', 'wp_all_export_plugin') . ' &lsaquo; ' . __('WP All Export', 'wp_all_export_plugin'), __('Settings', 'wp_all_export_plugin'), PMXE_Plugin::$capabilities, 'pmxe-admin-settings', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
17
- // add_submenu_page('pmxe-admin-home', __('Feedback', 'wp_all_export_plugin') . ' &lsaquo; ' . __('WP All Export', 'wp_all_export_plugin'), __('Feedback', 'wp_all_export_plugin'), PMXE_Plugin::$capabilities, 'pmxe-admin-feedback', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
18
- //add_submenu_page('pmxe-admin-home', __('Support', 'wp_all_export_plugin') . ' &lsaquo; ' . __('WP All Export', 'wp_all_export_plugin'), __('Support', 'wp_all_export_plugin'), 'manage_options', 'pmxe-admin-help', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
19
-
20
- }
21
- }
22
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/actions/admin_notices.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
-
3
- function pmxe_admin_notices() {
4
-
5
- // notify user if history folder is not writable
6
- $uploads = wp_upload_dir();
7
-
8
- $input = new PMXE_Input();
9
- $messages = $input->get('pmxe_nt', array());
10
- if ($messages) {
11
- is_array($messages) or $messages = array($messages);
12
- foreach ($messages as $type => $m) {
13
- in_array((string)$type, array('updated', 'error')) or $type = 'updated';
14
- ?>
15
- <div class="<?php echo $type ?>"><p><?php echo $m ?></p></div>
16
- <?php
17
- }
18
- }
19
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/actions/init.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
-
3
- function pmxe_init()
4
- {
5
- if(!empty($_GET['check_connection'])) {
6
- exit(json_encode(array('success' => true)));
7
- }
8
- }
 
 
 
 
 
 
 
 
trunk/actions/pmxe_after_export.php DELETED
@@ -1,417 +0,0 @@
1
- <?php
2
-
3
- function pmxe_prepend($string, $orig_filename) {
4
- $context = stream_context_create();
5
- $orig_file = fopen($orig_filename, 'r', 1, $context);
6
-
7
- $temp_filename = tempnam(sys_get_temp_dir(), 'php_prepend_');
8
- file_put_contents($temp_filename, $string);
9
- file_put_contents($temp_filename, $orig_file, FILE_APPEND);
10
-
11
- fclose($orig_file);
12
- unlink($orig_filename);
13
- rename($temp_filename, $orig_filename);
14
- }
15
-
16
- function pmxe_pmxe_after_export($export_id, $export)
17
- {
18
- if ( ! empty(PMXE_Plugin::$session) and PMXE_Plugin::$session->has_session() )
19
- {
20
- PMXE_Plugin::$session->set('file', '');
21
- PMXE_Plugin::$session->save_data();
22
- }
23
-
24
- if ( ! $export->isEmpty())
25
- {
26
-
27
- $export->set(
28
- array(
29
- 'registered_on' => current_time( 'mysql', 1 ),
30
- )
31
- )->save();
32
-
33
- $splitSize = $export->options['split_large_exports_count'];
34
-
35
- $exportOptions = $export->options;
36
- // remove previously genereted chunks
37
- if ( ! empty($exportOptions['split_files_list']) and ! $export->options['creata_a_new_export_file'] )
38
- {
39
- foreach ($exportOptions['split_files_list'] as $file) {
40
- @unlink($file);
41
- }
42
- }
43
-
44
- $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
45
-
46
- if ( ! $is_secure_import)
47
- {
48
- $filepath = get_attached_file($export->attch_id);
49
- }
50
- else
51
- {
52
- $filepath = wp_all_export_get_absolute_path($export->options['filepath']);
53
- }
54
-
55
- //TODO: Look into what is happening with this variable and what it is used for
56
- $is_export_csv_headers = apply_filters('wp_all_export_is_csv_headers_enabled', true, $export->id);
57
-
58
- if ( isset($export->options['include_header_row']) ) {
59
- $is_export_csv_headers = $export->options['include_header_row'];
60
- }
61
-
62
- $removeHeaders = false;
63
-
64
- $removeHeaders = apply_filters('wp_all_export_remove_csv_headers', $removeHeaders, $export->id);
65
-
66
- // Remove headers row from CSV file
67
- if ( (empty($is_export_csv_headers) && @file_exists($filepath) && $export->options['export_to'] == 'csv' && $export->options['export_to_sheet'] == 'csv') || $removeHeaders){
68
-
69
- $tmp_file = str_replace(basename($filepath), 'iteration_' . basename($filepath), $filepath);
70
- copy($filepath, $tmp_file);
71
- $in = fopen($tmp_file, 'r');
72
- $out = fopen($filepath, 'w');
73
-
74
- $headers = fgetcsv($in, 0, XmlExportEngine::$exportOptions['delimiter']);
75
-
76
- if (is_resource($in)) {
77
- $lineNumber = 0;
78
- while ( ! feof($in) ) {
79
- $data = fgetcsv($in, 0, XmlExportEngine::$exportOptions['delimiter']);
80
- if ( empty($data) ) continue;
81
- $data_assoc = array_combine($headers, array_values($data));
82
- $line = array();
83
- foreach ($headers as $header) {
84
- $line[$header] = ( isset($data_assoc[$header]) ) ? $data_assoc[$header] : '';
85
- }
86
- if ( ! $lineNumber && XmlExportEngine::$exportOptions['include_bom']){
87
- fwrite($out, chr(0xEF).chr(0xBB).chr(0xBF));
88
- fputcsv($out, $line, XmlExportEngine::$exportOptions['delimiter']);
89
- }
90
- else{
91
- fputcsv($out, $line, XmlExportEngine::$exportOptions['delimiter']);
92
- }
93
- apply_filters('wp_all_export_after_csv_line', $out, XmlExportEngine::$exportID);
94
- $lineNumber++;
95
- }
96
- fclose($in);
97
- }
98
- fclose($out);
99
- @unlink($tmp_file);
100
- }
101
-
102
- $preCsvHeaders = false;
103
- $preCsvHeaders = apply_filters('wp_all_export_pre_csv_headers', $preCsvHeaders, $export->id);
104
-
105
- if($preCsvHeaders) {
106
- pmxe_prepend($preCsvHeaders."\n", $filepath);
107
- }
108
-
109
- // Split large exports into chunks
110
- if ( $export->options['split_large_exports'] and $splitSize < $export->exported )
111
- {
112
-
113
- $exportOptions['split_files_list'] = array();
114
-
115
- if ( @file_exists($filepath) )
116
- {
117
-
118
- switch ($export->options['export_to'])
119
- {
120
- case 'xml':
121
-
122
- require_once PMXE_ROOT_DIR . '/classes/XMLWriter.php';
123
-
124
- switch ( $export->options['xml_template_type'])
125
- {
126
- case 'XmlGoogleMerchants':
127
- case 'custom':
128
- // Determine XML root element
129
- $main_xml_tag = false;
130
- preg_match_all("%<[\w]+[\s|>]{1}%", $export->options['custom_xml_template_header'], $matches);
131
- if ( ! empty($matches[0]) ){
132
- $main_xml_tag = preg_replace("%[\s|<|>]%","",array_shift($matches[0]));
133
- }
134
- // Determine XML recond element
135
- $record_xml_tag = false;
136
- preg_match_all("%<[\w]+[\s|>]{1}%", $export->options['custom_xml_template_loop'], $matches);
137
- if ( ! empty($matches[0]) ){
138
- $record_xml_tag = preg_replace("%[\s|<|>]%","",array_shift($matches[0]));
139
- }
140
-
141
- $xml_header = PMXE_XMLWriter::preprocess_xml($export->options['custom_xml_template_header']);
142
- $xml_footer = PMXE_XMLWriter::preprocess_xml($export->options['custom_xml_template_footer']);
143
-
144
- break;
145
-
146
- default:
147
- $main_xml_tag = apply_filters('wp_all_export_main_xml_tag', $export->options['main_xml_tag'], $export->id);
148
- $record_xml_tag = apply_filters('wp_all_export_record_xml_tag', $export->options['record_xml_tag'], $export->id);
149
- $xml_header = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" . "\n" . "<".$main_xml_tag.">";
150
- $xml_footer = "</".$main_xml_tag.">";
151
- break;
152
-
153
- }
154
-
155
-
156
- $records_count = 0;
157
- $chunk_records_count = 0;
158
- $fileCount = 1;
159
-
160
- $feed = $xml_header;
161
-
162
- if($export->options['xml_template_type'] == 'custom'){
163
- $outputFileTemplate = str_replace(basename($filepath), str_replace('.xml', '', basename($filepath)) . '-{FILE_COUNT_PLACEHOLDER}.xml', $filepath);
164
- $exportOptions['split_files_list'] = wp_all_export_break_into_files($record_xml_tag, -1, $splitSize, file_get_contents($filepath), null, $outputFileTemplate);
165
-
166
- // Remove first file which just contains the empty data tag
167
- @unlink($exportOptions['split_files_list'][0]);
168
- array_shift($exportOptions['split_files_list']);
169
- }
170
- else {
171
- $file = new PMXE_Chunk($filepath, array('element' => $record_xml_tag, 'encoding' => 'UTF-8'));
172
- // loop through the file until all lines are read
173
- while ($xml = $file->read()) {
174
-
175
- if ( ! empty($xml) )
176
- {
177
- $records_count++;
178
- $chunk_records_count++;
179
- $feed .= $xml;
180
- }
181
-
182
- if ( $chunk_records_count == $splitSize or $records_count == $export->exported ){
183
- $feed .= "\n".$xml_footer;
184
- $outputFile = str_replace(basename($filepath), str_replace('.xml', '', basename($filepath)) . '-' . $fileCount++ . '.xml', $filepath);
185
- file_put_contents($outputFile, $feed);
186
- if ( ! in_array($outputFile, $exportOptions['split_files_list']))
187
- $exportOptions['split_files_list'][] = $outputFile;
188
- $chunk_records_count = 0;
189
- $feed = $xml_header;
190
- }
191
- }
192
- }
193
-
194
- break;
195
- case 'csv':
196
- $in = fopen($filepath, 'r');
197
-
198
- $rowCount = 0;
199
- $fileCount = 1;
200
- $headers = fgetcsv($in);
201
- while (!feof($in)) {
202
- $data = fgetcsv($in);
203
- if (empty($data)) continue;
204
- if (($rowCount % $splitSize) == 0) {
205
- if ($rowCount > 0) {
206
- fclose($out);
207
- }
208
- $outputFile = str_replace(basename($filepath), str_replace('.csv', '', basename($filepath)) . '-' . $fileCount++ . '.csv', $filepath);
209
- if ( ! in_array($outputFile, $exportOptions['split_files_list']))
210
- $exportOptions['split_files_list'][] = $outputFile;
211
-
212
- $out = fopen($outputFile, 'w');
213
- }
214
- if ($data){
215
- if (($rowCount % $splitSize) == 0) {
216
- fputcsv($out, $headers);
217
- }
218
- fputcsv($out, $data);
219
- }
220
- $rowCount++;
221
- }
222
- fclose($in);
223
- fclose($out);
224
-
225
- // convert splitted files into XLS format
226
- if ( ! empty($exportOptions['split_files_list']) && ! empty($export->options['export_to_sheet']) and $export->options['export_to_sheet'] != 'csv' )
227
- {
228
- require_once PMXE_Plugin::ROOT_DIR . '/classes/PHPExcel/IOFactory.php';
229
-
230
- foreach ($exportOptions['split_files_list'] as $key => $file)
231
- {
232
- $objReader = PHPExcel_IOFactory::createReader('CSV');
233
- // If the files uses a delimiter other than a comma (e.g. a tab), then tell the reader
234
- $objReader->setDelimiter($export->options['delimiter']);
235
- // If the files uses an encoding other than UTF-8 or ASCII, then tell the reader
236
- $objPHPExcel = $objReader->load($file);
237
- switch ($export->options['export_to_sheet']){
238
- case 'xls':
239
- $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
240
- $objWriter->save(str_replace(".csv", ".xls", $file));
241
- $exportOptions['split_files_list'][$key] = str_replace(".csv", ".xls", $file);
242
- break;
243
- case 'xlsx':
244
- $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
245
- $objWriter->save(str_replace(".csv", ".xlsx", $file));
246
- $exportOptions['split_files_list'][$key] = str_replace(".csv", ".xlsx", $file);
247
- break;
248
- }
249
- @unlink($file);
250
- }
251
- }
252
-
253
- break;
254
-
255
- default:
256
-
257
- break;
258
- }
259
-
260
- $export->set(array('options' => $exportOptions))->save();
261
- }
262
- }
263
-
264
- // convert CSV to XLS
265
- if ( @file_exists($filepath) and $export->options['export_to'] == 'csv' && ! empty($export->options['export_to_sheet']) and $export->options['export_to_sheet'] != 'csv')
266
- {
267
-
268
- require_once PMXE_Plugin::ROOT_DIR . '/classes/PHPExcel/IOFactory.php';
269
-
270
- $objReader = PHPExcel_IOFactory::createReader('CSV');
271
- // If the files uses a delimiter other than a comma (e.g. a tab), then tell the reader
272
- $objReader->setDelimiter($export->options['delimiter']);
273
- // If the files uses an encoding other than UTF-8 or ASCII, then tell the reader
274
-
275
- $objPHPExcel = $objReader->load($filepath);
276
-
277
- switch ($export->options['export_to_sheet']) {
278
- case 'xls':
279
- $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
280
- $objWriter->save(str_replace(".csv", ".xls", $filepath));
281
- @unlink($filepath);
282
- $filepath = str_replace(".csv", ".xls", $filepath);
283
- break;
284
- case 'xlsx':
285
- $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
286
- $objWriter->save(str_replace(".csv", ".xlsx", $filepath));
287
- @unlink($filepath);
288
- $filepath = str_replace(".csv", ".xlsx", $filepath);
289
- break;
290
- }
291
-
292
- $exportOptions = $export->options;
293
- $exportOptions['filepath'] = wp_all_export_get_relative_path($filepath);
294
- $export->set(array('options' => $exportOptions))->save();
295
-
296
- $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
297
-
298
- if ( ! $is_secure_import ){
299
- $wp_uploads = wp_upload_dir();
300
- $wp_filetype = wp_check_filetype(basename($filepath), null );
301
- $attachment_data = array(
302
- 'guid' => $wp_uploads['baseurl'] . '/' . _wp_relative_upload_path( $filepath ),
303
- 'post_mime_type' => $wp_filetype['type'],
304
- 'post_title' => preg_replace('/\.[^.]+$/', '', basename($filepath)),
305
- 'post_content' => '',
306
- 'post_status' => 'inherit'
307
- );
308
- if ( ! empty($export->attch_id) )
309
- {
310
- $attach_id = $export->attch_id;
311
- $attachment = get_post($attach_id);
312
- if ($attachment)
313
- {
314
- update_attached_file( $attach_id, $filepath );
315
- wp_update_attachment_metadata( $attach_id, $attachment_data );
316
- }
317
- else
318
- {
319
- $attach_id = wp_insert_attachment( $attachment_data, PMXE_Plugin::$session->file );
320
- }
321
- }
322
- }
323
-
324
- }
325
-
326
- // make a temporary copy of current file
327
- if ( empty($export->parent_id) and @file_exists($filepath) and @copy($filepath, str_replace(basename($filepath), '', $filepath) . 'current-' . basename($filepath)))
328
- {
329
- $exportOptions = $export->options;
330
- $exportOptions['current_filepath'] = str_replace(basename($filepath), '', $filepath) . 'current-' . basename($filepath);
331
- $export->set(array('options' => $exportOptions))->save();
332
- }
333
-
334
- $generateBundle = apply_filters('wp_all_export_generate_bundle', true);
335
-
336
- if($generateBundle) {
337
-
338
- // genereta export bundle
339
- $export->generate_bundle();
340
-
341
- if ( ! empty($export->parent_id) )
342
- {
343
- $parent_export = new PMXE_Export_Record();
344
- $parent_export->getById($export->parent_id);
345
- if ( ! $parent_export->isEmpty() )
346
- {
347
- $parent_export->generate_bundle(true);
348
- }
349
- }
350
- }
351
-
352
-
353
- // send exported data to zapier.com
354
- $subscriptions = get_option('zapier_subscribe', array());
355
- if ( ! empty($subscriptions) and empty($export->parent_id))
356
- {
357
-
358
- $wp_uploads = wp_upload_dir();
359
-
360
- $fileurl = str_replace($wp_uploads['basedir'], $wp_uploads['baseurl'], $filepath);
361
-
362
- $response = array(
363
- 'website_url' => home_url(),
364
- 'export_id' => $export->id,
365
- 'export_name' => $export->friendly_name,
366
- 'file_name' => basename($filepath),
367
- 'file_type' => wp_all_export_get_export_format($export->options),
368
- 'post_types_exported' => empty($export->options['cpt']) ? $export->options['wp_query'] : implode($export->options['cpt'], ','),
369
- 'export_created_date' => $export->registered_on,
370
- 'export_last_run_date' => date('Y-m-d H:i:s'),
371
- 'export_trigger_type' => empty($_GET['export_key']) ? 'manual' : 'cron',
372
- 'records_exported' => $export->exported,
373
- 'export_file' => ''
374
- );
375
-
376
- if (file_exists($filepath))
377
- {
378
- $response['export_file_url'] = $fileurl;
379
- $response['status'] = 200;
380
- $response['message'] = 'OK';
381
- }
382
- else
383
- {
384
- $response['export_file_url'] = '';
385
- $response['status'] = 300;
386
- $response['message'] = 'File doesn\'t exist';
387
- }
388
-
389
- $response = apply_filters('wp_all_export_zapier_response', $response);
390
-
391
- foreach ($subscriptions as $zapier)
392
- {
393
- if (empty($zapier['target_url'])) continue;
394
-
395
- wp_remote_post( $zapier['target_url'], array(
396
- 'method' => 'POST',
397
- 'timeout' => 45,
398
- 'redirection' => 5,
399
- 'httpversion' => '1.0',
400
- 'blocking' => true,
401
- 'headers' => array(
402
- 'Content-Type' => 'application/json'
403
- ),
404
- 'body' => "[".json_encode($response)."]",
405
- 'cookies' => array()
406
- )
407
- );
408
- }
409
- }
410
-
411
- // clean session
412
- if ( ! empty(PMXE_Plugin::$session) and PMXE_Plugin::$session->has_session() )
413
- {
414
- PMXE_Plugin::$session->clean_session( $export->id );
415
- }
416
- }
417
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/actions/pmxe_before_export.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
-
3
- function pmxe_pmxe_before_export($export_id)
4
- {
5
- $export = new PMXE_Export_Record();
6
- $export->getById($export_id);
7
-
8
- if ( ! $export->isEmpty() )
9
- {
10
- if ( ! $export->options['export_only_new_stuff'] )
11
- {
12
- $postList = new PMXE_Post_List();
13
- $missingPosts = $postList->getBy(array('export_id' => $export_id, 'iteration !=' => --$export->iteration));
14
- $missing_ids = array();
15
- if ( ! $missingPosts->isEmpty() ):
16
-
17
- foreach ($missingPosts as $missingPost)
18
- {
19
- $missing_ids[] = $missingPost['post_id'];
20
- }
21
-
22
- endif;
23
-
24
- if ( ! empty($missing_ids))
25
- {
26
- global $wpdb;
27
- // Delete records form pmxe_posts
28
- $sql = "DELETE FROM " . PMXE_Plugin::getInstance()->getTablePrefix() . "posts WHERE post_id IN (" . implode(',', $missing_ids) . ") AND export_id = %d";
29
- $wpdb->query(
30
- $wpdb->prepare($sql, $export->id)
31
- );
32
- }
33
- }
34
-
35
- if ( empty($export->parent_id) )
36
- {
37
- delete_option( 'wp_all_export_queue_' . $export->id );
38
- }
39
-
40
- delete_option( 'wp_all_export_acf_flexible_' . $export->id );
41
- }
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/actions/pmxe_exported_post.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
-
3
- function pmxe_pmxe_exported_post( $pid, $exportRecord )
4
- {
5
- // do not associate exported record with child export
6
- if ( ! empty($exportRecord->parent_id) ) return;
7
-
8
- $postRecord = new PMXE_Post_Record();
9
- $postRecord->getBy(array(
10
- 'post_id' => $pid,
11
- 'export_id' => XmlExportEngine::$exportID
12
- ));
13
-
14
- if ($postRecord->isEmpty())
15
- {
16
- $postRecord->set(array(
17
- 'post_id' => $pid,
18
- 'export_id' => XmlExportEngine::$exportID,
19
- 'iteration' => $exportRecord->iteration
20
- ))->insert();
21
- }
22
- else
23
- {
24
- $postRecord->set(array('iteration' => $exportRecord->iteration))->update();
25
- }
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/actions/wp_ajax_dismiss_export_warnings.php DELETED
@@ -1,23 +0,0 @@
1
- <?php
2
-
3
- function pmxe_wp_ajax_dismiss_export_warnings(){
4
-
5
- if ( ! check_ajax_referer( 'wp_all_export_secure', 'security', false )){
6
- exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
7
- }
8
-
9
- if ( ! current_user_can( PMXE_Plugin::$capabilities ) ){
10
- exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
11
- }
12
-
13
- $input = new PMXE_Input();
14
-
15
- $post = $input->post('data', false);
16
-
17
- if ( ! empty($post) && ! empty($post['export_id'])){
18
- $option_name = 'wpae_dismiss_warnings_' . $post['export_id'];
19
- update_option($option_name, 1);
20
- }
21
-
22
- exit(json_encode(array('result' => true)));
23
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/actions/wp_ajax_generate_zapier_api_key.php DELETED
@@ -1,18 +0,0 @@
1
- <?php
2
-
3
- function pmxe_wp_ajax_generate_zapier_api_key(){
4
-
5
- if ( ! check_ajax_referer( 'wp_all_export_secure', 'security', false )){
6
- exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
7
- }
8
-
9
- if ( ! current_user_can( PMXE_Plugin::$capabilities ) ){
10
- exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
11
- }
12
-
13
- $api_key = wp_all_export_rand_char(32);
14
-
15
- PMXE_Plugin::getInstance()->updateOption('zapier_api_key', $api_key);
16
-
17
- exit(json_encode(array('api_key' => $api_key)));
18
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/actions/wp_ajax_redirect_after_addon_installed.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
-
3
- function pmxe_wp_ajax_redirect_after_addon_installed(){
4
-
5
- if ( ! check_ajax_referer( 'wp_all_export_secure', 'security', false )){
6
- exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
7
- }
8
-
9
- if ( ! current_user_can( PMXE_Plugin::$capabilities ) ){
10
- exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
11
- }
12
-
13
- $input = new PMXE_Input();
14
-
15
- $addon = $input->post('addon', false);
16
-
17
- $result = false;
18
-
19
- if ($addon && defined( 'WP_PLUGIN_DIR' )) {
20
- $result = file_exists(trailingslashit(WP_PLUGIN_DIR) . $addon);
21
- }
22
-
23
- exit(json_encode(array('result' => $result)));
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/actions/wp_ajax_save_scheduling.php DELETED
@@ -1,56 +0,0 @@
1
- <?php
2
-
3
- use Wpae\Scheduling\Interval\ScheduleTime;
4
- use Wpae\Scheduling\Scheduling;
5
-
6
- /**
7
- * @throws Exception
8
- */
9
- function pmxe_wp_ajax_save_scheduling()
10
- {
11
-
12
- if (!check_ajax_referer('wp_all_export_secure', 'security', false)) {
13
- exit(__('Security check', 'wp_all_export_plugin'));
14
- }
15
-
16
- if (!current_user_can(PMXE_Plugin::$capabilities)) {
17
- exit(__('Security check', 'wp_all_export_plugin'));
18
- }
19
-
20
- $elementId = $_POST['element_id'];
21
-
22
- $post = $_POST;
23
-
24
- foreach($post['scheduling_times'] as $schedulingTime) {
25
- if(!preg_match('/^(0?[1-9]|1[012])(:[0-5]\d)[APap][mM]$/', $schedulingTime) && $schedulingTime != '') {
26
- header('HTTP/1.1 400 Bad request', true, 400);
27
- die('Invalid times provided');
28
- }
29
- }
30
-
31
- try{
32
- $scheduling = Scheduling::create();
33
- $scheduling->handleScheduling($elementId, $post);
34
- } catch (\Wpae\Scheduling\Exception\SchedulingHttpException $e) {
35
- header('HTTP/1.1 503 Service unavailable', true, 503);
36
- echo json_encode(array('success' => false));
37
-
38
- die;
39
- }
40
-
41
- $export = new PMXE_Export_Record();
42
- $export->getById($elementId);
43
- $export->set(array('options' => array_merge($export->options, $post)));
44
- $export->save();
45
-
46
- echo json_encode(array('success' => true));
47
- die;
48
- }
49
-
50
- /**
51
- * @return bool
52
- */
53
- function convertStringToBoolean($string)
54
- {
55
- return ($string == 'true' || $string == 1 || $string === true) ? true : false;
56
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/actions/wp_ajax_scheduling_dialog_content.php DELETED
@@ -1,853 +0,0 @@
1
- <?php
2
-
3
- function pmxe_wp_ajax_scheduling_dialog_content()
4
- {
5
-
6
- if (!check_ajax_referer('wp_all_export_secure', 'security', false)) {
7
- exit(json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))));
8
- }
9
-
10
- if (!current_user_can(PMXE_Plugin::$capabilities)) {
11
- exit(json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))));
12
- }
13
-
14
- $export_id = $_POST['id'];
15
- $export = new PMXE_Export_Record();
16
- $export->getById($export_id);
17
- if (!$export) {
18
- throw new Exception('Export not found');
19
- }
20
- $post = $export->options;
21
-
22
- $hasActiveLicense = PMXE_Plugin::hasActiveSchedulingLicense();
23
-
24
- $options = \PMXE_Plugin::getInstance()->getOption();
25
-
26
- $scheduling = \Wpae\Scheduling\Scheduling::create();
27
-
28
- $cron_job_key = PMXE_Plugin::getInstance()->getOption('cron_job_key');
29
-
30
- if (!isset($post['scheduling_enable'])) {
31
- $post['scheduling_enable'] = 0;
32
- }
33
-
34
- if (!isset($post['scheduling_timezone'])) {
35
- $post['scheduling_timezone'] = 'UTC';
36
- }
37
-
38
- if (!isset($post['scheduling_run_on'])) {
39
- $post['scheduling_run_on'] = 'weekly';
40
- }
41
-
42
- if (!isset($post['scheduling_times'])) {
43
- $post['scheduling_times'] = array();
44
- }
45
- ?>
46
-
47
- <style type="text/css">
48
- .days-of-week {
49
- margin-left: 5px;
50
- }
51
-
52
- .days-of-week li {
53
- border: 1px solid #ccc;
54
- border-radius: 5px;
55
- padding: 10px 30px;;
56
- display: inline-block;
57
- margin-right: 10px;
58
- cursor: pointer;
59
- font-weight: bold;
60
- width: 26px;
61
- text-align: center;
62
- height: 16px;
63
- color: rgb(68, 68, 68);
64
- float: left;
65
- }
66
-
67
- .days-of-week li.selected {
68
- color: #fff;
69
- background-color: #425F9A;
70
- border-color: #585858;
71
- }
72
-
73
- #weekly, #monthly {
74
- height: 20px;
75
- margin-left: 5px;
76
- margin-top: 10px;
77
- }
78
-
79
- .timepicker {
80
- padding: 10px;
81
- border-radius: 5px;
82
- margin-right: 10px;
83
- }
84
-
85
- #times {
86
- margin-top: 5px;
87
- width: 766px;
88
- }
89
-
90
- #times input {
91
- margin-top: 10px;
92
- margin-left: 0;
93
- float: left;
94
- width: 88px;
95
-
96
- }
97
-
98
- #times input.error {
99
- border-color: red !important;
100
- }
101
-
102
- .subscribe {
103
-
104
- }
105
-
106
- .subscribe .button-container {
107
- float: left;
108
- width: 150px;
109
- }
110
-
111
- .subscribe .text-container {
112
- float: left;
113
- width: auto;
114
- }
115
-
116
- .subscribe .text-container p {
117
- margin: 0;
118
- color: #425F9A;
119
- font-size: 14px;
120
- font-weight: bold;
121
- }
122
-
123
- .subscribe .text-container p a {
124
- color: #425F9A;
125
- text-decoration: underline;
126
- }
127
-
128
- .save {
129
- padding-left: 5px;
130
- padding-top: 5px;
131
- width: auto;
132
- }
133
-
134
- .ui-timepicker-wrapper {
135
- width: 86px;
136
- }
137
-
138
- .easing-spinner {
139
- width: 30px;
140
- height: 30px;
141
- position: relative;
142
- display: inline-block;
143
-
144
- margin-top: 7px;
145
- margin-left: -25px;
146
-
147
- float: left;
148
- }
149
-
150
- .double-bounce1, .double-bounce2 {
151
- width: 100%;
152
- height: 100%;
153
- border-radius: 50%;
154
- background-color: #fff;
155
- opacity: 0.6;
156
- position: absolute;
157
- top: 0;
158
- left: 0;
159
-
160
- -webkit-animation: sk-bounce 2.0s infinite ease-in-out;
161
- animation: sk-bounce 2.0s infinite ease-in-out;
162
- }
163
-
164
- .double-bounce2 {
165
- -webkit-animation-delay: -1.0s;
166
- animation-delay: -1.0s;
167
- }
168
-
169
- .wpae-save-button svg {
170
- margin-top: 7px;
171
- margin-left: -215px;
172
- display: inline-block;
173
- position: relative;
174
- }
175
-
176
- @-webkit-keyframes sk-bounce {
177
- 0%, 100% {
178
- -webkit-transform: scale(0.0)
179
- }
180
- 50% {
181
- -webkit-transform: scale(1.0)
182
- }
183
- }
184
-
185
- @keyframes sk-bounce {
186
- 0%, 100% {
187
- transform: scale(0.0);
188
- -webkit-transform: scale(0.0);
189
- }
190
- 50% {
191
- transform: scale(1.0);
192
- -webkit-transform: scale(1.0);
193
- }
194
- }
195
-
196
- #add-subscription-field {
197
- position: absolute;
198
- left: -155px;
199
- top: -1px;
200
- height: 46px;
201
- border-radius: 5px;
202
- font-size: 17px;
203
- padding-left: 10px;
204
- display: none;
205
- width: 140px;
206
- }
207
-
208
- #find-subscription-link {
209
- position: absolute;
210
- left: 133px;
211
- top: 14px;
212
- height: 30px;
213
- width: 300px;
214
- display: none;
215
- }
216
-
217
- #find-subscription-link a {
218
- display: block;
219
- width: 100%;
220
- height: 46px;
221
- white-space: nowrap;
222
- }
223
-
224
- #weekly li.error, #monthly li.error {
225
- border-color: red;
226
- }
227
-
228
- .chosen-single {
229
- margin-bottom: 0 !important;
230
- }
231
-
232
- .chosen-container.chosen-with-drop .chosen-drop {
233
- margin-top: -3px;
234
- }
235
-
236
- .ui-timepicker-wrapper {
237
- z-index: 999999;
238
- }
239
-
240
- .wpallexport-scheduling-dialog h4 {
241
- font-size: 14px;
242
- margin-bottom: 5px;
243
- color: #40acad;
244
- text-decoration: none;
245
- margin-left: 0;
246
- }
247
-
248
- .manual-scheduling {
249
- margin-left: 26px;
250
- }
251
- .chosen-container .chosen-results {
252
-
253
- margin: 0 4px 4px 0 !important;
254
- }
255
- </style>
256
-
257
-
258
- <script type="text/javascript">
259
- (function ($) {
260
- $(function () {
261
-
262
- var hasActiveLicense = <?php echo $hasActiveLicense ? 'true' : 'false'; ?>;
263
-
264
- $(document).ready(function () {
265
-
266
- function openSchedulingAccordeonIfClosed() {
267
- if ($('.wpallexport-file-options').hasClass('closed')) {
268
- // Open accordion
269
- $('#scheduling-title').trigger('click');
270
- }
271
- }
272
-
273
- window.pmxeValidateSchedulingForm = function () {
274
-
275
- var schedulingEnabled = $('input[name="scheduling_enable"]:checked').val() == 1;
276
-
277
- if (!schedulingEnabled) {
278
- return {
279
- isValid: true
280
- };
281
- }
282
-
283
- var runOn = $('input[name="scheduling_run_on"]:checked').val();
284
-
285
- // Validate weekdays
286
- if (runOn == 'weekly') {
287
- var weeklyDays = $('#weekly_days').val();
288
-
289
- if (weeklyDays == '') {
290
- $('#weekly li').addClass('error');
291
- return {
292
- isValid: false,
293
- message: 'Please select at least a day on which the export should run'
294
- }
295
- }
296
- } else if (runOn == 'monthly') {
297
- var monthlyDays = $('#monthly_days').val();
298
-
299
- if (monthlyDays == '') {
300
- $('#monthly li').addClass('error');
301
- return {
302
- isValid: false,
303
- message: 'Please select at least a day on which the export should run'
304
- }
305
- }
306
- }
307
-
308
- // Validate times
309
- var timeValid = true;
310
- var timeMessage = 'Please select at least a time for the export to run';
311
- var timeInputs = $('.timepicker');
312
- var timesHasValues = false;
313
-
314
- timeInputs.each(function (key, $elem) {
315
-
316
- if ($(this).val() !== '') {
317
- timesHasValues = true;
318
- }
319
-
320
- if (!$(this).val().match(/^(0?[1-9]|1[012])(:[0-5]\d)[APap][mM]$/) && $(this).val() != '') {
321
- $(this).addClass('error');
322
- timeValid = false;
323
- } else {
324
- $(this).removeClass('error');
325
- }
326
- });
327
-
328
- if (!timesHasValues) {
329
- timeValid = false;
330
- $('.timepicker').addClass('error');
331
- }
332
-
333
- if (!timeValid) {
334
- return {
335
- isValid: false,
336
- message: timeMessage
337
- };
338
- }
339
-
340
- return {
341
- isValid: true
342
- };
343
- };
344
-
345
- $('#weekly li').click(function () {
346
-
347
- $('#weekly li').removeClass('error');
348
-
349
- if ($(this).hasClass('selected')) {
350
- $(this).removeClass('selected');
351
- } else {
352
- $(this).addClass('selected');
353
- }
354
-
355
- $('#weekly_days').val('');
356
-
357
- $('#weekly li.selected').each(function () {
358
- var val = $(this).data('day');
359
- $('#weekly_days').val($('#weekly_days').val() + val + ',');
360
- });
361
-
362
- $('#weekly_days').val($('#weekly_days').val().slice(0, -1));
363
-
364
- });
365
-
366
- $('#monthly li').click(function () {
367
-
368
- $('#monthly li').removeClass('error');
369
- $(this).parent().parent().find('.days-of-week li').removeClass('selected');
370
- $(this).addClass('selected');
371
-
372
- $('#monthly_days').val($(this).data('day'));
373
- });
374
-
375
- $('input[name="scheduling_run_on"]').change(function () {
376
- var val = $('input[name="scheduling_run_on"]:checked').val();
377
- if (val == "weekly") {
378
-
379
- $('#weekly').slideDown({
380
- queue: false
381
- });
382
- $('#monthly').slideUp({
383
- queue: false
384
- });
385
-
386
- } else if (val == "monthly") {
387
-
388
- $('#weekly').slideUp({
389
- queue: false
390
- });
391
- $('#monthly').slideDown({
392
- queue: false
393
- });
394
- }
395
- });
396
-
397
- $('.timepicker').timepicker();
398
-
399
- var selectedTimes = [];
400
-
401
- var onTimeSelected = function () {
402
-
403
- selectedTimes.push([$(this).val(), $(this).val() + 1]);
404
-
405
- var isLastChild = $(this).is(':last-child');
406
- if (isLastChild) {
407
- $(this).parent().append('<input class="timepicker" name="scheduling_times[]" style="display: none;" type="text" />');
408
- $('.timepicker:last-child').timepicker({
409
- 'disableTimeRanges': selectedTimes
410
- });
411
- $('.timepicker:last-child').fadeIn('fast');
412
- $('.timepicker').on('changeTime', onTimeSelected);
413
- }
414
- };
415
-
416
- $('.timepicker').on('changeTime', onTimeSelected);
417
-
418
- $('#timezone').chosen({width: '284px'});
419
-
420
- $('.wpae-save-button').click(function (e) {
421
-
422
- var initialValue = $(this).find('.save-text').html();
423
- var schedulingEnable = $('input[name="scheduling_enable"]:checked').val();
424
- console.log(schedulingEnable);
425
-
426
- if (!hasActiveLicense) {
427
- if (!$(this).data('iunderstand') && schedulingEnable) {
428
- $('#no-subscription').slideDown();
429
- $(this).find('.save-text').html('<?php echo _e('I Understand');?>');
430
- $(this).find('.save-text').css('left', '100px');
431
- $(this).data('iunderstand', 1);
432
-
433
- openSchedulingAccordeonIfClosed();
434
- e.preventDefault();
435
- return;
436
- } else {
437
- var submitEvent = $.Event('wpae-scheduling-options-form:submit');
438
- $(document).trigger(submitEvent);
439
-
440
- return;
441
- }
442
- }
443
-
444
- // Don't process scheduling
445
- if (!schedulingEnable) {
446
- var submitEvent = $.Event('wpae-scheduling-options-form:submit');
447
- $(document).trigger(submitEvent);
448
-
449
- return;
450
- }
451
-
452
- var validationResponse = pmxeValidateSchedulingForm();
453
- if (!validationResponse.isValid) {
454
-
455
- openSchedulingAccordeonIfClosed();
456
- e.preventDefault();
457
- return false;
458
- }
459
-
460
- $(this).find('.easing-spinner').toggle();
461
-
462
- var $button = $(this);
463
-
464
- var formData = $('#scheduling-form :input').serializeArray();
465
-
466
- formData.push({name: 'security', value: wp_all_export_security});
467
- formData.push({name: 'action', value: 'save_scheduling'});
468
- formData.push({name: 'element_id', value: <?php echo $export_id; ?>});
469
- formData.push({name: 'scheduling_enable', value: schedulingEnable});
470
-
471
- $.ajax({
472
- type: 'POST',
473
- url: ajaxurl,
474
- data: formData,
475
- success: function (response) {
476
- $button.find('.easing-spinner').toggle();
477
- $button.find('.save-text').html(initialValue);
478
- $button.find('svg').show();
479
-
480
- setTimeout(function () {
481
- var submitEvent = $.Event('wpae-scheduling-options-form:submit');
482
- $(document).trigger(submitEvent);
483
- }, 1000);
484
-
485
- },
486
- error: function () {
487
- $button.find('.easing-spinner').toggle();
488
- $button.find('.save-text').html(initialValue);
489
- }
490
- });
491
- });
492
-
493
- <?php if($post['scheduling_timezone'] == 'UTC') {
494
- ?>
495
- var timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
496
-
497
- if($('#timezone').find("option:contains('"+ timeZone +"')").length != 0){
498
- $('#timezone').trigger("chosen:updated");
499
- $('#timezone').val(timeZone);
500
- $('#timezone').trigger("chosen:updated");
501
- }else{
502
- var parts = timeZone.split('/');
503
- var lastPart = parts[parts.length-1];
504
- var opt = $('#timezone').find("option:contains('"+ lastPart +"')");
505
-
506
- $('#timezone').val(opt.val());
507
- $('#timezone').trigger("chosen:updated");
508
- }
509
-
510
- <?php
511
- }
512
- ?>
513
-
514
- var saveSubscription = false;
515
-
516
- $('#add-subscription').click(function () {
517
-
518
- $('#add-subscription-field').show();
519
- $('#add-subscription-field').animate({width: '400px'}, 225);
520
- $('#add-subscription-field').animate({left: '-1px'}, 225);
521
- $('#subscribe-button .button-subscribe').css('background-color', '#46ba69');
522
- $('.text-container p').fadeOut();
523
-
524
- setTimeout(function () {
525
- $('#find-subscription-link').show();
526
- $('#find-subscription-link').animate({left: '410px'}, 300, 'swing');
527
- }, 225);
528
- $('.subscribe-button-text').html('<?php _e('Activate'); ?>');
529
- saveSubscription = true;
530
- return false;
531
- });
532
-
533
- $('#subscribe-button').click(function () {
534
-
535
- if (saveSubscription) {
536
- $('#subscribe-button .easing-spinner').show();
537
-
538
- var license = $('#add-subscription-field').val();
539
- $.ajax({
540
- url: ajaxurl + '?action=wpae_api&q=schedulingLicense/saveSchedulingLicense&security=<?php echo wp_create_nonce("wp_all_export_secure");?>',
541
- type: "POST",
542
- data: {
543
- license: license
544
- },
545
- dataType: "json",
546
- success: function (response) {
547
-
548
- $('#subscribe-button .button-subscribe').css('background-color', '#425f9a');
549
-
550
- if (response.success) {
551
- hasActiveLicense = true;
552
- $('#subscribe-button .easing-spinner').hide();
553
- $('#subscribe-button svg.success').show();
554
- $('#subscribe-button svg.success').fadeOut(3000, function () {
555
- $('.subscribe').hide({queue: false});
556
- $('#subscribe-filler').show({queue: false});
557
- });
558
-
559
- $('.save-changes').removeClass('disabled');
560
- window.pmxeHasSchedulingSubscription = true;
561
-
562
- $('.wpai-no-license').hide();
563
- $('.wpai-license').show();
564
- } else {
565
-
566
- $('#subscribe-button .easing-spinner').hide();
567
- $('#subscribe-button svg.error').show();
568
- $('.subscribe-button-text').html('<?php _e('Subscribe'); ?>');
569
-
570
- $('#subscribe-button svg.error').fadeOut(3000, function () {
571
- $('#subscribe-button svg.error').hide({queue: false});
572
-
573
- });
574
-
575
- $('#add-subscription').html('<?php _e('Invalid license, try again?');?>');
576
- $('.text-container p').fadeIn();
577
-
578
- $('#find-subscription-link').animate({width: 'toggle'}, 300, 'swing');
579
-
580
- setTimeout(function () {
581
- $('#add-subscription-field').animate({width: '140px'}, 225);
582
- $('#add-subscription-field').animate({left: '-155px'}, 225);
583
- }, 300);
584
-
585
- $('#add-subscription-field').val('');
586
-
587
- $('#subscribe-button-text').html('<?php _e('Subscribe'); ?>');
588
- saveSubscription = false;
589
- }
590
- }
591
- });
592
-
593
- return false;
594
- }
595
- });
596
- });
597
- });
598
- // help scheduling template
599
- $('.help_scheduling').click(function () {
600
-
601
- $('.wp-all-export-scheduling-help').css('left', ($(document).width() / 2) - 255).show();
602
- $('#wp-all-export-scheduling-help-inner').css('max-height', $(window).height() - 150).show();
603
- $('.wpallexport-super-overlay').show();
604
- $('.wpallexport-overlay').hide();
605
- $('.wp-pointer').hide();
606
- return false;
607
- });
608
-
609
- $('.wp_all_export_scheduling_help').find('h3').unbind('click').click(function () {
610
- var $action = $(this).find('span').html();
611
- $('.wp_all_export_scheduling_help').find('h3').each(function () {
612
- $(this).find('span').html("+");
613
- });
614
- if ($action == "+") {
615
- $('.wp_all_export_help_tab').slideUp();
616
- $('.wp_all_export_help_tab[rel=' + $(this).attr('id') + ']').slideDown();
617
- $(this).find('span').html("-");
618
- }
619
- else {
620
- $('.wp_all_export_help_tab[rel=' + $(this).attr('id') + ']').slideUp();
621
- $(this).find('span').html("+");
622
- }
623
- });
624
-
625
- $('.wpallexport-super-overlay').click(function () {
626
- $('.wp-all-export-scheduling-help, .wp-all-export-scheduling-help-inner').hide();
627
- $('.wp-pointer').show();
628
- $('.wpallexport-overlay').show();
629
-
630
- $(this).hide();
631
- });
632
-
633
- })(jQuery);
634
-
635
- </script>
636
- <?php require __DIR__ . '/../src/Scheduling/views/CommonJs.php'; ?>
637
- <div id="post-preview" class="wpallexport-preview wpallexport-scheduling-dialog">
638
- <p class="wpallexport-preview-title"><strong>Scheduling Options</strong></p>
639
- <div class="wpallexport-preview-content" style="max-height: 700px; overflow: visible;">
640
-
641
- <div style="margin-bottom: 20px;">
642
- <label>
643
- <input type="radio" name="scheduling_enable"
644
- value="0" <?php if ((isset($post['scheduling_enable']) && $post['scheduling_enable'] == 0) || !isset($post['scheduling_enable'])) { ?> checked="checked" <?php } ?>/>
645
- <h4 style="display: inline-block;"><?php _e('Do Not Schedule'); ?></h4>
646
- </label>
647
- </div>
648
- <div>
649
- <label>
650
- <input type="radio" name="scheduling_enable"
651
- value="1" <?php if ($post['scheduling_enable'] == 1) { ?> checked="checked" <?php } ?>/>
652
- <h4 style="margin: 0; position: relative; display: inline-block;"><?php _e('Automatic Scheduling', PMXE_Plugin::LANGUAGE_DOMAIN); ?>
653
- <span class="connection-icon">
654
- <?php include __DIR__ . '/../src/Scheduling/views/ConnectionIcon.php'; ?>
655
- </span>
656
- <?php if (!$scheduling->checkConnection()) { ?>
657
- <span class="wpai-license wpai-license-text" style="display: inline-block; font-weight: normal; <?php if(!$hasActiveLicense) { ?> display: none; <?php }?> color: #f2b03d; ">Unable to connect - <a target="_blank" style="text-decoration: underline;" href="http://wpallimport.com/support">please contact support</a>.</span>
658
- <?php } ?>
659
- </h4>
660
- </label>
661
- </div>
662
- <form id="scheduling-form">
663
- <div style="margin-bottom: 10px; margin-left:26px;">
664
- <label style="font-size: 13px;">
665
- <?php _e('Run this export on a schedule.'); ?>
666
- </label>
667
- </div>
668
- <div id="automatic-scheduling"
669
- style="margin-left: 21px; <?php if ($post['scheduling_enable'] != 1) { ?> display: none; <?php } ?>">
670
- <div>
671
- <div class="input">
672
- <label style="color: rgb(68,68,68);">
673
- <input
674
- type="radio" <?php if (isset($post['scheduling_run_on']) && $post['scheduling_run_on'] != 'monthly') { ?> checked="checked" <?php } ?>
675
- name="scheduling_run_on" value="weekly"
676
- checked="checked"/> <?php _e('Every week on...', PMXE_Plugin::LANGUAGE_DOMAIN); ?>
677
- </label>
678
- </div>
679
- <input type="hidden" style="width: 500px;" name="scheduling_weekly_days"
680
- value="<?php echo $post['scheduling_weekly_days']; ?>" id="weekly_days"/>
681
- <?php
682
- if (isset($post['scheduling_weekly_days'])) {
683
- $weeklyArray = explode(',', $post['scheduling_weekly_days']);
684
- } else {
685
- $weeklyArray = array();
686
- }
687
- ?>
688
- <ul class="days-of-week" id="weekly"
689
- style="<?php if ($post['scheduling_run_on'] == 'monthly') { ?> display: none; <?php } ?>">
690
- <li data-day="0" <?php if (in_array('0', $weeklyArray)) { ?> class="selected" <?php } ?>>
691
- Mon
692
- </li>
693
- <li data-day="1" <?php if (in_array('1', $weeklyArray)) { ?> class="selected" <?php } ?>>
694
- Tue
695
- </li>
696
- <li data-day="2" <?php if (in_array('2', $weeklyArray)) { ?> class="selected" <?php } ?>>
697
- Wed
698
- </li>
699
- <li data-day="3" <?php if (in_array('3', $weeklyArray)) { ?> class="selected" <?php } ?>>
700
- Thu
701
- </li>
702
- <li data-day="4" <?php if (in_array('4', $weeklyArray)) { ?> class="selected" <?php } ?>>
703
- Fri
704
- </li>
705
- <li data-day="5" <?php if (in_array('5', $weeklyArray)) { ?> class="selected" <?php } ?>>
706
- Sat
707
- </li>
708
- <li data-day="6" <?php if (in_array('6', $weeklyArray)) { ?> class="selected" <?php } ?>>
709
- Sun
710
- </li>
711
- </ul>
712
- </div>
713
- <div style="clear: both;"></div>
714
- <div>
715
- <div class="input">
716
- <label style="color: rgb(68,68,68); margin-top: 5px;">
717
- <input
718
- type="radio" <?php if (isset($post['scheduling_run_on']) && $post['scheduling_run_on'] == 'monthly') { ?> checked="checked" <?php } ?>
719
- name="scheduling_run_on"
720
- value="monthly"/> <?php _e('Every month on the first...', PMXE_Plugin::LANGUAGE_DOMAIN); ?>
721
- </label>
722
- </div>
723
- <input type="hidden" name="scheduling_monthly_days"
724
- value="<?php if(isset($post['scheduling_monthly_days'])) echo $post['scheduling_monthly_days']; ?>" id="monthly_days"/>
725
- <?php
726
- if (isset($post['scheduling_monthly_days'])) {
727
- $monthlyArray = explode(',', $post['scheduling_monthly_days']);
728
- } else {
729
- $monthlyArray = array();
730
- }
731
- ?>
732
- <ul class="days-of-week" id="monthly"
733
- style="<?php if ($post['scheduling_run_on'] != 'monthly') { ?> display: none; <?php } ?>">
734
- <li data-day="0" <?php if (in_array('0', $monthlyArray)) { ?> class="selected" <?php } ?>>
735
- Mon
736
- </li>
737
- <li data-day="1" <?php if (in_array('1', $monthlyArray)) { ?> class="selected" <?php } ?>>
738
- Tue
739
- </li>
740
- <li data-day="2" <?php if (in_array('2', $monthlyArray)) { ?> class="selected" <?php } ?>>
741
- Wed
742
- </li>
743
- <li data-day="3" <?php if (in_array('3', $monthlyArray)) { ?> class="selected" <?php } ?>>
744
- Thu
745
- </li>
746
- <li data-day="4" <?php if (in_array('4', $monthlyArray)) { ?> class="selected" <?php } ?>>
747
- Fri
748
- </li>
749
- <li data-day="5" <?php if (in_array('5', $monthlyArray)) { ?> class="selected" <?php } ?>>
750
- Sat
751
- </li>
752
- <li data-day="6" <?php if (in_array('6', $monthlyArray)) { ?> class="selected" <?php } ?>>
753
- Sun
754
- </li>
755
- </ul>
756
- </div>
757
- <div style="clear: both;"></div>
758
-
759
- <div id="times-container" style="margin-left: 5px;">
760
- <div style="margin-top: 10px; margin-bottom: 5px;">
761
- What times do you want this export to run?
762
- </div>
763
-
764
- <div id="times" style="margin-bottom: 10px;">
765
- <?php if (isset($post['scheduling_times']) && is_array($post['scheduling_times'])) {
766
- foreach ($post['scheduling_times'] as $time) { ?>
767
-
768
- <?php if ($time) { ?>
769
- <input class="timepicker" type="text" name="scheduling_times[]"
770
- value="<?php echo $time; ?>"/>
771
- <?php } ?>
772
- <?php } ?>
773
- <input class="timepicker" type="text" name="scheduling_times[]"/>
774
- <?php } ?>
775
- </div>
776
- <div style="clear: both;"></div>
777
- <div class="timezone-select" style="position:absolute; margin-top: 10px;">
778
- <?php
779
-
780
- $timezoneValue = false;
781
- if ($post['scheduling_timezone']) {
782
- $timezoneValue = $post['scheduling_timezone'];
783
- }
784
-
785
- $timezoneSelect = new \Wpae\Scheduling\Timezone\TimezoneSelect();
786
- echo $timezoneSelect->getTimezoneSelect($timezoneValue);
787
- ?>
788
- </div>
789
- </div>
790
- <div style="height: 60px; margin-top: 30px; <?php if (!$hasActiveLicense) { ?>display: none; <?php } ?>"
791
- id="subscribe-filler">&nbsp;
792
- </div>
793
- <?php
794
- if (!$hasActiveLicense) {
795
- ?>
796
- <div class="subscribe"
797
- style="margin-left: 5px; margin-top: 65px; margin-bottom: 130px; position: relative;">
798
- <div class="button-container">
799
-
800
- <a href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=515704&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=automatic-scheduling"
801
- target="_blank" id="subscribe-button">
802
- <div class="button button-primary button-hero wpallexport-large-button button-subscribe"
803
- style="background-image: none; width: 140px; text-align: center; position: absolute; z-index: 4;">
804
- <svg class="success" width="30" height="30" viewBox="0 0 1792 1792"
805
- xmlns="http://www.w3.org/2000/svg"
806
- style="fill: white; position: absolute; top: 7px; left: 9px; display: none;">
807
- <path
808
- d="M1671 566q0 40-28 68l-724 724-136 136q-28 28-68 28t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28 68-28t68 28l294 295 656-657q28-28 68-28t68 28l136 136q28 28 28 68z"
809
- fill="white"/>
810
- </svg>
811
- <svg class="error" width="30" height="30" viewBox="0 0 1792 1792"
812
- xmlns="http://www.w3.org/2000/svg"
813
- style="fill: red; position: absolute; top: 2px; left: 7px; display: none;">
814
- <path d="M1490 1322q0 40-28 68l-136 136q-28 28-68 28t-68-28l-294-294-294 294q-28 28-68 28t-68-28l-136-136q-28-28-28-68t28-68l294-294-294-294q-28-28-28-68t28-68l136-136q28-28 68-28t68 28l294 294 294-294q28-28 68-28t68 28l136 136q28 28 28 68t-28 68l-294 294 294 294q28 28 28 68z"/>
815
- </svg>
816
- <div class="easing-spinner"
817
- style=" position: absolute; left: 37px; display: none;">
818
- <div class="double-bounce1"></div>
819
- <div class="double-bounce2"></div>
820
- </div>
821
-
822
- <span class="subscribe-button-text">
823
- <?php _e('Subscribe'); ?>
824
- </span>
825
- </div>
826
- </a>
827
- </div>
828
- <div class="text-container" style="position: absolute; left: 150px; top: 2px;">
829
- <p><?php _e('Get automatic scheduling for unlimited sites, just $9/mo.'); ?></p>
830
- <p><?php _e('Have a license?'); ?>
831
- <a href="#"
832
- id="add-subscription"><?php _e('Register this site.'); ?></a> <?php _e('Questions?'); ?>
833
- <a href="#" class="help_scheduling">Read more.</a>
834
- </p>
835
- <input type="password" id="add-subscription-field"
836
- style="position: absolute; z-index: 2; top: -4px; font-size:14px;"
837
- placeholder="<?php _e('Enter your license', PMXE_Plugin::LANGUAGE_DOMAIN); ?>"/>
838
- <div style="position: absolute;" id="find-subscription-link"><a
839
- href="http://www.wpallimport.com/portal/automatic-scheduling/"
840
- target="_blank"><?php _e('Find your license.'); ?></a></div>
841
- </div>
842
- </div>
843
- <?php
844
- } ?>
845
- </div>
846
-
847
- </form>
848
- <?php require __DIR__ . '/../src/Scheduling/views/ManualScheduling.php'; ?>
849
- </div>
850
- </div>
851
- <?php
852
- wp_die();
853
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/actions/wp_ajax_wpae_available_rules.php DELETED
@@ -1,106 +0,0 @@
1
- <?php
2
-
3
- function pmxe_wp_ajax_wpae_available_rules(){
4
-
5
- if ( ! check_ajax_referer( 'wp_all_export_secure', 'security', false )){
6
- exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
7
- }
8
-
9
- if ( ! current_user_can( PMXE_Plugin::$capabilities ) ){
10
- exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
11
- }
12
-
13
- ob_start();
14
-
15
- $input = new PMXE_Input();
16
-
17
- $post = $input->post('data', array());
18
-
19
- ?>
20
- <select id="wp_all_export_rule">
21
- <option value=""><?php _e('Select Rule', 'wp_all_export_plugin'); ?></option>
22
- <?php
23
- if (strpos($post['selected'], 'tx_') === 0 || strpos($post['selected'], 'product_tx') === 0){
24
- ?>
25
-
26
- <!-- Taxonomies -->
27
- <option value="in"><?php echo __('In', 'wp_all_export_plugin') . ' ' . ucwords(str_replace(array("product_tx", "tx_", "_"), array("", "", " "), $post['selected'])); ?></option>
28
- <option value="not_in"><?php echo __('Not In', 'wp_all_export_plugin') . ' ' . ucwords(str_replace(array("product_tx", "tx_", "_"), array("", "", " "), $post['selected'])); ?></option>
29
-
30
- <!-- Custom Fields -->
31
- <!--option value="between">BETWEEN</option-->
32
-
33
- <?php
34
- }
35
- elseif( in_array($post['selected'], array('post_date', 'post_modified', 'user_registered', 'comment_date', 'cf__completed_date')) )
36
- {
37
- ?>
38
- <option value="equals"><?php _e('equals', 'wp_all_export_plugin'); ?></option>
39
- <option value="not_equals"><?php _e("doesn't equal", 'wp_all_export_plugin'); ?></option>
40
- <option value="greater"><?php _e('newer than', 'wp_all_export_plugin');?></option>
41
- <option value="equals_or_greater"><?php _e('equal to or newer than', 'wp_all_export_plugin'); ?></option>
42
- <option value="less"><?php _e('older than', 'wp_all_export_plugin'); ?></option>
43
- <option value="equals_or_less"><?php _e('equal to or older than', 'wp_all_export_plugin'); ?></option>
44
-
45
- <option value="contains"><?php _e('contains', 'wp_all_export_plugin'); ?></option>
46
- <option value="not_contains"><?php _e("doesn't contain", 'wp_all_export_plugin'); ?></option>
47
- <option value="is_empty"><?php _e('is empty', 'wp_all_export_plugin'); ?></option>
48
- <option value="is_not_empty"><?php _e('is not empty', 'wp_all_export_plugin'); ?></option>
49
- <?php
50
- }
51
- elseif( in_array($post['selected'], array('wp_capabilities')))
52
- {
53
- ?>
54
- <option value="contains"><?php _e('contains', 'wp_all_export_plugin'); ?></option>
55
- <option value="not_contains"><?php _e("doesn't contain", 'wp_all_export_plugin'); ?></option>
56
- <?php
57
- }
58
- elseif ( in_array($post['selected'], array('user_login', 'user_nicename', 'user_role', 'user_email', 'display_name', 'first_name', 'last_name', 'nickname', 'description',
59
- 'post_status', 'post_title', 'post_content', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_agent',
60
- 'comment_type', 'comment_content') ) )
61
- {
62
- ?>
63
- <option value="equals"><?php _e('equals', 'wp_all_export_plugin'); ?></option>
64
- <option value="not_equals"><?php _e("doesn't equal", 'wp_all_export_plugin'); ?></option>
65
- <option value="contains"><?php _e('contains', 'wp_all_export_plugin'); ?></option>
66
- <option value="not_contains"><?php _e("doesn't contain", 'wp_all_export_plugin'); ?></option>
67
- <option value="is_empty"><?php _e('is empty', 'wp_all_export_plugin'); ?></option>
68
- <option value="is_not_empty"><?php _e('is not empty', 'wp_all_export_plugin'); ?></option>
69
- <?php
70
- }
71
- elseif ( in_array($post['selected'], array('term_parent_slug') ) )
72
- {
73
- ?>
74
- <option value="equals"><?php _e('equals', 'wp_all_export_plugin'); ?></option>
75
- <option value="not_equals"><?php _e("doesn't equal", 'wp_all_export_plugin'); ?></option>
76
- <option value="greater"><?php _e('greater than', 'wp_all_export_plugin');?></option>
77
- <option value="equals_or_greater"><?php _e('equal to or greater than', 'wp_all_export_plugin'); ?></option>
78
- <option value="less"><?php _e('less than', 'wp_all_export_plugin'); ?></option>
79
- <option value="equals_or_less"><?php _e('equal to or less than', 'wp_all_export_plugin'); ?></option>
80
- <option value="is_empty"><?php _e('is empty', 'wp_all_export_plugin'); ?></option>
81
- <option value="is_not_empty"><?php _e('is not empty', 'wp_all_export_plugin'); ?></option>
82
- <?php
83
- }
84
- else
85
- {
86
- ?>
87
- <option value="equals"><?php _e('equals', 'wp_all_export_plugin'); ?></option>
88
- <option value="not_equals"><?php _e("doesn't equal", 'wp_all_export_plugin'); ?></option>
89
- <option value="greater"><?php _e('greater than', 'wp_all_export_plugin');?></option>
90
- <option value="equals_or_greater"><?php _e('equal to or greater than', 'wp_all_export_plugin'); ?></option>
91
- <option value="less"><?php _e('less than', 'wp_all_export_plugin'); ?></option>
92
- <option value="equals_or_less"><?php _e('equal to or less than', 'wp_all_export_plugin'); ?></option>
93
-
94
- <option value="contains"><?php _e('contains', 'wp_all_export_plugin'); ?></option>
95
- <option value="not_contains"><?php _e("doesn't contain", 'wp_all_export_plugin'); ?></option>
96
- <option value="is_empty"><?php _e('is empty', 'wp_all_export_plugin'); ?></option>
97
- <option value="is_not_empty"><?php _e('is not empty', 'wp_all_export_plugin'); ?></option>
98
- <?php
99
- }
100
- ?>
101
- </select>
102
- <?php
103
-
104
- exit(json_encode(array('html' => ob_get_clean()))); die;
105
-
106
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/actions/wp_ajax_wpae_filtering.php DELETED
@@ -1,91 +0,0 @@
1
- <?php
2
-
3
- function pmxe_wp_ajax_wpae_filtering(){
4
-
5
- if ( ! check_ajax_referer( 'wp_all_export_secure', 'security', false )){
6
- exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
7
- }
8
-
9
- if ( ! current_user_can( PMXE_Plugin::$capabilities ) ){
10
- exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
11
- }
12
-
13
- $addons = new \Wpae\App\Service\Addons\AddonService();
14
- $response = array(
15
- 'html' => '',
16
- 'btns' => ''
17
- );
18
-
19
- ob_start();
20
-
21
- $errors = new WP_Error();
22
-
23
- $input = new PMXE_Input();
24
-
25
- $post = $input->post('data', array());
26
-
27
- if ( ! empty($post['cpt'])):
28
-
29
- $engine = new XmlExportEngine($post, $errors);
30
-
31
- $engine->init_available_data();
32
-
33
- ?>
34
- <div class="wpallexport-content-section">
35
- <div class="wpallexport-collapsed-header">
36
- <h3><?php _e('Add Filtering Options', 'wp_all_export_plugin'); ?></h3>
37
- </div>
38
- <div class="wpallexport-collapsed-content">
39
- <?php include_once PMXE_ROOT_DIR . '/views/admin/export/blocks/filters.php'; ?>
40
- </div>
41
- </div>
42
-
43
- <?php
44
-
45
- endif;
46
-
47
- $response['html'] = ob_get_clean();
48
-
49
- if ( (XmlExportEngine::$is_user_export && $post['cpt'] != 'shop_customer' && !$addons->isUserAddonActive()) || XmlExportEngine::$is_comment_export || XmlExportEngine::$is_taxonomy_export || $post['cpt'] == 'shop_customer' )
50
- {
51
- $response['btns'] = '';
52
- exit(json_encode($response)); die;
53
- }
54
-
55
- ob_start();
56
-
57
- if ( XmlExportEngine::$is_auto_generate_enabled ):
58
- ?>
59
- <div class="wpallexport-free-edition-notice" id="migrate-orders-notice" style="padding: 20px; margin-bottom: 10px; display: none;">
60
- <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=118611&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=migrate-orders"><?php _e('Upgrade to the Pro edition of WP All Export to Migrate Orders', PMXE_Plugin::LANGUAGE_DOMAIN);?></a>
61
- <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', PMXE_Plugin::LANGUAGE_DOMAIN);?></p>
62
- </div>
63
-
64
- <div class="wpallexport-free-edition-notice" id="migrate-users-notice" style="padding: 20px; margin-bottom: 10px; display: none;">
65
- <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=118611&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=migrate-users"><?php _e('Upgrade to the Pro edition of WP All Export to Migrate Users', PMXE_Plugin::LANGUAGE_DOMAIN);?></a>
66
- <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', PMXE_Plugin::LANGUAGE_DOMAIN);?></p>
67
- </div>
68
-
69
- <?php if(isset($post['cpt'])) { ?>
70
- <span class="wp_all_export_btn_with_note">
71
- <a href="javascript:void(0);" class="back rad3 auto-generate-template" style="float:none; background: #425f9a; padding: 0 50px; margin-right: 10px; color: #fff; font-weight: normal;"><?php printf(__('Migrate %s', 'wp_all_export_plugin'), wp_all_export_get_cpt_name(array($post['cpt']), 2, $post)); ?></a>
72
- <span class="auto-generate-template">&nbsp;</span>
73
- </span>
74
- <?php } ?>
75
- <span class="wp_all_export_btn_with_note">
76
- <input type="submit" class="button button-primary button-hero wpallexport-large-button" value="<?php _e('Customize Export File', 'wp_all_export_plugin') ?>"/>
77
- <span class="auto-generate-template">&nbsp;</span>
78
- </span>
79
- <?php
80
- else:
81
- ?>
82
- <span class="wp_all_export_btn_with_note">
83
- <input type="submit" class="button button-primary button-hero wpallexport-large-button" value="<?php _e('Customize Export File', 'wp_all_export_plugin') ?>"/>
84
- </span>
85
- <?php
86
- endif;
87
- $response['btns'] = ob_get_clean();
88
-
89
- exit(json_encode($response)); die;
90
-
91
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/actions/wp_ajax_wpae_filtering_count.php DELETED
@@ -1,372 +0,0 @@
1
- <?php
2
-
3
- function pmxe_wp_ajax_wpae_filtering_count(){
4
-
5
- if ( ! check_ajax_referer( 'wp_all_export_secure', 'security', false )){
6
- exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
7
- }
8
-
9
- if ( ! current_user_can( PMXE_Plugin::$capabilities ) ){
10
- exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
11
- }
12
-
13
- ob_start();
14
-
15
- $hasVariations = false;
16
-
17
- $input = new PMXE_Input();
18
-
19
- $post = $input->post('data', array());
20
-
21
- $filter_args = array(
22
- 'filter_rules_hierarhy' => empty($post['filter_rules_hierarhy']) ? array() : $post['filter_rules_hierarhy'],
23
- 'product_matching_mode' => empty($post['product_matching_mode']) ? 'strict' : $post['product_matching_mode'],
24
- 'taxonomy_to_export' => empty($post['taxonomy_to_export']) ? '' : $post['taxonomy_to_export']
25
- );
26
-
27
- $input = new PMXE_Input();
28
- $export_id = $input->get('id', 0);
29
- if (empty($export_id))
30
- {
31
- $export_id = ( ! empty(PMXE_Plugin::$session->update_previous)) ? PMXE_Plugin::$session->update_previous : 0;
32
- }
33
-
34
- $export = new PMXE_Export_Record();
35
- $export->getById($export_id);
36
- if ( ! $export->isEmpty() )
37
- {
38
- XmlExportEngine::$exportRecord = $export;
39
- XmlExportEngine::$exportOptions = $export->options + PMXE_Plugin::get_default_import_options();
40
- XmlExportEngine::$exportOptions['export_only_new_stuff'] = $post['export_only_new_stuff'];
41
- XmlExportEngine::$exportOptions['export_only_modified_stuff'] = $post['export_only_modified_stuff'];
42
- if ( ! empty($post['wpml_lang']) ){
43
- XmlExportEngine::$exportOptions['wpml_lang'] = $post['wpml_lang'];
44
- $export->set(array('options' => XmlExportEngine::$exportOptions))->save();
45
- }
46
- }
47
- else{
48
- $sessionLang = empty(PMXE_Plugin::$session->wpml_lang) ? 'all' : PMXE_Plugin::$session->wpml_lang;
49
- XmlExportEngine::$exportOptions['wpml_lang'] = empty($post['wpml_lang']) ? $sessionLang : $post['wpml_lang'];
50
- }
51
-
52
- if (class_exists('SitePress') && !empty(XmlExportEngine::$exportOptions['wpml_lang'])){
53
- PMXE_Plugin::$session->set('wpml_lang', XmlExportEngine::$exportOptions['wpml_lang']);
54
- do_action( 'wpml_switch_language', XmlExportEngine::$exportOptions['wpml_lang'] );
55
- }
56
-
57
- XmlExportEngine::$is_user_export = ( 'users' == $post['cpt'] or 'shop_customer' == $post['cpt'] ) ? true : false;
58
- XmlExportEngine::$is_comment_export = ( 'comments' == $post['cpt'] ) ? true : false;
59
- XmlExportEngine::$is_taxonomy_export = ( 'taxonomies' == $post['cpt'] ) ? true : false;
60
- XmlExportEngine::$post_types = array($post['cpt']);
61
- XmlExportEngine::$exportOptions['export_variations'] = empty($post['export_variations']) ? XmlExportEngine::VARIABLE_PRODUCTS_EXPORT_PARENT_AND_VARIATION : $post['export_variations'];
62
-
63
- $filters = \Wpae\Pro\Filtering\FilteringFactory::getFilterEngine();
64
- $filters->init($filter_args);
65
- $filters->parse();
66
-
67
- PMXE_Plugin::$session->set('whereclause', $filters->get('queryWhere'));
68
- PMXE_Plugin::$session->set('joinclause', $filters->get('queryJoin'));
69
- PMXE_Plugin::$session->save_data();
70
-
71
- $foundRecords = 0;
72
- $total_records = 0;
73
-
74
- $cpt = array($post['cpt']);
75
-
76
- $is_products_export = ($post['cpt'] == 'product' and class_exists('WooCommerce'));
77
-
78
- if ($post['export_type'] == 'advanced')
79
- {
80
- if (XmlExportEngine::$is_user_export)
81
- {
82
- // get total users
83
- $totalQuery = eval('return new WP_User_Query(array(' . PMXE_Plugin::$session->get('wp_query') . ', \'offset\' => 0, \'number\' => 10 ));');
84
- if ( ! empty($totalQuery->results)){
85
- $total_records = $totalQuery->get_total();
86
- }
87
-
88
- ob_start();
89
- // get users depends on filters
90
- add_action('pre_user_query', 'wp_all_export_pre_user_query', 10, 1);
91
- $exportQuery = eval('return new WP_User_Query(array(' . PMXE_Plugin::$session->get('wp_query') . ', \'offset\' => 0, \'number\' => 10 ));');
92
- if ( ! empty($exportQuery->results)){
93
- $foundRecords = $exportQuery->get_total();
94
- }
95
- remove_action('pre_user_query', 'wp_all_export_pre_user_query');
96
- ob_get_clean();
97
- }
98
- elseif(XmlExportEngine::$is_comment_export)
99
- {
100
- // get total comments
101
- $totalQuery = eval('return new WP_Comment_Query(array(' . PMXE_Plugin::$session->get('wp_query') . ', \'number\' => 10, \'count\' => true ));');
102
- $total_records = $totalQuery->get_comments();
103
-
104
- ob_start();
105
- // get comments depends on filters
106
- add_action('comments_clauses', 'wp_all_export_comments_clauses', 10, 1);
107
- $exportQuery = eval('return new WP_Comment_Query(array(' . PMXE_Plugin::$session->get('wp_query') . '));');
108
- $foundRecords = $exportQuery->get_comments();
109
- remove_action('comments_clauses', 'wp_all_export_comments_clauses');
110
- ob_get_clean();
111
- }
112
- else
113
- {
114
- remove_all_actions('parse_query');
115
- remove_all_actions('pre_get_posts');
116
- remove_all_filters('posts_clauses');
117
-
118
- // get total custom post type records
119
- $totalQuery = eval('return new WP_Query(array(' . PMXE_Plugin::$session->get('wp_query') . ', \'offset\' => 0, \'posts_per_page\' => 10 ));');
120
- if ( ! empty($totalQuery->found_posts)){
121
- $total_records = $totalQuery->found_posts;
122
- }
123
-
124
- wp_reset_postdata();
125
-
126
- ob_start();
127
- // get custom post type records depends on filters
128
- add_filter('posts_where', 'wp_all_export_posts_where', 10, 1);
129
- add_filter('posts_join', 'wp_all_export_posts_join', 10, 1);
130
-
131
- $exportQuery = eval('return new WP_Query(array(' . PMXE_Plugin::$session->get('wp_query') . ', \'offset\' => 0, \'posts_per_page\' => 10 ));');
132
- if ( ! empty($exportQuery->found_posts)){
133
- $foundRecords = $exportQuery->found_posts;
134
- }
135
- remove_filter('posts_join', 'wp_all_export_posts_join');
136
- remove_filter('posts_where', 'wp_all_export_posts_where');
137
- ob_get_clean();
138
- }
139
- }
140
- else
141
- {
142
- if ( 'users' == $post['cpt'] or 'shop_customer' == $post['cpt'] )
143
- {
144
- // get total users
145
- $totalQuery = new WP_User_Query( array( 'orderby' => 'ID', 'order' => 'ASC', 'number' => 10 ));
146
- if ( ! empty($totalQuery->results)){
147
- $total_records = $totalQuery->get_total();
148
- }
149
-
150
- ob_start();
151
- // get users depends on filters
152
- add_action('pre_user_query', 'wp_all_export_pre_user_query', 10, 1);
153
- $exportQuery = new WP_User_Query( array( 'orderby' => 'ID', 'order' => 'ASC', 'number' => 10 ));
154
- if ( ! empty($exportQuery->results)){
155
- $foundRecords = $exportQuery->get_total();
156
- }
157
- remove_action('pre_user_query', 'wp_all_export_pre_user_query');
158
- ob_get_clean();
159
- }
160
- elseif( 'comments' == $post['cpt'] )
161
- {
162
- // get total comments
163
- global $wp_version;
164
-
165
- if ( version_compare($wp_version, '4.2.0', '>=') )
166
- {
167
- $totalQuery = new WP_Comment_Query( array( 'orderby' => 'comment_ID', 'order' => 'ASC', 'number' => 10, 'count' => true));
168
- $total_records = $totalQuery->get_comments();
169
- }
170
- else
171
- {
172
- $total_records = get_comments( array( 'orderby' => 'comment_ID', 'order' => 'ASC', 'number' => 10, 'count' => true));
173
- }
174
-
175
- ob_start();
176
- // get comments depends on filters
177
- add_action('comments_clauses', 'wp_all_export_comments_clauses', 10, 1);
178
-
179
- if ( version_compare($wp_version, '4.2.0', '>=') )
180
- {
181
- $exportQuery = new WP_Comment_Query( array( 'orderby' => 'comment_ID', 'order' => 'ASC'));
182
- $foundRecords = count($exportQuery->get_comments());
183
- }
184
- else
185
- {
186
- $foundRecords = count(get_comments( array( 'orderby' => 'comment_ID', 'order' => 'ASC')));
187
- }
188
- remove_action('comments_clauses', 'wp_all_export_comments_clauses');
189
- ob_get_clean();
190
- }
191
- elseif( 'taxonomies' == $post['cpt'] )
192
- {
193
- global $wp_version;
194
-
195
- if ( version_compare($wp_version, '4.6.0', '>=') ) {
196
- $totalQuery = new WP_Term_Query(array(
197
- 'taxonomy' => $post['taxonomy_to_export'],
198
- 'orderby' => 'name',
199
- 'order' => 'ASC',
200
- 'number' => 10,
201
- 'hide_empty' => FALSE
202
- ));
203
- $total_records = count($totalQuery->get_terms());
204
-
205
- ob_start();
206
- // get comments depends on filters
207
- add_filter('terms_clauses', 'wp_all_export_terms_clauses', 10, 3);
208
- $exportQuery = new WP_Term_Query(array(
209
- 'taxonomy' => $post['taxonomy_to_export'],
210
- 'orderby' => 'name',
211
- 'order' => 'ASC',
212
- 'hide_empty' => FALSE
213
- ));
214
- $foundRecords = count($exportQuery->get_terms());
215
- remove_filter('terms_clauses', 'wp_all_export_terms_clauses');
216
- ob_get_clean();
217
- }
218
- else{
219
- ?>
220
- <div class="founded_records">
221
- <h3><?php _e('Unable to Export', 'wp_all_export_plugin'); ?></h3>
222
- <h4><?php printf(__("Exporting taxonomies requires WordPress 4.6 or greater", "wp_all_export_plugin"), wp_all_export_get_cpt_name($cpt, 2, $post)); ?></h4>
223
- </div>
224
- <?php
225
- exit(json_encode(array('html' => ob_get_clean(), 'found_records' => 0, 'hasVariations' => $hasVariations))); die;
226
- }
227
-
228
- }
229
- else
230
- {
231
- remove_all_actions('parse_query');
232
- remove_all_actions('pre_get_posts');
233
- remove_all_filters('posts_clauses');
234
-
235
- $cpt = ($is_products_export) ? array('product', 'product_variation') : array($post['cpt']);
236
-
237
- // get total custom post type records
238
- $totalQuery = new WP_Query( array( 'post_type' => $cpt, 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10 ));
239
-
240
- if ( ! empty($totalQuery->found_posts)){
241
- $total_records = $totalQuery->found_posts;
242
- }
243
-
244
- wp_reset_postdata();
245
-
246
- ob_start();
247
- // get custom post type records depends on filters
248
- add_filter('posts_where', 'wp_all_export_posts_where', 10, 1);
249
- add_filter('posts_where', 'wp_all_export_numbering_where', 15, 1);
250
-
251
- add_filter('posts_join', 'wp_all_export_posts_join', 10, 1);
252
-
253
-
254
- if($is_products_export) {
255
-
256
- add_filter('posts_where', 'wp_all_export_numbering_where', 15, 1);
257
-
258
- $productsQuery = new WP_Query( array( 'post_type' => array('product', 'product_variation'), 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10));
259
- $variationsQuery = new WP_Query( array( 'post_type' => 'product_variation', 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10));
260
-
261
- $foundProducts = $productsQuery->found_posts;
262
-
263
- $foundVariations = $variationsQuery->found_posts;
264
-
265
- $foundRecords = $foundProducts;
266
- $hasVariations = !!$foundVariations;
267
-
268
- remove_filter('posts_where', 'wp_all_export_numbering_where');
269
-
270
- } else {
271
- $exportQuery = new WP_Query( array( 'post_type' => $cpt, 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10));
272
- if ( ! empty($exportQuery->found_posts))
273
- {
274
- $foundRecords = $exportQuery->found_posts;
275
- }
276
- }
277
-
278
- remove_filter('posts_where', 'wp_all_export_posts_where');
279
- remove_filter('posts_where', 'wp_all_export_numbering_where');
280
-
281
- remove_filter('posts_join', 'wp_all_export_posts_join');
282
-
283
- ob_end_clean();
284
-
285
- }
286
- }
287
-
288
- if(isset($exportQuery)) {
289
- PMXE_Plugin::$session->set('exportQuery', $exportQuery);
290
- PMXE_Plugin::$session->save_data();
291
- }
292
-
293
- if ( $post['is_confirm_screen'] )
294
- {
295
- ?>
296
-
297
- <?php if ($foundRecords > 0) :?>
298
- <h3><?php _e('Your export is ready to run.', 'wp_all_export_plugin'); ?></h3>
299
- <h4><?php printf(__('WP All Export will export %d %s.', 'wp_all_export_plugin'), $foundRecords, wp_all_export_get_cpt_name($cpt, $foundRecords, $post)); ?></h4>
300
- <?php else: ?>
301
- <?php if (! $export->isEmpty() and ($export->options['export_only_new_stuff'] or $export->options['export_only_modified_stuff'])): ?>
302
- <h3><?php _e('Nothing to export.', 'wp_all_export_plugin'); ?></h3>
303
- <h4><?php printf(__("All %s have already been exported.", "wp_all_export_plugin"), wp_all_export_get_cpt_name($cpt, 2, $post)); ?></h4>
304
- <?php elseif ($total_records > 0): ?>
305
- <h3><?php _e('Nothing to export.', 'wp_all_export_plugin'); ?></h3>
306
- <h4><?php printf(__("No matching %s found for selected filter rules.", "wp_all_export_plugin"), wp_all_export_get_cpt_name($cpt, 2, $post)); ?></h4>
307
- <?php else: ?>
308
- <h3><?php _e('Nothing to export.', 'wp_all_export_plugin'); ?></h3>
309
- <h4><?php printf(__("There aren't any %s to export.", "wp_all_export_plugin"), wp_all_export_get_cpt_name($cpt, 2, $post)); ?></h4>
310
- <?php endif; ?>
311
- <?php endif; ?>
312
-
313
- <?php
314
- }
315
- elseif( $post['is_template_screen'] )
316
- {
317
- ?>
318
-
319
- <?php if ($foundRecords > 0) :?>
320
- <h3><span class="matches_count"><?php echo $foundRecords; ?></span> <strong><?php echo wp_all_export_get_cpt_name($cpt, $foundRecords, $post); ?></strong> will be exported</h3>
321
- <h4><?php _e("Drag &amp; drop data to include in the export file.", "wp_all_export_plugin"); ?></h4>
322
- <?php else: ?>
323
- <?php if (! $export->isEmpty() and ($export->options['export_only_new_stuff'] or $export->options['export_only_modified_stuff'])): ?>
324
- <h3><?php _e('Nothing to export.', 'wp_all_export_plugin'); ?></h3>
325
- <h4><?php printf(__("All %s have already been exported.", "wp_all_export_plugin"), wp_all_export_get_cpt_name($cpt, 2, $post)); ?></h4>
326
- <?php elseif ($total_records > 0): ?>
327
- <h3><?php _e('Nothing to export.', 'wp_all_export_plugin'); ?></h3>
328
- <h4><?php printf(__("No matching %s found for selected filter rules.", "wp_all_export_plugin"), wp_all_export_get_cpt_name($cpt, 2, $post)); ?></h4>
329
- <?php else: ?>
330
- <h3><?php _e('Nothing to export.', 'wp_all_export_plugin'); ?></h3>
331
- <h4><?php printf(__("There aren't any %s to export.", "wp_all_export_plugin"), wp_all_export_get_cpt_name($cpt, 2, $post)); ?></h4>
332
- <?php endif; ?>
333
- <?php endif; ?>
334
-
335
- <?php
336
- }
337
- else
338
- {
339
- ?>
340
- <div class="founded_records">
341
- <?php if ($foundRecords > 0) :?>
342
- <h3><span class="matches_count"><?php echo $foundRecords; ?></span> <strong><?php echo wp_all_export_get_cpt_name($cpt, $foundRecords, $post); ?></strong> will be exported</h3>
343
- <h4><?php _e("Continue to configure and run your export.", "wp_all_export_plugin"); ?></h4>
344
- <?php elseif ($total_records > 0): ?>
345
- <h4 style="line-height:60px;"><?php printf(__("No matching %s found for selected filter rules.", "wp_all_export_plugin"), wp_all_export_get_cpt_name($cpt, 2, $post)); ?></h4>
346
- <?php else: ?>
347
- <h4 style="line-height:60px;"><?php printf(__("There aren't any %s to export.", "wp_all_export_plugin"), wp_all_export_get_cpt_name($cpt, 2, $post)); ?></h4>
348
- <?php endif; ?>
349
- </div>
350
- <?php
351
- }
352
-
353
- exit(json_encode(array('html' => ob_get_clean(), 'found_records' => $foundRecords, 'hasVariations' => $hasVariations))); die;
354
-
355
- }
356
-
357
- function wp_all_export_numbering_where($where)
358
- {
359
- global $wpdb;
360
-
361
- $excludeVariationsSql = " AND $wpdb->posts.ID NOT IN (SELECT o.ID FROM $wpdb->posts o
362
- LEFT OUTER JOIN $wpdb->posts r ON o.post_parent = r.ID WHERE ((r.post_status = 'trash' OR r.ID IS NULL) AND o.post_type = 'product_variation'))";
363
-
364
- $groupSql = "GROUP BY $wpdb->posts.ID";
365
- if(strpos($where, $groupSql) !== false ){
366
- $where = str_replace($groupSql, $excludeVariationsSql." ".$groupSql, $where);
367
- } else {
368
- $where = $where.$excludeVariationsSql;
369
- }
370
-
371
- return $where;
372
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/actions/wp_ajax_wpae_preview.php DELETED
@@ -1,436 +0,0 @@
1
- <?php
2
- /**
3
- * AJAX action for preview export row
4
- */
5
-
6
- function pmxe_wp_ajax_wpae_preview(){
7
-
8
- if ( ! check_ajax_referer( 'wp_all_export_secure', 'security', false )){
9
- exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
10
- }
11
-
12
- if ( ! current_user_can( PMXE_Plugin::$capabilities ) ){
13
- exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
14
- }
15
-
16
- XmlExportEngine::$is_preview = true;
17
-
18
- $custom_xml_valid = true;
19
-
20
- ob_start();
21
-
22
- $values = array();
23
-
24
- parse_str($_POST['data'], $values);
25
-
26
- if(is_array($values['cc_options'])) {
27
-
28
- foreach ($values['cc_options'] as &$value) {
29
- $value = stripslashes($value);
30
- }
31
- }
32
-
33
- $export_id = (isset($_GET['id'])) ? stripcslashes($_GET['id']) : 0;
34
-
35
- $exportOptions = $values + (PMXE_Plugin::$session->has_session() ? PMXE_Plugin::$session->get_clear_session_data() : array()) + PMXE_Plugin::get_default_import_options();
36
-
37
- $exportOptions['custom_xml_template'] = (isset($_POST['custom_xml'])) ? stripcslashes($_POST['custom_xml']) : '';
38
- $exportOptions['custom_xml_template'] = str_replace('<ID>','<id>', $exportOptions['custom_xml_template'] );
39
- $exportOptions['custom_xml_template'] = str_replace('</ID>','</id>', $exportOptions['custom_xml_template'] );
40
-
41
- if ( ! empty($exportOptions['custom_xml_template'])) {
42
- $custom_xml_template_line_count = substr_count($exportOptions['custom_xml_template'], "\n");
43
- }
44
-
45
- $errors = new WP_Error();
46
-
47
- $engine = new XmlExportEngine($exportOptions, $errors);
48
-
49
- XmlExportEngine::$exportOptions = $exportOptions;
50
- XmlExportEngine::$is_user_export = $exportOptions['is_user_export'];
51
- XmlExportEngine::$is_comment_export = $exportOptions['is_comment_export'];
52
- XmlExportEngine::$is_taxonomy_export = $exportOptions['is_taxonomy_export'];
53
- XmlExportEngine::$exportID = $export_id;
54
-
55
- if ( class_exists('SitePress') && ! empty(XmlExportEngine::$exportOptions['wpml_lang'])){
56
- do_action( 'wpml_switch_language', XmlExportEngine::$exportOptions['wpml_lang'] );
57
- }
58
-
59
- if (XmlExportEngine::$exportOptions['export_to'] == XmlExportEngine::EXPORT_TYPE_XML && in_array(XmlExportEngine::$exportOptions['xml_template_type'], array('custom', 'XmlGoogleMerchants')) ){
60
-
61
- if ( empty(XmlExportEngine::$exportOptions['custom_xml_template']) )
62
- {
63
- $errors->add('form-validation', __('XML template is empty.', 'wp_all_export_plugin'));
64
- }
65
-
66
- if ( ! empty(XmlExportEngine::$exportOptions['custom_xml_template'])){
67
-
68
- $engine->init_additional_data();
69
-
70
- $engine->init_available_data();
71
-
72
- $result = $engine->parse_custom_xml_template();
73
- $line_numbers = $result['line_numbers'];
74
- if ( ! $errors->get_error_codes()) {
75
- XmlExportEngine::$exportOptions = array_merge(XmlExportEngine::$exportOptions, $result);
76
- }
77
-
78
- $originalXmlTemplate = $exportOptions['custom_xml_template'];
79
- libxml_use_internal_errors(true);
80
- libxml_clear_errors();
81
-
82
- //Add root se we make sure there is a root tag
83
- $result['original_post_loop'] = '<root>'.$result['original_post_loop'].'</root>';
84
-
85
- $custom_xml_template = simplexml_load_string($result['original_post_loop']);
86
-
87
- if ($custom_xml_template === false) {
88
- $custom_xml_template_errors = libxml_get_errors();
89
- libxml_clear_errors();
90
- $custom_xml_valid = false;
91
- // Remove one line because we added root
92
- $line_difference = $custom_xml_template_line_count - $line_numbers - 1;
93
- }
94
- $exportOptions['custom_xml_template'] = str_replace("<!-- BEGIN POST LOOP -->", "<!-- BEGIN LOOP -->", $exportOptions['custom_xml_template']);
95
- $exportOptions['custom_xml_template'] = str_replace("<!-- END POST LOOP -->", "<!-- END LOOP -->", $exportOptions['custom_xml_template']);
96
-
97
- }
98
- }
99
-
100
- if(isset($_GET['show_cdata'])) {
101
- XmlExportEngine::$exportOptions['show_cdata_in_preview'] = (bool)$_GET['show_cdata'];
102
- } else {
103
- XmlExportEngine::$exportOptions['show_cdata_in_preview'] = false;
104
- }
105
-
106
- if ( $errors->get_error_codes()) {
107
- $msgs = $errors->get_error_messages();
108
- if ( ! is_array($msgs)) {
109
- $msgs = array($msgs);
110
- }
111
- foreach ($msgs as $msg): ?>
112
- <div class="error"><p><?php echo $msg ?></p></div>
113
- <?php endforeach;
114
- exit( json_encode(array('html' => ob_get_clean())) );
115
- }
116
-
117
- if ( 'advanced' == $exportOptions['export_type'] )
118
- {
119
- if ( XmlExportEngine::$is_user_export ) {
120
- $exportQuery = eval('return new WP_User_Query(array(' . $exportOptions['wp_query'] . ', \'offset\' => 0, \'number\' => 10));');
121
- }
122
- elseif ( XmlExportEngine::$is_comment_export ) {
123
- $exportQuery = eval('return new WP_Comment_Query(array(' . $exportOptions['wp_query'] . ', \'offset\' => 0, \'number\' => 10));');
124
- }
125
- else {
126
- remove_all_actions('parse_query');
127
- remove_all_actions('pre_get_posts');
128
- remove_all_filters('posts_clauses');
129
-
130
- $exportQuery = eval('return new WP_Query(array(' . $exportOptions['wp_query'] . ', \'offset\' => 0, \'posts_per_page\' => 10));');
131
- }
132
- }
133
- else
134
- {
135
- XmlExportEngine::$post_types = $exportOptions['cpt'];
136
-
137
- if ( in_array('users', $exportOptions['cpt']) or in_array('shop_customer', $exportOptions['cpt']))
138
- {
139
- add_action('pre_user_query', 'wp_all_export_pre_user_query', 10, 1);
140
- $exportQuery = new WP_User_Query( array( 'orderby' => 'ID', 'order' => 'ASC', 'number' => 10 ));
141
- remove_action('pre_user_query', 'wp_all_export_pre_user_query');
142
- }
143
- elseif ( in_array('taxonomies', $exportOptions['cpt']))
144
- {
145
- add_filter('terms_clauses', 'wp_all_export_terms_clauses', 10, 3);
146
- $exportQuery = new WP_Term_Query( array( 'taxonomy' => $exportOptions['taxonomy_to_export'], 'orderby' => 'term_id', 'order' => 'ASC', 'number' => 10, 'hide_empty' => false ));
147
- remove_filter('terms_clauses', 'wp_all_export_terms_clauses');
148
- }
149
- elseif( in_array('comments', $exportOptions['cpt']))
150
- {
151
- add_action('comments_clauses', 'wp_all_export_comments_clauses', 10, 1);
152
-
153
- global $wp_version;
154
-
155
- if ( version_compare($wp_version, '4.2.0', '>=') )
156
- {
157
- $exportQuery = new WP_Comment_Query( array( 'orderby' => 'comment_ID', 'order' => 'ASC', 'number' => 10 ));
158
- }
159
- else
160
- {
161
- $exportQuery = get_comments( array( 'orderby' => 'comment_ID', 'order' => 'ASC', 'number' => 10 ));
162
- }
163
- remove_action('comments_clauses', 'wp_all_export_comments_clauses');
164
- }
165
- else
166
- {
167
- remove_all_actions('parse_query');
168
- remove_all_actions('pre_get_posts');
169
- remove_all_filters('posts_clauses');
170
-
171
- add_filter('posts_join', 'wp_all_export_posts_join', 10, 1);
172
- add_filter('posts_where', 'wp_all_export_posts_where', 10, 1);
173
- $exportQuery = new WP_Query( array( 'post_type' => $exportOptions['cpt'], 'post_status' => 'any', 'orderby' => 'title', 'order' => 'ASC', 'posts_per_page' => 10 ));
174
-
175
- remove_filter('posts_where', 'wp_all_export_posts_where');
176
- remove_filter('posts_join', 'wp_all_export_posts_join');
177
- }
178
- }
179
-
180
- XmlExportEngine::$exportQuery = $exportQuery;
181
-
182
- $engine->init_additional_data();
183
-
184
- ?>
185
-
186
- <div id="post-preview" class="wpallexport-preview">
187
-
188
- <p class="wpallexport-preview-title"><?php echo sprintf("Preview first 10 %s", wp_all_export_get_cpt_name($exportOptions['cpt'], 10, $exportOptions)); ?></p>
189
-
190
- <div class="wpallexport-preview-content">
191
-
192
- <?php
193
-
194
- if(!$custom_xml_valid) {
195
- $error_msg = '<strong class="error">' . __('Invalid XML', 'wp_all_import_plugin') . '</strong><ul class="error">';
196
- foreach($custom_xml_template_errors as $error) {
197
- $error_msg .= '<li>';
198
- $error_msg .= __('Line', 'wp_all_import_plugin') . ' ' . ($error->line + $line_difference) . ', ';
199
- $error_msg .= __('Column', 'wp_all_import_plugin') . ' ' . $error->column . ', ';
200
- $error_msg .= __('Code', 'wp_all_import_plugin') . ' ' . $error->code . ': ';
201
- $error_msg .= '<em>' . trim(esc_html($error->message)) . '</em>';
202
- $error_msg .= '</li>';
203
- }
204
- $error_msg .= '</ul>';
205
- echo $error_msg;
206
- exit( json_encode(array('html' => ob_get_clean())) );
207
- }
208
-
209
- switch ($exportOptions['export_to']) {
210
-
211
- case 'xml':
212
-
213
- $dom = new DOMDocument('1.0', $exportOptions['encoding']);
214
- libxml_use_internal_errors(true);
215
- try{
216
- $xml = XmlCsvExport::export_xml(true);
217
- } catch (WpaeMethodNotFoundException $e) {
218
- // Find the line where the function is
219
- $errorMessage = '';
220
- $functionName = $e->getMessage();
221
- $txtParts = explode("\n",$originalXmlTemplate);
222
- for ($i=0, $length = count($txtParts);$i<$length;$i++)
223
- {
224
- $tmp = strstr($txtParts[$i], $functionName);
225
- if ($tmp) {
226
- $errorMessage .= 'Error parsing XML feed: Call to undefined function <em>"'.$functionName.'"</em> on Line '.($i+1);
227
- }
228
- }
229
-
230
- $error_msg = '<span class="error">'.__($errorMessage, 'wp_all_import_plugin').'</span>';
231
- echo $error_msg;
232
- exit( json_encode(array('html' => ob_get_clean())) );
233
- } catch (WpaeInvalidStringException $e) {
234
- // Find the line where the function is
235
- $errorMessage = '';
236
- $functionName = $e->getMessage();
237
- $txtParts = explode("\n",$originalXmlTemplate);
238
- for ($i=0, $length = count($txtParts);$i<$length;$i++)
239
- {
240
- $tmp = strstr($txtParts[$i], $functionName);
241
- if ($tmp) {
242
- $errorMessage .= 'Error parsing XML feed: Unterminated string on line '.($i+1);
243
- }
244
- }
245
-
246
- $error_msg = '<span class="error">'.__($errorMessage, 'wp_all_import_plugin').'</span>';
247
- echo $error_msg;
248
- exit( json_encode(array('html' => ob_get_clean())) );
249
- } catch (WpaeTooMuchRecursionException $e) {
250
- $errorMessage = __('There was a problem parsing the custom XML template');
251
- $error_msg = '<span class="error">'.__($errorMessage, 'wp_all_import_plugin').'</span>';
252
- echo $error_msg;
253
- exit( json_encode(array('html' => ob_get_clean())) );
254
- }
255
-
256
- $xml_errors = false;
257
-
258
- $main_xml_tag = '';
259
-
260
- switch ( XmlExportEngine::$exportOptions['xml_template_type'] ){
261
-
262
- case 'custom':
263
- case 'XmlGoogleMerchants':
264
-
265
- require_once PMXE_ROOT_DIR . '/classes/XMLWriter.php';
266
-
267
- $preview_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" . "\n<Preview>\n" . $xml . "\n</Preview>";
268
-
269
- $preview_xml = str_replace('<![CDATA[', 'CDATABEGIN', $preview_xml);
270
- $preview_xml = str_replace(']]>', 'CDATACLOSE', $preview_xml);
271
- $preview_xml = str_replace('&amp;', '&', $preview_xml);
272
- $preview_xml = str_replace('&', '&amp;', $preview_xml);
273
-
274
- $xml = PMXE_XMLWriter::preprocess_xml( XmlExportEngine::$exportOptions['custom_xml_template_header'] ) . "\n" . $xml . "\n" . PMXE_XMLWriter::preprocess_xml( XmlExportEngine::$exportOptions['custom_xml_template_footer'] );
275
-
276
- $xml = str_replace('<![CDATA[', 'CDATABEGIN', $xml);
277
- $xml = str_replace(']]>', 'CDATACLOSE', $xml);
278
- $xml = str_replace('&amp;', '&', $xml);
279
- $xml = str_replace('&', '&amp;', $xml);
280
-
281
- // Determine XML root element
282
- preg_match_all("%<[\w]+[\s|>]{1}%", XmlExportEngine::$exportOptions['custom_xml_template_header'], $matches);
283
-
284
- if ( ! empty($matches[0]) ){
285
- $main_xml_tag = preg_replace("%[\s|<|>]%","",array_shift($matches[0]));
286
- }
287
-
288
- libxml_clear_errors();
289
- $dom->loadXML($xml);
290
- $xml_errors = libxml_get_errors();
291
- libxml_clear_errors();
292
- if (! $xml_errors ){
293
- $xpath = new DOMXPath($dom);
294
- if (($elements = @$xpath->query('/' . $main_xml_tag)) and $elements->length){
295
- pmxe_render_xml_element($elements->item( 0 ), true);
296
- }
297
- else{
298
- $xml_errors = true;
299
- }
300
- }
301
-
302
- break;
303
-
304
- default:
305
-
306
- libxml_clear_errors();
307
- $dom->loadXML($xml);
308
- $xml_errors = libxml_get_errors();
309
- libxml_clear_errors();
310
-
311
- $xpath = new DOMXPath($dom);
312
-
313
- // Determine XML root element
314
- $main_xml_tag = apply_filters('wp_all_export_main_xml_tag', $exportOptions['main_xml_tag'], XmlExportEngine::$exportID);
315
- $elements = @$xpath->query('/' . $main_xml_tag);
316
- if ($elements->length){
317
- pmxe_render_xml_element($elements->item( 0 ), true);
318
- $xml_errors = false;
319
- }
320
- else{
321
- $error_msg = '<strong>' . __('Can\'t preview the document.', 'wp_all_import_plugin') . '</strong><ul>';
322
- $error_msg .= '<li>';
323
- $error_msg .= __('You can continue export or try to use &lt;data&gt; tag as root element.', 'wp_all_import_plugin');
324
- $error_msg .= '</li>';
325
- $error_msg .= '</ul>';
326
- echo $error_msg;
327
- exit( json_encode(array('html' => ob_get_clean())) );
328
- }
329
- break;
330
-
331
- }
332
-
333
- if ( $xml_errors ){
334
-
335
- $preview_dom = new DOMDocument('1.0', $exportOptions['encoding']);
336
- libxml_clear_errors();
337
- $preview_dom->loadXML($preview_xml);
338
- $preview_xml_errors = libxml_get_errors();
339
- libxml_clear_errors();
340
-
341
- if ($preview_xml_errors){
342
- $error_msg = '<strong class="error">' . __('Invalid XML', 'wp_all_import_plugin') . '</strong><ul class="error">';
343
- foreach($preview_xml_errors as $error) {
344
- $error_msg .= '<li>';
345
- $error_msg .= __('Line', 'wp_all_import_plugin') . ' ' . $error->line . ', ';
346
- $error_msg .= __('Column', 'wp_all_import_plugin') . ' ' . $error->column . ', ';
347
- $error_msg .= __('Code', 'wp_all_import_plugin') . ' ' . $error->code . ': ';
348
- $error_msg .= '<em>' . trim(esc_html($error->message)) . '</em>';
349
- $error_msg .= '</li>';
350
- }
351
- $error_msg .= '</ul>';
352
- echo $error_msg;
353
- exit( json_encode(array('html' => ob_get_clean())) );
354
- }
355
- else{
356
- $xpath = new DOMXPath($preview_dom);
357
- if (($elements = @$xpath->query('/Preview')) and $elements->length){
358
- pmxe_render_xml_element($elements->item( 0 ), true);
359
- }
360
- else{
361
- $error_msg = '<strong>' . __('Can\'t preview the document. Root element is not detected.', 'wp_all_import_plugin') . '</strong><ul>';
362
- $error_msg .= '<li>';
363
- $error_msg .= __('You can continue export or try to use &lt;data&gt; tag as root element.', 'wp_all_import_plugin');
364
- $error_msg .= '</li>';
365
- $error_msg .= '</ul>';
366
- echo $error_msg;
367
- exit( json_encode(array('html' => ob_get_clean())) );
368
- }
369
- }
370
- }
371
-
372
- break;
373
-
374
- case 'csv':
375
- ?>
376
- <small>
377
- <?php
378
-
379
- $csv = XmlCsvExport::export_csv( true );
380
-
381
- if (!empty($csv)){
382
- $csv_rows = array_filter(explode("\n", $csv));
383
- if ($csv_rows){
384
- ?>
385
- <table class="pmxe_preview" cellpadding="0" cellspacing="0">
386
- <?php
387
- foreach ($csv_rows as $rkey => $row) {
388
- $cells = str_getcsv($row, $exportOptions['delimiter']);
389
- if ($cells){
390
- ?>
391
- <tr>
392
- <?php
393
- foreach ($cells as $key => $value) {
394
- ?>
395
- <td>
396
- <?php if (!$rkey):?><strong><?php endif;?>
397
- <?php echo $value; ?>
398
- <?php if (!$rkey):?></strong><?php endif;?>
399
- </td>
400
- <?php
401
- }
402
- ?>
403
- </tr>
404
- <?php
405
- }
406
- }
407
- ?>
408
- </table>
409
- <?php
410
- }
411
- }
412
- else{
413
- _e('Data not found.', 'wp_all_export_plugin');
414
- }
415
- ?>
416
- </small>
417
- <?php
418
- break;
419
-
420
- default:
421
-
422
- _e('This format is not supported.', 'wp_all_export_plugin');
423
-
424
- break;
425
- }
426
- wp_reset_postdata();
427
- ?>
428
-
429
- </div>
430
-
431
- </div>
432
-
433
- <?php
434
-
435
- exit(json_encode(array('html' => ob_get_clean()))); die;
436
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/actions/wp_ajax_wpallexport.php DELETED
@@ -1,327 +0,0 @@
1
- <?php
2
- /**
3
- * AJAX action export processing
4
- */
5
- function pmxe_wp_ajax_wpallexport()
6
- {
7
-
8
- if (!check_ajax_referer('wp_all_export_secure', 'security', false)) {
9
- exit(__('Security check', 'wp_all_export_plugin'));
10
- }
11
-
12
- if (!current_user_can(PMXE_Plugin::$capabilities)) {
13
- exit(__('Security check', 'wp_all_export_plugin'));
14
- }
15
-
16
- $input = new PMXE_Input();
17
- $export_id = $input->get('id', 0);
18
- if (empty($export_id)) {
19
- $export_id = (!empty(PMXE_Plugin::$session->update_previous)) ? PMXE_Plugin::$session->update_previous : 0;
20
- }
21
-
22
- $wp_uploads = wp_upload_dir();
23
-
24
- $export = new PMXE_Export_Record();
25
-
26
- $export->getById($export_id);
27
-
28
- if ($export->isEmpty()) {
29
- exit(__('Export is not defined.', 'wp_all_export_plugin'));
30
- }
31
-
32
- $exportOptions = $export->options + PMXE_Plugin::get_default_import_options();
33
-
34
- wp_reset_postdata();
35
-
36
- XmlExportEngine::$exportOptions = $exportOptions;
37
- XmlExportEngine::$is_user_export = $exportOptions['is_user_export'];
38
- XmlExportEngine::$is_comment_export = $exportOptions['is_comment_export'];
39
- XmlExportEngine::$is_taxonomy_export = empty($exportOptions['is_taxonomy_export']) ? false : $exportOptions['is_taxonomy_export'];
40
- XmlExportEngine::$exportID = $export_id;
41
- XmlExportEngine::$exportRecord = $export;
42
-
43
- if (class_exists('SitePress') && !empty(XmlExportEngine::$exportOptions['wpml_lang'])) {
44
- do_action('wpml_switch_language', XmlExportEngine::$exportOptions['wpml_lang']);
45
- }
46
-
47
- $errors = new WP_Error();
48
- $engine = new XmlExportEngine($exportOptions, $errors);
49
-
50
- $posts_per_page = $exportOptions['records_per_iteration'];
51
-
52
- if ($exportOptions['export_type'] == 'advanced') {
53
- if (XmlExportEngine::$is_user_export) {
54
- add_action('pre_user_query', 'wp_all_export_pre_user_query', 10, 1);
55
- $exportQuery = eval('return new WP_User_Query(array(' . $exportOptions['wp_query'] . ', \'offset\' => ' . $export->exported . ', \'number\' => ' . $posts_per_page . ' ));');
56
- remove_action('pre_user_query', 'wp_all_export_pre_user_query');
57
- } elseif (XmlExportEngine::$is_comment_export) {
58
- add_action('comments_clauses', 'wp_all_export_comments_clauses', 10, 1);
59
- $exportQuery = eval('return new WP_Comment_Query(array(' . $exportOptions['wp_query'] . ', \'offset\' => ' . $export->exported . ', \'number\' => ' . $posts_per_page . ' ));');
60
- remove_action('comments_clauses', 'wp_all_export_comments_clauses');
61
- } else {
62
- remove_all_actions('parse_query');
63
- remove_all_actions('pre_get_posts');
64
- remove_all_filters('posts_clauses');
65
-
66
- add_filter('posts_join', 'wp_all_export_posts_join', 10, 1);
67
- add_filter('posts_where', 'wp_all_export_posts_where', 10, 1);
68
- $code = 'return new WP_Query(array(' . $exportOptions['wp_query'] . ', \'offset\' => ' . $export->exported . ', \'posts_per_page\' => ' . $posts_per_page . ' ));';
69
- $exportQuery = eval($code);
70
-
71
- remove_filter('posts_where', 'wp_all_export_posts_where');
72
- remove_filter('posts_join', 'wp_all_export_posts_join');
73
- }
74
- } else {
75
- XmlExportEngine::$post_types = $exportOptions['cpt'];
76
-
77
- // $is_products_export = ($exportOptions['cpt'] == 'product' and class_exists('WooCommerce'));
78
-
79
- if (in_array('users', $exportOptions['cpt']) or in_array('shop_customer', $exportOptions['cpt'])) {
80
- add_action('pre_user_query', 'wp_all_export_pre_user_query', 10, 1);
81
- $exportQuery = new WP_User_Query(array('orderby' => 'ID', 'order' => 'ASC', 'number' => $posts_per_page, 'offset' => $export->exported));
82
- remove_action('pre_user_query', 'wp_all_export_pre_user_query');
83
- } elseif (in_array('taxonomies', $exportOptions['cpt'])) {
84
- add_filter('terms_clauses', 'wp_all_export_terms_clauses', 10, 3);
85
- $exportQuery = new WP_Term_Query(array('taxonomy' => $exportOptions['taxonomy_to_export'], 'orderby' => 'term_id', 'order' => 'ASC', 'number' => $posts_per_page, 'offset' => $export->exported, 'hide_empty' => false));
86
- $postCount = count($exportQuery->get_terms());
87
- remove_filter('terms_clauses', 'wp_all_export_terms_clauses');
88
- } elseif (in_array('comments', $exportOptions['cpt'])) {
89
- add_action('comments_clauses', 'wp_all_export_comments_clauses', 10, 1);
90
-
91
- global $wp_version;
92
-
93
- if (version_compare($wp_version, '4.2.0', '>=')) {
94
- $exportQuery = new WP_Comment_Query(array('orderby' => 'comment_ID', 'order' => 'ASC', 'number' => $posts_per_page, 'offset' => $export->exported));
95
- } else {
96
- $exportQuery = get_comments(array('orderby' => 'comment_ID', 'order' => 'ASC', 'number' => $posts_per_page, 'offset' => $export->exported));
97
- }
98
- remove_action('comments_clauses', 'wp_all_export_comments_clauses');
99
- } else {
100
- remove_all_actions('parse_query');
101
- remove_all_actions('pre_get_posts');
102
- remove_all_filters('posts_clauses');
103
- remove_all_filters('posts_orderby');
104
-
105
- add_filter('posts_join', 'wp_all_export_posts_join', 10, 1);
106
- add_filter('posts_where', 'wp_all_export_posts_where', 10, 1);
107
- $exportQuery = new WP_Query(array('post_type' => $exportOptions['cpt'], 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'offset' => $export->exported, 'posts_per_page' => $posts_per_page));
108
- remove_filter('posts_where', 'wp_all_export_posts_where');
109
- remove_filter('posts_join', 'wp_all_export_posts_join');
110
- }
111
- }
112
-
113
- XmlExportEngine::$exportQuery = $exportQuery;
114
-
115
- $engine->init_additional_data();
116
-
117
- // get total founded records
118
- if (XmlExportEngine::$is_comment_export) {
119
- global $wp_version;
120
-
121
- if (version_compare($wp_version, '4.2.0', '>=')) {
122
- $postCount = count($exportQuery->get_comments());
123
- add_action('comments_clauses', 'wp_all_export_comments_clauses', 10, 1);
124
- $result = new WP_Comment_Query(array('orderby' => 'comment_ID', 'order' => 'ASC', 'number' => 10, 'count' => true));
125
- $foundPosts = $result->get_comments();
126
- remove_action('comments_clauses', 'wp_all_export_comments_clauses');
127
- } else {
128
- $postCount = count($exportQuery);
129
- add_action('comments_clauses', 'wp_all_export_comments_clauses', 10, 1);
130
- $foundPosts = get_comments(array('orderby' => 'comment_ID', 'order' => 'ASC', 'number' => 10, 'count' => true));
131
- remove_action('comments_clauses', 'wp_all_export_comments_clauses');
132
- }
133
- } elseif (XmlExportEngine::$is_taxonomy_export) {
134
- add_filter('terms_clauses', 'wp_all_export_terms_clauses', 10, 3);
135
- $result = new WP_Term_Query(array('taxonomy' => $exportOptions['taxonomy_to_export'], 'orderby' => 'term_id', 'order' => 'ASC', 'hide_empty' => false));
136
- $foundPosts = count($result->get_terms());
137
- remove_filter('terms_clauses', 'wp_all_export_terms_clauses');
138
- } else {
139
-
140
- if(XmlExportEngine::$is_user_export) {
141
- $foundPosts = $exportQuery->get_total();
142
- $postCount = count($exportQuery->get_results());
143
- } else {
144
- $foundPosts = $exportQuery->found_posts;
145
- $postCount = $exportQuery->post_count;
146
- }
147
- }
148
- // [ \get total founded records ]
149
-
150
- if (!$export->exported) {
151
- $attachment_list = $export->options['attachment_list'];
152
- if (!empty($attachment_list)) {
153
- foreach ($attachment_list as $attachment) {
154
- if (!is_numeric($attachment)) {
155
- @unlink($attachment);
156
- }
157
- }
158
- }
159
- $exportOptions['attachment_list'] = array();
160
- $export->set(array(
161
- 'options' => $exportOptions
162
- ))->save();
163
-
164
- $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
165
-
166
- if ($is_secure_import and !empty($exportOptions['filepath'])) {
167
-
168
- $exportOptions['filepath'] = '';
169
- }
170
-
171
- PMXE_Plugin::$session->set('count', $foundPosts);
172
- PMXE_Plugin::$session->save_data();
173
- }
174
-
175
- // Export posts
176
- XmlCsvExport::export();
177
-
178
- $export->set(array(
179
- 'exported' => $export->exported + $postCount,
180
- 'last_activity' => date('Y-m-d H:i:s')
181
- ))->save();
182
-
183
-
184
- if ($posts_per_page != -1 && $postCount && !isAdvancedSingleItemExport($postCount, $foundPosts)) {
185
-
186
- $percentage = ceil(($export->exported / $foundPosts) * 100);
187
-
188
- $responseArray = array(
189
- 'export_id' => $export->id,
190
- 'queue_export' => false,
191
- 'exported' => $export->exported,
192
- 'percentage' => $percentage,
193
- 'done' => false,
194
- 'posts' => $postCount,
195
- 'records_per_request' => $exportOptions['records_per_iteration']
196
- );
197
-
198
- if(isset($code)){
199
- $responseArray['code'] = $code;
200
- } else {
201
- $responseArray['code'] = '';
202
- }
203
-
204
- wp_send_json($responseArray);
205
- } else {
206
- if (file_exists(PMXE_Plugin::$session->file)) {
207
-
208
- if ($exportOptions['export_to'] == 'xml') {
209
- switch (XmlExportEngine::$exportOptions['xml_template_type']) {
210
- case 'custom':
211
- require_once PMXE_ROOT_DIR . '/classes/XMLWriter.php';
212
- file_put_contents(PMXE_Plugin::$session->file, PMXE_XMLWriter::preprocess_xml(XmlExportEngine::$exportOptions['custom_xml_template_footer']), FILE_APPEND);
213
- break;
214
- default:
215
-
216
- break;
217
- }
218
-
219
- if (!in_array(XmlExportEngine::$exportOptions['xml_template_type'], array('custom', 'XmlGoogleMerchants'))) {
220
- $main_xml_tag = apply_filters('wp_all_export_main_xml_tag', $exportOptions['main_xml_tag'], $export->id);
221
-
222
- file_put_contents(PMXE_Plugin::$session->file, '</' . $main_xml_tag . '>', FILE_APPEND);
223
-
224
- $xml_footer = apply_filters('wp_all_export_xml_footer', '', $export->id);
225
-
226
- if (!empty($xml_footer)) file_put_contents(PMXE_Plugin::$session->file, $xml_footer, FILE_APPEND);
227
- }
228
- }
229
-
230
- $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
231
-
232
- if (!$is_secure_import) {
233
-
234
- if (!$export->isEmpty()) {
235
-
236
- $wp_filetype = wp_check_filetype(basename(PMXE_Plugin::$session->file), null);
237
- $attachment_data = array(
238
- 'guid' => $wp_uploads['baseurl'] . '/' . _wp_relative_upload_path(PMXE_Plugin::$session->file),
239
- 'post_mime_type' => $wp_filetype['type'],
240
- 'post_title' => preg_replace('/\.[^.]+$/', '', basename(PMXE_Plugin::$session->file)),
241
- 'post_content' => '',
242
- 'post_status' => 'inherit'
243
- );
244
-
245
- if (empty($export->attch_id)) {
246
- $attach_id = wp_insert_attachment($attachment_data, PMXE_Plugin::$session->file);
247
- } elseif ($export->options['creata_a_new_export_file']) {
248
- $attach_id = wp_insert_attachment($attachment_data, PMXE_Plugin::$session->file);
249
- } else {
250
- $attach_id = $export->attch_id;
251
- $attachment = get_post($attach_id);
252
- if ($attachment) {
253
- update_attached_file($attach_id, PMXE_Plugin::$session->file);
254
- wp_update_attachment_metadata($attach_id, $attachment_data);
255
- } else {
256
- $attach_id = wp_insert_attachment($attachment_data, PMXE_Plugin::$session->file);
257
- }
258
- }
259
-
260
- if (!in_array($attach_id, $exportOptions['attachment_list'])) $exportOptions['attachment_list'][] = $attach_id;
261
-
262
- $export->set(array(
263
- 'attch_id' => $attach_id,
264
- 'options' => $exportOptions
265
- ))->save();
266
- }
267
-
268
- } else {
269
- $exportOptions['filepath'] = wp_all_export_get_relative_path(PMXE_Plugin::$session->file);
270
-
271
- if (!$export->isEmpty()) {
272
- $export->set(array(
273
- 'options' => $exportOptions
274
- ))->save();
275
- }
276
-
277
- }
278
-
279
- PMXE_Wpallimport::generateImportTemplate($export, PMXE_Plugin::$session->file, PMXE_Plugin::$session->count);
280
-
281
- }
282
-
283
- $export->set(array(
284
- 'executing' => 0,
285
- 'canceled' => 0,
286
- 'iteration' => ++$export->iteration
287
- ))->save();
288
-
289
- do_action('pmxe_after_export', $export->id, $export);
290
-
291
- $queue_exports = empty($export->parent_id) ? array() : get_option('wp_all_export_queue_' . $export->parent_id);
292
-
293
- // update child exports with correct WHERE & JOIN filters
294
- if (!empty($export->options['cpt']) and class_exists('WooCommerce') and in_array('shop_order', $export->options['cpt']) and empty($export->parent_id)) {
295
- $queue_exports = XmlExportWooCommerceOrder::prepare_child_exports($export);
296
- }
297
-
298
- if (!empty($queue_exports) and !empty($export->parent_id)) {
299
- array_shift($queue_exports);
300
- }
301
-
302
- if (empty($queue_exports)) {
303
- delete_option('wp_all_export_queue_' . (empty($export->parent_id) ? $export->id : $export->parent_id));
304
- } else {
305
- update_option('wp_all_export_queue_' . (empty($export->parent_id) ? $export->id : $export->parent_id), $queue_exports);
306
- }
307
-
308
- wp_send_json(array(
309
- 'export_id' => $export->id,
310
- 'queue_export' => empty($queue_exports) ? false : $queue_exports[0],
311
- 'exported' => $export->exported,
312
- 'percentage' => 100,
313
- 'done' => true,
314
- 'records_per_request' => $exportOptions['records_per_iteration']
315
- ));
316
- }
317
- }
318
-
319
- /**
320
- * @param $postCount
321
- * @param $foundPosts
322
- * @return bool
323
- */
324
- function isAdvancedSingleItemExport($postCount, $foundPosts)
325
- {
326
- return ($postCount == 1 && $foundPosts == 1);
327
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/actions/wp_loaded.php DELETED
@@ -1,251 +0,0 @@
1
- <?php
2
-
3
- function pmxe_wp_loaded() {
4
-
5
- @ini_set("max_input_time", PMXE_Plugin::getInstance()->getOption('max_input_time'));
6
-
7
- $maxExecutionTime = PMXE_Plugin::getInstance()->getOption('max_execution_time');
8
- if($maxExecutionTime == -1) {
9
- $maxExecutionTime = 0;
10
- }
11
-
12
- @ini_set("max_execution_time", $maxExecutionTime);
13
-
14
- $scheduledExport = new \Wpae\Scheduling\Export();
15
-
16
- if ( ! empty($_GET['zapier_subscribe']) and ! empty($_GET['api_key']) )
17
- {
18
- $zapier_api_key = PMXE_Plugin::getInstance()->getOption('zapier_api_key');
19
-
20
- if ( ! empty($zapier_api_key) and $zapier_api_key == $_GET['api_key'] )
21
- {
22
- $subscriptions = get_option('zapier_subscribe', array());
23
-
24
- $body = json_decode(file_get_contents("php://input"), true);
25
-
26
- if ( ! empty($body))
27
- {
28
- $subscriptions[basename($body['target_url'])] = $body;
29
- }
30
-
31
- update_option('zapier_subscribe', $subscriptions);
32
-
33
- exit(json_encode(array('status' => 200)));
34
- }
35
- else
36
- {
37
- http_response_code(401);
38
- exit(json_encode(array('status' => 'error')));
39
- }
40
- }
41
-
42
- if ( ! empty($_GET['zapier_unsubscribe']) and ! empty($_GET['api_key']) )
43
- {
44
- $zapier_api_key = PMXE_Plugin::getInstance()->getOption('zapier_api_key');
45
-
46
- if ( ! empty($zapier_api_key) and $zapier_api_key == $_GET['api_key'] )
47
- {
48
- $subscriptions = get_option('zapier_subscribe', array());
49
-
50
- $body = json_decode(file_get_contents("php://input"), true);
51
-
52
- if ( ! empty($subscriptions[basename($body['target_url'])]) ) unset($subscriptions[basename($body['target_url'])]);
53
-
54
- update_option('zapier_subscribe', $subscriptions);
55
-
56
- exit(json_encode(array('status' => 200)));
57
- }
58
- else
59
- {
60
- http_response_code(401);
61
- exit(json_encode(array('status' => 'error')));
62
- }
63
- }
64
-
65
- if ( ! empty($_GET['export_completed']) and ! empty($_GET['api_key']))
66
- {
67
-
68
- $zapier_api_key = PMXE_Plugin::getInstance()->getOption('zapier_api_key');
69
-
70
- if ( ! empty($zapier_api_key) and $zapier_api_key == $_GET['api_key'] )
71
- {
72
-
73
- global $wpdb;
74
-
75
- $table_prefix = PMXE_Plugin::getInstance()->getTablePrefix();
76
-
77
- $export = $wpdb->get_row("SELECT * FROM {$table_prefix}exports ORDER BY `id` DESC LIMIT 1");
78
-
79
- if ( ! empty($export) and ! is_wp_error($export) )
80
- {
81
- $child_export = new PMXE_Export_Record();
82
- $child_export->getById( $export->id );
83
-
84
- if ( ! $child_export->isEmpty())
85
- {
86
- $wp_uploads = wp_upload_dir();
87
-
88
- $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
89
-
90
- if ( ! $is_secure_import)
91
- {
92
- $filepath = get_attached_file($child_export->attch_id);
93
- }
94
- else
95
- {
96
- $filepath = wp_all_export_get_absolute_path($child_export->options['filepath']);
97
- }
98
-
99
- $fileurl = str_replace($wp_uploads['basedir'], $wp_uploads['baseurl'], $filepath);
100
-
101
- $response = array(
102
- 'website_url' => home_url(),
103
- 'export_id' => $child_export->id,
104
- 'export_name' => $child_export->friendly_name,
105
- 'file_name' => basename($filepath),
106
- 'file_type' => $child_export->options['export_to'],
107
- 'post_types_exported' => empty($child_export->options['cpt']) ? $child_export->options['wp_query'] : implode($child_export->options['cpt'], ','),
108
- 'export_created_date' => $child_export->registered_on,
109
- 'export_last_run_date' => date('Y-m-d H:i:s'),
110
- 'export_trigger_type' => 'manual',
111
- 'records_exported' => $child_export->exported,
112
- 'export_file' => ''
113
- );
114
-
115
- if (file_exists($filepath))
116
- {
117
- $response['export_file_url'] = $fileurl;
118
- $response['status'] = 200;
119
- $response['message'] = 'OK';
120
- }
121
- else
122
- {
123
- $response['export_file_url'] = '';
124
- $response['status'] = 300;
125
- $response['message'] = 'File doesn\'t exist';
126
- }
127
-
128
- $response = apply_filters('wp_all_export_zapier_response', $response);
129
-
130
- wp_send_json(array($response));
131
- }
132
- }
133
-
134
- }
135
- else
136
- {
137
- http_response_code(401);
138
- exit(json_encode(array('status' => 'error')));
139
- }
140
- }
141
-
142
- /* Check if cron is manualy, then execute export */
143
- $cron_job_key = PMXE_Plugin::getInstance()->getOption('cron_job_key');
144
-
145
- if ( ! empty($_GET['action']) && ! empty($_GET['export_id']) && (!empty($_GET['export_hash']) || !empty($_GET['security_token'])))
146
- {
147
-
148
- if(empty($_GET['export_hash'])) {
149
- $securityToken = $_GET['security_token'];
150
- } else {
151
- $securityToken = $_GET['export_hash'];
152
- }
153
-
154
- if ( $securityToken == substr(md5($cron_job_key . $_GET['export_id']), 0, 16) )
155
- {
156
- $export = new PMXE_Export_Record();
157
-
158
- $export->getById($_GET['export_id']);
159
-
160
- if ( ! $export->isEmpty())
161
- {
162
- switch ($_GET['action'])
163
- {
164
- case 'get_data':
165
-
166
- if ( ! empty($export->options['current_filepath']) and @file_exists($export->options['current_filepath']))
167
- {
168
- $filepath = $export->options['current_filepath'];
169
- }
170
- else
171
- {
172
- $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
173
-
174
- if ( ! $is_secure_import)
175
- {
176
- $filepath = get_attached_file($export->attch_id);
177
- }
178
- else
179
- {
180
- $filepath = wp_all_export_get_absolute_path($export->options['filepath']);
181
- }
182
- }
183
-
184
- if ( ! empty($_GET['part']) and is_numeric($_GET['part'])) $filepath = str_replace(basename($filepath), str_replace('.' . $export->options['export_to'], '', basename($filepath)) . '-' . $_GET['part'] . '.' . $export->options['export_to'], $filepath);
185
-
186
- break;
187
-
188
- case 'get_bundle':
189
-
190
- $filepath = wp_all_export_get_absolute_path($export->options['bundlepath']);
191
-
192
- break;
193
- }
194
-
195
- if (file_exists($filepath))
196
- {
197
- $uploads = wp_upload_dir();
198
- $fileurl = $uploads['baseurl'] . str_replace($uploads['basedir'], '', str_replace(basename($filepath), rawurlencode(basename($filepath)), $filepath));
199
-
200
- if($export['options']['export_to'] == XmlExportEngine::EXPORT_TYPE_XML && $export['options']['xml_template_type'] == XmlExportEngine::EXPORT_TYPE_GOOLE_MERCHANTS) {
201
-
202
- // If we are doing a google merchants export, send the file as a download.
203
- header("Content-type: text/plain");
204
- header("Content-Disposition: attachment; filename=".basename($filepath));
205
- readfile($filepath);
206
-
207
- die;
208
- }
209
-
210
- if(apply_filters('wp_all_export_no_cache', false)) {
211
-
212
- // If we are doing a google merchants export, send the file as a download.
213
- header("Content-type: " . mime_content_type($filepath));
214
- header("Content-Disposition: attachment; filename=" . basename($filepath));
215
- header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
216
- header("Cache-Control: post-check=0, pre-check=0", false);
217
- header("Pragma: no-cache");
218
-
219
- readfile($filepath);
220
-
221
- die;
222
- }
223
-
224
- $fileurl = str_replace( "\\", "/", $fileurl );
225
-
226
- wp_redirect($fileurl);
227
- }
228
- else
229
- {
230
- wp_send_json(array(
231
- 'status' => 403,
232
- 'message' => __('File doesn\'t exist', 'wp_all_export_plugin')
233
- ));
234
- }
235
- }
236
- }
237
- else
238
- {
239
- wp_send_json(array(
240
- 'status' => 403,
241
- 'message' => __('Export hash is not valid.', 'wp_all_export_plugin')
242
- ));
243
- }
244
- }
245
-
246
- if(isset($_GET['action']) && $_GET['action'] == 'wpae_public_api') {
247
- $router = new \Wpae\Http\Router();
248
- $router->route($_GET['q'], false);
249
- }
250
- }
251
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/actions/wpmu_new_blog.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
-
3
- function pmxe_wpmu_new_blog($blog_id, $user_id, $domain, $path, $site_id, $meta)
4
- {
5
- // create/update required database tables
6
- require_once ABSPATH . 'wp-admin/includes/upgrade.php';
7
- require PMXE_Plugin::ROOT_DIR . '/schema.php';
8
- global $wpdb;
9
-
10
- if (function_exists('is_multisite') && is_multisite()) {
11
- // check if it is a network activation - if so, run the activation function for each blog id
12
- $old_blog = $wpdb->blogid;
13
-
14
- switch_to_blog($blog_id);
15
- require PMXE_Plugin::ROOT_DIR . '/schema.php';
16
- dbDelta($plugin_queries);
17
-
18
- switch_to_blog($old_blog);
19
- return;
20
- }
21
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/banner-772x250.png DELETED
Binary file
trunk/classes/CdataStrategy.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
-
3
-
4
- interface CdataStrategy
5
- {
6
- public function should_cdata_be_applied($field, $hasSnippets = false);
7
- }
 
 
 
 
 
 
 
trunk/classes/CdataStrategyAlways.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
-
3
- require_once('CdataStrategy.php');
4
-
5
- class CdataStrategyAlways implements CdataStrategy
6
- {
7
- public function should_cdata_be_applied($field, $hasSnippets = false)
8
- {
9
- return true;
10
- }
11
-
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
trunk/classes/CdataStrategyFactory.php DELETED
@@ -1,22 +0,0 @@
1
- <?php
2
-
3
- require_once(__DIR__.'/CdataStrategyAlways.php');
4
- require_once(__DIR__.'/CdataStrategyIllegalCharacters.php');
5
- require_once(__DIR__.'/CdataStrategyNever.php');
6
-
7
-
8
- class CdataStrategyFactory
9
- {
10
- public function create_strategy($strategy) {
11
-
12
- if($strategy == 'all') {
13
- return new CdataStrategyAlways();
14
- } else if($strategy == 'never') {
15
- return new CdataStrategyNever();
16
- } else if($strategy == 'auto') {
17
- return new CdataStrategyIllegalCharacters();
18
- } else {
19
- return new CdataStrategyIllegalCharacters();
20
- }
21
- }
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/classes/CdataStrategyIllegalCharacters.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
-
3
- require_once('CdataStrategy.php');
4
-
5
- class CdataStrategyIllegalCharacters implements CdataStrategy
6
- {
7
- private $illegalCharacters = array('<','>','&', '\'', '"','**LT**', '**GT**');
8
-
9
- public function should_cdata_be_applied($field, $hasSnippets = false)
10
- {
11
- if($hasSnippets) {
12
- $this->illegalCharacters = array('<','>','&', '**LT**', '**GT**');
13
- }
14
-
15
- foreach($this->illegalCharacters as $character) {
16
- if(strpos($field, $character) !== false) {
17
- return true;
18
- }
19
- }
20
-
21
- return false;
22
- }
23
-
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/classes/CdataStrategyIllegalCharactersHtmlEntities.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
-
3
- require_once('CdataStrategy.php');
4
-
5
- class CdataStrategyIllegalCharactersHtmlEntities implements CdataStrategy
6
- {
7
- public function should_cdata_be_applied($field, $hasSnippets = false)
8
- {
9
- return strlen($field) != strlen(htmlentities($field));
10
- }
11
-
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
trunk/classes/CdataStrategyNever.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
-
3
- require_once('CdataStrategy.php');
4
-
5
- class CdataStrategyNever implements CdataStrategy
6
- {
7
- public function should_cdata_be_applied($field, $hasSnippets = false)
8
- {
9
- return false;
10
- }
11
-
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
trunk/classes/XMLWriter.php DELETED
@@ -1,420 +0,0 @@
1
- <?php
2
-
3
- // Handle eval errors that cause the script to finish
4
- $wpaeErrorHandler = new WpaePhpInterpreterErrorHandler();
5
- register_shutdown_function(array($wpaeErrorHandler, 'handle'));
6
-
7
- /**
8
- * Class PMXE_XMLWriter
9
- */
10
- class PMXE_XMLWriter extends XMLWriter
11
- {
12
- /**
13
- * @var array
14
- */
15
- public $articles = array();
16
-
17
-
18
- /**
19
- * @param array $articles
20
- */
21
- public function writeArticle($articles = array())
22
- {
23
-
24
- $article = array_shift($articles);
25
-
26
- if (!empty($articles)) {
27
-
28
- $keys = array();
29
- foreach ($articles as $a) {
30
-
31
- foreach ($a as $key => $value) {
32
-
33
- if (!isset($article[$key])) {
34
- $article[$key] = array($value);
35
- } else {
36
- if (is_array($article[$key])){
37
- array_push($article[$key], $value);
38
- }
39
- else{
40
- $article[$key] = array($article[$key], $value);
41
- }
42
- }
43
-
44
- if (!in_array($key, $keys)) $keys[] = $key;
45
- }
46
- }
47
- }
48
-
49
- if (!empty($article)) {
50
- foreach ($article as $key => $value) {
51
- if (!is_array($value) && strpos($value, '#delimiter#') !== FALSE) {
52
- $article[$key] = explode('#delimiter#', $value);
53
- }
54
- }
55
- }
56
-
57
- $this->articles[] = $article;
58
- }
59
-
60
- /**
61
- * @param $ns
62
- * @param $element
63
- * @param $uri
64
- * @param $value
65
- * @return bool
66
- */
67
- public function putElement($ns, $element, $uri, $value)
68
- {
69
- if (in_array(XmlExportEngine::$exportOptions['xml_template_type'], array('custom', 'XmlGoogleMerchants'))) return true;
70
-
71
- if (empty($ns)) {
72
- return $this->writeElement($element, $value);
73
- } else {
74
- return $this->writeElementNS($ns, $element, $uri, $value);
75
- }
76
- }
77
-
78
- /**
79
- * @param $ns
80
- * @param $element
81
- * @param $uri
82
- * @return bool
83
- */
84
- public function beginElement($ns, $element, $uri)
85
- {
86
- if (in_array(XmlExportEngine::$exportOptions['xml_template_type'], array('custom', 'XmlGoogleMerchants'))) return true;
87
-
88
- if (empty($ns)) {
89
- return $this->startElement($element);
90
- } else {
91
- return $this->startElementNS($ns, $element, $uri);
92
- }
93
- }
94
-
95
- /**
96
- * @return bool
97
- */
98
- public function closeElement()
99
- {
100
-
101
- if (in_array(XmlExportEngine::$exportOptions['xml_template_type'], array('custom', 'XmlGoogleMerchants'))) return true;
102
-
103
- return $this->endElement();
104
- }
105
-
106
- /**
107
- * @param $value
108
- * @param $element_name
109
- *
110
- * @return bool
111
- */
112
- public function writeData($value, $element_name)
113
- {
114
- if (in_array(XmlExportEngine::$exportOptions['xml_template_type'], array('custom', 'XmlGoogleMerchants'))) return true;
115
-
116
- $cdataStrategyFactory = new CdataStrategyFactory();
117
-
118
- if (!isset(XmlExportEngine::$exportOptions['custom_xml_cdata_logic'])) {
119
- XmlExportEngine::$exportOptions['custom_xml_cdata_logic'] = 'auto';
120
- }
121
- $cdataStrategy = $cdataStrategyFactory->create_strategy(XmlExportEngine::$exportOptions['custom_xml_cdata_logic']);
122
- $is_wrap_into_cdata = $cdataStrategy->should_cdata_be_applied($value);
123
-
124
- $wrap_value_into_cdata = apply_filters('wp_all_export_is_wrap_value_into_cdata', $is_wrap_into_cdata, $value, $element_name);
125
-
126
- if ($wrap_value_into_cdata === false) {
127
- $this->writeRaw($value);
128
- } else {
129
- if (XmlExportEngine::$is_preview && XmlExportEngine::$exportOptions['show_cdata_in_preview']) {
130
- $this->text('CDATABEGIN' . $value . 'CDATACLOSE');
131
- } else if (XmlExportEngine::$is_preview && !XmlExportEngine::$exportOptions['show_cdata_in_preview']) {
132
- return $this->text($value);
133
- } else {
134
- $this->writeCdata($value);
135
- }
136
- }
137
- }
138
-
139
- /**
140
- * @return mixed|string
141
- */
142
- public function wpae_flush()
143
- {
144
- if (!in_array(XmlExportEngine::$exportOptions['xml_template_type'], array('custom', 'XmlGoogleMerchants'))) return $this->flush(true);
145
-
146
- $xml = '';
147
- foreach ($this->articles as $article) {
148
-
149
- $founded_values = array_keys($article);
150
- $node_tpl = XmlExportEngine::$exportOptions['custom_xml_template_loop'];
151
-
152
- // clean up XPaths for not found values
153
- preg_match_all("%(\{[^\}\{]*\})%", $node_tpl, $matches);
154
- $xpaths = array_unique($matches[0]);
155
-
156
- if (!empty($xpaths)) {
157
- foreach ($xpaths as $xpath) {
158
- if (!in_array(preg_replace("%[\{\}]%", "", $xpath), $founded_values)) {
159
- $node_tpl = str_replace($xpath, "", $node_tpl);
160
- }
161
- }
162
- }
163
-
164
- foreach ($article as $key => $value) {
165
- switch ($key) {
166
- case 'id':
167
- $node_tpl = str_replace('{'.$key.'}', '{' . $value . '}', $node_tpl);
168
- break;
169
- default:
170
- // replace [ and ]
171
- $v = str_replace(']', 'CLOSEBRAKET', str_replace('[', 'OPENBRAKET', $value));
172
- // replace { and }
173
- $v = str_replace('}', 'CLOSECURVE', str_replace('{', 'OPENCURVE', $v));
174
- // replace ( and )
175
- $v = str_replace(')', 'CLOSECIRCLE', str_replace('(', 'OPENCIRCLE', $v));
176
-
177
- $originalValue = $v;
178
-
179
- if (is_array($v)) {
180
- foreach($v as &$val) {
181
- $val = str_replace("\"","**DOUBLEQUOT**",$val);
182
- $val = str_replace("'","**SINGLEQUOT**",$val);
183
- }
184
-
185
- $delimiter = uniqid();
186
- $node_tpl = preg_replace('%\[(.*)\{'.$key.'\}([^\[]*)\]%', "[$1explode('" . $delimiter . "', '" . implode($delimiter, $v) . "')$2]", $node_tpl);
187
- $v = "[explode('" . $delimiter . "', '" . implode($delimiter, $v) . "')]";
188
- $v = str_replace('<','**LT**', $v);
189
- $v = str_replace('>','**GT**', $v);
190
- } else {
191
- $v = '{' . $v . '}';
192
- }
193
-
194
- $arrayTypes = array(
195
- 'Product Tags', 'Tags', 'Product Categories', 'Categories', 'Image URL', 'Image Filename', 'Image Path', 'Image ID', 'Image Title', 'Image Caption', 'Image Description', 'Image Alt Text', 'Product Type', 'Categories'
196
- );
197
-
198
- // We have an empty array, which is transformed into {}
199
- if(in_array($key, $arrayTypes) && $v == "{}") {
200
- $delimiter = uniqid();
201
- $node_tpl = preg_replace('%\[(.*)\{'.$key.'\}([^\[]*)\]%', "[$1explode('" . $delimiter . "', '" . implode($delimiter, array()) . "')$2]", $node_tpl);
202
- $v = "[explode('" . $delimiter . "', '" . implode($delimiter, array()) . "')]";
203
- }
204
-
205
- // We have an array with just one value (Which is transformed into a string)
206
- if(in_array($key, $arrayTypes) && count($originalValue) == 1) {
207
- $delimiter = uniqid();
208
- $node_tpl = preg_replace('%\[(.*)\{'.$key.'\}([^\[]*)\]%', "[$1explode('" . $delimiter . "', '" . implode($delimiter, array($originalValue)) . "')$2]", $node_tpl);
209
- $v = "[explode('" . $delimiter . "', '" . implode($delimiter, array($originalValue)) . "')]";
210
- }
211
-
212
- $node_tpl = str_replace('{' . $key . '}', $v, $node_tpl);
213
-
214
- break;
215
- }
216
- }
217
-
218
- $xml .= $node_tpl;
219
-
220
- }
221
-
222
- $this->articles = array();
223
- $wpaeString = new WpaeString();
224
- $xmlPrepreocesor = new WpaeXmlProcessor($wpaeString);
225
- return $xmlPrepreocesor->process($xml);
226
- }
227
-
228
- public static function getIndentationCount($content, $str)
229
- {
230
- $lines = explode("\r", $content);
231
- foreach ($lines as $lineNumber => $line) {
232
- if (strpos($line, $str) !== false) {
233
- return substr_count($line, "\t");
234
- }
235
- }
236
-
237
- return -1;
238
- }
239
-
240
- public static function indentTag($tag, $indentationCount, $index)
241
- {
242
- if($index == 0) {
243
- $indentationString = "";
244
- } else {
245
- $indentationString = str_repeat("\t", $indentationCount);
246
- }
247
-
248
- return $indentationString . $tag;
249
- }
250
-
251
- /**
252
- * @param string $xml
253
- * @return mixed|string
254
- *
255
- * @throws WpaeInvalidStringException
256
- * @throws WpaeMethodNotFoundException
257
- */
258
- public static function preprocess_xml($xml = '')
259
- {
260
- $xml = str_replace('<![CDATA[', 'DOMCdataSection', $xml);
261
-
262
- preg_match_all("%(\[[^\]\[]*\])%", $xml, $matches);
263
- $snipets = empty($matches) ? array() : array_unique($matches[0]);
264
- $simple_snipets = array();
265
- preg_match_all("%(\{[^\}\{]*\})%", $xml, $matches);
266
- $xpaths = array_unique($matches[0]);
267
-
268
- if (!empty($xpaths)) {
269
- foreach ($xpaths as $xpath) {
270
- if (!in_array($xpath, $snipets)) $simple_snipets[] = $xpath;
271
- }
272
- }
273
-
274
- if (!empty($snipets)) {
275
- foreach ($snipets as $snipet) {
276
- // if function is found
277
- if (preg_match("%\w+\(.*\)%", $snipet)) {
278
-
279
- $filtered = trim(trim(trim($snipet, "]"), "["));
280
- $filtered = preg_replace("%[\{\}]%", "\"", $filtered);
281
- $filtered = str_replace('CLOSEBRAKET', ']', str_replace('OPENBRAKET', '[', $filtered));
282
- $filtered = str_replace('CLOSECURVE', '}', str_replace('OPENCURVE', '{', $filtered));
283
- $filtered = str_replace('CLOSECIRCLE', ')', str_replace('OPENCIRCLE', '(', $filtered));
284
-
285
- $functionName = self::sanitizeFunctionName($filtered);
286
-
287
- $numberOfSingleQuotes = substr_count($filtered, "'");
288
- $numberOfDoubleQuotes = substr_count($filtered, "\"");
289
-
290
- if ($numberOfSingleQuotes % 2 || $numberOfDoubleQuotes % 2) {
291
- throw new WpaeInvalidStringException($functionName);
292
- }
293
-
294
- if (!function_exists($functionName)) {
295
- throw new WpaeMethodNotFoundException($functionName);
296
- }
297
-
298
- $values = eval("return " . $filtered . ";");
299
-
300
- $v = '';
301
- if (is_array($values)) {
302
- $tag = false;
303
-
304
- preg_match_all("%(<[\w]+[\s|>]{1})" . preg_quote($snipet) . "%", $xml, $matches);
305
-
306
- if (!empty($matches[1])) {
307
- $tag = array_shift($matches[1]);
308
- }
309
- if (empty($tag)) $tag = "<item>";
310
-
311
- $indentationCount = self::getIndentationCount($xml, $tag);
312
-
313
- $i = 0;
314
- foreach ($values as $number => $value) {
315
- $v .= self::indentTag($tag . self::maybe_cdata($value) . str_replace("<", "</", $tag) . "\n", $indentationCount, $i);
316
- $i++;
317
- }
318
-
319
- $xml = str_replace($tag . $snipet . str_replace("<", "</", $tag), $v, $xml);
320
- } else {
321
- $xml = str_replace($snipet, self::maybe_cdata($values), $xml);
322
- }
323
- }
324
- }
325
- }
326
-
327
- if (!empty($simple_snipets)) {
328
- foreach ($simple_snipets as $snipet) {
329
- $filtered = preg_replace("%[\{\}]%", "", $snipet);
330
-
331
- $is_attribute = false;
332
-
333
- //Encode data in attributes
334
- if (strpos($xml, "\"$snipet\"") !== false || strpos($xml, "'$snipet'") !== false) {
335
- $is_attribute = true;
336
- $filtered = str_replace('&amp;', '&', $filtered);
337
- $filtered = str_replace('&', '&amp;', $filtered);
338
- $filtered = str_replace('\'', '&#x27;', $filtered);
339
- $filtered = str_replace('"', '&quot;', $filtered);
340
- $filtered = str_replace('<', '&lt;', $filtered);
341
- $filtered = str_replace('>', '&gt;', $filtered);
342
- }
343
-
344
- $filtered = str_replace('CLOSEBRAKET', ']', str_replace('OPENBRAKET', '[', $filtered));
345
- $filtered = str_replace('CLOSECURVE', '}', str_replace('OPENCURVE', '{', $filtered));
346
- $filtered = str_replace('CLOSECIRCLE', ')', str_replace('OPENCIRCLE', '(', $filtered));
347
-
348
- if ($is_attribute) {
349
- $xml = str_replace($snipet, $filtered, $xml);
350
- } else {
351
- $xml = str_replace($snipet, self::maybe_cdata($filtered), $xml);
352
- }
353
- }
354
- }
355
-
356
- $xml = str_replace('DOMCdataSection', '<![CDATA[', $xml);
357
-
358
- return $xml;
359
- }
360
-
361
- /**
362
- * @param $v
363
- * @return string
364
- */
365
- public static function maybe_cdata($v)
366
- {
367
-
368
- if (XmlExportEngine::$is_preview) {
369
- $v = str_replace('&amp;', '&', $v);
370
- $v = htmlspecialchars($v);
371
- }
372
-
373
- if (XmlExportEngine::$is_preview && !XmlExportEngine::$exportOptions['show_cdata_in_preview']) {
374
- return $v;
375
- }
376
-
377
- $cdataStrategyFactory = new CdataStrategyFactory();
378
-
379
- if (!isset(XmlExportEngine::$exportOptions['custom_xml_cdata_logic'])) {
380
- XmlExportEngine::$exportOptions['custom_xml_cdata_logic'] = 'auto';
381
- }
382
-
383
- $cdataStrategy = $cdataStrategyFactory->create_strategy(XmlExportEngine::$exportOptions['custom_xml_cdata_logic']);
384
- $is_wrap_into_cdata = $cdataStrategy->should_cdata_be_applied($v);
385
-
386
- if ($is_wrap_into_cdata === false) {
387
- return $v;
388
- } else {
389
- if (XmlExportEngine::$is_preview && XmlExportEngine::$exportOptions['show_cdata_in_preview']) {
390
- return 'CDATABEGIN' . $v . 'CDATACLOSE';
391
- } else {
392
- return "<![CDATA[" . $v . "]]>";
393
- }
394
- }
395
- }
396
-
397
- /**
398
- * @param $filtered
399
- * @return mixed
400
- */
401
- private static function sanitizeFunctionName($filtered)
402
- {
403
- $functionName = preg_replace('/"[^"]+"/', '', $filtered);
404
- $functionName = preg_replace('/\'[^\']+\'/', '', $functionName);
405
-
406
- $firstSingleQuote = strpos($functionName, '\'');
407
- $firstDoubleQuote = strpos($functionName, '"');
408
-
409
- if ($firstDoubleQuote < $firstSingleQuote && $firstDoubleQuote != 0) {
410
- $functionName = explode('"', $functionName);
411
- $functionName = $functionName[0];
412
- } else if ($firstSingleQuote != 0) {
413
- $functionName = explode('\'', $functionName);
414
- $functionName = $functionName[0];
415
- }
416
- $functionName = str_replace(array('(', ')', ',', ' ', '\'', '"'), '', $functionName);
417
-
418
- return $functionName;
419
- }
420
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/classes/chunk.php DELETED
@@ -1,274 +0,0 @@
1
- <?php
2
- /**
3
- * Chunk
4
- *
5
- * Reads a large file in as chunks for easier parsing.
6
- *
7
- *
8
- * @package default
9
- * @author Max Tsiplyakov
10
- */
11
- class PMXE_Chunk {
12
- /**
13
- * options
14
- *
15
- * @var array Contains all major options
16
- * @access public
17
- */
18
- public $options = array(
19
- 'path' => './', // string The path to check for $file in
20
- 'element' => '', // string The XML element to return
21
- 'type' => 'upload',
22
- 'encoding' => 'UTF-8',
23
- 'pointer' => 1,
24
- 'chunkSize' => 1024,
25
- 'filter' => true,
26
- 'get_cloud' => false
27
- );
28
-
29
- /**
30
- * file
31
- *
32
- * @var string The filename being read
33
- * @access public
34
- */
35
- public $file = '';
36
- /**
37
- * pointer
38
- *
39
- * @var integer The current position the file is being read from
40
- * @access public
41
- */
42
- public $reader;
43
- public $cloud = array();
44
- public $loop = 1;
45
-
46
- /**
47
- * handle
48
- *
49
- * @var resource The fopen() resource
50
- * @access private
51
- */
52
- private $handle = null;
53
- /**
54
- * reading
55
- *
56
- * @var boolean Whether the script is currently reading the file
57
- * @access private
58
- */
59
-
60
- /**
61
- * __construct
62
- *
63
- * Builds the Chunk object
64
- *
65
- * @param string $file The filename to work with
66
- * @param array $options The options with which to parse the file
67
- * @author Dom Hastings
68
- * @access public
69
- */
70
- public function __construct($file, $options = array()) {
71
-
72
- // merge the options together
73
- $this->options = array_merge($this->options, (is_array($options) ? $options : array()));
74
-
75
- $this->options['chunkSize'] *= 32;
76
-
77
- // set the filename
78
- $this->file = $file;
79
-
80
- $is_html = false;
81
- $f = @fopen($file, "rb");
82
- while (!@feof($f)) {
83
- $chunk = @fread($f, 1024);
84
- if (strpos($chunk, "<!DOCTYPE") === 0) $is_html = true;
85
- break;
86
- }
87
- @fclose($f);
88
-
89
- if ($is_html) return;
90
-
91
- if (empty($this->options['element']) or $this->options['get_cloud'])
92
- {
93
- if (function_exists('stream_filter_register') and $this->options['filter']){
94
- stream_filter_register('preprocessxml', 'wpae_preprocessXml_filter');
95
- $path = 'php://filter/read=preprocessxml/resource=' . $this->file;
96
- }
97
- else $path = $this->file;
98
-
99
- $reader = new XMLReader();
100
- $reader->open($path);
101
- $reader->setParserProperty(XMLReader::VALIDATE, false);
102
- while ( @$reader->read()) {
103
- switch ($reader->nodeType) {
104
- case (XMLREADER::ELEMENT):
105
- $localName = str_replace("_colon_", ":", $reader->localName);
106
- if (array_key_exists(str_replace(":", "_", $localName), $this->cloud))
107
- $this->cloud[str_replace(":", "_", $localName)]++;
108
- else
109
- $this->cloud[str_replace(":", "_", $localName)] = 1;
110
- break;
111
- default:
112
-
113
- break;
114
- }
115
- }
116
- unset($reader);
117
-
118
- if ( ! empty($this->cloud) and empty($this->options['element']) ){
119
-
120
- arsort($this->cloud);
121
-
122
- $main_elements = array('node', 'product', 'job', 'deal', 'entry', 'item', 'property', 'listing', 'hotel', 'record', 'article', 'post', 'book');
123
-
124
- foreach ($this->cloud as $element_name => $value) {
125
- if ( in_array(strtolower($element_name), $main_elements) ){
126
- $this->options['element'] = $element_name;
127
- break;
128
- }
129
- }
130
-
131
- if (empty($this->options['element'])){
132
- foreach ($this->cloud as $el => $count) {
133
- $this->options['element'] = $el;
134
- break;
135
- }
136
- }
137
- }
138
- }
139
-
140
- if (function_exists('stream_filter_register') and $this->options['filter']){
141
- stream_filter_register('preprocessxml', 'wpae_preprocessXml_filter');
142
- $path = 'php://filter/read=preprocessxml/resource=' . $this->file;
143
- }
144
- else $path = $this->file;
145
-
146
- $this->reader = new XMLReader();
147
- @$this->reader->open($path);
148
- @$this->reader->setParserProperty(XMLReader::VALIDATE, false);
149
-
150
-
151
- }
152
-
153
- /**
154
- * __destruct
155
- *
156
- * Cleans up
157
- *
158
- * @return void
159
- * @author Dom Hastings
160
- * @access public
161
- */
162
- public function __destruct() {
163
- // close the file resource
164
- unset($this->reader);
165
- }
166
-
167
- /**
168
- * read
169
- *
170
- * Reads the first available occurence of the XML element $this->options['element']
171
- *
172
- * @return string The XML string from $this->file
173
- * @author Dom Hastings
174
- * @access public
175
- */
176
- public function read($debug = false) {
177
-
178
- // trim it
179
- $element = trim($this->options['element']);
180
-
181
- $xml = '';
182
-
183
- try {
184
- while ( @$this->reader->read() ) {
185
- switch ($this->reader->nodeType) {
186
- case (XMLREADER::ELEMENT):
187
- $localName = str_replace("_colon_", ":", $this->reader->localName);
188
-
189
- if ( strtolower(str_replace(":", "_", $localName)) == strtolower($element) ) {
190
-
191
- if ($this->loop < $this->options['pointer']){
192
- $this->loop++;
193
- continue;
194
- }
195
-
196
- $xml = @$this->reader->readOuterXML();
197
-
198
- break(2);
199
- }
200
- break;
201
- default:
202
- // code ...
203
- break;
204
- }
205
- }
206
- } catch (XmlImportException $e) {
207
- $xml = false;
208
- }
209
-
210
- return ( ! empty($xml) ) ? $this->removeColonsFromRSS(preg_replace('%xmlns.*=\s*([\'"&quot;]).*\1%sU', '', $xml)) : false;
211
-
212
- }
213
-
214
- function removeColonsFromRSS($feed) {
215
-
216
- $feed = str_replace("_colon_", ":", $feed);
217
-
218
- // pull out colons from start tags
219
- // (<\w+):(\w+>)
220
- $pattern = '/(<\w+):([\w+|\.|-]+[ |>]{1})/i';
221
- $replacement = '$1_$2';
222
- $feed = preg_replace($pattern, $replacement, $feed);
223
- // pull out colons from end tags
224
- // (<\/\w+):(\w+>)
225
- $pattern = '/(<\/\w+):([\w+|\.|-]+>)/i';
226
- $replacement = '$1_$2';
227
- $feed = preg_replace($pattern, $replacement, $feed);
228
- // pull out colons from attributes
229
- $pattern = '/(\s+\w+):(\w+[=]{1})/i';
230
- $replacement = '$1_$2';
231
- $feed = preg_replace($pattern, $replacement, $feed);
232
- // pull colons from single element
233
- // (<\w+):(\w+\/>)
234
- $pattern = '/(<\w+):([\w+|\.|-]+\/>)/i';
235
- $replacement = '$1_$2';
236
- $feed = preg_replace($pattern, $replacement, $feed);
237
-
238
- $is_preprocess_enabled = apply_filters('is_xml_preprocess_enabled', true);
239
- if ($is_preprocess_enabled)
240
- {
241
- // replace temporary word _ampersand_ back to & symbol
242
- $feed = str_replace("_ampersand_", "&", $feed);
243
- }
244
-
245
- return $feed;
246
-
247
- }
248
-
249
- }
250
-
251
- class wpae_preprocessXml_filter extends php_user_filter {
252
-
253
- function filter($in, $out, &$consumed, $closing)
254
- {
255
- while ($bucket = stream_bucket_make_writeable($in)) {
256
- $is_preprocess_enabled = apply_filters('is_xml_preprocess_enabled', true);
257
- if ($is_preprocess_enabled)
258
- {
259
- // the & symbol is not valid in XML, so replace it with temporary word _ampersand_
260
- $bucket->data = str_replace("&", "_ampersand_", $bucket->data);
261
- $bucket->data = preg_replace('/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', ' ', $this->replace_colons($bucket->data));
262
- }
263
- $consumed += $bucket->datalen;
264
- stream_bucket_append($out, $bucket);
265
- }
266
- return PSFS_PASS_ON;
267
- }
268
-
269
- function replace_colons($data)
270
- {
271
- return str_replace(":", "_colon_", $data);
272
- }
273
-
274
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/classes/config.php DELETED
@@ -1,99 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Class to load config files
5
- *
6
- * @author Pavel Kulbakin <p.kulbakin@gmail.com>
7
- */
8
- class PMXE_Config implements IteratorAggregate {
9
-
10
- /**
11
- * Config variables stored
12
- * @var array
13
- */
14
- protected $config = array();
15
-
16
- /**
17
- * List of loaded files in order to avoid loading same file several times
18
- * @var array
19
- */
20
- protected $loaded = array();
21
-
22
- /**
23
- * Static method to create config instance from file on disc
24
- * @param string $filePath
25
- * @param string[optional] $section
26
- * @return PMXE_Config
27
- */
28
- public static function createFromFile($filePath, $section = NULL) {
29
- $config = new self();
30
- return $config->loadFromFile($filePath, $section);
31
- }
32
-
33
- /**
34
- * Load config file
35
- * @param string $filePath
36
- * @param string [optional] $section
37
- * @return PMXE_Config
38
- */
39
- public function loadFromFile($filePath, $section = NULL)
40
- {
41
- if (!is_null($section)) {
42
- $this->config[$section] = self::createFromFile($filePath);
43
- } else {
44
- $filePath = realpath($filePath);
45
- if ($filePath and !in_array($filePath, $this->loaded)) {
46
-
47
- require $filePath;
48
-
49
- if (!isset($config)) {
50
- $config = array();
51
- }
52
- }
53
- $this->loaded[] = $filePath;
54
- $this->config = array_merge($this->config, $config);
55
- }
56
- return $this;
57
- }
58
-
59
- /**
60
- * Return value of setting with specified name
61
- * @param string $field Setting name
62
- * @param string[optional] $section Section name to look setting in
63
- * @return mixed
64
- */
65
- public function get($field, $section = NULL) {
66
- return ! is_null($section) ? $this->config[$section]->get($field) : $this->config[$field];
67
- }
68
-
69
- /**
70
- * Magic method for checking whether some config option are set
71
- * @param string $field
72
- * @return bool
73
- */
74
- public function __isset($field) {
75
- return isset($this->config[$field]);
76
- }
77
-
78
- /**
79
- * Magic method to implement object-like access to config parameters
80
- * @param string $field
81
- * @return mixed
82
- */
83
- public function __get($field) {
84
- return $this->config[$field];
85
- }
86
-
87
- /**
88
- * Return all config options as array
89
- * @return array
90
- */
91
- public function toArray($section = NULL) {
92
- return ! is_null($section) ? $this->config[$section]->toArray() : $this->config;
93
- }
94
-
95
- public function getIterator() {
96
- return new ArrayIterator($this->config);
97
- }
98
-
99
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/classes/download.php DELETED
@@ -1,58 +0,0 @@
1
- <?php
2
-
3
- class PMXE_Download
4
- {
5
-
6
- static public function zip($file_name)
7
- {
8
- $uploads = wp_upload_dir();
9
- $bundle_url = $uploads['baseurl'] . str_replace($uploads['basedir'], '', $file_name);
10
- $bundle_url = str_replace( "\\", "/", $bundle_url );
11
- wp_redirect($bundle_url);
12
- die;
13
- }
14
-
15
- static public function xls($file_name)
16
- {
17
- self::sendFile("Content-Type: application/vnd.ms-excel; charset=UTF-8", $file_name);
18
- }
19
-
20
- static public function xlsx($file_name)
21
- {
22
- self::sendFile("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=UTF-8", $file_name);
23
- }
24
-
25
- static public function csv($file_name)
26
- {
27
- self::sendFile("Content-Type: text/plain; charset=UTF-8", $file_name);
28
- }
29
-
30
- static public function txt($file_name)
31
- {
32
- self::sendFile("Content-Type: text/plain; charset=UTF-8", $file_name);
33
- }
34
-
35
- static public function xml($file_name)
36
- {
37
- self::sendFile("Content-Type: application/xhtml+xml; charset=UTF-8", $file_name);
38
- }
39
-
40
- static public function sendFile($header, $file_name)
41
- {
42
- // If we ar testing don't sent it as attachment
43
- if (php_sapi_name() != 'cli-server') {
44
- header($header);
45
- header("Content-Disposition: attachment; filename=\"" . basename($file_name) . "\"");
46
- header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
47
- header("Cache-Control: post-check=0, pre-check=0", false);
48
- header("Pragma: no-cache");
49
- }
50
- while (ob_get_level()) {
51
- ob_end_clean();
52
- }
53
-
54
- readfile($file_name);
55
- die;
56
- }
57
-
58
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/classes/handler.php DELETED
@@ -1,134 +0,0 @@
1
- <?php
2
-
3
- class PMXE_Handler extends PMXE_Session
4
- {
5
- /** cookie name */
6
- private $_cookie;
7
-
8
- /** session due to expire timestamp */
9
- private $_session_expiring;
10
-
11
- /** session expiration timestamp */
12
- private $_session_expiration;
13
-
14
- /** Bool based on whether a cookie exists **/
15
- private $_has_cookie = false;
16
-
17
- /**
18
- * Constructor for the session class.
19
- *
20
- * @access public
21
- * @return void
22
- */
23
- public function __construct()
24
- {
25
-
26
- $this->set_session_expiration();
27
-
28
- $this->_import_id = $this->generate_import_id();
29
-
30
- $this->_data = $this->get_session_data();
31
-
32
- }
33
-
34
- /**
35
- * Return true if the current user has an active session, i.e. a cookie to retrieve values
36
- * @return boolean
37
- */
38
- public function has_session()
39
- {
40
- return isset( $_COOKIE[ $this->_cookie ] ) || $this->_has_cookie || is_user_logged_in();
41
- }
42
-
43
- /**
44
- * set_session_expiration function.
45
- *
46
- * @access public
47
- * @return void
48
- */
49
- public function set_session_expiration()
50
- {
51
- $this->_session_expiring = time() + intval( apply_filters( 'wpallexport_session_expiring', 60 * 60 * 47 ) ); // 47 Hours
52
- $this->_session_expiration = time() + intval( apply_filters( 'wpallexport_session_expiration', 60 * 60 * 48 ) ); // 48 Hours
53
- }
54
-
55
- public function generate_import_id()
56
- {
57
- $input = new PMXE_Input();
58
- $import_id = $input->get('id', 'new');
59
-
60
- return $import_id;
61
- }
62
-
63
- /**
64
- * get_session_data function.
65
- *
66
- * @access public
67
- * @return array
68
- */
69
- public function get_session_data()
70
- {
71
- global $wpdb;
72
-
73
- $session = $wpdb->get_row( $wpdb->prepare("SELECT option_name, option_value FROM $wpdb->options WHERE option_name = %s", '_wpallexport_session_' . $this->_import_id . '_'), ARRAY_A );
74
-
75
- return empty($session) ? array() : maybe_unserialize($session['option_value']);
76
- }
77
-
78
- /**
79
- * get_session_data function.
80
- *
81
- * @access public
82
- * @return array
83
- */
84
- public function get_clear_session_data()
85
- {
86
- $this->_data = $this->get_session_data();
87
- $clear_data = array();
88
- foreach ($this->_data as $key => $value) {
89
- $ckey = sanitize_key( $key );
90
- $clear_data[ $ckey ] = maybe_unserialize( $value );
91
- }
92
-
93
- return $clear_data;
94
- }
95
-
96
- /**
97
- * save_data function.
98
- *
99
- * @access public
100
- * @return void
101
- */
102
- public function save_data()
103
- {
104
- // Dirty if something changed - prevents saving nothing new
105
- if ( $this->_dirty && $this->has_session() )
106
- {
107
- $session_option = '_wpallexport_session_' . $this->_import_id . '_';
108
- $session_expiry_option = '_wpallexport_session_expires_' . $this->_import_id . '_';
109
-
110
- global $wpdb;
111
-
112
- $session = $wpdb->get_row( $wpdb->prepare("SELECT option_name, option_value FROM $wpdb->options WHERE option_name = %s", $session_option), ARRAY_A );
113
-
114
- if ( empty($session) )
115
- {
116
- $wpdb->query($wpdb->prepare("INSERT INTO `$wpdb->options` (`option_name`, `option_value`, `autoload`) VALUES (%s, %s, 'no')", $session_option, serialize($this->_data)));
117
- $wpdb->query($wpdb->prepare("INSERT INTO `$wpdb->options` (`option_name`, `option_value`, `autoload`) VALUES (%s, %s, 'no')", $session_expiry_option, $this->_session_expiration));
118
- // add_option( $session_option, $this->_data, '', 'no' );
119
- // add_option( $session_expiry_option, $this->_session_expiration, '', 'no' );
120
- } else {
121
- // update_option( $session_option, $this->_data );
122
- $wpdb->query($wpdb->prepare("UPDATE `$wpdb->options` SET `option_value` = %s WHERE `option_name` = %s", serialize($this->_data), $session_option));
123
- }
124
- }
125
- }
126
-
127
- public function clean_session( $import_id = 'new' )
128
- {
129
- global $wpdb;
130
-
131
- $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->options WHERE option_name = %s", '_wpallexport_session_' . $import_id . '_') );
132
- $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->options WHERE option_name = %s", '_wpallexport_session_expires_' . $import_id . '_') );
133
- }
134
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/classes/helper.php DELETED
@@ -1,139 +0,0 @@
1
- <?php
2
- /**
3
- * Helper class which defnes a namespace for some commonly used functions
4
- *
5
- * @author Pavel Kulbakin <p.kulbakin@gmail.com>
6
- */
7
- class PMXE_Helper {
8
- const GLOB_MARK = 1;
9
- const GLOB_NOSORT = 2;
10
- const GLOB_ONLYDIR = 4;
11
-
12
- const GLOB_NODIR = 256;
13
- const GLOB_PATH = 512;
14
- const GLOB_NODOTS = 1024;
15
- const GLOB_RECURSE = 2048;
16
-
17
- /**
18
- * A safe empowered glob().
19
- *
20
- * Function glob() is prohibited on some server (probably in safe mode)
21
- * (Message "Warning: glob() has been disabled for security reasons in
22
- * (script) on line (line)") for security reasons as stated on:
23
- * http://seclists.org/fulldisclosure/2005/Sep/0001.html
24
- *
25
- * safe_glob() intends to replace glob() using readdir() & fnmatch() instead.
26
- * Supported flags: self::GLOB_MARK, self::GLOB_NOSORT, self::GLOB_ONLYDIR
27
- * Additional flags: self::GLOB_NODIR, self::GLOB_PATH, self::GLOB_NODOTS, self::GLOB_RECURSE
28
- * (not original glob() flags)
29
- * @author BigueNique AT yahoo DOT ca
30
- * @updates
31
- * - 080324 Added support for additional flags: self::GLOB_NODIR, self::GLOB_PATH,
32
- * self::GLOB_NODOTS, self::GLOB_RECURSE
33
- * - 100607 Recurse is_dir check fixed by Pavel Kulbakin <p.kulbakin@gmail.com>
34
- */
35
- public static function safe_glob($pattern, $flags=0) {
36
- $split = explode('/', str_replace('\\', '/', $pattern));
37
- $mask = array_pop($split);
38
- $path = implode('/', $split);
39
-
40
- if (($dir = @opendir($path . '/')) !== false or ($dir = @opendir($path)) !== false) {
41
- $glob = array();
42
- while(($file = readdir($dir)) !== false) {
43
- // Recurse subdirectories (self::GLOB_RECURSE)
44
- if (($flags & self::GLOB_RECURSE) && is_dir($path . '/' . $file) && ( ! in_array($file, array('.', '..')))) {
45
- $glob = array_merge($glob, self::array_prepend(self::safe_glob($path . '/' . $file . '/' . $mask, $flags), ($flags & self::GLOB_PATH ? '' : $file . '/')));
46
- }
47
- // Match file mask
48
- if (self::fnmatch($mask, $file, FNM_CASEFOLD)) {
49
- if ((( ! ($flags & self::GLOB_ONLYDIR)) || is_dir("$path/$file"))
50
- && (( ! ($flags & self::GLOB_NODIR)) || ( ! is_dir($path . '/' . $file)))
51
- && (( ! ($flags & self::GLOB_NODOTS)) || ( ! in_array($file, array('.', '..'))))
52
- ) {
53
- $glob[] = ($flags & self::GLOB_PATH ? $path . '/' : '') . $file . ($flags & self::GLOB_MARK ? '/' : '');
54
- }
55
- }
56
- }
57
- closedir($dir);
58
- if ( ! ($flags & self::GLOB_NOSORT)) sort($glob);
59
- return $glob;
60
- } else {
61
- return (strpos($pattern, "*") === false) ? array($pattern) : false;
62
- }
63
- }
64
-
65
- /**
66
- * Prepends $string to each element of $array
67
- * If $deep is true, will indeed also apply to sub-arrays
68
- * @author BigueNique AT yahoo DOT ca
69
- * @since 080324
70
- */
71
- public static function array_prepend($array, $string, $deep=false) {
72
- if(empty($array)||empty($string)) {
73
- return $array;
74
- }
75
- foreach ($array as $key => $element) {
76
- if (is_array($element)) {
77
- if ($deep) {
78
- $array[$key] = self::array_prepend($element,$string,$deep);
79
- } else {
80
- trigger_error(__METHOD__ . ': array element', E_USER_WARNING);
81
- }
82
- } else {
83
- $array[$key] = $string.$element;
84
- }
85
- }
86
- return $array;
87
-
88
- }
89
-
90
- const FNM_PATHNAME = 1;
91
- const FNM_NOESCAPE = 2;
92
- const FNM_PERIOD = 4;
93
- const FNM_CASEFOLD = 16;
94
-
95
- /**
96
- * non-POSIX complient remplacement for the fnmatch
97
- */
98
- public static function fnmatch($pattern, $string, $flags = 0) {
99
-
100
- $modifiers = null;
101
- $transforms = array(
102
- '\*' => '.*',
103
- '\?' => '.',
104
- '\[\!' => '[^',
105
- '\[' => '[',
106
- '\]' => ']',
107
- '\.' => '\.',
108
- '\\' => '\\\\',
109
- '\-' => '-',
110
- );
111
-
112
- // Forward slash in string must be in pattern:
113
- if ($flags & FNM_PATHNAME) {
114
- $transforms['\*'] = '[^/]*';
115
- }
116
-
117
- // Back slash should not be escaped:
118
- if ($flags & FNM_NOESCAPE) {
119
- unset($transforms['\\']);
120
- }
121
-
122
- // Perform case insensitive match:
123
- if ($flags & FNM_CASEFOLD) {
124
- $modifiers .= 'i';
125
- }
126
-
127
- // Period at start must be the same as pattern:
128
- if ($flags & FNM_PERIOD) {
129
- if (strpos($string, '.') === 0 && strpos($pattern, '.') !== 0) return false;
130
- }
131
-
132
- $pattern = '#^'
133
- .strtr(preg_quote($pattern, '#'), $transforms)
134
- .'$#'
135
- .$modifiers;
136
-
137
- return (boolean)preg_match($pattern, $string);
138
- }
139
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/classes/input.php DELETED
@@ -1,81 +0,0 @@
1
- <?php
2
- class PMXE_Input {
3
- protected $filters = array('stripslashes');
4
-
5
- public function read($inputArray, $paramName, $default = NULL) {
6
- if (is_array($paramName) and ! is_null($default)) {
7
- throw new Exception('Either array of parameter names with default values as the only argument or param name and default value as seperate arguments are expected.');
8
- }
9
- if (is_array($paramName)) {
10
- foreach ($paramName as $param => $def) {
11
- if (isset($inputArray[$param])) {
12
- $paramName[$param] = $this->applyFilters($inputArray[$param]);
13
- }
14
- }
15
- return $paramName;
16
- } else {
17
- return isset($inputArray[$paramName]) ? $this->applyFilters($inputArray[$paramName]) : $default;
18
- }
19
- }
20
-
21
- public function get($paramName, $default = NULL) {
22
- $this->addFilter('htmlspecialchars');
23
- $this->addFilter('strip_tags');
24
- $this->addFilter('esc_sql');
25
- $this->addFilter('esc_js');
26
- $result = $this->read($_GET, $paramName, $default);
27
- $this->removeFilter('htmlspecialchars');
28
- $this->removeFilter('strip_tags');
29
- $this->removeFilter('esc_sql');
30
- $this->removeFilter('esc_js');
31
- return $result;
32
- }
33
-
34
- public function post($paramName, $default = NULL) {
35
- return $this->read($_POST, $paramName, $default);
36
- }
37
-
38
- public function cookie($paramName, $default = NULL) {
39
- return $this->read($_COOKIE, $paramName, $default);
40
- }
41
-
42
- public function request($paramName, $default = NULL) {
43
- return $this->read($_GET + $_POST + $_COOKIE, $paramName, $default);
44
- }
45
-
46
- public function getpost($paramName, $default = NULL) {
47
- return $this->read($_GET + $_POST, $paramName, $default);
48
- }
49
-
50
- public function server($paramName, $default = NULL) {
51
- return $this->read($_SERVER, $paramName, $default);
52
- }
53
-
54
- public function addFilter($callback) {
55
- if ( ! is_callable($callback)) {
56
- throw new Exception(get_class($this) . '::' . __METHOD__ . ' parameter must be a proper callback function reference.');
57
- }
58
- if ( ! in_array($callback, $this->filters)) {
59
- $this->filters[] = $callback;
60
- }
61
- return $this;
62
- }
63
-
64
- public function removeFilter($callback) {
65
- $this->filters = array_diff($this->filters, array($callback));
66
- return $this;
67
- }
68
-
69
- protected function applyFilters($val) {
70
- if (is_array($val)) {
71
- foreach ($val as $k => $v) {
72
- $val[$k] = $this->applyFilters($v);
73
- }
74
- } else {
75
- foreach ($this->filters as $filter) {
76
- $val = call_user_func($filter, $val);
77
- }
78
- }
79
- return $val;
80
- }
81
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/classes/installer.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
-
3
- class PMXE_Installer
4
- {
5
- const MIN_PHP_VERSION = "5.3.0";
6
-
7
- const WRONG_PHP_VERSION_MESSAGE = "WP All Export requires PHP %1s or greater, you are using PHP %2s. Please contact your host and tell them to update your server to at least PHP %1s.";
8
-
9
- public function checkActivationConditions()
10
- {
11
- if (version_compare(phpversion(), self::MIN_PHP_VERSION , "<")) {
12
- $this->error(sprintf(
13
- self::WRONG_PHP_VERSION_MESSAGE,
14
- self::MIN_PHP_VERSION,
15
- phpversion(),
16
- self::MIN_PHP_VERSION
17
- ));
18
- }
19
- }
20
-
21
- private function error($message){
22
-
23
- $message = __($message);
24
- $error = <<<EOT
25
- <style type="text/css">
26
- body, html {
27
- margin: 0;
28
- padding: 0;
29
- }
30
- </style>
31
- <div class="error">
32
- <p style="padding-left:2px; font-size:13px; color: #444; font-family: 'Open Sans',sans-serif; -webkit-font-smoothing: subpixel-antialiased;">
33
- $message
34
- </p>
35
- </div>
36
- EOT;
37
- echo $error;
38
- die;
39
- }
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/classes/session.php DELETED
@@ -1,96 +0,0 @@
1
- <?php
2
-
3
- abstract class PMXE_Session {
4
-
5
- /** @var int $_customer_id */
6
- protected $_import_id;
7
-
8
- /** @var array $_data */
9
- protected $_data = array();
10
-
11
- /** @var bool $_dirty When something changes */
12
- protected $_dirty = false;
13
-
14
- /**
15
- * __get function.
16
- *
17
- * @access public
18
- * @param mixed $key
19
- * @return mixed
20
- */
21
- public function __get( $key ) {
22
- return $this->get( $key );
23
- }
24
-
25
- /**
26
- * __set function.
27
- *
28
- * @access public
29
- * @param mixed $key
30
- * @param mixed $value
31
- * @return void
32
- */
33
- public function __set( $key, $value ) {
34
- $this->set( $key, $value );
35
- }
36
-
37
- /**
38
- * __isset function.
39
- *
40
- * @access public
41
- * @param mixed $key
42
- * @return bool
43
- */
44
- public function __isset( $key ) {
45
- return isset( $this->_data[ sanitize_title( $key ) ] );
46
- }
47
-
48
- /**
49
- * __unset function.
50
- *
51
- * @access public
52
- * @param mixed $key
53
- * @return void
54
- */
55
- public function __unset( $key ) {
56
-
57
- if ( isset( $this->_data[ $key ] ) ) {
58
- unset( $this->_data[ $key ] );
59
- $this->_dirty = true;
60
- }
61
-
62
- }
63
-
64
- /**
65
- * Get a session variable
66
- *
67
- * @param string $key
68
- * @param mixed $default used if the session variable isn't set
69
- * @return mixed value of session variable
70
- */
71
- public function get( $key, $default = null ) {
72
- $key = sanitize_key( $key );
73
- return isset( $this->_data[ $key ] ) ? maybe_unserialize( $this->_data[ $key ] ) : $default;
74
- }
75
-
76
- /**
77
- * Set a session variable
78
- *
79
- * @param string $key
80
- * @param mixed $value
81
- */
82
- public function set( $key, $value ) {
83
- $this->_data[ sanitize_key( $key ) ] = maybe_serialize( $value );
84
- $this->_dirty = true;
85
- }
86
-
87
- /**
88
- * get_import_id function.
89
- *
90
- * @access public
91
- * @return int
92
- */
93
- public function get_import_id() {
94
- return $this->_import_id;
95
- }
96
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/classes/wpallimport.php DELETED
@@ -1,582 +0,0 @@
1
- <?php
2
-
3
- final class PMXE_Wpallimport
4
- {
5
- /**
6
- * Singletone instance
7
- * @var PMXE_Wpallimport
8
- */
9
- protected static $instance;
10
-
11
- /**
12
- * Return singletone instance
13
- * @return PMXE_Wpallimport
14
- */
15
- static public function getInstance() {
16
- if (self::$instance == NULL) {
17
- self::$instance = new self();
18
- }
19
- return self::$instance;
20
- }
21
-
22
- private function __construct(){}
23
-
24
- public static function create_an_import( & $export )
25
- {
26
-
27
- $custom_type = (empty($export->options['cpt'])) ? 'post' : $export->options['cpt'][0];
28
-
29
- // Do not create an import for WooCommerce Orders & Refunds
30
- // if ( in_array($custom_type, array('shop_order'))) return false;
31
-
32
- if ( $export->options['is_generate_import'] and wp_all_export_is_compatible() ){
33
-
34
- $import = new PMXI_Import_Record();
35
-
36
- if ( ! empty($export->options['import_id']) ) $import->getById($export->options['import_id']);
37
-
38
- if ($import->isEmpty())
39
- {
40
- $import->set(array(
41
- 'parent_import_id' => 99999,
42
- 'xpath' => '/',
43
- 'type' => 'upload',
44
- 'options' => array('empty'),
45
- 'root_element' => 'root',
46
- 'path' => 'path',
47
- 'imported' => 0,
48
- 'created' => 0,
49
- 'updated' => 0,
50
- 'skipped' => 0,
51
- 'deleted' => 0,
52
- 'iteration' => 1
53
- ))->save();
54
-
55
- if ( ! empty(PMXE_Plugin::$session) and PMXE_Plugin::$session->has_session() )
56
- {
57
- PMXE_Plugin::$session->set('import_id', $import->id);
58
- }
59
- $options = $export->options;
60
- $options['import_id'] = $import->id;
61
-
62
- $export->set(array(
63
- 'options' => $options
64
- ))->save();
65
- }
66
- else
67
- {
68
- if ( $import->parent_import_id != 99999 )
69
- {
70
- $newImport = new PMXI_Import_Record();
71
-
72
- $newImport->set(array(
73
- 'parent_import_id' => 99999,
74
- 'xpath' => '/',
75
- 'type' => 'upload',
76
- 'options' => array('empty'),
77
- 'root_element' => 'root',
78
- 'path' => 'path',
79
- 'imported' => 0,
80
- 'created' => 0,
81
- 'updated' => 0,
82
- 'skipped' => 0,
83
- 'deleted' => 0,
84
- 'iteration' => 1
85
- ))->save();
86
-
87
- if ( ! empty(PMXE_Plugin::$session) and PMXE_Plugin::$session->has_session() )
88
- {
89
- PMXE_Plugin::$session->set('import_id', $newImport->id);
90
- }
91
-
92
- $options = $export->options;
93
- $options['import_id'] = $newImport->id;
94
-
95
- $export->set(array(
96
- 'options' => $options
97
- ))->save();
98
- }
99
- else
100
- {
101
- global $wpdb;
102
- $post = new PMXI_Post_List();
103
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $post->getTable() . ' WHERE import_id = %s', $import->id));
104
- }
105
- }
106
- }
107
- }
108
-
109
- public static $templateOptions = array();
110
- public static function generateImportTemplate( & $export, $file_path = '', $foundPosts = 0, $link_to_import = true )
111
- {
112
- $exportOptions = $export->options;
113
-
114
- $custom_type = (empty($exportOptions['cpt'])) ? 'post' : $exportOptions['cpt'][0];
115
-
116
- // Do not create an import template for WooCommerce Refunds
117
- if ( $export->options['export_to'] == 'xml' && in_array($export->options['xml_template_type'], array('custom', 'XmlGoogleMerchants')) ) return false;
118
-
119
- // Generate template for WP All Import
120
- if ($exportOptions['is_generate_templates'])
121
- {
122
- self::$templateOptions = array(
123
- 'type' => ( ! empty($exportOptions['cpt']) and $exportOptions['cpt'][0] == 'page') ? 'page' : 'post',
124
- 'wizard_type' => 'new',
125
- 'deligate' => 'wpallexport',
126
- 'custom_type' => (XmlExportEngine::$is_user_export) ? 'import_users' : $custom_type,
127
- 'status' => 'xpath',
128
- 'is_multiple_page_parent' => 'no',
129
- 'unique_key' => '',
130
- 'acf' => array(),
131
- 'fields' => array(),
132
- 'is_multiple_field_value' => array(),
133
- 'multiple_value' => array(),
134
- 'fields_delimiter' => array(),
135
- 'update_all_data' => 'no',
136
- 'is_update_status' => 0,
137
- 'is_update_title' => 0,
138
- 'is_update_author' => 0,
139
- 'is_update_slug' => 0,
140
- 'is_update_content' => 0,
141
- 'is_update_excerpt' => 0,
142
- 'is_update_dates' => 0,
143
- 'is_update_menu_order' => 0,
144
- 'is_update_parent' => 0,
145
- 'is_update_attachments' => 0,
146
- 'is_update_acf' => 0,
147
- 'is_update_comment_status' => 0,
148
- 'import_img_tags' => 1,
149
- 'update_acf_logic' => 'only',
150
- 'acf_list' => '',
151
- 'is_update_product_type' => 1,
152
- 'is_update_attributes' => 0,
153
- 'update_attributes_logic' => 'only',
154
- 'attributes_list' => '',
155
- 'is_update_images' => 0,
156
- 'is_update_custom_fields' => 0,
157
- 'update_custom_fields_logic' => 'only',
158
- 'custom_fields_list' => '',
159
- 'is_update_categories' => 0,
160
- 'update_categories_logic' => 'only',
161
- 'taxonomies_list' => '',
162
- 'export_id' => $export->id
163
- );
164
-
165
- if ( in_array('product', $exportOptions['cpt']) )
166
- {
167
- $default = array(
168
- 'is_multiple_product_type' => 'yes',
169
- 'multiple_product_type' => 'simple',
170
- 'is_product_virtual' => 'no',
171
- 'is_product_downloadable' => 'no',
172
- 'is_product_enabled' => 'yes',
173
- 'is_variation_enabled' => 'yes',
174
- 'is_product_featured' => 'no',
175
- 'is_product_visibility' => 'visible',
176
- 'is_multiple_product_tax_status' => 'yes',
177
- 'multiple_product_tax_status' => 'none',
178
- 'is_multiple_product_tax_class' => 'yes',
179
- 'is_product_manage_stock' => 'no',
180
- 'product_stock_status' => 'auto',
181
- 'product_allow_backorders' => 'no',
182
- 'product_sold_individually' => 'no',
183
- 'is_multiple_product_shipping_class' => 'yes',
184
- 'is_multiple_grouping_product' => 'yes',
185
- 'is_product_enable_reviews' => 'no',
186
- 'single_sale_price_dates_from' => 'now',
187
- 'single_sale_price_dates_to' => 'now',
188
- 'product_files_delim' => ',',
189
- 'product_files_names_delim' => ',',
190
- 'matching_parent' => 'auto',
191
- 'parent_indicator' => 'custom field',
192
- 'missing_records_stock_status' => 0,
193
- 'is_variable_sale_price_shedule' => 0,
194
- 'is_variable_product_virtual' => 'no',
195
- 'is_variable_product_manage_stock' => 'no',
196
- 'is_multiple_variable_product_shipping_class' => 'yes',
197
- 'is_multiple_variable_product_tax_class' => 'yes',
198
- 'multiple_variable_product_tax_class' => 'parent',
199
- 'variable_stock_status' => 'instock',
200
- 'variable_allow_backorders' => 'no',
201
- 'is_variable_product_downloadable' => 'no',
202
- 'variable_product_files_delim' => ',',
203
- 'variable_product_files_names_delim' => ',',
204
- 'is_variable_product_enabled' => 'yes',
205
- 'first_is_parent' => 'yes',
206
- 'default_attributes_type' => 'first',
207
- 'disable_sku_matching' => 1,
208
- 'disable_prepare_price' => 1,
209
- 'convert_decimal_separator' => 1,
210
- 'grouping_indicator' => 'xpath',
211
- 'is_update_product_type' => 1,
212
- 'make_simple_product' => 1,
213
- 'single_product_regular_price_adjust_type' => '%',
214
- 'single_product_sale_price_adjust_type' => '%',
215
- 'is_variation_product_manage_stock' => 'no',
216
- 'variation_stock_status' => 'auto',
217
- );
218
-
219
- self::$templateOptions = array_replace_recursive(self::$templateOptions, $default);
220
-
221
- self::$templateOptions['_virtual'] = 1;
222
- self::$templateOptions['_downloadable'] = 1;
223
- self::$templateOptions['put_variation_image_to_gallery'] = 1;
224
- self::$templateOptions['disable_auto_sku_generation'] = 1;
225
- }
226
-
227
- if ( in_array('shop_order', $exportOptions['cpt']) )
228
- {
229
- self::$templateOptions['update_all_data'] = 'no';
230
- self::$templateOptions['is_update_status'] = 0;
231
- self::$templateOptions['is_update_dates'] = 0;
232
- self::$templateOptions['is_update_excerpt'] = 0;
233
-
234
- // $default = PMWI_Plugin::get_default_import_options();
235
- // self::$templateOptions['pmwi_order'] = $default['pmwi_order'];
236
- self::$templateOptions['pmwi_order'] = array();
237
- self::$templateOptions['pmwi_order']['is_update_billing_details'] = 0;
238
- self::$templateOptions['pmwi_order']['is_update_shipping_details'] = 0;
239
- self::$templateOptions['pmwi_order']['is_update_payment'] = 0;
240
- self::$templateOptions['pmwi_order']['is_update_notes'] = 0;
241
- self::$templateOptions['pmwi_order']['is_update_products'] = 0;
242
- self::$templateOptions['pmwi_order']['is_update_fees'] = 0;
243
- self::$templateOptions['pmwi_order']['is_update_coupons'] = 0;
244
- self::$templateOptions['pmwi_order']['is_update_shipping'] = 0;
245
- self::$templateOptions['pmwi_order']['is_update_taxes'] = 0;
246
- self::$templateOptions['pmwi_order']['is_update_refunds'] = 0;
247
- self::$templateOptions['pmwi_order']['is_update_total'] = 0;
248
- self::$templateOptions['pmwi_order']['is_guest_matching'] = 1;
249
- self::$templateOptions['pmwi_order']['status'] = 'wc-pending';
250
- self::$templateOptions['pmwi_order']['billing_source'] = 'existing';
251
- self::$templateOptions['pmwi_order']['billing_source_match_by'] = 'username';
252
- self::$templateOptions['pmwi_order']['shipping_source'] = 'guest';
253
- self::$templateOptions['pmwi_order']['copy_from_billing'] = 1;
254
- self::$templateOptions['pmwi_order']['products_repeater_mode'] = 'csv';
255
- self::$templateOptions['pmwi_order']['products_repeater_mode_separator'] = '|';
256
- self::$templateOptions['pmwi_order']['products_source'] = 'existing';
257
- self::$templateOptions['pmwi_order']['fees_repeater_mode'] = 'csv';
258
- self::$templateOptions['pmwi_order']['fees_repeater_mode_separator'] = '|';
259
- self::$templateOptions['pmwi_order']['coupons_repeater_mode'] = 'csv';
260
- self::$templateOptions['pmwi_order']['coupons_repeater_mode_separator'] = '|';
261
- self::$templateOptions['pmwi_order']['shipping_repeater_mode'] = 'csv';
262
- self::$templateOptions['pmwi_order']['shipping_repeater_mode_separator'] = '|';
263
- self::$templateOptions['pmwi_order']['taxes_repeater_mode'] = 'csv';
264
- self::$templateOptions['pmwi_order']['taxes_repeater_mode_separator'] = '|';
265
- self::$templateOptions['pmwi_order']['order_total_logic'] = 'auto';
266
- self::$templateOptions['pmwi_order']['order_refund_date'] = 'now';
267
- self::$templateOptions['pmwi_order']['order_refund_issued_source'] = 'existing';
268
- self::$templateOptions['pmwi_order']['order_refund_issued_match_by'] = 'username';
269
- self::$templateOptions['pmwi_order']['notes_repeater_mode'] = 'csv';
270
- self::$templateOptions['pmwi_order']['notes_repeater_mode_separator'] = '|';
271
- }
272
-
273
- if ( XmlExportEngine::$is_user_export )
274
- {
275
- self::$templateOptions['is_update_first_name'] = 0;
276
- self::$templateOptions['is_update_last_name'] = 0;
277
- self::$templateOptions['is_update_role'] = 0;
278
- self::$templateOptions['is_update_nickname'] = 0;
279
- self::$templateOptions['is_update_description'] = 0;
280
- self::$templateOptions['is_update_login'] = 0;
281
- self::$templateOptions['is_update_password'] = 0;
282
- self::$templateOptions['is_update_nicename'] = 0;
283
- self::$templateOptions['is_update_email'] = 0;
284
- self::$templateOptions['is_update_registered'] = 0;
285
- self::$templateOptions['is_update_display_name'] = 0;
286
- self::$templateOptions['is_update_url'] = 0;
287
- }
288
-
289
- if (XmlExportEngine::$is_taxonomy_export){
290
- self::$templateOptions['taxonomy_type'] = $exportOptions['taxonomy_to_export'];
291
- }
292
-
293
- self::prepare_import_template( $exportOptions );
294
-
295
- if ( in_array('product', $exportOptions['cpt']) )
296
- {
297
- self::$templateOptions['single_page_parent'] = '';
298
- if ( ! empty($exportOptions['export_variations']) && $exportOptions['export_variations'] == XmlExportEngine::VARIABLE_PRODUCTS_EXPORT_VARIATION ){
299
- if ( $exportOptions['export_variations_title'] == XmlExportEngine::VARIATION_USE_PARENT_TITLE ){
300
- self::$templateOptions['matching_parent'] = 'first_is_variation';
301
- }
302
- if ( $exportOptions['export_variations_title'] == XmlExportEngine::VARIATION_USE_DEFAULT_TITLE ) {
303
- self::$templateOptions['matching_parent'] = 'first_is_parent_id';
304
- }
305
- self::$templateOptions['create_new_records'] = 0;
306
- self::$templateOptions['is_update_product_type'] = 0;
307
- }
308
- }
309
-
310
- $tpl_options = self::$templateOptions;
311
-
312
- if ( 'csv' == $exportOptions['export_to'] )
313
- {
314
- $tpl_options['delimiter'] = $exportOptions['delimiter'];
315
- $tpl_options['root_element'] = 'node';
316
- }
317
- else
318
- {
319
- $tpl_options['root_element'] = $exportOptions['record_xml_tag'];
320
- }
321
-
322
- $tpl_options['update_all_data'] = 'yes';
323
- $tpl_options['is_update_status'] = 1;
324
- $tpl_options['is_update_title'] = 1;
325
- $tpl_options['is_update_author'] = 1;
326
- $tpl_options['is_update_slug'] = 1;
327
- $tpl_options['is_update_content'] = 1;
328
- $tpl_options['is_update_excerpt'] = 1;
329
- $tpl_options['is_update_dates'] = 1;
330
- $tpl_options['is_update_menu_order'] = 1;
331
- $tpl_options['is_update_parent'] = 1;
332
- $tpl_options['is_update_attachments'] = 1;
333
- $tpl_options['is_update_acf'] = 1;
334
- $tpl_options['update_acf_logic'] = 'full_update';
335
- $tpl_options['acf_list'] = '';
336
- $tpl_options['is_update_product_type'] = 1;
337
- $tpl_options['is_update_attributes'] = 1;
338
- $tpl_options['update_attributes_logic'] = 'full_update';
339
- $tpl_options['attributes_list'] = '';
340
- $tpl_options['is_update_images'] = 1;
341
- $tpl_options['is_update_custom_fields'] = 1;
342
- $tpl_options['update_custom_fields_logic'] = 'full_update';
343
- $tpl_options['custom_fields_list'] = '';
344
- $tpl_options['is_update_categories'] = 1;
345
- $tpl_options['update_categories_logic'] = 'full_update';
346
- $tpl_options['taxonomies_list'] = '';
347
-
348
- $tpl_data = array(
349
- 'name' => $exportOptions['template_name'],
350
- 'is_keep_linebreaks' => 1,
351
- 'is_leave_html' => 0,
352
- 'fix_characters' => 0,
353
- 'options' => $tpl_options,
354
- );
355
-
356
- $exportOptions['tpl_data'] = $tpl_data;
357
-
358
- $export->set(array(
359
- 'options' => $exportOptions
360
- ))->save();
361
-
362
- }
363
-
364
- $link_to_import and $export->options['is_generate_import'] and self::link_template_to_import( $export, $file_path, $foundPosts );
365
- }
366
-
367
- public static function link_template_to_import( & $export, $file_path, $foundPosts )
368
- {
369
-
370
- $exportOptions = $export->options;
371
-
372
- // associate exported posts with new import
373
- if ( wp_all_export_is_compatible() )
374
- {
375
- $options = self::$templateOptions + PMXI_Plugin::get_default_import_options();
376
-
377
- $import = new PMXI_Import_Record();
378
-
379
- $import->getById($exportOptions['import_id']);
380
-
381
- if ( ! $import->isEmpty() and $import->parent_import_id == 99999 ){
382
-
383
- $xmlPath = $file_path;
384
-
385
- $root_element = '';
386
-
387
- $historyPath = $file_path;
388
-
389
- if ( 'csv' == $exportOptions['export_to'] )
390
- {
391
- $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
392
-
393
- $options['delimiter'] = $exportOptions['delimiter'];
394
-
395
- include_once( PMXI_Plugin::ROOT_DIR . '/libraries/XmlImportCsvParse.php' );
396
-
397
- $path_info = pathinfo($xmlPath);
398
-
399
- $path_parts = explode(DIRECTORY_SEPARATOR, $path_info['dirname']);
400
-
401
- $security_folder = array_pop($path_parts);
402
-
403
- $wp_uploads = wp_upload_dir();
404
-
405
- $target = $is_secure_import ? $wp_uploads['basedir'] . DIRECTORY_SEPARATOR . PMXE_Plugin::UPLOADS_DIRECTORY . DIRECTORY_SEPARATOR . $security_folder : $wp_uploads['path'];
406
-
407
- $csv = new PMXI_CsvParser( array( 'filename' => $xmlPath, 'targetDir' => $target ) );
408
-
409
- if ( ! in_array($xmlPath, $exportOptions['attachment_list']) )
410
- {
411
- $exportOptions['attachment_list'][] = $csv->xml_path;
412
- }
413
-
414
- $historyPath = $csv->xml_path;
415
-
416
- $root_element = 'node';
417
-
418
- }
419
- else
420
- {
421
- $root_element = apply_filters('wp_all_export_record_xml_tag', $exportOptions['record_xml_tag'], $export->id);
422
- }
423
-
424
- $import->set(array(
425
- 'xpath' => '/' . $root_element,
426
- 'type' => 'upload',
427
- 'options' => $options,
428
- 'root_element' => $root_element,
429
- 'path' => $xmlPath,
430
- 'name' => basename($xmlPath),
431
- 'imported' => 0,
432
- 'created' => 0,
433
- 'updated' => 0,
434
- 'skipped' => 0,
435
- 'deleted' => 0,
436
- 'iteration' => 1,
437
- 'count' => $foundPosts
438
- ))->save();
439
-
440
- $history_file = new PMXI_File_Record();
441
- $history_file->set(array(
442
- 'name' => $import->name,
443
- 'import_id' => $import->id,
444
- 'path' => $historyPath,
445
- 'registered_on' => date('Y-m-d H:i:s')
446
- ))->save();
447
-
448
- $exportOptions['import_id'] = $import->id;
449
-
450
- $export->set(array(
451
- 'options' => $exportOptions
452
- ))->save();
453
- }
454
- }
455
- }
456
-
457
- public static function prepare_import_template( $exportOptions )
458
- {
459
- $options = $exportOptions;
460
-
461
- $is_xml_template = $options['export_to'] == 'xml';
462
-
463
- $required_add_ons = array();
464
-
465
- $cf_list = array();
466
- $attr_list = array();
467
- $taxs_list = array();
468
- $acf_list = array();
469
-
470
- $implode_delimiter = ($options['delimiter'] == ',') ? '|' : ',';
471
-
472
- if ( ! empty($options['is_user_export']) ) self::$templateOptions['pmui']['import_users'] = 1;
473
-
474
- foreach ($options['ids'] as $ID => $value)
475
- {
476
- if (empty($options['cc_type'][$ID])) continue;
477
-
478
- if ($is_xml_template)
479
- {
480
- $element_name = (!empty($options['cc_name'][$ID])) ? str_replace(':', '_', preg_replace('/[^a-z0-9_:-]/i', '', $options['cc_name'][$ID])) : 'untitled_' . $ID;
481
- }
482
- else
483
- {
484
- $element_name = strtolower((!empty($options['cc_name'][$ID])) ? preg_replace('/[^a-z0-9_]/i', '', $options['cc_name'][$ID]) : 'untitled_' . $ID);
485
- }
486
-
487
- if (empty($element_name)) $element_name = 'undefined' . $ID;
488
-
489
- $element_type = $options['cc_type'][$ID];
490
-
491
- switch ($element_type)
492
- {
493
- case 'woo':
494
-
495
- if ( ! empty($options['cc_value'][$ID]) )
496
- {
497
- if (empty($required_add_ons['PMWI_Plugin']))
498
- {
499
- $required_add_ons['PMWI_Plugin'] = array(
500
- 'name' => 'WooCommerce Add-On Pro',
501
- 'paid' => true,
502
- 'url' => 'http://www.wpallimport.com/woocommerce-product-import/?utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=import-wooco-products-template'
503
- );
504
- }
505
-
506
- XmlExportWooCommerce::prepare_import_template( $options, self::$templateOptions, $cf_list, $attr_list, $element_name, $options['cc_label'][$ID] );
507
- }
508
-
509
- break;
510
-
511
- case 'acf':
512
-
513
- if (empty($required_add_ons['PMAI_Plugin']))
514
- {
515
- $required_add_ons['PMAI_Plugin'] = array(
516
- 'name' => 'ACF Add-On Pro',
517
- 'paid' => true,
518
- 'url' => 'http://www.wpallimport.com/advanced-custom-fields/?utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=import-acf-template'
519
- );
520
- }
521
-
522
- $field_options = unserialize($options['cc_options'][$ID]);
523
-
524
- // add ACF group ID to the template options
525
- if( ! in_array($field_options['group_id'], self::$templateOptions['acf'])){
526
- self::$templateOptions['acf'][$field_options['group_id']] = 1;
527
- }
528
-
529
- self::$templateOptions['fields'][$field_options['key']] = XmlExportACF::prepare_import_template( $options, self::$templateOptions, $acf_list, $element_name, $field_options);
530
-
531
- break;
532
-
533
- default:
534
-
535
- $addons = new \Wpae\App\Service\Addons\AddonService();
536
- XmlExportCpt::prepare_import_template( $options, self::$templateOptions, $cf_list, $attr_list, $taxs_list, $element_name, $ID);
537
-
538
- XmlExportMediaGallery::prepare_import_template( $options, self::$templateOptions, $element_name, $ID);
539
-
540
- if($addons->isUserAddonActive()) {
541
- XmlExportUser::prepare_import_template($options, self::$templateOptions, $element_name, $ID);
542
- }
543
-
544
- XmlExportTaxonomy::prepare_import_template( $options, self::$templateOptions, $element_name, $ID);
545
-
546
- XmlExportWooCommerceOrder::prepare_import_template( $options, self::$templateOptions, $element_name, $ID);
547
-
548
- break;
549
- }
550
- }
551
-
552
- if ( ! empty($cf_list) )
553
- {
554
- self::$templateOptions['is_update_custom_fields'] = 1;
555
- self::$templateOptions['custom_fields_list'] = $cf_list;
556
- }
557
- if ( ! empty($attr_list) )
558
- {
559
- self::$templateOptions['is_update_attributes'] = 1;
560
- self::$templateOptions['update_attributes_logic'] = 'only';
561
- self::$templateOptions['attributes_list'] = $attr_list;
562
- self::$templateOptions['attributes_only_list'] = implode(',', $attr_list);
563
- }
564
- else{
565
- self::$templateOptions['is_update_attributes'] = 0;
566
- }
567
- if ( ! empty($taxs_list) )
568
- {
569
- self::$templateOptions['is_update_categories'] = 1;
570
- self::$templateOptions['taxonomies_list'] = $taxs_list;
571
- }
572
- if ( ! empty($acf_list) )
573
- {
574
- self::$templateOptions['is_update_acf'] = 1;
575
- self::$templateOptions['acf_list'] = $acf_list;
576
- }
577
-
578
- self::$templateOptions['required_add_ons'] = $required_add_ons;
579
- }
580
- }
581
-
582
- PMXE_Wpallimport::getInstance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/classes/zip.php DELETED
@@ -1,54 +0,0 @@
1
- <?php
2
-
3
- if ( ! class_exists('PMXE_Zip')){
4
-
5
- class PMXE_Zip
6
- {
7
- /**
8
- * Add files and sub-directories in a folder to zip file.
9
- * @param string $folder
10
- * @param ZipArchive $zipFile
11
- * @param int $exclusiveLength Number of text to be exclusived from the file path.
12
- */
13
- private static function folderToZip($folder, &$zipFile, $exclusiveLength) {
14
- $handle = opendir($folder);
15
- while (false !== $f = readdir($handle)) {
16
- if ($f != '.' && $f != '..') {
17
- $filePath = "$folder/$f";
18
- // Remove prefix from file path before add to zip.
19
- $localPath = substr($filePath, $exclusiveLength);
20
- if (is_file($filePath)) {
21
- $zipFile->addFile($filePath, $localPath);
22
- } elseif (is_dir($filePath)) {
23
- // Add sub-directory.
24
- $zipFile->addEmptyDir($localPath);
25
- self::folderToZip($filePath, $zipFile, $exclusiveLength);
26
- }
27
- }
28
- }
29
- closedir($handle);
30
- }
31
-
32
- /**
33
- * Zip a folder (include itself).
34
- * Usage:
35
- * PMXE_Zip::zipDir('/path/to/sourceDir', '/path/to/out.zip');
36
- *
37
- * @param string $sourcePath Path of directory to be zip.
38
- * @param string $outZipPath Path of output zip file.
39
- */
40
- public static function zipDir($sourcePath, $outZipPath)
41
- {
42
- $pathInfo = pathInfo($sourcePath);
43
- $parentPath = $pathInfo['dirname'];
44
- $dirName = $pathInfo['basename'];
45
-
46
- $z = new ZipArchive();
47
- $z->open($outZipPath, ZIPARCHIVE::CREATE);
48
- $z->addEmptyDir($dirName);
49
- self::folderToZip($sourcePath, $z, strlen("$parentPath/"));
50
- $z->close();
51
- }
52
- }
53
-
54
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/config/options.php DELETED
@@ -1,22 +0,0 @@
1
- <?php
2
- /**
3
- * List of plugin options, contains only default values, actual values are stored in database
4
- * and can be changed by corresponding WordPress function calls
5
- */
6
- $config = array(
7
- "info_api_url" => "http://www.wpallimport.com",
8
- "dismiss" => 0,
9
- "dismiss_manage_top" => 0,
10
- "dismiss_manage_bottom" => 0,
11
- "cron_job_key" => wp_all_export_url_title(wp_all_export_rand_char(12)),
12
- "max_input_time" => -1,
13
- "max_execution_time" => 0,
14
- "secure" => 1,
15
- "license" => "",
16
- "license_status" => "",
17
- "scheduling_license" => "",
18
- "scheduling_license_status" => "",
19
- "zapier_api_key" => wp_all_export_rand_char(32),
20
- "zapier_invitation_url" => "",
21
- "zapier_invitation_url_received" => ""
22
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/controllers/admin/export.php DELETED
@@ -1,563 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Export configuration wizard
5
- *
6
- * @author Max Tsiplyakov <makstsiplyakov@gmail.com>
7
- */
8
- class PMXE_Admin_Export extends PMXE_Controller_Admin
9
- {
10
-
11
- protected $isWizard = true; // indicates whether controller is in wizard mode (otherwise it called to be delegated an edit action)
12
-
13
- protected function init()
14
- {
15
-
16
- parent::init();
17
-
18
- if ('PMXE_Admin_Manage' == PMXE_Plugin::getInstance()->getAdminCurrentScreen()->base) { // prereqisites are not checked when flow control is deligated
19
- $id = $this->input->get('id');
20
- $this->data['export'] = $export = new PMXE_Export_Record();
21
- if (!$id or $export->getById($id)->isEmpty()) { // specified import is not found
22
- wp_redirect(add_query_arg('page', 'pmxe-admin-manage', admin_url('admin.php')));
23
- die();
24
- }
25
- $this->isWizard = false;
26
- $export->fix_template_options();
27
- } else {
28
- $action = PMXE_Plugin::getInstance()->getAdminCurrentScreen()->action;
29
- $this->_step_ready($action);
30
- }
31
-
32
- // preserve id parameter as part of baseUrl
33
- $id = $this->input->get('id') and $this->baseUrl = add_query_arg('id', $id, $this->baseUrl);
34
-
35
- }
36
-
37
- public function set($var, $val)
38
- {
39
- $this->{$var} = $val;
40
- }
41
-
42
- public function get($var)
43
- {
44
- return $this->{$var};
45
- }
46
-
47
- /**
48
- * Checks whether corresponding step of wizard is complete
49
- * @param string $action
50
- * @return bool
51
- */
52
- protected function _step_ready($action)
53
- {
54
-
55
- // step #1: xml selction - has no prerequisites
56
- if ('index' == $action) return true;
57
-
58
- if ('element' == $action) return true;
59
-
60
- $this->data['update_previous'] = $update_previous = new PMXE_Export_Record();
61
-
62
- $update_previous->getById(PMXE_Plugin::$session->update_previous);
63
-
64
- if (!$update_previous->isEmpty()) {
65
- $update_previous->fix_template_options();
66
- }
67
-
68
- if ('options' == $action) return true;
69
-
70
- if (!PMXE_Plugin::$session->has_session()) {
71
- wp_redirect_or_javascript($this->baseUrl);
72
- die();
73
- }
74
-
75
- if ('process' == $action) return true;
76
-
77
- }
78
-
79
- /**
80
- * Step #1: Choose CPT
81
- */
82
- public function index()
83
- {
84
-
85
- $action = $this->input->get('action');
86
-
87
- $DefaultOptions = array(
88
- 'cpt' => '',
89
- 'export_to' => 'xml',
90
- 'export_type' => 'specific',
91
- 'wp_query' => '',
92
- 'filter_rules_hierarhy' => '',
93
- 'product_matching_mode' => 'strict',
94
- 'wp_query_selector' => 'wp_query',
95
- 'auto_generate' => 0,
96
- 'taxonomy_to_export' => '',
97
- 'created_at_version' => PMXE_VERSION
98
- );
99
-
100
- if (!in_array($action, array('index'))) {
101
- PMXE_Plugin::$session->clean_session();
102
- $this->data['preload'] = false;
103
- } else {
104
- $DefaultOptions = (PMXE_Plugin::$session->has_session() ? PMXE_Plugin::$session->get_clear_session_data() : array()) + $DefaultOptions;
105
- $this->data['preload'] = true;
106
- }
107
-
108
- $this->data['post'] = $post = $this->input->post($DefaultOptions);
109
-
110
- if (is_array($this->data['post']['cpt'])) $this->data['post']['cpt'] = $this->data['post']['cpt'][0];
111
-
112
- // Delete history
113
- if(is_dir(PMXE_ROOT_DIR.'/history')) {
114
- $history_files = PMXE_Helper::safe_glob(PMXE_ROOT_DIR . '/history/*', PMXE_Helper::GLOB_RECURSE | PMXE_Helper::GLOB_PATH);
115
- if (!empty($history_files)) {
116
- foreach ($history_files as $filePath) {
117
- @file_exists($filePath) and @unlink($filePath);
118
- }
119
- }
120
- }
121
-
122
- if (!class_exists('ZipArchive')) {
123
- $this->errors->add('form-validation', __('ZipArchive class is missing on your server.<br/>Please contact your web hosting provider and ask them to install and activate ZipArchive.', 'wp_all_export_plugin'));
124
- }
125
- if (!class_exists('XMLReader') or !class_exists('XMLWriter')) {
126
- $this->errors->add('form-validation', __('Required PHP components are missing.<br/><br/>WP All Export requires XMLReader, and XMLWriter PHP modules to be installed.<br/>These are standard features of PHP, and are necessary for WP All Export to write the files you are trying to export.<br/>Please contact your web hosting provider and ask them to install and activate the DOMDocument, XMLReader, and XMLWriter PHP modules.', 'wp_all_export_plugin'));
127
- }
128
-
129
- if ($this->input->post('is_submitted')) {
130
-
131
- PMXE_Plugin::$session->set('export_type', $post['export_type']);
132
- PMXE_Plugin::$session->set('filter_rules_hierarhy', $post['filter_rules_hierarhy']);
133
- PMXE_Plugin::$session->set('product_matching_mode', $post['product_matching_mode']);
134
- PMXE_Plugin::$session->set('wp_query_selector', $post['wp_query_selector']);
135
- PMXE_Plugin::$session->set('taxonomy_to_export', $post['taxonomy_to_export']);
136
- PMXE_Plugin::$session->set('created_at_version', $post['created_at_version']);
137
-
138
- if (!empty($post['auto_generate'])) {
139
- $auto_generate = XmlCsvExport::auto_genetate_export_fields($post, $this->errors);
140
-
141
- foreach ($auto_generate as $key => $value) {
142
- PMXE_Plugin::$session->set($key, $value);
143
- }
144
-
145
- PMXE_Plugin::$session->save_data();
146
- } else {
147
- $engine = new XmlExportEngine($post, $this->errors);
148
- $engine->init_additional_data();
149
- }
150
- }
151
-
152
- if ($this->input->post('is_submitted') and !$this->errors->get_error_codes()) {
153
-
154
- check_admin_referer('choose-cpt', '_wpnonce_choose-cpt');
155
-
156
- PMXE_Plugin::$session->save_data();
157
-
158
- if (!empty($post['auto_generate'])) {
159
- wp_redirect(add_query_arg('action', 'options', $this->baseUrl));
160
- die();
161
- } else {
162
- wp_redirect(add_query_arg('action', 'template', $this->baseUrl));
163
- die();
164
- }
165
-
166
- }
167
-
168
- $this->render();
169
- }
170
-
171
- /**
172
- * Step #2: Export Template
173
- */
174
- public function template()
175
- {
176
-
177
- $template = new PMXE_Template_Record();
178
-
179
- $default = PMXE_Plugin::get_default_import_options();
180
-
181
- $this->data['dismiss_warnings'] = 0;
182
-
183
- if ($this->isWizard) {
184
- // New export
185
- $DefaultOptions = (PMXE_Plugin::$session->has_session() ? PMXE_Plugin::$session->get_clear_session_data() : array()) + $default;
186
- $post = $this->input->post($DefaultOptions);
187
- } else {
188
- // Edit export
189
- $DefaultOptions = $this->data['export']->options + $default;
190
-
191
- if (empty($this->data['export']->options['export_variations'])) {
192
- $DefaultOptions['export_variations'] = XmlExportEngine::VARIABLE_PRODUCTS_EXPORT_PARENT_AND_VARIATION;
193
- }
194
- if (empty($this->data['export']->options['export_variations_title'])) {
195
- $DefaultOptions['export_variations_title'] = XmlExportEngine::VARIATION_USE_DEFAULT_TITLE;
196
- }
197
- $post = $this->input->post($DefaultOptions);
198
- $post['scheduled'] = $this->data['export']->scheduled;
199
-
200
- foreach ($post as $key => $value) {
201
- PMXE_Plugin::$session->set($key, $value);
202
- }
203
- $this->data['dismiss_warnings'] = get_option('wpae_dismiss_warnings_' . $this->data['export']->id, 0);
204
- }
205
-
206
- $max_input_vars = @ini_get('max_input_vars');
207
-
208
- if (ctype_digit($max_input_vars) && count($_POST, COUNT_RECURSIVE) >= $max_input_vars) {
209
- $this->errors->add('form-validation', sprintf(__('You\'ve reached your max_input_vars limit of %d. Please contact your web host to increase it.', 'wp_all_export_plugin'), $max_input_vars));
210
- }
211
-
212
- PMXE_Plugin::$session->save_data();
213
-
214
- $this->data['post'] =& $post;
215
-
216
- PMXE_Plugin::$session->set('is_loaded_template', '');
217
-
218
- $this->data['engine'] = null;
219
-
220
- XmlExportEngine::$exportQuery = PMXE_Plugin::$session->get('exportQuery');
221
-
222
- if (($load_template = $this->input->post('load_template'))) { // init form with template selected
223
- if (!$template->getById($load_template)->isEmpty()) {
224
- $template_options = $template->options;
225
- unset($template_options['cpt']);
226
- unset($template_options['wp_query']);
227
- unset($template_options['filter_rules_hierarhy']);
228
- unset($template_options['product_matching_mode']);
229
- unset($template_options['wp_query_selector']);
230
- $this->data['post'] = array_merge($post, $template_options);
231
- PMXE_Plugin::$session->set('is_loaded_template', $load_template);
232
- }
233
-
234
- } elseif ($this->input->post('is_submitted')) {
235
- check_admin_referer('template', '_wpnonce_template');
236
-
237
- if (empty($post['cc_type'][0]) && !in_array($post['xml_template_type'], array('custom', 'XmlGoogleMerchants'))) {
238
- $this->errors->add('form-validation', __('You haven\'t selected any columns for export.', 'wp_all_export_plugin'));
239
- }
240
-
241
- if ('csv' == $post['export_to'] and '' == $post['delimiter']) {
242
- $this->errors->add('form-validation', __('CSV delimiter must be specified.', 'wp_all_export_plugin'));
243
- }
244
-
245
- if ('xml' == $post['export_to'] && !in_array($post['xml_template_type'], array('custom', 'XmlGoogleMerchants'))) {
246
- $post['main_xml_tag'] = preg_replace('/[^a-z0-9_]/i', '', $post['main_xml_tag']);
247
- if (empty($post['main_xml_tag'])) {
248
- $this->errors->add('form-validation', __('Main XML Tag is required.', 'wp_all_export_plugin'));
249
- }
250
-
251
- $post['record_xml_tag'] = preg_replace('/[^a-z0-9_]/i', '', $post['record_xml_tag']);
252
- if (empty($post['record_xml_tag'])) {
253
- $this->errors->add('form-validation', __('Single Record XML Tag is required.', 'wp_all_export_plugin'));
254
- }
255
-
256
- if ($post['main_xml_tag'] == $post['record_xml_tag']) {
257
- $this->errors->add('form-validation', __('Main XML Tag equals to Single Record XML Tag.', 'wp_all_export_plugin'));
258
- }
259
- }
260
-
261
- if (($post['export_to'] == XmlExportEngine::EXPORT_TYPE_XML) && in_array($post['xml_template_type'], array('custom', 'XmlGoogleMerchants'))) {
262
-
263
- if (empty($post['custom_xml_template'])) {
264
- $this->errors->add('form-validation', __('XML template is empty.', 'wp_all_export_plugin'));
265
- }
266
-
267
- // Convert Custom XML template to default
268
- if (!empty($post['custom_xml_template'])) {
269
-
270
- $post['custom_xml_template'] = str_replace('<ID>', '<id>', $post['custom_xml_template']);
271
- $post['custom_xml_template'] = str_replace('</ID>', '</id>', $post['custom_xml_template']);
272
-
273
- $post['custom_xml_template'] = str_replace("<!-- BEGIN POST LOOP -->", "<!-- BEGIN LOOP -->", $post['custom_xml_template']);
274
- $post['custom_xml_template'] = str_replace("<!-- END POST LOOP -->", "<!-- END LOOP -->", $post['custom_xml_template']);
275
-
276
- $this->data['engine'] = new XmlExportEngine($post, $this->errors);
277
-
278
- $this->data['engine']->init_additional_data();
279
-
280
- $this->data = array_merge($this->data, $this->data['engine']->init_available_data());
281
-
282
- $result = $this->data['engine']->parse_custom_xml_template();
283
-
284
- if (!$this->errors->get_error_codes()) {
285
- $post = array_merge($post, $result);
286
- }
287
- }
288
- }
289
-
290
- if (!$this->errors->get_error_codes()) {
291
-
292
- if (!empty($post['name']) and !empty($post['save_template_as'])) { // save template in database
293
- $template->getByName($post['name'])->set(array(
294
- 'name' => $post['name'],
295
- 'options' => $post
296
- ))->save();
297
- PMXE_Plugin::$session->set('saved_template', $template->id);
298
- }
299
-
300
- if ($this->isWizard) {
301
- foreach ($this->data['post'] as $key => $value) {
302
- PMXE_Plugin::$session->set($key, $value);
303
- }
304
- PMXE_Plugin::$session->save_data();
305
- wp_redirect(add_query_arg('action', 'options', $this->baseUrl));
306
- die();
307
- } else {
308
- $this->data['export']->set(array('options' => $post, 'settings_update_on' => date('Y-m-d H:i:s')))->save();
309
-
310
- if (!empty($post['friendly_name'])) {
311
- $this->data['export']->set(array('friendly_name' => $post['friendly_name'], 'scheduled' => (($post['is_scheduled']) ? $post['scheduled_period'] : '')))->save();
312
- }
313
-
314
- wp_redirect(add_query_arg(array('page' => 'pmxe-admin-manage', 'pmxe_nt' => urlencode(__('Options updated', 'pmxi_plugin'))) + array_intersect_key($_GET, array_flip($this->baseUrlParamNames)), admin_url('admin.php')));
315
- die();
316
- }
317
- }
318
- }
319
-
320
- if (empty($this->data['engine'])) {
321
-
322
- $this->data['engine'] = new XmlExportEngine($post, $this->errors);
323
-
324
- $this->data['engine']->init_additional_data();
325
-
326
- $this->data = array_merge($this->data, $this->data['engine']->init_available_data());
327
- }
328
-
329
- $this->data['available_data_view'] = $this->data['engine']->render();
330
-
331
- $this->data['available_fields_view'] = $this->data['engine']->render_new_field();
332
-
333
- if (class_exists('SitePress')) {
334
- global $sitepress;
335
- $langs = $sitepress->get_active_languages();
336
- if (!empty($langs)) {
337
- // prepare active languages list
338
- $language_list = array('all' => 'All');
339
- foreach ($langs as $code => $langInfo) {
340
- $language_list[$code] = "<img width='18' height='12' src='" . $sitepress->get_flag_url($code) . "' style='position:relative; top: 2px;'/> " . $langInfo['display_name'];
341
- if(isset($this->default_language)){
342
- if ($code == $this->default_language) $language_list[$code] .= ' ( <strong>default</strong> )';
343
- }
344
-
345
- }
346
- }
347
- $this->data['wpml_options'] = $language_list;
348
- }
349
-
350
- $this->render();
351
- }
352
-
353
- /**
354
- * Step #3: Export Options
355
- */
356
- public function options()
357
- {
358
- $default = PMXE_Plugin::get_default_import_options();
359
-
360
- if ($this->isWizard) {
361
-
362
- $DefaultOptions = (PMXE_Plugin::$session->has_session() ? PMXE_Plugin::$session->get_clear_session_data() : array()) + $default;
363
- $post = $this->input->post($DefaultOptions);
364
-
365
- if(isset($post['update_previous'])) {
366
- $exportId = $post['update_previous'];
367
- } else {
368
- $exportId = false;
369
- }
370
-
371
- if(!$exportId) {
372
- $export = $this->data['update_previous'];
373
- $export->set(
374
- array(
375
- 'triggered' => 0,
376
- 'processing' => 0,
377
- 'exported' => 0,
378
- 'executing' => 0,
379
- 'canceled' => 0,
380
- 'options' => $post,
381
- 'friendly_name' => $this->getFriendlyName($post),
382
- 'last_activity' => date('Y-m-d H:i:s')
383
- )
384
- )->save();
385
-
386
- PMXE_Plugin::$session->set('update_previous', $export->id);
387
- PMXE_Plugin::$session->set('friendly_name', $this->getFriendlyName($post));
388
- PMXE_Plugin::$session->save_data();
389
- $exportId = $export->id;
390
- }
391
- $this->data['export_id'] = $exportId;
392
- $this->data['export'] = new PMXE_Export_Record();
393
- $this->data['export'] = $this->data['export']->getBy('id', $exportId);
394
-
395
- if(empty($post['friendly_name'])) {
396
- $post['friendly_name'] = $this->getFriendlyName($post);
397
- }
398
- }
399
- else {
400
- $DefaultOptions = $this->data['export']->options + $default;
401
- if (empty($this->data['export']->options['export_variations'])) {
402
- $DefaultOptions['export_variations'] = XmlExportEngine::VARIABLE_PRODUCTS_EXPORT_PARENT_AND_VARIATION;
403
- }
404
- if (empty($this->data['export']->options['export_variations_title'])) {
405
- $DefaultOptions['export_variations_title'] = XmlExportEngine::VARIATION_USE_DEFAULT_TITLE;
406
- }
407
- $post = $this->input->post($DefaultOptions);
408
- $post['scheduled'] = $this->data['export']->scheduled;
409
-
410
- foreach ($post as $key => $value) {
411
- PMXE_Plugin::$session->set($key, $value);
412
- }
413
- PMXE_Plugin::$session->save_data();
414
- $this->data['export_id'] = $this->data['export']->id;
415
- }
416
-
417
- $this->data['engine'] = new XmlExportEngine($post, $this->errors);
418
-
419
- $this->data['engine']->init_available_data();
420
-
421
- $this->data['post'] =& $post;
422
-
423
- if ($this->input->post('is_submitted')) {
424
-
425
- check_admin_referer('options', '_wpnonce_options');
426
-
427
- if ($post['is_generate_templates'] and '' == $post['template_name']) {
428
- $friendly_name = $this->getFriendlyName($post);
429
- $post['template_name'] = $friendly_name;
430
- }
431
-
432
- if ($this->isWizard) {
433
- if (!$this->errors->get_error_codes()) {
434
- foreach ($this->data['post'] as $key => $value) {
435
- PMXE_Plugin::$session->set($key, $value);
436
- }
437
- PMXE_Plugin::$session->save_data();
438
- wp_redirect(add_query_arg('action', 'process', $this->baseUrl));
439
- die();
440
- }
441
- } else {
442
- $this->errors->remove('count-validation');
443
- if (!$this->errors->get_error_codes()) {
444
- $this->data['export']->set(array('options' => $post, 'settings_update_on' => date('Y-m-d H:i:s')))->save();
445
- if (!empty($post['friendly_name'])) {
446
- $this->data['export']->set(array('friendly_name' => $post['friendly_name'], 'scheduled' => (($post['is_scheduled']) ? $post['scheduled_period'] : '')))->save();
447
- }
448
- wp_redirect(add_query_arg(array('page' => 'pmxe-admin-manage', 'pmxe_nt' => urlencode(__('Options updated', 'wp_all_export_plugin'))) + array_intersect_key($_GET, array_flip($this->baseUrlParamNames)), admin_url('admin.php')));
449
- die();
450
- }
451
- }
452
- }
453
-
454
- $this->render();
455
- }
456
-
457
- /**
458
- * Step #4: Export Processing
459
- */
460
- public function process()
461
- {
462
- @set_time_limit(0);
463
-
464
- $export = $this->data['update_previous'];
465
-
466
- if (!PMXE_Plugin::is_ajax()) {
467
-
468
- if ("" == PMXE_Plugin::$session->friendly_name) {
469
-
470
- $post_types = PMXE_Plugin::$session->get('cpt');
471
- if (!empty($post_types)) {
472
- if (in_array('users', $post_types)) {
473
- $friendly_name = 'Users Export - ' . date("Y F d H:i");
474
- } elseif (in_array('shop_customer', $post_types)) {
475
- $friendly_name = 'Customers Export - ' . date("Y F d H:i");
476
- } elseif (in_array('comments', $post_types)) {
477
- $friendly_name = 'Comments Export - ' . date("Y F d H:i");
478
- } elseif (in_array('taxonomies', $post_types)) {
479
- $tx = get_taxonomy(PMXE_Plugin::$session->get('taxonomy_to_export'));
480
- if (!empty($tx->labels->name)) {
481
- $friendly_name = $tx->labels->name . ' Export - ' . date("Y F d H:i");
482
- } else {
483
- $friendly_name = 'Taxonomy Terms Export - ' . date("Y F d H:i");
484
- }
485
- } else {
486
- $post_type_details = get_post_type_object(array_shift($post_types));
487
- $friendly_name = $post_type_details->labels->name . ' Export - ' . date("Y F d H:i");
488
- }
489
- } else {
490
- $friendly_name = 'WP_Query Export - ' . date("Y F d H:i");
491
- }
492
-
493
- PMXE_Plugin::$session->set('friendly_name', $friendly_name);
494
- }
495
-
496
- PMXE_Plugin::$session->set('file', '');
497
- PMXE_Plugin::$session->save_data();
498
-
499
- $export->set(
500
- array(
501
- 'triggered' => 0,
502
- 'processing' => 0,
503
- 'exported' => 0,
504
- 'executing' => 1,
505
- 'canceled' => 0,
506
- 'options' => PMXE_Plugin::$session->get_clear_session_data(),
507
- 'friendly_name' => PMXE_Plugin::$session->friendly_name,
508
- 'scheduled' => (PMXE_Plugin::$session->is_scheduled) ? PMXE_Plugin::$session->scheduled_period : '',
509
- //'registered_on' => date('Y-m-d H:i:s'),
510
- 'last_activity' => date('Y-m-d H:i:s')
511
- )
512
- )->save();
513
-
514
- // create an import for this export
515
- if ($export->options['export_to'] == 'csv' || !in_array($export->options['xml_template_type'], array('custom', 'XmlGoogleMerchants'))) PMXE_Wpallimport::create_an_import($export);
516
- PMXE_Plugin::$session->set('update_previous', $export->id);
517
- PMXE_Plugin::$session->save_data();
518
-
519
- do_action('pmxe_before_export', $export->id);
520
-
521
- }
522
-
523
- $this->render();
524
- }
525
-
526
- /**
527
- * @param $post
528
- * @return string
529
- */
530
- protected function getFriendlyName($post)
531
- {
532
- $friendly_name = '';
533
- $post_types = PMXE_Plugin::$session->get('cpt');
534
- if (!empty($post_types)) {
535
- if (in_array('users', $post_types)) {
536
- $friendly_name = 'Users Export - ' . date("Y F d H:i");
537
- return $friendly_name;
538
- } elseif (in_array('shop_customer', $post_types)) {
539
- $friendly_name = 'Customers Export - ' . date("Y F d H:i");
540
- return $friendly_name;
541
- } elseif (in_array('comments', $post_types)) {
542
- $friendly_name = 'Comments Export - ' . date("Y F d H:i");
543
- return $friendly_name;
544
- } elseif (in_array('taxonomies', $post_types)) {
545
- $tx = get_taxonomy($post['taxonomy_to_export']);
546
- if (!empty($tx->labels->name)) {
547
- $friendly_name = $tx->labels->name . ' Export - ' . date("Y F d H:i");
548
- return $friendly_name;
549
- } else {
550
- $friendly_name = 'Taxonomy Terms Export - ' . date("Y F d H:i");
551
- return $friendly_name;
552
- }
553
- } else {
554
- $post_type_details = get_post_type_object(array_shift($post_types));
555
- $friendly_name = $post_type_details->labels->name . ' Export - ' . date("Y F d H:i");
556
- return $friendly_name;
557
- }
558
- } else {
559
- $friendly_name = 'WP_Query Export - ' . date("Y F d H:i");
560
- return $friendly_name;
561
- }
562
- }
563
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/controllers/admin/feedback.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- /**
3
- * Admin Help page
4
- *
5
- * @author Pavel Kulbakin <p.kulbakin@gmail.com>
6
- */
7
- class PMXE_Admin_Feedback extends PMXE_Controller_Admin {
8
-
9
- public function index() {
10
- $this->render();
11
- }
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
trunk/controllers/admin/help.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- /**
3
- * Admin Help page
4
- *
5
- * @author Pavel Kulbakin <p.kulbakin@gmail.com>
6
- */
7
- class PMXE_Admin_Help extends PMXE_Controller_Admin {
8
-
9
- public function index() {
10
- $this->render();
11
- }
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
trunk/controllers/admin/manage.php DELETED
@@ -1,526 +0,0 @@
1
- <?php
2
- /**
3
- * Manage Imports
4
- *
5
- * @author Pavel Kulbakin <p.kulbakin@gmail.com>
6
- */
7
- class PMXE_Admin_Manage extends PMXE_Controller_Admin {
8
-
9
- public function init() {
10
- parent::init();
11
-
12
- if ('update' == PMXE_Plugin::getInstance()->getAdminCurrentScreen()->action) {
13
- $this->isInline = true;
14
- }
15
- }
16
-
17
- /**
18
- * Previous Imports list
19
- */
20
- public function index() {
21
-
22
- $get = $this->input->get(array(
23
- 's' => '',
24
- 'order_by' => 'id',
25
- 'order' => 'DESC',
26
- 'pagenum' => 1,
27
- 'perPage' => 25,
28
- ));
29
- $get['pagenum'] = absint($get['pagenum']);
30
- extract($get);
31
- $this->data += $get;
32
-
33
- if ( ! in_array($order_by, array('registered_on', 'id', 'friendly_name'))){
34
- $order_by = 'registered_on';
35
- }
36
-
37
- if ( ! in_array($order, array('DESC', 'ASC'))){
38
- $order = 'DESC';
39
- }
40
-
41
- $list = new PMXE_Export_List();
42
- $by = array('parent_id' => 0);
43
- if ('' != $s) {
44
- $like = '%' . preg_replace('%\s+%', '%', preg_replace('/[%?]/', '\\\\$0', $s)) . '%';
45
- $by[] = array(array('friendly_name LIKE' => $like, 'registered_on LIKE' => $like), 'OR');
46
- }
47
-
48
- $this->data['list'] = $list->setColumns(
49
- $list->getTable() . '.*'
50
- )->getBy($by, "$order_by $order", $pagenum, $perPage, $list->getTable() . '.id');
51
-
52
- $this->data['page_links'] = paginate_links(array(
53
- 'base' => add_query_arg('pagenum', '%#%', $this->baseUrl),
54
- 'add_args' => array('page' => 'pmxe-admin-manage'),
55
- 'format' => '',
56
- 'prev_text' => __('&laquo;', 'PMXE_plugin'),
57
- 'next_text' => __('&raquo;', 'PMXE_plugin'),
58
- 'total' => ceil($list->total() / $perPage),
59
- 'current' => $pagenum,
60
- ));
61
-
62
- PMXE_Plugin::$session->clean_session();
63
-
64
- $this->render();
65
- }
66
-
67
- /**
68
- * Edit Options
69
- */
70
- public function options() {
71
-
72
- // deligate operation to other controller
73
- $controller = new PMXE_Admin_Export();
74
- $controller->set('isTemplateEdit', true);
75
- $controller->options();
76
- }
77
-
78
- /**
79
- * Edit Template
80
- */
81
- public function template() {
82
-
83
- // deligate operation to other controller
84
- $controller = new PMXE_Admin_Export();
85
- $controller->set('isTemplateEdit', true);
86
- $controller->template();
87
- }
88
-
89
- /**
90
- * Cron Scheduling
91
- */
92
- public function scheduling() {
93
- $this->data['id'] = $id = $this->input->get('id');
94
- $this->data['cron_job_key'] = PMXE_Plugin::getInstance()->getOption('cron_job_key');
95
- $this->data['item'] = $item = new PMXE_Export_Record();
96
- if ( ! $id or $item->getById($id)->isEmpty()) {
97
- wp_redirect($this->baseUrl); die();
98
- }
99
-
100
- $wp_uploads = wp_upload_dir();
101
-
102
- $this->data['file_path'] = site_url() . '/wp-cron.php?security_token=' . substr(md5($this->data['cron_job_key'] . $item['id']), 0, 16) . '&export_id=' . $item['id'] . '&action=get_data';
103
-
104
- $this->data['bundle_url'] = '';
105
-
106
- if ( ! empty($item['options']['bundlepath']) )
107
- {
108
- $this->data['bundle_url'] = site_url() . '/wp-cron.php?security_token=' . substr(md5($this->data['cron_job_key'] . $item['id']), 0, 16) . '&export_id=' . $item['id'] . '&action=get_bundle&t=zip';
109
- }
110
-
111
- $this->render();
112
- }
113
-
114
- /**
115
- * Google merchants info
116
- */
117
- public function google_merchants_info() {
118
-
119
- $this->data['id'] = $id = $this->input->get('id');
120
- $this->data['cron_job_key'] = PMXE_Plugin::getInstance()->getOption('cron_job_key');
121
- $this->data['item'] = $item = new PMXE_Export_Record();
122
- if ( ! $id or $item->getById($id)->isEmpty()) {
123
- wp_redirect($this->baseUrl); die();
124
- }
125
-
126
- $this->data['file_path'] = site_url() . '/wp-cron.php?security_token=' . substr(md5($this->data['cron_job_key'] . $item['id']), 0, 16) . '&export_id=' . $item['id'] . '&action=get_data';
127
-
128
- $this->render();
129
- }
130
-
131
- /**
132
- * Download import templates
133
- */
134
- public function templates() {
135
- $this->data['id'] = $id = $this->input->get('id');
136
- $this->data['item'] = $item = new PMXE_Export_Record();
137
- if ( ! $id or $item->getById($id)->isEmpty()) {
138
- wp_redirect($this->baseUrl); die();
139
- }
140
-
141
- $this->render();
142
- }
143
-
144
- /**
145
- * Cancel import processing
146
- */
147
- public function cancel(){
148
-
149
- $id = $this->input->get('id');
150
-
151
- PMXE_Plugin::$session->clean_session( $id );
152
-
153
- $item = new PMXE_Export_Record();
154
- if ( ! $id or $item->getById($id)->isEmpty()) {
155
- wp_redirect($this->baseUrl); die();
156
- }
157
- $item->set(array(
158
- 'triggered' => 0,
159
- 'processing' => 0,
160
- 'executing' => 0,
161
- 'canceled' => 1,
162
- 'canceled_on' => date('Y-m-d H:i:s')
163
- ))->update();
164
-
165
- wp_redirect(add_query_arg('pmxe_nt', urlencode(__('Export canceled', 'wp_all_import_plugin')), $this->baseUrl)); die();
166
- }
167
-
168
- /**
169
- * Reexport
170
- */
171
- public function update() {
172
-
173
- $id = $this->input->get('id');
174
-
175
- PMXE_Plugin::$session->clean_session($id);
176
-
177
- $action_type = $this->input->get('type');
178
-
179
- $this->data['item'] = $item = new PMXE_Export_Record();
180
- if ( ! $id or $item->getById($id)->isEmpty()) {
181
- wp_redirect($this->baseUrl); die();
182
- }
183
-
184
- $item->fix_template_options();
185
-
186
- $default = PMXE_Plugin::get_default_import_options();
187
- $DefaultOptions = $item->options + $default;
188
- if (empty($item->options['export_variations'])){
189
- $DefaultOptions['export_variations'] = XmlExportEngine::VARIABLE_PRODUCTS_EXPORT_PARENT_AND_VARIATION;
190
- }
191
- if (empty($item->options['export_variations_title'])){
192
- $DefaultOptions['export_variations_title'] = XmlExportEngine::VARIATION_USE_DEFAULT_TITLE;
193
- }
194
- $this->data['post'] = $post = $this->input->post($DefaultOptions);
195
- $this->data['iteration'] = $item->iteration;
196
-
197
- if ($this->input->post('is_confirmed')) {
198
-
199
- check_admin_referer('update-export', '_wpnonce_update-export');
200
-
201
- $iteration = ( empty($item->options['creata_a_new_export_file']) && ! empty($post['creata_a_new_export_file'])) ? 0 : $item->iteration;
202
-
203
- $item->set(array( 'options' => $post, 'iteration' => $iteration))->save();
204
- if ( ! empty($post['friendly_name']) ) {
205
- $item->set( array( 'friendly_name' => $post['friendly_name'], 'scheduled' => (($post['is_scheduled']) ? $post['scheduled_period'] : '') ) )->save();
206
- }
207
-
208
- // compose data to look like result of wizard steps
209
- $sesson_data = $post + array('update_previous' => $item->id ) + $default;
210
-
211
- foreach ($sesson_data as $key => $value) {
212
- PMXE_Plugin::$session->set($key, $value);
213
- }
214
-
215
- $this->data['engine'] = new XmlExportEngine($sesson_data, $this->errors);
216
- $this->data['engine']->init_additional_data();
217
- $this->data['engine']->init_available_data();
218
-
219
- PMXE_Plugin::$session->save_data();
220
-
221
- if ( ! $this->errors->get_error_codes() && $this->input->post('record-count')) {
222
-
223
- // deligate operation to other controller
224
- $controller = new PMXE_Admin_Export();
225
- $controller->data['update_previous'] = $item;
226
- $controller->process();
227
- return;
228
-
229
- }
230
-
231
- $this->errors->remove('count-validation');
232
- if ( ! $this->errors->get_error_codes()) {
233
- wp_redirect(add_query_arg('pmxe_nt', urlencode(__('Options updated', 'wp_all_export_plugin')), $this->baseUrl));
234
- die();
235
- }
236
-
237
- }
238
-
239
- $this->data['isWizard'] = false;
240
- $this->data['engine'] = new XmlExportEngine($post, $this->errors);
241
- $this->data['engine']->init_available_data();
242
-
243
- $this->render();
244
- }
245
-
246
- /**
247
- * Delete an export
248
- */
249
- public function delete() {
250
- $id = $this->input->get('id');
251
- $this->data['item'] = $item = new PMXE_Export_Record();
252
- if ( ! $id or $item->getById($id)->isEmpty()) {
253
- wp_redirect($this->baseUrl); die();
254
- }
255
-
256
- if ($this->input->post('is_confirmed')) {
257
- check_admin_referer('delete-export', '_wpnonce_delete-export');
258
- $item->delete();
259
-
260
- $scheduling = \Wpae\Scheduling\Scheduling::create();
261
- $scheduling->deleteScheduleIfExists($id);
262
-
263
- wp_redirect(add_query_arg('pmxe_nt', urlencode(__('Export deleted', 'wp_all_export_plugin')), $this->baseUrl)); die();
264
- }
265
-
266
- $this->render();
267
- }
268
-
269
- /**
270
- * Bulk actions
271
- */
272
- public function bulk() {
273
- check_admin_referer('bulk-exports', '_wpnonce_bulk-exports');
274
- if ($this->input->post('doaction2')) {
275
- $this->data['action'] = $action = $this->input->post('bulk-action2');
276
- } else {
277
- $this->data['action'] = $action = $this->input->post('bulk-action');
278
- }
279
- $this->data['ids'] = $ids = $this->input->post('items');
280
- $this->data['items'] = $items = new PMXE_Export_List();
281
- if (empty($action) or ! in_array($action, array('delete')) or empty($ids) or $items->getBy('id', $ids)->isEmpty()) {
282
- wp_redirect($this->baseUrl); die();
283
- }
284
- if ($this->input->post('is_confirmed')) {
285
- foreach($items->convertRecords() as $item) {
286
-
287
- if ($item->attch_id) wp_delete_attachment($item->attch_id, true);
288
-
289
- $item->delete();
290
-
291
- $scheduling = \Wpae\Scheduling\Scheduling::create();
292
- $scheduling->deleteScheduleIfExists($item->id);
293
- }
294
- wp_redirect(add_query_arg('pmxe_nt', urlencode(sprintf(__('%d %s deleted', 'wp_all_export_plugin'), $items->count(), _n('export', 'exports', $items->count(), 'wp_all_export_plugin'))), $this->baseUrl)); die();
295
- }
296
- $this->render();
297
- }
298
-
299
- public function get_template(){
300
- $nonce = (!empty($_REQUEST['_wpnonce'])) ? $_REQUEST['_wpnonce'] : '';
301
- if ( ! wp_verify_nonce( $nonce, '_wpnonce-download_template' ) ) {
302
- die( __('Security check', 'wp_all_export_plugin') );
303
- } else {
304
-
305
- $id = $this->input->get('id');
306
-
307
- $export = new PMXE_Export_Record();
308
-
309
- $filepath = '';
310
-
311
- $export_data = array();
312
-
313
- if ( ! $export->getById($id)->isEmpty()){
314
-
315
- $export_data[] = $export->options['tpl_data'];
316
- $uploads = wp_upload_dir();
317
- $targetDir = $uploads['basedir'] . DIRECTORY_SEPARATOR . PMXE_Plugin::TEMP_DIRECTORY;
318
-
319
- $export_file_name = "WP All Import Template - " . sanitize_file_name($export->friendly_name) . ".txt";
320
-
321
- file_put_contents($targetDir . DIRECTORY_SEPARATOR . $export_file_name, json_encode($export_data));
322
-
323
- PMXE_download::csv($targetDir . DIRECTORY_SEPARATOR . $export_file_name);
324
-
325
- }
326
- }
327
- }
328
-
329
- /*
330
- * Download bundle for WP All Import
331
- *
332
- */
333
- public function bundle()
334
- {
335
- $nonce = (!empty($_REQUEST['_wpnonce'])) ? $_REQUEST['_wpnonce'] : '';
336
- if ( ! wp_verify_nonce( $nonce, '_wpnonce-download_bundle' ) ) {
337
- die( __('Security check', 'wp_all_export_plugin') );
338
- } else {
339
-
340
- $uploads = wp_upload_dir();
341
-
342
- $id = $this->input->get('id');
343
-
344
- $export = new PMXE_Export_Record();
345
-
346
- if ( ! $export->getById($id)->isEmpty())
347
- {
348
- if ( ! empty($export->options['bundlepath']) )
349
- {
350
- $bundle_path = wp_all_export_get_absolute_path($export->options['bundlepath']);
351
-
352
- if ( @file_exists($bundle_path) )
353
- {
354
- $bundle_url = $uploads['baseurl'] . str_replace($uploads['basedir'], '', $bundle_path);
355
-
356
- PMXE_download::zip($bundle_path);
357
- }
358
- }
359
- else
360
- {
361
- wp_redirect(add_query_arg('pmxe_nt', urlencode(__('The exported bundle is missing and can\'t be downloaded. Please re-run your export to re-generate it.', 'wp_all_export_plugin')), $this->baseUrl)); die();
362
- }
363
- }
364
- else
365
- {
366
- wp_redirect(add_query_arg('pmxe_nt', urlencode(__('This export doesn\'t exist.', 'wp_all_export_plugin')), $this->baseUrl)); die();
367
- }
368
- }
369
- }
370
-
371
- public function split_bundle(){
372
- $nonce = (!empty($_REQUEST['_wpnonce'])) ? $_REQUEST['_wpnonce'] : '';
373
- if ( ! wp_verify_nonce( $nonce, '_wpnonce-download_split_bundle' ) ) {
374
- die( __('Security check', 'wp_all_export_plugin') );
375
- } else {
376
-
377
- $uploads = wp_upload_dir();
378
-
379
- $id = PMXE_Plugin::$session->update_previous;
380
-
381
- if (empty($id))
382
- $id = $this->input->get('id');
383
-
384
- $export = new PMXE_Export_Record();
385
-
386
- if ( ! $export->getById($id)->isEmpty())
387
- {
388
- if ( ! empty($export->options['split_files_list']))
389
- {
390
- $tmp_dir = $uploads['basedir'] . DIRECTORY_SEPARATOR . PMXE_Plugin::TEMP_DIRECTORY . DIRECTORY_SEPARATOR . md5($export->id) . DIRECTORY_SEPARATOR;
391
- $bundle_dir = $tmp_dir . 'split_files' . DIRECTORY_SEPARATOR;
392
-
393
- wp_all_export_rrmdir($tmp_dir);
394
-
395
- @mkdir($tmp_dir);
396
- @mkdir($bundle_dir);
397
-
398
- foreach ($export->options['split_files_list'] as $file) {
399
- @copy( $file, $bundle_dir . basename($file) );
400
- }
401
-
402
- $friendly_name = sanitize_file_name($export->friendly_name);
403
-
404
- $bundle_path = $tmp_dir . $friendly_name . '-split-files.zip';
405
-
406
- PMXE_Zip::zipDir($bundle_dir, $bundle_path);
407
-
408
- if (file_exists($bundle_path))
409
- {
410
- $bundle_url = $uploads['baseurl'] . str_replace($uploads['basedir'], '', $bundle_path);
411
-
412
- PMXE_download::zip($bundle_path);
413
- }
414
- }
415
- }
416
- }
417
- }
418
-
419
- /*
420
- * Download import log file
421
- *
422
- */
423
- public function get_file(){
424
-
425
- $nonce = (!empty($_REQUEST['_wpnonce'])) ? $_REQUEST['_wpnonce'] : '';
426
- if ( ! wp_verify_nonce( $nonce, '_wpnonce-download_feed' ) ) {
427
- die( __('Security check', 'wp_all_export_plugin') );
428
- } else {
429
-
430
- $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
431
-
432
- $id = $this->input->get('id');
433
-
434
- $export = new PMXE_Export_Record();
435
-
436
- $filepath = '';
437
-
438
- if ( ! $export->getById($id)->isEmpty())
439
- {
440
- if ( ! $is_secure_import)
441
- {
442
- $filepath = get_attached_file($export->attch_id);
443
- }
444
- else
445
- {
446
- $filepath = wp_all_export_get_absolute_path($export->options['filepath']);
447
- }
448
-
449
- if ( @file_exists($filepath) )
450
- {
451
- switch ($export->options['export_to'])
452
- {
453
- case 'xml':
454
- if($export['options']['xml_template_type'] == XmlExportEngine::EXPORT_TYPE_GOOLE_MERCHANTS) {
455
- PMXE_Download::txt($filepath);
456
- } else {
457
- PMXE_download::xml($filepath);
458
- }
459
-
460
- break;
461
- case 'csv':
462
- if (empty($export->options['export_to_sheet']) or $export->options['export_to_sheet'] == 'csv')
463
- {
464
- PMXE_download::csv($filepath);
465
- }
466
- else
467
- {
468
- PMXE_download::xls($filepath);
469
- }
470
- break;
471
- default:
472
- wp_redirect(add_query_arg('pmxe_nt', urlencode(__('File format not supported', 'wp_all_export_plugin')), $this->baseUrl)); die();
473
- break;
474
- }
475
- }
476
- else
477
- {
478
- wp_redirect(add_query_arg('pmxe_nt', urlencode(__('The exported file is missing and can\'t be downloaded. Please re-run your export to re-generate it.', 'wp_all_export_plugin')), $this->baseUrl)); die();
479
- }
480
- }
481
- else
482
- {
483
- wp_redirect(add_query_arg('pmxe_nt', urlencode(__('The exported file is missing and can\'t be downloaded. Please re-run your export to re-generate it.', 'wp_all_export_plugin')), $this->baseUrl)); die();
484
- }
485
- }
486
- }
487
-
488
- /**
489
- * @param $post
490
- * @return string
491
- */
492
- protected function getFriendlyName($post)
493
- {
494
- $friendly_name = '';
495
- $post_types = PMXE_Plugin::$session->get('cpt');
496
- if (!empty($post_types)) {
497
- if (in_array('users', $post_types)) {
498
- $friendly_name = 'Users Export - ' . date("Y F d H:i");
499
- return $friendly_name;
500
- } elseif (in_array('shop_customer', $post_types)) {
501
- $friendly_name = 'Customers Export - ' . date("Y F d H:i");
502
- return $friendly_name;
503
- } elseif (in_array('comments', $post_types)) {
504
- $friendly_name = 'Comments Export - ' . date("Y F d H:i");
505
- return $friendly_name;
506
- } elseif (in_array('taxonomies', $post_types)) {
507
- $tx = get_taxonomy($post['taxonomy_to_export']);
508
- if (!empty($tx->labels->name)) {
509
- $friendly_name = $tx->labels->name . ' Export - ' . date("Y F d H:i");
510
- return $friendly_name;
511
- } else {
512
- $friendly_name = 'Taxonomy Terms Export - ' . date("Y F d H:i");
513
- return $friendly_name;
514
- }
515
- } else {
516
- $post_type_details = get_post_type_object(array_shift($post_types));
517
- $friendly_name = $post_type_details->labels->name . ' Export - ' . date("Y F d H:i");
518
- return $friendly_name;
519
- }
520
- } else {
521
- $friendly_name = 'WP_Query Export - ' . date("Y F d H:i");
522
- return $friendly_name;
523
- }
524
- }
525
-
526
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/controllers/admin/settings.php DELETED
@@ -1,178 +0,0 @@
1
- <?php
2
- /**
3
- * Admin Statistics page
4
- *
5
- * @author Pavel Kulbakin <p.kulbakin@gmail.com>
6
- */
7
- class PMXE_Admin_Settings extends PMXE_Controller_Admin {
8
-
9
- /** @var \Wpae\App\Service\License\LicenseActivator */
10
- private $licenseActivator;
11
-
12
- protected function init()
13
- {
14
- $this->licenseActivator = new \Wpae\App\Service\License\LicenseActivator();
15
- }
16
-
17
- public function index() {
18
-
19
- $this->data['post'] = $post = $this->input->post(PMXE_Plugin::getInstance()->getOption());
20
-
21
- if ($this->input->post('is_settings_submitted')) { // save settings form
22
-
23
- check_admin_referer('edit-settings', '_wpnonce_edit-settings');
24
-
25
- if ( ! $this->errors->get_error_codes()) { // no validation errors detected
26
-
27
- PMXE_Plugin::getInstance()->updateOption($post);
28
-
29
- wp_redirect(add_query_arg('pmxe_nt', urlencode(__('Settings saved', 'wp_all_export_plugin')), $this->baseUrl)); die();
30
- }
31
- }
32
-
33
- if ($this->input->post('is_scheduling_license_submitted')) {
34
-
35
- check_admin_referer('edit-license', '_wpnonce_edit-scheduling-license');
36
-
37
- if (!$this->errors->get_error_codes()) { // no validation errors detected
38
-
39
- PMXE_Plugin::getInstance()->updateOption($post);
40
- if (empty($_POST['pmxe_scheduling_license_activate']) and empty($_POST['pmxe_scheduling_license_deactivate'])) {
41
- $post['scheduling_license_status'] = $this->check_scheduling_license();
42
- if ($post['scheduling_license_status'] == 'valid') {
43
-
44
- $this->data['scheduling_license_message'] = __('License activated.', 'wp_all_import_plugin');
45
- }
46
-
47
- PMXE_Plugin::getInstance()->updateOption($post);
48
- $this->activate_scheduling_licenses();
49
-
50
- }
51
- }
52
-
53
- $this->data['post'] = $post = PMXE_Plugin::getInstance()->getOption();
54
- }
55
-
56
-
57
- $post['scheduling_license_status'] = $this->check_scheduling_license();
58
- $this->data['is_license_active'] = false;
59
- if (!empty($post['license_status']) && $post['license_status'] == 'valid') {
60
- $this->data['is_license_active'] = true;
61
- }
62
-
63
- $this->data['is_scheduling_license_active'] = false;
64
- if (!empty($post['scheduling_license_status']) && $post['scheduling_license_status'] == 'valid') {
65
- $this->data['is_scheduling_license_active'] = true;
66
- }
67
-
68
- if ($this->input->post('is_templates_submitted')) { // delete templates form
69
-
70
- check_admin_referer('delete-templates', '_wpnonce_delete-templates');
71
-
72
- if ($this->input->post('import_templates')){
73
-
74
- if (!empty($_FILES)){
75
- $file_name = $_FILES['template_file']['name'];
76
- $file_size = $_FILES['template_file']['size'];
77
- $tmp_name = $_FILES['template_file']['tmp_name'];
78
-
79
- if(isset($file_name))
80
- {
81
- $filename = stripslashes($file_name);
82
- $extension = strtolower(pmxe_getExtension($filename));
83
-
84
- if (($extension != "txt"))
85
- {
86
- $this->errors->add('form-validation', __('Unknown File extension. Only txt files are permitted', 'wp_all_export_plugin'));
87
- }
88
- else {
89
- $import_data = @file_get_contents($tmp_name);
90
- if (!empty($import_data)){
91
- $templates_data = json_decode($import_data, true);
92
-
93
- if (!empty($templates_data)){
94
- $templateOptions = empty($templates_data[0]['options']) ? false : unserialize($templates_data[0]['options']);
95
- if ( empty($templateOptions) ){
96
- $this->errors->add('form-validation', __('The template is invalid. Options are missing.', 'wp_all_export_plugin'));
97
- }
98
- else{
99
- if (!isset($templateOptions['is_user_export'])){
100
- $this->errors->add('form-validation', __('The template you\'ve uploaded is intended to be used with WP All Import plugin.', 'wp_all_export_plugin'));
101
- }
102
- else{
103
- $template = new PMXE_Template_Record();
104
- foreach ($templates_data as $template_data) {
105
- unset($template_data['id']);
106
- $template->clear()->set($template_data)->insert();
107
- }
108
- wp_redirect(add_query_arg('pmxe_nt', urlencode(sprintf(_n('%d template imported', '%d templates imported', count($templates_data), 'wp_all_export_plugin'), count($templates_data))), $this->baseUrl));
109
- die();
110
- }
111
- }
112
- }
113
- else $this->errors->add('form-validation', __('Wrong imported data format', 'wp_all_export_plugin'));
114
- }
115
- else $this->errors->add('form-validation', __('File is empty or doesn\'t exests', 'wp_all_export_plugin'));
116
- }
117
- }
118
- else $this->errors->add('form-validation', __('Undefined entry!', 'wp_all_export_plugin'));
119
- }
120
- else $this->errors->add('form-validation', __('Please select file.', 'wp_all_export_plugin'));
121
-
122
- }
123
- else{
124
- $templates_ids = $this->input->post('templates', array());
125
- if (empty($templates_ids)) {
126
- $this->errors->add('form-validation', __('Templates must be selected', 'wp_all_export_plugin'));
127
- }
128
-
129
- if ( ! $this->errors->get_error_codes()) { // no validation errors detected
130
- if ($this->input->post('delete_templates')){
131
- $template = new PMXE_Template_Record();
132
- foreach ($templates_ids as $template_id) {
133
- $template->clear()->set('id', $template_id)->delete();
134
- }
135
- wp_redirect(add_query_arg('pmxe_nt', urlencode(sprintf(_n('%d template deleted', '%d templates deleted', count($templates_ids), 'wp_all_export_plugin'), count($templates_ids))), $this->baseUrl)); die();
136
- }
137
- if ($this->input->post('export_templates')){
138
- $export_data = array();
139
- $template = new PMXE_Template_Record();
140
- foreach ($templates_ids as $template_id) {
141
- $export_data[] = $template->clear()->getBy('id', $template_id)->toArray(TRUE);
142
- }
143
-
144
- $uploads = wp_upload_dir();
145
- $targetDir = $uploads['basedir'] . DIRECTORY_SEPARATOR . PMXE_Plugin::TEMP_DIRECTORY;
146
- $export_file_name = "templates_".uniqid().".txt";
147
- file_put_contents($targetDir . DIRECTORY_SEPARATOR . $export_file_name, json_encode($export_data));
148
-
149
- PMXE_download::csv($targetDir . DIRECTORY_SEPARATOR . $export_file_name);
150
-
151
- }
152
- }
153
- }
154
- }
155
-
156
- $this->render();
157
-
158
- }
159
-
160
- public function dismiss(){
161
-
162
- PMXE_Plugin::getInstance()->updateOption("dismiss", 1);
163
-
164
- exit('OK');
165
- }
166
-
167
- protected function activate_scheduling_licenses()
168
- {
169
- return $this->licenseActivator->activateLicense(PMXE_Plugin::getSchedulingName(),\Wpae\App\Service\License\LicenseActivator::CONTEXT_SCHEDULING);
170
- }
171
-
172
- public function check_scheduling_license()
173
- {
174
- $options = PMXE_Plugin::getInstance()->getOption();
175
-
176
- return $this->licenseActivator->checkLicense(PMXE_Plugin::getSchedulingName(), $options, \Wpae\App\Service\License\LicenseActivator::CONTEXT_SCHEDULING);
177
- }
178
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/controllers/controller.php DELETED
@@ -1,182 +0,0 @@
1
- <?php
2
- /**
3
- * Common logic for all shortcodes plugin implements
4
- *
5
- * @author Pavel Kulbakin <p.kulbakin@gmail.com>
6
- */
7
- abstract class PMXE_Controller {
8
- /**
9
- * Input class instance to retrieve parameters submitted during page request
10
- * @var PMXE_Input
11
- */
12
- protected $input;
13
- /**
14
- * Error messages
15
- * @var WP_Error
16
- */
17
- protected $errors;
18
- /**
19
- * Associative array of data which will be automatically available as variables when template is rendered
20
- * @var array
21
- */
22
- public $data = array();
23
- /**
24
- * Constructor
25
- */
26
- public function __construct() {
27
- $this->input = new PMXE_Input();
28
- $this->input->addFilter('trim');
29
-
30
- $this->errors = new WP_Error();
31
-
32
- $this->init();
33
- }
34
-
35
- /**
36
- * Method to put controller initialization logic to
37
- */
38
- protected function init() {}
39
-
40
- /**
41
- * Checks wether protocol is HTTPS and redirects user to secure connection if not
42
- */
43
- protected function force_ssl() {
44
- if (force_ssl_admin() && ! is_ssl()) {
45
- if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
46
- wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI'])); die();
47
- } else {
48
- wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); die();
49
- }
50
- }
51
- }
52
-
53
- /**
54
- * Method returning resolved template content
55
- *
56
- * @param string [optional] $viewPath Template path to render
57
- * @throws Exception
58
- */
59
- protected function render($viewPath = null) {
60
-
61
- if ( ! get_current_user_id() or ! current_user_can( PMXE_Plugin::$capabilities )) {
62
- // This nonce is not valid.
63
- die( 'Security check' );
64
-
65
- } else {
66
-
67
- // assume template file name depending on calling function
68
- if (is_null($viewPath)) {
69
- $trace = debug_backtrace();
70
- $viewPath = str_replace('_', '/', preg_replace('%^' . preg_quote(PMXE_Plugin::PREFIX, '%') . '%', '', strtolower($trace[1]['class']))) . '/' . $trace[1]['function'];
71
- }
72
- // append file extension if not specified
73
- if ( ! preg_match('%\.php$%', $viewPath)) {
74
- $viewPath .= '.php';
75
- }
76
- $filePath = PMXE_Plugin::ROOT_DIR . '/views/' . $viewPath;
77
- if (is_file($filePath)) {
78
- extract($this->data);
79
- include $filePath;
80
- } else {
81
- throw new Exception("Requested template file $filePath is not found.");
82
- }
83
- }
84
- }
85
-
86
- /**
87
- * Display list of errors
88
- *
89
- * @param string|array|WP_Error[optional] $msgs
90
- */
91
- protected function error($msgs = NULL) {
92
- if (is_null($msgs)) {
93
- $msgs = $this->errors;
94
- }
95
- if (is_wp_error($msgs))
96
- {
97
- unset($msgs->errors['count-validation']);
98
-
99
- $msgs = $msgs->get_error_messages();
100
- }
101
- if ( ! is_array($msgs)) {
102
- $msgs = array($msgs);
103
- }
104
- $this->data['errors'] = $msgs;
105
-
106
- $viewPathRel = str_replace('_', '/', preg_replace('%^' . preg_quote(PMXE_Plugin::PREFIX, '%') . '%', '', strtolower(get_class($this)))) . '/error.php';
107
- if (is_file(PMXE_Plugin::ROOT_DIR . '/views/' . $viewPathRel)) { // if calling controller class has specific error view
108
- $this->render($viewPathRel);
109
- } else { // render default error view
110
- $this->render('controller/error.php');
111
- }
112
- }
113
-
114
- public function download(){
115
-
116
-
117
- $nonce = (!empty($_REQUEST['_wpnonce'])) ? $_REQUEST['_wpnonce'] : '';
118
- if ( ! wp_verify_nonce( $nonce, '_wpnonce-download_feed' ) && !isset($_GET['google_feed']) ) {
119
- die( __('Security check', 'wp_all_export_plugin') );
120
- } else {
121
-
122
- $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
123
-
124
- $id = $this->input->get('id');
125
-
126
- $export = new PMXE_Export_Record();
127
-
128
- $filepath = '';
129
-
130
- if ( ! $export->getById($id)->isEmpty())
131
- {
132
- if($export->options['export_to'] != XmlExportEngine::EXPORT_TYPE_GOOLE_MERCHANTS && isset($_GET['google_feed'])) {
133
- die('Unauthorized');
134
- }
135
- if ( ! $is_secure_import)
136
- {
137
- $filepath = get_attached_file($export->attch_id);
138
- }
139
- else
140
- {
141
- $filepath = wp_all_export_get_absolute_path($export->options['filepath']);
142
- }
143
- if ( @file_exists($filepath) )
144
- {
145
- switch ($export['options']['export_to'])
146
- {
147
- case XmlExportEngine::EXPORT_TYPE_XML:
148
-
149
- if($export['options']['xml_template_type'] == XmlExportEngine::EXPORT_TYPE_GOOLE_MERCHANTS) {
150
- PMXE_download::txt($filepath);
151
- } else {
152
- PMXE_download::xml($filepath);
153
- }
154
-
155
- break;
156
- case XmlExportEngine::EXPORT_TYPE_CSV:
157
- if (empty($export->options['export_to_sheet']) or $export->options['export_to_sheet'] == 'csv')
158
- {
159
- PMXE_download::csv($filepath);
160
- }
161
- else
162
- {
163
- switch ($export->options['export_to_sheet']){
164
- case 'xls':
165
- PMXE_download::xls($filepath);
166
- break;
167
- case 'xlsx':
168
- PMXE_download::xlsx($filepath);
169
- break;
170
- }
171
- }
172
- break;
173
-
174
- default:
175
-
176
- break;
177
- }
178
- }
179
- }
180
- }
181
- }
182
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/controllers/controller/admin.php DELETED
@@ -1,129 +0,0 @@
1
- <?php
2
- /**
3
- * Introduce special type for controllers which render pages inside admin area
4
- *
5
- * @author Pavel Kulbakin <p.kulbakin@gmail.com>
6
- */
7
- abstract class PMXE_Controller_Admin extends PMXE_Controller {
8
- /**
9
- * Admin page base url (request url without all get parameters but `page`)
10
- * @var string
11
- */
12
- public $baseUrl;
13
- /**
14
- * Parameters which is left when baseUrl is detected
15
- * @var array
16
- */
17
- public $baseUrlParamNames = array('page', 'pagenum', 'order', 'order_by', 'type', 's', 'f');
18
- /**
19
- * Whether controller is rendered inside wordpress page
20
- * @var bool
21
- */
22
- public $isInline = false;
23
- /**
24
- * Constructor
25
- */
26
- public function __construct() {
27
-
28
- $remove = array_diff(array_keys($_GET), $this->baseUrlParamNames);
29
- if ($remove) {
30
- $this->baseUrl = remove_query_arg($remove);
31
- } else {
32
- $this->baseUrl = $_SERVER['REQUEST_URI'];
33
- }
34
- parent::__construct();
35
-
36
- // add special filter for url fields
37
- $this->input->addFilter('pmxe_url_filter');
38
-
39
- // enqueue required sripts and styles
40
- global $wp_styles;
41
- if ( ! is_a($wp_styles, 'WP_Styles'))
42
- $wp_styles = new WP_Styles();
43
-
44
- wp_enqueue_style('jquery-ui', PMXE_ROOT_URL . '/static/js/jquery/css/redmond/jquery-ui.css', array('media-views'));
45
- wp_enqueue_style('jquery-tipsy', PMXE_ROOT_URL . '/static/js/jquery/css/smoothness/jquery.tipsy.css', array('media-views'));
46
- wp_enqueue_style('pmxe-admin-style', PMXE_ROOT_URL . '/static/css/admin.css',array('media-views'), PMXE_VERSION);
47
- wp_enqueue_style('pmxe-admin-style-ie', PMXE_ROOT_URL . '/static/css/admin-ie.css', array('media-views'));
48
- wp_enqueue_style('jquery-select2', PMXE_ROOT_URL . '/static/js/jquery/css/select2/select2.css', array('media-views'));
49
- wp_enqueue_style('jquery-select2', PMXE_ROOT_URL . '/static/js/jquery/css/select2/select2-bootstrap.css', array('media-views'));
50
- wp_enqueue_style('jquery-chosen', PMXE_ROOT_URL . '/static/js/jquery/css/chosen/chosen.css', array('media-views'));
51
- wp_enqueue_style('jquery-codemirror', PMXE_ROOT_URL . '/static/codemirror/codemirror.css', array('media-views'), PMXE_VERSION);
52
- wp_enqueue_style('jquery-timepicker', PMXE_ROOT_URL . '/static/js/jquery/css/timepicker/jquery.timepicker.css', array('media-views'), PMXE_VERSION);
53
- wp_enqueue_style('pmxe-angular-scss', PMXE_ROOT_URL . '/dist/styles.css', array('media-views'), PMXE_VERSION);
54
-
55
- $wp_styles->add_data('pmxe-admin-style-ie', 'conditional', 'lte IE 7');
56
- wp_enqueue_style('wp-pointer');
57
-
58
- if ( version_compare(get_bloginfo('version'), '3.8-RC1') >= 0 ){
59
- wp_enqueue_style('pmxe-admin-style-wp-3.8', PMXE_ROOT_URL . '/static/css/admin-wp-3.8.css', array('media-views'));
60
- }
61
-
62
- if ( version_compare(get_bloginfo('version'), '4.4') >= 0 ){
63
- wp_enqueue_style('pmxe-admin-style-wp-4.4', PMXE_ROOT_URL . '/static/css/admin-wp-4.4.css', array('media-views'));
64
- }
65
-
66
- $scheme_color = get_user_option('admin_color') and is_file(PMXE_Plugin::ROOT_DIR . '/static/css/admin-colors-' . $scheme_color . '.css') or $scheme_color = 'fresh';
67
- if (is_file(PMXE_Plugin::ROOT_DIR . '/static/css/admin-colors-' . $scheme_color . '.css')) {
68
- wp_enqueue_style('pmxe-admin-style-color', PMXE_ROOT_URL . '/static/css/admin-colors-' . $scheme_color . '.css', array('media-views'));
69
- }
70
-
71
- wp_enqueue_script('jquery-ui-datepicker', PMXE_ROOT_URL . '/static/js/jquery/ui.datepicker.js', 'jquery-ui-core');
72
- wp_enqueue_script('jquery-tipsy', PMXE_ROOT_URL . '/static/js/jquery/jquery.tipsy.js', 'jquery');
73
- wp_enqueue_script('jquery-pmxe-nestable', PMXE_ROOT_URL . '/static/js/jquery/jquery.mjs.pmxe_nestedSortable.js', array('jquery', 'jquery-ui-dialog', 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-tabs', 'jquery-ui-progressbar'));
74
- wp_enqueue_script('jquery-select2', PMXE_ROOT_URL . '/static/js/jquery/select2.min.js', 'jquery');
75
- wp_enqueue_script('jquery-ddslick', PMXE_ROOT_URL . '/static/js/jquery/jquery.ddslick.min.js', 'jquery');
76
- wp_enqueue_script('jquery-chosen', PMXE_ROOT_URL . '/static/js/jquery/chosen.jquery.js', 'jquery');
77
- wp_enqueue_script('jquery-codemirror', PMXE_ROOT_URL . '/static/codemirror/codemirror.js', array(), PMXE_VERSION);
78
- wp_enqueue_script('jquery-codemirror-matchbrackets', PMXE_ROOT_URL . '/static/codemirror/matchbrackets.js', array('jquery-codemirror'), PMXE_VERSION);
79
- wp_enqueue_script('jquery-codemirror-htmlmixed', PMXE_ROOT_URL . '/static/codemirror/htmlmixed.js', array('jquery-codemirror-matchbrackets'), PMXE_VERSION);
80
- wp_enqueue_script('jquery-codemirror-xml', PMXE_ROOT_URL . '/static/codemirror/xml.js', array('jquery-codemirror-htmlmixed'), PMXE_VERSION);
81
- wp_enqueue_script('jquery-codemirror-javascript', PMXE_ROOT_URL . '/static/codemirror/javascript.js', array('jquery-codemirror-xml'), PMXE_VERSION);
82
- wp_enqueue_script('jquery-codemirror-clike', PMXE_ROOT_URL . '/static/codemirror/clike.js', array('jquery-codemirror-javascript'), PMXE_VERSION);
83
- wp_enqueue_script('jquery-codemirror-php', PMXE_ROOT_URL . '/static/codemirror/php.js', array('jquery-codemirror-clike'), PMXE_VERSION);
84
- wp_enqueue_script('jquery-codemirror-autorefresh', PMXE_ROOT_URL . '/static/codemirror/autorefresh.js', array('jquery-codemirror'), PMXE_VERSION);
85
- wp_enqueue_script('jquery-timepicker', PMXE_ROOT_URL . '/static/js/jquery/jquery.timepicker.js', array('jquery'), PMXE_VERSION);
86
-
87
- wp_enqueue_script('wp-pointer');
88
-
89
- /* load plupload scripts */
90
- wp_enqueue_script('pmxe-admin-script', PMXE_ROOT_URL . '/static/js/admin.js', array('jquery', 'jquery-ui-dialog', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position', 'jquery-ui-autocomplete', 'updates' ), PMXE_VERSION);
91
- wp_enqueue_script('pmxe-admin-validate-braces', PMXE_ROOT_URL . '/static/js/validate-braces.js', array('pmxe-admin-script' ), PMXE_VERSION);
92
-
93
- if(getenv('WPAE_DEV')) {
94
- wp_enqueue_script('pmxe-angular-app', PMXE_ROOT_URL . '/dist/app.js', array('jquery'), PMXE_VERSION);
95
- } else {
96
- wp_enqueue_script('pmxe-angular-app', PMXE_ROOT_URL . '/dist/app.min.js', array('jquery'), PMXE_VERSION);
97
- }
98
- }
99
-
100
- /**
101
- * @see Controller::render()
102
- */
103
- protected function render($viewPath = NULL)
104
- {
105
- // assume template file name depending on calling function
106
- if (is_null($viewPath)) {
107
- $trace = debug_backtrace();
108
- $viewPath = str_replace('_', '/', preg_replace('%^' . preg_quote(PMXE_Plugin::PREFIX, '%') . '%', '', strtolower($trace[1]['class']))) . '/' . $trace[1]['function'];
109
- }
110
-
111
- // render contextual help automatically
112
- $viewHelpPath = $viewPath;
113
- // append file extension if not specified
114
- if ( ! preg_match('%\.php$%', $viewHelpPath)) {
115
- $viewHelpPath .= '.php';
116
- }
117
- $viewHelpPath = preg_replace('%\.php$%', '-help.php', $viewHelpPath);
118
- $fileHelpPath = PMXE_Plugin::ROOT_DIR . '/views/' . $viewHelpPath;
119
-
120
- if (is_file($fileHelpPath)) { // there is help file defined
121
- ob_start();
122
- include $fileHelpPath;
123
- add_contextual_help(PMXE_Plugin::getInstance()->getAdminCurrentScreen()->id, ob_get_clean());
124
- }
125
-
126
- parent::render($viewPath);
127
- }
128
-
129
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/dist/app.js DELETED
@@ -1,41342 +0,0 @@
1
- /**
2
- * @license AngularJS v1.6.6
3
- * (c) 2010-2017 Google, Inc. http://angularjs.org
4
- * License: MIT
5
- */
6
- (function(window) {'use strict';
7
-
8
- /* exported
9
- minErrConfig,
10
- errorHandlingConfig,
11
- isValidObjectMaxDepth
12
- */
13
-
14
- var minErrConfig = {
15
- objectMaxDepth: 5
16
- };
17
-
18
- /**
19
- * @ngdoc function
20
- * @name angular.errorHandlingConfig
21
- * @module ng
22
- * @kind function
23
- *
24
- * @description
25
- * Configure several aspects of error handling in AngularJS if used as a setter or return the
26
- * current configuration if used as a getter. The following options are supported:
27
- *
28
- * - **objectMaxDepth**: The maximum depth to which objects are traversed when stringified for error messages.
29
- *
30
- * Omitted or undefined options will leave the corresponding configuration values unchanged.
31
- *
32
- * @param {Object=} config - The configuration object. May only contain the options that need to be
33
- * updated. Supported keys:
34
- *
35
- * * `objectMaxDepth` **{Number}** - The max depth for stringifying objects. Setting to a
36
- * non-positive or non-numeric value, removes the max depth limit.
37
- * Default: 5
38
- */
39
- function errorHandlingConfig(config) {
40
- if (isObject(config)) {
41
- if (isDefined(config.objectMaxDepth)) {
42
- minErrConfig.objectMaxDepth = isValidObjectMaxDepth(config.objectMaxDepth) ? config.objectMaxDepth : NaN;
43
- }
44
- } else {
45
- return minErrConfig;
46
- }
47
- }
48
-
49
- /**
50
- * @private
51
- * @param {Number} maxDepth
52
- * @return {boolean}
53
- */
54
- function isValidObjectMaxDepth(maxDepth) {
55
- return isNumber(maxDepth) && maxDepth > 0;
56
- }
57
-
58
- /**
59
- * @description
60
- *
61
- * This object provides a utility for producing rich Error messages within
62
- * Angular. It can be called as follows:
63
- *
64
- * var exampleMinErr = minErr('example');
65
- * throw exampleMinErr('one', 'This {0} is {1}', foo, bar);
66
- *
67
- * The above creates an instance of minErr in the example namespace. The
68
- * resulting error will have a namespaced error code of example.one. The
69
- * resulting error will replace {0} with the value of foo, and {1} with the
70
- * value of bar. The object is not restricted in the number of arguments it can
71
- * take.
72
- *
73
- * If fewer arguments are specified than necessary for interpolation, the extra
74
- * interpolation markers will be preserved in the final string.
75
- *
76
- * Since data will be parsed statically during a build step, some restrictions
77
- * are applied with respect to how minErr instances are created and called.
78
- * Instances should have names of the form namespaceMinErr for a minErr created
79
- * using minErr('namespace') . Error codes, namespaces and template strings
80
- * should all be static strings, not variables or general expressions.
81
- *
82
- * @param {string} module The namespace to use for the new minErr instance.
83
- * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning
84
- * error from returned function, for cases when a particular type of error is useful.
85
- * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance
86
- */
87
-
88
- function minErr(module, ErrorConstructor) {
89
- ErrorConstructor = ErrorConstructor || Error;
90
- return function() {
91
- var code = arguments[0],
92
- template = arguments[1],
93
- message = '[' + (module ? module + ':' : '') + code + '] ',
94
- templateArgs = sliceArgs(arguments, 2).map(function(arg) {
95
- return toDebugString(arg, minErrConfig.objectMaxDepth);
96
- }),
97
- paramPrefix, i;
98
-
99
- message += template.replace(/\{\d+\}/g, function(match) {
100
- var index = +match.slice(1, -1);
101
-
102
- if (index < templateArgs.length) {
103
- return templateArgs[index];
104
- }
105
-
106
- return match;
107
- });
108
-
109
- message += '\nhttp://errors.angularjs.org/1.6.6/' +
110
- (module ? module + '/' : '') + code;
111
-
112
- for (i = 0, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {
113
- message += paramPrefix + 'p' + i + '=' + encodeURIComponent(templateArgs[i]);
114
- }
115
-
116
- return new ErrorConstructor(message);
117
- };
118
- }
119
-
120
- /* We need to tell ESLint what variables are being exported */
121
- /* exported
122
- angular,
123
- msie,
124
- jqLite,
125
- jQuery,
126
- slice,
127
- splice,
128
- push,
129
- toString,
130
- minErrConfig,
131
- errorHandlingConfig,
132
- isValidObjectMaxDepth,
133
- ngMinErr,
134
- angularModule,
135
- uid,
136
- REGEX_STRING_REGEXP,
137
- VALIDITY_STATE_PROPERTY,
138
-
139
- lowercase,
140
- uppercase,
141
- manualLowercase,
142
- manualUppercase,
143
- nodeName_,
144
- isArrayLike,
145
- forEach,
146
- forEachSorted,
147
- reverseParams,
148
- nextUid,
149
- setHashKey,
150
- extend,
151
- toInt,
152
- inherit,
153
- merge,
154
- noop,
155
- identity,
156
- valueFn,
157
- isUndefined,
158
- isDefined,
159
- isObject,
160
- isBlankObject,
161
- isString,
162
- isNumber,
163
- isNumberNaN,
164
- isDate,
165
- isError,
166
- isArray,
167
- isFunction,
168
- isRegExp,
169
- isWindow,
170
- isScope,
171
- isFile,
172
- isFormData,
173
- isBlob,
174
- isBoolean,
175
- isPromiseLike,
176
- trim,
177
- escapeForRegexp,
178
- isElement,
179
- makeMap,
180
- includes,
181
- arrayRemove,
182
- copy,
183
- simpleCompare,
184
- equals,
185
- csp,
186
- jq,
187
- concat,
188
- sliceArgs,
189
- bind,
190
- toJsonReplacer,
191
- toJson,
192
- fromJson,
193
- convertTimezoneToLocal,
194
- timezoneToOffset,
195
- startingTag,
196
- tryDecodeURIComponent,
197
- parseKeyValue,
198
- toKeyValue,
199
- encodeUriSegment,
200
- encodeUriQuery,
201
- angularInit,
202
- bootstrap,
203
- getTestability,
204
- snake_case,
205
- bindJQuery,
206
- assertArg,
207
- assertArgFn,
208
- assertNotHasOwnProperty,
209
- getter,
210
- getBlockNodes,
211
- hasOwnProperty,
212
- createMap,
213
- stringify,
214
-
215
- NODE_TYPE_ELEMENT,
216
- NODE_TYPE_ATTRIBUTE,
217
- NODE_TYPE_TEXT,
218
- NODE_TYPE_COMMENT,
219
- NODE_TYPE_DOCUMENT,
220
- NODE_TYPE_DOCUMENT_FRAGMENT
221
- */
222
-
223
- ////////////////////////////////////
224
-
225
- /**
226
- * @ngdoc module
227
- * @name ng
228
- * @module ng
229
- * @installation
230
- * @description
231
- *
232
- * # ng (core module)
233
- * The ng module is loaded by default when an AngularJS application is started. The module itself
234
- * contains the essential components for an AngularJS application to function. The table below
235
- * lists a high level breakdown of each of the services/factories, filters, directives and testing
236
- * components available within this core module.
237
- *
238
- * <div doc-module-components="ng"></div>
239
- */
240
-
241
- var REGEX_STRING_REGEXP = /^\/(.+)\/([a-z]*)$/;
242
-
243
- // The name of a form control's ValidityState property.
244
- // This is used so that it's possible for internal tests to create mock ValidityStates.
245
- var VALIDITY_STATE_PROPERTY = 'validity';
246
-
247
-
248
- var hasOwnProperty = Object.prototype.hasOwnProperty;
249
-
250
- /**
251
- * @ngdoc function
252
- * @name angular.lowercase
253
- * @module ng
254
- * @kind function
255
- *
256
- * @deprecated
257
- * sinceVersion="1.5.0"
258
- * removeVersion="1.7.0"
259
- * Use [String.prototype.toLowerCase](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase) instead.
260
- *
261
- * @description Converts the specified string to lowercase.
262
- * @param {string} string String to be converted to lowercase.
263
- * @returns {string} Lowercased string.
264
- */
265
- var lowercase = function(string) {return isString(string) ? string.toLowerCase() : string;};
266
-
267
- /**
268
- * @ngdoc function
269
- * @name angular.uppercase
270
- * @module ng
271
- * @kind function
272
- *
273
- * @deprecated
274
- * sinceVersion="1.5.0"
275
- * removeVersion="1.7.0"
276
- * Use [String.prototype.toUpperCase](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) instead.
277
- *
278
- * @description Converts the specified string to uppercase.
279
- * @param {string} string String to be converted to uppercase.
280
- * @returns {string} Uppercased string.
281
- */
282
- var uppercase = function(string) {return isString(string) ? string.toUpperCase() : string;};
283
-
284
-
285
- var manualLowercase = function(s) {
286
- /* eslint-disable no-bitwise */
287
- return isString(s)
288
- ? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);})
289
- : s;
290
- /* eslint-enable */
291
- };
292
- var manualUppercase = function(s) {
293
- /* eslint-disable no-bitwise */
294
- return isString(s)
295
- ? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);})
296
- : s;
297
- /* eslint-enable */
298
- };
299
-
300
-
301
- // String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish
302
- // locale, for this reason we need to detect this case and redefine lowercase/uppercase methods
303
- // with correct but slower alternatives. See https://github.com/angular/angular.js/issues/11387
304
- if ('i' !== 'I'.toLowerCase()) {
305
- lowercase = manualLowercase;
306
- uppercase = manualUppercase;
307
- }
308
-
309
-
310
- var
311
- msie, // holds major version number for IE, or NaN if UA is not IE.
312
- jqLite, // delay binding since jQuery could be loaded after us.
313
- jQuery, // delay binding
314
- slice = [].slice,
315
- splice = [].splice,
316
- push = [].push,
317
- toString = Object.prototype.toString,
318
- getPrototypeOf = Object.getPrototypeOf,
319
- ngMinErr = minErr('ng'),
320
-
321
- /** @name angular */
322
- angular = window.angular || (window.angular = {}),
323
- angularModule,
324
- uid = 0;
325
-
326
- // Support: IE 9-11 only
327
- /**
328
- * documentMode is an IE-only property
329
- * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx
330
- */
331
- msie = window.document.documentMode;
332
-
333
-
334
- /**
335
- * @private
336
- * @param {*} obj
337
- * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments,
338
- * String ...)
339
- */
340
- function isArrayLike(obj) {
341
-
342
- // `null`, `undefined` and `window` are not array-like
343
- if (obj == null || isWindow(obj)) return false;
344
-
345
- // arrays, strings and jQuery/jqLite objects are array like
346
- // * jqLite is either the jQuery or jqLite constructor function
347
- // * we have to check the existence of jqLite first as this method is called
348
- // via the forEach method when constructing the jqLite object in the first place
349
- if (isArray(obj) || isString(obj) || (jqLite && obj instanceof jqLite)) return true;
350
-
351
- // Support: iOS 8.2 (not reproducible in simulator)
352
- // "length" in obj used to prevent JIT error (gh-11508)
353
- var length = 'length' in Object(obj) && obj.length;
354
-
355
- // NodeList objects (with `item` method) and
356
- // other objects with suitable length characteristics are array-like
357
- return isNumber(length) &&
358
- (length >= 0 && ((length - 1) in obj || obj instanceof Array) || typeof obj.item === 'function');
359
-
360
- }
361
-
362
- /**
363
- * @ngdoc function
364
- * @name angular.forEach
365
- * @module ng
366
- * @kind function
367
- *
368
- * @description
369
- * Invokes the `iterator` function once for each item in `obj` collection, which can be either an
370
- * object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value`
371
- * is the value of an object property or an array element, `key` is the object property key or
372
- * array element index and obj is the `obj` itself. Specifying a `context` for the function is optional.
373
- *
374
- * It is worth noting that `.forEach` does not iterate over inherited properties because it filters
375
- * using the `hasOwnProperty` method.
376
- *
377
- * Unlike ES262's
378
- * [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18),
379
- * providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just
380
- * return the value provided.
381
- *
382
- ```js
383
- var values = {name: 'misko', gender: 'male'};
384
- var log = [];
385
- angular.forEach(values, function(value, key) {
386
- this.push(key + ': ' + value);
387
- }, log);
388
- expect(log).toEqual(['name: misko', 'gender: male']);
389
- ```
390
- *
391
- * @param {Object|Array} obj Object to iterate over.
392
- * @param {Function} iterator Iterator function.
393
- * @param {Object=} context Object to become context (`this`) for the iterator function.
394
- * @returns {Object|Array} Reference to `obj`.
395
- */
396
-
397
- function forEach(obj, iterator, context) {
398
- var key, length;
399
- if (obj) {
400
- if (isFunction(obj)) {
401
- for (key in obj) {
402
- if (key !== 'prototype' && key !== 'length' && key !== 'name' && obj.hasOwnProperty(key)) {
403
- iterator.call(context, obj[key], key, obj);
404
- }
405
- }
406
- } else if (isArray(obj) || isArrayLike(obj)) {
407
- var isPrimitive = typeof obj !== 'object';
408
- for (key = 0, length = obj.length; key < length; key++) {
409
- if (isPrimitive || key in obj) {
410
- iterator.call(context, obj[key], key, obj);
411
- }
412
- }
413
- } else if (obj.forEach && obj.forEach !== forEach) {
414
- obj.forEach(iterator, context, obj);
415
- } else if (isBlankObject(obj)) {
416
- // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty
417
- for (key in obj) {
418
- iterator.call(context, obj[key], key, obj);
419
- }
420
- } else if (typeof obj.hasOwnProperty === 'function') {
421
- // Slow path for objects inheriting Object.prototype, hasOwnProperty check needed
422
- for (key in obj) {
423
- if (obj.hasOwnProperty(key)) {
424
- iterator.call(context, obj[key], key, obj);
425
- }
426
- }
427
- } else {
428
- // Slow path for objects which do not have a method `hasOwnProperty`
429
- for (key in obj) {
430
- if (hasOwnProperty.call(obj, key)) {
431
- iterator.call(context, obj[key], key, obj);
432
- }
433
- }
434
- }
435
- }
436
- return obj;
437
- }
438
-
439
- function forEachSorted(obj, iterator, context) {
440
- var keys = Object.keys(obj).sort();
441
- for (var i = 0; i < keys.length; i++) {
442
- iterator.call(context, obj[keys[i]], keys[i]);
443
- }
444
- return keys;
445
- }
446
-
447
-
448
- /**
449
- * when using forEach the params are value, key, but it is often useful to have key, value.
450
- * @param {function(string, *)} iteratorFn
451
- * @returns {function(*, string)}
452
- */
453
- function reverseParams(iteratorFn) {
454
- return function(value, key) {iteratorFn(key, value);};
455
- }
456
-
457
- /**
458
- * A consistent way of creating unique IDs in angular.
459
- *
460
- * Using simple numbers allows us to generate 28.6 million unique ids per second for 10 years before
461
- * we hit number precision issues in JavaScript.
462
- *
463
- * Math.pow(2,53) / 60 / 60 / 24 / 365 / 10 = 28.6M
464
- *
465
- * @returns {number} an unique alpha-numeric string
466
- */
467
- function nextUid() {
468
- return ++uid;
469
- }
470
-
471
-
472
- /**
473
- * Set or clear the hashkey for an object.
474
- * @param obj object
475
- * @param h the hashkey (!truthy to delete the hashkey)
476
- */
477
- function setHashKey(obj, h) {
478
- if (h) {
479
- obj.$$hashKey = h;
480
- } else {
481
- delete obj.$$hashKey;
482
- }
483
- }
484
-
485
-
486
- function baseExtend(dst, objs, deep) {
487
- var h = dst.$$hashKey;
488
-
489
- for (var i = 0, ii = objs.length; i < ii; ++i) {
490
- var obj = objs[i];
491
- if (!isObject(obj) && !isFunction(obj)) continue;
492
- var keys = Object.keys(obj);
493
- for (var j = 0, jj = keys.length; j < jj; j++) {
494
- var key = keys[j];
495
- var src = obj[key];
496
-
497
- if (deep && isObject(src)) {
498
- if (isDate(src)) {
499
- dst[key] = new Date(src.valueOf());
500
- } else if (isRegExp(src)) {
501
- dst[key] = new RegExp(src);
502
- } else if (src.nodeName) {
503
- dst[key] = src.cloneNode(true);
504
- } else if (isElement(src)) {
505
- dst[key] = src.clone();
506
- } else {
507
- if (!isObject(dst[key])) dst[key] = isArray(src) ? [] : {};
508
- baseExtend(dst[key], [src], true);
509
- }
510
- } else {
511
- dst[key] = src;
512
- }
513
- }
514
- }
515
-
516
- setHashKey(dst, h);
517
- return dst;
518
- }
519
-
520
- /**
521
- * @ngdoc function
522
- * @name angular.extend
523
- * @module ng
524
- * @kind function
525
- *
526
- * @description
527
- * Extends the destination object `dst` by copying own enumerable properties from the `src` object(s)
528
- * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so
529
- * by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`.
530
- *
531
- * **Note:** Keep in mind that `angular.extend` does not support recursive merge (deep copy). Use
532
- * {@link angular.merge} for this.
533
- *
534
- * @param {Object} dst Destination object.
535
- * @param {...Object} src Source object(s).
536
- * @returns {Object} Reference to `dst`.
537
- */
538
- function extend(dst) {
539
- return baseExtend(dst, slice.call(arguments, 1), false);
540
- }
541
-
542
-
543
- /**
544
- * @ngdoc function
545
- * @name angular.merge
546
- * @module ng
547
- * @kind function
548
- *
549
- * @description
550
- * Deeply extends the destination object `dst` by copying own enumerable properties from the `src` object(s)
551
- * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so
552
- * by passing an empty object as the target: `var object = angular.merge({}, object1, object2)`.
553
- *
554
- * Unlike {@link angular.extend extend()}, `merge()` recursively descends into object properties of source
555
- * objects, performing a deep copy.
556
- *
557
- * @deprecated
558
- * sinceVersion="1.6.5"
559
- * This function is deprecated, but will not be removed in the 1.x lifecycle.
560
- * There are edge cases (see {@link angular.merge#known-issues known issues}) that are not
561
- * supported by this function. We suggest
562
- * using [lodash's merge()](https://lodash.com/docs/4.17.4#merge) instead.
563
- *
564
- * @knownIssue
565
- * This is a list of (known) object types that are not handled correctly by this function:
566
- * - [`Blob`](https://developer.mozilla.org/docs/Web/API/Blob)
567
- * - [`MediaStream`](https://developer.mozilla.org/docs/Web/API/MediaStream)
568
- * - [`CanvasGradient`](https://developer.mozilla.org/docs/Web/API/CanvasGradient)
569
- * - AngularJS {@link $rootScope.Scope scopes};
570
- *
571
- * @param {Object} dst Destination object.
572
- * @param {...Object} src Source object(s).
573
- * @returns {Object} Reference to `dst`.
574
- */
575
- function merge(dst) {
576
- return baseExtend(dst, slice.call(arguments, 1), true);
577
- }
578
-
579
-
580
-
581
- function toInt(str) {
582
- return parseInt(str, 10);
583
- }
584
-
585
- var isNumberNaN = Number.isNaN || function isNumberNaN(num) {
586
- // eslint-disable-next-line no-self-compare
587
- return num !== num;
588
- };
589
-
590
-
591
- function inherit(parent, extra) {
592
- return extend(Object.create(parent), extra);
593
- }
594
-
595
- /**
596
- * @ngdoc function
597
- * @name angular.noop
598
- * @module ng
599
- * @kind function
600
- *
601
- * @description
602
- * A function that performs no operations. This function can be useful when writing code in the
603
- * functional style.
604
- ```js
605
- function foo(callback) {
606
- var result = calculateResult();
607
- (callback || angular.noop)(result);
608
- }
609
- ```
610
- */
611
- function noop() {}
612
- noop.$inject = [];
613
-
614
-
615
- /**
616
- * @ngdoc function
617
- * @name angular.identity
618
- * @module ng
619
- * @kind function
620
- *
621
- * @description
622
- * A function that returns its first argument. This function is useful when writing code in the
623
- * functional style.
624
- *
625
- ```js
626
- function transformer(transformationFn, value) {
627
- return (transformationFn || angular.identity)(value);
628
- };
629
-
630
- // E.g.
631
- function getResult(fn, input) {
632
- return (fn || angular.identity)(input);
633
- };
634
-
635
- getResult(function(n) { return n * 2; }, 21); // returns 42
636
- getResult(null, 21); // returns 21
637
- getResult(undefined, 21); // returns 21
638
- ```
639
- *
640
- * @param {*} value to be returned.
641
- * @returns {*} the value passed in.
642
- */
643
- function identity($) {return $;}
644
- identity.$inject = [];
645
-
646
-
647
- function valueFn(value) {return function valueRef() {return value;};}
648
-
649
- function hasCustomToString(obj) {
650
- return isFunction(obj.toString) && obj.toString !== toString;
651
- }
652
-
653
-
654
- /**
655
- * @ngdoc function
656
- * @name angular.isUndefined
657
- * @module ng
658
- * @kind function
659
- *
660
- * @description
661
- * Determines if a reference is undefined.
662
- *
663
- * @param {*} value Reference to check.
664
- * @returns {boolean} True if `value` is undefined.
665
- */
666
- function isUndefined(value) {return typeof value === 'undefined';}
667
-
668
-
669
- /**
670
- * @ngdoc function
671
- * @name angular.isDefined
672
- * @module ng
673
- * @kind function
674
- *
675
- * @description
676
- * Determines if a reference is defined.
677
- *
678
- * @param {*} value Reference to check.
679
- * @returns {boolean} True if `value` is defined.
680
- */
681
- function isDefined(value) {return typeof value !== 'undefined';}
682
-
683
-
684
- /**
685
- * @ngdoc function
686
- * @name angular.isObject
687
- * @module ng
688
- * @kind function
689
- *
690
- * @description
691
- * Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not
692
- * considered to be objects. Note that JavaScript arrays are objects.
693
- *
694
- * @param {*} value Reference to check.
695
- * @returns {boolean} True if `value` is an `Object` but not `null`.
696
- */
697
- function isObject(value) {
698
- // http://jsperf.com/isobject4
699
- return value !== null && typeof value === 'object';
700
- }
701
-
702
-
703
- /**
704
- * Determine if a value is an object with a null prototype
705
- *
706
- * @returns {boolean} True if `value` is an `Object` with a null prototype
707
- */
708
- function isBlankObject(value) {
709
- return value !== null && typeof value === 'object' && !getPrototypeOf(value);
710
- }
711
-
712
-
713
- /**
714
- * @ngdoc function
715
- * @name angular.isString
716
- * @module ng
717
- * @kind function
718
- *
719
- * @description
720
- * Determines if a reference is a `String`.
721
- *
722
- * @param {*} value Reference to check.
723
- * @returns {boolean} True if `value` is a `String`.
724
- */
725
- function isString(value) {return typeof value === 'string';}
726
-
727
-
728
- /**
729
- * @ngdoc function
730
- * @name angular.isNumber
731
- * @module ng
732
- * @kind function
733
- *
734
- * @description
735
- * Determines if a reference is a `Number`.
736
- *
737
- * This includes the "special" numbers `NaN`, `+Infinity` and `-Infinity`.
738
- *
739
- * If you wish to exclude these then you can use the native
740
- * [`isFinite'](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite)
741
- * method.
742
- *
743
- * @param {*} value Reference to check.
744
- * @returns {boolean} True if `value` is a `Number`.
745
- */
746
- function isNumber(value) {return typeof value === 'number';}
747
-
748
-
749
- /**
750
- * @ngdoc function
751
- * @name angular.isDate
752
- * @module ng
753
- * @kind function
754
- *
755
- * @description
756
- * Determines if a value is a date.
757
- *
758
- * @param {*} value Reference to check.
759
- * @returns {boolean} True if `value` is a `Date`.
760
- */
761
- function isDate(value) {
762
- return toString.call(value) === '[object Date]';
763
- }
764
-
765
-
766
- /**
767
- * @ngdoc function
768
- * @name angular.isArray
769
- * @module ng
770
- * @kind function
771
- *
772
- * @description
773
- * Determines if a reference is an `Array`. Alias of Array.isArray.
774
- *
775
- * @param {*} value Reference to check.
776
- * @returns {boolean} True if `value` is an `Array`.
777
- */
778
- var isArray = Array.isArray;
779
-
780
- /**
781
- * @description
782
- * Determines if a reference is an `Error`.
783
- * Loosely based on https://www.npmjs.com/package/iserror
784
- *
785
- * @param {*} value Reference to check.
786
- * @returns {boolean} True if `value` is an `Error`.
787
- */
788
- function isError(value) {
789
- var tag = toString.call(value);
790
- switch (tag) {
791
- case '[object Error]': return true;
792
- case '[object Exception]': return true;
793
- case '[object DOMException]': return true;
794
- default: return value instanceof Error;
795
- }
796
- }
797
-
798
- /**
799
- * @ngdoc function
800
- * @name angular.isFunction
801
- * @module ng
802
- * @kind function
803
- *
804
- * @description
805
- * Determines if a reference is a `Function`.
806
- *
807
- * @param {*} value Reference to check.
808
- * @returns {boolean} True if `value` is a `Function`.
809
- */
810
- function isFunction(value) {return typeof value === 'function';}
811
-
812
-
813
- /**
814
- * Determines if a value is a regular expression object.
815
- *
816
- * @private
817
- * @param {*} value Reference to check.
818
- * @returns {boolean} True if `value` is a `RegExp`.
819
- */
820
- function isRegExp(value) {
821
- return toString.call(value) === '[object RegExp]';
822
- }
823
-
824
-
825
- /**
826
- * Checks if `obj` is a window object.
827
- *
828
- * @private
829
- * @param {*} obj Object to check
830
- * @returns {boolean} True if `obj` is a window obj.
831
- */
832
- function isWindow(obj) {
833
- return obj && obj.window === obj;
834
- }
835
-
836
-
837
- function isScope(obj) {
838
- return obj && obj.$evalAsync && obj.$watch;
839
- }
840
-
841
-
842
- function isFile(obj) {
843
- return toString.call(obj) === '[object File]';
844
- }
845
-
846
-
847
- function isFormData(obj) {
848
- return toString.call(obj) === '[object FormData]';
849
- }
850
-
851
-
852
- function isBlob(obj) {
853
- return toString.call(obj) === '[object Blob]';
854
- }
855
-
856
-
857
- function isBoolean(value) {
858
- return typeof value === 'boolean';
859
- }
860
-
861
-
862
- function isPromiseLike(obj) {
863
- return obj && isFunction(obj.then);
864
- }
865
-
866
-
867
- var TYPED_ARRAY_REGEXP = /^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/;
868
- function isTypedArray(value) {
869
- return value && isNumber(value.length) && TYPED_ARRAY_REGEXP.test(toString.call(value));
870
- }
871
-
872
- function isArrayBuffer(obj) {
873
- return toString.call(obj) === '[object ArrayBuffer]';
874
- }
875
-
876
-
877
- var trim = function(value) {
878
- return isString(value) ? value.trim() : value;
879
- };
880
-
881
- // Copied from:
882
- // http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021
883
- // Prereq: s is a string.
884
- var escapeForRegexp = function(s) {
885
- return s
886
- .replace(/([-()[\]{}+?*.$^|,:#<!\\])/g, '\\$1')
887
- // eslint-disable-next-line no-control-regex
888
- .replace(/\x08/g, '\\x08');
889
- };
890
-
891
-
892
- /**
893
- * @ngdoc function
894
- * @name angular.isElement
895
- * @module ng
896
- * @kind function
897
- *
898
- * @description
899
- * Determines if a reference is a DOM element (or wrapped jQuery element).
900
- *
901
- * @param {*} value Reference to check.
902
- * @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element).
903
- */
904
- function isElement(node) {
905
- return !!(node &&
906
- (node.nodeName // We are a direct element.
907
- || (node.prop && node.attr && node.find))); // We have an on and find method part of jQuery API.
908
- }
909
-
910
- /**
911
- * @param str 'key1,key2,...'
912
- * @returns {object} in the form of {key1:true, key2:true, ...}
913
- */
914
- function makeMap(str) {
915
- var obj = {}, items = str.split(','), i;
916
- for (i = 0; i < items.length; i++) {
917
- obj[items[i]] = true;
918
- }
919
- return obj;
920
- }
921
-
922
-
923
- function nodeName_(element) {
924
- return lowercase(element.nodeName || (element[0] && element[0].nodeName));
925
- }
926
-
927
- function includes(array, obj) {
928
- return Array.prototype.indexOf.call(array, obj) !== -1;
929
- }
930
-
931
- function arrayRemove(array, value) {
932
- var index = array.indexOf(value);
933
- if (index >= 0) {
934
- array.splice(index, 1);
935
- }
936
- return index;
937
- }
938
-
939
- /**
940
- * @ngdoc function
941
- * @name angular.copy
942
- * @module ng
943
- * @kind function
944
- *
945
- * @description
946
- * Creates a deep copy of `source`, which should be an object or an array.
947
- *
948
- * * If no destination is supplied, a copy of the object or array is created.
949
- * * If a destination is provided, all of its elements (for arrays) or properties (for objects)
950
- * are deleted and then all elements/properties from the source are copied to it.
951
- * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned.
952
- * * If `source` is identical to `destination` an exception will be thrown.
953
- *
954
- * <br />
955
- * <div class="alert alert-warning">
956
- * Only enumerable properties are taken into account. Non-enumerable properties (both on `source`
957
- * and on `destination`) will be ignored.
958
- * </div>
959
- *
960
- * @param {*} source The source that will be used to make a copy.
961
- * Can be any type, including primitives, `null`, and `undefined`.
962
- * @param {(Object|Array)=} destination Destination into which the source is copied. If
963
- * provided, must be of the same type as `source`.
964
- * @returns {*} The copy or updated `destination`, if `destination` was specified.
965
- *
966
- * @example
967
- <example module="copyExample" name="angular-copy">
968
- <file name="index.html">
969
- <div ng-controller="ExampleController">
970
- <form novalidate class="simple-form">
971
- <label>Name: <input type="text" ng-model="user.name" /></label><br />
972
- <label>Age: <input type="number" ng-model="user.age" /></label><br />
973
- Gender: <label><input type="radio" ng-model="user.gender" value="male" />male</label>
974
- <label><input type="radio" ng-model="user.gender" value="female" />female</label><br />
975
- <button ng-click="reset()">RESET</button>
976
- <button ng-click="update(user)">SAVE</button>
977
- </form>
978
- <pre>form = {{user | json}}</pre>
979
- <pre>master = {{master | json}}</pre>
980
- </div>
981
- </file>
982
- <file name="script.js">
983
- // Module: copyExample
984
- angular.
985
- module('copyExample', []).
986
- controller('ExampleController', ['$scope', function($scope) {
987
- $scope.master = {};
988
-
989
- $scope.reset = function() {
990
- // Example with 1 argument
991
- $scope.user = angular.copy($scope.master);
992
- };
993
-
994
- $scope.update = function(user) {
995
- // Example with 2 arguments
996
- angular.copy(user, $scope.master);
997
- };
998
-
999
- $scope.reset();
1000
- }]);
1001
- </file>
1002
- </example>
1003
- */
1004
- function copy(source, destination, maxDepth) {
1005
- var stackSource = [];
1006
- var stackDest = [];
1007
- maxDepth = isValidObjectMaxDepth(maxDepth) ? maxDepth : NaN;
1008
-
1009
- if (destination) {
1010
- if (isTypedArray(destination) || isArrayBuffer(destination)) {
1011
- throw ngMinErr('cpta', 'Can\'t copy! TypedArray destination cannot be mutated.');
1012
- }
1013
- if (source === destination) {
1014
- throw ngMinErr('cpi', 'Can\'t copy! Source and destination are identical.');
1015
- }
1016
-
1017
- // Empty the destination object
1018
- if (isArray(destination)) {
1019
- destination.length = 0;
1020
- } else {
1021
- forEach(destination, function(value, key) {
1022
- if (key !== '$$hashKey') {
1023
- delete destination[key];
1024
- }
1025
- });
1026
- }
1027
-
1028
- stackSource.push(source);
1029
- stackDest.push(destination);
1030
- return copyRecurse(source, destination, maxDepth);
1031
- }
1032
-
1033
- return copyElement(source, maxDepth);
1034
-
1035
- function copyRecurse(source, destination, maxDepth) {
1036
- maxDepth--;
1037
- if (maxDepth < 0) {
1038
- return '...';
1039
- }
1040
- var h = destination.$$hashKey;
1041
- var key;
1042
- if (isArray(source)) {
1043
- for (var i = 0, ii = source.length; i < ii; i++) {
1044
- destination.push(copyElement(source[i], maxDepth));
1045
- }
1046
- } else if (isBlankObject(source)) {
1047
- // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty
1048
- for (key in source) {
1049
- destination[key] = copyElement(source[key], maxDepth);
1050
- }
1051
- } else if (source && typeof source.hasOwnProperty === 'function') {
1052
- // Slow path, which must rely on hasOwnProperty
1053
- for (key in source) {
1054
- if (source.hasOwnProperty(key)) {
1055
- destination[key] = copyElement(source[key], maxDepth);
1056
- }
1057
- }
1058
- } else {
1059
- // Slowest path --- hasOwnProperty can't be called as a method
1060
- for (key in source) {
1061
- if (hasOwnProperty.call(source, key)) {
1062
- destination[key] = copyElement(source[key], maxDepth);
1063
- }
1064
- }
1065
- }
1066
- setHashKey(destination, h);
1067
- return destination;
1068
- }
1069
-
1070
- function copyElement(source, maxDepth) {
1071
- // Simple values
1072
- if (!isObject(source)) {
1073
- return source;
1074
- }
1075
-
1076
- // Already copied values
1077
- var index = stackSource.indexOf(source);
1078
- if (index !== -1) {
1079
- return stackDest[index];
1080
- }
1081
-
1082
- if (isWindow(source) || isScope(source)) {
1083
- throw ngMinErr('cpws',
1084
- 'Can\'t copy! Making copies of Window or Scope instances is not supported.');
1085
- }
1086
-
1087
- var needsRecurse = false;
1088
- var destination = copyType(source);
1089
-
1090
- if (destination === undefined) {
1091
- destination = isArray(source) ? [] : Object.create(getPrototypeOf(source));
1092
- needsRecurse = true;
1093
- }
1094
-
1095
- stackSource.push(source);
1096
- stackDest.push(destination);
1097
-
1098
- return needsRecurse
1099
- ? copyRecurse(source, destination, maxDepth)
1100
- : destination;
1101
- }
1102
-
1103
- function copyType(source) {
1104
- switch (toString.call(source)) {
1105
- case '[object Int8Array]':
1106
- case '[object Int16Array]':
1107
- case '[object Int32Array]':
1108
- case '[object Float32Array]':
1109
- case '[object Float64Array]':
1110
- case '[object Uint8Array]':
1111
- case '[object Uint8ClampedArray]':
1112
- case '[object Uint16Array]':
1113
- case '[object Uint32Array]':
1114
- return new source.constructor(copyElement(source.buffer), source.byteOffset, source.length);
1115
-
1116
- case '[object ArrayBuffer]':
1117
- // Support: IE10
1118
- if (!source.slice) {
1119
- // If we're in this case we know the environment supports ArrayBuffer
1120
- /* eslint-disable no-undef */
1121
- var copied = new ArrayBuffer(source.byteLength);
1122
- new Uint8Array(copied).set(new Uint8Array(source));
1123
- /* eslint-enable */
1124
- return copied;
1125
- }
1126
- return source.slice(0);
1127
-
1128
- case '[object Boolean]':
1129
- case '[object Number]':
1130
- case '[object String]':
1131
- case '[object Date]':
1132
- return new source.constructor(source.valueOf());
1133
-
1134
- case '[object RegExp]':
1135
- var re = new RegExp(source.source, source.toString().match(/[^/]*$/)[0]);
1136
- re.lastIndex = source.lastIndex;
1137
- return re;
1138
-
1139
- case '[object Blob]':
1140
- return new source.constructor([source], {type: source.type});
1141
- }
1142
-
1143
- if (isFunction(source.cloneNode)) {
1144
- return source.cloneNode(true);
1145
- }
1146
- }
1147
- }
1148
-
1149
-
1150
- // eslint-disable-next-line no-self-compare
1151
- function simpleCompare(a, b) { return a === b || (a !== a && b !== b); }
1152
-
1153
-
1154
- /**
1155
- * @ngdoc function
1156
- * @name angular.equals
1157
- * @module ng
1158
- * @kind function
1159
- *
1160
- * @description
1161
- * Determines if two objects or two values are equivalent. Supports value types, regular
1162
- * expressions, arrays and objects.
1163
- *
1164
- * Two objects or values are considered equivalent if at least one of the following is true:
1165
- *
1166
- * * Both objects or values pass `===` comparison.
1167
- * * Both objects or values are of the same type and all of their properties are equal by
1168
- * comparing them with `angular.equals`.
1169
- * * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal)
1170
- * * Both values represent the same regular expression (In JavaScript,
1171
- * /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual
1172
- * representation matches).
1173
- *
1174
- * During a property comparison, properties of `function` type and properties with names
1175
- * that begin with `$` are ignored.
1176
- *
1177
- * Scope and DOMWindow objects are being compared only by identify (`===`).
1178
- *
1179
- * @param {*} o1 Object or value to compare.
1180
- * @param {*} o2 Object or value to compare.
1181
- * @returns {boolean} True if arguments are equal.
1182
- *
1183
- * @example
1184
- <example module="equalsExample" name="equalsExample">
1185
- <file name="index.html">
1186
- <div ng-controller="ExampleController">
1187
- <form novalidate>
1188
- <h3>User 1</h3>
1189
- Name: <input type="text" ng-model="user1.name">
1190
- Age: <input type="number" ng-model="user1.age">
1191
-
1192
- <h3>User 2</h3>
1193
- Name: <input type="text" ng-model="user2.name">
1194
- Age: <input type="number" ng-model="user2.age">
1195
-
1196
- <div>
1197
- <br/>
1198
- <input type="button" value="Compare" ng-click="compare()">
1199
- </div>
1200
- User 1: <pre>{{user1 | json}}</pre>
1201
- User 2: <pre>{{user2 | json}}</pre>
1202
- Equal: <pre>{{result}}</pre>
1203
- </form>
1204
- </div>
1205
- </file>
1206
- <file name="script.js">
1207
- angular.module('equalsExample', []).controller('ExampleController', ['$scope', function($scope) {
1208
- $scope.user1 = {};
1209
- $scope.user2 = {};
1210
- $scope.compare = function() {
1211
- $scope.result = angular.equals($scope.user1, $scope.user2);
1212
- };
1213
- }]);
1214
- </file>
1215
- </example>
1216
- */
1217
- function equals(o1, o2) {
1218
- if (o1 === o2) return true;
1219
- if (o1 === null || o2 === null) return false;
1220
- // eslint-disable-next-line no-self-compare
1221
- if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN
1222
- var t1 = typeof o1, t2 = typeof o2, length, key, keySet;
1223
- if (t1 === t2 && t1 === 'object') {
1224
- if (isArray(o1)) {
1225
- if (!isArray(o2)) return false;
1226
- if ((length = o1.length) === o2.length) {
1227
- for (key = 0; key < length; key++) {
1228
- if (!equals(o1[key], o2[key])) return false;
1229
- }
1230
- return true;
1231
- }
1232
- } else if (isDate(o1)) {
1233
- if (!isDate(o2)) return false;
1234
- return simpleCompare(o1.getTime(), o2.getTime());
1235
- } else if (isRegExp(o1)) {
1236
- if (!isRegExp(o2)) return false;
1237
- return o1.toString() === o2.toString();
1238
- } else {
1239
- if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) ||
1240
- isArray(o2) || isDate(o2) || isRegExp(o2)) return false;
1241
- keySet = createMap();
1242
- for (key in o1) {
1243
- if (key.charAt(0) === '$' || isFunction(o1[key])) continue;
1244
- if (!equals(o1[key], o2[key])) return false;
1245
- keySet[key] = true;
1246
- }
1247
- for (key in o2) {
1248
- if (!(key in keySet) &&
1249
- key.charAt(0) !== '$' &&
1250
- isDefined(o2[key]) &&
1251
- !isFunction(o2[key])) return false;
1252
- }
1253
- return true;
1254
- }
1255
- }
1256
- return false;
1257
- }
1258
-
1259
- var csp = function() {
1260
- if (!isDefined(csp.rules)) {
1261
-
1262
-
1263
- var ngCspElement = (window.document.querySelector('[ng-csp]') ||
1264
- window.document.querySelector('[data-ng-csp]'));
1265
-
1266
- if (ngCspElement) {
1267
- var ngCspAttribute = ngCspElement.getAttribute('ng-csp') ||
1268
- ngCspElement.getAttribute('data-ng-csp');
1269
- csp.rules = {
1270
- noUnsafeEval: !ngCspAttribute || (ngCspAttribute.indexOf('no-unsafe-eval') !== -1),
1271
- noInlineStyle: !ngCspAttribute || (ngCspAttribute.indexOf('no-inline-style') !== -1)
1272
- };
1273
- } else {
1274
- csp.rules = {
1275
- noUnsafeEval: noUnsafeEval(),
1276
- noInlineStyle: false
1277
- };
1278
- }
1279
- }
1280
-
1281
- return csp.rules;
1282
-
1283
- function noUnsafeEval() {
1284
- try {
1285
- // eslint-disable-next-line no-new, no-new-func
1286
- new Function('');
1287
- return false;
1288
- } catch (e) {
1289
- return true;
1290
- }
1291
- }
1292
- };
1293
-
1294
- /**
1295
- * @ngdoc directive
1296
- * @module ng
1297
- * @name ngJq
1298
- *
1299
- * @element ANY
1300
- * @param {string=} ngJq the name of the library available under `window`
1301
- * to be used for angular.element
1302
- * @description
1303
- * Use this directive to force the angular.element library. This should be
1304
- * used to force either jqLite by leaving ng-jq blank or setting the name of
1305
- * the jquery variable under window (eg. jQuery).
1306
- *
1307
- * Since angular looks for this directive when it is loaded (doesn't wait for the
1308
- * DOMContentLoaded event), it must be placed on an element that comes before the script
1309
- * which loads angular. Also, only the first instance of `ng-jq` will be used and all
1310
- * others ignored.
1311
- *
1312
- * @example
1313
- * This example shows how to force jqLite using the `ngJq` directive to the `html` tag.
1314
- ```html
1315
- <!doctype html>
1316
- <html ng-app ng-jq>
1317
- ...
1318
- ...
1319
- </html>
1320
- ```
1321
- * @example
1322
- * This example shows how to use a jQuery based library of a different name.
1323
- * The library name must be available at the top most 'window'.
1324
- ```html
1325
- <!doctype html>
1326
- <html ng-app ng-jq="jQueryLib">
1327
- ...
1328
- ...
1329
- </html>
1330
- ```
1331
- */
1332
- var jq = function() {
1333
- if (isDefined(jq.name_)) return jq.name_;
1334
- var el;
1335
- var i, ii = ngAttrPrefixes.length, prefix, name;
1336
- for (i = 0; i < ii; ++i) {
1337
- prefix = ngAttrPrefixes[i];
1338
- el = window.document.querySelector('[' + prefix.replace(':', '\\:') + 'jq]');
1339
- if (el) {
1340
- name = el.getAttribute(prefix + 'jq');
1341
- break;
1342
- }
1343
- }
1344
-
1345
- return (jq.name_ = name);
1346
- };
1347
-
1348
- function concat(array1, array2, index) {
1349
- return array1.concat(slice.call(array2, index));
1350
- }
1351
-
1352
- function sliceArgs(args, startIndex) {
1353
- return slice.call(args, startIndex || 0);
1354
- }
1355
-
1356
-
1357
- /**
1358
- * @ngdoc function
1359
- * @name angular.bind
1360
- * @module ng
1361
- * @kind function
1362
- *
1363
- * @description
1364
- * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for
1365
- * `fn`). You can supply optional `args` that are prebound to the function. This feature is also
1366
- * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as
1367
- * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application).
1368
- *
1369
- * @param {Object} self Context which `fn` should be evaluated in.
1370
- * @param {function()} fn Function to be bound.
1371
- * @param {...*} args Optional arguments to be prebound to the `fn` function call.
1372
- * @returns {function()} Function that wraps the `fn` with all the specified bindings.
1373
- */
1374
- function bind(self, fn) {
1375
- var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];
1376
- if (isFunction(fn) && !(fn instanceof RegExp)) {
1377
- return curryArgs.length
1378
- ? function() {
1379
- return arguments.length
1380
- ? fn.apply(self, concat(curryArgs, arguments, 0))
1381
- : fn.apply(self, curryArgs);
1382
- }
1383
- : function() {
1384
- return arguments.length
1385
- ? fn.apply(self, arguments)
1386
- : fn.call(self);
1387
- };
1388
- } else {
1389
- // In IE, native methods are not functions so they cannot be bound (note: they don't need to be).
1390
- return fn;
1391
- }
1392
- }
1393
-
1394
-
1395
- function toJsonReplacer(key, value) {
1396
- var val = value;
1397
-
1398
- if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') {
1399
- val = undefined;
1400
- } else if (isWindow(value)) {
1401
- val = '$WINDOW';
1402
- } else if (value && window.document === value) {
1403
- val = '$DOCUMENT';
1404
- } else if (isScope(value)) {
1405
- val = '$SCOPE';
1406
- }
1407
-
1408
- return val;
1409
- }
1410
-
1411
-
1412
- /**
1413
- * @ngdoc function
1414
- * @name angular.toJson
1415
- * @module ng
1416
- * @kind function
1417
- *
1418
- * @description
1419
- * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be
1420
- * stripped since angular uses this notation internally.
1421
- *
1422
- * @param {Object|Array|Date|string|number|boolean} obj Input to be serialized into JSON.
1423
- * @param {boolean|number} [pretty=2] If set to true, the JSON output will contain newlines and whitespace.
1424
- * If set to an integer, the JSON output will contain that many spaces per indentation.
1425
- * @returns {string|undefined} JSON-ified string representing `obj`.
1426
- * @knownIssue
1427
- *
1428
- * The Safari browser throws a `RangeError` instead of returning `null` when it tries to stringify a `Date`
1429
- * object with an invalid date value. The only reliable way to prevent this is to monkeypatch the
1430
- * `Date.prototype.toJSON` method as follows:
1431
- *
1432
- * ```
1433
- * var _DatetoJSON = Date.prototype.toJSON;
1434
- * Date.prototype.toJSON = function() {
1435
- * try {
1436
- * return _DatetoJSON.call(this);
1437
- * } catch(e) {
1438
- * if (e instanceof RangeError) {
1439
- * return null;
1440
- * }
1441
- * throw e;
1442
- * }
1443
- * };
1444
- * ```
1445
- *
1446
- * See https://github.com/angular/angular.js/pull/14221 for more information.
1447
- */
1448
- function toJson(obj, pretty) {
1449
- if (isUndefined(obj)) return undefined;
1450
- if (!isNumber(pretty)) {
1451
- pretty = pretty ? 2 : null;
1452
- }
1453
- return JSON.stringify(obj, toJsonReplacer, pretty);
1454
- }
1455
-
1456
-
1457
- /**
1458
- * @ngdoc function
1459
- * @name angular.fromJson
1460
- * @module ng
1461
- * @kind function
1462
- *
1463
- * @description
1464
- * Deserializes a JSON string.
1465
- *
1466
- * @param {string} json JSON string to deserialize.
1467
- * @returns {Object|Array|string|number} Deserialized JSON string.
1468
- */
1469
- function fromJson(json) {
1470
- return isString(json)
1471
- ? JSON.parse(json)
1472
- : json;
1473
- }
1474
-
1475
-
1476
- var ALL_COLONS = /:/g;
1477
- function timezoneToOffset(timezone, fallback) {
1478
- // Support: IE 9-11 only, Edge 13-15+
1479
- // IE/Edge do not "understand" colon (`:`) in timezone
1480
- timezone = timezone.replace(ALL_COLONS, '');
1481
- var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;
1482
- return isNumberNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;
1483
- }
1484
-
1485
-
1486
- function addDateMinutes(date, minutes) {
1487
- date = new Date(date.getTime());
1488
- date.setMinutes(date.getMinutes() + minutes);
1489
- return date;
1490
- }
1491
-
1492
-
1493
- function convertTimezoneToLocal(date, timezone, reverse) {
1494
- reverse = reverse ? -1 : 1;
1495
- var dateTimezoneOffset = date.getTimezoneOffset();
1496
- var timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
1497
- return addDateMinutes(date, reverse * (timezoneOffset - dateTimezoneOffset));
1498
- }
1499
-
1500
-
1501
- /**
1502
- * @returns {string} Returns the string representation of the element.
1503
- */
1504
- function startingTag(element) {
1505
- element = jqLite(element).clone().empty();
1506
- var elemHtml = jqLite('<div>').append(element).html();
1507
- try {
1508
- return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) :
1509
- elemHtml.
1510
- match(/^(<[^>]+>)/)[1].
1511
- replace(/^<([\w-]+)/, function(match, nodeName) {return '<' + lowercase(nodeName);});
1512
- } catch (e) {
1513
- return lowercase(elemHtml);
1514
- }
1515
-
1516
- }
1517
-
1518
-
1519
- /////////////////////////////////////////////////
1520
-
1521
- /**
1522
- * Tries to decode the URI component without throwing an exception.
1523
- *
1524
- * @private
1525
- * @param str value potential URI component to check.
1526
- * @returns {boolean} True if `value` can be decoded
1527
- * with the decodeURIComponent function.
1528
- */
1529
- function tryDecodeURIComponent(value) {
1530
- try {
1531
- return decodeURIComponent(value);
1532
- } catch (e) {
1533
- // Ignore any invalid uri component.
1534
- }
1535
- }
1536
-
1537
-
1538
- /**
1539
- * Parses an escaped url query string into key-value pairs.
1540
- * @returns {Object.<string,boolean|Array>}
1541
- */
1542
- function parseKeyValue(/**string*/keyValue) {
1543
- var obj = {};
1544
- forEach((keyValue || '').split('&'), function(keyValue) {
1545
- var splitPoint, key, val;
1546
- if (keyValue) {
1547
- key = keyValue = keyValue.replace(/\+/g,'%20');
1548
- splitPoint = keyValue.indexOf('=');
1549
- if (splitPoint !== -1) {
1550
- key = keyValue.substring(0, splitPoint);
1551
- val = keyValue.substring(splitPoint + 1);
1552
- }
1553
- key = tryDecodeURIComponent(key);
1554
- if (isDefined(key)) {
1555
- val = isDefined(val) ? tryDecodeURIComponent(val) : true;
1556
- if (!hasOwnProperty.call(obj, key)) {
1557
- obj[key] = val;
1558
- } else if (isArray(obj[key])) {
1559
- obj[key].push(val);
1560
- } else {
1561
- obj[key] = [obj[key],val];
1562
- }
1563
- }
1564
- }
1565
- });
1566
- return obj;
1567
- }
1568
-
1569
- function toKeyValue(obj) {
1570
- var parts = [];
1571
- forEach(obj, function(value, key) {
1572
- if (isArray(value)) {
1573
- forEach(value, function(arrayValue) {
1574
- parts.push(encodeUriQuery(key, true) +
1575
- (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));
1576
- });
1577
- } else {
1578
- parts.push(encodeUriQuery(key, true) +
1579
- (value === true ? '' : '=' + encodeUriQuery(value, true)));
1580
- }
1581
- });
1582
- return parts.length ? parts.join('&') : '';
1583
- }
1584
-
1585
-
1586
- /**
1587
- * We need our custom method because encodeURIComponent is too aggressive and doesn't follow
1588
- * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path
1589
- * segments:
1590
- * segment = *pchar
1591
- * pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
1592
- * pct-encoded = "%" HEXDIG HEXDIG
1593
- * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
1594
- * sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
1595
- * / "*" / "+" / "," / ";" / "="
1596
- */
1597
- function encodeUriSegment(val) {
1598
- return encodeUriQuery(val, true).
1599
- replace(/%26/gi, '&').
1600
- replace(/%3D/gi, '=').
1601
- replace(/%2B/gi, '+');
1602
- }
1603
-
1604
-
1605
- /**
1606
- * This method is intended for encoding *key* or *value* parts of query component. We need a custom
1607
- * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be
1608
- * encoded per http://tools.ietf.org/html/rfc3986:
1609
- * query = *( pchar / "/" / "?" )
1610
- * pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
1611
- * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
1612
- * pct-encoded = "%" HEXDIG HEXDIG
1613
- * sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
1614
- * / "*" / "+" / "," / ";" / "="
1615
- */
1616
- function encodeUriQuery(val, pctEncodeSpaces) {
1617
- return encodeURIComponent(val).
1618
- replace(/%40/gi, '@').
1619
- replace(/%3A/gi, ':').
1620
- replace(/%24/g, '$').
1621
- replace(/%2C/gi, ',').
1622
- replace(/%3B/gi, ';').
1623
- replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));
1624
- }
1625
-
1626
- var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];
1627
-
1628
- function getNgAttribute(element, ngAttr) {
1629
- var attr, i, ii = ngAttrPrefixes.length;
1630
- for (i = 0; i < ii; ++i) {
1631
- attr = ngAttrPrefixes[i] + ngAttr;
1632
- if (isString(attr = element.getAttribute(attr))) {
1633
- return attr;
1634
- }
1635
- }
1636
- return null;
1637
- }
1638
-
1639
- function allowAutoBootstrap(document) {
1640
- var script = document.currentScript;
1641
-
1642
- if (!script) {
1643
- // Support: IE 9-11 only
1644
- // IE does not have `document.currentScript`
1645
- return true;
1646
- }
1647
-
1648
- // If the `currentScript` property has been clobbered just return false, since this indicates a probable attack
1649
- if (!(script instanceof window.HTMLScriptElement || script instanceof window.SVGScriptElement)) {
1650
- return false;
1651
- }
1652
-
1653
- var attributes = script.attributes;
1654
- var srcs = [attributes.getNamedItem('src'), attributes.getNamedItem('href'), attributes.getNamedItem('xlink:href')];
1655
-
1656
- return srcs.every(function(src) {
1657
- if (!src) {
1658
- return true;
1659
- }
1660
- if (!src.value) {
1661
- return false;
1662
- }
1663
-
1664
- var link = document.createElement('a');
1665
- link.href = src.value;
1666
-
1667
- if (document.location.origin === link.origin) {
1668
- // Same-origin resources are always allowed, even for non-whitelisted schemes.
1669
- return true;
1670
- }
1671
- // Disabled bootstrapping unless angular.js was loaded from a known scheme used on the web.
1672
- // This is to prevent angular.js bundled with browser extensions from being used to bypass the
1673
- // content security policy in web pages and other browser extensions.
1674
- switch (link.protocol) {
1675
- case 'http:':
1676
- case 'https:':
1677
- case 'ftp:':
1678
- case 'blob:':
1679
- case 'file:':
1680
- case 'data:':
1681
- return true;
1682
- default:
1683
- return false;
1684
- }
1685
- });
1686
- }
1687
-
1688
- // Cached as it has to run during loading so that document.currentScript is available.
1689
- var isAutoBootstrapAllowed = allowAutoBootstrap(window.document);
1690
-
1691
- /**
1692
- * @ngdoc directive
1693
- * @name ngApp
1694
- * @module ng
1695
- *
1696
- * @element ANY
1697
- * @param {angular.Module} ngApp an optional application
1698
- * {@link angular.module module} name to load.
1699
- * @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be
1700
- * created in "strict-di" mode. This means that the application will fail to invoke functions which
1701
- * do not use explicit function annotation (and are thus unsuitable for minification), as described
1702
- * in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in
1703
- * tracking down the root of these bugs.
1704
- *
1705
- * @description
1706
- *
1707
- * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive
1708
- * designates the **root element** of the application and is typically placed near the root element
1709
- * of the page - e.g. on the `<body>` or `<html>` tags.
1710
- *
1711
- * There are a few things to keep in mind when using `ngApp`:
1712
- * - only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp`
1713
- * found in the document will be used to define the root element to auto-bootstrap as an
1714
- * application. To run multiple applications in an HTML document you must manually bootstrap them using
1715
- * {@link angular.bootstrap} instead.
1716
- * - AngularJS applications cannot be nested within each other.
1717
- * - Do not use a directive that uses {@link ng.$compile#transclusion transclusion} on the same element as `ngApp`.
1718
- * This includes directives such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and
1719
- * {@link ngRoute.ngView `ngView`}.
1720
- * Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector},
1721
- * causing animations to stop working and making the injector inaccessible from outside the app.
1722
- *
1723
- * You can specify an **AngularJS module** to be used as the root module for the application. This
1724
- * module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It
1725
- * should contain the application code needed or have dependencies on other modules that will
1726
- * contain the code. See {@link angular.module} for more information.
1727
- *
1728
- * In the example below if the `ngApp` directive were not placed on the `html` element then the
1729
- * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`
1730
- * would not be resolved to `3`.
1731
- *
1732
- * `ngApp` is the easiest, and most common way to bootstrap an application.
1733
- *
1734
- <example module="ngAppDemo" name="ng-app">
1735
- <file name="index.html">
1736
- <div ng-controller="ngAppDemoController">
1737
- I can add: {{a}} + {{b}} = {{ a+b }}
1738
- </div>
1739
- </file>
1740
- <file name="script.js">
1741
- angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) {
1742
- $scope.a = 1;
1743
- $scope.b = 2;
1744
- });
1745
- </file>
1746
- </example>
1747
- *
1748
- * Using `ngStrictDi`, you would see something like this:
1749
- *
1750
- <example ng-app-included="true" name="strict-di">
1751
- <file name="index.html">
1752
- <div ng-app="ngAppStrictDemo" ng-strict-di>
1753
- <div ng-controller="GoodController1">
1754
- I can add: {{a}} + {{b}} = {{ a+b }}
1755
-
1756
- <p>This renders because the controller does not fail to
1757
- instantiate, by using explicit annotation style (see
1758
- script.js for details)
1759
- </p>
1760
- </div>
1761
-
1762
- <div ng-controller="GoodController2">
1763
- Name: <input ng-model="name"><br />
1764
- Hello, {{name}}!
1765
-
1766
- <p>This renders because the controller does not fail to
1767
- instantiate, by using explicit annotation style
1768
- (see script.js for details)
1769
- </p>
1770
- </div>
1771
-
1772
- <div ng-controller="BadController">
1773
- I can add: {{a}} + {{b}} = {{ a+b }}
1774
-
1775
- <p>The controller could not be instantiated, due to relying
1776
- on automatic function annotations (which are disabled in
1777
- strict mode). As such, the content of this section is not
1778
- interpolated, and there should be an error in your web console.
1779
- </p>
1780
- </div>
1781
- </div>
1782
- </file>
1783
- <file name="script.js">
1784
- angular.module('ngAppStrictDemo', [])
1785
- // BadController will fail to instantiate, due to relying on automatic function annotation,
1786
- // rather than an explicit annotation
1787
- .controller('BadController', function($scope) {
1788
- $scope.a = 1;
1789
- $scope.b = 2;
1790
- })
1791
- // Unlike BadController, GoodController1 and GoodController2 will not fail to be instantiated,
1792
- // due to using explicit annotations using the array style and $inject property, respectively.
1793
- .controller('GoodController1', ['$scope', function($scope) {
1794
- $scope.a = 1;
1795
- $scope.b = 2;
1796
- }])
1797
- .controller('GoodController2', GoodController2);
1798
- function GoodController2($scope) {
1799
- $scope.name = 'World';
1800
- }
1801
- GoodController2.$inject = ['$scope'];
1802
- </file>
1803
- <file name="style.css">
1804
- div[ng-controller] {
1805
- margin-bottom: 1em;
1806
- -webkit-border-radius: 4px;
1807
- border-radius: 4px;
1808
- border: 1px solid;
1809
- padding: .5em;
1810
- }
1811
- div[ng-controller^=Good] {
1812
- border-color: #d6e9c6;
1813
- background-color: #dff0d8;
1814
- color: #3c763d;
1815
- }
1816
- div[ng-controller^=Bad] {
1817
- border-color: #ebccd1;
1818
- background-color: #f2dede;
1819
- color: #a94442;
1820
- margin-bottom: 0;
1821
- }
1822
- </file>
1823
- </example>
1824
- */
1825
- function angularInit(element, bootstrap) {
1826
- var appElement,
1827
- module,
1828
- config = {};
1829
-
1830
- // The element `element` has priority over any other element.
1831
- forEach(ngAttrPrefixes, function(prefix) {
1832
- var name = prefix + 'app';
1833
-
1834
- if (!appElement && element.hasAttribute && element.hasAttribute(name)) {
1835
- appElement = element;
1836
- module = element.getAttribute(name);
1837
- }
1838
- });
1839
- forEach(ngAttrPrefixes, function(prefix) {
1840
- var name = prefix + 'app';
1841
- var candidate;
1842
-
1843
- if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) {
1844
- appElement = candidate;
1845
- module = candidate.getAttribute(name);
1846
- }
1847
- });
1848
- if (appElement) {
1849
- if (!isAutoBootstrapAllowed) {
1850
- window.console.error('Angular: disabling automatic bootstrap. <script> protocol indicates ' +
1851
- 'an extension, document.location.href does not match.');
1852
- return;
1853
- }
1854
- config.strictDi = getNgAttribute(appElement, 'strict-di') !== null;
1855
- bootstrap(appElement, module ? [module] : [], config);
1856
- }
1857
- }
1858
-
1859
- /**
1860
- * @ngdoc function
1861
- * @name angular.bootstrap
1862
- * @module ng
1863
- * @description
1864
- * Use this function to manually start up angular application.
1865
- *
1866
- * For more information, see the {@link guide/bootstrap Bootstrap guide}.
1867
- *
1868
- * Angular will detect if it has been loaded into the browser more than once and only allow the
1869
- * first loaded script to be bootstrapped and will report a warning to the browser console for
1870
- * each of the subsequent scripts. This prevents strange results in applications, where otherwise
1871
- * multiple instances of Angular try to work on the DOM.
1872
- *
1873
- * <div class="alert alert-warning">
1874
- * **Note:** Protractor based end-to-end tests cannot use this function to bootstrap manually.
1875
- * They must use {@link ng.directive:ngApp ngApp}.
1876
- * </div>
1877
- *
1878
- * <div class="alert alert-warning">
1879
- * **Note:** Do not bootstrap the app on an element with a directive that uses {@link ng.$compile#transclusion transclusion},
1880
- * such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and {@link ngRoute.ngView `ngView`}.
1881
- * Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector},
1882
- * causing animations to stop working and making the injector inaccessible from outside the app.
1883
- * </div>
1884
- *
1885
- * ```html
1886
- * <!doctype html>
1887
- * <html>
1888
- * <body>
1889
- * <div ng-controller="WelcomeController">
1890
- * {{greeting}}
1891
- * </div>
1892
- *
1893
- * <script src="angular.js"></script>
1894
- * <script>
1895
- * var app = angular.module('demo', [])
1896
- * .controller('WelcomeController', function($scope) {
1897
- * $scope.greeting = 'Welcome!';
1898
- * });
1899
- * angular.bootstrap(document, ['demo']);
1900
- * </script>
1901
- * </body>
1902
- * </html>
1903
- * ```
1904
- *
1905
- * @param {DOMElement} element DOM element which is the root of angular application.
1906
- * @param {Array<String|Function|Array>=} modules an array of modules to load into the application.
1907
- * Each item in the array should be the name of a predefined module or a (DI annotated)
1908
- * function that will be invoked by the injector as a `config` block.
1909
- * See: {@link angular.module modules}
1910
- * @param {Object=} config an object for defining configuration options for the application. The
1911
- * following keys are supported:
1912
- *
1913
- * * `strictDi` - disable automatic function annotation for the application. This is meant to
1914
- * assist in finding bugs which break minified code. Defaults to `false`.
1915
- *
1916
- * @returns {auto.$injector} Returns the newly created injector for this app.
1917
- */
1918
- function bootstrap(element, modules, config) {
1919
- if (!isObject(config)) config = {};
1920
- var defaultConfig = {
1921
- strictDi: false
1922
- };
1923
- config = extend(defaultConfig, config);
1924
- var doBootstrap = function() {
1925
- element = jqLite(element);
1926
-
1927
- if (element.injector()) {
1928
- var tag = (element[0] === window.document) ? 'document' : startingTag(element);
1929
- // Encode angle brackets to prevent input from being sanitized to empty string #8683.
1930
- throw ngMinErr(
1931
- 'btstrpd',
1932
- 'App already bootstrapped with this element \'{0}\'',
1933
- tag.replace(/</,'&lt;').replace(/>/,'&gt;'));
1934
- }
1935
-
1936
- modules = modules || [];
1937
- modules.unshift(['$provide', function($provide) {
1938
- $provide.value('$rootElement', element);
1939
- }]);
1940
-
1941
- if (config.debugInfoEnabled) {
1942
- // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`.
1943
- modules.push(['$compileProvider', function($compileProvider) {
1944
- $compileProvider.debugInfoEnabled(true);
1945
- }]);
1946
- }
1947
-
1948
- modules.unshift('ng');
1949
- var injector = createInjector(modules, config.strictDi);
1950
- injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector',
1951
- function bootstrapApply(scope, element, compile, injector) {
1952
- scope.$apply(function() {
1953
- element.data('$injector', injector);
1954
- compile(element)(scope);
1955
- });
1956
- }]
1957
- );
1958
- return injector;
1959
- };
1960
-
1961
- var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/;
1962
- var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/;
1963
-
1964
- if (window && NG_ENABLE_DEBUG_INFO.test(window.name)) {
1965
- config.debugInfoEnabled = true;
1966
- window.name = window.name.replace(NG_ENABLE_DEBUG_INFO, '');
1967
- }
1968
-
1969
- if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) {
1970
- return doBootstrap();
1971
- }
1972
-
1973
- window.name = window.name.replace(NG_DEFER_BOOTSTRAP, '');
1974
- angular.resumeBootstrap = function(extraModules) {
1975
- forEach(extraModules, function(module) {
1976
- modules.push(module);
1977
- });
1978
- return doBootstrap();
1979
- };
1980
-
1981
- if (isFunction(angular.resumeDeferredBootstrap)) {
1982
- angular.resumeDeferredBootstrap();
1983
- }
1984
- }
1985
-
1986
- /**
1987
- * @ngdoc function
1988
- * @name angular.reloadWithDebugInfo
1989
- * @module ng
1990
- * @description
1991
- * Use this function to reload the current application with debug information turned on.
1992
- * This takes precedence over a call to `$compileProvider.debugInfoEnabled(false)`.
1993
- *
1994
- * See {@link ng.$compileProvider#debugInfoEnabled} for more.
1995
- */
1996
- function reloadWithDebugInfo() {
1997
- window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name;
1998
- window.location.reload();
1999
- }
2000
-
2001
- /**
2002
- * @name angular.getTestability
2003
- * @module ng
2004
- * @description
2005
- * Get the testability service for the instance of Angular on the given
2006
- * element.
2007
- * @param {DOMElement} element DOM element which is the root of angular application.
2008
- */
2009
- function getTestability(rootElement) {
2010
- var injector = angular.element(rootElement).injector();
2011
- if (!injector) {
2012
- throw ngMinErr('test',
2013
- 'no injector found for element argument to getTestability');
2014
- }
2015
- return injector.get('$$testability');
2016
- }
2017
-
2018
- var SNAKE_CASE_REGEXP = /[A-Z]/g;
2019
- function snake_case(name, separator) {
2020
- separator = separator || '_';
2021
- return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {
2022
- return (pos ? separator : '') + letter.toLowerCase();
2023
- });
2024
- }
2025
-
2026
- var bindJQueryFired = false;
2027
- function bindJQuery() {
2028
- var originalCleanData;
2029
-
2030
- if (bindJQueryFired) {
2031
- return;
2032
- }
2033
-
2034
- // bind to jQuery if present;
2035
- var jqName = jq();
2036
- jQuery = isUndefined(jqName) ? window.jQuery : // use jQuery (if present)
2037
- !jqName ? undefined : // use jqLite
2038
- window[jqName]; // use jQuery specified by `ngJq`
2039
-
2040
- // Use jQuery if it exists with proper functionality, otherwise default to us.
2041
- // Angular 1.2+ requires jQuery 1.7+ for on()/off() support.
2042
- // Angular 1.3+ technically requires at least jQuery 2.1+ but it may work with older
2043
- // versions. It will not work for sure with jQuery <1.7, though.
2044
- if (jQuery && jQuery.fn.on) {
2045
- jqLite = jQuery;
2046
- extend(jQuery.fn, {
2047
- scope: JQLitePrototype.scope,
2048
- isolateScope: JQLitePrototype.isolateScope,
2049
- controller: /** @type {?} */ (JQLitePrototype).controller,
2050
- injector: JQLitePrototype.injector,
2051
- inheritedData: JQLitePrototype.inheritedData
2052
- });
2053
-
2054
- // All nodes removed from the DOM via various jQuery APIs like .remove()
2055
- // are passed through jQuery.cleanData. Monkey-patch this method to fire
2056
- // the $destroy event on all removed nodes.
2057
- originalCleanData = jQuery.cleanData;
2058
- jQuery.cleanData = function(elems) {
2059
- var events;
2060
- for (var i = 0, elem; (elem = elems[i]) != null; i++) {
2061
- events = jQuery._data(elem, 'events');
2062
- if (events && events.$destroy) {
2063
- jQuery(elem).triggerHandler('$destroy');
2064
- }
2065
- }
2066
- originalCleanData(elems);
2067
- };
2068
- } else {
2069
- jqLite = JQLite;
2070
- }
2071
-
2072
- angular.element = jqLite;
2073
-
2074
- // Prevent double-proxying.
2075
- bindJQueryFired = true;
2076
- }
2077
-
2078
- /**
2079
- * throw error if the argument is falsy.
2080
- */
2081
- function assertArg(arg, name, reason) {
2082
- if (!arg) {
2083
- throw ngMinErr('areq', 'Argument \'{0}\' is {1}', (name || '?'), (reason || 'required'));
2084
- }
2085
- return arg;
2086
- }
2087
-
2088
- function assertArgFn(arg, name, acceptArrayAnnotation) {
2089
- if (acceptArrayAnnotation && isArray(arg)) {
2090
- arg = arg[arg.length - 1];
2091
- }
2092
-
2093
- assertArg(isFunction(arg), name, 'not a function, got ' +
2094
- (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg));
2095
- return arg;
2096
- }
2097
-
2098
- /**
2099
- * throw error if the name given is hasOwnProperty
2100
- * @param {String} name the name to test
2101
- * @param {String} context the context in which the name is used, such as module or directive
2102
- */
2103
- function assertNotHasOwnProperty(name, context) {
2104
- if (name === 'hasOwnProperty') {
2105
- throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);
2106
- }
2107
- }
2108
-
2109
- /**
2110
- * Return the value accessible from the object by path. Any undefined traversals are ignored
2111
- * @param {Object} obj starting object
2112
- * @param {String} path path to traverse
2113
- * @param {boolean} [bindFnToScope=true]
2114
- * @returns {Object} value as accessible by path
2115
- */
2116
- //TODO(misko): this function needs to be removed
2117
- function getter(obj, path, bindFnToScope) {
2118
- if (!path) return obj;
2119
- var keys = path.split('.');
2120
- var key;
2121
- var lastInstance = obj;
2122
- var len = keys.length;
2123
-
2124
- for (var i = 0; i < len; i++) {
2125
- key = keys[i];
2126
- if (obj) {
2127
- obj = (lastInstance = obj)[key];
2128
- }
2129
- }
2130
- if (!bindFnToScope && isFunction(obj)) {
2131
- return bind(lastInstance, obj);
2132
- }
2133
- return obj;
2134
- }
2135
-
2136
- /**
2137
- * Return the DOM siblings between the first and last node in the given array.
2138
- * @param {Array} array like object
2139
- * @returns {Array} the inputted object or a jqLite collection containing the nodes
2140
- */
2141
- function getBlockNodes(nodes) {
2142
- // TODO(perf): update `nodes` instead of creating a new object?
2143
- var node = nodes[0];
2144
- var endNode = nodes[nodes.length - 1];
2145
- var blockNodes;
2146
-
2147
- for (var i = 1; node !== endNode && (node = node.nextSibling); i++) {
2148
- if (blockNodes || nodes[i] !== node) {
2149
- if (!blockNodes) {
2150
- blockNodes = jqLite(slice.call(nodes, 0, i));
2151
- }
2152
- blockNodes.push(node);
2153
- }
2154
- }
2155
-
2156
- return blockNodes || nodes;
2157
- }
2158
-
2159
-
2160
- /**
2161
- * Creates a new object without a prototype. This object is useful for lookup without having to
2162
- * guard against prototypically inherited properties via hasOwnProperty.
2163
- *
2164
- * Related micro-benchmarks:
2165
- * - http://jsperf.com/object-create2
2166
- * - http://jsperf.com/proto-map-lookup/2
2167
- * - http://jsperf.com/for-in-vs-object-keys2
2168
- *
2169
- * @returns {Object}
2170
- */
2171
- function createMap() {
2172
- return Object.create(null);
2173
- }
2174
-
2175
- function stringify(value) {
2176
- if (value == null) { // null || undefined
2177
- return '';
2178
- }
2179
- switch (typeof value) {
2180
- case 'string':
2181
- break;
2182
- case 'number':
2183
- value = '' + value;
2184
- break;
2185
- default:
2186
- if (hasCustomToString(value) && !isArray(value) && !isDate(value)) {
2187
- value = value.toString();
2188
- } else {
2189
- value = toJson(value);
2190
- }
2191
- }
2192
-
2193
- return value;
2194
- }
2195
-
2196
- var NODE_TYPE_ELEMENT = 1;
2197
- var NODE_TYPE_ATTRIBUTE = 2;
2198
- var NODE_TYPE_TEXT = 3;
2199
- var NODE_TYPE_COMMENT = 8;
2200
- var NODE_TYPE_DOCUMENT = 9;
2201
- var NODE_TYPE_DOCUMENT_FRAGMENT = 11;
2202
-
2203
- /**
2204
- * @ngdoc type
2205
- * @name angular.Module
2206
- * @module ng
2207
- * @description
2208
- *
2209
- * Interface for configuring angular {@link angular.module modules}.
2210
- */
2211
-
2212
- function setupModuleLoader(window) {
2213
-
2214
- var $injectorMinErr = minErr('$injector');
2215
- var ngMinErr = minErr('ng');
2216
-
2217
- function ensure(obj, name, factory) {
2218
- return obj[name] || (obj[name] = factory());
2219
- }
2220
-
2221
- var angular = ensure(window, 'angular', Object);
2222
-
2223
- // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap
2224
- angular.$$minErr = angular.$$minErr || minErr;
2225
-
2226
- return ensure(angular, 'module', function() {
2227
- /** @type {Object.<string, angular.Module>} */
2228
- var modules = {};
2229
-
2230
- /**
2231
- * @ngdoc function
2232
- * @name angular.module
2233
- * @module ng
2234
- * @description
2235
- *
2236
- * The `angular.module` is a global place for creating, registering and retrieving Angular
2237
- * modules.
2238
- * All modules (angular core or 3rd party) that should be available to an application must be
2239
- * registered using this mechanism.
2240
- *
2241
- * Passing one argument retrieves an existing {@link angular.Module},
2242
- * whereas passing more than one argument creates a new {@link angular.Module}
2243
- *
2244
- *
2245
- * # Module
2246
- *
2247
- * A module is a collection of services, directives, controllers, filters, and configuration information.
2248
- * `angular.module` is used to configure the {@link auto.$injector $injector}.
2249
- *
2250
- * ```js
2251
- * // Create a new module
2252
- * var myModule = angular.module('myModule', []);
2253
- *
2254
- * // register a new service
2255
- * myModule.value('appName', 'MyCoolApp');
2256
- *
2257
- * // configure existing services inside initialization blocks.
2258
- * myModule.config(['$locationProvider', function($locationProvider) {
2259
- * // Configure existing providers
2260
- * $locationProvider.hashPrefix('!');
2261
- * }]);
2262
- * ```
2263
- *
2264
- * Then you can create an injector and load your modules like this:
2265
- *
2266
- * ```js
2267
- * var injector = angular.injector(['ng', 'myModule'])
2268
- * ```
2269
- *
2270
- * However it's more likely that you'll just use
2271
- * {@link ng.directive:ngApp ngApp} or
2272
- * {@link angular.bootstrap} to simplify this process for you.
2273
- *
2274
- * @param {!string} name The name of the module to create or retrieve.
2275
- * @param {!Array.<string>=} requires If specified then new module is being created. If
2276
- * unspecified then the module is being retrieved for further configuration.
2277
- * @param {Function=} configFn Optional configuration function for the module. Same as
2278
- * {@link angular.Module#config Module#config()}.
2279
- * @returns {angular.Module} new module with the {@link angular.Module} api.
2280
- */
2281
- return function module(name, requires, configFn) {
2282
-
2283
- var info = {};
2284
-
2285
- var assertNotHasOwnProperty = function(name, context) {
2286
- if (name === 'hasOwnProperty') {
2287
- throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);
2288
- }
2289
- };
2290
-
2291
- assertNotHasOwnProperty(name, 'module');
2292
- if (requires && modules.hasOwnProperty(name)) {
2293
- modules[name] = null;
2294
- }
2295
- return ensure(modules, name, function() {
2296
- if (!requires) {
2297
- throw $injectorMinErr('nomod', 'Module \'{0}\' is not available! You either misspelled ' +
2298
- 'the module name or forgot to load it. If registering a module ensure that you ' +
2299
- 'specify the dependencies as the second argument.', name);
2300
- }
2301
-
2302
- /** @type {!Array.<Array.<*>>} */
2303
- var invokeQueue = [];
2304
-
2305
- /** @type {!Array.<Function>} */
2306
- var configBlocks = [];
2307
-
2308
- /** @type {!Array.<Function>} */
2309
- var runBlocks = [];
2310
-
2311
- var config = invokeLater('$injector', 'invoke', 'push', configBlocks);
2312
-
2313
- /** @type {angular.Module} */
2314
- var moduleInstance = {
2315
- // Private state
2316
- _invokeQueue: invokeQueue,
2317
- _configBlocks: configBlocks,
2318
- _runBlocks: runBlocks,
2319
-
2320
- /**
2321
- * @ngdoc method
2322
- * @name angular.Module#info
2323
- * @module ng
2324
- *
2325
- * @param {Object=} info Information about the module
2326
- * @returns {Object|Module} The current info object for this module if called as a getter,
2327
- * or `this` if called as a setter.
2328
- *
2329
- * @description
2330
- * Read and write custom information about this module.
2331
- * For example you could put the version of the module in here.
2332
- *
2333
- * ```js
2334
- * angular.module('myModule', []).info({ version: '1.0.0' });
2335
- * ```
2336
- *
2337
- * The version could then be read back out by accessing the module elsewhere:
2338
- *
2339
- * ```
2340
- * var version = angular.module('myModule').info().version;
2341
- * ```
2342
- *
2343
- * You can also retrieve this information during runtime via the
2344
- * {@link $injector#modules `$injector.modules`} property:
2345
- *
2346
- * ```js
2347
- * var version = $injector.modules['myModule'].info().version;
2348
- * ```
2349
- */
2350
- info: function(value) {
2351
- if (isDefined(value)) {
2352
- if (!isObject(value)) throw ngMinErr('aobj', 'Argument \'{0}\' must be an object', 'value');
2353
- info = value;
2354
- return this;
2355
- }
2356
- return info;
2357
- },
2358
-
2359
- /**
2360
- * @ngdoc property
2361
- * @name angular.Module#requires
2362
- * @module ng
2363
- *
2364
- * @description
2365
- * Holds the list of modules which the injector will load before the current module is
2366
- * loaded.
2367
- */
2368
- requires: requires,
2369
-
2370
- /**
2371
- * @ngdoc property
2372
- * @name angular.Module#name
2373
- * @module ng
2374
- *
2375
- * @description
2376
- * Name of the module.
2377
- */
2378
- name: name,
2379
-
2380
-
2381
- /**
2382
- * @ngdoc method
2383
- * @name angular.Module#provider
2384
- * @module ng
2385
- * @param {string} name service name
2386
- * @param {Function} providerType Construction function for creating new instance of the
2387
- * service.
2388
- * @description
2389
- * See {@link auto.$provide#provider $provide.provider()}.
2390
- */
2391
- provider: invokeLaterAndSetModuleName('$provide', 'provider'),
2392
-
2393
- /**
2394
- * @ngdoc method
2395
- * @name angular.Module#factory
2396
- * @module ng
2397
- * @param {string} name service name
2398
- * @param {Function} providerFunction Function for creating new instance of the service.
2399
- * @description
2400
- * See {@link auto.$provide#factory $provide.factory()}.
2401
- */
2402
- factory: invokeLaterAndSetModuleName('$provide', 'factory'),
2403
-
2404
- /**
2405
- * @ngdoc method
2406
- * @name angular.Module#service
2407
- * @module ng
2408
- * @param {string} name service name
2409
- * @param {Function} constructor A constructor function that will be instantiated.
2410
- * @description
2411
- * See {@link auto.$provide#service $provide.service()}.
2412
- */
2413
- service: invokeLaterAndSetModuleName('$provide', 'service'),
2414
-
2415
- /**
2416
- * @ngdoc method
2417
- * @name angular.Module#value
2418
- * @module ng
2419
- * @param {string} name service name
2420
- * @param {*} object Service instance object.
2421
- * @description
2422
- * See {@link auto.$provide#value $provide.value()}.
2423
- */
2424
- value: invokeLater('$provide', 'value'),
2425
-
2426
- /**
2427
- * @ngdoc method
2428
- * @name angular.Module#constant
2429
- * @module ng
2430
- * @param {string} name constant name
2431
- * @param {*} object Constant value.
2432
- * @description
2433
- * Because the constants are fixed, they get applied before other provide methods.
2434
- * See {@link auto.$provide#constant $provide.constant()}.
2435
- */
2436
- constant: invokeLater('$provide', 'constant', 'unshift'),
2437
-
2438
- /**
2439
- * @ngdoc method
2440
- * @name angular.Module#decorator
2441
- * @module ng
2442
- * @param {string} name The name of the service to decorate.
2443
- * @param {Function} decorFn This function will be invoked when the service needs to be
2444
- * instantiated and should return the decorated service instance.
2445
- * @description
2446
- * See {@link auto.$provide#decorator $provide.decorator()}.
2447
- */
2448
- decorator: invokeLaterAndSetModuleName('$provide', 'decorator', configBlocks),
2449
-
2450
- /**
2451
- * @ngdoc method
2452
- * @name angular.Module#animation
2453
- * @module ng
2454
- * @param {string} name animation name
2455
- * @param {Function} animationFactory Factory function for creating new instance of an
2456
- * animation.
2457
- * @description
2458
- *
2459
- * **NOTE**: animations take effect only if the **ngAnimate** module is loaded.
2460
- *
2461
- *
2462
- * Defines an animation hook that can be later used with
2463
- * {@link $animate $animate} service and directives that use this service.
2464
- *
2465
- * ```js
2466
- * module.animation('.animation-name', function($inject1, $inject2) {
2467
- * return {
2468
- * eventName : function(element, done) {
2469
- * //code to run the animation
2470
- * //once complete, then run done()
2471
- * return function cancellationFunction(element) {
2472
- * //code to cancel the animation
2473
- * }
2474
- * }
2475
- * }
2476
- * })
2477
- * ```
2478
- *
2479
- * See {@link ng.$animateProvider#register $animateProvider.register()} and
2480
- * {@link ngAnimate ngAnimate module} for more information.
2481
- */
2482
- animation: invokeLaterAndSetModuleName('$animateProvider', 'register'),
2483
-
2484
- /**
2485
- * @ngdoc method
2486
- * @name angular.Module#filter
2487
- * @module ng
2488
- * @param {string} name Filter name - this must be a valid angular expression identifier
2489
- * @param {Function} filterFactory Factory function for creating new instance of filter.
2490
- * @description
2491
- * See {@link ng.$filterProvider#register $filterProvider.register()}.
2492
- *
2493
- * <div class="alert alert-warning">
2494
- * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`.
2495
- * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace
2496
- * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores
2497
- * (`myapp_subsection_filterx`).
2498
- * </div>
2499
- */
2500
- filter: invokeLaterAndSetModuleName('$filterProvider', 'register'),
2501
-
2502
- /**
2503
- * @ngdoc method
2504
- * @name angular.Module#controller
2505
- * @module ng
2506
- * @param {string|Object} name Controller name, or an object map of controllers where the
2507
- * keys are the names and the values are the constructors.
2508
- * @param {Function} constructor Controller constructor function.
2509
- * @description
2510
- * See {@link ng.$controllerProvider#register $controllerProvider.register()}.
2511
- */
2512
- controller: invokeLaterAndSetModuleName('$controllerProvider', 'register'),
2513
-
2514
- /**
2515
- * @ngdoc method
2516
- * @name angular.Module#directive
2517
- * @module ng
2518
- * @param {string|Object} name Directive name, or an object map of directives where the
2519
- * keys are the names and the values are the factories.
2520
- * @param {Function} directiveFactory Factory function for creating new instance of
2521
- * directives.
2522
- * @description
2523
- * See {@link ng.$compileProvider#directive $compileProvider.directive()}.
2524
- */
2525
- directive: invokeLaterAndSetModuleName('$compileProvider', 'directive'),
2526
-
2527
- /**
2528
- * @ngdoc method
2529
- * @name angular.Module#component
2530
- * @module ng
2531
- * @param {string} name Name of the component in camel-case (i.e. myComp which will match as my-comp)
2532
- * @param {Object} options Component definition object (a simplified
2533
- * {@link ng.$compile#directive-definition-object directive definition object})
2534
- *
2535
- * @description
2536
- * See {@link ng.$compileProvider#component $compileProvider.component()}.
2537
- */
2538
- component: invokeLaterAndSetModuleName('$compileProvider', 'component'),
2539
-
2540
- /**
2541
- * @ngdoc method
2542
- * @name angular.Module#config
2543
- * @module ng
2544
- * @param {Function} configFn Execute this function on module load. Useful for service
2545
- * configuration.
2546
- * @description
2547
- * Use this method to register work which needs to be performed on module loading.
2548
- * For more about how to configure services, see
2549
- * {@link providers#provider-recipe Provider Recipe}.
2550
- */
2551
- config: config,
2552
-
2553
- /**
2554
- * @ngdoc method
2555
- * @name angular.Module#run
2556
- * @module ng
2557
- * @param {Function} initializationFn Execute this function after injector creation.
2558
- * Useful for application initialization.
2559
- * @description
2560
- * Use this method to register work which should be performed when the injector is done
2561
- * loading all modules.
2562
- */
2563
- run: function(block) {
2564
- runBlocks.push(block);
2565
- return this;
2566
- }
2567
- };
2568
-
2569
- if (configFn) {
2570
- config(configFn);
2571
- }
2572
-
2573
- return moduleInstance;
2574
-
2575
- /**
2576
- * @param {string} provider
2577
- * @param {string} method
2578
- * @param {String=} insertMethod
2579
- * @returns {angular.Module}
2580
- */
2581
- function invokeLater(provider, method, insertMethod, queue) {
2582
- if (!queue) queue = invokeQueue;
2583
- return function() {
2584
- queue[insertMethod || 'push']([provider, method, arguments]);
2585
- return moduleInstance;
2586
- };
2587
- }
2588
-
2589
- /**
2590
- * @param {string} provider
2591
- * @param {string} method
2592
- * @returns {angular.Module}
2593
- */
2594
- function invokeLaterAndSetModuleName(provider, method, queue) {
2595
- if (!queue) queue = invokeQueue;
2596
- return function(recipeName, factoryFunction) {
2597
- if (factoryFunction && isFunction(factoryFunction)) factoryFunction.$$moduleName = name;
2598
- queue.push([provider, method, arguments]);
2599
- return moduleInstance;
2600
- };
2601
- }
2602
- });
2603
- };
2604
- });
2605
-
2606
- }
2607
-
2608
- /* global shallowCopy: true */
2609
-
2610
- /**
2611
- * Creates a shallow copy of an object, an array or a primitive.
2612
- *
2613
- * Assumes that there are no proto properties for objects.
2614
- */
2615
- function shallowCopy(src, dst) {
2616
- if (isArray(src)) {
2617
- dst = dst || [];
2618
-
2619
- for (var i = 0, ii = src.length; i < ii; i++) {
2620
- dst[i] = src[i];
2621
- }
2622
- } else if (isObject(src)) {
2623
- dst = dst || {};
2624
-
2625
- for (var key in src) {
2626
- if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {
2627
- dst[key] = src[key];
2628
- }
2629
- }
2630
- }
2631
-
2632
- return dst || src;
2633
- }
2634
-
2635
- /* exported toDebugString */
2636
-
2637
- function serializeObject(obj, maxDepth) {
2638
- var seen = [];
2639
-
2640
- // There is no direct way to stringify object until reaching a specific depth
2641
- // and a very deep object can cause a performance issue, so we copy the object
2642
- // based on this specific depth and then stringify it.
2643
- if (isValidObjectMaxDepth(maxDepth)) {
2644
- // This file is also included in `angular-loader`, so `copy()` might not always be available in
2645
- // the closure. Therefore, it is lazily retrieved as `angular.copy()` when needed.
2646
- obj = angular.copy(obj, null, maxDepth);
2647
- }
2648
- return JSON.stringify(obj, function(key, val) {
2649
- val = toJsonReplacer(key, val);
2650
- if (isObject(val)) {
2651
-
2652
- if (seen.indexOf(val) >= 0) return '...';
2653
-
2654
- seen.push(val);
2655
- }
2656
- return val;
2657
- });
2658
- }
2659
-
2660
- function toDebugString(obj, maxDepth) {
2661
- if (typeof obj === 'function') {
2662
- return obj.toString().replace(/ \{[\s\S]*$/, '');
2663
- } else if (isUndefined(obj)) {
2664
- return 'undefined';
2665
- } else if (typeof obj !== 'string') {
2666
- return serializeObject(obj, maxDepth);
2667
- }
2668
- return obj;
2669
- }
2670
-
2671
- /* global angularModule: true,
2672
- version: true,
2673
-
2674
- $CompileProvider,
2675
-
2676
- htmlAnchorDirective,
2677
- inputDirective,
2678
- inputDirective,
2679
- formDirective,
2680
- scriptDirective,
2681
- selectDirective,
2682
- optionDirective,
2683
- ngBindDirective,
2684
- ngBindHtmlDirective,
2685
- ngBindTemplateDirective,
2686
- ngClassDirective,
2687
- ngClassEvenDirective,
2688
- ngClassOddDirective,
2689
- ngCloakDirective,
2690
- ngControllerDirective,
2691
- ngFormDirective,
2692
- ngHideDirective,
2693
- ngIfDirective,
2694
- ngIncludeDirective,
2695
- ngIncludeFillContentDirective,
2696
- ngInitDirective,
2697
- ngNonBindableDirective,
2698
- ngPluralizeDirective,
2699
- ngRepeatDirective,
2700
- ngShowDirective,
2701
- ngStyleDirective,
2702
- ngSwitchDirective,
2703
- ngSwitchWhenDirective,
2704
- ngSwitchDefaultDirective,
2705
- ngOptionsDirective,
2706
- ngTranscludeDirective,
2707
- ngModelDirective,
2708
- ngListDirective,
2709
- ngChangeDirective,
2710
- patternDirective,
2711
- patternDirective,
2712
- requiredDirective,
2713
- requiredDirective,
2714
- minlengthDirective,
2715
- minlengthDirective,
2716
- maxlengthDirective,
2717
- maxlengthDirective,
2718
- ngValueDirective,
2719
- ngModelOptionsDirective,
2720
- ngAttributeAliasDirectives,
2721
- ngEventDirectives,
2722
-
2723
- $AnchorScrollProvider,
2724
- $AnimateProvider,
2725
- $CoreAnimateCssProvider,
2726
- $$CoreAnimateJsProvider,
2727
- $$CoreAnimateQueueProvider,
2728
- $$AnimateRunnerFactoryProvider,
2729
- $$AnimateAsyncRunFactoryProvider,
2730
- $BrowserProvider,
2731
- $CacheFactoryProvider,
2732
- $ControllerProvider,
2733
- $DateProvider,
2734
- $DocumentProvider,
2735
- $$IsDocumentHiddenProvider,
2736
- $ExceptionHandlerProvider,
2737
- $FilterProvider,
2738
- $$ForceReflowProvider,
2739
- $InterpolateProvider,
2740
- $IntervalProvider,
2741
- $HttpProvider,
2742
- $HttpParamSerializerProvider,
2743
- $HttpParamSerializerJQLikeProvider,
2744
- $HttpBackendProvider,
2745
- $xhrFactoryProvider,
2746
- $jsonpCallbacksProvider,
2747
- $LocationProvider,
2748
- $LogProvider,
2749
- $$MapProvider,
2750
- $ParseProvider,
2751
- $RootScopeProvider,
2752
- $QProvider,
2753
- $$QProvider,
2754
- $$SanitizeUriProvider,
2755
- $SceProvider,
2756
- $SceDelegateProvider,
2757
- $SnifferProvider,
2758
- $TemplateCacheProvider,
2759
- $TemplateRequestProvider,
2760
- $$TestabilityProvider,
2761
- $TimeoutProvider,
2762
- $$RAFProvider,
2763
- $WindowProvider,
2764
- $$jqLiteProvider,
2765
- $$CookieReaderProvider
2766
- */
2767
-
2768
-
2769
- /**
2770
- * @ngdoc object
2771
- * @name angular.version
2772
- * @module ng
2773
- * @description
2774
- * An object that contains information about the current AngularJS version.
2775
- *
2776
- * This object has the following properties:
2777
- *
2778
- * - `full` – `{string}` – Full version string, such as "0.9.18".
2779
- * - `major` – `{number}` – Major version number, such as "0".
2780
- * - `minor` – `{number}` – Minor version number, such as "9".
2781
- * - `dot` – `{number}` – Dot version number, such as "18".
2782
- * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
2783
- */
2784
- var version = {
2785
- // These placeholder strings will be replaced by grunt's `build` task.
2786
- // They need to be double- or single-quoted.
2787
- full: '1.6.6',
2788
- major: 1,
2789
- minor: 6,
2790
- dot: 6,
2791
- codeName: 'interdimensional-cable'
2792
- };
2793
-
2794
-
2795
- function publishExternalAPI(angular) {
2796
- extend(angular, {
2797
- 'errorHandlingConfig': errorHandlingConfig,
2798
- 'bootstrap': bootstrap,
2799
- 'copy': copy,
2800
- 'extend': extend,
2801
- 'merge': merge,
2802
- 'equals': equals,
2803
- 'element': jqLite,
2804
- 'forEach': forEach,
2805
- 'injector': createInjector,
2806
- 'noop': noop,
2807
- 'bind': bind,
2808
- 'toJson': toJson,
2809
- 'fromJson': fromJson,
2810
- 'identity': identity,
2811
- 'isUndefined': isUndefined,
2812
- 'isDefined': isDefined,
2813
- 'isString': isString,
2814
- 'isFunction': isFunction,
2815
- 'isObject': isObject,
2816
- 'isNumber': isNumber,
2817
- 'isElement': isElement,
2818
- 'isArray': isArray,
2819
- 'version': version,
2820
- 'isDate': isDate,
2821
- 'lowercase': lowercase,
2822
- 'uppercase': uppercase,
2823
- 'callbacks': {$$counter: 0},
2824
- 'getTestability': getTestability,
2825
- 'reloadWithDebugInfo': reloadWithDebugInfo,
2826
- '$$minErr': minErr,
2827
- '$$csp': csp,
2828
- '$$encodeUriSegment': encodeUriSegment,
2829
- '$$encodeUriQuery': encodeUriQuery,
2830
- '$$stringify': stringify
2831
- });
2832
-
2833
- angularModule = setupModuleLoader(window);
2834
-
2835
- angularModule('ng', ['ngLocale'], ['$provide',
2836
- function ngModule($provide) {
2837
- // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it.
2838
- $provide.provider({
2839
- $$sanitizeUri: $$SanitizeUriProvider
2840
- });
2841
- $provide.provider('$compile', $CompileProvider).
2842
- directive({
2843
- a: htmlAnchorDirective,
2844
- input: inputDirective,
2845
- textarea: inputDirective,
2846
- form: formDirective,
2847
- script: scriptDirective,
2848
- select: selectDirective,
2849
- option: optionDirective,
2850
- ngBind: