All-in-One Event Calendar - Version 2.0.7

Version Description

Download this release

Release Info

Developer jbutkus
Plugin Icon 128x128 All-in-One Event Calendar
Version 2.0.7
Comparing to
See all releases

Code changes from version 2.0.6 to 2.0.7

Files changed (56) hide show
  1. all-in-one-event-calendar.php +1 -1
  2. app/config/constants.php +2 -2
  3. app/controller/extension-license.php +7 -7
  4. app/controller/extension.php +22 -1
  5. app/controller/front.php +36 -14
  6. app/controller/javascript.php +6 -1
  7. app/controller/shutdown.php +6 -0
  8. app/model/event.php +1 -1
  9. app/model/event/creating.php +42 -0
  10. app/model/event/entity.php +4 -1
  11. app/model/event/instance.php +2 -2
  12. app/model/event/parent.php +223 -0
  13. app/model/event/trashing.php +57 -24
  14. app/model/search.php +1 -1
  15. app/view/admin/add-new-event.php +30 -2
  16. app/view/admin/settings.php +8 -1
  17. app/view/event/content.php +2 -2
  18. app/view/event/single.php +2 -1
  19. language/all-in-one-event-calendar.mo +0 -0
  20. language/all-in-one-event-calendar.po +62 -329
  21. language/all-in-one-event-calendar.pot +58 -308
  22. lib/bootstrap/loader-map.php +39 -383
  23. lib/calendar-feed/ics.php +2 -2
  24. lib/command/clone.php +2 -1
  25. lib/command/disable-gzip.php +46 -0
  26. lib/command/export-events.php +1 -1
  27. lib/command/resolver.php +5 -0
  28. lib/command/save-settings.php +3 -6
  29. lib/css/frontend.php +1 -1
  30. lib/database/datetime-migration.php +4 -4
  31. lib/dbi/dbi.php +15 -12
  32. lib/html/element/setting/calendar-page-selector.php +15 -12
  33. lib/http/request.php +21 -3
  34. lib/http/response/helper.php +0 -32
  35. lib/iCal/{iCalcreator-2.16 → iCalcreator-2.20}/iCalcreator.class.php +1786 -1598
  36. lib/iCal/{iCalcreator-2.16 → iCalcreator-2.20}/lgpl.txt +0 -0
  37. lib/import-export/ics.php +12 -15
  38. lib/notification/admin.php +1 -8
  39. lib/robots/helper.php +12 -0
  40. lib/routing/router.php +32 -0
  41. public/admin/box_event_children.php +5 -5
  42. public/admin/box_support.php +53 -22
  43. public/admin/box_time_and_date.php +9 -3
  44. public/admin/css/add_new_event.css +22 -0
  45. public/admin/css/bootstrap.min.css +9 -9
  46. public/admin/css/settings.css +15 -9
  47. public/admin/img/timely-logo.png +0 -0
  48. public/admin/less/timely-variables.less +1 -0
  49. public/admin/twig/bootstrap_tabs.twig +1 -0
  50. public/admin/twig/setting/calendar-page-selector.twig +4 -0
  51. public/js/pages/add_new_event.js +1 -1
  52. public/js/pages/calendar.js +1 -1
  53. public/js/pages/common_backend.js +1 -1
  54. public/js/scripts/add_new_event.js +1 -1
  55. public/js/scripts/add_new_event/event_date_time/date_time_event_handlers.js +1 -1
  56. public/js/scripts/calendar.js +1 -1
all-in-one-event-calendar.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: A calendar system with month, week, day, agenda views, upcoming events widget, color-coded categories, recurrence, and import/export of .ics feeds.
6
  * Author: Time.ly Network Inc.
7
  * Author URI: http://time.ly/
8
- * Version: 2.0.6
9
  * Text Domain: all-in-one-event-calendar
10
  * Domain Path: /language
11
  */
5
  * Description: A calendar system with month, week, day, agenda views, upcoming events widget, color-coded categories, recurrence, and import/export of .ics feeds.
6
  * Author: Time.ly Network Inc.
7
  * Author URI: http://time.ly/
8
+ * Version: 2.0.7
9
  * Text Domain: all-in-one-event-calendar
10
  * Domain Path: /language
11
  */
app/config/constants.php CHANGED
@@ -50,14 +50,14 @@ function ai1ec_initiate_constants( $ai1ec_base_dir, $ai1ec_base_url ) {
50
  // = Plugin Version =
51
  // ==================
52
  if ( ! defined( 'AI1EC_VERSION' ) ) {
53
- define( 'AI1EC_VERSION', '2.0.6' );
54
  }
55
 
56
  // ================
57
  // = RSS FEED URL =
58
  // ================
59
  if ( ! defined( 'AI1EC_RSS_FEED' ) ) {
60
- define( 'AI1EC_RSS_FEED', 'http://time.ly/feed/' );
61
  }
62
 
63
  // =================
50
  // = Plugin Version =
51
  // ==================
52
  if ( ! defined( 'AI1EC_VERSION' ) ) {
53
+ define( 'AI1EC_VERSION', '2.0.7' );
54
  }
55
 
56
  // ================
57
  // = RSS FEED URL =
58
  // ================
59
  if ( ! defined( 'AI1EC_RSS_FEED' ) ) {
60
+ define( 'AI1EC_RSS_FEED', 'http://time.ly/blog/feed/' );
61
  }
62
 
63
  // =================
app/controller/extension-license.php CHANGED
@@ -72,8 +72,8 @@ abstract class Ai1ec_Base_License_Controller extends Ai1ec_Base_Extension_Contro
72
  public function check_licence( array $old_options, array $new_options ) {
73
  $old_licence = $old_options[$this->_licence]['value'];
74
  $new_licence = $new_options[$this->_licence]['value'];
75
-
76
- if ( $new_licence !== $old_licence && ! empty( $new_licence ) ) {
77
  $license = trim( $new_licence );
78
  // data to send in our API request
79
  $api_params = array(
@@ -82,23 +82,23 @@ abstract class Ai1ec_Base_License_Controller extends Ai1ec_Base_Extension_Contro
82
  'item_name' => urlencode( $this->get_name() ),// the name of our product in EDD,
83
  'url' => home_url()
84
  );
85
-
86
  // Call the custom API.
87
  $response = wp_remote_get( add_query_arg( $api_params, $this->_store ) );
88
-
89
  // make sure the response came back okay
90
  if ( is_wp_error( $response ) ) {
91
  return false;
92
  }
93
-
94
  // decode the license data
95
  $license_data = json_decode( wp_remote_retrieve_body( $response ) );
96
  // $license_data->license will be either "active" or "inactive"
97
-
98
  $this->_registry->get( 'model.settings' )
99
  ->set( $this->_licence_status, $license_data->license );
100
-
101
  }
 
102
  }
103
 
104
  /**
72
  public function check_licence( array $old_options, array $new_options ) {
73
  $old_licence = $old_options[$this->_licence]['value'];
74
  $new_licence = $new_options[$this->_licence]['value'];
75
+ $status = $old_options[$this->_licence_status]['value'];
76
+ if ( 'inactive' === $status || $new_licence !== $old_licence ) {
77
  $license = trim( $new_licence );
78
  // data to send in our API request
79
  $api_params = array(
82
  'item_name' => urlencode( $this->get_name() ),// the name of our product in EDD,
83
  'url' => home_url()
84
  );
85
+
86
  // Call the custom API.
87
  $response = wp_remote_get( add_query_arg( $api_params, $this->_store ) );
88
+
89
  // make sure the response came back okay
90
  if ( is_wp_error( $response ) ) {
91
  return false;
92
  }
93
+
94
  // decode the license data
95
  $license_data = json_decode( wp_remote_retrieve_body( $response ) );
96
  // $license_data->license will be either "active" or "inactive"
97
+
98
  $this->_registry->get( 'model.settings' )
99
  ->set( $this->_licence_status, $license_data->license );
 
100
  }
101
+
102
  }
103
 
104
  /**
app/controller/extension.php CHANGED
@@ -10,7 +10,7 @@
10
  * @subpackage AI1EC.Controller
11
  */
12
  abstract class Ai1ec_Base_Extension_Controller {
13
-
14
  /**
15
  * @var Ai1ec_Registry_Object
16
  */
@@ -70,6 +70,27 @@ abstract class Ai1ec_Base_Extension_Controller {
70
  Ai1ec_Event_Dispatcher $dispatcher
71
  );
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  /**
74
  * Removes options when uninstalling the plugin.
75
  */
10
  * @subpackage AI1EC.Controller
11
  */
12
  abstract class Ai1ec_Base_Extension_Controller {
13
+
14
  /**
15
  * @var Ai1ec_Registry_Object
16
  */
70
  Ai1ec_Event_Dispatcher $dispatcher
71
  );
72
 
73
+ /**
74
+ * Perform the basic compatibility check.
75
+ *
76
+ * @param string $ai1ec_version
77
+ *
78
+ * @return boolean
79
+ */
80
+ public function check_compatibility( $ai1ec_version ) {
81
+ return version_compare(
82
+ $ai1ec_version,
83
+ $this->minimum_core_required(),
84
+ '>='
85
+ );
86
+ }
87
+
88
+ /**
89
+ * @return string
90
+ */
91
+ public function minimum_core_required() {
92
+ return '2.0.7';
93
+ }
94
  /**
95
  * Removes options when uninstalling the plugin.
96
  */
app/controller/front.php CHANGED
@@ -241,16 +241,16 @@ class Ai1ec_Front_Controller {
241
  $option = $this->_registry->get( 'model.option' );
242
  $theme = $option->get( 'ai1ec_current_theme', array() );
243
  $update = false;
244
-
 
 
 
 
 
 
245
  // Theme setting is undefined; default to Vortex.
246
  if ( empty( $theme ) ) {
247
- $theme = array(
248
- 'theme_dir' => AI1EC_DEFAULT_THEME_PATH,
249
- 'theme_root' => AI1EC_DEFAULT_THEME_ROOT,
250
- 'theme_url' => AI1EC_THEMES_URL . '/' . AI1EC_DEFAULT_THEME_NAME,
251
- 'stylesheet' => AI1EC_DEFAULT_THEME_NAME,
252
- 'legacy' => false,
253
- );
254
  $update = true;
255
  }
256
  // Legacy settings; in 1.x the active theme was stored as a bare string,
@@ -273,8 +273,8 @@ class Ai1ec_Front_Controller {
273
  // It's missing; something is wrong with this theme. Reset theme to
274
  // Vortex and warn the user accordingly.
275
  $option->set( 'ai1ec_current_theme', $default_theme );
276
-
277
- $notification = $this->_registry->get( 'notification.admin',
278
  sprintf(
279
  Ai1ec_I18n::__(
280
  'Your active calendar theme could not be properly initialized. The default theme has been activated instead. Please visit %s and try reactivating your theme manually.'
@@ -396,6 +396,26 @@ class Ai1ec_Front_Controller {
396
  2
397
  );
398
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
  // Category colors
400
  $dispatcher->register_action(
401
  'events_categories_add_form_fields',
@@ -558,10 +578,12 @@ class Ai1ec_Front_Controller {
558
  'plugin_action_links_' . AI1EC_PLUGIN_BASENAME,
559
  array( 'view.admin.nav', 'plugin_action_links' )
560
  );
561
- $dispatcher->register_action(
562
- 'admin_init',
563
- array( 'robots.helper', 'install' )
564
- );
 
 
565
  $dispatcher->register_action(
566
  'wp_ajax_ai1ec_rescan_cache',
567
  array( 'twig.cache', 'rescan' )
241
  $option = $this->_registry->get( 'model.option' );
242
  $theme = $option->get( 'ai1ec_current_theme', array() );
243
  $update = false;
244
+ $default_theme = array(
245
+ 'theme_dir' => AI1EC_DEFAULT_THEME_PATH,
246
+ 'theme_root' => AI1EC_DEFAULT_THEME_ROOT,
247
+ 'theme_url' => AI1EC_THEMES_URL . '/' . AI1EC_DEFAULT_THEME_NAME,
248
+ 'stylesheet' => AI1EC_DEFAULT_THEME_NAME,
249
+ 'legacy' => false,
250
+ );
251
  // Theme setting is undefined; default to Vortex.
252
  if ( empty( $theme ) ) {
253
+ $theme = $default_theme;
 
 
 
 
 
 
254
  $update = true;
255
  }
256
  // Legacy settings; in 1.x the active theme was stored as a bare string,
273
  // It's missing; something is wrong with this theme. Reset theme to
274
  // Vortex and warn the user accordingly.
275
  $option->set( 'ai1ec_current_theme', $default_theme );
276
+ $notification = $this->_registry->get( 'notification.admin' );
277
+ $notification->store(
278
  sprintf(
279
  Ai1ec_I18n::__(
280
  'Your active calendar theme could not be properly initialized. The default theme has been activated instead. Please visit %s and try reactivating your theme manually.'
396
  2
397
  );
398
 
399
+ $dispatcher->register_filter(
400
+ 'ai1ec_dbi_debug',
401
+ array( 'http.request', 'debug_filter' )
402
+ );
403
+
404
+ // editing a child instance
405
+ if ( basename( $_SERVER['SCRIPT_NAME'] ) === 'post.php' ) {
406
+ $dispatcher->register_action(
407
+ 'admin_action_editpost',
408
+ array( 'model.event.parent', 'admin_init_post' )
409
+ );
410
+ }
411
+ // post row action for parent/child
412
+ $dispatcher->register_action(
413
+ 'post_row_actions',
414
+ array( 'model.event.parent', 'post_row_actions' ),
415
+ 10,
416
+ 2
417
+ );
418
+
419
  // Category colors
420
  $dispatcher->register_action(
421
  'events_categories_add_form_fields',
578
  'plugin_action_links_' . AI1EC_PLUGIN_BASENAME,
579
  array( 'view.admin.nav', 'plugin_action_links' )
580
  );
581
+ if ( $this->_registry->get( 'robots.helper' )->pre_check() ) {
582
+ $dispatcher->register_action(
583
+ 'admin_init',
584
+ array( 'robots.helper', 'install' )
585
+ );
586
+ }
587
  $dispatcher->register_action(
588
  'wp_ajax_ai1ec_rescan_cache',
589
  array( 'twig.cache', 'rescan' )
app/controller/javascript.php CHANGED
@@ -484,7 +484,12 @@ class Ai1ec_Javascript_Controller {
484
  'type' => 'text/javascript'
485
  )
486
  );
487
- $http_encoder->encode();
 
 
 
 
 
488
  $http_encoder->sendAll();
489
  }
490
  Ai1ec_Http_Response_Helper::stop( 0 );
484
  'type' => 'text/javascript'
485
  )
486
  );
487
+ $compression_level = null;
488
+ if ( $this->_registry->get( 'model.settings' )->get( 'disable_gzip_compression' ) ) {
489
+ // set the compression level to 0 to disable it.
490
+ $compression_level = 0;
491
+ }
492
+ $http_encoder->encode( $compression_level );
493
  $http_encoder->sendAll();
494
  }
495
  Ai1ec_Http_Response_Helper::stop( 0 );
app/controller/shutdown.php CHANGED
@@ -69,6 +69,12 @@ class Ai1ec_Shutdown_Controller {
69
  foreach ( $this->_restorables as $name => $object ) {
70
  unset( $object, $this->_restorables[$name] );
71
  }
 
 
 
 
 
 
72
  }
73
 
74
  /**
69
  foreach ( $this->_restorables as $name => $object ) {
70
  unset( $object, $this->_restorables[$name] );
71
  }
72
+ if ( AI1EC_DEBUG ) {
73
+ // __destruct is called twice if facebook extension is installed
74
+ // still can't find the reason, this fixes it but prevent other plugins
75
+ // __destruct() so let's just use it in dev until we fix this.
76
+ exit();
77
+ }
78
  }
79
 
80
  /**
app/model/event.php CHANGED
@@ -192,7 +192,7 @@ class Ai1ec_Event extends Ai1ec_Base {
192
  " IF( aei.start IS NOT NULL, aei.end, e.end ) as end ";
193
 
194
  $instance = (int)$instance;
195
- $this->instance_id = $instance;
196
  $left_join = 'LEFT JOIN ' . $dbi->get_table_name( 'ai1ec_event_instances' ) .
197
  ' aei ON aei.id = ' . $instance . ' AND e.post_id = aei.post_id ';
198
  } else {
192
  " IF( aei.start IS NOT NULL, aei.end, e.end ) as end ";
193
 
194
  $instance = (int)$instance;
195
+ $this->set( 'instance_id', $instance );
196
  $left_join = 'LEFT JOIN ' . $dbi->get_table_name( 'ai1ec_event_instances' ) .
197
  ' aei ON aei.id = ' . $instance . ' AND e.post_id = aei.post_id ';
198
  } else {
app/model/event/creating.php CHANGED
@@ -192,4 +192,46 @@ class Ai1ec_Event_Creating extends Ai1ec_Base {
192
  return $event;
193
  }
194
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  }
192
  return $event;
193
  }
194
 
195
+ /**
196
+ * _create_duplicate_post method
197
+ *
198
+ * Create copy of event by calling {@uses wp_insert_post} function.
199
+ * Using 'post_parent' to add hierarchy.
200
+ *
201
+ * @param array $data Event instance data to copy
202
+ *
203
+ * @return int|bool New post ID or false on failure
204
+ **/
205
+ public function create_duplicate_post() {
206
+ if ( ! isset( $_POST['post_ID'] ) ) {
207
+ return false;
208
+ }
209
+ $clean_fields = array(
210
+ 'ai1ec_repeat' => NULL,
211
+ 'ai1ec_rrule' => '',
212
+ 'ai1ec_exrule' => '',
213
+ 'ai1ec_exdate' => '',
214
+ 'post_ID' => NULL,
215
+ 'post_name' => NULL,
216
+ 'ai1ec_instance_id' => NULL,
217
+ );
218
+ $old_post_id = $_POST['post_ID'];
219
+ $instance_id = $_POST['ai1ec_instance_id'];
220
+ foreach ( $clean_fields as $field => $to_value ) {
221
+ if ( NULL === $to_value ) {
222
+ unset( $_POST[$field] );
223
+ } else {
224
+ $_POST[$field] = $to_value;
225
+ }
226
+ }
227
+ $_POST = _wp_translate_postdata( false, $_POST );
228
+ $_POST['post_parent'] = $old_post_id;
229
+ $post_id = wp_insert_post( $_POST );
230
+ $this->_registry->get( 'model.event.parent' )->event_parent(
231
+ $post_id,
232
+ $old_post_id,
233
+ $instance_id
234
+ );
235
+ return $post_id;
236
+ }
237
  }
app/model/event/entity.php CHANGED
@@ -56,6 +56,9 @@ class Ai1ec_Event_Entity extends Ai1ec_Base {
56
  if ( 'registry' === $name ) {
57
  return $this; // short-circuit: protection mean.
58
  }
 
 
 
59
  $field = '_' . $name;
60
  if ( isset( $time_fields[$name] ) ) {
61
  // object of Ai1ec_Date_Time type is now handled in it itself
@@ -68,7 +71,7 @@ class Ai1ec_Event_Entity extends Ai1ec_Base {
68
  } else {
69
  $this->{$field} = $value;
70
  }
71
- if ( 'timezone_name' === $name && ! empty( $value ) ) {
72
  $this->_start->set_timezone( $value );
73
  $this->_end ->set_timezone( $value );
74
  }
56
  if ( 'registry' === $name ) {
57
  return $this; // short-circuit: protection mean.
58
  }
59
+ if ( 'timezone_name' === $name && empty( $value ) ) {
60
+ return $this; // protection against invalid TZ values.
61
+ }
62
  $field = '_' . $name;
63
  if ( isset( $time_fields[$name] ) ) {
64
  // object of Ai1ec_Date_Time type is now handled in it itself
71
  } else {
72
  $this->{$field} = $value;
73
  }
74
+ if ( 'timezone_name' === $name ) {
75
  $this->_start->set_timezone( $value );
76
  $this->_end ->set_timezone( $value );
77
  }
app/model/event/instance.php CHANGED
@@ -40,8 +40,8 @@ class Ai1ec_Event_Instance extends Ai1ec_Base {
40
  $where = array( 'post_id' => $post_id );
41
  $format = array( '%d' );
42
  if ( null !== $instance_id ) {
43
- $where['instance_id'] = $instance_id;
44
- $format[] = '%d';
45
  }
46
  return $this->_dbi->delete( 'ai1ec_event_instances', $where, $format );
47
  }
40
  $where = array( 'post_id' => $post_id );
41
  $format = array( '%d' );
42
  if ( null !== $instance_id ) {
43
+ $where['id'] = $instance_id;
44
+ $format[] = '%d';
45
  }
46
  return $this->_dbi->delete( 'ai1ec_event_instances', $where, $format );
47
  }
app/model/event/parent.php ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class which represnt event parent/child relationship.
4
+ *
5
+ * @author Time.ly Network, Inc.
6
+ * @since 2.0
7
+ * @package Ai1EC
8
+ * @subpackage Ai1EC.Model
9
+ */
10
+ class Ai1ec_Event_Parent extends Ai1ec_Base {
11
+
12
+ /**
13
+ * event_parent method
14
+ *
15
+ * Get/set event parent
16
+ *
17
+ * @param int $event_id ID of checked event
18
+ * @param int $parent_id ID of new parent [optional=NULL, acts as getter]
19
+ * @param int $instance_id ID of old instance id
20
+ *
21
+ * @return int|bool Value depends on mode:
22
+ * Getter: {@see self::get_parent_event()} for details
23
+ * Setter: true on success.
24
+ */
25
+ public function event_parent(
26
+ $event_id,
27
+ $parent_id = null,
28
+ $instance_id = null
29
+ ) {
30
+ $meta_key = '_ai1ec_event_parent';
31
+ if ( null === $parent_id ) {
32
+ return $this->get_parent_event( $event_id );
33
+ }
34
+ $meta_value = json_encode( array(
35
+ 'created' => $this->_registry->get( 'date.system' )->current_time(),
36
+ 'instance' => $instance_id,
37
+ ) );
38
+ return add_post_meta( $event_id, $meta_key, $meta_value, true );
39
+ }
40
+
41
+ /**
42
+ * Get parent ID for given event
43
+ *
44
+ * @param int $current_id Current event ID
45
+ *
46
+ * @return int|bool ID of parent event or bool(false)
47
+ */
48
+ public function get_parent_event( $current_id ) {
49
+ static $parents = null;
50
+ if ( null === $parents ) {
51
+ $parents = $this->_registry->get( 'cache.memory' );
52
+ }
53
+ $current_id = (int)$current_id;
54
+ if ( null === ( $parent_id = $parents->get( $current_id ) ) ) {
55
+ $db = $this->_registry->get( 'dbi.dbi' );
56
+ /* @var $db Ai1ec_Dbi */
57
+ $query = '
58
+ SELECT parent.ID, parent.post_status
59
+ FROM
60
+ ' . $db->get_table_name( 'posts' ) . ' AS child
61
+ INNER JOIN ' . $db->get_table_name( 'posts' ) . ' AS parent
62
+ ON ( parent.ID = child.post_parent )
63
+ WHERE child.ID = ' . $current_id;
64
+ $parent = $db->get_row( $query );
65
+ if (
66
+ empty( $parent ) ||
67
+ 'trash' === $parent->post_status
68
+ ) {
69
+ $parent_id = false;
70
+ } else {
71
+ $parent_id = $parent->ID;
72
+ }
73
+ $parents->set( $current_id, $parent_id );
74
+ unset( $query );
75
+ }
76
+ return $parent_id;
77
+ }
78
+
79
+ /**
80
+ * Returns a list of modified (children) event objects
81
+ *
82
+ * @param int $parent_id ID of parent event
83
+ * @param bool $include_trash Includes trashed when `true` [optional=false]
84
+ *
85
+ * @return array List (might be empty) of Ai1ec_Event objects
86
+ */
87
+ public function get_child_event_objects(
88
+ $parent_id,
89
+ $include_trash = false
90
+ ) {
91
+ $db = $this->_registry->get( 'dbi.dbi' );
92
+ /* @var $db Ai1ec_Dbi */
93
+ $parent_id = (int)$parent_id;
94
+ $sql_query = 'SELECT ID FROM ' . $db->get_table_name( 'posts' ) .
95
+ ' WHERE post_parent = ' . $parent_id;
96
+ $childs = (array)$db->get_col( $sql_query );
97
+ $objects = array();
98
+ foreach ( $childs as $child_id ) {
99
+ try {
100
+ $instance = $this->_registry->get( 'model.event', $child_id );
101
+ if (
102
+ $include_trash ||
103
+ 'trash' !== $instance->get( 'post' )->post_status
104
+ ) {
105
+ $objects[$child_id] = $instance;
106
+ }
107
+ } catch ( Ai1ec_Event_Not_Found $exception ) {
108
+ // ignore
109
+ }
110
+ }
111
+ return $objects;
112
+ }
113
+
114
+ /**
115
+ * admin_init_post method
116
+ *
117
+ * Bind to admin_action_editpost action to override default save
118
+ * method when user is editing single instance.
119
+ * New post is created with some fields unset.
120
+ */
121
+ public function admin_init_post( ) {
122
+ if (
123
+ isset( $_POST['ai1ec_instance_id'] ) &&
124
+ isset( $_POST['action'] ) &&
125
+ 'editpost' === $_POST['action']
126
+ ) {
127
+ $old_post_id = $_POST['post_ID'];
128
+ $instance_id = $_POST['ai1ec_instance_id'];
129
+ $post_id = $this->_registry->get( 'model.event.creating' )
130
+ ->create_duplicate_post();
131
+ if ( false !== $post_id ) {
132
+ $created_event = $this->_registry->get( 'model.event', $post_id );
133
+ $this->add_exception_date(
134
+ $old_post_id,
135
+ $created_event->get( 'start' )
136
+ );
137
+ $this->_registry->get( 'model.event.instance' )->clean(
138
+ $old_post_id,
139
+ $instance_id
140
+ );
141
+ $location = add_query_arg(
142
+ 'message',
143
+ 1,
144
+ get_edit_post_link( $post_id, 'url' )
145
+ );
146
+ wp_redirect(
147
+ apply_filters(
148
+ 'redirect_post_location',
149
+ $location,
150
+ $post_id
151
+ )
152
+ );
153
+ exit();
154
+ }
155
+ }
156
+ }
157
+
158
+ /**
159
+ * Inject base event edit link for modified instances
160
+ *
161
+ * Modified instances are events, belonging to some parent having recurrence
162
+ * rule, and having some of it's properties altered.
163
+ *
164
+ * @param array $actions List of defined actions
165
+ * @param stdClass $post Instance being rendered (WP_Post class instance in WP 3.5+)
166
+ *
167
+ * @return array Optionally modified $actions list
168
+ */
169
+ public function post_row_actions( array $actions, $post ) {
170
+ if ( $this->_registry->get( 'acl.aco' )->is_our_post_type( $post ) ) {
171
+ $parent_post_id = $this->event_parent( $post->ID );
172
+ if (
173
+ $parent_post_id &&
174
+ NULL !== ( $parent_post = get_post( $parent_post_id ) ) &&
175
+ isset( $parent_post->post_status ) &&
176
+ 'trash' !== $parent_post->post_status
177
+ ) {
178
+ $parent_link = get_edit_post_link(
179
+ $parent_post_id,
180
+ 'display'
181
+ );
182
+ $actions['ai1ec_parent'] = sprintf(
183
+ '<a href="%s" title="%s">%s</a>',
184
+ wp_nonce_url( $parent_link ),
185
+ sprintf(
186
+ __( 'Edit &#8220;%s&#8221;', AI1EC_PLUGIN_NAME ),
187
+ apply_filters(
188
+ 'the_title',
189
+ $parent_post->post_title,
190
+ $parent_post->ID
191
+ )
192
+ ),
193
+ __( 'Base Event', AI1EC_PLUGIN_NAME )
194
+ );
195
+ }
196
+ }
197
+ return $actions;
198
+ }
199
+
200
+ /**
201
+ * add_exception_date method
202
+ *
203
+ * Add exception (date) to event.
204
+ *
205
+ * @param int $post_id Event edited post ID
206
+ * @param mixed $date Parseable date representation to exclude
207
+ *
208
+ * @return bool Success
209
+ */
210
+ public function add_exception_date( $post_id, Ai1ec_Date_Time $date ) {
211
+ $event = $this->_registry->get( 'model.event', $post_id );
212
+ $dates_list = explode( ',', $event->get( 'exception_dates' ) );
213
+ if ( empty( $dates_list[0] ) ) {
214
+ unset( $dates_list[0] );
215
+ }
216
+ $date->set_time( 0, 0, 0 );
217
+ $dates_list[] = $date->format(
218
+ 'Ymd\THis\Z'
219
+ );
220
+ $event->set( 'exception_dates', implode( ',', $dates_list ) );
221
+ return $event->save( true );
222
+ }
223
+ }
app/model/event/trashing.php CHANGED
@@ -15,9 +15,57 @@
15
  */
16
  class Ai1ec_Event_Trashing extends Ai1ec_Base {
17
 
18
- public function remove_childs( $post_id, $full_remove = false ) {
19
- // to be filled when hierarchy is introduced
20
- return true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  }
22
 
23
  /**
@@ -30,8 +78,7 @@ class Ai1ec_Event_Trashing extends Ai1ec_Base {
30
  * @return bool Success.
31
  */
32
  public function trash( $post_id ) {
33
- return $this->remove_childs( $post_id, false ) &&
34
- $this->delete_cache( $post_id );
35
  }
36
 
37
  /**
@@ -44,8 +91,7 @@ class Ai1ec_Event_Trashing extends Ai1ec_Base {
44
  * @return bool Success.
45
  */
46
  public function untrash( $post_id ) {
47
- // to be filled when hierarchy is introduced
48
- return true;
49
  }
50
 
51
  /**
@@ -64,24 +110,11 @@ class Ai1ec_Event_Trashing extends Ai1ec_Base {
64
  $where = array( 'post_id' => (int)$post_id );
65
  $format = array( '%d' );
66
  $dbi = $this->_registry->get( 'dbi.dbi' );
67
- $success = $this->remove_childs( $post_id, true );
68
- $success &= $dbi->delete( 'ai1ec_events', $where, $format );
69
- $success &= $dbi->delete( 'ai1ec_event_instances', $where, $format );
70
  unset( $where, $dbi );
71
- return $success && $this->delete_cache( $post_id );
72
- }
73
-
74
- /**
75
- * Remove the cache for a specific event
76
- *
77
- * @param $event_id
78
- * @internal param $event_id
79
- *
80
- * @return boolean
81
- */
82
- public function delete_cache( $event_id ) {
83
- // to be added with cache introduction
84
- return true;
85
  }
86
 
87
  }
15
  */
16
  class Ai1ec_Event_Trashing extends Ai1ec_Base {
17
 
18
+ /**
19
+ * Trash/untrash/deletes child posts
20
+ *
21
+ * @param id $post_id
22
+ * @param string $action
23
+ */
24
+ protected function _manage_children( $post_id, $action ) {
25
+ try {
26
+ $ai1ec_event = $this->_registry->get( 'model.event', $post_id );
27
+ if (
28
+ $ai1ec_event->get( 'post' ) &&
29
+ $ai1ec_event->get( 'recurrence_rules' )
30
+ ) {
31
+ // when untrashing also get trashed object
32
+ $children = $this->_registry->get( 'model.event.parent' )
33
+ ->get_child_event_objects( $ai1ec_event->get( 'post_id' ), $action === 'untrash' );
34
+ $function = 'wp_' . $action . '_post';
35
+ foreach ( $children as $child ) {
36
+ $function( $child->get( 'post_id' ) );
37
+ }
38
+ }
39
+ } catch ( Ai1ec_Event_Not_Found $exception ) {
40
+ // ignore - not an event
41
+ }
42
+ }
43
+
44
+ /**
45
+ * Trashes child posts
46
+ *
47
+ * @param int $post_id
48
+ */
49
+ public function trash_children( $post_id ) {
50
+ $this->_manage_children( $post_id, 'trash' );
51
+ }
52
+
53
+ /**
54
+ * Delete child posts
55
+ *
56
+ * @param int $post_id
57
+ */
58
+ public function delete_children( $post_id ) {
59
+ $this->_manage_children( $post_id, 'delete' );
60
+ }
61
+
62
+ /**
63
+ * Untrashes child posts
64
+ *
65
+ * @param int $post_id
66
+ */
67
+ public function untrash_children( $post_id ) {
68
+ $this->_manage_children( $post_id, 'untrash' );
69
  }
70
 
71
  /**
78
  * @return bool Success.
79
  */
80
  public function trash( $post_id ) {
81
+ return $this->trash_children( $post_id );
 
82
  }
83
 
84
  /**
91
  * @return bool Success.
92
  */
93
  public function untrash( $post_id ) {
94
+ return $this->untrash_children( $post_id );
 
95
  }
96
 
97
  /**
110
  $where = array( 'post_id' => (int)$post_id );
111
  $format = array( '%d' );
112
  $dbi = $this->_registry->get( 'dbi.dbi' );
113
+ $success = $this->delete_children( $post_id );
114
+ $success = $dbi->delete( 'ai1ec_events', $where, $format );
115
+ $success = $this->_registry->get( 'model.event.instance' )->clean( $post_id );
116
  unset( $where, $dbi );
117
+ return $success;
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  }
119
 
120
  }
app/model/search.php CHANGED
@@ -40,7 +40,7 @@ class Ai1ec_Event_Search extends Ai1ec_Base {
40
  if ( $instance_id < 1 ) {
41
  $instance_id = false;
42
  }
43
- return new Ai1ec_Event( $post_id, $instance_id );
44
  }
45
 
46
  /**
40
  if ( $instance_id < 1 ) {
41
  $instance_id = false;
42
  }
43
+ return $this->_registry->get( 'model.event', $post_id, $instance_id );
44
  }
45
 
46
  /**
app/view/admin/add-new-event.php CHANGED
@@ -211,7 +211,11 @@ class Ai1ec_View_Add_New_Event extends Ai1ec_Base {
211
  // This will store each of the accordion tabs' markup, and passed as an
212
  // argument to the final view.
213
  $boxes = array();
214
-
 
 
 
 
215
  // ===============================
216
  // = Display event time and date =
217
  // ===============================
@@ -230,6 +234,7 @@ class Ai1ec_View_Add_New_Event extends Ai1ec_Base {
230
  'timezone_string' => $timezone_string,
231
  'timezone_name' => $timezone_name,
232
  'exdate' => $exdate,
 
233
  'instance_id' => $instance_id,
234
  );
235
 
@@ -315,6 +320,30 @@ class Ai1ec_View_Add_New_Event extends Ai1ec_Base {
315
 
316
  }
317
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
318
  // Display the final view of the meta box.
319
  $args = array(
320
  'boxes' => $boxes,
@@ -344,5 +373,4 @@ class Ai1ec_View_Add_New_Event extends Ai1ec_Base {
344
  return $input;
345
  }
346
 
347
-
348
  }
211
  // This will store each of the accordion tabs' markup, and passed as an
212
  // argument to the final view.
213
  $boxes = array();
214
+ $parent_event_id = null;
215
+ if ( $event ) {
216
+ $parent_event_id = $this->_registry->get( 'model.event.parent' )
217
+ ->event_parent( $event->get( 'post_id' ) );
218
+ }
219
  // ===============================
220
  // = Display event time and date =
221
  // ===============================
234
  'timezone_string' => $timezone_string,
235
  'timezone_name' => $timezone_name,
236
  'exdate' => $exdate,
237
+ 'parent_event_id' => $parent_event_id,
238
  'instance_id' => $instance_id,
239
  );
240
 
320
 
321
  }
322
 
323
+ // ==========================
324
+ // = Parent/Child relations =
325
+ // ==========================
326
+ if ( $event ) {
327
+ $parent = $this->_registry->get( 'model.event.parent' )
328
+ ->get_parent_event( $event->get( 'post_id' ) );
329
+ if ( $parent ) {
330
+ try {
331
+ $parent = $this->_registry->get( 'model.event', $parent );
332
+ } catch ( Ai1ec_Event_Not_Found $exception ) { // ignore
333
+ $parent = null;
334
+ }
335
+ }
336
+ $children = $this->_registry->get( 'model.event.parent' )
337
+ ->get_child_event_objects( $event->get( 'post_id' ) );
338
+ $args = compact( 'parent', 'children' );
339
+ $args['registry'] = $this->_registry;
340
+
341
+ $boxes[] = $theme_loader->get_file(
342
+ 'box_event_children.php',
343
+ $args,
344
+ true
345
+ )->get_content();
346
+ }
347
  // Display the final view of the meta box.
348
  $args = array(
349
  'boxes' => $boxes,
373
  return $input;
374
  }
375
 
 
376
  }
app/view/admin/settings.php CHANGED
@@ -173,7 +173,14 @@ class Ai1ec_View_Admin_Settings extends Ai1ec_View_Admin_Abstract {
173
  'class' => 'ai1ec-btn ai1ec-btn-primary ai1ec-btn-lg',
174
  ),
175
  ),
176
-
 
 
 
 
 
 
 
177
  );
178
 
179
  $file = $loader->get_file( 'setting/bootstrap_tabs.twig', $args, true );
173
  'class' => 'ai1ec-btn ai1ec-btn-primary ai1ec-btn-lg',
174
  ),
175
  ),
176
+ 'pre_tabs_markup' => sprintf(
177
+ '<div class="ai1ec-gzip-causes-js-failure">' .
178
+ Ai1ec_I18n::__(
179
+ 'If the form below is not working please follow <a href="%s">this link</a>.'
180
+ ) .
181
+ '</div>',
182
+ add_query_arg( 'ai1ec_disable_gzip_compression', '1' )
183
+ )
184
  );
185
 
186
  $file = $loader->get_file( 'setting/bootstrap_tabs.twig', $args, true );
app/view/event/content.php CHANGED
@@ -118,7 +118,7 @@ class Ai1ec_View_Event_Content extends Ai1ec_Base {
118
  $href = $href->generate_href();
119
  }
120
  $text = esc_attr( Ai1ec_I18n::__( 'Back to Calendar' ) );
121
- $tooltip = esc_attr( Ai1ec_I18n::__( 'Go back to event calendar' ) );
122
  $html = <<<HTML
123
  <a class="ai1ec-calendar-link ai1ec-btn ai1ec-btn-default ai1ec-btn-sm
124
  ai1ec-tooltip-trigger $class"
@@ -126,7 +126,7 @@ class Ai1ec_View_Event_Content extends Ai1ec_Base {
126
  $data_type
127
  data-placement="left"
128
  title="$tooltip">
129
- <i class="ai1ec-fa ai1ec-fa-arrow-left ai1ec-fa-fw"></i>
130
  <span class="ai1ec-hidden-xs">$text</span>
131
  </a>
132
  HTML;
118
  $href = $href->generate_href();
119
  }
120
  $text = esc_attr( Ai1ec_I18n::__( 'Back to Calendar' ) );
121
+ $tooltip = esc_attr( Ai1ec_I18n::__( 'View all events' ) );
122
  $html = <<<HTML
123
  <a class="ai1ec-calendar-link ai1ec-btn ai1ec-btn-default ai1ec-btn-sm
124
  ai1ec-tooltip-trigger $class"
126
  $data_type
127
  data-placement="left"
128
  title="$tooltip">
129
+ <i class="ai1ec-fa ai1ec-fa-calendar ai1ec-fa-fw"></i>
130
  <span class="ai1ec-hidden-xs">$text</span>
131
  </a>
132
  HTML;
app/view/event/single.php CHANGED
@@ -69,9 +69,10 @@ class Ai1ec_View_Event_Single extends Ai1ec_Base {
69
  'hide_featured_image' => $settings->get( 'hide_featured_image' ),
70
  'extra_buttons' => $extra_buttons
71
  );
 
72
  if (
73
  ! empty( $args['recurrence'] ) &&
74
- ! $event->get( 'instance_id' ) &&
75
  current_user_can( 'edit_ai1ec_events' )
76
  ) {
77
  $args['edit_instance_url'] = admin_url(
69
  'hide_featured_image' => $settings->get( 'hide_featured_image' ),
70
  'extra_buttons' => $extra_buttons
71
  );
72
+
73
  if (
74
  ! empty( $args['recurrence'] ) &&
75
+ $event->get( 'instance_id' ) &&
76
  current_user_can( 'edit_ai1ec_events' )
77
  ) {
78
  $args['edit_instance_url'] = admin_url(
language/all-in-one-event-calendar.mo CHANGED
Binary file
language/all-in-one-event-calendar.po CHANGED
@@ -2,13 +2,13 @@
2
  # This file is distributed under the same license as the All-in-One Event Calendar by Time.ly package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: All-in-One Event Calendar by Time.ly 2.0.6\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/all-in-one-event-calendar\n"
7
- "POT-Creation-Date: 2014-04-29 18:54:34+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2014-04-29 21:54+0300\n"
12
  "Last-Translator: Timely <support@time.ly>\n"
13
  "Language-Team:\n"
14
 
@@ -39,7 +39,7 @@ msgstr ""
39
  msgid "Calendar Themes"
40
  msgstr "Calendar Themes"
41
 
42
- #: app/controller/front.php:786
43
  msgid ""
44
  "Your database is found to be corrupt. Likely previous update has failed. "
45
  "Please restore All-in-One Event Calendar tables from a backup and retry."
@@ -115,8 +115,16 @@ msgstr ""
115
  "The URL you have entered seems to be invalid. Please remember that URLs must "
116
  "start with either \"http://\" or \"https://\"."
117
 
 
 
 
 
 
 
 
 
118
  #: app/model/settings.php:325
119
- #: lib/html/element/setting/calendar-page-selector.php:55
120
  msgid "Calendar page"
121
  msgstr "Calendar page"
122
 
@@ -384,15 +392,15 @@ msgstr "Templates cache improves site performance"
384
  msgid "Event Details"
385
  msgstr "Event Details"
386
 
387
- #: app/view/admin/add-new-event.php:306
388
  msgid "Publish"
389
  msgstr "Publish"
390
 
391
- #: app/view/admin/add-new-event.php:307
392
  msgid "Update"
393
  msgstr "Update"
394
 
395
- #: app/view/admin/add-new-event.php:309
396
  msgid "Submit for Review"
397
  msgstr "Submit for Review"
398
 
@@ -622,6 +630,12 @@ msgstr "Cache Report"
622
  msgid "Save Settings"
623
  msgstr "Save Settings"
624
 
 
 
 
 
 
 
625
  #: app/view/admin/theme-options.php:50 app/view/admin/theme-options.php:51
626
  msgid "Theme Options"
627
  msgstr "Theme Options"
@@ -704,8 +718,8 @@ msgid "Back to Calendar"
704
  msgstr "Back to Calendar"
705
 
706
  #: app/view/event/content.php:121
707
- msgid "Go back to event calendar"
708
- msgstr "Go back to event calendar"
709
 
710
  #: app/view/event/post.php:29
711
  msgid "Event updated. <a href=\"%s\">View event</a>"
@@ -758,7 +772,7 @@ msgid "Event draft updated. <a target=\"_blank\" href=\"%s\">Preview event</a>"
758
  msgstr ""
759
  "Event draft updated. <a target=\"_blank\" href=\"%s\">Preview event</a>"
760
 
761
- #: app/view/event/single.php:82
762
  msgid "Edit this occurrence (%s)"
763
  msgstr "Edit this occurrence (%s)"
764
 
@@ -808,307 +822,6 @@ msgstr "all-day"
808
  msgid ", and "
809
  msgstr ", and "
810
 
811
- #: cache/twig/14/14/340e18cb8d14d82ac7e5827d0ebc22d4c122f3f55377628ee439cef60657.php:31
812
- msgid "Enabled"
813
- msgstr "Enabled"
814
-
815
- #: cache/twig/14/14/340e18cb8d14d82ac7e5827d0ebc22d4c122f3f55377628ee439cef60657.php:35
816
- msgid "Default"
817
- msgstr "Default"
818
-
819
- #: cache/twig/14/b3/3cdfb74dcddd288dc4f674be44f9332303e665eaaddeafa0e539e1479799.php:48
820
- msgid "Choose a date using calendar"
821
- msgstr "Choose a date using calendar"
822
-
823
- #: cache/twig/22/6c/b502ceaa36d3658c4e1bc82790a015e5a6639b97464b731dc289baa619d5.php:31
824
- msgid ""
825
- "Subscribe to this calendar in your personal calendar (iCal, Outlook, etc.)"
826
- msgstr ""
827
- "Subscribe to this calendar in your personal calendar (iCal, Outlook, etc.)"
828
-
829
- #: cache/twig/22/6c/b502ceaa36d3658c4e1bc82790a015e5a6639b97464b731dc289baa619d5.php:48
830
- msgid "Subscribe to filtered calendar"
831
- msgstr "Subscribe to filtered calendar"
832
-
833
- #: cache/twig/22/6c/b502ceaa36d3658c4e1bc82790a015e5a6639b97464b731dc289baa619d5.php:54
834
- msgid "Subscribe"
835
- msgstr "Subscribe"
836
-
837
- #: cache/twig/22/6c/b502ceaa36d3658c4e1bc82790a015e5a6639b97464b731dc289baa619d5.php:77
838
- msgid "Subscribe to this calendar in your Google Calendar"
839
- msgstr "Subscribe to this calendar in your Google Calendar"
840
-
841
- #: cache/twig/22/6c/b502ceaa36d3658c4e1bc82790a015e5a6639b97464b731dc289baa619d5.php:91
842
- msgid "Add to Google"
843
- msgstr "Add to Google"
844
-
845
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:26
846
- msgid "Embed the calendar using the Super Widget"
847
- msgstr "Embed the calendar using the Super Widget"
848
-
849
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:36
850
- msgid ""
851
- "You can also embed a calendar into a remote webpage (for example, a static "
852
- "HTML page hosted on a different server). Here's how:"
853
- msgstr ""
854
- "You can also embed a calendar into a remote webpage (for example, a static "
855
- "HTML page hosted on a different server). Here's how:"
856
-
857
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:42
858
- msgid "Add this line just before the closing <code>&lt;/head&gt;</code> tag:"
859
- msgstr "Add this line just before the closing <code>&lt;/head&gt;</code> tag:"
860
-
861
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:52
862
- msgid ""
863
- "Insert this markup where you would like to embed the Super Widget (using "
864
- "default options):"
865
- msgstr ""
866
- "Insert this markup where you would like to embed the Super Widget (using "
867
- "default options):"
868
-
869
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:60
870
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:67
871
- msgid "Optional."
872
- msgstr "Optional."
873
-
874
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:64
875
- msgid "Add options to your Super Widget:"
876
- msgstr "Add options to your Super Widget:"
877
-
878
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:70
879
- msgid "Posterboard view:"
880
- msgstr "Posterboard view:"
881
-
882
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:74
883
- msgid "Stream view:"
884
- msgstr "Stream view:"
885
-
886
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:78
887
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:41
888
- msgid "Month view:"
889
- msgstr "Month view:"
890
-
891
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:82
892
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:45
893
- msgid "Week view:"
894
- msgstr "Week view:"
895
-
896
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:86
897
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:49
898
- msgid "Day view:"
899
- msgstr "Day view:"
900
-
901
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:90
902
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:53
903
- msgid "Agenda view:"
904
- msgstr "Agenda view:"
905
-
906
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:94
907
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:61
908
- msgid "Default view as per settings:"
909
- msgstr "Default view as per settings:"
910
-
911
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:99
912
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:91
913
- msgid "Filter by event category ID:"
914
- msgstr "Filter by event category ID:"
915
-
916
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:103
917
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:95
918
- msgid "Filter by event category IDs (separate IDs by comma):"
919
- msgstr "Filter by event category IDs (separate IDs by comma):"
920
-
921
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:108
922
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:114
923
- msgid "Filter by event tag ID:"
924
- msgstr "Filter by event tag ID:"
925
-
926
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:112
927
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:118
928
- msgid "Filter by event tag IDs (separate IDs by comma):"
929
- msgstr "Filter by event tag IDs (separate IDs by comma):"
930
-
931
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:117
932
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:123
933
- msgid "Filter by post ID:"
934
- msgstr "Filter by post ID:"
935
-
936
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:121
937
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:127
938
- msgid "Filter by post IDs (separate IDs by comma):"
939
- msgstr "Filter by post IDs (separate IDs by comma):"
940
-
941
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:126
942
- msgid "Hide title and navigation buttons:"
943
- msgstr "Hide title and navigation buttons:"
944
-
945
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:131
946
- msgid "Set a default start date: *"
947
- msgstr "Set a default start date: *"
948
-
949
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:139
950
- msgid ""
951
- "* Provide a date in the same format specified by the <strong>Input dates in "
952
- "this format</strong> setting on the <strong>Adding/Editing Events</strong> "
953
- "tab."
954
- msgstr ""
955
- "* Provide a date in the same format specified by the <strong>Input dates in "
956
- "this format</strong> setting on the <strong>Adding/Editing Events</strong> "
957
- "tab."
958
-
959
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:145
960
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:133
961
- msgid "Warning:"
962
- msgstr "Warning:"
963
-
964
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:149
965
- msgid ""
966
- "It is currently not supported to embed more than one calendar in the same "
967
- "page. Do not attempt to embed the calendar via Super Widget in a page that "
968
- "already displays the calendar."
969
- msgstr ""
970
- "It is currently not supported to embed more than one calendar in the same "
971
- "page. Do not attempt to embed the calendar via Super Widget in a page that "
972
- "already displays the calendar."
973
-
974
- #: cache/twig/33/1c/dabac328da20469e2616008dc56dce67c63be852b24506548f1b388569a9.php:27
975
- msgid "All-in-One Event Calendar"
976
- msgstr "All-in-One Event Calendar"
977
-
978
- #: cache/twig/36/41/cb5ba7ae689f85c6edb69ac8d77d4746270ac297a4aabebf1815a1d7784e.php:39
979
- msgid "Clear tag filter"
980
- msgstr "Clear tag filter"
981
-
982
- #: cache/twig/36/41/cb5ba7ae689f85c6edb69ac8d77d4746270ac297a4aabebf1815a1d7784e.php:45
983
- #: lib/html/element/setting/tags-categories.php:39
984
- msgid "Tags"
985
- msgstr "Tags"
986
-
987
- #: cache/twig/41/2c/390dc1284f86a5e8f726b412117f45d6b76198d80b1c3ca743b4a52d8344.php:39
988
- msgid "Clear category filter"
989
- msgstr "Clear category filter"
990
-
991
- #: cache/twig/41/2c/390dc1284f86a5e8f726b412117f45d6b76198d80b1c3ca743b4a52d8344.php:45
992
- #: lib/html/element/setting/tags-categories.php:47
993
- msgid "Categories"
994
- msgstr "Categories"
995
-
996
- #: cache/twig/5d/6a/4c3721e30bde93d60edc8380d57a3856559300e77878dd71e2abdd927e2b.php:23
997
- msgid "Collapse All"
998
- msgstr "Collapse All"
999
-
1000
- #: cache/twig/5d/6a/4c3721e30bde93d60edc8380d57a3856559300e77878dd71e2abdd927e2b.php:29
1001
- msgid "Expand All"
1002
- msgstr "Expand All"
1003
-
1004
- #: cache/twig/80/49/21f13f8c6c3ea945cecbea222634076899d945460d6d1d07fc875e75fc1e.php:31
1005
- msgid "Add Your Calendar Feed"
1006
- msgstr "Add Your Calendar Feed"
1007
-
1008
- #: cache/twig/80/49/21f13f8c6c3ea945cecbea222634076899d945460d6d1d07fc875e75fc1e.php:57
1009
- #: public/admin/calendar_tasks.php:13
1010
- msgid "Post Your Event"
1011
- msgstr "Post Your Event"
1012
-
1013
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:26
1014
- msgid "Embed the calendar using a shortcode"
1015
- msgstr "Embed the calendar using a shortcode"
1016
-
1017
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:36
1018
- msgid ""
1019
- "Insert one of these shortcodes into your page body to embed the calendar "
1020
- "into any arbitrary WordPress Page:"
1021
- msgstr ""
1022
- "Insert one of these shortcodes into your page body to embed the calendar "
1023
- "into any arbitrary WordPress Page:"
1024
-
1025
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:57
1026
- msgid "Some Other view:"
1027
- msgstr "Some Other view:"
1028
-
1029
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:71
1030
- msgid ""
1031
- "Add options to display a filtered calender. (You can find out category and "
1032
- "tag IDs by inspecting the URL of your filtered calendar page.)"
1033
- msgstr ""
1034
- "Add options to display a filtered calender. (You can find out category and "
1035
- "tag IDs by inspecting the URL of your filtered calendar page.)"
1036
-
1037
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:77
1038
- msgid "Filter by event category name/slug:"
1039
- msgstr "Filter by event category name/slug:"
1040
-
1041
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:79
1042
- msgid "Holidays"
1043
- msgstr "Holidays"
1044
-
1045
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:83
1046
- msgid "Filter by event category names/slugs (separate names by comma):"
1047
- msgstr "Filter by event category names/slugs (separate names by comma):"
1048
-
1049
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:85
1050
- msgid "Lunar Cycles"
1051
- msgstr "Lunar Cycles"
1052
-
1053
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:87
1054
- msgid "zodiac-date-ranges"
1055
- msgstr "zodiac-date-ranges"
1056
-
1057
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:100
1058
- msgid "Filter by event tag name/slug:"
1059
- msgstr "Filter by event tag name/slug:"
1060
-
1061
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:102
1062
- msgid "tips-and-tricks"
1063
- msgstr "tips-and-tricks"
1064
-
1065
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:106
1066
- msgid "Filter by event tag names/slugs (separate names by comma):"
1067
- msgstr "Filter by event tag names/slugs (separate names by comma):"
1068
-
1069
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:108
1070
- msgid "creative writing"
1071
- msgstr "creative writing"
1072
-
1073
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:110
1074
- msgid "performing arts"
1075
- msgstr "performing arts"
1076
-
1077
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:137
1078
- msgid ""
1079
- "It is currently not supported to embed more than one calendar in the same "
1080
- "page. Do not attempt to embed the calendar via shortcode in a page that "
1081
- "already displays the calendar."
1082
- msgstr ""
1083
- "It is currently not supported to embed more than one calendar in the same "
1084
- "page. Do not attempt to embed the calendar via shortcode in a page that "
1085
- "already displays the calendar."
1086
-
1087
- #: cache/twig/d5/ea/0f196084548c56e9b17f48b3fa082f54fbf3f61f088b55acd91d52e27130.php:30
1088
- msgid "There are no upcoming events to display at this time."
1089
- msgstr "There are no upcoming events to display at this time."
1090
-
1091
- #: cache/twig/d5/ea/0f196084548c56e9b17f48b3fa082f54fbf3f61f088b55acd91d52e27130.php:130
1092
- msgid "@ %s"
1093
- msgstr "@ %s"
1094
-
1095
- #: cache/twig/d5/ea/0f196084548c56e9b17f48b3fa082f54fbf3f61f088b55acd91d52e27130.php:149
1096
- msgid "Edit"
1097
- msgstr "Edit"
1098
-
1099
- #: cache/twig/d5/ea/0f196084548c56e9b17f48b3fa082f54fbf3f61f088b55acd91d52e27130.php:219
1100
- msgid "Read more"
1101
- msgstr "Read more"
1102
-
1103
- #: cache/twig/d5/ea/0f196084548c56e9b17f48b3fa082f54fbf3f61f088b55acd91d52e27130.php:238
1104
- msgid "Categories:"
1105
- msgstr "Categories:"
1106
-
1107
- #: cache/twig/d5/ea/0f196084548c56e9b17f48b3fa082f54fbf3f61f088b55acd91d52e27130.php:257
1108
- #: lib/theme/list.php:323 public/admin/themes.php:29
1109
- msgid "Tags:"
1110
- msgstr "Tags:"
1111
-
1112
  #: lib/calendar-feed/ics.php:33
1113
  msgid "ICS"
1114
  msgstr "ICS"
@@ -1306,10 +1019,22 @@ msgstr "Checking..."
1306
  msgid "Performance Report"
1307
  msgstr "Performance Report"
1308
 
1309
- #: lib/html/element/setting/calendar-page-selector.php:111
 
 
 
 
1310
  msgid "- Auto-Create New Page -"
1311
  msgstr "- Auto-Create New Page -"
1312
 
 
 
 
 
 
 
 
 
1313
  #: lib/less/variable/font.php:64
1314
  msgid "Custom..."
1315
  msgstr "Custom..."
@@ -1572,6 +1297,10 @@ msgstr ""
1572
  msgid "All of this theme&#8217;s files are located in <code>%2$s</code>."
1573
  msgstr "All of this theme&#8217;s files are located in <code>%2$s</code>."
1574
 
 
 
 
 
1575
  #: lib/theme/loader.php:285
1576
  msgid "We couldn't find a suitable loader for filename with extension '%s'"
1577
  msgstr "We couldn't find a suitable loader for filename with extension '%s'"
@@ -1857,27 +1586,27 @@ msgstr ""
1857
  "Timely’s All-in-One Event Calendar is a<br />revolutionary new way to find "
1858
  "and share events."
1859
 
1860
- #: public/admin/box_support.php:14
1861
  msgid "Get Add-ons"
1862
  msgstr "Get Add-ons"
1863
 
1864
- #: public/admin/box_support.php:15
1865
  msgid "Support"
1866
  msgstr "Support"
1867
 
1868
- #: public/admin/box_support.php:16
1869
- msgid "Time.ly Events"
1870
- msgstr "Time.ly Events"
1871
 
1872
- #: public/admin/box_support.php:20
1873
  msgid "Timely News"
1874
  msgstr "Timely News"
1875
 
1876
- #: public/admin/box_support.php:24
1877
  msgid "view all news"
1878
  msgstr "view all news"
1879
 
1880
- #: public/admin/box_support.php:64
1881
  msgid "Follow @_Timely"
1882
  msgstr "Follow @_Timely"
1883
 
@@ -1905,27 +1634,27 @@ msgstr "(Time zone: %s)"
1905
  msgid "End date / time"
1906
  msgstr "End date / time"
1907
 
1908
- #: public/admin/box_time_and_date.php:91
1909
  msgid "Repeat"
1910
  msgstr "Repeat"
1911
 
1912
- #: public/admin/box_time_and_date.php:110
1913
  msgid "Exclude"
1914
  msgstr "Exclude"
1915
 
1916
- #: public/admin/box_time_and_date.php:119
1917
  msgid "Choose a rule for exclusion"
1918
  msgstr "Choose a rule for exclusion"
1919
 
1920
- #: public/admin/box_time_and_date.php:126
1921
  msgid "Exclude dates"
1922
  msgstr "Exclude dates"
1923
 
1924
- #: public/admin/box_time_and_date.php:133
1925
  msgid "Select date range"
1926
  msgstr "Select date range"
1927
 
1928
- #: public/admin/box_time_and_date.php:140
1929
  msgid "Choose specific dates to exclude"
1930
  msgstr "Choose specific dates to exclude"
1931
 
@@ -1941,6 +1670,10 @@ msgstr ""
1941
  "to the All-in-One Event Calendar by <a href=\"http://time.ly/\" target="
1942
  "\"_blank\">Timely</a>"
1943
 
 
 
 
 
1944
  #: public/admin/calendar_tasks.php:16
1945
  msgid "Add a new event to the calendar."
1946
  msgstr "Add a new event to the calendar."
@@ -2364,9 +2097,9 @@ msgstr "Today background"
2364
  msgid "All-in-One Event Calendar by Time.ly"
2365
  msgstr "All-in-One Event Calendar by Time.ly"
2366
 
2367
- #. #-#-#-#-# all-in-one-event-calendar.pot (All-in-One Event Calendar by Time.ly 2.0.6) #-#-#-#-#
2368
  #. Plugin URI of the plugin/theme
2369
- #. #-#-#-#-# all-in-one-event-calendar.pot (All-in-One Event Calendar by Time.ly 2.0.6) #-#-#-#-#
2370
  #. Author URI of the plugin/theme
2371
  msgid "http://time.ly/"
2372
  msgstr "http://time.ly/"
2
  # This file is distributed under the same license as the All-in-One Event Calendar by Time.ly package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: All-in-One Event Calendar by Time.ly 2.0.7\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/all-in-one-event-calendar\n"
7
+ "POT-Creation-Date: 2014-05-13 16:04:05+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2014-05-13 19:04+0300\n"
12
  "Last-Translator: Timely <support@time.ly>\n"
13
  "Language-Team:\n"
14
 
39
  msgid "Calendar Themes"
40
  msgstr "Calendar Themes"
41
 
42
+ #: app/controller/front.php:808
43
  msgid ""
44
  "Your database is found to be corrupt. Likely previous update has failed. "
45
  "Please restore All-in-One Event Calendar tables from a backup and retry."
115
  "The URL you have entered seems to be invalid. Please remember that URLs must "
116
  "start with either \"http://\" or \"https://\"."
117
 
118
+ #: app/model/event/parent.php:186
119
+ msgid "Edit &#8220;%s&#8221;"
120
+ msgstr "Edit &#8220;%s&#8221;"
121
+
122
+ #: app/model/event/parent.php:193
123
+ msgid "Base Event"
124
+ msgstr "Base Event"
125
+
126
  #: app/model/settings.php:325
127
+ #: lib/html/element/setting/calendar-page-selector.php:50
128
  msgid "Calendar page"
129
  msgstr "Calendar page"
130
 
392
  msgid "Event Details"
393
  msgstr "Event Details"
394
 
395
+ #: app/view/admin/add-new-event.php:311
396
  msgid "Publish"
397
  msgstr "Publish"
398
 
399
+ #: app/view/admin/add-new-event.php:312
400
  msgid "Update"
401
  msgstr "Update"
402
 
403
+ #: app/view/admin/add-new-event.php:314
404
  msgid "Submit for Review"
405
  msgstr "Submit for Review"
406
 
630
  msgid "Save Settings"
631
  msgstr "Save Settings"
632
 
633
+ #: app/view/admin/settings.php:178
634
+ msgid ""
635
+ "If the form below is not working please follow <a href=\"%s\">this link</a>."
636
+ msgstr ""
637
+ "If the form below is not working please follow <a href=\"%s\">this link</a>."
638
+
639
  #: app/view/admin/theme-options.php:50 app/view/admin/theme-options.php:51
640
  msgid "Theme Options"
641
  msgstr "Theme Options"
718
  msgstr "Back to Calendar"
719
 
720
  #: app/view/event/content.php:121
721
+ msgid "View all events"
722
+ msgstr "View all events"
723
 
724
  #: app/view/event/post.php:29
725
  msgid "Event updated. <a href=\"%s\">View event</a>"
772
  msgstr ""
773
  "Event draft updated. <a target=\"_blank\" href=\"%s\">Preview event</a>"
774
 
775
+ #: app/view/event/single.php:83
776
  msgid "Edit this occurrence (%s)"
777
  msgstr "Edit this occurrence (%s)"
778
 
822
  msgid ", and "
823
  msgstr ", and "
824
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
825
  #: lib/calendar-feed/ics.php:33
826
  msgid "ICS"
827
  msgstr "ICS"
1019
  msgid "Performance Report"
1020
  msgstr "Performance Report"
1021
 
1022
+ #: lib/html/element/setting/calendar-page-selector.php:70
1023
+ msgid "View"
1024
+ msgstr "View"
1025
+
1026
+ #: lib/html/element/setting/calendar-page-selector.php:114
1027
  msgid "- Auto-Create New Page -"
1028
  msgstr "- Auto-Create New Page -"
1029
 
1030
+ #: lib/html/element/setting/tags-categories.php:39
1031
+ msgid "Tags"
1032
+ msgstr "Tags"
1033
+
1034
+ #: lib/html/element/setting/tags-categories.php:47
1035
+ msgid "Categories"
1036
+ msgstr "Categories"
1037
+
1038
  #: lib/less/variable/font.php:64
1039
  msgid "Custom..."
1040
  msgstr "Custom..."
1297
  msgid "All of this theme&#8217;s files are located in <code>%2$s</code>."
1298
  msgstr "All of this theme&#8217;s files are located in <code>%2$s</code>."
1299
 
1300
+ #: lib/theme/list.php:323 public/admin/themes.php:29
1301
+ msgid "Tags:"
1302
+ msgstr "Tags:"
1303
+
1304
  #: lib/theme/loader.php:285
1305
  msgid "We couldn't find a suitable loader for filename with extension '%s'"
1306
  msgstr "We couldn't find a suitable loader for filename with extension '%s'"
1586
  "Timely’s All-in-One Event Calendar is a<br />revolutionary new way to find "
1587
  "and share events."
1588
 
1589
+ #: public/admin/box_support.php:19
1590
  msgid "Get Add-ons"
1591
  msgstr "Get Add-ons"
1592
 
1593
+ #: public/admin/box_support.php:27
1594
  msgid "Support"
1595
  msgstr "Support"
1596
 
1597
+ #: public/admin/box_support.php:35
1598
+ msgid "Timely Events"
1599
+ msgstr "Timely Events"
1600
 
1601
+ #: public/admin/box_support.php:43
1602
  msgid "Timely News"
1603
  msgstr "Timely News"
1604
 
1605
+ #: public/admin/box_support.php:47
1606
  msgid "view all news"
1607
  msgstr "view all news"
1608
 
1609
+ #: public/admin/box_support.php:95
1610
  msgid "Follow @_Timely"
1611
  msgstr "Follow @_Timely"
1612
 
1634
  msgid "End date / time"
1635
  msgstr "End date / time"
1636
 
1637
+ #: public/admin/box_time_and_date.php:97
1638
  msgid "Repeat"
1639
  msgstr "Repeat"
1640
 
1641
+ #: public/admin/box_time_and_date.php:116
1642
  msgid "Exclude"
1643
  msgstr "Exclude"
1644
 
1645
+ #: public/admin/box_time_and_date.php:125
1646
  msgid "Choose a rule for exclusion"
1647
  msgstr "Choose a rule for exclusion"
1648
 
1649
+ #: public/admin/box_time_and_date.php:132
1650
  msgid "Exclude dates"
1651
  msgstr "Exclude dates"
1652
 
1653
+ #: public/admin/box_time_and_date.php:139
1654
  msgid "Select date range"
1655
  msgstr "Select date range"
1656
 
1657
+ #: public/admin/box_time_and_date.php:146
1658
  msgid "Choose specific dates to exclude"
1659
  msgstr "Choose specific dates to exclude"
1660
 
1670
  "to the All-in-One Event Calendar by <a href=\"http://time.ly/\" target="
1671
  "\"_blank\">Timely</a>"
1672
 
1673
+ #: public/admin/calendar_tasks.php:13
1674
+ msgid "Post Your Event"
1675
+ msgstr "Post Your Event"
1676
+
1677
  #: public/admin/calendar_tasks.php:16
1678
  msgid "Add a new event to the calendar."
1679
  msgstr "Add a new event to the calendar."
2097
  msgid "All-in-One Event Calendar by Time.ly"
2098
  msgstr "All-in-One Event Calendar by Time.ly"
2099
 
2100
+ #. #-#-#-#-# all-in-one-event-calendar.pot (All-in-One Event Calendar by Time.ly 2.0.7) #-#-#-#-#
2101
  #. Plugin URI of the plugin/theme
2102
+ #. #-#-#-#-# all-in-one-event-calendar.pot (All-in-One Event Calendar by Time.ly 2.0.7) #-#-#-#-#
2103
  #. Author URI of the plugin/theme
2104
  msgid "http://time.ly/"
2105
  msgstr "http://time.ly/"
language/all-in-one-event-calendar.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the All-in-One Event Calendar by Time.ly package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: All-in-One Event Calendar by Time.ly 2.0.6\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/all-in-one-event-calendar\n"
7
- "POT-Creation-Date: 2014-04-29 18:54:34+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -36,7 +36,7 @@ msgstr ""
36
  msgid "Calendar Themes"
37
  msgstr ""
38
 
39
- #: app/controller/front.php:786
40
  msgid ""
41
  "Your database is found to be corrupt. Likely previous update has failed. "
42
  "Please restore All-in-One Event Calendar tables from a backup and retry."
@@ -98,8 +98,16 @@ msgid ""
98
  "start with either \"http://\" or \"https://\"."
99
  msgstr ""
100
 
 
 
 
 
 
 
 
 
101
  #: app/model/settings.php:325
102
- #: lib/html/element/setting/calendar-page-selector.php:55
103
  msgid "Calendar page"
104
  msgstr ""
105
 
@@ -321,15 +329,15 @@ msgstr ""
321
  msgid "Event Details"
322
  msgstr ""
323
 
324
- #: app/view/admin/add-new-event.php:306
325
  msgid "Publish"
326
  msgstr ""
327
 
328
- #: app/view/admin/add-new-event.php:307
329
  msgid "Update"
330
  msgstr ""
331
 
332
- #: app/view/admin/add-new-event.php:309
333
  msgid "Submit for Review"
334
  msgstr ""
335
 
@@ -557,6 +565,11 @@ msgstr ""
557
  msgid "Save Settings"
558
  msgstr ""
559
 
 
 
 
 
 
560
  #: app/view/admin/theme-options.php:50 app/view/admin/theme-options.php:51
561
  msgid "Theme Options"
562
  msgstr ""
@@ -637,7 +650,7 @@ msgid "Back to Calendar"
637
  msgstr ""
638
 
639
  #: app/view/event/content.php:121
640
- msgid "Go back to event calendar"
641
  msgstr ""
642
 
643
  #: app/view/event/post.php:29
@@ -688,7 +701,7 @@ msgstr ""
688
  msgid "Event draft updated. <a target=\"_blank\" href=\"%s\">Preview event</a>"
689
  msgstr ""
690
 
691
- #: app/view/event/single.php:82
692
  msgid "Edit this occurrence (%s)"
693
  msgstr ""
694
 
@@ -738,289 +751,6 @@ msgstr ""
738
  msgid ", and "
739
  msgstr ""
740
 
741
- #: cache/twig/14/14/340e18cb8d14d82ac7e5827d0ebc22d4c122f3f55377628ee439cef60657.php:31
742
- msgid "Enabled"
743
- msgstr ""
744
-
745
- #: cache/twig/14/14/340e18cb8d14d82ac7e5827d0ebc22d4c122f3f55377628ee439cef60657.php:35
746
- msgid "Default"
747
- msgstr ""
748
-
749
- #: cache/twig/14/b3/3cdfb74dcddd288dc4f674be44f9332303e665eaaddeafa0e539e1479799.php:48
750
- msgid "Choose a date using calendar"
751
- msgstr ""
752
-
753
- #: cache/twig/22/6c/b502ceaa36d3658c4e1bc82790a015e5a6639b97464b731dc289baa619d5.php:31
754
- msgid ""
755
- "Subscribe to this calendar in your personal calendar (iCal, Outlook, etc.)"
756
- msgstr ""
757
-
758
- #: cache/twig/22/6c/b502ceaa36d3658c4e1bc82790a015e5a6639b97464b731dc289baa619d5.php:48
759
- msgid "Subscribe to filtered calendar"
760
- msgstr ""
761
-
762
- #: cache/twig/22/6c/b502ceaa36d3658c4e1bc82790a015e5a6639b97464b731dc289baa619d5.php:54
763
- msgid "Subscribe"
764
- msgstr ""
765
-
766
- #: cache/twig/22/6c/b502ceaa36d3658c4e1bc82790a015e5a6639b97464b731dc289baa619d5.php:77
767
- msgid "Subscribe to this calendar in your Google Calendar"
768
- msgstr ""
769
-
770
- #: cache/twig/22/6c/b502ceaa36d3658c4e1bc82790a015e5a6639b97464b731dc289baa619d5.php:91
771
- msgid "Add to Google"
772
- msgstr ""
773
-
774
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:26
775
- msgid "Embed the calendar using the Super Widget"
776
- msgstr ""
777
-
778
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:36
779
- msgid ""
780
- "You can also embed a calendar into a remote webpage (for example, a static "
781
- "HTML page hosted on a different server). Here's how:"
782
- msgstr ""
783
-
784
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:42
785
- msgid "Add this line just before the closing <code>&lt;/head&gt;</code> tag:"
786
- msgstr ""
787
-
788
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:52
789
- msgid ""
790
- "Insert this markup where you would like to embed the Super Widget (using "
791
- "default options):"
792
- msgstr ""
793
-
794
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:60
795
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:67
796
- msgid "Optional."
797
- msgstr ""
798
-
799
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:64
800
- msgid "Add options to your Super Widget:"
801
- msgstr ""
802
-
803
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:70
804
- msgid "Posterboard view:"
805
- msgstr ""
806
-
807
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:74
808
- msgid "Stream view:"
809
- msgstr ""
810
-
811
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:78
812
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:41
813
- msgid "Month view:"
814
- msgstr ""
815
-
816
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:82
817
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:45
818
- msgid "Week view:"
819
- msgstr ""
820
-
821
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:86
822
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:49
823
- msgid "Day view:"
824
- msgstr ""
825
-
826
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:90
827
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:53
828
- msgid "Agenda view:"
829
- msgstr ""
830
-
831
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:94
832
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:61
833
- msgid "Default view as per settings:"
834
- msgstr ""
835
-
836
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:99
837
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:91
838
- msgid "Filter by event category ID:"
839
- msgstr ""
840
-
841
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:103
842
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:95
843
- msgid "Filter by event category IDs (separate IDs by comma):"
844
- msgstr ""
845
-
846
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:108
847
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:114
848
- msgid "Filter by event tag ID:"
849
- msgstr ""
850
-
851
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:112
852
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:118
853
- msgid "Filter by event tag IDs (separate IDs by comma):"
854
- msgstr ""
855
-
856
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:117
857
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:123
858
- msgid "Filter by post ID:"
859
- msgstr ""
860
-
861
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:121
862
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:127
863
- msgid "Filter by post IDs (separate IDs by comma):"
864
- msgstr ""
865
-
866
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:126
867
- msgid "Hide title and navigation buttons:"
868
- msgstr ""
869
-
870
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:131
871
- msgid "Set a default start date: *"
872
- msgstr ""
873
-
874
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:139
875
- msgid ""
876
- "* Provide a date in the same format specified by the <strong>Input dates in "
877
- "this format</strong> setting on the <strong>Adding/Editing Events</strong> "
878
- "tab."
879
- msgstr ""
880
-
881
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:145
882
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:133
883
- msgid "Warning:"
884
- msgstr ""
885
-
886
- #: cache/twig/31/41/6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php:149
887
- msgid ""
888
- "It is currently not supported to embed more than one calendar in the same "
889
- "page. Do not attempt to embed the calendar via Super Widget in a page that "
890
- "already displays the calendar."
891
- msgstr ""
892
-
893
- #: cache/twig/33/1c/dabac328da20469e2616008dc56dce67c63be852b24506548f1b388569a9.php:27
894
- msgid "All-in-One Event Calendar"
895
- msgstr ""
896
-
897
- #: cache/twig/36/41/cb5ba7ae689f85c6edb69ac8d77d4746270ac297a4aabebf1815a1d7784e.php:39
898
- msgid "Clear tag filter"
899
- msgstr ""
900
-
901
- #: cache/twig/36/41/cb5ba7ae689f85c6edb69ac8d77d4746270ac297a4aabebf1815a1d7784e.php:45
902
- #: lib/html/element/setting/tags-categories.php:39
903
- msgid "Tags"
904
- msgstr ""
905
-
906
- #: cache/twig/41/2c/390dc1284f86a5e8f726b412117f45d6b76198d80b1c3ca743b4a52d8344.php:39
907
- msgid "Clear category filter"
908
- msgstr ""
909
-
910
- #: cache/twig/41/2c/390dc1284f86a5e8f726b412117f45d6b76198d80b1c3ca743b4a52d8344.php:45
911
- #: lib/html/element/setting/tags-categories.php:47
912
- msgid "Categories"
913
- msgstr ""
914
-
915
- #: cache/twig/5d/6a/4c3721e30bde93d60edc8380d57a3856559300e77878dd71e2abdd927e2b.php:23
916
- msgid "Collapse All"
917
- msgstr ""
918
-
919
- #: cache/twig/5d/6a/4c3721e30bde93d60edc8380d57a3856559300e77878dd71e2abdd927e2b.php:29
920
- msgid "Expand All"
921
- msgstr ""
922
-
923
- #: cache/twig/80/49/21f13f8c6c3ea945cecbea222634076899d945460d6d1d07fc875e75fc1e.php:31
924
- msgid "Add Your Calendar Feed"
925
- msgstr ""
926
-
927
- #: cache/twig/80/49/21f13f8c6c3ea945cecbea222634076899d945460d6d1d07fc875e75fc1e.php:57
928
- #: public/admin/calendar_tasks.php:13
929
- msgid "Post Your Event"
930
- msgstr ""
931
-
932
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:26
933
- msgid "Embed the calendar using a shortcode"
934
- msgstr ""
935
-
936
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:36
937
- msgid ""
938
- "Insert one of these shortcodes into your page body to embed the calendar "
939
- "into any arbitrary WordPress Page:"
940
- msgstr ""
941
-
942
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:57
943
- msgid "Some Other view:"
944
- msgstr ""
945
-
946
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:71
947
- msgid ""
948
- "Add options to display a filtered calender. (You can find out category and "
949
- "tag IDs by inspecting the URL of your filtered calendar page.)"
950
- msgstr ""
951
-
952
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:77
953
- msgid "Filter by event category name/slug:"
954
- msgstr ""
955
-
956
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:79
957
- msgid "Holidays"
958
- msgstr ""
959
-
960
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:83
961
- msgid "Filter by event category names/slugs (separate names by comma):"
962
- msgstr ""
963
-
964
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:85
965
- msgid "Lunar Cycles"
966
- msgstr ""
967
-
968
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:87
969
- msgid "zodiac-date-ranges"
970
- msgstr ""
971
-
972
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:100
973
- msgid "Filter by event tag name/slug:"
974
- msgstr ""
975
-
976
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:102
977
- msgid "tips-and-tricks"
978
- msgstr ""
979
-
980
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:106
981
- msgid "Filter by event tag names/slugs (separate names by comma):"
982
- msgstr ""
983
-
984
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:108
985
- msgid "creative writing"
986
- msgstr ""
987
-
988
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:110
989
- msgid "performing arts"
990
- msgstr ""
991
-
992
- #: cache/twig/ca/44/0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php:137
993
- msgid ""
994
- "It is currently not supported to embed more than one calendar in the same "
995
- "page. Do not attempt to embed the calendar via shortcode in a page that "
996
- "already displays the calendar."
997
- msgstr ""
998
-
999
- #: cache/twig/d5/ea/0f196084548c56e9b17f48b3fa082f54fbf3f61f088b55acd91d52e27130.php:30
1000
- msgid "There are no upcoming events to display at this time."
1001
- msgstr ""
1002
-
1003
- #: cache/twig/d5/ea/0f196084548c56e9b17f48b3fa082f54fbf3f61f088b55acd91d52e27130.php:130
1004
- msgid "@ %s"
1005
- msgstr ""
1006
-
1007
- #: cache/twig/d5/ea/0f196084548c56e9b17f48b3fa082f54fbf3f61f088b55acd91d52e27130.php:149
1008
- msgid "Edit"
1009
- msgstr ""
1010
-
1011
- #: cache/twig/d5/ea/0f196084548c56e9b17f48b3fa082f54fbf3f61f088b55acd91d52e27130.php:219
1012
- msgid "Read more"
1013
- msgstr ""
1014
-
1015
- #: cache/twig/d5/ea/0f196084548c56e9b17f48b3fa082f54fbf3f61f088b55acd91d52e27130.php:238
1016
- msgid "Categories:"
1017
- msgstr ""
1018
-
1019
- #: cache/twig/d5/ea/0f196084548c56e9b17f48b3fa082f54fbf3f61f088b55acd91d52e27130.php:257
1020
- #: lib/theme/list.php:323 public/admin/themes.php:29
1021
- msgid "Tags:"
1022
- msgstr ""
1023
-
1024
  #: lib/calendar-feed/ics.php:33
1025
  msgid "ICS"
1026
  msgstr ""
@@ -1197,10 +927,22 @@ msgstr ""
1197
  msgid "Performance Report"
1198
  msgstr ""
1199
 
1200
- #: lib/html/element/setting/calendar-page-selector.php:111
 
 
 
 
1201
  msgid "- Auto-Create New Page -"
1202
  msgstr ""
1203
 
 
 
 
 
 
 
 
 
1204
  #: lib/less/variable/font.php:64
1205
  msgid "Custom..."
1206
  msgstr ""
@@ -1448,6 +1190,10 @@ msgstr ""
1448
  msgid "All of this theme&#8217;s files are located in <code>%2$s</code>."
1449
  msgstr ""
1450
 
 
 
 
 
1451
  #: lib/theme/loader.php:285
1452
  msgid "We couldn't find a suitable loader for filename with extension '%s'"
1453
  msgstr ""
@@ -1724,27 +1470,27 @@ msgid ""
1724
  "and share events."
1725
  msgstr ""
1726
 
1727
- #: public/admin/box_support.php:14
1728
  msgid "Get Add-ons"
1729
  msgstr ""
1730
 
1731
- #: public/admin/box_support.php:15
1732
  msgid "Support"
1733
  msgstr ""
1734
 
1735
- #: public/admin/box_support.php:16
1736
- msgid "Time.ly Events"
1737
  msgstr ""
1738
 
1739
- #: public/admin/box_support.php:20
1740
  msgid "Timely News"
1741
  msgstr ""
1742
 
1743
- #: public/admin/box_support.php:24
1744
  msgid "view all news"
1745
  msgstr ""
1746
 
1747
- #: public/admin/box_support.php:64
1748
  msgid "Follow @_Timely"
1749
  msgstr ""
1750
 
@@ -1772,27 +1518,27 @@ msgstr ""
1772
  msgid "End date / time"
1773
  msgstr ""
1774
 
1775
- #: public/admin/box_time_and_date.php:91
1776
  msgid "Repeat"
1777
  msgstr ""
1778
 
1779
- #: public/admin/box_time_and_date.php:110
1780
  msgid "Exclude"
1781
  msgstr ""
1782
 
1783
- #: public/admin/box_time_and_date.php:119
1784
  msgid "Choose a rule for exclusion"
1785
  msgstr ""
1786
 
1787
- #: public/admin/box_time_and_date.php:126
1788
  msgid "Exclude dates"
1789
  msgstr ""
1790
 
1791
- #: public/admin/box_time_and_date.php:133
1792
  msgid "Select date range"
1793
  msgstr ""
1794
 
1795
- #: public/admin/box_time_and_date.php:140
1796
  msgid "Choose specific dates to exclude"
1797
  msgstr ""
1798
 
@@ -1806,6 +1552,10 @@ msgid ""
1806
  "\"_blank\">Timely</a>"
1807
  msgstr ""
1808
 
 
 
 
 
1809
  #: public/admin/calendar_tasks.php:16
1810
  msgid "Add a new event to the calendar."
1811
  msgstr ""
@@ -2224,9 +1974,9 @@ msgstr ""
2224
  msgid "All-in-One Event Calendar by Time.ly"
2225
  msgstr ""
2226
 
2227
- #. #-#-#-#-# all-in-one-event-calendar.pot (All-in-One Event Calendar by Time.ly 2.0.6) #-#-#-#-#
2228
  #. Plugin URI of the plugin/theme
2229
- #. #-#-#-#-# all-in-one-event-calendar.pot (All-in-One Event Calendar by Time.ly 2.0.6) #-#-#-#-#
2230
  #. Author URI of the plugin/theme
2231
  msgid "http://time.ly/"
2232
  msgstr ""
2
  # This file is distributed under the same license as the All-in-One Event Calendar by Time.ly package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: All-in-One Event Calendar by Time.ly 2.0.7\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/all-in-one-event-calendar\n"
7
+ "POT-Creation-Date: 2014-05-13 16:04:05+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
36
  msgid "Calendar Themes"
37
  msgstr ""
38
 
39
+ #: app/controller/front.php:808
40
  msgid ""
41
  "Your database is found to be corrupt. Likely previous update has failed. "
42
  "Please restore All-in-One Event Calendar tables from a backup and retry."
98
  "start with either \"http://\" or \"https://\"."
99
  msgstr ""
100
 
101
+ #: app/model/event/parent.php:186
102
+ msgid "Edit &#8220;%s&#8221;"
103
+ msgstr ""
104
+
105
+ #: app/model/event/parent.php:193
106
+ msgid "Base Event"
107
+ msgstr ""
108
+
109
  #: app/model/settings.php:325
110
+ #: lib/html/element/setting/calendar-page-selector.php:50
111
  msgid "Calendar page"
112
  msgstr ""
113
 
329
  msgid "Event Details"
330
  msgstr ""
331
 
332
+ #: app/view/admin/add-new-event.php:311
333
  msgid "Publish"
334
  msgstr ""
335
 
336
+ #: app/view/admin/add-new-event.php:312
337
  msgid "Update"
338
  msgstr ""
339
 
340
+ #: app/view/admin/add-new-event.php:314
341
  msgid "Submit for Review"
342
  msgstr ""
343
 
565
  msgid "Save Settings"
566
  msgstr ""
567
 
568
+ #: app/view/admin/settings.php:178
569
+ msgid ""
570
+ "If the form below is not working please follow <a href=\"%s\">this link</a>."
571
+ msgstr ""
572
+
573
  #: app/view/admin/theme-options.php:50 app/view/admin/theme-options.php:51
574
  msgid "Theme Options"
575
  msgstr ""
650
  msgstr ""
651
 
652
  #: app/view/event/content.php:121
653
+ msgid "View all events"
654
  msgstr ""
655
 
656
  #: app/view/event/post.php:29
701
  msgid "Event draft updated. <a target=\"_blank\" href=\"%s\">Preview event</a>"
702
  msgstr ""
703
 
704
+ #: app/view/event/single.php:83
705
  msgid "Edit this occurrence (%s)"
706
  msgstr ""
707
 
751
  msgid ", and "
752
  msgstr ""
753
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
754
  #: lib/calendar-feed/ics.php:33
755
  msgid "ICS"
756
  msgstr ""
927
  msgid "Performance Report"
928
  msgstr ""
929
 
930
+ #: lib/html/element/setting/calendar-page-selector.php:70
931
+ msgid "View"
932
+ msgstr ""
933
+
934
+ #: lib/html/element/setting/calendar-page-selector.php:114
935
  msgid "- Auto-Create New Page -"
936
  msgstr ""
937
 
938
+ #: lib/html/element/setting/tags-categories.php:39
939
+ msgid "Tags"
940
+ msgstr ""
941
+
942
+ #: lib/html/element/setting/tags-categories.php:47
943
+ msgid "Categories"
944
+ msgstr ""
945
+
946
  #: lib/less/variable/font.php:64
947
  msgid "Custom..."
948
  msgstr ""
1190
  msgid "All of this theme&#8217;s files are located in <code>%2$s</code>."
1191
  msgstr ""
1192
 
1193
+ #: lib/theme/list.php:323 public/admin/themes.php:29
1194
+ msgid "Tags:"
1195
+ msgstr ""
1196
+
1197
  #: lib/theme/loader.php:285
1198
  msgid "We couldn't find a suitable loader for filename with extension '%s'"
1199
  msgstr ""
1470
  "and share events."
1471
  msgstr ""
1472
 
1473
+ #: public/admin/box_support.php:19
1474
  msgid "Get Add-ons"
1475
  msgstr ""
1476
 
1477
+ #: public/admin/box_support.php:27
1478
  msgid "Support"
1479
  msgstr ""
1480
 
1481
+ #: public/admin/box_support.php:35
1482
+ msgid "Timely Events"
1483
  msgstr ""
1484
 
1485
+ #: public/admin/box_support.php:43
1486
  msgid "Timely News"
1487
  msgstr ""
1488
 
1489
+ #: public/admin/box_support.php:47
1490
  msgid "view all news"
1491
  msgstr ""
1492
 
1493
+ #: public/admin/box_support.php:95
1494
  msgid "Follow @_Timely"
1495
  msgstr ""
1496
 
1518
  msgid "End date / time"
1519
  msgstr ""
1520
 
1521
+ #: public/admin/box_time_and_date.php:97
1522
  msgid "Repeat"
1523
  msgstr ""
1524
 
1525
+ #: public/admin/box_time_and_date.php:116
1526
  msgid "Exclude"
1527
  msgstr ""
1528
 
1529
+ #: public/admin/box_time_and_date.php:125
1530
  msgid "Choose a rule for exclusion"
1531
  msgstr ""
1532
 
1533
+ #: public/admin/box_time_and_date.php:132
1534
  msgid "Exclude dates"
1535
  msgstr ""
1536
 
1537
+ #: public/admin/box_time_and_date.php:139
1538
  msgid "Select date range"
1539
  msgstr ""
1540
 
1541
+ #: public/admin/box_time_and_date.php:146
1542
  msgid "Choose specific dates to exclude"
1543
  msgstr ""
1544
 
1552
  "\"_blank\">Timely</a>"
1553
  msgstr ""
1554
 
1555
+ #: public/admin/calendar_tasks.php:13
1556
+ msgid "Post Your Event"
1557
+ msgstr ""
1558
+
1559
  #: public/admin/calendar_tasks.php:16
1560
  msgid "Add a new event to the calendar."
1561
  msgstr ""
1974
  msgid "All-in-One Event Calendar by Time.ly"
1975
  msgstr ""
1976
 
1977
+ #. #-#-#-#-# all-in-one-event-calendar.pot (All-in-One Event Calendar by Time.ly 2.0.7) #-#-#-#-#
1978
  #. Plugin URI of the plugin/theme
1979
+ #. #-#-#-#-# all-in-one-event-calendar.pot (All-in-One Event Calendar by Time.ly 2.0.7) #-#-#-#-#
1980
  #. Author URI of the plugin/theme
1981
  msgid "http://time.ly/"
1982
  msgstr ""
lib/bootstrap/loader-map.php CHANGED
@@ -212,6 +212,13 @@
212
  'i' => 'g',
213
  'r' => 'y',
214
  ),
 
 
 
 
 
 
 
215
  'Ai1ec_Command_Export_Events' =>
216
  array (
217
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'command' . DIRECTORY_SEPARATOR . 'export-events.php',
@@ -500,6 +507,13 @@
500
  'c' => 'Ai1ec_Event_Not_Found_Exception',
501
  'i' => 'g',
502
  ),
 
 
 
 
 
 
 
503
  'Ai1ec_Event_Search' =>
504
  array (
505
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR . 'search.php',
@@ -2449,192 +2463,6 @@
2449
  'c' => 'Twig_TokenStream',
2450
  'i' => 'g',
2451
  ),
2452
- '__TwigTemplate_0390aeab35788b09647b9a02c8610d09925aabc8c355462d95b2a35074e72577' =>
2453
- array (
2454
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '03' . DIRECTORY_SEPARATOR . '90' . DIRECTORY_SEPARATOR . 'aeab35788b09647b9a02c8610d09925aabc8c355462d95b2a35074e72577.php',
2455
- 'c' => '__TwigTemplate_0390aeab35788b09647b9a02c8610d09925aabc8c355462d95b2a35074e72577',
2456
- 'i' => 'g',
2457
- ),
2458
- '__TwigTemplate_0d04fd8553709f7381252f5b9560ca2f467a3f832e7ef50112df9766d36955eb' =>
2459
- array (
2460
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '0d' . DIRECTORY_SEPARATOR . '04' . DIRECTORY_SEPARATOR . 'fd8553709f7381252f5b9560ca2f467a3f832e7ef50112df9766d36955eb.php',
2461
- 'c' => '__TwigTemplate_0d04fd8553709f7381252f5b9560ca2f467a3f832e7ef50112df9766d36955eb',
2462
- 'i' => 'g',
2463
- ),
2464
- '__TwigTemplate_1414340e18cb8d14d82ac7e5827d0ebc22d4c122f3f55377628ee439cef60657' =>
2465
- array (
2466
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '14' . DIRECTORY_SEPARATOR . '14' . DIRECTORY_SEPARATOR . '340e18cb8d14d82ac7e5827d0ebc22d4c122f3f55377628ee439cef60657.php',
2467
- 'c' => '__TwigTemplate_1414340e18cb8d14d82ac7e5827d0ebc22d4c122f3f55377628ee439cef60657',
2468
- 'i' => 'g',
2469
- ),
2470
- '__TwigTemplate_14b33cdfb74dcddd288dc4f674be44f9332303e665eaaddeafa0e539e1479799' =>
2471
- array (
2472
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '14' . DIRECTORY_SEPARATOR . 'b3' . DIRECTORY_SEPARATOR . '3cdfb74dcddd288dc4f674be44f9332303e665eaaddeafa0e539e1479799.php',
2473
- 'c' => '__TwigTemplate_14b33cdfb74dcddd288dc4f674be44f9332303e665eaaddeafa0e539e1479799',
2474
- 'i' => 'g',
2475
- ),
2476
- '__TwigTemplate_18526ce85d9ef23252ecf5353debe4749659b49f5d284d268fdbbc55fedad96b' =>
2477
- array (
2478
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '18' . DIRECTORY_SEPARATOR . '52' . DIRECTORY_SEPARATOR . '6ce85d9ef23252ecf5353debe4749659b49f5d284d268fdbbc55fedad96b.php',
2479
- 'c' => '__TwigTemplate_18526ce85d9ef23252ecf5353debe4749659b49f5d284d268fdbbc55fedad96b',
2480
- 'i' => 'g',
2481
- ),
2482
- '__TwigTemplate_1fb0d88f9b3ac4ab4ff245818fcab511b01e585cb62249022aa123e722a52428' =>
2483
- array (
2484
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '1f' . DIRECTORY_SEPARATOR . 'b0' . DIRECTORY_SEPARATOR . 'd88f9b3ac4ab4ff245818fcab511b01e585cb62249022aa123e722a52428.php',
2485
- 'c' => '__TwigTemplate_1fb0d88f9b3ac4ab4ff245818fcab511b01e585cb62249022aa123e722a52428',
2486
- 'i' => 'g',
2487
- ),
2488
- '__TwigTemplate_226cb502ceaa36d3658c4e1bc82790a015e5a6639b97464b731dc289baa619d5' =>
2489
- array (
2490
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '22' . DIRECTORY_SEPARATOR . '6c' . DIRECTORY_SEPARATOR . 'b502ceaa36d3658c4e1bc82790a015e5a6639b97464b731dc289baa619d5.php',
2491
- 'c' => '__TwigTemplate_226cb502ceaa36d3658c4e1bc82790a015e5a6639b97464b731dc289baa619d5',
2492
- 'i' => 'g',
2493
- ),
2494
- '__TwigTemplate_281c29136b7dcb658210fac8a4bd81007f1c9b21b1d7579cdaa987e5fb6d4d4c' =>
2495
- array (
2496
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '28' . DIRECTORY_SEPARATOR . '1c' . DIRECTORY_SEPARATOR . '29136b7dcb658210fac8a4bd81007f1c9b21b1d7579cdaa987e5fb6d4d4c.php',
2497
- 'c' => '__TwigTemplate_281c29136b7dcb658210fac8a4bd81007f1c9b21b1d7579cdaa987e5fb6d4d4c',
2498
- 'i' => 'g',
2499
- ),
2500
- '__TwigTemplate_31416a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848' =>
2501
- array (
2502
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '31' . DIRECTORY_SEPARATOR . '41' . DIRECTORY_SEPARATOR . '6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php',
2503
- 'c' => '__TwigTemplate_31416a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848',
2504
- 'i' => 'g',
2505
- ),
2506
- '__TwigTemplate_331cdabac328da20469e2616008dc56dce67c63be852b24506548f1b388569a9' =>
2507
- array (
2508
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '33' . DIRECTORY_SEPARATOR . '1c' . DIRECTORY_SEPARATOR . 'dabac328da20469e2616008dc56dce67c63be852b24506548f1b388569a9.php',
2509
- 'c' => '__TwigTemplate_331cdabac328da20469e2616008dc56dce67c63be852b24506548f1b388569a9',
2510
- 'i' => 'g',
2511
- ),
2512
- '__TwigTemplate_3641cb5ba7ae689f85c6edb69ac8d77d4746270ac297a4aabebf1815a1d7784e' =>
2513
- array (
2514
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '36' . DIRECTORY_SEPARATOR . '41' . DIRECTORY_SEPARATOR . 'cb5ba7ae689f85c6edb69ac8d77d4746270ac297a4aabebf1815a1d7784e.php',
2515
- 'c' => '__TwigTemplate_3641cb5ba7ae689f85c6edb69ac8d77d4746270ac297a4aabebf1815a1d7784e',
2516
- 'i' => 'g',
2517
- ),
2518
- '__TwigTemplate_3f6c8cdc781204b2b1401ef907fcddb9c3cb7cd72d4b0b8f5abf450db9eaf16a' =>
2519
- array (
2520
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '3f' . DIRECTORY_SEPARATOR . '6c' . DIRECTORY_SEPARATOR . '8cdc781204b2b1401ef907fcddb9c3cb7cd72d4b0b8f5abf450db9eaf16a.php',
2521
- 'c' => '__TwigTemplate_3f6c8cdc781204b2b1401ef907fcddb9c3cb7cd72d4b0b8f5abf450db9eaf16a',
2522
- 'i' => 'g',
2523
- ),
2524
- '__TwigTemplate_412c390dc1284f86a5e8f726b412117f45d6b76198d80b1c3ca743b4a52d8344' =>
2525
- array (
2526
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '41' . DIRECTORY_SEPARATOR . '2c' . DIRECTORY_SEPARATOR . '390dc1284f86a5e8f726b412117f45d6b76198d80b1c3ca743b4a52d8344.php',
2527
- 'c' => '__TwigTemplate_412c390dc1284f86a5e8f726b412117f45d6b76198d80b1c3ca743b4a52d8344',
2528
- 'i' => 'g',
2529
- ),
2530
- '__TwigTemplate_5528bfcb0e0fa8155e3469092a742b5dad7834ca41009ce1db3bfa8e0c5ebc40' =>
2531
- array (
2532
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '55' . DIRECTORY_SEPARATOR . '28' . DIRECTORY_SEPARATOR . 'bfcb0e0fa8155e3469092a742b5dad7834ca41009ce1db3bfa8e0c5ebc40.php',
2533
- 'c' => '__TwigTemplate_5528bfcb0e0fa8155e3469092a742b5dad7834ca41009ce1db3bfa8e0c5ebc40',
2534
- 'i' => 'g',
2535
- ),
2536
- '__TwigTemplate_583af310a4ee1526dbd6cad652585947c2eef7470a0862828301ed48ad41615e' =>
2537
- array (
2538
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '58' . DIRECTORY_SEPARATOR . '3a' . DIRECTORY_SEPARATOR . 'f310a4ee1526dbd6cad652585947c2eef7470a0862828301ed48ad41615e.php',
2539
- 'c' => '__TwigTemplate_583af310a4ee1526dbd6cad652585947c2eef7470a0862828301ed48ad41615e',
2540
- 'i' => 'g',
2541
- ),
2542
- '__TwigTemplate_5d6a4c3721e30bde93d60edc8380d57a3856559300e77878dd71e2abdd927e2b' =>
2543
- array (
2544
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '5d' . DIRECTORY_SEPARATOR . '6a' . DIRECTORY_SEPARATOR . '4c3721e30bde93d60edc8380d57a3856559300e77878dd71e2abdd927e2b.php',
2545
- 'c' => '__TwigTemplate_5d6a4c3721e30bde93d60edc8380d57a3856559300e77878dd71e2abdd927e2b',
2546
- 'i' => 'g',
2547
- ),
2548
- '__TwigTemplate_5fd54eb14d711093fc6d960237fd8b483db342d780035d2e2e9c6e5632cde5b4' =>
2549
- array (
2550
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '5f' . DIRECTORY_SEPARATOR . 'd5' . DIRECTORY_SEPARATOR . '4eb14d711093fc6d960237fd8b483db342d780035d2e2e9c6e5632cde5b4.php',
2551
- 'c' => '__TwigTemplate_5fd54eb14d711093fc6d960237fd8b483db342d780035d2e2e9c6e5632cde5b4',
2552
- 'i' => 'g',
2553
- ),
2554
- '__TwigTemplate_70abe50c784c9a3bffa0427eda1d918d3e98e322a131f5635f89c98fbe8a74a6' =>
2555
- array (
2556
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '70' . DIRECTORY_SEPARATOR . 'ab' . DIRECTORY_SEPARATOR . 'e50c784c9a3bffa0427eda1d918d3e98e322a131f5635f89c98fbe8a74a6.php',
2557
- 'c' => '__TwigTemplate_70abe50c784c9a3bffa0427eda1d918d3e98e322a131f5635f89c98fbe8a74a6',
2558
- 'i' => 'g',
2559
- ),
2560
- '__TwigTemplate_804921f13f8c6c3ea945cecbea222634076899d945460d6d1d07fc875e75fc1e' =>
2561
- array (
2562
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '80' . DIRECTORY_SEPARATOR . '49' . DIRECTORY_SEPARATOR . '21f13f8c6c3ea945cecbea222634076899d945460d6d1d07fc875e75fc1e.php',
2563
- 'c' => '__TwigTemplate_804921f13f8c6c3ea945cecbea222634076899d945460d6d1d07fc875e75fc1e',
2564
- 'i' => 'g',
2565
- ),
2566
- '__TwigTemplate_94a55324d66efe7f3272ca99629344807932939c4dd45bc3477dbddba77adcbb' =>
2567
- array (
2568
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '94' . DIRECTORY_SEPARATOR . 'a5' . DIRECTORY_SEPARATOR . '5324d66efe7f3272ca99629344807932939c4dd45bc3477dbddba77adcbb.php',
2569
- 'c' => '__TwigTemplate_94a55324d66efe7f3272ca99629344807932939c4dd45bc3477dbddba77adcbb',
2570
- 'i' => 'g',
2571
- ),
2572
- '__TwigTemplate_a64d88cdfa6f8bc13511e76d870e4326feee3c2172402687d71f852eb6b8c758' =>
2573
- array (
2574
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'a6' . DIRECTORY_SEPARATOR . '4d' . DIRECTORY_SEPARATOR . '88cdfa6f8bc13511e76d870e4326feee3c2172402687d71f852eb6b8c758.php',
2575
- 'c' => '__TwigTemplate_a64d88cdfa6f8bc13511e76d870e4326feee3c2172402687d71f852eb6b8c758',
2576
- 'i' => 'g',
2577
- ),
2578
- '__TwigTemplate_ab8ff375c058e5b3ddf71337cc5f39b08710362b0cb927ab047fc87531354ec3' =>
2579
- array (
2580
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'ab' . DIRECTORY_SEPARATOR . '8f' . DIRECTORY_SEPARATOR . 'f375c058e5b3ddf71337cc5f39b08710362b0cb927ab047fc87531354ec3.php',
2581
- 'c' => '__TwigTemplate_ab8ff375c058e5b3ddf71337cc5f39b08710362b0cb927ab047fc87531354ec3',
2582
- 'i' => 'g',
2583
- ),
2584
- '__TwigTemplate_b8dc20c6d89f8151e76fcd838573c80d2fe6d63fa3b5f209fbb25455fcbaa861' =>
2585
- array (
2586
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'b8' . DIRECTORY_SEPARATOR . 'dc' . DIRECTORY_SEPARATOR . '20c6d89f8151e76fcd838573c80d2fe6d63fa3b5f209fbb25455fcbaa861.php',
2587
- 'c' => '__TwigTemplate_b8dc20c6d89f8151e76fcd838573c80d2fe6d63fa3b5f209fbb25455fcbaa861',
2588
- 'i' => 'g',
2589
- ),
2590
- '__TwigTemplate_c3efa6c892e192ab677abaa0a51f9dce404bdb09045156b1e62e6ad503db8838' =>
2591
- array (
2592
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'c3' . DIRECTORY_SEPARATOR . 'ef' . DIRECTORY_SEPARATOR . 'a6c892e192ab677abaa0a51f9dce404bdb09045156b1e62e6ad503db8838.php',
2593
- 'c' => '__TwigTemplate_c3efa6c892e192ab677abaa0a51f9dce404bdb09045156b1e62e6ad503db8838',
2594
- 'i' => 'g',
2595
- ),
2596
- '__TwigTemplate_ca440aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b' =>
2597
- array (
2598
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'ca' . DIRECTORY_SEPARATOR . '44' . DIRECTORY_SEPARATOR . '0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php',
2599
- 'c' => '__TwigTemplate_ca440aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b',
2600
- 'i' => 'g',
2601
- ),
2602
- '__TwigTemplate_ce724c7cb5cac3cffd05dcac960e0136a91e09c2281d281c2aa076bb92249201' =>
2603
- array (
2604
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'ce' . DIRECTORY_SEPARATOR . '72' . DIRECTORY_SEPARATOR . '4c7cb5cac3cffd05dcac960e0136a91e09c2281d281c2aa076bb92249201.php',
2605
- 'c' => '__TwigTemplate_ce724c7cb5cac3cffd05dcac960e0136a91e09c2281d281c2aa076bb92249201',
2606
- 'i' => 'g',
2607
- ),
2608
- '__TwigTemplate_d465fa726b6c76aa0ab1e5bd1ce6c787ea379c52871b80bf7fa0ff0b1ec788a8' =>
2609
- array (
2610
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'd4' . DIRECTORY_SEPARATOR . '65' . DIRECTORY_SEPARATOR . 'fa726b6c76aa0ab1e5bd1ce6c787ea379c52871b80bf7fa0ff0b1ec788a8.php',
2611
- 'c' => '__TwigTemplate_d465fa726b6c76aa0ab1e5bd1ce6c787ea379c52871b80bf7fa0ff0b1ec788a8',
2612
- 'i' => 'g',
2613
- ),
2614
- '__TwigTemplate_d5ea0f196084548c56e9b17f48b3fa082f54fbf3f61f088b55acd91d52e27130' =>
2615
- array (
2616
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'd5' . DIRECTORY_SEPARATOR . 'ea' . DIRECTORY_SEPARATOR . '0f196084548c56e9b17f48b3fa082f54fbf3f61f088b55acd91d52e27130.php',
2617
- 'c' => '__TwigTemplate_d5ea0f196084548c56e9b17f48b3fa082f54fbf3f61f088b55acd91d52e27130',
2618
- 'i' => 'g',
2619
- ),
2620
- '__TwigTemplate_ddc2602f6650e55fce9a9402a7d1062a4384aac357c8b7840b338904a647fe10' =>
2621
- array (
2622
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'dd' . DIRECTORY_SEPARATOR . 'c2' . DIRECTORY_SEPARATOR . '602f6650e55fce9a9402a7d1062a4384aac357c8b7840b338904a647fe10.php',
2623
- 'c' => '__TwigTemplate_ddc2602f6650e55fce9a9402a7d1062a4384aac357c8b7840b338904a647fe10',
2624
- 'i' => 'g',
2625
- ),
2626
- '__TwigTemplate_edbe11913727712f3aeca5bcd9308202e49470f0f1d80fdeeab130a9c38ae967' =>
2627
- array (
2628
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'ed' . DIRECTORY_SEPARATOR . 'be' . DIRECTORY_SEPARATOR . '11913727712f3aeca5bcd9308202e49470f0f1d80fdeeab130a9c38ae967.php',
2629
- 'c' => '__TwigTemplate_edbe11913727712f3aeca5bcd9308202e49470f0f1d80fdeeab130a9c38ae967',
2630
- 'i' => 'g',
2631
- ),
2632
- '__TwigTemplate_f8b8d195bb5bb7102497fc98dcb0702f082b666aaae80097e97d1302a5c5343a' =>
2633
- array (
2634
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'f8' . DIRECTORY_SEPARATOR . 'b8' . DIRECTORY_SEPARATOR . 'd195bb5bb7102497fc98dcb0702f082b666aaae80097e97d1302a5c5343a.php',
2635
- 'c' => '__TwigTemplate_f8b8d195bb5bb7102497fc98dcb0702f082b666aaae80097e97d1302a5c5343a',
2636
- 'i' => 'g',
2637
- ),
2638
  'acl.aco' =>
2639
  array (
2640
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'acl' . DIRECTORY_SEPARATOR . 'aco.php',
@@ -2760,7 +2588,7 @@
2760
  ),
2761
  'calendarComponent' =>
2762
  array (
2763
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.16' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
2764
  'c' => 'calendarComponent',
2765
  'i' => 'g',
2766
  ),
@@ -2799,6 +2627,13 @@
2799
  'i' => 'g',
2800
  'r' => 'y',
2801
  ),
 
 
 
 
 
 
 
2802
  'command.export-events' =>
2803
  array (
2804
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'command' . DIRECTORY_SEPARATOR . 'export-events.php',
@@ -3443,15 +3278,15 @@
3443
  'c' => 'iCalcnv',
3444
  'i' => 'g',
3445
  ),
3446
- 'iCal.iCalcreator-2.16.iCalcreator.class' =>
3447
  array (
3448
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.16' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
3449
  'c' => 'iCalUtilityFunctions',
3450
  'i' => 'g',
3451
  ),
3452
  'iCalUtilityFunctions' =>
3453
  array (
3454
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.16' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
3455
  'c' => 'iCalUtilityFunctions',
3456
  'i' => 'g',
3457
  ),
@@ -3623,6 +3458,13 @@
3623
  'c' => 'Ai1ec_Event_Not_Found_Exception',
3624
  'i' => 'g',
3625
  ),
 
 
 
 
 
 
 
3626
  'model.event.taxonomy' =>
3627
  array (
3628
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR . 'event' . DIRECTORY_SEPARATOR . 'taxonomy.php',
@@ -3952,126 +3794,6 @@
3952
  'i' => 'g',
3953
  'r' => 'y',
3954
  ),
3955
- 'twig.03.90.aeab35788b09647b9a02c8610d09925aabc8c355462d95b2a35074e72577' =>
3956
- array (
3957
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '03' . DIRECTORY_SEPARATOR . '90' . DIRECTORY_SEPARATOR . 'aeab35788b09647b9a02c8610d09925aabc8c355462d95b2a35074e72577.php',
3958
- 'c' => '__TwigTemplate_0390aeab35788b09647b9a02c8610d09925aabc8c355462d95b2a35074e72577',
3959
- 'i' => 'g',
3960
- ),
3961
- 'twig.0d.04.fd8553709f7381252f5b9560ca2f467a3f832e7ef50112df9766d36955eb' =>
3962
- array (
3963
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '0d' . DIRECTORY_SEPARATOR . '04' . DIRECTORY_SEPARATOR . 'fd8553709f7381252f5b9560ca2f467a3f832e7ef50112df9766d36955eb.php',
3964
- 'c' => '__TwigTemplate_0d04fd8553709f7381252f5b9560ca2f467a3f832e7ef50112df9766d36955eb',
3965
- 'i' => 'g',
3966
- ),
3967
- 'twig.14.14.340e18cb8d14d82ac7e5827d0ebc22d4c122f3f55377628ee439cef60657' =>
3968
- array (
3969
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '14' . DIRECTORY_SEPARATOR . '14' . DIRECTORY_SEPARATOR . '340e18cb8d14d82ac7e5827d0ebc22d4c122f3f55377628ee439cef60657.php',
3970
- 'c' => '__TwigTemplate_1414340e18cb8d14d82ac7e5827d0ebc22d4c122f3f55377628ee439cef60657',
3971
- 'i' => 'g',
3972
- ),
3973
- 'twig.14.b3.3cdfb74dcddd288dc4f674be44f9332303e665eaaddeafa0e539e1479799' =>
3974
- array (
3975
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '14' . DIRECTORY_SEPARATOR . 'b3' . DIRECTORY_SEPARATOR . '3cdfb74dcddd288dc4f674be44f9332303e665eaaddeafa0e539e1479799.php',
3976
- 'c' => '__TwigTemplate_14b33cdfb74dcddd288dc4f674be44f9332303e665eaaddeafa0e539e1479799',
3977
- 'i' => 'g',
3978
- ),
3979
- 'twig.18.52.6ce85d9ef23252ecf5353debe4749659b49f5d284d268fdbbc55fedad96b' =>
3980
- array (
3981
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '18' . DIRECTORY_SEPARATOR . '52' . DIRECTORY_SEPARATOR . '6ce85d9ef23252ecf5353debe4749659b49f5d284d268fdbbc55fedad96b.php',
3982
- 'c' => '__TwigTemplate_18526ce85d9ef23252ecf5353debe4749659b49f5d284d268fdbbc55fedad96b',
3983
- 'i' => 'g',
3984
- ),
3985
- 'twig.1f.b0.d88f9b3ac4ab4ff245818fcab511b01e585cb62249022aa123e722a52428' =>
3986
- array (
3987
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '1f' . DIRECTORY_SEPARATOR . 'b0' . DIRECTORY_SEPARATOR . 'd88f9b3ac4ab4ff245818fcab511b01e585cb62249022aa123e722a52428.php',
3988
- 'c' => '__TwigTemplate_1fb0d88f9b3ac4ab4ff245818fcab511b01e585cb62249022aa123e722a52428',
3989
- 'i' => 'g',
3990
- ),
3991
- 'twig.22.6c.b502ceaa36d3658c4e1bc82790a015e5a6639b97464b731dc289baa619d5' =>
3992
- array (
3993
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '22' . DIRECTORY_SEPARATOR . '6c' . DIRECTORY_SEPARATOR . 'b502ceaa36d3658c4e1bc82790a015e5a6639b97464b731dc289baa619d5.php',
3994
- 'c' => '__TwigTemplate_226cb502ceaa36d3658c4e1bc82790a015e5a6639b97464b731dc289baa619d5',
3995
- 'i' => 'g',
3996
- ),
3997
- 'twig.28.1c.29136b7dcb658210fac8a4bd81007f1c9b21b1d7579cdaa987e5fb6d4d4c' =>
3998
- array (
3999
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '28' . DIRECTORY_SEPARATOR . '1c' . DIRECTORY_SEPARATOR . '29136b7dcb658210fac8a4bd81007f1c9b21b1d7579cdaa987e5fb6d4d4c.php',
4000
- 'c' => '__TwigTemplate_281c29136b7dcb658210fac8a4bd81007f1c9b21b1d7579cdaa987e5fb6d4d4c',
4001
- 'i' => 'g',
4002
- ),
4003
- 'twig.31.41.6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848' =>
4004
- array (
4005
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '31' . DIRECTORY_SEPARATOR . '41' . DIRECTORY_SEPARATOR . '6a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848.php',
4006
- 'c' => '__TwigTemplate_31416a842b873aa15c2afe2fd664e027ecf1ba867877537f21b06052271bb848',
4007
- 'i' => 'g',
4008
- ),
4009
- 'twig.33.1c.dabac328da20469e2616008dc56dce67c63be852b24506548f1b388569a9' =>
4010
- array (
4011
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '33' . DIRECTORY_SEPARATOR . '1c' . DIRECTORY_SEPARATOR . 'dabac328da20469e2616008dc56dce67c63be852b24506548f1b388569a9.php',
4012
- 'c' => '__TwigTemplate_331cdabac328da20469e2616008dc56dce67c63be852b24506548f1b388569a9',
4013
- 'i' => 'g',
4014
- ),
4015
- 'twig.36.41.cb5ba7ae689f85c6edb69ac8d77d4746270ac297a4aabebf1815a1d7784e' =>
4016
- array (
4017
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '36' . DIRECTORY_SEPARATOR . '41' . DIRECTORY_SEPARATOR . 'cb5ba7ae689f85c6edb69ac8d77d4746270ac297a4aabebf1815a1d7784e.php',
4018
- 'c' => '__TwigTemplate_3641cb5ba7ae689f85c6edb69ac8d77d4746270ac297a4aabebf1815a1d7784e',
4019
- 'i' => 'g',
4020
- ),
4021
- 'twig.3f.6c.8cdc781204b2b1401ef907fcddb9c3cb7cd72d4b0b8f5abf450db9eaf16a' =>
4022
- array (
4023
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '3f' . DIRECTORY_SEPARATOR . '6c' . DIRECTORY_SEPARATOR . '8cdc781204b2b1401ef907fcddb9c3cb7cd72d4b0b8f5abf450db9eaf16a.php',
4024
- 'c' => '__TwigTemplate_3f6c8cdc781204b2b1401ef907fcddb9c3cb7cd72d4b0b8f5abf450db9eaf16a',
4025
- 'i' => 'g',
4026
- ),
4027
- 'twig.41.2c.390dc1284f86a5e8f726b412117f45d6b76198d80b1c3ca743b4a52d8344' =>
4028
- array (
4029
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '41' . DIRECTORY_SEPARATOR . '2c' . DIRECTORY_SEPARATOR . '390dc1284f86a5e8f726b412117f45d6b76198d80b1c3ca743b4a52d8344.php',
4030
- 'c' => '__TwigTemplate_412c390dc1284f86a5e8f726b412117f45d6b76198d80b1c3ca743b4a52d8344',
4031
- 'i' => 'g',
4032
- ),
4033
- 'twig.55.28.bfcb0e0fa8155e3469092a742b5dad7834ca41009ce1db3bfa8e0c5ebc40' =>
4034
- array (
4035
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '55' . DIRECTORY_SEPARATOR . '28' . DIRECTORY_SEPARATOR . 'bfcb0e0fa8155e3469092a742b5dad7834ca41009ce1db3bfa8e0c5ebc40.php',
4036
- 'c' => '__TwigTemplate_5528bfcb0e0fa8155e3469092a742b5dad7834ca41009ce1db3bfa8e0c5ebc40',
4037
- 'i' => 'g',
4038
- ),
4039
- 'twig.58.3a.f310a4ee1526dbd6cad652585947c2eef7470a0862828301ed48ad41615e' =>
4040
- array (
4041
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '58' . DIRECTORY_SEPARATOR . '3a' . DIRECTORY_SEPARATOR . 'f310a4ee1526dbd6cad652585947c2eef7470a0862828301ed48ad41615e.php',
4042
- 'c' => '__TwigTemplate_583af310a4ee1526dbd6cad652585947c2eef7470a0862828301ed48ad41615e',
4043
- 'i' => 'g',
4044
- ),
4045
- 'twig.5d.6a.4c3721e30bde93d60edc8380d57a3856559300e77878dd71e2abdd927e2b' =>
4046
- array (
4047
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '5d' . DIRECTORY_SEPARATOR . '6a' . DIRECTORY_SEPARATOR . '4c3721e30bde93d60edc8380d57a3856559300e77878dd71e2abdd927e2b.php',
4048
- 'c' => '__TwigTemplate_5d6a4c3721e30bde93d60edc8380d57a3856559300e77878dd71e2abdd927e2b',
4049
- 'i' => 'g',
4050
- ),
4051
- 'twig.5f.d5.4eb14d711093fc6d960237fd8b483db342d780035d2e2e9c6e5632cde5b4' =>
4052
- array (
4053
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '5f' . DIRECTORY_SEPARATOR . 'd5' . DIRECTORY_SEPARATOR . '4eb14d711093fc6d960237fd8b483db342d780035d2e2e9c6e5632cde5b4.php',
4054
- 'c' => '__TwigTemplate_5fd54eb14d711093fc6d960237fd8b483db342d780035d2e2e9c6e5632cde5b4',
4055
- 'i' => 'g',
4056
- ),
4057
- 'twig.70.ab.e50c784c9a3bffa0427eda1d918d3e98e322a131f5635f89c98fbe8a74a6' =>
4058
- array (
4059
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '70' . DIRECTORY_SEPARATOR . 'ab' . DIRECTORY_SEPARATOR . 'e50c784c9a3bffa0427eda1d918d3e98e322a131f5635f89c98fbe8a74a6.php',
4060
- 'c' => '__TwigTemplate_70abe50c784c9a3bffa0427eda1d918d3e98e322a131f5635f89c98fbe8a74a6',
4061
- 'i' => 'g',
4062
- ),
4063
- 'twig.80.49.21f13f8c6c3ea945cecbea222634076899d945460d6d1d07fc875e75fc1e' =>
4064
- array (
4065
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '80' . DIRECTORY_SEPARATOR . '49' . DIRECTORY_SEPARATOR . '21f13f8c6c3ea945cecbea222634076899d945460d6d1d07fc875e75fc1e.php',
4066
- 'c' => '__TwigTemplate_804921f13f8c6c3ea945cecbea222634076899d945460d6d1d07fc875e75fc1e',
4067
- 'i' => 'g',
4068
- ),
4069
- 'twig.94.a5.5324d66efe7f3272ca99629344807932939c4dd45bc3477dbddba77adcbb' =>
4070
- array (
4071
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . '94' . DIRECTORY_SEPARATOR . 'a5' . DIRECTORY_SEPARATOR . '5324d66efe7f3272ca99629344807932939c4dd45bc3477dbddba77adcbb.php',
4072
- 'c' => '__TwigTemplate_94a55324d66efe7f3272ca99629344807932939c4dd45bc3477dbddba77adcbb',
4073
- 'i' => 'g',
4074
- ),
4075
  'twig.Compiler' =>
4076
  array (
4077
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'Compiler.php',
@@ -5008,42 +4730,12 @@
5008
  'c' => 'Twig_TokenStream',
5009
  'i' => 'g',
5010
  ),
5011
- 'twig.a6.4d.88cdfa6f8bc13511e76d870e4326feee3c2172402687d71f852eb6b8c758' =>
5012
- array (
5013
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'a6' . DIRECTORY_SEPARATOR . '4d' . DIRECTORY_SEPARATOR . '88cdfa6f8bc13511e76d870e4326feee3c2172402687d71f852eb6b8c758.php',
5014
- 'c' => '__TwigTemplate_a64d88cdfa6f8bc13511e76d870e4326feee3c2172402687d71f852eb6b8c758',
5015
- 'i' => 'g',
5016
- ),
5017
- 'twig.ab.8f.f375c058e5b3ddf71337cc5f39b08710362b0cb927ab047fc87531354ec3' =>
5018
- array (
5019
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'ab' . DIRECTORY_SEPARATOR . '8f' . DIRECTORY_SEPARATOR . 'f375c058e5b3ddf71337cc5f39b08710362b0cb927ab047fc87531354ec3.php',
5020
- 'c' => '__TwigTemplate_ab8ff375c058e5b3ddf71337cc5f39b08710362b0cb927ab047fc87531354ec3',
5021
- 'i' => 'g',
5022
- ),
5023
  'twig.ai1ec-extension' =>
5024
  array (
5025
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'ai1ec-extension.php',
5026
  'c' => 'Ai1ec_Twig_Ai1ec_Extension',
5027
  'i' => 'g',
5028
  ),
5029
- 'twig.b8.dc.20c6d89f8151e76fcd838573c80d2fe6d63fa3b5f209fbb25455fcbaa861' =>
5030
- array (
5031
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'b8' . DIRECTORY_SEPARATOR . 'dc' . DIRECTORY_SEPARATOR . '20c6d89f8151e76fcd838573c80d2fe6d63fa3b5f209fbb25455fcbaa861.php',
5032
- 'c' => '__TwigTemplate_b8dc20c6d89f8151e76fcd838573c80d2fe6d63fa3b5f209fbb25455fcbaa861',
5033
- 'i' => 'g',
5034
- ),
5035
- 'twig.c3.ef.a6c892e192ab677abaa0a51f9dce404bdb09045156b1e62e6ad503db8838' =>
5036
- array (
5037
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'c3' . DIRECTORY_SEPARATOR . 'ef' . DIRECTORY_SEPARATOR . 'a6c892e192ab677abaa0a51f9dce404bdb09045156b1e62e6ad503db8838.php',
5038
- 'c' => '__TwigTemplate_c3efa6c892e192ab677abaa0a51f9dce404bdb09045156b1e62e6ad503db8838',
5039
- 'i' => 'g',
5040
- ),
5041
- 'twig.ca.44.0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b' =>
5042
- array (
5043
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'ca' . DIRECTORY_SEPARATOR . '44' . DIRECTORY_SEPARATOR . '0aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b.php',
5044
- 'c' => '__TwigTemplate_ca440aa661b1c953233505b2506f7ca2ef971ece252f191fef784ea217b3981b',
5045
- 'i' => 'g',
5046
- ),
5047
  'twig.cache' =>
5048
  array (
5049
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'cache.php',
@@ -5051,51 +4743,15 @@
5051
  'i' => 'g',
5052
  'r' => 'y',
5053
  ),
5054
- 'twig.ce.72.4c7cb5cac3cffd05dcac960e0136a91e09c2281d281c2aa076bb92249201' =>
5055
- array (
5056
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'ce' . DIRECTORY_SEPARATOR . '72' . DIRECTORY_SEPARATOR . '4c7cb5cac3cffd05dcac960e0136a91e09c2281d281c2aa076bb92249201.php',
5057
- 'c' => '__TwigTemplate_ce724c7cb5cac3cffd05dcac960e0136a91e09c2281d281c2aa076bb92249201',
5058
- 'i' => 'g',
5059
- ),
5060
- 'twig.d4.65.fa726b6c76aa0ab1e5bd1ce6c787ea379c52871b80bf7fa0ff0b1ec788a8' =>
5061
- array (
5062
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'd4' . DIRECTORY_SEPARATOR . '65' . DIRECTORY_SEPARATOR . 'fa726b6c76aa0ab1e5bd1ce6c787ea379c52871b80bf7fa0ff0b1ec788a8.php',
5063
- 'c' => '__TwigTemplate_d465fa726b6c76aa0ab1e5bd1ce6c787ea379c52871b80bf7fa0ff0b1ec788a8',
5064
- 'i' => 'g',
5065
- ),
5066
- 'twig.d5.ea.0f196084548c56e9b17f48b3fa082f54fbf3f61f088b55acd91d52e27130' =>
5067
- array (
5068
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'd5' . DIRECTORY_SEPARATOR . 'ea' . DIRECTORY_SEPARATOR . '0f196084548c56e9b17f48b3fa082f54fbf3f61f088b55acd91d52e27130.php',
5069
- 'c' => '__TwigTemplate_d5ea0f196084548c56e9b17f48b3fa082f54fbf3f61f088b55acd91d52e27130',
5070
- 'i' => 'g',
5071
- ),
5072
- 'twig.dd.c2.602f6650e55fce9a9402a7d1062a4384aac357c8b7840b338904a647fe10' =>
5073
- array (
5074
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'dd' . DIRECTORY_SEPARATOR . 'c2' . DIRECTORY_SEPARATOR . '602f6650e55fce9a9402a7d1062a4384aac357c8b7840b338904a647fe10.php',
5075
- 'c' => '__TwigTemplate_ddc2602f6650e55fce9a9402a7d1062a4384aac357c8b7840b338904a647fe10',
5076
- 'i' => 'g',
5077
- ),
5078
- 'twig.ed.be.11913727712f3aeca5bcd9308202e49470f0f1d80fdeeab130a9c38ae967' =>
5079
- array (
5080
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'ed' . DIRECTORY_SEPARATOR . 'be' . DIRECTORY_SEPARATOR . '11913727712f3aeca5bcd9308202e49470f0f1d80fdeeab130a9c38ae967.php',
5081
- 'c' => '__TwigTemplate_edbe11913727712f3aeca5bcd9308202e49470f0f1d80fdeeab130a9c38ae967',
5082
- 'i' => 'g',
5083
- ),
5084
  'twig.environment' =>
5085
  array (
5086
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'environment.php',
5087
  'c' => 'Ai1ec_Twig_Environment',
5088
  'i' => 'g',
5089
  ),
5090
- 'twig.f8.b8.d195bb5bb7102497fc98dcb0702f082b666aaae80097e97d1302a5c5343a' =>
5091
- array (
5092
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'f8' . DIRECTORY_SEPARATOR . 'b8' . DIRECTORY_SEPARATOR . 'd195bb5bb7102497fc98dcb0702f082b666aaae80097e97d1302a5c5343a.php',
5093
- 'c' => '__TwigTemplate_f8b8d195bb5bb7102497fc98dcb0702f082b666aaae80097e97d1302a5c5343a',
5094
- 'i' => 'g',
5095
- ),
5096
  'valarm' =>
5097
  array (
5098
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.16' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
5099
  'c' => 'valarm',
5100
  'i' => 'g',
5101
  ),
@@ -5121,19 +4777,19 @@
5121
  ),
5122
  'vcalendar' =>
5123
  array (
5124
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.16' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
5125
  'c' => 'vcalendar',
5126
  'i' => 'g',
5127
  ),
5128
  'vevent' =>
5129
  array (
5130
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.16' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
5131
  'c' => 'vevent',
5132
  'i' => 'g',
5133
  ),
5134
  'vfreebusy' =>
5135
  array (
5136
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.16' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
5137
  'c' => 'vfreebusy',
5138
  'i' => 'g',
5139
  ),
@@ -5333,19 +4989,19 @@
5333
  ),
5334
  'vjournal' =>
5335
  array (
5336
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.16' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
5337
  'c' => 'vjournal',
5338
  'i' => 'g',
5339
  ),
5340
  'vtimezone' =>
5341
  array (
5342
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.16' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
5343
  'c' => 'vtimezone',
5344
  'i' => 'g',
5345
  ),
5346
  'vtodo' =>
5347
  array (
5348
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.16' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
5349
  'c' => 'vtodo',
5350
  'i' => 'g',
5351
  ),
212
  'i' => 'g',
213
  'r' => 'y',
214
  ),
215
+ 'Ai1ec_Command_Disable_Gzip' =>
216
+ array (
217
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'command' . DIRECTORY_SEPARATOR . 'disable-gzip.php',
218
+ 'c' => 'Ai1ec_Command_Disable_Gzip',
219
+ 'i' => 'g',
220
+ 'r' => 'y',
221
+ ),
222
  'Ai1ec_Command_Export_Events' =>
223
  array (
224
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'command' . DIRECTORY_SEPARATOR . 'export-events.php',
507
  'c' => 'Ai1ec_Event_Not_Found_Exception',
508
  'i' => 'g',
509
  ),
510
+ 'Ai1ec_Event_Parent' =>
511
+ array (
512
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR . 'event' . DIRECTORY_SEPARATOR . 'parent.php',
513
+ 'c' => 'Ai1ec_Event_Parent',
514
+ 'i' => 'g',
515
+ 'r' => 'y',
516
+ ),
517
  'Ai1ec_Event_Search' =>
518
  array (
519
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR . 'search.php',
2463
  'c' => 'Twig_TokenStream',
2464
  'i' => 'g',
2465
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2466
  'acl.aco' =>
2467
  array (
2468
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'acl' . DIRECTORY_SEPARATOR . 'aco.php',
2588
  ),
2589
  'calendarComponent' =>
2590
  array (
2591
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.20' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
2592
  'c' => 'calendarComponent',
2593
  'i' => 'g',
2594
  ),
2627
  'i' => 'g',
2628
  'r' => 'y',
2629
  ),
2630
+ 'command.disable-gzip' =>
2631
+ array (
2632
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'command' . DIRECTORY_SEPARATOR . 'disable-gzip.php',
2633
+ 'c' => 'Ai1ec_Command_Disable_Gzip',
2634
+ 'i' => 'g',
2635
+ 'r' => 'y',
2636
+ ),
2637
  'command.export-events' =>
2638
  array (
2639
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'command' . DIRECTORY_SEPARATOR . 'export-events.php',
3278
  'c' => 'iCalcnv',
3279
  'i' => 'g',
3280
  ),
3281
+ 'iCal.iCalcreator-2.20.iCalcreator.class' =>
3282
  array (
3283
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.20' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
3284
  'c' => 'iCalUtilityFunctions',
3285
  'i' => 'g',
3286
  ),
3287
  'iCalUtilityFunctions' =>
3288
  array (
3289
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.20' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
3290
  'c' => 'iCalUtilityFunctions',
3291
  'i' => 'g',
3292
  ),
3458
  'c' => 'Ai1ec_Event_Not_Found_Exception',
3459
  'i' => 'g',
3460
  ),
3461
+ 'model.event.parent' =>
3462
+ array (
3463
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR . 'event' . DIRECTORY_SEPARATOR . 'parent.php',
3464
+ 'c' => 'Ai1ec_Event_Parent',
3465
+ 'i' => 'g',
3466
+ 'r' => 'y',
3467
+ ),
3468
  'model.event.taxonomy' =>
3469
  array (
3470
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR . 'event' . DIRECTORY_SEPARATOR . 'taxonomy.php',
3794
  'i' => 'g',
3795
  'r' => 'y',
3796
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3797
  'twig.Compiler' =>
3798
  array (
3799
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'Compiler.php',
4730
  'c' => 'Twig_TokenStream',
4731
  'i' => 'g',
4732
  ),
 
 
 
 
 
 
 
 
 
 
 
 
4733
  'twig.ai1ec-extension' =>
4734
  array (
4735
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'ai1ec-extension.php',
4736
  'c' => 'Ai1ec_Twig_Ai1ec_Extension',
4737
  'i' => 'g',
4738
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4739
  'twig.cache' =>
4740
  array (
4741
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'cache.php',
4743
  'i' => 'g',
4744
  'r' => 'y',
4745
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4746
  'twig.environment' =>
4747
  array (
4748
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'environment.php',
4749
  'c' => 'Ai1ec_Twig_Environment',
4750
  'i' => 'g',
4751
  ),
 
 
 
 
 
 
4752
  'valarm' =>
4753
  array (
4754
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.20' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
4755
  'c' => 'valarm',
4756
  'i' => 'g',
4757
  ),
4777
  ),
4778
  'vcalendar' =>
4779
  array (
4780
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.20' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
4781
  'c' => 'vcalendar',
4782
  'i' => 'g',
4783
  ),
4784
  'vevent' =>
4785
  array (
4786
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.20' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
4787
  'c' => 'vevent',
4788
  'i' => 'g',
4789
  ),
4790
  'vfreebusy' =>
4791
  array (
4792
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.20' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
4793
  'c' => 'vfreebusy',
4794
  'i' => 'g',
4795
  ),
4989
  ),
4990
  'vjournal' =>
4991
  array (
4992
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.20' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
4993
  'c' => 'vjournal',
4994
  'i' => 'g',
4995
  ),
4996
  'vtimezone' =>
4997
  array (
4998
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.20' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
4999
  'c' => 'vtimezone',
5000
  'i' => 'g',
5001
  ),
5002
  'vtodo' =>
5003
  array (
5004
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.20' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
5005
  'c' => 'vtodo',
5006
  'i' => 'g',
5007
  ),
lib/calendar-feed/ics.php CHANGED
@@ -84,9 +84,9 @@ class Ai1ecIcsConnectorPlugin extends Ai1ec_Connector_Plugin {
84
  $import_export = $this->_registry->get( 'controller.import-export' );
85
  $args = array();
86
  $args['feed'] = $feed;
87
- $args['comments_enabled'] = 'open';
88
  if ( isset( $feed->comments_enabled ) && $feed->comments_enabled < 1 ) {
89
- $comment_status = 'closed';
90
  }
91
 
92
  $args['do_show_map'] = 0;
84
  $import_export = $this->_registry->get( 'controller.import-export' );
85
  $args = array();
86
  $args['feed'] = $feed;
87
+ $args['comment_status'] = 'open';
88
  if ( isset( $feed->comments_enabled ) && $feed->comments_enabled < 1 ) {
89
+ $args['comment_status'] = 'closed';
90
  }
91
 
92
  $args['do_show_map'] = 0;
lib/command/clone.php CHANGED
@@ -176,7 +176,8 @@ class Ai1ec_Command_Clone extends Ai1ec_Command {
176
  $post->post_title,
177
  $edit_event_url
178
  );
179
- $notification = $this->_registry->get( 'notification.admin', $message );
 
180
  $this->_duplicate_post_copy_post_taxonomies( $new_post_id, $post );
181
  $this->_duplicate_post_copy_attachments( $new_post_id, $post );
182
  $this->_duplicate_post_copy_post_meta_info( $new_post_id, $post );
176
  $post->post_title,
177
  $edit_event_url
178
  );
179
+ $notification = $this->_registry->get( 'notification.admin' );
180
+ $notification->store( $message );
181
  $this->_duplicate_post_copy_post_taxonomies( $new_post_id, $post );
182
  $this->_duplicate_post_copy_attachments( $new_post_id, $post );
183
  $this->_duplicate_post_copy_post_meta_info( $new_post_id, $post );
lib/command/disable-gzip.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The concrete command that disabel gzip.
4
+ *
5
+ * @author Time.ly Network Inc.
6
+ * @since 2.0
7
+ *
8
+ * @package AI1EC
9
+ * @subpackage AI1EC.Command
10
+ */
11
+ class Ai1ec_Command_Disable_Gzip extends Ai1ec_Command {
12
+
13
+ /* (non-PHPdoc)
14
+ * @see Ai1ec_Command::is_this_to_execute()
15
+ */
16
+ public function is_this_to_execute() {
17
+ if ( isset( $_GET['ai1ec_disable_gzip_compression'] ) ) {
18
+ return true;
19
+ }
20
+ return false;
21
+ }
22
+
23
+ /* (non-PHPdoc)
24
+ * @see Ai1ec_Command::do_execute()
25
+ */
26
+ public function do_execute() {
27
+ $this->_registry->get( 'model.settings' )
28
+ ->set( 'disable_gzip_compression', true );
29
+ return array(
30
+ 'url' => admin_url( 'edit.php' ),
31
+ 'query_args' => array(
32
+ 'post_type' => 'ai1ec_event',
33
+ 'page' => 'all-in-one-event-calendar-settings',
34
+ ),
35
+ );
36
+ }
37
+
38
+ /* (non-PHPdoc)
39
+ * @see Ai1ec_Command::set_render_strategy()
40
+ */
41
+ public function set_render_strategy( Ai1ec_Request_Parser $request ) {
42
+ $this->_render_strategy = $this->_registry->get(
43
+ 'http.response.render.strategy.redirect'
44
+ );
45
+ }
46
+ }
lib/command/export-events.php CHANGED
@@ -38,7 +38,7 @@ class Ai1ec_Command_Export_Events extends Ai1ec_Command {
38
  if ( $params['action'] === self::EXPORT_METHOD &&
39
  $params['controller'] === self::EXPORT_CONTROLLER ) {
40
  $params['tag_ids'] = Ai1ec_Request_Parser::get_param(
41
- 'ai1ec_cat_ids',
42
  false
43
  );
44
  $params['cat_ids'] = Ai1ec_Request_Parser::get_param(
38
  if ( $params['action'] === self::EXPORT_METHOD &&
39
  $params['controller'] === self::EXPORT_CONTROLLER ) {
40
  $params['tag_ids'] = Ai1ec_Request_Parser::get_param(
41
+ 'ai1ec_tag_ids',
42
  false
43
  );
44
  $params['cat_ids'] = Ai1ec_Request_Parser::get_param(
lib/command/resolver.php CHANGED
@@ -37,6 +37,11 @@ class Ai1ec_Command_Resolver {
37
  Ai1ec_Registry_Object $registry,
38
  Ai1ec_Request_Parser $request
39
  ) {
 
 
 
 
 
40
  $this->add_command(
41
  $registry->get(
42
  'command.export-events', $request
37
  Ai1ec_Registry_Object $registry,
38
  Ai1ec_Request_Parser $request
39
  ) {
40
+ $this->add_command(
41
+ $registry->get(
42
+ 'command.disable-gzip', $request
43
+ )
44
+ );
45
  $this->add_command(
46
  $registry->get(
47
  'command.export-events', $request
lib/command/save-settings.php CHANGED
@@ -17,13 +17,10 @@ class Ai1ec_Command_Save_Settings extends Ai1ec_Command_Save_Abstract {
17
  public function do_execute() {
18
  $settings = $this->_registry->get( 'model.settings' );
19
  $options = $settings->get_options();
20
- // if either tag or categories are set, process the setting.
21
- if (
22
- isset( $_POST['default_tags'] ) ||
23
  isset( $_POST['default_categories'] )
24
- ) {
25
- $_POST['default_tags_categories'] = true;
26
- }
27
  $_POST['enabled_views'] = true;
28
  foreach ( $options as $name => $data ) {
29
  $value = null;
17
  public function do_execute() {
18
  $settings = $this->_registry->get( 'model.settings' );
19
  $options = $settings->get_options();
20
+ $_POST['default_tags_categories'] = (
21
+ isset( $_POST['default_tags'] ) ||
 
22
  isset( $_POST['default_categories'] )
23
+ );
 
 
24
  $_POST['enabled_views'] = true;
25
  foreach ( $options as $name => $data ) {
26
  $value = null;
lib/css/frontend.php CHANGED
@@ -85,7 +85,7 @@ class Ai1ec_Css_Frontend extends Ai1ec_Base {
85
  ) {
86
  // compress data if possible
87
  $compatibility_ob = $this->_registry->get( 'compatibility.ob' );
88
- if ( Ai1ec_Http_Response_Helper::client_use_gzip() ) {
89
  $compatibility_ob->start( 'ob_gzhandler' );
90
  header( 'Content-Encoding: gzip' );
91
  } else {
85
  ) {
86
  // compress data if possible
87
  $compatibility_ob = $this->_registry->get( 'compatibility.ob' );
88
+ if ( $this->_registry->get( 'http.request' )->client_use_gzip() ) {
89
  $compatibility_ob->start( 'ob_gzhandler' );
90
  header( 'Content-Encoding: gzip' );
91
  } else {
lib/database/datetime-migration.php CHANGED
@@ -301,7 +301,7 @@ class Ai1ecdm_Datetime_Migration {
301
  }
302
  $sql_query = 'ALTER TABLE `' . $table . '` ' .
303
  implode( ', ', $column_particles );
304
- return $this->_dbi->query( $sql_query );
305
  }
306
 
307
  /**
@@ -347,7 +347,7 @@ class Ai1ecdm_Datetime_Migration {
347
  }
348
  $sql_query = 'ALTER TABLE `' . $table . '` ' .
349
  implode( ', ', $snippets );
350
- return $this->_dbi->query( $sql_query );
351
  }
352
 
353
  /**
@@ -388,7 +388,7 @@ class Ai1ecdm_Datetime_Migration {
388
  */
389
  public function drop( $table ) {
390
  $sql_query = 'DROP TABLE IF EXISTS ' . $table;
391
- return false !== $this->_dbi->query( $sql_query );
392
  }
393
 
394
  /**
@@ -447,4 +447,4 @@ class Ai1ecdm_Datetime_Migration {
447
  return ( (string)$table === (string)$name );
448
  }
449
 
450
- }
301
  }
302
  $sql_query = 'ALTER TABLE `' . $table . '` ' .
303
  implode( ', ', $column_particles );
304
+ return ( false !== $this->_dbi->query( $sql_query ) );
305
  }
306
 
307
  /**
347
  }
348
  $sql_query = 'ALTER TABLE `' . $table . '` ' .
349
  implode( ', ', $snippets );
350
+ return ( false !== $this->_dbi->query( $sql_query ) );
351
  }
352
 
353
  /**
388
  */
389
  public function drop( $table ) {
390
  $sql_query = 'DROP TABLE IF EXISTS ' . $table;
391
+ return ( false !== $this->_dbi->query( $sql_query ) );
392
  }
393
 
394
  /**
447
  return ( (string)$table === (string)$name );
448
  }
449
 
450
+ }
lib/dbi/dbi.php CHANGED
@@ -55,7 +55,11 @@ class Ai1ec_Dbi {
55
  $this->_registry->get( 'controller.shutdown' )->register(
56
  array( $this, 'shutdown' )
57
  );
58
- $this->auto_debug();
 
 
 
 
59
  $this->set_timezone();
60
  }
61
 
@@ -78,19 +82,19 @@ class Ai1ec_Dbi {
78
  }
79
 
80
  /**
81
- * Automatically change debug flag.
 
 
 
 
82
  *
83
  * @return void
84
  */
85
- public function auto_debug() {
86
- if (
87
- AI1EC_DEBUG &&
88
- ! $this->_registry->get( 'http.request' )->is_ajax()
89
- ) {
90
- $this->_log_enabled = true;
91
- } else {
92
- $this->disable_debug();
93
- }
94
  }
95
 
96
  /**
@@ -377,7 +381,6 @@ class Ai1ec_Dbi {
377
  * @return void
378
  */
379
  public function shutdown() {
380
- $this->auto_debug();
381
  if ( ! $this->_log_enabled ) {
382
  return false;
383
  }
55
  $this->_registry->get( 'controller.shutdown' )->register(
56
  array( $this, 'shutdown' )
57
  );
58
+ add_action(
59
+ 'ai1ec_loaded',
60
+ array( $this, 'check_debug' ),
61
+ PHP_INT_MAX
62
+ );
63
  $this->set_timezone();
64
  }
65
 
82
  }
83
 
84
  /**
85
+ * Only attempt to enable debug after all add-ons are loaded.
86
+ *
87
+ * @wp_hook ai1ec_loaded
88
+ *
89
+ * @uses apply_filters ai1ec_dbi_debug
90
  *
91
  * @return void
92
  */
93
+ public function check_debug() {
94
+ $this->_log_enabled = apply_filters(
95
+ 'ai1ec_dbi_debug',
96
+ ( false !== AI1EC_DEBUG )
97
+ );
 
 
 
 
98
  }
99
 
100
  /**
381
  * @return void
382
  */
383
  public function shutdown() {
 
384
  if ( ! $this->_log_enabled ) {
385
  return false;
386
  }
lib/html/element/setting/calendar-page-selector.php CHANGED
@@ -21,11 +21,6 @@ class Ai1ec_Html_Element_Calendar_Page_Selector
21
  */
22
  protected $_pages = array();
23
 
24
- /**
25
- * @var int ID of page currently selected, NULL if none.
26
- */
27
- protected $_selected = null;
28
-
29
  /**
30
  * Set attributes for element.
31
  *
@@ -64,17 +59,25 @@ class Ai1ec_Html_Element_Calendar_Page_Selector
64
  * @return string HTML snippet.
65
  */
66
  protected function _get_page_view_link() {
67
- if ( empty( $this->_selected ) ) {
68
  return '';
69
  }
70
- $post = get_post( $this->_selected );
71
- if ( empty( $post ) ) {
72
  return '';
73
  }
74
- return '<p><a target="_blank" href="' . get_permalink( $post->ID ) . '">
75
- View "' . $post->title . '"
76
- <i class="ai1ec-fa ai1ec-fa-arrow-right"></i>
77
- </a></p>';
 
 
 
 
 
 
 
 
78
  }
79
 
80
  /**
21
  */
22
  protected $_pages = array();
23
 
 
 
 
 
 
24
  /**
25
  * Set attributes for element.
26
  *
59
  * @return string HTML snippet.
60
  */
61
  protected function _get_page_view_link() {
62
+ if ( empty( $this->_args['value'] ) ) {
63
  return '';
64
  }
65
+ $post = get_post( $this->_args['value'] );
66
+ if ( empty( $post->ID ) ) {
67
  return '';
68
  }
69
+ $args = array(
70
+ 'view' => Ai1ec_I18n::__( 'View' ),
71
+ 'link' => get_permalink( $post->ID ),
72
+ 'title' => apply_filters(
73
+ 'the_title',
74
+ $post->post_title,
75
+ $post->ID
76
+ ),
77
+ );
78
+ return $this->_registry->get( 'theme.loader' )
79
+ ->get_file( 'setting/calendar-page-selector.twig', $args, true )
80
+ ->get_content();
81
  }
82
 
83
  /**
lib/http/request.php CHANGED
@@ -22,6 +22,22 @@ class Ai1ec_Http_Request {
22
  $this->_registry = $registry;
23
  }
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  /**
26
  * Check if we are processing AJAX request.
27
  *
@@ -65,9 +81,11 @@ class Ai1ec_Http_Request {
65
 
66
  if (
67
  $settings->get( 'disable_gzip_compression' ) ||
68
- isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) &&
69
- 'identity' === $_SERVER['HTTP_ACCEPT_ENCODING'] ||
70
- ! extension_loaded( 'zlib' )
 
 
71
  ) {
72
  return false;
73
  }
22
  $this->_registry = $registry;
23
  }
24
 
25
+ /**
26
+ * Callback for debug-checking filters. Changes debug to false for AJAX req.
27
+ *
28
+ * @wp_hook ai1ec_dbi_debug
29
+ *
30
+ * @param bool $do_debug Current debug value.
31
+ *
32
+ * @return bool Optionally modified `$do_debug`.
33
+ */
34
+ public function debug_filter( $do_debug ) {
35
+ if ( $this->is_ajax() ) {
36
+ $do_debug = false;
37
+ }
38
+ return $do_debug;
39
+ }
40
+
41
  /**
42
  * Check if we are processing AJAX request.
43
  *
81
 
82
  if (
83
  $settings->get( 'disable_gzip_compression' ) ||
84
+ (
85
+ isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) &&
86
+ 'identity' === $_SERVER['HTTP_ACCEPT_ENCODING'] ||
87
+ ! extension_loaded( 'zlib' )
88
+ )
89
  ) {
90
  return false;
91
  }
lib/http/response/helper.php CHANGED
@@ -42,38 +42,6 @@ class Ai1ec_Http_Response_Helper {
42
  exit( $code );
43
  }
44
 
45
- /**
46
- * Check if client accepts gzip and we should compress content
47
- *
48
- * Plugin settings, client preferences and server capabilities are
49
- * checked to make sure we should use gzip for output compression.
50
- *
51
- * @uses Ai1ec_Settings::get_instance To early instantiate object
52
- *
53
- * @return bool True when gzip should be used
54
- */
55
- static public function client_use_gzip() {
56
- if (
57
- isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) &&
58
- 'identity' === $_SERVER['HTTP_ACCEPT_ENCODING'] ||
59
- ! extension_loaded( 'zlib' )
60
- ) {
61
- return false;
62
- }
63
- $zlib_output_handler = ini_get( 'zlib.output_handler' );
64
- if (
65
- in_array( 'ob_gzhandler', ob_list_handlers() ) ||
66
- in_array(
67
- strtolower( ini_get( 'zlib.output_compression' ) ),
68
- array( '1', 'on' )
69
- ) ||
70
- ! empty( $zlib_output_handler )
71
- ) {
72
- return false;
73
- }
74
- return true;
75
- }
76
-
77
  /**
78
  * ai1ec_utf8 function
79
  *
42
  exit( $code );
43
  }
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  /**
46
  * ai1ec_utf8 function
47
  *
lib/iCal/{iCalcreator-2.16 → iCalcreator-2.20}/iCalcreator.class.php RENAMED
@@ -1,14 +1,16 @@
1
  <?php
2
  /*********************************************************************************/
3
  /**
4
- * iCalcreator v2.16.1
5
- * copyright (c) 2007-2012 Kjell-Inge Gustafsson kigkonsult
6
- * kigkonsult.se/iCalcreator/index.php
7
- * ical@kigkonsult.se
8
  *
9
- * Description:
10
  * This file is a PHP implementation of rfc2445/rfc5545.
11
  *
 
 
 
 
 
 
 
12
  * This library is free software; you can redistribute it and/or
13
  * modify it under the terms of the GNU Lesser General Public
14
  * License as published by the Free Software Foundation; either
@@ -24,29 +26,13 @@
24
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
  */
26
  /*********************************************************************************/
27
- /*********************************************************************************/
28
- /* A little setup */
29
- /*********************************************************************************/
30
- /* your local language code */
31
- // define( 'ICAL_LANG', 'sv' );
32
- // alt. autosetting
33
- /*
34
- $langstr = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
35
- $pos = strpos( $langstr, ';' );
36
- if ($pos !== false) {
37
- $langstr = substr( $langstr, 0, $pos );
38
- $pos = strpos( $langstr, ',' );
39
- if ($pos !== false) {
40
- $pos = strpos( $langstr, ',' );
41
- $langstr = substr( $langstr, 0, $pos );
42
- }
43
- define( 'ICAL_LANG', $langstr );
44
- }
45
- */
46
- /*********************************************************************************/
47
- /* version, do NOT remove!! */
48
- define( 'ICALCREATOR_VERSION', 'iCalcreator 2.16.1' );
49
- /*********************************************************************************/
50
  /*********************************************************************************/
51
  /**
52
  * vcalendar class
@@ -113,6 +99,17 @@ class vcalendar {
113
  $this->xcaldecl = array();
114
  $this->components = array();
115
  }
 
 
 
 
 
 
 
 
 
 
 
116
  /*********************************************************************************/
117
  /**
118
  * Property Name: CALSCALE
@@ -186,13 +183,12 @@ class vcalendar {
186
  /**
187
  * Property Name: PRODID
188
  *
189
- * The identifier is RECOMMENDED to be the identical syntax to the
190
- * [RFC 822] addr-spec. A good method to assure uniqueness is to put the
191
- * domain name or a domain literal IP address of the host on which.. .
192
  */
193
  /**
194
  * creates formatted output for calendar property prodid
195
  *
 
 
196
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
197
  * @since 2.12.11 - 2012-05-13
198
  * @return string
@@ -212,8 +208,10 @@ class vcalendar {
212
  }
213
  }
214
  /**
215
- * make default value for calendar prodid
216
  *
 
 
217
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
218
  * @since 2.6.8 - 2009-12-30
219
  * @return void
@@ -294,28 +292,29 @@ class vcalendar {
294
  * creates formatted output for calendar property x-prop, iCal format only
295
  *
296
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
297
- * @since 2.10.16 - 2011-11-01
298
  * @return string
299
  */
300
  function createXprop() {
301
  if( empty( $this->xprop ) || !is_array( $this->xprop )) return FALSE;
302
- $output = null;
303
- $toolbox = new calendarComponent();
304
  $toolbox->setConfig( $this->getConfig());
305
  foreach( $this->xprop as $label => $xpropPart ) {
306
  if( !isset($xpropPart['value']) || ( empty( $xpropPart['value'] ) && !is_numeric( $xpropPart['value'] ))) {
307
- $output .= $toolbox->_createElement( $label );
 
308
  continue;
309
  }
310
- $attributes = $toolbox->_createParams( $xpropPart['params'], array( 'LANGUAGE' ));
311
  if( is_array( $xpropPart['value'] )) {
312
  foreach( $xpropPart['value'] as $pix => $theXpart )
313
- $xpropPart['value'][$pix] = $toolbox->_strrep( $theXpart );
314
  $xpropPart['value'] = implode( ',', $xpropPart['value'] );
315
  }
316
  else
317
- $xpropPart['value'] = $toolbox->_strrep( $xpropPart['value'] );
318
- $output .= $toolbox->_createElement( $label, $attributes, $xpropPart['value'] );
319
  if( is_array( $toolbox->xcaldecl ) && ( 0 < count( $toolbox->xcaldecl ))) {
320
  foreach( $toolbox->xcaldecl as $localxcaldecl )
321
  $this->xcaldecl[] = $localxcaldecl;
@@ -327,7 +326,7 @@ class vcalendar {
327
  * set calendar property x-prop
328
  *
329
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
330
- * @since 2.11.9 - 2012-01-16
331
  * @param string $label
332
  * @param string $value
333
  * @param array $params optional
@@ -336,13 +335,15 @@ class vcalendar {
336
  function setXprop( $label, $value, $params=FALSE ) {
337
  if( empty( $label ))
338
  return FALSE;
339
- if( 'X-' != strtoupper( substr( $label, 0, 2 )))
 
340
  return FALSE;
341
- if( empty( $value ) && !is_numeric( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
342
  $xprop = array( 'value' => $value );
343
  $xprop['params'] = iCalUtilityFunctions::_setParams( $params );
344
- if( !is_array( $this->xprop )) $this->xprop = array();
345
- $this->xprop[strtoupper( $label )] = $xprop;
 
346
  return TRUE;
347
  }
348
  /*********************************************************************************/
@@ -405,7 +406,7 @@ class vcalendar {
405
  * get calendar property value/params
406
  *
407
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
408
- * @since 2.13.4 - 2012-08-08
409
  * @param string $propName, optional
410
  * @param int $propix, optional, if specific property is wanted in case of multiply occurences
411
  * @param bool $inclParam=FALSE
@@ -418,8 +419,11 @@ class vcalendar {
418
  $propix = ( isset( $this->propix[$propName] )) ? $this->propix[$propName] + 2 : 1;
419
  $this->propix[$propName] = --$propix;
420
  }
421
- else
422
  $mProps = array( 'ATTENDEE', 'CATEGORIES', 'CONTACT', 'RELATED-TO', 'RESOURCES' );
 
 
 
423
  switch( $propName ) {
424
  case 'ATTENDEE':
425
  case 'CATEGORIES':
@@ -439,9 +443,9 @@ class vcalendar {
439
  case 'URL':
440
  $output = array();
441
  foreach ( $this->components as $cix => $component) {
442
- if( !in_array( $component->objName, array('vevent', 'vtodo', 'vjournal', 'vfreebusy' )))
443
  continue;
444
- if( in_array( strtoupper( $propName ), $mProps )) {
445
  $component->_getProperties( $propName, $output );
446
  continue;
447
  }
@@ -450,21 +454,11 @@ class vcalendar {
450
  $content = $component->getProperty( 'UID' );
451
  }
452
  elseif( 'GEOLOCATION' == $propName ) {
453
- $content = $component->getProperty( 'LOCATION' );
454
- $content = ( !empty( $content )) ? $content.' ' : '';
455
- if(( FALSE === ( $geo = $component->getProperty( 'GEO' ))) || empty( $geo ))
456
  continue;
457
- if( 0.0 < $geo['latitude'] )
458
- $sign = '+';
459
- else
460
- $sign = ( 0.0 > $geo['latitude'] ) ? '-' : '';
461
- $content .= ' '.$sign.sprintf( "%09.6f", abs( $geo['latitude'] ));
462
- $content = rtrim( rtrim( $content, '0' ), '.' );
463
- if( 0.0 < $geo['longitude'] )
464
- $sign = '+';
465
- else
466
- $sign = ( 0.0 > $geo['longitude'] ) ? '-' : '';
467
- $content .= $sign.sprintf( '%8.6f', abs( $geo['longitude'] )).'/';
468
  }
469
  elseif( FALSE === ( $content = $component->getProperty( $propName )))
470
  continue;
@@ -472,7 +466,7 @@ class vcalendar {
472
  continue;
473
  elseif( is_array( $content )) {
474
  if( isset( $content['year'] )) {
475
- $key = sprintf( '%04d%02d%02d', $content['year'], $content['month'], $content['day'] );
476
  if( !isset( $output[$key] ))
477
  $output[$key] = 1;
478
  else
@@ -671,25 +665,23 @@ class vcalendar {
671
  * general vcalendar config setting
672
  *
673
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
674
- * @since 2.12.12 - 2012-05-13
675
  * @param mixed $config
676
  * @param string $value
677
  * @return void
678
  */
679
  function setConfig( $config, $value = FALSE) {
680
  if( is_array( $config )) {
681
- $ak = array_keys( $config );
682
- foreach( $ak as $k ) {
683
- if( 'DIRECTORY' == strtoupper( $k )) {
684
- if( FALSE === $this->setConfig( 'DIRECTORY', $config[$k] ))
685
- return FALSE;
686
- unset( $config[$k] );
687
- }
688
- elseif( 'NEWLINECHAR' == strtoupper( $k )) {
689
- if( FALSE === $this->setConfig( 'NEWLINECHAR', $config[$k] ))
690
- return FALSE;
691
- unset( $config[$k] );
692
- }
693
  }
694
  foreach( $config as $cKey => $cValue ) {
695
  if( FALSE === $this->setConfig( $cKey, $cValue ))
@@ -697,8 +689,10 @@ class vcalendar {
697
  }
698
  return TRUE;
699
  }
 
700
  $res = FALSE;
701
- switch( strtoupper( $config )) {
 
702
  case 'ALLOWEMPTY':
703
  $this->allowEmpty = $value;
704
  $subcfg = array( 'ALLOWEMPTY' => $value );
@@ -709,28 +703,18 @@ class vcalendar {
709
  return TRUE;
710
  break;
711
  case 'DIRECTORY':
712
- $value = trim( $value );
713
- $del = $this->getConfig('delimiter');
714
- if( $del == substr( $value, ( 0 - strlen( $del ))))
715
- $value = substr( $value, 0, ( strlen( $value ) - strlen( $del )));
716
- if( is_dir( $value )) {
717
  /* local directory */
718
- clearstatcache();
719
  $this->directory = $value;
720
  $this->url = null;
721
  return TRUE;
722
  }
723
- else
724
- return FALSE;
725
  break;
726
  case 'FILENAME':
727
  $value = trim( $value );
728
- if( !empty( $this->url )) {
729
- /* remote directory+file -> URL */
730
- $this->filename = $value;
731
- return TRUE;
732
- }
733
- $dirfile = $this->getConfig( 'directory' ).$this->getConfig( 'delimiter' ).$value;
734
  if( file_exists( $dirfile )) {
735
  /* local file exists */
736
  if( is_readable( $dirfile ) || is_writable( $dirfile )) {
@@ -741,8 +725,9 @@ class vcalendar {
741
  else
742
  return FALSE;
743
  }
744
- elseif( is_readable($this->getConfig( 'directory' ) ) || is_writable( $this->getConfig( 'directory' ) )) {
745
  /* read- or writable directory */
 
746
  $this->filename = $value;
747
  return TRUE;
748
  }
@@ -799,14 +784,17 @@ class vcalendar {
799
  break;
800
  case 'URL':
801
  /* remote file - URL */
802
- $value = trim( $value );
803
- $value = str_replace( 'HTTP://', 'http://', $value );
804
- $value = str_replace( 'WEBCAL://', 'http://', $value );
805
- $value = str_replace( 'webcal://', 'http://', $value );
 
806
  $this->url = $value;
807
- $this->directory = null;
808
- $parts = pathinfo( $value );
809
- return $this->setConfig( 'filename', $parts['basename'] );
 
 
810
  break;
811
  default: // any unvalid config key.. .
812
  return TRUE;
@@ -882,7 +870,7 @@ class vcalendar {
882
  * get calendar component from container
883
  *
884
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
885
- * @since 2.13.5 - 2012-08-08
886
  * @param mixed $arg1 optional, ordno/component type/ component uid
887
  * @param mixed $arg2 optional, ordno if arg1 = component type
888
  * @return object
@@ -893,11 +881,6 @@ class vcalendar {
893
  $argType = 'INDEX';
894
  $index = $this->compix['INDEX'] = ( isset( $this->compix['INDEX'] )) ? $this->compix['INDEX'] + 1 : 1;
895
  }
896
- elseif ( ctype_digit( (string) $arg1 )) { // specific component in chain
897
- $argType = 'INDEX';
898
- $index = (int) $arg1;
899
- unset( $this->compix );
900
- }
901
  elseif( is_array( $arg1 )) { // array( *[propertyName => propertyValue] )
902
  $arg2 = implode( '-', array_keys( $arg1 ));
903
  $index = $this->compix[$arg2] = ( isset( $this->compix[$arg2] )) ? $this->compix[$arg2] + 1 : 1;
@@ -905,6 +888,11 @@ class vcalendar {
905
  $otherProps = array( 'ATTENDEE', 'CATEGORIES', 'CONTACT', 'LOCATION', 'ORGANIZER', 'PRIORITY', 'RELATED-TO', 'RESOURCES', 'STATUS', 'SUMMARY', 'UID', 'URL' );
906
  $mProps = array( 'ATTENDEE', 'CATEGORIES', 'CONTACT', 'RELATED-TO', 'RESOURCES' );
907
  }
 
 
 
 
 
908
  elseif(( strlen( $arg1 ) <= strlen( 'vfreebusy' )) && ( FALSE === strpos( $arg1, '@' ))) { // object class name
909
  unset( $this->compix['INDEX'] );
910
  $argType = strtolower( $arg1 );
@@ -935,9 +923,9 @@ class vcalendar {
935
  $cix1gC++;
936
  }
937
  elseif( is_array( $arg1 )) { // array( *[propertyName => propertyValue] )
938
- $hit = array();
 
939
  foreach( $arg1 as $pName => $pValue ) {
940
- $pName = strtoupper( $pName );
941
  if( !in_array( $pName, $dateProps ) && !in_array( $pName, $otherProps ))
942
  continue;
943
  if( in_array( $pName, $mProps )) { // multiple occurrence
@@ -955,7 +943,7 @@ class vcalendar {
955
  $hit[] = ( FALSE !== stripos( $value, $pValue )) ? TRUE : FALSE;
956
  continue;
957
  }
958
- if( in_array( strtoupper( $pName ), $dateProps )) {
959
  $valuedate = sprintf( '%04d%02d%02d', $value['year'], $value['month'], $value['day'] );
960
  if( 8 < strlen( $pValue )) {
961
  if( isset( $value['hour'] )) {
@@ -1044,7 +1032,7 @@ class vcalendar {
1044
  * No date controls occurs.
1045
  *
1046
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
1047
- * @since 2.11.22 - 2012-02-13
1048
  * @param mixed $startY optional, start Year, default current Year ALT. array selecOptions ( *[ <propName> => <uniqueValue> ] )
1049
  * @param int $startM optional, start Month, default current Month
1050
  * @param int $startD optional, start Day, default current Day
@@ -1067,75 +1055,85 @@ class vcalendar {
1067
  if( is_array( $startY ))
1068
  return $this->selectComponents2( $startY );
1069
  /* check default dates */
1070
- if( !$startY ) $startY = date( 'Y' );
1071
- if( !$startM ) $startM = date( 'm' );
1072
- if( !$startD ) $startD = date( 'd' );
1073
  $startDate = mktime( 0, 0, 0, $startM, $startD, $startY );
1074
- if( !$endY ) $endY = $startY;
1075
- if( !$endM ) $endM = $startM;
1076
- if( !$endD ) $endD = $startD;
1077
  $endDate = mktime( 23, 59, 59, $endM, $endD, $endY );
1078
- //echo 'selectComp arg='.date( 'Y-m-d H:i:s', $startDate).' -- '.date( 'Y-m-d H:i:s', $endDate)."<br />\n"; $tcnt = 0;// test ###
1079
  /* check component types */
1080
  $validTypes = array('vevent', 'vtodo', 'vjournal', 'vfreebusy' );
1081
- if( is_array( $cType )) {
 
 
 
 
 
1082
  foreach( $cType as $cix => $theType ) {
1083
- $cType[$cix] = $theType = strtolower( $theType );
1084
  if( !in_array( $theType, $validTypes ))
1085
  $cType[$cix] = 'vevent';
1086
  }
1087
  $cType = array_unique( $cType );
1088
  }
1089
- elseif( !empty( $cType )) {
1090
- $cType = strtolower( $cType );
1091
- if( !in_array( $cType, $validTypes ))
1092
- $cType = array( 'vevent' );
1093
- else
1094
- $cType = array( $cType );
1095
- }
1096
- else
1097
- $cType = $validTypes;
1098
- if( 0 >= count( $cType ))
1099
- $cType = $validTypes;
1100
  if(( FALSE === $flat ) && ( FALSE === $any )) // invalid combination
1101
  $split = FALSE;
1102
  if(( TRUE === $flat ) && ( TRUE === $split )) // invalid combination
1103
  $split = FALSE;
1104
  /* iterate components */
1105
- $result = array();
 
 
 
1106
  foreach ( $this->components as $cix => $component ) {
1107
  if( empty( $component )) continue;
1108
  unset( $start );
1109
  /* deselect unvalid type components */
1110
  if( !in_array( $component->objName, $cType ))
1111
  continue;
1112
- $start = $component->getProperty( 'dtstart' );
1113
  /* select due when dtstart is missing */
1114
- if( empty( $start ) && ( $component->objName == 'vtodo' ) && ( FALSE === ( $start = $component->getProperty( 'due' ))))
1115
  continue;
1116
  if( empty( $start ))
1117
  continue;
1118
- $dtendExist = $dueExist = $durationExist = $endAllDayEvent = $recurrid = FALSE;
1119
- unset( $end, $startWdate, $endWdate, $rdurWsecs, $rdur, $exdatelist, $workstart, $workend, $endDateFormat ); // clean up
1120
- $startWdate = iCalUtilityFunctions::_date2timestamp( $start );
1121
- $startDateFormat = ( isset( $start['hour'] )) ? 'Y-m-d H:i:s' : 'Y-m-d';
 
 
 
 
 
 
 
 
 
 
1122
  /* get end date from dtend/due/duration properties */
1123
- $end = $component->getProperty( 'dtend' );
1124
  if( !empty( $end )) {
1125
- $dtendExist = TRUE;
1126
- $endDateFormat = ( isset( $end['hour'] )) ? 'Y-m-d H:i:s' : 'Y-m-d';
1127
  }
 
 
 
1128
  if( empty( $end ) && ( $component->objName == 'vtodo' )) {
1129
  $end = $component->getProperty( 'due' );
1130
  if( !empty( $end )) {
1131
- $dueExist = TRUE;
1132
- $endDateFormat = ( isset( $end['hour'] )) ? 'Y-m-d H:i:s' : 'Y-m-d';
1133
  }
1134
  }
1135
  if( !empty( $end ) && !isset( $end['hour'] )) {
1136
  /* a DTEND without time part regards an event that ends the day before,
1137
  for an all-day event DTSTART=20071201 DTEND=20071202 (taking place 20071201!!! */
1138
- $endAllDayEvent = TRUE;
1139
  $endWdate = mktime( 23, 59, 59, $end['month'], ($end['day'] - 1), $end['year'] );
1140
  $end['year'] = date( 'Y', $endWdate );
1141
  $end['month'] = date( 'm', $endWdate );
@@ -1146,15 +1144,19 @@ class vcalendar {
1146
  if( empty( $end )) {
1147
  $end = $component->getProperty( 'duration', FALSE, FALSE, TRUE );// in dtend (array) format
1148
  if( !empty( $end ))
1149
- $durationExist = TRUE;
1150
- $endDateFormat = ( isset( $start['hour'] )) ? 'Y-m-d H:i:s' : 'Y-m-d';
1151
- // if( !empty($end)) echo 'selectComp 4 start='.implode('-',$start).' end='.implode('-',$end)."<br />\n"; // test ###
 
 
1152
  }
1153
  if( empty( $end )) { // assume one day duration if missing end date
1154
  $end = array( 'year' => $start['year'], 'month' => $start['month'], 'day' => $start['day'], 'hour' => 23, 'min' => 59, 'sec' => 59 );
 
 
1155
  }
1156
- // if( isset($end)) echo 'selectComp 5 start='.implode('-',$start).' end='.implode('-',$end)."<br />\n"; // test ###
1157
- $endWdate = iCalUtilityFunctions::_date2timestamp( $end );
1158
  if( $endWdate < $startWdate ) { // MUST be after start date!!
1159
  $end = array( 'year' => $start['year'], 'month' => $start['month'], 'day' => $start['day'], 'hour' => 23, 'min' => 59, 'sec' => 59 );
1160
  $endWdate = iCalUtilityFunctions::_date2timestamp( $end );
@@ -1174,24 +1176,12 @@ class vcalendar {
1174
  $exdatelist[$exWdate] = TRUE;
1175
  } // end - foreach( $exdate as $theExdate )
1176
  } // end - check exdate
1177
- $compUID = $component->getProperty( 'UID' );
1178
- /* check recurrence-id (with sequence), remove hit with reccurr-id date */
1179
- if(( FALSE !== ( $recurrid = $component->getProperty( 'recurrence-id' ))) &&
1180
- ( FALSE !== ( $sequence = $component->getProperty( 'sequence' ))) ) {
1181
  $recurrid = iCalUtilityFunctions::_date2timestamp( $recurrid );
1182
  $recurrid = mktime( 0, 0, 0, date( 'm', $recurrid ), date( 'd', $recurrid ), date( 'Y', $recurrid )); // on a day-basis !!!
1183
- $endD = $recurrid + $rdurWsecs;
1184
- do {
1185
- if( date( 'Ymd', $startWdate ) != date( 'Ymd', $recurrid ))
1186
- $exdatelist[$recurrid] = TRUE; // exclude all other days than startdate
1187
- $wd = getdate( $recurrid );
1188
- if( isset( $result[$wd['year']][$wd['mon']][$wd['mday']][$compUID] ))
1189
- unset( $result[$wd['year']][$wd['mon']][$wd['mday']][$compUID] ); // remove from output, dtstart etc added below
1190
- if( $split && ( $recurrid <= $endD ))
1191
- $recurrid = mktime( 0, 0, 0, date( 'm', $recurrid ), date( 'd', $recurrid ) + 1, date( 'Y', $recurrid )); // step one day
1192
- else
1193
- break;
1194
- } while( TRUE );
1195
  } // end recurrence-id/sequence test
1196
  /* select only components with.. . */
1197
  if(( !$any && ( $startWdate >= $startDate ) && ( $startWdate <= $endDate )) || // (dt)start within the period
@@ -1204,66 +1194,54 @@ class vcalendar {
1204
  elseif( $split ) { // split the original component
1205
  if( $endWdate > $endDate )
1206
  $endWdate = $endDate; // use period end date
1207
- $rstart = $startWdate;
1208
- if( $rstart < $startDate )
1209
- $rstart = $startDate; // use period start date
1210
- $startYMD = date( 'Ymd', $rstart );
1211
  $endYMD = date( 'Ymd', $endWdate );
1212
  $checkDate = mktime( 0, 0, 0, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!!
1213
- while( date( 'Ymd', $rstart ) <= $endYMD ) { // iterate
1214
- $checkDate = mktime( 0, 0, 0, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!!
1215
- if( isset( $exdatelist[$checkDate] )) { // exclude any recurrence date, found in exdatelist
1216
- $rstart = mktime( date( 'H', $rstart ), date( 'i', $rstart ), date( 's', $rstart ), date( 'm', $rstart ), date( 'd', $rstart ) + 1, date( 'Y', $rstart ) ); // step one day
1217
- continue;
1218
- }
1219
- if( date( 'Ymd', $rstart ) > $startYMD ) // date after dtstart
1220
- $datestring = date( $startDateFormat, mktime( 0, 0, 0, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart )));
1221
- else
1222
- $datestring = date( $startDateFormat, $rstart );
1223
- if( isset( $start['tz'] ))
1224
- $datestring .= ' '.$start['tz'];
1225
- // echo "X-CURRENT-DTSTART 3 = $datestring xRecurrence=$xRecurrence tcnt =".++$tcnt."<br />";$component->setProperty( 'X-CNT', $tcnt ); // test ###
1226
- $component->setProperty( 'X-CURRENT-DTSTART', $datestring );
1227
- if( $dtendExist || $dueExist || $durationExist ) {
1228
- if( date( 'Ymd', $rstart ) < $endYMD ) // not the last day
1229
- $tend = mktime( 23, 59, 59, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ));
1230
- else
1231
- $tend = mktime( date( 'H', $endWdate ), date( 'i', $endWdate ), date( 's', $endWdate ), date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!!
1232
- if( $endAllDayEvent && $dtendExist )
1233
- $tend += ( 24 * 3600 ); // alldaysevents has an end date 'day after' meaning this day
1234
- $datestring = date( $endDateFormat, $tend );
1235
- if( isset( $end['tz'] ))
1236
- $datestring .= ' '.$end['tz'];
1237
- $propName = ( !$dueExist ) ? 'X-CURRENT-DTEND' : 'X-CURRENT-DUE';
1238
- $component->setProperty( $propName, $datestring );
1239
- } // end if( $dtendExist || $dueExist || $durationExist )
1240
- $wd = getdate( $rstart );
1241
- $result[$wd['year']][$wd['mon']][$wd['mday']][$compUID] = $component->copy(); // copy to output
1242
- $rstart = mktime( date( 'H', $rstart ), date( 'i', $rstart ), date( 's', $rstart ), date( 'm', $rstart ), date( 'd', $rstart ) + 1, date( 'Y', $rstart ) ); // step one day
1243
- } // end while( $rstart <= $endWdate )
1244
- } // end if( $split ) - else use component date
1245
  elseif( $recurrid && !$flat && !$any && !$split )
1246
  $continue = TRUE;
1247
  else { // !$flat && !$split, i.e. no flat array and DTSTART within period
1248
  $checkDate = mktime( 0, 0, 0, date( 'm', $startWdate ), date( 'd', $startWdate ), date( 'Y', $startWdate ) ); // on a day-basis !!!
1249
- if( !$any || !isset( $exdatelist[$checkDate] )) { // exclude any recurrence date, found in exdatelist
 
 
 
1250
  $wd = getdate( $startWdate );
1251
  $result[$wd['year']][$wd['mon']][$wd['mday']][$compUID] = $component->copy(); // copy to output
1252
  }
1253
  }
1254
  } // end if(( $startWdate >= $startDate ) && ( $startWdate <= $endDate ))
1255
-
1256
  /* if 'any' components, check components with reccurrence rules, removing all excluding dates */
1257
  if( TRUE === $any ) {
1258
  /* make a list of optional repeating dates for component occurence, rrule, rdate */
1259
  $recurlist = array();
1260
  while( FALSE !== ( $rrule = $component->getProperty( 'rrule' ))) // check rrule
1261
  iCalUtilityFunctions::_recur2date( $recurlist, $rrule, $start, $workstart, $workend );
1262
- foreach( $recurlist as $recurkey => $recurvalue ) // key=match date as timestamp
1263
- $recurlist[$recurkey] = $rdurWsecs; // add duration in seconds
1264
  while( FALSE !== ( $rdate = $component->getProperty( 'rdate' ))) { // check rdate
1265
  foreach( $rdate as $theRdate ) {
1266
- if( is_array( $theRdate ) && ( 2 == count( $theRdate )) && // all days within PERIOD
1267
  array_key_exists( '0', $theRdate ) && array_key_exists( '1', $theRdate )) {
1268
  $rstart = iCalUtilityFunctions::_date2timestamp( $theRdate[0] );
1269
  if(( $rstart < ( $startDate - $rdurWsecs )) || ( $rstart > $endDate ))
@@ -1286,19 +1264,26 @@ class vcalendar {
1286
  }
1287
  }
1288
  } // end - check rdate
 
 
 
 
 
1289
  if( 0 < count( $recurlist )) {
1290
  ksort( $recurlist );
1291
  $xRecurrence = 1;
1292
  $component2 = $component->copy();
1293
  $compUID = $component2->getProperty( 'UID' );
1294
  foreach( $recurlist as $recurkey => $durvalue ) {
1295
- // echo "recurKey=".date( 'Y-m-d H:i:s', $recurkey ).' dur='.iCalUtilityFunctions::offsetSec2His( $durvalue )."<br />\n"; // test ###;
1296
  if((( $startDate - $rdurWsecs ) > $recurkey ) || ( $endDate < $recurkey )) // not within period
1297
  continue;
1298
  $checkDate = mktime( 0, 0, 0, date( 'm', $recurkey ), date( 'd', $recurkey ), date( 'Y', $recurkey ) ); // on a day-basis !!!
1299
- if( isset( $exdatelist[$checkDate] )) // check excluded dates
1300
  continue;
1301
- if( $startWdate >= $recurkey ) // exclude component start date
 
 
1302
  continue;
1303
  $rstart = $recurkey;
1304
  $rend = $recurkey + $durvalue;
@@ -1309,101 +1294,79 @@ class vcalendar {
1309
  }
1310
  /* add repeating components within valid dates to output array, one each day */
1311
  elseif( $split ) {
 
1312
  if( $rend > $endDate )
1313
  $rend = $endDate;
1314
- $startYMD = date( 'Ymd', $rstart );
1315
  $endYMD = date( 'Ymd', $rend );
1316
- // echo "splitStart=".date( 'Y-m-d H:i:s', $rstart ).' end='.date( 'Y-m-d H:i:s', $rend )."<br />\n"; // test ###;
1317
- while( $rstart <= $rend ) { // iterate.. .
1318
  $checkDate = mktime( 0, 0, 0, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!!
1319
- if( isset( $exdatelist[$checkDate] )) // exclude any recurrence START date, found in exdatelist
1320
  break;
1321
- // echo "checking date after startdate=".date( 'Y-m-d H:i:s', $rstart ).' mot '.date( 'Y-m-d H:i:s', $startDate )."<br />"; // test ###;
1322
- if( $rstart >= $startDate ) { // date after dtstart
1323
- if( date( 'Ymd', $rstart ) > $startYMD ) // date after dtstart
1324
- $datestring = date( $startDateFormat, $checkDate );
1325
- else
1326
- $datestring = date( $startDateFormat, $rstart );
1327
- if( isset( $start['tz'] ))
1328
- $datestring .= ' '.$start['tz'];
1329
- //echo "X-CURRENT-DTSTART 1 = $datestring xRecurrence=$xRecurrence tcnt =".++$tcnt."<br />";$component2->setProperty( 'X-CNT', $tcnt ); // test ###
1330
- $component2->setProperty( 'X-CURRENT-DTSTART', $datestring );
1331
- if( $dtendExist || $dueExist || $durationExist ) {
1332
- if( date( 'Ymd', $rstart ) < $endYMD ) // not the last day
1333
- $tend = mktime( 23, 59, 59, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ));
1334
- else
1335
- $tend = mktime( date( 'H', $endWdate ), date( 'i', $endWdate ), date( 's', $endWdate ), date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!!
1336
- if( $endAllDayEvent && $dtendExist )
1337
- $tend += ( 24 * 3600 ); // alldaysevents has an end date 'day after' meaning this day
1338
- $datestring = date( $endDateFormat, $tend );
1339
- if( isset( $end['tz'] ))
1340
- $datestring .= ' '.$end['tz'];
1341
- $propName = ( !$dueExist ) ? 'X-CURRENT-DTEND' : 'X-CURRENT-DUE';
1342
- $component2->setProperty( $propName, $datestring );
1343
- } // end if( $dtendExist || $dueExist || $durationExist )
1344
  $component2->setProperty( 'X-RECURRENCE', $xRecurrence );
1345
  $wd = getdate( $rstart );
1346
  $result[$wd['year']][$wd['mon']][$wd['mday']][$compUID] = $component2->copy(); // copy to output
1347
- } // end if( $checkDate > $startYMD ) { // date after dtstart
1348
- $rstart = mktime( date( 'H', $rstart ), date( 'i', $rstart ), date( 's', $rstart ), date( 'm', $rstart ), date( 'd', $rstart ) + 1, date( 'Y', $rstart ) ); // step one day
 
1349
  } // end while( $rstart <= $rend )
1350
- $xRecurrence += 1;
1351
  } // end elseif( $split )
1352
- elseif( $rstart >= $startDate ) { // date within period //* flat=FALSE && split=FALSE => one comp every recur startdate *//
 
1353
  $checkDate = mktime( 0, 0, 0, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!!
1354
- if( !isset( $exdatelist[$checkDate] )) { // exclude any recurrence START date, found in exdatelist
1355
- $xRecurrence += 1;
1356
- $datestring = date( $startDateFormat, $rstart );
1357
- if( isset( $start['tz'] ))
1358
- $datestring .= ' '.$start['tz'];
1359
- //echo "X-CURRENT-DTSTART 2 = $datestring xRecurrence=$xRecurrence tcnt =".++$tcnt."<br />";$component2->setProperty( 'X-CNT', $tcnt ); // test ###
1360
- $component2->setProperty( 'X-CURRENT-DTSTART', $datestring );
1361
- if( $dtendExist || $dueExist || $durationExist ) {
1362
- $tend = $rstart + $rdurWsecs;
1363
- if( date( 'Ymd', $tend ) < date( 'Ymd', $endWdate ))
1364
- $tend = mktime( 23, 59, 59, date( 'm', $tend ), date( 'd', $tend ), date( 'Y', $tend ));
1365
- else
1366
- $tend = mktime( date( 'H', $endWdate ), date( 'i', $endWdate ), date( 's', $endWdate ), date( 'm', $tend ), date( 'd', $tend ), date( 'Y', $tend ) ); // on a day-basis !!!
1367
- if( $endAllDayEvent && $dtendExist )
1368
- $tend += ( 24 * 3600 ); // alldaysevents has an end date 'day after' meaning this day
1369
- $datestring = date( $endDateFormat, $tend );
1370
- if( isset( $end['tz'] ))
1371
- $datestring .= ' '.$end['tz'];
1372
- $propName = ( !$dueExist ) ? 'X-CURRENT-DTEND' : 'X-CURRENT-DUE';
1373
- $component2->setProperty( $propName, $datestring );
1374
- } // end if( $dtendExist || $dueExist || $durationExist )
1375
  $component2->setProperty( 'X-RECURRENCE', $xRecurrence );
1376
  $wd = getdate( $rstart );
1377
  $result[$wd['year']][$wd['mon']][$wd['mday']][$compUID] = $component2->copy(); // copy to output
1378
  } // end if( !isset( $exdatelist[$checkDate] ))
1379
  } // end elseif( $rstart >= $startDate )
1380
  } // end foreach( $recurlist as $recurkey => $durvalue )
 
1381
  } // end if( 0 < count( $recurlist ))
1382
  /* deselect components with startdate/enddate not within period */
1383
  if(( $endWdate < $startDate ) || ( $startWdate > $endDate ))
1384
  continue;
1385
  } // end if( TRUE === $any )
1386
  } // end foreach ( $this->components as $cix => $component )
1387
- if( 0 >= count( $result )) return FALSE;
 
 
 
1388
  elseif( !$flat ) {
1389
  foreach( $result as $y => $yeararr ) {
1390
  foreach( $yeararr as $m => $montharr ) {
1391
  foreach( $montharr as $d => $dayarr ) {
1392
  if( empty( $result[$y][$m][$d] ))
1393
  unset( $result[$y][$m][$d] );
1394
- else
1395
- $result[$y][$m][$d] = array_values( $dayarr ); // skip tricky UID-index, hoping they are in hour order.. .
1396
- }
 
 
 
 
 
 
1397
  if( empty( $result[$y][$m] ))
1398
  unset( $result[$y][$m] );
1399
  else
1400
  ksort( $result[$y][$m] );
1401
- }
1402
  if( empty( $result[$y] ))
1403
  unset( $result[$y] );
1404
  else
1405
  ksort( $result[$y] );
1406
- }
1407
  if( empty( $result ))
1408
  unset( $result );
1409
  else
@@ -1417,7 +1380,7 @@ class vcalendar {
1417
  * select components from calendar on based on specific property value(-s)
1418
  *
1419
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
1420
- * @since 2.13.4 - 2012-08-07
1421
  * @param array $selectOptions, (string) key => (mixed) value, (key=propertyName)
1422
  * @return array
1423
  */
@@ -1425,18 +1388,18 @@ class vcalendar {
1425
  $output = array();
1426
  $allowedComps = array('vevent', 'vtodo', 'vjournal', 'vfreebusy' );
1427
  $allowedProperties = array( 'ATTENDEE', 'CATEGORIES', 'CONTACT', 'LOCATION', 'ORGANIZER', 'PRIORITY', 'RELATED-TO', 'RESOURCES', 'STATUS', 'SUMMARY', 'UID', 'URL' );
 
1428
  foreach( $this->components as $cix => $component3 ) {
1429
  if( !in_array( $component3->objName, $allowedComps ))
1430
  continue;
1431
  $uid = $component3->getProperty( 'UID' );
1432
  foreach( $selectOptions as $propName => $pvalue ) {
1433
- $propName = strtoupper( $propName );
1434
  if( !in_array( $propName, $allowedProperties ))
1435
  continue;
1436
  if( !is_array( $pvalue ))
1437
  $pvalue = array( $pvalue );
1438
  if(( 'UID' == $propName ) && in_array( $uid, $pvalue )) {
1439
- $output[] = $component3->copy();
1440
  continue;
1441
  }
1442
  elseif(( 'ATTENDEE' == $propName ) || ( 'CATEGORIES' == $propName ) || ( 'CONTACT' == $propName ) || ( 'RELATED-TO' == $propName ) || ( 'RESOURCES' == $propName )) { // multiple occurrence?
@@ -1444,8 +1407,8 @@ class vcalendar {
1444
  $component3->_getProperties( $propName, $propValues );
1445
  $propValues = array_keys( $propValues );
1446
  foreach( $pvalue as $theValue ) {
1447
- if( in_array( $theValue, $propValues ) && !isset( $output[$uid] )) {
1448
- $output[$uid] = $component3->copy();
1449
  break;
1450
  }
1451
  }
@@ -1456,36 +1419,65 @@ class vcalendar {
1456
  if( is_array( $d )) {
1457
  foreach( $d as $part ) {
1458
  if( in_array( $part, $pvalue ) && !isset( $output[$uid] ))
1459
- $output[$uid] = $component3->copy();
1460
  }
1461
  }
1462
  elseif(( 'SUMMARY' == $propName ) && !isset( $output[$uid] )) {
1463
  foreach( $pvalue as $pval ) {
1464
  if( FALSE !== stripos( $d, $pval )) {
1465
- $output[$uid] = $component3->copy();
1466
  break;
1467
  }
1468
  }
1469
  }
1470
  elseif( in_array( $d, $pvalue ) && !isset( $output[$uid] ))
1471
- $output[$uid] = $component3->copy();
1472
  } // end foreach( $selectOptions as $propName => $pvalue ) {
1473
  } // end foreach( $this->components as $cix => $component3 ) {
1474
  if( !empty( $output )) {
1475
- ksort( $output );
1476
- $output = array_values( $output );
 
 
 
 
 
1477
  }
1478
  return $output;
1479
  }
1480
  /**
1481
- * add calendar component to container
1482
  *
1483
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
1484
- * @since 2.8.8 - 2011-03-15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1485
  * @param object $component calendar component
1486
  * @param mixed $arg1 optional, ordno/component type/ component uid
1487
  * @param mixed $arg2 optional, ordno if arg1 = component type
1488
- * @return void
1489
  */
1490
  function setComponent( $component, $arg1=FALSE, $arg2=FALSE ) {
1491
  $component->setConfig( $this->getConfig(), FALSE, TRUE );
@@ -1494,6 +1486,7 @@ class vcalendar {
1494
  $dummy1 = $component->getProperty( 'dtstamp' );
1495
  $dummy2 = $component->getProperty( 'uid' );
1496
  }
 
1497
  if( !$arg1 ) { // plain insert, last in chain
1498
  $this->components[] = $component->copy();
1499
  return TRUE;
@@ -1544,133 +1537,54 @@ class vcalendar {
1544
  * otherwise sorting on specific (argument) property values
1545
  *
1546
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
1547
- * @since 2.13.4 - 2012-08-07
1548
  * @param string $sortArg, optional
 
 
1549
  * @return void
1550
- *
1551
  */
1552
  function sort( $sortArg=FALSE ) {
1553
- if( is_array( $this->components )) {
1554
- if( $sortArg ) {
1555
- $sortArg = strtoupper( $sortArg );
1556
- if( !in_array( $sortArg, array( 'ATTENDEE', 'CATEGORIES', 'CONTACT', 'DTSTAMP', 'LOCATION', 'ORGANIZER', 'PRIORITY', 'RELATED-TO', 'RESOURCES', 'STATUS', 'SUMMARY', 'URL' )))
1557
- $sortArg = FALSE;
1558
- }
1559
- /* set sort parameters for each component */
1560
- foreach( $this->components as $cix => & $c ) {
1561
- $c->srtk = array( '0', '0', '0', '0' );
1562
- if( 'vtimezone' == $c->objName ) {
1563
- if( FALSE === ( $c->srtk[0] = $c->getProperty( 'tzid' )))
1564
- $c->srtk[0] = 0;
1565
- continue;
1566
- }
1567
- elseif( $sortArg ) {
1568
- if(( 'ATTENDEE' == $sortArg ) || ( 'CATEGORIES' == $sortArg ) || ( 'CONTACT' == $sortArg ) || ( 'RELATED-TO' == $sortArg ) || ( 'RESOURCES' == $sortArg )) {
1569
- $propValues = array();
1570
- $c->_getProperties( $sortArg, $propValues );
1571
- if( !empty( $propValues )) {
1572
- $sk = array_keys( $propValues );
1573
- $c->srtk[0] = $sk[0];
1574
- if( 'RELATED-TO' == $sortArg )
1575
- $c->srtk[0] .= $c->getProperty( 'uid' );
1576
- }
1577
- elseif( 'RELATED-TO' == $sortArg )
1578
- $c->srtk[0] = $c->getProperty( 'uid' );
1579
- }
1580
- elseif( FALSE !== ( $d = $c->getProperty( $sortArg )))
1581
- $c->srtk[0] = $d;
1582
- continue;
1583
- }
1584
- if( FALSE !== ( $d = $c->getProperty( 'X-CURRENT-DTSTART' ))) {
1585
- $c->srtk[0] = iCalUtilityFunctions::_strdate2date( $d[1] );
1586
- unset( $c->srtk[0]['unparsedtext'] );
1587
- }
1588
- elseif( FALSE === ( $c->srtk[0] = $c->getProperty( 'dtstart' )))
1589
- $c->srtk[1] = 0; // sortkey 0 : dtstart
1590
- if( FALSE !== ( $d = $c->getProperty( 'X-CURRENT-DTEND' ))) {
1591
- $c->srtk[1] = iCalUtilityFunctions::_strdate2date( $d[1] ); // sortkey 1 : dtend/due(/dtstart+duration)
1592
- unset( $c->srtk[1]['unparsedtext'] );
1593
- }
1594
- elseif( FALSE === ( $c->srtk[1] = $c->getProperty( 'dtend' ))) {
1595
- if( FALSE !== ( $d = $c->getProperty( 'X-CURRENT-DUE' ))) {
1596
- $c->srtk[1] = iCalUtilityFunctions::_strdate2date( $d[1] );
1597
- unset( $c->srtk[1]['unparsedtext'] );
1598
- }
1599
- elseif( FALSE === ( $c->srtk[1] = $c->getProperty( 'due' )))
1600
- if( FALSE === ( $c->srtk[1] = $c->getProperty( 'duration', FALSE, FALSE, TRUE )))
1601
- $c->srtk[1] = 0;
1602
- }
1603
- if( FALSE === ( $c->srtk[2] = $c->getProperty( 'created' ))) // sortkey 2 : created/dtstamp
1604
- if( FALSE === ( $c->srtk[2] = $c->getProperty( 'dtstamp' )))
1605
- $c->srtk[2] = 0;
1606
- if( FALSE === ( $c->srtk[3] = $c->getProperty( 'uid' ))) // sortkey 3 : uid
1607
- $c->srtk[3] = 0;
1608
- } // end foreach( $this->components as & $c
1609
- /* sort */
1610
- usort( $this->components, array( $this, '_cmpfcn' ));
1611
- }
1612
- }
1613
- function _cmpfcn( $a, $b ) {
1614
- if( empty( $a )) return -1;
1615
- if( empty( $b )) return 1;
1616
- if( 'vtimezone' == $a->objName ) {
1617
- if( 'vtimezone' != $b->objName ) return -1;
1618
- elseif( $a->srtk[0] <= $b->srtk[0] ) return -1;
1619
- else return 1;
1620
- }
1621
- elseif( 'vtimezone' == $b->objName ) return 1;
1622
- $sortkeys = array( 'year', 'month', 'day', 'hour', 'min', 'sec' );
1623
- for( $k = 0; $k < 4 ; $k++ ) {
1624
- if( empty( $a->srtk[$k] )) return -1;
1625
- elseif( empty( $b->srtk[$k] )) return 1;
1626
- if( is_array( $a->srtk[$k] )) {
1627
- if( is_array( $b->srtk[$k] )) {
1628
- foreach( $sortkeys as $key ) {
1629
- if ( !isset( $a->srtk[$k][$key] )) return -1;
1630
- elseif( !isset( $b->srtk[$k][$key] )) return 1;
1631
- if ( empty( $a->srtk[$k][$key] )) return -1;
1632
- elseif( empty( $b->srtk[$k][$key] )) return 1;
1633
- if ( $a->srtk[$k][$key] == $b->srtk[$k][$key])
1634
- continue;
1635
- if (( (int) $a->srtk[$k][$key] ) < ((int) $b->srtk[$k][$key] ))
1636
- return -1;
1637
- elseif(( (int) $a->srtk[$k][$key] ) > ((int) $b->srtk[$k][$key] ))
1638
- return 1;
1639
- }
1640
- }
1641
- else return -1;
1642
- }
1643
- elseif( is_array( $b->srtk[$k] )) return 1;
1644
- elseif( $a->srtk[$k] < $b->srtk[$k] ) return -1;
1645
- elseif( $a->srtk[$k] > $b->srtk[$k] ) return 1;
1646
  }
1647
- return 0;
 
 
1648
  }
1649
  /**
1650
  * parse iCal text/file into vcalendar, components, properties and parameters
1651
  *
1652
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
1653
- * @since 2.15.10 - 2012-10-28
1654
  * @param mixed $unparsedtext, optional, strict rfc2445 formatted, single property string or array of property strings
1655
  * @return bool FALSE if error occurs during parsing
1656
- *
1657
  */
1658
  function parse( $unparsedtext=FALSE ) {
1659
  $nl = $this->getConfig( 'nl' );
1660
  if(( FALSE === $unparsedtext ) || empty( $unparsedtext )) {
1661
- /* directory+filename is set previously via setConfig directory+filename or url */
1662
- if( FALSE === ( $filename = $this->getConfig( 'url' )))
1663
- $filename = $this->getConfig( 'dirfile' );
 
 
 
 
 
 
1664
  /* READ FILE */
1665
- if( FALSE === ( $rows = file_get_contents( $filename )))
1666
- return FALSE; /* err 1 */
1667
  }
1668
  elseif( is_array( $unparsedtext ))
1669
  $rows = implode( '\n'.$nl, $unparsedtext );
1670
  else
1671
  $rows = & $unparsedtext;
1672
  /* fix line folding */
1673
- $rows = explode( $nl, iCalUtilityFunctions::convEolChar( $rows, $nl ));
1674
  /* skip leading (empty/invalid) lines */
1675
  foreach( $rows as $lix => $line ) {
1676
  if( FALSE !== stripos( $line, 'BEGIN:VCALENDAR' ))
@@ -1754,9 +1668,6 @@ class vcalendar {
1754
  $line .= rtrim( substr( $this->unparsed[++$i], 1 ), $nl );
1755
  $proprows[] = $line;
1756
  }
1757
- $paramMStz = array( 'utc-', 'utc+', 'gmt-', 'gmt+' );
1758
- $paramProto3 = array( 'fax:', 'cid:', 'sms:', 'tel:', 'urn:' );
1759
- $paramProto4 = array( 'crid:', 'news:', 'pres:' );
1760
  foreach( $proprows as $line ) {
1761
  if( '\n' == substr( $line, -2 ))
1762
  $line = substr( $line, 0, -2 );
@@ -1779,51 +1690,7 @@ class vcalendar {
1779
  /* rest of the line is opt.params and value */
1780
  $line = substr( $line, $cix);
1781
  /* separate attributes from value */
1782
- $attr = array();
1783
- $attrix = -1;
1784
- $strlen = strlen( $line );
1785
- $WithinQuotes = FALSE;
1786
- $cix = 0;
1787
- while( FALSE !== substr( $line, $cix, 1 )) {
1788
- if( ( ':' == $line[$cix] ) &&
1789
- ( substr( $line,$cix, 3 ) != '://' ) &&
1790
- ( !in_array( strtolower( substr( $line,$cix - 6, 4 )), $paramMStz )) &&
1791
- ( !in_array( strtolower( substr( $line,$cix - 3, 4 )), $paramProto3 )) &&
1792
- ( !in_array( strtolower( substr( $line,$cix - 4, 5 )), $paramProto4 )) &&
1793
- ( strtolower( substr( $line,$cix - 6, 7 )) != 'mailto:' ) &&
1794
- !$WithinQuotes ) {
1795
- $attrEnd = TRUE;
1796
- if(( $cix < ( $strlen - 4 )) &&
1797
- ctype_digit( substr( $line, $cix+1, 4 ))) { // an URI with a (4pos) portnr??
1798
- for( $c2ix = $cix; 3 < $c2ix; $c2ix-- ) {
1799
- if( '://' == substr( $line, $c2ix - 2, 3 )) {
1800
- $attrEnd = FALSE;
1801
- break; // an URI with a portnr!!
1802
- }
1803
- }
1804
- }
1805
- if( $attrEnd) {
1806
- $line = substr( $line, ( $cix + 1 ));
1807
- break;
1808
- }
1809
- }
1810
- if( '"' == $line[$cix] )
1811
- $WithinQuotes = ( FALSE === $WithinQuotes ) ? TRUE : FALSE;
1812
- if( ';' == $line[$cix] )
1813
- $attr[++$attrix] = null;
1814
- else
1815
- $attr[$attrix] .= $line[$cix];
1816
- $cix++;
1817
- }
1818
- /* make attributes in array format */
1819
- $propattr = array();
1820
- foreach( $attr as $attribute ) {
1821
- $attrsplit = explode( '=', $attribute, 2 );
1822
- if( 1 < count( $attrsplit ))
1823
- $propattr[$attrsplit[0]] = $attrsplit[1];
1824
- else
1825
- $propattr[] = $attribute;
1826
- }
1827
  /* update Property */
1828
  if( FALSE !== strpos( $line, ',' )) {
1829
  $content = array( 0 => '' );
@@ -1839,15 +1706,15 @@ class vcalendar {
1839
  }
1840
  if( 1 < count( $content )) {
1841
  foreach( $content as $cix => $contentPart )
1842
- $content[$cix] = calendarComponent::_strunrep( $contentPart );
1843
- $this->setProperty( $propname, $content, $propattr );
1844
  continue;
1845
  }
1846
  else
1847
  $line = reset( $content );
1848
- $line = calendarComponent::_strunrep( $line );
1849
  }
1850
- $this->setProperty( $propname, rtrim( $line, "\x00..\x1F" ), $propattr );
1851
  } // end - foreach( $this->unparsed.. .
1852
  } // end - if( is_array( $this->unparsed.. .
1853
  unset( $unparsedtext, $rows, $this->unparsed, $proprows );
@@ -2141,13 +2008,13 @@ class calendarComponent {
2141
  * set calendar component property action
2142
  *
2143
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2144
- * @since 2.4.8 - 2008-11-04
2145
  * @param string $value "AUDIO" / "DISPLAY" / "EMAIL" / "PROCEDURE"
2146
  * @param mixed $params
2147
  * @return bool
2148
  */
2149
  function setAction( $value, $params=FALSE ) {
2150
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
2151
  $this->action = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
2152
  return TRUE;
2153
  }
@@ -2190,14 +2057,14 @@ class calendarComponent {
2190
  * set calendar component property attach
2191
  *
2192
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2193
- * @since 2.5.1 - 2008-11-06
2194
  * @param string $value
2195
  * @param array $params, optional
2196
  * @param integer $index, optional
2197
  * @return bool
2198
  */
2199
  function setAttach( $value, $params=FALSE, $index=FALSE ) {
2200
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
2201
  iCalUtilityFunctions::_setMval( $this->attach, $value, $params, FALSE, $index );
2202
  return TRUE;
2203
  }
@@ -2295,14 +2162,14 @@ class calendarComponent {
2295
  * set calendar component property attach
2296
  *
2297
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2298
- * @since 2.12.18 - 2012-07-13
2299
  * @param string $value
2300
  * @param array $params, optional
2301
  * @param integer $index, optional
2302
  * @return bool
2303
  */
2304
  function setAttendee( $value, $params=FALSE, $index=FALSE ) {
2305
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
2306
  // ftp://, http://, mailto:, file://, gopher://, news:, nntp://, telnet://, wais://, prospero:// may exist.. . also in params
2307
  if( !empty( $value )) {
2308
  if( FALSE === ( $pos = strpos( substr( $value, 0, 9 ), ':' )))
@@ -2314,8 +2181,10 @@ class calendarComponent {
2314
  $params2 = array();
2315
  if( is_array($params )) {
2316
  $optarrays = array();
 
2317
  foreach( $params as $optparamlabel => $optparamvalue ) {
2318
- $optparamlabel = strtoupper( $optparamlabel );
 
2319
  switch( $optparamlabel ) {
2320
  case 'MEMBER':
2321
  case 'DELEGATED-TO':
@@ -2373,7 +2242,7 @@ class calendarComponent {
2373
  * creates formatted output for calendar component property categories
2374
  *
2375
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2376
- * @since 2.4.8 - 2008-10-22
2377
  * @return string
2378
  */
2379
  function createCategories() {
@@ -2388,11 +2257,11 @@ class calendarComponent {
2388
  $attributes = $this->_createParams( $category['params'], array( 'LANGUAGE' ));
2389
  if( is_array( $category['value'] )) {
2390
  foreach( $category['value'] as $cix => $categoryPart )
2391
- $category['value'][$cix] = $this->_strrep( $categoryPart );
2392
  $content = implode( ',', $category['value'] );
2393
  }
2394
  else
2395
- $content = $this->_strrep( $category['value'] );
2396
  $output .= $this->_createElement( 'CATEGORIES', $attributes, $content );
2397
  }
2398
  return $output;
@@ -2401,14 +2270,14 @@ class calendarComponent {
2401
  * set calendar component property categories
2402
  *
2403
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2404
- * @since 2.5.1 - 2008-11-06
2405
  * @param mixed $value
2406
  * @param array $params, optional
2407
  * @param integer $index, optional
2408
  * @return bool
2409
  */
2410
  function setCategories( $value, $params=FALSE, $index=FALSE ) {
2411
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
2412
  iCalUtilityFunctions::_setMval( $this->categories, $value, $params, FALSE, $index );
2413
  return TRUE;
2414
  }
@@ -2434,13 +2303,13 @@ class calendarComponent {
2434
  * set calendar component property class
2435
  *
2436
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2437
- * @since 2.4.8 - 2008-11-04
2438
  * @param string $value "PUBLIC" / "PRIVATE" / "CONFIDENTIAL" / iana-token / x-name
2439
  * @param array $params optional
2440
  * @return bool
2441
  */
2442
  function setClass( $value, $params=FALSE ) {
2443
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
2444
  $this->class = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
2445
  return TRUE;
2446
  }
@@ -2452,7 +2321,7 @@ class calendarComponent {
2452
  * creates formatted output for calendar component property comment
2453
  *
2454
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2455
- * @since 2.4.8 - 2008-10-22
2456
  * @return string
2457
  */
2458
  function createComment() {
@@ -2464,7 +2333,7 @@ class calendarComponent {
2464
  continue;
2465
  }
2466
  $attributes = $this->_createParams( $commentPart['params'], array( 'ALTREP', 'LANGUAGE' ));
2467
- $content = $this->_strrep( $commentPart['value'] );
2468
  $output .= $this->_createElement( 'COMMENT', $attributes, $content );
2469
  }
2470
  return $output;
@@ -2473,14 +2342,14 @@ class calendarComponent {
2473
  * set calendar component property comment
2474
  *
2475
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2476
- * @since 2.5.1 - 2008-11-06
2477
  * @param string $value
2478
  * @param array $params, optional
2479
  * @param integer $index, optional
2480
  * @return bool
2481
  */
2482
  function setComment( $value, $params=FALSE, $index=FALSE ) {
2483
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
2484
  iCalUtilityFunctions::_setMval( $this->comment, $value, $params, FALSE, $index );
2485
  return TRUE;
2486
  }
@@ -2514,7 +2383,7 @@ class calendarComponent {
2514
  * set calendar component property completed
2515
  *
2516
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2517
- * @since 2.4.8 - 2008-10-23
2518
  * @param mixed $year
2519
  * @param mixed $month optional
2520
  * @param int $day optional
@@ -2527,7 +2396,7 @@ class calendarComponent {
2527
  function setCompleted( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) {
2528
  if( empty( $year )) {
2529
  if( $this->getConfig( 'allowEmpty' )) {
2530
- $this->completed = array( 'value' => null, 'params' => iCalUtilityFunctions::_setParams( $params ));
2531
  return TRUE;
2532
  }
2533
  else
@@ -2544,7 +2413,7 @@ class calendarComponent {
2544
  * creates formatted output for calendar component property contact
2545
  *
2546
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2547
- * @since 2.4.8 - 2008-10-23
2548
  * @return string
2549
  */
2550
  function createContact() {
@@ -2553,7 +2422,7 @@ class calendarComponent {
2553
  foreach( $this->contact as $contact ) {
2554
  if( !empty( $contact['value'] )) {
2555
  $attributes = $this->_createParams( $contact['params'], array( 'ALTREP', 'LANGUAGE' ));
2556
- $content = $this->_strrep( $contact['value'] );
2557
  $output .= $this->_createElement( 'CONTACT', $attributes, $content );
2558
  }
2559
  elseif( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'CONTACT' );
@@ -2564,14 +2433,14 @@ class calendarComponent {
2564
  * set calendar component property contact
2565
  *
2566
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2567
- * @since 2.5.1 - 2008-11-05
2568
  * @param string $value
2569
  * @param array $params, optional
2570
  * @param integer $index, optional
2571
  * @return bool
2572
  */
2573
  function setContact( $value, $params=FALSE, $index=FALSE ) {
2574
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
2575
  iCalUtilityFunctions::_setMval( $this->contact, $value, $params, FALSE, $index );
2576
  return TRUE;
2577
  }
@@ -2596,7 +2465,7 @@ class calendarComponent {
2596
  * set calendar component property created
2597
  *
2598
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2599
- * @since 2.4.8 - 2008-10-23
2600
  * @param mixed $year optional
2601
  * @param mixed $month optional
2602
  * @param int $day optional
@@ -2607,9 +2476,8 @@ class calendarComponent {
2607
  * @return bool
2608
  */
2609
  function setCreated( $year=FALSE, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) {
2610
- if( !isset( $year )) {
2611
- $year = date('Ymd\THis', mktime( date( 'H' ), date( 'i' ), date( 's' ) - date( 'Z'), date( 'm' ), date( 'd' ), date( 'Y' )));
2612
- }
2613
  $this->created = iCalUtilityFunctions::_setDate2( $year, $month, $day, $hour, $min, $sec, $params );
2614
  return TRUE;
2615
  }
@@ -2621,7 +2489,7 @@ class calendarComponent {
2621
  * creates formatted output for calendar component property description
2622
  *
2623
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2624
- * @since 2.4.8 - 2008-10-22
2625
  * @return string
2626
  */
2627
  function createDescription() {
@@ -2630,7 +2498,7 @@ class calendarComponent {
2630
  foreach( $this->description as $description ) {
2631
  if( !empty( $description['value'] )) {
2632
  $attributes = $this->_createParams( $description['params'], array( 'ALTREP', 'LANGUAGE' ));
2633
- $content = $this->_strrep( $description['value'] );
2634
  $output .= $this->_createElement( 'DESCRIPTION', $attributes, $content );
2635
  }
2636
  elseif( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'DESCRIPTION' );
@@ -2641,14 +2509,14 @@ class calendarComponent {
2641
  * set calendar component property description
2642
  *
2643
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2644
- * @since 2.6.24 - 2010-11-06
2645
  * @param string $value
2646
  * @param array $params, optional
2647
  * @param integer $index, optional
2648
  * @return bool
2649
  */
2650
  function setDescription( $value, $params=FALSE, $index=FALSE ) {
2651
- if( empty( $value )) { if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; }
2652
  if( 'vjournal' != $this->objName )
2653
  $index = 1;
2654
  iCalUtilityFunctions::_setMval( $this->description, $value, $params, FALSE, $index );
@@ -2685,7 +2553,7 @@ class calendarComponent {
2685
  * set calendar component property dtend
2686
  *
2687
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2688
- * @since 2.9.6 - 2011-05-14
2689
  * @param mixed $year
2690
  * @param mixed $month optional
2691
  * @param int $day optional
@@ -2699,7 +2567,7 @@ class calendarComponent {
2699
  function setDtend( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $tz=FALSE, $params=FALSE ) {
2700
  if( empty( $year )) {
2701
  if( $this->getConfig( 'allowEmpty' )) {
2702
- $this->dtend = array( 'value' => null, 'params' => iCalUtilityFunctions::_setParams( $params ));
2703
  return TRUE;
2704
  }
2705
  else
@@ -2735,11 +2603,11 @@ class calendarComponent {
2735
  * computes datestamp for calendar component object instance dtstamp
2736
  *
2737
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2738
- * @since 2.14.1 - 2012-09-29
2739
  * @return void
2740
  */
2741
  function _makeDtstamp() {
2742
- $d = date( 'Y-m-d-H-i-s', mktime( date('H'), date('i'), (date('s') - date( 'Z' )), date('m'), date('d'), date('Y')));
2743
  $date = explode( '-', $d );
2744
  $this->dtstamp['value'] = array( 'year' => $date[0], 'month' => $date[1], 'day' => $date[2], 'hour' => $date[3], 'min' => $date[4], 'sec' => $date[5], 'tz' => 'Z' );
2745
  $this->dtstamp['params'] = null;
@@ -2799,7 +2667,7 @@ class calendarComponent {
2799
  * set calendar component property dtstart
2800
  *
2801
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2802
- * @since 2.6.22 - 2010-09-22
2803
  * @param mixed $year
2804
  * @param mixed $month optional
2805
  * @param int $day optional
@@ -2813,7 +2681,7 @@ class calendarComponent {
2813
  function setDtstart( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $tz=FALSE, $params=FALSE ) {
2814
  if( empty( $year )) {
2815
  if( $this->getConfig( 'allowEmpty' )) {
2816
- $this->dtstart = array( 'value' => null, 'params' => iCalUtilityFunctions::_setParams( $params ));
2817
  return TRUE;
2818
  }
2819
  else
@@ -2855,7 +2723,7 @@ class calendarComponent {
2855
  * set calendar component property due
2856
  *
2857
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2858
- * @since 2.4.8 - 2008-11-04
2859
  * @param mixed $year
2860
  * @param mixed $month optional
2861
  * @param int $day optional
@@ -2868,7 +2736,7 @@ class calendarComponent {
2868
  function setDue( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $tz=FALSE, $params=FALSE ) {
2869
  if( empty( $year )) {
2870
  if( $this->getConfig( 'allowEmpty' )) {
2871
- $this->due = array( 'value' => null, 'params' => iCalUtilityFunctions::_setParams( $params ));
2872
  return TRUE;
2873
  }
2874
  else
@@ -2885,7 +2753,7 @@ class calendarComponent {
2885
  * creates formatted output for calendar component property duration
2886
  *
2887
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2888
- * @since 2.4.8 - 2008-10-21
2889
  * @return string
2890
  */
2891
  function createDuration() {
@@ -2896,7 +2764,7 @@ class calendarComponent {
2896
  !isset( $this->duration['value']['min'] ) &&
2897
  !isset( $this->duration['value']['sec'] ))
2898
  if( $this->getConfig( 'allowEmpty' ))
2899
- return $this->_createElement( 'DURATION', array(), null );
2900
  else return FALSE;
2901
  $attributes = $this->_createParams( $this->duration['params'] );
2902
  return $this->_createElement( 'DURATION', $attributes, iCalUtilityFunctions::_duration2str( $this->duration['value'] ));
@@ -2905,7 +2773,7 @@ class calendarComponent {
2905
  * set calendar component property duration
2906
  *
2907
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2908
- * @since 2.4.8 - 2008-11-04
2909
  * @param mixed $week
2910
  * @param mixed $day optional
2911
  * @param int $hour optional
@@ -2915,7 +2783,12 @@ class calendarComponent {
2915
  * @return bool
2916
  */
2917
  function setDuration( $week, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) {
2918
- if( empty( $week )) if( $this->getConfig( 'allowEmpty' )) $week = null; else return FALSE;
 
 
 
 
 
2919
  if( is_array( $week ) && ( 1 <= count( $week )))
2920
  $this->duration = array( 'value' => iCalUtilityFunctions::_duration2arr( $week ), 'params' => iCalUtilityFunctions::_setParams( $day ));
2921
  elseif( is_string( $week ) && ( 3 <= strlen( trim( $week )))) {
@@ -2924,10 +2797,9 @@ class calendarComponent {
2924
  $week = substr( $week, 1 );
2925
  $this->duration = array( 'value' => iCalUtilityFunctions::_durationStr2arr( $week ), 'params' => iCalUtilityFunctions::_setParams( $day ));
2926
  }
2927
- elseif( empty( $week ) && empty( $day ) && empty( $hour ) && empty( $min ) && empty( $sec ))
2928
- return FALSE;
2929
  else
2930
- $this->duration = array( 'value' => iCalUtilityFunctions::_duration2arr( array( $week, $day, $hour, $min, $sec )), 'params' => iCalUtilityFunctions::_setParams( $params ));
 
2931
  return TRUE;
2932
  }
2933
  /*********************************************************************************/
@@ -2938,17 +2810,26 @@ class calendarComponent {
2938
  * creates formatted output for calendar component property exdate
2939
  *
2940
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2941
- * @since 2.4.8 - 2008-10-22
2942
  * @return string
2943
  */
2944
  function createExdate() {
2945
  if( empty( $this->exdate )) return FALSE;
2946
- $output = null;
2947
- foreach( $this->exdate as $ex => $theExdate ) {
 
2948
  if( empty( $theExdate['value'] )) {
2949
- if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'EXDATE' );
 
2950
  continue;
2951
  }
 
 
 
 
 
 
 
2952
  $content = $attributes = null;
2953
  foreach( $theExdate['value'] as $eix => $exdatePart ) {
2954
  $parno = count( $exdatePart );
@@ -2967,19 +2848,19 @@ class calendarComponent {
2967
  }
2968
  else
2969
  $formatted = str_replace( 'Z', '', $formatted );
2970
- }
2971
  $content .= ( 0 < $eix ) ? ','.$formatted : $formatted;
2972
- }
2973
  $attributes .= $this->_createParams( $theExdate['params'] );
2974
  $output .= $this->_createElement( 'EXDATE', $attributes, $content );
2975
- }
2976
  return $output;
2977
  }
2978
  /**
2979
  * set calendar component property exdate
2980
  *
2981
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2982
- * @since 2.14.1 - 2012-10-02
2983
  * @param array exdates
2984
  * @param array $params, optional
2985
  * @param integer $index, optional
@@ -2988,7 +2869,7 @@ class calendarComponent {
2988
  function setExdate( $exdates, $params=FALSE, $index=FALSE ) {
2989
  if( empty( $exdates )) {
2990
  if( $this->getConfig( 'allowEmpty' )) {
2991
- iCalUtilityFunctions::_setMval( $this->exdate, null, $params, FALSE, $index );
2992
  return TRUE;
2993
  }
2994
  else
@@ -3067,14 +2948,14 @@ class calendarComponent {
3067
  * set calendar component property exdate
3068
  *
3069
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3070
- * @since 2.5.1 - 2008-11-05
3071
  * @param array $exruleset
3072
  * @param array $params, optional
3073
  * @param integer $index, optional
3074
  * @return bool
3075
  */
3076
  function setExrule( $exruleset, $params=FALSE, $index=FALSE ) {
3077
- if( empty( $exruleset )) if( $this->getConfig( 'allowEmpty' )) $exruleset = null; else return FALSE;
3078
  iCalUtilityFunctions::_setMval( $this->exrule, iCalUtilityFunctions::_setRexrule( $exruleset ), $params, FALSE, $index );
3079
  return TRUE;
3080
  }
@@ -3086,7 +2967,7 @@ class calendarComponent {
3086
  * creates formatted output for calendar component property freebusy
3087
  *
3088
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3089
- * @since 2.1.23 - 2012-02-16
3090
  * @return string
3091
  */
3092
  function createFreebusy() {
@@ -3108,6 +2989,8 @@ class calendarComponent {
3108
  $attributes .= $this->_createParams( $freebusyPart['params'] );
3109
  $fno = 1;
3110
  $cnt = count( $freebusyPart['value']);
 
 
3111
  foreach( $freebusyPart['value'] as $periodix => $freebusyPeriod ) {
3112
  $formatted = iCalUtilityFunctions::_date2strdate( $freebusyPeriod[0] );
3113
  $content .= $formatted;
@@ -3138,7 +3021,7 @@ class calendarComponent {
3138
  * set calendar component property freebusy
3139
  *
3140
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3141
- * @since 2.10.30 - 2012-01-16
3142
  * @param string $fbType
3143
  * @param array $fbValues
3144
  * @param array $params, optional
@@ -3148,7 +3031,7 @@ class calendarComponent {
3148
  function setFreebusy( $fbType, $fbValues, $params=FALSE, $index=FALSE ) {
3149
  if( empty( $fbValues )) {
3150
  if( $this->getConfig( 'allowEmpty' )) {
3151
- iCalUtilityFunctions::_setMval( $this->freebusy, null, $params, FALSE, $index );
3152
  return TRUE;
3153
  }
3154
  else
@@ -3204,48 +3087,36 @@ class calendarComponent {
3204
  * creates formatted output for calendar component property geo
3205
  *
3206
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3207
- * @since 2.12.6 - 2012-04-21
3208
  * @return string
3209
  */
3210
  function createGeo() {
3211
  if( empty( $this->geo )) return FALSE;
3212
  if( empty( $this->geo['value'] ))
3213
  return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'GEO' ) : FALSE;
3214
- $attributes = $this->_createParams( $this->geo['params'] );
3215
- if( 0.0 < $this->geo['value']['latitude'] )
3216
- $sign = '+';
3217
- else
3218
- $sign = ( 0.0 > $this->geo['value']['latitude'] ) ? '-' : '';
3219
- $content = $sign.sprintf( "%09.6f", abs( $this->geo['value']['latitude'] )); // sprintf && lpad && float && sign !"#¤%&/(
3220
- $content = rtrim( rtrim( $content, '0' ), '.' );
3221
- if( 0.0 < $this->geo['value']['longitude'] )
3222
- $sign = '+';
3223
- else
3224
- $sign = ( 0.0 > $this->geo['value']['longitude'] ) ? '-' : '';
3225
- $content .= ';'.$sign.sprintf( '%8.6f', abs( $this->geo['value']['longitude'] )); // sprintf && lpad && float && sign !"#¤%&/(
3226
- $content = rtrim( rtrim( $content, '0' ), '.' );
3227
- return $this->_createElement( 'GEO', $attributes, $content );
3228
  }
3229
  /**
3230
  * set calendar component property geo
3231
  *
3232
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3233
- * @since 2.12.5 - 2012-04-21
3234
- * @param float $latitude
3235
- * @param float $longitude
3236
  * @param array $params optional
3237
  * @return bool
3238
  */
3239
  function setGeo( $latitude, $longitude, $params=FALSE ) {
3240
- if(( !empty( $latitude ) || ( 0 == $latitude )) &&
3241
- ( !empty( $longitude ) || ( 0 == $longitude ))) {
3242
  if( !is_array( $this->geo )) $this->geo = array();
3243
- $this->geo['value']['latitude'] = (float) $latitude;
3244
- $this->geo['value']['longitude'] = (float) $longitude;
3245
  $this->geo['params'] = iCalUtilityFunctions::_setParams( $params );
3246
  }
3247
  elseif( $this->getConfig( 'allowEmpty' ))
3248
- $this->geo = array( 'value' => null, 'params' => iCalUtilityFunctions::_setParams( $params ) );
3249
  else
3250
  return FALSE;
3251
  return TRUE;
@@ -3271,7 +3142,7 @@ class calendarComponent {
3271
  * set calendar component property completed
3272
  *
3273
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3274
- * @since 2.4.8 - 2008-10-23
3275
  * @param mixed $year optional
3276
  * @param mixed $month optional
3277
  * @param int $day optional
@@ -3283,7 +3154,7 @@ class calendarComponent {
3283
  */
3284
  function setLastModified( $year=FALSE, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) {
3285
  if( empty( $year ))
3286
- $year = date('Ymd\THis', mktime( date( 'H' ), date( 'i' ), date( 's' ) - date( 'Z'), date( 'm' ), date( 'd' ), date( 'Y' )));
3287
  $this->lastmodified = iCalUtilityFunctions::_setDate2( $year, $month, $day, $hour, $min, $sec, $params );
3288
  return TRUE;
3289
  }
@@ -3295,7 +3166,7 @@ class calendarComponent {
3295
  * creates formatted output for calendar component property location
3296
  *
3297
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3298
- * @since 2.4.8 - 2008-10-22
3299
  * @return string
3300
  */
3301
  function createLocation() {
@@ -3303,20 +3174,20 @@ class calendarComponent {
3303
  if( empty( $this->location['value'] ))
3304
  return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'LOCATION' ) : FALSE;
3305
  $attributes = $this->_createParams( $this->location['params'], array( 'ALTREP', 'LANGUAGE' ));
3306
- $content = $this->_strrep( $this->location['value'] );
3307
  return $this->_createElement( 'LOCATION', $attributes, $content );
3308
  }
3309
  /**
3310
  * set calendar component property location
3311
  '
3312
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3313
- * @since 2.4.8 - 2008-11-04
3314
  * @param string $value
3315
  * @param array params optional
3316
  * @return bool
3317
  */
3318
  function setLocation( $value, $params=FALSE ) {
3319
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
3320
  $this->location = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
3321
  return TRUE;
3322
  }
@@ -3343,13 +3214,13 @@ class calendarComponent {
3343
  * set calendar component property organizer
3344
  *
3345
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3346
- * @since 2.12.18 - 2012-07-13
3347
  * @param string $value
3348
  * @param array params optional
3349
  * @return bool
3350
  */
3351
  function setOrganizer( $value, $params=FALSE ) {
3352
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
3353
  if( !empty( $value )) {
3354
  if( FALSE === ( $pos = strpos( substr( $value, 0, 9 ), ':' )))
3355
  $value = 'MAILTO:'.$value;
@@ -3388,13 +3259,13 @@ class calendarComponent {
3388
  * set calendar component property percent-complete
3389
  *
3390
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3391
- * @since 2.9.3 - 2011-05-14
3392
  * @param int $value
3393
  * @param array $params optional
3394
  * @return bool
3395
  */
3396
  function setPercentComplete( $value, $params=FALSE ) {
3397
- if( empty( $value ) && !is_numeric( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
3398
  $this->percentcomplete = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
3399
  return TRUE;
3400
  }
@@ -3420,13 +3291,13 @@ class calendarComponent {
3420
  * set calendar component property priority
3421
  *
3422
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3423
- * @since 2.9.3 - 2011-05-14
3424
  * @param int $value
3425
  * @param array $params optional
3426
  * @return bool
3427
  */
3428
  function setPriority( $value, $params=FALSE ) {
3429
- if( empty( $value ) && !is_numeric( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
3430
  $this->priority = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
3431
  return TRUE;
3432
  }
@@ -3438,15 +3309,14 @@ class calendarComponent {
3438
  * creates formatted output for calendar component property rdate
3439
  *
3440
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3441
- * @since 2.14.1 - 2012-10-04
3442
  * @return string
3443
  */
3444
  function createRdate() {
3445
  if( empty( $this->rdate )) return FALSE;
3446
  $utctime = ( in_array( $this->objName, array( 'vtimezone', 'standard', 'daylight' ))) ? TRUE : FALSE;
3447
  $output = null;
3448
- if( $utctime )
3449
- unset( $this->rdate['params']['TZID'] );
3450
  foreach( $this->rdate as $rpix => $theRdate ) {
3451
  if( empty( $theRdate['value'] )) {
3452
  if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'RDATE' );
@@ -3454,6 +3324,13 @@ class calendarComponent {
3454
  }
3455
  if( $utctime )
3456
  unset( $theRdate['params']['TZID'] );
 
 
 
 
 
 
 
3457
  $attributes = $this->_createParams( $theRdate['params'] );
3458
  $cnt = count( $theRdate['value'] );
3459
  $content = null;
@@ -3515,7 +3392,7 @@ class calendarComponent {
3515
  * set calendar component property rdate
3516
  *
3517
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3518
- * @since 2.14.1 - 2012-10-04
3519
  * @param array $rdates
3520
  * @param array $params, optional
3521
  * @param integer $index, optional
@@ -3524,7 +3401,7 @@ class calendarComponent {
3524
  function setRdate( $rdates, $params=FALSE, $index=FALSE ) {
3525
  if( empty( $rdates )) {
3526
  if( $this->getConfig( 'allowEmpty' )) {
3527
- iCalUtilityFunctions::_setMval( $this->rdate, null, $params, FALSE, $index );
3528
  return TRUE;
3529
  }
3530
  else
@@ -3685,7 +3562,7 @@ class calendarComponent {
3685
  * set calendar component property recurrence-id
3686
  *
3687
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3688
- * @since 2.9.6 - 2011-05-15
3689
  * @param mixed $year
3690
  * @param mixed $month optional
3691
  * @param int $day optional
@@ -3698,7 +3575,7 @@ class calendarComponent {
3698
  function setRecurrenceid( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $tz=FALSE, $params=FALSE ) {
3699
  if( empty( $year )) {
3700
  if( $this->getConfig( 'allowEmpty' )) {
3701
- $this->recurrenceid = array( 'value' => null, 'params' => null );
3702
  return TRUE;
3703
  }
3704
  else
@@ -3715,7 +3592,7 @@ class calendarComponent {
3715
  * creates formatted output for calendar component property related-to
3716
  *
3717
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3718
- * @since 2.11.24 - 2012-02-23
3719
  * @return string
3720
  */
3721
  function createRelatedTo() {
@@ -3723,9 +3600,9 @@ class calendarComponent {
3723
  $output = null;
3724
  foreach( $this->relatedto as $relation ) {
3725
  if( !empty( $relation['value'] ))
3726
- $output .= $this->_createElement( 'RELATED-TO', $this->_createParams( $relation['params'] ), $this->_strrep( $relation['value'] ) );
3727
  elseif( $this->getConfig( 'allowEmpty' ))
3728
- $output .= $this->_createElement( 'RELATED-TO', $this->_createParams( $relation['params'] ));
3729
  }
3730
  return $output;
3731
  }
@@ -3733,14 +3610,14 @@ class calendarComponent {
3733
  * set calendar component property related-to
3734
  *
3735
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3736
- * @since 2.11.24 - 2012-02-23
3737
  * @param float $relid
3738
  * @param array $params, optional
3739
  * @param index $index, optional
3740
  * @return bool
3741
  */
3742
  function setRelatedTo( $value, $params=FALSE, $index=FALSE ) {
3743
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
3744
  iCalUtilityFunctions::_existRem( $params, 'RELTYPE', 'PARENT', TRUE ); // remove default
3745
  iCalUtilityFunctions::_setMval( $this->relatedto, $value, $params, FALSE, $index );
3746
  return TRUE;
@@ -3767,13 +3644,13 @@ class calendarComponent {
3767
  * set calendar component property repeat
3768
  *
3769
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3770
- * @since 2.9.3 - 2011-05-14
3771
  * @param string $value
3772
  * @param array $params optional
3773
  * @return void
3774
  */
3775
  function setRepeat( $value, $params=FALSE ) {
3776
- if( empty( $value ) && !is_numeric( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
3777
  $this->repeat = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
3778
  return TRUE;
3779
  }
@@ -3784,7 +3661,7 @@ class calendarComponent {
3784
  /**
3785
  * creates formatted output for calendar component property request-status
3786
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3787
- * @since 2.4.8 - 2008-10-23
3788
  * @return string
3789
  */
3790
  function createRequestStatus() {
@@ -3797,9 +3674,9 @@ class calendarComponent {
3797
  }
3798
  $attributes = $this->_createParams( $rstat['params'], array( 'LANGUAGE' ));
3799
  $content = number_format( (float) $rstat['value']['statcode'], 2, '.', '');
3800
- $content .= ';'.$this->_strrep( $rstat['value']['text'] );
3801
  if( isset( $rstat['value']['extdata'] ))
3802
- $content .= ';'.$this->_strrep( $rstat['value']['extdata'] );
3803
  $output .= $this->_createElement( 'REQUEST-STATUS', $attributes, $content );
3804
  }
3805
  return $output;
@@ -3808,7 +3685,7 @@ class calendarComponent {
3808
  * set calendar component property request-status
3809
  *
3810
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3811
- * @since 2.5.1 - 2008-11-05
3812
  * @param float $statcode
3813
  * @param string $text
3814
  * @param string $extdata, optional
@@ -3817,7 +3694,7 @@ class calendarComponent {
3817
  * @return bool
3818
  */
3819
  function setRequestStatus( $statcode, $text, $extdata=FALSE, $params=FALSE, $index=FALSE ) {
3820
- if( empty( $statcode ) || empty( $text )) if( $this->getConfig( 'allowEmpty' )) $statcode = $text = null; else return FALSE;
3821
  $input = array( 'statcode' => $statcode, 'text' => $text );
3822
  if( $extdata )
3823
  $input['extdata'] = $extdata;
@@ -3832,7 +3709,7 @@ class calendarComponent {
3832
  * creates formatted output for calendar component property resources
3833
  *
3834
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3835
- * @since 2.4.8 - 2008-10-23
3836
  * @return string
3837
  */
3838
  function createResources() {
@@ -3846,11 +3723,11 @@ class calendarComponent {
3846
  $attributes = $this->_createParams( $resource['params'], array( 'ALTREP', 'LANGUAGE' ));
3847
  if( is_array( $resource['value'] )) {
3848
  foreach( $resource['value'] as $rix => $resourcePart )
3849
- $resource['value'][$rix] = $this->_strrep( $resourcePart );
3850
  $content = implode( ',', $resource['value'] );
3851
  }
3852
  else
3853
- $content = $this->_strrep( $resource['value'] );
3854
  $output .= $this->_createElement( 'RESOURCES', $attributes, $content );
3855
  }
3856
  return $output;
@@ -3859,14 +3736,14 @@ class calendarComponent {
3859
  * set calendar component property recources
3860
  *
3861
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3862
- * @since 2.5.1 - 2008-11-05
3863
  * @param mixed $value
3864
  * @param array $params, optional
3865
  * @param integer $index, optional
3866
  * @return bool
3867
  */
3868
  function setResources( $value, $params=FALSE, $index=FALSE ) {
3869
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
3870
  iCalUtilityFunctions::_setMval( $this->resources, $value, $params, FALSE, $index );
3871
  return TRUE;
3872
  }
@@ -3889,14 +3766,14 @@ class calendarComponent {
3889
  * set calendar component property rrule
3890
  *
3891
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3892
- * @since 2.5.1 - 2008-11-05
3893
  * @param array $rruleset
3894
  * @param array $params, optional
3895
  * @param integer $index, optional
3896
  * @return void
3897
  */
3898
  function setRrule( $rruleset, $params=FALSE, $index=FALSE ) {
3899
- if( empty( $rruleset )) if( $this->getConfig( 'allowEmpty' )) $rruleset = null; else return FALSE;
3900
  iCalUtilityFunctions::_setMval( $this->rrule, iCalUtilityFunctions::_setRexrule( $rruleset ), $params, FALSE, $index );
3901
  return TRUE;
3902
  }
@@ -3954,13 +3831,13 @@ class calendarComponent {
3954
  * set calendar component property status
3955
  *
3956
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3957
- * @since 2.4.8 - 2008-11-04
3958
  * @param string $value
3959
  * @param array $params optional
3960
  * @return bool
3961
  */
3962
  function setStatus( $value, $params=FALSE ) {
3963
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
3964
  $this->status = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
3965
  return TRUE;
3966
  }
@@ -3972,7 +3849,7 @@ class calendarComponent {
3972
  * creates formatted output for calendar component property summary
3973
  *
3974
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3975
- * @since 2.4.8 - 2008-10-21
3976
  * @return string
3977
  */
3978
  function createSummary() {
@@ -3980,20 +3857,20 @@ class calendarComponent {
3980
  if( empty( $this->summary['value'] ))
3981
  return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'SUMMARY' ) : FALSE;
3982
  $attributes = $this->_createParams( $this->summary['params'], array( 'ALTREP', 'LANGUAGE' ));
3983
- $content = $this->_strrep( $this->summary['value'] );
3984
  return $this->_createElement( 'SUMMARY', $attributes, $content );
3985
  }
3986
  /**
3987
  * set calendar component property summary
3988
  *
3989
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3990
- * @since 2.4.8 - 2008-11-04
3991
  * @param string $value
3992
  * @param string $params optional
3993
  * @return bool
3994
  */
3995
  function setSummary( $value, $params=FALSE ) {
3996
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
3997
  $this->summary = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
3998
  return TRUE;
3999
  }
@@ -4019,13 +3896,13 @@ class calendarComponent {
4019
  * set calendar component property transp
4020
  *
4021
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4022
- * @since 2.4.8 - 2008-11-04
4023
  * @param string $value
4024
  * @param string $params optional
4025
  * @return bool
4026
  */
4027
  function setTransp( $value, $params=FALSE ) {
4028
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
4029
  $this->transp = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
4030
  return TRUE;
4031
  }
@@ -4063,7 +3940,7 @@ class calendarComponent {
4063
  * set calendar component property trigger
4064
  *
4065
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4066
- * @since 2.14.1 - 2012-09-20
4067
  * @param mixed $year
4068
  * @param mixed $month optional
4069
  * @param int $day optional
@@ -4077,9 +3954,9 @@ class calendarComponent {
4077
  * @return bool
4078
  */
4079
  function setTrigger( $year, $month=null, $day=null, $week=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $relatedStart=TRUE, $before=TRUE, $params=FALSE ) {
4080
- if( empty( $year ) && empty( $month ) && empty( $day ) && empty( $week ) && empty( $hour ) && empty( $min ) && empty( $sec ))
4081
  if( $this->getConfig( 'allowEmpty' )) {
4082
- $this->trigger = array( 'value' => null, 'params' => iCalUtilityFunctions::_setParams( $params ) );
4083
  return TRUE;
4084
  }
4085
  else
@@ -4112,7 +3989,7 @@ class calendarComponent {
4112
  }
4113
  elseif(is_string( $year ) && ( is_array( $month ) || empty( $month ))) { // duration or date in a string
4114
  $params = iCalUtilityFunctions::_setParams( $month );
4115
- if( in_array( $year[0], array( 'P', '+', '-' ))) { // duration
4116
  $relatedStart = ( isset( $params['RELATED'] ) && ( 'END' == strtoupper( $params['RELATED'] ))) ? FALSE : TRUE;
4117
  $before = ( '-' == $year[0] ) ? TRUE : FALSE;
4118
  if( 'P' != $year[0] )
@@ -4164,6 +4041,8 @@ class calendarComponent {
4164
  $this->trigger['value']['sec'] = 0;
4165
  $before = FALSE;
4166
  }
 
 
4167
  $relatedStart = ( FALSE !== $relatedStart ) ? TRUE : FALSE;
4168
  $before = ( FALSE !== $before ) ? TRUE : FALSE;
4169
  $this->trigger['value']['relatedStart'] = $relatedStart;
@@ -4180,7 +4059,7 @@ class calendarComponent {
4180
  * creates formatted output for calendar component property tzid
4181
  *
4182
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4183
- * @since 2.4.8 - 2008-10-21
4184
  * @return string
4185
  */
4186
  function createTzid() {
@@ -4188,19 +4067,19 @@ class calendarComponent {
4188
  if( empty( $this->tzid['value'] ))
4189
  return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'TZID' ) : FALSE;
4190
  $attributes = $this->_createParams( $this->tzid['params'] );
4191
- return $this->_createElement( 'TZID', $attributes, $this->_strrep( $this->tzid['value'] ));
4192
  }
4193
  /**
4194
  * set calendar component property tzid
4195
  *
4196
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4197
- * @since 2.4.8 - 2008-11-04
4198
  * @param string $value
4199
  * @param array $params optional
4200
  * @return bool
4201
  */
4202
  function setTzid( $value, $params=FALSE ) {
4203
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
4204
  $this->tzid = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
4205
  return TRUE;
4206
  }
@@ -4213,7 +4092,7 @@ class calendarComponent {
4213
  * creates formatted output for calendar component property tzname
4214
  *
4215
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4216
- * @since 2.4.8 - 2008-10-21
4217
  * @return string
4218
  */
4219
  function createTzname() {
@@ -4222,7 +4101,7 @@ class calendarComponent {
4222
  foreach( $this->tzname as $theName ) {
4223
  if( !empty( $theName['value'] )) {
4224
  $attributes = $this->_createParams( $theName['params'], array( 'LANGUAGE' ));
4225
- $output .= $this->_createElement( 'TZNAME', $attributes, $this->_strrep( $theName['value'] ));
4226
  }
4227
  elseif( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'TZNAME' );
4228
  }
@@ -4232,14 +4111,14 @@ class calendarComponent {
4232
  * set calendar component property tzname
4233
  *
4234
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4235
- * @since 2.5.1 - 2008-11-05
4236
  * @param string $value
4237
  * @param string $params, optional
4238
  * @param integer $index, optional
4239
  * @return bool
4240
  */
4241
  function setTzname( $value, $params=FALSE, $index=FALSE ) {
4242
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
4243
  iCalUtilityFunctions::_setMval( $this->tzname, $value, $params, FALSE, $index );
4244
  return TRUE;
4245
  }
@@ -4265,13 +4144,13 @@ class calendarComponent {
4265
  * set calendar component property tzoffsetfrom
4266
  *
4267
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4268
- * @since 2.4.8 - 2008-11-04
4269
  * @param string $value
4270
  * @param string $params optional
4271
  * @return bool
4272
  */
4273
  function setTzoffsetfrom( $value, $params=FALSE ) {
4274
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
4275
  $this->tzoffsetfrom = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
4276
  return TRUE;
4277
  }
@@ -4297,13 +4176,13 @@ class calendarComponent {
4297
  * set calendar component property tzoffsetto
4298
  *
4299
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4300
- * @since 2.4.8 - 2008-11-04
4301
  * @param string $value
4302
  * @param string $params optional
4303
  * @return bool
4304
  */
4305
  function setTzoffsetto( $value, $params=FALSE ) {
4306
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
4307
  $this->tzoffsetto = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
4308
  return TRUE;
4309
  }
@@ -4329,13 +4208,13 @@ class calendarComponent {
4329
  * set calendar component property tzurl
4330
  *
4331
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4332
- * @since 2.4.8 - 2008-11-04
4333
  * @param string $value
4334
  * @param string $params optional
4335
  * @return boll
4336
  */
4337
  function setTzurl( $value, $params=FALSE ) {
4338
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
4339
  $this->tzurl = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
4340
  return TRUE;
4341
  }
@@ -4347,11 +4226,11 @@ class calendarComponent {
4347
  * creates formatted output for calendar component property uid
4348
  *
4349
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4350
- * @since 0.9.7 - 2006-11-20
4351
  * @return string
4352
  */
4353
  function createUid() {
4354
- if( 0 >= count( $this->uid ))
4355
  $this->_makeuid();
4356
  $attributes = $this->_createParams( $this->uid['params'] );
4357
  return $this->_createElement( 'UID', $attributes, $this->uid['value'] );
@@ -4380,13 +4259,13 @@ class calendarComponent {
4380
  * set calendar component property uid
4381
  *
4382
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4383
- * @since 2.4.8 - 2008-11-04
4384
  * @param string $value
4385
  * @param string $params optional
4386
  * @return bool
4387
  */
4388
  function setUid( $value, $params=FALSE ) {
4389
- if( empty( $value )) return FALSE; // no allowEmpty check here !!!!
4390
  $this->uid = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
4391
  return TRUE;
4392
  }
@@ -4412,13 +4291,20 @@ class calendarComponent {
4412
  * set calendar component property url
4413
  *
4414
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4415
- * @since 2.4.8 - 2008-11-04
4416
  * @param string $value
4417
  * @param string $params optional
4418
  * @return bool
4419
  */
4420
  function setUrl( $value, $params=FALSE ) {
4421
- if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
 
 
 
 
 
 
 
4422
  $this->url = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
4423
  return TRUE;
4424
  }
@@ -4430,7 +4316,7 @@ class calendarComponent {
4430
  * creates formatted output for calendar component property x-prop
4431
  *
4432
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4433
- * @since 2.9.3 - 2011-05-14
4434
  * @return string
4435
  */
4436
  function createXprop() {
@@ -4444,11 +4330,11 @@ class calendarComponent {
4444
  $attributes = $this->_createParams( $xpropPart['params'], array( 'LANGUAGE' ));
4445
  if( is_array( $xpropPart['value'] )) {
4446
  foreach( $xpropPart['value'] as $pix => $theXpart )
4447
- $xpropPart['value'][$pix] = $this->_strrep( $theXpart );
4448
  $xpropPart['value'] = implode( ',', $xpropPart['value'] );
4449
  }
4450
  else
4451
- $xpropPart['value'] = $this->_strrep( $xpropPart['value'] );
4452
  $output .= $this->_createElement( $label, $attributes, $xpropPart['value'] );
4453
  }
4454
  return $output;
@@ -4457,7 +4343,7 @@ class calendarComponent {
4457
  * set calendar component property x-prop
4458
  *
4459
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4460
- * @since 2.11.9 - 2012-01-16
4461
  * @param string $label
4462
  * @param mixed $value
4463
  * @param array $params optional
@@ -4466,13 +4352,14 @@ class calendarComponent {
4466
  function setXprop( $label, $value, $params=FALSE ) {
4467
  if( empty( $label ))
4468
  return FALSE;
4469
- if( 'X-' != strtoupper( substr( $label, 0, 2 )))
 
4470
  return FALSE;
4471
- if( empty( $value ) && !is_numeric( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE;
4472
  $xprop = array( 'value' => $value );
4473
  $xprop['params'] = iCalUtilityFunctions::_setParams( $params );
4474
  if( !is_array( $this->xprop )) $this->xprop = array();
4475
- $this->xprop[strtoupper( $label )] = $xprop;
4476
  return TRUE;
4477
  }
4478
  /*********************************************************************************/
@@ -4520,7 +4407,7 @@ class calendarComponent {
4520
  * creates formatted output for calendar component property
4521
  *
4522
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4523
- * @since 2.10.16 - 2011-10-28
4524
  * @param string $label property name
4525
  * @param string $attributes property attributes
4526
  * @param string $content property content (optional)
@@ -4621,7 +4508,7 @@ class calendarComponent {
4621
  break;
4622
  default:
4623
  $output .= $this->elementStart2.$this->valueInit;
4624
- return $this->_size75( $output );
4625
  break;
4626
  }
4627
  }
@@ -4632,7 +4519,7 @@ class calendarComponent {
4632
  return $output.$this->elementEnd1.$label.$this->elementEnd2;
4633
  break;
4634
  default:
4635
- return $this->_size75( $output );
4636
  break;
4637
  }
4638
  }
@@ -4640,7 +4527,7 @@ class calendarComponent {
4640
  * creates formatted output for calendar component property parameters
4641
  *
4642
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4643
- * @since 2.10.27 - 2012-01-16
4644
  * @param array $params optional
4645
  * @param array $ctrKeys optional
4646
  * @return string
@@ -4653,6 +4540,7 @@ class calendarComponent {
4653
  $LANGattrKey = ( in_array( 'LANGUAGE', $ctrKeys )) ? TRUE : FALSE ;
4654
  $CNattrExist = $LANGattrExist = FALSE;
4655
  $xparams = array();
 
4656
  foreach( $params as $paramKey => $paramValue ) {
4657
  if(( FALSE !== strpos( $paramValue, ':' )) ||
4658
  ( FALSE !== strpos( $paramValue, ';' )) ||
@@ -4662,7 +4550,6 @@ class calendarComponent {
4662
  $xparams[] = $paramValue;
4663
  continue;
4664
  }
4665
- $paramKey = strtoupper( $paramKey );
4666
  if( !in_array( $paramKey, array( 'ALTREP', 'CN', 'DIR', 'ENCODING', 'FMTTYPE', 'LANGUAGE', 'RANGE', 'RELTYPE', 'SENT-BY', 'TZID', 'VALUE' )))
4667
  $xparams[$paramKey] = $paramValue;
4668
  else
@@ -4724,7 +4611,7 @@ class calendarComponent {
4724
  * creates formatted output for calendar component property data value type recur
4725
  *
4726
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4727
- * @since 2.14.1 - 2012-10-06
4728
  * @param array $recurlabel
4729
  * @param array $recurdata
4730
  * @return string
@@ -4739,7 +4626,7 @@ class calendarComponent {
4739
  $attributes = ( isset( $therule['params'] )) ? $this->_createParams( $therule['params'] ) : null;
4740
  $content1 = $content2 = null;
4741
  foreach( $therule['value'] as $rulelabel => $rulevalue ) {
4742
- switch( $rulelabel ) {
4743
  case 'FREQ': {
4744
  $content1 .= "FREQ=$rulevalue";
4745
  break;
@@ -4775,32 +4662,21 @@ class calendarComponent {
4775
  break;
4776
  }
4777
  case 'BYDAY': {
4778
- $content2 .= ";$rulelabel=";
4779
- $bydaycnt = 0;
4780
- foreach( $rulevalue as $vix => $valuePart ) {
4781
- $content21 = $content22 = null;
4782
- if( is_array( $valuePart )) {
4783
- $content2 .= ( $bydaycnt ) ? ',' : null;
4784
- foreach( $valuePart as $vix2 => $valuePart2 ) {
4785
- if( 'DAY' != strtoupper( $vix2 ))
4786
- $content21 .= $valuePart2;
4787
- else
4788
- $content22 .= $valuePart2;
4789
- }
4790
- $content2 .= $content21.$content22;
4791
- $bydaycnt++;
4792
- }
4793
- else {
4794
- $content2 .= ( $bydaycnt ) ? ',' : null;
4795
- if( 'DAY' != strtoupper( $vix ))
4796
- $content21 .= $valuePart;
4797
- else {
4798
- $content22 .= $valuePart;
4799
- $bydaycnt++;
4800
- }
4801
- $content2 .= $content21.$content22;
4802
  }
4803
- }
 
 
 
4804
  break;
4805
  }
4806
  default: {
@@ -4838,7 +4714,7 @@ class calendarComponent {
4838
  * get general component config variables or info about subcomponents
4839
  *
4840
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4841
- * @since 2.9.6 - 2011-05-14
4842
  * @param mixed $config
4843
  * @return value
4844
  */
@@ -4887,7 +4763,7 @@ class calendarComponent {
4887
  case 'PROPINFO':
4888
  $output = array();
4889
  if( !in_array( $this->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' ))) {
4890
- if( empty( $this->uid['value'] )) $this->_makeuid();
4891
  $output['UID'] = 1;
4892
  if( empty( $this->dtstamp )) $this->_makeDtstamp();
4893
  $output['DTSTAMP'] = 1;
@@ -4954,7 +4830,7 @@ class calendarComponent {
4954
  * general component config setting
4955
  *
4956
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4957
- * @since 2.10.18 - 2011-10-28
4958
  * @param mixed $config
4959
  * @param string $value
4960
  * @param bool $softUpdate
@@ -4962,14 +4838,12 @@ class calendarComponent {
4962
  */
4963
  function setConfig( $config, $value = FALSE, $softUpdate = FALSE ) {
4964
  if( is_array( $config )) {
4965
- $ak = array_keys( $config );
4966
- foreach( $ak as $k ) {
4967
- if( 'NEWLINECHAR' == strtoupper( $k )) {
4968
- if( FALSE === $this->setConfig( 'NEWLINECHAR', $config[$k] ))
4969
- return FALSE;
4970
- unset( $config[$k] );
4971
- break;
4972
- }
4973
  }
4974
  foreach( $config as $cKey => $cValue ) {
4975
  if( FALSE === $this->setConfig( $cKey, $cValue, $softUpdate ))
@@ -4977,8 +4851,10 @@ class calendarComponent {
4977
  }
4978
  return TRUE;
4979
  }
 
 
4980
  $res = FALSE;
4981
- switch( strtoupper( $config )) {
4982
  case 'ALLOWEMPTY':
4983
  $this->allowEmpty = $value;
4984
  $subcfg = array( 'ALLOWEMPTY' => $value );
@@ -5260,7 +5136,7 @@ class calendarComponent {
5260
  case 'UID':
5261
  if( in_array( $this->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' )))
5262
  return FALSE;
5263
- if( !empty( $this->uid )) {
5264
  $this->uid = '';
5265
  $return = TRUE;
5266
  }
@@ -5325,7 +5201,7 @@ class calendarComponent {
5325
  * if property has multiply values, consequtive function calls are needed
5326
  *
5327
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
5328
- * @since 2.12.4 - 2012-04-22
5329
  * @param string $propName, optional
5330
  * @param int @propix, optional, if specific property is wanted in case of multiply occurences
5331
  * @param bool $inclParam=FALSE
@@ -5334,21 +5210,12 @@ class calendarComponent {
5334
  */
5335
  function getProperty( $propName=FALSE, $propix=FALSE, $inclParam=FALSE, $specform=FALSE ) {
5336
  if( 'GEOLOCATION' == strtoupper( $propName )) {
5337
- $content = $this->getProperty( 'LOCATION' );
5338
- $content = ( !empty( $content )) ? $content.' ' : '';
5339
- if(( FALSE === ( $geo = $this->getProperty( 'GEO' ))) || empty( $geo ))
5340
  return FALSE;
5341
- if( 0.0 < $geo['latitude'] )
5342
- $sign = '+';
5343
- else
5344
- $sign = ( 0.0 > $geo['latitude'] ) ? '-' : '';
5345
- $content .= $sign.sprintf( "%09.6f", abs( $geo['latitude'] )); // sprintf && lpad && float && sign !"#¤%&/(
5346
- $content = rtrim( rtrim( $content, '0' ), '.' );
5347
- if( 0.0 < $geo['longitude'] )
5348
- $sign = '+';
5349
- else
5350
- $sign = ( 0.0 > $geo['longitude'] ) ? '-' : '';
5351
- return $content.$sign.sprintf( '%8.6f', abs( $geo['longitude'] )).'/'; // sprintf && lpad && float && sign !"#¤%&/(
5352
  }
5353
  if( $this->_notExistProp( $propName )) return FALSE;
5354
  $propName = ( $propName ) ? strtoupper( $propName ) : 'X-PROP';
@@ -5360,7 +5227,7 @@ class calendarComponent {
5360
  }
5361
  switch( $propName ) {
5362
  case 'ACTION':
5363
- if( !empty( $this->action['value'] )) return ( $inclParam ) ? $this->action : $this->action['value'];
5364
  break;
5365
  case 'ATTACH':
5366
  $ak = ( is_array( $this->attach )) ? array_keys( $this->attach ) : array();
@@ -5387,7 +5254,7 @@ class calendarComponent {
5387
  return ( $inclParam ) ? $this->categories[$propix] : $this->categories[$propix]['value'];
5388
  break;
5389
  case 'CLASS':
5390
- if( !empty( $this->class['value'] )) return ( $inclParam ) ? $this->class : $this->class['value'];
5391
  break;
5392
  case 'COMMENT':
5393
  $ak = ( is_array( $this->comment )) ? array_keys( $this->comment ) : array();
@@ -5398,7 +5265,7 @@ class calendarComponent {
5398
  return ( $inclParam ) ? $this->comment[$propix] : $this->comment[$propix]['value'];
5399
  break;
5400
  case 'COMPLETED':
5401
- if( !empty( $this->completed['value'] )) return ( $inclParam ) ? $this->completed : $this->completed['value'];
5402
  break;
5403
  case 'CONTACT':
5404
  $ak = ( is_array( $this->contact )) ? array_keys( $this->contact ) : array();
@@ -5409,7 +5276,7 @@ class calendarComponent {
5409
  return ( $inclParam ) ? $this->contact[$propix] : $this->contact[$propix]['value'];
5410
  break;
5411
  case 'CREATED':
5412
- if( !empty( $this->created['value'] )) return ( $inclParam ) ? $this->created : $this->created['value'];
5413
  break;
5414
  case 'DESCRIPTION':
5415
  $ak = ( is_array( $this->description )) ? array_keys( $this->description ) : array();
@@ -5420,7 +5287,7 @@ class calendarComponent {
5420
  return ( $inclParam ) ? $this->description[$propix] : $this->description[$propix]['value'];
5421
  break;
5422
  case 'DTEND':
5423
- if( !empty( $this->dtend['value'] )) return ( $inclParam ) ? $this->dtend : $this->dtend['value'];
5424
  break;
5425
  case 'DTSTAMP':
5426
  if( in_array( $this->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' )))
@@ -5430,13 +5297,13 @@ class calendarComponent {
5430
  return ( $inclParam ) ? $this->dtstamp : $this->dtstamp['value'];
5431
  break;
5432
  case 'DTSTART':
5433
- if( !empty( $this->dtstart['value'] )) return ( $inclParam ) ? $this->dtstart : $this->dtstart['value'];
5434
  break;
5435
  case 'DUE':
5436
- if( !empty( $this->due['value'] )) return ( $inclParam ) ? $this->due : $this->due['value'];
5437
  break;
5438
  case 'DURATION':
5439
- if( !isset( $this->duration['value'] )) return FALSE;
5440
  $value = ( $specform && isset( $this->dtstart['value'] ) && isset( $this->duration['value'] )) ? iCalUtilityFunctions::_duration2date( $this->dtstart['value'], $this->duration['value'] ) : $this->duration['value'];
5441
  return ( $inclParam ) ? array( 'value' => $value, 'params' => $this->duration['params'] ) : $value;
5442
  break;
@@ -5465,22 +5332,22 @@ class calendarComponent {
5465
  return ( $inclParam ) ? $this->freebusy[$propix] : $this->freebusy[$propix]['value'];
5466
  break;
5467
  case 'GEO':
5468
- if( !empty( $this->geo['value'] )) return ( $inclParam ) ? $this->geo : $this->geo['value'];
5469
  break;
5470
  case 'LAST-MODIFIED':
5471
- if( !empty( $this->lastmodified['value'] )) return ( $inclParam ) ? $this->lastmodified : $this->lastmodified['value'];
5472
  break;
5473
  case 'LOCATION':
5474
- if( !empty( $this->location['value'] )) return ( $inclParam ) ? $this->location : $this->location['value'];
5475
  break;
5476
  case 'ORGANIZER':
5477
- if( !empty( $this->organizer['value'] )) return ( $inclParam ) ? $this->organizer : $this->organizer['value'];
5478
  break;
5479
  case 'PERCENT-COMPLETE':
5480
- if( !empty( $this->percentcomplete['value'] ) || ( isset( $this->percentcomplete['value'] ) && ( '0' == $this->percentcomplete['value'] ))) return ( $inclParam ) ? $this->percentcomplete : $this->percentcomplete['value'];
5481
  break;
5482
  case 'PRIORITY':
5483
- if( !empty( $this->priority['value'] ) || ( isset( $this->priority['value'] ) && ('0' == $this->priority['value'] ))) return ( $inclParam ) ? $this->priority : $this->priority['value'];
5484
  break;
5485
  case 'RDATE':
5486
  $ak = ( is_array( $this->rdate )) ? array_keys( $this->rdate ) : array();
@@ -5491,7 +5358,7 @@ class calendarComponent {
5491
  return ( $inclParam ) ? $this->rdate[$propix] : $this->rdate[$propix]['value'];
5492
  break;
5493
  case 'RECURRENCE-ID':
5494
- if( !empty( $this->recurrenceid['value'] )) return ( $inclParam ) ? $this->recurrenceid : $this->recurrenceid['value'];
5495
  break;
5496
  case 'RELATED-TO':
5497
  $ak = ( is_array( $this->relatedto )) ? array_keys( $this->relatedto ) : array();
@@ -5502,7 +5369,7 @@ class calendarComponent {
5502
  return ( $inclParam ) ? $this->relatedto[$propix] : $this->relatedto[$propix]['value'];
5503
  break;
5504
  case 'REPEAT':
5505
- if( !empty( $this->repeat['value'] ) || ( isset( $this->repeat['value'] ) && ( '0' == $this->repeat['value'] ))) return ( $inclParam ) ? $this->repeat : $this->repeat['value'];
5506
  break;
5507
  case 'REQUEST-STATUS':
5508
  $ak = ( is_array( $this->requeststatus )) ? array_keys( $this->requeststatus ) : array();
@@ -5529,22 +5396,22 @@ class calendarComponent {
5529
  return ( $inclParam ) ? $this->rrule[$propix] : $this->rrule[$propix]['value'];
5530
  break;
5531
  case 'SEQUENCE':
5532
- if( isset( $this->sequence['value'] ) && ( isset( $this->sequence['value'] ) && ( '0' <= $this->sequence['value'] ))) return ( $inclParam ) ? $this->sequence : $this->sequence['value'];
5533
  break;
5534
  case 'STATUS':
5535
- if( !empty( $this->status['value'] )) return ( $inclParam ) ? $this->status : $this->status['value'];
5536
  break;
5537
  case 'SUMMARY':
5538
- if( !empty( $this->summary['value'] )) return ( $inclParam ) ? $this->summary : $this->summary['value'];
5539
  break;
5540
  case 'TRANSP':
5541
- if( !empty( $this->transp['value'] )) return ( $inclParam ) ? $this->transp : $this->transp['value'];
5542
  break;
5543
  case 'TRIGGER':
5544
- if( !empty( $this->trigger['value'] )) return ( $inclParam ) ? $this->trigger : $this->trigger['value'];
5545
  break;
5546
  case 'TZID':
5547
- if( !empty( $this->tzid['value'] )) return ( $inclParam ) ? $this->tzid : $this->tzid['value'];
5548
  break;
5549
  case 'TZNAME':
5550
  $ak = ( is_array( $this->tzname )) ? array_keys( $this->tzname ) : array();
@@ -5555,23 +5422,23 @@ class calendarComponent {
5555
  return ( $inclParam ) ? $this->tzname[$propix] : $this->tzname[$propix]['value'];
5556
  break;
5557
  case 'TZOFFSETFROM':
5558
- if( !empty( $this->tzoffsetfrom['value'] )) return ( $inclParam ) ? $this->tzoffsetfrom : $this->tzoffsetfrom['value'];
5559
  break;
5560
  case 'TZOFFSETTO':
5561
- if( !empty( $this->tzoffsetto['value'] )) return ( $inclParam ) ? $this->tzoffsetto : $this->tzoffsetto['value'];
5562
  break;
5563
  case 'TZURL':
5564
- if( !empty( $this->tzurl['value'] )) return ( $inclParam ) ? $this->tzurl : $this->tzurl['value'];
5565
  break;
5566
  case 'UID':
5567
  if( in_array( $this->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' )))
5568
  return FALSE;
5569
- if( empty( $this->uid['value'] ))
5570
  $this->_makeuid();
5571
  return ( $inclParam ) ? $this->uid : $this->uid['value'];
5572
  break;
5573
  case 'URL':
5574
- if( !empty( $this->url['value'] )) return ( $inclParam ) ? $this->url : $this->url['value'];
5575
  break;
5576
  default:
5577
  if( $propName != 'X-PROP' ) {
@@ -5681,93 +5548,93 @@ class calendarComponent {
5681
  }
5682
  switch( $arglist[0] ) {
5683
  case 'ACTION':
5684
- return $this->setAction( $arglist[1], $arglist[2] );
5685
  case 'ATTACH':
5686
- return $this->setAttach( $arglist[1], $arglist[2], $arglist[3] );
5687
  case 'ATTENDEE':
5688
- return $this->setAttendee( $arglist[1], $arglist[2], $arglist[3] );
5689
  case 'CATEGORIES':
5690
- return $this->setCategories( $arglist[1], $arglist[2], $arglist[3] );
5691
  case 'CLASS':
5692
- return $this->setClass( $arglist[1], $arglist[2] );
5693
  case 'COMMENT':
5694
- return $this->setComment( $arglist[1], $arglist[2], $arglist[3] );
5695
  case 'COMPLETED':
5696
- return $this->setCompleted( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7] );
5697
  case 'CONTACT':
5698
- return $this->setContact( $arglist[1], $arglist[2], $arglist[3] );
5699
  case 'CREATED':
5700
- return $this->setCreated( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7] );
5701
  case 'DESCRIPTION':
5702
- return $this->setDescription( $arglist[1], $arglist[2], $arglist[3] );
5703
  case 'DTEND':
5704
- return $this->setDtend( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8] );
5705
  case 'DTSTAMP':
5706
- return $this->setDtstamp( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7] );
5707
  case 'DTSTART':
5708
- return $this->setDtstart( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8] );
5709
  case 'DUE':
5710
- return $this->setDue( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8] );
5711
  case 'DURATION':
5712
- return $this->setDuration( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6] );
5713
  case 'EXDATE':
5714
- return $this->setExdate( $arglist[1], $arglist[2], $arglist[3] );
5715
  case 'EXRULE':
5716
- return $this->setExrule( $arglist[1], $arglist[2], $arglist[3] );
5717
  case 'FREEBUSY':
5718
- return $this->setFreebusy( $arglist[1], $arglist[2], $arglist[3], $arglist[4] );
5719
  case 'GEO':
5720
- return $this->setGeo( $arglist[1], $arglist[2], $arglist[3] );
5721
  case 'LAST-MODIFIED':
5722
- return $this->setLastModified( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7] );
5723
  case 'LOCATION':
5724
- return $this->setLocation( $arglist[1], $arglist[2] );
5725
  case 'ORGANIZER':
5726
- return $this->setOrganizer( $arglist[1], $arglist[2] );
5727
  case 'PERCENT-COMPLETE':
5728
  return $this->setPercentComplete( $arglist[1], $arglist[2] );
5729
  case 'PRIORITY':
5730
- return $this->setPriority( $arglist[1], $arglist[2] );
5731
  case 'RDATE':
5732
- return $this->setRdate( $arglist[1], $arglist[2], $arglist[3] );
5733
  case 'RECURRENCE-ID':
5734
- return $this->setRecurrenceid( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8] );
5735
  case 'RELATED-TO':
5736
- return $this->setRelatedTo( $arglist[1], $arglist[2], $arglist[3] );
5737
  case 'REPEAT':
5738
- return $this->setRepeat( $arglist[1], $arglist[2] );
5739
  case 'REQUEST-STATUS':
5740
- return $this->setRequestStatus( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5] );
5741
  case 'RESOURCES':
5742
- return $this->setResources( $arglist[1], $arglist[2], $arglist[3] );
5743
  case 'RRULE':
5744
- return $this->setRrule( $arglist[1], $arglist[2], $arglist[3] );
5745
  case 'SEQUENCE':
5746
- return $this->setSequence( $arglist[1], $arglist[2] );
5747
  case 'STATUS':
5748
- return $this->setStatus( $arglist[1], $arglist[2] );
5749
  case 'SUMMARY':
5750
- return $this->setSummary( $arglist[1], $arglist[2] );
5751
  case 'TRANSP':
5752
- return $this->setTransp( $arglist[1], $arglist[2] );
5753
  case 'TRIGGER':
5754
- return $this->setTrigger( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8], $arglist[9], $arglist[10], $arglist[11] );
5755
  case 'TZID':
5756
- return $this->setTzid( $arglist[1], $arglist[2] );
5757
  case 'TZNAME':
5758
- return $this->setTzname( $arglist[1], $arglist[2], $arglist[3] );
5759
  case 'TZOFFSETFROM':
5760
- return $this->setTzoffsetfrom( $arglist[1], $arglist[2] );
5761
  case 'TZOFFSETTO':
5762
- return $this->setTzoffsetto( $arglist[1], $arglist[2] );
5763
  case 'TZURL':
5764
- return $this->setTzurl( $arglist[1], $arglist[2] );
5765
  case 'UID':
5766
- return $this->setUid( $arglist[1], $arglist[2] );
5767
  case 'URL':
5768
- return $this->setUrl( $arglist[1], $arglist[2] );
5769
  default:
5770
- return $this->setXprop( $arglist[0], $arglist[1], $arglist[2] );
5771
  }
5772
  return FALSE;
5773
  }
@@ -5776,17 +5643,16 @@ class calendarComponent {
5776
  * parse component unparsed data into properties
5777
  *
5778
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
5779
- * @since 2.15.10 - 2012-10-28
5780
  * @param mixed $unparsedtext, optional, strict rfc2445 formatted, single property string or array of strings
5781
  * @return bool FALSE if error occurs during parsing
5782
- *
5783
  */
5784
  function parse( $unparsedtext=null ) {
5785
  $nl = $this->getConfig( 'nl' );
5786
  if( !empty( $unparsedtext )) {
5787
  if( is_array( $unparsedtext ))
5788
  $unparsedtext = implode( '\n'.$nl, $unparsedtext );
5789
- $unparsedtext = explode( $nl, iCalUtilityFunctions::convEolChar( $unparsedtext, $nl ));
5790
  }
5791
  elseif( !isset( $this->unparsed ))
5792
  $unparsedtext = array();
@@ -5865,9 +5731,6 @@ class calendarComponent {
5865
  $proprows[] = $line;
5866
  }
5867
  /* parse each property 'line' */
5868
- $paramMStz = array( 'utc-', 'utc+', 'gmt-', 'gmt+' );
5869
- $paramProto3 = array( 'fax:', 'cid:', 'sms:', 'tel:', 'urn:' );
5870
- $paramProto4 = array( 'crid:', 'news:', 'pres:' );
5871
  foreach( $proprows as $line ) {
5872
  if( '\n' == substr( $line, -2 ))
5873
  $line = substr( $line, 0, -2 );
@@ -5890,67 +5753,19 @@ class calendarComponent {
5890
  /* rest of the line is opt.params and value */
5891
  $line = substr( $line, $cix );
5892
  /* separate attributes from value */
5893
- $attr = array();
5894
- $attrix = -1;
5895
- $clen = strlen( $line );
5896
- $WithinQuotes = FALSE;
5897
- $cix = 0;
5898
- while( FALSE !== substr( $line, $cix, 1 )) {
5899
- if( ( ':' == $line[$cix] ) &&
5900
- ( substr( $line,$cix, 3 ) != '://' ) &&
5901
- ( !in_array( strtolower( substr( $line,$cix - 6, 4 )), $paramMStz )) &&
5902
- ( !in_array( strtolower( substr( $line,$cix - 3, 4 )), $paramProto3 )) &&
5903
- ( !in_array( strtolower( substr( $line,$cix - 4, 5 )), $paramProto4 )) &&
5904
- ( strtolower( substr( $line,$cix - 6, 7 )) != 'mailto:' ) &&
5905
- !$WithinQuotes ) {
5906
- $attrEnd = TRUE;
5907
- if(( $cix < ( $clen - 4 )) &&
5908
- ctype_digit( substr( $line, $cix+1, 4 ))) { // an URI with a (4pos) portnr??
5909
- for( $c2ix = $cix; 3 < $c2ix; $c2ix-- ) {
5910
- if( '://' == substr( $line, $c2ix - 2, 3 )) {
5911
- $attrEnd = FALSE;
5912
- break; // an URI with a portnr!!
5913
- }
5914
- }
5915
- }
5916
- if( $attrEnd) {
5917
- $line = substr( $line, ( $cix + 1 ));
5918
- break;
5919
- }
5920
- $cix++;
5921
- }
5922
- if( '"' == $line[$cix] )
5923
- $WithinQuotes = ( FALSE === $WithinQuotes ) ? TRUE : FALSE;
5924
- if( ';' == $line[$cix] )
5925
- $attr[++$attrix] = null;
5926
- else
5927
- $attr[$attrix] .= $line[$cix];
5928
- $cix++;
5929
- }
5930
- /* make attributes in array format */
5931
- $propattr = array();
5932
- foreach( $attr as $attribute ) {
5933
- $attrsplit = explode( '=', $attribute, 2 );
5934
- if( 1 < count( $attrsplit ))
5935
- $propattr[$attrsplit[0]] = $attrsplit[1];
5936
- else
5937
- $propattr[] = $attribute;
5938
- }
5939
  /* call setProperty( $propname.. . */
5940
  switch( strtoupper( $propname )) {
5941
  case 'ATTENDEE':
5942
- foreach( $propattr as $pix => $attr ) {
5943
  if( !in_array( strtoupper( $pix ), array( 'MEMBER', 'DELEGATED-TO', 'DELEGATED-FROM' )))
5944
  continue;
5945
  $attr2 = explode( ',', $attr );
5946
  if( 1 < count( $attr2 ))
5947
- $propattr[$pix] = $attr2;
5948
  }
5949
- $this->setProperty( $propname, $line, $propattr );
5950
  break;
5951
- case 'X-':
5952
- $propname = ( isset( $propname2 )) ? $propname2 : $propname;
5953
- unset( $propname2 );
5954
  case 'CATEGORIES':
5955
  case 'RESOURCES':
5956
  if( FALSE !== strpos( $line, ',' )) {
@@ -5968,8 +5783,8 @@ class calendarComponent {
5968
  if( 1 < count( $content )) {
5969
  $content = array_values( $content );
5970
  foreach( $content as $cix => $contentPart )
5971
- $content[$cix] = calendarComponent::_strunrep( $contentPart );
5972
- $this->setProperty( $propname, $content, $propattr );
5973
  break;
5974
  }
5975
  else
@@ -5981,43 +5796,43 @@ class calendarComponent {
5981
  case 'LOCATION':
5982
  case 'SUMMARY':
5983
  if( empty( $line ))
5984
- $propattr = null;
5985
- $this->setProperty( $propname, calendarComponent::_strunrep( $line ), $propattr );
5986
  break;
5987
  case 'REQUEST-STATUS':
5988
  $values = explode( ';', $line, 3 );
5989
- $values[1] = ( !isset( $values[1] )) ? null : calendarComponent::_strunrep( $values[1] );
5990
- $values[2] = ( !isset( $values[2] )) ? null : calendarComponent::_strunrep( $values[2] );
5991
  $this->setProperty( $propname
5992
  , $values[0] // statcode
5993
  , $values[1] // statdesc
5994
  , $values[2] // extdata
5995
- , $propattr );
5996
  break;
5997
  case 'FREEBUSY':
5998
- $fbtype = ( isset( $propattr['FBTYPE'] )) ? $propattr['FBTYPE'] : ''; // force setting default, if missing
5999
- unset( $propattr['FBTYPE'] );
6000
  $values = explode( ',', $line );
6001
  foreach( $values as $vix => $value ) {
6002
  $value2 = explode( '/', $value );
6003
  if( 1 < count( $value2 ))
6004
  $values[$vix] = $value2;
6005
  }
6006
- $this->setProperty( $propname, $fbtype, $values, $propattr );
6007
  break;
6008
  case 'GEO':
6009
  $value = explode( ';', $line, 2 );
6010
  if( 2 > count( $value ))
6011
  $value[1] = null;
6012
- $this->setProperty( $propname, $value[0], $value[1], $propattr );
6013
  break;
6014
  case 'EXDATE':
6015
  $values = ( !empty( $line )) ? explode( ',', $line ) : null;
6016
- $this->setProperty( $propname, $values, $propattr );
6017
  break;
6018
  case 'RDATE':
6019
  if( empty( $line )) {
6020
- $this->setProperty( $propname, $line, $propattr );
6021
  break;
6022
  }
6023
  $values = explode( ',', $line );
@@ -6026,7 +5841,7 @@ class calendarComponent {
6026
  if( 1 < count( $value2 ))
6027
  $values[$vix] = $value2;
6028
  }
6029
- $this->setProperty( $propname, $values, $propattr );
6030
  break;
6031
  case 'EXRULE':
6032
  case 'RRULE':
@@ -6085,8 +5900,11 @@ class calendarComponent {
6085
  }
6086
  } // end - switch $rulelabel
6087
  } // end - foreach( $values.. .
6088
- $this->setProperty( $propname, $recur, $propattr );
6089
  break;
 
 
 
6090
  case 'ACTION':
6091
  case 'CLASSIFICATION':
6092
  case 'STATUS':
@@ -6095,9 +5913,9 @@ class calendarComponent {
6095
  case 'TZID':
6096
  case 'RELATED-TO':
6097
  case 'TZNAME':
6098
- $line = calendarComponent::_strunrep( $line );
6099
  default:
6100
- $this->setProperty( $propname, $line, $propattr );
6101
  break;
6102
  } // end switch( $propname.. .
6103
  } // end - foreach( $proprows.. .
@@ -6362,158 +6180,6 @@ class calendarComponent {
6362
  }
6363
  return $output;
6364
  }
6365
- /********************************************************************************/
6366
- /**
6367
- * break lines at pos 75
6368
- *
6369
- * Lines of text SHOULD NOT be longer than 75 octets, excluding the line
6370
- * break. Long content lines SHOULD be split into a multiple line
6371
- * representations using a line "folding" technique. That is, a long
6372
- * line can be split between any two characters by inserting a CRLF
6373
- * immediately followed by a single linear white space character (i.e.,
6374
- * SPACE, US-ASCII decimal 32 or HTAB, US-ASCII decimal 9). Any sequence
6375
- * of CRLF followed immediately by a single linear white space character
6376
- * is ignored (i.e., removed) when processing the content type.
6377
- *
6378
- * Edited 2007-08-26 by Anders Litzell, anders@litzell.se to fix bug where
6379
- * the reserved expression "\n" in the arg $string could be broken up by the
6380
- * folding of lines, causing ambiguity in the return string.
6381
- *
6382
- * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
6383
- * @since 2.12.17 - 2012-07-15
6384
- * @param string $value
6385
- * @return string
6386
- */
6387
- function _size75( $string ) {
6388
- $tmp = $string;
6389
- $string = '';
6390
- $cCnt = $x = 0;
6391
- while( TRUE ) {
6392
- if( !isset( $tmp[$x] )) {
6393
- $string .= $this->nl; // loop breakes here
6394
- break;
6395
- }
6396
- elseif(( 74 <= $cCnt ) && ( '\\' == $tmp[$x] ) && ( 'n' == $tmp[$x+1] )) {
6397
- $string .= $this->nl.' \n'; // don't break lines inside '\n'
6398
- $x += 2;
6399
- if( !isset( $tmp[$x] )) {
6400
- $string .= $this->nl;
6401
- break;
6402
- }
6403
- $cCnt = 3;
6404
- }
6405
- elseif( 75 <= $cCnt ) {
6406
- $string .= $this->nl.' ';
6407
- $cCnt = 1;
6408
- }
6409
- $byte = ord( $tmp[$x] );
6410
- $string .= $tmp[$x];
6411
- switch( TRUE ) { // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
6412
- case(( $byte >= 0x20 ) && ( $byte <= 0x7F )): // characters U-00000000 - U-0000007F (same as ASCII)
6413
- $cCnt += 1;
6414
- break; // add a one byte character
6415
- case(( $byte & 0xE0) == 0xC0 ): // characters U-00000080 - U-000007FF, mask 110XXXXX
6416
- if( isset( $tmp[$x+1] )) {
6417
- $cCnt += 1;
6418
- $string .= $tmp[$x+1];
6419
- $x += 1; // add a two bytes character
6420
- }
6421
- break;
6422
- case(( $byte & 0xF0 ) == 0xE0 ): // characters U-00000800 - U-0000FFFF, mask 1110XXXX
6423
- if( isset( $tmp[$x+2] )) {
6424
- $cCnt += 1;
6425
- $string .= $tmp[$x+1].$tmp[$x+2];
6426
- $x += 2; // add a three bytes character
6427
- }
6428
- break;
6429
- case(( $byte & 0xF8 ) == 0xF0 ): // characters U-00010000 - U-001FFFFF, mask 11110XXX
6430
- if( isset( $tmp[$x+3] )) {
6431
- $cCnt += 1;
6432
- $string .= $tmp[$x+1].$tmp[$x+2].$tmp[$x+3];
6433
- $x += 3; // add a four bytes character
6434
- }
6435
- break;
6436
- case(( $byte & 0xFC ) == 0xF8 ): // characters U-00200000 - U-03FFFFFF, mask 111110XX
6437
- if( isset( $tmp[$x+4] )) {
6438
- $cCnt += 1;
6439
- $string .= $tmp[$x+1].$tmp[$x+2].$tmp[$x+3].$tmp[$x+4];
6440
- $x += 4; // add a five bytes character
6441
- }
6442
- break;
6443
- case(( $byte & 0xFE ) == 0xFC ): // characters U-04000000 - U-7FFFFFFF, mask 1111110X
6444
- if( isset( $tmp[$x+5] )) {
6445
- $cCnt += 1;
6446
- $string .= $tmp[$x+1].$tmp[$x+2].$tmp[$x+3].$tmp[$x+4].$tmp[$x+5];
6447
- $x += 5; // add a six bytes character
6448
- }
6449
- default: // add any other byte without counting up $cCnt
6450
- break;
6451
- } // end switch( TRUE )
6452
- $x += 1; // next 'byte' to test
6453
- } // end while( TRUE ) {
6454
- return $string;
6455
- }
6456
- /**
6457
- * special characters management output
6458
- *
6459
- * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
6460
- * @since 2.12.16 - 2012-07-16
6461
- * @param string $string
6462
- * @return string
6463
- */
6464
- function _strrep( $string ) {
6465
- switch( $this->format ) {
6466
- case 'xcal':
6467
- $string = str_replace( '\n', $this->nl, $string);
6468
- $string = htmlspecialchars( strip_tags( stripslashes( urldecode ( $string ))));
6469
- break;
6470
- default:
6471
- $pos = 0;
6472
- $specChars = array( 'n', 'N', 'r', ',', ';' );
6473
- while( isset( $string[$pos] )) {
6474
- if( FALSE === ( $pos = strpos( $string, "\\", $pos )))
6475
- break;
6476
- if( !in_array( substr( $string, $pos, 1 ), $specChars )) {
6477
- $string = substr( $string, 0, $pos )."\\".substr( $string, ( $pos + 1 ));
6478
- $pos += 1;
6479
- }
6480
- $pos += 1;
6481
- }
6482
- if( FALSE !== strpos( $string, '"' ))
6483
- $string = str_replace('"', "'", $string);
6484
- if( FALSE !== strpos( $string, ',' ))
6485
- $string = str_replace(',', '\,', $string);
6486
- if( FALSE !== strpos( $string, ';' ))
6487
- $string = str_replace(';', '\;', $string);
6488
- if( FALSE !== strpos( $string, "\r\n" ))
6489
- $string = str_replace( "\r\n", '\n', $string);
6490
- elseif( FALSE !== strpos( $string, "\r" ))
6491
- $string = str_replace( "\r", '\n', $string);
6492
- elseif( FALSE !== strpos( $string, "\n" ))
6493
- $string = str_replace( "\n", '\n', $string);
6494
- if( FALSE !== strpos( $string, '\N' ))
6495
- $string = str_replace( '\N', '\n', $string);
6496
- // if( FALSE !== strpos( $string, $this->nl ))
6497
- $string = str_replace( $this->nl, '\n', $string);
6498
- break;
6499
- }
6500
- return $string;
6501
- }
6502
- /**
6503
- * special characters management input (from iCal file)
6504
- *
6505
- * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
6506
- * @since 2.6.22 - 2010-10-17
6507
- * @param string $string
6508
- * @return string
6509
- */
6510
- static function _strunrep( $string ) {
6511
- $string = str_replace( '\\\\', '\\', $string);
6512
- $string = str_replace( '\,', ',', $string);
6513
- $string = str_replace( '\;', ';', $string);
6514
- // $string = str_replace( '\n', $this->nl, $string); // ??
6515
- return $string;
6516
- }
6517
  }
6518
  /*********************************************************************************/
6519
  /*********************************************************************************/
@@ -7197,8 +6863,7 @@ class vtimezone extends calendarComponent {
7197
  * 20111223 - move iCalUtilityFunctions class to the end of the iCalcreator class file
7198
  *
7199
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
7200
- * @since 2.10.1 - 2011-07-16
7201
- *
7202
  */
7203
  class iCalUtilityFunctions {
7204
  // Store the single instance of iCalUtilityFunctions
@@ -7208,6 +6873,11 @@ class iCalUtilityFunctions {
7208
  private function __construct() {
7209
  $m_pInstance = FALSE;
7210
  }
 
 
 
 
 
7211
 
7212
  // Getter method for creating/returning the single instance of this class
7213
  public static function getInstance() {
@@ -7220,7 +6890,7 @@ class iCalUtilityFunctions {
7220
  * ensures internal date-time/date format (keyed array) for an input date-time/date array (keyed or unkeyed)
7221
  *
7222
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
7223
- * @since 2.14.1 - 2012-09-27
7224
  * @param array $datetime
7225
  * @param int $parno optional, default FALSE
7226
  * @return array
@@ -7230,6 +6900,11 @@ class iCalUtilityFunctions {
7230
  }
7231
  public static function _chkDateArr( $datetime, $parno=FALSE ) {
7232
  $output = array();
 
 
 
 
 
7233
  foreach( $datetime as $dateKey => $datePart ) {
7234
  switch ( $dateKey ) {
7235
  case '0': case 'year': $output['year'] = $datePart; break;
@@ -7313,6 +6988,51 @@ class iCalUtilityFunctions {
7313
  $parno = 6;
7314
  }
7315
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7316
  /**
7317
  * byte oriented line folding fix
7318
  *
@@ -7321,32 +7041,30 @@ class iCalUtilityFunctions {
7321
  * takes care of '\r\n', '\r' and '\n' and mixed '\r\n'+'\r', '\r\n'+'\n'
7322
  *
7323
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
7324
- * @since 2.12.17 - 2012-07-12
7325
  * @param string $text
7326
  * @param string $nl
7327
  * @return string
7328
  */
7329
  public static function convEolChar( & $text, $nl ) {
7330
- $outp = '';
7331
- $cix = 0;
7332
- while( isset( $text[$cix] )) {
7333
- if( isset( $text[$cix + 2] ) && ( "\r" == $text[$cix] ) && ( "\n" == $text[$cix + 1] ) &&
7334
- (( " " == $text[$cix + 2] ) || ( "\t" == $text[$cix + 2] ))) // 2 pos eolchar + ' ' or '\t'
7335
- $cix += 2; // skip 3
7336
- elseif( isset( $text[$cix + 1] ) && ( "\r" == $text[$cix] ) && ( "\n" == $text[$cix + 1] )) {
7337
- $outp .= $nl; // 2 pos eolchar
7338
- $cix += 1; // replace with $nl
7339
- }
7340
- elseif( isset( $text[$cix + 1] ) && (( "\r" == $text[$cix] ) || ( "\n" == $text[$cix] )) &&
7341
- (( " " == $text[$cix + 1] ) || ( "\t" == $text[$cix + 1] ))) // 1 pos eolchar + ' ' or '\t'
7342
- $cix += 1; // skip 2
7343
- elseif(( "\r" == $text[$cix] ) || ( "\n" == $text[$cix] )) // 1 pos eolchar
7344
- $outp .= $nl; // replace with $nl
7345
- else
7346
- $outp .= $text[$cix]; // add any other byte
7347
- $cix += 1;
7348
- }
7349
- return $outp;
7350
  }
7351
  /**
7352
  * create a calendar timezone and standard/daylight components
@@ -7370,7 +7088,7 @@ class iCalUtilityFunctions {
7370
  * END:VTIMEZONE
7371
  *
7372
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
7373
- * @since 2.16.1 - 2012-11-26
7374
  * Generates components for all transitions in a date range, based on contribution by Yitzchok Lavi <icalcreator@onebigsystem.com>
7375
  * Additional changes jpirkey
7376
  * @param object $calendar, reference to an iCalcreator calendar instance
@@ -7403,7 +7121,7 @@ class iCalUtilityFunctions {
7403
  else {
7404
  $from = reset( $dates ); // set lowest date to the lowest dtstart date
7405
  $dateFrom = new DateTime( $from.'T000000', $dtz );
7406
- $dateFrom->modify( '-1 month' ); // set $dateFrom to one month before the lowest date
7407
  $dateFrom->setTimezone( $utcTz ); // convert local date to UTC
7408
  }
7409
  $dateFromYmd = $dateFrom->format('Y-m-d' );
@@ -7412,7 +7130,7 @@ class iCalUtilityFunctions {
7412
  else {
7413
  $to = end( $dates ); // set highest date to the highest dtstart date
7414
  $dateTo = new DateTime( $to.'T235959', $dtz );
7415
- $dateTo->modify( '+1 year' ); // set $dateTo to one year after the highest date
7416
  $dateTo->setTimezone( $utcTz ); // convert local date to UTC
7417
  }
7418
  $dateToYmd = $dateTo->format('Y-m-d' );
@@ -7487,7 +7205,7 @@ class iCalUtilityFunctions {
7487
  }
7488
  }
7489
  unset( $transitions, $date, $prevTrans );
7490
- foreach( $transTemp as $tix => $trans ) {
7491
  $type = ( TRUE !== $trans['isdst'] ) ? 'standard' : 'daylight';
7492
  $scomp = & $tz->newComponent( $type );
7493
  $scomp->setProperty( 'dtstart', $trans['time'] );
@@ -7541,7 +7259,7 @@ class iCalUtilityFunctions {
7541
  $offset = iCalUtilityFunctions::_tz2offset( $datetime['tz'] );
7542
  try {
7543
  $d = new DateTime( $output, new DateTimeZone( 'UTC' ));
7544
- if( 0 != $offset ) // adjust för offset
7545
  $d->modify( "$offset seconds" );
7546
  $output = $d->format( 'Ymd\THis' );
7547
  }
@@ -7597,7 +7315,7 @@ class iCalUtilityFunctions {
7597
  * ensures internal duration format for input in array format
7598
  *
7599
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
7600
- * @since 2.14.1 - 2012-09-25
7601
  * @param array $duration
7602
  * @return array
7603
  */
@@ -7605,47 +7323,42 @@ class iCalUtilityFunctions {
7605
  return iCalUtilityFunctions::_duration2arr( $duration );
7606
  }
7607
  public static function _duration2arr( $duration ) {
7608
- $output = array();
7609
- if( is_array( $duration ) &&
7610
- ( 1 == count( $duration )) &&
7611
- isset( $duration['sec'] ) &&
7612
- ( 60 < $duration['sec'] )) {
7613
- $durseconds = $duration['sec'];
7614
- $output['week'] = (int) floor( $durseconds / ( 60 * 60 * 24 * 7 ));
7615
- $durseconds = $durseconds % ( 60 * 60 * 24 * 7 );
7616
- $output['day'] = (int) floor( $durseconds / ( 60 * 60 * 24 ));
7617
- $durseconds = $durseconds % ( 60 * 60 * 24 );
7618
- $output['hour'] = (int) floor( $durseconds / ( 60 * 60 ));
7619
- $durseconds = $durseconds % ( 60 * 60 );
7620
- $output['min'] = (int) floor( $durseconds / ( 60 ));
7621
- $output['sec'] = ( $durseconds % ( 60 ));
7622
- }
7623
- else {
7624
- foreach( $duration as $durKey => $durValue ) {
7625
- if( empty( $durValue )) continue;
7626
- switch ( $durKey ) {
7627
- case '0': case 'week': $output['week'] = $durValue; break;
7628
- case '1': case 'day': $output['day'] = $durValue; break;
7629
- case '2': case 'hour': $output['hour'] = $durValue; break;
7630
- case '3': case 'min': $output['min'] = $durValue; break;
7631
- case '4': case 'sec': $output['sec'] = $durValue; break;
7632
- }
7633
  }
7634
  }
7635
- if( isset( $output['week'] ) && ( 0 < $output['week'] )) {
7636
- unset( $output['day'], $output['hour'], $output['min'], $output['sec'] );
 
7637
  return $output;
7638
- }
7639
  unset( $output['week'] );
 
 
 
 
 
 
7640
  if( empty( $output['day'] ))
7641
  unset( $output['day'] );
7642
- if ( isset( $output['hour'] ) || isset( $output['min'] ) || isset( $output['sec'] )) {
7643
- if( !isset( $output['hour'] )) $output['hour'] = 0;
7644
- if( !isset( $output['min'] )) $output['min'] = 0;
7645
- if( !isset( $output['sec'] )) $output['sec'] = 0;
7646
- if(( 0 == $output['hour'] ) && ( 0 == $output['min'] ) && ( 0 == $output['sec'] ))
7647
- unset( $output['hour'], $output['min'], $output['sec'] );
7648
- }
7649
  return $output;
7650
  }
7651
  /**
@@ -7797,18 +7510,31 @@ class iCalUtilityFunctions {
7797
  }
7798
  return $elseVal;
7799
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7800
  /**
7801
  * checks if input contains a (array formatted) date/time
7802
  *
7803
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
7804
- * @since 2.11.8 - 2012-01-20
7805
  * @param array $input
7806
  * @return bool
7807
  */
7808
  public static function _isArrayDate( $input ) {
7809
- if( !is_array( $input ))
7810
- return FALSE;
7811
- if( isset( $input['week'] ) || ( !in_array( count( $input ), array( 3, 6, 7 ))))
7812
  return FALSE;
7813
  if( 7 == count( $input ))
7814
  return TRUE;
@@ -7816,12 +7542,12 @@ class iCalUtilityFunctions {
7816
  return checkdate( (int) $input['month'], (int) $input['day'], (int) $input['year'] );
7817
  if( isset( $input['day'] ) || isset( $input['hour'] ) || isset( $input['min'] ) || isset( $input['sec'] ))
7818
  return FALSE;
7819
- if( in_array( 0, $input ))
7820
  return FALSE;
7821
  if(( 1970 > $input[0] ) || ( 12 < $input[1] ) || ( 31 < $input[2] ))
7822
  return FALSE;
7823
  if(( isset( $input[0] ) && isset( $input[1] ) && isset( $input[2] )) &&
7824
- checkdate( (int) $input[1], (int) $input[2], (int) $input[0] ))
7825
  return TRUE;
7826
  $input = iCalUtilityFunctions::_strdate2date( $input[1].'/'.$input[2].'/'.$input[0], 3 ); // m - d - Y
7827
  if( isset( $input['year'] ) && isset( $input['month'] ) && isset( $input['day'] ))
@@ -7972,24 +7698,6 @@ class iCalUtilityFunctions {
7972
  *
7973
  * if missing, UNTIL is set 1 year from startdate (emergency break)
7974
  *
7975
- * Some additional data from the author
7976
- * The $result array is an array([timestamp] => TRUE).
7977
- *
7978
- * The $startdate and $enddate arguments describes the period start and end
7979
- * dates where recurrences may appear.
7980
- *
7981
- * The $wdate arg. is the component start date (DTSTART), lower than end date.
7982
- *
7983
- * The format of the input $wdate, $startdate and $enddate args. are the
7984
- * iCalcreator internal date format (array( 'year' =>.., 'month' =>.. 'day'
7985
- * => .., 'hour' => .., 'min'=> .., 'sec' => .. )).
7986
- * The function do not do any timezone convertions, I don't think it matters
7987
- * here, only managing YMD dates.
7988
- *
7989
- * You can find a brief overview of the $recur array at
7990
- * kigkonsult.se/iCalcreator/docs/using.html#EXRULE,
7991
- * also output of calendarComponent::getProperty( "RRULE" ).
7992
- *
7993
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
7994
  * @since 2.10.19 - 2011-10-31
7995
  * @param array $result, array to update, array([timestamp] => timestamp)
@@ -8009,7 +7717,7 @@ class iCalUtilityFunctions {
8009
  $enddate = $startdate;
8010
  $enddate['year'] += 1;
8011
  }
8012
- // echo "recur __in_ comp start ".implode('-',$wdate)." period start ".implode('-',$startdate)." period end ".implode('-',$enddate)."<br />\n";print_r($recur);echo "<br />\n";//test###
8013
  $endDatets = iCalUtilityFunctions::_date2timestamp( $enddate ); // fix break
8014
  if( !isset( $recur['COUNT'] ) && !isset( $recur['UNTIL'] ))
8015
  $recur['UNTIL'] = $enddate; // create break
@@ -8023,7 +7731,7 @@ class iCalUtilityFunctions {
8023
  $recur['UNTIL'] = iCalUtilityFunctions::_timestamp2date( $endDatets, 6 );
8024
  }
8025
  if( $wdatets > $endDatets ) {
8026
- // echo "recur out of date ".date('Y-m-d H:i:s',$wdatets)."<br />\n";//test
8027
  return array(); // nothing to do.. .
8028
  }
8029
  if( !isset( $recur['FREQ'] )) // "MUST be specified.. ."
@@ -8056,7 +7764,7 @@ class iCalUtilityFunctions {
8056
  }
8057
  if( isset( $recur['BYSETPOS'] )) { // save start date + weekno
8058
  $bysetposymd1 = $bysetposymd2 = $bysetposw1 = $bysetposw2 = array();
8059
- // echo "bysetposXold_start=$bysetposYold $bysetposMold $bysetposDold<br />\n"; // test ###
8060
  if( is_array( $recur['BYSETPOS'] )) {
8061
  foreach( $recur['BYSETPOS'] as $bix => $bval )
8062
  $recur['BYSETPOS'][$bix] = (int) $bval;
@@ -8075,7 +7783,7 @@ class iCalUtilityFunctions {
8075
  }
8076
  else
8077
  iCalUtilityFunctions::_stepdate( $enddate, $endDatets, $step); // make sure to count whole last period
8078
- // echo "BYSETPOS endDat++ =".implode('-',$enddate).' step='.var_export($step,TRUE)."<br />\n";//test###
8079
  $bysetposWold = (int) date( 'W', ( $wdatets + $wkst ));
8080
  $bysetposYold = $wdate['year'];
8081
  $bysetposMold = $wdate['month'];
@@ -8086,7 +7794,7 @@ class iCalUtilityFunctions {
8086
  $year_old = null;
8087
  $daynames = array( 'SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA' );
8088
  /* MAIN LOOP */
8089
- // echo "recur start ".implode('-',$wdate)." end ".implode('-',$enddate)."<br />\n";//test
8090
  while( TRUE ) {
8091
  if( isset( $endDatets ) && ( $wdatets > $endDatets ))
8092
  break;
@@ -8176,13 +7884,13 @@ class iCalUtilityFunctions {
8176
  if(( $recur['INTERVAL'] != $intervalarr[$intervalix] ) &&
8177
  ( 0 != $intervalarr[$intervalix] )) {
8178
  /* step up date */
8179
- // echo "skip: ".implode('-',$wdate)." ix=$intervalix old=$currentKey interval=".$intervalarr[$intervalix]."<br />\n";//test
8180
  iCalUtilityFunctions::_stepdate( $wdate, $wdatets, $step);
8181
  continue;
8182
  }
8183
  else // continue within the selected interval
8184
  $intervalarr[$intervalix] = 0;
8185
- // echo "cont: ".implode('-',$wdate)." ix=$intervalix old=$currentKey interval=".$intervalarr[$intervalix]."<br />\n";//test
8186
  }
8187
  $updateOK = TRUE;
8188
  if( $updateOK && isset( $recur['BYMONTH'] ))
@@ -8201,7 +7909,7 @@ class iCalUtilityFunctions {
8201
  $updateOK = iCalUtilityFunctions::_recurBYcntcheck( $recur['BYMONTHDAY']
8202
  , $wdate['day']
8203
  , $daycnts[$wdate['month']][$wdate['day']]['monthcnt_down'] );
8204
- // echo "efter BYMONTHDAY: ".implode('-',$wdate).' status: '; echo ($updateOK) ? 'TRUE' : 'FALSE'; echo "<br />\n";//test###
8205
  if( $updateOK && isset( $recur['BYDAY'] )) {
8206
  $updateOK = FALSE;
8207
  $m = $wdate['month'];
@@ -8224,9 +7932,9 @@ class iCalUtilityFunctions {
8224
  if(( $daynoexists && $daynosw && $daynamesw ) ||
8225
  ( !$daynoexists && !$daynosw && $daynamesw )) {
8226
  $updateOK = TRUE;
8227
- // echo "m=$m d=$d day=".$daycnts[$m][$d]['DAY']." yeardayno_up=".$daycnts[$m][$d]['yeardayno_up']." daynoexists:$daynoexists daynosw:$daynosw daynamesw:$daynamesw updateOK:$updateOK<br />\n"; // test ###
8228
  }
8229
- //echo "m=$m d=$d day=".$daycnts[$m][$d]['DAY']." yeardayno_up=".$daycnts[$m][$d]['yeardayno_up']." daynoexists:$daynoexists daynosw:$daynosw daynamesw:$daynamesw updateOK:$updateOK<br />\n"; // test ###
8230
  }
8231
  else {
8232
  foreach( $recur['BYDAY'] as $bydayvalue ) {
@@ -8246,7 +7954,7 @@ class iCalUtilityFunctions {
8246
  , $daycnts[$m][$d]['yeardayno_up']
8247
  , $daycnts[$m][$d]['yeardayno_down'] );
8248
  }
8249
- // echo "daynoexists:$daynoexists daynosw:$daynosw daynamesw:$daynamesw<br />\n"; // test ###
8250
  if(( $daynoexists && $daynosw && $daynamesw ) ||
8251
  ( !$daynoexists && !$daynosw && $daynamesw )) {
8252
  $updateOK = TRUE;
@@ -8255,7 +7963,7 @@ class iCalUtilityFunctions {
8255
  }
8256
  }
8257
  }
8258
- // echo "efter BYDAY: ".implode('-',$wdate).' status: '; echo ($updateOK) ? 'TRUE' : 'FALSE'; echo "<br />\n"; // test ###
8259
  /* check BYSETPOS */
8260
  if( $updateOK ) {
8261
  if( isset( $recur['BYSETPOS'] ) &&
@@ -8276,11 +7984,11 @@ class iCalUtilityFunctions {
8276
  (( $bysetposYold == $wdate['year'] ) &&
8277
  ( $bysetposMold == $wdate['month']) &&
8278
  ( $bysetposDold == $wdate['day'] )))) {
8279
- // echo "bysetposymd1[]=".date('Y-m-d H:i:s',$wdatets)."<br />\n";//test
8280
  $bysetposymd1[] = $wdatets;
8281
  }
8282
  else {
8283
- // echo "bysetposymd2[]=".date('Y-m-d H:i:s',$wdatets)."<br />\n";//test
8284
  $bysetposymd2[] = $wdatets;
8285
  }
8286
  }
@@ -8290,9 +7998,9 @@ class iCalUtilityFunctions {
8290
  $countcnt++;
8291
  if( $startdatets <= $wdatets ) { // only output within period
8292
  $result[$wdatets] = TRUE;
8293
- // echo "recur ".date('Y-m-d H:i:s',$wdatets)."<br />\n";//test
8294
  }
8295
- // echo "recur undate ".date('Y-m-d H:i:s',$wdatets)." okdatstart ".date('Y-m-d H:i:s',$startdatets)."<br />\n";//test
8296
  $updateOK = FALSE;
8297
  }
8298
  }
@@ -8337,7 +8045,7 @@ class iCalUtilityFunctions {
8337
  $bysetposarr1 = & $bysetposymd1;
8338
  $bysetposarr2 = & $bysetposymd2;
8339
  }
8340
- // echo 'test före out startYMD (weekno)='.$wdateStart['year'].':'.$wdateStart['month'].':'.$wdateStart['day']." ($weekStart) "; // test ###
8341
  foreach( $recur['BYSETPOS'] as $ix ) {
8342
  if( 0 > $ix ) // both positive and negative BYSETPOS allowed
8343
  $ix = ( count( $bysetposarr1 ) + $ix + 1);
@@ -8355,7 +8063,7 @@ class iCalUtilityFunctions {
8355
  if( isset( $recur['COUNT'] ) && ( $countcnt >= $recur['COUNT'] ))
8356
  break;
8357
  }
8358
- // echo "<br />\n"; // test ###
8359
  $bysetposarr1 = $bysetposarr2;
8360
  $bysetposarr2 = array();
8361
  }
@@ -8391,11 +8099,84 @@ class iCalUtilityFunctions {
8391
  }
8392
  return $intervalix;
8393
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8394
  /**
8395
  * convert input format for exrule and rrule to internal format
8396
  *
8397
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
8398
- * @since 2.14.1 - 2012-09-24
8399
  * @param array $rexrule
8400
  * @return array
8401
  */
@@ -8403,8 +8184,8 @@ class iCalUtilityFunctions {
8403
  $input = array();
8404
  if( empty( $rexrule ))
8405
  return $input;
 
8406
  foreach( $rexrule as $rexrulelabel => $rexrulevalue ) {
8407
- $rexrulelabel = strtoupper( $rexrulelabel );
8408
  if( 'UNTIL' != $rexrulelabel )
8409
  $input[$rexrulelabel] = $rexrulevalue;
8410
  else {
@@ -8485,7 +8266,7 @@ class iCalUtilityFunctions {
8485
  * convert format for input date to internal date with parameters
8486
  *
8487
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
8488
- * @since 2.14.1 - 2012-10-15
8489
  * @param mixed $year
8490
  * @param mixed $month optional
8491
  * @param int $day optional
@@ -8504,7 +8285,7 @@ class iCalUtilityFunctions {
8504
  $localtime = (( 'dtstart' == $caller ) && in_array( $objName, array( 'vtimezone', 'standard', 'daylight' ))) ? TRUE : FALSE;
8505
  iCalUtilityFunctions::_strDate2arr( $year );
8506
  if( iCalUtilityFunctions::_isArrayDate( $year )) {
8507
- $input['value'] = iCalUtilityFunctions::_chkDateArr( $year, $parno );
8508
  if( 100 > $input['value']['year'] )
8509
  $input['value']['year'] += 2000;
8510
  if( $localtime )
@@ -8513,7 +8294,7 @@ class iCalUtilityFunctions {
8513
  $month['TZID'] = $tzid;
8514
  if( isset( $input['value']['tz'] ) && iCalUtilityFunctions::_isOffset( $input['value']['tz'] ))
8515
  unset( $month['TZID'] );
8516
- elseif( isset( $month['TZID'] ) && iCalUtilityFunctions::_isOffset( $month['TZID'] )) {
8517
  $input['value']['tz'] = $month['TZID'];
8518
  unset( $month['TZID'] );
8519
  }
@@ -8521,7 +8302,9 @@ class iCalUtilityFunctions {
8521
  $hitval = ( isset( $input['value']['tz'] )) ? 7 : 6;
8522
  $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME', $hitval );
8523
  $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE', 3, count( $input['value'] ), $parno );
8524
- if(( 3 != $parno ) && isset( $input['value']['tz'] ) && ( 'Z' != $input['value']['tz'] ) && iCalUtilityFunctions::_isOffset( $input['value']['tz'] )) {
 
 
8525
  $d = $input['value'];
8526
  $strdate = sprintf( '%04d-%02d-%02d %02d:%02d:%02d %s', $d['year'], $d['month'], $d['day'], $d['hour'], $d['min'], $d['sec'], $d['tz'] );
8527
  $input['value'] = iCalUtilityFunctions::_strdate2date( $strdate, $parno );
@@ -8538,20 +8321,37 @@ class iCalUtilityFunctions {
8538
  $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE', 3 );
8539
  $hitval = 7;
8540
  $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME', $hitval, $parno );
8541
- if( !isset( $input['params']['TZID'] ) && !empty( $tzid ))
8542
- $input['params']['TZID'] = $tzid;
8543
- if( isset( $year['tz'] )) {
8544
- $parno = 6;
8545
- if( !iCalUtilityFunctions::_isOffset( $year['tz'] ))
8546
  $input['params']['TZID'] = $year['tz'];
 
 
 
 
 
 
 
 
 
 
 
 
8547
  }
8548
- elseif( isset( $input['params']['TZID'] )) {
8549
- $year['tz'] = $input['params']['TZID'];
8550
- $parno = 6;
8551
  if( iCalUtilityFunctions::_isOffset( $input['params']['TZID'] )) {
8552
- unset( $input['params']['TZID'] );
8553
- $parno = 7;
 
 
 
 
 
 
 
 
8554
  }
 
 
8555
  }
8556
  $input['value'] = iCalUtilityFunctions::_timestamp2date( $year, $parno );
8557
  } // end elseif( iCalUtilityFunctions::_isArrayTimestampDate( $year ))
@@ -8564,6 +8364,8 @@ class iCalUtilityFunctions {
8564
  $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME', 7, $parno );
8565
  $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE', 3, $parno, $parno );
8566
  $input['value'] = iCalUtilityFunctions::_strdate2date( $year, $parno );
 
 
8567
  unset( $input['value']['unparsedtext'] );
8568
  if( isset( $input['value']['tz'] )) {
8569
  if( iCalUtilityFunctions::_isOffset( $input['value']['tz'] )) {
@@ -8670,7 +8472,7 @@ class iCalUtilityFunctions {
8670
  * convert format for input date (UTC) to internal date with parameters
8671
  *
8672
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
8673
- * @since 2.14.4 - 2012-10-06
8674
  * @param mixed $year
8675
  * @param mixed $month optional
8676
  * @param int $day optional
@@ -8688,22 +8490,43 @@ class iCalUtilityFunctions {
8688
  if( isset( $input['value']['year'] ) && ( 100 > $input['value']['year'] ))
8689
  $input['value']['year'] += 2000;
8690
  $input['params'] = iCalUtilityFunctions::_setParams( $month, array( 'VALUE' => 'DATE-TIME' ));
8691
- if( isset( $input['value']['tz'] ) && ( 'Z' != $input['value']['tz'] ) && iCalUtilityFunctions::_isOffset( $input['value']['tz'] )) {
 
 
 
 
 
 
 
 
8692
  $d = $input['value'];
8693
- $strdate = sprintf( '%04d-%02d-%02d %02d:%02d:%02d %s', $d['year'], $d['month'], $d['day'], $d['hour'], $d['min'], $d['sec'], $d['tz'] );
8694
  $input['value'] = iCalUtilityFunctions::_strdate2date( $strdate, 7 );
8695
  unset( $input['value']['unparsedtext'] );
8696
  }
8697
  }
8698
  elseif( iCalUtilityFunctions::_isArrayTimestampDate( $year )) {
8699
- $year['tz'] = 'UTC';
 
 
 
 
 
8700
  $input['value'] = iCalUtilityFunctions::_timestamp2date( $year, 7 );
8701
  $input['params'] = iCalUtilityFunctions::_setParams( $month, array( 'VALUE' => 'DATE-TIME' ));
 
8702
  }
8703
  elseif( 8 <= strlen( trim( $year ))) { // ex. 2006-08-03 10:12:18
8704
  $input['value'] = iCalUtilityFunctions::_strdate2date( $year, 7 );
8705
  unset( $input['value']['unparsedtext'] );
8706
  $input['params'] = iCalUtilityFunctions::_setParams( $month, array( 'VALUE' => 'DATE-TIME' ));
 
 
 
 
 
 
 
8707
  }
8708
  else {
8709
  $input['value'] = array( 'year' => $year
@@ -8723,6 +8546,7 @@ class iCalUtilityFunctions {
8723
  unset( $input['value']['unparsedtext'] );
8724
  }
8725
  $input['params'] = iCalUtilityFunctions::_setParams( $params, array( 'VALUE' => 'DATE-TIME' ));
 
8726
  }
8727
  $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME', 7 ); // remove default
8728
  if( !isset( $input['value']['hour'] )) $input['value']['hour'] = 0;
@@ -8762,7 +8586,7 @@ class iCalUtilityFunctions {
8762
  * default parameters can be set, if missing
8763
  *
8764
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
8765
- * @since 1.x.x - 2007-05-01
8766
  * @param array $params
8767
  * @param array $defaults
8768
  * @return array
@@ -8770,7 +8594,8 @@ class iCalUtilityFunctions {
8770
  public static function _setParams( $params, $defaults=FALSE ) {
8771
  if( !is_array( $params))
8772
  $params = array();
8773
- $input = array();
 
8774
  foreach( $params as $paramKey => $paramValue ) {
8775
  if( is_array( $paramValue )) {
8776
  foreach( $paramValue as $pkey => $pValue ) {
@@ -8780,10 +8605,10 @@ class iCalUtilityFunctions {
8780
  }
8781
  elseif(( '"' == substr( $paramValue, 0, 1 )) && ( '"' == substr( $paramValue, -1 )))
8782
  $paramValue = substr( $paramValue, 1, ( strlen( $paramValue ) - 2 ));
8783
- if( 'VALUE' == strtoupper( $paramKey ))
8784
- $input['VALUE'] = strtoupper( $paramValue );
8785
  else
8786
- $input[strtoupper( $paramKey )] = $paramValue;
8787
  }
8788
  if( is_array( $defaults )) {
8789
  foreach( $defaults as $paramKey => $paramValue ) {
@@ -8793,6 +8618,283 @@ class iCalUtilityFunctions {
8793
  }
8794
  return (0 < count( $input )) ? $input : null;
8795
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8796
  /**
8797
  * step date, return updated date, array and timpstamp
8798
  *
@@ -8879,7 +8981,7 @@ class iCalUtilityFunctions {
8879
  * ensures internal date-time/date format for input date-time/date in string fromat
8880
  *
8881
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
8882
- * @since 2.14.1 - 2012-10-07
8883
  * Modified to also return original string value by Yitzchok Lavi <icalcreator@onebigsystem.com>
8884
  * @param array $datetime
8885
  * @param int $parno optional, default FALSE
@@ -8901,17 +9003,14 @@ class iCalUtilityFunctions {
8901
  $tz = 'Z';
8902
  $datetime = trim( substr( $datetime, 0, ( $len - 1 )));
8903
  $tzSts = TRUE;
8904
- $len = 88;
8905
  }
8906
  if( iCalUtilityFunctions::_isOffset( substr( $datetime, -5, 5 ))) { // [+/-]NNNN offset
8907
  $tz = substr( $datetime, -5, 5 );
8908
  $datetime = trim( substr( $datetime, 0, ($len - 5)));
8909
- $len = strlen( $datetime );
8910
  }
8911
  elseif( iCalUtilityFunctions::_isOffset( substr( $datetime, -7, 7 ))) { // [+/-]NNNNNN offset
8912
  $tz = substr( $datetime, -7, 7 );
8913
  $datetime = trim( substr( $datetime, 0, ($len - 7)));
8914
- $len = strlen( $datetime );
8915
  }
8916
  elseif( empty( $wtz ) && ctype_digit( substr( $datetime, 0, 4 )) && ctype_digit( substr( $datetime, -2, 2 )) && iCalUtilityFunctions::_strDate2arr( $datetime )) {
8917
  $output = $datetime;
@@ -8922,9 +9021,10 @@ class iCalUtilityFunctions {
8922
  }
8923
  else {
8924
  $cx = $tx = 0; // find any trailing timezone or offset
 
8925
  for( $cx = -1; $cx > ( 9 - $len ); $cx-- ) {
8926
  $char = substr( $datetime, $cx, 1 );
8927
- if(( ' ' == $char) || ctype_digit( $char ))
8928
  break; // if exists, tz ends here.. . ?
8929
  else
8930
  $tx--; // tz length counter
@@ -8932,22 +9032,16 @@ class iCalUtilityFunctions {
8932
  if( 0 > $tx ) { // if any
8933
  $tz = substr( $datetime, $tx );
8934
  $datetime = trim( substr( $datetime, 0, $len + $tx ));
8935
- $len = strlen( $datetime );
8936
  }
8937
- if(( 17 <= $len ) || // long textual datetime
8938
- ( ctype_digit( substr( $datetime, 0, 8 )) && ( 'T' == substr( $datetime, 8, 1 )) && ctype_digit( substr( $datetime, -6, 6 ))) ||
8939
- ( ctype_digit( substr( $datetime, 0, 14 )))) {
8940
- $len = 88;
8941
  $tzSts = TRUE;
8942
- }
8943
- else
8944
- $tz = null; // no tz for Y-m-d dates
8945
  }
8946
  if( empty( $tz ) && !empty( $wtz ))
8947
  $tz = $wtz;
8948
- if( 17 >= $len ) // any Y-m-d textual date
8949
  $tz = null;
8950
- if( !empty( $tz ) && ( 17 < $len )) { // tz set AND long textual datetime
8951
  if(( 'Z' != $tz ) && ( iCalUtilityFunctions::_isOffset( $tz ))) {
8952
  $offset = (string) iCalUtilityFunctions::_tz2offset( $tz ) * -1;
8953
  $tz = 'UTC';
@@ -8970,17 +9064,14 @@ class iCalUtilityFunctions {
8970
  catch( Exception $e ) {
8971
  $datestring = date( 'Y-m-d-H-i-s', strtotime( $datetime ));
8972
  }
8973
- } // end if( !empty( $tz ) && ( 17 < $len ))
8974
  else
8975
  $datestring = date( 'Y-m-d-H-i-s', strtotime( $datetime ));
8976
- // echo "<tr><td>&nbsp;<td colspan='3'>_strdate2date input=$datetime, tz=$tz, offset=$offset, wtz=$wtz, len=$len, prepDate=$datestring\n";
8977
  if( 'UTC' == $tz )
8978
  $tz = 'Z';
8979
  $d = explode( '-', $datestring );
8980
  $output = array( 'year' => $d[0], 'month' => $d[1], 'day' => $d[2] );
8981
- if((( FALSE !== $parno ) && ( 3 != $parno )) || // parno is set to 6 or 7
8982
- (( FALSE === $parno ) && ( 'Z' == $tz )) || // parno is not set and UTC
8983
- (( FALSE === $parno ) && ( 'Z' != $tz ) && ( 0 != $d[3] + $d[4] + $d[5] ) && ( 17 < $len ))) { // !parno and !UTC and 0 != hour+min+sec and long input text
8984
  $output['hour'] = $d[3];
8985
  $output['min'] = $d[4];
8986
  $output['sec'] = $d[5];
@@ -8991,6 +9082,70 @@ class iCalUtilityFunctions {
8991
  $output['unparsedtext'] = $unparseddatetime;
8992
  return $output;
8993
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8994
  /**
8995
  * convert timestamp to date array, default UTC or adjusted for offset/timezone
8996
  *
@@ -9007,15 +9162,16 @@ class iCalUtilityFunctions {
9007
  $timestamp = $timestamp['timestamp'];
9008
  }
9009
  $tz = ( isset( $tz )) ? $tz : $wtz;
 
9010
  if( empty( $tz ) || ( 'Z' == $tz ) || ( 'GMT' == strtoupper( $tz )))
9011
  $tz = 'UTC';
9012
  elseif( iCalUtilityFunctions::_isOffset( $tz )) {
9013
  $offset = iCalUtilityFunctions::_tz2offset( $tz );
9014
- $tz = 'UTC';
9015
  }
9016
  try {
9017
  $d = new DateTime( "@$timestamp" ); // set UTC date
9018
- if( isset( $offset ) && ( 0 != $offset )) // adjust for offset
9019
  $d->modify( $offset.' seconds' );
9020
  elseif( 'UTC' != $tz )
9021
  $d->setTimezone( new DateTimeZone( $tz )); // convert to local date
@@ -9031,7 +9187,7 @@ class iCalUtilityFunctions {
9031
  $output['hour'] = $date[3];
9032
  $output['min'] = $date[4];
9033
  $output['sec'] = $date[5];
9034
- if( 'UTC' == $tz && ( !isset( $offset ) || ( 0 == $offset )))
9035
  $output['tz'] = 'Z';
9036
  }
9037
  return $output;
@@ -9092,7 +9248,7 @@ class iCalUtilityFunctions {
9092
  return TRUE;
9093
  }
9094
  /**
9095
- * convert offset, [+/-]HHmm[ss], to seconds used when correcting UTC to localtime or v.v.
9096
  *
9097
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
9098
  * @since 2.11.4 - 2012-01-11
@@ -9259,20 +9415,21 @@ function iCal2vCards( & $calendar, $version='2.1', $directory=FALSE, $ext='vcf'
9259
  * format iCal XML output, rfc6321, using PHP SimpleXMLElement
9260
  *
9261
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
9262
- * @since 2.15.6 - 2012-10-19
9263
  * @param object $calendar, iCalcreator vcalendar instance reference
9264
  * @return string
9265
  */
9266
  function iCal2XML( & $calendar ) {
9267
  /** fix an SimpleXMLElement instance and create root element */
9268
- $xmlstr = '<?xml version="1.0" encoding="utf-8"?><icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">';
9269
- $xmlstr .= '<!-- created utilizing kigkonsult.se '.ICALCREATOR_VERSION.' iCal2XMl (rfc6321) -->';
9270
- $xmlstr .= '</icalendar>';
9271
- $xml = new SimpleXMLElement( $xmlstr );
9272
- $vcalendar = $xml->addChild( 'vcalendar' );
 
9273
  /** fix calendar properties */
9274
- $properties = $vcalendar->addChild( 'properties' );
9275
- $calProps = array( 'prodid', 'version', 'calscale', 'method' );
9276
  foreach( $calProps as $calProp ) {
9277
  if( FALSE !== ( $content = $calendar->getProperty( $calProp )))
9278
  _addXMLchild( $properties, $calProp, 'text', $content );
@@ -9281,39 +9438,184 @@ function iCal2XML( & $calendar ) {
9281
  _addXMLchild( $properties, $content[0], 'unknown', $content[1]['value'], $content[1]['params'] );
9282
  $langCal = $calendar->getConfig( 'language' );
9283
  /** prepare to fix components with properties */
9284
- $components = $vcalendar->addChild( 'components' );
9285
- $comps = array( 'vtimezone', 'vevent', 'vtodo', 'vjournal', 'vfreebusy' );
9286
- foreach( $comps as $compName ) {
9287
- switch( $compName ) {
9288
- case 'vevent':
9289
- case 'vtodo':
9290
- $subComps = array( 'valarm' );
9291
- break;
9292
- case 'vjournal':
9293
- case 'vfreebusy':
9294
- $subComps = array();
9295
- break;
9296
- case 'vtimezone':
9297
- $subComps = array( 'standard', 'daylight' );
9298
- break;
9299
- } // end switch( $compName )
9300
  /** fix component properties */
9301
- while( FALSE !== ( $component = $calendar->getComponent( $compName ))) {
9302
- $child = $components->addChild( $compName );
9303
- $properties = $child->addChild( 'properties' );
9304
- $langComp = $component->getConfig( 'language' );
9305
- $props = $component->getConfig( 'setPropertyNames' );
9306
- foreach( $props as $prop ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9307
  switch( strtolower( $prop )) {
9308
  case 'attach': // may occur multiple times, below
9309
- while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9310
  $type = ( isset( $content['params']['VALUE'] ) && ( 'BINARY' == $content['params']['VALUE'] )) ? 'binary' : 'uri';
9311
  unset( $content['params']['VALUE'] );
9312
  _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] );
9313
  }
9314
  break;
9315
  case 'attendee':
9316
- while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9317
  if( isset( $content['params']['CN'] ) && !isset( $content['params']['LANGUAGE'] )) {
9318
  if( $langComp )
9319
  $content['params']['LANGUAGE'] = $langComp;
@@ -9323,35 +9625,20 @@ function iCal2XML( & $calendar ) {
9323
  _addXMLchild( $properties, $prop, 'cal-address', $content['value'], $content['params'] );
9324
  }
9325
  break;
9326
- case 'exdate':
9327
- while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9328
- $type = ( isset( $content['params']['VALUE'] ) && ( 'DATE' == $content['params']['VALUE'] )) ? 'date' : 'date-time';
9329
- unset( $content['params']['VALUE'] );
9330
- _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] );
9331
- }
9332
- break;
9333
- case 'freebusy':
9334
- while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9335
- if( is_array( $content ) && isset( $content['value']['fbtype'] )) {
9336
- $content['params']['FBTYPE'] = $content['value']['fbtype'];
9337
- unset( $content['value']['fbtype'] );
9338
- }
9339
- _addXMLchild( $properties, $prop, 'period', $content['value'], $content['params'] );
9340
- }
9341
- break;
9342
- case 'request-status':
9343
- while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9344
  if( !isset( $content['params']['LANGUAGE'] )) {
9345
  if( $langComp )
9346
  $content['params']['LANGUAGE'] = $langComp;
9347
  elseif( $langCal )
9348
  $content['params']['LANGUAGE'] = $langCal;
9349
  }
9350
- _addXMLchild( $properties, $prop, 'rstatus', $content['value'], $content['params'] );
9351
  }
9352
  break;
9353
  case 'rdate':
9354
- while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9355
  $type = 'date-time';
9356
  if( isset( $content['params']['VALUE'] )) {
9357
  if( 'DATE' == $content['params']['VALUE'] )
@@ -9363,14 +9650,15 @@ function iCal2XML( & $calendar ) {
9363
  _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] );
9364
  }
9365
  break;
9366
- case 'categories':
9367
- case 'comment':
9368
- case 'contact':
 
 
9369
  case 'description':
9370
- case 'related-to':
9371
- case 'resources':
9372
- while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9373
- if(( 'related-to' != $prop ) && !isset( $content['params']['LANGUAGE'] )) {
9374
  if( $langComp )
9375
  $content['params']['LANGUAGE'] = $langComp;
9376
  elseif( $langCal )
@@ -9379,203 +9667,54 @@ function iCal2XML( & $calendar ) {
9379
  _addXMLchild( $properties, $prop, 'text', $content['value'], $content['params'] );
9380
  }
9381
  break;
9382
- case 'x-prop':
9383
- while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE )))
9384
- _addXMLchild( $properties, $content[0], 'unknown', $content[1]['value'], $content[1]['params'] );
9385
- break;
9386
- case 'created': // single occurence below, if set
9387
- case 'completed':
9388
- case 'dtstamp':
9389
- case 'last-modified':
9390
- $utcDate = TRUE;
9391
  case 'dtstart':
9392
- case 'dtend':
9393
- case 'due':
9394
- case 'recurrence-id':
9395
- if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9396
- $type = ( isset( $content['params']['VALUE'] ) && ( 'DATE' == $content['params']['VALUE'] )) ? 'date' : 'date-time';
9397
- unset( $content['params']['VALUE'] );
9398
- if(( isset( $content['params']['TZID'] ) && empty( $content['params']['TZID'] )) || @is_null( $content['params']['TZID'] ))
9399
- unset( $content['params']['TZID'] );
9400
- _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] );
9401
  }
9402
- unset( $utcDate );
9403
  break;
9404
  case 'duration':
9405
- if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9406
- if( !isset( $content['value']['relatedStart'] ) || ( TRUE !== $content['value']['relatedStart'] ))
9407
- $content['params']['RELATED'] = 'END';
9408
  _addXMLchild( $properties, $prop, 'duration', $content['value'], $content['params'] );
9409
- }
9410
  break;
9411
- case 'rrule':
9412
- while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE )))
9413
- _addXMLchild( $properties, $prop, 'recur', $content['value'], $content['params'] );
9414
- break;
9415
- case 'class':
9416
- case 'location':
9417
- case 'status':
9418
- case 'summary':
9419
- case 'transp':
9420
- case 'tzid':
9421
- case 'uid':
9422
- if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9423
- if((( 'location' == $prop ) || ( 'summary' == $prop )) && !isset( $content['params']['LANGUAGE'] )) {
9424
- if( $langComp )
9425
- $content['params']['LANGUAGE'] = $langComp;
9426
- elseif( $langCal )
9427
- $content['params']['LANGUAGE'] = $langCal;
9428
- }
9429
- _addXMLchild( $properties, $prop, 'text', $content['value'], $content['params'] );
9430
- }
9431
- break;
9432
- case 'geo':
9433
- if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE )))
9434
- _addXMLchild( $properties, $prop, 'geo', $content['value'], $content['params'] );
9435
  break;
9436
- case 'organizer':
9437
- if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9438
- if( isset( $content['params']['CN'] ) && !isset( $content['params']['LANGUAGE'] )) {
9439
- if( $langComp )
9440
- $content['params']['LANGUAGE'] = $langComp;
9441
- elseif( $langCal )
9442
- $content['params']['LANGUAGE'] = $langCal;
 
 
 
9443
  }
9444
- _addXMLchild( $properties, $prop, 'cal-address', $content['value'], $content['params'] );
9445
  }
9446
  break;
9447
- case 'percent-complete':
9448
- case 'priority':
9449
- case 'sequence':
9450
- if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE )))
9451
- _addXMLchild( $properties, $prop, 'integer', $content['value'], $content['params'] );
9452
  break;
9453
- case 'tzurl':
9454
- case 'url':
9455
- if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE )))
9456
- _addXMLchild( $properties, $prop, 'uri', $content['value'], $content['params'] );
9457
  break;
9458
- } // end switch( $prop )
9459
- } // end foreach( $props as $prop )
9460
- /** fix subComponent properties, if any */
9461
- foreach( $subComps as $subCompName ) {
9462
- while( FALSE !== ( $subcomp = $component->getComponent( $subCompName ))) {
9463
- $child2 = $child->addChild( $subCompName );
9464
- $properties = $child2->addChild( 'properties' );
9465
- $langComp = $subcomp->getConfig( 'language' );
9466
- $subCompProps = $subcomp->getConfig( 'setPropertyNames' );
9467
- foreach( $subCompProps as $prop ) {
9468
- switch( strtolower( $prop )) {
9469
- case 'attach': // may occur multiple times, below
9470
- while( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) {
9471
- $type = ( isset( $content['params']['VALUE'] ) && ( 'BINARY' == $content['params']['VALUE'] )) ? 'binary' : 'uri';
9472
- unset( $content['params']['VALUE'] );
9473
- _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] );
9474
- }
9475
- break;
9476
- case 'attendee':
9477
- while( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) {
9478
- if( isset( $content['params']['CN'] ) && !isset( $content['params']['LANGUAGE'] )) {
9479
- if( $langComp )
9480
- $content['params']['LANGUAGE'] = $langComp;
9481
- elseif( $langCal )
9482
- $content['params']['LANGUAGE'] = $langCal;
9483
- }
9484
- _addXMLchild( $properties, $prop, 'cal-address', $content['value'], $content['params'] );
9485
- }
9486
- break;
9487
- case 'comment':
9488
- case 'tzname':
9489
- while( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) {
9490
- if( !isset( $content['params']['LANGUAGE'] )) {
9491
- if( $langComp )
9492
- $content['params']['LANGUAGE'] = $langComp;
9493
- elseif( $langCal )
9494
- $content['params']['LANGUAGE'] = $langCal;
9495
- }
9496
- _addXMLchild( $properties, $prop, 'text', $content['value'], $content['params'] );
9497
- }
9498
- break;
9499
- case 'rdate':
9500
- while( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) {
9501
- $type = 'date-time';
9502
- if( isset( $content['params']['VALUE'] )) {
9503
- if( 'DATE' == $content['params']['VALUE'] )
9504
- $type = 'date';
9505
- elseif( 'PERIOD' == $content['params']['VALUE'] )
9506
- $type = 'period';
9507
- }
9508
- unset( $content['params']['VALUE'] );
9509
- _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] );
9510
- }
9511
- break;
9512
- case 'x-prop':
9513
- while( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE )))
9514
- _addXMLchild( $properties, $content[0], 'unknown', $content[1]['value'], $content[1]['params'] );
9515
- break;
9516
- case 'action': // single occurence below, if set
9517
- case 'description':
9518
- case 'summary':
9519
- if( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) {
9520
- if(( 'action' != $prop ) && !isset( $content['params']['LANGUAGE'] )) {
9521
- if( $langComp )
9522
- $content['params']['LANGUAGE'] = $langComp;
9523
- elseif( $langCal )
9524
- $content['params']['LANGUAGE'] = $langCal;
9525
- }
9526
- _addXMLchild( $properties, $prop, 'text', $content['value'], $content['params'] );
9527
- }
9528
- break;
9529
- case 'dtstart':
9530
- if( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) {
9531
- unset( $content['value']['tz'], $content['params']['VALUE'] ); // always local time
9532
- _addXMLchild( $properties, $prop, 'date-time', $content['value'], $content['params'] );
9533
- }
9534
- break;
9535
- case 'duration':
9536
- if( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE )))
9537
- _addXMLchild( $properties, $prop, 'duration', $content['value'], $content['params'] );
9538
- break;
9539
- case 'repeat':
9540
- if( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE )))
9541
- _addXMLchild( $properties, $prop, 'integer', $content['value'], $content['params'] );
9542
- break;
9543
- case 'trigger':
9544
- if( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) {
9545
- if( isset( $content['value']['year'] ) &&
9546
- isset( $content['value']['month'] ) &&
9547
- isset( $content['value']['day'] ))
9548
- $type = 'date-time';
9549
- else {
9550
- $type = 'duration';
9551
- if( !isset( $content['value']['relatedStart'] ) || ( TRUE !== $content['value']['relatedStart'] ))
9552
- $content['params']['RELATED'] = 'END';
9553
- }
9554
- _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] );
9555
- }
9556
- break;
9557
- case 'tzoffsetto':
9558
- case 'tzoffsetfrom':
9559
- if( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE )))
9560
- _addXMLchild( $properties, $prop, 'utc-offset', $content['value'], $content['params'] );
9561
- break;
9562
- case 'rrule':
9563
- while( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE )))
9564
- _addXMLchild( $properties, $prop, 'recur', $content['value'], $content['params'] );
9565
- break;
9566
- } // switch( $prop )
9567
- } // end foreach( $subCompProps as $prop )
9568
- } // end while( FALSE !== ( $subcomp = $component->getComponent( subCompName )))
9569
- } // end foreach( $subCombs as $subCompName )
9570
- } // end while( FALSE !== ( $component = $calendar->getComponent( $compName )))
9571
- } // end foreach( $comps as $compName)
9572
  return $xml->asXML();
9573
  }
9574
  /**
9575
  * Add children to a SimpleXMLelement
9576
  *
9577
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
9578
- * @since 2.15.5 - 2012-10-19
9579
  * @param object $parent, reference to a SimpleXMLelement node
9580
  * @param string $name, new element node name
9581
  * @param string $type, content type, subelement(-s) name
@@ -9587,11 +9726,11 @@ function _addXMLchild( & $parent, $name, $type, $content, $params=array()) {
9587
  /** create new child node */
9588
  $name = strtolower( $name );
9589
  $child = $parent->addChild( $name );
9590
- if( isset( $params['VALUE'] ))
9591
- unset( $params['VALUE'] );
9592
  if( !empty( $params )) {
9593
  $parameters = $child->addChild( 'parameters' );
9594
  foreach( $params as $param => $parVal ) {
 
 
9595
  $param = strtolower( $param );
9596
  if( 'x-' == substr( $param, 0, 2 )) {
9597
  $p1 = $parameters->addChild( $param );
@@ -9617,8 +9756,8 @@ function _addXMLchild( & $parent, $name, $type, $content, $params=array()) {
9617
  $p2 = $p1->addChild( $ptype, htmlspecialchars( $parVal ));
9618
  }
9619
  }
9620
- }
9621
- if( empty( $content ) && ( '0' != $content ))
9622
  return;
9623
  /** store content */
9624
  switch( $type ) {
@@ -9656,11 +9795,13 @@ function _addXMLchild( & $parent, $name, $type, $content, $params=array()) {
9656
  $v = $child->addChild( $type, $output.iCalUtilityFunctions::_duration2str( $content ) );
9657
  break;
9658
  case 'geo':
9659
- $v1 = $child->addChild( 'latitude', number_format( (float) $content['latitude'], 6, '.', '' ));
9660
- $v1 = $child->addChild( 'longitude', number_format( (float) $content['longitude'], 6, '.', '' ));
 
 
9661
  break;
9662
  case 'integer':
9663
- $v = $child->addChild( $type, $content );
9664
  break;
9665
  case 'period':
9666
  if( !is_array( $content ))
@@ -9682,8 +9823,8 @@ function _addXMLchild( & $parent, $name, $type, $content, $params=array()) {
9682
  }
9683
  break;
9684
  case 'recur':
 
9685
  foreach( $content as $rulelabel => $rulevalue ) {
9686
- $rulelabel = strtolower( $rulelabel );
9687
  switch( $rulelabel ) {
9688
  case 'until':
9689
  if( isset( $rulevalue['hour'] ))
@@ -9774,293 +9915,340 @@ function _addXMLchild( & $parent, $name, $type, $content, $params=array()) {
9774
  break;
9775
  }
9776
  }
9777
- /**
9778
- * parse xml string into iCalcreator instance
9779
- *
9780
- * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
9781
- * @since 2.11.2 - 2012-01-31
9782
- * @param string $xmlstr
9783
- * @param array $iCalcfg iCalcreator config array (opt)
9784
- * @return mixed iCalcreator instance or FALSE on error
9785
- */
9786
- function & XMLstr2iCal( $xmlstr, $iCalcfg=array()) {
9787
- libxml_use_internal_errors( TRUE );
9788
- $xml = simplexml_load_string( $xmlstr );
9789
- if( !$xml ) {
9790
- $str = '';
9791
- $return = FALSE;
9792
- foreach( libxml_get_errors() as $error ) {
9793
- switch ( $error->level ) {
9794
- case LIBXML_ERR_FATAL: $str .= ' FATAL '; break;
9795
- case LIBXML_ERR_ERROR: $str .= ' ERROR '; break;
9796
- case LIBXML_ERR_WARNING:
9797
- default: $str .= ' WARNING '; break;
9798
- }
9799
- $str .= PHP_EOL.'Error when loading XML';
9800
- if( !empty( $error->file ))
9801
- $str .= ', file:'.$error->file.', ';
9802
- $str .= ', line:'.$error->line;
9803
- $str .= ', ('.$error->code.') '.$error->message;
9804
- }
9805
- error_log( $str );
9806
- if( LIBXML_ERR_WARNING != $error->level )
9807
- return $return;
9808
- libxml_clear_errors();
9809
- }
9810
- return xml2iCal( $xml, $iCalcfg );
9811
- }
9812
  /**
9813
  * parse xml file into iCalcreator instance
9814
  *
9815
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
9816
- * @since 2.11.2 - 2012-01-20
9817
  * @param string $xmlfile
9818
- * @param array$iCalcfg iCalcreator config array (opt)
9819
  * @return mixediCalcreator instance or FALSE on error
9820
  */
9821
- function & XMLfile2iCal( $xmlfile, $iCalcfg=array()) {
9822
- libxml_use_internal_errors( TRUE );
9823
- $xml = simplexml_load_file( $xmlfile );
9824
- if( !$xml ) {
9825
- $str = '';
9826
- foreach( libxml_get_errors() as $error ) {
9827
- switch ( $error->level ) {
9828
- case LIBXML_ERR_FATAL: $str .= 'FATAL '; break;
9829
- case LIBXML_ERR_ERROR: $str .= 'ERROR '; break;
9830
- case LIBXML_ERR_WARNING:
9831
- default: $str .= 'WARNING '; break;
9832
- }
9833
- $str .= 'Failed loading XML'.PHP_EOL;
9834
- if( !empty( $error->file ))
9835
- $str .= ' file:'.$error->file.', ';
9836
- $str .= 'line:'.$error->line.PHP_EOL;
9837
- $str .= '('.$error->code.') '.$error->message.PHP_EOL;
9838
- }
9839
- error_log( $str );
9840
- if( LIBXML_ERR_WARNING != $error->level )
9841
- return FALSE;
9842
- libxml_clear_errors();
9843
- }
9844
- return xml2iCal( $xml, $iCalcfg );
9845
  }
9846
  /**
9847
- * parse SimpleXMLElement instance into iCalcreator instance
9848
  *
9849
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
9850
- * @since 2.11.2 - 2012-01-27
9851
- * @param object $xmlobj SimpleXMLElement
9852
  * @param array $iCalcfg iCalcreator config array (opt)
9853
  * @return mixed iCalcreator instance or FALSE on error
9854
  */
9855
- function & XML2iCal( $xmlobj, $iCalcfg=array()) {
9856
- $iCal = new vcalendar( $iCalcfg );
9857
- foreach( $xmlobj->children() as $icalendar ) { // vcalendar
9858
- foreach( $icalendar->children() as $calPart ) { // calendar properties and components
9859
- if( 'components' == $calPart->getName()) {
9860
- foreach( $calPart->children() as $component ) { // single components
9861
- if( 0 < $component->count())
9862
- _getXMLComponents( $iCal, $component );
9863
- }
9864
- }
9865
- elseif(( 'properties' == $calPart->getName()) && ( 0 < $calPart->count())) {
9866
- foreach( $calPart->children() as $calProp ) { // calendar properties
9867
- $propName = $calProp->getName();
9868
- if(( 'calscale' != $propName ) && ( 'method' != $propName ) && ( 'x-' != substr( $propName,0,2 )))
9869
- continue;
9870
- $params = array();
9871
- foreach( $calProp->children() as $calPropElem ) { // single calendar property
9872
- if( 'parameters' == $calPropElem->getName())
9873
- $params = _getXMLParams( $calPropElem );
9874
- else
9875
- $iCal->setProperty( $propName, reset( $calPropElem ), $params );
9876
- } // end foreach( $calProp->children() as $calPropElem )
9877
- } // end foreach( $calPart->properties->children() as $calProp )
9878
- } // end if( 0 < $calPart->properties->count())
9879
- } // end foreach( $icalendar->children() as $calPart )
9880
- } // end foreach( $xmlobj->children() as $icalendar )
9881
- return $iCal;
9882
  }
9883
  /**
9884
- * parse SimpleXMLElement instance property parameters and return iCalcreator property parameter array
9885
  *
9886
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
9887
- * @since 2.11.2 - 2012-01-15
9888
- * @param object $parameters SimpleXMLElement
9889
- * @return array iCalcreator property parameter array
 
9890
  */
9891
- function _getXMLParams( & $parameters ) {
9892
- if( 1 > $parameters->count())
9893
- return array();
9894
- $params = array();
9895
- foreach( $parameters->children() as $parameter ) { // single parameter key
9896
- $key = strtoupper( $parameter->getName());
9897
- $value = array();
9898
- foreach( $parameter->children() as $paramValue ) // skip parameter value type
9899
- $value[] = reset( $paramValue );
9900
- if( 2 > count( $value ))
9901
- $params[$key] = html_entity_decode( reset( $value ));
9902
- else
9903
- $params[$key] = $value;
9904
- }
9905
- return $params;
9906
  }
9907
  /**
9908
- * parse SimpleXMLElement instance components, create iCalcreator component and update
9909
  *
9910
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
9911
- * @since 2.11.2 - 2012-01-15
9912
- * @param array $iCal iCalcreator calendar instance
9913
- * @param object $component SimpleXMLElement
9914
- * @return void
9915
  */
9916
- function _getXMLComponents( & $iCal, & $component ) {
9917
- $compName = $component->getName();
9918
- $comp = & $iCal->newComponent( $compName );
9919
- $subComponents = array( 'valarm', 'standard', 'daylight' );
9920
- foreach( $component->children() as $compPart ) { // properties and (opt) subComponents
9921
- if( 1 > $compPart->count())
9922
- continue;
9923
- if( in_array( $compPart->getName(), $subComponents ))
9924
- _getXMLComponents( $comp, $compPart );
9925
- elseif( 'properties' == $compPart->getName()) {
9926
- foreach( $compPart->children() as $property ) // properties as single property
9927
- _getXMLProperties( $comp, $property );
9928
- }
9929
- } // end foreach( $component->children() as $compPart )
 
 
 
 
 
 
 
 
 
9930
  }
9931
  /**
9932
- * parse SimpleXMLElement instance property, create iCalcreator component property
9933
  *
9934
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
9935
- * @since 2.11.2 - 2012-01-27
9936
- * @param array $iCal iCalcreator calendar instance
9937
- * @param object $component SimpleXMLElement
9938
  * @return void
9939
  */
9940
- function _getXMLProperties( & $iCal, & $property ) {
9941
- $propName = $property->getName();
9942
- $value = $params = array();
9943
- $valueType = '';
9944
- foreach( $property->children() as $propPart ) { // calendar property parameters (opt) and value(-s)
9945
- $valueType = $propPart->getName();
9946
- if( 'parameters' == $valueType) {
9947
- $params = _getXMLParams( $propPart );
9948
  continue;
9949
  }
9950
- switch( $valueType ) {
9951
- case 'binary':
9952
- $value = reset( $propPart );
9953
- break;
9954
- case 'boolean':
9955
- break;
9956
- case 'cal-address':
9957
- $value = reset( $propPart );
9958
- break;
9959
- case 'date':
9960
- $params['VALUE'] = 'DATE';
9961
- case 'date-time':
9962
- if(( 'exdate' == $propName ) || ( 'rdate' == $propName ))
9963
- $value[] = reset( $propPart );
9964
- else
9965
- $value = reset( $propPart );
9966
- break;
9967
- case 'duration':
9968
- $value = reset( $propPart );
9969
- break;
9970
- // case 'geo':
9971
- case 'latitude':
9972
- case 'longitude':
9973
- $value[$valueType] = reset( $propPart );
9974
- break;
9975
- case 'integer':
9976
- $value = reset( $propPart );
9977
- break;
9978
- case 'period':
9979
- if( 'rdate' == $propName )
9980
- $params['VALUE'] = 'PERIOD';
9981
- $pData = array();
9982
- foreach( $propPart->children() as $periodPart )
9983
- $pData[] = reset( $periodPart );
9984
- if( !empty( $pData ))
9985
- $value[] = $pData;
9986
- break;
9987
- // case 'rrule':
9988
- case 'freq':
9989
- case 'count':
9990
- case 'until':
9991
- case 'interval':
9992
- case 'wkst':
9993
- $value[$valueType] = reset( $propPart );
9994
- break;
9995
- case 'bysecond':
9996
- case 'byminute':
9997
- case 'byhour':
9998
- case 'bymonthday':
9999
- case 'byyearday':
10000
- case 'byweekno':
10001
- case 'bymonth':
10002
- case 'bysetpos':
10003
- $value[$valueType][] = reset( $propPart );
10004
- break;
10005
- case 'byday':
10006
- $byday = reset( $propPart );
10007
- if( 2 == strlen( $byday ))
10008
- $value[$valueType][] = array( 'DAY' => $byday );
10009
  else {
10010
- $day = substr( $byday, -2 );
10011
- $key = substr( $byday, 0, ( strlen( $byday ) - 2 ));
10012
- $value[$valueType][] = array( $key, 'DAY' => $day );
 
10013
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10014
  break;
10015
- // case 'rstatus':
10016
- case 'code':
10017
- $value[0] = reset( $propPart );
10018
- break;
10019
- case 'description':
10020
- $value[1] = reset( $propPart );
10021
- break;
10022
- case 'data':
10023
- $value[2] = reset( $propPart );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10024
  break;
10025
- case 'text':
10026
- $text = str_replace( array( "\r\n", "\n\r", "\r", "\n"), '\n', reset( $propPart ));
10027
- $value['text'][] = html_entity_decode( $text );
10028
  break;
10029
- case 'time':
 
 
 
10030
  break;
10031
- case 'uri':
10032
- $value = reset( $propPart );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10033
  break;
10034
- case 'utc-offset':
10035
- $value = str_replace( ':', '', reset( $propPart ));
 
 
 
 
 
 
 
 
 
10036
  break;
10037
- case 'unknown':
10038
  default:
10039
- $value = html_entity_decode( reset( $propPart ));
10040
- break;
10041
- } // end switch( $valueType )
10042
- } // end foreach( $property->children() as $propPart )
10043
- if( 'freebusy' == $propName ) {
10044
- $fbtype = $params['FBTYPE'];
10045
- unset( $params['FBTYPE'] );
10046
- $iCal->setProperty( $propName, $fbtype, $value, $params );
10047
- }
10048
- elseif( 'geo' == $propName )
10049
- $iCal->setProperty( $propName, $value['latitude'], $value['longitude'], $params );
10050
- elseif( 'request-status' == $propName ) {
10051
- if( !isset( $value[2] ))
10052
- $value[2] = FALSE;
10053
- $iCal->setProperty( $propName, $value[0], $value[1], $value[2], $params );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10054
  }
10055
- else {
10056
- if( isset( $value['text'] ) && is_array( $value['text'] )) {
10057
- if(( 'categories' == $propName ) || ( 'resources' == $propName ))
10058
- $value = $value['text'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10059
  else
10060
- $value = reset( $value['text'] );
10061
  }
10062
- $iCal->setProperty( $propName, $value, $params );
 
10063
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10064
  }
10065
  /*********************************************************************************/
10066
  /* Additional functions to use with vtimezone components */
@@ -10116,7 +10304,6 @@ function getTzOffsetForDate($timezonesarray, $tzid, $timestamp) {
10116
  $timestamp['day'],
10117
  $timestamp['year']
10118
  ) ;
10119
- //echo '<td colspan="4">&nbsp;'."\n".'<tr><td>&nbsp;<td class="r">'.$timestamp.'<td class="r">'.$disp.'<td colspan="4">&nbsp;'."\n".'<tr><td colspan="3">&nbsp;'; // test ###
10120
  }
10121
  $tzoffset = array();
10122
  // something to return if all goes wrong (such as if $tzid doesn't find us an array of dates)
@@ -10353,3 +10540,4 @@ function expandTimezoneDates($vtzc) {
10353
  }
10354
  return $tzdates;
10355
  }
 
1
  <?php
2
  /*********************************************************************************/
3
  /**
 
 
 
 
4
  *
 
5
  * This file is a PHP implementation of rfc2445/rfc5545.
6
  *
7
+ * @copyright Copyright (c) 2007-2014 Kjell-Inge Gustafsson, kigkonsult, All rights reserved
8
+ * @link http://kigkonsult.se/iCalcreator/index.php
9
+ * @license http://kigkonsult.se/downloads/dl.php?f=LGPL
10
+ * @package iCalcreator
11
+ * @version v2.20
12
+ */
13
+ /**
14
  * This library is free software; you can redistribute it and/or
15
  * modify it under the terms of the GNU Lesser General Public
16
  * License as published by the Free Software Foundation; either
26
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27
  */
28
  /*********************************************************************************/
29
+ /**
30
+ * Do NOT remove or change version!!
31
+ *
32
+ * @copyright Copyright (c) 2007-2014 Kjell-Inge Gustafsson, kigkonsult, All rights reserved
33
+ * @license http://kigkonsult.se/downloads/dl.php?f=LGPL
34
+ */
35
+ define( 'ICALCREATOR_VERSION', 'iCalcreator 2.20' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  /*********************************************************************************/
37
  /**
38
  * vcalendar class
99
  $this->xcaldecl = array();
100
  $this->components = array();
101
  }
102
+ /**
103
+ * return iCalcreator version number
104
+ *
105
+ * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
106
+ * @since 2.18.5 - 2013-08-29
107
+ * @uses ICALCREATOR_VERSION
108
+ * @return string
109
+ */
110
+ public static function iCalcreatorVersion() {
111
+ return trim( substr( ICALCREATOR_VERSION, strpos( ICALCREATOR_VERSION, ' ' )));
112
+ }
113
  /*********************************************************************************/
114
  /**
115
  * Property Name: CALSCALE
183
  /**
184
  * Property Name: PRODID
185
  *
 
 
 
186
  */
187
  /**
188
  * creates formatted output for calendar property prodid
189
  *
190
+ * @copyright copyright (c) 2007-2013 Kjell-Inge Gustafsson, kigkonsult, All rights reserved
191
+ * @license http://kigkonsult.se/downloads/dl.php?f=LGPL
192
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
193
  * @since 2.12.11 - 2012-05-13
194
  * @return string
208
  }
209
  }
210
  /**
211
+ * make default value for calendar prodid, do NOT alter or remove this method or invoke of this method
212
  *
213
+ * @copyright copyright (c) 2007-2013 Kjell-Inge Gustafsson, kigkonsult, All rights reserved
214
+ * @license http://kigkonsult.se/downloads/dl.php?f=LGPL
215
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
216
  * @since 2.6.8 - 2009-12-30
217
  * @return void
292
  * creates formatted output for calendar property x-prop, iCal format only
293
  *
294
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
295
+ * @since 2.16.21 - 2013-05-25
296
  * @return string
297
  */
298
  function createXprop() {
299
  if( empty( $this->xprop ) || !is_array( $this->xprop )) return FALSE;
300
+ $output = null;
301
+ $toolbox = new calendarComponent();
302
  $toolbox->setConfig( $this->getConfig());
303
  foreach( $this->xprop as $label => $xpropPart ) {
304
  if( !isset($xpropPart['value']) || ( empty( $xpropPart['value'] ) && !is_numeric( $xpropPart['value'] ))) {
305
+ if( $this->getConfig( 'allowEmpty' ))
306
+ $output .= $toolbox->_createElement( $label );
307
  continue;
308
  }
309
+ $attributes = $toolbox->_createParams( $xpropPart['params'], array( 'LANGUAGE' ));
310
  if( is_array( $xpropPart['value'] )) {
311
  foreach( $xpropPart['value'] as $pix => $theXpart )
312
+ $xpropPart['value'][$pix] = iCalUtilityFunctions::_strrep( $theXpart, $this->format, $this->nl );
313
  $xpropPart['value'] = implode( ',', $xpropPart['value'] );
314
  }
315
  else
316
+ $xpropPart['value'] = iCalUtilityFunctions::_strrep( $xpropPart['value'], $this->format, $this->nl );
317
+ $output .= $toolbox->_createElement( $label, $attributes, $xpropPart['value'] );
318
  if( is_array( $toolbox->xcaldecl ) && ( 0 < count( $toolbox->xcaldecl ))) {
319
  foreach( $toolbox->xcaldecl as $localxcaldecl )
320
  $this->xcaldecl[] = $localxcaldecl;
326
  * set calendar property x-prop
327
  *
328
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
329
+ * @since 2.18.10 - 2013-09-04
330
  * @param string $label
331
  * @param string $value
332
  * @param array $params optional
335
  function setXprop( $label, $value, $params=FALSE ) {
336
  if( empty( $label ))
337
  return FALSE;
338
+ $label = strtoupper( $label );
339
+ if( 'X-' != substr( $label, 0, 2 ))
340
  return FALSE;
341
+ if( empty( $value ) && !is_numeric( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
342
  $xprop = array( 'value' => $value );
343
  $xprop['params'] = iCalUtilityFunctions::_setParams( $params );
344
+ if( !is_array( $this->xprop ))
345
+ $this->xprop = array();
346
+ $this->xprop[$label] = $xprop;
347
  return TRUE;
348
  }
349
  /*********************************************************************************/
406
  * get calendar property value/params
407
  *
408
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
409
+ * @since 2.18.10 - 2013-09-04
410
  * @param string $propName, optional
411
  * @param int $propix, optional, if specific property is wanted in case of multiply occurences
412
  * @param bool $inclParam=FALSE
419
  $propix = ( isset( $this->propix[$propName] )) ? $this->propix[$propName] + 2 : 1;
420
  $this->propix[$propName] = --$propix;
421
  }
422
+ else {
423
  $mProps = array( 'ATTENDEE', 'CATEGORIES', 'CONTACT', 'RELATED-TO', 'RESOURCES' );
424
+ $vComps = array('vevent', 'vtodo', 'vjournal', 'vfreebusy' );
425
+ $dateFmt = '%04d%02d%02d';
426
+ }
427
  switch( $propName ) {
428
  case 'ATTENDEE':
429
  case 'CATEGORIES':
443
  case 'URL':
444
  $output = array();
445
  foreach ( $this->components as $cix => $component) {
446
+ if( !in_array( $component->objName, $vComps))
447
  continue;
448
+ if( in_array( $propName, $mProps )) {
449
  $component->_getProperties( $propName, $output );
450
  continue;
451
  }
454
  $content = $component->getProperty( 'UID' );
455
  }
456
  elseif( 'GEOLOCATION' == $propName ) {
457
+ $content = ( FALSE === ( $loc = $component->getProperty( 'LOCATION' ))) ? '' : $loc.' ';
458
+ if( FALSE === ( $geo = $component->getProperty( 'GEO' )))
 
459
  continue;
460
+ $content .= iCalUtilityFunctions::_geo2str2( $geo['latitude'], iCalUtilityFunctions::$geoLatFmt ).
461
+ iCalUtilityFunctions::_geo2str2( $geo['longitude'], iCalUtilityFunctions::$geoLongFmt ).'/';
 
 
 
 
 
 
 
 
 
462
  }
463
  elseif( FALSE === ( $content = $component->getProperty( $propName )))
464
  continue;
466
  continue;
467
  elseif( is_array( $content )) {
468
  if( isset( $content['year'] )) {
469
+ $key = sprintf( $dateFmt, $content['year'], $content['month'], $content['day'] );
470
  if( !isset( $output[$key] ))
471
  $output[$key] = 1;
472
  else
665
  * general vcalendar config setting
666
  *
667
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
668
+ * @since 2.18.12 - 2013-09-12
669
  * @param mixed $config
670
  * @param string $value
671
  * @return void
672
  */
673
  function setConfig( $config, $value = FALSE) {
674
  if( is_array( $config )) {
675
+ $config = array_change_key_case( $config, CASE_UPPER );
676
+ if( isset( $config['DELIMITER'] )) {
677
+ if( FALSE === $this->setConfig( 'DELIMITER', $config['DELIMITER'] ))
678
+ return FALSE;
679
+ unset( $config['DELIMITER'] );
680
+ }
681
+ if( isset( $config['DIRECTORY'] )) {
682
+ if( FALSE === $this->setConfig( 'DIRECTORY', $config['DIRECTORY'] ))
683
+ return FALSE;
684
+ unset( $config['DIRECTORY'] );
 
 
685
  }
686
  foreach( $config as $cKey => $cValue ) {
687
  if( FALSE === $this->setConfig( $cKey, $cValue ))
689
  }
690
  return TRUE;
691
  }
692
+ else
693
  $res = FALSE;
694
+ $config = strtoupper( $config );
695
+ switch( $config ) {
696
  case 'ALLOWEMPTY':
697
  $this->allowEmpty = $value;
698
  $subcfg = array( 'ALLOWEMPTY' => $value );
703
  return TRUE;
704
  break;
705
  case 'DIRECTORY':
706
+ if( FALSE === ( $value = realpath( rtrim( trim( $value ), $this->delimiter ))))
707
+ return FALSE;
708
+ else {
 
 
709
  /* local directory */
 
710
  $this->directory = $value;
711
  $this->url = null;
712
  return TRUE;
713
  }
 
 
714
  break;
715
  case 'FILENAME':
716
  $value = trim( $value );
717
+ $dirfile = $this->directory.$this->delimiter.$value;
 
 
 
 
 
718
  if( file_exists( $dirfile )) {
719
  /* local file exists */
720
  if( is_readable( $dirfile ) || is_writable( $dirfile )) {
725
  else
726
  return FALSE;
727
  }
728
+ elseif( is_readable( $this->directory ) || is_writable( $this->directory )) {
729
  /* read- or writable directory */
730
+ clearstatcache();
731
  $this->filename = $value;
732
  return TRUE;
733
  }
784
  break;
785
  case 'URL':
786
  /* remote file - URL */
787
+ $value = str_replace( array( 'HTTP://', 'WEBCAL://', 'webcal://' ), 'http://', trim( $value ));
788
+ $value = str_replace( 'HTTPS://', 'https://', trim( $value ));
789
+ if(( 'http://' != substr( $value, 0, 7 )) && ( 'https://' != substr( $value, 0, 8 )))
790
+ return FALSE;
791
+ $this->directory = '.';
792
  $this->url = $value;
793
+ if( '.ics' != strtolower( substr( $value, -4 )))
794
+ unset( $this->filename );
795
+ else
796
+ $this->filename = $basename( $value );
797
+ return TRUE;
798
  break;
799
  default: // any unvalid config key.. .
800
  return TRUE;
870
  * get calendar component from container
871
  *
872
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
873
+ * @since 2.18.10 - 2013-09-04
874
  * @param mixed $arg1 optional, ordno/component type/ component uid
875
  * @param mixed $arg2 optional, ordno if arg1 = component type
876
  * @return object
881
  $argType = 'INDEX';
882
  $index = $this->compix['INDEX'] = ( isset( $this->compix['INDEX'] )) ? $this->compix['INDEX'] + 1 : 1;
883
  }
 
 
 
 
 
884
  elseif( is_array( $arg1 )) { // array( *[propertyName => propertyValue] )
885
  $arg2 = implode( '-', array_keys( $arg1 ));
886
  $index = $this->compix[$arg2] = ( isset( $this->compix[$arg2] )) ? $this->compix[$arg2] + 1 : 1;
888
  $otherProps = array( 'ATTENDEE', 'CATEGORIES', 'CONTACT', 'LOCATION', 'ORGANIZER', 'PRIORITY', 'RELATED-TO', 'RESOURCES', 'STATUS', 'SUMMARY', 'UID', 'URL' );
889
  $mProps = array( 'ATTENDEE', 'CATEGORIES', 'CONTACT', 'RELATED-TO', 'RESOURCES' );
890
  }
891
+ elseif ( ctype_digit( (string) $arg1 )) { // specific component in chain
892
+ $argType = 'INDEX';
893
+ $index = (int) $arg1;
894
+ unset( $this->compix );
895
+ }
896
  elseif(( strlen( $arg1 ) <= strlen( 'vfreebusy' )) && ( FALSE === strpos( $arg1, '@' ))) { // object class name
897
  unset( $this->compix['INDEX'] );
898
  $argType = strtolower( $arg1 );
923
  $cix1gC++;
924
  }
925
  elseif( is_array( $arg1 )) { // array( *[propertyName => propertyValue] )
926
+ $hit = array();
927
+ $arg1 = array_change_key_case( $arg1, CASE_UPPER );
928
  foreach( $arg1 as $pName => $pValue ) {
 
929
  if( !in_array( $pName, $dateProps ) && !in_array( $pName, $otherProps ))
930
  continue;
931
  if( in_array( $pName, $mProps )) { // multiple occurrence
943
  $hit[] = ( FALSE !== stripos( $value, $pValue )) ? TRUE : FALSE;
944
  continue;
945
  }
946
+ if( in_array( $pName, $dateProps )) {
947
  $valuedate = sprintf( '%04d%02d%02d', $value['year'], $value['month'], $value['day'] );
948
  if( 8 < strlen( $pValue )) {
949
  if( isset( $value['hour'] )) {
1032
  * No date controls occurs.
1033
  *
1034
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
1035
+ * @since 2.18.19 - 2014-02-01
1036
  * @param mixed $startY optional, start Year, default current Year ALT. array selecOptions ( *[ <propName> => <uniqueValue> ] )
1037
  * @param int $startM optional, start Month, default current Month
1038
  * @param int $startD optional, start Day, default current Day
1055
  if( is_array( $startY ))
1056
  return $this->selectComponents2( $startY );
1057
  /* check default dates */
1058
+ if( ! $startY ) $startY = date( 'Y' );
1059
+ if( ! $startM ) $startM = date( 'm' );
1060
+ if( ! $startD ) $startD = date( 'd' );
1061
  $startDate = mktime( 0, 0, 0, $startM, $startD, $startY );
1062
+ if( ! $endY ) $endY = $startY;
1063
+ if( ! $endM ) $endM = $startM;
1064
+ if( ! $endD ) $endD = $startD;
1065
  $endDate = mktime( 23, 59, 59, $endM, $endD, $endY );
1066
+ // echo 'selectComp arg='.date( 'Y-m-d H:i:s', $startDate).' -- '.date( 'Y-m-d H:i:s', $endDate)."<br>\n"; $tcnt = 0;// test ###
1067
  /* check component types */
1068
  $validTypes = array('vevent', 'vtodo', 'vjournal', 'vfreebusy' );
1069
+ if( empty( $cType ))
1070
+ $cType = $validTypes;
1071
+ else {
1072
+ if( ! is_array( $cType ))
1073
+ $cType = array( $cType );
1074
+ $cType = array_map( 'strtolower', $cType );
1075
  foreach( $cType as $cix => $theType ) {
1076
+ $cType[$cix] = $theType;
1077
  if( !in_array( $theType, $validTypes ))
1078
  $cType[$cix] = 'vevent';
1079
  }
1080
  $cType = array_unique( $cType );
1081
  }
 
 
 
 
 
 
 
 
 
 
 
1082
  if(( FALSE === $flat ) && ( FALSE === $any )) // invalid combination
1083
  $split = FALSE;
1084
  if(( TRUE === $flat ) && ( TRUE === $split )) // invalid combination
1085
  $split = FALSE;
1086
  /* iterate components */
1087
+ $result = array();
1088
+ $this->sort( 'UID' );
1089
+ $compUIDcmp = null;
1090
+ $recurridList = array();
1091
  foreach ( $this->components as $cix => $component ) {
1092
  if( empty( $component )) continue;
1093
  unset( $start );
1094
  /* deselect unvalid type components */
1095
  if( !in_array( $component->objName, $cType ))
1096
  continue;
1097
+ $start = $component->getProperty( 'dtstart', FALSE, TRUE );
1098
  /* select due when dtstart is missing */
1099
+ if( empty( $start ) && ( $component->objName == 'vtodo' ) && ( FALSE === ( $start = $component->getProperty( 'due', FALSE, TRUE ))))
1100
  continue;
1101
  if( empty( $start ))
1102
  continue;
1103
+ if( ! isset( $start['value']['tz'] ) && isset( $start['params']['TZID'] ))
1104
+ $start['value']['tz'] = $start['params']['TZID'];
1105
+ $start = $start['value'];
1106
+ $compUID = $component->getProperty( 'UID' );
1107
+ if( $compUIDcmp != $compUID ) {
1108
+ $compUIDcmp = $compUID;
1109
+ unset( $exdatelist, $recurridList );
1110
+ }
1111
+ $SCbools = array( 'dtendExist' => FALSE, 'dueExist' => FALSE, 'durationExist' => FALSE, 'endAllDayEvent' => FALSE );
1112
+ $recurrid = FALSE;
1113
+ $dateFormat = array();
1114
+ unset( $end, $startWdate, $endWdate, $rdurWsecs, $rdur, $workstart, $workend ); // clean up
1115
+ $startWdate = iCalUtilityFunctions::_SCsetXCurrentDateZ( iCalUtilityFunctions::_date2timestamp( $start ), $start );
1116
+ $dateFormat['start'] = ( isset( $start['hour'] )) ? 'Y-m-d H:i:s' : 'Y-m-d';
1117
  /* get end date from dtend/due/duration properties */
1118
+ $end = $component->getProperty( 'dtend', FALSE, TRUE );
1119
  if( !empty( $end )) {
1120
+ $SCbools[ 'dtendExist'] = TRUE;
1121
+ $dateFormat['end'] = ( isset( $end['value']['hour'] )) ? 'Y-m-d H:i:s' : 'Y-m-d';
1122
  }
1123
+ if( ! isset( $end['value']['tz'] ) && isset( $end['params']['TZID'] ))
1124
+ $end['value']['tz'] = $end['params']['TZID'];
1125
+ $end = $end['value'];
1126
  if( empty( $end ) && ( $component->objName == 'vtodo' )) {
1127
  $end = $component->getProperty( 'due' );
1128
  if( !empty( $end )) {
1129
+ $SCbools[ 'dueExist'] = TRUE;
1130
+ $dateFormat['end'] = ( isset( $end['hour'] )) ? 'Y-m-d H:i:s' : 'Y-m-d';
1131
  }
1132
  }
1133
  if( !empty( $end ) && !isset( $end['hour'] )) {
1134
  /* a DTEND without time part regards an event that ends the day before,
1135
  for an all-day event DTSTART=20071201 DTEND=20071202 (taking place 20071201!!! */
1136
+ $SCbools[ 'endAllDayEvent'] = TRUE;
1137
  $endWdate = mktime( 23, 59, 59, $end['month'], ($end['day'] - 1), $end['year'] );
1138
  $end['year'] = date( 'Y', $endWdate );
1139
  $end['month'] = date( 'm', $endWdate );
1144
  if( empty( $end )) {
1145
  $end = $component->getProperty( 'duration', FALSE, FALSE, TRUE );// in dtend (array) format
1146
  if( !empty( $end ))
1147
+ if( isset( $start['tz'] ))
1148
+ $end['tz'] = $start['tz'];
1149
+ $SCbools[ 'durationExist'] = TRUE;
1150
+ $dateFormat['end'] = ( isset( $start['hour'] )) ? 'Y-m-d H:i:s' : 'Y-m-d';
1151
+ // if( !empty($end)) echo 'selectComp 4 start='.implode('-',$start).' end='.implode('-',$end)."<br>\n"; // test ###
1152
  }
1153
  if( empty( $end )) { // assume one day duration if missing end date
1154
  $end = array( 'year' => $start['year'], 'month' => $start['month'], 'day' => $start['day'], 'hour' => 23, 'min' => 59, 'sec' => 59 );
1155
+ if( isset( $start['tz'] ))
1156
+ $end['tz'] = $start['tz'];
1157
  }
1158
+ // if( isset($end)) echo 'selectComp 5 start='.implode('-',$start).' end='.implode('-',$end)."<br>\n"; // test ###
1159
+ $endWdate = iCalUtilityFunctions::_SCsetXCurrentDateZ( iCalUtilityFunctions::_date2timestamp( $end ), $end );
1160
  if( $endWdate < $startWdate ) { // MUST be after start date!!
1161
  $end = array( 'year' => $start['year'], 'month' => $start['month'], 'day' => $start['day'], 'hour' => 23, 'min' => 59, 'sec' => 59 );
1162
  $endWdate = iCalUtilityFunctions::_date2timestamp( $end );
1176
  $exdatelist[$exWdate] = TRUE;
1177
  } // end - foreach( $exdate as $theExdate )
1178
  } // end - check exdate
1179
+ /* check recurrence-id (note, a missing sequence is the same as sequence=0 so don't test for sequence), remove hit with reccurr-id date */
1180
+ if( FALSE !== ( $recurrid = $component->getProperty( 'recurrence-id' ))) {
 
 
1181
  $recurrid = iCalUtilityFunctions::_date2timestamp( $recurrid );
1182
  $recurrid = mktime( 0, 0, 0, date( 'm', $recurrid ), date( 'd', $recurrid ), date( 'Y', $recurrid )); // on a day-basis !!!
1183
+ $recurridList[$recurrid] = TRUE; // no recurring to start this day
1184
+ // echo "adding comp no:$cix with date=".implode($start)." and recurrid=".implode($recurrid)." to recurridList id=$recurrid<br>\n"; // test ###
 
 
 
 
 
 
 
 
 
 
1185
  } // end recurrence-id/sequence test
1186
  /* select only components with.. . */
1187
  if(( !$any && ( $startWdate >= $startDate ) && ( $startWdate <= $endDate )) || // (dt)start within the period
1194
  elseif( $split ) { // split the original component
1195
  if( $endWdate > $endDate )
1196
  $endWdate = $endDate; // use period end date
1197
+ $rstart = ( $startWdate < $startDate ) ? $startDate : $startWdate; // use period start date
1198
+ $startYMD = $rstartYMD = date( 'Ymd', $rstart );
 
 
1199
  $endYMD = date( 'Ymd', $endWdate );
1200
  $checkDate = mktime( 0, 0, 0, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!!
1201
+ // echo "going to test comp no:$cix with rstartYMD=$rstartYMD, endYMD=$endYMD and checkDate($checkDate) with recurridList=".implode(',',array_keys($recurridList))."<br>\n"; // test ###
1202
+ if( !isset( $exdatelist[$checkDate] )) { // exclude any recurrence START date, found in exdatelist
1203
+ while( $rstartYMD <= $endYMD ) { // iterate
1204
+ if( isset( $exdatelist[$checkDate] ) || // exclude any recurrence date, found in the exdatelist
1205
+ ( isset( $recurridList[$checkDate] ) && !$recurrid )) { // or in the recurridList, but not itself
1206
+ // echo "skipping comp no:$cix with datestart=$rstartYMD and checkdate=$checkDate<br>\n"; // test ###
1207
+ $rstart += ( 24 *3600 ); // step one day
1208
+ $rstartYMD = date( 'Ymd', $rstart );
1209
+ continue;
1210
+ }
1211
+ iCalUtilityFunctions::_SCsetXCurrentStart( $component, $dateFormat, $checkDate, $rstartYMD, $rstart, $startYMD, $start );
1212
+ iCalUtilityFunctions::_SCsetXCurrentEnd( $component, $dateFormat, $rstart, $rstartYMD, $endWdate, $endYMD, $end, $SCbools );
1213
+ $wd = getdate( $rstart );
1214
+ $result[$wd['year']][$wd['mon']][$wd['mday']][$compUID] = $component->copy(); // copy to output
1215
+ $rstart += ( 24 *3600 ); // step one day
1216
+ $rstartYMD = date( 'Ymd', $rstart );
1217
+ $checkDate = mktime( 0, 0, 0, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!!
1218
+ } // end while( $rstart <= $endWdate )
1219
+ } // end if( !isset( $exdatelist[$checkDate] ))
1220
+ } // end elseif( $split ) - else use component date
 
 
 
 
 
 
 
 
 
 
 
 
1221
  elseif( $recurrid && !$flat && !$any && !$split )
1222
  $continue = TRUE;
1223
  else { // !$flat && !$split, i.e. no flat array and DTSTART within period
1224
  $checkDate = mktime( 0, 0, 0, date( 'm', $startWdate ), date( 'd', $startWdate ), date( 'Y', $startWdate ) ); // on a day-basis !!!
1225
+ // echo "going to test comp no:$cix with checkDate=$checkDate with recurridList=".implode(',',array_keys($recurridList)); // test ###
1226
+ if(( !$any || !isset( $exdatelist[$checkDate] )) && // exclude any recurrence date, found in exdatelist
1227
+ ( !isset( $recurridList[$checkDate] ) || $recurrid )) { // or in the recurridList, but not itself
1228
+ // echo " and copied to output<br>\n"; // test ###
1229
  $wd = getdate( $startWdate );
1230
  $result[$wd['year']][$wd['mon']][$wd['mday']][$compUID] = $component->copy(); // copy to output
1231
  }
1232
  }
1233
  } // end if(( $startWdate >= $startDate ) && ( $startWdate <= $endDate ))
 
1234
  /* if 'any' components, check components with reccurrence rules, removing all excluding dates */
1235
  if( TRUE === $any ) {
1236
  /* make a list of optional repeating dates for component occurence, rrule, rdate */
1237
  $recurlist = array();
1238
  while( FALSE !== ( $rrule = $component->getProperty( 'rrule' ))) // check rrule
1239
  iCalUtilityFunctions::_recur2date( $recurlist, $rrule, $start, $workstart, $workend );
1240
+ foreach( $recurlist as $recurkey => $recurvalue ) // key=match date as timestamp
1241
+ $recurlist[$recurkey] = $rdurWsecs; // add duration in seconds
1242
  while( FALSE !== ( $rdate = $component->getProperty( 'rdate' ))) { // check rdate
1243
  foreach( $rdate as $theRdate ) {
1244
+ if( is_array( $theRdate ) && ( 2 == count( $theRdate )) && // all days within PERIOD
1245
  array_key_exists( '0', $theRdate ) && array_key_exists( '1', $theRdate )) {
1246
  $rstart = iCalUtilityFunctions::_date2timestamp( $theRdate[0] );
1247
  if(( $rstart < ( $startDate - $rdurWsecs )) || ( $rstart > $endDate ))
1264
  }
1265
  }
1266
  } // end - check rdate
1267
+ foreach( $recurlist as $recurkey => $durvalue ) { // remove all recurrence START dates found in the exdatelist
1268
+ $checkDate = mktime( 0, 0, 0, date( 'm', $recurkey ), date( 'd', $recurkey ), date( 'Y', $recurkey ) ); // on a day-basis !!!
1269
+ if( isset( $exdatelist[$checkDate] )) // no recurring to start this day
1270
+ unset( $recurlist[$recurkey] );
1271
+ }
1272
  if( 0 < count( $recurlist )) {
1273
  ksort( $recurlist );
1274
  $xRecurrence = 1;
1275
  $component2 = $component->copy();
1276
  $compUID = $component2->getProperty( 'UID' );
1277
  foreach( $recurlist as $recurkey => $durvalue ) {
1278
+ // echo "recurKey=".date( 'Y-m-d H:i:s', $recurkey ).' dur='.iCalUtilityFunctions::offsetSec2His( $durvalue )."<br>\n"; // test ###;
1279
  if((( $startDate - $rdurWsecs ) > $recurkey ) || ( $endDate < $recurkey )) // not within period
1280
  continue;
1281
  $checkDate = mktime( 0, 0, 0, date( 'm', $recurkey ), date( 'd', $recurkey ), date( 'Y', $recurkey ) ); // on a day-basis !!!
1282
+ if( isset( $recurridList[$checkDate] )) // no recurring to start this day
1283
  continue;
1284
+ if( isset( $exdatelist[$checkDate] )) // check excluded dates
1285
+ continue;
1286
+ if( $startWdate >= $recurkey ) // exclude component start date
1287
  continue;
1288
  $rstart = $recurkey;
1289
  $rend = $recurkey + $durvalue;
1294
  }
1295
  /* add repeating components within valid dates to output array, one each day */
1296
  elseif( $split ) {
1297
+ $xRecurrence += 1;
1298
  if( $rend > $endDate )
1299
  $rend = $endDate;
1300
+ $startYMD = $rstartYMD = date( 'Ymd', $rstart );
1301
  $endYMD = date( 'Ymd', $rend );
1302
+ // echo "splitStart=".date( 'Y-m-d H:i:s', $rstart ).' end='.date( 'Y-m-d H:i:s', $rend )."<br>\n"; // test ###;
1303
+ while( $rstartYMD <= $endYMD ) { // iterate.. .
1304
  $checkDate = mktime( 0, 0, 0, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!!
1305
+ if( isset( $recurridList[$checkDate] )) // no recurring to start this day
1306
  break;
1307
+ if( isset( $exdatelist[$checkDate] )) // exclude any recurrence START date, found in exdatelist
1308
+ break;
1309
+ // echo "checking date after startdate=".date( 'Y-m-d H:i:s', $rstart ).' mot '.date( 'Y-m-d H:i:s', $startDate )."<br>"; // test ###;
1310
+ if( $rstart >= $startDate ) { // date after dtstart
1311
+ iCalUtilityFunctions::_SCsetXCurrentStart( $component2, $dateFormat, $checkDate, $rstartYMD, $rstart, $startYMD, $start );
1312
+ iCalUtilityFunctions::_SCsetXCurrentEnd( $component2, $dateFormat, $rstart, $rstartYMD, $endWdate, $endYMD, $end, $SCbools );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1313
  $component2->setProperty( 'X-RECURRENCE', $xRecurrence );
1314
  $wd = getdate( $rstart );
1315
  $result[$wd['year']][$wd['mon']][$wd['mday']][$compUID] = $component2->copy(); // copy to output
1316
+ } // end if$rstart >= $startDate { // date after dtstart
1317
+ $rstart += ( 24 *3600 ); // step one day
1318
+ $rstartYMD = date( 'Ymd', $rstart );
1319
  } // end while( $rstart <= $rend )
 
1320
  } // end elseif( $split )
1321
+ elseif( $rstart >= $startDate ) { // date within period //* flat=FALSE && split=FALSE => one comp every recur startdate *//
1322
+ $xRecurrence += 1;
1323
  $checkDate = mktime( 0, 0, 0, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!!
1324
+ if( !isset( $exdatelist[$checkDate] )) { // exclude any recurrence START date, found in exdatelist
1325
+ iCalUtilityFunctions::_SCsetXCurrentStart( $component2, $dateFormat, $rstart, FALSE, FALSE, FALSE, $start );
1326
+ $tend = $rstart + $rdurWsecs;
1327
+ iCalUtilityFunctions::_SCsetXCurrentEnd( $component2, $dateFormat, $tend, date( 'Ymd', $tend ), $endWdate, date( 'Ymd', $endWdate ), $end, $SCbools );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1328
  $component2->setProperty( 'X-RECURRENCE', $xRecurrence );
1329
  $wd = getdate( $rstart );
1330
  $result[$wd['year']][$wd['mon']][$wd['mday']][$compUID] = $component2->copy(); // copy to output
1331
  } // end if( !isset( $exdatelist[$checkDate] ))
1332
  } // end elseif( $rstart >= $startDate )
1333
  } // end foreach( $recurlist as $recurkey => $durvalue )
1334
+ unset( $component2 );
1335
  } // end if( 0 < count( $recurlist ))
1336
  /* deselect components with startdate/enddate not within period */
1337
  if(( $endWdate < $startDate ) || ( $startWdate > $endDate ))
1338
  continue;
1339
  } // end if( TRUE === $any )
1340
  } // end foreach ( $this->components as $cix => $component )
1341
+ unset( $SCbools, $recurrid, $recurridList,
1342
+ $end, $startWdate, $endWdate, $rdurWsecs, $rdur, $exdatelist, $recurlist, $workstart, $workend, $dateFormat ); // clean up
1343
+ if( 0 >= count( $result ))
1344
+ return FALSE;
1345
  elseif( !$flat ) {
1346
  foreach( $result as $y => $yeararr ) {
1347
  foreach( $yeararr as $m => $montharr ) {
1348
  foreach( $montharr as $d => $dayarr ) {
1349
  if( empty( $result[$y][$m][$d] ))
1350
  unset( $result[$y][$m][$d] );
1351
+ else {
1352
+ $result[$y][$m][$d] = array_values( $dayarr ); // skip tricky UID-index
1353
+ if( 1 < count( $result[$y][$m][$d] )) {
1354
+ foreach( $result[$y][$m][$d] as & $c ) // sort
1355
+ iCalUtilityFunctions::_setSortArgs( $c );
1356
+ usort( $result[$y][$m][$d], array( 'iCalUtilityFunctions', '_cmpfcn' ));
1357
+ }
1358
+ }
1359
+ } // end foreach( $montharr as $d => $dayarr )
1360
  if( empty( $result[$y][$m] ))
1361
  unset( $result[$y][$m] );
1362
  else
1363
  ksort( $result[$y][$m] );
1364
+ } // end foreach( $yeararr as $m => $montharr )
1365
  if( empty( $result[$y] ))
1366
  unset( $result[$y] );
1367
  else
1368
  ksort( $result[$y] );
1369
+ }// end foreach( $result as $y => $yeararr )
1370
  if( empty( $result ))
1371
  unset( $result );
1372
  else
1380
  * select components from calendar on based on specific property value(-s)
1381
  *
1382
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
1383
+ * @since 2.16.6 - 2012-12-26
1384
  * @param array $selectOptions, (string) key => (mixed) value, (key=propertyName)
1385
  * @return array
1386
  */
1388
  $output = array();
1389
  $allowedComps = array('vevent', 'vtodo', 'vjournal', 'vfreebusy' );
1390
  $allowedProperties = array( 'ATTENDEE', 'CATEGORIES', 'CONTACT', 'LOCATION', 'ORGANIZER', 'PRIORITY', 'RELATED-TO', 'RESOURCES', 'STATUS', 'SUMMARY', 'UID', 'URL' );
1391
+ $selectOptions = array_change_key_case( $selectOptions, CASE_UPPER );
1392
  foreach( $this->components as $cix => $component3 ) {
1393
  if( !in_array( $component3->objName, $allowedComps ))
1394
  continue;
1395
  $uid = $component3->getProperty( 'UID' );
1396
  foreach( $selectOptions as $propName => $pvalue ) {
 
1397
  if( !in_array( $propName, $allowedProperties ))
1398
  continue;
1399
  if( !is_array( $pvalue ))
1400
  $pvalue = array( $pvalue );
1401
  if(( 'UID' == $propName ) && in_array( $uid, $pvalue )) {
1402
+ $output[$uid][] = $component3->copy();
1403
  continue;
1404
  }
1405
  elseif(( 'ATTENDEE' == $propName ) || ( 'CATEGORIES' == $propName ) || ( 'CONTACT' == $propName ) || ( 'RELATED-TO' == $propName ) || ( 'RESOURCES' == $propName )) { // multiple occurrence?
1407
  $component3->_getProperties( $propName, $propValues );
1408
  $propValues = array_keys( $propValues );
1409
  foreach( $pvalue as $theValue ) {
1410
+ if( in_array( $theValue, $propValues )) { // && !isset( $output[$uid] )) {
1411
+ $output[$uid][] = $component3->copy();
1412
  break;
1413
  }
1414
  }
1419
  if( is_array( $d )) {
1420
  foreach( $d as $part ) {
1421
  if( in_array( $part, $pvalue ) && !isset( $output[$uid] ))
1422
+ $output[$uid][] = $component3->copy();
1423
  }
1424
  }
1425
  elseif(( 'SUMMARY' == $propName ) && !isset( $output[$uid] )) {
1426
  foreach( $pvalue as $pval ) {
1427
  if( FALSE !== stripos( $d, $pval )) {
1428
+ $output[$uid][] = $component3->copy();
1429
  break;
1430
  }
1431
  }
1432
  }
1433
  elseif( in_array( $d, $pvalue ) && !isset( $output[$uid] ))
1434
+ $output[$uid][] = $component3->copy();
1435
  } // end foreach( $selectOptions as $propName => $pvalue ) {
1436
  } // end foreach( $this->components as $cix => $component3 ) {
1437
  if( !empty( $output )) {
1438
+ ksort( $output ); // uid order
1439
+ $output2 = array();
1440
+ foreach( $output as $uid => $components ) {
1441
+ foreach( $components as $component )
1442
+ $output2[] = $component;
1443
+ }
1444
+ $output = $output2;
1445
  }
1446
  return $output;
1447
  }
1448
  /**
1449
+ * replace calendar component in vcalendar
1450
  *
1451
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
1452
+ * @since 2.18.14 - 2014-03-30
1453
+ * @param object $component calendar component
1454
+ * @return bool
1455
+ */
1456
+ function replaceComponent( $component ) {
1457
+ if( in_array( $component->objName, array( 'vevent', 'vtodo', 'vjournal', 'vfreebusy' )))
1458
+ return $this->setComponent( $component, $component->getProperty( 'UID' ));
1459
+ if(( 'vtimezone' != $component->objName ) || ( FALSE === ( $tzid = $component->getProperty( 'TZID' ))))
1460
+ return FALSE;
1461
+ foreach( $this->components as $cix => $comp ) {
1462
+ if( 'vtimezone' != $component->objName )
1463
+ continue;
1464
+ if( $tzid == $comp->getComponent( 'TZID' )) {
1465
+ unset( $component->propix, $component->compix );
1466
+ $this->components[$cix] = $component;
1467
+ return TRUE;
1468
+ }
1469
+ }
1470
+ return FALSE;
1471
+ }
1472
+ /**
1473
+ * add calendar component to calendar
1474
+ *
1475
+ * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
1476
+ * @since 2.19.3 - 2014-03-30
1477
  * @param object $component calendar component
1478
  * @param mixed $arg1 optional, ordno/component type/ component uid
1479
  * @param mixed $arg2 optional, ordno if arg1 = component type
1480
+ * @return bool
1481
  */
1482
  function setComponent( $component, $arg1=FALSE, $arg2=FALSE ) {
1483
  $component->setConfig( $this->getConfig(), FALSE, TRUE );
1486
  $dummy1 = $component->getProperty( 'dtstamp' );
1487
  $dummy2 = $component->getProperty( 'uid' );
1488
  }
1489
+ unset( $component->propix, $component->compix );
1490
  if( !$arg1 ) { // plain insert, last in chain
1491
  $this->components[] = $component->copy();
1492
  return TRUE;
1537
  * otherwise sorting on specific (argument) property values
1538
  *
1539
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
1540
+ * @since 2.18.4 - 2013-08-18
1541
  * @param string $sortArg, optional
1542
+ * @uses iCalUtilityFunctions::_setSortArgs()
1543
+ * @uses iCalUtilityFunctions::_cmpfcn()
1544
  * @return void
 
1545
  */
1546
  function sort( $sortArg=FALSE ) {
1547
+ if( ! is_array( $this->components ) || ( 2 > count( $this->components )))
1548
+ return;
1549
+ if( $sortArg ) {
1550
+ $sortArg = strtoupper( $sortArg );
1551
+ if( !in_array( $sortArg, array( 'ATTENDEE', 'CATEGORIES', 'CONTACT', 'DTSTAMP', 'LOCATION', 'ORGANIZER', 'PRIORITY', 'RELATED-TO', 'RESOURCES', 'STATUS', 'SUMMARY', 'UID', 'URL' )))
1552
+ $sortArg = FALSE;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1553
  }
1554
+ foreach( $this->components as & $c )
1555
+ iCalUtilityFunctions::_setSortArgs( $c, $sortArg );
1556
+ usort( $this->components, array( 'iCalUtilityFunctions', '_cmpfcn' ));
1557
  }
1558
  /**
1559
  * parse iCal text/file into vcalendar, components, properties and parameters
1560
  *
1561
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
1562
+ * @since 2.18.16 - 2014-04-04
1563
  * @param mixed $unparsedtext, optional, strict rfc2445 formatted, single property string or array of property strings
1564
  * @return bool FALSE if error occurs during parsing
 
1565
  */
1566
  function parse( $unparsedtext=FALSE ) {
1567
  $nl = $this->getConfig( 'nl' );
1568
  if(( FALSE === $unparsedtext ) || empty( $unparsedtext )) {
1569
+ /* directory+filename is set previously via setConfig url or directory+filename */
1570
+ if( FALSE === ( $file = $this->getConfig( 'url' ))) {
1571
+ if( FALSE === ( $file = $this->getConfig( 'dirfile' )))
1572
+ return FALSE; /* err 1 */
1573
+ if( ! is_file( $file ))
1574
+ return FALSE; /* err 2 */
1575
+ if( ! is_readable( $file ))
1576
+ return FALSE; /* err 3 */
1577
+ }
1578
  /* READ FILE */
1579
+ if( FALSE === ( $rows = file_get_contents( $file )))
1580
+ return FALSE; /* err 5 */
1581
  }
1582
  elseif( is_array( $unparsedtext ))
1583
  $rows = implode( '\n'.$nl, $unparsedtext );
1584
  else
1585
  $rows = & $unparsedtext;
1586
  /* fix line folding */
1587
+ $rows = iCalUtilityFunctions::convEolChar( $rows, $nl );
1588
  /* skip leading (empty/invalid) lines */
1589
  foreach( $rows as $lix => $line ) {
1590
  if( FALSE !== stripos( $line, 'BEGIN:VCALENDAR' ))
1668
  $line .= rtrim( substr( $this->unparsed[++$i], 1 ), $nl );
1669
  $proprows[] = $line;
1670
  }
 
 
 
1671
  foreach( $proprows as $line ) {
1672
  if( '\n' == substr( $line, -2 ))
1673
  $line = substr( $line, 0, -2 );
1690
  /* rest of the line is opt.params and value */
1691
  $line = substr( $line, $cix);
1692
  /* separate attributes from value */
1693
+ iCalUtilityFunctions::_splitContent( $line, $propAttr );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1694
  /* update Property */
1695
  if( FALSE !== strpos( $line, ',' )) {
1696
  $content = array( 0 => '' );
1706
  }
1707
  if( 1 < count( $content )) {
1708
  foreach( $content as $cix => $contentPart )
1709
+ $content[$cix] = iCalUtilityFunctions::_strunrep( $contentPart );
1710
+ $this->setProperty( $propname, $content, $propAttr );
1711
  continue;
1712
  }
1713
  else
1714
  $line = reset( $content );
1715
+ $line = iCalUtilityFunctions::_strunrep( $line );
1716
  }
1717
+ $this->setProperty( $propname, rtrim( $line, "\x00..\x1F" ), $propAttr );
1718
  } // end - foreach( $this->unparsed.. .
1719
  } // end - if( is_array( $this->unparsed.. .
1720
  unset( $unparsedtext, $rows, $this->unparsed, $proprows );
2008
  * set calendar component property action
2009
  *
2010
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2011
+ * @since 2.16.21 - 2013-06-23
2012
  * @param string $value "AUDIO" / "DISPLAY" / "EMAIL" / "PROCEDURE"
2013
  * @param mixed $params
2014
  * @return bool
2015
  */
2016
  function setAction( $value, $params=FALSE ) {
2017
+ if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
2018
  $this->action = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
2019
  return TRUE;
2020
  }
2057
  * set calendar component property attach
2058
  *
2059
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2060
+ * @since 2.16.21 - 2013-06-23
2061
  * @param string $value
2062
  * @param array $params, optional
2063
  * @param integer $index, optional
2064
  * @return bool
2065
  */
2066
  function setAttach( $value, $params=FALSE, $index=FALSE ) {
2067
+ if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
2068
  iCalUtilityFunctions::_setMval( $this->attach, $value, $params, FALSE, $index );
2069
  return TRUE;
2070
  }
2162
  * set calendar component property attach
2163
  *
2164
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2165
+ * @since 2.18.13 - 2013-09-22
2166
  * @param string $value
2167
  * @param array $params, optional
2168
  * @param integer $index, optional
2169
  * @return bool
2170
  */
2171
  function setAttendee( $value, $params=FALSE, $index=FALSE ) {
2172
+ if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
2173
  // ftp://, http://, mailto:, file://, gopher://, news:, nntp://, telnet://, wais://, prospero:// may exist.. . also in params
2174
  if( !empty( $value )) {
2175
  if( FALSE === ( $pos = strpos( substr( $value, 0, 9 ), ':' )))
2181
  $params2 = array();
2182
  if( is_array($params )) {
2183
  $optarrays = array();
2184
+ $params = array_change_key_case( $params, CASE_UPPER );
2185
  foreach( $params as $optparamlabel => $optparamvalue ) {
2186
+ if(( 'X-' != substr( $optparamlabel, 0, 2 )) && (( 'vfreebusy' == $this->objName ) || ( 'valarm' == $this->objName )))
2187
+ continue;
2188
  switch( $optparamlabel ) {
2189
  case 'MEMBER':
2190
  case 'DELEGATED-TO':
2242
  * creates formatted output for calendar component property categories
2243
  *
2244
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2245
+ * @since 2.16.2 - 2012-12-18
2246
  * @return string
2247
  */
2248
  function createCategories() {
2257
  $attributes = $this->_createParams( $category['params'], array( 'LANGUAGE' ));
2258
  if( is_array( $category['value'] )) {
2259
  foreach( $category['value'] as $cix => $categoryPart )
2260
+ $category['value'][$cix] = iCalUtilityFunctions::_strrep( $categoryPart, $this->format, $this->nl );
2261
  $content = implode( ',', $category['value'] );
2262
  }
2263
  else
2264
+ $content = iCalUtilityFunctions::_strrep( $category['value'], $this->format, $this->nl );
2265
  $output .= $this->_createElement( 'CATEGORIES', $attributes, $content );
2266
  }
2267
  return $output;
2270
  * set calendar component property categories
2271
  *
2272
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2273
+ * @since 2.16.21 - 2013-06-23
2274
  * @param mixed $value
2275
  * @param array $params, optional
2276
  * @param integer $index, optional
2277
  * @return bool
2278
  */
2279
  function setCategories( $value, $params=FALSE, $index=FALSE ) {
2280
+ if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
2281
  iCalUtilityFunctions::_setMval( $this->categories, $value, $params, FALSE, $index );
2282
  return TRUE;
2283
  }
2303
  * set calendar component property class
2304
  *
2305
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2306
+ * @since 2.16.21 - 2013-06-23
2307
  * @param string $value "PUBLIC" / "PRIVATE" / "CONFIDENTIAL" / iana-token / x-name
2308
  * @param array $params optional
2309
  * @return bool
2310
  */
2311
  function setClass( $value, $params=FALSE ) {
2312
+ if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
2313
  $this->class = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
2314
  return TRUE;
2315
  }
2321
  * creates formatted output for calendar component property comment
2322
  *
2323
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2324
+ * @since 2.16.2 - 2012-12-18
2325
  * @return string
2326
  */
2327
  function createComment() {
2333
  continue;
2334
  }
2335
  $attributes = $this->_createParams( $commentPart['params'], array( 'ALTREP', 'LANGUAGE' ));
2336
+ $content = iCalUtilityFunctions::_strrep( $commentPart['value'], $this->format, $this->nl );
2337
  $output .= $this->_createElement( 'COMMENT', $attributes, $content );
2338
  }
2339
  return $output;
2342
  * set calendar component property comment
2343
  *
2344
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2345
+ * @since 2.16.21 - 2013-06-23
2346
  * @param string $value
2347
  * @param array $params, optional
2348
  * @param integer $index, optional
2349
  * @return bool
2350
  */
2351
  function setComment( $value, $params=FALSE, $index=FALSE ) {
2352
+ if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
2353
  iCalUtilityFunctions::_setMval( $this->comment, $value, $params, FALSE, $index );
2354
  return TRUE;
2355
  }
2383
  * set calendar component property completed
2384
  *
2385
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2386
+ * @since 2.16.21 - 2013-06-23
2387
  * @param mixed $year
2388
  * @param mixed $month optional
2389
  * @param int $day optional
2396
  function setCompleted( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) {
2397
  if( empty( $year )) {
2398
  if( $this->getConfig( 'allowEmpty' )) {
2399
+ $this->completed = array( 'value' => '', 'params' => iCalUtilityFunctions::_setParams( $params ));
2400
  return TRUE;
2401
  }
2402
  else
2413
  * creates formatted output for calendar component property contact
2414
  *
2415
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2416
+ * @since 2.16.2 - 2012-12-18
2417
  * @return string
2418
  */
2419
  function createContact() {
2422
  foreach( $this->contact as $contact ) {
2423
  if( !empty( $contact['value'] )) {
2424
  $attributes = $this->_createParams( $contact['params'], array( 'ALTREP', 'LANGUAGE' ));
2425
+ $content = iCalUtilityFunctions::_strrep( $contact['value'], $this->format, $this->nl );
2426
  $output .= $this->_createElement( 'CONTACT', $attributes, $content );
2427
  }
2428
  elseif( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'CONTACT' );
2433
  * set calendar component property contact
2434
  *
2435
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2436
+ * @since 2.16.21 - 2013-06-23
2437
  * @param string $value
2438
  * @param array $params, optional
2439
  * @param integer $index, optional
2440
  * @return bool
2441
  */
2442
  function setContact( $value, $params=FALSE, $index=FALSE ) {
2443
+ if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
2444
  iCalUtilityFunctions::_setMval( $this->contact, $value, $params, FALSE, $index );
2445
  return TRUE;
2446
  }
2465
  * set calendar component property created
2466
  *
2467
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2468
+ * @since 2.19.5 - 2014-03-29
2469
  * @param mixed $year optional
2470
  * @param mixed $month optional
2471
  * @param int $day optional
2476
  * @return bool
2477
  */
2478
  function setCreated( $year=FALSE, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) {
2479
+ if( !isset( $year ))
2480
+ $year = gmdate( 'Ymd\THis' );
 
2481
  $this->created = iCalUtilityFunctions::_setDate2( $year, $month, $day, $hour, $min, $sec, $params );
2482
  return TRUE;
2483
  }
2489
  * creates formatted output for calendar component property description
2490
  *
2491
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2492
+ * @since 2.16.2 - 2012-12-18
2493
  * @return string
2494
  */
2495
  function createDescription() {
2498
  foreach( $this->description as $description ) {
2499
  if( !empty( $description['value'] )) {
2500
  $attributes = $this->_createParams( $description['params'], array( 'ALTREP', 'LANGUAGE' ));
2501
+ $content = iCalUtilityFunctions::_strrep( $description['value'], $this->format, $this->nl );
2502
  $output .= $this->_createElement( 'DESCRIPTION', $attributes, $content );
2503
  }
2504
  elseif( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'DESCRIPTION' );
2509
  * set calendar component property description
2510
  *
2511
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2512
+ * @since 2.16.21 - 2013-06-23
2513
  * @param string $value
2514
  * @param array $params, optional
2515
  * @param integer $index, optional
2516
  * @return bool
2517
  */
2518
  function setDescription( $value, $params=FALSE, $index=FALSE ) {
2519
+ if( empty( $value )) { if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE; }
2520
  if( 'vjournal' != $this->objName )
2521
  $index = 1;
2522
  iCalUtilityFunctions::_setMval( $this->description, $value, $params, FALSE, $index );
2553
  * set calendar component property dtend
2554
  *
2555
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2556
+ * @since 2.16.21 - 2013-06-23
2557
  * @param mixed $year
2558
  * @param mixed $month optional
2559
  * @param int $day optional
2567
  function setDtend( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $tz=FALSE, $params=FALSE ) {
2568
  if( empty( $year )) {
2569
  if( $this->getConfig( 'allowEmpty' )) {
2570
+ $this->dtend = array( 'value' => '', 'params' => iCalUtilityFunctions::_setParams( $params ));
2571
  return TRUE;
2572
  }
2573
  else
2603
  * computes datestamp for calendar component object instance dtstamp
2604
  *
2605
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2606
+ * @since 2.19.5 - 2014-03-29
2607
  * @return void
2608
  */
2609
  function _makeDtstamp() {
2610
+ $d = gmdate( 'Y-m-d-H-i-s', time());
2611
  $date = explode( '-', $d );
2612
  $this->dtstamp['value'] = array( 'year' => $date[0], 'month' => $date[1], 'day' => $date[2], 'hour' => $date[3], 'min' => $date[4], 'sec' => $date[5], 'tz' => 'Z' );
2613
  $this->dtstamp['params'] = null;
2667
  * set calendar component property dtstart
2668
  *
2669
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2670
+ * @since 2.16.21 - 2013-06-23
2671
  * @param mixed $year
2672
  * @param mixed $month optional
2673
  * @param int $day optional
2681
  function setDtstart( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $tz=FALSE, $params=FALSE ) {
2682
  if( empty( $year )) {
2683
  if( $this->getConfig( 'allowEmpty' )) {
2684
+ $this->dtstart = array( 'value' => '', 'params' => iCalUtilityFunctions::_setParams( $params ));
2685
  return TRUE;
2686
  }
2687
  else
2723
  * set calendar component property due
2724
  *
2725
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2726
+ * @since 2.16.21 - 2013-06-23
2727
  * @param mixed $year
2728
  * @param mixed $month optional
2729
  * @param int $day optional
2736
  function setDue( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $tz=FALSE, $params=FALSE ) {
2737
  if( empty( $year )) {
2738
  if( $this->getConfig( 'allowEmpty' )) {
2739
+ $this->due = array( 'value' => '', 'params' => iCalUtilityFunctions::_setParams( $params ));
2740
  return TRUE;
2741
  }
2742
  else
2753
  * creates formatted output for calendar component property duration
2754
  *
2755
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2756
+ * @since 2.16.21 - 2013-05-25
2757
  * @return string
2758
  */
2759
  function createDuration() {
2764
  !isset( $this->duration['value']['min'] ) &&
2765
  !isset( $this->duration['value']['sec'] ))
2766
  if( $this->getConfig( 'allowEmpty' ))
2767
+ return $this->_createElement( 'DURATION' );
2768
  else return FALSE;
2769
  $attributes = $this->_createParams( $this->duration['params'] );
2770
  return $this->_createElement( 'DURATION', $attributes, iCalUtilityFunctions::_duration2str( $this->duration['value'] ));
2773
  * set calendar component property duration
2774
  *
2775
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2776
+ * @since 2.16.21 - 2013-05-25
2777
  * @param mixed $week
2778
  * @param mixed $day optional
2779
  * @param int $hour optional
2783
  * @return bool
2784
  */
2785
  function setDuration( $week, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) {
2786
+ if( empty( $week ) && empty( $day ) && empty( $hour ) && empty( $min ) && empty( $sec )) {
2787
+ if( $this->getConfig( 'allowEmpty' ))
2788
+ $week = $day = null;
2789
+ else
2790
+ return FALSE;
2791
+ }
2792
  if( is_array( $week ) && ( 1 <= count( $week )))
2793
  $this->duration = array( 'value' => iCalUtilityFunctions::_duration2arr( $week ), 'params' => iCalUtilityFunctions::_setParams( $day ));
2794
  elseif( is_string( $week ) && ( 3 <= strlen( trim( $week )))) {
2797
  $week = substr( $week, 1 );
2798
  $this->duration = array( 'value' => iCalUtilityFunctions::_durationStr2arr( $week ), 'params' => iCalUtilityFunctions::_setParams( $day ));
2799
  }
 
 
2800
  else
2801
+ $this->duration = array( 'value' => iCalUtilityFunctions::_duration2arr( array( 'week' => $week, 'day' => $day, 'hour' => $hour, 'min' => $min, 'sec' => $sec ))
2802
+ , 'params' => iCalUtilityFunctions::_setParams( $params ));
2803
  return TRUE;
2804
  }
2805
  /*********************************************************************************/
2810
  * creates formatted output for calendar component property exdate
2811
  *
2812
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2813
+ * @since 2.16.5 - 2012-12-28
2814
  * @return string
2815
  */
2816
  function createExdate() {
2817
  if( empty( $this->exdate )) return FALSE;
2818
+ $output = null;
2819
+ $exdates = array();
2820
+ foreach( $this->exdate as $theExdate ) {
2821
  if( empty( $theExdate['value'] )) {
2822
+ if( $this->getConfig( 'allowEmpty' ))
2823
+ $output .= $this->_createElement( 'EXDATE' );
2824
  continue;
2825
  }
2826
+ if( 1 < count( $theExdate['value'] ))
2827
+ usort( $theExdate['value'], array( 'iCalUtilityFunctions', '_sortExdate1' ));
2828
+ $exdates[] = $theExdate;
2829
+ }
2830
+ if( 1 < count( $exdates ))
2831
+ usort( $exdates, array( 'iCalUtilityFunctions', '_sortExdate2' ));
2832
+ foreach( $exdates as $theExdate ) {
2833
  $content = $attributes = null;
2834
  foreach( $theExdate['value'] as $eix => $exdatePart ) {
2835
  $parno = count( $exdatePart );
2848
  }
2849
  else
2850
  $formatted = str_replace( 'Z', '', $formatted );
2851
+ } // end if( 0 < $eix )
2852
  $content .= ( 0 < $eix ) ? ','.$formatted : $formatted;
2853
+ } // end foreach( $theExdate['value'] as $eix => $exdatePart )
2854
  $attributes .= $this->_createParams( $theExdate['params'] );
2855
  $output .= $this->_createElement( 'EXDATE', $attributes, $content );
2856
+ } // end foreach( $exdates as $theExdate )
2857
  return $output;
2858
  }
2859
  /**
2860
  * set calendar component property exdate
2861
  *
2862
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2863
+ * @since 2.16.21 - 2013-06-23
2864
  * @param array exdates
2865
  * @param array $params, optional
2866
  * @param integer $index, optional
2869
  function setExdate( $exdates, $params=FALSE, $index=FALSE ) {
2870
  if( empty( $exdates )) {
2871
  if( $this->getConfig( 'allowEmpty' )) {
2872
+ iCalUtilityFunctions::_setMval( $this->exdate, '', $params, FALSE, $index );
2873
  return TRUE;
2874
  }
2875
  else
2948
  * set calendar component property exdate
2949
  *
2950
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2951
+ * @since 2.16.21 - 2013-06-23
2952
  * @param array $exruleset
2953
  * @param array $params, optional
2954
  * @param integer $index, optional
2955
  * @return bool
2956
  */
2957
  function setExrule( $exruleset, $params=FALSE, $index=FALSE ) {
2958
+ if( empty( $exruleset )) if( $this->getConfig( 'allowEmpty' )) $exruleset = ''; else return FALSE;
2959
  iCalUtilityFunctions::_setMval( $this->exrule, iCalUtilityFunctions::_setRexrule( $exruleset ), $params, FALSE, $index );
2960
  return TRUE;
2961
  }
2967
  * creates formatted output for calendar component property freebusy
2968
  *
2969
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
2970
+ * @since 2.16.27 - 2013-07-05
2971
  * @return string
2972
  */
2973
  function createFreebusy() {
2989
  $attributes .= $this->_createParams( $freebusyPart['params'] );
2990
  $fno = 1;
2991
  $cnt = count( $freebusyPart['value']);
2992
+ if( 1 < $cnt )
2993
+ usort( $freebusyPart['value'], array( 'iCalUtilityFunctions', '_sortRdate1' ));
2994
  foreach( $freebusyPart['value'] as $periodix => $freebusyPeriod ) {
2995
  $formatted = iCalUtilityFunctions::_date2strdate( $freebusyPeriod[0] );
2996
  $content .= $formatted;
3021
  * set calendar component property freebusy
3022
  *
3023
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3024
+ * @since 2.16.21 - 2013-06-23
3025
  * @param string $fbType
3026
  * @param array $fbValues
3027
  * @param array $params, optional
3031
  function setFreebusy( $fbType, $fbValues, $params=FALSE, $index=FALSE ) {
3032
  if( empty( $fbValues )) {
3033
  if( $this->getConfig( 'allowEmpty' )) {
3034
+ iCalUtilityFunctions::_setMval( $this->freebusy, '', $params, FALSE, $index );
3035
  return TRUE;
3036
  }
3037
  else
3087
  * creates formatted output for calendar component property geo
3088
  *
3089
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3090
+ * @since 2.18.10 - 2013-09-03
3091
  * @return string
3092
  */
3093
  function createGeo() {
3094
  if( empty( $this->geo )) return FALSE;
3095
  if( empty( $this->geo['value'] ))
3096
  return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'GEO' ) : FALSE;
3097
+ return $this->_createElement( 'GEO', $this->_createParams( $this->geo['params'] ),
3098
+ iCalUtilityFunctions::_geo2str2( $this->geo['value']['latitude'], iCalUtilityFunctions::$geoLatFmt ).
3099
+ ';'.iCalUtilityFunctions::_geo2str2( $this->geo['value']['longitude'], iCalUtilityFunctions::$geoLongFmt ));
 
 
 
 
 
 
 
 
 
 
 
3100
  }
3101
  /**
3102
  * set calendar component property geo
3103
  *
3104
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3105
+ * @since 2.18.10 - 2013-09-03
3106
+ * @param mixed $latitude
3107
+ * @param mixed $longitude
3108
  * @param array $params optional
3109
  * @return bool
3110
  */
3111
  function setGeo( $latitude, $longitude, $params=FALSE ) {
3112
+ if( isset( $latitude ) && isset( $longitude )) {
 
3113
  if( !is_array( $this->geo )) $this->geo = array();
3114
+ $this->geo['value']['latitude'] = floatval( $latitude );
3115
+ $this->geo['value']['longitude'] = floatval( $longitude );
3116
  $this->geo['params'] = iCalUtilityFunctions::_setParams( $params );
3117
  }
3118
  elseif( $this->getConfig( 'allowEmpty' ))
3119
+ $this->geo = array( 'value' => '', 'params' => iCalUtilityFunctions::_setParams( $params ) );
3120
  else
3121
  return FALSE;
3122
  return TRUE;
3142
  * set calendar component property completed
3143
  *
3144
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3145
+ * @since 2.19.5 - 2014-03-29
3146
  * @param mixed $year optional
3147
  * @param mixed $month optional
3148
  * @param int $day optional
3154
  */
3155
  function setLastModified( $year=FALSE, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) {
3156
  if( empty( $year ))
3157
+ $year = gmdate( 'Ymd\THis' );
3158
  $this->lastmodified = iCalUtilityFunctions::_setDate2( $year, $month, $day, $hour, $min, $sec, $params );
3159
  return TRUE;
3160
  }
3166
  * creates formatted output for calendar component property location
3167
  *
3168
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3169
+ * @since 2.16.2 - 2012-12-18
3170
  * @return string
3171
  */
3172
  function createLocation() {
3174
  if( empty( $this->location['value'] ))
3175
  return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'LOCATION' ) : FALSE;
3176
  $attributes = $this->_createParams( $this->location['params'], array( 'ALTREP', 'LANGUAGE' ));
3177
+ $content = iCalUtilityFunctions::_strrep( $this->location['value'], $this->format, $this->nl );
3178
  return $this->_createElement( 'LOCATION', $attributes, $content );
3179
  }
3180
  /**
3181
  * set calendar component property location
3182
  '
3183
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3184
+ * @since 2.16.21 - 2013-06-23
3185
  * @param string $value
3186
  * @param array params optional
3187
  * @return bool
3188
  */
3189
  function setLocation( $value, $params=FALSE ) {
3190
+ if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
3191
  $this->location = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
3192
  return TRUE;
3193
  }
3214
  * set calendar component property organizer
3215
  *
3216
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3217
+ * @since 2.16.21 - 2013-06-23
3218
  * @param string $value
3219
  * @param array params optional
3220
  * @return bool
3221
  */
3222
  function setOrganizer( $value, $params=FALSE ) {
3223
+ if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
3224
  if( !empty( $value )) {
3225
  if( FALSE === ( $pos = strpos( substr( $value, 0, 9 ), ':' )))
3226
  $value = 'MAILTO:'.$value;
3259
  * set calendar component property percent-complete
3260
  *
3261
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3262
+ * @since 2.16.21 - 2013-06-23
3263
  * @param int $value
3264
  * @param array $params optional
3265
  * @return bool
3266
  */
3267
  function setPercentComplete( $value, $params=FALSE ) {
3268
+ if( empty( $value ) && !is_numeric( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
3269
  $this->percentcomplete = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
3270
  return TRUE;
3271
  }
3291
  * set calendar component property priority
3292
  *
3293
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3294
+ * @since 2.16.21 - 2013-06-23
3295
  * @param int $value
3296
  * @param array $params optional
3297
  * @return bool
3298
  */
3299
  function setPriority( $value, $params=FALSE ) {
3300
+ if( empty( $value ) && !is_numeric( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
3301
  $this->priority = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
3302
  return TRUE;
3303
  }
3309
  * creates formatted output for calendar component property rdate
3310
  *
3311
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3312
+ * @since 2.16.9 - 2013-01-09
3313
  * @return string
3314
  */
3315
  function createRdate() {
3316
  if( empty( $this->rdate )) return FALSE;
3317
  $utctime = ( in_array( $this->objName, array( 'vtimezone', 'standard', 'daylight' ))) ? TRUE : FALSE;
3318
  $output = null;
3319
+ $rdates = array();
 
3320
  foreach( $this->rdate as $rpix => $theRdate ) {
3321
  if( empty( $theRdate['value'] )) {
3322
  if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'RDATE' );
3324
  }
3325
  if( $utctime )
3326
  unset( $theRdate['params']['TZID'] );
3327
+ if( 1 < count( $theRdate['value'] ))
3328
+ usort( $theRdate['value'], array( 'iCalUtilityFunctions', '_sortRdate1' ));
3329
+ $rdates[] = $theRdate;
3330
+ }
3331
+ if( 1 < count( $rdates ))
3332
+ usort( $rdates, array( 'iCalUtilityFunctions', '_sortRdate2' ));
3333
+ foreach( $rdates as $rpix => $theRdate ) {
3334
  $attributes = $this->_createParams( $theRdate['params'] );
3335
  $cnt = count( $theRdate['value'] );
3336
  $content = null;
3392
  * set calendar component property rdate
3393
  *
3394
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3395
+ * @since 2.16.21 - 2013-06-23
3396
  * @param array $rdates
3397
  * @param array $params, optional
3398
  * @param integer $index, optional
3401
  function setRdate( $rdates, $params=FALSE, $index=FALSE ) {
3402
  if( empty( $rdates )) {
3403
  if( $this->getConfig( 'allowEmpty' )) {
3404
+ iCalUtilityFunctions::_setMval( $this->rdate, '', $params, FALSE, $index );
3405
  return TRUE;
3406
  }
3407
  else
3562
  * set calendar component property recurrence-id
3563
  *
3564
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3565
+ * @since 2.16.21 - 2013-06-23
3566
  * @param mixed $year
3567
  * @param mixed $month optional
3568
  * @param int $day optional
3575
  function setRecurrenceid( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $tz=FALSE, $params=FALSE ) {
3576
  if( empty( $year )) {
3577
  if( $this->getConfig( 'allowEmpty' )) {
3578
+ $this->recurrenceid = array( 'value' => '', 'params' => null );
3579
  return TRUE;
3580
  }
3581
  else
3592
  * creates formatted output for calendar component property related-to
3593
  *
3594
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3595
+ * @since 2.16.21 - 2013-05-25
3596
  * @return string
3597
  */
3598
  function createRelatedTo() {
3600
  $output = null;
3601
  foreach( $this->relatedto as $relation ) {
3602
  if( !empty( $relation['value'] ))
3603
+ $output .= $this->_createElement( 'RELATED-TO', $this->_createParams( $relation['params'] ), iCalUtilityFunctions::_strrep( $relation['value'], $this->format, $this->nl ));
3604
  elseif( $this->getConfig( 'allowEmpty' ))
3605
+ $output .= $this->_createElement( 'RELATED-TO' );
3606
  }
3607
  return $output;
3608
  }
3610
  * set calendar component property related-to
3611
  *
3612
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3613
+ * @since 2.16.21 - 2013-06-23
3614
  * @param float $relid
3615
  * @param array $params, optional
3616
  * @param index $index, optional
3617
  * @return bool
3618
  */
3619
  function setRelatedTo( $value, $params=FALSE, $index=FALSE ) {
3620
+ if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
3621
  iCalUtilityFunctions::_existRem( $params, 'RELTYPE', 'PARENT', TRUE ); // remove default
3622
  iCalUtilityFunctions::_setMval( $this->relatedto, $value, $params, FALSE, $index );
3623
  return TRUE;
3644
  * set calendar component property repeat
3645
  *
3646
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3647
+ * @since 2.16.21 - 2013-06-23
3648
  * @param string $value
3649
  * @param array $params optional
3650
  * @return void
3651
  */
3652
  function setRepeat( $value, $params=FALSE ) {
3653
+ if( empty( $value ) && !is_numeric( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
3654
  $this->repeat = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
3655
  return TRUE;
3656
  }
3661
  /**
3662
  * creates formatted output for calendar component property request-status
3663
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3664
+ * @since 2.16.2 - 2012-12-18
3665
  * @return string
3666
  */
3667
  function createRequestStatus() {
3674
  }
3675
  $attributes = $this->_createParams( $rstat['params'], array( 'LANGUAGE' ));
3676
  $content = number_format( (float) $rstat['value']['statcode'], 2, '.', '');
3677
+ $content .= ';'.iCalUtilityFunctions::_strrep( $rstat['value']['text'], $this->format, $this->nl );
3678
  if( isset( $rstat['value']['extdata'] ))
3679
+ $content .= ';'.iCalUtilityFunctions::_strrep( $rstat['value']['extdata'], $this->format, $this->nl );
3680
  $output .= $this->_createElement( 'REQUEST-STATUS', $attributes, $content );
3681
  }
3682
  return $output;
3685
  * set calendar component property request-status
3686
  *
3687
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3688
+ * @since 2.16.21 - 2013-06-23
3689
  * @param float $statcode
3690
  * @param string $text
3691
  * @param string $extdata, optional
3694
  * @return bool
3695
  */
3696
  function setRequestStatus( $statcode, $text, $extdata=FALSE, $params=FALSE, $index=FALSE ) {
3697
+ if( empty( $statcode ) || empty( $text )) if( $this->getConfig( 'allowEmpty' )) $statcode = $text = ''; else return FALSE;
3698
  $input = array( 'statcode' => $statcode, 'text' => $text );
3699
  if( $extdata )
3700
  $input['extdata'] = $extdata;
3709
  * creates formatted output for calendar component property resources
3710
  *
3711
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3712
+ * @since 2.16.2 - 2012-12-18
3713
  * @return string
3714
  */
3715
  function createResources() {
3723
  $attributes = $this->_createParams( $resource['params'], array( 'ALTREP', 'LANGUAGE' ));
3724
  if( is_array( $resource['value'] )) {
3725
  foreach( $resource['value'] as $rix => $resourcePart )
3726
+ $resource['value'][$rix] = iCalUtilityFunctions::_strrep( $resourcePart, $this->format, $this->nl );
3727
  $content = implode( ',', $resource['value'] );
3728
  }
3729
  else
3730
+ $content = iCalUtilityFunctions::_strrep( $resource['value'], $this->format, $this->nl );
3731
  $output .= $this->_createElement( 'RESOURCES', $attributes, $content );
3732
  }
3733
  return $output;
3736
  * set calendar component property recources
3737
  *
3738
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3739
+ * @since 2.16.21 - 2013-06-23
3740
  * @param mixed $value
3741
  * @param array $params, optional
3742
  * @param integer $index, optional
3743
  * @return bool
3744
  */
3745
  function setResources( $value, $params=FALSE, $index=FALSE ) {
3746
+ if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
3747
  iCalUtilityFunctions::_setMval( $this->resources, $value, $params, FALSE, $index );
3748
  return TRUE;
3749
  }
3766
  * set calendar component property rrule
3767
  *
3768
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3769
+ * @since 2.16.21 - 2013-06-23
3770
  * @param array $rruleset
3771
  * @param array $params, optional
3772
  * @param integer $index, optional
3773
  * @return void
3774
  */
3775
  function setRrule( $rruleset, $params=FALSE, $index=FALSE ) {
3776
+ if( empty( $rruleset )) if( $this->getConfig( 'allowEmpty' )) $rruleset = ''; else return FALSE;
3777
  iCalUtilityFunctions::_setMval( $this->rrule, iCalUtilityFunctions::_setRexrule( $rruleset ), $params, FALSE, $index );
3778
  return TRUE;
3779
  }
3831
  * set calendar component property status
3832
  *
3833
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3834
+ * @since 2.16.21 - 2013-06-23
3835
  * @param string $value
3836
  * @param array $params optional
3837
  * @return bool
3838
  */
3839
  function setStatus( $value, $params=FALSE ) {
3840
+ if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
3841
  $this->status = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
3842
  return TRUE;
3843
  }
3849
  * creates formatted output for calendar component property summary
3850
  *
3851
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3852
+ * @since 2.16.2 - 2012-12-18
3853
  * @return string
3854
  */
3855
  function createSummary() {
3857
  if( empty( $this->summary['value'] ))
3858
  return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'SUMMARY' ) : FALSE;
3859
  $attributes = $this->_createParams( $this->summary['params'], array( 'ALTREP', 'LANGUAGE' ));
3860
+ $content = iCalUtilityFunctions::_strrep( $this->summary['value'], $this->format, $this->nl );
3861
  return $this->_createElement( 'SUMMARY', $attributes, $content );
3862
  }
3863
  /**
3864
  * set calendar component property summary
3865
  *
3866
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3867
+ * @since 2.16.21 - 2013-06-23
3868
  * @param string $value
3869
  * @param string $params optional
3870
  * @return bool
3871
  */
3872
  function setSummary( $value, $params=FALSE ) {
3873
+ if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
3874
  $this->summary = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
3875
  return TRUE;
3876
  }
3896
  * set calendar component property transp
3897
  *
3898
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3899
+ * @since 2.16.21 - 2013-06-23
3900
  * @param string $value
3901
  * @param string $params optional
3902
  * @return bool
3903
  */
3904
  function setTransp( $value, $params=FALSE ) {
3905
+ if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
3906
  $this->transp = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
3907
  return TRUE;
3908
  }
3940
  * set calendar component property trigger
3941
  *
3942
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
3943
+ * @since 2.16.21 - 2013-06-23
3944
  * @param mixed $year
3945
  * @param mixed $month optional
3946
  * @param int $day optional
3954
  * @return bool
3955
  */
3956
  function setTrigger( $year, $month=null, $day=null, $week=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $relatedStart=TRUE, $before=TRUE, $params=FALSE ) {
3957
+ if( empty( $year ) && ( empty( $month ) || is_array( $month )) && empty( $day ) && empty( $week ) && empty( $hour ) && empty( $min ) && empty( $sec ))
3958
  if( $this->getConfig( 'allowEmpty' )) {
3959
+ $this->trigger = array( 'value' => '', 'params' => iCalUtilityFunctions::_setParams( $month ) );
3960
  return TRUE;
3961
  }
3962
  else
3989
  }
3990
  elseif(is_string( $year ) && ( is_array( $month ) || empty( $month ))) { // duration or date in a string
3991
  $params = iCalUtilityFunctions::_setParams( $month );
3992
+ if( in_array( $year{0}, array( 'P', '+', '-' ))) { // duration
3993
  $relatedStart = ( isset( $params['RELATED'] ) && ( 'END' == strtoupper( $params['RELATED'] ))) ? FALSE : TRUE;
3994
  $before = ( '-' == $year[0] ) ? TRUE : FALSE;
3995
  if( 'P' != $year[0] )
4041
  $this->trigger['value']['sec'] = 0;
4042
  $before = FALSE;
4043
  }
4044
+ else
4045
+ $this->trigger['value'] = iCalUtilityFunctions::_duration2arr( $this->trigger['value'] );
4046
  $relatedStart = ( FALSE !== $relatedStart ) ? TRUE : FALSE;
4047
  $before = ( FALSE !== $before ) ? TRUE : FALSE;
4048
  $this->trigger['value']['relatedStart'] = $relatedStart;
4059
  * creates formatted output for calendar component property tzid
4060
  *
4061
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4062
+ * @since 2.16.2 - 2012-12-18
4063
  * @return string
4064
  */
4065
  function createTzid() {
4067
  if( empty( $this->tzid['value'] ))
4068
  return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'TZID' ) : FALSE;
4069
  $attributes = $this->_createParams( $this->tzid['params'] );
4070
+ return $this->_createElement( 'TZID', $attributes, iCalUtilityFunctions::_strrep( $this->tzid['value'], $this->format, $this->nl ));
4071
  }
4072
  /**
4073
  * set calendar component property tzid
4074
  *
4075
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4076
+ * @since 2.16.21 - 2013-06-23
4077
  * @param string $value
4078
  * @param array $params optional
4079
  * @return bool
4080
  */
4081
  function setTzid( $value, $params=FALSE ) {
4082
+ if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
4083
  $this->tzid = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
4084
  return TRUE;
4085
  }
4092
  * creates formatted output for calendar component property tzname
4093
  *
4094
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4095
+ * @since 2.16.2 - 2012-12-18
4096
  * @return string
4097
  */
4098
  function createTzname() {
4101
  foreach( $this->tzname as $theName ) {
4102
  if( !empty( $theName['value'] )) {
4103
  $attributes = $this->_createParams( $theName['params'], array( 'LANGUAGE' ));
4104
+ $output .= $this->_createElement( 'TZNAME', $attributes, iCalUtilityFunctions::_strrep( $theName['value'], $this->format, $this->nl ));
4105
  }
4106
  elseif( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'TZNAME' );
4107
  }
4111
  * set calendar component property tzname
4112
  *
4113
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4114
+ * @since 2.16.21 - 2013-06-23
4115
  * @param string $value
4116
  * @param string $params, optional
4117
  * @param integer $index, optional
4118
  * @return bool
4119
  */
4120
  function setTzname( $value, $params=FALSE, $index=FALSE ) {
4121
+ if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
4122
  iCalUtilityFunctions::_setMval( $this->tzname, $value, $params, FALSE, $index );
4123
  return TRUE;
4124
  }
4144
  * set calendar component property tzoffsetfrom
4145
  *
4146
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4147
+ * @since 2.16.21 - 2013-06-23
4148
  * @param string $value
4149
  * @param string $params optional
4150
  * @return bool
4151
  */
4152
  function setTzoffsetfrom( $value, $params=FALSE ) {
4153
+ if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
4154
  $this->tzoffsetfrom = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
4155
  return TRUE;
4156
  }
4176
  * set calendar component property tzoffsetto
4177
  *
4178
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4179
+ * @since 2.16.21 - 2013-06-23
4180
  * @param string $value
4181
  * @param string $params optional
4182
  * @return bool
4183
  */
4184
  function setTzoffsetto( $value, $params=FALSE ) {
4185
+ if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
4186
  $this->tzoffsetto = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
4187
  return TRUE;
4188
  }
4208
  * set calendar component property tzurl
4209
  *
4210
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4211
+ * @since 2.16.21 - 2013-06-23
4212
  * @param string $value
4213
  * @param string $params optional
4214
  * @return boll
4215
  */
4216
  function setTzurl( $value, $params=FALSE ) {
4217
+ if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
4218
  $this->tzurl = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
4219
  return TRUE;
4220
  }
4226
  * creates formatted output for calendar component property uid
4227
  *
4228
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4229
+ * @since 2.19.1 - 2014-02-21
4230
  * @return string
4231
  */
4232
  function createUid() {
4233
+ if( empty( $this->uid ))
4234
  $this->_makeuid();
4235
  $attributes = $this->_createParams( $this->uid['params'] );
4236
  return $this->_createElement( 'UID', $attributes, $this->uid['value'] );
4259
  * set calendar component property uid
4260
  *
4261
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4262
+ * @since 2.19.1 - 2014-02-21
4263
  * @param string $value
4264
  * @param string $params optional
4265
  * @return bool
4266
  */
4267
  function setUid( $value, $params=FALSE ) {
4268
+ if( empty( $value ) && ( '0' != $value )) return FALSE; // no allowEmpty check here !!!!
4269
  $this->uid = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
4270
  return TRUE;
4271
  }
4291
  * set calendar component property url
4292
  *
4293
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4294
+ * @since 2.16.21 - 2013-06-23
4295
  * @param string $value
4296
  * @param string $params optional
4297
  * @return bool
4298
  */
4299
  function setUrl( $value, $params=FALSE ) {
4300
+ if( !empty( $value )) {
4301
+ if( !filter_var( $value, FILTER_VALIDATE_URL ) && ( 'urn' != strtolower( substr( $value, 0, 3 ))))
4302
+ return FALSE;
4303
+ }
4304
+ elseif( $this->getConfig( 'allowEmpty' ))
4305
+ $value = '';
4306
+ else
4307
+ return FALSE;
4308
  $this->url = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params ));
4309
  return TRUE;
4310
  }
4316
  * creates formatted output for calendar component property x-prop
4317
  *
4318
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4319
+ * @since 2.16.2 - 2012-12-18
4320
  * @return string
4321
  */
4322
  function createXprop() {
4330
  $attributes = $this->_createParams( $xpropPart['params'], array( 'LANGUAGE' ));
4331
  if( is_array( $xpropPart['value'] )) {
4332
  foreach( $xpropPart['value'] as $pix => $theXpart )
4333
+ $xpropPart['value'][$pix] = iCalUtilityFunctions::_strrep( $theXpart, $this->format, $this->format );
4334
  $xpropPart['value'] = implode( ',', $xpropPart['value'] );
4335
  }
4336
  else
4337
+ $xpropPart['value'] = iCalUtilityFunctions::_strrep( $xpropPart['value'], $this->format, $this->nl );
4338
  $output .= $this->_createElement( $label, $attributes, $xpropPart['value'] );
4339
  }
4340
  return $output;
4343
  * set calendar component property x-prop
4344
  *
4345
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4346
+ * @since 2.18.10 - 2013-09-04
4347
  * @param string $label
4348
  * @param mixed $value
4349
  * @param array $params optional
4352
  function setXprop( $label, $value, $params=FALSE ) {
4353
  if( empty( $label ))
4354
  return FALSE;
4355
+ $label = strtoupper( $label );
4356
+ if( 'X-' != substr( $label, 0, 2 ))
4357
  return FALSE;
4358
+ if( empty( $value ) && !is_numeric( $value )) if( $this->getConfig( 'allowEmpty' )) $value = ''; else return FALSE;
4359
  $xprop = array( 'value' => $value );
4360
  $xprop['params'] = iCalUtilityFunctions::_setParams( $params );
4361
  if( !is_array( $this->xprop )) $this->xprop = array();
4362
+ $this->xprop[$label] = $xprop;
4363
  return TRUE;
4364
  }
4365
  /*********************************************************************************/
4407
  * creates formatted output for calendar component property
4408
  *
4409
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4410
+ * @since 2.16.2 - 2012-12-18
4411
  * @param string $label property name
4412
  * @param string $attributes property attributes
4413
  * @param string $content property content (optional)
4508
  break;
4509
  default:
4510
  $output .= $this->elementStart2.$this->valueInit;
4511
+ return iCalUtilityFunctions::_size75( $output, $this->nl );
4512
  break;
4513
  }
4514
  }
4519
  return $output.$this->elementEnd1.$label.$this->elementEnd2;
4520
  break;
4521
  default:
4522
+ return iCalUtilityFunctions::_size75( $output, $this->nl );
4523
  break;
4524
  }
4525
  }
4527
  * creates formatted output for calendar component property parameters
4528
  *
4529
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4530
+ * @since 2.18.10 - 2012-09-04
4531
  * @param array $params optional
4532
  * @param array $ctrKeys optional
4533
  * @return string
4540
  $LANGattrKey = ( in_array( 'LANGUAGE', $ctrKeys )) ? TRUE : FALSE ;
4541
  $CNattrExist = $LANGattrExist = FALSE;
4542
  $xparams = array();
4543
+ $params = array_change_key_case( $params, CASE_UPPER );
4544
  foreach( $params as $paramKey => $paramValue ) {
4545
  if(( FALSE !== strpos( $paramValue, ':' )) ||
4546
  ( FALSE !== strpos( $paramValue, ';' )) ||
4550
  $xparams[] = $paramValue;
4551
  continue;
4552
  }
 
4553
  if( !in_array( $paramKey, array( 'ALTREP', 'CN', 'DIR', 'ENCODING', 'FMTTYPE', 'LANGUAGE', 'RANGE', 'RELTYPE', 'SENT-BY', 'TZID', 'VALUE' )))
4554
  $xparams[$paramKey] = $paramValue;
4555
  else
4611
  * creates formatted output for calendar component property data value type recur
4612
  *
4613
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4614
+ * @since 2.16.25 - 2013-06-30
4615
  * @param array $recurlabel
4616
  * @param array $recurdata
4617
  * @return string
4626
  $attributes = ( isset( $therule['params'] )) ? $this->_createParams( $therule['params'] ) : null;
4627
  $content1 = $content2 = null;
4628
  foreach( $therule['value'] as $rulelabel => $rulevalue ) {
4629
+ switch( strtoupper( $rulelabel )) {
4630
  case 'FREQ': {
4631
  $content1 .= "FREQ=$rulevalue";
4632
  break;
4662
  break;
4663
  }
4664
  case 'BYDAY': {
4665
+ $byday = array( '' );
4666
+ $bx = 0;
4667
+ foreach( $rulevalue as $bix => $bydayPart ) {
4668
+ if( ! empty( $byday[$bx] ) && ! ctype_digit( substr( $byday[$bx], -1 ))) // new day
4669
+ $byday[++$bx] = '';
4670
+ if( ! is_array( $bydayPart )) // day without order number
4671
+ $byday[$bx] .= (string) $bydayPart;
4672
+ else { // day with order number
4673
+ foreach( $bydayPart as $bix2 => $bydayPart2 )
4674
+ $byday[$bx] .= (string) $bydayPart2;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4675
  }
4676
+ } // end foreach( $rulevalue as $bix => $bydayPart )
4677
+ if( 1 < count( $byday ))
4678
+ usort( $byday, array( 'iCalUtilityFunctions', '_recurBydaySort' ));
4679
+ $content2 .= ';BYDAY='.implode( ',', $byday );
4680
  break;
4681
  }
4682
  default: {
4714
  * get general component config variables or info about subcomponents
4715
  *
4716
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4717
+ * @since 2.19.1 - 2014-02-21
4718
  * @param mixed $config
4719
  * @return value
4720
  */
4763
  case 'PROPINFO':
4764
  $output = array();
4765
  if( !in_array( $this->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' ))) {
4766
+ if( empty( $this->uid )) $this->_makeuid();
4767
  $output['UID'] = 1;
4768
  if( empty( $this->dtstamp )) $this->_makeDtstamp();
4769
  $output['DTSTAMP'] = 1;
4830
  * general component config setting
4831
  *
4832
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
4833
+ * @since 2.10.18 - 2013-09-06
4834
  * @param mixed $config
4835
  * @param string $value
4836
  * @param bool $softUpdate
4838
  */
4839
  function setConfig( $config, $value = FALSE, $softUpdate = FALSE ) {
4840
  if( is_array( $config )) {
4841
+ $config = array_change_key_case( $config, CASE_UPPER );
4842
+ if( isset( $config['NEWLINECHAR'] ) || isset( $config['NL'] )) {
4843
+ $k = ( isset( $config['NEWLINECHAR'] )) ? 'NEWLINECHAR' : 'NL';
4844
+ if( FALSE === $this->setConfig( 'NL', $config[$k] ))
4845
+ return FALSE;
4846
+ unset( $config[$k] );
 
 
4847
  }
4848
  foreach( $config as $cKey => $cValue ) {
4849
  if( FALSE === $this->setConfig( $cKey, $cValue, $softUpdate ))
4851
  }
4852
  return TRUE;
4853
  }
4854
+ else
4855
+ $config = strtoupper( $config );
4856
  $res = FALSE;
4857
+ switch( $config ) {
4858
  case 'ALLOWEMPTY':
4859
  $this->allowEmpty = $value;
4860
  $subcfg = array( 'ALLOWEMPTY' => $value );
5136
  case 'UID':
5137
  if( in_array( $this->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' )))
5138
  return FALSE;
5139
+ if( ! empty( $this->uid )) {
5140
  $this->uid = '';
5141
  $return = TRUE;
5142
  }
5201
  * if property has multiply values, consequtive function calls are needed
5202
  *
5203
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
5204
+ * @since 2.19.1 - 2014-02-21
5205
  * @param string $propName, optional
5206
  * @param int @propix, optional, if specific property is wanted in case of multiply occurences
5207
  * @param bool $inclParam=FALSE
5210
  */
5211
  function getProperty( $propName=FALSE, $propix=FALSE, $inclParam=FALSE, $specform=FALSE ) {
5212
  if( 'GEOLOCATION' == strtoupper( $propName )) {
5213
+ $content = ( FALSE === ( $loc = $this->getProperty( 'LOCATION' ))) ? '' : $loc.' ';
5214
+ if( FALSE === ( $geo = $this->getProperty( 'GEO' )))
 
5215
  return FALSE;
5216
+ return $content.
5217
+ iCalUtilityFunctions::_geo2str2( $geo['latitude'], iCalUtilityFunctions::$geoLatFmt ).
5218
+ iCalUtilityFunctions::_geo2str2( $geo['longitude'], iCalUtilityFunctions::$geoLongFmt ).'/';
 
 
 
 
 
 
 
 
5219
  }
5220
  if( $this->_notExistProp( $propName )) return FALSE;
5221
  $propName = ( $propName ) ? strtoupper( $propName ) : 'X-PROP';
5227
  }
5228
  switch( $propName ) {
5229
  case 'ACTION':
5230
+ if( isset( $this->action['value'] )) return ( $inclParam ) ? $this->action : $this->action['value'];
5231
  break;
5232
  case 'ATTACH':
5233
  $ak = ( is_array( $this->attach )) ? array_keys( $this->attach ) : array();
5254
  return ( $inclParam ) ? $this->categories[$propix] : $this->categories[$propix]['value'];
5255
  break;
5256
  case 'CLASS':
5257
+ if( isset( $this->class['value'] )) return ( $inclParam ) ? $this->class : $this->class['value'];
5258
  break;
5259
  case 'COMMENT':
5260
  $ak = ( is_array( $this->comment )) ? array_keys( $this->comment ) : array();
5265
  return ( $inclParam ) ? $this->comment[$propix] : $this->comment[$propix]['value'];
5266
  break;
5267
  case 'COMPLETED':
5268
+ if( isset( $this->completed['value'] )) return ( $inclParam ) ? $this->completed : $this->completed['value'];
5269
  break;
5270
  case 'CONTACT':
5271
  $ak = ( is_array( $this->contact )) ? array_keys( $this->contact ) : array();
5276
  return ( $inclParam ) ? $this->contact[$propix] : $this->contact[$propix]['value'];
5277
  break;
5278
  case 'CREATED':
5279
+ if( isset( $this->created['value'] )) return ( $inclParam ) ? $this->created : $this->created['value'];
5280
  break;
5281
  case 'DESCRIPTION':
5282
  $ak = ( is_array( $this->description )) ? array_keys( $this->description ) : array();
5287
  return ( $inclParam ) ? $this->description[$propix] : $this->description[$propix]['value'];
5288
  break;
5289
  case 'DTEND':
5290
+ if( isset( $this->dtend['value'] )) return ( $inclParam ) ? $this->dtend : $this->dtend['value'];
5291
  break;
5292
  case 'DTSTAMP':
5293
  if( in_array( $this->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' )))
5297
  return ( $inclParam ) ? $this->dtstamp : $this->dtstamp['value'];
5298
  break;
5299
  case 'DTSTART':
5300
+ if( isset( $this->dtstart['value'] )) return ( $inclParam ) ? $this->dtstart : $this->dtstart['value'];
5301
  break;
5302
  case 'DUE':
5303
+ if( isset( $this->due['value'] )) return ( $inclParam ) ? $this->due : $this->due['value'];
5304
  break;
5305
  case 'DURATION':
5306
+ if( ! isset( $this->duration['value'] )) return FALSE;
5307
  $value = ( $specform && isset( $this->dtstart['value'] ) && isset( $this->duration['value'] )) ? iCalUtilityFunctions::_duration2date( $this->dtstart['value'], $this->duration['value'] ) : $this->duration['value'];
5308
  return ( $inclParam ) ? array( 'value' => $value, 'params' => $this->duration['params'] ) : $value;
5309
  break;
5332
  return ( $inclParam ) ? $this->freebusy[$propix] : $this->freebusy[$propix]['value'];
5333
  break;
5334
  case 'GEO':
5335
+ if( isset( $this->geo['value'] )) return ( $inclParam ) ? $this->geo : $this->geo['value'];
5336
  break;
5337
  case 'LAST-MODIFIED':
5338
+ if( isset( $this->lastmodified['value'] )) return ( $inclParam ) ? $this->lastmodified : $this->lastmodified['value'];
5339
  break;
5340
  case 'LOCATION':
5341
+ if( isset( $this->location['value'] )) return ( $inclParam ) ? $this->location : $this->location['value'];
5342
  break;
5343
  case 'ORGANIZER':
5344
+ if( isset( $this->organizer['value'] )) return ( $inclParam ) ? $this->organizer : $this->organizer['value'];
5345
  break;
5346
  case 'PERCENT-COMPLETE':
5347
+ if( isset( $this->percentcomplete['value'] )) return ( $inclParam ) ? $this->percentcomplete : $this->percentcomplete['value'];
5348
  break;
5349
  case 'PRIORITY':
5350
+ if( isset( $this->priority['value'] )) return ( $inclParam ) ? $this->priority : $this->priority['value'];
5351
  break;
5352
  case 'RDATE':
5353
  $ak = ( is_array( $this->rdate )) ? array_keys( $this->rdate ) : array();
5358
  return ( $inclParam ) ? $this->rdate[$propix] : $this->rdate[$propix]['value'];
5359
  break;
5360
  case 'RECURRENCE-ID':
5361
+ if( isset( $this->recurrenceid['value'] )) return ( $inclParam ) ? $this->recurrenceid : $this->recurrenceid['value'];
5362
  break;
5363
  case 'RELATED-TO':
5364
  $ak = ( is_array( $this->relatedto )) ? array_keys( $this->relatedto ) : array();
5369
  return ( $inclParam ) ? $this->relatedto[$propix] : $this->relatedto[$propix]['value'];
5370
  break;
5371
  case 'REPEAT':
5372
+ if( isset( $this->repeat['value'] )) return ( $inclParam ) ? $this->repeat : $this->repeat['value'];
5373
  break;
5374
  case 'REQUEST-STATUS':
5375
  $ak = ( is_array( $this->requeststatus )) ? array_keys( $this->requeststatus ) : array();
5396
  return ( $inclParam ) ? $this->rrule[$propix] : $this->rrule[$propix]['value'];
5397
  break;
5398
  case 'SEQUENCE':
5399
+ if( isset( $this->sequence['value'] )) return ( $inclParam ) ? $this->sequence : $this->sequence['value'];
5400
  break;
5401
  case 'STATUS':
5402
+ if( isset( $this->status['value'] )) return ( $inclParam ) ? $this->status : $this->status['value'];
5403
  break;
5404
  case 'SUMMARY':
5405
+ if( isset( $this->summary['value'] )) return ( $inclParam ) ? $this->summary : $this->summary['value'];
5406
  break;
5407
  case 'TRANSP':
5408
+ if( isset( $this->transp['value'] )) return ( $inclParam ) ? $this->transp : $this->transp['value'];
5409
  break;
5410
  case 'TRIGGER':
5411
+ if( isset( $this->trigger['value'] )) return ( $inclParam ) ? $this->trigger : $this->trigger['value'];
5412
  break;
5413
  case 'TZID':
5414
+ if( isset( $this->tzid['value'] )) return ( $inclParam ) ? $this->tzid : $this->tzid['value'];
5415
  break;
5416
  case 'TZNAME':
5417
  $ak = ( is_array( $this->tzname )) ? array_keys( $this->tzname ) : array();
5422
  return ( $inclParam ) ? $this->tzname[$propix] : $this->tzname[$propix]['value'];
5423
  break;
5424
  case 'TZOFFSETFROM':
5425
+ if( isset( $this->tzoffsetfrom['value'] )) return ( $inclParam ) ? $this->tzoffsetfrom : $this->tzoffsetfrom['value'];
5426
  break;
5427
  case 'TZOFFSETTO':
5428
+ if( isset( $this->tzoffsetto['value'] )) return ( $inclParam ) ? $this->tzoffsetto : $this->tzoffsetto['value'];
5429
  break;
5430
  case 'TZURL':
5431
+ if( isset( $this->tzurl['value'] )) return ( $inclParam ) ? $this->tzurl : $this->tzurl['value'];
5432
  break;
5433
  case 'UID':
5434
  if( in_array( $this->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' )))
5435
  return FALSE;
5436
+ if( empty( $this->uid ))
5437
  $this->_makeuid();
5438
  return ( $inclParam ) ? $this->uid : $this->uid['value'];
5439
  break;
5440
  case 'URL':
5441
+ if( isset( $this->url['value'] )) return ( $inclParam ) ? $this->url : $this->url['value'];
5442
  break;
5443
  default:
5444
  if( $propName != 'X-PROP' ) {
5548
  }
5549
  switch( $arglist[0] ) {
5550
  case 'ACTION':
5551
+ return $this->setAction( $arglist[1], $arglist[2] );
5552
  case 'ATTACH':
5553
+ return $this->setAttach( $arglist[1], $arglist[2], $arglist[3] );
5554
  case 'ATTENDEE':
5555
+ return $this->setAttendee( $arglist[1], $arglist[2], $arglist[3] );
5556
  case 'CATEGORIES':
5557
+ return $this->setCategories( $arglist[1], $arglist[2], $arglist[3] );
5558
  case 'CLASS':
5559
+ return $this->setClass( $arglist[1], $arglist[2] );
5560
  case 'COMMENT':
5561
+ return $this->setComment( $arglist[1], $arglist[2], $arglist[3] );
5562
  case 'COMPLETED':
5563
+ return $this->setCompleted( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7] );
5564
  case 'CONTACT':
5565
+ return $this->setContact( $arglist[1], $arglist[2], $arglist[3] );
5566
  case 'CREATED':
5567
+ return $this->setCreated( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7] );
5568
  case 'DESCRIPTION':
5569
+ return $this->setDescription( $arglist[1], $arglist[2], $arglist[3] );
5570
  case 'DTEND':
5571
+ return $this->setDtend( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8] );
5572
  case 'DTSTAMP':
5573
+ return $this->setDtstamp( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7] );
5574
  case 'DTSTART':
5575
+ return $this->setDtstart( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8] );
5576
  case 'DUE':
5577
+ return $this->setDue( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8] );
5578
  case 'DURATION':
5579
+ return $this->setDuration( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6] );
5580
  case 'EXDATE':
5581
+ return $this->setExdate( $arglist[1], $arglist[2], $arglist[3] );
5582
  case 'EXRULE':
5583
+ return $this->setExrule( $arglist[1], $arglist[2], $arglist[3] );
5584
  case 'FREEBUSY':
5585
+ return $this->setFreebusy( $arglist[1], $arglist[2], $arglist[3], $arglist[4] );
5586
  case 'GEO':
5587
+ return $this->setGeo( $arglist[1], $arglist[2], $arglist[3] );
5588
  case 'LAST-MODIFIED':
5589
+ return $this->setLastModified( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7] );
5590
  case 'LOCATION':
5591
+ return $this->setLocation( $arglist[1], $arglist[2] );
5592
  case 'ORGANIZER':
5593
+ return $this->setOrganizer( $arglist[1], $arglist[2] );
5594
  case 'PERCENT-COMPLETE':
5595
  return $this->setPercentComplete( $arglist[1], $arglist[2] );
5596
  case 'PRIORITY':
5597
+ return $this->setPriority( $arglist[1], $arglist[2] );
5598
  case 'RDATE':
5599
+ return $this->setRdate( $arglist[1], $arglist[2], $arglist[3] );
5600
  case 'RECURRENCE-ID':
5601
+ return $this->setRecurrenceid( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8] );
5602
  case 'RELATED-TO':
5603
+ return $this->setRelatedTo( $arglist[1], $arglist[2], $arglist[3] );
5604
  case 'REPEAT':
5605
+ return $this->setRepeat( $arglist[1], $arglist[2] );
5606
  case 'REQUEST-STATUS':
5607
+ return $this->setRequestStatus( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5] );
5608
  case 'RESOURCES':
5609
+ return $this->setResources( $arglist[1], $arglist[2], $arglist[3] );
5610
  case 'RRULE':
5611
+ return $this->setRrule( $arglist[1], $arglist[2], $arglist[3] );
5612
  case 'SEQUENCE':
5613
+ return $this->setSequence( $arglist[1], $arglist[2] );
5614
  case 'STATUS':
5615
+ return $this->setStatus( $arglist[1], $arglist[2] );
5616
  case 'SUMMARY':
5617
+ return $this->setSummary( $arglist[1], $arglist[2] );
5618
  case 'TRANSP':
5619
+ return $this->setTransp( $arglist[1], $arglist[2] );
5620
  case 'TRIGGER':
5621
+ return $this->setTrigger( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8], $arglist[9], $arglist[10], $arglist[11] );
5622
  case 'TZID':
5623
+ return $this->setTzid( $arglist[1], $arglist[2] );
5624
  case 'TZNAME':
5625
+ return $this->setTzname( $arglist[1], $arglist[2], $arglist[3] );
5626
  case 'TZOFFSETFROM':
5627
+ return $this->setTzoffsetfrom( $arglist[1], $arglist[2] );
5628
  case 'TZOFFSETTO':
5629
+ return $this->setTzoffsetto( $arglist[1], $arglist[2] );
5630
  case 'TZURL':
5631
+ return $this->setTzurl( $arglist[1], $arglist[2] );
5632
  case 'UID':
5633
+ return $this->setUid( $arglist[1], $arglist[2] );
5634
  case 'URL':
5635
+ return $this->setUrl( $arglist[1], $arglist[2] );
5636
  default:
5637
+ return $this->setXprop( $arglist[0], $arglist[1], $arglist[2] );
5638
  }
5639
  return FALSE;
5640
  }
5643
  * parse component unparsed data into properties
5644
  *
5645
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
5646
+ * @since 2.18.16 - 2014-04-04
5647
  * @param mixed $unparsedtext, optional, strict rfc2445 formatted, single property string or array of strings
5648
  * @return bool FALSE if error occurs during parsing
 
5649
  */
5650
  function parse( $unparsedtext=null ) {
5651
  $nl = $this->getConfig( 'nl' );
5652
  if( !empty( $unparsedtext )) {
5653
  if( is_array( $unparsedtext ))
5654
  $unparsedtext = implode( '\n'.$nl, $unparsedtext );
5655
+ $unparsedtext = iCalUtilityFunctions::convEolChar( $unparsedtext, $nl );
5656
  }
5657
  elseif( !isset( $this->unparsed ))
5658
  $unparsedtext = array();
5731
  $proprows[] = $line;
5732
  }
5733
  /* parse each property 'line' */
 
 
 
5734
  foreach( $proprows as $line ) {
5735
  if( '\n' == substr( $line, -2 ))
5736
  $line = substr( $line, 0, -2 );
5753
  /* rest of the line is opt.params and value */
5754
  $line = substr( $line, $cix );
5755
  /* separate attributes from value */
5756
+ iCalUtilityFunctions::_splitContent( $line, $propAttr );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5757
  /* call setProperty( $propname.. . */
5758
  switch( strtoupper( $propname )) {
5759
  case 'ATTENDEE':
5760
+ foreach( $propAttr as $pix => $attr ) {
5761
  if( !in_array( strtoupper( $pix ), array( 'MEMBER', 'DELEGATED-TO', 'DELEGATED-FROM' )))
5762
  continue;
5763
  $attr2 = explode( ',', $attr );
5764
  if( 1 < count( $attr2 ))
5765
+ $propAttr[$pix] = $attr2;
5766
  }
5767
+ $this->setProperty( $propname, $line, $propAttr );
5768
  break;
 
 
 
5769
  case 'CATEGORIES':
5770
  case 'RESOURCES':
5771
  if( FALSE !== strpos( $line, ',' )) {
5783
  if( 1 < count( $content )) {
5784
  $content = array_values( $content );
5785
  foreach( $content as $cix => $contentPart )
5786
+ $content[$cix] = iCalUtilityFunctions::_strunrep( $contentPart );
5787
+ $this->setProperty( $propname, $content, $propAttr );
5788
  break;
5789
  }
5790
  else
5796
  case 'LOCATION':
5797
  case 'SUMMARY':
5798
  if( empty( $line ))
5799
+ $propAttr = null;
5800
+ $this->setProperty( $propname, iCalUtilityFunctions::_strunrep( $line ), $propAttr );
5801
  break;
5802
  case 'REQUEST-STATUS':
5803
  $values = explode( ';', $line, 3 );
5804
+ $values[1] = ( !isset( $values[1] )) ? null : iCalUtilityFunctions::_strunrep( $values[1] );
5805
+ $values[2] = ( !isset( $values[2] )) ? null : iCalUtilityFunctions::_strunrep( $values[2] );
5806
  $this->setProperty( $propname
5807
  , $values[0] // statcode
5808
  , $values[1] // statdesc
5809
  , $values[2] // extdata
5810
+ , $propAttr );
5811
  break;
5812
  case 'FREEBUSY':
5813
+ $fbtype = ( isset( $propAttr['FBTYPE'] )) ? $propAttr['FBTYPE'] : ''; // force setting default, if missing
5814
+ unset( $propAttr['FBTYPE'] );
5815
  $values = explode( ',', $line );
5816
  foreach( $values as $vix => $value ) {
5817
  $value2 = explode( '/', $value );
5818
  if( 1 < count( $value2 ))
5819
  $values[$vix] = $value2;
5820
  }
5821
+ $this->setProperty( $propname, $fbtype, $values, $propAttr );
5822
  break;
5823
  case 'GEO':
5824
  $value = explode( ';', $line, 2 );
5825
  if( 2 > count( $value ))
5826
  $value[1] = null;
5827
+ $this->setProperty( $propname, $value[0], $value[1], $propAttr );
5828
  break;
5829
  case 'EXDATE':
5830
  $values = ( !empty( $line )) ? explode( ',', $line ) : null;
5831
+ $this->setProperty( $propname, $values, $propAttr );
5832
  break;
5833
  case 'RDATE':
5834
  if( empty( $line )) {
5835
+ $this->setProperty( $propname, $line, $propAttr );
5836
  break;
5837
  }
5838
  $values = explode( ',', $line );
5841
  if( 1 < count( $value2 ))
5842
  $values[$vix] = $value2;
5843
  }
5844
+ $this->setProperty( $propname, $values, $propAttr );
5845
  break;
5846
  case 'EXRULE':
5847
  case 'RRULE':
5900
  }
5901
  } // end - switch $rulelabel
5902
  } // end - foreach( $values.. .
5903
+ $this->setProperty( $propname, $recur, $propAttr );
5904
  break;
5905
+ case 'X-':
5906
+ $propname = ( isset( $propname2 )) ? $propname2 : $propname;
5907
+ unset( $propname2 );
5908
  case 'ACTION':
5909
  case 'CLASSIFICATION':
5910
  case 'STATUS':
5913
  case 'TZID':
5914
  case 'RELATED-TO':
5915
  case 'TZNAME':
5916
+ $line = iCalUtilityFunctions::_strunrep( $line );
5917
  default:
5918
+ $this->setProperty( $propname, $line, $propAttr );
5919
  break;
5920
  } // end switch( $propname.. .
5921
  } // end - foreach( $proprows.. .
6180
  }
6181
  return $output;
6182
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6183
  }
6184
  /*********************************************************************************/
6185
  /*********************************************************************************/
6863
  * 20111223 - move iCalUtilityFunctions class to the end of the iCalcreator class file
6864
  *
6865
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
6866
+ * @since 2.18.10 - 2013-09-02
 
6867
  */
6868
  class iCalUtilityFunctions {
6869
  // Store the single instance of iCalUtilityFunctions
6873
  private function __construct() {
6874
  $m_pInstance = FALSE;
6875
  }
6876
+ // tmp line delimiter, used in convEolChar (parse)
6877
+ private static $baseDelim = null;
6878
+ // output format for geo latitude and longitude (before rtrim)
6879
+ public static $geoLatFmt = '%09.6f';
6880
+ public static $geoLongFmt = '%8.6f';
6881
 
6882
  // Getter method for creating/returning the single instance of this class
6883
  public static function getInstance() {
6890
  * ensures internal date-time/date format (keyed array) for an input date-time/date array (keyed or unkeyed)
6891
  *
6892
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
6893
+ * @since 2.16.24 - 2013-06-26
6894
  * @param array $datetime
6895
  * @param int $parno optional, default FALSE
6896
  * @return array
6900
  }
6901
  public static function _chkDateArr( $datetime, $parno=FALSE ) {
6902
  $output = array();
6903
+ if(( !$parno || ( 6 <= $parno )) && isset( $datetime[3] ) && !isset( $datetime[4] )) { // Y-m-d with tz
6904
+ $temp = $datetime[3];
6905
+ $datetime[3] = $datetime[4] = $datetime[5] = 0;
6906
+ $datetime[6] = $temp;
6907
+ }
6908
  foreach( $datetime as $dateKey => $datePart ) {
6909
  switch ( $dateKey ) {
6910
  case '0': case 'year': $output['year'] = $datePart; break;
6988
  $parno = 6;
6989
  }
6990
  }
6991
+ /**
6992
+ * vcalendar sort callback function
6993
+ *
6994
+ * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
6995
+ * @since 2.16.2 - 2012-12-17
6996
+ * @param array $a
6997
+ * @param array $b
6998
+ * @return int
6999
+ */
7000
+ public static function _cmpfcn( $a, $b ) {
7001
+ if( empty( $a )) return -1;
7002
+ if( empty( $b )) return 1;
7003
+ if( 'vtimezone' == $a->objName ) {
7004
+ if( 'vtimezone' != $b->objName ) return -1;
7005
+ elseif( $a->srtk[0] <= $b->srtk[0] ) return -1;
7006
+ else return 1;
7007
+ }
7008
+ elseif( 'vtimezone' == $b->objName ) return 1;
7009
+ $sortkeys = array( 'year', 'month', 'day', 'hour', 'min', 'sec' );
7010
+ for( $k = 0; $k < 4 ; $k++ ) {
7011
+ if( empty( $a->srtk[$k] )) return -1;
7012
+ elseif( empty( $b->srtk[$k] )) return 1;
7013
+ if( is_array( $a->srtk[$k] )) {
7014
+ if( is_array( $b->srtk[$k] )) {
7015
+ foreach( $sortkeys as $key ) {
7016
+ if ( !isset( $a->srtk[$k][$key] )) return -1;
7017
+ elseif( !isset( $b->srtk[$k][$key] )) return 1;
7018
+ if ( empty( $a->srtk[$k][$key] )) return -1;
7019
+ elseif( empty( $b->srtk[$k][$key] )) return 1;
7020
+ if ( $a->srtk[$k][$key] == $b->srtk[$k][$key])
7021
+ continue;
7022
+ if (( (int) $a->srtk[$k][$key] ) < ((int) $b->srtk[$k][$key] ))
7023
+ return -1;
7024
+ elseif(( (int) $a->srtk[$k][$key] ) > ((int) $b->srtk[$k][$key] ))
7025
+ return 1;
7026
+ }
7027
+ }
7028
+ else return -1;
7029
+ }
7030
+ elseif( is_array( $b->srtk[$k] )) return 1;
7031
+ elseif( $a->srtk[$k] < $b->srtk[$k] ) return -1;
7032
+ elseif( $a->srtk[$k] > $b->srtk[$k] ) return 1;
7033
+ }
7034
+ return 0;
7035
+ }
7036
  /**
7037
  * byte oriented line folding fix
7038
  *
7041
  * takes care of '\r\n', '\r' and '\n' and mixed '\r\n'+'\r', '\r\n'+'\n'
7042
  *
7043
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
7044
+ * @since 2.18.16 - 2014-04-04
7045
  * @param string $text
7046
  * @param string $nl
7047
  * @return string
7048
  */
7049
  public static function convEolChar( & $text, $nl ) {
7050
+ /* fix dummy line separator */
7051
+ if( empty( iCalUtilityFunctions::$baseDelim )) {
7052
+ iCalUtilityFunctions::$baseDelim = substr( microtime(), 2, 4 );
7053
+ $base = 'aAbB!cCdD"eEfF#gGhHiIjJ%kKlL&mMnN/oOpP(rRsS)tTuU=vVxX?uUvV*wWzZ-1234_5678|90';
7054
+ $len = strlen( $base ) - 1;
7055
+ for( $p = 0; $p < 6; $p++ )
7056
+ iCalUtilityFunctions::$baseDelim .= $base{mt_rand( 0, $len )};
7057
+ }
7058
+ /* fix eol chars */
7059
+ $text = str_replace( array( "\r\n", "\n\r", "\n", "\r" ), iCalUtilityFunctions::$baseDelim, $text );
7060
+ /* fix empty lines */
7061
+ $text = str_replace( iCalUtilityFunctions::$baseDelim.iCalUtilityFunctions::$baseDelim, iCalUtilityFunctions::$baseDelim.str_pad( '', 75 ).iCalUtilityFunctions::$baseDelim, $text );
7062
+ /* fix line folding */
7063
+ $text = str_replace( iCalUtilityFunctions::$baseDelim, $nl, $text );
7064
+ $text = str_replace( array( $nl.' ', $nl."\t" ), '', $text );
7065
+ /* split in component/property lines */
7066
+ $text = explode( $nl, $text );
7067
+ return $text;
 
 
7068
  }
7069
  /**
7070
  * create a calendar timezone and standard/daylight components
7088
  * END:VTIMEZONE
7089
  *
7090
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
7091
+ * @since 2.18.17 - 2013-12-22
7092
  * Generates components for all transitions in a date range, based on contribution by Yitzchok Lavi <icalcreator@onebigsystem.com>
7093
  * Additional changes jpirkey
7094
  * @param object $calendar, reference to an iCalcreator calendar instance
7121
  else {
7122
  $from = reset( $dates ); // set lowest date to the lowest dtstart date
7123
  $dateFrom = new DateTime( $from.'T000000', $dtz );
7124
+ $dateFrom->modify( '-7 month' ); // set $dateFrom to seven month before the lowest date
7125
  $dateFrom->setTimezone( $utcTz ); // convert local date to UTC
7126
  }
7127
  $dateFromYmd = $dateFrom->format('Y-m-d' );
7130
  else {
7131
  $to = end( $dates ); // set highest date to the highest dtstart date
7132
  $dateTo = new DateTime( $to.'T235959', $dtz );
7133
+ $dateTo->modify( '+7 month' ); // set $dateTo to seven month after the highest date
7134
  $dateTo->setTimezone( $utcTz ); // convert local date to UTC
7135
  }
7136
  $dateToYmd = $dateTo->format('Y-m-d' );
7205
  }
7206
  }
7207
  unset( $transitions, $date, $prevTrans );
7208
+ foreach( $transTemp as $tix => $trans ) { // create standard/daylight subcomponents
7209
  $type = ( TRUE !== $trans['isdst'] ) ? 'standard' : 'daylight';
7210
  $scomp = & $tz->newComponent( $type );
7211
  $scomp->setProperty( 'dtstart', $trans['time'] );
7259
  $offset = iCalUtilityFunctions::_tz2offset( $datetime['tz'] );
7260
  try {
7261
  $d = new DateTime( $output, new DateTimeZone( 'UTC' ));
7262
+ if( 0 != $offset ) // adjust för offset
7263
  $d->modify( "$offset seconds" );
7264
  $output = $d->format( 'Ymd\THis' );
7265
  }
7315
  * ensures internal duration format for input in array format
7316
  *
7317
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
7318
+ * @since 2.19.4 - 2014-03-14
7319
  * @param array $duration
7320
  * @return array
7321
  */
7323
  return iCalUtilityFunctions::_duration2arr( $duration );
7324
  }
7325
  public static function _duration2arr( $duration ) {
7326
+ $seconds = 0;
7327
+ foreach( $duration as $durKey => $durValue ) {
7328
+ if( empty( $durValue )) continue;
7329
+ switch ( $durKey ) {
7330
+ case '0': case 'week':
7331
+ $seconds += (((int) $durValue ) * 60 * 60 * 24 * 7 );
7332
+ break;
7333
+ case '1': case 'day':
7334
+ $seconds += (((int) $durValue ) * 60 * 60 * 24 );
7335
+ break;
7336
+ case '2': case 'hour':
7337
+ $seconds += (((int) $durValue ) * 60 * 60 );
7338
+ break;
7339
+ case '3': case 'min':
7340
+ $seconds += (((int) $durValue ) * 60 );
7341
+ break;
7342
+ case '4': case 'sec':
7343
+ $seconds += (int) $durValue;
7344
+ break;
 
 
 
 
 
 
7345
  }
7346
  }
7347
+ $output = array();
7348
+ $output['week'] = (int) floor( $seconds / ( 60 * 60 * 24 * 7 ));
7349
+ if(( 0 < $output['week'] ) && ( 0 == ( $seconds % ( 60 * 60 * 24 * 7 ))))
7350
  return $output;
 
7351
  unset( $output['week'] );
7352
+ $output['day'] = (int) floor( $seconds / ( 60 * 60 * 24 ));
7353
+ $seconds = ( $seconds % ( 60 * 60 * 24 ));
7354
+ $output['hour'] = (int) floor( $seconds / ( 60 * 60 ));
7355
+ $seconds = ( $seconds % ( 60 * 60 ));
7356
+ $output['min'] = (int) floor( $seconds / 60 );
7357
+ $output['sec'] = ( $seconds % 60 );
7358
  if( empty( $output['day'] ))
7359
  unset( $output['day'] );
7360
+ if(( 0 == $output['hour'] ) && ( 0 == $output['min'] ) && ( 0 == $output['sec'] ))
7361
+ unset( $output['hour'], $output['min'], $output['sec'] );
 
 
 
 
 
7362
  return $output;
7363
  }
7364
  /**
7510
  }
7511
  return $elseVal;
7512
  }
7513
+ /**
7514
+ * mgnt geo part output
7515
+ *
7516
+ * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
7517
+ * @since 2.8.10 - 2013-09-02
7518
+ * @param float $ll
7519
+ * @return string
7520
+ */
7521
+ public static function _geo2str2( $ll, $format ) {
7522
+ if( 0.0 < $ll )
7523
+ $sign = '+';
7524
+ else
7525
+ $sign = ( 0.0 > $ll ) ? '-' : '';
7526
+ return rtrim( rtrim( $sign.sprintf( $format, abs( $ll )), '0' ), '.' );
7527
+ }
7528
  /**
7529
  * checks if input contains a (array formatted) date/time
7530
  *
7531
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
7532
+ * @since 2.16.24 - 2013-07-02
7533
  * @param array $input
7534
  * @return bool
7535
  */
7536
  public static function _isArrayDate( $input ) {
7537
+ if( !is_array( $input ) || isset( $input['week'] ) || isset( $input['timestamp'] ) || ( 3 > count( $input )))
 
 
7538
  return FALSE;
7539
  if( 7 == count( $input ))
7540
  return TRUE;
7542
  return checkdate( (int) $input['month'], (int) $input['day'], (int) $input['year'] );
7543
  if( isset( $input['day'] ) || isset( $input['hour'] ) || isset( $input['min'] ) || isset( $input['sec'] ))
7544
  return FALSE;
7545
+ if(( 0 == $input[0] ) || ( 0 == $input[1] ) || ( 0 == $input[2] ))
7546
  return FALSE;
7547
  if(( 1970 > $input[0] ) || ( 12 < $input[1] ) || ( 31 < $input[2] ))
7548
  return FALSE;
7549
  if(( isset( $input[0] ) && isset( $input[1] ) && isset( $input[2] )) &&
7550
+ checkdate((int) $input[1], (int) $input[2], (int) $input[0] ))
7551
  return TRUE;
7552
  $input = iCalUtilityFunctions::_strdate2date( $input[1].'/'.$input[2].'/'.$input[0], 3 ); // m - d - Y
7553
  if( isset( $input['year'] ) && isset( $input['month'] ) && isset( $input['day'] ))
7698
  *
7699
  * if missing, UNTIL is set 1 year from startdate (emergency break)
7700
  *
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7701
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
7702
  * @since 2.10.19 - 2011-10-31
7703
  * @param array $result, array to update, array([timestamp] => timestamp)
7717
  $enddate = $startdate;
7718
  $enddate['year'] += 1;
7719
  }
7720
+ // echo "recur __in_ comp start ".implode('-',$wdate)." period start ".implode('-',$startdate)." period end ".implode('-',$enddate)."<br>\n";print_r($recur);echo "<br>\n";//test###
7721
  $endDatets = iCalUtilityFunctions::_date2timestamp( $enddate ); // fix break
7722
  if( !isset( $recur['COUNT'] ) && !isset( $recur['UNTIL'] ))
7723
  $recur['UNTIL'] = $enddate; // create break
7731
  $recur['UNTIL'] = iCalUtilityFunctions::_timestamp2date( $endDatets, 6 );
7732
  }
7733
  if( $wdatets > $endDatets ) {
7734
+ // echo "recur out of date ".date('Y-m-d H:i:s',$wdatets)."<br>\n";//test
7735
  return array(); // nothing to do.. .
7736
  }
7737
  if( !isset( $recur['FREQ'] )) // "MUST be specified.. ."
7764
  }
7765
  if( isset( $recur['BYSETPOS'] )) { // save start date + weekno
7766
  $bysetposymd1 = $bysetposymd2 = $bysetposw1 = $bysetposw2 = array();
7767
+ // echo "bysetposXold_start=$bysetposYold $bysetposMold $bysetposDold<br>\n"; // test ###
7768
  if( is_array( $recur['BYSETPOS'] )) {
7769
  foreach( $recur['BYSETPOS'] as $bix => $bval )
7770
  $recur['BYSETPOS'][$bix] = (int) $bval;
7783
  }
7784
  else
7785
  iCalUtilityFunctions::_stepdate( $enddate, $endDatets, $step); // make sure to count whole last period
7786
+ // echo "BYSETPOS endDat++ =".implode('-',$enddate).' step='.var_export($step,TRUE)."<br>\n";//test###
7787
  $bysetposWold = (int) date( 'W', ( $wdatets + $wkst ));
7788
  $bysetposYold = $wdate['year'];
7789
  $bysetposMold = $wdate['month'];
7794
  $year_old = null;
7795
  $daynames = array( 'SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA' );
7796
  /* MAIN LOOP */
7797
+ // echo "recur start ".implode('-',$wdate)." end ".implode('-',$enddate)."<br>\n";//test
7798
  while( TRUE ) {
7799
  if( isset( $endDatets ) && ( $wdatets > $endDatets ))
7800
  break;
7884
  if(( $recur['INTERVAL'] != $intervalarr[$intervalix] ) &&
7885
  ( 0 != $intervalarr[$intervalix] )) {
7886
  /* step up date */
7887
+ // echo "skip: ".implode('-',$wdate)." ix=$intervalix old=$currentKey interval=".$intervalarr[$intervalix]."<br>\n";//test
7888
  iCalUtilityFunctions::_stepdate( $wdate, $wdatets, $step);
7889
  continue;
7890
  }
7891
  else // continue within the selected interval
7892
  $intervalarr[$intervalix] = 0;
7893
+ // echo "cont: ".implode('-',$wdate)." ix=$intervalix old=$currentKey interval=".$intervalarr[$intervalix]."<br>\n";//test
7894
  }
7895
  $updateOK = TRUE;
7896
  if( $updateOK && isset( $recur['BYMONTH'] ))
7909
  $updateOK = iCalUtilityFunctions::_recurBYcntcheck( $recur['BYMONTHDAY']
7910
  , $wdate['day']
7911
  , $daycnts[$wdate['month']][$wdate['day']]['monthcnt_down'] );
7912
+ // echo "efter BYMONTHDAY: ".implode('-',$wdate).' status: '; echo ($updateOK) ? 'TRUE' : 'FALSE'; echo "<br>\n";//test###
7913
  if( $updateOK && isset( $recur['BYDAY'] )) {
7914
  $updateOK = FALSE;
7915
  $m = $wdate['month'];
7932
  if(( $daynoexists && $daynosw && $daynamesw ) ||
7933
  ( !$daynoexists && !$daynosw && $daynamesw )) {
7934
  $updateOK = TRUE;
7935
+ // echo "m=$m d=$d day=".$daycnts[$m][$d]['DAY']." yeardayno_up=".$daycnts[$m][$d]['yeardayno_up']." daynoexists:$daynoexists daynosw:$daynosw daynamesw:$daynamesw updateOK:$updateOK<br>\n"; // test ###
7936
  }
7937
+ // echo "m=$m d=$d day=".$daycnts[$m][$d]['DAY']." yeardayno_up=".$daycnts[$m][$d]['yeardayno_up']." daynoexists:$daynoexists daynosw:$daynosw daynamesw:$daynamesw updateOK:$updateOK<br>\n"; // test ###
7938
  }
7939
  else {
7940
  foreach( $recur['BYDAY'] as $bydayvalue ) {
7954
  , $daycnts[$m][$d]['yeardayno_up']
7955
  , $daycnts[$m][$d]['yeardayno_down'] );
7956
  }
7957
+ // echo "daynoexists:$daynoexists daynosw:$daynosw daynamesw:$daynamesw<br>\n"; // test ###
7958
  if(( $daynoexists && $daynosw && $daynamesw ) ||
7959
  ( !$daynoexists && !$daynosw && $daynamesw )) {
7960
  $updateOK = TRUE;
7963
  }
7964
  }
7965
  }
7966
+ // echo "efter BYDAY: ".implode('-',$wdate).' status: '; echo ($updateOK) ? 'TRUE' : 'FALSE'; echo "<br>\n"; // test ###
7967
  /* check BYSETPOS */
7968
  if( $updateOK ) {
7969
  if( isset( $recur['BYSETPOS'] ) &&
7984
  (( $bysetposYold == $wdate['year'] ) &&
7985
  ( $bysetposMold == $wdate['month']) &&
7986
  ( $bysetposDold == $wdate['day'] )))) {
7987
+ // echo "bysetposymd1[]=".date('Y-m-d H:i:s',$wdatets)."<br>\n";//test
7988
  $bysetposymd1[] = $wdatets;
7989
  }
7990
  else {
7991
+ // echo "bysetposymd2[]=".date('Y-m-d H:i:s',$wdatets)."<br>\n";//test
7992
  $bysetposymd2[] = $wdatets;
7993
  }
7994
  }
7998
  $countcnt++;
7999
  if( $startdatets <= $wdatets ) { // only output within period
8000
  $result[$wdatets] = TRUE;
8001
+ // echo "recur ".date('Y-m-d H:i:s',$wdatets)."<br>\n";//test
8002
  }
8003
+ // echo "recur undate ".date('Y-m-d H:i:s',$wdatets)." okdatstart ".date('Y-m-d H:i:s',$startdatets)."<br>\n";//test
8004
  $updateOK = FALSE;
8005
  }
8006
  }
8045
  $bysetposarr1 = & $bysetposymd1;
8046
  $bysetposarr2 = & $bysetposymd2;
8047
  }
8048
+ // echo 'test före out startYMD (weekno)='.$wdateStart['year'].':'.$wdateStart['month'].':'.$wdateStart['day']." ($weekStart) "; // test ###
8049
  foreach( $recur['BYSETPOS'] as $ix ) {
8050
  if( 0 > $ix ) // both positive and negative BYSETPOS allowed
8051
  $ix = ( count( $bysetposarr1 ) + $ix + 1);
8063
  if( isset( $recur['COUNT'] ) && ( $countcnt >= $recur['COUNT'] ))
8064
  break;
8065
  }
8066
+ // echo "<br>\n"; // test ###
8067
  $bysetposarr1 = $bysetposarr2;
8068
  $bysetposarr2 = array();
8069
  }
8099
  }
8100
  return $intervalix;
8101
  }
8102
+ public static function _recurBydaySort( $bydaya, $bydayb ) {
8103
+ static $days = array( 'SU' => 0, 'MO' => 1, 'TU' => 2, 'WE' => 3, 'TH' => 4, 'FR' => 5, 'SA' => 6 );
8104
+ return ( $days[substr( $bydaya, -2 )] < $days[substr( $bydayb, -2 )] ) ? -1 : 1;
8105
+ }
8106
+ /**
8107
+ * helper function for vcalendar::selectComponents, set property X-CURRENT-DTEND/DUE
8108
+ *
8109
+ * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
8110
+ * @since 2.18.7 - 2013-08-30
8111
+ * @param object $comp component to update
8112
+ * @param array $dateFormat
8113
+ * @param int $timestamp1
8114
+ * @param string $cmpYMD1 date('Ymd') related to $timestamp1
8115
+ * @param int $timestamp2
8116
+ * @param string $cmpYMD2 date('Ymd') related to $timestamp2
8117
+ * @param array $tz date array opt. with key for 'tz'
8118
+ * @param array $SCbools (end) date booleans
8119
+ * @return void
8120
+ */
8121
+ static function _SCsetXCurrentEnd( $comp, $dateFormat, $timestamp1, $cmpYMD1, $timestamp2, $cmpYMD2, $tz, $SCbools ) {
8122
+ if( ! $SCbools[ 'dtendExist'] && ! $SCbools[ 'dueExist'] && ! $SCbools[ 'durationExist'] )
8123
+ return;
8124
+ $H = ( $cmpYMD1 < $cmpYMD2 ) ? 23 : date( 'H', $timestamp2 );
8125
+ $i = ( $cmpYMD1 < $cmpYMD2 ) ? 59 : date( 'i', $timestamp2 );
8126
+ $s = ( $cmpYMD1 < $cmpYMD2 ) ? 59 : date( 's', $timestamp2 );
8127
+ $tend = mktime( $H, $i, $s, date( 'm', $timestamp1 ), date( 'd', $timestamp1 ), date( 'Y', $timestamp1 ) ); // on a day-basis !!!
8128
+ if( $SCbools[ 'endAllDayEvent'] && $SCbools[ 'dtendExist'] )
8129
+ $tend += ( 24 * 3600 ); // alldaysevents has an end date 'day after' meaning this day
8130
+ $datestring = date( $dateFormat['end'], $tend );
8131
+ if( isset( $tz['tz'] ))
8132
+ $datestring .= ' '.$tz['tz'];
8133
+ $propName = ( ! $SCbools[ 'dueExist'] ) ? 'X-CURRENT-DTEND' : 'X-CURRENT-DUE';
8134
+ $comp->setProperty( $propName, $datestring );
8135
+ }
8136
+ /**
8137
+ * helper function for vcalendar::selectComponents, set property X-CURRENT-DTSTART
8138
+ *
8139
+ * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
8140
+ * @since 2.18.7 - 2013-08-30
8141
+ * @param object $comp component to update
8142
+ * @param array $dateFormat
8143
+ * @param int $timestamp1
8144
+ * @param string $cpmYMD1 date('Ymd') related to $timestamp1
8145
+ * @param int $timestamp2
8146
+ * @param string $cpmYMD2 date('Ymd') related to $timestamp2
8147
+ * @param array $tz date array opt. with key for 'tz'
8148
+ * @return void
8149
+ */
8150
+ static function _SCsetXCurrentStart( $comp, $dateFormat, $timestamp1, $cpmYMD1=FALSE, $timestamp2=FALSE, $cpmYMD2=FALSE, $tz=FALSE ) {
8151
+ if( $cpmYMD2 && ( $cpmYMD1 <= $cpmYMD2 )) // check date after dtstart
8152
+ $timestamp1 = $timestamp2;
8153
+ $datestring = date( $dateFormat['start'], $timestamp1 );
8154
+ if( isset( $tz['tz'] ))
8155
+ $datestring .= ' '.$tz['tz'];
8156
+ $comp->setProperty( 'X-CURRENT-DTSTART', $datestring );
8157
+ }
8158
+ /**
8159
+ * helper function for vcalendar::selectComponents, adjust UTC X-CURRENT-x date
8160
+ *
8161
+ * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
8162
+ * @since 2.18.19 - 2014-02-01
8163
+ * @param int $timestamp
8164
+ * @param array $tz date array opt. with key for 'tz'
8165
+ * @return int
8166
+ */
8167
+ static function _SCsetXCurrentDateZ( $timestamp, $tz=array()) {
8168
+ if( ! is_array( $tz ) || ! isset( $tz['tz'] ))
8169
+ return $timestamp;
8170
+ $tz['tz'] = strtoupper( $tz['tz'] );
8171
+ if(( 'Z' == $tz['tz'] ) ||( 'UTC' == $tz['tz'] ) ||( 'GMT' == $tz['tz'] ))
8172
+ $timestamp -= date( 'Z', $timestamp );
8173
+ return $timestamp;
8174
+ }
8175
  /**
8176
  * convert input format for exrule and rrule to internal format
8177
  *
8178
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
8179
+ * @since 2.18.10 - 2013-09-04
8180
  * @param array $rexrule
8181
  * @return array
8182
  */
8184
  $input = array();
8185
  if( empty( $rexrule ))
8186
  return $input;
8187
+ $rexrule = array_change_key_case( $rexrule, CASE_UPPER );
8188
  foreach( $rexrule as $rexrulelabel => $rexrulevalue ) {
 
8189
  if( 'UNTIL' != $rexrulelabel )
8190
  $input[$rexrulelabel] = $rexrulevalue;
8191
  else {
8266
  * convert format for input date to internal date with parameters
8267
  *
8268
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
8269
+ * @since 2.16.24 - 2013-06-26
8270
  * @param mixed $year
8271
  * @param mixed $month optional
8272
  * @param int $day optional
8285
  $localtime = (( 'dtstart' == $caller ) && in_array( $objName, array( 'vtimezone', 'standard', 'daylight' ))) ? TRUE : FALSE;
8286
  iCalUtilityFunctions::_strDate2arr( $year );
8287
  if( iCalUtilityFunctions::_isArrayDate( $year )) {
8288
+ $input['value'] = iCalUtilityFunctions::_chkDateArr( $year, FALSE ); //$parno );
8289
  if( 100 > $input['value']['year'] )
8290
  $input['value']['year'] += 2000;
8291
  if( $localtime )
8294
  $month['TZID'] = $tzid;
8295
  if( isset( $input['value']['tz'] ) && iCalUtilityFunctions::_isOffset( $input['value']['tz'] ))
8296
  unset( $month['TZID'] );
8297
+ elseif( !isset( $input['value']['tz'] ) && isset( $month['TZID'] ) && iCalUtilityFunctions::_isOffset( $month['TZID'] )) {
8298
  $input['value']['tz'] = $month['TZID'];
8299
  unset( $month['TZID'] );
8300
  }
8302
  $hitval = ( isset( $input['value']['tz'] )) ? 7 : 6;
8303
  $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME', $hitval );
8304
  $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE', 3, count( $input['value'] ), $parno );
8305
+ if( 6 > $parno )
8306
+ unset( $input['value']['tz'], $input['params']['TZID'], $tzid );
8307
+ if(( 6 <= $parno ) && isset( $input['value']['tz'] ) && ( 'Z' != $input['value']['tz'] ) && iCalUtilityFunctions::_isOffset( $input['value']['tz'] )) {
8308
  $d = $input['value'];
8309
  $strdate = sprintf( '%04d-%02d-%02d %02d:%02d:%02d %s', $d['year'], $d['month'], $d['day'], $d['hour'], $d['min'], $d['sec'], $d['tz'] );
8310
  $input['value'] = iCalUtilityFunctions::_strdate2date( $strdate, $parno );
8321
  $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE', 3 );
8322
  $hitval = 7;
8323
  $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME', $hitval, $parno );
8324
+ if( isset( $year['tz'] ) && !empty( $year['tz'] )) {
8325
+ if( !iCalUtilityFunctions::_isOffset( $year['tz'] )) {
 
 
 
8326
  $input['params']['TZID'] = $year['tz'];
8327
+ unset( $year['tz'], $tzid );
8328
+ }
8329
+ else {
8330
+ if( isset( $input['params']['TZID'] ) && !empty( $input['params']['TZID'] )) {
8331
+ if( !iCalUtilityFunctions::_isOffset( $input['params']['TZID'] ))
8332
+ unset( $tzid );
8333
+ else
8334
+ unset( $input['params']['TZID']);
8335
+ }
8336
+ elseif( isset( $tzid ) && !iCalUtilityFunctions::_isOffset( $tzid ))
8337
+ $input['params']['TZID'] = $tzid;
8338
+ }
8339
  }
8340
+ elseif( isset( $input['params']['TZID'] ) && !empty( $input['params']['TZID'] )) {
 
 
8341
  if( iCalUtilityFunctions::_isOffset( $input['params']['TZID'] )) {
8342
+ $year['tz'] = $input['params']['TZID'];
8343
+ unset( $input['params']['TZID']);
8344
+ if( isset( $tzid ) && !empty( $tzid ) && !iCalUtilityFunctions::_isOffset( $tzid ))
8345
+ $input['params']['TZID'] = $tzid;
8346
+ }
8347
+ }
8348
+ elseif( isset( $tzid ) && !empty( $tzid )) {
8349
+ if( iCalUtilityFunctions::_isOffset( $tzid )) {
8350
+ $year['tz'] = $tzid;
8351
+ unset( $input['params']['TZID']);
8352
  }
8353
+ else
8354
+ $input['params']['TZID'] = $tzid;
8355
  }
8356
  $input['value'] = iCalUtilityFunctions::_timestamp2date( $year, $parno );
8357
  } // end elseif( iCalUtilityFunctions::_isArrayTimestampDate( $year ))
8364
  $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME', 7, $parno );
8365
  $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE', 3, $parno, $parno );
8366
  $input['value'] = iCalUtilityFunctions::_strdate2date( $year, $parno );
8367
+ if( 3 == $parno )
8368
+ unset( $input['value']['tz'], $input['params']['TZID'] );
8369
  unset( $input['value']['unparsedtext'] );
8370
  if( isset( $input['value']['tz'] )) {
8371
  if( iCalUtilityFunctions::_isOffset( $input['value']['tz'] )) {
8472
  * convert format for input date (UTC) to internal date with parameters
8473
  *
8474
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
8475
+ * @since 2.16.24 - 2013-07-01
8476
  * @param mixed $year
8477
  * @param mixed $month optional
8478
  * @param int $day optional
8490
  if( isset( $input['value']['year'] ) && ( 100 > $input['value']['year'] ))
8491
  $input['value']['year'] += 2000;
8492
  $input['params'] = iCalUtilityFunctions::_setParams( $month, array( 'VALUE' => 'DATE-TIME' ));
8493
+ unset( $input['params']['VALUE'] );
8494
+ if( isset( $input['value']['tz'] ) && iCalUtilityFunctions::_isOffset( $input['value']['tz'] ))
8495
+ $tzid = $input['value']['tz'];
8496
+ elseif( isset( $input['params']['TZID'] ) && iCalUtilityFunctions::_isOffset( $input['params']['TZID'] ))
8497
+ $tzid = $input['params']['TZID'];
8498
+ else
8499
+ $tzid = '';
8500
+ unset( $input['params']['VALUE'], $input['params']['TZID'] );
8501
+ if( !empty( $tzid ) && ( 'Z' != $tzid ) && iCalUtilityFunctions::_isOffset( $tzid )) {
8502
  $d = $input['value'];
8503
+ $strdate = sprintf( '%04d-%02d-%02d %02d:%02d:%02d %s', $d['year'], $d['month'], $d['day'], $d['hour'], $d['min'], $d['sec'], $tzid );
8504
  $input['value'] = iCalUtilityFunctions::_strdate2date( $strdate, 7 );
8505
  unset( $input['value']['unparsedtext'] );
8506
  }
8507
  }
8508
  elseif( iCalUtilityFunctions::_isArrayTimestampDate( $year )) {
8509
+ if( isset( $year['tz'] ) && ! iCalUtilityFunctions::_isOffset( $year['tz'] ))
8510
+ $year['tz'] = 'UTC';
8511
+ elseif( isset( $input['params']['TZID'] ) && iCalUtilityFunctions::_isOffset( $input['params']['TZID'] ))
8512
+ $year['tz'] = $input['params']['TZID'];
8513
+ else
8514
+ $year['tz'] = 'UTC';
8515
  $input['value'] = iCalUtilityFunctions::_timestamp2date( $year, 7 );
8516
  $input['params'] = iCalUtilityFunctions::_setParams( $month, array( 'VALUE' => 'DATE-TIME' ));
8517
+ unset( $input['params']['VALUE'], $input['params']['TZID'] );
8518
  }
8519
  elseif( 8 <= strlen( trim( $year ))) { // ex. 2006-08-03 10:12:18
8520
  $input['value'] = iCalUtilityFunctions::_strdate2date( $year, 7 );
8521
  unset( $input['value']['unparsedtext'] );
8522
  $input['params'] = iCalUtilityFunctions::_setParams( $month, array( 'VALUE' => 'DATE-TIME' ));
8523
+ if(( !isset( $input['value']['tz'] ) || empty( $input['value']['tz'] )) && isset( $input['params']['TZID'] ) && iCalUtilityFunctions::_isOffset( $input['params']['TZID'] )) {
8524
+ $d = $input['value'];
8525
+ $strdate = sprintf( '%04d-%02d-%02d %02d:%02d:%02d %s', $d['year'], $d['month'], $d['day'], $d['hour'], $d['min'], $d['sec'], $input['params']['TZID'] );
8526
+ $input['value'] = iCalUtilityFunctions::_strdate2date( $strdate, 7 );
8527
+ unset( $input['value']['unparsedtext'] );
8528
+ }
8529
+ unset( $input['params']['VALUE'], $input['params']['TZID'] );
8530
  }
8531
  else {
8532
  $input['value'] = array( 'year' => $year
8546
  unset( $input['value']['unparsedtext'] );
8547
  }
8548
  $input['params'] = iCalUtilityFunctions::_setParams( $params, array( 'VALUE' => 'DATE-TIME' ));
8549
+ unset( $input['params']['VALUE'] );
8550
  }
8551
  $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME', 7 ); // remove default
8552
  if( !isset( $input['value']['hour'] )) $input['value']['hour'] = 0;
8586
  * default parameters can be set, if missing
8587
  *
8588
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
8589
+ * @since 2.18.10 - 2013-09-04
8590
  * @param array $params
8591
  * @param array $defaults
8592
  * @return array
8594
  public static function _setParams( $params, $defaults=FALSE ) {
8595
  if( !is_array( $params))
8596
  $params = array();
8597
+ $input = array();
8598
+ $params = array_change_key_case( $params, CASE_UPPER );
8599
  foreach( $params as $paramKey => $paramValue ) {
8600
  if( is_array( $paramValue )) {
8601
  foreach( $paramValue as $pkey => $pValue ) {
8605
  }
8606
  elseif(( '"' == substr( $paramValue, 0, 1 )) && ( '"' == substr( $paramValue, -1 )))
8607
  $paramValue = substr( $paramValue, 1, ( strlen( $paramValue ) - 2 ));
8608
+ if( 'VALUE' == $paramKey )
8609
+ $input['VALUE'] = strtoupper( $paramValue );
8610
  else
8611
+ $input[$paramKey] = $paramValue;
8612
  }
8613
  if( is_array( $defaults )) {
8614
  foreach( $defaults as $paramKey => $paramValue ) {
8618
  }
8619
  return (0 < count( $input )) ? $input : null;
8620
  }
8621
+ /**
8622
+ * set sort arguments/parameters in component
8623
+ *
8624
+ *
8625
+ * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
8626
+ * @since 2.18.4 - 2013-08-18
8627
+ * @param object $c valendar component
8628
+ * @param string $sortArg, optional
8629
+ * @return void
8630
+ */
8631
+ public static function _setSortArgs( & $c, $sortArg=FALSE ) {
8632
+ $c->srtk = array( '0', '0', '0', '0' );
8633
+ if( 'vtimezone' == $c->objName ) {
8634
+ if( FALSE === ( $c->srtk[0] = $c->getProperty( 'tzid' )))
8635
+ $c->srtk[0] = 0;
8636
+ return;
8637
+ }
8638
+ elseif( $sortArg ) {
8639
+ if(( 'ATTENDEE' == $sortArg ) || ( 'CATEGORIES' == $sortArg ) || ( 'CONTACT' == $sortArg ) || ( 'RELATED-TO' == $sortArg ) || ( 'RESOURCES' == $sortArg )) {
8640
+ $propValues = array();
8641
+ $c->_getProperties( $sortArg, $propValues );
8642
+ if( !empty( $propValues )) {
8643
+ $sk = array_keys( $propValues );
8644
+ $c->srtk[0] = $sk[0];
8645
+ if( 'RELATED-TO' == $sortArg )
8646
+ $c->srtk[0] .= $c->getProperty( 'uid' );
8647
+ }
8648
+ elseif( 'RELATED-TO' == $sortArg )
8649
+ $c->srtk[0] = $c->getProperty( 'uid' );
8650
+ }
8651
+ elseif( FALSE !== ( $d = $c->getProperty( $sortArg ))) {
8652
+ $c->srtk[0] = $d;
8653
+ if( 'UID' == $sortArg ) {
8654
+ if( FALSE !== ( $d = $c->getProperty( 'recurrence-id' ))) {
8655
+ $c->srtk[1] = iCalUtilityFunctions::_date2strdate( $d );
8656
+ if( FALSE === ( $c->srtk[2] = $c->getProperty( 'sequence' )))
8657
+ $c->srtk[2] = PHP_INT_MAX;
8658
+ }
8659
+ else
8660
+ $c->srtk[1] = $c->srtk[2] = PHP_INT_MAX;
8661
+ }
8662
+ }
8663
+ return;
8664
+ } // end elseif( $sortArg )
8665
+ if( FALSE !== ( $d = $c->getProperty( 'X-CURRENT-DTSTART' ))) {
8666
+ $c->srtk[0] = iCalUtilityFunctions::_strdate2date( $d[1] );
8667
+ unset( $c->srtk[0]['unparsedtext'] );
8668
+ }
8669
+ elseif( FALSE === ( $c->srtk[0] = $c->getProperty( 'dtstart' )))
8670
+ $c->srtk[0] = 0; // sortkey 0 : dtstart
8671
+ if( FALSE !== ( $d = $c->getProperty( 'X-CURRENT-DTEND' ))) {
8672
+ $c->srtk[1] = iCalUtilityFunctions::_strdate2date( $d[1] ); // sortkey 1 : dtend/due(/duration)
8673
+ unset( $c->srtk[1]['unparsedtext'] );
8674
+ }
8675
+ elseif( FALSE === ( $c->srtk[1] = $c->getProperty( 'dtend' ))) {
8676
+ if( FALSE !== ( $d = $c->getProperty( 'X-CURRENT-DUE' ))) {
8677
+ $c->srtk[1] = iCalUtilityFunctions::_strdate2date( $d[1] );
8678
+ unset( $c->srtk[1]['unparsedtext'] );
8679
+ }
8680
+ elseif( FALSE === ( $c->srtk[1] = $c->getProperty( 'due' )))
8681
+ if( FALSE === ( $c->srtk[1] = $c->getProperty( 'duration', FALSE, FALSE, TRUE )))
8682
+ $c->srtk[1] = 0;
8683
+ }
8684
+ if( FALSE === ( $c->srtk[2] = $c->getProperty( 'created' ))) // sortkey 2 : created/dtstamp
8685
+ if( FALSE === ( $c->srtk[2] = $c->getProperty( 'dtstamp' )))
8686
+ $c->srtk[2] = 0;
8687
+ if( FALSE === ( $c->srtk[3] = $c->getProperty( 'uid' ))) // sortkey 3 : uid
8688
+ $c->srtk[3] = 0;
8689
+ }
8690
+ /**
8691
+ * break lines at pos 75
8692
+ *
8693
+ * Lines of text SHOULD NOT be longer than 75 octets, excluding the line
8694
+ * break. Long content lines SHOULD be split into a multiple line
8695
+ * representations using a line "folding" technique. That is, a long
8696
+ * line can be split between any two characters by inserting a CRLF
8697
+ * immediately followed by a single linear white space character (i.e.,
8698
+ * SPACE, US-ASCII decimal 32 or HTAB, US-ASCII decimal 9). Any sequence
8699
+ * of CRLF followed immediately by a single linear white space character
8700
+ * is ignored (i.e., removed) when processing the content type.
8701
+ *
8702
+ * Edited 2007-08-26 by Anders Litzell, anders@litzell.se to fix bug where
8703
+ * the reserved expression "\n" in the arg $string could be broken up by the
8704
+ * folding of lines, causing ambiguity in the return string.
8705
+ *
8706
+ * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
8707
+ * @since 2.16.2 - 2012-12-18
8708
+ * @param string $value
8709
+ * @return string
8710
+ */
8711
+ public static function _size75( $string, $nl ) {
8712
+ $tmp = $string;
8713
+ $string = '';
8714
+ $cCnt = $x = 0;
8715
+ while( TRUE ) {
8716
+ if( !isset( $tmp[$x] )) {
8717
+ $string .= $nl; // loop breakes here
8718
+ break;
8719
+ }
8720
+ elseif(( 74 <= $cCnt ) && ( '\\' == $tmp[$x] ) && ( 'n' == $tmp[$x+1] )) {
8721
+ $string .= $nl.' \n'; // don't break lines inside '\n'
8722
+ $x += 2;
8723
+ if( !isset( $tmp[$x] )) {
8724
+ $string .= $nl;
8725
+ break;
8726
+ }
8727
+ $cCnt = 3;
8728
+ }
8729
+ elseif( 75 <= $cCnt ) {
8730
+ $string .= $nl.' ';
8731
+ $cCnt = 1;
8732
+ }
8733
+ $byte = ord( $tmp[$x] );
8734
+ $string .= $tmp[$x];
8735
+ switch( TRUE ) { // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
8736
+ case(( $byte >= 0x20 ) && ( $byte <= 0x7F )): // characters U-00000000 - U-0000007F (same as ASCII)
8737
+ $cCnt += 1;
8738
+ break; // add a one byte character
8739
+ case(( $byte & 0xE0) == 0xC0 ): // characters U-00000080 - U-000007FF, mask 110XXXXX
8740
+ if( isset( $tmp[$x+1] )) {
8741
+ $cCnt += 1;
8742
+ $string .= $tmp[$x+1];
8743
+ $x += 1; // add a two bytes character
8744
+ }
8745
+ break;
8746
+ case(( $byte & 0xF0 ) == 0xE0 ): // characters U-00000800 - U-0000FFFF, mask 1110XXXX
8747
+ if( isset( $tmp[$x+2] )) {
8748
+ $cCnt += 1;
8749
+ $string .= $tmp[$x+1].$tmp[$x+2];
8750
+ $x += 2; // add a three bytes character
8751
+ }
8752
+ break;
8753
+ case(( $byte & 0xF8 ) == 0xF0 ): // characters U-00010000 - U-001FFFFF, mask 11110XXX
8754
+ if( isset( $tmp[$x+3] )) {
8755
+ $cCnt += 1;
8756
+ $string .= $tmp[$x+1].$tmp[$x+2].$tmp[$x+3];
8757
+ $x += 3; // add a four bytes character
8758
+ }
8759
+ break;
8760
+ case(( $byte & 0xFC ) == 0xF8 ): // characters U-00200000 - U-03FFFFFF, mask 111110XX
8761
+ if( isset( $tmp[$x+4] )) {
8762
+ $cCnt += 1;
8763
+ $string .= $tmp[$x+1].$tmp[$x+2].$tmp[$x+3].$tmp[$x+4];
8764
+ $x += 4; // add a five bytes character
8765
+ }
8766
+ break;
8767
+ case(( $byte & 0xFE ) == 0xFC ): // characters U-04000000 - U-7FFFFFFF, mask 1111110X
8768
+ if( isset( $tmp[$x+5] )) {
8769
+ $cCnt += 1;
8770
+ $string .= $tmp[$x+1].$tmp[$x+2].$tmp[$x+3].$tmp[$x+4].$tmp[$x+5];
8771
+ $x += 5; // add a six bytes character
8772
+ }
8773
+ default: // add any other byte without counting up $cCnt
8774
+ break;
8775
+ } // end switch( TRUE )
8776
+ $x += 1; // next 'byte' to test
8777
+ } // end while( TRUE ) {
8778
+ return $string;
8779
+ }
8780
+ /**
8781
+ * sort callback functions for exdate
8782
+ *
8783
+ * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
8784
+ * @since 2.16.11 - 2013-01-12
8785
+ * @param array $a
8786
+ * @param array $b
8787
+ * @return int
8788
+ */
8789
+ public static function _sortExdate1( $a, $b ) {
8790
+ $as = sprintf( '%04d%02d%02d', $a['year'], $a['month'], $a['day'] );
8791
+ $as .= ( isset( $a['hour'] )) ? sprintf( '%02d%02d%02d', $a['hour'], $a['min'], $a['sec'] ) : '';
8792
+ $bs = sprintf( '%04d%02d%02d', $b['year'], $b['month'], $b['day'] );
8793
+ $bs .= ( isset( $b['hour'] )) ? sprintf( '%02d%02d%02d', $b['hour'], $b['min'], $b['sec'] ) : '';
8794
+ return strcmp( $as, $bs );
8795
+ }
8796
+ public static function _sortExdate2( $a, $b ) {
8797
+ $val = reset( $a['value'] );
8798
+ $as = sprintf( '%04d%02d%02d', $val['year'], $val['month'], $val['day'] );
8799
+ $as .= ( isset( $val['hour'] )) ? sprintf( '%02d%02d%02d', $val['hour'], $val['min'], $val['sec'] ) : '';
8800
+ $val = reset( $b['value'] );
8801
+ $bs = sprintf( '%04d%02d%02d', $val['year'], $val['month'], $val['day'] );
8802
+ $bs .= ( isset( $val['hour'] )) ? sprintf( '%02d%02d%02d', $val['hour'], $val['min'], $val['sec'] ) : '';
8803
+ return strcmp( $as, $bs );
8804
+ }
8805
+ /**
8806
+ * sort callback functions for rdate
8807
+ *
8808
+ * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
8809
+ * @since 2.16.27 - 2013-07-05
8810
+ * @param array $a
8811
+ * @param array $b
8812
+ * @return int
8813
+ */
8814
+ public static function _sortRdate1( $a, $b ) {
8815
+ $val = isset( $a['year'] ) ? $a : $a[0];
8816
+ $as = sprintf( '%04d%02d%02d', $val['year'], $val['month'], $val['day'] );
8817
+ $as .= ( isset( $val['hour'] )) ? sprintf( '%02d%02d%02d', $val['hour'], $val['min'], $val['sec'] ) : '';
8818
+ $val = isset( $b['year'] ) ? $b : $b[0];
8819
+ $bs = sprintf( '%04d%02d%02d', $val['year'], $val['month'], $val['day'] );
8820
+ $bs .= ( isset( $val['hour'] )) ? sprintf( '%02d%02d%02d', $val['hour'], $val['min'], $val['sec'] ) : '';
8821
+ return strcmp( $as, $bs );
8822
+ }
8823
+ public static function _sortRdate2( $a, $b ) {
8824
+ $val = isset( $a['value'][0]['year'] ) ? $a['value'][0] : $a['value'][0][0];
8825
+ if( empty( $val ))
8826
+ $as = '';
8827
+ else {
8828
+ $as = sprintf( '%04d%02d%02d', $val['year'], $val['month'], $val['day'] );
8829
+ $as .= ( isset( $val['hour'] )) ? sprintf( '%02d%02d%02d', $val['hour'], $val['min'], $val['sec'] ) : '';
8830
+ }
8831
+ $val = isset( $b['value'][0]['year'] ) ? $b['value'][0] : $b['value'][0][0];
8832
+ if( empty( $val ))
8833
+ $bs = '';
8834
+ else {
8835
+ $bs = sprintf( '%04d%02d%02d', $val['year'], $val['month'], $val['day'] );
8836
+ $bs .= ( isset( $val['hour'] )) ? sprintf( '%02d%02d%02d', $val['hour'], $val['min'], $val['sec'] ) : '';
8837
+ }
8838
+ return strcmp( $as, $bs );
8839
+ }
8840
+ static $parValPrefix = array ( 'MStz' => array( 'utc-', 'utc+', 'gmt-', 'gmt+' )
8841
+ , 'Proto3' => array( 'fax:', 'cid:', 'sms:', 'tel:', 'urn:' )
8842
+ , 'Proto4' => array( 'crid:', 'news:', 'pres:' )
8843
+ , 'Proto6' => array( 'mailto:' ));
8844
+ /**
8845
+ * separate property attributes from property value
8846
+ *
8847
+ * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
8848
+ * @since 2.18.6 - 2013-08-29
8849
+ * @param string $line, property content
8850
+ * @param array $propAttr property parameters
8851
+ * @return void
8852
+ */
8853
+ public static function _splitContent( & $line, & $propAttr=null ) {
8854
+ $attr = array();
8855
+ $attrix = -1;
8856
+ $clen = strlen( $line );
8857
+ $WithinQuotes = FALSE;
8858
+ $cix = 0;
8859
+ while( FALSE !== substr( $line, $cix, 1 )) {
8860
+ if( ! $WithinQuotes && ( ':' == $line[$cix] ) &&
8861
+ ( substr( $line,$cix, 3 ) != '://' ) &&
8862
+ ( ! in_array( strtolower( substr( $line,$cix - 6, 4 )), iCalUtilityFunctions::$parValPrefix['MStz'] )) &&
8863
+ ( ! in_array( strtolower( substr( $line,$cix - 3, 4 )), iCalUtilityFunctions::$parValPrefix['Proto3'] )) &&
8864
+ ( ! in_array( strtolower( substr( $line,$cix - 4, 5 )), iCalUtilityFunctions::$parValPrefix['Proto4'] )) &&
8865
+ ( ! in_array( strtolower( substr( $line,$cix - 6, 7 )), iCalUtilityFunctions::$parValPrefix['Proto6'] ))) {
8866
+ $attrEnd = TRUE;
8867
+ if(( $cix < ( $clen - 4 )) &&
8868
+ ctype_digit( substr( $line, $cix+1, 4 ))) { // an URI with a (4pos) portnr??
8869
+ for( $c2ix = $cix; 3 < $c2ix; $c2ix-- ) {
8870
+ if( '://' == substr( $line, $c2ix - 2, 3 )) {
8871
+ $attrEnd = FALSE;
8872
+ break; // an URI with a portnr!!
8873
+ }
8874
+ }
8875
+ }
8876
+ if( $attrEnd) {
8877
+ $line = substr( $line, ( $cix + 1 ));
8878
+ break;
8879
+ }
8880
+ $cix++;
8881
+ }
8882
+ if( '"' == $line[$cix] )
8883
+ $WithinQuotes = ! $WithinQuotes;
8884
+ if( ';' == $line[$cix] )
8885
+ $attr[++$attrix] = null;
8886
+ else
8887
+ $attr[$attrix] .= $line[$cix];
8888
+ $cix++;
8889
+ }
8890
+ /* make attributes in array format */
8891
+ $propAttr = array();
8892
+ foreach( $attr as $attribute ) {
8893
+ $attrsplit = explode( '=', $attribute, 2 );
8894
+ if( 1 < count( $attrsplit ))
8895
+ $propAttr[$attrsplit[0]] = $attrsplit[1];
8896
+ }
8897
+ }
8898
  /**
8899
  * step date, return updated date, array and timpstamp
8900
  *
8981
  * ensures internal date-time/date format for input date-time/date in string fromat
8982
  *
8983
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
8984
+ * @since 2.16.24 - 2013-06-26
8985
  * Modified to also return original string value by Yitzchok Lavi <icalcreator@onebigsystem.com>
8986
  * @param array $datetime
8987
  * @param int $parno optional, default FALSE
9003
  $tz = 'Z';
9004
  $datetime = trim( substr( $datetime, 0, ( $len - 1 )));
9005
  $tzSts = TRUE;
 
9006
  }
9007
  if( iCalUtilityFunctions::_isOffset( substr( $datetime, -5, 5 ))) { // [+/-]NNNN offset
9008
  $tz = substr( $datetime, -5, 5 );
9009
  $datetime = trim( substr( $datetime, 0, ($len - 5)));
 
9010
  }
9011
  elseif( iCalUtilityFunctions::_isOffset( substr( $datetime, -7, 7 ))) { // [+/-]NNNNNN offset
9012
  $tz = substr( $datetime, -7, 7 );
9013
  $datetime = trim( substr( $datetime, 0, ($len - 7)));
 
9014
  }
9015
  elseif( empty( $wtz ) && ctype_digit( substr( $datetime, 0, 4 )) && ctype_digit( substr( $datetime, -2, 2 )) && iCalUtilityFunctions::_strDate2arr( $datetime )) {
9016
  $output = $datetime;
9021
  }
9022
  else {
9023
  $cx = $tx = 0; // find any trailing timezone or offset
9024
+ $len = strlen( $datetime );
9025
  for( $cx = -1; $cx > ( 9 - $len ); $cx-- ) {
9026
  $char = substr( $datetime, $cx, 1 );
9027
+ if(( ' ' == $char ) || ctype_digit( $char ))
9028
  break; // if exists, tz ends here.. . ?
9029
  else
9030
  $tx--; // tz length counter
9032
  if( 0 > $tx ) { // if any
9033
  $tz = substr( $datetime, $tx );
9034
  $datetime = trim( substr( $datetime, 0, $len + $tx ));
 
9035
  }
9036
+ if(( ctype_digit( substr( $datetime, 0, 8 )) && ( 'T' == substr( $datetime, 8, 1 )) && ctype_digit( substr( $datetime, -6, 6 ))) ||
9037
+ ( ctype_digit( substr( $datetime, 0, 14 ))))
 
 
9038
  $tzSts = TRUE;
 
 
 
9039
  }
9040
  if( empty( $tz ) && !empty( $wtz ))
9041
  $tz = $wtz;
9042
+ if( 3 == $parno )
9043
  $tz = null;
9044
+ if( !empty( $tz )) { // tz set
9045
  if(( 'Z' != $tz ) && ( iCalUtilityFunctions::_isOffset( $tz ))) {
9046
  $offset = (string) iCalUtilityFunctions::_tz2offset( $tz ) * -1;
9047
  $tz = 'UTC';
9064
  catch( Exception $e ) {
9065
  $datestring = date( 'Y-m-d-H-i-s', strtotime( $datetime ));
9066
  }
9067
+ } // end if( !empty( $tz ))
9068
  else
9069
  $datestring = date( 'Y-m-d-H-i-s', strtotime( $datetime ));
 
9070
  if( 'UTC' == $tz )
9071
  $tz = 'Z';
9072
  $d = explode( '-', $datestring );
9073
  $output = array( 'year' => $d[0], 'month' => $d[1], 'day' => $d[2] );
9074
+ if( !$parno || ( 3 != $parno )) { // parno is set to 6 or 7
 
 
9075
  $output['hour'] = $d[3];
9076
  $output['min'] = $d[4];
9077
  $output['sec'] = $d[5];
9082
  $output['unparsedtext'] = $unparseddatetime;
9083
  return $output;
9084
  }
9085
+ /********************************************************************************/
9086
+ /**
9087
+ * special characters management output
9088
+ *
9089
+ * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
9090
+ * @since 2.16.2 - 2012-12-18
9091
+ * @param string $string
9092
+ * @param string $format
9093
+ * @param string $nl
9094
+ * @return string
9095
+ */
9096
+ public static function _strrep( $string, $format, $nl ) {
9097
+ switch( $format ) {
9098
+ case 'xcal':
9099
+ $string = str_replace( '\n', $nl, $string);
9100
+ $string = htmlspecialchars( strip_tags( stripslashes( urldecode ( $string ))));
9101
+ break;
9102
+ default:
9103
+ $pos = 0;
9104
+ $specChars = array( 'n', 'N', 'r', ',', ';' );
9105
+ while( isset( $string[$pos] )) {
9106
+ if( FALSE === ( $pos = strpos( $string, "\\", $pos )))
9107
+ break;
9108
+ if( !in_array( substr( $string, $pos, 1 ), $specChars )) {
9109
+ $string = substr( $string, 0, $pos )."\\".substr( $string, ( $pos + 1 ));
9110
+ $pos += 1;
9111
+ }
9112
+ $pos += 1;
9113
+ }
9114
+ if( FALSE !== strpos( $string, '"' ))
9115
+ $string = str_replace('"', "'", $string);
9116
+ if( FALSE !== strpos( $string, ',' ))
9117
+ $string = str_replace(',', '\,', $string);
9118
+ if( FALSE !== strpos( $string, ';' ))
9119
+ $string = str_replace(';', '\;', $string);
9120
+ if( FALSE !== strpos( $string, "\r\n" ))
9121
+ $string = str_replace( "\r\n", '\n', $string);
9122
+ elseif( FALSE !== strpos( $string, "\r" ))
9123
+ $string = str_replace( "\r", '\n', $string);
9124
+ elseif( FALSE !== strpos( $string, "\n" ))
9125
+ $string = str_replace( "\n", '\n', $string);
9126
+ if( FALSE !== strpos( $string, '\N' ))
9127
+ $string = str_replace( '\N', '\n', $string);
9128
+ // if( FALSE !== strpos( $string, $nl ))
9129
+ $string = str_replace( $nl, '\n', $string);
9130
+ break;
9131
+ }
9132
+ return $string;
9133
+ }
9134
+ /**
9135
+ * special characters management input (from iCal file)
9136
+ *
9137
+ * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
9138
+ * @since 2.16.2 - 2012-12-18
9139
+ * @param string $string
9140
+ * @return string
9141
+ */
9142
+ public static function _strunrep( $string ) {
9143
+ $string = str_replace( '\\\\', '\\', $string);
9144
+ $string = str_replace( '\,', ',', $string);
9145
+ $string = str_replace( '\;', ';', $string);
9146
+ // $string = str_replace( '\n', $nl, $string); // ??
9147
+ return $string;
9148
+ }
9149
  /**
9150
  * convert timestamp to date array, default UTC or adjusted for offset/timezone
9151
  *
9162
  $timestamp = $timestamp['timestamp'];
9163
  }
9164
  $tz = ( isset( $tz )) ? $tz : $wtz;
9165
+ $offset = 0;
9166
  if( empty( $tz ) || ( 'Z' == $tz ) || ( 'GMT' == strtoupper( $tz )))
9167
  $tz = 'UTC';
9168
  elseif( iCalUtilityFunctions::_isOffset( $tz )) {
9169
  $offset = iCalUtilityFunctions::_tz2offset( $tz );
9170
+ // $tz = 'UTC';
9171
  }
9172
  try {
9173
  $d = new DateTime( "@$timestamp" ); // set UTC date
9174
+ if( 0 != $offset ) // adjust for offset
9175
  $d->modify( $offset.' seconds' );
9176
  elseif( 'UTC' != $tz )
9177
  $d->setTimezone( new DateTimeZone( $tz )); // convert to local date
9187
  $output['hour'] = $date[3];
9188
  $output['min'] = $date[4];
9189
  $output['sec'] = $date[5];
9190
+ if(( 'UTC' == $tz ) || ( 0 == $offset ))
9191
  $output['tz'] = 'Z';
9192
  }
9193
  return $output;
9248
  return TRUE;
9249
  }
9250
  /**
9251
+ * convert offset, [+/-]HHmm[ss], to seconds, used when correcting UTC to localtime or v.v.
9252
  *
9253
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
9254
  * @since 2.11.4 - 2012-01-11
9415
  * format iCal XML output, rfc6321, using PHP SimpleXMLElement
9416
  *
9417
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
9418
+ * @since 2.18.1 - 2013-08-18
9419
  * @param object $calendar, iCalcreator vcalendar instance reference
9420
  * @return string
9421
  */
9422
  function iCal2XML( & $calendar ) {
9423
  /** fix an SimpleXMLElement instance and create root element */
9424
+ $xmlstr = '<?xml version="1.0" encoding="utf-8"?><icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">';
9425
+ $xmlstr .= '<!-- created '.gmdate( 'Ymd\THis\Z' );
9426
+ $xmlstr .= ' using kigkonsult.se '.ICALCREATOR_VERSION.' iCal2XMl (rfc6321) -->';
9427
+ $xmlstr .= '</icalendar>';
9428
+ $xml = new SimpleXMLElement( $xmlstr );
9429
+ $vcalendar = $xml->addChild( 'vcalendar' );
9430
  /** fix calendar properties */
9431
+ $properties = $vcalendar->addChild( 'properties' );
9432
+ $calProps = array( 'version', 'prodid', 'calscale', 'method' );
9433
  foreach( $calProps as $calProp ) {
9434
  if( FALSE !== ( $content = $calendar->getProperty( $calProp )))
9435
  _addXMLchild( $properties, $calProp, 'text', $content );
9438
  _addXMLchild( $properties, $content[0], 'unknown', $content[1]['value'], $content[1]['params'] );
9439
  $langCal = $calendar->getConfig( 'language' );
9440
  /** prepare to fix components with properties */
9441
+ $components = $vcalendar->addChild( 'components' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9442
  /** fix component properties */
9443
+ while( FALSE !== ( $component = $calendar->getComponent())) {
9444
+ $compName = $component->objName;
9445
+ $child = $components->addChild( $compName );
9446
+ $properties = $child->addChild( 'properties' );
9447
+ $langComp = $component->getConfig( 'language' );
9448
+ $props = $component->getConfig( 'setPropertyNames' );
9449
+ foreach( $props as $prop ) {
9450
+ switch( strtolower( $prop )) {
9451
+ case 'attach': // may occur multiple times, below
9452
+ while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9453
+ $type = ( isset( $content['params']['VALUE'] ) && ( 'BINARY' == $content['params']['VALUE'] )) ? 'binary' : 'uri';
9454
+ unset( $content['params']['VALUE'] );
9455
+ _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] );
9456
+ }
9457
+ break;
9458
+ case 'attendee':
9459
+ while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9460
+ if( isset( $content['params']['CN'] ) && !isset( $content['params']['LANGUAGE'] )) {
9461
+ if( $langComp )
9462
+ $content['params']['LANGUAGE'] = $langComp;
9463
+ elseif( $langCal )
9464
+ $content['params']['LANGUAGE'] = $langCal;
9465
+ }
9466
+ _addXMLchild( $properties, $prop, 'cal-address', $content['value'], $content['params'] );
9467
+ }
9468
+ break;
9469
+ case 'exdate':
9470
+ while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9471
+ $type = ( isset( $content['params']['VALUE'] ) && ( 'DATE' == $content['params']['VALUE'] )) ? 'date' : 'date-time';
9472
+ unset( $content['params']['VALUE'] );
9473
+ _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] );
9474
+ }
9475
+ break;
9476
+ case 'freebusy':
9477
+ while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9478
+ if( is_array( $content ) && isset( $content['value']['fbtype'] )) {
9479
+ $content['params']['FBTYPE'] = $content['value']['fbtype'];
9480
+ unset( $content['value']['fbtype'] );
9481
+ }
9482
+ _addXMLchild( $properties, $prop, 'period', $content['value'], $content['params'] );
9483
+ }
9484
+ break;
9485
+ case 'request-status':
9486
+ while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9487
+ if( !isset( $content['params']['LANGUAGE'] )) {
9488
+ if( $langComp )
9489
+ $content['params']['LANGUAGE'] = $langComp;
9490
+ elseif( $langCal )
9491
+ $content['params']['LANGUAGE'] = $langCal;
9492
+ }
9493
+ _addXMLchild( $properties, $prop, 'rstatus', $content['value'], $content['params'] );
9494
+ }
9495
+ break;
9496
+ case 'rdate':
9497
+ while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9498
+ $type = 'date-time';
9499
+ if( isset( $content['params']['VALUE'] )) {
9500
+ if( 'DATE' == $content['params']['VALUE'] )
9501
+ $type = 'date';
9502
+ elseif( 'PERIOD' == $content['params']['VALUE'] )
9503
+ $type = 'period';
9504
+ }
9505
+ unset( $content['params']['VALUE'] );
9506
+ _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] );
9507
+ }
9508
+ break;
9509
+ case 'categories':
9510
+ case 'comment':
9511
+ case 'contact':
9512
+ case 'description':
9513
+ case 'related-to':
9514
+ case 'resources':
9515
+ while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9516
+ if(( 'related-to' != $prop ) && !isset( $content['params']['LANGUAGE'] )) {
9517
+ if( $langComp )
9518
+ $content['params']['LANGUAGE'] = $langComp;
9519
+ elseif( $langCal )
9520
+ $content['params']['LANGUAGE'] = $langCal;
9521
+ }
9522
+ _addXMLchild( $properties, $prop, 'text', $content['value'], $content['params'] );
9523
+ }
9524
+ break;
9525
+ case 'x-prop':
9526
+ while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE )))
9527
+ _addXMLchild( $properties, $content[0], 'unknown', $content[1]['value'], $content[1]['params'] );
9528
+ break;
9529
+ case 'created': // single occurence below, if set
9530
+ case 'completed':
9531
+ case 'dtstamp':
9532
+ case 'last-modified':
9533
+ $utcDate = TRUE;
9534
+ case 'dtstart':
9535
+ case 'dtend':
9536
+ case 'due':
9537
+ case 'recurrence-id':
9538
+ if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9539
+ $type = ( isset( $content['params']['VALUE'] ) && ( 'DATE' == $content['params']['VALUE'] )) ? 'date' : 'date-time';
9540
+ unset( $content['params']['VALUE'] );
9541
+ if(( isset( $content['params']['TZID'] ) && empty( $content['params']['TZID'] )) || @is_null( $content['params']['TZID'] ))
9542
+ unset( $content['params']['TZID'] );
9543
+ _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] );
9544
+ }
9545
+ unset( $utcDate );
9546
+ break;
9547
+ case 'duration':
9548
+ if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE )))
9549
+ _addXMLchild( $properties, $prop, 'duration', $content['value'], $content['params'] );
9550
+ break;
9551
+ case 'exrule':
9552
+ case 'rrule':
9553
+ while( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE )))
9554
+ _addXMLchild( $properties, $prop, 'recur', $content['value'], $content['params'] );
9555
+ break;
9556
+ case 'class':
9557
+ case 'location':
9558
+ case 'status':
9559
+ case 'summary':
9560
+ case 'transp':
9561
+ case 'tzid':
9562
+ case 'uid':
9563
+ if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9564
+ if((( 'location' == $prop ) || ( 'summary' == $prop )) && !isset( $content['params']['LANGUAGE'] )) {
9565
+ if( $langComp )
9566
+ $content['params']['LANGUAGE'] = $langComp;
9567
+ elseif( $langCal )
9568
+ $content['params']['LANGUAGE'] = $langCal;
9569
+ }
9570
+ _addXMLchild( $properties, $prop, 'text', $content['value'], $content['params'] );
9571
+ }
9572
+ break;
9573
+ case 'geo':
9574
+ if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE )))
9575
+ _addXMLchild( $properties, $prop, 'geo', $content['value'], $content['params'] );
9576
+ break;
9577
+ case 'organizer':
9578
+ if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE ))) {
9579
+ if( isset( $content['params']['CN'] ) && !isset( $content['params']['LANGUAGE'] )) {
9580
+ if( $langComp )
9581
+ $content['params']['LANGUAGE'] = $langComp;
9582
+ elseif( $langCal )
9583
+ $content['params']['LANGUAGE'] = $langCal;
9584
+ }
9585
+ _addXMLchild( $properties, $prop, 'cal-address', $content['value'], $content['params'] );
9586
+ }
9587
+ break;
9588
+ case 'percent-complete':
9589
+ case 'priority':
9590
+ case 'sequence':
9591
+ if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE )))
9592
+ _addXMLchild( $properties, $prop, 'integer', $content['value'], $content['params'] );
9593
+ break;
9594
+ case 'tzurl':
9595
+ case 'url':
9596
+ if( FALSE !== ( $content = $component->getProperty( $prop, FALSE, TRUE )))
9597
+ _addXMLchild( $properties, $prop, 'uri', $content['value'], $content['params'] );
9598
+ break;
9599
+ } // end switch( $prop )
9600
+ } // end foreach( $props as $prop )
9601
+ /** fix subComponent properties, if any */
9602
+ while( FALSE !== ( $subcomp = $component->getComponent())) {
9603
+ $subCompName = $subcomp->objName;
9604
+ $child2 = $child->addChild( $subCompName );
9605
+ $properties = $child2->addChild( 'properties' );
9606
+ $langComp = $subcomp->getConfig( 'language' );
9607
+ $subCompProps = $subcomp->getConfig( 'setPropertyNames' );
9608
+ foreach( $subCompProps as $prop ) {
9609
  switch( strtolower( $prop )) {
9610
  case 'attach': // may occur multiple times, below
9611
+ while( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) {
9612
  $type = ( isset( $content['params']['VALUE'] ) && ( 'BINARY' == $content['params']['VALUE'] )) ? 'binary' : 'uri';
9613
  unset( $content['params']['VALUE'] );
9614
  _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] );
9615
  }
9616
  break;
9617
  case 'attendee':
9618
+ while( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) {
9619
  if( isset( $content['params']['CN'] ) && !isset( $content['params']['LANGUAGE'] )) {
9620
  if( $langComp )
9621
  $content['params']['LANGUAGE'] = $langComp;
9625
  _addXMLchild( $properties, $prop, 'cal-address', $content['value'], $content['params'] );
9626
  }
9627
  break;
9628
+ case 'comment':
9629
+ case 'tzname':
9630
+ while( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9631
  if( !isset( $content['params']['LANGUAGE'] )) {
9632
  if( $langComp )
9633
  $content['params']['LANGUAGE'] = $langComp;
9634
  elseif( $langCal )
9635
  $content['params']['LANGUAGE'] = $langCal;
9636
  }
9637
+ _addXMLchild( $properties, $prop, 'text', $content['value'], $content['params'] );
9638
  }
9639
  break;
9640
  case 'rdate':
9641
+ while( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) {
9642
  $type = 'date-time';
9643
  if( isset( $content['params']['VALUE'] )) {
9644
  if( 'DATE' == $content['params']['VALUE'] )
9650
  _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] );
9651
  }
9652
  break;
9653
+ case 'x-prop':
9654
+ while( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE )))
9655
+ _addXMLchild( $properties, $content[0], 'unknown', $content[1]['value'], $content[1]['params'] );
9656
+ break;
9657
+ case 'action': // single occurence below, if set
9658
  case 'description':
9659
+ case 'summary':
9660
+ if( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) {
9661
+ if(( 'action' != $prop ) && !isset( $content['params']['LANGUAGE'] )) {
 
9662
  if( $langComp )
9663
  $content['params']['LANGUAGE'] = $langComp;
9664
  elseif( $langCal )
9667
  _addXMLchild( $properties, $prop, 'text', $content['value'], $content['params'] );
9668
  }
9669
  break;
 
 
 
 
 
 
 
 
 
9670
  case 'dtstart':
9671
+ if( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) {
9672
+ unset( $content['value']['tz'], $content['params']['VALUE'] ); // always local time
9673
+ _addXMLchild( $properties, $prop, 'date-time', $content['value'], $content['params'] );
 
 
 
 
 
 
9674
  }
 
9675
  break;
9676
  case 'duration':
9677
+ if( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE )))
 
 
9678
  _addXMLchild( $properties, $prop, 'duration', $content['value'], $content['params'] );
 
9679
  break;
9680
+ case 'repeat':
9681
+ if( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE )))
9682
+ _addXMLchild( $properties, $prop, 'integer', $content['value'], $content['params'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9683
  break;
9684
+ case 'trigger':
9685
+ if( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE ))) {
9686
+ if( isset( $content['value']['year'] ) &&
9687
+ isset( $content['value']['month'] ) &&
9688
+ isset( $content['value']['day'] ))
9689
+ $type = 'date-time';
9690
+ else {
9691
+ $type = 'duration';
9692
+ if( !isset( $content['value']['relatedStart'] ) || ( TRUE !== $content['value']['relatedStart'] ))
9693
+ $content['params']['RELATED'] = 'END';
9694
  }
9695
+ _addXMLchild( $properties, $prop, $type, $content['value'], $content['params'] );
9696
  }
9697
  break;
9698
+ case 'tzoffsetto':
9699
+ case 'tzoffsetfrom':
9700
+ if( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE )))
9701
+ _addXMLchild( $properties, $prop, 'utc-offset', $content['value'], $content['params'] );
 
9702
  break;
9703
+ case 'rrule':
9704
+ while( FALSE !== ( $content = $subcomp->getProperty( $prop, FALSE, TRUE )))
9705
+ _addXMLchild( $properties, $prop, 'recur', $content['value'], $content['params'] );
 
9706
  break;
9707
+ } // switch( $prop )
9708
+ } // end foreach( $subCompProps as $prop )
9709
+ } // end while( FALSE !== ( $subcomp = $component->getComponent()))
9710
+ } // end while( FALSE !== ( $component = $calendar->getComponent()))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9711
  return $xml->asXML();
9712
  }
9713
  /**
9714
  * Add children to a SimpleXMLelement
9715
  *
9716
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
9717
+ * @since 2.18.10 - 2013-09-04
9718
  * @param object $parent, reference to a SimpleXMLelement node
9719
  * @param string $name, new element node name
9720
  * @param string $type, content type, subelement(-s) name
9726
  /** create new child node */
9727
  $name = strtolower( $name );
9728
  $child = $parent->addChild( $name );
 
 
9729
  if( !empty( $params )) {
9730
  $parameters = $child->addChild( 'parameters' );
9731
  foreach( $params as $param => $parVal ) {
9732
+ if( 'VALUE' == $param )
9733
+ continue;
9734
  $param = strtolower( $param );
9735
  if( 'x-' == substr( $param, 0, 2 )) {
9736
  $p1 = $parameters->addChild( $param );
9756
  $p2 = $p1->addChild( $ptype, htmlspecialchars( $parVal ));
9757
  }
9758
  }
9759
+ } // end if( !empty( $params ))
9760
+ if(( empty( $content ) && ( '0' != $content )) || ( !is_array( $content) && ( '-' != substr( $content, 0, 1 ) && ( 0 > $content ))))
9761
  return;
9762
  /** store content */
9763
  switch( $type ) {
9795
  $v = $child->addChild( $type, $output.iCalUtilityFunctions::_duration2str( $content ) );
9796
  break;
9797
  case 'geo':
9798
+ if( !empty( $content )) {
9799
+ $v1 = $child->addChild( 'latitude', iCalUtilityFunctions::_geo2str2( $content['latitude'], iCalUtilityFunctions::$geoLatFmt ));
9800
+ $v1 = $child->addChild( 'longitude', iCalUtilityFunctions::_geo2str2( $content['longitude'], iCalUtilityFunctions::$geoLongFmt ));
9801
+ }
9802
  break;
9803
  case 'integer':
9804
+ $v = $child->addChild( $type, (string) $content );
9805
  break;
9806
  case 'period':
9807
  if( !is_array( $content ))
9823
  }
9824
  break;
9825
  case 'recur':
9826
+ $content = array_change_key_case( $content );
9827
  foreach( $content as $rulelabel => $rulevalue ) {
 
9828
  switch( $rulelabel ) {
9829
  case 'until':
9830
  if( isset( $rulevalue['hour'] ))
9915
  break;
9916
  }
9917
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9918
  /**
9919
  * parse xml file into iCalcreator instance
9920
  *
9921
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
9922
+ * @since 2.16.22 - 2013-06-18
9923
  * @param string $xmlfile
9924
+ * @param array $iCalcfg iCalcreator config array (opt)
9925
  * @return mixediCalcreator instance or FALSE on error
9926
  */
9927
+ function XMLfile2iCal( $xmlfile, $iCalcfg=array()) {
9928
+ if( FALSE === ( $xmlstr = file_get_contents( $xmlfile )))
9929
+ return FALSE;
9930
+ return xml2iCal( $xmlstr, $iCalcfg );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9931
  }
9932
  /**
9933
+ * parse xml string into iCalcreator instance, alias of XML2iCal
9934
  *
9935
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
9936
+ * @since 2.16.22 - 2013-06-18
9937
+ * @param string $xmlstr
9938
  * @param array $iCalcfg iCalcreator config array (opt)
9939
  * @return mixed iCalcreator instance or FALSE on error
9940
  */
9941
+ function XMLstr2iCal( $xmlstr, $iCalcfg=array()) {
9942
+ return XML2iCal( $xmlstr, $iCalcfg);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9943
  }
9944
  /**
9945
+ * parse xml string into iCalcreator instance
9946
  *
9947
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
9948
+ * @since 2.16.22 - 2013-06-20
9949
+ * @param string $xmlstr
9950
+ * @param array $iCalcfg iCalcreator config array (opt)
9951
+ * @return mixed iCalcreator instance or FALSE on error
9952
  */
9953
+ function XML2iCal( $xmlstr, $iCalcfg=array()) {
9954
+ $xmlstr = str_replace( array( "\r\n", "\n\r", "\n", "\r" ), '', $xmlstr );
9955
+ $xml = XMLgetTagContent1( $xmlstr, 'vcalendar', $endIx );
9956
+ $iCal = new vcalendar( $iCalcfg );
9957
+ XMLgetComps( $iCal, $xmlstr );
9958
+ unset( $xmlstr );
9959
+ return $iCal;
 
 
 
 
 
 
 
 
9960
  }
9961
  /**
9962
+ * parse XML string into iCalcreator components
9963
  *
9964
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
9965
+ * @since 2.16.22 - 2013-06-20
9966
+ * @param object $iCal, iCalcreator vcalendar or component object instance
9967
+ * @param string $xml
9968
+ * @return bool
9969
  */
9970
+ function XMLgetComps( $iCal, $xml ) {
9971
+ static $comps = array( 'vtimezone', 'standard', 'daylight', 'vevent', 'vtodo', 'vjournal', 'vfreebusy', 'valarm' );
9972
+ $sx = 0;
9973
+ while(( FALSE !== substr( $xml, ( $sx + 11 ), 1 )) &&
9974
+ ( '<properties>' != substr( $xml, $sx, 12 )) && ( '<components>' != substr( $xml, $sx, 12 )))
9975
+ $sx += 1;
9976
+ if( FALSE === substr( $xml, ( $sx + 11 ), 1 ))
9977
+ return FALSE;
9978
+ if( '<properties>' == substr( $xml, $sx, 12 )) {
9979
+ $xml2 = XMLgetTagContent1( $xml, 'properties', $endIx );
9980
+ XMLgetProps( $iCal, $xml2 );
9981
+ $xml = substr( $xml, $endIx );
9982
+ }
9983
+ if( '<components>' == substr( $xml, 0, 12 ))
9984
+ $xml = XMLgetTagContent1( $xml, 'components', $endIx );
9985
+ while( ! empty( $xml )) {
9986
+ $xml2 = XMLgetTagContent2( $xml, $tagName, $endIx );
9987
+ if( in_array( strtolower( $tagName ), $comps ) && ( FALSE !== ( $subComp = $iCal->newComponent( $tagName ))))
9988
+ XMLgetComps( $subComp, $xml2 );
9989
+ $xml = substr( $xml, $endIx);
9990
+ }
9991
+ unset( $xml );
9992
+ return $iCal;
9993
  }
9994
  /**
9995
+ * parse XML into iCalcreator properties
9996
  *
9997
  * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
9998
+ * @since 2.16.21 - 2013-06-23
9999
+ * @param array $iCal iCalcreator calendar/component instance
10000
+ * @param string $xml
10001
  * @return void
10002
  */
10003
+ function XMLgetProps( $iCal, $xml) {
10004
+ while( ! empty( $xml )) {
10005
+ $xml2 = XMLgetTagContent2( $xml, $propName, $endIx );
10006
+ $propName = strtoupper( $propName );
10007
+ if( empty( $xml2 ) && ( '0' != $xml2 )) {
10008
+ $iCal->setProperty( $propName );
10009
+ $xml = substr( $xml, $endIx);
 
10010
  continue;
10011
  }
10012
+ $params = array();
10013
+ if( '<parameters/>' == substr( $xml2, 0, 13 ))
10014
+ $xml2 = substr( $xml2, 13 );
10015
+ elseif( '<parameters>' == substr( $xml2, 0, 12 )) {
10016
+ $xml3 = XMLgetTagContent1( $xml2, 'parameters', $endIx2 );
10017
+ while( ! empty( $xml3 )) {
10018
+ $xml4 = XMLgetTagContent2( $xml3, $paramKey, $endIx3 );
10019
+ $pType = FALSE; // skip parameter valueType
10020
+ $paramKey = strtoupper( $paramKey );
10021
+ if( in_array( $paramKey, array( 'DELEGATED-FROM', 'DELEGATED-TO', 'MEMBER' ))) {
10022
+ while( ! empty( $xml4 )) {
10023
+ if( ! isset( $params[$paramKey] ))
10024
+ $params[$paramKey] = array( XMLgetTagContent1( $xml4, 'cal-address', $endIx4 ));
10025
+ else
10026
+ $params[$paramKey][] = XMLgetTagContent1( $xml4, 'cal-address', $endIx4 );
10027
+ $xml4 = substr( $xml4, $endIx4 );
10028
+ }
10029
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10030
  else {
10031
+ if( ! isset( $params[$paramKey] ))
10032
+ $params[$paramKey] = html_entity_decode( XMLgetTagContent2( $xml4, $pType, $endIx4 ));
10033
+ else
10034
+ $params[$paramKey] .= ','.html_entity_decode( XMLgetTagContent2( $xml4, $pType, $endIx4 ));
10035
  }
10036
+ $xml3 = substr( $xml3, $endIx3 );
10037
+ }
10038
+ $xml2 = substr( $xml2, $endIx2 );
10039
+ } // if( '<parameters>' == substr( $xml2, 0, 12 ))
10040
+ $valueType = FALSE;
10041
+ $value = ( ! empty( $xml2 ) || ( '0' == $xml2 )) ? XMLgetTagContent2( $xml2, $valueType, $endIx3 ) : '';
10042
+ switch( $propName ) {
10043
+ case 'CATEGORIES':
10044
+ case 'RESOURCES':
10045
+ $tValue = array();
10046
+ while( ! empty( $xml2 )) {
10047
+ $tValue[] = html_entity_decode( XMLgetTagContent2( $xml2, $valueType, $endIx4 ));
10048
+ $xml2 = substr( $xml2, $endIx4 );
10049
+ }
10050
+ $value = $tValue;
10051
  break;
10052
+ case 'EXDATE': // multiple single-date(-times) may exist
10053
+ case 'RDATE':
10054
+ if( 'period' != $valueType ) {
10055
+ if( 'date' == $valueType )
10056
+ $params['VALUE'] = 'DATE';
10057
+ $t = array();
10058
+ while( ! empty( $xml2 ) && ( '<date' == substr( $xml2, 0, 5 ))) {
10059
+ $t[] = XMLgetTagContent2( $xml2, $pType, $endIx4 );
10060
+ $xml2 = substr( $xml2, $endIx4 );
10061
+ }
10062
+ $value = $t;
10063
+ break;
10064
+ }
10065
+ case 'FREEBUSY':
10066
+ if( 'RDATE' == $propName )
10067
+ $params['VALUE'] = 'PERIOD';
10068
+ $value = array();
10069
+ while( ! empty( $xml2 ) && ( '<period>' == substr( $xml2, 0, 8 ))) {
10070
+ $xml3 = XMLgetTagContent1( $xml2, 'period', $endIx4 ); // period
10071
+ $t = array();
10072
+ while( ! empty( $xml3 )) {
10073
+ $t[] = XMLgetTagContent2( $xml3, $pType, $endIx5 ); // start - end/duration
10074
+ $xml3 = substr( $xml3, $endIx5 );
10075
+ }
10076
+ $value[] = $t;
10077
+ $xml2 = substr( $xml2, $endIx4 );
10078
+ }
10079
  break;
10080
+ case 'TZOFFSETTO':
10081
+ case 'TZOFFSETFROM':
10082
+ $value = str_replace( ':', '', $value );
10083
  break;
10084
+ case 'GEO':
10085
+ $tValue = array( 'latitude' => $value );
10086
+ $tValue['longitude'] = XMLgetTagContent1( substr( $xml2, $endIx3 ), 'longitude', $endIx3 );
10087
+ $value = $tValue;
10088
  break;
10089
+ case 'EXRULE':
10090
+ case 'RRULE':
10091
+ $tValue = array( $valueType => $value );
10092
+ $xml2 = substr( $xml2, $endIx3 );
10093
+ $valueType = FALSE;
10094
+ while( ! empty( $xml2 )) {
10095
+ $t = XMLgetTagContent2( $xml2, $valueType, $endIx4 );
10096
+ switch( $valueType ) {
10097
+ case 'freq':
10098
+ case 'count':
10099
+ case 'until':
10100
+ case 'interval':
10101
+ case 'wkst':
10102
+ $tValue[$valueType] = $t;
10103
+ break;
10104
+ case 'byday':
10105
+ if( 2 == strlen( $t ))
10106
+ $tValue[$valueType][] = array( 'DAY' => $t );
10107
+ else {
10108
+ $day = substr( $t, -2 );
10109
+ $key = substr( $t, 0, ( strlen( $t ) - 2 ));
10110
+ $tValue[$valueType][] = array( $key, 'DAY' => $day );
10111
+ }
10112
+ break;
10113
+ default:
10114
+ $tValue[$valueType][] = $t;
10115
+ }
10116
+ $xml2 = substr( $xml2, $endIx4 );
10117
+ }
10118
+ $value = $tValue;
10119
  break;
10120
+ case 'REQUEST-STATUS':
10121
+ $tValue = array();
10122
+ while( ! empty( $xml2 )) {
10123
+ $t = html_entity_decode( XMLgetTagContent2( $xml2, $valueType, $endIx4 ));
10124
+ $tValue[$valueType] = $t;
10125
+ $xml2 = substr( $xml2, $endIx4 );
10126
+ }
10127
+ if( ! empty( $tValue ))
10128
+ $value = $tValue;
10129
+ else
10130
+ $value = array( 'code' => null, 'description' => null );
10131
  break;
 
10132
  default:
10133
+ switch( $valueType ) {
10134
+ case 'binary': $params['VALUE'] = 'BINARY'; break;
10135
+ case 'date': $params['VALUE'] = 'DATE'; break;
10136
+ case 'date-time': $params['VALUE'] = 'DATE-TIME'; break;
10137
+ case 'text':
10138
+ case 'unknown': $value = html_entity_decode( $value ); break;
10139
+ }
10140
+ break;
10141
+ } // end switch( $propName )
10142
+ if( 'FREEBUSY' == $propName ) {
10143
+ $fbtype = $params['FBTYPE'];
10144
+ unset( $params['FBTYPE'] );
10145
+ $iCal->setProperty( $propName, $fbtype, $value, $params );
10146
+ }
10147
+ elseif( 'GEO' == $propName )
10148
+ $iCal->setProperty( $propName, $value['latitude'], $value['longitude'], $params );
10149
+ elseif( 'REQUEST-STATUS' == $propName ) {
10150
+ if( !isset( $value['data'] ))
10151
+ $value['data'] = FALSE;
10152
+ $iCal->setProperty( $propName, $value['code'], $value['description'], $value['data'], $params );
10153
+ }
10154
+ else {
10155
+ if( empty( $value ) && ( is_array( $value ) || ( '0' > $value )))
10156
+ $value = '';
10157
+ $iCal->setProperty( $propName, $value, $params );
10158
+ }
10159
+ $xml = substr( $xml, $endIx);
10160
+ } // end while( ! empty( $xml ))
10161
+ }
10162
+ /**
10163
+ * fetch a specific XML tag content
10164
+ *
10165
+ * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
10166
+ * @since 2.16.22 - 2013-06-20
10167
+ * @param string $xml
10168
+ * @param string $tagName
10169
+ * @param int $endIx
10170
+ * @return mixed
10171
+ */
10172
+ function XMLgetTagContent1( $xml, $tagName, & $endIx=0 ) {
10173
+ $strlen = strlen( $tagName );
10174
+ $sx1 = 0;
10175
+ while( FALSE !== substr( $xml, $sx1, 1 )) {
10176
+ if(( FALSE !== substr( $xml, ( $sx1 + $strlen + 1 ), 1 )) &&
10177
+ ( strtolower( "<$tagName>" ) == strtolower( substr( $xml, $sx1, ( $strlen + 2 )))))
10178
+ break;
10179
+ if(( FALSE !== substr( $xml, ( $sx1 + $strlen + 3 ), 1 )) &&
10180
+ ( strtolower( "<$tagName />" ) == strtolower( substr( $xml, $sx1, ( $strlen + 4 ))))) { // empty tag
10181
+ $endIx = $strlen + 5;
10182
+ return '';
10183
+ }
10184
+ if(( FALSE !== substr( $xml, ( $sx1 + $strlen + 2 ), 1 )) &&
10185
+ ( strtolower( "<$tagName/>" ) == strtolower( substr( $xml, $sx1, ( $strlen + 3 ))))) { // empty tag
10186
+ $endIx = $strlen + 4;
10187
+ return '';
10188
+ }
10189
+ $sx1 += 1;
10190
  }
10191
+ if( FALSE === substr( $xml, $sx1, 1 )) {
10192
+ $endIx = ( empty( $sx )) ? 0 : $sx - 1;
10193
+ return '';
10194
+ }
10195
+ if( FALSE === ( $pos = stripos( $xml, "</$tagName>" ))) { // missing end tag??
10196
+ $endIx = strlen( $xml ) + 1;
10197
+ return '';
10198
+ }
10199
+ $endIx = $pos + $strlen + 3;
10200
+ return substr( $xml, ( $sx1 + $strlen + 2 ), ( $pos - $sx1 - 2 - $strlen ));
10201
+ }
10202
+ /**
10203
+ * fetch next (unknown) XML tagname AND content
10204
+ *
10205
+ * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
10206
+ * @since 2.16.22 - 2013-06-20
10207
+ * @param string $xml
10208
+ * @param string $tagName
10209
+ * @param int $endIx
10210
+ * @return mixed
10211
+ */
10212
+ function XMLgetTagContent2( $xml, & $tagName, & $endIx ) {
10213
+ $endIx = strlen( $xml ) + 1; // just in case.. .
10214
+ $sx1 = 0;
10215
+ while( FALSE !== substr( $xml, $sx1, 1 )) {
10216
+ if( '<' == substr( $xml, $sx1, 1 )) {
10217
+ if(( FALSE !== substr( $xml, ( $sx1 + 3 ), 1 )) && ( '<!--' == substr( $xml, $sx1, 4 ))) // skip comment
10218
+ $sx1 += 1;
10219
  else
10220
+ break; // tagname start here
10221
  }
10222
+ else
10223
+ $sx1 += 1;
10224
  }
10225
+ $sx2 = $sx1;
10226
+ while( FALSE !== substr( $xml, $sx2 )) {
10227
+ if(( FALSE !== substr( $xml, ( $sx2 + 1 ), 1 )) && ( '/>' == substr( $xml, $sx2, 2 ))) { // empty tag
10228
+ $tagName = trim( substr( $xml, ( $sx1 + 1 ), ( $sx2 - $sx1 - 1 )));
10229
+ $endIx = $sx2 + 2;
10230
+ return '';
10231
+ }
10232
+ if( '>' == substr( $xml, $sx2, 1 )) // tagname ends here
10233
+ break;
10234
+ $sx2 += 1;
10235
+ }
10236
+ $tagName = substr( $xml, ( $sx1 + 1 ), ( $sx2 - $sx1 - 1 ));
10237
+ $endIx = $sx2 + 1;
10238
+ if( FALSE === substr( $xml, $sx2, 1 )) {
10239
+ return '';
10240
+ }
10241
+ $strlen = strlen( $tagName );
10242
+ if(( 'duration' == $tagName ) &&
10243
+ ( FALSE !== ( $pos1 = stripos( $xml, "<duration>", $sx1+1 ))) &&
10244
+ ( FALSE !== ( $pos2 = stripos( $xml, "</duration>", $pos1+1 ))) &&
10245
+ ( FALSE !== ( $pos3 = stripos( $xml, "</duration>", $pos2+1 ))) &&
10246
+ ( $pos1 < $pos2 ) && ( $pos2 < $pos3 ))
10247
+ $pos = $pos3;
10248
+ elseif( FALSE === ( $pos = stripos( $xml, "</$tagName>", $sx2 )))
10249
+ return '';
10250
+ $endIx = $pos + $strlen + 3;
10251
+ return substr( $xml, ( $sx1 + $strlen + 2 ), ( $pos - $strlen - 2 ));
10252
  }
10253
  /*********************************************************************************/
10254
  /* Additional functions to use with vtimezone components */
10304
  $timestamp['day'],
10305
  $timestamp['year']
10306
  ) ;
 
10307
  }
10308
  $tzoffset = array();
10309
  // something to return if all goes wrong (such as if $tzid doesn't find us an array of dates)
10540
  }
10541
  return $tzdates;
10542
  }
10543
+ ?>
lib/iCal/{iCalcreator-2.16 → iCalcreator-2.20}/lgpl.txt RENAMED
File without changes
lib/import-export/ics.php CHANGED
@@ -892,30 +892,27 @@ class Ai1ec_Ics_Import_Export_Engine
892
  // We must also match the exact starting time
893
  $exception_dates = $event->get( 'exception_dates' );
894
  if ( ! empty( $exception_dates ) ) {
895
- $params = array( 'VALUE' => 'DATE' );
896
- $use_dates = array();
 
 
 
897
  foreach (
898
  explode( ',', $exception_dates )
899
  as $exdate
900
  ) {
901
- $use_dates[] = $this->format_exception_date( $exdate );
 
 
 
 
 
 
902
  }
903
- $e->setProperty( 'exdate', $use_dates, $params );
904
  }
905
  return $calendar;
906
  }
907
 
908
- /**
909
- * Format exdate for export.
910
- *
911
- * @param string $exdate Previously written exdate.
912
- *
913
- * @return string Value to use when exporting.
914
- */
915
- public function format_exception_date( $exdate ) {
916
- return substr( $exdate, 0, 8 );
917
- }
918
-
919
  /**
920
  * _sanitize_value method
921
  *
892
  // We must also match the exact starting time
893
  $exception_dates = $event->get( 'exception_dates' );
894
  if ( ! empty( $exception_dates ) ) {
895
+ $params = array(
896
+ 'VALUE' => 'DATE-TIME',
897
+ 'TZID' => $tz,
898
+ );
899
+ $dt_suffix = $event->get( 'start' )->format( '\THis' );
900
  foreach (
901
  explode( ',', $exception_dates )
902
  as $exdate
903
  ) {
904
+ $exdate = $this->_registry->get( 'date.time', $exdate )
905
+ ->format( 'Ymd' );
906
+ $e->setProperty(
907
+ 'exdate',
908
+ array( $exdate . $dt_suffix ),
909
+ $params
910
+ );
911
  }
 
912
  }
913
  return $calendar;
914
  }
915
 
 
 
 
 
 
 
 
 
 
 
 
916
  /**
917
  * _sanitize_value method
918
  *
lib/notification/admin.php CHANGED
@@ -48,16 +48,9 @@ class Ai1ec_Notification_Admin extends Ai1ec_Notification {
48
  * @return Ai1ec_Notification_Admin
49
  */
50
  public function __construct(
51
- Ai1ec_Registry_Object $registry,
52
- $message = null,
53
- $class = 'updated',
54
- $importance = 0,
55
- array $recipients = array( self::RCPT_ADMIN )
56
  ) {
57
  $this->_registry = $registry;
58
- if ( $message ) {
59
- $this->store( $message, $class, $importance, $recipients );
60
- }
61
  }
62
 
63
  /**
48
  * @return Ai1ec_Notification_Admin
49
  */
50
  public function __construct(
51
+ Ai1ec_Registry_Object $registry
 
 
 
 
52
  ) {
53
  $this->_registry = $registry;
 
 
 
54
  }
55
 
56
  /**
lib/robots/helper.php CHANGED
@@ -11,6 +11,18 @@
11
  */
12
  class Ai1ec_Robots_Helper extends Ai1ec_Base {
13
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  /**
15
  * Install robotx.txt into current Wordpress instance
16
  *
11
  */
12
  class Ai1ec_Robots_Helper extends Ai1ec_Base {
13
 
14
+ /**
15
+ * Activation status.
16
+ *
17
+ * @return bool Whereas activation must be triggered.
18
+ */
19
+ public function pre_check() {
20
+ if ( defined( 'FS_METHOD' ) && 'direct' === FS_METHOD ) {
21
+ return true;
22
+ }
23
+ return false; // disable until FS is properly resolved
24
+ }
25
+
26
  /**
27
  * Install robotx.txt into current Wordpress instance
28
  *
lib/routing/router.php CHANGED
@@ -128,6 +128,36 @@ class Ai1ec_Router extends Ai1ec_Base {
128
  return $result_uri;
129
  }
130
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  /**
132
  * Register rewrite rule to enable work with pretty URIs
133
  */
@@ -142,12 +172,14 @@ class Ai1ec_Router extends Ai1ec_Base {
142
  if ( false !== strpos( $base, '?' ) ) {
143
  return $this;
144
  }
 
145
  $base = '(?:.+/)?' . $base;
146
  $named_args = str_replace(
147
  '[:DS:]',
148
  preg_quote( Ai1ec_Uri::DIRECTION_SEPARATOR ),
149
  '[a-z][a-z0-9\-_[:DS:]\/]*[:DS:][a-z0-9\-_[:DS:]\/]'
150
  );
 
151
  $regexp = $base . '(\/' . $named_args . ')';
152
  $clean_base = trim( $this->_calendar_base, '/' );
153
  $clean_site = trim( $this->get_site_url(), '/' );
128
  return $result_uri;
129
  }
130
 
131
+ /**
132
+ * Properly capitalize encoded URL sequence.
133
+ *
134
+ * @param string $url Original URL to use.
135
+ *
136
+ * @return string Modified URL.
137
+ */
138
+ protected function _fix_encoded_uri( $url ) {
139
+ $particles = preg_split(
140
+ '|(%[a-f0-9]{2})|',
141
+ $url,
142
+ -1,
143
+ PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY
144
+ );
145
+ $state = false;
146
+ $output = '';
147
+ foreach ( $particles as $particle ) {
148
+ if ( '%' === $particle ) {
149
+ $state = true;
150
+ } else {
151
+ if ( ! $state && '%' === $particle{0} ) {
152
+ $particle = strtoupper( $particle );
153
+ }
154
+ $state = false;
155
+ }
156
+ $output .= $particle;
157
+ }
158
+ return $output;
159
+ }
160
+
161
  /**
162
  * Register rewrite rule to enable work with pretty URIs
163
  */
172
  if ( false !== strpos( $base, '?' ) ) {
173
  return $this;
174
  }
175
+ $base = $this->_fix_encoded_uri( $base );
176
  $base = '(?:.+/)?' . $base;
177
  $named_args = str_replace(
178
  '[:DS:]',
179
  preg_quote( Ai1ec_Uri::DIRECTION_SEPARATOR ),
180
  '[a-z][a-z0-9\-_[:DS:]\/]*[:DS:][a-z0-9\-_[:DS:]\/]'
181
  );
182
+
183
  $regexp = $base . '(\/' . $named_args . ')';
184
  $clean_base = trim( $this->_calendar_base, '/' );
185
  $clean_site = trim( $this->get_site_url(), '/' );
public/admin/box_event_children.php CHANGED
@@ -20,8 +20,8 @@ if ( empty( $parent ) && empty( $children ) ) {
20
  <div class="ai1ec-panel-body">
21
  <?php if ( $parent ) : ?>
22
  <?php _e( 'Edit parent:', AI1EC_PLUGIN_NAME ); ?>
23
- <a href="<?php echo get_edit_post_link( $parent->post_id ); ?>"><?php
24
- echo apply_filters( 'the_title', $parent->post->post_title, $parent->post_id );
25
  ?></a>
26
  <?php else : /* children */ ?>
27
  <h4><?php _e( 'Modified Events', AI1EC_PLUGIN_NAME ); ?></h4>
@@ -29,9 +29,9 @@ if ( empty( $parent ) && empty( $children ) ) {
29
  <?php foreach ( $children as $child ) : ?>
30
  <li>
31
  <?php _e( 'Edit:', AI1EC_PLUGIN_NAME ); ?>
32
- <a href="<?php echo get_edit_post_link( $child->post_id ); ?>"><?php
33
- echo $child->post->post_title;
34
- ?></a>, <?php echo $child->get_timespan_html( 'long' ); ?>
35
  </li>
36
  <?php endforeach; ?>
37
  </ul>
20
  <div class="ai1ec-panel-body">
21
  <?php if ( $parent ) : ?>
22
  <?php _e( 'Edit parent:', AI1EC_PLUGIN_NAME ); ?>
23
+ <a href="<?php echo get_edit_post_link( $parent->get( 'post_id' ) ); ?>"><?php
24
+ echo apply_filters( 'the_title', $parent->get( 'post' )->post_title, $parent->get( 'post_id' ) );
25
  ?></a>
26
  <?php else : /* children */ ?>
27
  <h4><?php _e( 'Modified Events', AI1EC_PLUGIN_NAME ); ?></h4>
29
  <?php foreach ( $children as $child ) : ?>
30
  <li>
31
  <?php _e( 'Edit:', AI1EC_PLUGIN_NAME ); ?>
32
+ <a href="<?php echo get_edit_post_link( $child->get( 'post_id' ) ); ?>"><?php
33
+ echo $child->get( 'post' )->post_title;
34
+ ?></a>, <?php echo $registry->get( 'view.event.time' )->get_timespan_html( $child, 'long' ); ?>
35
  </li>
36
  <?php endforeach; ?>
37
  </ul>
public/admin/box_support.php CHANGED
@@ -10,14 +10,37 @@
10
  <h2>
11
  <?php _e( 'Timely’s All-in-One Event Calendar is a<br />revolutionary new way to find and share events.', AI1EC_PLUGIN_NAME ); ?>
12
  </h2>
13
- <div class="ai1ec-support-placeholder">
14
- <a class="ai1ec-btn ai1ec-btn-primary ai1ec-btn-lg" target="_blank" href="http://time.ly/add-ons/?utm_source=dashboard&amp;utm_medium=button&amp;utm_campaign=addons"><?php _e( 'Get Add-ons', AI1EC_PLUGIN_NAME ); ?></a>
15
- <a class="ai1ec-btn ai1ec-btn-primary ai1ec-btn-lg" target="_blank" href="http://time.ly/support/?utm_source=dashboard&amp;utm_medium=button&amp;utm_campaign=support"><?php _e( 'Support', AI1EC_PLUGIN_NAME ); ?></a>
16
- <a class="ai1ec-btn ai1ec-btn-primary ai1ec-btn-lg" target="_blank" href="http://time.ly/calendar/?utm_source=dashboard&amp;utm_medium=button&amp;utm_campaign=events"><?php _e( 'Time.ly Events', AI1EC_PLUGIN_NAME ); ?></a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  </div>
18
  </div>
19
  <div class="ai1ec-news">
20
- <h2><?php _e( 'Timely News', AI1EC_PLUGIN_NAME ); ?>
 
 
21
  <small>
22
  <a href="http://time.ly/blog?utm_source=dashboard&nbsp;utm_medium=blog&nbsp;utm_term=ai1ec-pro&nbsp;utm_content=1.11.4&nbsp;utm_campaign=news"
23
  target="_blank">
@@ -28,29 +51,37 @@
28
  </h2>
29
  <div>
30
  <?php if ( count( $news ) > 0 ) : ?>
31
- <?php foreach ( $news as $n ) : ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  <article>
33
  <header>
34
- <strong><a href="<?php
35
- $ga_args = array(
36
- 'utm_source' => 'dashboard',
37
- 'utm_medium' => 'blog',
38
- 'utm_campaign' => 'news',
39
- 'utm_term' => urlencode(
40
- strtolower( substr( $n->get_title(), 0, 40 ) )
41
- ),
42
- );
43
- echo add_query_arg( $ga_args, $n->get_permalink() );
44
- ?>" target="_blank"><?php echo $n->get_title() ?></a></strong>
45
  </header>
46
- <div>
47
- <?php echo preg_replace( '/\s+?(\S+)?$/', '', $n->get_description() ); ?>
48
- </div>
49
  </article>
50
- <?php endforeach ?>
51
  <?php else : ?>
52
  <p><em>No news available.</em></p>
53
- <?php endif ?>
54
  </div>
55
  </div>
56
 
10
  <h2>
11
  <?php _e( 'Timely’s All-in-One Event Calendar is a<br />revolutionary new way to find and share events.', AI1EC_PLUGIN_NAME ); ?>
12
  </h2>
13
+ <div class="ai1ec-support-buttons ai1ec-row">
14
+ <div class="ai1ec-col-lg-4" id="ai1ec-addons-col">
15
+ <a class="ai1ec-btn ai1ec-btn-info ai1ec-btn-block ai1ec-btn-lg"
16
+ target="_blank"
17
+ href="http://time.ly/add-ons/?utm_source=dashboard&amp;utm_medium=button&amp;utm_campaign=addons">
18
+ <i class="ai1ec-fa ai1ec-fa-magic ai1ec-fa-fw"></i>
19
+ <?php _e( 'Get Add-ons', AI1EC_PLUGIN_NAME ); ?>
20
+ </a>
21
+ </div>
22
+ <div class="ai1ec-col-lg-4" id="ai1ec-support-col">
23
+ <a class="ai1ec-btn ai1ec-btn-primary ai1ec-btn-block ai1ec-btn-lg"
24
+ target="_blank"
25
+ href="http://time.ly/support/?utm_source=dashboard&amp;utm_medium=button&amp;utm_campaign=support">
26
+ <i class="ai1ec-fa ai1ec-fa-comments ai1ec-fa-fw"></i>
27
+ <?php _e( 'Support', AI1EC_PLUGIN_NAME ); ?>
28
+ </a>
29
+ </div>
30
+ <div class="ai1ec-col-lg-4" id="ai1ec-events-col">
31
+ <a class="ai1ec-btn ai1ec-btn-primary ai1ec-btn-block ai1ec-btn-lg"
32
+ target="_blank"
33
+ href="http://time.ly/calendar/?utm_source=dashboard&amp;utm_medium=button&amp;utm_campaign=events">
34
+ <i class="ai1ec-fa ai1ec-fa-calendar ai1ec-fa-fw"></i>
35
+ <?php _e( 'Timely Events', AI1EC_PLUGIN_NAME ); ?>
36
+ </a>
37
+ </div>
38
  </div>
39
  </div>
40
  <div class="ai1ec-news">
41
+ <h2>
42
+ <i class="ai1ec-fa ai1ec-fa-bullhorn"></i>
43
+ <?php _e( 'Timely News', AI1EC_PLUGIN_NAME ); ?>
44
  <small>
45
  <a href="http://time.ly/blog?utm_source=dashboard&nbsp;utm_medium=blog&nbsp;utm_term=ai1ec-pro&nbsp;utm_content=1.11.4&nbsp;utm_campaign=news"
46
  target="_blank">
51
  </h2>
52
  <div>
53
  <?php if ( count( $news ) > 0 ) : ?>
54
+ <?php foreach ( $news as $n ) :
55
+ $ga_args = array(
56
+ 'utm_source' => 'dashboard',
57
+ 'utm_medium' => 'blog',
58
+ 'utm_campaign' => 'news',
59
+ 'utm_term' => urlencode(
60
+ strtolower( substr( $n->get_title(), 0, 40 ) )
61
+ ),
62
+ );
63
+ $href = esc_attr( add_query_arg( $ga_args, $n->get_permalink() ) );
64
+ $desc = preg_replace( '/\s+?(\S+)?$/', '', $n->get_description() );
65
+ $desc = wp_trim_words(
66
+ $desc,
67
+ 40,
68
+ ' <a href="' . $href . '" target="_blank">[&hellip;]</a>'
69
+ );
70
+ ?>
71
  <article>
72
  <header>
73
+ <h4>
74
+ <a href="<?php echo $href; ?>" target="_blank">
75
+ <?php echo $n->get_title(); ?>
76
+ </a>
77
+ </h4>
 
 
 
 
 
 
78
  </header>
79
+ <p><?php echo $desc; ?></p>
 
 
80
  </article>
81
+ <?php endforeach; ?>
82
  <?php else : ?>
83
  <p><em>No news available.</em></p>
84
+ <?php endif; ?>
85
  </div>
86
  </div>
87
 
public/admin/box_time_and_date.php CHANGED
@@ -80,7 +80,13 @@
80
  value="<?php echo $end->format_to_javascript(); ?>">
81
  </td>
82
  </tr>
83
- <tr>
 
 
 
 
 
 
84
  <td>
85
  <input type="checkbox" name="ai1ec_repeat" id="ai1ec_repeat"
86
  value="1"
@@ -98,7 +104,7 @@
98
  </div>
99
  </td>
100
  </tr>
101
- <tr>
102
  <td>
103
  <input type="checkbox" name="ai1ec_exclude" id="ai1ec_exclude"
104
  value="1"
@@ -120,7 +126,7 @@
120
  </span>
121
  </td>
122
  </tr>
123
- <tr>
124
  <td>
125
  <label for="ai1ec_exdate_calendar_icon" id="ai1ec_exclude_date_label">
126
  <?php _e( 'Exclude dates', AI1EC_PLUGIN_NAME ); ?>:
80
  value="<?php echo $end->format_to_javascript(); ?>">
81
  </td>
82
  </tr>
83
+ <?php
84
+ $recurrence_attr = '';
85
+ if ( $parent_event_id || $instance_id ) :
86
+ $recurrence_attr = ' class="ai1ec-hide"';
87
+ endif;
88
+ ?>
89
+ <tr<?php echo $recurrence_attr; ?>>
90
  <td>
91
  <input type="checkbox" name="ai1ec_repeat" id="ai1ec_repeat"
92
  value="1"
104
  </div>
105
  </td>
106
  </tr>
107
+ <tr<?php echo $recurrence_attr; ?>>
108
  <td>
109
  <input type="checkbox" name="ai1ec_exclude" id="ai1ec_exclude"
110
  value="1"
126
  </span>
127
  </td>
128
  </tr>
129
+ <tr<?php echo $recurrence_attr; ?>>
130
  <td>
131
  <label for="ai1ec_exdate_calendar_icon" id="ai1ec_exclude_date_label">
132
  <?php _e( 'Exclude dates', AI1EC_PLUGIN_NAME ); ?>:
public/admin/css/add_new_event.css CHANGED
@@ -1,3 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  /* General form attributes */
2
 
3
  /* Add/edit event form hidden by default to that DOM can be rearranged without
1
+ /* Event details meta box arrow and handle fix */
2
+
3
+ .js #ai1ec_event .handlediv:before {
4
+ content: '\f142';
5
+ right: 12px;
6
+ font: 400 20px/1 dashicons;
7
+ speak: none;
8
+ display: inline-block;
9
+ padding: 8px 10px;
10
+ top: 0;
11
+ position: relative;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ text-decoration: none!important;
15
+ }
16
+ .js #ai1ec_event.closed .handlediv:before {
17
+ content: '\f140';
18
+ }
19
+ .js #ai1ec_event .hndle {
20
+ cursor: default;
21
+ }
22
+
23
  /* General form attributes */
24
 
25
  /* Add/edit event form hidden by default to that DOM can be rearranged without
public/admin/css/bootstrap.min.css CHANGED
@@ -3073,8 +3073,8 @@ fieldset[disabled] .timely .ai1ec-btn-success.ai1ec-active {
3073
  }
3074
  .timely .ai1ec-btn-info {
3075
  color: #ffffff;
3076
- background-color: #5bc0de;
3077
- border-color: #46b8da;
3078
  }
3079
  .timely .ai1ec-btn-info:hover,
3080
  .timely .ai1ec-btn-info:focus,
@@ -3082,8 +3082,8 @@ fieldset[disabled] .timely .ai1ec-btn-success.ai1ec-active {
3082
  .timely .ai1ec-btn-info.ai1ec-active,
3083
  .ai1ec-open .ai1ec-dropdown-toggle.timely .ai1ec-btn-info {
3084
  color: #ffffff;
3085
- background-color: #39b3d7;
3086
- border-color: #269abc;
3087
  }
3088
  .timely .ai1ec-btn-info:active,
3089
  .timely .ai1ec-btn-info.ai1ec-active,
@@ -3105,11 +3105,11 @@ fieldset[disabled] .timely .ai1ec-btn-info:active,
3105
  .timely .ai1ec-btn-info.ai1ec-disabled.ai1ec-active,
3106
  .timely .ai1ec-btn-info[disabled].ai1ec-active,
3107
  fieldset[disabled] .timely .ai1ec-btn-info.ai1ec-active {
3108
- background-color: #5bc0de;
3109
- border-color: #46b8da;
3110
  }
3111
  .timely .ai1ec-btn-info .ai1ec-badge {
3112
- color: #5bc0de;
3113
  background-color: #fff;
3114
  }
3115
  .timely .ai1ec-btn-link {
@@ -4223,11 +4223,11 @@ textarea.ai1ec-input-group-sm > .ai1ec-input-group-btn > .ai1ec-btn {
4223
  background-color: #449d44;
4224
  }
4225
  .ai1ec-label-info {
4226
- background-color: #5bc0de;
4227
  }
4228
  .ai1ec-label-info[href]:hover,
4229
  .ai1ec-label-info[href]:focus {
4230
- background-color: #31b0d5;
4231
  }
4232
  .ai1ec-label-warning {
4233
  background-color: #f0ad4e;
3073
  }
3074
  .timely .ai1ec-btn-info {
3075
  color: #ffffff;
3076
+ background-color: #f48121;
3077
+ border-color: #f0730c;
3078
  }
3079
  .timely .ai1ec-btn-info:hover,
3080
  .timely .ai1ec-btn-info:focus,
3082
  .timely .ai1ec-btn-info.ai1ec-active,
3083
  .ai1ec-open .ai1ec-dropdown-toggle.timely .ai1ec-btn-info {
3084
  color: #ffffff;
3085
+ background-color: #e16c0b;
3086
+ border-color: #b55709;
3087
  }
3088
  .timely .ai1ec-btn-info:active,
3089
  .timely .ai1ec-btn-info.ai1ec-active,
3105
  .timely .ai1ec-btn-info.ai1ec-disabled.ai1ec-active,
3106
  .timely .ai1ec-btn-info[disabled].ai1ec-active,
3107
  fieldset[disabled] .timely .ai1ec-btn-info.ai1ec-active {
3108
+ background-color: #f48121;
3109
+ border-color: #f0730c;
3110
  }
3111
  .timely .ai1ec-btn-info .ai1ec-badge {
3112
+ color: #f48121;
3113
  background-color: #fff;
3114
  }
3115
  .timely .ai1ec-btn-link {
4223
  background-color: #449d44;
4224
  }
4225
  .ai1ec-label-info {
4226
+ background-color: #f48121;
4227
  }
4228
  .ai1ec-label-info[href]:hover,
4229
  .ai1ec-label-info[href]:focus {
4230
+ background-color: #d7680b;
4231
  }
4232
  .ai1ec-label-warning {
4233
  background-color: #f0ad4e;
public/admin/css/settings.css CHANGED
@@ -15,10 +15,21 @@
15
 
16
  /* Support box */
17
 
18
- .ai1ec-support-placeholder {
19
  text-align: center;
20
  margin: 20px 0;
21
  }
 
 
 
 
 
 
 
 
 
 
 
22
  #ai1ec-support {
23
  background: #f9f9f9;
24
  min-width: 350px;
@@ -38,8 +49,10 @@
38
  }
39
  #ai1ec-support .timely-logo a {
40
  background: url(../img/timely-logo.png) no-repeat center center;
 
 
41
  display: block;
42
- height: 140px;
43
  }
44
  #ai1ec-support .timely-intro {
45
  text-align: center;
@@ -96,7 +109,6 @@
96
  }
97
 
98
  #ai1ec-support .ai1ec-news h2 small {
99
- font-family: sans-serif;
100
  font-size: 0.8em;
101
  margin-left: 0.3em;
102
  }
@@ -109,12 +121,6 @@
109
  border-top: 1px solid #e0e0e0;
110
  padding-top: 5px;
111
  }
112
- #ai1ec-support .ai1ec-news article div {
113
- font-size: 0.9em;
114
- overflow: hidden;
115
- text-overflow: ellipsis;
116
- white-space: nowrap;
117
- }
118
 
119
  /* General settings */
120
 
15
 
16
  /* Support box */
17
 
18
+ .ai1ec-support-buttons {
19
  text-align: center;
20
  margin: 20px 0;
21
  }
22
+ .timely .ai1ec-support-buttons .ai1ec-btn-block {
23
+ margin-bottom: 5px;
24
+ }
25
+ @media ( min-width: 1200px ) {
26
+ #ai1ec-addons-col {
27
+ padding-right: 0;
28
+ }
29
+ #ai1ec-events-col {
30
+ padding-left: 0;
31
+ }
32
+ }
33
  #ai1ec-support {
34
  background: #f9f9f9;
35
  min-width: 350px;
49
  }
50
  #ai1ec-support .timely-logo a {
51
  background: url(../img/timely-logo.png) no-repeat center center;
52
+ -webkit-background-size: 250px auto;
53
+ background-size: 250px auto;
54
  display: block;
55
+ height: 109px;
56
  }
57
  #ai1ec-support .timely-intro {
58
  text-align: center;
109
  }
110
 
111
  #ai1ec-support .ai1ec-news h2 small {
 
112
  font-size: 0.8em;
113
  margin-left: 0.3em;
114
  }
121
  border-top: 1px solid #e0e0e0;
122
  padding-top: 5px;
123
  }
 
 
 
 
 
 
124
 
125
  /* General settings */
126
 
public/admin/img/timely-logo.png CHANGED
Binary file
public/admin/less/timely-variables.less CHANGED
@@ -3,6 +3,7 @@
3
  //
4
 
5
  @brand-primary: #6AAB2D;
 
6
  @font-size-base: 13px;
7
  @font-family-sans-serif: "Open Sans", Arial, sans-serif;
8
  @headings-color: @gray-dark;
3
  //
4
 
5
  @brand-primary: #6AAB2D;
6
+ @brand-info: #F48121;
7
  @font-size-base: 13px;
8
  @font-family-sans-serif: "Open Sans", Arial, sans-serif;
9
  @headings-color: @gray-dark;
public/admin/twig/bootstrap_tabs.twig CHANGED
@@ -35,6 +35,7 @@
35
  {% if stacked %}</div><div class="ai1ec-col-sm-9">{% endif %}
36
 
37
  <div class="ai1ec-tab-content {{ content_class }}">
 
38
  {% for id, data in tabs %}
39
  <div class="ai1ec-tab-pane" id="ai1ec-{{ id }}">
40
  {% for element in data.elements %}
35
  {% if stacked %}</div><div class="ai1ec-col-sm-9">{% endif %}
36
 
37
  <div class="ai1ec-tab-content {{ content_class }}">
38
+ {{ pre_tabs_markup | raw}}
39
  {% for id, data in tabs %}
40
  <div class="ai1ec-tab-pane" id="ai1ec-{{ id }}">
41
  {% for element in data.elements %}
public/admin/twig/setting/calendar-page-selector.twig ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <p><a target="_blank" href="{{ link }}">
2
+ {{ view }} "{{ title|raw }}"
3
+ <i class="ai1ec-fa ai1ec-fa-arrow-right"></i>
4
+ </a></p>
public/js/pages/add_new_event.js CHANGED
@@ -118,4 +118,4 @@
118
  * limitations under the License.
119
  * ======================================================================== */
120
 
121
- timely.define("domReady",[],function(){function u(e){var t;for(t=0;t<e.length;t++)e[t](n)}function a(){var e=r;t&&e.length&&(r=[],u(e))}function f(){t||(t=!0,o&&clearInterval(o),a())}function c(e){return t?e(n):r.push(e),c}var e=typeof window!="undefined"&&window.document,t=!e,n=e?document:null,r=[],i,s,o;if(e){if(document.addEventListener)document.addEventListener("DOMContentLoaded",f,!1),window.addEventListener("load",f,!1);else if(window.attachEvent){window.attachEvent("onload",f),s=document.createElement("div");try{i=window.frameElement===null}catch(l){}s.doScroll&&i&&window.external&&(o=setInterval(function(){try{s.doScroll(),f()}catch(e){}},30))}(document.readyState==="complete"||document.readyState==="interactive")&&f()}return c.version="2.0.0",c.load=function(e,t,n,r){r.isBuild?n(null):c(n)},c}),timely.define("external_libs/bootstrap/tab",["jquery_timely"],function(e){var t=function(t){this.element=e(t)};t.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.ai1ec-dropdown-menu)"),r=t.data("target");r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("ai1ec-active"))return;var i=n.find(".ai1ec-active:last a")[0],s=e.Event("show.bs.tab",{relatedTarget:i});t.trigger(s);if(s.isDefaultPrevented())return;var o=e(r);this.activate(t.parent("li"),n),this.activate(o,o.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:i})})},t.prototype.activate=function(t,n,r){function o(){i.removeClass("ai1ec-active").find("> .ai1ec-dropdown-menu > .ai1ec-active").removeClass("ai1ec-active"),t.addClass("ai1ec-active"),s?(t[0].offsetWidth,t.addClass("ai1ec-in")):t.removeClass("ai1ec-fade"),t.parent(".ai1ec-dropdown-menu")&&t.closest("li.ai1ec-dropdown").addClass("ai1ec-active"),r&&r()}var i=n.find("> .ai1ec-active"),s=r&&e.support.transition&&i.hasClass("ai1ec-fade");s?i.one(e.support.transition.end,o).emulateTransitionEnd(150):o(),i.removeClass("ai1ec-in")};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tab");i||r.data("bs.tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.bs.tab.data-api",'[data-toggle="ai1ec-tab"], [data-toggle="ai1ec-pill"]',function(t){t.preventDefault(),e(this).tab("show")})}),timely.define("libs/utils",["jquery_timely","external_libs/bootstrap/tab"],function(e){var t=function(){return{is_float:function(e){return!isNaN(parseFloat(e))},is_valid_coordinate:function(e,t){var n=t?90:180;return this.is_float(e)&&Math.abs(e)<n},convert_comma_to_dot:function(e){return e.replace(",",".")},field_has_value:function(t){var n="#"+t,r=e(n),i=!1;return r.length===1&&(i=e.trim(r.val())!==""),i},make_alert:function(t,n,r){var i="";switch(n){case"error":i="ai1ec-alert ai1ec-alert-danger";break;case"success":i="ai1ec-alert ai1ec-alert-success";break;default:i="ai1ec-alert"}var s=e("<div />",{"class":i,html:t});if(!r){var o=e("<button>",{type:"button","class":"ai1ec-close","data-dismiss":"ai1ec-alert",text:"×"});s.prepend(o)}return s},get_ajax_url:function(){return typeof window.ajaxurl=="undefined"?"http://localhost/wordpress/wp-admin/admin-ajax.php":window.ajaxurl},isUrl:function(e){var t=/(http|https|webcal):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(e)},isValidEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)},activate_saved_tab_on_page_load:function(t){null===t||undefined===t?e("ul.ai1ec-nav a:first").tab("show"):e("ul.ai1ec-nav a[href="+t+"]").tab("show")}}}();return t}),timely.define("scripts/add_new_event/event_location/input_coordinates_utility_functions",["jquery_timely","ai1ec_config","libs/utils"],function(e,t,n){var r=function(){e("#ai1ec_input_coordinates:checked").length>0&&e("#ai1ec_table_coordinates input.coordinates").each(function(){this.value=n.convert_comma_to_dot(this.value)})},i=function(t,n){var r=e("<div />",{text:n,"class":"ai1ec-error"});e(t).after(r)},s=function(t,n){t.target.id==="post"&&(t.stopImmediatePropagation(),t.preventDefault(),e("#publish").removeClass("button-primary-disabled"),e("#publish").siblings(".spinner").css("visibility","hidden")),e(n).focus()},o=function(){var t=n.field_has_value("ai1ec_address"),r=!0;return e(".coordinates").each(function(){var e=n.field_has_value(this.id);e||(r=!1)}),t||r},u=function(n){var r=!0,o=!1;return e("#ai1ec_input_coordinates:checked").length>0&&(e("div.ai1ec-error").remove(),e("#ai1ec_table_coordinates input.coordinates").each(function(){var n=e(this).hasClass("latitude"),s=n?t.error_message_not_entered_lat:t.error_message_not_entered_long;this.value===""&&(r=!1,o===!1&&(o=this),i(this,s))})),r===!1&&s(n,o),r},a=function(r){if(e("#ai1ec_input_coordinates:checked").length===1){e("div.ai1ec-error").remove();var o=!0,u=!1,a=!1;return e("#ai1ec_table_coordinates input.coordinates").each(function(){if(this.value===""){a=!0;return}var r=e(this).hasClass("latitude"),s=r?t.error_message_not_valid_lat:t.error_message_not_valid_long;n.is_valid_coordinate(this.value,r)||(o=!1,u===!1&&(u=this),i(this,s))}),o===!1&&s(r,u),a===!0&&(o=!1),o}};return{ai1ec_convert_commas_to_dots_for_coordinates:r,ai1ec_show_error_message_after_element:i,check_if_address_or_coordinates_are_set:o,ai1ec_check_lat_long_fields_filled_when_publishing_event:u,ai1ec_check_lat_long_ok_for_search:a}}),timely.define("external_libs/jquery.autocomplete_geomod",["jquery_timely"],function(e){e.fn.extend({autocomplete:function(t,n){var r=typeof t=="string";return n=e.extend({},e.Autocompleter.defaults,{url:r?t:null,data:r?null:t,delay:r?e.Autocompleter.defaults.delay:10,max:n&&!n.scroll?10:150},n),n.highlight=n.highlight||function(e){return e},n.formatMatch=n.formatMatch||n.formatItem,this.each(function(){new e.Autocompleter(this,n)})},result:function(e){return this.bind("result",e)},search:function(e){return this.trigger("search",[e])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(e){return this.trigger("setOptions",[e])},unautocomplete:function(){return this.trigger("unautocomplete")}}),e.Autocompleter=function(t,n){function d(){var r=h.selected();if(!r)return!1;var s=r.result;o=s;if(n.multiple){var u=m(i.val());if(u.length>1){var a=n.multipleSeparator.length,f=e(t).selection().start,l,c=0;e.each(u,function(e,t){c+=t.length;if(f<=c)return l=e,!1;c+=a}),u[l]=s,s=u.join(n.multipleSeparator)}s+=n.multipleSeparator}return i.val(s),w(),i.trigger("result",[r.data,r.value]),!0}function v(e,t){if(f==r.DEL){h.hide();return}var s=i.val();if(!t&&s==o)return;o=s,s=g(s),s.length>=n.minChars?(i.addClass(n.loadingClass),n.matchCase||(s=s.toLowerCase()),S(s,E,w)):(T(),h.hide())}function m(t){return t?n.multiple?e.map(t.split(n.multipleSeparator),function(n){return e.trim(t).length?e.trim(n):null}):[e.trim(t)]:[""]}function g(r){if(!n.multiple)return r;var i=m(r);if(i.length==1)return i[0];var s=e(t).selection().start;return s==r.length?i=m(r):i=m(r.replace(r.substring(s),"")),i[i.length-1]}function y(s,u){n.autoFill&&g(i.val()).toLowerCase()==s.toLowerCase()&&f!=r.BACKSPACE&&(i.val(i.val()+u.substring(g(o).length)),e(t).selection(o.length,o.length+u.length))}function b(){clearTimeout(s),s=setTimeout(w,200)}function w(){var e=h.visible();h.hide(),clearTimeout(s),T(),n.mustMatch&&i.search(function(e){if(!e)if(n.multiple){var t=m(i.val()).slice(0,-1);i.val(t.join(n.multipleSeparator)+(t.length?n.multipleSeparator:""))}else i.val(""),i.trigger("result",null)})}function E(e,t){t&&t.length&&a?(T(),h.display(t,e),y(e,t[0].value),h.show()):w()}function S(r,i,s){n.matchCase||(r=r.toLowerCase());var o=u.load(r);if(o&&o.length)i(r,o);else if(n.geocoder){var a=g(r),f={address:a};n.region&&(f.region=n.region),n.geocoder.geocode(f,function(e,t){var s=n.parse(e,t,a);u.add(r,s),i(r,s)})}else if(typeof n.url=="string"&&n.url.length>0){var l={timestamp:+(new Date)};e.each(n.extraParams,function(e,t){l[e]=typeof t=="function"?t():t}),e.ajax({mode:"abort",port:"autocomplete"+t.name,dataType:n.dataType,url:n.url,data:e.extend({q:g(r),limit:n.max},l),success:function(e){var t=n.parse&&n.parse(e)||x(e);u.add(r,t),i(r,t)}})}else h.emptyList(),s(r)}function x(t){var r=[],i=t.split("\n");for(var s=0;s<i.length;s++){var o=e.trim(i[s]);o&&(o=o.split("|"),r[r.length]={data:o,value:o[0],result:n.formatResult&&n.formatResult(o,o[0])||o[0]})}return r}function T(){i.removeClass(n.loadingClass)}var r={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8},i=e(t).attr("autocomplete","off").addClass(n.inputClass),s,o="",u=e.Autocompleter.Cache(n),a=0,f,l=navigator.userAgent.match(/opera/i),c={mouseDownOnSelect:!1},h=e.Autocompleter.Select(n,t,d,c),p;l&&e(t.form).bind("submit.autocomplete",function(){if(p)return p=!1,!1}),i.bind((l?"keypress":"keydown")+".autocomplete",function(t){a=1,f=t.keyCode;switch(t.keyCode){case r.UP:t.preventDefault(),h.visible()?h.prev():v(0,!0);break;case r.DOWN:t.preventDefault(),h.visible()?h.next():v(0,!0);break;case r.PAGEUP:t.preventDefault(),h.visible()?h.pageUp():v(0,!0);break;case r.PAGEDOWN:t.preventDefault(),h.visible()?h.pageDown():v(0,!0);break;case n.multiple&&e.trim(n.multipleSeparator)==","&&r.COMMA:case r.TAB:case r.RETURN:if(d())return t.preventDefault(),p=!0,!1;break;case r.ESC:h.hide();break;default:clearTimeout(s),s=setTimeout(v,n.delay)}}).focus(function(){a++}).blur(function(){a=0,c.mouseDownOnSelect||b()}).click(function(){a++>1&&!h.visible()&&v(0,!0)}).bind("search",function(){function n(e,n){var r;if(n&&n.length)for(var s=0;s<n.length;s++)if(n[s].result.toLowerCase()==e.toLowerCase()){r=n[s];break}typeof t=="function"?t(r):i.trigger("result",r&&[r.data,r.value])}var t=arguments.length>1?arguments[1]:null;e.each(m(i.val()),function(e,t){S(t,n,n)})}).bind("flushCache",function(){u.flush()}).bind("setOptions",function(){e.extend(n,arguments[1]),"data"in arguments[1]&&u.populate()}).bind("unautocomplete",function(){h.unbind(),i.unbind(),e(t.form).unbind(".autocomplete")})},e.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:!1,matchSubset:!0,matchContains:!1,cacheLength:10,max:100,mustMatch:!1,extraParams:{},selectFirst:!0,formatItem:function(e){return e[0]},formatMatch:null,autoFill:!1,width:0,multiple:!1,multipleSeparator:", ",highlight:function(e,t){return e.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+t.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:!0,scrollHeight:180},e.Autocompleter.Cache=function(t){function i(e,n){t.matchCase||(e=e.toLowerCase());var r=e.indexOf(n);return t.matchContains=="word"&&(r=e.toLowerCase().search("\\b"+n.toLowerCase())),r==-1?!1:r==0||t.matchContains}function s(e,i){r>t.cacheLength&&u(),n[e]||r++,n[e]=i}function o(){if(!t.data)return!1;var n={},r=0;t.url||(t.cacheLength=1),n[""]=[];for(var i=0,o=t.data.length;i<o;i++){var u=t.data[i];u=typeof u=="string"?[u]:u;var a=t.formatMatch(u,i+1,t.data.length);if(a===!1)continue;var f=a.charAt(0).toLowerCase();n[f]||(n[f]=[]);var l={value:a,data:u,result:t.formatResult&&t.formatResult(u)||a};n[f].push(l),r++<t.max&&n[""].push(l)}e.each(n,function(e,n){t.cacheLength++,s(e,n)})}function u(){n={},r=0}var n={},r=0;return setTimeout(o,25),{flush:u,add:s,populate:o,load:function(s){if(!t.cacheLength||!r)return null;if(!t.url&&t.matchContains){var o=[];for(var u in n)if(u.length>0){var a=n[u];e.each(a,function(e,t){i(t.value,s)&&o.push(t)})}return o}if(n[s])return n[s];if(t.matchSubset)for(var f=s.length-1;f>=t.minChars;f--){var a=n[s.substr(0,f)];if(a){var o=[];return e.each(a,function(e,t){i(t.value,s)&&(o[o.length]=t)}),o}}return null}}},e.Autocompleter.Select=function(t,n,r,i){function p(){if(!l)return;c=e("<div/>").hide().addClass(t.resultsClass).css("position","absolute").appendTo(document.body),h=e("<ul/>").appendTo(c).mouseover(function(t){d(t).nodeName&&d(t).nodeName.toUpperCase()=="LI"&&(u=e("li",h).removeClass(s.ACTIVE).index(d(t)),e(d(t)).addClass(s.ACTIVE))}).click(function(t){return e(d(t)).addClass(s.ACTIVE),r(),n.focus(),!1}).mousedown(function(){i.mouseDownOnSelect=!0}).mouseup(function(){i.mouseDownOnSelect=!1}),t.width>0&&c.css("width",t.width),l=!1}function d(e){var t=e.target;while(t&&t.tagName!="LI")t=t.parentNode;return t?t:[]}function v(e){o.slice(u,u+1).removeClass(s.ACTIVE),m(e);var n=o.slice(u,u+1).addClass(s.ACTIVE);if(t.scroll){var r=0;o.slice(0,u).each(function(){r+=this.offsetHeight}),r+n[0].offsetHeight-h.scrollTop()>h[0].clientHeight?h.scrollTop(r+n[0].offsetHeight-h.innerHeight()):r<h.scrollTop()&&h.scrollTop(r)}}function m(e){u+=e,u<0?u=o.size()-1:u>=o.size()&&(u=0)}function g(e){return t.max&&t.max<e?t.max:e}function y(){h.empty();var n=g(a.length);for(var r=0;r<n;r++){if(!a[r])continue;var i=t.formatItem(a[r].data,r+1,n,a[r].value,f);if(i===!1)continue;var l=e("<li/>").html(t.highlight(i,f)).addClass(r%2==0?"ac_even":"ac_odd").appendTo(h)[0];e.data(l,"ac_data",a[r])}o=h.find("li"),t.selectFirst&&(o.slice(0,1).addClass(s.ACTIVE),u=0),e.fn.bgiframe&&h.bgiframe()}var s={ACTIVE:"ac_over"},o,u=-1,a,f="",l=!0,c,h;return{display:function(e,t){p(),a=e,f=t,y()},next:function(){v(1)},prev:function(){v(-1)},pageUp:function(){u!=0&&u-8<0?v(-u):v(-8)},pageDown:function(){u!=o.size()-1&&u+8>o.size()?v(o.size()-1-u):v(8)},hide:function(){c&&c.hide(),o&&o.removeClass(s.ACTIVE),u=-1},visible:function(){return c&&c.is(":visible")},current:function(){return this.visible()&&(o.filter("."+s.ACTIVE)[0]||t.selectFirst&&o[0])},show:function(){var r=e(n).offset();c.css({width:typeof t.width=="string"||t.width>0?t.width:e(n).width(),top:r.top+n.offsetHeight,left:r.left}).show();if(t.scroll){h.scrollTop(0),h.css({maxHeight:t.scrollHeight,overflow:"auto"});if(navigator.userAgent.match(/msie/i)&&typeof document.body.style.maxHeight=="undefined"){var i=0;o.each(function(){i+=this.offsetHeight});var s=i>t.scrollHeight;h.css("height",s?t.scrollHeight:i),s||o.width(h.width()-parseInt(o.css("padding-left"))-parseInt(o.css("padding-right")))}}},selected:function(){var t=o&&o.filter("."+s.ACTIVE).removeClass(s.ACTIVE);return t&&t.length&&e.data(t[0],"ac_data")},emptyList:function(){h&&h.empty()},unbind:function(){c&&c.remove()}}},e.fn.selection=function(e,t){if(e!==undefined)return this.each(function(){if(this.createTextRange){var n=this.createTextRange();t===undefined||e==t?(n.move("character",e),n.select()):(n.collapse(!0),n.moveStart("character",e),n.moveEnd("character",t),n.select())}else this.setSelectionRange?this.setSelectionRange(e,t):this.selectionStart&&(this.selectionStart=e,this.selectionEnd=t)});var n=this[0];if(n.createTextRange){var r=document.selection.createRange(),i=n.value,s="<->",o=r.text.length;r.text=s;var u=n.value.indexOf(s);return n.value=i,this.selection(u,u+o),{start:u,end:u+o}}if(n.selectionStart!==undefined)return{start:n.selectionStart,end:n.selectionEnd}}}),timely.define("external_libs/geo_autocomplete",["jquery_timely","external_libs/jquery.autocomplete_geomod"],function(e){e.fn.extend({geo_autocomplete:function(t,n){return options=e.extend({},e.Autocompleter.defaults,{geocoder:t,mapwidth:100,mapheight:100,maptype:"terrain",mapkey:"ABQIAAAAbnvDoAoYOSW2iqoXiGTpYBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQNumU68AwGqjbSNF9YO8NokKst8w",mapsensor:!1,parse:function(t,n,r){var i=[];return t&&n&&n=="OK"&&e.each(t,function(t,n){if(n.geometry&&n.geometry.viewport){var s=n.formatted_address.split(","),o=s[0];e.each(s,function(t,n){if(n.toLowerCase().indexOf(r.toLowerCase())!=-1)return o=e.trim(n),!1}),i.push({data:n,value:o,result:o})}}),i},formatItem:function(e,t,n,r){var i="https://maps.google.com/maps/api/staticmap?visible="+e.geometry.viewport.getSouthWest().toUrlValue()+"|"+e.geometry.viewport.getNorthEast().toUrlValue()+"&size="+options.mapwidth+"x"+options.mapheight+"&maptype="+options.maptype+"&key="+options.mapkey+"&sensor="+(options.mapsensor?"true":"false"),s=e.formatted_address.replace(/,/gi,",<br/>");return'<img src="'+i+'" width="'+options.mapwidth+'" height="'+options.mapheight+'" /> '+s+'<br clear="both"/>'}},n),options.highlight=options.highlight||function(e){return e},options.formatMatch=options.formatMatch||options.formatItem,options.resultsClass="ai1ec-geo-ac-results-not-ready",this.each(function(){e(this).one("focus",function(){var t=setInterval(function(){var n=e(".ai1ec-geo-ac-results-not-ready");n.length&&(n.removeClass("ai1ec-geo-ac-results-not-ready").addClass("ai1ec-geo-ac-results").children("ul").addClass("ai1ec-dropdown-menu"),clearInterval(t))},500)}),new e.Autocompleter(this,options)})}})}),timely.define("scripts/add_new_event/event_location/gmaps_helper",["jquery_timely","domReady","ai1ec_config","scripts/add_new_event/event_location/input_coordinates_utility_functions","external_libs/jquery.autocomplete_geomod","external_libs/geo_autocomplete"],function(e,t,n,r){var i,s,o,u,a,f,l=function(t){e("input.longitude").val(t.latLng.lng()),e("input.latitude").val(t.latLng.lat()),e("#ai1ec_input_coordinates:checked").length===0&&e("#ai1ec_input_coordinates").trigger("click")},c=function(){!navigator.geolocation||navigator.geolocation.getCurrentPosition(function(e){var t=r.check_if_address_or_coordinates_are_set();if(t===!1){var n=e.coords.latitude,i=e.coords.longitude;s=new google.maps.LatLng(n,i),a.setPosition(s),u.setCenter(s),u.setZoom(15),f=e}})},h=function(){n.disable_autocompletion||e("#ai1ec_address").geo_autocomplete(new google.maps.Geocoder,{selectFirst:!1,minChars:3,cacheLength:50,width:300,scroll:!0,scrollHeight:330,region:n.region}).result(function(e,t){t&&d(t)}).change(function(){if(e(this).val().length>0){var t=e(this).val();i.geocode({address:t,region:n.region},function(e,t){t===google.maps.GeocoderStatus.OK&&d(e[0])})}})},p=function(){i=new google.maps.Geocoder,s=new google.maps.LatLng(9.965,-83.327),o={zoom:0,mapTypeId:google.maps.MapTypeId.ROADMAP,center:s},t(function(){e("#ai1ec_map_canvas").length>0&&(u=new google.maps.Map(e("#ai1ec_map_canvas").get(0),o),a=new google.maps.Marker({map:u,draggable:!0}),google.maps.event.addListener(a,"dragend",l),a.setPosition(s),c(),h(),m())})},d=function(t){u.setCenter(t.geometry.location),u.setZoom(15),a.setPosition(t.geometry.location),e("#ai1ec_address").val(t.formatted_address),e("#ai1ec_latitude").val(t.geometry.location.lat()),e("#ai1ec_longitude").val(t.geometry.location.lng()),e("#ai1ec_input_coordinates").is(":checked")||e("#ai1ec_input_coordinates").click();var n="",r="",i="",s=0,o=0,f="";for(var l=0;l<t.address_components.length;l++)switch(t.address_components[l].types[0]){case"street_number":n=t.address_components[l].long_name;break;case"route":r=t.address_components[l].long_name;break;case"locality":i=t.address_components[l].long_name;break;case"administrative_area_level_1":f=t.address_components[l].long_name;break;case"postal_code":s=t.address_components[l].long_name;break;case"country":o=t.address_components[l].long_name}var c=n.length>0?n+" ":"";c+=r.length>0?r:"",s=s!==0?s:"",e("#ai1ec_city").val(i),e("#ai1ec_province").val(f),e("#ai1ec_postal_code").val(s),e("#ai1ec_country").val(o)},v=function(){var t=parseFloat(e("input.latitude").val()),n=parseFloat(e("input.longitude").val()),r=new google.maps.LatLng(t,n);u.setCenter(r),u.setZoom(15),a.setPosition(r)},m=function(){e("#ai1ec_input_coordinates:checked").length===0?(e("#ai1ec_table_coordinates").css({visibility:"hidden"}),e("#ai1ec_address").change()):v()},g=function(){return a},y=function(){return f};return{init_gmaps:p,ai1ec_update_map_from_coordinates:v,get_marker:g,get_position:y}}),timely.define("scripts/add_new_event/event_location/input_coordinates_event_handlers",["jquery_timely","scripts/add_new_event/event_location/input_coordinates_utility_functions","scripts/add_new_event/event_location/gmaps_helper","ai1ec_config"],function(e,t,n,r){var i=function(t){e(this).is(":checked")?e(".ai1ec_box_map").addClass("ai1ec_box_map_visible").hide().slideDown("fast"):e(".ai1ec_box_map").slideUp("fast")},s=function(t){this.checked===!0?e("#ai1ec_table_coordinates").css({visibility:"visible"}):(e("#ai1ec_table_coordinates").css({visibility:"hidden"}),e("#ai1ec_table_coordinates input").val(""),e("div.ai1ec-error").remove())},o=function(e){t.ai1ec_convert_commas_to_dots_for_coordinates();var r=t.ai1ec_check_lat_long_ok_for_search(e);r===!0&&n.ai1ec_update_map_from_coordinates()};return{toggle_visibility_of_google_map_on_click:i,toggle_visibility_of_coordinate_fields_on_click:s,update_map_from_coordinates_on_blur:o}}),timely.define("scripts/add_new_event/event_date_time/date_time_utility_functions",["jquery_timely","ai1ec_config","libs/utils"],function(e,t,n){var r=n.get_ajax_url(),i=function(t,n,r,i,s,o){e(t).val(i),e("#ai1ec_repeat_box").modal("hide");var u=e.trim(e(n).text());u.lastIndexOf(":")===-1&&(u=u.substring(0,u.length-3),e(n).text(u+":")),e(s).attr("disabled",!1),e(r).fadeOut("fast",function(){e(this).text(o.message),e(this).fadeIn("fast")})},s=function(t,n,r,i){e("#ai1ec_repeat_box .ai1ec-alert-danger").text(r.message).removeClass("ai1ec-hide"),e(i).attr("disabled",!1),e(t).val("");var s=e.trim(e(n).text());s.lastIndexOf("...")===-1&&(s=s.substring(0,s.length-1),e(n).text(s+"...")),e(this).closest("tr").find(".ai1ec_rule_text").text()===""&&e(t).siblings("input:checkbox").removeAttr("checked")},o=function(t,n,r,i,s){e(document).on("click",t,function(){if(!e(n).is(":checked")){e(n).attr("checked",!0);var t=e.trim(e(r).text());t=t.substring(0,t.length-3),e(r).text(t+":")}return l(i,s),!1})},u=function(t,n,r,i,s){e(t).click(function(){if(e(this).is(":checked"))this.id==="ai1ec_repeat"&&e("#ai1ec_exclude").removeAttr("disabled"),l(i,s);else{this.id==="ai1ec_repeat"&&e("#ai1ec_exclude").attr("disabled",!0),e(n).text("");var t=e.trim(e(r).text());t=t.substring(0,t.length-1),e(r).text(t+"...")}})},a=function(t,n,r){if(e.trim(e(t).text())===""){e(n).removeAttr("checked"),e("#ai1ec_repeat").is(":checked")||e("#ai1ec_exclude").attr("disabled",!0);var i=e.trim(e(r).text());i.lastIndexOf("...")===-1&&(i=i.substring(0,i.length-1),e(r).text(i+"..."))}},f=function(){e("#ai1ec_count, #ai1ec_daily_count, #ai1ec_weekly_count, #ai1ec_monthly_count, #ai1ec_yearly_count").rangeinput({css:{input:"ai1ec-range",slider:"ai1ec-slider",progress:"ai1ec-progress",handle:"ai1ec-handle"}});var n={start_date_input:"#ai1ec_until-date-input",start_time:"#ai1ec_until-time",date_format:t.date_format,month_names:t.month_names,day_names:t.day_names,week_start_day:t.week_start_day,twentyfour_hour:t.twentyfour_hour,now:new Date(t.now*1e3)};e.inputdate(n)},l=function(t,n){var i=e("#ai1ec_repeat_box"),s=e(".ai1ec-loading",i);i.modal({backdrop:"static"}),e.post(r,t,function(e){e.error?(window.alert(e.message),i.modal("hide")):(s.addClass("ai1ec-hide").after(e.message),typeof n=="function"&&n())},"json")};return{show_repeat_tabs:l,init_modal_widgets:f,click_on_modal_cancel:a,click_on_checkbox:u,click_on_ics_rule_text:o,repeat_form_error:s,repeat_form_success:i}}),timely.define("external_libs/jquery.calendrical_timespan",["jquery_timely"],function(e){function l(){var e=new Date;return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function c(e,t){return typeof e=="string"&&(e=new Date(e)),typeof t=="string"&&(t=new Date(t)),e.getUTCDate()===t.getUTCDate()&&e.getUTCMonth()===t.getUTCMonth()&&e.getUTCFullYear()===t.getUTCFullYear()?!0:!1}function h(e,t){if(e instanceof Date)return h(e.getUTCFullYear(),e.getUTCMonth());if(t==1){var n=e%4==0&&(e%100!=0||e%400==0);return n?29:28}return t==3||t==5||t==8||t==10?30:31}function p(e){return new Date(e.getTime()+864e5)}function d(e){return new Date(e.getTime()-864e5)}function v(e,t){return t==11?new Date(e+1,0,1):new Date(e,t+1,1)}function m(t,n,r,i){var s=i.monthNames.split(","),o=e("<thead />"),u=e("<tr />").appendTo(o);e("<th />").addClass("monthCell").append(e('<a href="javascript:;">&laquo;</a>').addClass("prevMonth").mousedown(function(e){g(t,r==0?n-1:n,r==0?11:r-1,i),e.preventDefault()})).appendTo(u),e("<th />").addClass("monthCell").attr("colSpan",5).append(e('<a href="javascript:;">'+s[r]+" "+n+"</a>").addClass("monthName")).appendTo(u),e("<th />").addClass("monthCell").append(e('<a href="javascript:;">&raquo;</a>').addClass("nextMonth").mousedown(function(){g(t,r==11?n+1:n,r==11?0:r+1,i)})).appendTo(u);var a=i.dayNames.split(","),f=parseInt(i.weekStartDay),l=[];for(var c=0,h=a.length;c<h;c++)l[c]=a[(c+f)%h];var p=e("<tr />").appendTo(o);return e.each(l,function(t,n){e("<td />").addClass("dayName").append(n).appendTo(p)}),o}function g(t,n,r,i){i=i||{};var s=parseInt(i.weekStartDay),o=i.today?i.today:l();o.setHours(0),o.setMinutes(0);var u=new Date(n,r,1),a=v(n,r),f=Math.abs(o.getTimezoneOffset());f!=0&&(o.setHours(o.getHours()+f/60),o.setMinutes(o.getMinutes()+f%60),u.setHours(u.getHours()+f/60),u.setMinutes(u.getMinutes()+f%60),a.setHours(a.getHours()+f/60),a.setMinutes(a.getMinutes()+f%60));var h=a.getUTCDay()-s;h<0?h=Math.abs(h)-1:h=6-h;for(var g=0;g<h;g++)a=p(a);var y=e("<table />");m(t,n,r,i).appendTo(y);var b=e("<tbody />").appendTo(y),w=e("<tr />"),E=u.getUTCDay()-s;E<0&&(E=7+E);for(var g=0;g<E;g++)u=d(u);while(u<=a){var S=e("<td />").addClass("day").append(e('<a href="javascript:;">'+u.getUTCDate()+"</a>").click(function(){var e=u;return function(){i&&i.selectDate&&i.selectDate(e)}}())).appendTo(w),x=c(u,o),T=i.selected&&c(i.selected,u);x&&S.addClass("today"),T&&S.addClass("selected"),x&&T&&S.addClass("today_selected"),u.getUTCMonth()!=r&&S.addClass("nonMonth");var N=u.getUTCDay();(N+1)%7==s&&(b.append(w),w=e("<tr />")),u=p(u)}w.children().length?b.append(w):w.remove(),t.empty().append(y)}function y(t,n){var r=n.selection&&f(n.selection);r&&(r.minute=Math.floor(r.minute/15)*15);var i=n.startTime&&n.startTime.hour*60+n.startTime.minute,s,o=e("<ul />");for(var a=0;a<24;a++)for(var l=0;l<60;l+=15){if(i&&i>a*60+l)continue;(function(){var t=u(a,l,n.isoTime),f=t;if(i!=null){var c=a*60+l-i;c<60?f+=" ("+c+" min)":c==60?f+=" (1 hr)":f+=" ("+Math.floor(c/60)+" hr "+c%60+" min)"}var h=e("<li />").append(e('<a href="javascript:;">'+f+"</a>").click(function(){n&&n.selectTime&&n.selectTime(t)}).mousemove(function(){e("li.selected",o).removeClass("selected")})).appendTo(o);!s&&a==n.defaultHour&&(s=h),r&&r.hour==a&&r.minute==l&&(h.addClass("selected"),s=h)})()}s&&setTimeout(function(){t[0].scrollTop=s[0].offsetTop-s.height()*2},0),t.empty().append(o)}function b(e){e.addClass("error").fadeOut("normal",function(){e.val(e.data("timespan.stored")).removeClass("error").fadeIn("fast")})}function w(){e(this).data("timespan.stored",this.value)}function E(t,n,r,i,a,f,l,c,h,p){r.val(r.data("timespan.initial_value")),f.val(f.data("timespan.initial_value")),l.get(0).checked=l.data("timespan.initial_value");var d=s(r,p,0,15);n.val(u(d.getUTCHours(),d.getUTCMinutes(),c)),t.val(o(d,h));var v=s(f,d.getTime(),1,15);a.val(u(v.getUTCHours(),v.getUTCMinutes(),c)),l.get(0).checked&&v.setUTCDate(v.getUTCDate()-1),i.val(o(v,h)),t.each(w),n.each(w),i.each(w),a.each(w),l.trigger("change.timespan"),e("#ai1ec_instant_event").trigger("change.timespan")}var t={us:{pattern:/([\d]{1,2})\/([\d]{1,2})\/([\d]{4}|[\d]{2})/,format:"m/d/y",order:"middleEndian",zeroPad:!1},iso:{pattern:/([\d]{4}|[\d]{2})-([\d]{1,2})-([\d]{1,2})/,format:"y-m-d",order:"bigEndian",zeroPad:!0},dot:{pattern:/([\d]{1,2}).([\d]{1,2}).([\d]{4}|[\d]{2})/,format:"d.m.y",order:"littleEndian",zeroPad:!1},def:{pattern:/([\d]{1,2})\/([\d]{1,2})\/([\d]{4}|[\d]{2})/,format:"d/m/y",order:"littleEndian",zeroPad:!1}},n=function(e){return e<10?"0"+e:e},r=function(e,t){typeof t=="undefined"&&(t=!1);var r=e.getUTCFullYear()+"-"+n(e.getUTCMonth()+1)+"-"+n(e.getUTCDate());return t&&(r+="T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":00"),r},i=function(e,t){var n=e.val(),r=null;if(n.length<4)r=new Date(t);else{r=new Date(n);var i=n.split("T"),s=i[0].split("-"),o=i[1].split(":");r.setUTCFullYear(s[0],s[1]-1,s[2]),r.setUTCHours(o[0],o[1],o[2],0)}return r},s=function(e,t,n,r){return t+=n*36e5,t-=t%(r*6e4),i(e,t)},o=function(e,n,r){var i,s,o;typeof t[n]=="undefined"&&(n="def"),typeof r=="undefined"&&(r=!1),!0===r?(i=e.getFullYear().toString(),s=(e.getMonth()+1).toString(),o=e.getDate().toString()):(i=e.getUTCFullYear().toString(),s=(e.getUTCMonth()+1).toString(),o=e.getUTCDate().toString()),t[n].zeroPad&&(s.length==1&&(s="0"+s),o.length==1&&(o="0"+o));var u=t[n].format;return u=u.replace("d",o),u=u.replace("m",s),u=u.replace("y",i),u},u=function(e,t,n){var r=t;t<10&&(r="0"+t);if(n){var i=e;return i<10&&(i="0"+e),i+":"+r}var i=e%12;i==0&&(i=12);var s=e<12?"am":"pm";return i+":"+r+s},a=function(e,n){typeof t[n]=="undefined"&&(n="def");var r=e.match(t[n].pattern);if(!r||r.length!=4)return Date("invalid");switch(t[n].order){case"bigEndian":var i=r[3],s=r[2],o=r[1];break;case"littleEndian":var i=r[1],s=r[2],o=r[3];break;case"middleEndian":var i=r[2],s=r[1],o=r[3];break;default:var i=r[1],s=r[2],o=r[3]}return o.length==2&&(o=(new Date).getUTCFullYear().toString().substr(0,2)+o),new Date(s+"/"+i+"/"+o+" GMT")},f=function(e){var t=t=/(\d+)\s*[:\-\.,]\s*(\d+)\s*(am|pm)?/i.exec(e);if(t&&t.length>=3){var n=Number(t[1]),r=Number(t[2]);return n==12&&t[3]&&(n-=12),t[3]&&t[3].toLowerCase()=="pm"&&(n+=12),{hour:n,minute:r}}return null};e.fn.calendricalDate=function(t){return t=t||{},t.padding=t.padding||4,t.monthNames=t.monthNames||"January,February,March,April,May,June,July,August,September,October,November,December",t.dayNames=t.dayNames||"S,M,T,W,T,F,S",t.weekStartDay=t.weekStartDay||0,this.each(function(){var n=e(this),r,i=!1;n.bind("focus",function(){if(r)return;var s=n.position(),u=n.css("padding-left");r=e("<div />").addClass("calendricalDatePopup").mouseenter(function(){i=!0}).mouseleave(function(){i=!1}).mousedown(function(e){e.preventDefault()}).css({position:"absolute",left:s.left,top:s.top+n.height()+t.padding*2}),n.after(r);var f=a(n.val(),t.dateFormat);f.getUTCFullYear()||(f=t.today?t.today:l()),g(r,f.getUTCFullYear(),f.getUTCMonth(),{today:t.today,selected:f,monthNames:t.monthNames,dayNames:t.dayNames,weekStartDay:t.weekStartDay,selectDate:function(e){i=!1,n.val(o(e,t.dateFormat)),r.remove(),r=null;if(t.endDate){var s=a(t.endDate.val(),t.dateFormat);s>=f&&t.endDate.val(o(new Date(e.getTime()+s.getTime()-f.getTime()),t.dateFormat))}}})}).blur(function(){if(i){r&&n.focus();return}if(!r)return;r.remove(),r=null})})},e.fn.calendricalDateRange=function(t){return this.length>=2&&(e(this[0]).calendricalDate(e.extend({endDate:e(this[1])},t)),e(this[1]).calendricalDate(t)),this},e.fn.calendricalDateRangeSingle=function(t){return this.length==1&&e(this).calendricalDate(t),this},e.fn.calendricalTime=function(t){return t=t||{},t.padding=t.padding||4,this.each(function(){var n=e(this),r,i=!1;n.bind("focus click",function(){if(r)return;var s=t.startTime;s&&t.startDate&&t.endDate&&!c(a(t.startDate.val()),a(t.endDate.val()))&&(s=!1);var o=n.position();r=e("<div />").addClass("calendricalTimePopup").mouseenter(function(){i=!0}).mouseleave(function(){i=!1}).mousedown(function(e){e.preventDefault()}).css({position:"absolute",left:o.left,top:o.top+n.height()+t.padding*2}),s&&r.addClass("calendricalEndTimePopup"),n.after(r);var u={selection:n.val(),selectTime:function(e){i=!1,n.val(e),r.remove(),r=null},isoTime:t.isoTime||!1,defaultHour:t.defaultHour!=null?t.defaultHour:8};s&&(u.startTime=f(t.startTime.val())),y(r,u)}).blur(function(){if(i){r&&n.focus();return}if(!r)return;r.remove(),r=null})})},e.fn.calendricalTimeRange=function(t){return this.length>=2&&(e(this[0]).calendricalTime(t),e(this[1]).calendricalTime(e.extend({startTime:e(this[0])},t))),this},e.fn.calendricalDateTimeRange=function(t){return this.length>=4&&(e(this[0]).calendricalDate(e.extend({endDate:e(this[2])},t)),e(this[1]).calendricalTime(t),e(this[2]).calendricalDate(t),e(this[3]).calendricalTime(e.extend({startTime:e(this[1]),startDate:e(this[0]),endDate:e(this[2])},t))),this};var S={allday:"#allday",start_date_input:"#start-date-input",start_time_input:"#start-time-input",start_time:"#start-time",end_date_input:"#end-date-input",end_time_input:"#end-time-input",end_time:"#end-time",twentyfour_hour:!1,date_format:"def",now:new Date},x={init:function(t){function C(){var e=a(s.val(),n.date_format).getTime()/1e3,t=f(l.val());e+=t.hour*3600+t.minute*60;var r=a(h.val(),n.date_format).getTime()/1e3,i=f(p.val());return r+=i.hour*3600+i.minute*60,r-e}function k(){var e=a(s.data("timespan.stored"),n.date_format),t=f(l.data("timespan.stored")),r=e.getTime()/1e3+t.hour*3600+t.minute*60+s.data("time_diff");return r=new Date(r*1e3),h.val(o(r,n.date_format)),p.val(u(r.getUTCHours(),r.getUTCMinutes(),n.twentyfour_hour)),!0}var n=e.extend({},S,t),i=e(n.allday),s=e(n.start_date_input),l=e(n.start_time_input),c=e(n.start_time),h=e(n.end_date_input),p=e(n.end_time_input),d=e(n.end_time),v=e("#ai1ec_instant_event"),m=h.add(p),g=s.add(n.end_date_input),y=l.add(n.end_time_input),x=s.add(n.start_time_input).add(n.end_date_input).add(n.end_time_input);x.bind("focus.timespan",w),v.bind("change.timespan",function(){this.checked?(m.closest("tr").fadeOut(),i.attr("disabled",!0)):(i.removeAttr("disabled"),m.closest("tr").fadeIn())});var T=new Date(n.now.getFullYear(),n.now.getMonth(),n.now.getDate()),N=!1;return i.bind("change.timespan",function(){this.checked?(y.fadeOut(),v.attr("disabled",!0)):(v.removeAttr("disabled"),y.fadeIn()),N||(N=!0,x.calendricalDateTimeRange({today:T,dateFormat:n.date_format,isoTime:n.twentyfour_hour,monthNames:n.month_names,dayNames:n.day_names,weekStartDay:n.week_start_day}))}).get().checked=!1,g.bind("blur.timespan",function(){var t=a(this.value,n.date_format);isNaN(t)?b(e(this)):(e(this).data("timespan.stored",this.value),e(this).val(o(t,n.date_format)))}),y.bind("blur.timespan",function(){var t=f(this.value);t?(e(this).data("timespan.stored",this.value),e(this).val(u(t.hour,t.minute,n.twentyfour_hour))):b(e(this))}),s.add(n.start_time_input).bind("focus.timespan",function(){s.data("time_diff",C())}).bind("blur.timespan",function(){s.data("time_diff")<0&&s.data("time_diff",900);var e=k()}),h.add(n.start_time_input).bind("blur.timespan",function(){if(C()<0){s.data("time_diff",900);var e=k()}}),s.closest("form").bind("submit.timespan",function(){var e=a(s.val(),n.date_format).getTime()/1e3;if(!isNaN(e)){if(!i.get(0).checked){var t=f(l.val());t?e+=t.hour*3600+t.minute*60:e=""}}else e="";e>0&&c.val(r(new Date(e*1e3),!0));var o=a(h.val(),n.date_format).getTime()/1e3;if(!isNaN(o))if(i.get(0).checked)o+=86400;else{var t=f(p.val());t?o+=t.hour*3600+t.minute*60:o=""}else o="";o>0&&d.val(r(new Date(o*1e3),!0))}),c.data("timespan.initial_value",c.val()),d.data("timespan.initial_value",d.val()),i.data("timespan.initial_value",i.get(0).checked),E(s,l,c,h,p,d,i,n.twentyfour_hour,n.date_format,n.now),this},reset:function(t){var n=e.extend({},S,t);return E(e(n.start_date_input),e(n.start_time_input),e(n.start_time),e(n.end_date_input),e(n.end_time_input),e(n.end_time),e(n.allday),n.twentyfour_hour,n.date_format,n.now),this},destroy:function(t){return t=e.extend({},S,t),e.each(t,function(t,n){e(n).unbind(".timespan")}),e(t.start_date_input).closest("form").unbind(".timespan"),this}};return e.timespan=function(t){if(x[t])return x[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return x.init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery.timespan")},{formatDate:o,parseDate:a}}),timely.define("external_libs/bootstrap/button",["jquery_timely"],function(e){var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r)};t.DEFAULTS={loadingText:"loading..."},t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.is("input")?"val":"html",i=n.data();e+="Text",i.resetText||n.data("resetText",n[r]()),n[r](i[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass("ai1ec-"+t).attr(t,t):n.removeClass("ai1ec-"+t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="ai1ec-buttons"]'),t=!0;if(e.length){var n=this.$element.find("input");n.prop("type")==="radio"&&(n.prop("checked")&&this.$element.hasClass("ai1ec-active")?t=!1:e.find(".ai1ec-active").removeClass("ai1ec-active")),t&&n.prop("checked",!this.$element.hasClass("ai1ec-active")).trigger("change")}t&&this.$element.toggleClass("ai1ec-active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("bs.button"),s=typeof n=="object"&&n;i||r.data("bs.button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.bs.button.data-api","[data-toggle^=ai1ec-button]",function(t){var n=e(t.target);n.hasClass("ai1ec-btn")||(n=n.closest(".ai1ec-btn")),n.button("toggle"),t.preventDefault()})}),timely.define("scripts/add_new_event/event_date_time/date_time_event_handlers",["jquery_timely","ai1ec_config","scripts/add_new_event/event_date_time/date_time_utility_functions","external_libs/jquery.calendrical_timespan","libs/utils","external_libs/bootstrap/button"],function(e,t,n,r,i){var s=i.get_ajax_url(),o=function(){var t=e("#ai1ec_end option:selected").val();switch(t){case"0":e("#ai1ec_until_holder, #ai1ec_count_holder").collapse("hide");break;case"1":e("#ai1ec_until_holder").collapse("hide"),e("#ai1ec_count_holder").collapse("show");break;case"2":e("#ai1ec_count_holder").collapse("hide"),e("#ai1ec_until_holder").collapse("show")}},u=function(){e("#publish").trigger("click")},a=function(){var i=e(this),o="",u=e("#ai1ec_repeat_box .ai1ec-tab-pane.ai1ec-active"),a=u.data("freq");switch(a){case"daily":o+="FREQ=DAILY;";var f=e("#ai1ec_daily_count").val();f>1&&(o+="INTERVAL="+f+";");break;case"weekly":o+="FREQ=WEEKLY;";var l=e("#ai1ec_weekly_count").val();l>1&&(o+="INTERVAL="+l+";");var c=e('input[name="ai1ec_weekly_date_select"]:first').val(),h=e('#ai1ec_weekly_date_select > li:first > input[type="hidden"]:first').val();c.length>0&&(o+="WKST="+h+";BYday="+c+";");break;case"monthly":o+="FREQ=MONTHLY;";var p=e("#ai1ec_monthly_count").val(),d=e('input[name="ai1ec_monthly_type"]:checked').val();p>1&&(o+="INTERVAL="+p+";");var v=e('input[name="ai1ec_montly_date_select"]:first').val();if(v.length>0&&d==="bymonthday")o+="BYMONTHDAY="+v+";";else if(d==="byday"){var m=e("#ai1ec_monthly_byday_num").val(),g=e("#ai1ec_monthly_byday_weekday").val();o+="BYday="+m+g+";"}break;case"yearly":o+="FREQ=YEARLY;";var y=e("#ai1ec_yearly_count").val();y>1&&(o+="INTERVAL="+y+";");var b=e('input[name="ai1ec_yearly_date_select"]:first').val();b.length>0&&(o+="BYMONTH="+b+";")}var w=e("#ai1ec_end").val();if(w==="1")o+="COUNT="+e("#ai1ec_count").val()+";";else if(w==="2"){var E=e("#ai1ec_until-date-input").val();E=r.parseDate(E,t.date_format);var S=e("#ai1ec_start-time").val();S=r.parseDate(S,t.date_format),S=new Date(S);var x=E.getUTCDate(),T=E.getUTCMonth()+1,N=S.getUTCHours(),C=S.getUTCMinutes();T=T<10?"0"+T:T,x=x<10?"0"+x:x,N=N<10?"0"+N:N,C=C<10?"0"+C:C,E=E.getUTCFullYear()+""+T+x+"T235959Z",o+="UNTIL="+E+";"}var k={action:"ai1ec_rrule_to_text",rrule:o};i.button("loading").next().addClass("ai1ec-disabled"),e.post(s,k,function(t){t.error?(i.button("reset").next().removeClass("ai1ec-disabled"),"1"===e("#ai1ec_is_box_repeat").val()?n.repeat_form_error("#ai1ec_rrule","#ai1ec_repeat_label",t,i):n.repeat_form_error("#ai1ec_exrule","#ai1ec_exclude_label",t,i)):"1"===e("#ai1ec_is_box_repeat").val()?n.repeat_form_success("#ai1ec_rrule","#ai1ec_repeat_label","#ai1ec_repeat_text > a",o,i,t):n.repeat_form_success("#ai1ec_exrule","#ai1ec_exclude_label","#ai1ec_exclude_text > a",o,i,t)},"json")},f=function(){return e("#ai1ec_is_box_repeat").val()==="1"?n.click_on_modal_cancel("#ai1ec_repeat_text > a","#ai1ec_repeat","#ai1ec_repeat_label"):n.click_on_modal_cancel("#ai1ec_exclude_text > a","#ai1ec_exclude","#ai1ec_exclude_label"),e("#ai1ec_repeat_box").modal("hide"),!1},l=function(){e(this).is("#ai1ec_monthly_type_bymonthday")?(e("#ai1ec_repeat_monthly_byday").collapse("hide"),e("#ai1ec_repeat_monthly_bymonthday").collapse("show")):(e("#ai1ec_repeat_monthly_bymonthday").collapse("hide"),e("#ai1ec_repeat_monthly_byday").collapse("show"))},c=function(){var t=e(this),n=[],r=t.closest(".ai1ec-btn-group-grid"),i;t.toggleClass("ai1ec-active"),e("a",r).each(function(){var t=e(this);t.is(".ai1ec-active")&&(i=t.next().val(),n.push(i))}),r.next().val(n.join())},h=function(){n.click_on_ics_rule_text("#ai1ec_repeat_text > a","#ai1ec_repeat","#ai1ec_repeat_label",{action:"ai1ec_get_repeat_box",repeat:1,post_id:e("#post_ID").val()},n.init_modal_widgets),n.click_on_ics_rule_text("#ai1ec_exclude_text > a","#ai1ec_exclude","#ai1ec_exclude_label",{action:"ai1ec_get_repeat_box",repeat:0,post_id:e("#post_ID").val()},n.init_modal_widgets),n.click_on_checkbox("#ai1ec_repeat","#ai1ec_repeat_text > a","#ai1ec_repeat_label",{action:"ai1ec_get_repeat_box",repeat:1,post_id:e("#post_ID").val()},n.init_modal_widgets),n.click_on_checkbox("#ai1ec_exclude","#ai1ec_exclude_text > a","#ai1ec_exclude_label",{action:"ai1ec_get_repeat_box",repeat:0,post_id:e("#post_ID").val()},n.init_modal_widgets)},p=function(t){var n=e(this).data("state")===undefined?!1:e(this).data("state");return e("#widgetCalendar").stop().animate({height:n?0:e("#widgetCalendar div.datepicker").get(0).offsetHeight},500),e(this).data("state",!n),!1},d=function(){e(".ai1ec-modal-content",this).not(".ai1ec-loading ").remove().end().removeClass("ai1ec-hide")};return{show_end_fields:o,trigger_publish:u,handle_click_on_apply_button:a,handle_click_on_cancel_modal:f,handle_checkbox_monthly_tab_modal:l,execute_pseudo_handlers:h,handle_animation_of_calendar_widget:p,handle_click_on_toggle_buttons:c,handle_modal_hide:d}}),timely.define("scripts/add_new_event/event_cost_helper",["jquery_timely","ai1ec_config"],function(e,t){var n=function(){return e("#ai1ec_is_free").is(":checked")},r=function(){return e("#ai1ec_cost").val()!==""},i=function(r){var i=e(this).parents("table:eq(0)"),s=e("#ai1ec_cost",i),o=t.label_a_buy_tickets_url;n()?(s.attr("value","").addClass("ai1ec-hidden"),o=t.label_a_rsvp_url):s.removeClass("ai1ec-hidden"),e("label[for=ai1ec_ticket_url]",i).text(o)};return{handle_change_is_free:i,check_is_free:n,check_is_price_entered:r}}),timely.define("external_libs/jquery.inputdate",["jquery_timely","external_libs/jquery.calendrical_timespan"],function(e,t){function n(e){e.addClass("error").fadeOut("normal",function(){e.val(e.data("timespan.stored")).removeClass("error").fadeIn("fast")})}function r(){e(this).data("timespan.stored",this.value)}function i(e,n,i,s,o){n.val(n.data("timespan.initial_value"));var u=parseInt(n.val());isNaN(parseInt(u))?u=new Date(o):u=new Date(parseInt(u)*1e3),e.val(t.formatDate(u,s)),e.each(r)}var s={start_date_input:"date-input",start_time:"time",twentyfour_hour:!1,date_format:"def",now:new Date},o={init:function(o){var u=e.extend({},s,o),a=e(u.start_date_input),f=e(u.start_time),l=a,c=a;return c.bind("focus.timespan",r),l.calendricalDate({today:new Date(u.now.getFullYear(),u.now.getMonth(),u.now.getDate()),dateFormat:u.date_format,monthNames:u.month_names,dayNames:u.day_names,weekStartDay:u.week_start_day}),l.bind("blur.timespan",function(){var r=t.parseDate(this.value,u.date_format);isNaN(r)?n(e(this)):(e(this).data("timespan.stored",this.value),e(this).val(t.formatDate(r,u.date_format)))}),a.bind("focus.timespan",function(){var e=t.parseDate(a.val(),u.date_format).getTime()/1e3}).bind("blur.timespan",function(){var e=t.parseDate(a.data("timespan.stored"),u.date_format)}),a.closest("form").bind("submit.timespan",function(){var e=t.parseDate(a.val(),u.date_format).getTime()/1e3;isNaN(e)&&(e=""),f.val(e)}),f.data("timespan.initial_value",f.val()),i(a,f,u.twentyfour_hour,u.date_format,u.now),this},reset:function(t){var n=e.extend({},s,t);return i(e(n.start_date_input),e(n.start_time),n.twentyfour_hour,n.date_format,n.now),this},destroy:function(t){return t=e.extend({},s,t),e.each(t,function(t,n){e(n).unbind(".timespan")}),e(t.start_date_input).closest("form").unbind(".timespan"),this}};e.inputdate=function(t){if(o[t])return o[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return o.init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery.timespan")}}),timely.define("external_libs/jquery.tools",["jquery_timely"],function(e){function i(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}function s(e,t){var n=parseInt(e.css(t),10);if(n)return n;var r=e[0].currentStyle;return r&&r.width&&parseInt(r.width,10)}function o(e){var t=e.data("events");return t&&t.onSlide}function u(t,n){function x(e,s,o,u){o===undefined?o=s/h*m:u&&(o-=n.min),g&&(o=Math.round(o/g)*g);if(s===undefined||g)s=o*h/m;if(isNaN(o))return r;s=Math.max(0,Math.min(s,h)),o=s/h*m;if(u||!f)o+=n.min;f&&(u?s=h-s:o=n.max-o),o=i(o,y);var a=e.type=="click";if(S&&l!==undefined&&!a){e.type="onSlide",E.trigger(e,[o,s]);if(e.isDefaultPrevented())return r}var c=a?n.speed:0,b=a?function(){e.type="change",E.trigger(e,[o])}:null;return f?(d.animate({top:s},c,b),n.progress&&v.animate({height:h-s+d.height()/2},c)):(d.animate({left:s},c,b),n.progress&&v.animate({width:s+d.width()/2},c)),l=o,p=s,t.val(o),r}function T(){f=n.vertical||s(a,"height")>s(a,"width"),f?(h=s(a,"height")-s(d,"height"),c=a.offset().top+h):(h=s(a,"width")-s(d,"width"),c=a.offset().left)}function N(){T(),r.setValue(n.value!==undefined?n.value:n.min)}var r=this,u=n.css,a=e("<div><div/><a href='#'/></div>").data("rangeinput",r),f,l,c,h,p;t.before(a);var d=a.addClass(u.slider).find("a").addClass(u.handle),v=a.find("div").addClass(u.progress);e.each("min,max,step,value".split(","),function(e,r){var i=t.attr(r);parseFloat(i)&&(n[r]=parseFloat(i,10))});var m=n.max-n.min,g=n.step=="any"?0:n.step,y=n.precision;y===undefined&&(y=g.toString().split("."),y=y.length===2?y[1].length:0);if(t.attr("type")=="range"){var b=t.clone().wrap("<div/>").parent().html(),w=e(b.replace(/type/i,"type=text data-orig-type"));w.val(n.value),t.replaceWith(w),t=w}t.addClass(u.input);var E=e(r).add(t),S=!0;e.extend(r,{getValue:function(){return l},setValue:function(t,n){return T(),x(n||e.Event("api"),undefined,t,!0)},getConf:function(){return n},getProgress:function(){return v},getHandle:function(){return d},getInput:function(){return t},step:function(t,i){i=i||e.Event();var s=n.step=="any"?1:n.step;r.setValue(l+s*(t||1),i)},stepUp:function(e){return r.step(e||1)},stepDown:function(e){return r.step(-e||-1)}}),e.each("onSlide,change".split(","),function(t,i){e.isFunction(n[i])&&e(r).on(i,n[i]),r[i]=function(t){return t&&e(r).on(i,t),r}}),d.drag({drag:!1}).on("dragStart",function(){T(),S=o(e(r))||o(t)}).on("drag",function(e,n,r){if(t.is(":disabled"))return!1;x(e,f?n:r)}).on("dragEnd",function(e){e.isDefaultPrevented()||(e.type="change",E.trigger(e,[l]))}).click(function(e){return e.preventDefault()}),a.click(function(e){if(t.is(":disabled")||e.target==d[0])return e.preventDefault();T();var n=f?d.height()/2:d.width()/2;x(e,f?h-c-n+e.pageY:e.pageX-c-n)}),n.keyboard&&t.keydown(function(n){if(t.attr("readonly"))return;var i=n.keyCode,s=e([75,76,38,33,39]).index(i)!=-1,o=e([74,72,40,34,37]).index(i)!=-1;if((s||o)&&!(n.shiftKey||n.altKey||n.ctrlKey))return s?r.step(i==33?10:1,n):o&&r.step(i==34?-10:-1,n),n.preventDefault()}),t.blur(function(t){var n=e(this).val();n!==l&&r.setValue(n,t)}),e.extend(t[0],{stepUp:r.stepUp,stepDown:r.stepDown}),N(),h||e(window).load(N)}e.tools=e.tools||{version:"1.2.7"};var t;t=e.tools.rangeinput={conf:{min:0,max:100,step:"any",steps:0,value:0,precision:undefined,vertical:0,keyboard:!0,progress:!1,speed:100,css:{input:"range",slider:"slider",progress:"progress",handle:"handle"}}};var n,r;e.fn.drag=function(t){return document.ondragstart=function(){return!1},t=e.extend({x:!0,y:!0,drag:!0},t),n=n||e(document).on("mousedown mouseup",function(i){var s=e(i.target);if(i.type=="mousedown"&&s.data("drag")){var o=s.position(),u=i.pageX-o.left,a=i.pageY-o.top,f=!0;n.on("mousemove.drag",function(e){var n=e.pageX-u,i=e.pageY-a,o={};t.x&&(o.left=n),t.y&&(o.top=i),f&&(s.trigger("dragStart"),f=!1),t.drag&&s.css(o),s.trigger("drag",[i,n]),r=s}),i.preventDefault()}else try{r&&r.trigger("dragEnd")}finally{n.off("mousemove.drag"),r=null}}),this.data("drag",!0)},e.expr[":"].range=function(t){var n=t.getAttribute("type");return n&&n=="range"||!!e(t).filter("input").data("rangeinput")},e.fn.rangeinput=function(n){if(this.data("rangeinput"))return this;n=e.extend(!0,{},t.conf,n);var r;return this.each(function(){var t=new u(e(this),e.extend(!0,{},n)),i=t.getInput().data("rangeinput",t);r=r?r.add(i):i}),r?r:this}}),timely.define("external_libs/ai1ec_datepicker",["jquery_timely"],function(e){var t=function(){var t={},n={years:"datepickerViewYears",moths:"datepickerViewMonths",days:"datepickerViewDays"},i={wrapper:'<div class="datepicker"><div class="datepickerBorderT" /><div class="datepickerBorderB" /><div class="datepickerBorderL" /><div class="datepickerBorderR" /><div class="datepickerBorderTL" /><div class="datepickerBorderTR" /><div class="datepickerBorderBL" /><div class="datepickerBorderBR" /><div class="datepickerContainer"><table cellspacing="0" cellpadding="0"><tbody><tr></tr></tbody></table></div></div>',head:["<td>",'<table cellspacing="0" cellpadding="0">',"<thead>","<tr>",'<th class="datepickerGoPrev"><a href="#"><span><%=prev%></span></a></th>','<th colspan="6" class="datepickerMonth"><a href="#"><span></span></a></th>','<th class="datepickerGoNext"><a href="#"><span><%=next%></span></a></th>',"</tr>",'<tr class="datepickerDoW">',"<th><span><%=week%></span></th>","<th><span><%=day1%></span></th>","<th><span><%=day2%></span></th>","<th><span><%=day3%></span></th>","<th><span><%=day4%></span></th>","<th><span><%=day5%></span></th>","<th><span><%=day6%></span></th>","<th><span><%=day7%></span></th>","</tr>","</thead>","</table></td>"],space:'<td class="datepickerSpace"><div></div></td>',days:['<tbody class="datepickerDays">',"<tr>",'<th class="datepickerWeek"><a href="#"><span><%=weeks[0].week%></span></a></th>','<td class="<%=weeks[0].days[0].classname%>"><a href="#"><span><%=weeks[0].days[0].text%></span></a></td>','<td class="<%=weeks[0].days[1].classname%>"><a href="#"><span><%=weeks[0].days[1].text%></span></a></td>','<td class="<%=weeks[0].days[2].classname%>"><a href="#"><span><%=weeks[0].days[2].text%></span></a></td>','<td class="<%=weeks[0].days[3].classname%>"><a href="#"><span><%=weeks[0].days[3].text%></span></a></td>','<td class="<%=weeks[0].days[4].classname%>"><a href="#"><span><%=weeks[0].days[4].text%></span></a></td>','<td class="<%=weeks[0].days[5].classname%>"><a href="#"><span><%=weeks[0].days[5].text%></span></a></td>','<td class="<%=weeks[0].days[6].classname%>"><a href="#"><span><%=weeks[0].days[6].text%></span></a></td>',"</tr>","<tr>",'<th class="datepickerWeek"><a href="#"><span><%=weeks[1].week%></span></a></th>','<td class="<%=weeks[1].days[0].classname%>"><a href="#"><span><%=weeks[1].days[0].text%></span></a></td>','<td class="<%=weeks[1].days[1].classname%>"><a href="#"><span><%=weeks[1].days[1].text%></span></a></td>','<td class="<%=weeks[1].days[2].classname%>"><a href="#"><span><%=weeks[1].days[2].text%></span></a></td>','<td class="<%=weeks[1].days[3].classname%>"><a href="#"><span><%=weeks[1].days[3].text%></span></a></td>','<td class="<%=weeks[1].days[4].classname%>"><a href="#"><span><%=weeks[1].days[4].text%></span></a></td>','<td class="<%=weeks[1].days[5].classname%>"><a href="#"><span><%=weeks[1].days[5].text%></span></a></td>','<td class="<%=weeks[1].days[6].classname%>"><a href="#"><span><%=weeks[1].days[6].text%></span></a></td>',"</tr>","<tr>",'<th class="datepickerWeek"><a href="#"><span><%=weeks[2].week%></span></a></th>','<td class="<%=weeks[2].days[0].classname%>"><a href="#"><span><%=weeks[2].days[0].text%></span></a></td>','<td class="<%=weeks[2].days[1].classname%>"><a href="#"><span><%=weeks[2].days[1].text%></span></a></td>','<td class="<%=weeks[2].days[2].classname%>"><a href="#"><span><%=weeks[2].days[2].text%></span></a></td>','<td class="<%=weeks[2].days[3].classname%>"><a href="#"><span><%=weeks[2].days[3].text%></span></a></td>','<td class="<%=weeks[2].days[4].classname%>"><a href="#"><span><%=weeks[2].days[4].text%></span></a></td>','<td class="<%=weeks[2].days[5].classname%>"><a href="#"><span><%=weeks[2].days[5].text%></span></a></td>','<td class="<%=weeks[2].days[6].classname%>"><a href="#"><span><%=weeks[2].days[6].text%></span></a></td>',"</tr>","<tr>",'<th class="datepickerWeek"><a href="#"><span><%=weeks[3].week%></span></a></th>','<td class="<%=weeks[3].days[0].classname%>"><a href="#"><span><%=weeks[3].days[0].text%></span></a></td>','<td class="<%=weeks[3].days[1].classname%>"><a href="#"><span><%=weeks[3].days[1].text%></span></a></td>','<td class="<%=weeks[3].days[2].classname%>"><a href="#"><span><%=weeks[3].days[2].text%></span></a></td>','<td class="<%=weeks[3].days[3].classname%>"><a href="#"><span><%=weeks[3].days[3].text%></span></a></td>','<td class="<%=weeks[3].days[4].classname%>"><a href="#"><span><%=weeks[3].days[4].text%></span></a></td>','<td class="<%=weeks[3].days[5].classname%>"><a href="#"><span><%=weeks[3].days[5].text%></span></a></td>','<td class="<%=weeks[3].days[6].classname%>"><a href="#"><span><%=weeks[3].days[6].text%></span></a></td>',"</tr>","<tr>",'<th class="datepickerWeek"><a href="#"><span><%=weeks[4].week%></span></a></th>','<td class="<%=weeks[4].days[0].classname%>"><a href="#"><span><%=weeks[4].days[0].text%></span></a></td>','<td class="<%=weeks[4].days[1].classname%>"><a href="#"><span><%=weeks[4].days[1].text%></span></a></td>','<td class="<%=weeks[4].days[2].classname%>"><a href="#"><span><%=weeks[4].days[2].text%></span></a></td>','<td class="<%=weeks[4].days[3].classname%>"><a href="#"><span><%=weeks[4].days[3].text%></span></a></td>','<td class="<%=weeks[4].days[4].classname%>"><a href="#"><span><%=weeks[4].days[4].text%></span></a></td>','<td class="<%=weeks[4].days[5].classname%>"><a href="#"><span><%=weeks[4].days[5].text%></span></a></td>','<td class="<%=weeks[4].days[6].classname%>"><a href="#"><span><%=weeks[4].days[6].text%></span></a></td>',"</tr>","<tr>",'<th class="datepickerWeek"><a href="#"><span><%=weeks[5].week%></span></a></th>','<td class="<%=weeks[5].days[0].classname%>"><a href="#"><span><%=weeks[5].days[0].text%></span></a></td>','<td class="<%=weeks[5].days[1].classname%>"><a href="#"><span><%=weeks[5].days[1].text%></span></a></td>','<td class="<%=weeks[5].days[2].classname%>"><a href="#"><span><%=weeks[5].days[2].text%></span></a></td>','<td class="<%=weeks[5].days[3].classname%>"><a href="#"><span><%=weeks[5].days[3].text%></span></a></td>','<td class="<%=weeks[5].days[4].classname%>"><a href="#"><span><%=weeks[5].days[4].text%></span></a></td>','<td class="<%=weeks[5].days[5].classname%>"><a href="#"><span><%=weeks[5].days[5].text%></span></a></td>','<td class="<%=weeks[5].days[6].classname%>"><a href="#"><span><%=weeks[5].days[6].text%></span></a></td>',"</tr>","</tbody>"],months:['<tbody class="<%=className%>">',"<tr>",'<td colspan="2"><a href="#"><span><%=data[0]%></span></a></td>','<td colspan="2"><a href="#"><span><%=data[1]%></span></a></td>','<td colspan="2"><a href="#"><span><%=data[2]%></span></a></td>','<td colspan="2"><a href="#"><span><%=data[3]%></span></a></td>',"</tr>","<tr>",'<td colspan="2"><a href="#"><span><%=data[4]%></span></a></td>','<td colspan="2"><a href="#"><span><%=data[5]%></span></a></td>','<td colspan="2"><a href="#"><span><%=data[6]%></span></a></td>','<td colspan="2"><a href="#"><span><%=data[7]%></span></a></td>',"</tr>","<tr>",'<td colspan="2"><a href="#"><span><%=data[8]%></span></a></td>','<td colspan="2"><a href="#"><span><%=data[9]%></span></a></td>','<td colspan="2"><a href="#"><span><%=data[10]%></span></a></td>','<td colspan="2"><a href="#"><span><%=data[11]%></span></a></td>',"</tr>","</tbody>"]},s={flat:!1,starts:1,prev:"&#9664;",next:"&#9654;",lastSel:!1,mode:"single",view:"days",calendars:1,format:"Y-m-d",position:"bottom",eventName:"click",onRender:function(){return{}},onChange:function(){return!0},onShow:function(){return!0},onBeforeShow:function(){return!0},onHide:function(){return!0},locale:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekMin:"wk"}},o=function(t){var n=e(t).data("datepicker"),s=e(t),o=Math.floor(n.calendars/2),u,f,l,c,h=0,p,d,v,m,g,y;s.find("td>table tbody").remove();for(var b=0;b<n.calendars;b++){u=new Date(n.current),u.addMonths(-o+b),y=s.find("table").eq(b+1);switch(y[0].className){case"datepickerViewDays":l=a(u,"B, Y");break;case"datepickerViewMonths":l=u.getFullYear();break;case"datepickerViewYears":l=u.getFullYear()-6+" - "+(u.getFullYear()+5)}y.find("thead tr:first th:eq(1) span").text(l),l=u.getFullYear()-6,f={data:[],className:"datepickerYears"};for(var w=0;w<12;w++)f.data.push(l+w);g=r(i.months.join(""),f),u.setDate(1),f={weeks:[],test:10},c=u.getMonth();var l=(u.getDay()-n.starts)%7;u.addDays(-(l+(l<0?7:0))),p=-1,h=0;while(h<42){v=parseInt(h/7,10),m=h%7,f.weeks[v]||(p=u.getWeekNumber(),f.weeks[v]={week:p,days:[]}),f.weeks[v].days[m]={text:u.getDate(),classname:[]},c!=u.getMonth()&&f.weeks[v].days[m].classname.push("datepickerNotInMonth"),u.getDay()==0&&f.weeks[v].days[m].classname.push("datepickerSunday"),u.getDay()==6&&f.weeks[v].days[m].classname.push("datepickerSaturday");var E=n.onRender(u),S=u.valueOf();(E.selected||n.date==S||e.inArray(S,n.date)>-1||n.mode=="range"&&S>=n.date[0]&&S<=n.date[1])&&f.weeks[v].days[m].classname.push("datepickerSelected"),E.disabled&&f.weeks[v].days[m].classname.push("datepickerDisabled"),E.className&&f.weeks[v].days[m].classname.push(E.className),f.weeks[v].days[m].classname=f.weeks[v].days[m].classname.join(" "),h++,u.addDays(1)}g=r(i.days.join(""),f)+g,f={data:n.locale.monthsShort,className:"datepickerMonths"},g=r(i.months.join(""),f)+g,y.append(g)}},u=function(e,t){if(e.constructor==Date)return new Date(e);var n=e.split(/\W+/),r=t.split(/\W+/),i,s,o,u,a,f=new Date;for(var l=0;l<n.length;l++)switch(r[l]){case"d":case"e":i=parseInt(n[l],10);break;case"m":s=parseInt(n[l],10)-1;break;case"Y":case"y":o=parseInt(n[l],10),o+=o>100?0:o<29?2e3:1900;break;case"H":case"I":case"k":case"l":u=parseInt(n[l],10);break;case"P":case"p":/pm/i.test(n[l])&&u<12?u+=12:/am/i.test(n[l])&&u>=12&&(u-=12);break;case"M":a=parseInt(n[l],10)}return new Date(o===undefined?f.getFullYear():o,s===undefined?f.getMonth():s,i===undefined?f.getDate():i,u===undefined?f.getHours():u,a===undefined?f.getMinutes():a,0)},a=function(e,t){var n=e.getMonth(),r=e.getDate(),i=e.getFullYear(),s=e.getWeekNumber(),o=e.getDay(),u={},a=e.getHours(),f=a>=12,l=f?a-12:a,c=e.getDayOfYear();l==0&&(l=12);var h=e.getMinutes(),p=e.getSeconds(),d=t.split(""),v;for(var m=0;m<d.length;m++){v=d[m];switch(d[m]){case"a":v=e.getDayName();break;case"A":v=e.getDayName(!0);break;case"b":v=e.getMonthName();break;case"B":v=e.getMonthName(!0);break;case"C":v=1+Math.floor(i/100);break;case"d":v=r<10?"0"+r:r;break;case"e":v=r;break;case"H":v=a<10?"0"+a:a;break;case"I":v=l<10?"0"+l:l;break;case"j":v=c<100?c<10?"00"+c:"0"+c:c;break;case"k":v=a;break;case"l":v=l;break;case"m":v=n<9?"0"+(1+n):1+n;break;case"M":v=h<10?"0"+h:h;break;case"p":case"P":v=f?"PM":"AM";break;case"s":v=Math.floor(e.getTime()/1e3);break;case"S":v=p<10?"0"+p:p;break;case"u":v=o+1;break;case"w":v=o;break;case"y":v=(""+i).substr(2,2);break;case"Y":v=i}d[m]=v}return d.join("")},f=function(e){if(Date.prototype.tempDate)return;Date.prototype.tempDate=null,Date.prototype.months=e.months,Date.prototype.monthsShort=e.monthsShort,Date.prototype.days=e.days,Date.prototype.daysShort=e.daysShort,Date.prototype.getMonthName=function(e){return this[e?"months":"monthsShort"][this.getMonth()]},Date.prototype.getDayName=function(e){return this[e?"days":"daysShort"][this.getDay()]},Date.prototype.addDays=function(e){this.setDate(this.getDate()+e),this.tempDate=this.getDate()},Date.prototype.addMonths=function(e){this.tempDate==null&&(this.tempDate=this.getDate()),this.setDate(1),this.setMonth(this.getMonth()+e),this.setDate(Math.min(this.tempDate,this.getMaxDays()))},Date.prototype.addYears=function(e){this.tempDate==null&&(this.tempDate=this.getDate()),this.setDate(1),this.setFullYear(this.getFullYear()+e),this.setDate(Math.min(this.tempDate,this.getMaxDays()))},Date.prototype.getMaxDays=function(){var e=new Date(Date.parse(this)),t=28,n;n=e.getMonth(),t=28;while(e.getMonth()==n)t++,e.setDate(t);return t-1},Date.prototype.getFirstDay=function(){var e=new Date(Date.parse(this));return e.setDate(1),e.getDay()},Date.prototype.getWeekNumber=function(){var e=new Date(this);e.setDate(e.getDate()-(e.getDay()+6)%7+3);var t=e.valueOf();return e.setMonth(0),e.setDate(4),Math.round((t-e.valueOf())/6048e5)+1},Date.prototype.getDayOfYear=function(){var e=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0),t=new Date(this.getFullYear(),0,0,0,0,0),n=e-t;return Math.floor(n/24*60*60*1e3)}},l=function(t){var n=e(t).data("datepicker"),r=e("#"+n.id);if(!n.extraHeight){var i=e(t).find("div");n.extraHeight=i.get(0).offsetHeight+i.get(1).offsetHeight,n.extraWidth=i.get(2).offsetWidth+i.get(3).offsetWidth}var s=r.find("table:first").get(0),o=s.offsetWidth,u=s.offsetHeight;r.css({width:o+n.extraWidth+"px",height:u+n.extraHeight+"px"}).find("div.datepickerContainer").css({width:o+"px",height:u+"px"})},c=function(t){e(t.target).is("span")&&(t.target=t.target.parentNode);var n=e(t.target);if(n.is("a")){t.target.blur();if(n.hasClass("datepickerDisabled"))return!1;var r=e(this).data("datepicker"),i=n.parent(),s=i.parent().parent().parent(),u=e("table",this).index(s.get(0))-1,f=new Date(r.current),l=!1,c=!1;if(i.is("th")){if(i.hasClass("datepickerWeek")&&r.mode=="range"&&!i.next().hasClass("datepickerDisabled")){var p=parseInt(i.next().text(),10);f.addMonths(u-Math.floor(r.calendars/2)),i.next().hasClass("datepickerNotInMonth")&&f.addMonths(p>15?-1:1),f.setDate(p),r.date[0]=f.setHours(0,0,0,0).valueOf(),f.setHours(23,59,59,0),f.addDays(6),r.date[1]=f.valueOf(),c=!0,l=!0,r.lastSel=!1}else if(i.hasClass("datepickerMonth")){f.addMonths(u-Math.floor(r.calendars/2));switch(s.get(0).className){case"datepickerViewDays":s.get(0).className="datepickerViewMonths",n.find("span").text(f.getFullYear());break;case"datepickerViewMonths":s.get(0).className="datepickerViewYears",n.find("span").text(f.getFullYear()-6+" - "+(f.getFullYear()+5));break;case"datepickerViewYears":s.get(0).className="datepickerViewDays",n.find("span").text(a(f,"B, Y"))}}else if(i.parent().parent().is("thead")){switch(s.get(0).className){case"datepickerViewDays":r.current.addMonths(i.hasClass("datepickerGoPrev")?-1:1);break;case"datepickerViewMonths":r.current.addYears(i.hasClass("datepickerGoPrev")?-1:1);break;case"datepickerViewYears":r.current.addYears(i.hasClass("datepickerGoPrev")?-12:12)}c=!0}}else if(i.is("td")&&!i.hasClass("datepickerDisabled")){switch(s.get(0).className){case"datepickerViewMonths":r.current.setMonth(s.find("tbody.datepickerMonths td").index(i)),r.current.setFullYear(parseInt(s.find("thead th.datepickerMonth span").text(),10)),r.current.addMonths(Math.floor(r.calendars/2)-u),s.get(0).className="datepickerViewDays";break;case"datepickerViewYears":r.current.setFullYear(parseInt(n.text(),10)),s.get(0).className="datepickerViewMonths";break;default:var p=parseInt(n.text(),10);f.addMonths(u-Math.floor(r.calendars/2)),i.hasClass("datepickerNotInMonth")&&f.addMonths(p>15?-1:1),f.setDate(p);switch(r.mode){case"multiple":p=f.setHours(0,0,0,0).valueOf(),e.inArray(p,r.date)>-1?e.each(r.date,function(e,t){if(t==p)return r.date.splice(e,1),!1}):r.date.push(p);break;case"range":r.lastSel||(r.date[0]=f.setHours(0,0,0,0).valueOf()),p=f.setHours(23,59,59,0).valueOf(),p<r.date[0]?(r.date[1]=r.date[0]+86399e3,r.date[0]=p-86399e3):r.date[1]=p,r.lastSel=!r.lastSel;break;default:r.date=f.valueOf()}}c=!0,l=!0}c&&o(this),l&&r.onChange.apply(this,h(r))}return!1},h=function(t){var n;return t.mode=="single"?(n=new Date(t.date),[a(n,t.format),n,t.el]):(n=[[],[],t.el],e.each(t.date,function(e,r){var i=new Date(r);n[0].push(a(i,t.format)),n[1].push(i)}),n)},p=function(){var e=document.compatMode=="CSS1Compat";return{l:window.pageXOffset||(e?document.documentElement.scrollLeft:document.body.scrollLeft),t:window.pageYOffset||(e?document.documentElement.scrollTop:document.body.scrollTop),w:window.innerWidth||(e?document.documentElement.clientWidth:document.body.clientWidth),h:window.innerHeight||(e?document.documentElement.clientHeight:document.body.clientHeight)}},d=function(e,t,n){if(e==t)return!0;if(e.contains)return e.contains(t);if(e.compareDocumentPosition)return!!(e.compareDocumentPosition(t)&16);var r=t.parentNode;while(r&&r!=n){if(r==e)return!0;r=r.parentNode}return!1},v=function(t){var n=e("#"+e(this).data("datepickerId"));if(!n.is(":visible")){var r=n.get(0);o(r);var i=n.data("datepicker");i.onBeforeShow.apply(this,[n.get(0)]);var s=e(this).offset(),u=p(),a=s.top,f=s.left,c=e.curCSS(r,"display");n.css({visibility:"hidden",display:"block"}),l(r);switch(i.position){case"top":a-=r.offsetHeight;break;case"left":f-=r.offsetWidth;break;case"right":f+=this.offsetWidth;break;case"bottom":a+=this.offsetHeight}a+r.offsetHeight>u.t+u.h&&(a=s.top-r.offsetHeight),a<u.t&&(a=s.top+this.offsetHeight+r.offsetHeight),f+r.offsetWidth>u.l+u.w&&(f=s.left-r.offsetWidth),f<u.l&&(f=s.left+this.offsetWidth),n.css({visibility:"visible",display:"block",top:a+"px",left:f+"px"}),i.onShow.apply(this,[n.get(0)])!=0&&n.show(),e(document).bind("mousedown",{cal:n,trigger:this},m)}return!1},m=function(t){t.target!=t.data.trigger&&!d(t.data.cal.get(0),t.target,t.data.cal.get(0))&&(t.data.cal.data("datepicker").onHide.apply(this,[t.data.cal.get(0)])!=0&&t.data.cal.hide(),e(document).unbind("mousedown",m))};return{init:function(t){return t=e.extend({},s,t||{}),f(t.locale),t.calendars=Math.max(1,parseInt(t.calendars,10)||1),t.mode=/single|multiple|range/.test(t.mode)?t.mode:"single",this.each(function(){if(!e(this).data("datepicker")){t.el=this,t.date.constructor==String&&(t.date=u(t.date,t.format),t.date.setHours(0,0,0,0));if(t.mode!="single")if(t.date.constructor!=Array)t.date=[t.date.valueOf()],t.mode=="range"&&t.date.push((new Date(t.date[0])).setHours(23,59,59,0).valueOf());else{for(var s=0;s<t.date.length;s++)t.date[s]=u(t.date[s],t.format).setHours(0,0,0,0).valueOf();t.mode=="range"&&(t.date[1]=(new Date(t.date[1])).setHours(23,59,59,0).valueOf())}else t.date=t.date.valueOf();t.current?t.current=u(t.current,t.format):t.current=new Date,t.current.setDate(1),t.current.setHours(0,0,0,0);var a="datepicker_"+parseInt(Math.random()*1e3),f;t.id=a,e(this).data("datepickerId",t.id);var h=e(i.wrapper).attr("id",a).bind("click",c).data("datepicker",t);t.className&&h.addClass(t.className);var p="";for(var s=0;s<t.calendars;s++)f=t.starts,s>0&&(p+=i.space),p+=r(i.head.join(""),{week:t.locale.weekMin,prev:t.prev,next:t.next,day1:t.locale.daysMin[f++%7],day2:t.locale.daysMin[f++%7],day3:t.locale.daysMin[f++%7],day4:t.locale.daysMin[f++%7],day5:t.locale.daysMin[f++%7],day6:t.locale.daysMin[f++%7],day7:t.locale.daysMin[f++%7]});h.find("tr:first").append(p).find("table").addClass(n[t.view]),o(h.get(0)),t.flat?(h.appendTo(this).show().css("position","relative"),l(h.get(0))):(h.appendTo(document.body),e(this).bind(t.eventName,v))}})},showPicker:function(){return this.each(function(){e(this).data("datepickerId")&&v.apply(this)})},hidePicker:function(){return this.each(function(){e(this).data("datepickerId")&&e("#"+e(this).data("datepickerId")).hide()})},setDate:function(t,n){return this.each(function(){if(e(this).data("datepickerId")){var r=e("#"+e(this).data("datepickerId")),i=r.data("datepicker");i.date=t,i.date.constructor==String&&(i.date=u(i.date,i.format),i.date.setHours(0,0,0,0));if(i.mode!="single")if(i.date.constructor!=Array)i.date=[i.date.valueOf()],i.mode=="range"&&i.date.push((new Date(i.date[0])).setHours(23,59,59,0).valueOf());else{for(var s=0;s<i.date.length;s++)i.date[s]=u(i.date[s],i.format).setHours(0,0,0,0).valueOf();i.mode=="range"&&(i.date[1]=(new Date(i.date[1])).setHours(23,59,59,0).valueOf())}else i.date=i.date.valueOf();n&&(i.current=new Date(i.mode!="single"?i.date[0]:i.date)),o(r.get(0))}})},getDate:function(t){if(this.size()>0)return h(e("#"+e(this).data("datepickerId")).data("datepicker"))[t?0:1]},clear:function(){return this.each(function(){if(e(this).data("datepickerId")){var t=e("#"+e(this).data("datepickerId")),n=t.data("datepicker");n.mode!="single"&&(n.date=[],o(t.get(0)))}})},fixLayout:function(){return this.each(function(){if(e(this).data("datepickerId")){var t=e("#"+e(this).data("datepickerId")),n=t.data("datepicker");n.flat&&l(t.get(0))}})}}}();e.fn.extend({DatePicker:t.init,DatePickerHide:t.hidePicker,DatePickerShow:t.showPicker,DatePickerSetDate:t.setDate,DatePickerGetDate:t.getDate,DatePickerClear:t.clear,DatePickerLayout:t.fixLayout});var n={},r=function(e,t){var i=/\W/.test(e)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+e.replace(/[\r\t\n]/g," ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):n[e]=n[e]||r(document.getElementById(e).innerHTML);return t?i(t):i}}),timely.define("external_libs/bootstrap/transition",["jquery_timely"],function(e){function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(e.style[n]!==undefined)return{end:t[n]}}e.fn.emulateTransitionEnd=function(t){var n=!1,r=this;e(this).one(e.support.transition.end,function(){n=!0});var i=function(){n||e(r).trigger(e.support.transition.end)};return setTimeout(i,t),this},e(function(){e.support.transition=t()})}),timely.define("external_libs/bootstrap/collapse",["jquery_timely"],function(e){var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r),this.transitioning=null,this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.DEFAULTS={toggle:!0},t.prototype.dimension=function(){var e=this.$element.hasClass("ai1ec-width");return e?"width":"height"},t.prototype.show=function(){if(this.transitioning||this.$element.hasClass("ai1ec-in"))return;var t=e.Event("show.bs.collapse");this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.$parent&&this.$parent.find("> .ai1ec-panel > .ai1ec-in");if(n&&n.length){var r=n.data("bs.collapse");if(r&&r.transitioning)return;n.collapse("hide"),r||n.data("bs.collapse",null)}var i=this.dimension();this.$element.removeClass("ai1ec-collapse").addClass("ai1ec-collapsing")[i](0),this.transitioning=1;var s=function(){this.$element.removeClass("ai1ec-collapsing").addClass("ai1ec-in")[i]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return s.call(this);var o=e.camelCase(["scroll",i].join("-"));this.$element.one(e.support.transition.end,e.proxy(s,this)).emulateTransitionEnd(350)[i](this.$element[0][o])},t.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass("ai1ec-in"))return;var t=e.Event("hide.bs.collapse");this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("ai1ec-collapsing").removeClass("ai1ec-collapse").removeClass("ai1ec-in"),this.transitioning=1;var r=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("ai1ec-collapsing").addClass("ai1ec-collapse")};if(!e.support.transition)return r.call(this);this.$element[n](0).one(e.support.transition.end,e.proxy(r,this)).emulateTransitionEnd(350)},t.prototype.toggle=function(){this[this.$element.hasClass("ai1ec-in")?"hide":"show"]()};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("bs.collapse"),s=e.extend({},t.DEFAULTS,r.data(),typeof n=="object"&&n);i||r.data("bs.collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.bs.collapse.data-api","[data-toggle=ai1ec-collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i),o=s.data("bs.collapse"),u=o?"toggle":n.data(),a=n.attr("data-parent"),f=a&&e(a);if(!o||!o.transitioning)f&&f.find('[data-toggle=ai1ec-collapse][data-parent="'+a+'"]').not(n).addClass("ai1ec-collapsed"),n[s.hasClass("ai1ec-in")?"addClass":"removeClass"]("ai1ec-collapsed");s.collapse(u)})}),timely.define("external_libs/bootstrap/modal",["jquery_timely"],function(e){var t=function(t,n){this.options=n,this.$element=e(t),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.load(this.options.remote)};t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},t.prototype.toggle=function(e){return this[this.isShown?"hide":"show"](e)},t.prototype.show=function(t){var n=this,r=e.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(r);if(this.isShown||r.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.$element.on("click.dismiss.modal",'[data-dismiss="ai1ec-modal"]',e.proxy(this.hide,this)),this.backdrop(function(){var r=e.support.transition&&n.$element.hasClass("ai1ec-fade");n.$element.parent().length||n.$element.appendTo(document.body),n.$element.show(),r&&n.$element[0].offsetWidth,n.$element.addClass("ai1ec-in").attr("aria-hidden",!1),n.enforceFocus();var i=e.Event("shown.bs.modal",{relatedTarget:t});r?n.$element.find(".ai1ec-modal-dialog").one(e.support.transition.end,function(){n.$element.focus().trigger(i)}).emulateTransitionEnd(300):n.$element.focus().trigger(i)})},t.prototype.hide=function(t){t&&t.preventDefault(),t=e.Event("hide.bs.modal"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.bs.modal"),this.$element.removeClass("ai1ec-in").attr("aria-hidden",!0).off("click.dismiss.modal"),e.support.transition&&this.$element.hasClass("ai1ec-fade")?this.$element.one(e.support.transition.end,e.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()},t.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){this.$element[0]!==e.target&&!this.$element.has(e.target).length&&this.$element.focus()},this))},t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",e.proxy(function(e){e.which==27&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},t.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden.bs.modal")})},t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},t.prototype.backdrop=function(t){var n=this,r=this.$element.hasClass("ai1ec-fade")?"ai1ec-fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="ai1ec-modal-backdrop '+r+'" />').appendTo(document.body),this.$element.on("click.dismiss.modal",e.proxy(function(e){if(e.target!==e.currentTarget)return;this.options.backdrop=="static"?this.$element[0].focus.call(this.$element[0]):this.hide.call(this)},this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("ai1ec-in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("ai1ec-in"),e.support.transition&&this.$element.hasClass("ai1ec-fade")?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()):t&&t()};var n=e.fn.modal;e.fn.modal=function(n,r){return this.each(function(){var i=e(this),s=i.data("bs.modal"),o=e.extend({},t.DEFAULTS,i.data(),typeof n=="object"&&n);s||i.data("bs.modal",s=new t(this,o)),typeof n=="string"?s[n](r):o.show&&s.show(r)})},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.bs.modal.data-api",'[data-toggle="ai1ec-modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s,this).one("hide",function(){n.is(":visible")&&n.focus()})}),e(document).on("show.bs.modal",".ai1ec-modal",function(){e(document.body).addClass("ai1ec-modal-open")}).on("hidden.bs.modal",".ai1ec-modal",function(){e(document.body).removeClass("ai1ec-modal-open")})}),timely.define("external_libs/bootstrap/alert",["jquery_timely"],function(e){var t='[data-dismiss="ai1ec-alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed.bs.alert").remove()}var n=e(this),r=n.attr("data-target");r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));var i=e(r);t&&t.preventDefault(),i.length||(i=n.hasClass("ai1ec-alert")?n:n.parent()),i.trigger(t=e.Event("close.bs.alert"));if(t.isDefaultPrevented())return;i.removeClass("ai1ec-in"),e.support.transition&&i.hasClass("ai1ec-fade")?i.one(e.support.transition.end,s).emulateTransitionEnd(150):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("bs.alert");i||r.data("bs.alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.bs.alert.data-api",t,n.prototype.close)}),timely.define("scripts/add_new_event",["jquery_timely","domReady","ai1ec_config","scripts/add_new_event/event_location/gmaps_helper","scripts/add_new_event/event_location/input_coordinates_event_handlers","scripts/add_new_event/event_location/input_coordinates_utility_functions","scripts/add_new_event/event_date_time/date_time_event_handlers","scripts/add_new_event/event_cost_helper","external_libs/jquery.calendrical_timespan","external_libs/jquery.inputdate","external_libs/jquery.tools","external_libs/ai1ec_datepicker","external_libs/bootstrap/transition","external_libs/bootstrap/collapse","external_libs/bootstrap/modal","external_libs/bootstrap/alert","external_libs/bootstrap/tab"],function(e,t,n,r,i,s,o,u,a){var f=function(){var t=new Date(n.now*1e3),r={allday:"#ai1ec_all_day_event",start_date_input:"#ai1ec_start-date-input",start_time_input:"#ai1ec_start-time-input",start_time:"#ai1ec_start-time",end_date_input:"#ai1ec_end-date-input",end_time_input:"#ai1ec_end-time-input",end_time:"#ai1ec_end-time",date_format:n.date_format,month_names:n.month_names,day_names:n.day_names,week_start_day:n.week_start_day,twentyfour_hour:n.twentyfour_hour,now:t};e.timespan(r);var i=e("#ai1ec_exdate").val(),s=null,o=!1,u;if(i.length>=8){s=[];var f=[];e.each(i.split(","),function(e,t){var r=t.slice(0,8),i=r.substr(0,4),o=r.substr(4,2);u=r.substr(6,2),o=o.charAt(0)==="0"?"0"+(parseInt(o.charAt(1),10)-1):parseInt(o,10)-1,s.push(new Date(i,o,u)),f.push(a.formatDate(new Date(i,o,u),n.date_format,!0))}),e("#widgetField span:first").html(f.join(", "))}else s=new Date(n.now*1e3),o=!0;e("#widgetCalendar").DatePicker({flat:!0,calendars:3,mode:"multiple",start:1,date:s,onChange:function(t){t=t.toString();if(t.length>=8){var r="",i=[];e.each(t.split(","),function(e,t){i.push(a.formatDate(new Date(t),n.date_format)),r+=t.replace(/-/g,"")+"T000000Z,"}),e("#widgetField span").html(i.join(", ")),r=r.slice(0,r.length-1),e("#ai1ec_exdate").val(r)}else e("#ai1ec_exdate").val("")}}),o&&e("#widgetCalendar").DatePickerClear(),e("#widgetCalendar div.datepicker").css("position","absolute")},l=function(){e(".ai1ec-panel-collapse").on("hide",function(){e(this).parent().removeClass("ai1ec-overflow-visible")}),e(".ai1ec-panel-collapse").on("shown",function(){var t=e(this);window.setTimeout(function(){t.parent().addClass("ai1ec-overflow-visible")},350)})},c=function(){f(),timely.require(["libs/gmaps"],function(e){e(r.init_gmaps)})},h=function(t,n){window.alert(n),t.preventDefault(),e("#publish, #ai1ec_bottom_publish").removeClass("button-primary-disabled"),e("#publish, #ai1ec_bottom_publish").siblings("#ajax-loading, .spinner").css("visibility","hidden")},p=function(t){s.ai1ec_check_lat_long_fields_filled_when_publishing_event(t)===!0&&(s.ai1ec_convert_commas_to_dots_for_coordinates(),s.ai1ec_check_lat_long_ok_for_search(t)),e("#ai1ec_ticket_url, #ai1ec_contact_url").each(function(){var e=this.value;if(""!==e){var r=/(http|https):\/\//;r.test(e)||h(t,n.url_not_valid)}})},d=function(){e("#ai1ec_google_map").click(i.toggle_visibility_of_google_map_on_click),e("#ai1ec_input_coordinates").change(i.toggle_visibility_of_coordinate_fields_on_click),e("#post").submit(p),e("input.coordinates").blur(i.update_map_from_coordinates_on_blur),e("#ai1ec_bottom_publish").on("click",o.trigger_publish),e(document).on("change","#ai1ec_end",o.show_end_fields).on("click","#ai1ec_repeat_apply",o.handle_click_on_apply_button).on("click","#ai1ec_repeat_cancel",o.handle_click_on_cancel_modal).on("click","#ai1ec_monthly_type_bymonthday, #ai1ec_monthly_type_byday",o.handle_checkbox_monthly_tab_modal).on("click",".ai1ec-btn-group-grid a",o.handle_click_on_toggle_buttons),e("#ai1ec_repeat_box").on("hidden.bs.modal",o.handle_modal_hide),o.execute_pseudo_handlers(),e("#widgetField > a, #widgetField > span, #ai1ec_exclude_date_label").on("click",o.handle_animation_of_calendar_widget),e("#ai1ec_is_free").on("change",u.handle_change_is_free)},v=function(){e("#ai1ec_event").insertAfter("#titlediv"),e("#post").addClass("ai1ec-visible")},m=function(){c(),t(function(){l(),v(),d()})};return{start:m}}),timely.require(["scripts/add_new_event"],function(e){e.start()}),timely.define("pages/add_new_event",function(){});
118
  * limitations under the License.
119
  * ======================================================================== */
120
 
121
+ timely.define("domReady",[],function(){function u(e){var t;for(t=0;t<e.length;t++)e[t](n)}function a(){var e=r;t&&e.length&&(r=[],u(e))}function f(){t||(t=!0,o&&clearInterval(o),a())}function c(e){return t?e(n):r.push(e),c}var e=typeof window!="undefined"&&window.document,t=!e,n=e?document:null,r=[],i,s,o;if(e){if(document.addEventListener)document.addEventListener("DOMContentLoaded",f,!1),window.addEventListener("load",f,!1);else if(window.attachEvent){window.attachEvent("onload",f),s=document.createElement("div");try{i=window.frameElement===null}catch(l){}s.doScroll&&i&&window.external&&(o=setInterval(function(){try{s.doScroll(),f()}catch(e){}},30))}(document.readyState==="complete"||document.readyState==="interactive")&&f()}return c.version="2.0.0",c.load=function(e,t,n,r){r.isBuild?n(null):c(n)},c}),timely.define("external_libs/bootstrap/tab",["jquery_timely"],function(e){var t=function(t){this.element=e(t)};t.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.ai1ec-dropdown-menu)"),r=t.data("target");r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("ai1ec-active"))return;var i=n.find(".ai1ec-active:last a")[0],s=e.Event("show.bs.tab",{relatedTarget:i});t.trigger(s);if(s.isDefaultPrevented())return;var o=e(r);this.activate(t.parent("li"),n),this.activate(o,o.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:i})})},t.prototype.activate=function(t,n,r){function o(){i.removeClass("ai1ec-active").find("> .ai1ec-dropdown-menu > .ai1ec-active").removeClass("ai1ec-active"),t.addClass("ai1ec-active"),s?(t[0].offsetWidth,t.addClass("ai1ec-in")):t.removeClass("ai1ec-fade"),t.parent(".ai1ec-dropdown-menu")&&t.closest("li.ai1ec-dropdown").addClass("ai1ec-active"),r&&r()}var i=n.find("> .ai1ec-active"),s=r&&e.support.transition&&i.hasClass("ai1ec-fade");s?i.one(e.support.transition.end,o).emulateTransitionEnd(150):o(),i.removeClass("ai1ec-in")};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tab");i||r.data("bs.tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.bs.tab.data-api",'[data-toggle="ai1ec-tab"], [data-toggle="ai1ec-pill"]',function(t){t.preventDefault(),e(this).tab("show")})}),timely.define("libs/utils",["jquery_timely","external_libs/bootstrap/tab"],function(e){var t=function(){return{is_float:function(e){return!isNaN(parseFloat(e))},is_valid_coordinate:function(e,t){var n=t?90:180;return this.is_float(e)&&Math.abs(e)<n},convert_comma_to_dot:function(e){return e.replace(",",".")},field_has_value:function(t){var n="#"+t,r=e(n),i=!1;return r.length===1&&(i=e.trim(r.val())!==""),i},make_alert:function(t,n,r){var i="";switch(n){case"error":i="ai1ec-alert ai1ec-alert-danger";break;case"success":i="ai1ec-alert ai1ec-alert-success";break;default:i="ai1ec-alert"}var s=e("<div />",{"class":i,html:t});if(!r){var o=e("<button>",{type:"button","class":"ai1ec-close","data-dismiss":"ai1ec-alert",text:"×"});s.prepend(o)}return s},get_ajax_url:function(){return typeof window.ajaxurl=="undefined"?"http://localhost/wordpress/wp-admin/admin-ajax.php":window.ajaxurl},isUrl:function(e){var t=/(http|https|webcal):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(e)},isValidEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)},activate_saved_tab_on_page_load:function(t){null===t||undefined===t?e("ul.ai1ec-nav a:first").tab("show"):e("ul.ai1ec-nav a[href="+t+"]").tab("show")}}}();return t}),timely.define("scripts/add_new_event/event_location/input_coordinates_utility_functions",["jquery_timely","ai1ec_config","libs/utils"],function(e,t,n){var r=function(){e("#ai1ec_input_coordinates:checked").length>0&&e("#ai1ec_table_coordinates input.coordinates").each(function(){this.value=n.convert_comma_to_dot(this.value)})},i=function(t,n){var r=e("<div />",{text:n,"class":"ai1ec-error"});e(t).after(r)},s=function(t,n){t.target.id==="post"&&(t.stopImmediatePropagation(),t.preventDefault(),e("#publish").removeClass("button-primary-disabled"),e("#publish").siblings(".spinner").css("visibility","hidden")),e(n).focus()},o=function(){var t=n.field_has_value("ai1ec_address"),r=!0;return e(".coordinates").each(function(){var e=n.field_has_value(this.id);e||(r=!1)}),t||r},u=function(n){var r=!0,o=!1;return e("#ai1ec_input_coordinates:checked").length>0&&(e("div.ai1ec-error").remove(),e("#ai1ec_table_coordinates input.coordinates").each(function(){var n=e(this).hasClass("latitude"),s=n?t.error_message_not_entered_lat:t.error_message_not_entered_long;this.value===""&&(r=!1,o===!1&&(o=this),i(this,s))})),r===!1&&s(n,o),r},a=function(r){if(e("#ai1ec_input_coordinates:checked").length===1){e("div.ai1ec-error").remove();var o=!0,u=!1,a=!1;return e("#ai1ec_table_coordinates input.coordinates").each(function(){if(this.value===""){a=!0;return}var r=e(this).hasClass("latitude"),s=r?t.error_message_not_valid_lat:t.error_message_not_valid_long;n.is_valid_coordinate(this.value,r)||(o=!1,u===!1&&(u=this),i(this,s))}),o===!1&&s(r,u),a===!0&&(o=!1),o}};return{ai1ec_convert_commas_to_dots_for_coordinates:r,ai1ec_show_error_message_after_element:i,check_if_address_or_coordinates_are_set:o,ai1ec_check_lat_long_fields_filled_when_publishing_event:u,ai1ec_check_lat_long_ok_for_search:a}}),timely.define("external_libs/jquery.autocomplete_geomod",["jquery_timely"],function(e){e.fn.extend({autocomplete:function(t,n){var r=typeof t=="string";return n=e.extend({},e.Autocompleter.defaults,{url:r?t:null,data:r?null:t,delay:r?e.Autocompleter.defaults.delay:10,max:n&&!n.scroll?10:150},n),n.highlight=n.highlight||function(e){return e},n.formatMatch=n.formatMatch||n.formatItem,this.each(function(){new e.Autocompleter(this,n)})},result:function(e){return this.bind("result",e)},search:function(e){return this.trigger("search",[e])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(e){return this.trigger("setOptions",[e])},unautocomplete:function(){return this.trigger("unautocomplete")}}),e.Autocompleter=function(t,n){function d(){var r=h.selected();if(!r)return!1;var s=r.result;o=s;if(n.multiple){var u=m(i.val());if(u.length>1){var a=n.multipleSeparator.length,f=e(t).selection().start,l,c=0;e.each(u,function(e,t){c+=t.length;if(f<=c)return l=e,!1;c+=a}),u[l]=s,s=u.join(n.multipleSeparator)}s+=n.multipleSeparator}return i.val(s),w(),i.trigger("result",[r.data,r.value]),!0}function v(e,t){if(f==r.DEL){h.hide();return}var s=i.val();if(!t&&s==o)return;o=s,s=g(s),s.length>=n.minChars?(i.addClass(n.loadingClass),n.matchCase||(s=s.toLowerCase()),S(s,E,w)):(T(),h.hide())}function m(t){return t?n.multiple?e.map(t.split(n.multipleSeparator),function(n){return e.trim(t).length?e.trim(n):null}):[e.trim(t)]:[""]}function g(r){if(!n.multiple)return r;var i=m(r);if(i.length==1)return i[0];var s=e(t).selection().start;return s==r.length?i=m(r):i=m(r.replace(r.substring(s),"")),i[i.length-1]}function y(s,u){n.autoFill&&g(i.val()).toLowerCase()==s.toLowerCase()&&f!=r.BACKSPACE&&(i.val(i.val()+u.substring(g(o).length)),e(t).selection(o.length,o.length+u.length))}function b(){clearTimeout(s),s=setTimeout(w,200)}function w(){var e=h.visible();h.hide(),clearTimeout(s),T(),n.mustMatch&&i.search(function(e){if(!e)if(n.multiple){var t=m(i.val()).slice(0,-1);i.val(t.join(n.multipleSeparator)+(t.length?n.multipleSeparator:""))}else i.val(""),i.trigger("result",null)})}function E(e,t){t&&t.length&&a?(T(),h.display(t,e),y(e,t[0].value),h.show()):w()}function S(r,i,s){n.matchCase||(r=r.toLowerCase());var o=u.load(r);if(o&&o.length)i(r,o);else if(n.geocoder){var a=g(r),f={address:a};n.region&&(f.region=n.region),n.geocoder.geocode(f,function(e,t){var s=n.parse(e,t,a);u.add(r,s),i(r,s)})}else if(typeof n.url=="string"&&n.url.length>0){var l={timestamp:+(new Date)};e.each(n.extraParams,function(e,t){l[e]=typeof t=="function"?t():t}),e.ajax({mode:"abort",port:"autocomplete"+t.name,dataType:n.dataType,url:n.url,data:e.extend({q:g(r),limit:n.max},l),success:function(e){var t=n.parse&&n.parse(e)||x(e);u.add(r,t),i(r,t)}})}else h.emptyList(),s(r)}function x(t){var r=[],i=t.split("\n");for(var s=0;s<i.length;s++){var o=e.trim(i[s]);o&&(o=o.split("|"),r[r.length]={data:o,value:o[0],result:n.formatResult&&n.formatResult(o,o[0])||o[0]})}return r}function T(){i.removeClass(n.loadingClass)}var r={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8},i=e(t).attr("autocomplete","off").addClass(n.inputClass),s,o="",u=e.Autocompleter.Cache(n),a=0,f,l=navigator.userAgent.match(/opera/i),c={mouseDownOnSelect:!1},h=e.Autocompleter.Select(n,t,d,c),p;l&&e(t.form).bind("submit.autocomplete",function(){if(p)return p=!1,!1}),i.bind((l?"keypress":"keydown")+".autocomplete",function(t){a=1,f=t.keyCode;switch(t.keyCode){case r.UP:t.preventDefault(),h.visible()?h.prev():v(0,!0);break;case r.DOWN:t.preventDefault(),h.visible()?h.next():v(0,!0);break;case r.PAGEUP:t.preventDefault(),h.visible()?h.pageUp():v(0,!0);break;case r.PAGEDOWN:t.preventDefault(),h.visible()?h.pageDown():v(0,!0);break;case n.multiple&&e.trim(n.multipleSeparator)==","&&r.COMMA:case r.TAB:case r.RETURN:if(d())return t.preventDefault(),p=!0,!1;break;case r.ESC:h.hide();break;default:clearTimeout(s),s=setTimeout(v,n.delay)}}).focus(function(){a++}).blur(function(){a=0,c.mouseDownOnSelect||b()}).click(function(){a++>1&&!h.visible()&&v(0,!0)}).bind("search",function(){function n(e,n){var r;if(n&&n.length)for(var s=0;s<n.length;s++)if(n[s].result.toLowerCase()==e.toLowerCase()){r=n[s];break}typeof t=="function"?t(r):i.trigger("result",r&&[r.data,r.value])}var t=arguments.length>1?arguments[1]:null;e.each(m(i.val()),function(e,t){S(t,n,n)})}).bind("flushCache",function(){u.flush()}).bind("setOptions",function(){e.extend(n,arguments[1]),"data"in arguments[1]&&u.populate()}).bind("unautocomplete",function(){h.unbind(),i.unbind(),e(t.form).unbind(".autocomplete")})},e.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:!1,matchSubset:!0,matchContains:!1,cacheLength:10,max:100,mustMatch:!1,extraParams:{},selectFirst:!0,formatItem:function(e){return e[0]},formatMatch:null,autoFill:!1,width:0,multiple:!1,multipleSeparator:", ",highlight:function(e,t){return e.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+t.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:!0,scrollHeight:180},e.Autocompleter.Cache=function(t){function i(e,n){t.matchCase||(e=e.toLowerCase());var r=e.indexOf(n);return t.matchContains=="word"&&(r=e.toLowerCase().search("\\b"+n.toLowerCase())),r==-1?!1:r==0||t.matchContains}function s(e,i){r>t.cacheLength&&u(),n[e]||r++,n[e]=i}function o(){if(!t.data)return!1;var n={},r=0;t.url||(t.cacheLength=1),n[""]=[];for(var i=0,o=t.data.length;i<o;i++){var u=t.data[i];u=typeof u=="string"?[u]:u;var a=t.formatMatch(u,i+1,t.data.length);if(a===!1)continue;var f=a.charAt(0).toLowerCase();n[f]||(n[f]=[]);var l={value:a,data:u,result:t.formatResult&&t.formatResult(u)||a};n[f].push(l),r++<t.max&&n[""].push(l)}e.each(n,function(e,n){t.cacheLength++,s(e,n)})}function u(){n={},r=0}var n={},r=0;return setTimeout(o,25),{flush:u,add:s,populate:o,load:function(s){if(!t.cacheLength||!r)return null;if(!t.url&&t.matchContains){var o=[];for(var u in n)if(u.length>0){var a=n[u];e.each(a,function(e,t){i(t.value,s)&&o.push(t)})}return o}if(n[s])return n[s];if(t.matchSubset)for(var f=s.length-1;f>=t.minChars;f--){var a=n[s.substr(0,f)];if(a){var o=[];return e.each(a,function(e,t){i(t.value,s)&&(o[o.length]=t)}),o}}return null}}},e.Autocompleter.Select=function(t,n,r,i){function p(){if(!l)return;c=e("<div/>").hide().addClass(t.resultsClass).css("position","absolute").appendTo(document.body),h=e("<ul/>").appendTo(c).mouseover(function(t){d(t).nodeName&&d(t).nodeName.toUpperCase()=="LI"&&(u=e("li",h).removeClass(s.ACTIVE).index(d(t)),e(d(t)).addClass(s.ACTIVE))}).click(function(t){return e(d(t)).addClass(s.ACTIVE),r(),n.focus(),!1}).mousedown(function(){i.mouseDownOnSelect=!0}).mouseup(function(){i.mouseDownOnSelect=!1}),t.width>0&&c.css("width",t.width),l=!1}function d(e){var t=e.target;while(t&&t.tagName!="LI")t=t.parentNode;return t?t:[]}function v(e){o.slice(u,u+1).removeClass(s.ACTIVE),m(e);var n=o.slice(u,u+1).addClass(s.ACTIVE);if(t.scroll){var r=0;o.slice(0,u).each(function(){r+=this.offsetHeight}),r+n[0].offsetHeight-h.scrollTop()>h[0].clientHeight?h.scrollTop(r+n[0].offsetHeight-h.innerHeight()):r<h.scrollTop()&&h.scrollTop(r)}}function m(e){u+=e,u<0?u=o.size()-1:u>=o.size()&&(u=0)}function g(e){return t.max&&t.max<e?t.max:e}function y(){h.empty();var n=g(a.length);for(var r=0;r<n;r++){if(!a[r])continue;var i=t.formatItem(a[r].data,r+1,n,a[r].value,f);if(i===!1)continue;var l=e("<li/>").html(t.highlight(i,f)).addClass(r%2==0?"ac_even":"ac_odd").appendTo(h)[0];e.data(l,"ac_data",a[r])}o=h.find("li"),t.selectFirst&&(o.slice(0,1).addClass(s.ACTIVE),u=0),e.fn.bgiframe&&h.bgiframe()}var s={ACTIVE:"ac_over"},o,u=-1,a,f="",l=!0,c,h;return{display:function(e,t){p(),a=e,f=t,y()},next:function(){v(1)},prev:function(){v(-1)},pageUp:function(){u!=0&&u-8<0?v(-u):v(-8)},pageDown:function(){u!=o.size()-1&&u+8>o.size()?v(o.size()-1-u):v(8)},hide:function(){c&&c.hide(),o&&o.removeClass(s.ACTIVE),u=-1},visible:function(){return c&&c.is(":visible")},current:function(){return this.visible()&&(o.filter("."+s.ACTIVE)[0]||t.selectFirst&&o[0])},show:function(){var r=e(n).offset();c.css({width:typeof t.width=="string"||t.width>0?t.width:e(n).width(),top:r.top+n.offsetHeight,left:r.left}).show();if(t.scroll){h.scrollTop(0),h.css({maxHeight:t.scrollHeight,overflow:"auto"});if(navigator.userAgent.match(/msie/i)&&typeof document.body.style.maxHeight=="undefined"){var i=0;o.each(function(){i+=this.offsetHeight});var s=i>t.scrollHeight;h.css("height",s?t.scrollHeight:i),s||o.width(h.width()-parseInt(o.css("padding-left"))-parseInt(o.css("padding-right")))}}},selected:function(){var t=o&&o.filter("."+s.ACTIVE).removeClass(s.ACTIVE);return t&&t.length&&e.data(t[0],"ac_data")},emptyList:function(){h&&h.empty()},unbind:function(){c&&c.remove()}}},e.fn.selection=function(e,t){if(e!==undefined)return this.each(function(){if(this.createTextRange){var n=this.createTextRange();t===undefined||e==t?(n.move("character",e),n.select()):(n.collapse(!0),n.moveStart("character",e),n.moveEnd("character",t),n.select())}else this.setSelectionRange?this.setSelectionRange(e,t):this.selectionStart&&(this.selectionStart=e,this.selectionEnd=t)});var n=this[0];if(n.createTextRange){var r=document.selection.createRange(),i=n.value,s="<->",o=r.text.length;r.text=s;var u=n.value.indexOf(s);return n.value=i,this.selection(u,u+o),{start:u,end:u+o}}if(n.selectionStart!==undefined)return{start:n.selectionStart,end:n.selectionEnd}}}),timely.define("external_libs/geo_autocomplete",["jquery_timely","external_libs/jquery.autocomplete_geomod"],function(e){e.fn.extend({geo_autocomplete:function(t,n){return options=e.extend({},e.Autocompleter.defaults,{geocoder:t,mapwidth:100,mapheight:100,maptype:"terrain",mapkey:"ABQIAAAAbnvDoAoYOSW2iqoXiGTpYBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQNumU68AwGqjbSNF9YO8NokKst8w",mapsensor:!1,parse:function(t,n,r){var i=[];return t&&n&&n=="OK"&&e.each(t,function(t,n){if(n.geometry&&n.geometry.viewport){var s=n.formatted_address.split(","),o=s[0];e.each(s,function(t,n){if(n.toLowerCase().indexOf(r.toLowerCase())!=-1)return o=e.trim(n),!1}),i.push({data:n,value:o,result:o})}}),i},formatItem:function(e,t,n,r){var i="https://maps.google.com/maps/api/staticmap?visible="+e.geometry.viewport.getSouthWest().toUrlValue()+"|"+e.geometry.viewport.getNorthEast().toUrlValue()+"&size="+options.mapwidth+"x"+options.mapheight+"&maptype="+options.maptype+"&key="+options.mapkey+"&sensor="+(options.mapsensor?"true":"false"),s=e.formatted_address.replace(/,/gi,",<br/>");return'<img src="'+i+'" width="'+options.mapwidth+'" height="'+options.mapheight+'" /> '+s+'<br clear="both"/>'}},n),options.highlight=options.highlight||function(e){return e},options.formatMatch=options.formatMatch||options.formatItem,options.resultsClass="ai1ec-geo-ac-results-not-ready",this.each(function(){e(this).one("focus",function(){var t=setInterval(function(){var n=e(".ai1ec-geo-ac-results-not-ready");n.length&&(n.removeClass("ai1ec-geo-ac-results-not-ready").addClass("ai1ec-geo-ac-results").children("ul").addClass("ai1ec-dropdown-menu"),clearInterval(t))},500)}),new e.Autocompleter(this,options)})}})}),timely.define("scripts/add_new_event/event_location/gmaps_helper",["jquery_timely","domReady","ai1ec_config","scripts/add_new_event/event_location/input_coordinates_utility_functions","external_libs/jquery.autocomplete_geomod","external_libs/geo_autocomplete"],function(e,t,n,r){var i,s,o,u,a,f,l=function(t){e("input.longitude").val(t.latLng.lng()),e("input.latitude").val(t.latLng.lat()),e("#ai1ec_input_coordinates:checked").length===0&&e("#ai1ec_input_coordinates").trigger("click")},c=function(){!navigator.geolocation||navigator.geolocation.getCurrentPosition(function(e){var t=r.check_if_address_or_coordinates_are_set();if(t===!1){var n=e.coords.latitude,i=e.coords.longitude;s=new google.maps.LatLng(n,i),a.setPosition(s),u.setCenter(s),u.setZoom(15),f=e}})},h=function(){n.disable_autocompletion||e("#ai1ec_address").geo_autocomplete(new google.maps.Geocoder,{selectFirst:!1,minChars:3,cacheLength:50,width:300,scroll:!0,scrollHeight:330,region:n.region}).result(function(e,t){t&&d(t)}).change(function(){if(e(this).val().length>0){var t=e(this).val();i.geocode({address:t,region:n.region},function(e,t){t===google.maps.GeocoderStatus.OK&&d(e[0])})}})},p=function(){i=new google.maps.Geocoder,s=new google.maps.LatLng(9.965,-83.327),o={zoom:0,mapTypeId:google.maps.MapTypeId.ROADMAP,center:s},t(function(){e("#ai1ec_map_canvas").length>0&&(u=new google.maps.Map(e("#ai1ec_map_canvas").get(0),o),a=new google.maps.Marker({map:u,draggable:!0}),google.maps.event.addListener(a,"dragend",l),a.setPosition(s),c(),h(),m())})},d=function(t){u.setCenter(t.geometry.location),u.setZoom(15),a.setPosition(t.geometry.location),e("#ai1ec_address").val(t.formatted_address),e("#ai1ec_latitude").val(t.geometry.location.lat()),e("#ai1ec_longitude").val(t.geometry.location.lng()),e("#ai1ec_input_coordinates").is(":checked")||e("#ai1ec_input_coordinates").click();var n="",r="",i="",s=0,o=0,f="";for(var l=0;l<t.address_components.length;l++)switch(t.address_components[l].types[0]){case"street_number":n=t.address_components[l].long_name;break;case"route":r=t.address_components[l].long_name;break;case"locality":i=t.address_components[l].long_name;break;case"administrative_area_level_1":f=t.address_components[l].long_name;break;case"postal_code":s=t.address_components[l].long_name;break;case"country":o=t.address_components[l].long_name}var c=n.length>0?n+" ":"";c+=r.length>0?r:"",s=s!==0?s:"",e("#ai1ec_city").val(i),e("#ai1ec_province").val(f),e("#ai1ec_postal_code").val(s),e("#ai1ec_country").val(o)},v=function(){var t=parseFloat(e("input.latitude").val()),n=parseFloat(e("input.longitude").val()),r=new google.maps.LatLng(t,n);u.setCenter(r),u.setZoom(15),a.setPosition(r)},m=function(){e("#ai1ec_input_coordinates:checked").length===0?(e("#ai1ec_table_coordinates").css({visibility:"hidden"}),e("#ai1ec_address").change()):v()},g=function(){return a},y=function(){return f};return{init_gmaps:p,ai1ec_update_map_from_coordinates:v,get_marker:g,get_position:y}}),timely.define("scripts/add_new_event/event_location/input_coordinates_event_handlers",["jquery_timely","scripts/add_new_event/event_location/input_coordinates_utility_functions","scripts/add_new_event/event_location/gmaps_helper","ai1ec_config"],function(e,t,n,r){var i=function(t){e(this).is(":checked")?e(".ai1ec_box_map").addClass("ai1ec_box_map_visible").hide().slideDown("fast"):e(".ai1ec_box_map").slideUp("fast")},s=function(t){this.checked===!0?e("#ai1ec_table_coordinates").css({visibility:"visible"}):(e("#ai1ec_table_coordinates").css({visibility:"hidden"}),e("#ai1ec_table_coordinates input").val(""),e("div.ai1ec-error").remove())},o=function(e){t.ai1ec_convert_commas_to_dots_for_coordinates();var r=t.ai1ec_check_lat_long_ok_for_search(e);r===!0&&n.ai1ec_update_map_from_coordinates()};return{toggle_visibility_of_google_map_on_click:i,toggle_visibility_of_coordinate_fields_on_click:s,update_map_from_coordinates_on_blur:o}}),timely.define("scripts/add_new_event/event_date_time/date_time_utility_functions",["jquery_timely","ai1ec_config","libs/utils"],function(e,t,n){var r=n.get_ajax_url(),i=function(t,n,r,i,s,o){e(t).val(i),e("#ai1ec_repeat_box").modal("hide");var u=e.trim(e(n).text());u.lastIndexOf(":")===-1&&(u=u.substring(0,u.length-3),e(n).text(u+":")),e(s).attr("disabled",!1),e(r).fadeOut("fast",function(){e(this).text(o.message),e(this).fadeIn("fast")})},s=function(t,n,r,i){e("#ai1ec_repeat_box .ai1ec-alert-danger").text(r.message).removeClass("ai1ec-hide"),e(i).attr("disabled",!1),e(t).val("");var s=e.trim(e(n).text());s.lastIndexOf("...")===-1&&(s=s.substring(0,s.length-1),e(n).text(s+"...")),e(this).closest("tr").find(".ai1ec_rule_text").text()===""&&e(t).siblings("input:checkbox").removeAttr("checked")},o=function(t,n,r,i,s){e(document).on("click",t,function(){if(!e(n).is(":checked")){e(n).attr("checked",!0);var t=e.trim(e(r).text());t=t.substring(0,t.length-3),e(r).text(t+":")}return l(i,s),!1})},u=function(t,n,r,i,s){e(t).click(function(){if(e(this).is(":checked"))this.id==="ai1ec_repeat"&&e("#ai1ec_exclude").removeAttr("disabled"),l(i,s);else{this.id==="ai1ec_repeat"&&e("#ai1ec_exclude").attr("disabled",!0),e(n).text("");var t=e.trim(e(r).text());t=t.substring(0,t.length-1),e(r).text(t+"...")}})},a=function(t,n,r){if(e.trim(e(t).text())===""){e(n).removeAttr("checked"),e("#ai1ec_repeat").is(":checked")||e("#ai1ec_exclude").attr("disabled",!0);var i=e.trim(e(r).text());i.lastIndexOf("...")===-1&&(i=i.substring(0,i.length-1),e(r).text(i+"..."))}},f=function(){e("#ai1ec_count, #ai1ec_daily_count, #ai1ec_weekly_count, #ai1ec_monthly_count, #ai1ec_yearly_count").rangeinput({css:{input:"ai1ec-range",slider:"ai1ec-slider",progress:"ai1ec-progress",handle:"ai1ec-handle"}});var n={start_date_input:"#ai1ec_until-date-input",start_time:"#ai1ec_until-time",date_format:t.date_format,month_names:t.month_names,day_names:t.day_names,week_start_day:t.week_start_day,twentyfour_hour:t.twentyfour_hour,now:new Date(t.now*1e3)};e.inputdate(n)},l=function(t,n){var i=e("#ai1ec_repeat_box"),s=e(".ai1ec-loading",i);i.modal({backdrop:"static"}),e.post(r,t,function(e){e.error?(window.alert(e.message),i.modal("hide")):(s.addClass("ai1ec-hide").after(e.message),typeof n=="function"&&n())},"json")};return{show_repeat_tabs:l,init_modal_widgets:f,click_on_modal_cancel:a,click_on_checkbox:u,click_on_ics_rule_text:o,repeat_form_error:s,repeat_form_success:i}}),timely.define("external_libs/jquery.calendrical_timespan",["jquery_timely"],function(e){function l(){var e=new Date;return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function c(e,t){return typeof e=="string"&&(e=new Date(e)),typeof t=="string"&&(t=new Date(t)),e.getUTCDate()===t.getUTCDate()&&e.getUTCMonth()===t.getUTCMonth()&&e.getUTCFullYear()===t.getUTCFullYear()?!0:!1}function h(e,t){if(e instanceof Date)return h(e.getUTCFullYear(),e.getUTCMonth());if(t==1){var n=e%4==0&&(e%100!=0||e%400==0);return n?29:28}return t==3||t==5||t==8||t==10?30:31}function p(e){return new Date(e.getTime()+864e5)}function d(e){return new Date(e.getTime()-864e5)}function v(e,t){return t==11?new Date(e+1,0,1):new Date(e,t+1,1)}function m(t,n,r,i){var s=i.monthNames.split(","),o=e("<thead />"),u=e("<tr />").appendTo(o);e("<th />").addClass("monthCell").append(e('<a href="javascript:;">&laquo;</a>').addClass("prevMonth").mousedown(function(e){g(t,r==0?n-1:n,r==0?11:r-1,i),e.preventDefault()})).appendTo(u),e("<th />").addClass("monthCell").attr("colSpan",5).append(e('<a href="javascript:;">'+s[r]+" "+n+"</a>").addClass("monthName")).appendTo(u),e("<th />").addClass("monthCell").append(e('<a href="javascript:;">&raquo;</a>').addClass("nextMonth").mousedown(function(){g(t,r==11?n+1:n,r==11?0:r+1,i)})).appendTo(u);var a=i.dayNames.split(","),f=parseInt(i.weekStartDay),l=[];for(var c=0,h=a.length;c<h;c++)l[c]=a[(c+f)%h];var p=e("<tr />").appendTo(o);return e.each(l,function(t,n){e("<td />").addClass("dayName").append(n).appendTo(p)}),o}function g(t,n,r,i){i=i||{};var s=parseInt(i.weekStartDay),o=i.today?i.today:l();o.setHours(0),o.setMinutes(0);var u=new Date(n,r,1),a=v(n,r),f=Math.abs(o.getTimezoneOffset());f!=0&&(o.setHours(o.getHours()+f/60),o.setMinutes(o.getMinutes()+f%60),u.setHours(u.getHours()+f/60),u.setMinutes(u.getMinutes()+f%60),a.setHours(a.getHours()+f/60),a.setMinutes(a.getMinutes()+f%60));var h=a.getUTCDay()-s;h<0?h=Math.abs(h)-1:h=6-h;for(var g=0;g<h;g++)a=p(a);var y=e("<table />");m(t,n,r,i).appendTo(y);var b=e("<tbody />").appendTo(y),w=e("<tr />"),E=u.getUTCDay()-s;E<0&&(E=7+E);for(var g=0;g<E;g++)u=d(u);while(u<=a){var S=e("<td />").addClass("day").append(e('<a href="javascript:;">'+u.getUTCDate()+"</a>").click(function(){var e=u;return function(){i&&i.selectDate&&i.selectDate(e)}}())).appendTo(w),x=c(u,o),T=i.selected&&c(i.selected,u);x&&S.addClass("today"),T&&S.addClass("selected"),x&&T&&S.addClass("today_selected"),u.getUTCMonth()!=r&&S.addClass("nonMonth");var N=u.getUTCDay();(N+1)%7==s&&(b.append(w),w=e("<tr />")),u=p(u)}w.children().length?b.append(w):w.remove(),t.empty().append(y)}function y(t,n){var r=n.selection&&f(n.selection);r&&(r.minute=Math.floor(r.minute/15)*15);var i=n.startTime&&n.startTime.hour*60+n.startTime.minute,s,o=e("<ul />");for(var a=0;a<24;a++)for(var l=0;l<60;l+=15){if(i&&i>a*60+l)continue;(function(){var t=u(a,l,n.isoTime),f=t;if(i!=null){var c=a*60+l-i;c<60?f+=" ("+c+" min)":c==60?f+=" (1 hr)":f+=" ("+Math.floor(c/60)+" hr "+c%60+" min)"}var h=e("<li />").append(e('<a href="javascript:;">'+f+"</a>").click(function(){n&&n.selectTime&&n.selectTime(t)}).mousemove(function(){e("li.selected",o).removeClass("selected")})).appendTo(o);!s&&a==n.defaultHour&&(s=h),r&&r.hour==a&&r.minute==l&&(h.addClass("selected"),s=h)})()}s&&setTimeout(function(){t[0].scrollTop=s[0].offsetTop-s.height()*2},0),t.empty().append(o)}function b(e){e.addClass("error").fadeOut("normal",function(){e.val(e.data("timespan.stored")).removeClass("error").fadeIn("fast")})}function w(){e(this).data("timespan.stored",this.value)}function E(t,n,r,i,a,f,l,c,h,p){r.val(r.data("timespan.initial_value")),f.val(f.data("timespan.initial_value")),l.get(0).checked=l.data("timespan.initial_value");var d=s(r,p,0,15);n.val(u(d.getUTCHours(),d.getUTCMinutes(),c)),t.val(o(d,h));var v=s(f,d.getTime(),1,15);a.val(u(v.getUTCHours(),v.getUTCMinutes(),c)),l.get(0).checked&&v.setUTCDate(v.getUTCDate()-1),i.val(o(v,h)),t.each(w),n.each(w),i.each(w),a.each(w),l.trigger("change.timespan"),e("#ai1ec_instant_event").trigger("change.timespan")}var t={us:{pattern:/([\d]{1,2})\/([\d]{1,2})\/([\d]{4}|[\d]{2})/,format:"m/d/y",order:"middleEndian",zeroPad:!1},iso:{pattern:/([\d]{4}|[\d]{2})-([\d]{1,2})-([\d]{1,2})/,format:"y-m-d",order:"bigEndian",zeroPad:!0},dot:{pattern:/([\d]{1,2}).([\d]{1,2}).([\d]{4}|[\d]{2})/,format:"d.m.y",order:"littleEndian",zeroPad:!1},def:{pattern:/([\d]{1,2})\/([\d]{1,2})\/([\d]{4}|[\d]{2})/,format:"d/m/y",order:"littleEndian",zeroPad:!1}},n=function(e){return e<10?"0"+e:e},r=function(e,t){typeof t=="undefined"&&(t=!1);var r=e.getUTCFullYear()+"-"+n(e.getUTCMonth()+1)+"-"+n(e.getUTCDate());return t&&(r+="T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":00"),r},i=function(e,t){var n=e.val(),r=null;if(n.length<4)r=new Date(t);else{r=new Date(n);var i=n.split("T"),s=i[0].split("-"),o=i[1].split(":");r.setUTCFullYear(s[0],s[1]-1,s[2]),r.setUTCHours(o[0],o[1],o[2],0)}return r},s=function(e,t,n,r){return t+=n*36e5,t-=t%(r*6e4),i(e,t)},o=function(e,n,r){var i,s,o;typeof t[n]=="undefined"&&(n="def"),typeof r=="undefined"&&(r=!1),!0===r?(i=e.getFullYear().toString(),s=(e.getMonth()+1).toString(),o=e.getDate().toString()):(i=e.getUTCFullYear().toString(),s=(e.getUTCMonth()+1).toString(),o=e.getUTCDate().toString()),t[n].zeroPad&&(s.length==1&&(s="0"+s),o.length==1&&(o="0"+o));var u=t[n].format;return u=u.replace("d",o),u=u.replace("m",s),u=u.replace("y",i),u},u=function(e,t,n){var r=t;t<10&&(r="0"+t);if(n){var i=e;return i<10&&(i="0"+e),i+":"+r}var i=e%12;i==0&&(i=12);var s=e<12?"am":"pm";return i+":"+r+s},a=function(e,n){typeof t[n]=="undefined"&&(n="def");var r=e.match(t[n].pattern);if(!r||r.length!=4)return Date("invalid");switch(t[n].order){case"bigEndian":var i=r[3],s=r[2],o=r[1];break;case"littleEndian":var i=r[1],s=r[2],o=r[3];break;case"middleEndian":var i=r[2],s=r[1],o=r[3];break;default:var i=r[1],s=r[2],o=r[3]}return o.length==2&&(o=(new Date).getUTCFullYear().toString().substr(0,2)+o),new Date(s+"/"+i+"/"+o+" GMT")},f=function(e){var t=t=/(\d+)\s*[:\-\.,]\s*(\d+)\s*(am|pm)?/i.exec(e);if(t&&t.length>=3){var n=Number(t[1]),r=Number(t[2]);return n==12&&t[3]&&(n-=12),t[3]&&t[3].toLowerCase()=="pm"&&(n+=12),{hour:n,minute:r}}return null};e.fn.calendricalDate=function(t){return t=t||{},t.padding=t.padding||4,t.monthNames=t.monthNames||"January,February,March,April,May,June,July,August,September,October,November,December",t.dayNames=t.dayNames||"S,M,T,W,T,F,S",t.weekStartDay=t.weekStartDay||0,this.each(function(){var n=e(this),r,i=!1;n.bind("focus",function(){if(r)return;var s=n.position(),u=n.css("padding-left");r=e("<div />").addClass("calendricalDatePopup").mouseenter(function(){i=!0}).mouseleave(function(){i=!1}).mousedown(function(e){e.preventDefault()}).css({position:"absolute",left:s.left,top:s.top+n.height()+t.padding*2}),n.after(r);var f=a(n.val(),t.dateFormat);f.getUTCFullYear()||(f=t.today?t.today:l()),g(r,f.getUTCFullYear(),f.getUTCMonth(),{today:t.today,selected:f,monthNames:t.monthNames,dayNames:t.dayNames,weekStartDay:t.weekStartDay,selectDate:function(e){i=!1,n.val(o(e,t.dateFormat)),r.remove(),r=null;if(t.endDate){var s=a(t.endDate.val(),t.dateFormat);s>=f&&t.endDate.val(o(new Date(e.getTime()+s.getTime()-f.getTime()),t.dateFormat))}}})}).blur(function(){if(i){r&&n.focus();return}if(!r)return;r.remove(),r=null})})},e.fn.calendricalDateRange=function(t){return this.length>=2&&(e(this[0]).calendricalDate(e.extend({endDate:e(this[1])},t)),e(this[1]).calendricalDate(t)),this},e.fn.calendricalDateRangeSingle=function(t){return this.length==1&&e(this).calendricalDate(t),this},e.fn.calendricalTime=function(t){return t=t||{},t.padding=t.padding||4,this.each(function(){var n=e(this),r,i=!1;n.bind("focus click",function(){if(r)return;var s=t.startTime;s&&t.startDate&&t.endDate&&!c(a(t.startDate.val()),a(t.endDate.val()))&&(s=!1);var o=n.position();r=e("<div />").addClass("calendricalTimePopup").mouseenter(function(){i=!0}).mouseleave(function(){i=!1}).mousedown(function(e){e.preventDefault()}).css({position:"absolute",left:o.left,top:o.top+n.height()+t.padding*2}),s&&r.addClass("calendricalEndTimePopup"),n.after(r);var u={selection:n.val(),selectTime:function(e){i=!1,n.val(e),r.remove(),r=null},isoTime:t.isoTime||!1,defaultHour:t.defaultHour!=null?t.defaultHour:8};s&&(u.startTime=f(t.startTime.val())),y(r,u)}).blur(function(){if(i){r&&n.focus();return}if(!r)return;r.remove(),r=null})})},e.fn.calendricalTimeRange=function(t){return this.length>=2&&(e(this[0]).calendricalTime(t),e(this[1]).calendricalTime(e.extend({startTime:e(this[0])},t))),this},e.fn.calendricalDateTimeRange=function(t){return this.length>=4&&(e(this[0]).calendricalDate(e.extend({endDate:e(this[2])},t)),e(this[1]).calendricalTime(t),e(this[2]).calendricalDate(t),e(this[3]).calendricalTime(e.extend({startTime:e(this[1]),startDate:e(this[0]),endDate:e(this[2])},t))),this};var S={allday:"#allday",start_date_input:"#start-date-input",start_time_input:"#start-time-input",start_time:"#start-time",end_date_input:"#end-date-input",end_time_input:"#end-time-input",end_time:"#end-time",twentyfour_hour:!1,date_format:"def",now:new Date},x={init:function(t){function C(){var e=a(s.val(),n.date_format).getTime()/1e3,t=f(l.val());e+=t.hour*3600+t.minute*60;var r=a(h.val(),n.date_format).getTime()/1e3,i=f(p.val());return r+=i.hour*3600+i.minute*60,r-e}function k(){var e=a(s.data("timespan.stored"),n.date_format),t=f(l.data("timespan.stored")),r=e.getTime()/1e3+t.hour*3600+t.minute*60+s.data("time_diff");return r=new Date(r*1e3),h.val(o(r,n.date_format)),p.val(u(r.getUTCHours(),r.getUTCMinutes(),n.twentyfour_hour)),!0}var n=e.extend({},S,t),i=e(n.allday),s=e(n.start_date_input),l=e(n.start_time_input),c=e(n.start_time),h=e(n.end_date_input),p=e(n.end_time_input),d=e(n.end_time),v=e("#ai1ec_instant_event"),m=h.add(p),g=s.add(n.end_date_input),y=l.add(n.end_time_input),x=s.add(n.start_time_input).add(n.end_date_input).add(n.end_time_input);x.bind("focus.timespan",w),v.bind("change.timespan",function(){this.checked?(m.closest("tr").fadeOut(),i.attr("disabled",!0)):(i.removeAttr("disabled"),m.closest("tr").fadeIn())});var T=new Date(n.now.getFullYear(),n.now.getMonth(),n.now.getDate()),N=!1;return i.bind("change.timespan",function(){this.checked?(y.fadeOut(),v.attr("disabled",!0)):(v.removeAttr("disabled"),y.fadeIn()),N||(N=!0,x.calendricalDateTimeRange({today:T,dateFormat:n.date_format,isoTime:n.twentyfour_hour,monthNames:n.month_names,dayNames:n.day_names,weekStartDay:n.week_start_day}))}).get().checked=!1,g.bind("blur.timespan",function(){var t=a(this.value,n.date_format);isNaN(t)?b(e(this)):(e(this).data("timespan.stored",this.value),e(this).val(o(t,n.date_format)))}),y.bind("blur.timespan",function(){var t=f(this.value);t?(e(this).data("timespan.stored",this.value),e(this).val(u(t.hour,t.minute,n.twentyfour_hour))):b(e(this))}),s.add(n.start_time_input).bind("focus.timespan",function(){s.data("time_diff",C())}).bind("blur.timespan",function(){s.data("time_diff")<0&&s.data("time_diff",900);var e=k()}),h.add(n.start_time_input).bind("blur.timespan",function(){if(C()<0){s.data("time_diff",900);var e=k()}}),s.closest("form").bind("submit.timespan",function(){var e=a(s.val(),n.date_format).getTime()/1e3;if(!isNaN(e)){if(!i.get(0).checked){var t=f(l.val());t?e+=t.hour*3600+t.minute*60:e=""}}else e="";e>0&&c.val(r(new Date(e*1e3),!0));var o=a(h.val(),n.date_format).getTime()/1e3;if(!isNaN(o))if(i.get(0).checked)o+=86400;else{var t=f(p.val());t?o+=t.hour*3600+t.minute*60:o=""}else o="";o>0&&d.val(r(new Date(o*1e3),!0))}),c.data("timespan.initial_value",c.val()),d.data("timespan.initial_value",d.val()),i.data("timespan.initial_value",i.get(0).checked),E(s,l,c,h,p,d,i,n.twentyfour_hour,n.date_format,n.now),this},reset:function(t){var n=e.extend({},S,t);return E(e(n.start_date_input),e(n.start_time_input),e(n.start_time),e(n.end_date_input),e(n.end_time_input),e(n.end_time),e(n.allday),n.twentyfour_hour,n.date_format,n.now),this},destroy:function(t){return t=e.extend({},S,t),e.each(t,function(t,n){e(n).unbind(".timespan")}),e(t.start_date_input).closest("form").unbind(".timespan"),this}};return e.timespan=function(t){if(x[t])return x[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return x.init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery.timespan")},{formatDate:o,parseDate:a}}),timely.define("external_libs/bootstrap/button",["jquery_timely"],function(e){var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r)};t.DEFAULTS={loadingText:"loading..."},t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.is("input")?"val":"html",i=n.data();e+="Text",i.resetText||n.data("resetText",n[r]()),n[r](i[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass("ai1ec-"+t).attr(t,t):n.removeClass("ai1ec-"+t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="ai1ec-buttons"]'),t=!0;if(e.length){var n=this.$element.find("input");n.prop("type")==="radio"&&(n.prop("checked")&&this.$element.hasClass("ai1ec-active")?t=!1:e.find(".ai1ec-active").removeClass("ai1ec-active")),t&&n.prop("checked",!this.$element.hasClass("ai1ec-active")).trigger("change")}t&&this.$element.toggleClass("ai1ec-active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("bs.button"),s=typeof n=="object"&&n;i||r.data("bs.button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.bs.button.data-api","[data-toggle^=ai1ec-button]",function(t){var n=e(t.target);n.hasClass("ai1ec-btn")||(n=n.closest(".ai1ec-btn")),n.button("toggle"),t.preventDefault()})}),timely.define("scripts/add_new_event/event_date_time/date_time_event_handlers",["jquery_timely","ai1ec_config","scripts/add_new_event/event_date_time/date_time_utility_functions","external_libs/jquery.calendrical_timespan","libs/utils","external_libs/bootstrap/button"],function(e,t,n,r,i){var s=i.get_ajax_url(),o=function(){var t=e("#ai1ec_end option:selected").val();switch(t){case"0":e("#ai1ec_until_holder, #ai1ec_count_holder").collapse("hide");break;case"1":e("#ai1ec_until_holder").collapse("hide"),e("#ai1ec_count_holder").collapse("show");break;case"2":e("#ai1ec_count_holder").collapse("hide"),e("#ai1ec_until_holder").collapse("show")}},u=function(){e("#publish").trigger("click")},a=function(){var i=e(this),o="",u=e("#ai1ec_repeat_box .ai1ec-tab-pane.ai1ec-active"),a=u.data("freq");switch(a){case"daily":o+="FREQ=DAILY;";var f=e("#ai1ec_daily_count").val();f>1&&(o+="INTERVAL="+f+";");break;case"weekly":o+="FREQ=WEEKLY;";var l=e("#ai1ec_weekly_count").val();l>1&&(o+="INTERVAL="+l+";");var c=e('input[name="ai1ec_weekly_date_select"]:first').val(),h=e('#ai1ec_weekly_date_select > div:first > input[type="hidden"]:first').val();c.length>0&&(o+="WKST="+h+";BYday="+c+";");break;case"monthly":o+="FREQ=MONTHLY;";var p=e("#ai1ec_monthly_count").val(),d=e('input[name="ai1ec_monthly_type"]:checked').val();p>1&&(o+="INTERVAL="+p+";");var v=e('input[name="ai1ec_montly_date_select"]:first').val();if(v.length>0&&d==="bymonthday")o+="BYMONTHDAY="+v+";";else if(d==="byday"){var m=e("#ai1ec_monthly_byday_num").val(),g=e("#ai1ec_monthly_byday_weekday").val();o+="BYday="+m+g+";"}break;case"yearly":o+="FREQ=YEARLY;";var y=e("#ai1ec_yearly_count").val();y>1&&(o+="INTERVAL="+y+";");var b=e('input[name="ai1ec_yearly_date_select"]:first').val();b.length>0&&(o+="BYMONTH="+b+";")}var w=e("#ai1ec_end").val();if(w==="1")o+="COUNT="+e("#ai1ec_count").val()+";";else if(w==="2"){var E=e("#ai1ec_until-date-input").val();E=r.parseDate(E,t.date_format);var S=e("#ai1ec_start-time").val();S=r.parseDate(S,t.date_format),S=new Date(S);var x=E.getUTCDate(),T=E.getUTCMonth()+1,N=S.getUTCHours(),C=S.getUTCMinutes();T=T<10?"0"+T:T,x=x<10?"0"+x:x,N=N<10?"0"+N:N,C=C<10?"0"+C:C,E=E.getUTCFullYear()+""+T+x+"T235959Z",o+="UNTIL="+E+";"}var k={action:"ai1ec_rrule_to_text",rrule:o};i.button("loading").next().addClass("ai1ec-disabled"),e.post(s,k,function(t){t.error?(i.button("reset").next().removeClass("ai1ec-disabled"),"1"===e("#ai1ec_is_box_repeat").val()?n.repeat_form_error("#ai1ec_rrule","#ai1ec_repeat_label",t,i):n.repeat_form_error("#ai1ec_exrule","#ai1ec_exclude_label",t,i)):"1"===e("#ai1ec_is_box_repeat").val()?n.repeat_form_success("#ai1ec_rrule","#ai1ec_repeat_label","#ai1ec_repeat_text > a",o,i,t):n.repeat_form_success("#ai1ec_exrule","#ai1ec_exclude_label","#ai1ec_exclude_text > a",o,i,t)},"json")},f=function(){return e("#ai1ec_is_box_repeat").val()==="1"?n.click_on_modal_cancel("#ai1ec_repeat_text > a","#ai1ec_repeat","#ai1ec_repeat_label"):n.click_on_modal_cancel("#ai1ec_exclude_text > a","#ai1ec_exclude","#ai1ec_exclude_label"),e("#ai1ec_repeat_box").modal("hide"),!1},l=function(){e(this).is("#ai1ec_monthly_type_bymonthday")?(e("#ai1ec_repeat_monthly_byday").collapse("hide"),e("#ai1ec_repeat_monthly_bymonthday").collapse("show")):(e("#ai1ec_repeat_monthly_bymonthday").collapse("hide"),e("#ai1ec_repeat_monthly_byday").collapse("show"))},c=function(){var t=e(this),n=[],r=t.closest(".ai1ec-btn-group-grid"),i;t.toggleClass("ai1ec-active"),e("a",r).each(function(){var t=e(this);t.is(".ai1ec-active")&&(i=t.next().val(),n.push(i))}),r.next().val(n.join())},h=function(){n.click_on_ics_rule_text("#ai1ec_repeat_text > a","#ai1ec_repeat","#ai1ec_repeat_label",{action:"ai1ec_get_repeat_box",repeat:1,post_id:e("#post_ID").val()},n.init_modal_widgets),n.click_on_ics_rule_text("#ai1ec_exclude_text > a","#ai1ec_exclude","#ai1ec_exclude_label",{action:"ai1ec_get_repeat_box",repeat:0,post_id:e("#post_ID").val()},n.init_modal_widgets),n.click_on_checkbox("#ai1ec_repeat","#ai1ec_repeat_text > a","#ai1ec_repeat_label",{action:"ai1ec_get_repeat_box",repeat:1,post_id:e("#post_ID").val()},n.init_modal_widgets),n.click_on_checkbox("#ai1ec_exclude","#ai1ec_exclude_text > a","#ai1ec_exclude_label",{action:"ai1ec_get_repeat_box",repeat:0,post_id:e("#post_ID").val()},n.init_modal_widgets)},p=function(t){var n=e(this).data("state")===undefined?!1:e(this).data("state");return e("#widgetCalendar").stop().animate({height:n?0:e("#widgetCalendar div.datepicker").get(0).offsetHeight},500),e(this).data("state",!n),!1},d=function(){e(".ai1ec-modal-content",this).not(".ai1ec-loading ").remove().end().removeClass("ai1ec-hide")};return{show_end_fields:o,trigger_publish:u,handle_click_on_apply_button:a,handle_click_on_cancel_modal:f,handle_checkbox_monthly_tab_modal:l,execute_pseudo_handlers:h,handle_animation_of_calendar_widget:p,handle_click_on_toggle_buttons:c,handle_modal_hide:d}}),timely.define("scripts/add_new_event/event_cost_helper",["jquery_timely","ai1ec_config"],function(e,t){var n=function(){return e("#ai1ec_is_free").is(":checked")},r=function(){return e("#ai1ec_cost").val()!==""},i=function(r){var i=e(this).parents("table:eq(0)"),s=e("#ai1ec_cost",i),o=t.label_a_buy_tickets_url;n()?(s.attr("value","").addClass("ai1ec-hidden"),o=t.label_a_rsvp_url):s.removeClass("ai1ec-hidden"),e("label[for=ai1ec_ticket_url]",i).text(o)};return{handle_change_is_free:i,check_is_free:n,check_is_price_entered:r}}),timely.define("external_libs/jquery.inputdate",["jquery_timely","external_libs/jquery.calendrical_timespan"],function(e,t){function n(e){e.addClass("error").fadeOut("normal",function(){e.val(e.data("timespan.stored")).removeClass("error").fadeIn("fast")})}function r(){e(this).data("timespan.stored",this.value)}function i(e,n,i,s,o){n.val(n.data("timespan.initial_value"));var u=parseInt(n.val());isNaN(parseInt(u))?u=new Date(o):u=new Date(parseInt(u)*1e3),e.val(t.formatDate(u,s)),e.each(r)}var s={start_date_input:"date-input",start_time:"time",twentyfour_hour:!1,date_format:"def",now:new Date},o={init:function(o){var u=e.extend({},s,o),a=e(u.start_date_input),f=e(u.start_time),l=a,c=a;return c.bind("focus.timespan",r),l.calendricalDate({today:new Date(u.now.getFullYear(),u.now.getMonth(),u.now.getDate()),dateFormat:u.date_format,monthNames:u.month_names,dayNames:u.day_names,weekStartDay:u.week_start_day}),l.bind("blur.timespan",function(){var r=t.parseDate(this.value,u.date_format);isNaN(r)?n(e(this)):(e(this).data("timespan.stored",this.value),e(this).val(t.formatDate(r,u.date_format)))}),a.bind("focus.timespan",function(){var e=t.parseDate(a.val(),u.date_format).getTime()/1e3}).bind("blur.timespan",function(){var e=t.parseDate(a.data("timespan.stored"),u.date_format)}),a.closest("form").bind("submit.timespan",function(){var e=t.parseDate(a.val(),u.date_format).getTime()/1e3;isNaN(e)&&(e=""),f.val(e)}),f.data("timespan.initial_value",f.val()),i(a,f,u.twentyfour_hour,u.date_format,u.now),this},reset:function(t){var n=e.extend({},s,t);return i(e(n.start_date_input),e(n.start_time),n.twentyfour_hour,n.date_format,n.now),this},destroy:function(t){return t=e.extend({},s,t),e.each(t,function(t,n){e(n).unbind(".timespan")}),e(t.start_date_input).closest("form").unbind(".timespan"),this}};e.inputdate=function(t){if(o[t])return o[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return o.init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery.timespan")}}),timely.define("external_libs/jquery.tools",["jquery_timely"],function(e){function i(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}function s(e,t){var n=parseInt(e.css(t),10);if(n)return n;var r=e[0].currentStyle;return r&&r.width&&parseInt(r.width,10)}function o(e){var t=e.data("events");return t&&t.onSlide}function u(t,n){function x(e,s,o,u){o===undefined?o=s/h*m:u&&(o-=n.min),g&&(o=Math.round(o/g)*g);if(s===undefined||g)s=o*h/m;if(isNaN(o))return r;s=Math.max(0,Math.min(s,h)),o=s/h*m;if(u||!f)o+=n.min;f&&(u?s=h-s:o=n.max-o),o=i(o,y);var a=e.type=="click";if(S&&l!==undefined&&!a){e.type="onSlide",E.trigger(e,[o,s]);if(e.isDefaultPrevented())return r}var c=a?n.speed:0,b=a?function(){e.type="change",E.trigger(e,[o])}:null;return f?(d.animate({top:s},c,b),n.progress&&v.animate({height:h-s+d.height()/2},c)):(d.animate({left:s},c,b),n.progress&&v.animate({width:s+d.width()/2},c)),l=o,p=s,t.val(o),r}function T(){f=n.vertical||s(a,"height")>s(a,"width"),f?(h=s(a,"height")-s(d,"height"),c=a.offset().top+h):(h=s(a,"width")-s(d,"width"),c=a.offset().left)}function N(){T(),r.setValue(n.value!==undefined?n.value:n.min)}var r=this,u=n.css,a=e("<div><div/><a href='#'/></div>").data("rangeinput",r),f,l,c,h,p;t.before(a);var d=a.addClass(u.slider).find("a").addClass(u.handle),v=a.find("div").addClass(u.progress);e.each("min,max,step,value".split(","),function(e,r){var i=t.attr(r);parseFloat(i)&&(n[r]=parseFloat(i,10))});var m=n.max-n.min,g=n.step=="any"?0:n.step,y=n.precision;y===undefined&&(y=g.toString().split("."),y=y.length===2?y[1].length:0);if(t.attr("type")=="range"){var b=t.clone().wrap("<div/>").parent().html(),w=e(b.replace(/type/i,"type=text data-orig-type"));w.val(n.value),t.replaceWith(w),t=w}t.addClass(u.input);var E=e(r).add(t),S=!0;e.extend(r,{getValue:function(){return l},setValue:function(t,n){return T(),x(n||e.Event("api"),undefined,t,!0)},getConf:function(){return n},getProgress:function(){return v},getHandle:function(){return d},getInput:function(){return t},step:function(t,i){i=i||e.Event();var s=n.step=="any"?1:n.step;r.setValue(l+s*(t||1),i)},stepUp:function(e){return r.step(e||1)},stepDown:function(e){return r.step(-e||-1)}}),e.each("onSlide,change".split(","),function(t,i){e.isFunction(n[i])&&e(r).on(i,n[i]),r[i]=function(t){return t&&e(r).on(i,t),r}}),d.drag({drag:!1}).on("dragStart",function(){T(),S=o(e(r))||o(t)}).on("drag",function(e,n,r){if(t.is(":disabled"))return!1;x(e,f?n:r)}).on("dragEnd",function(e){e.isDefaultPrevented()||(e.type="change",E.trigger(e,[l]))}).click(function(e){return e.preventDefault()}),a.click(function(e){if(t.is(":disabled")||e.target==d[0])return e.preventDefault();T();var n=f?d.height()/2:d.width()/2;x(e,f?h-c-n+e.pageY:e.pageX-c-n)}),n.keyboard&&t.keydown(function(n){if(t.attr("readonly"))return;var i=n.keyCode,s=e([75,76,38,33,39]).index(i)!=-1,o=e([74,72,40,34,37]).index(i)!=-1;if((s||o)&&!(n.shiftKey||n.altKey||n.ctrlKey))return s?r.step(i==33?10:1,n):o&&r.step(i==34?-10:-1,n),n.preventDefault()}),t.blur(function(t){var n=e(this).val();n!==l&&r.setValue(n,t)}),e.extend(t[0],{stepUp:r.stepUp,stepDown:r.stepDown}),N(),h||e(window).load(N)}e.tools=e.tools||{version:"1.2.7"};var t;t=e.tools.rangeinput={conf:{min:0,max:100,step:"any",steps:0,value:0,precision:undefined,vertical:0,keyboard:!0,progress:!1,speed:100,css:{input:"range",slider:"slider",progress:"progress",handle:"handle"}}};var n,r;e.fn.drag=function(t){return document.ondragstart=function(){return!1},t=e.extend({x:!0,y:!0,drag:!0},t),n=n||e(document).on("mousedown mouseup",function(i){var s=e(i.target);if(i.type=="mousedown"&&s.data("drag")){var o=s.position(),u=i.pageX-o.left,a=i.pageY-o.top,f=!0;n.on("mousemove.drag",function(e){var n=e.pageX-u,i=e.pageY-a,o={};t.x&&(o.left=n),t.y&&(o.top=i),f&&(s.trigger("dragStart"),f=!1),t.drag&&s.css(o),s.trigger("drag",[i,n]),r=s}),i.preventDefault()}else try{r&&r.trigger("dragEnd")}finally{n.off("mousemove.drag"),r=null}}),this.data("drag",!0)},e.expr[":"].range=function(t){var n=t.getAttribute("type");return n&&n=="range"||!!e(t).filter("input").data("rangeinput")},e.fn.rangeinput=function(n){if(this.data("rangeinput"))return this;n=e.extend(!0,{},t.conf,n);var r;return this.each(function(){var t=new u(e(this),e.extend(!0,{},n)),i=t.getInput().data("rangeinput",t);r=r?r.add(i):i}),r?r:this}}),timely.define("external_libs/ai1ec_datepicker",["jquery_timely"],function(e){var t=function(){var t={},n={years:"datepickerViewYears",moths:"datepickerViewMonths",days:"datepickerViewDays"},i={wrapper:'<div class="datepicker"><div class="datepickerBorderT" /><div class="datepickerBorderB" /><div class="datepickerBorderL" /><div class="datepickerBorderR" /><div class="datepickerBorderTL" /><div class="datepickerBorderTR" /><div class="datepickerBorderBL" /><div class="datepickerBorderBR" /><div class="datepickerContainer"><table cellspacing="0" cellpadding="0"><tbody><tr></tr></tbody></table></div></div>',head:["<td>",'<table cellspacing="0" cellpadding="0">',"<thead>","<tr>",'<th class="datepickerGoPrev"><a href="#"><span><%=prev%></span></a></th>','<th colspan="6" class="datepickerMonth"><a href="#"><span></span></a></th>','<th class="datepickerGoNext"><a href="#"><span><%=next%></span></a></th>',"</tr>",'<tr class="datepickerDoW">',"<th><span><%=week%></span></th>","<th><span><%=day1%></span></th>","<th><span><%=day2%></span></th>","<th><span><%=day3%></span></th>","<th><span><%=day4%></span></th>","<th><span><%=day5%></span></th>","<th><span><%=day6%></span></th>","<th><span><%=day7%></span></th>","</tr>","</thead>","</table></td>"],space:'<td class="datepickerSpace"><div></div></td>',days:['<tbody class="datepickerDays">',"<tr>",'<th class="datepickerWeek"><a href="#"><span><%=weeks[0].week%></span></a></th>','<td class="<%=weeks[0].days[0].classname%>"><a href="#"><span><%=weeks[0].days[0].text%></span></a></td>','<td class="<%=weeks[0].days[1].classname%>"><a href="#"><span><%=weeks[0].days[1].text%></span></a></td>','<td class="<%=weeks[0].days[2].classname%>"><a href="#"><span><%=weeks[0].days[2].text%></span></a></td>','<td class="<%=weeks[0].days[3].classname%>"><a href="#"><span><%=weeks[0].days[3].text%></span></a></td>','<td class="<%=weeks[0].days[4].classname%>"><a href="#"><span><%=weeks[0].days[4].text%></span></a></td>','<td class="<%=weeks[0].days[5].classname%>"><a href="#"><span><%=weeks[0].days[5].text%></span></a></td>','<td class="<%=weeks[0].days[6].classname%>"><a href="#"><span><%=weeks[0].days[6].text%></span></a></td>',"</tr>","<tr>",'<th class="datepickerWeek"><a href="#"><span><%=weeks[1].week%></span></a></th>','<td class="<%=weeks[1].days[0].classname%>"><a href="#"><span><%=weeks[1].days[0].text%></span></a></td>','<td class="<%=weeks[1].days[1].classname%>"><a href="#"><span><%=weeks[1].days[1].text%></span></a></td>','<td class="<%=weeks[1].days[2].classname%>"><a href="#"><span><%=weeks[1].days[2].text%></span></a></td>','<td class="<%=weeks[1].days[3].classname%>"><a href="#"><span><%=weeks[1].days[3].text%></span></a></td>','<td class="<%=weeks[1].days[4].classname%>"><a href="#"><span><%=weeks[1].days[4].text%></span></a></td>','<td class="<%=weeks[1].days[5].classname%>"><a href="#"><span><%=weeks[1].days[5].text%></span></a></td>','<td class="<%=weeks[1].days[6].classname%>"><a href="#"><span><%=weeks[1].days[6].text%></span></a></td>',"</tr>","<tr>",'<th class="datepickerWeek"><a href="#"><span><%=weeks[2].week%></span></a></th>','<td class="<%=weeks[2].days[0].classname%>"><a href="#"><span><%=weeks[2].days[0].text%></span></a></td>','<td class="<%=weeks[2].days[1].classname%>"><a href="#"><span><%=weeks[2].days[1].text%></span></a></td>','<td class="<%=weeks[2].days[2].classname%>"><a href="#"><span><%=weeks[2].days[2].text%></span></a></td>','<td class="<%=weeks[2].days[3].classname%>"><a href="#"><span><%=weeks[2].days[3].text%></span></a></td>','<td class="<%=weeks[2].days[4].classname%>"><a href="#"><span><%=weeks[2].days[4].text%></span></a></td>','<td class="<%=weeks[2].days[5].classname%>"><a href="#"><span><%=weeks[2].days[5].text%></span></a></td>','<td class="<%=weeks[2].days[6].classname%>"><a href="#"><span><%=weeks[2].days[6].text%></span></a></td>',"</tr>","<tr>",'<th class="datepickerWeek"><a href="#"><span><%=weeks[3].week%></span></a></th>','<td class="<%=weeks[3].days[0].classname%>"><a href="#"><span><%=weeks[3].days[0].text%></span></a></td>','<td class="<%=weeks[3].days[1].classname%>"><a href="#"><span><%=weeks[3].days[1].text%></span></a></td>','<td class="<%=weeks[3].days[2].classname%>"><a href="#"><span><%=weeks[3].days[2].text%></span></a></td>','<td class="<%=weeks[3].days[3].classname%>"><a href="#"><span><%=weeks[3].days[3].text%></span></a></td>','<td class="<%=weeks[3].days[4].classname%>"><a href="#"><span><%=weeks[3].days[4].text%></span></a></td>','<td class="<%=weeks[3].days[5].classname%>"><a href="#"><span><%=weeks[3].days[5].text%></span></a></td>','<td class="<%=weeks[3].days[6].classname%>"><a href="#"><span><%=weeks[3].days[6].text%></span></a></td>',"</tr>","<tr>",'<th class="datepickerWeek"><a href="#"><span><%=weeks[4].week%></span></a></th>','<td class="<%=weeks[4].days[0].classname%>"><a href="#"><span><%=weeks[4].days[0].text%></span></a></td>','<td class="<%=weeks[4].days[1].classname%>"><a href="#"><span><%=weeks[4].days[1].text%></span></a></td>','<td class="<%=weeks[4].days[2].classname%>"><a href="#"><span><%=weeks[4].days[2].text%></span></a></td>','<td class="<%=weeks[4].days[3].classname%>"><a href="#"><span><%=weeks[4].days[3].text%></span></a></td>','<td class="<%=weeks[4].days[4].classname%>"><a href="#"><span><%=weeks[4].days[4].text%></span></a></td>','<td class="<%=weeks[4].days[5].classname%>"><a href="#"><span><%=weeks[4].days[5].text%></span></a></td>','<td class="<%=weeks[4].days[6].classname%>"><a href="#"><span><%=weeks[4].days[6].text%></span></a></td>',"</tr>","<tr>",'<th class="datepickerWeek"><a href="#"><span><%=weeks[5].week%></span></a></th>','<td class="<%=weeks[5].days[0].classname%>"><a href="#"><span><%=weeks[5].days[0].text%></span></a></td>','<td class="<%=weeks[5].days[1].classname%>"><a href="#"><span><%=weeks[5].days[1].text%></span></a></td>','<td class="<%=weeks[5].days[2].classname%>"><a href="#"><span><%=weeks[5].days[2].text%></span></a></td>','<td class="<%=weeks[5].days[3].classname%>"><a href="#"><span><%=weeks[5].days[3].text%></span></a></td>','<td class="<%=weeks[5].days[4].classname%>"><a href="#"><span><%=weeks[5].days[4].text%></span></a></td>','<td class="<%=weeks[5].days[5].classname%>"><a href="#"><span><%=weeks[5].days[5].text%></span></a></td>','<td class="<%=weeks[5].days[6].classname%>"><a href="#"><span><%=weeks[5].days[6].text%></span></a></td>',"</tr>","</tbody>"],months:['<tbody class="<%=className%>">',"<tr>",'<td colspan="2"><a href="#"><span><%=data[0]%></span></a></td>','<td colspan="2"><a href="#"><span><%=data[1]%></span></a></td>','<td colspan="2"><a href="#"><span><%=data[2]%></span></a></td>','<td colspan="2"><a href="#"><span><%=data[3]%></span></a></td>',"</tr>","<tr>",'<td colspan="2"><a href="#"><span><%=data[4]%></span></a></td>','<td colspan="2"><a href="#"><span><%=data[5]%></span></a></td>','<td colspan="2"><a href="#"><span><%=data[6]%></span></a></td>','<td colspan="2"><a href="#"><span><%=data[7]%></span></a></td>',"</tr>","<tr>",'<td colspan="2"><a href="#"><span><%=data[8]%></span></a></td>','<td colspan="2"><a href="#"><span><%=data[9]%></span></a></td>','<td colspan="2"><a href="#"><span><%=data[10]%></span></a></td>','<td colspan="2"><a href="#"><span><%=data[11]%></span></a></td>',"</tr>","</tbody>"]},s={flat:!1,starts:1,prev:"&#9664;",next:"&#9654;",lastSel:!1,mode:"single",view:"days",calendars:1,format:"Y-m-d",position:"bottom",eventName:"click",onRender:function(){return{}},onChange:function(){return!0},onShow:function(){return!0},onBeforeShow:function(){return!0},onHide:function(){return!0},locale:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekMin:"wk"}},o=function(t){var n=e(t).data("datepicker"),s=e(t),o=Math.floor(n.calendars/2),u,f,l,c,h=0,p,d,v,m,g,y;s.find("td>table tbody").remove();for(var b=0;b<n.calendars;b++){u=new Date(n.current),u.addMonths(-o+b),y=s.find("table").eq(b+1);switch(y[0].className){case"datepickerViewDays":l=a(u,"B, Y");break;case"datepickerViewMonths":l=u.getFullYear();break;case"datepickerViewYears":l=u.getFullYear()-6+" - "+(u.getFullYear()+5)}y.find("thead tr:first th:eq(1) span").text(l),l=u.getFullYear()-6,f={data:[],className:"datepickerYears"};for(var w=0;w<12;w++)f.data.push(l+w);g=r(i.months.join(""),f),u.setDate(1),f={weeks:[],test:10},c=u.getMonth();var l=(u.getDay()-n.starts)%7;u.addDays(-(l+(l<0?7:0))),p=-1,h=0;while(h<42){v=parseInt(h/7,10),m=h%7,f.weeks[v]||(p=u.getWeekNumber(),f.weeks[v]={week:p,days:[]}),f.weeks[v].days[m]={text:u.getDate(),classname:[]},c!=u.getMonth()&&f.weeks[v].days[m].classname.push("datepickerNotInMonth"),u.getDay()==0&&f.weeks[v].days[m].classname.push("datepickerSunday"),u.getDay()==6&&f.weeks[v].days[m].classname.push("datepickerSaturday");var E=n.onRender(u),S=u.valueOf();(E.selected||n.date==S||e.inArray(S,n.date)>-1||n.mode=="range"&&S>=n.date[0]&&S<=n.date[1])&&f.weeks[v].days[m].classname.push("datepickerSelected"),E.disabled&&f.weeks[v].days[m].classname.push("datepickerDisabled"),E.className&&f.weeks[v].days[m].classname.push(E.className),f.weeks[v].days[m].classname=f.weeks[v].days[m].classname.join(" "),h++,u.addDays(1)}g=r(i.days.join(""),f)+g,f={data:n.locale.monthsShort,className:"datepickerMonths"},g=r(i.months.join(""),f)+g,y.append(g)}},u=function(e,t){if(e.constructor==Date)return new Date(e);var n=e.split(/\W+/),r=t.split(/\W+/),i,s,o,u,a,f=new Date;for(var l=0;l<n.length;l++)switch(r[l]){case"d":case"e":i=parseInt(n[l],10);break;case"m":s=parseInt(n[l],10)-1;break;case"Y":case"y":o=parseInt(n[l],10),o+=o>100?0:o<29?2e3:1900;break;case"H":case"I":case"k":case"l":u=parseInt(n[l],10);break;case"P":case"p":/pm/i.test(n[l])&&u<12?u+=12:/am/i.test(n[l])&&u>=12&&(u-=12);break;case"M":a=parseInt(n[l],10)}return new Date(o===undefined?f.getFullYear():o,s===undefined?f.getMonth():s,i===undefined?f.getDate():i,u===undefined?f.getHours():u,a===undefined?f.getMinutes():a,0)},a=function(e,t){var n=e.getMonth(),r=e.getDate(),i=e.getFullYear(),s=e.getWeekNumber(),o=e.getDay(),u={},a=e.getHours(),f=a>=12,l=f?a-12:a,c=e.getDayOfYear();l==0&&(l=12);var h=e.getMinutes(),p=e.getSeconds(),d=t.split(""),v;for(var m=0;m<d.length;m++){v=d[m];switch(d[m]){case"a":v=e.getDayName();break;case"A":v=e.getDayName(!0);break;case"b":v=e.getMonthName();break;case"B":v=e.getMonthName(!0);break;case"C":v=1+Math.floor(i/100);break;case"d":v=r<10?"0"+r:r;break;case"e":v=r;break;case"H":v=a<10?"0"+a:a;break;case"I":v=l<10?"0"+l:l;break;case"j":v=c<100?c<10?"00"+c:"0"+c:c;break;case"k":v=a;break;case"l":v=l;break;case"m":v=n<9?"0"+(1+n):1+n;break;case"M":v=h<10?"0"+h:h;break;case"p":case"P":v=f?"PM":"AM";break;case"s":v=Math.floor(e.getTime()/1e3);break;case"S":v=p<10?"0"+p:p;break;case"u":v=o+1;break;case"w":v=o;break;case"y":v=(""+i).substr(2,2);break;case"Y":v=i}d[m]=v}return d.join("")},f=function(e){if(Date.prototype.tempDate)return;Date.prototype.tempDate=null,Date.prototype.months=e.months,Date.prototype.monthsShort=e.monthsShort,Date.prototype.days=e.days,Date.prototype.daysShort=e.daysShort,Date.prototype.getMonthName=function(e){return this[e?"months":"monthsShort"][this.getMonth()]},Date.prototype.getDayName=function(e){return this[e?"days":"daysShort"][this.getDay()]},Date.prototype.addDays=function(e){this.setDate(this.getDate()+e),this.tempDate=this.getDate()},Date.prototype.addMonths=function(e){this.tempDate==null&&(this.tempDate=this.getDate()),this.setDate(1),this.setMonth(this.getMonth()+e),this.setDate(Math.min(this.tempDate,this.getMaxDays()))},Date.prototype.addYears=function(e){this.tempDate==null&&(this.tempDate=this.getDate()),this.setDate(1),this.setFullYear(this.getFullYear()+e),this.setDate(Math.min(this.tempDate,this.getMaxDays()))},Date.prototype.getMaxDays=function(){var e=new Date(Date.parse(this)),t=28,n;n=e.getMonth(),t=28;while(e.getMonth()==n)t++,e.setDate(t);return t-1},Date.prototype.getFirstDay=function(){var e=new Date(Date.parse(this));return e.setDate(1),e.getDay()},Date.prototype.getWeekNumber=function(){var e=new Date(this);e.setDate(e.getDate()-(e.getDay()+6)%7+3);var t=e.valueOf();return e.setMonth(0),e.setDate(4),Math.round((t-e.valueOf())/6048e5)+1},Date.prototype.getDayOfYear=function(){var e=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0),t=new Date(this.getFullYear(),0,0,0,0,0),n=e-t;return Math.floor(n/24*60*60*1e3)}},l=function(t){var n=e(t).data("datepicker"),r=e("#"+n.id);if(!n.extraHeight){var i=e(t).find("div");n.extraHeight=i.get(0).offsetHeight+i.get(1).offsetHeight,n.extraWidth=i.get(2).offsetWidth+i.get(3).offsetWidth}var s=r.find("table:first").get(0),o=s.offsetWidth,u=s.offsetHeight;r.css({width:o+n.extraWidth+"px",height:u+n.extraHeight+"px"}).find("div.datepickerContainer").css({width:o+"px",height:u+"px"})},c=function(t){e(t.target).is("span")&&(t.target=t.target.parentNode);var n=e(t.target);if(n.is("a")){t.target.blur();if(n.hasClass("datepickerDisabled"))return!1;var r=e(this).data("datepicker"),i=n.parent(),s=i.parent().parent().parent(),u=e("table",this).index(s.get(0))-1,f=new Date(r.current),l=!1,c=!1;if(i.is("th")){if(i.hasClass("datepickerWeek")&&r.mode=="range"&&!i.next().hasClass("datepickerDisabled")){var p=parseInt(i.next().text(),10);f.addMonths(u-Math.floor(r.calendars/2)),i.next().hasClass("datepickerNotInMonth")&&f.addMonths(p>15?-1:1),f.setDate(p),r.date[0]=f.setHours(0,0,0,0).valueOf(),f.setHours(23,59,59,0),f.addDays(6),r.date[1]=f.valueOf(),c=!0,l=!0,r.lastSel=!1}else if(i.hasClass("datepickerMonth")){f.addMonths(u-Math.floor(r.calendars/2));switch(s.get(0).className){case"datepickerViewDays":s.get(0).className="datepickerViewMonths",n.find("span").text(f.getFullYear());break;case"datepickerViewMonths":s.get(0).className="datepickerViewYears",n.find("span").text(f.getFullYear()-6+" - "+(f.getFullYear()+5));break;case"datepickerViewYears":s.get(0).className="datepickerViewDays",n.find("span").text(a(f,"B, Y"))}}else if(i.parent().parent().is("thead")){switch(s.get(0).className){case"datepickerViewDays":r.current.addMonths(i.hasClass("datepickerGoPrev")?-1:1);break;case"datepickerViewMonths":r.current.addYears(i.hasClass("datepickerGoPrev")?-1:1);break;case"datepickerViewYears":r.current.addYears(i.hasClass("datepickerGoPrev")?-12:12)}c=!0}}else if(i.is("td")&&!i.hasClass("datepickerDisabled")){switch(s.get(0).className){case"datepickerViewMonths":r.current.setMonth(s.find("tbody.datepickerMonths td").index(i)),r.current.setFullYear(parseInt(s.find("thead th.datepickerMonth span").text(),10)),r.current.addMonths(Math.floor(r.calendars/2)-u),s.get(0).className="datepickerViewDays";break;case"datepickerViewYears":r.current.setFullYear(parseInt(n.text(),10)),s.get(0).className="datepickerViewMonths";break;default:var p=parseInt(n.text(),10);f.addMonths(u-Math.floor(r.calendars/2)),i.hasClass("datepickerNotInMonth")&&f.addMonths(p>15?-1:1),f.setDate(p);switch(r.mode){case"multiple":p=f.setHours(0,0,0,0).valueOf(),e.inArray(p,r.date)>-1?e.each(r.date,function(e,t){if(t==p)return r.date.splice(e,1),!1}):r.date.push(p);break;case"range":r.lastSel||(r.date[0]=f.setHours(0,0,0,0).valueOf()),p=f.setHours(23,59,59,0).valueOf(),p<r.date[0]?(r.date[1]=r.date[0]+86399e3,r.date[0]=p-86399e3):r.date[1]=p,r.lastSel=!r.lastSel;break;default:r.date=f.valueOf()}}c=!0,l=!0}c&&o(this),l&&r.onChange.apply(this,h(r))}return!1},h=function(t){var n;return t.mode=="single"?(n=new Date(t.date),[a(n,t.format),n,t.el]):(n=[[],[],t.el],e.each(t.date,function(e,r){var i=new Date(r);n[0].push(a(i,t.format)),n[1].push(i)}),n)},p=function(){var e=document.compatMode=="CSS1Compat";return{l:window.pageXOffset||(e?document.documentElement.scrollLeft:document.body.scrollLeft),t:window.pageYOffset||(e?document.documentElement.scrollTop:document.body.scrollTop),w:window.innerWidth||(e?document.documentElement.clientWidth:document.body.clientWidth),h:window.innerHeight||(e?document.documentElement.clientHeight:document.body.clientHeight)}},d=function(e,t,n){if(e==t)return!0;if(e.contains)return e.contains(t);if(e.compareDocumentPosition)return!!(e.compareDocumentPosition(t)&16);var r=t.parentNode;while(r&&r!=n){if(r==e)return!0;r=r.parentNode}return!1},v=function(t){var n=e("#"+e(this).data("datepickerId"));if(!n.is(":visible")){var r=n.get(0);o(r);var i=n.data("datepicker");i.onBeforeShow.apply(this,[n.get(0)]);var s=e(this).offset(),u=p(),a=s.top,f=s.left,c=e.curCSS(r,"display");n.css({visibility:"hidden",display:"block"}),l(r);switch(i.position){case"top":a-=r.offsetHeight;break;case"left":f-=r.offsetWidth;break;case"right":f+=this.offsetWidth;break;case"bottom":a+=this.offsetHeight}a+r.offsetHeight>u.t+u.h&&(a=s.top-r.offsetHeight),a<u.t&&(a=s.top+this.offsetHeight+r.offsetHeight),f+r.offsetWidth>u.l+u.w&&(f=s.left-r.offsetWidth),f<u.l&&(f=s.left+this.offsetWidth),n.css({visibility:"visible",display:"block",top:a+"px",left:f+"px"}),i.onShow.apply(this,[n.get(0)])!=0&&n.show(),e(document).bind("mousedown",{cal:n,trigger:this},m)}return!1},m=function(t){t.target!=t.data.trigger&&!d(t.data.cal.get(0),t.target,t.data.cal.get(0))&&(t.data.cal.data("datepicker").onHide.apply(this,[t.data.cal.get(0)])!=0&&t.data.cal.hide(),e(document).unbind("mousedown",m))};return{init:function(t){return t=e.extend({},s,t||{}),f(t.locale),t.calendars=Math.max(1,parseInt(t.calendars,10)||1),t.mode=/single|multiple|range/.test(t.mode)?t.mode:"single",this.each(function(){if(!e(this).data("datepicker")){t.el=this,t.date.constructor==String&&(t.date=u(t.date,t.format),t.date.setHours(0,0,0,0));if(t.mode!="single")if(t.date.constructor!=Array)t.date=[t.date.valueOf()],t.mode=="range"&&t.date.push((new Date(t.date[0])).setHours(23,59,59,0).valueOf());else{for(var s=0;s<t.date.length;s++)t.date[s]=u(t.date[s],t.format).setHours(0,0,0,0).valueOf();t.mode=="range"&&(t.date[1]=(new Date(t.date[1])).setHours(23,59,59,0).valueOf())}else t.date=t.date.valueOf();t.current?t.current=u(t.current,t.format):t.current=new Date,t.current.setDate(1),t.current.setHours(0,0,0,0);var a="datepicker_"+parseInt(Math.random()*1e3),f;t.id=a,e(this).data("datepickerId",t.id);var h=e(i.wrapper).attr("id",a).bind("click",c).data("datepicker",t);t.className&&h.addClass(t.className);var p="";for(var s=0;s<t.calendars;s++)f=t.starts,s>0&&(p+=i.space),p+=r(i.head.join(""),{week:t.locale.weekMin,prev:t.prev,next:t.next,day1:t.locale.daysMin[f++%7],day2:t.locale.daysMin[f++%7],day3:t.locale.daysMin[f++%7],day4:t.locale.daysMin[f++%7],day5:t.locale.daysMin[f++%7],day6:t.locale.daysMin[f++%7],day7:t.locale.daysMin[f++%7]});h.find("tr:first").append(p).find("table").addClass(n[t.view]),o(h.get(0)),t.flat?(h.appendTo(this).show().css("position","relative"),l(h.get(0))):(h.appendTo(document.body),e(this).bind(t.eventName,v))}})},showPicker:function(){return this.each(function(){e(this).data("datepickerId")&&v.apply(this)})},hidePicker:function(){return this.each(function(){e(this).data("datepickerId")&&e("#"+e(this).data("datepickerId")).hide()})},setDate:function(t,n){return this.each(function(){if(e(this).data("datepickerId")){var r=e("#"+e(this).data("datepickerId")),i=r.data("datepicker");i.date=t,i.date.constructor==String&&(i.date=u(i.date,i.format),i.date.setHours(0,0,0,0));if(i.mode!="single")if(i.date.constructor!=Array)i.date=[i.date.valueOf()],i.mode=="range"&&i.date.push((new Date(i.date[0])).setHours(23,59,59,0).valueOf());else{for(var s=0;s<i.date.length;s++)i.date[s]=u(i.date[s],i.format).setHours(0,0,0,0).valueOf();i.mode=="range"&&(i.date[1]=(new Date(i.date[1])).setHours(23,59,59,0).valueOf())}else i.date=i.date.valueOf();n&&(i.current=new Date(i.mode!="single"?i.date[0]:i.date)),o(r.get(0))}})},getDate:function(t){if(this.size()>0)return h(e("#"+e(this).data("datepickerId")).data("datepicker"))[t?0:1]},clear:function(){return this.each(function(){if(e(this).data("datepickerId")){var t=e("#"+e(this).data("datepickerId")),n=t.data("datepicker");n.mode!="single"&&(n.date=[],o(t.get(0)))}})},fixLayout:function(){return this.each(function(){if(e(this).data("datepickerId")){var t=e("#"+e(this).data("datepickerId")),n=t.data("datepicker");n.flat&&l(t.get(0))}})}}}();e.fn.extend({DatePicker:t.init,DatePickerHide:t.hidePicker,DatePickerShow:t.showPicker,DatePickerSetDate:t.setDate,DatePickerGetDate:t.getDate,DatePickerClear:t.clear,DatePickerLayout:t.fixLayout});var n={},r=function(e,t){var i=/\W/.test(e)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+e.replace(/[\r\t\n]/g," ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):n[e]=n[e]||r(document.getElementById(e).innerHTML);return t?i(t):i}}),timely.define("external_libs/bootstrap/transition",["jquery_timely"],function(e){function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(e.style[n]!==undefined)return{end:t[n]}}e.fn.emulateTransitionEnd=function(t){var n=!1,r=this;e(this).one(e.support.transition.end,function(){n=!0});var i=function(){n||e(r).trigger(e.support.transition.end)};return setTimeout(i,t),this},e(function(){e.support.transition=t()})}),timely.define("external_libs/bootstrap/collapse",["jquery_timely"],function(e){var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r),this.transitioning=null,this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.DEFAULTS={toggle:!0},t.prototype.dimension=function(){var e=this.$element.hasClass("ai1ec-width");return e?"width":"height"},t.prototype.show=function(){if(this.transitioning||this.$element.hasClass("ai1ec-in"))return;var t=e.Event("show.bs.collapse");this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.$parent&&this.$parent.find("> .ai1ec-panel > .ai1ec-in");if(n&&n.length){var r=n.data("bs.collapse");if(r&&r.transitioning)return;n.collapse("hide"),r||n.data("bs.collapse",null)}var i=this.dimension();this.$element.removeClass("ai1ec-collapse").addClass("ai1ec-collapsing")[i](0),this.transitioning=1;var s=function(){this.$element.removeClass("ai1ec-collapsing").addClass("ai1ec-in")[i]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return s.call(this);var o=e.camelCase(["scroll",i].join("-"));this.$element.one(e.support.transition.end,e.proxy(s,this)).emulateTransitionEnd(350)[i](this.$element[0][o])},t.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass("ai1ec-in"))return;var t=e.Event("hide.bs.collapse");this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("ai1ec-collapsing").removeClass("ai1ec-collapse").removeClass("ai1ec-in"),this.transitioning=1;var r=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("ai1ec-collapsing").addClass("ai1ec-collapse")};if(!e.support.transition)return r.call(this);this.$element[n](0).one(e.support.transition.end,e.proxy(r,this)).emulateTransitionEnd(350)},t.prototype.toggle=function(){this[this.$element.hasClass("ai1ec-in")?"hide":"show"]()};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("bs.collapse"),s=e.extend({},t.DEFAULTS,r.data(),typeof n=="object"&&n);i||r.data("bs.collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.bs.collapse.data-api","[data-toggle=ai1ec-collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i),o=s.data("bs.collapse"),u=o?"toggle":n.data(),a=n.attr("data-parent"),f=a&&e(a);if(!o||!o.transitioning)f&&f.find('[data-toggle=ai1ec-collapse][data-parent="'+a+'"]').not(n).addClass("ai1ec-collapsed"),n[s.hasClass("ai1ec-in")?"addClass":"removeClass"]("ai1ec-collapsed");s.collapse(u)})}),timely.define("external_libs/bootstrap/modal",["jquery_timely"],function(e){var t=function(t,n){this.options=n,this.$element=e(t),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.load(this.options.remote)};t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},t.prototype.toggle=function(e){return this[this.isShown?"hide":"show"](e)},t.prototype.show=function(t){var n=this,r=e.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(r);if(this.isShown||r.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.$element.on("click.dismiss.modal",'[data-dismiss="ai1ec-modal"]',e.proxy(this.hide,this)),this.backdrop(function(){var r=e.support.transition&&n.$element.hasClass("ai1ec-fade");n.$element.parent().length||n.$element.appendTo(document.body),n.$element.show(),r&&n.$element[0].offsetWidth,n.$element.addClass("ai1ec-in").attr("aria-hidden",!1),n.enforceFocus();var i=e.Event("shown.bs.modal",{relatedTarget:t});r?n.$element.find(".ai1ec-modal-dialog").one(e.support.transition.end,function(){n.$element.focus().trigger(i)}).emulateTransitionEnd(300):n.$element.focus().trigger(i)})},t.prototype.hide=function(t){t&&t.preventDefault(),t=e.Event("hide.bs.modal"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.bs.modal"),this.$element.removeClass("ai1ec-in").attr("aria-hidden",!0).off("click.dismiss.modal"),e.support.transition&&this.$element.hasClass("ai1ec-fade")?this.$element.one(e.support.transition.end,e.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()},t.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){this.$element[0]!==e.target&&!this.$element.has(e.target).length&&this.$element.focus()},this))},t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",e.proxy(function(e){e.which==27&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},t.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden.bs.modal")})},t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},t.prototype.backdrop=function(t){var n=this,r=this.$element.hasClass("ai1ec-fade")?"ai1ec-fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="ai1ec-modal-backdrop '+r+'" />').appendTo(document.body),this.$element.on("click.dismiss.modal",e.proxy(function(e){if(e.target!==e.currentTarget)return;this.options.backdrop=="static"?this.$element[0].focus.call(this.$element[0]):this.hide.call(this)},this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("ai1ec-in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("ai1ec-in"),e.support.transition&&this.$element.hasClass("ai1ec-fade")?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()):t&&t()};var n=e.fn.modal;e.fn.modal=function(n,r){return this.each(function(){var i=e(this),s=i.data("bs.modal"),o=e.extend({},t.DEFAULTS,i.data(),typeof n=="object"&&n);s||i.data("bs.modal",s=new t(this,o)),typeof n=="string"?s[n](r):o.show&&s.show(r)})},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.bs.modal.data-api",'[data-toggle="ai1ec-modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s,this).one("hide",function(){n.is(":visible")&&n.focus()})}),e(document).on("show.bs.modal",".ai1ec-modal",function(){e(document.body).addClass("ai1ec-modal-open")}).on("hidden.bs.modal",".ai1ec-modal",function(){e(document.body).removeClass("ai1ec-modal-open")})}),timely.define("external_libs/bootstrap/alert",["jquery_timely"],function(e){var t='[data-dismiss="ai1ec-alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed.bs.alert").remove()}var n=e(this),r=n.attr("data-target");r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));var i=e(r);t&&t.preventDefault(),i.length||(i=n.hasClass("ai1ec-alert")?n:n.parent()),i.trigger(t=e.Event("close.bs.alert"));if(t.isDefaultPrevented())return;i.removeClass("ai1ec-in"),e.support.transition&&i.hasClass("ai1ec-fade")?i.one(e.support.transition.end,s).emulateTransitionEnd(150):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("bs.alert");i||r.data("bs.alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.bs.alert.data-api",t,n.prototype.close)}),timely.define("scripts/add_new_event",["jquery_timely","domReady","ai1ec_config","scripts/add_new_event/event_location/gmaps_helper","scripts/add_new_event/event_location/input_coordinates_event_handlers","scripts/add_new_event/event_location/input_coordinates_utility_functions","scripts/add_new_event/event_date_time/date_time_event_handlers","scripts/add_new_event/event_cost_helper","external_libs/jquery.calendrical_timespan","external_libs/jquery.inputdate","external_libs/jquery.tools","external_libs/ai1ec_datepicker","external_libs/bootstrap/transition","external_libs/bootstrap/collapse","external_libs/bootstrap/modal","external_libs/bootstrap/alert","external_libs/bootstrap/tab"],function(e,t,n,r,i,s,o,u,a){var f=function(){var t=new Date(n.now*1e3),r={allday:"#ai1ec_all_day_event",start_date_input:"#ai1ec_start-date-input",start_time_input:"#ai1ec_start-time-input",start_time:"#ai1ec_start-time",end_date_input:"#ai1ec_end-date-input",end_time_input:"#ai1ec_end-time-input",end_time:"#ai1ec_end-time",date_format:n.date_format,month_names:n.month_names,day_names:n.day_names,week_start_day:n.week_start_day,twentyfour_hour:n.twentyfour_hour,now:t};e.timespan(r);var i=e("#ai1ec_exdate").val(),s=null,o=!1,u;if(i.length>=8){s=[];var f=[];e.each(i.split(","),function(e,t){var r=t.slice(0,8),i=r.substr(0,4),o=r.substr(4,2);u=r.substr(6,2),o=o.charAt(0)==="0"?"0"+(parseInt(o.charAt(1),10)-1):parseInt(o,10)-1,s.push(new Date(i,o,u)),f.push(a.formatDate(new Date(i,o,u),n.date_format,!0))}),e("#widgetField span:first").html(f.join(", "))}else s=new Date(n.now*1e3),o=!0;e("#widgetCalendar").DatePicker({flat:!0,calendars:3,mode:"multiple",start:1,date:s,onChange:function(t){t=t.toString();if(t.length>=8){var r="",i=[];e.each(t.split(","),function(e,t){i.push(a.formatDate(new Date(t),n.date_format)),r+=t.replace(/-/g,"")+"T000000Z,"}),e("#widgetField span").html(i.join(", ")),r=r.slice(0,r.length-1),e("#ai1ec_exdate").val(r)}else e("#ai1ec_exdate").val("")}}),o&&e("#widgetCalendar").DatePickerClear(),e("#widgetCalendar div.datepicker").css("position","absolute")},l=function(){e(".ai1ec-panel-collapse").on("hide",function(){e(this).parent().removeClass("ai1ec-overflow-visible")}),e(".ai1ec-panel-collapse").on("shown",function(){var t=e(this);window.setTimeout(function(){t.parent().addClass("ai1ec-overflow-visible")},350)})},c=function(){f(),timely.require(["libs/gmaps"],function(e){e(r.init_gmaps)})},h=function(t,n){window.alert(n),t.preventDefault(),e("#publish, #ai1ec_bottom_publish").removeClass("button-primary-disabled"),e("#publish, #ai1ec_bottom_publish").siblings("#ajax-loading, .spinner").css("visibility","hidden")},p=function(t){s.ai1ec_check_lat_long_fields_filled_when_publishing_event(t)===!0&&(s.ai1ec_convert_commas_to_dots_for_coordinates(),s.ai1ec_check_lat_long_ok_for_search(t)),e("#ai1ec_ticket_url, #ai1ec_contact_url").each(function(){var e=this.value;if(""!==e){var r=/(http|https):\/\//;r.test(e)||h(t,n.url_not_valid)}})},d=function(){e("#ai1ec_google_map").click(i.toggle_visibility_of_google_map_on_click),e("#ai1ec_input_coordinates").change(i.toggle_visibility_of_coordinate_fields_on_click),e("#post").submit(p),e("input.coordinates").blur(i.update_map_from_coordinates_on_blur),e("#ai1ec_bottom_publish").on("click",o.trigger_publish),e(document).on("change","#ai1ec_end",o.show_end_fields).on("click","#ai1ec_repeat_apply",o.handle_click_on_apply_button).on("click","#ai1ec_repeat_cancel",o.handle_click_on_cancel_modal).on("click","#ai1ec_monthly_type_bymonthday, #ai1ec_monthly_type_byday",o.handle_checkbox_monthly_tab_modal).on("click",".ai1ec-btn-group-grid a",o.handle_click_on_toggle_buttons),e("#ai1ec_repeat_box").on("hidden.bs.modal",o.handle_modal_hide),o.execute_pseudo_handlers(),e("#widgetField > a, #widgetField > span, #ai1ec_exclude_date_label").on("click",o.handle_animation_of_calendar_widget),e("#ai1ec_is_free").on("change",u.handle_change_is_free)},v=function(){e("#ai1ec_event").insertAfter("#titlediv")},m=function(){c(),t(function(){l(),v(),d()})};return{start:m}}),timely.require(["scripts/add_new_event"],function(e){e.start()}),timely.define("pages/add_new_event",function(){});
public/js/pages/calendar.js CHANGED
@@ -304,4 +304,4 @@ OTHER DEALINGS IN THE SOFTWARE.
304
  * limitations under the License.
305
  * ======================================================================== */
306
 
307
- timely.define("scripts/calendar/print",["jquery_timely"],function(e){var t=function(t){t.preventDefault();var n=e("body"),r=e("html"),i=e("#ai1ec-container").html(),s=n.html();s=s.replace(/<script.*?>([\s\S]*?)<\/script>/gmi,""),n.empty(),n.addClass("timely"),r.addClass("ai1ec-print"),n.html(i),e("span").click(function(){return!1}),window.print(),n.removeClass("timely"),r.removeClass("ai1ec-print"),n.html(s)};return{handle_click_on_print_button:t}}),timely.define("scripts/calendar/agenda_view",["jquery_timely"],function(e){var t=function(){e(this).closest(".ai1ec-event").toggleClass("ai1ec-expanded").find(".ai1ec-event-summary").slideToggle(300)},n=function(){e(".ai1ec-expanded .ai1ec-event-toggle").click()},r=function(){e(".ai1ec-event:not(.ai1ec-expanded) .ai1ec-event-toggle").click()};return{toggle_event:t,collapse_all:n,expand_all:r}}),timely.define("external_libs/modernizr",[],function(){var e=function(e,t,n){function S(e){f.cssText=e}function x(e,t){return S(h.join(e+";")+(t||""))}function T(e,t){return typeof e===t}function N(e,t){return!!~(""+e).indexOf(t)}function C(e,t,r){for(var i in e){var s=t[e[i]];if(s!==n)return r===!1?e[i]:T(s,"function")?s.bind(r||t):s}return!1}var r="2.5.3",i={},s=!0,o=t.documentElement,u="modernizr",a=t.createElement(u),f=a.style,l,c={}.toString,h=" -webkit- -moz- -o- -ms- ".split(" "),p={},d={},v={},m=[],g=m.slice,y,b=function(e,n,r,i){var s,a,f,l=t.createElement("div"),c=t.body,h=c?c:t.createElement("body");if(parseInt(r,10))while(r--)f=t.createElement("div"),f.id=i?i[r]:u+(r+1),l.appendChild(f);return s=["&#173;","<style>",e,"</style>"].join(""),l.id=u,(c?l:h).innerHTML+=s,h.appendChild(l),c||(h.style.background="",o.appendChild(h)),a=n(l,e),c?l.parentNode.removeChild(l):h.parentNode.removeChild(h),!!a},w={}.hasOwnProperty,E;!T(w,"undefined")&&!T(w.call,"undefined")?E=function(e,t){return w.call(e,t)}:E=function(e,t){return t in e&&T(e.constructor.prototype[t],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if(typeof n!="function")throw new TypeError;var r=g.call(arguments,1),i=function(){if(this instanceof i){var e=function(){};e.prototype=n.prototype;var s=new e,o=n.apply(s,r.concat(g.call(arguments)));return Object(o)===o?o:s}return n.apply(t,r.concat(g.call(arguments)))};return i});var k=function(n,r){var s=n.join(""),o=r.length;b(s,function(n,r){var s=t.styleSheets[t.styleSheets.length-1],u=s?s.cssRules&&s.cssRules[0]?s.cssRules[0].cssText:s.cssText||"":"",a=n.childNodes,f={};while(o--)f[a[o].id]=a[o];i.touch="ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch||(f.touch&&f.touch.offsetTop)===9},o,r)}([,["@media (",h.join("touch-enabled),("),u,")","{#touch{top:9px;position:absolute}}"].join("")],[,"touch"]);p.touch=function(){return i.touch};for(var L in p)E(p,L)&&(y=L.toLowerCase(),i[y]=p[L](),m.push((i[y]?"":"no-")+y));return S(""),a=l=null,i._version=r,i._prefixes=h,i.testStyles=b,o.className=o.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(s?" js "+m.join(" "):""),i}(window,window.document);return e}),timely.define("scripts/calendar/month_view",["jquery_timely","external_libs/modernizr"],function(e,t){var n=navigator.userAgent.match(/opera/i),r=navigator.userAgent.match(/webkit/i),i=function(){var t=e(".ai1ec-day"),n=e(".ai1ec-week:first .ai1ec-day").length;e(".ai1ec-month-view .ai1ec-multiday").each(function(){var n=this.parentNode,r=e(this).outerHeight(!0),i=parseInt(e(this).data("endDay"),10),u=e(".ai1ec-date",n),a=parseInt(u.text(),10),f=e(this).data("endTruncated");f&&(i=parseInt(e(t[t.length-1]).text(),10));var l=e(this),c=e(".ai1ec-event",l)[0].style.backgroundColor,h=0,p=i-a+1,d=p,v,m=0;t.each(function(t){var n=e(".ai1ec-date",this),r=e(this.parentNode),u=r.index(),f=parseInt(n.text(),10);if(f>=a&&f<=i){f===a&&(v=parseInt(n.css("marginBottom"),10)+16),h===0&&m++;if(u===0&&f>a&&d!==0){var p=l.next(".ai1ec-popup").andSelf().clone(!1);n.parent().append(p);var g=p.first();g.addClass("ai1ec-multiday-bar ai1ec-multiday-clone"),g.css({position:"absolute",left:"1px",top:parseInt(n.css("marginBottom"),10)+13,backgroundColor:c});var y=d>7?7:d;g.css("width",s(y)),d>7&&g.append(o(1,c)),g.append(o(2,c))}h===0?n.css({marginBottom:v+"px"}):n.css({marginBottom:"+=16px"}),d--,d>0&&u===6&&h++}});if(f){var g=e("."+l[0].className.replace(/\s+/igm,".")).last();g.append(o(1,c))}e(this).css({position:"absolute",top:u.outerHeight(!0)-r-1+"px",left:"1px",width:s(m)}),h>0&&e(this).append(o(1,c)),e(this).data("startTruncated")&&e(this).append(o(2,c)).addClass("ai1ec-multiday-bar")})},s=function(e){var t;switch(e){case 1:t=97.5;break;case 2:t=198.7;break;case 3:t=300;break;case 4:t=401;break;case 5:r||n?t=507:t=503.4;break;case 6:r||n?t=608:t=603.5;break;case 7:r||n?t=709:t=705}return t+"%"},o=function(t,n){var r=e('<div class="ai1ec-multiday-arrow'+t+'"></div>');return t===1?r.css({borderLeftColor:n}):r.css({borderTopColor:n,borderRightColor:n,borderBottomColor:n}),r};return{extend_multiday_events:i}}),timely.define("libs/frontend_utils",[],function(){var e=function(e){var t,n;t=function(e){if(/&[^;]+;/.test(e)){var t=document.createElement("div");return t.innerHTML=e,t.firstChild?t.firstChild.nodeValue:e}return e};if(typeof e=="string")return t(e);if(typeof e=="object")for(n in e)typeof e[n]=="string"&&(e[n]=t(e[n]));return e},t=function(e,t,n){var r,i,s,o,u;if("#"===e.charAt(0)||"?"===e.charAt(0))e=e.substring(1);r={},e=e.split(t);for(i=0;i<e.length;i++)o=e[i].trim(),-1!==(u=o.indexOf(n))?(s=o.substring(0,u).trim(),o=o.substring(u+1).trim()):(s=o,o=!0),r[s]=o;return r},n=function(e){var n,r,i,s,o;e=t(e,"&","="),i=Object.keys(e),n={ai1ec:{},action:"month"};for(r=0;r<i.length;r++)if("ai1ec"===i[r]){var u=t(e[i[r]],"|",":");for(s in u)if(""!==u[s]){if("action"===s||"view"===s)n.action=u[s];n.ai1ec[s]=u[s]}}else"ai1ec_"===i[r].substring(0,6)?n.ai1ec[i[r].substring(6)]=e[i[r]]:n[i[r]]=e[i[r]];"ai1ec_"!==n.action.substring(0,6)&&(n.action="ai1ec_"+n.action),o="action="+n.action+"&ai1ec=";for(s in n.ai1ec)n.ai1ec.hasOwnProperty(s)&&(o+=escape(s)+":"+escape(n.ai1ec[s])+"|");o=o.substring(0,o.length-1);for(s in n)"ai1ec"!==s&&"action"!==s&&(o+="&"+s+"="+escape(n[s]));return o};return{ai1ec_convert_entities:e,ai1ec_map_internal_query:n,ai1ec_tokenize_uri:t}}),timely.define("external_libs/bootstrap/tab",["jquery_timely"],function(e){var t=function(t){this.element=e(t)};t.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.ai1ec-dropdown-menu)"),r=t.data("target");r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("ai1ec-active"))return;var i=n.find(".ai1ec-active:last a")[0],s=e.Event("show.bs.tab",{relatedTarget:i});t.trigger(s);if(s.isDefaultPrevented())return;var o=e(r);this.activate(t.parent("li"),n),this.activate(o,o.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:i})})},t.prototype.activate=function(t,n,r){function o(){i.removeClass("ai1ec-active").find("> .ai1ec-dropdown-menu > .ai1ec-active").removeClass("ai1ec-active"),t.addClass("ai1ec-active"),s?(t[0].offsetWidth,t.addClass("ai1ec-in")):t.removeClass("ai1ec-fade"),t.parent(".ai1ec-dropdown-menu")&&t.closest("li.ai1ec-dropdown").addClass("ai1ec-active"),r&&r()}var i=n.find("> .ai1ec-active"),s=r&&e.support.transition&&i.hasClass("ai1ec-fade");s?i.one(e.support.transition.end,o).emulateTransitionEnd(150):o(),i.removeClass("ai1ec-in")};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tab");i||r.data("bs.tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.bs.tab.data-api",'[data-toggle="ai1ec-tab"], [data-toggle="ai1ec-pill"]',function(t){t.preventDefault(),e(this).tab("show")})}),timely.define("libs/utils",["jquery_timely","external_libs/bootstrap/tab"],function(e){var t=function(){return{is_float:function(e){return!isNaN(parseFloat(e))},is_valid_coordinate:function(e,t){var n=t?90:180;return this.is_float(e)&&Math.abs(e)<n},convert_comma_to_dot:function(e){return e.replace(",",".")},field_has_value:function(t){var n="#"+t,r=e(n),i=!1;return r.length===1&&(i=e.trim(r.val())!==""),i},make_alert:function(t,n,r){var i="";switch(n){case"error":i="ai1ec-alert ai1ec-alert-danger";break;case"success":i="ai1ec-alert ai1ec-alert-success";break;default:i="ai1ec-alert"}var s=e("<div />",{"class":i,html:t});if(!r){var o=e("<button>",{type:"button","class":"ai1ec-close","data-dismiss":"ai1ec-alert",text:"×"});s.prepend(o)}return s},get_ajax_url:function(){return typeof window.ajaxurl=="undefined"?"http://localhost/wordpress/wp-admin/admin-ajax.php":window.ajaxurl},isUrl:function(e){var t=/(http|https|webcal):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(e)},isValidEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)},activate_saved_tab_on_page_load:function(t){null===t||undefined===t?e("ul.ai1ec-nav a:first").tab("show"):e("ul.ai1ec-nav a[href="+t+"]").tab("show")}}}();return t}),timely.define("domReady",[],function(){function u(e){var t;for(t=0;t<e.length;t++)e[t](n)}function a(){var e=r;t&&e.length&&(r=[],u(e))}function f(){t||(t=!0,o&&clearInterval(o),a())}function c(e){return t?e(n):r.push(e),c}var e=typeof window!="undefined"&&window.document,t=!e,n=e?document:null,r=[],i,s,o;if(e){if(document.addEventListener)document.addEventListener("DOMContentLoaded",f,!1),window.addEventListener("load",f,!1);else if(window.attachEvent){window.attachEvent("onload",f),s=document.createElement("div");try{i=window.frameElement===null}catch(l){}s.doScroll&&i&&window.external&&(o=setInterval(function(){try{s.doScroll(),f()}catch(e){}},30))}(document.readyState==="complete"||document.readyState==="interactive")&&f()}return c.version="2.0.0",c.load=function(e,t,n,r){r.isBuild?n(null):c(n)},c}),timely.define("scripts/common_scripts/frontend/common_event_handlers",["jquery_timely"],function(e){var t=function(t){var n=e(this),r=n.next(".ai1ec-popup"),i,s,o;if(r.length===0)return;i=r.html(),s=r.attr("class");var u=n.closest("#ai1ec-calendar-view");u.length===0&&(u=e("body")),n.offset().left-u.offset().left>182?o="left":o="right",n.constrained_popover({content:i,title:"",placement:o,trigger:"manual",html:!0,template:'<div class="timely ai1ec-popover '+s+'">'+'<div class="ai1ec-arrow"></div>'+'<div class="ai1ec-popover-inner">'+'<div class="ai1ec-popover-content"><div></div></div>'+"</div>"+"</div>",container:"body"}).constrained_popover("show")},n=function(t){var n=e(t.toElement||t.relatedTarget);n.closest(".ai1ec-popup").length===0&&e(this).constrained_popover("hide")},r=function(t){var n=e(t.toElement||t.relatedTarget);n.closest(".ai1ec-tooltip").length===0&&(e(this).remove(),e("body > .ai1ec-tooltip").remove())},i=function(t){var n=e(this),r={template:'<div class="timely ai1ec-tooltip"><div class="ai1ec-tooltip-arrow"></div><div class="ai1ec-tooltip-inner"></div></div>',trigger:"manual",container:"body"};if(n.is(".ai1ec-category .ai1ec-color-swatch"))return;n.tooltip(r),n.tooltip("show")},s=function(t){var n=e(t.toElement||t.relatedTarget);n.closest(".ai1ec-tooltip").length===0&&e(this).data("bs.tooltip")&&e(this).tooltip("hide")},o=function(t){var n=e(t.toElement||t.relatedTarget);n.closest(".ai1ec-tooltip-trigger").length===0&&e(this).remove(),n.closest(".ai1ec-popup").length===0&&e("body > .ai1ec-popup").remove()};return{handle_popover_over:t,handle_popover_out:n,handle_popover_self_out:r,handle_tooltip_over:i,handle_tooltip_out:s,handle_tooltip_self_out:o}}),timely.define("external_libs/bootstrap/tooltip",["jquery_timely"],function(e){var t=function(e,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",e,t)};t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="ai1ec-tooltip"><div class="ai1ec-tooltip-arrow"></div><div class="ai1ec-tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},t.prototype.init=function(t,n,r){this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(r);var i=this.options.trigger.split(" ");for(var s=i.length;s--;){var o=i[s];if(o=="click")this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if(o!="manual"){var u=o=="hover"?"mouseenter":"focus",a=o=="hover"?"mouseleave":"blur";this.$element.on(u+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(a+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.getOptions=function(t){return t=e.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},t.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,function(e,r){n[e]!=r&&(t[e]=r)}),t},t.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(n.timeout),n.hoverState="in";if(!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},t.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(n.timeout),n.hoverState="out";if(!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},t.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.tip();this.setContent(),this.options.animation&&n.addClass("ai1ec-fade");var r=typeof this.options.placement=="function"?this.options.placement.call(this,n[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,s=i.test(r);s&&(r=r.replace(i,"")||"top"),n.detach().css({top:0,left:0,display:"block"}).addClass("ai1ec-"+r),this.options.container?n.appendTo(this.options.container):n.insertAfter(this.$element);var o=this.getPosition(),u=n[0].offsetWidth,a=n[0].offsetHeight;if(s){var f=this.$element.parent(),l=r,c=document.documentElement.scrollTop||document.body.scrollTop,h=this.options.container=="body"?window.innerWidth:f.outerWidth(),p=this.options.container=="body"?window.innerHeight:f.outerHeight(),d=this.options.container=="body"?0:f.offset().left;r=r=="bottom"&&o.top+o.height+a-c>p?"top":r=="top"&&o.top-c-a<0?"bottom":r=="right"&&o.right+u>h?"left":r=="left"&&o.left-u<d?"right":r,n.removeClass("ai1ec-"+l).addClass("ai1ec-"+r)}var v=this.getCalculatedOffset(r,o,u,a);this.applyPlacement(v,r),this.$element.trigger("shown.bs."+this.type)}},t.prototype.applyPlacement=function(e,t){var n,r=this.tip(),i=r[0].offsetWidth,s=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),u=parseInt(r.css("margin-left"),10);isNaN(o)&&(o=0),isNaN(u)&&(u=0),e.top=e.top+o,e.left=e.left+u,r.offset(e).addClass("ai1ec-in");var a=r[0].offsetWidth,f=r[0].offsetHeight;t=="top"&&f!=s&&(n=!0,e.top=e.top+s-f);if(/bottom|top/.test(t)){var l=0;e.left<0&&(l=e.left*-2,e.left=0,r.offset(e),a=r[0].offsetWidth,f=r[0].offsetHeight),this.replaceArrow(l-i+a,a,"left")}else this.replaceArrow(f-s,f,"top");n&&r.offset(e)},t.prototype.replaceArrow=function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".ai1ec-tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("ai1ec-fade ai1ec-in ai1ec-top ai1ec-bottom ai1ec-left ai1ec-right")},t.prototype.hide=function(){function i(){t.hoverState!="in"&&n.detach()}var t=this,n=this.tip(),r=e.Event("hide.bs."+this.type);this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("ai1ec-in"),e.support.transition&&this.$tip.hasClass("ai1ec-fade")?n.one(e.support.transition.end,i).emulateTransitionEnd(150):i(),this.$element.trigger("hidden.bs."+this.type),this},t.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},t.prototype.hasContent=function(){return this.getTitle()},t.prototype.getPosition=function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},t.prototype.getCalculatedOffset=function(e,t,n,r){return e=="bottom"?{top:t.top+t.height,left:t.left+t.width/2-n/2}:e=="top"?{top:t.top-r,left:t.left+t.width/2-n/2}:e=="left"?{top:t.top+t.height/2-r/2,left:t.left-n}:{top:t.top+t.height/2-r/2,left:t.left+t.width}},t.prototype.getTitle=function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},t.prototype.tip=function(){return this.$tip=this.$tip||e(this.options.template)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".ai1ec-tooltip-arrow")},t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},t.prototype.enable=function(){this.enabled=!0},t.prototype.disable=function(){this.enabled=!1},t.prototype.toggleEnabled=function(){this.enabled=!this.enabled},t.prototype.toggle=function(t){var n=t?e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;n.tip().hasClass("ai1ec-in")?n.leave(n):n.enter(n)},t.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tooltip"),s=typeof n=="object"&&n;i||r.data("bs.tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}),timely.define("external_libs/bootstrap/popover",["jquery_timely","external_libs/bootstrap/tooltip"],function(e){var t=function(e,t){this.init("popover",e,t)};if(!e.fn.tooltip)throw new Error("Popover requires tooltip.js");t.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="ai1ec-popover"><div class="ai1ec-arrow"></div><h3 class="ai1ec-popover-title"></h3><div class="ai1ec-popover-content"></div></div>'}),t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),t.prototype.constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".ai1ec-popover-title")[this.options.html?"html":"text"](t),e.find(".ai1ec-popover-content")[this.options.html?"html":"text"](n),e.removeClass("ai1ec-fade ai1ec-top ai1ec-bottom ai1ec-left ai1ec-right ai1ec-in"),e.find(".ai1ec-popover-title").html()||e.find(".ai1ec-popover-title").hide()},t.prototype.hasContent=function(){return this.getTitle()||this.getContent()},t.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||(typeof t.content=="function"?t.content.call(e[0]):t.content)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".ai1ec-arrow")},t.prototype.tip=function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip};var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("bs.popover"),s=typeof n=="object"&&n;i||r.data("bs.popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}),timely.define("external_libs/constrained_popover",["jquery_timely","external_libs/bootstrap/popover"],function(e){var t=function(e,t){this.init("constrained_popover",e,t)};t.DEFAULTS=e.extend({},e.fn.popover.Constructor.DEFAULTS,{container:"",content:this.options}),t.prototype=e.extend({},e.fn.popover.Constructor.prototype),t.prototype.constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.applyPlacement=function(t,n){e.fn.popover.Constructor.prototype.applyPlacement.call(this,t,n);var r=this.tip(),i=r[0].offsetWidth,s=r[0].offsetHeight,o=this.getPosition(),u={};switch(n){case"left":newPos=this.defineBounds(o),typeof newPos.top=="undefined"?u.top=o.top+o.height/2-s/2:u.top=newPos.top-s/2,typeof newPos.left=="undefined"?u.left=o.left-i:u.left=newPos.left-i,r.offset(u);break;case"right":newPos=this.defineBounds(o),typeof newPos.top=="undefined"?u.top=o.top+o.height/2-s/2:u.top=newPos.top-s/2,typeof newPos.left=="undefined"?u.left=o.left+o.width:u.left=newPos.left+o.width,r.offset(u)}},t.prototype.defineBounds=function(t){var n,r,i,s,o,u={},a=e(this.options.container);return a.length?(n=a.offset(),r=n.top,i=n.left,s=r+a.height(),o=i+a.width(),t.top+t.height/2<r&&(u.top=r),t.top+t.height/2>s&&(u.top=s),t.left-t.width/2<i&&(u.left=i),t.left-t.width/2>o&&(u.left=o),u):!1};var n=e.fn.popover;e.fn.constrained_popover=function(n){return this.each(function(){var r=e(this),i=r.data("ai1ec.constrained_popover"),s=typeof n=="object"&&n;i||r.data("ai1ec.constrained_popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.constrained_popover.Constructor=t,e.fn.constrained_popover.noConflict=function(){return e.fn.constrained_popover=n,this}}),timely.define("external_libs/bootstrap/dropdown",["jquery_timely"],function(e){function i(){e(t).remove(),e(n).each(function(t){var n=s(e(this));if(!n.hasClass("ai1ec-open"))return;n.trigger(t=e.Event("hide.bs.dropdown"));if(t.isDefaultPrevented())return;n.removeClass("ai1ec-open").trigger("hidden.bs.dropdown")})}function s(t){var n=t.attr("data-target");n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r=n&&e(n);return r&&r.length?r:t.parent()}var t=".ai1ec-dropdown-backdrop",n="[data-toggle=ai1ec-dropdown]",r=function(t){e(t).on("click.bs.dropdown",this.toggle)};r.prototype.toggle=function(t){var n=e(this);if(n.is(".ai1ec-disabled, :disabled"))return;var r=s(n),o=r.hasClass("ai1ec-open");i();if(!o){"ontouchstart"in document.documentElement&&!r.closest(".ai1ec-navbar-nav").length&&e('<div class="ai1ec-dropdown-backdrop"/>').insertAfter(e(this)).on("click",i),r.trigger(t=e.Event("show.bs.dropdown"));if(t.isDefaultPrevented())return;r.toggleClass("ai1ec-open").trigger("shown.bs.dropdown"),n.focus()}return!1},r.prototype.keydown=function(t){if(!/(38|40|27)/.test(t.keyCode))return;var r=e(this);t.preventDefault(),t.stopPropagation();if(r.is(".ai1ec-disabled, :disabled"))return;var i=s(r),o=i.hasClass("ai1ec-open");if(!o||o&&t.keyCode==27)return t.which==27&&i.find(n).focus(),r.click();var u=e("[role=menu] li:not(.ai1ec-divider):visible a",i);if(!u.length)return;var a=u.index(u.filter(":focus"));t.keyCode==38&&a>0&&a--,t.keyCode==40&&a<u.length-1&&a++,~a||(a=0),u.eq(a).focus()};var o=e.fn.dropdown;e.fn.dropdown=function(t){return this.each(function(){var n=e(this),i=n.data("bs.dropdown");i||n.data("bs.dropdown",i=new r(this)),typeof t=="string"&&i[t].call(n)})},e.fn.dropdown.Constructor=r,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=o,this},e(document).on("click.bs.dropdown.data-api",i).on("click.bs.dropdown.data-api",".ai1ec-dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",n,r.prototype.toggle).on("keydown.bs.dropdown.data-api",n+", [role=menu]",r.prototype.keydown)}),timely.define("scripts/common_scripts/frontend/common_frontend",["jquery_timely","domReady","scripts/common_scripts/frontend/common_event_handlers","ai1ec_calendar","external_libs/modernizr","external_libs/bootstrap/tooltip","external_libs/constrained_popover","external_libs/bootstrap/dropdown"],function(e,t,n,r,i){var s=!1,o=function(){s=!0,e(document).on("mouseenter",".ai1ec-popup-trigger",n.handle_popover_over),e(document).on("mouseleave",".ai1ec-popup-trigger",n.handle_popover_out),e(document).on("mouseleave",".ai1ec-popup",n.handle_popover_self_out),e(document).on("mouseenter",".ai1ec-tooltip-trigger",n.handle_tooltip_over),e(document).on("mouseleave",".ai1ec-tooltip-trigger",n.handle_tooltip_out),e(document).on("mouseleave",".ai1ec-tooltip",n.handle_tooltip_self_out)},u=function(){t(function(){o()})},a=function(){return s};return{start:u,are_event_listeners_attached:a}}),timely.define("external_libs/select2",["jquery_timely"],function(e){(function(e){typeof e.fn.each2=="undefined"&&e.fn.extend({each2:function(t){var n=e([0]),r=-1,i=this.length;while(++r<i&&(n.context=n[0]=this[r])&&t.call(n[0],r,n)!==!1);return this}})})(e),function(e,t){function l(e,t){var n=0,r=t.length;for(;n<r;n+=1)if(c(e,t[n]))return n;return-1}function c(e,n){return e===n?!0:e===t||n===t?!1:e===null||n===null?!1:e.constructor===String?e===n+"":n.constructor===String?n===e+"":!1}function h(t,n){var r,i,s;if(t===null||t.length<1)return[];r=t.split(n);for(i=0,s=r.length;i<s;i+=1)r[i]=e.trim(r[i]);return r}function p(e){return e.outerWidth(!1)-e.width()}function d(n){var r="keyup-change-value";n.bind("keydown",function(){e.data(n,r)===t&&e.data(n,r,n.val())}),n.bind("keyup",function(){var i=e.data(n,r);i!==t&&n.val()!==i&&(e.removeData(n,r),n.trigger("keyup-change"))})}function v(n){n.bind("mousemove",function(n){var r=a;(r===t||r.x!==n.pageX||r.y!==n.pageY)&&e(n.target).trigger("mousemove-filtered",n)})}function m(e,n,r){r=r||t;var i;return function(){var t=arguments;window.clearTimeout(i),i=window.setTimeout(function(){n.apply(r,t)},e)}}function g(e){var t=!1,n;return function(){return t===!1&&(n=e(),t=!0),n}}function y(e,t){var n=m(e,function(e){t.trigger("scroll-debounced",e)});t.bind("scroll",function(e){l(e.target,t.get())>=0&&n(e)})}function b(e){if(e[0]===document.activeElement)return;window.setTimeout(function(){var t=e[0],n=e.val().length,r;e.focus(),t.setSelectionRange?t.setSelectionRange(n,n):t.createTextRange&&(r=t.createTextRange(),r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",n),r.select())},0)}function w(e){e.preventDefault(),e.stopPropagation()}function E(e){e.preventDefault(),e.stopImmediatePropagation()}function S(t){if(!u){var n=t[0].currentStyle||window.getComputedStyle(t[0],null);u=e(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:n.fontSize,fontFamily:n.fontFamily,fontStyle:n.fontStyle,fontWeight:n.fontWeight,letterSpacing:n.letterSpacing,textTransform:n.textTransform,whiteSpace:"nowrap"}),u.attr("class","select2-sizer"),e("body").append(u)}return u.text(t.val()),u.width()}function x(t,n,r){var i,s=[],o;i=t.attr("class"),typeof i=="string"&&e(i.split(" ")).each2(function(){this.indexOf("select2-")===0&&s.push(this)}),i=n.attr("class"),typeof i=="string"&&e(i.split(" ")).each2(function(){this.indexOf("select2-")!==0&&(o=r(this),typeof o=="string"&&o.length>0&&s.push(this))}),t.attr("class",s.join(" "))}function T(e,t,n,r){var i=e.toUpperCase().indexOf(t.toUpperCase()),s=t.length;if(i<0){n.push(r(e));return}n.push(r(e.substring(0,i))),n.push("<span class='select2-match'>"),n.push(r(e.substring(i,i+s))),n.push("</span>"),n.push(r(e.substring(i+s,e.length)))}function N(t){var n,r=0,i=null,s=t.quietMillis||100,o=t.url,u=this;return function(a){window.clearTimeout(n),n=window.setTimeout(function(){r+=1;var n=r,s=t.data,f=o,l=t.transport||e.ajax,c=t.type||"GET",h={};s=s?s.call(u,a.term,a.page,a.context):null,f=typeof f=="function"?f.call(u,a.term,a.page,a.context):f,null!==i&&i.abort(),t.params&&(e.isFunction(t.params)?e.extend(h,t.params.call(u)):e.extend(h,t.params)),e.extend(h,{url:f,dataType:t.dataType,data:s,type:c,cache:!1,success:function(e){if(n<r)return;var i=t.results(e,a.page);a.callback(i)}}),i=l.call(u,h)},s)}}function C(t){var n=t,r,i,s=function(e){return""+e.text};e.isArray(n)&&(i=n,n={results:i}),e.isFunction(n)===!1&&(i=n,n=function(){return i});var o=n();return o.text&&(s=o.text,e.isFunction(s)||(r=n.text,s=function(e){return e[r]})),function(t){var r=t.term,i={results:[]},o;if(r===""){t.callback(n());return}o=function(n,i){var u,a;n=n[0];if(n.children){u={};for(a in n)n.hasOwnProperty(a)&&(u[a]=n[a]);u.children=[],e(n.children).each2(function(e,t){o(t,u.children)}),(u.children.length||t.matcher(r,s(u),n))&&i.push(u)}else t.matcher(r,s(n),n)&&i.push(n)},e(n().results).each2(function(e,t){o(t,i.results)}),t.callback(i)}}function k(n){var r=e.isFunction(n);return function(i){var s=i.term,o={results:[]};e(r?n():n).each(function(){var e=this.text!==t,n=e?this.text:this;(s===""||i.matcher(s,n))&&o.results.push(e?this:{id:this,text:this})}),i.callback(o)}}function L(t,n){if(e.isFunction(t))return!0;if(!t)return!1;throw new Error("formatterName must be a function or a falsy value")}function A(t){return e.isFunction(t)?t():t}function O(t){var n=0;return e.each(t,function(e,t){t.children?n+=O(t.children):n++}),n}function M(e,n,r,i){var s=e,o=!1,u,a,f,l,h;if(!i.createSearchChoice||!i.tokenSeparators||i.tokenSeparators.length<1)return t;for(;;){a=-1;for(f=0,l=i.tokenSeparators.length;f<l;f++){h=i.tokenSeparators[f],a=e.indexOf(h);if(a>=0)break}if(a<0)break;u=e.substring(0,a),e=e.substring(a+h.length);if(u.length>0){u=i.createSearchChoice(u,n);if(u!==t&&u!==null&&i.id(u)!==t&&i.id(u)!==null){o=!1;for(f=0,l=n.length;f<l;f++)if(c(i.id(u),i.id(n[f]))){o=!0;break}o||r(u)}}}if(s!==e)return e}function _(t,n){var r=function(){};return r.prototype=new t,r.prototype.constructor=r,r.prototype.parent=t.prototype,r.prototype=e.extend(r.prototype,n),r}var n,r,i,s,o,u,a,f;n={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){e=e.which?e.which:e;switch(e){case n.LEFT:case n.RIGHT:case n.UP:case n.DOWN:return!0}return!1},isControl:function(e){var t=e.which;switch(t){case n.SHIFT:case n.CTRL:case n.ALT:return!0}return e.metaKey?!0:!1},isFunctionKey:function(e){return e=e.which?e.which:e,e>=112&&e<=123}},f=e(document),o=function(){var e=1;return function(){return e++}}(),f.bind("mousemove",function(e){a={x:e.pageX,y:e.pageY}}),r=_(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(n){var r,i,s=".select2-results",u;this.opts=n=this.prepareOpts(n),this.id=n.id,n.element.data("select2")!==t&&n.element.data("select2")!==null&&this.destroy(),this.enabled=!0,this.container=this.createContainer(),this.containerId="s2id_"+(n.element.attr("id")||"autogen"+o()),this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.body=g(function(){return n.element.closest("body")}),x(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.css(A(n.containerCss)),this.container.addClass(A(n.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabIndex"),this.opts.element.data("select2",this).addClass("select2-offscreen").bind("focus.select2",function(){e(this).select2("focus")}).attr("tabIndex","-1").before(this.container),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),this.dropdown.addClass(A(n.dropdownCssClass)),this.dropdown.data("select2",this),this.results=r=this.container.find(s),this.search=i=this.container.find("input.select2-input"),i.attr("tabIndex",this.elementTabIndex),this.resultsPage=0,this.context=null,this.initContainer(),v(this.results),this.dropdown.delegate(s,"mousemove-filtered touchstart touchmove touchend",this.bind(this.highlightUnderEvent)),y(80,this.results),this.dropdown.delegate(s,"scroll-debounced",this.bind(this.loadMoreIfNeeded)),e.fn.mousewheel&&r.mousewheel(function(e,t,n,i){var s=r.scrollTop(),o;i>0&&s-i<=0?(r.scrollTop(0),w(e)):i<0&&r.get(0).scrollHeight-r.scrollTop()+i<=r.height()&&(r.scrollTop(r.get(0).scrollHeight-r.height()),w(e))}),d(i),i.bind("keyup-change input paste",this.bind(this.updateResults)),i.bind("focus",function(){i.addClass("select2-focused")}),i.bind("blur",function(){i.removeClass("select2-focused")}),this.dropdown.delegate(s,"mouseup",this.bind(function(t){e(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.bind("click mouseup mousedown",function(e){e.stopPropagation()}),e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),(n.element.is(":disabled")||n.element.is("[readonly='readonly']"))&&this.disable()},destroy:function(){var e=this.opts.element.data("select2");this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),e!==t&&(e.container.remove(),e.dropdown.remove(),e.opts.element.removeClass("select2-offscreen").removeData("select2").unbind(".select2").attr({tabIndex:this.elementTabIndex}).show())},prepareOpts:function(n){var r,i,s,o;r=n.element,r.get(0).tagName.toLowerCase()==="select"&&(this.select=i=n.element),i&&e.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in n)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),n=e.extend({},{populateResults:function(r,i,s){var o,u,a,f,l=this.opts.id,c=this;o=function(r,i,u){var a,f,h,p,d,v,m,g,y,b;r=n.sortResults(r,i,s);for(a=0,f=r.length;a<f;a+=1)h=r[a],d=h.disabled===!0,p=!d&&l(h)!==t,v=h.children&&h.children.length>0,m=e("<li></li>"),m.addClass("select2-results-dept-"+u),m.addClass("select2-result"),m.addClass(p?"select2-result-selectable":"select2-result-unselectable"),d&&m.addClass("select2-disabled"),v&&m.addClass("select2-result-with-children"),m.addClass(c.opts.formatResultCssClass(h)),g=e(document.createElement("div")),g.addClass("select2-result-label"),b=n.formatResult(h,g,s,c.opts.escapeMarkup),b!==t&&g.html(b),m.append(g),v&&(y=e("<ul></ul>"),y.addClass("select2-result-sub"),o(h.children,y,u+1),m.append(y)),m.data("select2-data",h),i.append(m)},o(i,r,0)}},e.fn.select2.defaults,n),typeof n.id!="function"&&(s=n.id,n.id=function(e){return e[s]});if(e.isArray(n.element.data("select2Tags"))){if("tags"in n)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+n.element.attr("id");n.tags=n.element.attr("data-select2-tags")}i?(n.query=this.bind(function(n){var i={results:[],more:!1},s=n.term,o,u,a;a=function(e,t){var r;e.is("option")?n.matcher(s,e.text(),e)&&t.push({id:e.attr("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:c(e.attr("disabled"),"disabled")}):e.is("optgroup")&&(r={text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")},e.children().each2(function(e,t){a(t,r.children)}),r.children.length>0&&t.push(r))},o=r.children(),this.getPlaceholder()!==t&&o.length>0&&(u=o[0],e(u).text()===""&&(o=o.not(u))),o.each2(function(e,t){a(t,i.results)}),n.callback(i)}),n.id=function(e){return e.id},n.formatResultCssClass=function(e){return e.css}):"query"in n||("ajax"in n?(o=n.element.data("ajax-url"),o&&o.length>0&&(n.ajax.url=o),n.query=N.call(n.element,n.ajax)):"data"in n?n.query=C(n.data):"tags"in n&&(n.query=k(n.tags),n.createSearchChoice===t&&(n.createSearchChoice=function(e){return{id:e,text:e}}),n.initSelection===t&&(n.initSelection=function(t,r){var i=[];e(h(t.val(),n.separator)).each(function(){var t=this,r=this,s=n.tags;e.isFunction(s)&&(s=s()),e(s).each(function(){if(c(this.id,t))return r=this.text,!1}),i.push({id:t,text:r})}),r(i)})));if(typeof n.query!="function")throw"query function not defined for Select2 "+n.element.attr("id");return n},monitorSource:function(){var e=this.opts.element,t;e.bind("change.select2",this.bind(function(e){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),t=this.bind(function(){var e,t,n=this;e=this.opts.element.attr("disabled")!=="disabled",t=this.opts.element.attr("readonly")==="readonly",e=e&&!t,this.enabled!==e&&(e?this.enable():this.disable()),x(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(A(this.opts.containerCssClass)),x(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(A(this.opts.dropdownCssClass))}),e.bind("propertychange.select2 DOMAttrModified.select2",t),typeof WebKitMutationObserver!="undefined"&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new WebKitMutationObserver(function(e){e.forEach(t)}),this.propertyObserver.observe(e.get(0),{attributes:!0,subtree:!1}))},triggerChange:function(t){t=t||{},t=e.extend({},t,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},enable:function(){if(this.enabled)return;this.enabled=!0,this.container.removeClass("select2-container-disabled"),this.opts.element.removeAttr("disabled")},disable:function(){if(!this.enabled)return;this.close(),this.enabled=!1,this.container.addClass("select2-container-disabled"),this.opts.element.attr("disabled","disabled")},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var t=this.container.offset(),n=this.container.outerHeight(!1),r=this.container.outerWidth(!1),i=this.dropdown.outerHeight(!1),s=e(window).scrollLeft()+e(window).width(),o=e(window).scrollTop()+e(window).height(),u=t.top+n,a=t.left,f=u+i<=o,l=t.top-i>=this.body().scrollTop(),c=this.dropdown.outerWidth(!1),h=a+c<=s,p=this.dropdown.hasClass("select2-drop-above"),d,v,m;this.body().css("position")!=="static"&&(d=this.body().offset(),u-=d.top,a-=d.left),p?(v=!0,!l&&f&&(v=!1)):(v=!1,!f&&l&&(v=!0)),h||(a=t.left+r-c),v?(u=t.top-i,this.container.addClass("select2-drop-above"),this.dropdown.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")),m=e.extend({top:u,left:a,width:r},A(this.opts.dropdownCss)),this.dropdown.css(m)},shouldOpen:function(){var t;return this.opened()?!1:(t=e.Event("opening"),this.opts.element.trigger(t),!t.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(window.setTimeout(this.bind(this.opening),1),!0):!1},opening:function(){var t=this.containerId,n="scroll."+t,r="resize."+t,i="orientationchange."+t,s;this.clearDropdownAlignmentPreference(),this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body()),this.updateResults(!0),s=e("#select2-drop-mask"),s.length==0&&(s=e(document.createElement("div")),s.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),s.hide(),s.appendTo(this.body()),s.bind("mousedown touchstart",function(t){var n=e("#select2-drop"),r;n.length>0&&(r=n.data("select2"),r.opts.selectOnBlur&&r.selectHighlighted({noFocus:!0}),r.close())})),this.dropdown.prev()[0]!==s[0]&&this.dropdown.before(s),e("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),s.css({width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight}),s.show(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active"),this.ensureHighlightVisible();var o=this;this.container.parents().add(window).each(function(){e(this).bind(r+" "+n+" "+i,function(t){e("#select2-drop-mask").css({width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight}),o.positionDropdown()})}),this.focusSearch()},close:function(){if(!this.opened())return;var t=this.containerId,n="scroll."+t,r="resize."+t,i="orientationchange."+t;this.container.parents().add(window).each(function(){e(this).unbind(n).unbind(r).unbind(i)}),this.clearDropdownAlignmentPreference(),e("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open"),this.results.empty(),this.clearSearch(),this.opts.element.trigger(e.Event("close"))},clearSearch:function(){},getMaximumSelectionSize:function(){return A(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var t=this.results,n,r,i,s,o,u,a;r=this.highlight();if(r<0)return;if(r==0){t.scrollTop(0);return}n=this.findHighlightableChoices(),i=e(n[r]),s=i.offset().top+i.outerHeight(!0),r===n.length-1&&(a=t.find("li.select2-more-results"),a.length>0&&(s=a.offset().top+a.outerHeight(!0))),o=t.offset().top+t.outerHeight(!0),s>o&&t.scrollTop(t.scrollTop()+(s-o)),u=i.offset().top-t.offset().top,u<0&&i.css("display")!="none"&&t.scrollTop(t.scrollTop()+u)},findHighlightableChoices:function(){var e=this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)");return this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)")},moveHighlight:function(t){var n=this.findHighlightableChoices(),r=this.highlight();while(r>-1&&r<n.length){r+=t;var i=e(n[r]);if(i.hasClass("select2-result-selectable")&&!i.hasClass("select2-disabled")&&!i.hasClass("select2-selected")){this.highlight(r);break}}},highlight:function(t){var n=this.findHighlightableChoices(),r,i;if(arguments.length===0)return l(n.filter(".select2-highlighted")[0],n.get());t>=n.length&&(t=n.length-1),t<0&&(t=0),this.results.find(".select2-highlighted").removeClass("select2-highlighted"),r=e(n[t]),r.addClass("select2-highlighted"),this.ensureHighlightVisible(),i=r.data("select2-data"),i&&this.opts.element.trigger({type:"highlight",val:this.id(i),choice:i})},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var n=e(t.target).closest(".select2-result-selectable");if(n.length>0&&!n.is(".select2-highlighted")){var r=this.findHighlightableChoices();this.highlight(r.index(n))}else n.length==0&&this.results.find(".select2-highlighted").removeClass("select2-highlighted")},loadMoreIfNeeded:function(){var e=this.results,t=e.find("li.select2-more-results"),n,r=-1,i=this.resultsPage+1,s=this,o=this.search.val(),u=this.context;if(t.length===0)return;n=t.offset().top-e.offset().top-e.height(),n<=this.opts.loadMorePadding&&(t.addClass("select2-active"),this.opts.query({element:this.opts.element,term:o,page:i,context:u,matcher:this.opts.matcher,callback:this.bind(function(n){if(!s.opened())return;s.opts.populateResults.call(this,e,n.results,{term:o,page:i,context:u}),n.more===!0?(t.detach().appendTo(e).text(s.opts.formatLoadMore(i+1)),window.setTimeout(function(){s.loadMoreIfNeeded()},10)):t.remove(),s.positionDropdown(),s.resultsPage=i,s.context=n.context})}))},tokenize:function(){},updateResults:function(n){function f(){i.scrollTop(0),r.removeClass("select2-active"),u.positionDropdown()}function l(e){i.html(e),f()}var r=this.search,i=this.results,s=this.opts,o,u=this,a;if(n!==!0&&(this.showSearchInput===!1||!this.opened()))return;r.addClass("select2-active");var h=this.getMaximumSelectionSize();if(h>=1){o=this.data();if(e.isArray(o)&&o.length>=h&&L(s.formatSelectionTooBig,"formatSelectionTooBig")){l("<li class='select2-selection-limit'>"+s.formatSelectionTooBig(h)+"</li>");return}}if(r.val().length<s.minimumInputLength){L(s.formatInputTooShort,"formatInputTooShort")?l("<li class='select2-no-results'>"+s.formatInputTooShort(r.val(),s.minimumInputLength)+"</li>"):l("");return}s.formatSearching()&&n===!0&&l("<li class='select2-searching'>"+s.formatSearching()+"</li>");if(s.maximumInputLength&&r.val().length>s.maximumInputLength){L(s.formatInputTooLong,"formatInputTooLong")?l("<li class='select2-no-results'>"+s.formatInputTooLong(r.val(),s.maximumInputLength)+"</li>"):l("");return}a=this.tokenize(),a!=t&&a!=null&&r.val(a),this.resultsPage=1,s.query({element:s.element,term:r.val(),page:this.resultsPage,context:null,matcher:s.matcher,callback:this.bind(function(o){var a;if(!this.opened())return;this.context=o.context===t?null:o.context,this.opts.createSearchChoice&&r.val()!==""&&(a=this.opts.createSearchChoice.call(null,r.val(),o.results),a!==t&&a!==null&&u.id(a)!==t&&u.id(a)!==null&&e(o.results).filter(function(){return c(u.id(this),u.id(a))}).length===0&&o.results.unshift(a));if(o.results.length===0&&L(s.formatNoMatches,"formatNoMatches")){l("<li class='select2-no-results'>"+s.formatNoMatches(r.val())+"</li>");return}i.empty(),u.opts.populateResults.call(this,i,o.results,{term:r.val(),page:this.resultsPage,context:null}),o.more===!0&&L(s.formatLoadMore,"formatLoadMore")&&(i.append("<li class='select2-more-results'>"+u.opts.escapeMarkup(s.formatLoadMore(this.resultsPage))+"</li>"),window.setTimeout(function(){u.loadMoreIfNeeded()},10)),this.postprocessResults(o,n),f()})})},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){b(this.search)},selectHighlighted:function(e){var t=this.highlight(),n=this.results.find(".select2-highlighted"),r=n.closest(".select2-result").data("select2-data");r&&(this.highlight(t),this.onSelect(r,e))},getPlaceholder:function(){return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder},initContainerWidth:function(){function n(){var n,r,i,s,o;if(this.opts.width==="off")return null;if(this.opts.width==="element")return this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px";if(this.opts.width==="copy"||this.opts.width==="resolve"){n=this.opts.element.attr("style");if(n!==t){r=n.split(";");for(s=0,o=r.length;s<o;s+=1){i=r[s].replace(/\s/g,"").match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/);if(i!==null&&i.length>=1)return i[1]}}return this.opts.width==="resolve"?(n=this.opts.element.css("width"),n.indexOf("%")>0?n:this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px"):null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}var r=n.call(this);r!==null&&this.container.css("width",r)}}),i=_(r,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>"," <span></span><abbr class='select2-search-choice-close' style='display:none;'></abbr>"," <div><b></b></div>","</a>","<input class='select2-focusser select2-offscreen' type='text'/>","<div class='select2-drop' style='display:none'>"," <div class='select2-search'>"," <input type='text' autocomplete='off' class='select2-input'/>"," </div>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return t},disable:function(){if(!this.enabled)return;this.parent.disable.apply(this,arguments),this.focusser.attr("disabled","disabled")},enable:function(){if(this.enabled)return;this.parent.enable.apply(this,arguments),this.focusser.removeAttr("disabled")},opening:function(){this.parent.opening.apply(this,arguments),this.focusser.attr("disabled","disabled"),this.opts.element.trigger(e.Event("open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments),this.focusser.removeAttr("disabled"),b(this.focusser)},focus:function(){this.opened()?this.close():(this.focusser.removeAttr("disabled"),this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus()},initContainer:function(){var e,t=this.container,r=this.dropdown,i=!1;this.showSearch(this.opts.minimumResultsForSearch>=0),this.selection=e=t.find(".select2-choice"),this.focusser=t.find(".select2-focusser"),this.search.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.PAGE_UP||e.which===n.PAGE_DOWN){w(e);return}switch(e.which){case n.UP:case n.DOWN:this.moveHighlight(e.which===n.UP?-1:1),w(e);return;case n.TAB:case n.ENTER:this.selectHighlighted(),w(e);return;case n.ESC:this.cancel(e),w(e);return}})),this.focusser.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.TAB||n.isControl(e)||n.isFunctionKey(e)||e.which===n.ESC)return;if(this.opts.openOnEnter===!1&&e.which===n.ENTER){w(e);return}if(e.which==n.DOWN||e.which==n.UP||e.which==n.ENTER&&this.opts.openOnEnter){this.open(),w(e);return}if(e.which==n.DELETE||e.which==n.BACKSPACE){this.opts.allowClear&&this.clear(),w(e);return}})),d(this.focusser),this.focusser.bind("keyup-change input",this.bind(function(e){if(this.opened())return;this.open(),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.focusser.val(""),w(e)})),e.delegate("abbr","mousedown",this.bind(function(e){if(!this.enabled)return;this.clear(),E(e),this.close(),this.selection.focus()})),e.bind("mousedown",this.bind(function(e){i=!0,this.opened()?this.close():this.enabled&&this.open(),w(e),i=!1})),r.bind("mousedown",this.bind(function(){this.search.focus()})),e.bind("focus",this.bind(function(e){w(e)})),this.focusser.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")})).bind("blur",this.bind(function(){this.opened()||this.container.removeClass("select2-container-active")})),this.search.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.setPlaceholder()},clear:function(){var e=this.selection.data("select2-data");this.opts.element.val(""),this.selection.find("span").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),this.opts.element.trigger({type:"removed",val:this.id(e),choice:e}),this.triggerChange({removed:e})},initSelection:function(){var e;if(this.opts.element.val()===""&&this.opts.element.text()==="")this.close(),this.setPlaceholder();else{var n=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==t&&e!==null&&(n.updateSelection(e),n.close(),n.setPlaceholder())})}},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(t,n){var r=t.find(":selected");e.isFunction(n)&&n({id:r.attr("value"),text:r.text(),element:r})}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=n.val();t.query({matcher:function(e,n,r){return c(i,t.id(r))},callback:e.isFunction(r)?function(e){r(e.results.length?e.results[0]:null)}:e.noop})}),t},getPlaceholder:function(){return this.select&&this.select.find("option").first().text()!==""?t:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(this.opts.element.val()===""&&e!==t){if(this.select&&this.select.find("option:first").text()!=="")return;this.selection.find("span").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.selection.find("abbr").hide()}},postprocessResults:function(e,t){var n=0,r=this,i=!0;this.findHighlightableChoices().each2(function(e,t){if(c(r.id(t.data("select2-data")),r.opts.element.val()))return n=e,!1}),this.highlight(n);if(t===!0){var s=this.opts.minimumResultsForSearch;i=s<0?!1:O(e.results)>=s,this.showSearch(i)}},showSearch:function(t){this.showSearchInput=t,this.dropdown.find(".select2-search")[t?"removeClass":"addClass"]("select2-search-hidden"),e(this.dropdown,this.container)[t?"addClass":"removeClass"]("select2-with-searchbox")},onSelect:function(e,t){var n=this.opts.element.val();this.opts.element.val(this.id(e)),this.updateSelection(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),this.close(),(!t||!t.noFocus)&&this.selection.focus(),c(n,this.id(e))||this.triggerChange()},updateSelection:function(e){var n=this.selection.find("span"),r;this.selection.data("select2-data",e),n.empty(),r=this.opts.formatSelection(e,n),r!==t&&n.append(this.opts.escapeMarkup(r)),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.selection.find("abbr").show()},val:function(){var e,n=!1,r=null,i=this;if(arguments.length===0)return this.opts.element.val();e=arguments[0],arguments.length>1&&(n=arguments[1]);if(this.select)this.select.val(e).find(":selected").each2(function(e,t){return r={id:t.attr("value"),text:t.text()},!1}),this.updateSelection(r),this.setPlaceholder(),n&&this.triggerChange();else{if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");if(!e&&e!==0){this.clear(),n&&this.triggerChange();return}this.opts.element.val(e),this.opts.initSelection(this.opts.element,function(e){i.opts.element.val(e?i.id(e):""),i.updateSelection(e),i.setPlaceholder(),n&&i.triggerChange()})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e){var n;if(arguments.length===0)return n=this.selection.data("select2-data"),n==t&&(n=null),n;!e||e===""?this.clear():(this.opts.element.val(e?this.id(e):""),this.updateSelection(e))}}),s=_(r,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html([" <ul class='select2-choices'>"," <li class='select2-search-field'>"," <input type='text' autocomplete='off' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi' style='display:none;'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return t},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(e,t){var n=[];e.find(":selected").each2(function(e,t){n.push({id:t.attr("value"),text:t.text(),element:t[0]})}),t(n)}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=h(n.val(),t.separator);t.query({matcher:function(n,r,s){return e.grep(i,function(e){return c(e,t.id(s))}).length},callback:e.isFunction(r)?function(e){r(e.results)}:e.noop})}),t},initContainer:function(){var t=".select2-choices",r;this.searchContainer=this.container.find(".select2-search-field"),this.selection=r=this.container.find(t),this.search.bind("input paste",this.bind(function(){if(!this.enabled)return;this.opened()||this.open()})),this.search.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.BACKSPACE&&this.search.val()===""){this.close();var t,i=r.find(".select2-search-choice-focus");if(i.length>0){this.unselect(i.first()),this.search.width(10),w(e);return}t=r.find(".select2-search-choice:not(.select2-locked)"),t.length>0&&t.last().addClass("select2-search-choice-focus")}else r.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");if(this.opened())switch(e.which){case n.UP:case n.DOWN:this.moveHighlight(e.which===n.UP?-1:1),w(e);return;case n.ENTER:case n.TAB:this.selectHighlighted(),w(e);return;case n.ESC:this.cancel(e),w(e);return}if(e.which===n.TAB||n.isControl(e)||n.isFunctionKey(e)||e.which===n.BACKSPACE||e.which===n.ESC)return;if(e.which===n.ENTER){if(this.opts.openOnEnter===!1)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),(e.which===n.PAGE_UP||e.which===n.PAGE_DOWN)&&w(e)})),this.search.bind("keyup",this.bind(this.resizeSearch)),this.search.bind("blur",this.bind(function(e){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.opened()||this.clearSearch(),e.stopImmediatePropagation()})),this.container.delegate(t,"mousedown",this.bind(function(t){if(!this.enabled)return;if(e(t.target).closest(".select2-search-choice").length>0)return;this.clearPlaceholder(),this.open(),this.focusSearch(),t.preventDefault()})),this.container.delegate(t,"focus",this.bind(function(){if(!this.enabled)return;this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder()})),this.initContainerWidth(),this.clearSearch()},enable:function(){if(this.enabled)return;this.parent.enable.apply(this,arguments),this.search.removeAttr("disabled")},disable:function(){if(!this.enabled)return;this.parent.disable.apply(this,arguments),this.search.attr("disabled",!0)},initSelection:function(){var e;this.opts.element.val()===""&&this.opts.element.text()===""&&(this.updateSelection([]),this.close(),this.clearSearch());if(this.select||this.opts.element.val()!==""){var n=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==t&&e!==null&&(n.updateSelection(e),n.close(),n.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder();e!==t&&this.getVal().length===0&&this.search.hasClass("select2-focused")===!1?(this.search.val(e).addClass("select2-default"),this.resizeSearch()):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.parent.opening.apply(this,arguments),this.clearPlaceholder(),this.resizeSearch(),this.focusSearch(),this.opts.element.trigger(e.Event("open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus(),this.opts.element.triggerHandler("focus")},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var n=[],r=[],i=this;e(t).each(function(){l(i.id(this),n)<0&&(n.push(i.id(this)),r.push(this))}),t=r,this.selection.find(".select2-search-choice").remove(),e(t).each(function(){i.addSelectedChoice(this)}),i.postprocessResults()},tokenize:function(){var e=this.search.val();e=this.opts.tokenizer(e,this.data(),this.bind(this.onSelect),this.opts),e!=null&&e!=t&&(this.search.val(e),e.length>0&&this.open())},onSelect:function(e,t){this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.val().length>=this.getMaximumSelectionSize()&&this.updateResults(!0),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),(!t||!t.noFocus)&&this.focusSearch()},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(n){var r=!n.locked,i=e("<li class='select2-search-choice'> <div></div> <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),s=e("<li class='select2-search-choice select2-locked'><div></div></li>"),o=r?i:s,u=this.id(n),a=this.getVal(),f;f=this.opts.formatSelection(n,o.find("div")),f!=t&&o.find("div").replaceWith("<div>"+this.opts.escapeMarkup(f)+"</div>"),r&&o.find(".select2-search-choice-close").bind("mousedown",w).bind("click dblclick",this.bind(function(t){if(!this.enabled)return;e(t.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(e(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),this.close(),this.focusSearch()})).dequeue(),w(t)})).bind("focus",this.bind(function(){if(!this.enabled)return;this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active")})),o.data("select2-data",n),o.insertBefore(this.searchContainer),a.push(u),this.setVal(a)},unselect:function(e){var t=this.getVal(),n,r;e=e.closest(".select2-search-choice");if(e.length===0)throw"Invalid argument: "+e+". Must be .select2-search-choice";n=e.data("select2-data");if(!n)return;r=l(this.id(n),t),r>=0&&(t.splice(r,1),this.setVal(t),this.select&&this.postprocessResults()),e.remove(),this.opts.element.trigger({type:"removed",val:this.id(n),choice:n}),this.triggerChange({removed:n})},postprocessResults:function(){var e=this.getVal(),t=this.results.find(".select2-result"),n=this.results.find(".select2-result-with-children"),r=this;t.each2(function(t,n){var i=r.id(n.data("select2-data"));l(i,e)>=0&&(n.addClass("select2-selected"),n.find(".select2-result-selectable").addClass("select2-selected"))}),n.each2(function(e,t){!t.is(".select2-result-selectable")&&t.find(".select2-result-selectable:not(.select2-selected)").length===0&&t.addClass("select2-selected")}),this.highlight()==-1&&r.highlight(0)},resizeSearch:function(){var e,t,n,r,i,s=p(this.search);e=S(this.search)+10,t=this.search.offset().left,n=this.selection.width(),r=this.selection.offset().left,i=n-(t-r)-s,i<e&&(i=n-s),i<40&&(i=n-s),i<=0&&(i=e),this.search.width(i)},getVal:function(){var e;return this.select?(e=this.select.val(),e===null?[]:e):(e=this.opts.element.val(),h(e,this.opts.separator))},setVal:function(t){var n;this.select?this.select.val(t):(n=[],e(t).each(function(){l(this,n)<0&&n.push(this)}),this.opts.element.val(n.length===0?"":n.join(this.opts.separator)))},val:function(){var n,r=!1,i=[],s=this;if(arguments.length===0)return this.getVal();n=arguments[0],arguments.length>1&&(r=arguments[1]);if(!n&&n!==0){this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),r&&this.triggerChange();return}this.setVal(n);if(this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),r&&this.triggerChange();else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var n=e(t).map(s.id);s.setVal(n),s.updateSelection(t),s.clearSearch(),r&&s.triggerChange()})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var t=[],n=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(n.opts.id(e(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t){var n=this,r;if(arguments.length===0)return this.selection.find(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get();t||(t=[]),r=e.map(t,function(e){return n.opts.id(e)}),this.setVal(r),this.updateSelection(t),this.clearSearch()}}),e.fn.select2=function(){var n=Array.prototype.slice.call(arguments,0),r,o,u,a,f=["val","destroy","opened","open","close","focus","isFocused","container","onSortStart","onSortEnd","enable","disable","positionDropdown","data"];return this.each(function(){if(n.length===0||typeof n[0]=="object")r=n.length===0?{}:e.extend({},n[0]),r.element=e(this),r.element.get(0).tagName.toLowerCase()==="select"?a=r.element.attr("multiple"):(a=r.multiple||!1,"tags"in r&&(r.multiple=a=!0)),o=a?new s:new i,o.init(r);else{if(typeof n[0]!="string")throw"Invalid arguments to select2 plugin: "+n;if(l(n[0],f)<0)throw"Unknown method: "+n[0];u=t,o=e(this).data("select2");if(o===t)return;n[0]==="container"?u=o.container:u=o[n[0]].apply(o,n.slice(1));if(u!==t)return!1}}),u===t?this:u},e.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,n,r){var i=[];return T(e.text,n.term,i,r),i.join("")},formatSelection:function(e,n){return e?e.text:t},sortResults:function(e,t,n){return e},formatResultCssClass:function(e){return t},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(e,t){var n=t-e.length;return"Please enter "+n+" more character"+(n==1?"":"s")},formatInputTooLong:function(e,t){var n=e.length-t;return"Please enter "+n+" less character"+(n==1?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(e==1?"":"s")},formatLoadMore:function(e){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e.id},matcher:function(e,t){return t.toUpperCase().indexOf(e.toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:M,escapeMarkup:function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;","/":"&#47;"};return String(e).replace(/[&<>"'/\\]/g,function(e){return t[e[0]]})},blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(e){return null}}}(e)}),timely.define("libs/select2_multiselect_helper",["jquery_timely","external_libs/select2"],function(e){var t=function(t){var n=e(t.element),r=n.data("color"),i=n.data("description"),s="";return typeof r!="undefined"&&r!==""&&(s+='<span class="ai1ec-color-swatch" style="background: '+n.data("color")+'"></span> '),s+=t.text,s='<span title="'+i+'">'+s+"</span>",s},n=function(t){var n=e(t.element),r=n.data("color"),i=n.data("description"),s="";return typeof r!="undefined"&&r!==""?s+='<span class="ai1ec-color-swatch" style="background: '+n.data("color")+'"></span> ':s+='<span class="ai1ec-color-swatch-empty"></span> ',s+=t.text,s='<span title="'+i+'">'+s+"</span>",s},r=function(r){typeof r=="undefined"&&(r=e(document)),e(".ai1ec-select2-multiselect-selector",r).select2({allowClear:!0,formatResult:n,formatSelection:t,escapeMarkup:function(e){return e}})},i=function(t){e(".ai1ec-select2-multiselect-selector.select2-container",t).each(function(){e(this).data("select2").resizeSearch()})};return{init:r,refresh:i}}),timely.define("external_libs/jquery_history",["jquery_timely"],function(e){try{(function(t,n){var r=t.History=t.History||{};if(typeof r.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");r.Adapter={bind:function(t,n,r){e(t).bind(n,r)},trigger:function(t,n,r){e(t).trigger(n,r)},extractEventData:function(e,t,r){var i=t&&t.originalEvent&&t.originalEvent[e]||r&&r[e]||n;return i},onDomLoad:function(t){e(t)}},typeof r.init!="undefined"&&r.init()})(window),function(e,t){var n=e.document,r=e.setTimeout||r,i=e.clearTimeout||i,s=e.setInterval||s,o=e.History=e.History||{};if(typeof o.initHtml4!="undefined")throw new Error("History.js HTML4 Support has already been loaded...");o.initHtml4=function(){if(typeof o.initHtml4.initialized!="undefined")return!1;o.initHtml4.initialized=!0,o.enabled=!0,o.savedHashes=[],o.isLastHash=function(e){var t=o.getHashByIndex(),n;return n=e===t,n},o.saveHash=function(e){return o.isLastHash(e)?!1:(o.savedHashes.push(e),!0)},o.getHashByIndex=function(e){var t=null;return typeof e=="undefined"?t=o.savedHashes[o.savedHashes.length-1]:e<0?t=o.savedHashes[o.savedHashes.length+e]:t=o.savedHashes[e],t},o.discardedHashes={},o.discardedStates={},o.discardState=function(e,t,n){var r=o.getHashByState(e),i;return i={discardedState:e,backState:n,forwardState:t},o.discardedStates[r]=i,!0},o.discardHash=function(e,t,n){var r={discardedHash:e,backState:n,forwardState:t};return o.discardedHashes[e]=r,!0},o.discardedState=function(e){var t=o.getHashByState(e),n;return n=o.discardedStates[t]||!1,n},o.discardedHash=function(e){var t=o.discardedHashes[e]||!1;return t},o.recycleState=function(e){var t=o.getHashByState(e);return o.discardedState(e)&&delete o.discardedStates[t],!0},o.emulated.hashChange&&(o.hashChangeInit=function(){o.checkerFunction=null;var t="",r,i,u,a;return o.isInternetExplorer()?(r="historyjs-iframe",i=n.createElement("iframe"),i.setAttribute("id",r),i.style.display="none",n.body.appendChild(i),i.contentWindow.document.open(),i.contentWindow.document.close(),u="",a=!1,o.checkerFunction=function(){if(a)return!1;a=!0;var n=o.getHash()||"",r=o.unescapeHash(i.contentWindow.document.location.hash)||"";return n!==t?(t=n,r!==n&&(u=r=n,i.contentWindow.document.open(),i.contentWindow.document.close(),i.contentWindow.document.location.hash=o.escapeHash(n)),o.Adapter.trigger(e,"hashchange")):r!==u&&(u=r,o.setHash(r,!1)),a=!1,!0}):o.checkerFunction=function(){var n=o.getHash();return n!==t&&(t=n,o.Adapter.trigger(e,"hashchange")),!0},o.intervalList.push(s(o.checkerFunction,o.options.hashChangeInterval)),!0},o.Adapter.onDomLoad(o.hashChangeInit)),o.emulated.pushState&&(o.onHashChange=function(t){var r=t&&t.newURL||n.location.href,i=o.getHashByUrl(r),s=null,u=null,a=null,f;return o.isLastHash(i)?(o.busy(!1),!1):(o.doubleCheckComplete(),o.saveHash(i),i&&o.isTraditionalAnchor(i)?(o.Adapter.trigger(e,"anchorchange"),o.busy(!1),!1):(s=o.extractState(o.getFullUrl(i||n.location.href,!1),!0),o.isLastSavedState(s)?(o.busy(!1),!1):(u=o.getHashByState(s),f=o.discardedState(s),f?(o.getHashByIndex(-2)===o.getHashByState(f.forwardState)?o.back(!1):o.forward(!1),!1):(o.pushState(s.data,s.title,s.url,!1),!0))))},o.Adapter.bind(e,"hashchange",o.onHashChange),o.pushState=function(t,r,i,s){if(o.getHashByUrl(i))throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(s!==!1&&o.busy())return o.pushQueue({scope:o,callback:o.pushState,args:arguments,queue:s}),!1;o.busy(!0);var u=o.createStateObject(t,r,i),a=o.getHashByState(u),f=o.getState(!1),l=o.getHashByState(f),c=o.getHash();return o.storeState(u),o.expectedStateId=u.id,o.recycleState(u),o.setTitle(u),a===l?(o.busy(!1),!1):a!==c&&a!==o.getShortUrl(n.location.href)?(o.setHash(a,!1),!1):(o.saveState(u),o.Adapter.trigger(e,"statechange"),o.busy(!1),!0)},o.replaceState=function(e,t,n,r){if(o.getHashByUrl(n))throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(r!==!1&&o.busy())return o.pushQueue({scope:o,callback:o.replaceState,args:arguments,queue:r}),!1;o.busy(!0);var i=o.createStateObject(e,t,n),s=o.getState(!1),u=o.getStateByIndex(-2);return o.discardState(s,i,u),o.pushState(i.data,i.title,i.url,!1),!0}),o.emulated.pushState&&o.getHash()&&!o.emulated.hashChange&&o.Adapter.onDomLoad(function(){o.Adapter.trigger(e,"hashchange")})},typeof o.init!="undefined"&&o.init()}(window),function(e,t){var n=e.console||t,r=e.document,i=e.navigator,s=e.sessionStorage||!1,o=e.setTimeout,u=e.clearTimeout,a=e.setInterval,f=e.clearInterval,l=e.JSON,c=e.alert,h=e.History=e.History||{},p=e.history;l.stringify=l.stringify||l.encode,l.parse=l.parse||l.decode;if(typeof h.init!="undefined")throw new Error("History.js Core has already been loaded...");h.init=function(){return typeof h.Adapter=="undefined"?!1:(typeof h.initCore!="undefined"&&h.initCore(),typeof h.initHtml4!="undefined"&&h.initHtml4(),!0)},h.initCore=function(){if(typeof h.initCore.initialized!="undefined")return!1;h.initCore.initialized=!0,h.options=h.options||{},h.options.hashChangeInterval=h.options.hashChangeInterval||100,h.options.safariPollInterval=h.options.safariPollInterval||500,h.options.doubleCheckInterval=h.options.doubleCheckInterval||500,h.options.storeInterval=h.options.storeInterval||1e3,h.options.busyDelay=h.options.busyDelay||250,h.options.debug=h.options.debug||!1,h.options.initialTitle=h.options.initialTitle||r.title,h.intervalList=[],h.clearAllIntervals=function(){var e,t=h.intervalList;if(typeof t!="undefined"&&t!==null){for(e=0;e<t.length;e++)f(t[e]);h.intervalList=null}},h.debug=function(){(h.options.debug||!1)&&h.log.apply(h,arguments)},h.log=function(){var e=typeof n!="undefined"&&typeof n.log!="undefined"&&typeof n.log.apply!="undefined",t=r.getElementById("log"),i,s,o,u,a;e?(u=Array.prototype.slice.call(arguments),i=u.shift(),typeof n.debug!="undefined"?n.debug.apply(n,[i,u]):n.log.apply(n,[i,u])):i="\n"+arguments[0]+"\n";for(s=1,o=arguments.length;s<o;++s){a=arguments[s];if(typeof a=="object"&&typeof l!="undefined")try{a=l.stringify(a)}catch(f){}i+="\n"+a+"\n"}return t?(t.value+=i+"\n-----\n",t.scrollTop=t.scrollHeight-t.clientHeight):e||c(i),!0},h.getInternetExplorerMajorVersion=function(){var e=h.getInternetExplorerMajorVersion.cached=typeof h.getInternetExplorerMajorVersion.cached!="undefined"?h.getInternetExplorerMajorVersion.cached:function(){var e=3,t=r.createElement("div"),n=t.getElementsByTagName("i");while((t.innerHTML="<!--[if gt IE "+ ++e+"]><i></i><![endif]-->")&&n[0]);return e>4?e:!1}();return e},h.isInternetExplorer=function(){var e=h.isInternetExplorer.cached=typeof h.isInternetExplorer.cached!="undefined"?h.isInternetExplorer.cached:Boolean(h.getInternetExplorerMajorVersion());return e},h.emulated={pushState:!Boolean(e.history&&e.history.pushState&&e.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(i.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(i.userAgent)),hashChange:Boolean(!("onhashchange"in e||"onhashchange"in r)||h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8)},h.enabled=!h.emulated.pushState,h.bugs={setHash:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),safariPoll:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),ieDoubleCheck:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<7)},h.isEmptyObject=function(e){for(var t in e)return!1;return!0},h.cloneObject=function(e){var t,n;return e?(t=l.stringify(e),n=l.parse(t)):n={},n},h.getRootUrl=function(){var e=r.location.protocol+"//"+(r.location.hostname||r.location.host);if(r.location.port||!1)e+=":"+r.location.port;return e+="/",e},h.getBaseHref=function(){var e=r.getElementsByTagName("base"),t=null,n="";return e.length===1&&(t=e[0],n=t.href.replace(/[^\/]+$/,"")),n=n.replace(/\/+$/,""),n&&(n+="/"),n},h.getBaseUrl=function(){var e=h.getBaseHref()||h.getBasePageUrl()||h.getRootUrl();return e},h.getPageUrl=function(){var e=h.getState(!1,!1),t=(e||{}).url||r.location.href,n;return n=t.replace(/\/+$/,"").replace(/[^\/]+$/,function(e,t,n){return/\./.test(e)?e:e+"/"}),n},h.getBasePageUrl=function(){var e=r.location.href.replace(/[#\?].*/,"").replace(/[^\/]+$/,function(e,t,n){return/[^\/]$/.test(e)?"":e}).replace(/\/+$/,"")+"/";return e},h.getFullUrl=function(e,t){var n=e,r=e.substring(0,1);return t=typeof t=="undefined"?!0:t,/[a-z]+\:\/\//.test(e)||(r==="/"?n=h.getRootUrl()+e.replace(/^\/+/,""):r==="#"?n=h.getPageUrl().replace(/#.*/,"")+e:r==="?"?n=h.getPageUrl().replace(/[\?#].*/,"")+e:t?n=h.getBaseUrl()+e.replace(/^(\.\/)+/,""):n=h.getBasePageUrl()+e.replace(/^(\.\/)+/,"")),n.replace(/\#$/,"")},h.getShortUrl=function(e){var t=e,n=h.getBaseUrl(),r=h.getRootUrl();return h.emulated.pushState&&(t=t.replace(n,"")),t=t.replace(r,"/"),h.isTraditionalAnchor(t)&&(t="./"+t),t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),t},h.store={},h.idToState=h.idToState||{},h.stateToId=h.stateToId||{},h.urlToId=h.urlToId||{},h.storedStates=h.storedStates||[],h.savedStates=h.savedStates||[],h.normalizeStore=function(){h.store.idToState=h.store.idToState||{},h.store.urlToId=h.store.urlToId||{},h.store.stateToId=h.store.stateToId||{}},h.getState=function(e,t){typeof e=="undefined"&&(e=!0),typeof t=="undefined"&&(t=!0);var n=h.getLastSavedState();return!n&&t&&(n=h.createStateObject()),e&&(n=h.cloneObject(n),n.url=n.cleanUrl||n.url),n},h.getIdByState=function(e){var t=h.extractId(e.url),n;if(!t){n=h.getStateString(e);if(typeof h.stateToId[n]!="undefined")t=h.stateToId[n];else if(typeof h.store.stateToId[n]!="undefined")t=h.store.stateToId[n];else{for(;;){t=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof h.idToState[t]=="undefined"&&typeof h.store.idToState[t]=="undefined")break}h.stateToId[n]=t,h.idToState[t]=e}}return t},h.normalizeState=function(e){var t,n;if(!e||typeof e!="object")e={};if(typeof e.normalized!="undefined")return e;if(!e.data||typeof e.data!="object")e.data={};t={},t.normalized=!0,t.title=e.title||"",t.url=h.getFullUrl(h.unescapeString(e.url||r.location.href)),t.hash=h.getShortUrl(t.url),t.data=h.cloneObject(e.data),t.id=h.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,n=!h.isEmptyObject(t.data);if(t.title||n)t.hash=h.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id;return t.hashedUrl=h.getFullUrl(t.hash),(h.emulated.pushState||h.bugs.safariPoll)&&h.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t},h.createStateObject=function(e,t,n){var r={data:e,title:t,url:n};return r=h.normalizeState(r),r},h.getStateById=function(e){e=String(e);var n=h.idToState[e]||h.store.idToState[e]||t;return n},h.getStateString=function(e){var t,n,r;return t=h.normalizeState(e),n={data:t.data,title:e.title,url:e.url},r=l.stringify(n),r},h.getStateId=function(e){var t,n;return t=h.normalizeState(e),n=t.id,n},h.getHashByState=function(e){var t,n;return t=h.normalizeState(e),n=t.hash,n},h.extractId=function(e){var t,n,r;return n=/(.*)\&_suid=([0-9]+)$/.exec(e),r=n?n[1]||e:e,t=n?String(n[2]||""):"",t||!1},h.isTraditionalAnchor=function(e){var t=!/[\/\?\.]/.test(e);return t},h.extractState=function(e,t){var n=null,r,i;return t=t||!1,r=h.extractId(e),r&&(n=h.getStateById(r)),n||(i=h.getFullUrl(e),r=h.getIdByUrl(i)||!1,r&&(n=h.getStateById(r)),!n&&t&&!h.isTraditionalAnchor(e)&&(n=h.createStateObject(null,null,i))),n},h.getIdByUrl=function(e){var n=h.urlToId[e]||h.store.urlToId[e]||t;return n},h.getLastSavedState=function(){return h.savedStates[h.savedStates.length-1]||t},h.getLastStoredState=function(){return h.storedStates[h.storedStates.length-1]||t},h.hasUrlDuplicate=function(e){var t=!1,n;return n=h.extractState(e.url),t=n&&n.id!==e.id,t},h.storeState=function(e){return h.urlToId[e.url]=e.id,h.storedStates.push(h.cloneObject(e)),e},h.isLastSavedState=function(e){var t=!1,n,r,i;return h.savedStates.length&&(n=e.id,r=h.getLastSavedState(),i=r.id,t=n===i),t},h.saveState=function(e){return h.isLastSavedState(e)?!1:(h.savedStates.push(h.cloneObject(e)),!0)},h.getStateByIndex=function(e){var t=null;return typeof e=="undefined"?t=h.savedStates[h.savedStates.length-1]:e<0?t=h.savedStates[h.savedStates.length+e]:t=h.savedStates[e],t},h.getHash=function(){var e=h.unescapeHash(r.location.hash);return e},h.unescapeString=function(t){var n=t,r;for(;;){r=e.unescape(n);if(r===n)break;n=r}return n},h.unescapeHash=function(e){var t=h.normalizeHash(e);return t=h.unescapeString(t),t},h.normalizeHash=function(e){var t=e.replace(/[^#]*#/,"").replace(/#.*/,"");return t},h.setHash=function(e,t){var n,i,s;return t!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.setHash,args:arguments,queue:t}),!1):(n=h.escapeHash(e),h.busy(!0),i=h.extractState(e,!0),i&&!h.emulated.pushState?h.pushState(i.data,i.title,i.url,!1):r.location.hash!==n&&(h.bugs.setHash?(s=h.getPageUrl(),h.pushState(null,null,s+"#"+n,!1)):r.location.hash=n),h)},h.escapeHash=function(t){var n=h.normalizeHash(t);return n=e.escape(n),h.bugs.hashEscape||(n=n.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),n},h.getHashByUrl=function(e){var t=String(e).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return t=h.unescapeHash(t),t},h.setTitle=function(e){var t=e.title,n;t||(n=h.getStateByIndex(0),n&&n.url===e.url&&(t=n.title||h.options.initialTitle));try{r.getElementsByTagName("title")[0].innerHTML=t.replace("<","&lt;").replace(">","&gt;").replace(" & "," &amp; ")}catch(i){}return r.title=t,h},h.queues=[],h.busy=function(e){typeof e!="undefined"?h.busy.flag=e:typeof h.busy.flag=="undefined"&&(h.busy.flag=!1);if(!h.busy.flag){u(h.busy.timeout);var t=function(){var e,n,r;if(h.busy.flag)return;for(e=h.queues.length-1;e>=0;--e){n=h.queues[e];if(n.length===0)continue;r=n.shift(),h.fireQueueItem(r),h.busy.timeout=o(t,h.options.busyDelay)}};h.busy.timeout=o(t,h.options.busyDelay)}return h.busy.flag},h.busy.flag=!1,h.fireQueueItem=function(e){return e.callback.apply(e.scope||h,e.args||[])},h.pushQueue=function(e){return h.queues[e.queue||0]=h.queues[e.queue||0]||[],h.queues[e.queue||0].push(e),h},h.queue=function(e,t){return typeof e=="function"&&(e={callback:e}),typeof t!="undefined"&&(e.queue=t),h.busy()?h.pushQueue(e):h.fireQueueItem(e),h},h.clearQueue=function(){return h.busy.flag=!1,h.queues=[],h},h.stateChanged=!1,h.doubleChecker=!1,h.doubleCheckComplete=function(){return h.stateChanged=!0,h.doubleCheckClear(),h},h.doubleCheckClear=function(){return h.doubleChecker&&(u(h.doubleChecker),h.doubleChecker=!1),h},h.doubleCheck=function(e){return h.stateChanged=!1,h.doubleCheckClear(),h.bugs.ieDoubleCheck&&(h.doubleChecker=o(function(){return h.doubleCheckClear(),h.stateChanged||e(),!0},h.options.doubleCheckInterval)),h},h.safariStatePoll=function(){var t=h.extractState(r.location.href),n;if(!h.isLastSavedState(t))return n=t,n||(n=h.createStateObject()),h.Adapter.trigger(e,"popstate"),h;return},h.back=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.back,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.back(!1)}),p.go(-1),!0)},h.forward=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.forward,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.forward(!1)}),p.go(1),!0)},h.go=function(e,t){var n;if(e>0)for(n=1;n<=e;++n)h.forward(t);else{if(!(e<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(n=-1;n>=e;--n)h.back(t)}return h};if(h.emulated.pushState){var d=function(){};h.pushState=h.pushState||d,h.replaceState=h.replaceState||d}else h.onPopState=function(t,n){var i=!1,s=!1,o,u;return h.doubleCheckComplete(),o=h.getHash(),o?(u=h.extractState(o||r.location.href,!0),u?h.replaceState(u.data,u.title,u.url,!1):(h.Adapter.trigger(e,"anchorchange"),h.busy(!1)),h.expectedStateId=!1,!1):(i=h.Adapter.extractEventData("state",t,n)||!1,i?s=h.getStateById(i):h.expectedStateId?s=h.getStateById(h.expectedStateId):s=h.extractState(r.location.href),s||(s=h.createStateObject(null,null,r.location.href)),h.expectedStateId=!1,h.isLastSavedState(s)?(h.busy(!1),!1):(h.storeState(s),h.saveState(s),h.setTitle(s),h.Adapter.trigger(e,"statechange"),h.busy(!1),!0))},h.Adapter.bind(e,"popstate",h.onPopState),h.pushState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.pushState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.pushState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0},h.replaceState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.replaceState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.replaceState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0};if(s){try{h.store=l.parse(s.getItem("History.store"))||{}}catch(v){h.store={}}h.normalizeStore()}else h.store={},h.normalizeStore();h.Adapter.bind(e,"beforeunload",h.clearAllIntervals),h.Adapter.bind(e,"unload",h.clearAllIntervals),h.saveState(h.storeState(h.extractState(r.location.href,!0))),s&&(h.onUnload=function(){var e,t;try{e=l.parse(s.getItem("History.store"))||{}}catch(n){e={}}e.idToState=e.idToState||{},e.urlToId=e.urlToId||{},e.stateToId=e.stateToId||{};for(t in h.idToState){if(!h.idToState.hasOwnProperty(t))continue;e.idToState[t]=h.idToState[t]}for(t in h.urlToId){if(!h.urlToId.hasOwnProperty(t))continue;e.urlToId[t]=h.urlToId[t]}for(t in h.stateToId){if(!h.stateToId.hasOwnProperty(t))continue;e.stateToId[t]=h.stateToId[t]}h.store=e,h.normalizeStore(),s.setItem("History.store",l.stringify(e))},h.intervalList.push(a(h.onUnload,h.options.storeInterval)),h.Adapter.bind(e,"beforeunload",h.onUnload),h.Adapter.bind(e,"unload",h.onUnload));if(!h.emulated.pushState){h.bugs.safariPoll&&h.intervalList.push(a(h.safariStatePoll,h.options.safariPollInterval));if(i.vendor==="Apple Computer, Inc."||(i.appCodeName||"")==="Mozilla")h.Adapter.bind(e,"hashchange",function(){h.Adapter.trigger(e,"popstate")}),h.getHash()&&h.Adapter.onDomLoad(function(){h.Adapter.trigger(e,"hashchange")})}},h.init()}(window)}catch(t){}}),timely.define("external_libs/jquery.tablescroller",["jquery_timely"],function(e){function n(){if(t)return t;var n=e('<div style="width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;"><div style="height:100px;"></div></div>');e("body").append(n);var r=e("div",n).innerWidth();n.css("overflow-y","auto");var i=e("div",n).innerWidth();return e(n).remove(),t=r-i,t}var t=0;e.fn.tableScroll=function(t){if(t=="undo"){var r=e(this).parent().parent();r.hasClass("tablescroll_wrapper")&&(r.find(".tablescroll_head thead").prependTo(this),r.find(".tablescroll_foot tfoot").appendTo(this),r.before(this),r.empty());return}var i=e.extend({},e.fn.tableScroll.defaults,t);return i.scrollbarWidth=n(),this.each(function(){var t=i.flush,n=e(this).addClass("tablescroll_body"),r=e('<div class="tablescroll_wrapper ai1ec-popover-boundary"></div>').insertBefore(n).append(n);r.parent("div").hasClass(i.containerClass)||e("<div></div>").addClass(i.containerClass).insertBefore(r).append(r);var s=i.width?i.width:n.outerWidth(),o=i.scroll?"auto":"hidden";r.css({width:s+"px",height:i.height+"px",overflow:o}),n.css("width",s+"px");var u=r.outerWidth(),a=u-s;r.css({width:s-a-2+"px"}),n.css("width",s-a-i.scrollbarWidth+"px"),n.outerHeight()<=i.height&&(r.css({height:"auto",width:s-a+"px"}),t=!1);var f=e("thead",n).length?!0:!1,l=e("tfoot",n).length?!0:!1,c=e("thead tr:first",n),h=e("tbody tr:first",n),p=e("tfoot tr:first",n),d=0;e("th, td",c).each(function(t){d=e(this).width(),e("th:eq("+t+"), td:eq("+t+")",c).css("width",d+"px"),e("th:eq("+t+"), td:eq("+t+")",h).css("width",d+"px"),l&&e("th:eq("+t+"), td:eq("+t+")",p).css("width",d+"px")});if(f)var v=e('<table class="tablescroll_head" cellspacing="0"></table>').insertBefore(r).prepend(e("thead",n));if(l)var m=e('<table class="tablescroll_foot" cellspacing="0"></table>').insertAfter(r).prepend(e("tfoot",n));v!=undefined&&(v.css("width",s+"px"),t&&(e("tr:first th:last, tr:first td:last",v).css("width",d+i.scrollbarWidth+"px"),v.css("width",r.outerWidth()+"px"))),m!=undefined&&(m.css("width",s+"px"),t&&(e("tr:first th:last, tr:first td:last",m).css("width",d+i.scrollbarWidth+"px"),m.css("width",r.outerWidth()+"px")))}),this},e.fn.tableScroll.defaults={flush:!0,width:null,height:100,containerClass:"tablescroll",scroll:!0}}),timely.define("external_libs/jquery.scrollTo",["jquery_timely"],function(e){function n(e){return typeof e=="object"?e:{top:e,left:e}}var t=e.scrollTo=function(t,n,r){e(window).scrollTo(t,n,r)};t.defaults={axis:"xy",duration:parseFloat(e.fn.jquery)>=1.3?0:1,limit:!0},t.window=function(t){return e(window)._scrollable()},e.fn._scrollable=function(){return this.map(function(){var t=this,n=!t.nodeName||e.inArray(t.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!n)return t;var r=(t.contentWindow||t).document||t.ownerDocument||t;return/webkit/i.test(navigator.userAgent)||r.compatMode=="BackCompat"?r.body:r.documentElement})},e.fn.scrollTo=function(r,i,s){return typeof i=="object"&&(s=i,i=0),typeof s=="function"&&(s={onAfter:s}),r=="max"&&(r=9e9),s=e.extend({},t.defaults,s),i=i||s.duration,s.queue=s.queue&&s.axis.length>1,s.queue&&(i/=2),s.offset=n(s.offset),s.over=n(s.over),this._scrollable().each(function(){function h(e){u.animate(l,i,s.easing,e&&function(){e.call(this,r,s)})}if(r==null)return;var o=this,u=e(o),a=r,f,l={},c=u.is("html,body");switch(typeof a){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(a)){a=n(a);break}a=e(a,this);if(!a.length)return;case"object":if(a.is||a.style)f=(a=e(a)).offset()}e.each(s.axis.split(""),function(e,n){var r=n=="x"?"Left":"Top",i=r.toLowerCase(),p="scroll"+r,d=o[p],v=t.max(o,n);if(f)l[p]=f[i]+(c?0:d-u.offset()[i]),s.margin&&(l[p]-=parseInt(a.css("margin"+r))||0,l[p]-=parseInt(a.css("border"+r+"Width"))||0),l[p]+=s.offset[i]||0,s.over[i]&&(l[p]+=a[n=="x"?"width":"height"]()*s.over[i]);else{var m=a[i];l[p]=m.slice&&m.slice(-1)=="%"?parseFloat(m)/100*v:m}s.limit&&/^\d+$/.test(l[p])&&(l[p]=l[p]<=0?0:Math.min(l[p],v)),!e&&s.queue&&(d!=l[p]&&h(s.onAfterFirst),delete l[p])}),h(s.onAfter)}).end()},t.max=function(t,n){var r=n=="x"?"Width":"Height",i="scroll"+r;if(!e(t).is("html,body"))return t[i]-e(t)[r.toLowerCase()]();var s="client"+r,o=t.ownerDocument.documentElement,u=t.ownerDocument.body;return Math.max(o[i],u[i])-Math.min(o[s],u[s])}}),timely.define("external_libs/locales/bootstrap-datepicker.bg",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.bg={days:["Неделя","Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота","Неделя"],daysShort:["Нед","Пон","Вто","Сря","Чет","Пет","Съб","Нед"],daysMin:["Н","П","В","С","Ч","П","С","Н"],months:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],monthsShort:["Ян","Фев","Мар","Апр","Май","Юни","Юли","Авг","Сеп","Окт","Ное","Дек"],today:"днес"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.br",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.br={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"]}}}}),timely.define("external_libs/locales/bootstrap-datepicker.cs",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.cs={days:["Neděle","Pondělí","Úterý","Středa","Čtvrtek","Pátek","Sobota","Neděle"],daysShort:["Ned","Pon","Úte","Stř","Čtv","Pát","Sob","Ned"],daysMin:["Ne","Po","Út","St","Čt","Pá","So","Ne"],months:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],monthsShort:["Led","Úno","Bře","Dub","Kvě","Čer","Čnc","Srp","Zář","Říj","Lis","Pro"],today:"Dnes"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.da",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.da={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I Dag",clear:"Nulstil"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.de",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.de={days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"],daysShort:["Son","Mon","Die","Mit","Don","Fre","Sam","Son"],daysMin:["So","Mo","Di","Mi","Do","Fr","Sa","So"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",clear:"Löschen",weekStart:1,format:"dd.mm.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.es",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.es={days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"],daysShort:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb","Dom"],daysMin:["Do","Lu","Ma","Mi","Ju","Vi","Sa","Do"],months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthsShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],today:"Hoy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.fi",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.fi={days:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai","sunnuntai"],daysShort:["sun","maa","tii","kes","tor","per","lau","sun"],daysMin:["su","ma","ti","ke","to","pe","la","su"],months:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],monthsShort:["tam","hel","maa","huh","tou","kes","hei","elo","syy","lok","mar","jou"],today:"tänään",weekStart:1,format:"d.m.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.fr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.fr={days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],daysMin:["D","L","Ma","Me","J","V","S","D"],months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthsShort:["Jan","Fév","Mar","Avr","Mai","Jui","Jul","Aou","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",clear:"Effacer",weekStart:1,format:"dd/mm/yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.id",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.id={days:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu","Minggu"],daysShort:["Mgu","Sen","Sel","Rab","Kam","Jum","Sab","Mgu"],daysMin:["Mg","Sn","Sl","Ra","Ka","Ju","Sa","Mg"],months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ags","Sep","Okt","Nov","Des"],today:"Hari Ini",clear:"Kosongkan"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.is",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.is={days:["Sunnudagur","Mánudagur","Þriðjudagur","Miðvikudagur","Fimmtudagur","Föstudagur","Laugardagur","Sunnudagur"],daysShort:["Sun","Mán","Þri","Mið","Fim","Fös","Lau","Sun"],daysMin:["Su","Má","Þr","Mi","Fi","Fö","La","Su"],months:["Janúar","Febrúar","Mars","Apríl","Maí","Júní","Júlí","Ágúst","September","Október","Nóvember","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Maí","Jún","Júl","Ágú","Sep","Okt","Nóv","Des"],today:"Í Dag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.it",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.it={days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato","Domenica"],daysShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab","Dom"],daysMin:["Do","Lu","Ma","Me","Gi","Ve","Sa","Do"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthsShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],today:"Oggi",clear:"Cancella",weekStart:1,format:"dd/mm/yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ja",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ja={days:["日曜","月曜","火曜","水曜","木曜","金曜","土曜","日曜"],daysShort:["日","月","火","水","木","金","土","日"],daysMin:["日","月","火","水","木","金","土","日"],months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],today:"今日",format:"yyyy/mm/dd"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.kr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.kr={days:["일요일","월요일","화요일","수요일","목요일","금요일","토요일","일요일"],daysShort:["일","월","화","수","목","금","토","일"],daysMin:["일","월","화","수","목","금","토","일"],months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],monthsShort:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]}}}}),timely.define("external_libs/locales/bootstrap-datepicker.lt",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.lt={days:["Sekmadienis","Pirmadienis","Antradienis","Trečiadienis","Ketvirtadienis","Penktadienis","Šeštadienis","Sekmadienis"],daysShort:["S","Pr","A","T","K","Pn","Š","S"],daysMin:["Sk","Pr","An","Tr","Ke","Pn","Št","Sk"],months:["Sausis","Vasaris","Kovas","Balandis","Gegužė","Birželis","Liepa","Rugpjūtis","Rugsėjis","Spalis","Lapkritis","Gruodis"],monthsShort:["Sau","Vas","Kov","Bal","Geg","Bir","Lie","Rugp","Rugs","Spa","Lap","Gru"],today:"Šiandien",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.lv",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.lv={days:["Svētdiena","Pirmdiena","Otrdiena","Trešdiena","Ceturtdiena","Piektdiena","Sestdiena","Svētdiena"],daysShort:["Sv","P","O","T","C","Pk","S","Sv"],daysMin:["Sv","Pr","Ot","Tr","Ce","Pk","Se","Sv"],months:["Janvāris","Februāris","Marts","Aprīlis","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jūn","Jūl","Aug","Sep","Okt","Nov","Dec"],today:"Šodien",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ms",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ms={days:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu","Ahad"],daysShort:["Aha","Isn","Sel","Rab","Kha","Jum","Sab","Aha"],daysMin:["Ah","Is","Se","Ra","Kh","Ju","Sa","Ah"],months:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],today:"Hari Ini"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.nb",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.nb={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],today:"I Dag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.nl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.nl={days:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zondag"],daysShort:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],daysMin:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],months:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"Vandaag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.pl={days:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota","Niedziela"],daysShort:["Nie","Pn","Wt","Śr","Czw","Pt","So","Nie"],daysMin:["N","Pn","Wt","Śr","Cz","Pt","So","N"],months:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],monthsShort:["Sty","Lu","Mar","Kw","Maj","Cze","Lip","Sie","Wrz","Pa","Lis","Gru"],today:"Dzisiaj",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pt-BR",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",clear:"Limpar"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pt",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.pt={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",clear:"Limpar"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ru",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ru={days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота","Воскресенье"],daysShort:["Вск","Пнд","Втр","Срд","Чтв","Птн","Суб","Вск"],daysMin:["Вс","Пн","Вт","Ср","Чт","Пт","Сб","Вс"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthsShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],today:"Сегодня",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.sl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.sl={days:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota","Nedelja"],daysShort:["Ned","Pon","Tor","Sre","Čet","Pet","Sob","Ned"],daysMin:["Ne","Po","To","Sr","Če","Pe","So","Ne"],months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],today:"Danes"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.sv",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.sv={days:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag","Söndag"],daysShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör","Sön"],daysMin:["Sö","Må","Ti","On","To","Fr","Lö","Sö"],months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I Dag",format:"yyyy-mm-dd",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.th",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.th={days:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัส","ศุกร์","เสาร์","อาทิตย์"],daysShort:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],daysMin:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],months:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],monthsShort:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],today:"วันนี้"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.tr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.tr={days:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi","Pazar"],daysShort:["Pz","Pzt","Sal","Çrş","Prş","Cu","Cts","Pz"],daysMin:["Pz","Pzt","Sa","Çr","Pr","Cu","Ct","Pz"],months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],monthsShort:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],today:"Bugün",format:"dd.mm.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.zh-CN",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["zh-CN"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今日",format:"yyyy年mm月dd日",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.zh-TW",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["zh-TW"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["週日","週一","週二","週三","週四","週五","週六","週日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今天",format:"yyyy年mm月dd日",weekStart:1}}}}),timely.define("external_libs/bootstrap_datepicker",["jquery_timely","ai1ec_config","external_libs/locales/bootstrap-datepicker.bg","external_libs/locales/bootstrap-datepicker.br","external_libs/locales/bootstrap-datepicker.cs","external_libs/locales/bootstrap-datepicker.da","external_libs/locales/bootstrap-datepicker.de","external_libs/locales/bootstrap-datepicker.es","external_libs/locales/bootstrap-datepicker.fi","external_libs/locales/bootstrap-datepicker.fr","external_libs/locales/bootstrap-datepicker.id","external_libs/locales/bootstrap-datepicker.is","external_libs/locales/bootstrap-datepicker.it","external_libs/locales/bootstrap-datepicker.ja","external_libs/locales/bootstrap-datepicker.kr","external_libs/locales/bootstrap-datepicker.lt","external_libs/locales/bootstrap-datepicker.lv","external_libs/locales/bootstrap-datepicker.ms","external_libs/locales/bootstrap-datepicker.nb","external_libs/locales/bootstrap-datepicker.nl","external_libs/locales/bootstrap-datepicker.pl","external_libs/locales/bootstrap-datepicker.pt-BR","external_libs/locales/bootstrap-datepicker.pt","external_libs/locales/bootstrap-datepicker.ru","external_libs/locales/bootstrap-datepicker.sl","external_libs/locales/bootstrap-datepicker.sv","external_libs/locales/bootstrap-datepicker.th","external_libs/locales/bootstrap-datepicker.tr","external_libs/locales/bootstrap-datepicker.zh-CN","external_libs/locales/bootstrap-datepicker.zh-TW"],function(e,t){function r(){return new Date(Date.UTC.apply(Date,arguments))}function i(){var e=new Date;return r(e.getFullYear(),e.getMonth(),e.getDate())}function s(e){return function(){return this[e].apply(this,arguments)}}function f(t,n){var r=e(t).data(),i={},s,o=new RegExp("^"+n.toLowerCase()+"([A-Z])"),n=new RegExp("^"+n.toLowerCase());for(var u in r)n.test(u)&&(s=u.replace(o,function(e,t){return t.toLowerCase()}),i[s]=r[u]);return i}function l(t){var n={};if(!d[t]){t=t.split("-")[0];if(!d[t])return}var r=d[t];return e.each(p,function(e,t){t in r&&(n[t]=r[t])}),n}var n=e(window),o=function(){var t={get:function(e){return this.slice(e)[0]},contains:function(e){var t=e&&e.valueOf();for(var n=0,r=this.length;n<r;n++)if(this[n].valueOf()===t)return n;return-1},remove:function(e){this.splice(e,1)},replace:function(t){if(!t)return;e.isArray(t)||(t=[t]),this.clear(),this.push.apply(this,t)},clear:function(){this.splice(0)},copy:function(){var e=new o;return e.replace(this),e}};return function(){var n=[];return n.push.apply(n,arguments),e.extend(n,t),n}}(),u=function(t,n){this.dates=new o,this.viewDate=i(),this.focusDate=null,this._process_options(n),this.element=e(t),this.isInline=!1,this.isInput=this.element.is("input"),this.component=this.element.is(".ai1ec-date")?this.element.find(".ai1ec-input-group, .ai1ec-input-group-addon, .ai1ec-btn"):!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&this.component.length===0&&(this.component=!1),this.picker=e(v.template),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("ai1ec-datepicker-inline").appendTo(this.element):this.picker.addClass("ai1ec-datepicker-dropdown ai1ec-dropdown-menu"),this.o.rtl&&this.picker.addClass("ai1ec-datepicker-rtl"),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("tfoot th.ai1ec-today").attr("colspan",function(e,t){return parseInt(t)+1}),this._allow_update=!1,this.setStartDate(this._o.startDate),this.setEndDate(this._o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};u.prototype={constructor:u,_process_options:function(n){this._o=e.extend({},this._o,n);var r=this.o=e.extend({},this._o),i=r.language;d[i]||(i=i.split("-")[0],d[i]||(i=t.language,d[i]||(i=h.language))),r.language=i;switch(r.startView){case 2:case"decade":r.startView=2;break;case 1:case"year":r.startView=1;break;default:r.startView=0}switch(r.minViewMode){case 1:case"months":r.minViewMode=1;break;case 2:case"years":r.minViewMode=2;break;default:r.minViewMode=0}r.startView=Math.max(r.startView,r.minViewMode),r.multidate!==!0&&(r.multidate=Number(r.multidate)||!1,r.multidate!==!1?r.multidate=Math.max(0,r.multidate):r.multidate=1),r.multidateSeparator=String(r.multidateSeparator),r.weekStart%=7,r.weekEnd=(r.weekStart+6)%7;var s=v.parseFormat(r.format);r.startDate!==-Infinity&&(r.startDate?r.startDate instanceof Date?r.startDate=this._local_to_utc(this._zero_time(r.startDate)):r.startDate=v.parseDate(r.startDate,s,r.language):r.startDate=-Infinity),r.endDate!==Infinity&&(r.endDate?r.endDate instanceof Date?r.endDate=this._local_to_utc(this._zero_time(r.endDate)):r.endDate=v.parseDate(r.endDate,s,r.language):r.endDate=Infinity),r.daysOfWeekDisabled=r.daysOfWeekDisabled||[],e.isArray(r.daysOfWeekDisabled)||(r.daysOfWeekDisabled=r.daysOfWeekDisabled.split(/[,\s]*/)),r.daysOfWeekDisabled=e.map(r.daysOfWeekDisabled,function(e){return parseInt(e,10)});var o=String(r.orientation).toLowerCase().split(/\s+/g),u=r.orientation.toLowerCase();o=e.grep(o,function(e){return/^auto|left|right|top|bottom$/.test(e)}),r.orientation={x:"auto",y:"auto"};if(!!u&&u!=="auto")if(o.length===1)switch(o[0]){case"top":case"bottom":r.orientation.y=o[0];break;case"left":case"right":r.orientation.x=o[0]}else u=e.grep(o,function(e){return/^left|right$/.test(e)}),r.orientation.x=u[0]||"auto",u=e.grep(o,function(e){return/^top|bottom$/.test(e)}),r.orientation.y=u[0]||"auto"},_events:[],_secondaryEvents:[],_applyEvents:function(e){for(var t=0,n,r,i;t<e.length;t++)n=e[t][0],e[t].length==2?(r=undefined,i=e[t][1]):e[t].length==3&&(r=e[t][1],i=e[t][2]),n.on(i,r)},_unapplyEvents:function(e){for(var t=0,n,r,i;t<e.length;t++)n=e[t][0],e[t].length==2?(i=undefined,r=e[t][1]):e[t].length==3&&(i=e[t][1],r=e[t][2]),n.off(r,i)},_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:e.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:e.proxy(this.keydown,this)}],[this.component,{click:e.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:e.proxy(this.show,this)}]],this._events.push([this.element,"*",{blur:e.proxy(function(e){this._focused_from=e.target},this)}],[this.element,{blur:e.proxy(function(e){this._focused_from=e.target},this)}]),this._secondaryEvents=[[this.picker,{click:e.proxy(this.click,this)}],[e(window),{resize:e.proxy(this.place,this)}],[e(document),{"mousedown touchstart":e.proxy(function(e){this.element.is(e.target)||this.element.find(e.target).length||this.picker.is(e.target)||this.picker.find(e.target).length||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(t,n){var r=n||this.dates.get(-1),i=this._utc_to_local(r);this.element.trigger({type:t,date:i,dates:e.map(this.dates,this._utc_to_local),format:e.proxy(function(e,t){arguments.length===0?(e=this.dates.length-1,t=this.o.format):typeof e=="string"&&(t=e,e=this.dates.length-1),t=t||this.o.format;var n=this.dates.get(e);return v.formatDate(n,t,this.o.language)},this)})},show:function(e){this.isInline||this.picker.appendTo("body"),this.picker.show(),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.place(),this._attachSecondaryEvents(),this._trigger("show")},hide:function(){if(this.isInline)return;if(!this.picker.is(":visible"))return;this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide")},remove:function(){this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date},_utc_to_local:function(e){return e&&new Date(e.getTime()+e.getTimezoneOffset()*6e4)},_local_to_utc:function(e){return e&&new Date(e.getTime()-e.getTimezoneOffset()*6e4)},_zero_time:function(e){return e&&new Date(e.getFullYear(),e.getMonth(),e.getDate())},_zero_utc_time:function(e){return e&&new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},getDates:function(){return e.map(this.dates,this._utc_to_local)},getUTCDates:function(){return e.map(this.dates,function(e){return new Date(e)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){return new Date(this.dates.get(-1))},setDates:function(){this.update.apply(this,arguments),this._trigger("changeDate"),this.setValue()},setUTCDates:function(){this.update.apply(this,e.map(arguments,this._utc_to_local)),this._trigger("changeDate"),this.setValue()},setDate:s("setDates"),setUTCDate:s("setUTCDates"),setValue:function(){var e=this.getFormattedDate();this.isInput?this.element.val(e).change():this.component&&this.element.find("input").val(e).change()},getFormattedDate:function(t){t===undefined&&(t=this.o.format);var n=this.o.language;return e.map(this.dates,function(e){return v.formatDate(e,t,n)}).join(this.o.multidateSeparator)},setStartDate:function(e){this._process_options({startDate:e}),this.update(),this.updateNavArrows()},setEndDate:function(e){this._process_options({endDate:e}),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(e){this._process_options({daysOfWeekDisabled:e}),this.update(),this.updateNavArrows()},place:function(){if(this.isInline)return;var t=this.picker.outerWidth(),r=this.picker.outerHeight(),i=10,s=n.width(),o=n.height(),u=n.scrollTop(),a=parseInt(this.element.parents().filter(function(){return e(this).css("z-index")!="auto"}).first().css("z-index"))+10,f=this.component?this.component.parent().offset():this.element.offset(),l=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),c=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),h=f.left,p=f.top;this.picker.removeClass("ai1ec-datepicker-orient-top ai1ec-datepicker-orient-bottom ai1ec-datepicker-orient-right ai1ec-datepicker-orient-left"),this.o.orientation.x!=="auto"?(this.picker.addClass("ai1ec-datepicker-orient-"+this.o.orientation.x),this.o.orientation.x==="right"&&(h-=t-c)):(this.picker.addClass("ai1ec-datepicker-orient-left"),f.left<0?h-=f.left-i:f.left+t>s&&(h=s-t-i));var d=this.o.orientation.y,v,m;d==="auto"&&(v=-u+f.top-r,m=u+o-(f.top+l+r),Math.max(v,m)===m?d="top":d="bottom"),this.picker.addClass("ai1ec-datepicker-orient-"+d),d==="top"?p+=l:p-=r+parseInt(this.picker.css("padding-top")),this.picker.css({top:p,left:h,zIndex:a})},_allow_update:!0,update:function(){if(!this._allow_update)return;var t=this.dates.copy(),n=[],r=!1;arguments.length?(e.each(arguments,e.proxy(function(e,t){t instanceof Date&&(t=this._local_to_utc(t)),n.push(t)},this)),r=!0):(n=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),n&&this.o.multidate?n=n.split(this.o.multidateSeparator):n=[n],delete this.element.data().date),n=e.map(n,e.proxy(function(e){return v.parseDate(e,this.o.format,this.o.language)},this)),n=e.grep(n,e.proxy(function(e){return e<this.o.startDate||e>this.o.endDate||!e},this),!0),this.dates.replace(n),this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate&&(this.viewDate=new Date(this.o.endDate)),r?this.setValue():n.length&&String(t)!==String(this.dates)&&this._trigger("changeDate"),!this.dates.length&&t.length&&this._trigger("clearDate"),this.fill()},fillDow:function(){var e=this.o.weekStart,t="<tr>";if(this.o.calendarWeeks){var n='<th class="ai1ec-cw">&nbsp;</th>';t+=n,this.picker.find(".ai1ec-datepicker-days thead tr:first-child").prepend(n)}while(e<this.o.weekStart+7)t+='<th class="ai1ec-dow">'+d[this.o.language].daysMin[e++%7]+"</th>";t+="</tr>",this.picker.find(".ai1ec-datepicker-days thead").append(t)},fillMonths:function(){var e="",t=0;while(t<12)e+='<span class="ai1ec-month">'+d[this.o.language].monthsShort[t++]+"</span>";this.picker.find(".ai1ec-datepicker-months td").html(e)},setRange:function(t){!t||!t.length?delete this.range:this.range=e.map(t,function(e){return e.valueOf()}),this.fill()},getClassNames:function(t){var n=[],r=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth(),s=new Date;return t.getUTCFullYear()<r||t.getUTCFullYear()==r&&t.getUTCMonth()<i?n.push("ai1ec-old"):(t.getUTCFullYear()>r||t.getUTCFullYear()==r&&t.getUTCMonth()>i)&&n.push("ai1ec-new"),this.focusDate&&t.valueOf()===this.focusDate.valueOf()&&n.push("ai1ec-focused"),this.o.todayHighlight&&t.getUTCFullYear()==s.getFullYear()&&t.getUTCMonth()==s.getMonth()&&t.getUTCDate()==s.getDate()&&n.push("ai1ec-today"),this.dates.contains(t)!==-1&&n.push("ai1ec-active"),(t.valueOf()<this.o.startDate||t.valueOf()>this.o.endDate||e.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled)!==-1)&&n.push("ai1ec-disabled"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&n.push("ai1ec-range"),e.inArray(t.valueOf(),this.range)!=-1&&n.push("ai1ec-selected")),n},fill:function(){var t=new Date(this.viewDate),n=t.getUTCFullYear(),i=t.getUTCMonth(),s=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,o=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,u=this.o.endDate!==Infinity?this.o.endDate.getUTCFullYear():Infinity,a=this.o.endDate!==Infinity?this.o.endDate.getUTCMonth():Infinity,f,l;this.picker.find(".ai1ec-datepicker-days thead th.ai1ec-datepicker-switch").text(d[this.o.language].months[i]+" "+n),this.picker.find("tfoot th.ai1ec-today").text(d[this.o.language].today).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot th.ai1ec-clear").text(d[this.o.language].clear).toggle(this.o.clearBtn!==!1),this.updateNavArrows(),this.fillMonths();var c=r(n,i-1,28),h=v.getDaysInMonth(c.getUTCFullYear(),c.getUTCMonth());c.setUTCDate(h),c.setUTCDate(h-(c.getUTCDay()-this.o.weekStart+7)%7);var p=new Date(c);p.setUTCDate(p.getUTCDate()+42),p=p.valueOf();var m=[],g;while(c.valueOf()<p){if(c.getUTCDay()==this.o.weekStart){m.push("<tr>");if(this.o.calendarWeeks){var y=new Date(+c+(this.o.weekStart-c.getUTCDay()-7)%7*864e5),b=new Date(+y+(11-y.getUTCDay())%7*864e5),w=new Date(+(w=r(b.getUTCFullYear(),0,1))+(11-w.getUTCDay())%7*864e5),E=(b-w)/864e5/7+1;m.push('<td class="ai1ec-cw">'+E+"</td>")}}g=this.getClassNames(c),g.push("ai1ec-day");if(this.o.beforeShowDay!==e.noop){var S=this.o.beforeShowDay(this._utc_to_local(c));S===undefined?S={}:typeof S=="boolean"?S={enabled:S}:typeof S=="string"&&(S={classes:S}),S.enabled===!1&&g.push("ai1ec-disabled"),S.classes&&(g=g.concat(S.classes.split(/\s+/))),S.tooltip&&(f=S.tooltip)}g=e.unique(g),m.push('<td class="'+g.join(" ")+'"'+(f?' title="'+f+'"':"")+">"+c.getUTCDate()+"</td>"),c.getUTCDay()==this.o.weekEnd&&m.push("</tr>"),c.setUTCDate(c.getUTCDate()+1)}this.picker.find(".ai1ec-datepicker-days tbody").empty().append(m.join(""));var x=this.picker.find(".ai1ec-datepicker-months").find("th:eq(1)").text(n).end().find("span").removeClass("ai1ec-active");e.each(this.dates,function(e,t){t.getUTCFullYear()==n&&x.eq(t.getUTCMonth()).addClass("ai1ec-active")}),(n<s||n>u)&&x.addClass("ai1ec-disabled"),n==s&&x.slice(0,o).addClass("ai1ec-disabled"),n==u&&x.slice(a+1).addClass("ai1ec-disabled"),m="",n=parseInt(n/10,10)*10;var T=this.picker.find(".ai1ec-datepicker-years").find("th:eq(1)").text(n+"-"+(n+9)).end().find("td");n-=1;var N=e.map(this.dates,function(e){return e.getUTCFullYear()}),C;for(var k=-1;k<11;k++)C=["ai1ec-year"],k===-1?C.push("ai1ec-old"):k===10&&C.push("ai1ec-new"),e.inArray(n,N)!==-1&&C.push("ai1ec-active"),(n<s||n>u)&&C.push("ai1ec-disabled"),m+='<span class="'+C.join(" ")+'">'+n+"</span>",n+=1;T.html(m)},updateNavArrows:function(){if(!this._allow_update)return;var e=new Date(this.viewDate),t=e.getUTCFullYear(),n=e.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-Infinity&&t<=this.o.startDate.getUTCFullYear()&&n<=this.o.startDate.getUTCMonth()?this.picker.find(".ai1ec-prev").css({visibility:"hidden"}):this.picker.find(".ai1ec-prev").css({visibility:"visible"}),this.o.endDate!==Infinity&&t>=this.o.endDate.getUTCFullYear()&&n>=this.o.endDate.getUTCMonth()?this.picker.find(".ai1ec-next").css({visibility:"hidden"}):this.picker.find(".ai1ec-next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-Infinity&&t<=this.o.startDate.getUTCFullYear()?this.picker.find(".ai1ec-prev").css({visibility:"hidden"}):this.picker.find(".ai1ec-prev").css({visibility:"visible"}),this.o.endDate!==Infinity&&t>=this.o.endDate.getUTCFullYear()?this.picker.find(".ai1ec-next").css({visibility:"hidden"}):this.picker.find(".ai1ec-next").css({visibility:"visible"})}},click:function(t){t.preventDefault();var n=e(t.target).closest("span, td, th"),i,s,o;if(n.length==1)switch(n[0].nodeName.toLowerCase()){case"th":switch(n[0].className){case"ai1ec-datepicker-switch":this.showMode(1);break;case"ai1ec-prev":case"ai1ec-next":var u=v.modes[this.viewMode].navStep*(n[0].className=="ai1ec-prev"?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,u),this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,u),this.viewMode===1&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"ai1ec-today":var a=new Date;a=r(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0),this.showMode(-2);var f=this.o.todayBtn=="linked"?null:"view";this._setDate(a,f);break;case"ai1ec-clear":var l;this.isInput?l=this.element:this.component&&(l=this.element.find("input")),l&&l.val("").change(),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()}break;case"span":n.is(".ai1ec-disabled")||(this.viewDate.setUTCDate(1),n.is(".ai1ec-month")?(o=1,s=n.parent().find("span").index(n),i=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(s),this._trigger("changeMonth",this.viewDate),this.o.minViewMode===1&&this._setDate(r(i,s,o))):(o=1,s=0,i=parseInt(n.text(),10)||0,this.viewDate.setUTCFullYear(i),this._trigger("changeYear",this.viewDate),this.o.minViewMode===2&&this._setDate(r(i,s,o))),this.showMode(-1),this.fill());break;case"td":n.is(".ai1ec-day")&&!n.is(".ai1ec-disabled")&&(o=parseInt(n.text(),10)||1,i=this.viewDate.getUTCFullYear(),s=this.viewDate.getUTCMonth(),n.is(".ai1ec-old")?s===0?(s=11,i-=1):s-=1:n.is(".ai1ec-new")&&(s==11?(s=0,i+=1):s+=1),this._setDate(r(i,s,o)))}this.picker.is(":visible")&&this._focused_from&&e(this._focused_from).focus(),delete this._focused_from},_toggle_multidate:function(e){var t=this.dates.contains(e);e?t!==-1?this.dates.remove(t):this.dates.push(e):this.dates.clear();if(typeof this.o.multidate=="number")while(this.dates.length>this.o.multidate)this.dates.remove(0)},_setDate:function(e,t){(!t||t=="date")&&this._toggle_multidate(e&&new Date(e));if(!t||t=="view")this.viewDate=e&&new Date(e);this.fill(),this.setValue(),this._trigger("changeDate");var n;this.isInput?n=this.element:this.component&&(n=this.element.find("input")),n&&n.change(),this.o.autoclose&&(!t||t=="date")&&this.hide()},moveMonth:function(e,t){if(!e)return undefined;if(!t)return e;var n=new Date(e.valueOf()),r=n.getUTCDate(),i=n.getUTCMonth(),s=Math.abs(t),o,u;t=t>0?1:-1;if(s==1){u=t==-1?function(){return n.getUTCMonth()==i}:function(){return n.getUTCMonth()!=o},o=i+t,n.setUTCMonth(o);if(o<0||o>11)o=(o+12)%12}else{for(var a=0;a<s;a++)n=this.moveMonth(n,t);o=n.getUTCMonth(),n.setUTCDate(r),u=function(){return o!=n.getUTCMonth()}}while(u())n.setUTCDate(--r),n.setUTCMonth(o);return n},moveYear:function(e,t){return this.moveMonth(e,t*12)},dateWithinRange:function(e){return e>=this.o.startDate&&e<=this.o.endDate},keydown:function(e){if(this.picker.is(":not(:visible)")){e.keyCode==27&&this.show();return}var t=!1,n,r,s,o=this.focusDate||this.viewDate;switch(e.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),e.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;n=e.keyCode==37?-1:1,e.ctrlKey?(r=this.moveYear(this.dates.get(-1)||i(),n),s=this.moveYear(o,n),this._trigger("changeYear",this.viewDate)):e.shiftKey?(r=this.moveMonth(this.dates.get(-1)||i(),n),s=this.moveMonth(o,n),this._trigger("changeMonth",this.viewDate)):(r=new Date(this.dates.get(-1)||i()),r.setUTCDate(r.getUTCDate()+n),s=new Date(o),s.setUTCDate(o.getUTCDate()+n)),this.dateWithinRange(r)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),e.preventDefault());break;case 38:case 40:if(!this.o.keyboardNavigation)break;n=e.keyCode==38?-1:1,e.ctrlKey?(r=this.moveYear(this.dates.get(-1)||i(),n),s=this.moveYear(o,n),this._trigger("changeYear",this.viewDate)):e.shiftKey?(r=this.moveMonth(this.dates.get(-1)||i(),n),s=this.moveMonth(o,n),this._trigger("changeMonth",this.viewDate)):(r=new Date(this.dates.get(-1)||i()),r.setUTCDate(r.getUTCDate()+n*7),s=new Date(o),s.setUTCDate(o.getUTCDate()+n*7)),this.dateWithinRange(r)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),e.preventDefault());break;case 32:break;case 13:o=this.focusDate||this.dates.get(-1)||this.viewDate,this._toggle_multidate(o),t=!0,this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(e.preventDefault(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}if(t){this.dates.length?this._trigger("changeDate"):this._trigger("clearDate");var u;this.isInput?u=this.element:this.component&&(u=this.element.find("input")),u&&u.change()}},showMode:function(e){e&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+e))),this.picker.find(">div").hide().filter(".ai1ec-datepicker-"+v.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}};var a=function(t,n){this.element=e(t),this.inputs=e.map(n.inputs,function(e){return e.jquery?e[0]:e}),delete n.inputs,e(this.inputs).datepicker(n).bind("changeDate",e.proxy(this.dateUpdated,this)),this.pickers=e.map(this.inputs,function(t){return e(t).data("datepicker")}),this.updateDates()};a.prototype={updateDates:function(){this.dates=e.map(this.pickers,function(e){return e.getUTCDate()}),this.updateRanges()},updateRanges:function(){var t=e.map(this.dates,function(e){return e.valueOf()});e.each(this.pickers,function(e,n){n.setRange(t)})},dateUpdated:function(t){if(this.updating)return;this.updating=!0;var n=e(t.target).data("datepicker"),r=n.getUTCDate(),i=e.inArray(t.target,this.inputs),s=this.inputs.length;if(i==-1)return;e.each(this.pickers,function(e,t){t.getUTCDate()||t.setUTCDate(r)});if(r<this.dates[i])while(i>=0&&r<this.dates[i])this.pickers[i--].setUTCDate(r);else if(r>this.dates[i])while(i<s&&r>this.dates[i])this.pickers[i++].setUTCDate(r);this.updateDates(),delete this.updating},remove:function(){e.map(this.pickers,function(e){e.remove()}),delete this.element.data().datepicker}};var c=e.fn.datepicker;e.fn.datepicker=function(t){var n=Array.apply(null,arguments);n.shift();var r;return this.each(function(){var i=e(this),s=i.data("datepicker"),o=typeof t=="object"&&t;if(!s){var c=f(this,"date"),p=e.extend({},h,c,o),d=l(p.language),v=e.extend({},h,d,c,o);if(i.is(".ai1ec-input-daterange")||v.inputs){var m={inputs:v.inputs||i.find("input").toArray()};i.data("datepicker",s=new a(this,e.extend(v,m)))}else i.data("datepicker",s=new u(this,v))}if(typeof t=="string"&&typeof s[t]=="function"){r=s[t].apply(s,n);if(r!==undefined)return!1}}),r!==undefined?r:this};var h=e.fn.datepicker.defaults={autoclose:!1,beforeShowDay:e.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:Infinity,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-Infinity,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0},p=e.fn.datepicker.locale_opts=["format","rtl","weekStart"];e.fn.datepicker.Constructor=u;var d=e.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"}},v={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(e){return e%4===0&&e%100!==0||e%400===0},getDaysInMonth:function(e,t){return[31,v.isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(e){var t=e.replace(this.validParts,"\0").split("\0"),n=e.match(this.validParts);if(!t||!t.length||!n||n.length===0)throw new Error("Invalid date format.");return{separators:t,parts:n}},parseDate:function(t,n,i){if(!t)return undefined;if(t instanceof Date)return t;typeof n=="string"&&(n=v.parseFormat(n));if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(t)){var s=/([\-+]\d+)([dmwy])/,o=t.match(/([\-+]\d+)([dmwy])/g),a,f;t=new Date;for(var l=0;l<o.length;l++){a=s.exec(o[l]),f=parseInt(a[1]);switch(a[2]){case"d":t.setUTCDate(t.getUTCDate()+f);break;case"m":t=u.prototype.moveMonth.call(u.prototype,t,f);break;case"w":t.setUTCDate(t.getUTCDate()+f*7);break;case"y":t=u.prototype.moveYear.call(u.prototype,t,f)}}return r(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),0,0,0)}var o=t&&t.match(this.nonpunctuation)||[],t=new Date,c={},h=["yyyy","yy","M","MM","m","mm","d","dd"],p={yyyy:function(e,t){return e.setUTCFullYear(t)},yy:function(e,t){return e.setUTCFullYear(2e3+t)},m:function(e,t){if(isNaN(e))return e;t-=1;while(t<0)t+=12;t%=12,e.setUTCMonth(t);while(e.getUTCMonth()!=t)e.setUTCDate(e.getUTCDate()-1);return e},d:function(e,t){return e.setUTCDate(t)}},m,g,a;p.M=p.MM=p.mm=p.m,p.dd=p.d,t=r(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0);var y=n.parts.slice();o.length!=y.length&&(y=e(y).filter(function(t,n){return e.inArray(n,h)!==-1}).toArray());if(o.length==y.length){for(var l=0,b=y.length;l<b;l++){m=parseInt(o[l],10),a=y[l];if(isNaN(m))switch(a){case"MM":g=e(d[i].months).filter(function(){var e=this.slice(0,o[l].length),t=o[l].slice(0,e.length);return e==t}),m=e.inArray(g[0],d[i].months)+1;break;case"M":g=e(d[i].monthsShort).filter(function(){var e=this.slice(0,o[l].length),t=o[l].slice(0,e.length);return e==t}),m=e.inArray(g[0],d[i].monthsShort)+1}c[a]=m}for(var l=0,w,E;l<h.length;l++)E=h[l],E in c&&!isNaN(c[E])&&(w=new Date(t),p[E](w,c[E]),isNaN(w)||(t=w))}return t},formatDate:function(t,n,r){if(!t)return"";typeof n=="string"&&(n=v.parseFormat(n));var i={d:t.getUTCDate(),D:d[r].daysShort[t.getUTCDay()],DD:d[r].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:d[r].monthsShort[t.getUTCMonth()],MM:d[r].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()};i.dd=(i.d<10?"0":"")+i.d,i.mm=(i.m<10?"0":"")+i.m;var t=[],s=e.extend([],n.separators);for(var o=0,u=n.parts.length;o<=u;o++)s.length&&t.push(s.shift()),t.push(i[n.parts[o]]);return t.join("")},headTemplate:'<thead><tr><th class="ai1ec-prev"><i class="ai1ec-fa ai1ec-fa-arrow-left"></i></th><th colspan="5" class="ai1ec-datepicker-switch"></th><th class="ai1ec-next"><i class="ai1ec-fa ai1ec-fa-arrow-right"></i></th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="ai1ec-today"></th></tr><tr><th colspan="7" class="ai1ec-clear"></th></tr></tfoot>'};v.template='<div class="ai1ec-datepicker"><div class="ai1ec-datepicker-days"><table class=" ai1ec-table-condensed">'+v.headTemplate+"<tbody></tbody>"+v.footTemplate+"</table>"+"</div>"+'<div class="ai1ec-datepicker-months">'+'<table class="ai1ec-table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table>"+"</div>"+'<div class="ai1ec-datepicker-years">'+'<table class="ai1ec-table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table>"+"</div>"+"</div>",e.fn.datepicker.DPGlobal=v,e.fn.datepicker.noConflict=function(){return e.fn.datepicker=c,this},e(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var n=e(this);if(n.data("datepicker"))return;t.preventDefault(),n.datepicker("show")}),e(function(){e('[data-provide="datepicker-inline"]').datepicker()});for(var m=2,g=arguments.length;m<g;m++)arguments[m].localize()}),timely.define("external_libs/bootstrap/alert",["jquery_timely"],function(e){var t='[data-dismiss="ai1ec-alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed.bs.alert").remove()}var n=e(this),r=n.attr("data-target");r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));var i=e(r);t&&t.preventDefault(),i.length||(i=n.hasClass("ai1ec-alert")?n:n.parent()),i.trigger(t=e.Event("close.bs.alert"));if(t.isDefaultPrevented())return;i.removeClass("ai1ec-in"),e.support.transition&&i.hasClass("ai1ec-fade")?i.one(e.support.transition.end,s).emulateTransitionEnd(150):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("bs.alert");i||r.data("bs.alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.bs.alert.data-api",t,n.prototype.close)}),timely.define("external_libs/jquery_cookie",["jquery_timely"],function(e){function n(e){return u.raw?e:encodeURIComponent(e)}function r(e){return u.raw?e:decodeURIComponent(e)}function i(e){return n(u.json?JSON.stringify(e):String(e))}function s(e){e.indexOf('"')===0&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(t," ")),u.json?JSON.parse(e):e}catch(n){}}function o(t,n){var r=u.raw?t:s(t);return e.isFunction(n)?n(r):r}var t=/\+/g,u=e.cookie=function(t,s,a){if(s!==undefined&&!e.isFunction(s)){a=e.extend({},u.defaults,a);if(typeof a.expires=="number"){var f=a.expires,l=a.expires=new Date;l.setTime(+l+f*864e5)}return document.cookie=[n(t),"=",i(s),a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+a.domain:"",a.secure?"; secure":""].join("")}var c=t?undefined:{},h=document.cookie?document.cookie.split("; "):[];for(var p=0,d=h.length;p<d;p++){var v=h[p].split("="),m=r(v.shift()),g=v.join("=");if(t&&t===m){c=o(g,s);break}!t&&(g=o(g))!==undefined&&(c[m]=g)}return c};u.defaults={},e.removeCookie=function(t,n){return e.cookie(t)===undefined?!1:(e.cookie(t,"",e.extend({},n,{expires:-1})),!e.cookie(t))}}),timely.define("scripts/calendar/load_views",["jquery_timely","scripts/calendar/print","scripts/calendar/agenda_view","scripts/calendar/month_view","libs/frontend_utils","libs/utils","ai1ec_calendar","ai1ec_config","scripts/common_scripts/frontend/common_frontend","libs/select2_multiselect_helper","external_libs/jquery_history","external_libs/jquery.tablescroller","external_libs/jquery.scrollTo","external_libs/bootstrap_datepicker","external_libs/bootstrap/alert","external_libs/jquery_cookie"],function(e,t,n,r,i,s,o,u,a,f){e.cookie.json=!0;var l="ai1ec_saved_filter",c=!e("#save_filtered_views").hasClass("ai1ec-hide"),h=function(){var t=e("#ai1ec-view-dropdown .ai1ec-dropdown-menu .ai1ec-active a"),n=u.week_view_ends_at-u.week_view_starts_at,i=n*60;e("table.ai1ec-week-view-original").tableScroll({height:i,containerClass:"ai1ec-week-view ai1ec-popover-boundary",scroll:!1}),e("table.ai1ec-oneday-view-original").tableScroll({height:i,containerClass:"ai1ec-oneday-view ai1ec-popover-boundary",scroll:!1});if(e(".ai1ec-week-view").length||e(".ai1ec-oneday-view").length)e(".ai1ec-oneday-view .tablescroll_wrapper, .ai1ec-week-view .tablescroll_wrapper").scrollTo(".ai1ec-hour-marker:eq("+u.week_view_starts_at+")"),e(".ai1ec-hour-marker:eq("+u.week_view_starts_at+")").addClass("ai1ec-first-visible");e(".ai1ec-month-view .ai1ec-multiday").length&&r.extend_multiday_events(),e("#ai1ec-calendar-view-container").trigger("initialize_view.ai1ec")},p=function(){e("#ai1ec-calendar-view-container").trigger("destroy_view.ai1ec");var t=e(".ai1ec-minical-trigger").data("datepicker");typeof t!="undefined"&&(t.picker.remove(),e(document).off("changeDate",".ai1ec-minical-trigger")),e(".ai1ec-tooltip.ai1ec-in, .ai1ec-popup").remove()},d=function(){var t=[],n=[],r=[],i;e(".ai1ec-category-filter .ai1ec-dropdown-menu .ai1ec-active").each(function(){t.push(e(this).data("term"))}),e(".ai1ec-tag-filter .ai1ec-dropdown-menu .ai1ec-active").each(function(){n.push(e(this).data("term"))}),e(".ai1ec-author-filter .ai1ec-dropdown-menu .ai1ec-active").each(function(){r.push(e(this).data("term"))});var s={};return s.cat_ids=t,s.tag_ids=n,s.auth_ids=r,i=e(".ai1ec-views-dropdown .ai1ec-dropdown-menu .ai1ec-active").data("action"),s.action=i,s},v=function(){var t=History.getState(),n=e.cookie(l);if(null===n||undefined===n)n={};var r=d();u.is_calendar_page?n.calendar_page=r:n[t.url]=r,e.cookie(l,n,{path:"/",expires:365}),e("#save_filtered_views").addClass("ai1ec-active").attr("data-original-title",u.clear_saved_filter_text);var i=s.make_alert(u.save_filter_text_ok,"success");e("#ai1ec-calendar").prepend(i)},m=function(t){t.stopImmediatePropagation();var n=e.cookie(l);if(u.is_calendar_page)delete n.calendar_page;else{var r=History.getState();delete n[r.url]}e.cookie(l,n,{path:"/",expires:365}),e("#save_filtered_views").removeClass("ai1ec-active").attr("data-original-title",u.reset_saved_filter_text),c||e("#save_filtered_views").addClass("ai1ec-hide");var i=s.make_alert(u.remove_filter_text_ok,"success");e("#ai1ec-calendar").prepend(i)},g=function(t,n){e("#ai1ec-calendar-view-loading").fadeIn("fast"),e("#ai1ec-calendar-view").fadeTo("fast",.3,function(){var r={request_type:n,ai1ec_doing_ajax:!0};e.ajax({url:t,dataType:n,data:r,method:"get",success:function(t){p(),typeof t.views_dropdown=="string"&&e(".ai1ec-views-dropdown").replaceWith(t.views_dropdown),typeof t.categories=="string"&&(e(".ai1ec-category-filter").replaceWith(t.categories),u.use_select2&&f.init(e(".ai1ec-category-filter"))),typeof t.authors=="string"&&(e(".ai1ec-author-filter").replaceWith(t.authors),u.use_select2&&f.init(e(".ai1ec-author-filter"))),typeof t.tags=="string"&&(e(".ai1ec-tag-filter").replaceWith(t.tags),u.use_select2&&f.init(e(".ai1ec-tag-filter"))),typeof t.subscribe_buttons=="string"&&e(".ai1ec-subscribe-container").replaceWith(t.subscribe_buttons),typeof t.save_view_btngroup=="string"&&e("#save_filtered_views").closest(".ai1ec-btn-group").replaceWith(t.save_view_btngroup),c=t.are_filters_set;var n=e("#ai1ec-calendar-view-container");n.height(n.height());var r=e("#ai1ec-calendar-view").html(t.html).height();n.animate({height:r},{complete:function(){n.height("auto")}}),e("#ai1ec-calendar-view-loading").fadeOut("fast"),e("#ai1ec-calendar-view").fadeTo("fast",1),h()}})})},y=!1,b=function(e){var t=History.getState();if(t.data.ai1ec!==undefined&&!0===t.data.ai1ec||!0===y)y=!0,g(t.url,"json")},w=function(e,t){if(e==="json"){var n={ai1ec:!0};History.pushState(n,document.title,t)}else g(t,"jsonp")},E=function(t){var n=e(this);t.preventDefault(),w(n.data("type"),n.attr("href"))},S=function(t){var n=e(this);t.preventDefault();if(typeof n.data("datepicker")=="undefined"){n.datepicker({todayBtn:"linked",todayHighlight:!0});var r=n.data("datepicker");r.picker.addClass("ai1ec-right-aligned");var i=r.place;r.place=function(){i.call(this);var t=this.component?this.component:this.element,n=t.offset();this.picker.css({left:"auto",right:e(document).width()-n.left-t.outerWidth()})},e(document).on("changeDate",".ai1ec-minical-trigger",x)}n.datepicker("show")},x=function(t){var n,r=e(this),i;r.datepicker("hide"),n=r.data("href"),i=t.format(),i=i.replace(/\//g,"-"),n=n.replace("__DATE__",i),w(r.data("type"),n)},T=function(t){var n;typeof t.added!="undefined"?n=e(t.added.element).data("href"):n=e("option[value="+t.removed.id+"]",t.target).data("href"),data={ai1ec:!0},History.pushState(data,null,n)},N=function(){w(e(this).data("type"),e(this).data("href"))};return{initialize_view:h,handle_click_on_link_to_load_view:E,handle_minical_trigger:S,handle_minical_change_date:x,clear_filters:N,handle_state_change:b,load_view:g,save_current_filter:v,remove_current_filter:m,load_view_from_select2_filter:T,load_view_according_to_datatype:w}}),timely.define("external_libs/bootstrap/transition",["jquery_timely"],function(e){function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(e.style[n]!==undefined)return{end:t[n]}}e.fn.emulateTransitionEnd=function(t){var n=!1,r=this;e(this).one(e.support.transition.end,function(){n=!0});var i=function(){n||e(r).trigger(e.support.transition.end)};return setTimeout(i,t),this},e(function(){e.support.transition=t()})}),timely.define("external_libs/bootstrap/modal",["jquery_timely"],function(e){var t=function(t,n){this.options=n,this.$element=e(t),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.load(this.options.remote)};t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},t.prototype.toggle=function(e){return this[this.isShown?"hide":"show"](e)},t.prototype.show=function(t){var n=this,r=e.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(r);if(this.isShown||r.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.$element.on("click.dismiss.modal",'[data-dismiss="ai1ec-modal"]',e.proxy(this.hide,this)),this.backdrop(function(){var r=e.support.transition&&n.$element.hasClass("ai1ec-fade");n.$element.parent().length||n.$element.appendTo(document.body),n.$element.show(),r&&n.$element[0].offsetWidth,n.$element.addClass("ai1ec-in").attr("aria-hidden",!1),n.enforceFocus();var i=e.Event("shown.bs.modal",{relatedTarget:t});r?n.$element.find(".ai1ec-modal-dialog").one(e.support.transition.end,function(){n.$element.focus().trigger(i)}).emulateTransitionEnd(300):n.$element.focus().trigger(i)})},t.prototype.hide=function(t){t&&t.preventDefault(),t=e.Event("hide.bs.modal"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.bs.modal"),this.$element.removeClass("ai1ec-in").attr("aria-hidden",!0).off("click.dismiss.modal"),e.support.transition&&this.$element.hasClass("ai1ec-fade")?this.$element.one(e.support.transition.end,e.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()},t.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){this.$element[0]!==e.target&&!this.$element.has(e.target).length&&this.$element.focus()},this))},t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",e.proxy(function(e){e.which==27&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},t.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden.bs.modal")})},t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},t.prototype.backdrop=function(t){var n=this,r=this.$element.hasClass("ai1ec-fade")?"ai1ec-fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="ai1ec-modal-backdrop '+r+'" />').appendTo(document.body),this.$element.on("click.dismiss.modal",e.proxy(function(e){if(e.target!==e.currentTarget)return;this.options.backdrop=="static"?this.$element[0].focus.call(this.$element[0]):this.hide.call(this)},this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("ai1ec-in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("ai1ec-in"),e.support.transition&&this.$element.hasClass("ai1ec-fade")?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()):t&&t()};var n=e.fn.modal;e.fn.modal=function(n,r){return this.each(function(){var i=e(this),s=i.data("bs.modal"),o=e.extend({},t.DEFAULTS,i.data(),typeof n=="object"&&n);s||i.data("bs.modal",s=new t(this,o)),typeof n=="string"?s[n](r):o.show&&s.show(r)})},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.bs.modal.data-api",'[data-toggle="ai1ec-modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s,this).one("hide",function(){n.is(":visible")&&n.focus()})}),e(document).on("show.bs.modal",".ai1ec-modal",function(){e(document.body).addClass("ai1ec-modal-open")}).on("hidden.bs.modal",".ai1ec-modal",function(){e(document.body).removeClass("ai1ec-modal-open")})}),timely.define("scripts/calendar",["jquery_timely","scripts/calendar/load_views","scripts/calendar/print","scripts/calendar/agenda_view","scripts/calendar/month_view","ai1ec_calendar","ai1ec_config","scripts/common_scripts/frontend/common_frontend","libs/utils","libs/select2_multiselect_helper","external_libs/bootstrap/transition","external_libs/bootstrap/modal","external_libs/jquery.scrollTo","external_libs/jquery_cookie"],function(e,t,n,r,i,s,o,u,a,f){var l=function(){if(s.selector!==undefined&&s.selector!==""&&e(s.selector).length===1){var t=e(":header:contains("+s.title+"):first");t.length||(t=e('<h1 class="page-title"></h1>'),t.text(s.title));var n=e("#ai1ec-container").detach().before(t);e(s.selector).empty().append(n).hide().css("visibility","visible").fadeIn("fast")}},c=function(){var t=e(this).data("instanceId");e(".ai1ec-event-instance-id-"+t).addClass("ai1ec-hover")},h=function(){var t=e(this).data("instanceId");e(".ai1ec-event-instance-id-"+t).removeClass("ai1ec-hover")},p=function(){var t=e(this),n=t.data("instanceId");t.delay(500).queue(function(){e(".ai1ec-event-instance-id-"+n).addClass("ai1ec-raised")})},d=function(t){var n=e(this),r=n.data("instanceId"),i=e(t.toElement||t.relatedTarget);if(i.is(".ai1ec-event-instance-id-"+r)||i.parent().is(".ai1ec-event-instance-id-"+r))return;e(".ai1ec-event-instance-id-"+r).clearQueue().removeClass("ai1ec-raised")},v=function(){l()},m=function(){e(document).on({mouseenter:c,mouseleave:h},".ai1ec-event-container.ai1ec-multiday"),e(document).on({mouseenter:p,mouseleave:d},".ai1ec-oneday-view .ai1ec-oneday .ai1ec-event-container, .ai1ec-week-view .ai1ec-week .ai1ec-event-container"),e(document).on("click",".ai1ec-agenda-view .ai1ec-event-header",r.toggle_event),e(document).on("click","#ai1ec-agenda-expand-all",r.expand_all),e(document).on("click","#ai1ec-agenda-collapse-all",r.collapse_all),e(document).on("click","a.ai1ec-load-view",t.handle_click_on_link_to_load_view),e(document).on("click",".ai1ec-minical-trigger",t.handle_minical_trigger),e(document).on("click",".ai1ec-clear-filter",t.clear_filters),e(document).on("click","#ai1ec-print-button",n.handle_click_on_print_button),e(document).on("click",".ai1ec-reveal-full-day button",function(){e(this).fadeOut();var t=e(".ai1ec-oneday-view-original"),n=e(".ai1ec-week-view-original");n.length===0&&(n=t);var r=e(".tablescroll_wrapper").offset().top-n.offset().top;e(window).scrollTo("+="+r+"px",400);var i=1440;e(".tablescroll_wrapper").animate({height:i+"px"})}),History.Adapter.bind(window,"statechange",t.handle_state_change),e(document).on("click","#ai1ec-calendar-view .ai1ec-load-event",function(t){t.preventDefault(),e.cookie.raw=!1,e.cookie("ai1ec_calendar_url",document.URL),window.location.href=this.href})},g=function(){f.init(e(".ai1ec-select2-filters")),e(document).on("change",".ai1ec-select2-multiselect-selector",t.load_view_from_select2_filter)},y=function(){e(document).on("page_ready.ai1ec",function(){v(),o.use_select2&&g(),m(),t.initialize_view()})};return{start:y}}),timely.require(["scripts/calendar"],function(e){e.start()}),timely.define("pages/calendar",function(){});
304
  * limitations under the License.
305
  * ======================================================================== */
306
 
307
+ timely.define("scripts/calendar/print",["jquery_timely"],function(e){var t=function(t){t.preventDefault();var n=e("body"),r=e("html"),i=e("#ai1ec-container").html(),s=n.html();s=s.replace(/<script.*?>([\s\S]*?)<\/script>/gmi,""),n.empty(),n.addClass("timely"),r.addClass("ai1ec-print"),n.html(i),e("span").click(function(){return!1}),window.print(),n.removeClass("timely"),r.removeClass("ai1ec-print"),n.html(s)};return{handle_click_on_print_button:t}}),timely.define("scripts/calendar/agenda_view",["jquery_timely"],function(e){var t=function(){e(this).closest(".ai1ec-event").toggleClass("ai1ec-expanded").find(".ai1ec-event-summary").slideToggle(300)},n=function(){e(".ai1ec-expanded .ai1ec-event-toggle").click()},r=function(){e(".ai1ec-event:not(.ai1ec-expanded) .ai1ec-event-toggle").click()};return{toggle_event:t,collapse_all:n,expand_all:r}}),timely.define("external_libs/modernizr",[],function(){var e=function(e,t,n){function S(e){f.cssText=e}function x(e,t){return S(h.join(e+";")+(t||""))}function T(e,t){return typeof e===t}function N(e,t){return!!~(""+e).indexOf(t)}function C(e,t,r){for(var i in e){var s=t[e[i]];if(s!==n)return r===!1?e[i]:T(s,"function")?s.bind(r||t):s}return!1}var r="2.5.3",i={},s=!0,o=t.documentElement,u="modernizr",a=t.createElement(u),f=a.style,l,c={}.toString,h=" -webkit- -moz- -o- -ms- ".split(" "),p={},d={},v={},m=[],g=m.slice,y,b=function(e,n,r,i){var s,a,f,l=t.createElement("div"),c=t.body,h=c?c:t.createElement("body");if(parseInt(r,10))while(r--)f=t.createElement("div"),f.id=i?i[r]:u+(r+1),l.appendChild(f);return s=["&#173;","<style>",e,"</style>"].join(""),l.id=u,(c?l:h).innerHTML+=s,h.appendChild(l),c||(h.style.background="",o.appendChild(h)),a=n(l,e),c?l.parentNode.removeChild(l):h.parentNode.removeChild(h),!!a},w={}.hasOwnProperty,E;!T(w,"undefined")&&!T(w.call,"undefined")?E=function(e,t){return w.call(e,t)}:E=function(e,t){return t in e&&T(e.constructor.prototype[t],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if(typeof n!="function")throw new TypeError;var r=g.call(arguments,1),i=function(){if(this instanceof i){var e=function(){};e.prototype=n.prototype;var s=new e,o=n.apply(s,r.concat(g.call(arguments)));return Object(o)===o?o:s}return n.apply(t,r.concat(g.call(arguments)))};return i});var k=function(n,r){var s=n.join(""),o=r.length;b(s,function(n,r){var s=t.styleSheets[t.styleSheets.length-1],u=s?s.cssRules&&s.cssRules[0]?s.cssRules[0].cssText:s.cssText||"":"",a=n.childNodes,f={};while(o--)f[a[o].id]=a[o];i.touch="ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch||(f.touch&&f.touch.offsetTop)===9},o,r)}([,["@media (",h.join("touch-enabled),("),u,")","{#touch{top:9px;position:absolute}}"].join("")],[,"touch"]);p.touch=function(){return i.touch};for(var L in p)E(p,L)&&(y=L.toLowerCase(),i[y]=p[L](),m.push((i[y]?"":"no-")+y));return S(""),a=l=null,i._version=r,i._prefixes=h,i.testStyles=b,o.className=o.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(s?" js "+m.join(" "):""),i}(window,window.document);return e}),timely.define("scripts/calendar/month_view",["jquery_timely","external_libs/modernizr"],function(e,t){var n=navigator.userAgent.match(/opera/i),r=navigator.userAgent.match(/webkit/i),i=function(){var t=e(".ai1ec-day"),n=e(".ai1ec-week:first .ai1ec-day").length;e(".ai1ec-month-view .ai1ec-multiday").each(function(){var n=this.parentNode,r=e(this).outerHeight(!0),i=parseInt(e(this).data("endDay"),10),u=e(".ai1ec-date",n),a=parseInt(u.text(),10),f=e(this).data("endTruncated");f&&(i=parseInt(e(t[t.length-1]).text(),10));var l=e(this),c=e(".ai1ec-event",l)[0].style.backgroundColor,h=0,p=i-a+1,d=p,v,m=0;t.each(function(t){var n=e(".ai1ec-date",this),r=e(this.parentNode),u=r.index(),f=parseInt(n.text(),10);if(f>=a&&f<=i){f===a&&(v=parseInt(n.css("marginBottom"),10)+16),h===0&&m++;if(u===0&&f>a&&d!==0){var p=l.next(".ai1ec-popup").andSelf().clone(!1);n.parent().append(p);var g=p.first();g.addClass("ai1ec-multiday-bar ai1ec-multiday-clone"),g.css({position:"absolute",left:"1px",top:parseInt(n.css("marginBottom"),10)+13,backgroundColor:c});var y=d>7?7:d;g.css("width",s(y)),d>7&&g.append(o(1,c)),g.append(o(2,c))}h===0?n.css({marginBottom:v+"px"}):n.css({marginBottom:"+=16px"}),d--,d>0&&u===6&&h++}});if(f){var g=e("."+l[0].className.replace(/\s+/igm,".")).last();g.append(o(1,c))}e(this).css({position:"absolute",top:u.outerHeight(!0)-r-1+"px",left:"1px",width:s(m)}),h>0&&e(this).append(o(1,c)),e(this).data("startTruncated")&&e(this).append(o(2,c)).addClass("ai1ec-multiday-bar")})},s=function(e){var t;switch(e){case 1:t=97.5;break;case 2:t=198.7;break;case 3:t=300;break;case 4:t=401;break;case 5:r||n?t=507:t=503.4;break;case 6:r||n?t=608:t=603.5;break;case 7:r||n?t=709:t=705}return t+"%"},o=function(t,n){var r=e('<div class="ai1ec-multiday-arrow'+t+'"></div>');return t===1?r.css({borderLeftColor:n}):r.css({borderTopColor:n,borderRightColor:n,borderBottomColor:n}),r};return{extend_multiday_events:i}}),timely.define("libs/frontend_utils",[],function(){var e=function(e){var t,n;t=function(e){if(/&[^;]+;/.test(e)){var t=document.createElement("div");return t.innerHTML=e,t.firstChild?t.firstChild.nodeValue:e}return e};if(typeof e=="string")return t(e);if(typeof e=="object")for(n in e)typeof e[n]=="string"&&(e[n]=t(e[n]));return e},t=function(e,t,n){var r,i,s,o,u;if("#"===e.charAt(0)||"?"===e.charAt(0))e=e.substring(1);r={},e=e.split(t);for(i=0;i<e.length;i++)o=e[i].trim(),-1!==(u=o.indexOf(n))?(s=o.substring(0,u).trim(),o=o.substring(u+1).trim()):(s=o,o=!0),r[s]=o;return r},n=function(e){var n,r,i,s,o;e=t(e,"&","="),i=Object.keys(e),n={ai1ec:{},action:"month"};for(r=0;r<i.length;r++)if("ai1ec"===i[r]){var u=t(e[i[r]],"|",":");for(s in u)if(""!==u[s]){if("action"===s||"view"===s)n.action=u[s];n.ai1ec[s]=u[s]}}else"ai1ec_"===i[r].substring(0,6)?n.ai1ec[i[r].substring(6)]=e[i[r]]:n[i[r]]=e[i[r]];"ai1ec_"!==n.action.substring(0,6)&&(n.action="ai1ec_"+n.action),o="action="+n.action+"&ai1ec=";for(s in n.ai1ec)n.ai1ec.hasOwnProperty(s)&&(o+=escape(s)+":"+escape(n.ai1ec[s])+"|");o=o.substring(0,o.length-1);for(s in n)"ai1ec"!==s&&"action"!==s&&(o+="&"+s+"="+escape(n[s]));return o};return{ai1ec_convert_entities:e,ai1ec_map_internal_query:n,ai1ec_tokenize_uri:t}}),timely.define("external_libs/bootstrap/tab",["jquery_timely"],function(e){var t=function(t){this.element=e(t)};t.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.ai1ec-dropdown-menu)"),r=t.data("target");r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("ai1ec-active"))return;var i=n.find(".ai1ec-active:last a")[0],s=e.Event("show.bs.tab",{relatedTarget:i});t.trigger(s);if(s.isDefaultPrevented())return;var o=e(r);this.activate(t.parent("li"),n),this.activate(o,o.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:i})})},t.prototype.activate=function(t,n,r){function o(){i.removeClass("ai1ec-active").find("> .ai1ec-dropdown-menu > .ai1ec-active").removeClass("ai1ec-active"),t.addClass("ai1ec-active"),s?(t[0].offsetWidth,t.addClass("ai1ec-in")):t.removeClass("ai1ec-fade"),t.parent(".ai1ec-dropdown-menu")&&t.closest("li.ai1ec-dropdown").addClass("ai1ec-active"),r&&r()}var i=n.find("> .ai1ec-active"),s=r&&e.support.transition&&i.hasClass("ai1ec-fade");s?i.one(e.support.transition.end,o).emulateTransitionEnd(150):o(),i.removeClass("ai1ec-in")};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tab");i||r.data("bs.tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.bs.tab.data-api",'[data-toggle="ai1ec-tab"], [data-toggle="ai1ec-pill"]',function(t){t.preventDefault(),e(this).tab("show")})}),timely.define("libs/utils",["jquery_timely","external_libs/bootstrap/tab"],function(e){var t=function(){return{is_float:function(e){return!isNaN(parseFloat(e))},is_valid_coordinate:function(e,t){var n=t?90:180;return this.is_float(e)&&Math.abs(e)<n},convert_comma_to_dot:function(e){return e.replace(",",".")},field_has_value:function(t){var n="#"+t,r=e(n),i=!1;return r.length===1&&(i=e.trim(r.val())!==""),i},make_alert:function(t,n,r){var i="";switch(n){case"error":i="ai1ec-alert ai1ec-alert-danger";break;case"success":i="ai1ec-alert ai1ec-alert-success";break;default:i="ai1ec-alert"}var s=e("<div />",{"class":i,html:t});if(!r){var o=e("<button>",{type:"button","class":"ai1ec-close","data-dismiss":"ai1ec-alert",text:"×"});s.prepend(o)}return s},get_ajax_url:function(){return typeof window.ajaxurl=="undefined"?"http://localhost/wordpress/wp-admin/admin-ajax.php":window.ajaxurl},isUrl:function(e){var t=/(http|https|webcal):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(e)},isValidEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)},activate_saved_tab_on_page_load:function(t){null===t||undefined===t?e("ul.ai1ec-nav a:first").tab("show"):e("ul.ai1ec-nav a[href="+t+"]").tab("show")}}}();return t}),timely.define("domReady",[],function(){function u(e){var t;for(t=0;t<e.length;t++)e[t](n)}function a(){var e=r;t&&e.length&&(r=[],u(e))}function f(){t||(t=!0,o&&clearInterval(o),a())}function c(e){return t?e(n):r.push(e),c}var e=typeof window!="undefined"&&window.document,t=!e,n=e?document:null,r=[],i,s,o;if(e){if(document.addEventListener)document.addEventListener("DOMContentLoaded",f,!1),window.addEventListener("load",f,!1);else if(window.attachEvent){window.attachEvent("onload",f),s=document.createElement("div");try{i=window.frameElement===null}catch(l){}s.doScroll&&i&&window.external&&(o=setInterval(function(){try{s.doScroll(),f()}catch(e){}},30))}(document.readyState==="complete"||document.readyState==="interactive")&&f()}return c.version="2.0.0",c.load=function(e,t,n,r){r.isBuild?n(null):c(n)},c}),timely.define("scripts/common_scripts/frontend/common_event_handlers",["jquery_timely"],function(e){var t=function(t){var n=e(this),r=n.next(".ai1ec-popup"),i,s,o;if(r.length===0)return;i=r.html(),s=r.attr("class");var u=n.closest("#ai1ec-calendar-view");u.length===0&&(u=e("body")),n.offset().left-u.offset().left>182?o="left":o="right",n.constrained_popover({content:i,title:"",placement:o,trigger:"manual",html:!0,template:'<div class="timely ai1ec-popover '+s+'">'+'<div class="ai1ec-arrow"></div>'+'<div class="ai1ec-popover-inner">'+'<div class="ai1ec-popover-content"><div></div></div>'+"</div>"+"</div>",container:"body"}).constrained_popover("show")},n=function(t){var n=e(t.toElement||t.relatedTarget);n.closest(".ai1ec-popup").length===0&&e(this).constrained_popover("hide")},r=function(t){var n=e(t.toElement||t.relatedTarget);n.closest(".ai1ec-tooltip").length===0&&(e(this).remove(),e("body > .ai1ec-tooltip").remove())},i=function(t){var n=e(this),r={template:'<div class="timely ai1ec-tooltip"><div class="ai1ec-tooltip-arrow"></div><div class="ai1ec-tooltip-inner"></div></div>',trigger:"manual",container:"body"};if(n.is(".ai1ec-category .ai1ec-color-swatch"))return;n.tooltip(r),n.tooltip("show")},s=function(t){var n=e(t.toElement||t.relatedTarget);n.closest(".ai1ec-tooltip").length===0&&e(this).data("bs.tooltip")&&e(this).tooltip("hide")},o=function(t){var n=e(t.toElement||t.relatedTarget);n.closest(".ai1ec-tooltip-trigger").length===0&&e(this).remove(),n.closest(".ai1ec-popup").length===0&&e("body > .ai1ec-popup").remove()};return{handle_popover_over:t,handle_popover_out:n,handle_popover_self_out:r,handle_tooltip_over:i,handle_tooltip_out:s,handle_tooltip_self_out:o}}),timely.define("external_libs/bootstrap/tooltip",["jquery_timely"],function(e){var t=function(e,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",e,t)};t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="ai1ec-tooltip"><div class="ai1ec-tooltip-arrow"></div><div class="ai1ec-tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},t.prototype.init=function(t,n,r){this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(r);var i=this.options.trigger.split(" ");for(var s=i.length;s--;){var o=i[s];if(o=="click")this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if(o!="manual"){var u=o=="hover"?"mouseenter":"focus",a=o=="hover"?"mouseleave":"blur";this.$element.on(u+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(a+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.getOptions=function(t){return t=e.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},t.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,function(e,r){n[e]!=r&&(t[e]=r)}),t},t.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(n.timeout),n.hoverState="in";if(!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},t.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(n.timeout),n.hoverState="out";if(!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},t.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.tip();this.setContent(),this.options.animation&&n.addClass("ai1ec-fade");var r=typeof this.options.placement=="function"?this.options.placement.call(this,n[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,s=i.test(r);s&&(r=r.replace(i,"")||"top"),n.detach().css({top:0,left:0,display:"block"}).addClass("ai1ec-"+r),this.options.container?n.appendTo(this.options.container):n.insertAfter(this.$element);var o=this.getPosition(),u=n[0].offsetWidth,a=n[0].offsetHeight;if(s){var f=this.$element.parent(),l=r,c=document.documentElement.scrollTop||document.body.scrollTop,h=this.options.container=="body"?window.innerWidth:f.outerWidth(),p=this.options.container=="body"?window.innerHeight:f.outerHeight(),d=this.options.container=="body"?0:f.offset().left;r=r=="bottom"&&o.top+o.height+a-c>p?"top":r=="top"&&o.top-c-a<0?"bottom":r=="right"&&o.right+u>h?"left":r=="left"&&o.left-u<d?"right":r,n.removeClass("ai1ec-"+l).addClass("ai1ec-"+r)}var v=this.getCalculatedOffset(r,o,u,a);this.applyPlacement(v,r),this.$element.trigger("shown.bs."+this.type)}},t.prototype.applyPlacement=function(e,t){var n,r=this.tip(),i=r[0].offsetWidth,s=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),u=parseInt(r.css("margin-left"),10);isNaN(o)&&(o=0),isNaN(u)&&(u=0),e.top=e.top+o,e.left=e.left+u,r.offset(e).addClass("ai1ec-in");var a=r[0].offsetWidth,f=r[0].offsetHeight;t=="top"&&f!=s&&(n=!0,e.top=e.top+s-f);if(/bottom|top/.test(t)){var l=0;e.left<0&&(l=e.left*-2,e.left=0,r.offset(e),a=r[0].offsetWidth,f=r[0].offsetHeight),this.replaceArrow(l-i+a,a,"left")}else this.replaceArrow(f-s,f,"top");n&&r.offset(e)},t.prototype.replaceArrow=function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".ai1ec-tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("ai1ec-fade ai1ec-in ai1ec-top ai1ec-bottom ai1ec-left ai1ec-right")},t.prototype.hide=function(){function i(){t.hoverState!="in"&&n.detach()}var t=this,n=this.tip(),r=e.Event("hide.bs."+this.type);this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("ai1ec-in"),e.support.transition&&this.$tip.hasClass("ai1ec-fade")?n.one(e.support.transition.end,i).emulateTransitionEnd(150):i(),this.$element.trigger("hidden.bs."+this.type),this},t.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},t.prototype.hasContent=function(){return this.getTitle()},t.prototype.getPosition=function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},t.prototype.getCalculatedOffset=function(e,t,n,r){return e=="bottom"?{top:t.top+t.height,left:t.left+t.width/2-n/2}:e=="top"?{top:t.top-r,left:t.left+t.width/2-n/2}:e=="left"?{top:t.top+t.height/2-r/2,left:t.left-n}:{top:t.top+t.height/2-r/2,left:t.left+t.width}},t.prototype.getTitle=function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},t.prototype.tip=function(){return this.$tip=this.$tip||e(this.options.template)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".ai1ec-tooltip-arrow")},t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},t.prototype.enable=function(){this.enabled=!0},t.prototype.disable=function(){this.enabled=!1},t.prototype.toggleEnabled=function(){this.enabled=!this.enabled},t.prototype.toggle=function(t){var n=t?e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;n.tip().hasClass("ai1ec-in")?n.leave(n):n.enter(n)},t.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tooltip"),s=typeof n=="object"&&n;i||r.data("bs.tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}),timely.define("external_libs/bootstrap/popover",["jquery_timely","external_libs/bootstrap/tooltip"],function(e){var t=function(e,t){this.init("popover",e,t)};if(!e.fn.tooltip)throw new Error("Popover requires tooltip.js");t.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="ai1ec-popover"><div class="ai1ec-arrow"></div><h3 class="ai1ec-popover-title"></h3><div class="ai1ec-popover-content"></div></div>'}),t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),t.prototype.constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".ai1ec-popover-title")[this.options.html?"html":"text"](t),e.find(".ai1ec-popover-content")[this.options.html?"html":"text"](n),e.removeClass("ai1ec-fade ai1ec-top ai1ec-bottom ai1ec-left ai1ec-right ai1ec-in"),e.find(".ai1ec-popover-title").html()||e.find(".ai1ec-popover-title").hide()},t.prototype.hasContent=function(){return this.getTitle()||this.getContent()},t.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||(typeof t.content=="function"?t.content.call(e[0]):t.content)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".ai1ec-arrow")},t.prototype.tip=function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip};var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("bs.popover"),s=typeof n=="object"&&n;i||r.data("bs.popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}),timely.define("external_libs/constrained_popover",["jquery_timely","external_libs/bootstrap/popover"],function(e){var t=function(e,t){this.init("constrained_popover",e,t)};t.DEFAULTS=e.extend({},e.fn.popover.Constructor.DEFAULTS,{container:"",content:this.options}),t.prototype=e.extend({},e.fn.popover.Constructor.prototype),t.prototype.constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.applyPlacement=function(t,n){e.fn.popover.Constructor.prototype.applyPlacement.call(this,t,n);var r=this.tip(),i=r[0].offsetWidth,s=r[0].offsetHeight,o=this.getPosition(),u={};switch(n){case"left":newPos=this.defineBounds(o),typeof newPos.top=="undefined"?u.top=o.top+o.height/2-s/2:u.top=newPos.top-s/2,typeof newPos.left=="undefined"?u.left=o.left-i:u.left=newPos.left-i,r.offset(u);break;case"right":newPos=this.defineBounds(o),typeof newPos.top=="undefined"?u.top=o.top+o.height/2-s/2:u.top=newPos.top-s/2,typeof newPos.left=="undefined"?u.left=o.left+o.width:u.left=newPos.left+o.width,r.offset(u)}},t.prototype.defineBounds=function(t){var n,r,i,s,o,u={},a=e(this.options.container);return a.length?(n=a.offset(),r=n.top,i=n.left,s=r+a.height(),o=i+a.width(),t.top+t.height/2<r&&(u.top=r),t.top+t.height/2>s&&(u.top=s),t.left-t.width/2<i&&(u.left=i),t.left-t.width/2>o&&(u.left=o),u):!1};var n=e.fn.popover;e.fn.constrained_popover=function(n){return this.each(function(){var r=e(this),i=r.data("ai1ec.constrained_popover"),s=typeof n=="object"&&n;i||r.data("ai1ec.constrained_popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.constrained_popover.Constructor=t,e.fn.constrained_popover.noConflict=function(){return e.fn.constrained_popover=n,this}}),timely.define("external_libs/bootstrap/dropdown",["jquery_timely"],function(e){function i(){e(t).remove(),e(n).each(function(t){var n=s(e(this));if(!n.hasClass("ai1ec-open"))return;n.trigger(t=e.Event("hide.bs.dropdown"));if(t.isDefaultPrevented())return;n.removeClass("ai1ec-open").trigger("hidden.bs.dropdown")})}function s(t){var n=t.attr("data-target");n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r=n&&e(n);return r&&r.length?r:t.parent()}var t=".ai1ec-dropdown-backdrop",n="[data-toggle=ai1ec-dropdown]",r=function(t){e(t).on("click.bs.dropdown",this.toggle)};r.prototype.toggle=function(t){var n=e(this);if(n.is(".ai1ec-disabled, :disabled"))return;var r=s(n),o=r.hasClass("ai1ec-open");i();if(!o){"ontouchstart"in document.documentElement&&!r.closest(".ai1ec-navbar-nav").length&&e('<div class="ai1ec-dropdown-backdrop"/>').insertAfter(e(this)).on("click",i),r.trigger(t=e.Event("show.bs.dropdown"));if(t.isDefaultPrevented())return;r.toggleClass("ai1ec-open").trigger("shown.bs.dropdown"),n.focus()}return!1},r.prototype.keydown=function(t){if(!/(38|40|27)/.test(t.keyCode))return;var r=e(this);t.preventDefault(),t.stopPropagation();if(r.is(".ai1ec-disabled, :disabled"))return;var i=s(r),o=i.hasClass("ai1ec-open");if(!o||o&&t.keyCode==27)return t.which==27&&i.find(n).focus(),r.click();var u=e("[role=menu] li:not(.ai1ec-divider):visible a",i);if(!u.length)return;var a=u.index(u.filter(":focus"));t.keyCode==38&&a>0&&a--,t.keyCode==40&&a<u.length-1&&a++,~a||(a=0),u.eq(a).focus()};var o=e.fn.dropdown;e.fn.dropdown=function(t){return this.each(function(){var n=e(this),i=n.data("bs.dropdown");i||n.data("bs.dropdown",i=new r(this)),typeof t=="string"&&i[t].call(n)})},e.fn.dropdown.Constructor=r,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=o,this},e(document).on("click.bs.dropdown.data-api",i).on("click.bs.dropdown.data-api",".ai1ec-dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",n,r.prototype.toggle).on("keydown.bs.dropdown.data-api",n+", [role=menu]",r.prototype.keydown)}),timely.define("scripts/common_scripts/frontend/common_frontend",["jquery_timely","domReady","scripts/common_scripts/frontend/common_event_handlers","ai1ec_calendar","external_libs/modernizr","external_libs/bootstrap/tooltip","external_libs/constrained_popover","external_libs/bootstrap/dropdown"],function(e,t,n,r,i){var s=!1,o=function(){s=!0,e(document).on("mouseenter",".ai1ec-popup-trigger",n.handle_popover_over),e(document).on("mouseleave",".ai1ec-popup-trigger",n.handle_popover_out),e(document).on("mouseleave",".ai1ec-popup",n.handle_popover_self_out),e(document).on("mouseenter",".ai1ec-tooltip-trigger",n.handle_tooltip_over),e(document).on("mouseleave",".ai1ec-tooltip-trigger",n.handle_tooltip_out),e(document).on("mouseleave",".ai1ec-tooltip",n.handle_tooltip_self_out)},u=function(){t(function(){o()})},a=function(){return s};return{start:u,are_event_listeners_attached:a}}),timely.define("external_libs/select2",["jquery_timely"],function(e){(function(e){typeof e.fn.each2=="undefined"&&e.fn.extend({each2:function(t){var n=e([0]),r=-1,i=this.length;while(++r<i&&(n.context=n[0]=this[r])&&t.call(n[0],r,n)!==!1);return this}})})(e),function(e,t){function l(e,t){var n=0,r=t.length;for(;n<r;n+=1)if(c(e,t[n]))return n;return-1}function c(e,n){return e===n?!0:e===t||n===t?!1:e===null||n===null?!1:e.constructor===String?e===n+"":n.constructor===String?n===e+"":!1}function h(t,n){var r,i,s;if(t===null||t.length<1)return[];r=t.split(n);for(i=0,s=r.length;i<s;i+=1)r[i]=e.trim(r[i]);return r}function p(e){return e.outerWidth(!1)-e.width()}function d(n){var r="keyup-change-value";n.bind("keydown",function(){e.data(n,r)===t&&e.data(n,r,n.val())}),n.bind("keyup",function(){var i=e.data(n,r);i!==t&&n.val()!==i&&(e.removeData(n,r),n.trigger("keyup-change"))})}function v(n){n.bind("mousemove",function(n){var r=a;(r===t||r.x!==n.pageX||r.y!==n.pageY)&&e(n.target).trigger("mousemove-filtered",n)})}function m(e,n,r){r=r||t;var i;return function(){var t=arguments;window.clearTimeout(i),i=window.setTimeout(function(){n.apply(r,t)},e)}}function g(e){var t=!1,n;return function(){return t===!1&&(n=e(),t=!0),n}}function y(e,t){var n=m(e,function(e){t.trigger("scroll-debounced",e)});t.bind("scroll",function(e){l(e.target,t.get())>=0&&n(e)})}function b(e){if(e[0]===document.activeElement)return;window.setTimeout(function(){var t=e[0],n=e.val().length,r;e.focus(),t.setSelectionRange?t.setSelectionRange(n,n):t.createTextRange&&(r=t.createTextRange(),r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",n),r.select())},0)}function w(e){e.preventDefault(),e.stopPropagation()}function E(e){e.preventDefault(),e.stopImmediatePropagation()}function S(t){if(!u){var n=t[0].currentStyle||window.getComputedStyle(t[0],null);u=e(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:n.fontSize,fontFamily:n.fontFamily,fontStyle:n.fontStyle,fontWeight:n.fontWeight,letterSpacing:n.letterSpacing,textTransform:n.textTransform,whiteSpace:"nowrap"}),u.attr("class","select2-sizer"),e("body").append(u)}return u.text(t.val()),u.width()}function x(t,n,r){var i,s=[],o;i=t.attr("class"),typeof i=="string"&&e(i.split(" ")).each2(function(){this.indexOf("select2-")===0&&s.push(this)}),i=n.attr("class"),typeof i=="string"&&e(i.split(" ")).each2(function(){this.indexOf("select2-")!==0&&(o=r(this),typeof o=="string"&&o.length>0&&s.push(this))}),t.attr("class",s.join(" "))}function T(e,t,n,r){var i=e.toUpperCase().indexOf(t.toUpperCase()),s=t.length;if(i<0){n.push(r(e));return}n.push(r(e.substring(0,i))),n.push("<span class='select2-match'>"),n.push(r(e.substring(i,i+s))),n.push("</span>"),n.push(r(e.substring(i+s,e.length)))}function N(t){var n,r=0,i=null,s=t.quietMillis||100,o=t.url,u=this;return function(a){window.clearTimeout(n),n=window.setTimeout(function(){r+=1;var n=r,s=t.data,f=o,l=t.transport||e.ajax,c=t.type||"GET",h={};s=s?s.call(u,a.term,a.page,a.context):null,f=typeof f=="function"?f.call(u,a.term,a.page,a.context):f,null!==i&&i.abort(),t.params&&(e.isFunction(t.params)?e.extend(h,t.params.call(u)):e.extend(h,t.params)),e.extend(h,{url:f,dataType:t.dataType,data:s,type:c,cache:!1,success:function(e){if(n<r)return;var i=t.results(e,a.page);a.callback(i)}}),i=l.call(u,h)},s)}}function C(t){var n=t,r,i,s=function(e){return""+e.text};e.isArray(n)&&(i=n,n={results:i}),e.isFunction(n)===!1&&(i=n,n=function(){return i});var o=n();return o.text&&(s=o.text,e.isFunction(s)||(r=n.text,s=function(e){return e[r]})),function(t){var r=t.term,i={results:[]},o;if(r===""){t.callback(n());return}o=function(n,i){var u,a;n=n[0];if(n.children){u={};for(a in n)n.hasOwnProperty(a)&&(u[a]=n[a]);u.children=[],e(n.children).each2(function(e,t){o(t,u.children)}),(u.children.length||t.matcher(r,s(u),n))&&i.push(u)}else t.matcher(r,s(n),n)&&i.push(n)},e(n().results).each2(function(e,t){o(t,i.results)}),t.callback(i)}}function k(n){var r=e.isFunction(n);return function(i){var s=i.term,o={results:[]};e(r?n():n).each(function(){var e=this.text!==t,n=e?this.text:this;(s===""||i.matcher(s,n))&&o.results.push(e?this:{id:this,text:this})}),i.callback(o)}}function L(t,n){if(e.isFunction(t))return!0;if(!t)return!1;throw new Error("formatterName must be a function or a falsy value")}function A(t){return e.isFunction(t)?t():t}function O(t){var n=0;return e.each(t,function(e,t){t.children?n+=O(t.children):n++}),n}function M(e,n,r,i){var s=e,o=!1,u,a,f,l,h;if(!i.createSearchChoice||!i.tokenSeparators||i.tokenSeparators.length<1)return t;for(;;){a=-1;for(f=0,l=i.tokenSeparators.length;f<l;f++){h=i.tokenSeparators[f],a=e.indexOf(h);if(a>=0)break}if(a<0)break;u=e.substring(0,a),e=e.substring(a+h.length);if(u.length>0){u=i.createSearchChoice(u,n);if(u!==t&&u!==null&&i.id(u)!==t&&i.id(u)!==null){o=!1;for(f=0,l=n.length;f<l;f++)if(c(i.id(u),i.id(n[f]))){o=!0;break}o||r(u)}}}if(s!==e)return e}function _(t,n){var r=function(){};return r.prototype=new t,r.prototype.constructor=r,r.prototype.parent=t.prototype,r.prototype=e.extend(r.prototype,n),r}var n,r,i,s,o,u,a,f;n={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){e=e.which?e.which:e;switch(e){case n.LEFT:case n.RIGHT:case n.UP:case n.DOWN:return!0}return!1},isControl:function(e){var t=e.which;switch(t){case n.SHIFT:case n.CTRL:case n.ALT:return!0}return e.metaKey?!0:!1},isFunctionKey:function(e){return e=e.which?e.which:e,e>=112&&e<=123}},f=e(document),o=function(){var e=1;return function(){return e++}}(),f.bind("mousemove",function(e){a={x:e.pageX,y:e.pageY}}),r=_(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(n){var r,i,s=".select2-results",u;this.opts=n=this.prepareOpts(n),this.id=n.id,n.element.data("select2")!==t&&n.element.data("select2")!==null&&this.destroy(),this.enabled=!0,this.container=this.createContainer(),this.containerId="s2id_"+(n.element.attr("id")||"autogen"+o()),this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.body=g(function(){return n.element.closest("body")}),x(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.css(A(n.containerCss)),this.container.addClass(A(n.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabIndex"),this.opts.element.data("select2",this).addClass("select2-offscreen").bind("focus.select2",function(){e(this).select2("focus")}).attr("tabIndex","-1").before(this.container),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),this.dropdown.addClass(A(n.dropdownCssClass)),this.dropdown.data("select2",this),this.results=r=this.container.find(s),this.search=i=this.container.find("input.select2-input"),i.attr("tabIndex",this.elementTabIndex),this.resultsPage=0,this.context=null,this.initContainer(),v(this.results),this.dropdown.delegate(s,"mousemove-filtered touchstart touchmove touchend",this.bind(this.highlightUnderEvent)),y(80,this.results),this.dropdown.delegate(s,"scroll-debounced",this.bind(this.loadMoreIfNeeded)),e.fn.mousewheel&&r.mousewheel(function(e,t,n,i){var s=r.scrollTop(),o;i>0&&s-i<=0?(r.scrollTop(0),w(e)):i<0&&r.get(0).scrollHeight-r.scrollTop()+i<=r.height()&&(r.scrollTop(r.get(0).scrollHeight-r.height()),w(e))}),d(i),i.bind("keyup-change input paste",this.bind(this.updateResults)),i.bind("focus",function(){i.addClass("select2-focused")}),i.bind("blur",function(){i.removeClass("select2-focused")}),this.dropdown.delegate(s,"mouseup",this.bind(function(t){e(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.bind("click mouseup mousedown",function(e){e.stopPropagation()}),e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),(n.element.is(":disabled")||n.element.is("[readonly='readonly']"))&&this.disable()},destroy:function(){var e=this.opts.element.data("select2");this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),e!==t&&(e.container.remove(),e.dropdown.remove(),e.opts.element.removeClass("select2-offscreen").removeData("select2").unbind(".select2").attr({tabIndex:this.elementTabIndex}).show())},prepareOpts:function(n){var r,i,s,o;r=n.element,r.get(0).tagName.toLowerCase()==="select"&&(this.select=i=n.element),i&&e.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in n)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),n=e.extend({},{populateResults:function(r,i,s){var o,u,a,f,l=this.opts.id,c=this;o=function(r,i,u){var a,f,h,p,d,v,m,g,y,b;r=n.sortResults(r,i,s);for(a=0,f=r.length;a<f;a+=1)h=r[a],d=h.disabled===!0,p=!d&&l(h)!==t,v=h.children&&h.children.length>0,m=e("<li></li>"),m.addClass("select2-results-dept-"+u),m.addClass("select2-result"),m.addClass(p?"select2-result-selectable":"select2-result-unselectable"),d&&m.addClass("select2-disabled"),v&&m.addClass("select2-result-with-children"),m.addClass(c.opts.formatResultCssClass(h)),g=e(document.createElement("div")),g.addClass("select2-result-label"),b=n.formatResult(h,g,s,c.opts.escapeMarkup),b!==t&&g.html(b),m.append(g),v&&(y=e("<ul></ul>"),y.addClass("select2-result-sub"),o(h.children,y,u+1),m.append(y)),m.data("select2-data",h),i.append(m)},o(i,r,0)}},e.fn.select2.defaults,n),typeof n.id!="function"&&(s=n.id,n.id=function(e){return e[s]});if(e.isArray(n.element.data("select2Tags"))){if("tags"in n)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+n.element.attr("id");n.tags=n.element.attr("data-select2-tags")}i?(n.query=this.bind(function(n){var i={results:[],more:!1},s=n.term,o,u,a;a=function(e,t){var r;e.is("option")?n.matcher(s,e.text(),e)&&t.push({id:e.attr("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:c(e.attr("disabled"),"disabled")}):e.is("optgroup")&&(r={text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")},e.children().each2(function(e,t){a(t,r.children)}),r.children.length>0&&t.push(r))},o=r.children(),this.getPlaceholder()!==t&&o.length>0&&(u=o[0],e(u).text()===""&&(o=o.not(u))),o.each2(function(e,t){a(t,i.results)}),n.callback(i)}),n.id=function(e){return e.id},n.formatResultCssClass=function(e){return e.css}):"query"in n||("ajax"in n?(o=n.element.data("ajax-url"),o&&o.length>0&&(n.ajax.url=o),n.query=N.call(n.element,n.ajax)):"data"in n?n.query=C(n.data):"tags"in n&&(n.query=k(n.tags),n.createSearchChoice===t&&(n.createSearchChoice=function(e){return{id:e,text:e}}),n.initSelection===t&&(n.initSelection=function(t,r){var i=[];e(h(t.val(),n.separator)).each(function(){var t=this,r=this,s=n.tags;e.isFunction(s)&&(s=s()),e(s).each(function(){if(c(this.id,t))return r=this.text,!1}),i.push({id:t,text:r})}),r(i)})));if(typeof n.query!="function")throw"query function not defined for Select2 "+n.element.attr("id");return n},monitorSource:function(){var e=this.opts.element,t;e.bind("change.select2",this.bind(function(e){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),t=this.bind(function(){var e,t,n=this;e=this.opts.element.attr("disabled")!=="disabled",t=this.opts.element.attr("readonly")==="readonly",e=e&&!t,this.enabled!==e&&(e?this.enable():this.disable()),x(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(A(this.opts.containerCssClass)),x(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(A(this.opts.dropdownCssClass))}),e.bind("propertychange.select2 DOMAttrModified.select2",t),typeof WebKitMutationObserver!="undefined"&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new WebKitMutationObserver(function(e){e.forEach(t)}),this.propertyObserver.observe(e.get(0),{attributes:!0,subtree:!1}))},triggerChange:function(t){t=t||{},t=e.extend({},t,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},enable:function(){if(this.enabled)return;this.enabled=!0,this.container.removeClass("select2-container-disabled"),this.opts.element.removeAttr("disabled")},disable:function(){if(!this.enabled)return;this.close(),this.enabled=!1,this.container.addClass("select2-container-disabled"),this.opts.element.attr("disabled","disabled")},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var t=this.container.offset(),n=this.container.outerHeight(!1),r=this.container.outerWidth(!1),i=this.dropdown.outerHeight(!1),s=e(window).scrollLeft()+e(window).width(),o=e(window).scrollTop()+e(window).height(),u=t.top+n,a=t.left,f=u+i<=o,l=t.top-i>=this.body().scrollTop(),c=this.dropdown.outerWidth(!1),h=a+c<=s,p=this.dropdown.hasClass("select2-drop-above"),d,v,m;this.body().css("position")!=="static"&&(d=this.body().offset(),u-=d.top,a-=d.left),p?(v=!0,!l&&f&&(v=!1)):(v=!1,!f&&l&&(v=!0)),h||(a=t.left+r-c),v?(u=t.top-i,this.container.addClass("select2-drop-above"),this.dropdown.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")),m=e.extend({top:u,left:a,width:r},A(this.opts.dropdownCss)),this.dropdown.css(m)},shouldOpen:function(){var t;return this.opened()?!1:(t=e.Event("opening"),this.opts.element.trigger(t),!t.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(window.setTimeout(this.bind(this.opening),1),!0):!1},opening:function(){var t=this.containerId,n="scroll."+t,r="resize."+t,i="orientationchange."+t,s;this.clearDropdownAlignmentPreference(),this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body()),this.updateResults(!0),s=e("#select2-drop-mask"),s.length==0&&(s=e(document.createElement("div")),s.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),s.hide(),s.appendTo(this.body()),s.bind("mousedown touchstart",function(t){var n=e("#select2-drop"),r;n.length>0&&(r=n.data("select2"),r.opts.selectOnBlur&&r.selectHighlighted({noFocus:!0}),r.close())})),this.dropdown.prev()[0]!==s[0]&&this.dropdown.before(s),e("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),s.css({width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight}),s.show(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active"),this.ensureHighlightVisible();var o=this;this.container.parents().add(window).each(function(){e(this).bind(r+" "+n+" "+i,function(t){e("#select2-drop-mask").css({width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight}),o.positionDropdown()})}),this.focusSearch()},close:function(){if(!this.opened())return;var t=this.containerId,n="scroll."+t,r="resize."+t,i="orientationchange."+t;this.container.parents().add(window).each(function(){e(this).unbind(n).unbind(r).unbind(i)}),this.clearDropdownAlignmentPreference(),e("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open"),this.results.empty(),this.clearSearch(),this.opts.element.trigger(e.Event("close"))},clearSearch:function(){},getMaximumSelectionSize:function(){return A(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var t=this.results,n,r,i,s,o,u,a;r=this.highlight();if(r<0)return;if(r==0){t.scrollTop(0);return}n=this.findHighlightableChoices(),i=e(n[r]),s=i.offset().top+i.outerHeight(!0),r===n.length-1&&(a=t.find("li.select2-more-results"),a.length>0&&(s=a.offset().top+a.outerHeight(!0))),o=t.offset().top+t.outerHeight(!0),s>o&&t.scrollTop(t.scrollTop()+(s-o)),u=i.offset().top-t.offset().top,u<0&&i.css("display")!="none"&&t.scrollTop(t.scrollTop()+u)},findHighlightableChoices:function(){var e=this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)");return this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)")},moveHighlight:function(t){var n=this.findHighlightableChoices(),r=this.highlight();while(r>-1&&r<n.length){r+=t;var i=e(n[r]);if(i.hasClass("select2-result-selectable")&&!i.hasClass("select2-disabled")&&!i.hasClass("select2-selected")){this.highlight(r);break}}},highlight:function(t){var n=this.findHighlightableChoices(),r,i;if(arguments.length===0)return l(n.filter(".select2-highlighted")[0],n.get());t>=n.length&&(t=n.length-1),t<0&&(t=0),this.results.find(".select2-highlighted").removeClass("select2-highlighted"),r=e(n[t]),r.addClass("select2-highlighted"),this.ensureHighlightVisible(),i=r.data("select2-data"),i&&this.opts.element.trigger({type:"highlight",val:this.id(i),choice:i})},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var n=e(t.target).closest(".select2-result-selectable");if(n.length>0&&!n.is(".select2-highlighted")){var r=this.findHighlightableChoices();this.highlight(r.index(n))}else n.length==0&&this.results.find(".select2-highlighted").removeClass("select2-highlighted")},loadMoreIfNeeded:function(){var e=this.results,t=e.find("li.select2-more-results"),n,r=-1,i=this.resultsPage+1,s=this,o=this.search.val(),u=this.context;if(t.length===0)return;n=t.offset().top-e.offset().top-e.height(),n<=this.opts.loadMorePadding&&(t.addClass("select2-active"),this.opts.query({element:this.opts.element,term:o,page:i,context:u,matcher:this.opts.matcher,callback:this.bind(function(n){if(!s.opened())return;s.opts.populateResults.call(this,e,n.results,{term:o,page:i,context:u}),n.more===!0?(t.detach().appendTo(e).text(s.opts.formatLoadMore(i+1)),window.setTimeout(function(){s.loadMoreIfNeeded()},10)):t.remove(),s.positionDropdown(),s.resultsPage=i,s.context=n.context})}))},tokenize:function(){},updateResults:function(n){function f(){i.scrollTop(0),r.removeClass("select2-active"),u.positionDropdown()}function l(e){i.html(e),f()}var r=this.search,i=this.results,s=this.opts,o,u=this,a;if(n!==!0&&(this.showSearchInput===!1||!this.opened()))return;r.addClass("select2-active");var h=this.getMaximumSelectionSize();if(h>=1){o=this.data();if(e.isArray(o)&&o.length>=h&&L(s.formatSelectionTooBig,"formatSelectionTooBig")){l("<li class='select2-selection-limit'>"+s.formatSelectionTooBig(h)+"</li>");return}}if(r.val().length<s.minimumInputLength){L(s.formatInputTooShort,"formatInputTooShort")?l("<li class='select2-no-results'>"+s.formatInputTooShort(r.val(),s.minimumInputLength)+"</li>"):l("");return}s.formatSearching()&&n===!0&&l("<li class='select2-searching'>"+s.formatSearching()+"</li>");if(s.maximumInputLength&&r.val().length>s.maximumInputLength){L(s.formatInputTooLong,"formatInputTooLong")?l("<li class='select2-no-results'>"+s.formatInputTooLong(r.val(),s.maximumInputLength)+"</li>"):l("");return}a=this.tokenize(),a!=t&&a!=null&&r.val(a),this.resultsPage=1,s.query({element:s.element,term:r.val(),page:this.resultsPage,context:null,matcher:s.matcher,callback:this.bind(function(o){var a;if(!this.opened())return;this.context=o.context===t?null:o.context,this.opts.createSearchChoice&&r.val()!==""&&(a=this.opts.createSearchChoice.call(null,r.val(),o.results),a!==t&&a!==null&&u.id(a)!==t&&u.id(a)!==null&&e(o.results).filter(function(){return c(u.id(this),u.id(a))}).length===0&&o.results.unshift(a));if(o.results.length===0&&L(s.formatNoMatches,"formatNoMatches")){l("<li class='select2-no-results'>"+s.formatNoMatches(r.val())+"</li>");return}i.empty(),u.opts.populateResults.call(this,i,o.results,{term:r.val(),page:this.resultsPage,context:null}),o.more===!0&&L(s.formatLoadMore,"formatLoadMore")&&(i.append("<li class='select2-more-results'>"+u.opts.escapeMarkup(s.formatLoadMore(this.resultsPage))+"</li>"),window.setTimeout(function(){u.loadMoreIfNeeded()},10)),this.postprocessResults(o,n),f()})})},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){b(this.search)},selectHighlighted:function(e){var t=this.highlight(),n=this.results.find(".select2-highlighted"),r=n.closest(".select2-result").data("select2-data");r&&(this.highlight(t),this.onSelect(r,e))},getPlaceholder:function(){return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder},initContainerWidth:function(){function n(){var n,r,i,s,o;if(this.opts.width==="off")return null;if(this.opts.width==="element")return this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px";if(this.opts.width==="copy"||this.opts.width==="resolve"){n=this.opts.element.attr("style");if(n!==t){r=n.split(";");for(s=0,o=r.length;s<o;s+=1){i=r[s].replace(/\s/g,"").match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/);if(i!==null&&i.length>=1)return i[1]}}return this.opts.width==="resolve"?(n=this.opts.element.css("width"),n.indexOf("%")>0?n:this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px"):null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}var r=n.call(this);r!==null&&this.container.css("width",r)}}),i=_(r,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>"," <span></span><abbr class='select2-search-choice-close' style='display:none;'></abbr>"," <div><b></b></div>","</a>","<input class='select2-focusser select2-offscreen' type='text'/>","<div class='select2-drop' style='display:none'>"," <div class='select2-search'>"," <input type='text' autocomplete='off' class='select2-input'/>"," </div>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return t},disable:function(){if(!this.enabled)return;this.parent.disable.apply(this,arguments),this.focusser.attr("disabled","disabled")},enable:function(){if(this.enabled)return;this.parent.enable.apply(this,arguments),this.focusser.removeAttr("disabled")},opening:function(){this.parent.opening.apply(this,arguments),this.focusser.attr("disabled","disabled"),this.opts.element.trigger(e.Event("open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments),this.focusser.removeAttr("disabled"),b(this.focusser)},focus:function(){this.opened()?this.close():(this.focusser.removeAttr("disabled"),this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus()},initContainer:function(){var e,t=this.container,r=this.dropdown,i=!1;this.showSearch(this.opts.minimumResultsForSearch>=0),this.selection=e=t.find(".select2-choice"),this.focusser=t.find(".select2-focusser"),this.search.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.PAGE_UP||e.which===n.PAGE_DOWN){w(e);return}switch(e.which){case n.UP:case n.DOWN:this.moveHighlight(e.which===n.UP?-1:1),w(e);return;case n.TAB:case n.ENTER:this.selectHighlighted(),w(e);return;case n.ESC:this.cancel(e),w(e);return}})),this.focusser.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.TAB||n.isControl(e)||n.isFunctionKey(e)||e.which===n.ESC)return;if(this.opts.openOnEnter===!1&&e.which===n.ENTER){w(e);return}if(e.which==n.DOWN||e.which==n.UP||e.which==n.ENTER&&this.opts.openOnEnter){this.open(),w(e);return}if(e.which==n.DELETE||e.which==n.BACKSPACE){this.opts.allowClear&&this.clear(),w(e);return}})),d(this.focusser),this.focusser.bind("keyup-change input",this.bind(function(e){if(this.opened())return;this.open(),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.focusser.val(""),w(e)})),e.delegate("abbr","mousedown",this.bind(function(e){if(!this.enabled)return;this.clear(),E(e),this.close(),this.selection.focus()})),e.bind("mousedown",this.bind(function(e){i=!0,this.opened()?this.close():this.enabled&&this.open(),w(e),i=!1})),r.bind("mousedown",this.bind(function(){this.search.focus()})),e.bind("focus",this.bind(function(e){w(e)})),this.focusser.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")})).bind("blur",this.bind(function(){this.opened()||this.container.removeClass("select2-container-active")})),this.search.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.setPlaceholder()},clear:function(){var e=this.selection.data("select2-data");this.opts.element.val(""),this.selection.find("span").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),this.opts.element.trigger({type:"removed",val:this.id(e),choice:e}),this.triggerChange({removed:e})},initSelection:function(){var e;if(this.opts.element.val()===""&&this.opts.element.text()==="")this.close(),this.setPlaceholder();else{var n=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==t&&e!==null&&(n.updateSelection(e),n.close(),n.setPlaceholder())})}},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(t,n){var r=t.find(":selected");e.isFunction(n)&&n({id:r.attr("value"),text:r.text(),element:r})}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=n.val();t.query({matcher:function(e,n,r){return c(i,t.id(r))},callback:e.isFunction(r)?function(e){r(e.results.length?e.results[0]:null)}:e.noop})}),t},getPlaceholder:function(){return this.select&&this.select.find("option").first().text()!==""?t:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(this.opts.element.val()===""&&e!==t){if(this.select&&this.select.find("option:first").text()!=="")return;this.selection.find("span").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.selection.find("abbr").hide()}},postprocessResults:function(e,t){var n=0,r=this,i=!0;this.findHighlightableChoices().each2(function(e,t){if(c(r.id(t.data("select2-data")),r.opts.element.val()))return n=e,!1}),this.highlight(n);if(t===!0){var s=this.opts.minimumResultsForSearch;i=s<0?!1:O(e.results)>=s,this.showSearch(i)}},showSearch:function(t){this.showSearchInput=t,this.dropdown.find(".select2-search")[t?"removeClass":"addClass"]("select2-search-hidden"),e(this.dropdown,this.container)[t?"addClass":"removeClass"]("select2-with-searchbox")},onSelect:function(e,t){var n=this.opts.element.val();this.opts.element.val(this.id(e)),this.updateSelection(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),this.close(),(!t||!t.noFocus)&&this.selection.focus(),c(n,this.id(e))||this.triggerChange()},updateSelection:function(e){var n=this.selection.find("span"),r;this.selection.data("select2-data",e),n.empty(),r=this.opts.formatSelection(e,n),r!==t&&n.append(this.opts.escapeMarkup(r)),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.selection.find("abbr").show()},val:function(){var e,n=!1,r=null,i=this;if(arguments.length===0)return this.opts.element.val();e=arguments[0],arguments.length>1&&(n=arguments[1]);if(this.select)this.select.val(e).find(":selected").each2(function(e,t){return r={id:t.attr("value"),text:t.text()},!1}),this.updateSelection(r),this.setPlaceholder(),n&&this.triggerChange();else{if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");if(!e&&e!==0){this.clear(),n&&this.triggerChange();return}this.opts.element.val(e),this.opts.initSelection(this.opts.element,function(e){i.opts.element.val(e?i.id(e):""),i.updateSelection(e),i.setPlaceholder(),n&&i.triggerChange()})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e){var n;if(arguments.length===0)return n=this.selection.data("select2-data"),n==t&&(n=null),n;!e||e===""?this.clear():(this.opts.element.val(e?this.id(e):""),this.updateSelection(e))}}),s=_(r,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html([" <ul class='select2-choices'>"," <li class='select2-search-field'>"," <input type='text' autocomplete='off' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi' style='display:none;'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return t},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(e,t){var n=[];e.find(":selected").each2(function(e,t){n.push({id:t.attr("value"),text:t.text(),element:t[0]})}),t(n)}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=h(n.val(),t.separator);t.query({matcher:function(n,r,s){return e.grep(i,function(e){return c(e,t.id(s))}).length},callback:e.isFunction(r)?function(e){r(e.results)}:e.noop})}),t},initContainer:function(){var t=".select2-choices",r;this.searchContainer=this.container.find(".select2-search-field"),this.selection=r=this.container.find(t),this.search.bind("input paste",this.bind(function(){if(!this.enabled)return;this.opened()||this.open()})),this.search.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.BACKSPACE&&this.search.val()===""){this.close();var t,i=r.find(".select2-search-choice-focus");if(i.length>0){this.unselect(i.first()),this.search.width(10),w(e);return}t=r.find(".select2-search-choice:not(.select2-locked)"),t.length>0&&t.last().addClass("select2-search-choice-focus")}else r.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");if(this.opened())switch(e.which){case n.UP:case n.DOWN:this.moveHighlight(e.which===n.UP?-1:1),w(e);return;case n.ENTER:case n.TAB:this.selectHighlighted(),w(e);return;case n.ESC:this.cancel(e),w(e);return}if(e.which===n.TAB||n.isControl(e)||n.isFunctionKey(e)||e.which===n.BACKSPACE||e.which===n.ESC)return;if(e.which===n.ENTER){if(this.opts.openOnEnter===!1)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),(e.which===n.PAGE_UP||e.which===n.PAGE_DOWN)&&w(e)})),this.search.bind("keyup",this.bind(this.resizeSearch)),this.search.bind("blur",this.bind(function(e){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.opened()||this.clearSearch(),e.stopImmediatePropagation()})),this.container.delegate(t,"mousedown",this.bind(function(t){if(!this.enabled)return;if(e(t.target).closest(".select2-search-choice").length>0)return;this.clearPlaceholder(),this.open(),this.focusSearch(),t.preventDefault()})),this.container.delegate(t,"focus",this.bind(function(){if(!this.enabled)return;this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder()})),this.initContainerWidth(),this.clearSearch()},enable:function(){if(this.enabled)return;this.parent.enable.apply(this,arguments),this.search.removeAttr("disabled")},disable:function(){if(!this.enabled)return;this.parent.disable.apply(this,arguments),this.search.attr("disabled",!0)},initSelection:function(){var e;this.opts.element.val()===""&&this.opts.element.text()===""&&(this.updateSelection([]),this.close(),this.clearSearch());if(this.select||this.opts.element.val()!==""){var n=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==t&&e!==null&&(n.updateSelection(e),n.close(),n.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder();e!==t&&this.getVal().length===0&&this.search.hasClass("select2-focused")===!1?(this.search.val(e).addClass("select2-default"),this.resizeSearch()):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.parent.opening.apply(this,arguments),this.clearPlaceholder(),this.resizeSearch(),this.focusSearch(),this.opts.element.trigger(e.Event("open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus(),this.opts.element.triggerHandler("focus")},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var n=[],r=[],i=this;e(t).each(function(){l(i.id(this),n)<0&&(n.push(i.id(this)),r.push(this))}),t=r,this.selection.find(".select2-search-choice").remove(),e(t).each(function(){i.addSelectedChoice(this)}),i.postprocessResults()},tokenize:function(){var e=this.search.val();e=this.opts.tokenizer(e,this.data(),this.bind(this.onSelect),this.opts),e!=null&&e!=t&&(this.search.val(e),e.length>0&&this.open())},onSelect:function(e,t){this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.val().length>=this.getMaximumSelectionSize()&&this.updateResults(!0),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),(!t||!t.noFocus)&&this.focusSearch()},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(n){var r=!n.locked,i=e("<li class='select2-search-choice'> <div></div> <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),s=e("<li class='select2-search-choice select2-locked'><div></div></li>"),o=r?i:s,u=this.id(n),a=this.getVal(),f;f=this.opts.formatSelection(n,o.find("div")),f!=t&&o.find("div").replaceWith("<div>"+this.opts.escapeMarkup(f)+"</div>"),r&&o.find(".select2-search-choice-close").bind("mousedown",w).bind("click dblclick",this.bind(function(t){if(!this.enabled)return;e(t.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(e(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),this.close(),this.focusSearch()})).dequeue(),w(t)})).bind("focus",this.bind(function(){if(!this.enabled)return;this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active")})),o.data("select2-data",n),o.insertBefore(this.searchContainer),a.push(u),this.setVal(a)},unselect:function(e){var t=this.getVal(),n,r;e=e.closest(".select2-search-choice");if(e.length===0)throw"Invalid argument: "+e+". Must be .select2-search-choice";n=e.data("select2-data");if(!n)return;r=l(this.id(n),t),r>=0&&(t.splice(r,1),this.setVal(t),this.select&&this.postprocessResults()),e.remove(),this.opts.element.trigger({type:"removed",val:this.id(n),choice:n}),this.triggerChange({removed:n})},postprocessResults:function(){var e=this.getVal(),t=this.results.find(".select2-result"),n=this.results.find(".select2-result-with-children"),r=this;t.each2(function(t,n){var i=r.id(n.data("select2-data"));l(i,e)>=0&&(n.addClass("select2-selected"),n.find(".select2-result-selectable").addClass("select2-selected"))}),n.each2(function(e,t){!t.is(".select2-result-selectable")&&t.find(".select2-result-selectable:not(.select2-selected)").length===0&&t.addClass("select2-selected")}),this.highlight()==-1&&r.highlight(0)},resizeSearch:function(){var e,t,n,r,i,s=p(this.search);e=S(this.search)+10,t=this.search.offset().left,n=this.selection.width(),r=this.selection.offset().left,i=n-(t-r)-s,i<e&&(i=n-s),i<40&&(i=n-s),i<=0&&(i=e),this.search.width(i)},getVal:function(){var e;return this.select?(e=this.select.val(),e===null?[]:e):(e=this.opts.element.val(),h(e,this.opts.separator))},setVal:function(t){var n;this.select?this.select.val(t):(n=[],e(t).each(function(){l(this,n)<0&&n.push(this)}),this.opts.element.val(n.length===0?"":n.join(this.opts.separator)))},val:function(){var n,r=!1,i=[],s=this;if(arguments.length===0)return this.getVal();n=arguments[0],arguments.length>1&&(r=arguments[1]);if(!n&&n!==0){this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),r&&this.triggerChange();return}this.setVal(n);if(this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),r&&this.triggerChange();else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var n=e(t).map(s.id);s.setVal(n),s.updateSelection(t),s.clearSearch(),r&&s.triggerChange()})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var t=[],n=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(n.opts.id(e(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t){var n=this,r;if(arguments.length===0)return this.selection.find(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get();t||(t=[]),r=e.map(t,function(e){return n.opts.id(e)}),this.setVal(r),this.updateSelection(t),this.clearSearch()}}),e.fn.select2=function(){var n=Array.prototype.slice.call(arguments,0),r,o,u,a,f=["val","destroy","opened","open","close","focus","isFocused","container","onSortStart","onSortEnd","enable","disable","positionDropdown","data"];return this.each(function(){if(n.length===0||typeof n[0]=="object")r=n.length===0?{}:e.extend({},n[0]),r.element=e(this),r.element.get(0).tagName.toLowerCase()==="select"?a=r.element.attr("multiple"):(a=r.multiple||!1,"tags"in r&&(r.multiple=a=!0)),o=a?new s:new i,o.init(r);else{if(typeof n[0]!="string")throw"Invalid arguments to select2 plugin: "+n;if(l(n[0],f)<0)throw"Unknown method: "+n[0];u=t,o=e(this).data("select2");if(o===t)return;n[0]==="container"?u=o.container:u=o[n[0]].apply(o,n.slice(1));if(u!==t)return!1}}),u===t?this:u},e.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,n,r){var i=[];return T(e.text,n.term,i,r),i.join("")},formatSelection:function(e,n){return e?e.text:t},sortResults:function(e,t,n){return e},formatResultCssClass:function(e){return t},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(e,t){var n=t-e.length;return"Please enter "+n+" more character"+(n==1?"":"s")},formatInputTooLong:function(e,t){var n=e.length-t;return"Please enter "+n+" less character"+(n==1?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(e==1?"":"s")},formatLoadMore:function(e){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e.id},matcher:function(e,t){return t.toUpperCase().indexOf(e.toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:M,escapeMarkup:function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;","/":"&#47;"};return String(e).replace(/[&<>"'/\\]/g,function(e){return t[e[0]]})},blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(e){return null}}}(e)}),timely.define("libs/select2_multiselect_helper",["jquery_timely","external_libs/select2"],function(e){var t=function(t){var n=e(t.element),r=n.data("color"),i=n.data("description"),s="";return typeof r!="undefined"&&r!==""&&(s+='<span class="ai1ec-color-swatch" style="background: '+n.data("color")+'"></span> '),s+=t.text,s='<span title="'+i+'">'+s+"</span>",s},n=function(t){var n=e(t.element),r=n.data("color"),i=n.data("description"),s="";return typeof r!="undefined"&&r!==""?s+='<span class="ai1ec-color-swatch" style="background: '+n.data("color")+'"></span> ':s+='<span class="ai1ec-color-swatch-empty"></span> ',s+=t.text,s='<span title="'+i+'">'+s+"</span>",s},r=function(r){typeof r=="undefined"&&(r=e(document)),e(".ai1ec-select2-multiselect-selector",r).select2({allowClear:!0,formatResult:n,formatSelection:t,escapeMarkup:function(e){return e}})},i=function(t){e(".ai1ec-select2-multiselect-selector.select2-container",t).each(function(){e(this).data("select2").resizeSearch()})};return{init:r,refresh:i}}),timely.define("external_libs/jquery_history",["jquery_timely"],function(e){try{(function(t,n){var r=t.History=t.History||{};if(typeof r.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");r.Adapter={bind:function(t,n,r){e(t).bind(n,r)},trigger:function(t,n,r){e(t).trigger(n,r)},extractEventData:function(e,t,r){var i=t&&t.originalEvent&&t.originalEvent[e]||r&&r[e]||n;return i},onDomLoad:function(t){e(t)}},typeof r.init!="undefined"&&r.init()})(window),function(e,t){var n=e.document,r=e.setTimeout||r,i=e.clearTimeout||i,s=e.setInterval||s,o=e.History=e.History||{};if(typeof o.initHtml4!="undefined")throw new Error("History.js HTML4 Support has already been loaded...");o.initHtml4=function(){if(typeof o.initHtml4.initialized!="undefined")return!1;o.initHtml4.initialized=!0,o.enabled=!0,o.savedHashes=[],o.isLastHash=function(e){var t=o.getHashByIndex(),n;return n=e===t,n},o.saveHash=function(e){return o.isLastHash(e)?!1:(o.savedHashes.push(e),!0)},o.getHashByIndex=function(e){var t=null;return typeof e=="undefined"?t=o.savedHashes[o.savedHashes.length-1]:e<0?t=o.savedHashes[o.savedHashes.length+e]:t=o.savedHashes[e],t},o.discardedHashes={},o.discardedStates={},o.discardState=function(e,t,n){var r=o.getHashByState(e),i;return i={discardedState:e,backState:n,forwardState:t},o.discardedStates[r]=i,!0},o.discardHash=function(e,t,n){var r={discardedHash:e,backState:n,forwardState:t};return o.discardedHashes[e]=r,!0},o.discardedState=function(e){var t=o.getHashByState(e),n;return n=o.discardedStates[t]||!1,n},o.discardedHash=function(e){var t=o.discardedHashes[e]||!1;return t},o.recycleState=function(e){var t=o.getHashByState(e);return o.discardedState(e)&&delete o.discardedStates[t],!0},o.emulated.hashChange&&(o.hashChangeInit=function(){o.checkerFunction=null;var t="",r,i,u,a;return o.isInternetExplorer()?(r="historyjs-iframe",i=n.createElement("iframe"),i.setAttribute("id",r),i.style.display="none",n.body.appendChild(i),i.contentWindow.document.open(),i.contentWindow.document.close(),u="",a=!1,o.checkerFunction=function(){if(a)return!1;a=!0;var n=o.getHash()||"",r=o.unescapeHash(i.contentWindow.document.location.hash)||"";return n!==t?(t=n,r!==n&&(u=r=n,i.contentWindow.document.open(),i.contentWindow.document.close(),i.contentWindow.document.location.hash=o.escapeHash(n)),o.Adapter.trigger(e,"hashchange")):r!==u&&(u=r,o.setHash(r,!1)),a=!1,!0}):o.checkerFunction=function(){var n=o.getHash();return n!==t&&(t=n,o.Adapter.trigger(e,"hashchange")),!0},o.intervalList.push(s(o.checkerFunction,o.options.hashChangeInterval)),!0},o.Adapter.onDomLoad(o.hashChangeInit)),o.emulated.pushState&&(o.onHashChange=function(t){var r=t&&t.newURL||n.location.href,i=o.getHashByUrl(r),s=null,u=null,a=null,f;return o.isLastHash(i)?(o.busy(!1),!1):(o.doubleCheckComplete(),o.saveHash(i),i&&o.isTraditionalAnchor(i)?(o.Adapter.trigger(e,"anchorchange"),o.busy(!1),!1):(s=o.extractState(o.getFullUrl(i||n.location.href,!1),!0),o.isLastSavedState(s)?(o.busy(!1),!1):(u=o.getHashByState(s),f=o.discardedState(s),f?(o.getHashByIndex(-2)===o.getHashByState(f.forwardState)?o.back(!1):o.forward(!1),!1):(o.pushState(s.data,s.title,s.url,!1),!0))))},o.Adapter.bind(e,"hashchange",o.onHashChange),o.pushState=function(t,r,i,s){if(o.getHashByUrl(i))throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(s!==!1&&o.busy())return o.pushQueue({scope:o,callback:o.pushState,args:arguments,queue:s}),!1;o.busy(!0);var u=o.createStateObject(t,r,i),a=o.getHashByState(u),f=o.getState(!1),l=o.getHashByState(f),c=o.getHash();return o.storeState(u),o.expectedStateId=u.id,o.recycleState(u),o.setTitle(u),a===l?(o.busy(!1),!1):a!==c&&a!==o.getShortUrl(n.location.href)?(o.setHash(a,!1),!1):(o.saveState(u),o.Adapter.trigger(e,"statechange"),o.busy(!1),!0)},o.replaceState=function(e,t,n,r){if(o.getHashByUrl(n))throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(r!==!1&&o.busy())return o.pushQueue({scope:o,callback:o.replaceState,args:arguments,queue:r}),!1;o.busy(!0);var i=o.createStateObject(e,t,n),s=o.getState(!1),u=o.getStateByIndex(-2);return o.discardState(s,i,u),o.pushState(i.data,i.title,i.url,!1),!0}),o.emulated.pushState&&o.getHash()&&!o.emulated.hashChange&&o.Adapter.onDomLoad(function(){o.Adapter.trigger(e,"hashchange")})},typeof o.init!="undefined"&&o.init()}(window),function(e,t){var n=e.console||t,r=e.document,i=e.navigator,s=e.sessionStorage||!1,o=e.setTimeout,u=e.clearTimeout,a=e.setInterval,f=e.clearInterval,l=e.JSON,c=e.alert,h=e.History=e.History||{},p=e.history;l.stringify=l.stringify||l.encode,l.parse=l.parse||l.decode;if(typeof h.init!="undefined")throw new Error("History.js Core has already been loaded...");h.init=function(){return typeof h.Adapter=="undefined"?!1:(typeof h.initCore!="undefined"&&h.initCore(),typeof h.initHtml4!="undefined"&&h.initHtml4(),!0)},h.initCore=function(){if(typeof h.initCore.initialized!="undefined")return!1;h.initCore.initialized=!0,h.options=h.options||{},h.options.hashChangeInterval=h.options.hashChangeInterval||100,h.options.safariPollInterval=h.options.safariPollInterval||500,h.options.doubleCheckInterval=h.options.doubleCheckInterval||500,h.options.storeInterval=h.options.storeInterval||1e3,h.options.busyDelay=h.options.busyDelay||250,h.options.debug=h.options.debug||!1,h.options.initialTitle=h.options.initialTitle||r.title,h.intervalList=[],h.clearAllIntervals=function(){var e,t=h.intervalList;if(typeof t!="undefined"&&t!==null){for(e=0;e<t.length;e++)f(t[e]);h.intervalList=null}},h.debug=function(){(h.options.debug||!1)&&h.log.apply(h,arguments)},h.log=function(){var e=typeof n!="undefined"&&typeof n.log!="undefined"&&typeof n.log.apply!="undefined",t=r.getElementById("log"),i,s,o,u,a;e?(u=Array.prototype.slice.call(arguments),i=u.shift(),typeof n.debug!="undefined"?n.debug.apply(n,[i,u]):n.log.apply(n,[i,u])):i="\n"+arguments[0]+"\n";for(s=1,o=arguments.length;s<o;++s){a=arguments[s];if(typeof a=="object"&&typeof l!="undefined")try{a=l.stringify(a)}catch(f){}i+="\n"+a+"\n"}return t?(t.value+=i+"\n-----\n",t.scrollTop=t.scrollHeight-t.clientHeight):e||c(i),!0},h.getInternetExplorerMajorVersion=function(){var e=h.getInternetExplorerMajorVersion.cached=typeof h.getInternetExplorerMajorVersion.cached!="undefined"?h.getInternetExplorerMajorVersion.cached:function(){var e=3,t=r.createElement("div"),n=t.getElementsByTagName("i");while((t.innerHTML="<!--[if gt IE "+ ++e+"]><i></i><![endif]-->")&&n[0]);return e>4?e:!1}();return e},h.isInternetExplorer=function(){var e=h.isInternetExplorer.cached=typeof h.isInternetExplorer.cached!="undefined"?h.isInternetExplorer.cached:Boolean(h.getInternetExplorerMajorVersion());return e},h.emulated={pushState:!Boolean(e.history&&e.history.pushState&&e.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(i.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(i.userAgent)),hashChange:Boolean(!("onhashchange"in e||"onhashchange"in r)||h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8)},h.enabled=!h.emulated.pushState,h.bugs={setHash:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),safariPoll:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),ieDoubleCheck:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<7)},h.isEmptyObject=function(e){for(var t in e)return!1;return!0},h.cloneObject=function(e){var t,n;return e?(t=l.stringify(e),n=l.parse(t)):n={},n},h.getRootUrl=function(){var e=r.location.protocol+"//"+(r.location.hostname||r.location.host);if(r.location.port||!1)e+=":"+r.location.port;return e+="/",e},h.getBaseHref=function(){var e=r.getElementsByTagName("base"),t=null,n="";return e.length===1&&(t=e[0],n=t.href.replace(/[^\/]+$/,"")),n=n.replace(/\/+$/,""),n&&(n+="/"),n},h.getBaseUrl=function(){var e=h.getBaseHref()||h.getBasePageUrl()||h.getRootUrl();return e},h.getPageUrl=function(){var e=h.getState(!1,!1),t=(e||{}).url||r.location.href,n;return n=t.replace(/\/+$/,"").replace(/[^\/]+$/,function(e,t,n){return/\./.test(e)?e:e+"/"}),n},h.getBasePageUrl=function(){var e=r.location.href.replace(/[#\?].*/,"").replace(/[^\/]+$/,function(e,t,n){return/[^\/]$/.test(e)?"":e}).replace(/\/+$/,"")+"/";return e},h.getFullUrl=function(e,t){var n=e,r=e.substring(0,1);return t=typeof t=="undefined"?!0:t,/[a-z]+\:\/\//.test(e)||(r==="/"?n=h.getRootUrl()+e.replace(/^\/+/,""):r==="#"?n=h.getPageUrl().replace(/#.*/,"")+e:r==="?"?n=h.getPageUrl().replace(/[\?#].*/,"")+e:t?n=h.getBaseUrl()+e.replace(/^(\.\/)+/,""):n=h.getBasePageUrl()+e.replace(/^(\.\/)+/,"")),n.replace(/\#$/,"")},h.getShortUrl=function(e){var t=e,n=h.getBaseUrl(),r=h.getRootUrl();return h.emulated.pushState&&(t=t.replace(n,"")),t=t.replace(r,"/"),h.isTraditionalAnchor(t)&&(t="./"+t),t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),t},h.store={},h.idToState=h.idToState||{},h.stateToId=h.stateToId||{},h.urlToId=h.urlToId||{},h.storedStates=h.storedStates||[],h.savedStates=h.savedStates||[],h.normalizeStore=function(){h.store.idToState=h.store.idToState||{},h.store.urlToId=h.store.urlToId||{},h.store.stateToId=h.store.stateToId||{}},h.getState=function(e,t){typeof e=="undefined"&&(e=!0),typeof t=="undefined"&&(t=!0);var n=h.getLastSavedState();return!n&&t&&(n=h.createStateObject()),e&&(n=h.cloneObject(n),n.url=n.cleanUrl||n.url),n},h.getIdByState=function(e){var t=h.extractId(e.url),n;if(!t){n=h.getStateString(e);if(typeof h.stateToId[n]!="undefined")t=h.stateToId[n];else if(typeof h.store.stateToId[n]!="undefined")t=h.store.stateToId[n];else{for(;;){t=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof h.idToState[t]=="undefined"&&typeof h.store.idToState[t]=="undefined")break}h.stateToId[n]=t,h.idToState[t]=e}}return t},h.normalizeState=function(e){var t,n;if(!e||typeof e!="object")e={};if(typeof e.normalized!="undefined")return e;if(!e.data||typeof e.data!="object")e.data={};t={},t.normalized=!0,t.title=e.title||"",t.url=h.getFullUrl(h.unescapeString(e.url||r.location.href)),t.hash=h.getShortUrl(t.url),t.data=h.cloneObject(e.data),t.id=h.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,n=!h.isEmptyObject(t.data);if(t.title||n)t.hash=h.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id;return t.hashedUrl=h.getFullUrl(t.hash),(h.emulated.pushState||h.bugs.safariPoll)&&h.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t},h.createStateObject=function(e,t,n){var r={data:e,title:t,url:n};return r=h.normalizeState(r),r},h.getStateById=function(e){e=String(e);var n=h.idToState[e]||h.store.idToState[e]||t;return n},h.getStateString=function(e){var t,n,r;return t=h.normalizeState(e),n={data:t.data,title:e.title,url:e.url},r=l.stringify(n),r},h.getStateId=function(e){var t,n;return t=h.normalizeState(e),n=t.id,n},h.getHashByState=function(e){var t,n;return t=h.normalizeState(e),n=t.hash,n},h.extractId=function(e){var t,n,r;return n=/(.*)\&_suid=([0-9]+)$/.exec(e),r=n?n[1]||e:e,t=n?String(n[2]||""):"",t||!1},h.isTraditionalAnchor=function(e){var t=!/[\/\?\.]/.test(e);return t},h.extractState=function(e,t){var n=null,r,i;return t=t||!1,r=h.extractId(e),r&&(n=h.getStateById(r)),n||(i=h.getFullUrl(e),r=h.getIdByUrl(i)||!1,r&&(n=h.getStateById(r)),!n&&t&&!h.isTraditionalAnchor(e)&&(n=h.createStateObject(null,null,i))),n},h.getIdByUrl=function(e){var n=h.urlToId[e]||h.store.urlToId[e]||t;return n},h.getLastSavedState=function(){return h.savedStates[h.savedStates.length-1]||t},h.getLastStoredState=function(){return h.storedStates[h.storedStates.length-1]||t},h.hasUrlDuplicate=function(e){var t=!1,n;return n=h.extractState(e.url),t=n&&n.id!==e.id,t},h.storeState=function(e){return h.urlToId[e.url]=e.id,h.storedStates.push(h.cloneObject(e)),e},h.isLastSavedState=function(e){var t=!1,n,r,i;return h.savedStates.length&&(n=e.id,r=h.getLastSavedState(),i=r.id,t=n===i),t},h.saveState=function(e){return h.isLastSavedState(e)?!1:(h.savedStates.push(h.cloneObject(e)),!0)},h.getStateByIndex=function(e){var t=null;return typeof e=="undefined"?t=h.savedStates[h.savedStates.length-1]:e<0?t=h.savedStates[h.savedStates.length+e]:t=h.savedStates[e],t},h.getHash=function(){var e=h.unescapeHash(r.location.hash);return e},h.unescapeString=function(t){var n=t,r;for(;;){r=e.unescape(n);if(r===n)break;n=r}return n},h.unescapeHash=function(e){var t=h.normalizeHash(e);return t=h.unescapeString(t),t},h.normalizeHash=function(e){var t=e.replace(/[^#]*#/,"").replace(/#.*/,"");return t},h.setHash=function(e,t){var n,i,s;return t!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.setHash,args:arguments,queue:t}),!1):(n=h.escapeHash(e),h.busy(!0),i=h.extractState(e,!0),i&&!h.emulated.pushState?h.pushState(i.data,i.title,i.url,!1):r.location.hash!==n&&(h.bugs.setHash?(s=h.getPageUrl(),h.pushState(null,null,s+"#"+n,!1)):r.location.hash=n),h)},h.escapeHash=function(t){var n=h.normalizeHash(t);return n=e.escape(n),h.bugs.hashEscape||(n=n.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),n},h.getHashByUrl=function(e){var t=String(e).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return t=h.unescapeHash(t),t},h.setTitle=function(e){var t=e.title,n;t||(n=h.getStateByIndex(0),n&&n.url===e.url&&(t=n.title||h.options.initialTitle));try{r.getElementsByTagName("title")[0].innerHTML=t.replace("<","&lt;").replace(">","&gt;").replace(" & "," &amp; ")}catch(i){}return r.title=t,h},h.queues=[],h.busy=function(e){typeof e!="undefined"?h.busy.flag=e:typeof h.busy.flag=="undefined"&&(h.busy.flag=!1);if(!h.busy.flag){u(h.busy.timeout);var t=function(){var e,n,r;if(h.busy.flag)return;for(e=h.queues.length-1;e>=0;--e){n=h.queues[e];if(n.length===0)continue;r=n.shift(),h.fireQueueItem(r),h.busy.timeout=o(t,h.options.busyDelay)}};h.busy.timeout=o(t,h.options.busyDelay)}return h.busy.flag},h.busy.flag=!1,h.fireQueueItem=function(e){return e.callback.apply(e.scope||h,e.args||[])},h.pushQueue=function(e){return h.queues[e.queue||0]=h.queues[e.queue||0]||[],h.queues[e.queue||0].push(e),h},h.queue=function(e,t){return typeof e=="function"&&(e={callback:e}),typeof t!="undefined"&&(e.queue=t),h.busy()?h.pushQueue(e):h.fireQueueItem(e),h},h.clearQueue=function(){return h.busy.flag=!1,h.queues=[],h},h.stateChanged=!1,h.doubleChecker=!1,h.doubleCheckComplete=function(){return h.stateChanged=!0,h.doubleCheckClear(),h},h.doubleCheckClear=function(){return h.doubleChecker&&(u(h.doubleChecker),h.doubleChecker=!1),h},h.doubleCheck=function(e){return h.stateChanged=!1,h.doubleCheckClear(),h.bugs.ieDoubleCheck&&(h.doubleChecker=o(function(){return h.doubleCheckClear(),h.stateChanged||e(),!0},h.options.doubleCheckInterval)),h},h.safariStatePoll=function(){var t=h.extractState(r.location.href),n;if(!h.isLastSavedState(t))return n=t,n||(n=h.createStateObject()),h.Adapter.trigger(e,"popstate"),h;return},h.back=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.back,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.back(!1)}),p.go(-1),!0)},h.forward=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.forward,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.forward(!1)}),p.go(1),!0)},h.go=function(e,t){var n;if(e>0)for(n=1;n<=e;++n)h.forward(t);else{if(!(e<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(n=-1;n>=e;--n)h.back(t)}return h};if(h.emulated.pushState){var d=function(){};h.pushState=h.pushState||d,h.replaceState=h.replaceState||d}else h.onPopState=function(t,n){var i=!1,s=!1,o,u;return h.doubleCheckComplete(),o=h.getHash(),o?(u=h.extractState(o||r.location.href,!0),u?h.replaceState(u.data,u.title,u.url,!1):(h.Adapter.trigger(e,"anchorchange"),h.busy(!1)),h.expectedStateId=!1,!1):(i=h.Adapter.extractEventData("state",t,n)||!1,i?s=h.getStateById(i):h.expectedStateId?s=h.getStateById(h.expectedStateId):s=h.extractState(r.location.href),s||(s=h.createStateObject(null,null,r.location.href)),h.expectedStateId=!1,h.isLastSavedState(s)?(h.busy(!1),!1):(h.storeState(s),h.saveState(s),h.setTitle(s),h.Adapter.trigger(e,"statechange"),h.busy(!1),!0))},h.Adapter.bind(e,"popstate",h.onPopState),h.pushState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.pushState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.pushState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0},h.replaceState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.replaceState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.replaceState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0};if(s){try{h.store=l.parse(s.getItem("History.store"))||{}}catch(v){h.store={}}h.normalizeStore()}else h.store={},h.normalizeStore();h.Adapter.bind(e,"beforeunload",h.clearAllIntervals),h.Adapter.bind(e,"unload",h.clearAllIntervals),h.saveState(h.storeState(h.extractState(r.location.href,!0))),s&&(h.onUnload=function(){var e,t;try{e=l.parse(s.getItem("History.store"))||{}}catch(n){e={}}e.idToState=e.idToState||{},e.urlToId=e.urlToId||{},e.stateToId=e.stateToId||{};for(t in h.idToState){if(!h.idToState.hasOwnProperty(t))continue;e.idToState[t]=h.idToState[t]}for(t in h.urlToId){if(!h.urlToId.hasOwnProperty(t))continue;e.urlToId[t]=h.urlToId[t]}for(t in h.stateToId){if(!h.stateToId.hasOwnProperty(t))continue;e.stateToId[t]=h.stateToId[t]}h.store=e,h.normalizeStore(),s.setItem("History.store",l.stringify(e))},h.intervalList.push(a(h.onUnload,h.options.storeInterval)),h.Adapter.bind(e,"beforeunload",h.onUnload),h.Adapter.bind(e,"unload",h.onUnload));if(!h.emulated.pushState){h.bugs.safariPoll&&h.intervalList.push(a(h.safariStatePoll,h.options.safariPollInterval));if(i.vendor==="Apple Computer, Inc."||(i.appCodeName||"")==="Mozilla")h.Adapter.bind(e,"hashchange",function(){h.Adapter.trigger(e,"popstate")}),h.getHash()&&h.Adapter.onDomLoad(function(){h.Adapter.trigger(e,"hashchange")})}},h.init()}(window)}catch(t){}}),timely.define("external_libs/jquery.tablescroller",["jquery_timely"],function(e){function n(){if(t)return t;var n=e('<div style="width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;"><div style="height:100px;"></div></div>');e("body").append(n);var r=e("div",n).innerWidth();n.css("overflow-y","auto");var i=e("div",n).innerWidth();return e(n).remove(),t=r-i,t}var t=0;e.fn.tableScroll=function(t){if(t=="undo"){var r=e(this).parent().parent();r.hasClass("tablescroll_wrapper")&&(r.find(".tablescroll_head thead").prependTo(this),r.find(".tablescroll_foot tfoot").appendTo(this),r.before(this),r.empty());return}var i=e.extend({},e.fn.tableScroll.defaults,t);return i.scrollbarWidth=n(),this.each(function(){var t=i.flush,n=e(this).addClass("tablescroll_body"),r=e('<div class="tablescroll_wrapper ai1ec-popover-boundary"></div>').insertBefore(n).append(n);r.parent("div").hasClass(i.containerClass)||e("<div></div>").addClass(i.containerClass).insertBefore(r).append(r);var s=i.width?i.width:n.outerWidth(),o=i.scroll?"auto":"hidden";r.css({width:s+"px",height:i.height+"px",overflow:o}),n.css("width",s+"px");var u=r.outerWidth(),a=u-s;r.css({width:s-a-2+"px"}),n.css("width",s-a-i.scrollbarWidth+"px"),n.outerHeight()<=i.height&&(r.css({height:"auto",width:s-a+"px"}),t=!1);var f=e("thead",n).length?!0:!1,l=e("tfoot",n).length?!0:!1,c=e("thead tr:first",n),h=e("tbody tr:first",n),p=e("tfoot tr:first",n),d=0;e("th, td",c).each(function(t){d=e(this).width(),e("th:eq("+t+"), td:eq("+t+")",c).css("width",d+"px"),e("th:eq("+t+"), td:eq("+t+")",h).css("width",d+"px"),l&&e("th:eq("+t+"), td:eq("+t+")",p).css("width",d+"px")});if(f)var v=e('<table class="tablescroll_head" cellspacing="0"></table>').insertBefore(r).prepend(e("thead",n));if(l)var m=e('<table class="tablescroll_foot" cellspacing="0"></table>').insertAfter(r).prepend(e("tfoot",n));v!=undefined&&(v.css("width",s+"px"),t&&(e("tr:first th:last, tr:first td:last",v).css("width",d+i.scrollbarWidth+"px"),v.css("width",r.outerWidth()+"px"))),m!=undefined&&(m.css("width",s+"px"),t&&(e("tr:first th:last, tr:first td:last",m).css("width",d+i.scrollbarWidth+"px"),m.css("width",r.outerWidth()+"px")))}),this},e.fn.tableScroll.defaults={flush:!0,width:null,height:100,containerClass:"tablescroll",scroll:!0}}),timely.define("external_libs/jquery.scrollTo",["jquery_timely"],function(e){function n(e){return typeof e=="object"?e:{top:e,left:e}}var t=e.scrollTo=function(t,n,r){e(window).scrollTo(t,n,r)};t.defaults={axis:"xy",duration:parseFloat(e.fn.jquery)>=1.3?0:1,limit:!0},t.window=function(t){return e(window)._scrollable()},e.fn._scrollable=function(){return this.map(function(){var t=this,n=!t.nodeName||e.inArray(t.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!n)return t;var r=(t.contentWindow||t).document||t.ownerDocument||t;return/webkit/i.test(navigator.userAgent)||r.compatMode=="BackCompat"?r.body:r.documentElement})},e.fn.scrollTo=function(r,i,s){return typeof i=="object"&&(s=i,i=0),typeof s=="function"&&(s={onAfter:s}),r=="max"&&(r=9e9),s=e.extend({},t.defaults,s),i=i||s.duration,s.queue=s.queue&&s.axis.length>1,s.queue&&(i/=2),s.offset=n(s.offset),s.over=n(s.over),this._scrollable().each(function(){function h(e){u.animate(l,i,s.easing,e&&function(){e.call(this,r,s)})}if(r==null)return;var o=this,u=e(o),a=r,f,l={},c=u.is("html,body");switch(typeof a){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(a)){a=n(a);break}a=e(a,this);if(!a.length)return;case"object":if(a.is||a.style)f=(a=e(a)).offset()}e.each(s.axis.split(""),function(e,n){var r=n=="x"?"Left":"Top",i=r.toLowerCase(),p="scroll"+r,d=o[p],v=t.max(o,n);if(f)l[p]=f[i]+(c?0:d-u.offset()[i]),s.margin&&(l[p]-=parseInt(a.css("margin"+r))||0,l[p]-=parseInt(a.css("border"+r+"Width"))||0),l[p]+=s.offset[i]||0,s.over[i]&&(l[p]+=a[n=="x"?"width":"height"]()*s.over[i]);else{var m=a[i];l[p]=m.slice&&m.slice(-1)=="%"?parseFloat(m)/100*v:m}s.limit&&/^\d+$/.test(l[p])&&(l[p]=l[p]<=0?0:Math.min(l[p],v)),!e&&s.queue&&(d!=l[p]&&h(s.onAfterFirst),delete l[p])}),h(s.onAfter)}).end()},t.max=function(t,n){var r=n=="x"?"Width":"Height",i="scroll"+r;if(!e(t).is("html,body"))return t[i]-e(t)[r.toLowerCase()]();var s="client"+r,o=t.ownerDocument.documentElement,u=t.ownerDocument.body;return Math.max(o[i],u[i])-Math.min(o[s],u[s])}}),timely.define("external_libs/locales/bootstrap-datepicker.bg",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.bg={days:["Неделя","Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота","Неделя"],daysShort:["Нед","Пон","Вто","Сря","Чет","Пет","Съб","Нед"],daysMin:["Н","П","В","С","Ч","П","С","Н"],months:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],monthsShort:["Ян","Фев","Мар","Апр","Май","Юни","Юли","Авг","Сеп","Окт","Ное","Дек"],today:"днес"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.br",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.br={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"]}}}}),timely.define("external_libs/locales/bootstrap-datepicker.cs",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.cs={days:["Neděle","Pondělí","Úterý","Středa","Čtvrtek","Pátek","Sobota","Neděle"],daysShort:["Ned","Pon","Úte","Stř","Čtv","Pát","Sob","Ned"],daysMin:["Ne","Po","Út","St","Čt","Pá","So","Ne"],months:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],monthsShort:["Led","Úno","Bře","Dub","Kvě","Čer","Čnc","Srp","Zář","Říj","Lis","Pro"],today:"Dnes"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.da",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.da={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I Dag",clear:"Nulstil"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.de",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.de={days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"],daysShort:["Son","Mon","Die","Mit","Don","Fre","Sam","Son"],daysMin:["So","Mo","Di","Mi","Do","Fr","Sa","So"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",clear:"Löschen",weekStart:1,format:"dd.mm.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.es",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.es={days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"],daysShort:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb","Dom"],daysMin:["Do","Lu","Ma","Mi","Ju","Vi","Sa","Do"],months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthsShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],today:"Hoy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.fi",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.fi={days:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai","sunnuntai"],daysShort:["sun","maa","tii","kes","tor","per","lau","sun"],daysMin:["su","ma","ti","ke","to","pe","la","su"],months:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],monthsShort:["tam","hel","maa","huh","tou","kes","hei","elo","syy","lok","mar","jou"],today:"tänään",weekStart:1,format:"d.m.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.fr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.fr={days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],daysMin:["D","L","Ma","Me","J","V","S","D"],months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthsShort:["Jan","Fév","Mar","Avr","Mai","Jui","Jul","Aou","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",clear:"Effacer",weekStart:1,format:"dd/mm/yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.id",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.id={days:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu","Minggu"],daysShort:["Mgu","Sen","Sel","Rab","Kam","Jum","Sab","Mgu"],daysMin:["Mg","Sn","Sl","Ra","Ka","Ju","Sa","Mg"],months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ags","Sep","Okt","Nov","Des"],today:"Hari Ini",clear:"Kosongkan"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.is",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.is={days:["Sunnudagur","Mánudagur","Þriðjudagur","Miðvikudagur","Fimmtudagur","Föstudagur","Laugardagur","Sunnudagur"],daysShort:["Sun","Mán","Þri","Mið","Fim","Fös","Lau","Sun"],daysMin:["Su","Má","Þr","Mi","Fi","Fö","La","Su"],months:["Janúar","Febrúar","Mars","Apríl","Maí","Júní","Júlí","Ágúst","September","Október","Nóvember","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Maí","Jún","Júl","Ágú","Sep","Okt","Nóv","Des"],today:"Í Dag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.it",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.it={days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato","Domenica"],daysShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab","Dom"],daysMin:["Do","Lu","Ma","Me","Gi","Ve","Sa","Do"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthsShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],today:"Oggi",clear:"Cancella",weekStart:1,format:"dd/mm/yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ja",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ja={days:["日曜","月曜","火曜","水曜","木曜","金曜","土曜","日曜"],daysShort:["日","月","火","水","木","金","土","日"],daysMin:["日","月","火","水","木","金","土","日"],months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],today:"今日",format:"yyyy/mm/dd"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.kr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.kr={days:["일요일","월요일","화요일","수요일","목요일","금요일","토요일","일요일"],daysShort:["일","월","화","수","목","금","토","일"],daysMin:["일","월","화","수","목","금","토","일"],months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],monthsShort:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]}}}}),timely.define("external_libs/locales/bootstrap-datepicker.lt",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.lt={days:["Sekmadienis","Pirmadienis","Antradienis","Trečiadienis","Ketvirtadienis","Penktadienis","Šeštadienis","Sekmadienis"],daysShort:["S","Pr","A","T","K","Pn","Š","S"],daysMin:["Sk","Pr","An","Tr","Ke","Pn","Št","Sk"],months:["Sausis","Vasaris","Kovas","Balandis","Gegužė","Birželis","Liepa","Rugpjūtis","Rugsėjis","Spalis","Lapkritis","Gruodis"],monthsShort:["Sau","Vas","Kov","Bal","Geg","Bir","Lie","Rugp","Rugs","Spa","Lap","Gru"],today:"Šiandien",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.lv",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.lv={days:["Svētdiena","Pirmdiena","Otrdiena","Trešdiena","Ceturtdiena","Piektdiena","Sestdiena","Svētdiena"],daysShort:["Sv","P","O","T","C","Pk","S","Sv"],daysMin:["Sv","Pr","Ot","Tr","Ce","Pk","Se","Sv"],months:["Janvāris","Februāris","Marts","Aprīlis","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jūn","Jūl","Aug","Sep","Okt","Nov","Dec"],today:"Šodien",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ms",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ms={days:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu","Ahad"],daysShort:["Aha","Isn","Sel","Rab","Kha","Jum","Sab","Aha"],daysMin:["Ah","Is","Se","Ra","Kh","Ju","Sa","Ah"],months:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],today:"Hari Ini"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.nb",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.nb={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],today:"I Dag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.nl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.nl={days:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zondag"],daysShort:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],daysMin:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],months:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"Vandaag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.pl={days:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota","Niedziela"],daysShort:["Nie","Pn","Wt","Śr","Czw","Pt","So","Nie"],daysMin:["N","Pn","Wt","Śr","Cz","Pt","So","N"],months:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],monthsShort:["Sty","Lu","Mar","Kw","Maj","Cze","Lip","Sie","Wrz","Pa","Lis","Gru"],today:"Dzisiaj",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pt-BR",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",clear:"Limpar"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pt",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.pt={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",clear:"Limpar"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ru",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ru={days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота","Воскресенье"],daysShort:["Вск","Пнд","Втр","Срд","Чтв","Птн","Суб","Вск"],daysMin:["Вс","Пн","Вт","Ср","Чт","Пт","Сб","Вс"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthsShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],today:"Сегодня",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.sl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.sl={days:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota","Nedelja"],daysShort:["Ned","Pon","Tor","Sre","Čet","Pet","Sob","Ned"],daysMin:["Ne","Po","To","Sr","Če","Pe","So","Ne"],months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],today:"Danes"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.sv",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.sv={days:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag","Söndag"],daysShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör","Sön"],daysMin:["Sö","Må","Ti","On","To","Fr","Lö","Sö"],months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I Dag",format:"yyyy-mm-dd",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.th",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.th={days:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัส","ศุกร์","เสาร์","อาทิตย์"],daysShort:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],daysMin:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],months:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],monthsShort:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],today:"วันนี้"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.tr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.tr={days:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi","Pazar"],daysShort:["Pz","Pzt","Sal","Çrş","Prş","Cu","Cts","Pz"],daysMin:["Pz","Pzt","Sa","Çr","Pr","Cu","Ct","Pz"],months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],monthsShort:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],today:"Bugün",format:"dd.mm.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.zh-CN",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["zh-CN"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今日",format:"yyyy年mm月dd日",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.zh-TW",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["zh-TW"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["週日","週一","週二","週三","週四","週五","週六","週日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今天",format:"yyyy年mm月dd日",weekStart:1}}}}),timely.define("external_libs/bootstrap_datepicker",["jquery_timely","ai1ec_config","external_libs/locales/bootstrap-datepicker.bg","external_libs/locales/bootstrap-datepicker.br","external_libs/locales/bootstrap-datepicker.cs","external_libs/locales/bootstrap-datepicker.da","external_libs/locales/bootstrap-datepicker.de","external_libs/locales/bootstrap-datepicker.es","external_libs/locales/bootstrap-datepicker.fi","external_libs/locales/bootstrap-datepicker.fr","external_libs/locales/bootstrap-datepicker.id","external_libs/locales/bootstrap-datepicker.is","external_libs/locales/bootstrap-datepicker.it","external_libs/locales/bootstrap-datepicker.ja","external_libs/locales/bootstrap-datepicker.kr","external_libs/locales/bootstrap-datepicker.lt","external_libs/locales/bootstrap-datepicker.lv","external_libs/locales/bootstrap-datepicker.ms","external_libs/locales/bootstrap-datepicker.nb","external_libs/locales/bootstrap-datepicker.nl","external_libs/locales/bootstrap-datepicker.pl","external_libs/locales/bootstrap-datepicker.pt-BR","external_libs/locales/bootstrap-datepicker.pt","external_libs/locales/bootstrap-datepicker.ru","external_libs/locales/bootstrap-datepicker.sl","external_libs/locales/bootstrap-datepicker.sv","external_libs/locales/bootstrap-datepicker.th","external_libs/locales/bootstrap-datepicker.tr","external_libs/locales/bootstrap-datepicker.zh-CN","external_libs/locales/bootstrap-datepicker.zh-TW"],function(e,t){function r(){return new Date(Date.UTC.apply(Date,arguments))}function i(){var e=new Date;return r(e.getFullYear(),e.getMonth(),e.getDate())}function s(e){return function(){return this[e].apply(this,arguments)}}function f(t,n){var r=e(t).data(),i={},s,o=new RegExp("^"+n.toLowerCase()+"([A-Z])"),n=new RegExp("^"+n.toLowerCase());for(var u in r)n.test(u)&&(s=u.replace(o,function(e,t){return t.toLowerCase()}),i[s]=r[u]);return i}function l(t){var n={};if(!d[t]){t=t.split("-")[0];if(!d[t])return}var r=d[t];return e.each(p,function(e,t){t in r&&(n[t]=r[t])}),n}var n=e(window),o=function(){var t={get:function(e){return this.slice(e)[0]},contains:function(e){var t=e&&e.valueOf();for(var n=0,r=this.length;n<r;n++)if(this[n].valueOf()===t)return n;return-1},remove:function(e){this.splice(e,1)},replace:function(t){if(!t)return;e.isArray(t)||(t=[t]),this.clear(),this.push.apply(this,t)},clear:function(){this.splice(0)},copy:function(){var e=new o;return e.replace(this),e}};return function(){var n=[];return n.push.apply(n,arguments),e.extend(n,t),n}}(),u=function(t,n){this.dates=new o,this.viewDate=i(),this.focusDate=null,this._process_options(n),this.element=e(t),this.isInline=!1,this.isInput=this.element.is("input"),this.component=this.element.is(".ai1ec-date")?this.element.find(".ai1ec-input-group, .ai1ec-input-group-addon, .ai1ec-btn"):!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&this.component.length===0&&(this.component=!1),this.picker=e(v.template),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("ai1ec-datepicker-inline").appendTo(this.element):this.picker.addClass("ai1ec-datepicker-dropdown ai1ec-dropdown-menu"),this.o.rtl&&this.picker.addClass("ai1ec-datepicker-rtl"),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("tfoot th.ai1ec-today").attr("colspan",function(e,t){return parseInt(t)+1}),this._allow_update=!1,this.setStartDate(this._o.startDate),this.setEndDate(this._o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};u.prototype={constructor:u,_process_options:function(n){this._o=e.extend({},this._o,n);var r=this.o=e.extend({},this._o),i=r.language;d[i]||(i=i.split("-")[0],d[i]||(i=t.language,d[i]||(i=h.language))),r.language=i;switch(r.startView){case 2:case"decade":r.startView=2;break;case 1:case"year":r.startView=1;break;default:r.startView=0}switch(r.minViewMode){case 1:case"months":r.minViewMode=1;break;case 2:case"years":r.minViewMode=2;break;default:r.minViewMode=0}r.startView=Math.max(r.startView,r.minViewMode),r.multidate!==!0&&(r.multidate=Number(r.multidate)||!1,r.multidate!==!1?r.multidate=Math.max(0,r.multidate):r.multidate=1),r.multidateSeparator=String(r.multidateSeparator),r.weekStart%=7,r.weekEnd=(r.weekStart+6)%7;var s=v.parseFormat(r.format);r.startDate!==-Infinity&&(r.startDate?r.startDate instanceof Date?r.startDate=this._local_to_utc(this._zero_time(r.startDate)):r.startDate=v.parseDate(r.startDate,s,r.language):r.startDate=-Infinity),r.endDate!==Infinity&&(r.endDate?r.endDate instanceof Date?r.endDate=this._local_to_utc(this._zero_time(r.endDate)):r.endDate=v.parseDate(r.endDate,s,r.language):r.endDate=Infinity),r.daysOfWeekDisabled=r.daysOfWeekDisabled||[],e.isArray(r.daysOfWeekDisabled)||(r.daysOfWeekDisabled=r.daysOfWeekDisabled.split(/[,\s]*/)),r.daysOfWeekDisabled=e.map(r.daysOfWeekDisabled,function(e){return parseInt(e,10)});var o=String(r.orientation).toLowerCase().split(/\s+/g),u=r.orientation.toLowerCase();o=e.grep(o,function(e){return/^auto|left|right|top|bottom$/.test(e)}),r.orientation={x:"auto",y:"auto"};if(!!u&&u!=="auto")if(o.length===1)switch(o[0]){case"top":case"bottom":r.orientation.y=o[0];break;case"left":case"right":r.orientation.x=o[0]}else u=e.grep(o,function(e){return/^left|right$/.test(e)}),r.orientation.x=u[0]||"auto",u=e.grep(o,function(e){return/^top|bottom$/.test(e)}),r.orientation.y=u[0]||"auto"},_events:[],_secondaryEvents:[],_applyEvents:function(e){for(var t=0,n,r,i;t<e.length;t++)n=e[t][0],e[t].length==2?(r=undefined,i=e[t][1]):e[t].length==3&&(r=e[t][1],i=e[t][2]),n.on(i,r)},_unapplyEvents:function(e){for(var t=0,n,r,i;t<e.length;t++)n=e[t][0],e[t].length==2?(i=undefined,r=e[t][1]):e[t].length==3&&(i=e[t][1],r=e[t][2]),n.off(r,i)},_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:e.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:e.proxy(this.keydown,this)}],[this.component,{click:e.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:e.proxy(this.show,this)}]],this._events.push([this.element,"*",{blur:e.proxy(function(e){this._focused_from=e.target},this)}],[this.element,{blur:e.proxy(function(e){this._focused_from=e.target},this)}]),this._secondaryEvents=[[this.picker,{click:e.proxy(this.click,this)}],[e(window),{resize:e.proxy(this.place,this)}],[e(document),{"mousedown touchstart":e.proxy(function(e){this.element.is(e.target)||this.element.find(e.target).length||this.picker.is(e.target)||this.picker.find(e.target).length||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(t,n){var r=n||this.dates.get(-1),i=this._utc_to_local(r);this.element.trigger({type:t,date:i,dates:e.map(this.dates,this._utc_to_local),format:e.proxy(function(e,t){arguments.length===0?(e=this.dates.length-1,t=this.o.format):typeof e=="string"&&(t=e,e=this.dates.length-1),t=t||this.o.format;var n=this.dates.get(e);return v.formatDate(n,t,this.o.language)},this)})},show:function(e){this.isInline||this.picker.appendTo("body"),this.picker.show(),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.place(),this._attachSecondaryEvents(),this._trigger("show")},hide:function(){if(this.isInline)return;if(!this.picker.is(":visible"))return;this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide")},remove:function(){this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date},_utc_to_local:function(e){return e&&new Date(e.getTime()+e.getTimezoneOffset()*6e4)},_local_to_utc:function(e){return e&&new Date(e.getTime()-e.getTimezoneOffset()*6e4)},_zero_time:function(e){return e&&new Date(e.getFullYear(),e.getMonth(),e.getDate())},_zero_utc_time:function(e){return e&&new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},getDates:function(){return e.map(this.dates,this._utc_to_local)},getUTCDates:function(){return e.map(this.dates,function(e){return new Date(e)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){return new Date(this.dates.get(-1))},setDates:function(){this.update.apply(this,arguments),this._trigger("changeDate"),this.setValue()},setUTCDates:function(){this.update.apply(this,e.map(arguments,this._utc_to_local)),this._trigger("changeDate"),this.setValue()},setDate:s("setDates"),setUTCDate:s("setUTCDates"),setValue:function(){var e=this.getFormattedDate();this.isInput?this.element.val(e).change():this.component&&this.element.find("input").val(e).change()},getFormattedDate:function(t){t===undefined&&(t=this.o.format);var n=this.o.language;return e.map(this.dates,function(e){return v.formatDate(e,t,n)}).join(this.o.multidateSeparator)},setStartDate:function(e){this._process_options({startDate:e}),this.update(),this.updateNavArrows()},setEndDate:function(e){this._process_options({endDate:e}),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(e){this._process_options({daysOfWeekDisabled:e}),this.update(),this.updateNavArrows()},place:function(){if(this.isInline)return;var t=this.picker.outerWidth(),r=this.picker.outerHeight(),i=10,s=n.width(),o=n.height(),u=n.scrollTop(),a=parseInt(this.element.parents().filter(function(){return e(this).css("z-index")!="auto"}).first().css("z-index"))+10,f=this.component?this.component.parent().offset():this.element.offset(),l=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),c=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),h=f.left,p=f.top;this.picker.removeClass("ai1ec-datepicker-orient-top ai1ec-datepicker-orient-bottom ai1ec-datepicker-orient-right ai1ec-datepicker-orient-left"),this.o.orientation.x!=="auto"?(this.picker.addClass("ai1ec-datepicker-orient-"+this.o.orientation.x),this.o.orientation.x==="right"&&(h-=t-c)):(this.picker.addClass("ai1ec-datepicker-orient-left"),f.left<0?h-=f.left-i:f.left+t>s&&(h=s-t-i));var d=this.o.orientation.y,v,m;d==="auto"&&(v=-u+f.top-r,m=u+o-(f.top+l+r),Math.max(v,m)===m?d="top":d="bottom"),this.picker.addClass("ai1ec-datepicker-orient-"+d),d==="top"?p+=l:p-=r+parseInt(this.picker.css("padding-top")),this.picker.css({top:p,left:h,zIndex:a})},_allow_update:!0,update:function(){if(!this._allow_update)return;var t=this.dates.copy(),n=[],r=!1;arguments.length?(e.each(arguments,e.proxy(function(e,t){t instanceof Date&&(t=this._local_to_utc(t)),n.push(t)},this)),r=!0):(n=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),n&&this.o.multidate?n=n.split(this.o.multidateSeparator):n=[n],delete this.element.data().date),n=e.map(n,e.proxy(function(e){return v.parseDate(e,this.o.format,this.o.language)},this)),n=e.grep(n,e.proxy(function(e){return e<this.o.startDate||e>this.o.endDate||!e},this),!0),this.dates.replace(n),this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate&&(this.viewDate=new Date(this.o.endDate)),r?this.setValue():n.length&&String(t)!==String(this.dates)&&this._trigger("changeDate"),!this.dates.length&&t.length&&this._trigger("clearDate"),this.fill()},fillDow:function(){var e=this.o.weekStart,t="<tr>";if(this.o.calendarWeeks){var n='<th class="ai1ec-cw">&nbsp;</th>';t+=n,this.picker.find(".ai1ec-datepicker-days thead tr:first-child").prepend(n)}while(e<this.o.weekStart+7)t+='<th class="ai1ec-dow">'+d[this.o.language].daysMin[e++%7]+"</th>";t+="</tr>",this.picker.find(".ai1ec-datepicker-days thead").append(t)},fillMonths:function(){var e="",t=0;while(t<12)e+='<span class="ai1ec-month">'+d[this.o.language].monthsShort[t++]+"</span>";this.picker.find(".ai1ec-datepicker-months td").html(e)},setRange:function(t){!t||!t.length?delete this.range:this.range=e.map(t,function(e){return e.valueOf()}),this.fill()},getClassNames:function(t){var n=[],r=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth(),s=new Date;return t.getUTCFullYear()<r||t.getUTCFullYear()==r&&t.getUTCMonth()<i?n.push("ai1ec-old"):(t.getUTCFullYear()>r||t.getUTCFullYear()==r&&t.getUTCMonth()>i)&&n.push("ai1ec-new"),this.focusDate&&t.valueOf()===this.focusDate.valueOf()&&n.push("ai1ec-focused"),this.o.todayHighlight&&t.getUTCFullYear()==s.getFullYear()&&t.getUTCMonth()==s.getMonth()&&t.getUTCDate()==s.getDate()&&n.push("ai1ec-today"),this.dates.contains(t)!==-1&&n.push("ai1ec-active"),(t.valueOf()<this.o.startDate||t.valueOf()>this.o.endDate||e.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled)!==-1)&&n.push("ai1ec-disabled"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&n.push("ai1ec-range"),e.inArray(t.valueOf(),this.range)!=-1&&n.push("ai1ec-selected")),n},fill:function(){var t=new Date(this.viewDate),n=t.getUTCFullYear(),i=t.getUTCMonth(),s=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,o=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,u=this.o.endDate!==Infinity?this.o.endDate.getUTCFullYear():Infinity,a=this.o.endDate!==Infinity?this.o.endDate.getUTCMonth():Infinity,f,l;this.picker.find(".ai1ec-datepicker-days thead th.ai1ec-datepicker-switch").text(d[this.o.language].months[i]+" "+n),this.picker.find("tfoot th.ai1ec-today").text(d[this.o.language].today).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot th.ai1ec-clear").text(d[this.o.language].clear).toggle(this.o.clearBtn!==!1),this.updateNavArrows(),this.fillMonths();var c=r(n,i-1,28),h=v.getDaysInMonth(c.getUTCFullYear(),c.getUTCMonth());c.setUTCDate(h),c.setUTCDate(h-(c.getUTCDay()-this.o.weekStart+7)%7);var p=new Date(c);p.setUTCDate(p.getUTCDate()+42),p=p.valueOf();var m=[],g;while(c.valueOf()<p){if(c.getUTCDay()==this.o.weekStart){m.push("<tr>");if(this.o.calendarWeeks){var y=new Date(+c+(this.o.weekStart-c.getUTCDay()-7)%7*864e5),b=new Date(+y+(11-y.getUTCDay())%7*864e5),w=new Date(+(w=r(b.getUTCFullYear(),0,1))+(11-w.getUTCDay())%7*864e5),E=(b-w)/864e5/7+1;m.push('<td class="ai1ec-cw">'+E+"</td>")}}g=this.getClassNames(c),g.push("ai1ec-day");if(this.o.beforeShowDay!==e.noop){var S=this.o.beforeShowDay(this._utc_to_local(c));S===undefined?S={}:typeof S=="boolean"?S={enabled:S}:typeof S=="string"&&(S={classes:S}),S.enabled===!1&&g.push("ai1ec-disabled"),S.classes&&(g=g.concat(S.classes.split(/\s+/))),S.tooltip&&(f=S.tooltip)}g=e.unique(g),m.push('<td class="'+g.join(" ")+'"'+(f?' title="'+f+'"':"")+">"+c.getUTCDate()+"</td>"),c.getUTCDay()==this.o.weekEnd&&m.push("</tr>"),c.setUTCDate(c.getUTCDate()+1)}this.picker.find(".ai1ec-datepicker-days tbody").empty().append(m.join(""));var x=this.picker.find(".ai1ec-datepicker-months").find("th:eq(1)").text(n).end().find("span").removeClass("ai1ec-active");e.each(this.dates,function(e,t){t.getUTCFullYear()==n&&x.eq(t.getUTCMonth()).addClass("ai1ec-active")}),(n<s||n>u)&&x.addClass("ai1ec-disabled"),n==s&&x.slice(0,o).addClass("ai1ec-disabled"),n==u&&x.slice(a+1).addClass("ai1ec-disabled"),m="",n=parseInt(n/10,10)*10;var T=this.picker.find(".ai1ec-datepicker-years").find("th:eq(1)").text(n+"-"+(n+9)).end().find("td");n-=1;var N=e.map(this.dates,function(e){return e.getUTCFullYear()}),C;for(var k=-1;k<11;k++)C=["ai1ec-year"],k===-1?C.push("ai1ec-old"):k===10&&C.push("ai1ec-new"),e.inArray(n,N)!==-1&&C.push("ai1ec-active"),(n<s||n>u)&&C.push("ai1ec-disabled"),m+='<span class="'+C.join(" ")+'">'+n+"</span>",n+=1;T.html(m)},updateNavArrows:function(){if(!this._allow_update)return;var e=new Date(this.viewDate),t=e.getUTCFullYear(),n=e.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-Infinity&&t<=this.o.startDate.getUTCFullYear()&&n<=this.o.startDate.getUTCMonth()?this.picker.find(".ai1ec-prev").css({visibility:"hidden"}):this.picker.find(".ai1ec-prev").css({visibility:"visible"}),this.o.endDate!==Infinity&&t>=this.o.endDate.getUTCFullYear()&&n>=this.o.endDate.getUTCMonth()?this.picker.find(".ai1ec-next").css({visibility:"hidden"}):this.picker.find(".ai1ec-next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-Infinity&&t<=this.o.startDate.getUTCFullYear()?this.picker.find(".ai1ec-prev").css({visibility:"hidden"}):this.picker.find(".ai1ec-prev").css({visibility:"visible"}),this.o.endDate!==Infinity&&t>=this.o.endDate.getUTCFullYear()?this.picker.find(".ai1ec-next").css({visibility:"hidden"}):this.picker.find(".ai1ec-next").css({visibility:"visible"})}},click:function(t){t.preventDefault();var n=e(t.target).closest("span, td, th"),i,s,o;if(n.length==1)switch(n[0].nodeName.toLowerCase()){case"th":switch(n[0].className){case"ai1ec-datepicker-switch":this.showMode(1);break;case"ai1ec-prev":case"ai1ec-next":var u=v.modes[this.viewMode].navStep*(n[0].className=="ai1ec-prev"?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,u),this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,u),this.viewMode===1&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"ai1ec-today":var a=new Date;a=r(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0),this.showMode(-2);var f=this.o.todayBtn=="linked"?null:"view";this._setDate(a,f);break;case"ai1ec-clear":var l;this.isInput?l=this.element:this.component&&(l=this.element.find("input")),l&&l.val("").change(),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()}break;case"span":n.is(".ai1ec-disabled")||(this.viewDate.setUTCDate(1),n.is(".ai1ec-month")?(o=1,s=n.parent().find("span").index(n),i=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(s),this._trigger("changeMonth",this.viewDate),this.o.minViewMode===1&&this._setDate(r(i,s,o))):(o=1,s=0,i=parseInt(n.text(),10)||0,this.viewDate.setUTCFullYear(i),this._trigger("changeYear",this.viewDate),this.o.minViewMode===2&&this._setDate(r(i,s,o))),this.showMode(-1),this.fill());break;case"td":n.is(".ai1ec-day")&&!n.is(".ai1ec-disabled")&&(o=parseInt(n.text(),10)||1,i=this.viewDate.getUTCFullYear(),s=this.viewDate.getUTCMonth(),n.is(".ai1ec-old")?s===0?(s=11,i-=1):s-=1:n.is(".ai1ec-new")&&(s==11?(s=0,i+=1):s+=1),this._setDate(r(i,s,o)))}this.picker.is(":visible")&&this._focused_from&&e(this._focused_from).focus(),delete this._focused_from},_toggle_multidate:function(e){var t=this.dates.contains(e);e?t!==-1?this.dates.remove(t):this.dates.push(e):this.dates.clear();if(typeof this.o.multidate=="number")while(this.dates.length>this.o.multidate)this.dates.remove(0)},_setDate:function(e,t){(!t||t=="date")&&this._toggle_multidate(e&&new Date(e));if(!t||t=="view")this.viewDate=e&&new Date(e);this.fill(),this.setValue(),this._trigger("changeDate");var n;this.isInput?n=this.element:this.component&&(n=this.element.find("input")),n&&n.change(),this.o.autoclose&&(!t||t=="date")&&this.hide()},moveMonth:function(e,t){if(!e)return undefined;if(!t)return e;var n=new Date(e.valueOf()),r=n.getUTCDate(),i=n.getUTCMonth(),s=Math.abs(t),o,u;t=t>0?1:-1;if(s==1){u=t==-1?function(){return n.getUTCMonth()==i}:function(){return n.getUTCMonth()!=o},o=i+t,n.setUTCMonth(o);if(o<0||o>11)o=(o+12)%12}else{for(var a=0;a<s;a++)n=this.moveMonth(n,t);o=n.getUTCMonth(),n.setUTCDate(r),u=function(){return o!=n.getUTCMonth()}}while(u())n.setUTCDate(--r),n.setUTCMonth(o);return n},moveYear:function(e,t){return this.moveMonth(e,t*12)},dateWithinRange:function(e){return e>=this.o.startDate&&e<=this.o.endDate},keydown:function(e){if(this.picker.is(":not(:visible)")){e.keyCode==27&&this.show();return}var t=!1,n,r,s,o=this.focusDate||this.viewDate;switch(e.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),e.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;n=e.keyCode==37?-1:1,e.ctrlKey?(r=this.moveYear(this.dates.get(-1)||i(),n),s=this.moveYear(o,n),this._trigger("changeYear",this.viewDate)):e.shiftKey?(r=this.moveMonth(this.dates.get(-1)||i(),n),s=this.moveMonth(o,n),this._trigger("changeMonth",this.viewDate)):(r=new Date(this.dates.get(-1)||i()),r.setUTCDate(r.getUTCDate()+n),s=new Date(o),s.setUTCDate(o.getUTCDate()+n)),this.dateWithinRange(r)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),e.preventDefault());break;case 38:case 40:if(!this.o.keyboardNavigation)break;n=e.keyCode==38?-1:1,e.ctrlKey?(r=this.moveYear(this.dates.get(-1)||i(),n),s=this.moveYear(o,n),this._trigger("changeYear",this.viewDate)):e.shiftKey?(r=this.moveMonth(this.dates.get(-1)||i(),n),s=this.moveMonth(o,n),this._trigger("changeMonth",this.viewDate)):(r=new Date(this.dates.get(-1)||i()),r.setUTCDate(r.getUTCDate()+n*7),s=new Date(o),s.setUTCDate(o.getUTCDate()+n*7)),this.dateWithinRange(r)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),e.preventDefault());break;case 32:break;case 13:o=this.focusDate||this.dates.get(-1)||this.viewDate,this._toggle_multidate(o),t=!0,this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(e.preventDefault(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}if(t){this.dates.length?this._trigger("changeDate"):this._trigger("clearDate");var u;this.isInput?u=this.element:this.component&&(u=this.element.find("input")),u&&u.change()}},showMode:function(e){e&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+e))),this.picker.find(">div").hide().filter(".ai1ec-datepicker-"+v.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}};var a=function(t,n){this.element=e(t),this.inputs=e.map(n.inputs,function(e){return e.jquery?e[0]:e}),delete n.inputs,e(this.inputs).datepicker(n).bind("changeDate",e.proxy(this.dateUpdated,this)),this.pickers=e.map(this.inputs,function(t){return e(t).data("datepicker")}),this.updateDates()};a.prototype={updateDates:function(){this.dates=e.map(this.pickers,function(e){return e.getUTCDate()}),this.updateRanges()},updateRanges:function(){var t=e.map(this.dates,function(e){return e.valueOf()});e.each(this.pickers,function(e,n){n.setRange(t)})},dateUpdated:function(t){if(this.updating)return;this.updating=!0;var n=e(t.target).data("datepicker"),r=n.getUTCDate(),i=e.inArray(t.target,this.inputs),s=this.inputs.length;if(i==-1)return;e.each(this.pickers,function(e,t){t.getUTCDate()||t.setUTCDate(r)});if(r<this.dates[i])while(i>=0&&r<this.dates[i])this.pickers[i--].setUTCDate(r);else if(r>this.dates[i])while(i<s&&r>this.dates[i])this.pickers[i++].setUTCDate(r);this.updateDates(),delete this.updating},remove:function(){e.map(this.pickers,function(e){e.remove()}),delete this.element.data().datepicker}};var c=e.fn.datepicker;e.fn.datepicker=function(t){var n=Array.apply(null,arguments);n.shift();var r;return this.each(function(){var i=e(this),s=i.data("datepicker"),o=typeof t=="object"&&t;if(!s){var c=f(this,"date"),p=e.extend({},h,c,o),d=l(p.language),v=e.extend({},h,d,c,o);if(i.is(".ai1ec-input-daterange")||v.inputs){var m={inputs:v.inputs||i.find("input").toArray()};i.data("datepicker",s=new a(this,e.extend(v,m)))}else i.data("datepicker",s=new u(this,v))}if(typeof t=="string"&&typeof s[t]=="function"){r=s[t].apply(s,n);if(r!==undefined)return!1}}),r!==undefined?r:this};var h=e.fn.datepicker.defaults={autoclose:!1,beforeShowDay:e.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:Infinity,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-Infinity,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0},p=e.fn.datepicker.locale_opts=["format","rtl","weekStart"];e.fn.datepicker.Constructor=u;var d=e.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"}},v={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(e){return e%4===0&&e%100!==0||e%400===0},getDaysInMonth:function(e,t){return[31,v.isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(e){var t=e.replace(this.validParts,"\0").split("\0"),n=e.match(this.validParts);if(!t||!t.length||!n||n.length===0)throw new Error("Invalid date format.");return{separators:t,parts:n}},parseDate:function(t,n,i){if(!t)return undefined;if(t instanceof Date)return t;typeof n=="string"&&(n=v.parseFormat(n));if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(t)){var s=/([\-+]\d+)([dmwy])/,o=t.match(/([\-+]\d+)([dmwy])/g),a,f;t=new Date;for(var l=0;l<o.length;l++){a=s.exec(o[l]),f=parseInt(a[1]);switch(a[2]){case"d":t.setUTCDate(t.getUTCDate()+f);break;case"m":t=u.prototype.moveMonth.call(u.prototype,t,f);break;case"w":t.setUTCDate(t.getUTCDate()+f*7);break;case"y":t=u.prototype.moveYear.call(u.prototype,t,f)}}return r(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),0,0,0)}var o=t&&t.match(this.nonpunctuation)||[],t=new Date,c={},h=["yyyy","yy","M","MM","m","mm","d","dd"],p={yyyy:function(e,t){return e.setUTCFullYear(t)},yy:function(e,t){return e.setUTCFullYear(2e3+t)},m:function(e,t){if(isNaN(e))return e;t-=1;while(t<0)t+=12;t%=12,e.setUTCMonth(t);while(e.getUTCMonth()!=t)e.setUTCDate(e.getUTCDate()-1);return e},d:function(e,t){return e.setUTCDate(t)}},m,g,a;p.M=p.MM=p.mm=p.m,p.dd=p.d,t=r(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0);var y=n.parts.slice();o.length!=y.length&&(y=e(y).filter(function(t,n){return e.inArray(n,h)!==-1}).toArray());if(o.length==y.length){for(var l=0,b=y.length;l<b;l++){m=parseInt(o[l],10),a=y[l];if(isNaN(m))switch(a){case"MM":g=e(d[i].months).filter(function(){var e=this.slice(0,o[l].length),t=o[l].slice(0,e.length);return e==t}),m=e.inArray(g[0],d[i].months)+1;break;case"M":g=e(d[i].monthsShort).filter(function(){var e=this.slice(0,o[l].length),t=o[l].slice(0,e.length);return e==t}),m=e.inArray(g[0],d[i].monthsShort)+1}c[a]=m}for(var l=0,w,E;l<h.length;l++)E=h[l],E in c&&!isNaN(c[E])&&(w=new Date(t),p[E](w,c[E]),isNaN(w)||(t=w))}return t},formatDate:function(t,n,r){if(!t)return"";typeof n=="string"&&(n=v.parseFormat(n));var i={d:t.getUTCDate(),D:d[r].daysShort[t.getUTCDay()],DD:d[r].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:d[r].monthsShort[t.getUTCMonth()],MM:d[r].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()};i.dd=(i.d<10?"0":"")+i.d,i.mm=(i.m<10?"0":"")+i.m;var t=[],s=e.extend([],n.separators);for(var o=0,u=n.parts.length;o<=u;o++)s.length&&t.push(s.shift()),t.push(i[n.parts[o]]);return t.join("")},headTemplate:'<thead><tr><th class="ai1ec-prev"><i class="ai1ec-fa ai1ec-fa-arrow-left"></i></th><th colspan="5" class="ai1ec-datepicker-switch"></th><th class="ai1ec-next"><i class="ai1ec-fa ai1ec-fa-arrow-right"></i></th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="ai1ec-today"></th></tr><tr><th colspan="7" class="ai1ec-clear"></th></tr></tfoot>'};v.template='<div class="ai1ec-datepicker"><div class="ai1ec-datepicker-days"><table class=" ai1ec-table-condensed">'+v.headTemplate+"<tbody></tbody>"+v.footTemplate+"</table>"+"</div>"+'<div class="ai1ec-datepicker-months">'+'<table class="ai1ec-table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table>"+"</div>"+'<div class="ai1ec-datepicker-years">'+'<table class="ai1ec-table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table>"+"</div>"+"</div>",e.fn.datepicker.DPGlobal=v,e.fn.datepicker.noConflict=function(){return e.fn.datepicker=c,this},e(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var n=e(this);if(n.data("datepicker"))return;t.preventDefault(),n.datepicker("show")}),e(function(){e('[data-provide="datepicker-inline"]').datepicker()});for(var m=2,g=arguments.length;m<g;m++)arguments[m].localize()}),timely.define("external_libs/bootstrap/alert",["jquery_timely"],function(e){var t='[data-dismiss="ai1ec-alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed.bs.alert").remove()}var n=e(this),r=n.attr("data-target");r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));var i=e(r);t&&t.preventDefault(),i.length||(i=n.hasClass("ai1ec-alert")?n:n.parent()),i.trigger(t=e.Event("close.bs.alert"));if(t.isDefaultPrevented())return;i.removeClass("ai1ec-in"),e.support.transition&&i.hasClass("ai1ec-fade")?i.one(e.support.transition.end,s).emulateTransitionEnd(150):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("bs.alert");i||r.data("bs.alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.bs.alert.data-api",t,n.prototype.close)}),timely.define("external_libs/jquery_cookie",["jquery_timely"],function(e){function n(e){return u.raw?e:encodeURIComponent(e)}function r(e){return u.raw?e:decodeURIComponent(e)}function i(e){return n(u.json?JSON.stringify(e):String(e))}function s(e){e.indexOf('"')===0&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(t," ")),u.json?JSON.parse(e):e}catch(n){}}function o(t,n){var r=u.raw?t:s(t);return e.isFunction(n)?n(r):r}var t=/\+/g,u=e.cookie=function(t,s,a){if(s!==undefined&&!e.isFunction(s)){a=e.extend({},u.defaults,a);if(typeof a.expires=="number"){var f=a.expires,l=a.expires=new Date;l.setTime(+l+f*864e5)}return document.cookie=[n(t),"=",i(s),a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+a.domain:"",a.secure?"; secure":""].join("")}var c=t?undefined:{},h=document.cookie?document.cookie.split("; "):[];for(var p=0,d=h.length;p<d;p++){var v=h[p].split("="),m=r(v.shift()),g=v.join("=");if(t&&t===m){c=o(g,s);break}!t&&(g=o(g))!==undefined&&(c[m]=g)}return c};u.defaults={},e.removeCookie=function(t,n){return e.cookie(t)===undefined?!1:(e.cookie(t,"",e.extend({},n,{expires:-1})),!e.cookie(t))}}),timely.define("scripts/calendar/load_views",["jquery_timely","scripts/calendar/print","scripts/calendar/agenda_view","scripts/calendar/month_view","libs/frontend_utils","libs/utils","ai1ec_calendar","ai1ec_config","scripts/common_scripts/frontend/common_frontend","libs/select2_multiselect_helper","external_libs/jquery_history","external_libs/jquery.tablescroller","external_libs/jquery.scrollTo","external_libs/bootstrap_datepicker","external_libs/bootstrap/alert","external_libs/jquery_cookie"],function(e,t,n,r,i,s,o,u,a,f){e.cookie.json=!0;var l="ai1ec_saved_filter",c=!e("#save_filtered_views").hasClass("ai1ec-hide"),h=function(){var t=e("#ai1ec-view-dropdown .ai1ec-dropdown-menu .ai1ec-active a"),n=u.week_view_ends_at-u.week_view_starts_at,i=n*60;e("table.ai1ec-week-view-original").tableScroll({height:i,containerClass:"ai1ec-week-view ai1ec-popover-boundary",scroll:!1}),e("table.ai1ec-oneday-view-original").tableScroll({height:i,containerClass:"ai1ec-oneday-view ai1ec-popover-boundary",scroll:!1});if(e(".ai1ec-week-view").length||e(".ai1ec-oneday-view").length)e(".ai1ec-oneday-view .tablescroll_wrapper, .ai1ec-week-view .tablescroll_wrapper").scrollTo(".ai1ec-hour-marker:eq("+u.week_view_starts_at+")"),e(".ai1ec-hour-marker:eq("+u.week_view_starts_at+")").addClass("ai1ec-first-visible");e(".ai1ec-month-view .ai1ec-multiday").length&&r.extend_multiday_events(),e("#ai1ec-calendar-view-container").trigger("initialize_view.ai1ec")},p=function(){e("#ai1ec-calendar-view-container").trigger("destroy_view.ai1ec");var t=e(".ai1ec-minical-trigger").data("datepicker");typeof t!="undefined"&&(t.picker.remove(),e(document).off("changeDate",".ai1ec-minical-trigger")),e(".ai1ec-tooltip.ai1ec-in, .ai1ec-popup").remove()},d=function(){var t=[],n=[],r=[],i;e(".ai1ec-category-filter .ai1ec-dropdown-menu .ai1ec-active").each(function(){t.push(e(this).data("term"))}),e(".ai1ec-tag-filter .ai1ec-dropdown-menu .ai1ec-active").each(function(){n.push(e(this).data("term"))}),e(".ai1ec-author-filter .ai1ec-dropdown-menu .ai1ec-active").each(function(){r.push(e(this).data("term"))});var s={};return s.cat_ids=t,s.tag_ids=n,s.auth_ids=r,i=e(".ai1ec-views-dropdown .ai1ec-dropdown-menu .ai1ec-active").data("action"),s.action=i,s},v=function(){var t=History.getState(),n=e.cookie(l);if(null===n||undefined===n)n={};var r=d();u.is_calendar_page?n.calendar_page=r:n[t.url]=r,e.cookie(l,n,{path:"/",expires:365}),e("#save_filtered_views").addClass("ai1ec-active").attr("data-original-title",u.clear_saved_filter_text);var i=s.make_alert(u.save_filter_text_ok,"success");e("#ai1ec-calendar").prepend(i)},m=function(t){t.stopImmediatePropagation();var n=e.cookie(l);if(u.is_calendar_page)delete n.calendar_page;else{var r=History.getState();delete n[r.url]}e.cookie(l,n,{path:"/",expires:365}),e("#save_filtered_views").removeClass("ai1ec-active").attr("data-original-title",u.reset_saved_filter_text),c||e("#save_filtered_views").addClass("ai1ec-hide");var i=s.make_alert(u.remove_filter_text_ok,"success");e("#ai1ec-calendar").prepend(i)},g=function(t,n){e("#ai1ec-calendar-view-loading").fadeIn("fast"),e("#ai1ec-calendar-view").fadeTo("fast",.3,function(){var r={request_type:n,ai1ec_doing_ajax:!0};e.ajax({url:t,dataType:n,data:r,method:"get",success:function(t){p(),typeof t.views_dropdown=="string"&&e(".ai1ec-views-dropdown").replaceWith(t.views_dropdown),typeof t.categories=="string"&&(e(".ai1ec-category-filter").replaceWith(t.categories),u.use_select2&&f.init(e(".ai1ec-category-filter"))),typeof t.authors=="string"&&(e(".ai1ec-author-filter").replaceWith(t.authors),u.use_select2&&f.init(e(".ai1ec-author-filter"))),typeof t.tags=="string"&&(e(".ai1ec-tag-filter").replaceWith(t.tags),u.use_select2&&f.init(e(".ai1ec-tag-filter"))),typeof t.subscribe_buttons=="string"&&e(".ai1ec-subscribe-container").replaceWith(t.subscribe_buttons),typeof t.save_view_btngroup=="string"&&e("#save_filtered_views").closest(".ai1ec-btn-group").replaceWith(t.save_view_btngroup),c=t.are_filters_set;var n=e("#ai1ec-calendar-view-container");n.height(n.height());var r=e("#ai1ec-calendar-view").html(t.html).height();n.animate({height:r},{complete:function(){n.height("auto")}}),e("#ai1ec-calendar-view-loading").fadeOut("fast"),e("#ai1ec-calendar-view").fadeTo("fast",1),h()}})})},y=!1,b=function(e){var t=History.getState();if(t.data.ai1ec!==undefined&&!0===t.data.ai1ec||!0===y)y=!0,g(t.url,"json")},w=function(e,t){if(e==="json"){var n={ai1ec:!0};History.pushState(n,document.title,decodeURI(t))}else g(t,"jsonp")},E=function(t){var n=e(this);t.preventDefault(),w(n.data("type"),n.attr("href"))},S=function(t){var n=e(this);t.preventDefault();if(typeof n.data("datepicker")=="undefined"){n.datepicker({todayBtn:"linked",todayHighlight:!0});var r=n.data("datepicker");r.picker.addClass("ai1ec-right-aligned");var i=r.place;r.place=function(){i.call(this);var t=this.component?this.component:this.element,n=t.offset();this.picker.css({left:"auto",right:e(document).width()-n.left-t.outerWidth()})},e(document).on("changeDate",".ai1ec-minical-trigger",x)}n.datepicker("show")},x=function(t){var n,r=e(this),i;r.datepicker("hide"),n=r.data("href"),i=t.format(),i=i.replace(/\//g,"-"),n=n.replace("__DATE__",i),w(r.data("type"),n)},T=function(t){var n;typeof t.added!="undefined"?n=e(t.added.element).data("href"):n=e("option[value="+t.removed.id+"]",t.target).data("href"),data={ai1ec:!0},History.pushState(data,null,n)},N=function(){w(e(this).data("type"),e(this).data("href"))};return{initialize_view:h,handle_click_on_link_to_load_view:E,handle_minical_trigger:S,handle_minical_change_date:x,clear_filters:N,handle_state_change:b,load_view:g,save_current_filter:v,remove_current_filter:m,load_view_from_select2_filter:T,load_view_according_to_datatype:w}}),timely.define("external_libs/bootstrap/transition",["jquery_timely"],function(e){function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(e.style[n]!==undefined)return{end:t[n]}}e.fn.emulateTransitionEnd=function(t){var n=!1,r=this;e(this).one(e.support.transition.end,function(){n=!0});var i=function(){n||e(r).trigger(e.support.transition.end)};return setTimeout(i,t),this},e(function(){e.support.transition=t()})}),timely.define("external_libs/bootstrap/modal",["jquery_timely"],function(e){var t=function(t,n){this.options=n,this.$element=e(t),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.load(this.options.remote)};t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},t.prototype.toggle=function(e){return this[this.isShown?"hide":"show"](e)},t.prototype.show=function(t){var n=this,r=e.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(r);if(this.isShown||r.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.$element.on("click.dismiss.modal",'[data-dismiss="ai1ec-modal"]',e.proxy(this.hide,this)),this.backdrop(function(){var r=e.support.transition&&n.$element.hasClass("ai1ec-fade");n.$element.parent().length||n.$element.appendTo(document.body),n.$element.show(),r&&n.$element[0].offsetWidth,n.$element.addClass("ai1ec-in").attr("aria-hidden",!1),n.enforceFocus();var i=e.Event("shown.bs.modal",{relatedTarget:t});r?n.$element.find(".ai1ec-modal-dialog").one(e.support.transition.end,function(){n.$element.focus().trigger(i)}).emulateTransitionEnd(300):n.$element.focus().trigger(i)})},t.prototype.hide=function(t){t&&t.preventDefault(),t=e.Event("hide.bs.modal"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.bs.modal"),this.$element.removeClass("ai1ec-in").attr("aria-hidden",!0).off("click.dismiss.modal"),e.support.transition&&this.$element.hasClass("ai1ec-fade")?this.$element.one(e.support.transition.end,e.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()},t.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){this.$element[0]!==e.target&&!this.$element.has(e.target).length&&this.$element.focus()},this))},t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",e.proxy(function(e){e.which==27&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},t.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden.bs.modal")})},t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},t.prototype.backdrop=function(t){var n=this,r=this.$element.hasClass("ai1ec-fade")?"ai1ec-fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="ai1ec-modal-backdrop '+r+'" />').appendTo(document.body),this.$element.on("click.dismiss.modal",e.proxy(function(e){if(e.target!==e.currentTarget)return;this.options.backdrop=="static"?this.$element[0].focus.call(this.$element[0]):this.hide.call(this)},this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("ai1ec-in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("ai1ec-in"),e.support.transition&&this.$element.hasClass("ai1ec-fade")?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()):t&&t()};var n=e.fn.modal;e.fn.modal=function(n,r){return this.each(function(){var i=e(this),s=i.data("bs.modal"),o=e.extend({},t.DEFAULTS,i.data(),typeof n=="object"&&n);s||i.data("bs.modal",s=new t(this,o)),typeof n=="string"?s[n](r):o.show&&s.show(r)})},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.bs.modal.data-api",'[data-toggle="ai1ec-modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s,this).one("hide",function(){n.is(":visible")&&n.focus()})}),e(document).on("show.bs.modal",".ai1ec-modal",function(){e(document.body).addClass("ai1ec-modal-open")}).on("hidden.bs.modal",".ai1ec-modal",function(){e(document.body).removeClass("ai1ec-modal-open")})}),timely.define("scripts/calendar",["jquery_timely","scripts/calendar/load_views","scripts/calendar/print","scripts/calendar/agenda_view","scripts/calendar/month_view","ai1ec_calendar","ai1ec_config","scripts/common_scripts/frontend/common_frontend","libs/utils","libs/select2_multiselect_helper","external_libs/bootstrap/transition","external_libs/bootstrap/modal","external_libs/jquery.scrollTo","external_libs/jquery_cookie"],function(e,t,n,r,i,s,o,u,a,f){var l=function(){if(s.selector!==undefined&&s.selector!==""&&e(s.selector).length===1){var t=e(":header:contains("+s.title+"):first");t.length||(t=e('<h1 class="page-title"></h1>'),t.text(s.title));var n=e("#ai1ec-container").detach().before(t);e(s.selector).empty().append(n).hide().css("visibility","visible").fadeIn("fast")}},c=function(){var t=e(this).data("instanceId");e(".ai1ec-event-instance-id-"+t).addClass("ai1ec-hover")},h=function(){var t=e(this).data("instanceId");e(".ai1ec-event-instance-id-"+t).removeClass("ai1ec-hover")},p=function(){var t=e(this),n=t.data("instanceId");t.delay(500).queue(function(){e(".ai1ec-event-instance-id-"+n).addClass("ai1ec-raised")})},d=function(t){var n=e(this),r=n.data("instanceId"),i=e(t.toElement||t.relatedTarget);if(i.is(".ai1ec-event-instance-id-"+r)||i.parent().is(".ai1ec-event-instance-id-"+r))return;e(".ai1ec-event-instance-id-"+r).clearQueue().removeClass("ai1ec-raised")},v=function(){l()},m=function(){e(document).on({mouseenter:c,mouseleave:h},".ai1ec-event-container.ai1ec-multiday"),e(document).on({mouseenter:p,mouseleave:d},".ai1ec-oneday-view .ai1ec-oneday .ai1ec-event-container, .ai1ec-week-view .ai1ec-week .ai1ec-event-container"),e(document).on("click",".ai1ec-agenda-view .ai1ec-event-header",r.toggle_event),e(document).on("click","#ai1ec-agenda-expand-all",r.expand_all),e(document).on("click","#ai1ec-agenda-collapse-all",r.collapse_all),e(document).on("click","a.ai1ec-load-view",t.handle_click_on_link_to_load_view),e(document).on("click",".ai1ec-minical-trigger",t.handle_minical_trigger),e(document).on("click",".ai1ec-clear-filter",t.clear_filters),e(document).on("click","#ai1ec-print-button",n.handle_click_on_print_button),e(document).on("click",".ai1ec-reveal-full-day button",function(){e(this).fadeOut();var t=e(".ai1ec-oneday-view-original"),n=e(".ai1ec-week-view-original");n.length===0&&(n=t);var r=e(".tablescroll_wrapper").offset().top-n.offset().top;e(window).scrollTo("+="+r+"px",400);var i=1440;e(".tablescroll_wrapper").animate({height:i+"px"})}),History.Adapter.bind(window,"statechange",t.handle_state_change),e(document).on("click","#ai1ec-calendar-view .ai1ec-load-event",function(t){t.preventDefault(),e.cookie.raw=!1,e.cookie("ai1ec_calendar_url",document.URL),window.location.href=this.href})},g=function(){f.init(e(".ai1ec-select2-filters")),e(document).on("change",".ai1ec-select2-multiselect-selector",t.load_view_from_select2_filter)},y=function(){e(document).on("page_ready.ai1ec",function(){v(),o.use_select2&&g(),m(),t.initialize_view()})};return{start:y}}),timely.require(["scripts/calendar"],function(e){e.start()}),timely.define("pages/calendar",function(){});
public/js/pages/common_backend.js CHANGED
@@ -90,4 +90,4 @@
90
  * limitations under the License.
91
  * ======================================================================== */
92
 
93
- timely.define("domReady",[],function(){function u(e){var t;for(t=0;t<e.length;t++)e[t](n)}function a(){var e=r;t&&e.length&&(r=[],u(e))}function f(){t||(t=!0,o&&clearInterval(o),a())}function c(e){return t?e(n):r.push(e),c}var e=typeof window!="undefined"&&window.document,t=!e,n=e?document:null,r=[],i,s,o;if(e){if(document.addEventListener)document.addEventListener("DOMContentLoaded",f,!1),window.addEventListener("load",f,!1);else if(window.attachEvent){window.attachEvent("onload",f),s=document.createElement("div");try{i=window.frameElement===null}catch(l){}s.doScroll&&i&&window.external&&(o=setInterval(function(){try{s.doScroll(),f()}catch(e){}},30))}(document.readyState==="complete"||document.readyState==="interactive")&&f()}return c.version="2.0.0",c.load=function(e,t,n,r){r.isBuild?n(null):c(n)},c}),timely.define("scripts/common_scripts/backend/common_ajax_handlers",["jquery_timely"],function(e){var t=function(t){t&&(typeof t.message!="undefined"?window.alert(t.message):e(".ai1ec-facebook-cron-dismiss-notification").closest(".message").fadeOut())},n=function(t){t.error?window.alert(t.message):e(".ai1ec-dismiss-notification").closest(".message").fadeOut()},r=function(t){t.error?window.alert(t.message):e(".ai1ec-dismiss-intro-video").closest(".message").fadeOut()},i=function(t){t.error?window.alert(t.message):e(".ai1ec-dismiss-license-warning").closest(".message").fadeOut()};return{handle_dismiss_plugins:t,handle_dismiss_notification:n,handle_dismiss_intro_video:r,handle_dismiss_license_warning:i}}),timely.define("scripts/common_scripts/backend/common_event_handlers",["jquery_timely","scripts/common_scripts/backend/common_ajax_handlers"],function(e,t){var n=function(n){var r={action:"ai1ec_facebook_cron_dismiss"};e.post(ajaxurl,r,t.handle_dismiss_plugins,"json")},r=function(n){var r=e(this);r.attr("disabled",!0);var i={action:"ai1ec_disable_notification",note:!1};e.post(ajaxurl,i,t.handle_dismiss_notification)},i=function(n){var r=e(this);r.attr("disabled",!0);var i={action:"ai1ec_disable_intro_video",note:!1};e.post(ajaxurl,i,t.handle_dismiss_intro_video)},s=function(n){var r=e(this);r.attr("disabled",!0);var i={action:"ai1ec_set_license_warning",value:"dismissed"};e.post(ajaxurl,i,t.handle_dismiss_license_warning)},o=function(t){e(this).parent().next(".ai1ec-limit-by-options-container").toggle().find("option").removeAttr("selected")};return{dismiss_plugins_messages_handler:n,dismiss_notification_handler:r,dismiss_intro_video_handler:i,dismiss_license_warning_handler:s,handle_multiselect_containers_widget_page:o}}),timely.define("external_libs/Placeholders",[],function(){function e(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent)return e.attachEvent("on"+t,n)}function t(e,t){var n,r;for(n=0,r=e.length;n<r;n++)if(e[n]===t)return!0;return!1}function n(e,t){var n;e.createTextRange?(n=e.createTextRange(),n.move("character",t),n.select()):e.selectionStart&&(e.focus(),e.setSelectionRange(t,t))}function r(e,t){try{return e.type=t,!0}catch(n){return!1}}function P(e){var t;return e.value===e.getAttribute(h)&&e.getAttribute(p)==="true"?(e.setAttribute(p,"false"),e.value="",e.className=e.className.replace(f,""),t=e.getAttribute(d),t&&(e.type=t),!0):!1}function H(e){var t;return e.value===""?(e.setAttribute(p,"true"),e.value=e.getAttribute(h),e.className+=" "+a,t=e.getAttribute(d),t?e.type="text":e.type==="password"&&S.changeType(e,"text")&&e.setAttribute(d,"password"),!0):!1}function B(e,t){var n,r,i,s,o;if(e&&e.getAttribute(h))t(e);else{n=e?e.getElementsByTagName("input"):n,r=e?e.getElementsByTagName("textarea"):r;for(o=0,s=n.length+r.length;o<s;o++)i=o<n.length?n[o]:r[o-n.length],t(i)}}function j(e){B(e,P)}function F(e){B(e,H)}function I(e){return function(){x&&e.value===e.getAttribute(h)&&e.getAttribute(p)==="true"?S.moveCaret(e,0):P(e)}}function q(e){return function(){H(e)}}function R(e){return function(t){N=e.value;if(e.getAttribute(p)==="true")return N!==e.getAttribute(h)||!S.inArray(o,t.keyCode)}}function U(e){return function(){var t;e.getAttribute(p)==="true"&&e.value!==N&&(e.className=e.className.replace(f,""),e.value=e.value.replace(e.getAttribute(h),""),e.setAttribute(p,!1),t=e.getAttribute(d),t&&(e.type=t)),e.value===""&&(e.blur(),S.moveCaret(e,0))}}function z(e){return function(){e===document.activeElement&&e.value===e.getAttribute(h)&&e.getAttribute(p)==="true"&&S.moveCaret(e,0)}}function W(e){return function(){j(e)}}function X(e){e.form&&(O=e.form,O.getAttribute(v)||(S.addEventListener(O,"submit",W(O)),O.setAttribute(v,"true"))),S.addEventListener(e,"focus",I(e)),S.addEventListener(e,"blur",q(e)),x&&(S.addEventListener(e,"keydown",R(e)),S.addEventListener(e,"keyup",U(e)),S.addEventListener(e,"click",z(e))),e.setAttribute(m,"true"),e.setAttribute(h,L),H(e)}var i={Utils:{addEventListener:e,inArray:t,moveCaret:n,changeType:r}},s=["text","search","url","tel","email","password","number","textarea"],o=[27,33,34,35,36,37,38,39,40,8,46],u="#ccc",a="placeholdersjs",f=new RegExp("\\b"+a+"\\b"),l,c,h="data-placeholder-value",p="data-placeholder-active",d="data-placeholder-type",v="data-placeholder-submit",m="data-placeholder-bound",g="data-placeholder-focus",y="data-placeholder-live",b=document.createElement("input"),w=document.getElementsByTagName("head")[0],E=document.documentElement,S=i.Utils,x,T,N,C,k,L,A,O,M,_,D;if(b.placeholder===void 0){l=document.getElementsByTagName("input"),c=document.getElementsByTagName("textarea"),x=E.getAttribute(g)==="false",T=E.getAttribute(y)!=="false",C=document.createElement("style"),C.type="text/css",k=document.createTextNode("."+a+" { color:"+u+"; }"),C.styleSheet?C.styleSheet.cssText=k.nodeValue:C.appendChild(k),w.insertBefore(C,w.firstChild);for(D=0,_=l.length+c.length;D<_;D++)M=D<l.length?l[D]:c[D-l.length],L=M.getAttribute("placeholder"),L&&S.inArray(s,M.type)&&X(M);A=setInterval(function(){for(D=0,_=l.length+c.length;D<_;D++){M=D<l.length?l[D]:c[D-l.length],L=M.getAttribute("placeholder");if(L&&S.inArray(s,M.type)){M.getAttribute(m)||X(M);if(L!==M.getAttribute(h)||M.type==="password"&&!M.getAttribute(d))M.type==="password"&&!M.getAttribute(d)&&S.changeType(M,"text")&&M.setAttribute(d,"password"),M.value===M.getAttribute(h)&&(M.value=L),M.setAttribute(h,L)}}T||clearInterval(A)},100)}return i.disable=j,i.enable=F,i}),timely.define("external_libs/bootstrap/tooltip",["jquery_timely"],function(e){var t=function(e,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",e,t)};t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="ai1ec-tooltip"><div class="ai1ec-tooltip-arrow"></div><div class="ai1ec-tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},t.prototype.init=function(t,n,r){this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(r);var i=this.options.trigger.split(" ");for(var s=i.length;s--;){var o=i[s];if(o=="click")this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if(o!="manual"){var u=o=="hover"?"mouseenter":"focus",a=o=="hover"?"mouseleave":"blur";this.$element.on(u+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(a+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.getOptions=function(t){return t=e.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},t.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,function(e,r){n[e]!=r&&(t[e]=r)}),t},t.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(n.timeout),n.hoverState="in";if(!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},t.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(n.timeout),n.hoverState="out";if(!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},t.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.tip();this.setContent(),this.options.animation&&n.addClass("ai1ec-fade");var r=typeof this.options.placement=="function"?this.options.placement.call(this,n[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,s=i.test(r);s&&(r=r.replace(i,"")||"top"),n.detach().css({top:0,left:0,display:"block"}).addClass("ai1ec-"+r),this.options.container?n.appendTo(this.options.container):n.insertAfter(this.$element);var o=this.getPosition(),u=n[0].offsetWidth,a=n[0].offsetHeight;if(s){var f=this.$element.parent(),l=r,c=document.documentElement.scrollTop||document.body.scrollTop,h=this.options.container=="body"?window.innerWidth:f.outerWidth(),p=this.options.container=="body"?window.innerHeight:f.outerHeight(),d=this.options.container=="body"?0:f.offset().left;r=r=="bottom"&&o.top+o.height+a-c>p?"top":r=="top"&&o.top-c-a<0?"bottom":r=="right"&&o.right+u>h?"left":r=="left"&&o.left-u<d?"right":r,n.removeClass("ai1ec-"+l).addClass("ai1ec-"+r)}var v=this.getCalculatedOffset(r,o,u,a);this.applyPlacement(v,r),this.$element.trigger("shown.bs."+this.type)}},t.prototype.applyPlacement=function(e,t){var n,r=this.tip(),i=r[0].offsetWidth,s=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),u=parseInt(r.css("margin-left"),10);isNaN(o)&&(o=0),isNaN(u)&&(u=0),e.top=e.top+o,e.left=e.left+u,r.offset(e).addClass("ai1ec-in");var a=r[0].offsetWidth,f=r[0].offsetHeight;t=="top"&&f!=s&&(n=!0,e.top=e.top+s-f);if(/bottom|top/.test(t)){var l=0;e.left<0&&(l=e.left*-2,e.left=0,r.offset(e),a=r[0].offsetWidth,f=r[0].offsetHeight),this.replaceArrow(l-i+a,a,"left")}else this.replaceArrow(f-s,f,"top");n&&r.offset(e)},t.prototype.replaceArrow=function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".ai1ec-tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("ai1ec-fade ai1ec-in ai1ec-top ai1ec-bottom ai1ec-left ai1ec-right")},t.prototype.hide=function(){function i(){t.hoverState!="in"&&n.detach()}var t=this,n=this.tip(),r=e.Event("hide.bs."+this.type);this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("ai1ec-in"),e.support.transition&&this.$tip.hasClass("ai1ec-fade")?n.one(e.support.transition.end,i).emulateTransitionEnd(150):i(),this.$element.trigger("hidden.bs."+this.type),this},t.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},t.prototype.hasContent=function(){return this.getTitle()},t.prototype.getPosition=function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},t.prototype.getCalculatedOffset=function(e,t,n,r){return e=="bottom"?{top:t.top+t.height,left:t.left+t.width/2-n/2}:e=="top"?{top:t.top-r,left:t.left+t.width/2-n/2}:e=="left"?{top:t.top+t.height/2-r/2,left:t.left-n}:{top:t.top+t.height/2-r/2,left:t.left+t.width}},t.prototype.getTitle=function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},t.prototype.tip=function(){return this.$tip=this.$tip||e(this.options.template)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".ai1ec-tooltip-arrow")},t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},t.prototype.enable=function(){this.enabled=!0},t.prototype.disable=function(){this.enabled=!1},t.prototype.toggleEnabled=function(){this.enabled=!this.enabled},t.prototype.toggle=function(t){var n=t?e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;n.tip().hasClass("ai1ec-in")?n.leave(n):n.enter(n)},t.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tooltip"),s=typeof n=="object"&&n;i||r.data("bs.tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}),timely.define("external_libs/bootstrap/popover",["jquery_timely","external_libs/bootstrap/tooltip"],function(e){var t=function(e,t){this.init("popover",e,t)};if(!e.fn.tooltip)throw new Error("Popover requires tooltip.js");t.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="ai1ec-popover"><div class="ai1ec-arrow"></div><h3 class="ai1ec-popover-title"></h3><div class="ai1ec-popover-content"></div></div>'}),t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),t.prototype.constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".ai1ec-popover-title")[this.options.html?"html":"text"](t),e.find(".ai1ec-popover-content")[this.options.html?"html":"text"](n),e.removeClass("ai1ec-fade ai1ec-top ai1ec-bottom ai1ec-left ai1ec-right ai1ec-in"),e.find(".ai1ec-popover-title").html()||e.find(".ai1ec-popover-title").hide()},t.prototype.hasContent=function(){return this.getTitle()||this.getContent()},t.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||(typeof t.content=="function"?t.content.call(e[0]):t.content)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".ai1ec-arrow")},t.prototype.tip=function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip};var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("bs.popover"),s=typeof n=="object"&&n;i||r.data("bs.popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}),timely.define("external_libs/bootstrap/modal",["jquery_timely"],function(e){var t=function(t,n){this.options=n,this.$element=e(t),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.load(this.options.remote)};t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},t.prototype.toggle=function(e){return this[this.isShown?"hide":"show"](e)},t.prototype.show=function(t){var n=this,r=e.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(r);if(this.isShown||r.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.$element.on("click.dismiss.modal",'[data-dismiss="ai1ec-modal"]',e.proxy(this.hide,this)),this.backdrop(function(){var r=e.support.transition&&n.$element.hasClass("ai1ec-fade");n.$element.parent().length||n.$element.appendTo(document.body),n.$element.show(),r&&n.$element[0].offsetWidth,n.$element.addClass("ai1ec-in").attr("aria-hidden",!1),n.enforceFocus();var i=e.Event("shown.bs.modal",{relatedTarget:t});r?n.$element.find(".ai1ec-modal-dialog").one(e.support.transition.end,function(){n.$element.focus().trigger(i)}).emulateTransitionEnd(300):n.$element.focus().trigger(i)})},t.prototype.hide=function(t){t&&t.preventDefault(),t=e.Event("hide.bs.modal"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.bs.modal"),this.$element.removeClass("ai1ec-in").attr("aria-hidden",!0).off("click.dismiss.modal"),e.support.transition&&this.$element.hasClass("ai1ec-fade")?this.$element.one(e.support.transition.end,e.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()},t.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){this.$element[0]!==e.target&&!this.$element.has(e.target).length&&this.$element.focus()},this))},t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",e.proxy(function(e){e.which==27&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},t.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden.bs.modal")})},t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},t.prototype.backdrop=function(t){var n=this,r=this.$element.hasClass("ai1ec-fade")?"ai1ec-fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="ai1ec-modal-backdrop '+r+'" />').appendTo(document.body),this.$element.on("click.dismiss.modal",e.proxy(function(e){if(e.target!==e.currentTarget)return;this.options.backdrop=="static"?this.$element[0].focus.call(this.$element[0]):this.hide.call(this)},this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("ai1ec-in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("ai1ec-in"),e.support.transition&&this.$element.hasClass("ai1ec-fade")?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()):t&&t()};var n=e.fn.modal;e.fn.modal=function(n,r){return this.each(function(){var i=e(this),s=i.data("bs.modal"),o=e.extend({},t.DEFAULTS,i.data(),typeof n=="object"&&n);s||i.data("bs.modal",s=new t(this,o)),typeof n=="string"?s[n](r):o.show&&s.show(r)})},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.bs.modal.data-api",'[data-toggle="ai1ec-modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s,this).one("hide",function(){n.is(":visible")&&n.focus()})}),e(document).on("show.bs.modal",".ai1ec-modal",function(){e(document.body).addClass("ai1ec-modal-open")}).on("hidden.bs.modal",".ai1ec-modal",function(){e(document.body).removeClass("ai1ec-modal-open")})}),timely.define("scripts/common_scripts/backend/common_backend",["jquery_timely","domReady","ai1ec_config","scripts/common_scripts/backend/common_event_handlers","external_libs/Placeholders","external_libs/bootstrap/tooltip","external_libs/bootstrap/popover","external_libs/bootstrap/modal"],function(e,t,n,r){var i=function(){e("#ai1ec-facebook-filter option[value=exportable]:selected").length>0&&e("table.wp-list-table tr.no-items").length===0&&n.facebook_logged_in==="1"&&(e("<option>").val("export-facebook").text("Export to facebook").appendTo("select[name='action']"),e("<option>").val("export-facebook").text("Export to facebook").appendTo("select[name='action2']"))},s=function(){if(n.platform_active==="1"){e("#menu-posts-ai1ec_event li").each(function(){var t=e(this);if(t.has('a[href$="all-in-one-event-calendar-themes"], a[href$="all-in-one-event-calendar-edit-css"], a[href$="all-in-one-event-calendar-settings"]').length){if(t.is(".current")){var n=e("a",t).attr("href");e('#adminmenu a:not(.current)[href="'+n+'"]').parent().andSelf().addClass("current").end().closest("li.menu-top").find("> a.menu-top").andSelf().addClass("wp-has-current-submenu wp-menu-open").removeClass("wp-not-current-submenu"),t.closest("li.menu-top").find("> a.menu-top").andSelf().removeClass("wp-has-current-submenu wp-menu-open").addClass("wp-not-current-submenu")}t.hide()}});if(e("body.options-reading-php").length){var t=function(){e("#page_on_front").attr("disabled","disabled")};t(),e("#front-static-pages input:radio").change(t),e("#page_on_front").after('<span class="description">'+n.page_on_front_description+"</span>")}n.strict_mode==="1"&&(e("#dashboard-widgets .postbox").not("#ai1ec-calendar-tasks, #dashboard_right_now").remove(),e("#adminmenu > li").not(".wp-menu-separator, #menu-dashboard, #menu-posts-ai1ec_event, #menu-media, #menu-appearance, #menu-users, #menu-settings").remove(),e("#menu-appearance > .wp-submenu li, #menu-settings > .wp-submenu li").not(':has(a[href*="all-in-one-event-calendar"])').remove())}},o=function(){e("#ai1ec-video").length&&(e.ajax({cache:!0,async:!0,dataType:"script",url:"//www.youtube.com/iframe_api"}),window.onYouTubeIframeAPIReady=function(){var t=new YT.Player("ai1ec-video",{height:"368",width:"600",videoId:window.ai1ecVideo.youtubeId});e("#ai1ec-video").css("display","block"),e("#ai1ec-video-modal").on("hide",function(){t.stopVideo()})})},u=function(){e(document).on("click",".ai1ec-facebook-cron-dismiss-notification",r.dismiss_plugins_messages_handler).on("click",".ai1ec-dismiss-notification",r.dismiss_notification_handler).on("click",".ai1ec-dismiss-intro-video",r.dismiss_intro_video_handler).on("click",".ai1ec-dismiss-license-warning",r.dismiss_license_warning_handler).on("click",".ai1ec-limit-by-cat, .ai1ec-limit-by-tag, .ai1ec-limit-by-event",r.handle_multiselect_containers_widget_page)},a=function(){e("#ai1ec-support .ai1ec-download a[title]").popover({placement:"left"}),e(".ai1ec-tooltip-toggle").tooltip({container:"body"})};n.page!==""&&(e(".if-js-closed").removeClass("if-js-closed").addClass("closed"),postboxes.add_postbox_toggles(n.page));var f=function(t){var n={tracking:t,action:"ai1ec_tracking"};e.post(ajaxurl,n)},l=function(){var t={content:"<h3>Help improve All In One Event Calendar</h3><p>Help us by sending some data</p>",position:{edge:"top",align:"center"},buttons:function(t,n){var r=e('<a id="pointer-close" style="margin-left:5px;" class="button-secondary">Do not allow tracking</a>');return r.bind("click.pointer",function(){n.element.pointer("close")}),r},close:function(){}};jQuery("#wpadminbar").pointer(t).pointer("open"),jQuery("#pointer-close").after('<a id="pointer-primary" class="button-primary">Allow tracking</a>'),jQuery("#pointer-primary").click(function(){f(!0),e(this).closest(".wp-pointer").remove()}),jQuery("#pointer-close").click(function(){f(!1)})},c=function(){t(function(){i(),o(),u(),s(),a(),n.show_tracking_popup&&l()})};return{start:c}}),timely.require(["scripts/common_scripts/backend/common_backend"],function(e){e.start()}),timely.define("pages/common_backend",function(){});
90
  * limitations under the License.
91
  * ======================================================================== */
92
 
93
+ timely.define("domReady",[],function(){function u(e){var t;for(t=0;t<e.length;t++)e[t](n)}function a(){var e=r;t&&e.length&&(r=[],u(e))}function f(){t||(t=!0,o&&clearInterval(o),a())}function c(e){return t?e(n):r.push(e),c}var e=typeof window!="undefined"&&window.document,t=!e,n=e?document:null,r=[],i,s,o;if(e){if(document.addEventListener)document.addEventListener("DOMContentLoaded",f,!1),window.addEventListener("load",f,!1);else if(window.attachEvent){window.attachEvent("onload",f),s=document.createElement("div");try{i=window.frameElement===null}catch(l){}s.doScroll&&i&&window.external&&(o=setInterval(function(){try{s.doScroll(),f()}catch(e){}},30))}(document.readyState==="complete"||document.readyState==="interactive")&&f()}return c.version="2.0.0",c.load=function(e,t,n,r){r.isBuild?n(null):c(n)},c}),timely.define("scripts/common_scripts/backend/common_ajax_handlers",["jquery_timely"],function(e){var t=function(t){t&&(typeof t.message!="undefined"?window.alert(t.message):e(".ai1ec-facebook-cron-dismiss-notification").closest(".message").fadeOut())},n=function(t){t.error?window.alert(t.message):e(".ai1ec-dismiss-notification").closest(".message").fadeOut()},r=function(t){t.error?window.alert(t.message):e(".ai1ec-dismiss-intro-video").closest(".message").fadeOut()},i=function(t){t.error?window.alert(t.message):e(".ai1ec-dismiss-license-warning").closest(".message").fadeOut()};return{handle_dismiss_plugins:t,handle_dismiss_notification:n,handle_dismiss_intro_video:r,handle_dismiss_license_warning:i}}),timely.define("scripts/common_scripts/backend/common_event_handlers",["jquery_timely","scripts/common_scripts/backend/common_ajax_handlers"],function(e,t){var n=function(n){var r={action:"ai1ec_facebook_cron_dismiss"};e.post(ajaxurl,r,t.handle_dismiss_plugins,"json")},r=function(n){var r=e(this);r.attr("disabled",!0);var i={action:"ai1ec_disable_notification",note:!1};e.post(ajaxurl,i,t.handle_dismiss_notification)},i=function(n){var r=e(this);r.attr("disabled",!0);var i={action:"ai1ec_disable_intro_video",note:!1};e.post(ajaxurl,i,t.handle_dismiss_intro_video)},s=function(n){var r=e(this);r.attr("disabled",!0);var i={action:"ai1ec_set_license_warning",value:"dismissed"};e.post(ajaxurl,i,t.handle_dismiss_license_warning)},o=function(t){e(this).parent().next(".ai1ec-limit-by-options-container").toggle().find("option").removeAttr("selected")};return{dismiss_plugins_messages_handler:n,dismiss_notification_handler:r,dismiss_intro_video_handler:i,dismiss_license_warning_handler:s,handle_multiselect_containers_widget_page:o}}),timely.define("external_libs/Placeholders",[],function(){function e(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent)return e.attachEvent("on"+t,n)}function t(e,t){var n,r;for(n=0,r=e.length;n<r;n++)if(e[n]===t)return!0;return!1}function n(e,t){var n;e.createTextRange?(n=e.createTextRange(),n.move("character",t),n.select()):e.selectionStart&&(e.focus(),e.setSelectionRange(t,t))}function r(e,t){try{return e.type=t,!0}catch(n){return!1}}function P(e){var t;return e.value===e.getAttribute(h)&&e.getAttribute(p)==="true"?(e.setAttribute(p,"false"),e.value="",e.className=e.className.replace(f,""),t=e.getAttribute(d),t&&(e.type=t),!0):!1}function H(e){var t;return e.value===""?(e.setAttribute(p,"true"),e.value=e.getAttribute(h),e.className+=" "+a,t=e.getAttribute(d),t?e.type="text":e.type==="password"&&S.changeType(e,"text")&&e.setAttribute(d,"password"),!0):!1}function B(e,t){var n,r,i,s,o;if(e&&e.getAttribute(h))t(e);else{n=e?e.getElementsByTagName("input"):n,r=e?e.getElementsByTagName("textarea"):r;for(o=0,s=n.length+r.length;o<s;o++)i=o<n.length?n[o]:r[o-n.length],t(i)}}function j(e){B(e,P)}function F(e){B(e,H)}function I(e){return function(){x&&e.value===e.getAttribute(h)&&e.getAttribute(p)==="true"?S.moveCaret(e,0):P(e)}}function q(e){return function(){H(e)}}function R(e){return function(t){N=e.value;if(e.getAttribute(p)==="true")return N!==e.getAttribute(h)||!S.inArray(o,t.keyCode)}}function U(e){return function(){var t;e.getAttribute(p)==="true"&&e.value!==N&&(e.className=e.className.replace(f,""),e.value=e.value.replace(e.getAttribute(h),""),e.setAttribute(p,!1),t=e.getAttribute(d),t&&(e.type=t)),e.value===""&&(e.blur(),S.moveCaret(e,0))}}function z(e){return function(){e===document.activeElement&&e.value===e.getAttribute(h)&&e.getAttribute(p)==="true"&&S.moveCaret(e,0)}}function W(e){return function(){j(e)}}function X(e){e.form&&(O=e.form,O.getAttribute(v)||(S.addEventListener(O,"submit",W(O)),O.setAttribute(v,"true"))),S.addEventListener(e,"focus",I(e)),S.addEventListener(e,"blur",q(e)),x&&(S.addEventListener(e,"keydown",R(e)),S.addEventListener(e,"keyup",U(e)),S.addEventListener(e,"click",z(e))),e.setAttribute(m,"true"),e.setAttribute(h,L),H(e)}var i={Utils:{addEventListener:e,inArray:t,moveCaret:n,changeType:r}},s=["text","search","url","tel","email","password","number","textarea"],o=[27,33,34,35,36,37,38,39,40,8,46],u="#ccc",a="placeholdersjs",f=new RegExp("\\b"+a+"\\b"),l,c,h="data-placeholder-value",p="data-placeholder-active",d="data-placeholder-type",v="data-placeholder-submit",m="data-placeholder-bound",g="data-placeholder-focus",y="data-placeholder-live",b=document.createElement("input"),w=document.getElementsByTagName("head")[0],E=document.documentElement,S=i.Utils,x,T,N,C,k,L,A,O,M,_,D;if(b.placeholder===void 0){l=document.getElementsByTagName("input"),c=document.getElementsByTagName("textarea"),x=E.getAttribute(g)==="false",T=E.getAttribute(y)!=="false",C=document.createElement("style"),C.type="text/css",k=document.createTextNode("."+a+" { color:"+u+"; }"),C.styleSheet?C.styleSheet.cssText=k.nodeValue:C.appendChild(k),w.insertBefore(C,w.firstChild);for(D=0,_=l.length+c.length;D<_;D++)M=D<l.length?l[D]:c[D-l.length],L=M.getAttribute("placeholder"),L&&S.inArray(s,M.type)&&X(M);A=setInterval(function(){for(D=0,_=l.length+c.length;D<_;D++){M=D<l.length?l[D]:c[D-l.length],L=M.getAttribute("placeholder");if(L&&S.inArray(s,M.type)){M.getAttribute(m)||X(M);if(L!==M.getAttribute(h)||M.type==="password"&&!M.getAttribute(d))M.type==="password"&&!M.getAttribute(d)&&S.changeType(M,"text")&&M.setAttribute(d,"password"),M.value===M.getAttribute(h)&&(M.value=L),M.setAttribute(h,L)}}T||clearInterval(A)},100)}return i.disable=j,i.enable=F,i}),timely.define("external_libs/bootstrap/tooltip",["jquery_timely"],function(e){var t=function(e,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",e,t)};t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="ai1ec-tooltip"><div class="ai1ec-tooltip-arrow"></div><div class="ai1ec-tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},t.prototype.init=function(t,n,r){this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(r);var i=this.options.trigger.split(" ");for(var s=i.length;s--;){var o=i[s];if(o=="click")this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if(o!="manual"){var u=o=="hover"?"mouseenter":"focus",a=o=="hover"?"mouseleave":"blur";this.$element.on(u+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(a+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.getOptions=function(t){return t=e.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},t.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,function(e,r){n[e]!=r&&(t[e]=r)}),t},t.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(n.timeout),n.hoverState="in";if(!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},t.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(n.timeout),n.hoverState="out";if(!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},t.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.tip();this.setContent(),this.options.animation&&n.addClass("ai1ec-fade");var r=typeof this.options.placement=="function"?this.options.placement.call(this,n[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,s=i.test(r);s&&(r=r.replace(i,"")||"top"),n.detach().css({top:0,left:0,display:"block"}).addClass("ai1ec-"+r),this.options.container?n.appendTo(this.options.container):n.insertAfter(this.$element);var o=this.getPosition(),u=n[0].offsetWidth,a=n[0].offsetHeight;if(s){var f=this.$element.parent(),l=r,c=document.documentElement.scrollTop||document.body.scrollTop,h=this.options.container=="body"?window.innerWidth:f.outerWidth(),p=this.options.container=="body"?window.innerHeight:f.outerHeight(),d=this.options.container=="body"?0:f.offset().left;r=r=="bottom"&&o.top+o.height+a-c>p?"top":r=="top"&&o.top-c-a<0?"bottom":r=="right"&&o.right+u>h?"left":r=="left"&&o.left-u<d?"right":r,n.removeClass("ai1ec-"+l).addClass("ai1ec-"+r)}var v=this.getCalculatedOffset(r,o,u,a);this.applyPlacement(v,r),this.$element.trigger("shown.bs."+this.type)}},t.prototype.applyPlacement=function(e,t){var n,r=this.tip(),i=r[0].offsetWidth,s=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),u=parseInt(r.css("margin-left"),10);isNaN(o)&&(o=0),isNaN(u)&&(u=0),e.top=e.top+o,e.left=e.left+u,r.offset(e).addClass("ai1ec-in");var a=r[0].offsetWidth,f=r[0].offsetHeight;t=="top"&&f!=s&&(n=!0,e.top=e.top+s-f);if(/bottom|top/.test(t)){var l=0;e.left<0&&(l=e.left*-2,e.left=0,r.offset(e),a=r[0].offsetWidth,f=r[0].offsetHeight),this.replaceArrow(l-i+a,a,"left")}else this.replaceArrow(f-s,f,"top");n&&r.offset(e)},t.prototype.replaceArrow=function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".ai1ec-tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("ai1ec-fade ai1ec-in ai1ec-top ai1ec-bottom ai1ec-left ai1ec-right")},t.prototype.hide=function(){function i(){t.hoverState!="in"&&n.detach()}var t=this,n=this.tip(),r=e.Event("hide.bs."+this.type);this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("ai1ec-in"),e.support.transition&&this.$tip.hasClass("ai1ec-fade")?n.one(e.support.transition.end,i).emulateTransitionEnd(150):i(),this.$element.trigger("hidden.bs."+this.type),this},t.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},t.prototype.hasContent=function(){return this.getTitle()},t.prototype.getPosition=function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},t.prototype.getCalculatedOffset=function(e,t,n,r){return e=="bottom"?{top:t.top+t.height,left:t.left+t.width/2-n/2}:e=="top"?{top:t.top-r,left:t.left+t.width/2-n/2}:e=="left"?{top:t.top+t.height/2-r/2,left:t.left-n}:{top:t.top+t.height/2-r/2,left:t.left+t.width}},t.prototype.getTitle=function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},t.prototype.tip=function(){return this.$tip=this.$tip||e(this.options.template)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".ai1ec-tooltip-arrow")},t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},t.prototype.enable=function(){this.enabled=!0},t.prototype.disable=function(){this.enabled=!1},t.prototype.toggleEnabled=function(){this.enabled=!this.enabled},t.prototype.toggle=function(t){var n=t?e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;n.tip().hasClass("ai1ec-in")?n.leave(n):n.enter(n)},t.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tooltip"),s=typeof n=="object"&&n;i||r.data("bs.tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}),timely.define("external_libs/bootstrap/popover",["jquery_timely","external_libs/bootstrap/tooltip"],function(e){var t=function(e,t){this.init("popover",e,t)};if(!e.fn.tooltip)throw new Error("Popover requires tooltip.js");t.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="ai1ec-popover"><div class="ai1ec-arrow"></div><h3 class="ai1ec-popover-title"></h3><div class="ai1ec-popover-content"></div></div>'}),t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),t.prototype.constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".ai1ec-popover-title")[this.options.html?"html":"text"](t),e.find(".ai1ec-popover-content")[this.options.html?"html":"text"](n),e.removeClass("ai1ec-fade ai1ec-top ai1ec-bottom ai1ec-left ai1ec-right ai1ec-in"),e.find(".ai1ec-popover-title").html()||e.find(".ai1ec-popover-title").hide()},t.prototype.hasContent=function(){return this.getTitle()||this.getContent()},t.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||(typeof t.content=="function"?t.content.call(e[0]):t.content)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".ai1ec-arrow")},t.prototype.tip=function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip};var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("bs.popover"),s=typeof n=="object"&&n;i||r.data("bs.popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}),timely.define("external_libs/bootstrap/modal",["jquery_timely"],function(e){var t=function(t,n){this.options=n,this.$element=e(t),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.load(this.options.remote)};t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},t.prototype.toggle=function(e){return this[this.isShown?"hide":"show"](e)},t.prototype.show=function(t){var n=this,r=e.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(r);if(this.isShown||r.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.$element.on("click.dismiss.modal",'[data-dismiss="ai1ec-modal"]',e.proxy(this.hide,this)),this.backdrop(function(){var r=e.support.transition&&n.$element.hasClass("ai1ec-fade");n.$element.parent().length||n.$element.appendTo(document.body),n.$element.show(),r&&n.$element[0].offsetWidth,n.$element.addClass("ai1ec-in").attr("aria-hidden",!1),n.enforceFocus();var i=e.Event("shown.bs.modal",{relatedTarget:t});r?n.$element.find(".ai1ec-modal-dialog").one(e.support.transition.end,function(){n.$element.focus().trigger(i)}).emulateTransitionEnd(300):n.$element.focus().trigger(i)})},t.prototype.hide=function(t){t&&t.preventDefault(),t=e.Event("hide.bs.modal"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.bs.modal"),this.$element.removeClass("ai1ec-in").attr("aria-hidden",!0).off("click.dismiss.modal"),e.support.transition&&this.$element.hasClass("ai1ec-fade")?this.$element.one(e.support.transition.end,e.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()},t.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){this.$element[0]!==e.target&&!this.$element.has(e.target).length&&this.$element.focus()},this))},t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",e.proxy(function(e){e.which==27&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},t.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden.bs.modal")})},t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},t.prototype.backdrop=function(t){var n=this,r=this.$element.hasClass("ai1ec-fade")?"ai1ec-fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="ai1ec-modal-backdrop '+r+'" />').appendTo(document.body),this.$element.on("click.dismiss.modal",e.proxy(function(e){if(e.target!==e.currentTarget)return;this.options.backdrop=="static"?this.$element[0].focus.call(this.$element[0]):this.hide.call(this)},this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("ai1ec-in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("ai1ec-in"),e.support.transition&&this.$element.hasClass("ai1ec-fade")?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()):t&&t()};var n=e.fn.modal;e.fn.modal=function(n,r){return this.each(function(){var i=e(this),s=i.data("bs.modal"),o=e.extend({},t.DEFAULTS,i.data(),typeof n=="object"&&n);s||i.data("bs.modal",s=new t(this,o)),typeof n=="string"?s[n](r):o.show&&s.show(r)})},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.bs.modal.data-api",'[data-toggle="ai1ec-modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s,this).one("hide",function(){n.is(":visible")&&n.focus()})}),e(document).on("show.bs.modal",".ai1ec-modal",function(){e(document.body).addClass("ai1ec-modal-open")}).on("hidden.bs.modal",".ai1ec-modal",function(){e(document.body).removeClass("ai1ec-modal-open")})}),timely.define("scripts/common_scripts/backend/common_backend",["jquery_timely","domReady","ai1ec_config","scripts/common_scripts/backend/common_event_handlers","external_libs/Placeholders","external_libs/bootstrap/tooltip","external_libs/bootstrap/popover","external_libs/bootstrap/modal"],function(e,t,n,r){var i=function(){e("#ai1ec-facebook-filter option[value=exportable]:selected").length>0&&e("table.wp-list-table tr.no-items").length===0&&n.facebook_logged_in==="1"&&(e("<option>").val("export-facebook").text("Export to facebook").appendTo("select[name='action']"),e("<option>").val("export-facebook").text("Export to facebook").appendTo("select[name='action2']"))},s=function(){if(n.platform_active==="1"){e("#menu-posts-ai1ec_event li").each(function(){var t=e(this);if(t.has('a[href$="all-in-one-event-calendar-themes"], a[href$="all-in-one-event-calendar-edit-css"], a[href$="all-in-one-event-calendar-settings"]').length){if(t.is(".current")){var n=e("a",t).attr("href");e('#adminmenu a:not(.current)[href="'+n+'"]').parent().andSelf().addClass("current").end().closest("li.menu-top").find("> a.menu-top").andSelf().addClass("wp-has-current-submenu wp-menu-open").removeClass("wp-not-current-submenu"),t.closest("li.menu-top").find("> a.menu-top").andSelf().removeClass("wp-has-current-submenu wp-menu-open").addClass("wp-not-current-submenu")}t.hide()}});if(e("body.options-reading-php").length){var t=function(){e("#page_on_front").attr("disabled","disabled")};t(),e("#front-static-pages input:radio").change(t),e("#page_on_front").after('<span class="description">'+n.page_on_front_description+"</span>")}n.strict_mode==="1"&&(e("#dashboard-widgets .postbox").not("#ai1ec-calendar-tasks, #dashboard_right_now").remove(),e("#adminmenu > li").not(".wp-menu-separator, #menu-dashboard, #menu-posts-ai1ec_event, #menu-media, #menu-appearance, #menu-users, #menu-settings").remove(),e("#menu-appearance > .wp-submenu li, #menu-settings > .wp-submenu li").not(':has(a[href*="all-in-one-event-calendar"])').remove())}},o=function(){e("#ai1ec-video").length&&(e.ajax({cache:!0,async:!0,dataType:"script",url:"//www.youtube.com/iframe_api"}),window.onYouTubeIframeAPIReady=function(){var t=new YT.Player("ai1ec-video",{height:"368",width:"600",videoId:window.ai1ecVideo.youtubeId});e("#ai1ec-video").css("display","block"),e("#ai1ec-video-modal").on("hide",function(){t.stopVideo()})})},u=function(){e(document).on("click",".ai1ec-facebook-cron-dismiss-notification",r.dismiss_plugins_messages_handler).on("click",".ai1ec-dismiss-notification",r.dismiss_notification_handler).on("click",".ai1ec-dismiss-intro-video",r.dismiss_intro_video_handler).on("click",".ai1ec-dismiss-license-warning",r.dismiss_license_warning_handler).on("click",".ai1ec-limit-by-cat, .ai1ec-limit-by-tag, .ai1ec-limit-by-event",r.handle_multiselect_containers_widget_page)},a=function(){e("#ai1ec-support .ai1ec-download a[title]").popover({placement:"left"}),e(".ai1ec-tooltip-toggle").tooltip({container:"body"})},f=function(t){var n={tracking:t,action:"ai1ec_tracking"};e.post(ajaxurl,n)},l=function(){var t={content:"<h3>Help improve All In One Event Calendar</h3><p>Help us by sending some data</p>",position:{edge:"top",align:"center"},buttons:function(t,n){var r=e('<a id="pointer-close" style="margin-left:5px;" class="button-secondary">Do not allow tracking</a>');return r.bind("click.pointer",function(){n.element.pointer("close")}),r},close:function(){}};jQuery("#wpadminbar").pointer(t).pointer("open"),jQuery("#pointer-close").after('<a id="pointer-primary" class="button-primary">Allow tracking</a>'),jQuery("#pointer-primary").click(function(){f(!0),e(this).closest(".wp-pointer").remove()}),jQuery("#pointer-close").click(function(){f(!1)})},c=function(){t(function(){i(),o(),u(),s(),a(),n.show_tracking_popup&&l()})};return{start:c}}),timely.require(["scripts/common_scripts/backend/common_backend"],function(e){e.start()}),timely.define("pages/common_backend",function(){});
public/js/scripts/add_new_event.js CHANGED
@@ -1 +1 @@
1
- timely.define(["jquery_timely","domReady","ai1ec_config","scripts/add_new_event/event_location/gmaps_helper","scripts/add_new_event/event_location/input_coordinates_event_handlers","scripts/add_new_event/event_location/input_coordinates_utility_functions","scripts/add_new_event/event_date_time/date_time_event_handlers","scripts/add_new_event/event_cost_helper","external_libs/jquery.calendrical_timespan","external_libs/jquery.inputdate","external_libs/jquery.tools","external_libs/ai1ec_datepicker","external_libs/bootstrap/transition","external_libs/bootstrap/collapse","external_libs/bootstrap/modal","external_libs/bootstrap/alert","external_libs/bootstrap/tab"],function(e,t,n,r,i,s,o,u,a){var f=function(){var t=new Date(n.now*1e3),r={allday:"#ai1ec_all_day_event",start_date_input:"#ai1ec_start-date-input",start_time_input:"#ai1ec_start-time-input",start_time:"#ai1ec_start-time",end_date_input:"#ai1ec_end-date-input",end_time_input:"#ai1ec_end-time-input",end_time:"#ai1ec_end-time",date_format:n.date_format,month_names:n.month_names,day_names:n.day_names,week_start_day:n.week_start_day,twentyfour_hour:n.twentyfour_hour,now:t};e.timespan(r);var i=e("#ai1ec_exdate").val(),s=null,o=!1,u;if(i.length>=8){s=[];var f=[];e.each(i.split(","),function(e,t){var r=t.slice(0,8),i=r.substr(0,4),o=r.substr(4,2);u=r.substr(6,2),o=o.charAt(0)==="0"?"0"+(parseInt(o.charAt(1),10)-1):parseInt(o,10)-1,s.push(new Date(i,o,u)),f.push(a.formatDate(new Date(i,o,u),n.date_format,!0))}),e("#widgetField span:first").html(f.join(", "))}else s=new Date(n.now*1e3),o=!0;e("#widgetCalendar").DatePicker({flat:!0,calendars:3,mode:"multiple",start:1,date:s,onChange:function(t){t=t.toString();if(t.length>=8){var r="",i=[];e.each(t.split(","),function(e,t){i.push(a.formatDate(new Date(t),n.date_format)),r+=t.replace(/-/g,"")+"T000000Z,"}),e("#widgetField span").html(i.join(", ")),r=r.slice(0,r.length-1),e("#ai1ec_exdate").val(r)}else e("#ai1ec_exdate").val("")}}),o&&e("#widgetCalendar").DatePickerClear(),e("#widgetCalendar div.datepicker").css("position","absolute")},l=function(){e(".ai1ec-panel-collapse").on("hide",function(){e(this).parent().removeClass("ai1ec-overflow-visible")}),e(".ai1ec-panel-collapse").on("shown",function(){var t=e(this);window.setTimeout(function(){t.parent().addClass("ai1ec-overflow-visible")},350)})},c=function(){f(),timely.require(["libs/gmaps"],function(e){e(r.init_gmaps)})},h=function(t,n){window.alert(n),t.preventDefault(),e("#publish, #ai1ec_bottom_publish").removeClass("button-primary-disabled"),e("#publish, #ai1ec_bottom_publish").siblings("#ajax-loading, .spinner").css("visibility","hidden")},p=function(t){s.ai1ec_check_lat_long_fields_filled_when_publishing_event(t)===!0&&(s.ai1ec_convert_commas_to_dots_for_coordinates(),s.ai1ec_check_lat_long_ok_for_search(t)),e("#ai1ec_ticket_url, #ai1ec_contact_url").each(function(){var e=this.value;if(""!==e){var r=/(http|https):\/\//;r.test(e)||h(t,n.url_not_valid)}})},d=function(){e("#ai1ec_google_map").click(i.toggle_visibility_of_google_map_on_click),e("#ai1ec_input_coordinates").change(i.toggle_visibility_of_coordinate_fields_on_click),e("#post").submit(p),e("input.coordinates").blur(i.update_map_from_coordinates_on_blur),e("#ai1ec_bottom_publish").on("click",o.trigger_publish),e(document).on("change","#ai1ec_end",o.show_end_fields).on("click","#ai1ec_repeat_apply",o.handle_click_on_apply_button).on("click","#ai1ec_repeat_cancel",o.handle_click_on_cancel_modal).on("click","#ai1ec_monthly_type_bymonthday, #ai1ec_monthly_type_byday",o.handle_checkbox_monthly_tab_modal).on("click",".ai1ec-btn-group-grid a",o.handle_click_on_toggle_buttons),e("#ai1ec_repeat_box").on("hidden.bs.modal",o.handle_modal_hide),o.execute_pseudo_handlers(),e("#widgetField > a, #widgetField > span, #ai1ec_exclude_date_label").on("click",o.handle_animation_of_calendar_widget),e("#ai1ec_is_free").on("change",u.handle_change_is_free)},v=function(){e("#ai1ec_event").insertAfter("#titlediv"),e("#post").addClass("ai1ec-visible")},m=function(){c(),t(function(){l(),v(),d()})};return{start:m}});
1
+ timely.define(["jquery_timely","domReady","ai1ec_config","scripts/add_new_event/event_location/gmaps_helper","scripts/add_new_event/event_location/input_coordinates_event_handlers","scripts/add_new_event/event_location/input_coordinates_utility_functions","scripts/add_new_event/event_date_time/date_time_event_handlers","scripts/add_new_event/event_cost_helper","external_libs/jquery.calendrical_timespan","external_libs/jquery.inputdate","external_libs/jquery.tools","external_libs/ai1ec_datepicker","external_libs/bootstrap/transition","external_libs/bootstrap/collapse","external_libs/bootstrap/modal","external_libs/bootstrap/alert","external_libs/bootstrap/tab"],function(e,t,n,r,i,s,o,u,a){var f=function(){var t=new Date(n.now*1e3),r={allday:"#ai1ec_all_day_event",start_date_input:"#ai1ec_start-date-input",start_time_input:"#ai1ec_start-time-input",start_time:"#ai1ec_start-time",end_date_input:"#ai1ec_end-date-input",end_time_input:"#ai1ec_end-time-input",end_time:"#ai1ec_end-time",date_format:n.date_format,month_names:n.month_names,day_names:n.day_names,week_start_day:n.week_start_day,twentyfour_hour:n.twentyfour_hour,now:t};e.timespan(r);var i=e("#ai1ec_exdate").val(),s=null,o=!1,u;if(i.length>=8){s=[];var f=[];e.each(i.split(","),function(e,t){var r=t.slice(0,8),i=r.substr(0,4),o=r.substr(4,2);u=r.substr(6,2),o=o.charAt(0)==="0"?"0"+(parseInt(o.charAt(1),10)-1):parseInt(o,10)-1,s.push(new Date(i,o,u)),f.push(a.formatDate(new Date(i,o,u),n.date_format,!0))}),e("#widgetField span:first").html(f.join(", "))}else s=new Date(n.now*1e3),o=!0;e("#widgetCalendar").DatePicker({flat:!0,calendars:3,mode:"multiple",start:1,date:s,onChange:function(t){t=t.toString();if(t.length>=8){var r="",i=[];e.each(t.split(","),function(e,t){i.push(a.formatDate(new Date(t),n.date_format)),r+=t.replace(/-/g,"")+"T000000Z,"}),e("#widgetField span").html(i.join(", ")),r=r.slice(0,r.length-1),e("#ai1ec_exdate").val(r)}else e("#ai1ec_exdate").val("")}}),o&&e("#widgetCalendar").DatePickerClear(),e("#widgetCalendar div.datepicker").css("position","absolute")},l=function(){e(".ai1ec-panel-collapse").on("hide",function(){e(this).parent().removeClass("ai1ec-overflow-visible")}),e(".ai1ec-panel-collapse").on("shown",function(){var t=e(this);window.setTimeout(function(){t.parent().addClass("ai1ec-overflow-visible")},350)})},c=function(){f(),timely.require(["libs/gmaps"],function(e){e(r.init_gmaps)})},h=function(t,n){window.alert(n),t.preventDefault(),e("#publish, #ai1ec_bottom_publish").removeClass("button-primary-disabled"),e("#publish, #ai1ec_bottom_publish").siblings("#ajax-loading, .spinner").css("visibility","hidden")},p=function(t){s.ai1ec_check_lat_long_fields_filled_when_publishing_event(t)===!0&&(s.ai1ec_convert_commas_to_dots_for_coordinates(),s.ai1ec_check_lat_long_ok_for_search(t)),e("#ai1ec_ticket_url, #ai1ec_contact_url").each(function(){var e=this.value;if(""!==e){var r=/(http|https):\/\//;r.test(e)||h(t,n.url_not_valid)}})},d=function(){e("#ai1ec_google_map").click(i.toggle_visibility_of_google_map_on_click),e("#ai1ec_input_coordinates").change(i.toggle_visibility_of_coordinate_fields_on_click),e("#post").submit(p),e("input.coordinates").blur(i.update_map_from_coordinates_on_blur),e("#ai1ec_bottom_publish").on("click",o.trigger_publish),e(document).on("change","#ai1ec_end",o.show_end_fields).on("click","#ai1ec_repeat_apply",o.handle_click_on_apply_button).on("click","#ai1ec_repeat_cancel",o.handle_click_on_cancel_modal).on("click","#ai1ec_monthly_type_bymonthday, #ai1ec_monthly_type_byday",o.handle_checkbox_monthly_tab_modal).on("click",".ai1ec-btn-group-grid a",o.handle_click_on_toggle_buttons),e("#ai1ec_repeat_box").on("hidden.bs.modal",o.handle_modal_hide),o.execute_pseudo_handlers(),e("#widgetField > a, #widgetField > span, #ai1ec_exclude_date_label").on("click",o.handle_animation_of_calendar_widget),e("#ai1ec_is_free").on("change",u.handle_change_is_free)},v=function(){e("#ai1ec_event").insertAfter("#titlediv")},m=function(){c(),t(function(){l(),v(),d()})};return{start:m}});
public/js/scripts/add_new_event/event_date_time/date_time_event_handlers.js CHANGED
@@ -1 +1 @@
1
- timely.define(["jquery_timely","ai1ec_config","scripts/add_new_event/event_date_time/date_time_utility_functions","external_libs/jquery.calendrical_timespan","libs/utils","external_libs/bootstrap/button"],function(e,t,n,r,i){var s=i.get_ajax_url(),o=function(){var t=e("#ai1ec_end option:selected").val();switch(t){case"0":e("#ai1ec_until_holder, #ai1ec_count_holder").collapse("hide");break;case"1":e("#ai1ec_until_holder").collapse("hide"),e("#ai1ec_count_holder").collapse("show");break;case"2":e("#ai1ec_count_holder").collapse("hide"),e("#ai1ec_until_holder").collapse("show")}},u=function(){e("#publish").trigger("click")},a=function(){var i=e(this),o="",u=e("#ai1ec_repeat_box .ai1ec-tab-pane.ai1ec-active"),a=u.data("freq");switch(a){case"daily":o+="FREQ=DAILY;";var f=e("#ai1ec_daily_count").val();f>1&&(o+="INTERVAL="+f+";");break;case"weekly":o+="FREQ=WEEKLY;";var l=e("#ai1ec_weekly_count").val();l>1&&(o+="INTERVAL="+l+";");var c=e('input[name="ai1ec_weekly_date_select"]:first').val(),h=e('#ai1ec_weekly_date_select > li:first > input[type="hidden"]:first').val();c.length>0&&(o+="WKST="+h+";BYday="+c+";");break;case"monthly":o+="FREQ=MONTHLY;";var p=e("#ai1ec_monthly_count").val(),d=e('input[name="ai1ec_monthly_type"]:checked').val();p>1&&(o+="INTERVAL="+p+";");var v=e('input[name="ai1ec_montly_date_select"]:first').val();if(v.length>0&&d==="bymonthday")o+="BYMONTHDAY="+v+";";else if(d==="byday"){var m=e("#ai1ec_monthly_byday_num").val(),g=e("#ai1ec_monthly_byday_weekday").val();o+="BYday="+m+g+";"}break;case"yearly":o+="FREQ=YEARLY;";var y=e("#ai1ec_yearly_count").val();y>1&&(o+="INTERVAL="+y+";");var b=e('input[name="ai1ec_yearly_date_select"]:first').val();b.length>0&&(o+="BYMONTH="+b+";")}var w=e("#ai1ec_end").val();if(w==="1")o+="COUNT="+e("#ai1ec_count").val()+";";else if(w==="2"){var E=e("#ai1ec_until-date-input").val();E=r.parseDate(E,t.date_format);var S=e("#ai1ec_start-time").val();S=r.parseDate(S,t.date_format),S=new Date(S);var x=E.getUTCDate(),T=E.getUTCMonth()+1,N=S.getUTCHours(),C=S.getUTCMinutes();T=T<10?"0"+T:T,x=x<10?"0"+x:x,N=N<10?"0"+N:N,C=C<10?"0"+C:C,E=E.getUTCFullYear()+""+T+x+"T235959Z",o+="UNTIL="+E+";"}var k={action:"ai1ec_rrule_to_text",rrule:o};i.button("loading").next().addClass("ai1ec-disabled"),e.post(s,k,function(t){t.error?(i.button("reset").next().removeClass("ai1ec-disabled"),"1"===e("#ai1ec_is_box_repeat").val()?n.repeat_form_error("#ai1ec_rrule","#ai1ec_repeat_label",t,i):n.repeat_form_error("#ai1ec_exrule","#ai1ec_exclude_label",t,i)):"1"===e("#ai1ec_is_box_repeat").val()?n.repeat_form_success("#ai1ec_rrule","#ai1ec_repeat_label","#ai1ec_repeat_text > a",o,i,t):n.repeat_form_success("#ai1ec_exrule","#ai1ec_exclude_label","#ai1ec_exclude_text > a",o,i,t)},"json")},f=function(){return e("#ai1ec_is_box_repeat").val()==="1"?n.click_on_modal_cancel("#ai1ec_repeat_text > a","#ai1ec_repeat","#ai1ec_repeat_label"):n.click_on_modal_cancel("#ai1ec_exclude_text > a","#ai1ec_exclude","#ai1ec_exclude_label"),e("#ai1ec_repeat_box").modal("hide"),!1},l=function(){e(this).is("#ai1ec_monthly_type_bymonthday")?(e("#ai1ec_repeat_monthly_byday").collapse("hide"),e("#ai1ec_repeat_monthly_bymonthday").collapse("show")):(e("#ai1ec_repeat_monthly_bymonthday").collapse("hide"),e("#ai1ec_repeat_monthly_byday").collapse("show"))},c=function(){var t=e(this),n=[],r=t.closest(".ai1ec-btn-group-grid"),i;t.toggleClass("ai1ec-active"),e("a",r).each(function(){var t=e(this);t.is(".ai1ec-active")&&(i=t.next().val(),n.push(i))}),r.next().val(n.join())},h=function(){n.click_on_ics_rule_text("#ai1ec_repeat_text > a","#ai1ec_repeat","#ai1ec_repeat_label",{action:"ai1ec_get_repeat_box",repeat:1,post_id:e("#post_ID").val()},n.init_modal_widgets),n.click_on_ics_rule_text("#ai1ec_exclude_text > a","#ai1ec_exclude","#ai1ec_exclude_label",{action:"ai1ec_get_repeat_box",repeat:0,post_id:e("#post_ID").val()},n.init_modal_widgets),n.click_on_checkbox("#ai1ec_repeat","#ai1ec_repeat_text > a","#ai1ec_repeat_label",{action:"ai1ec_get_repeat_box",repeat:1,post_id:e("#post_ID").val()},n.init_modal_widgets),n.click_on_checkbox("#ai1ec_exclude","#ai1ec_exclude_text > a","#ai1ec_exclude_label",{action:"ai1ec_get_repeat_box",repeat:0,post_id:e("#post_ID").val()},n.init_modal_widgets)},p=function(t){var n=e(this).data("state")===undefined?!1:e(this).data("state");return e("#widgetCalendar").stop().animate({height:n?0:e("#widgetCalendar div.datepicker").get(0).offsetHeight},500),e(this).data("state",!n),!1},d=function(){e(".ai1ec-modal-content",this).not(".ai1ec-loading ").remove().end().removeClass("ai1ec-hide")};return{show_end_fields:o,trigger_publish:u,handle_click_on_apply_button:a,handle_click_on_cancel_modal:f,handle_checkbox_monthly_tab_modal:l,execute_pseudo_handlers:h,handle_animation_of_calendar_widget:p,handle_click_on_toggle_buttons:c,handle_modal_hide:d}});
1
+ timely.define(["jquery_timely","ai1ec_config","scripts/add_new_event/event_date_time/date_time_utility_functions","external_libs/jquery.calendrical_timespan","libs/utils","external_libs/bootstrap/button"],function(e,t,n,r,i){var s=i.get_ajax_url(),o=function(){var t=e("#ai1ec_end option:selected").val();switch(t){case"0":e("#ai1ec_until_holder, #ai1ec_count_holder").collapse("hide");break;case"1":e("#ai1ec_until_holder").collapse("hide"),e("#ai1ec_count_holder").collapse("show");break;case"2":e("#ai1ec_count_holder").collapse("hide"),e("#ai1ec_until_holder").collapse("show")}},u=function(){e("#publish").trigger("click")},a=function(){var i=e(this),o="",u=e("#ai1ec_repeat_box .ai1ec-tab-pane.ai1ec-active"),a=u.data("freq");switch(a){case"daily":o+="FREQ=DAILY;";var f=e("#ai1ec_daily_count").val();f>1&&(o+="INTERVAL="+f+";");break;case"weekly":o+="FREQ=WEEKLY;";var l=e("#ai1ec_weekly_count").val();l>1&&(o+="INTERVAL="+l+";");var c=e('input[name="ai1ec_weekly_date_select"]:first').val(),h=e('#ai1ec_weekly_date_select > div:first > input[type="hidden"]:first').val();c.length>0&&(o+="WKST="+h+";BYday="+c+";");break;case"monthly":o+="FREQ=MONTHLY;";var p=e("#ai1ec_monthly_count").val(),d=e('input[name="ai1ec_monthly_type"]:checked').val();p>1&&(o+="INTERVAL="+p+";");var v=e('input[name="ai1ec_montly_date_select"]:first').val();if(v.length>0&&d==="bymonthday")o+="BYMONTHDAY="+v+";";else if(d==="byday"){var m=e("#ai1ec_monthly_byday_num").val(),g=e("#ai1ec_monthly_byday_weekday").val();o+="BYday="+m+g+";"}break;case"yearly":o+="FREQ=YEARLY;";var y=e("#ai1ec_yearly_count").val();y>1&&(o+="INTERVAL="+y+";");var b=e('input[name="ai1ec_yearly_date_select"]:first').val();b.length>0&&(o+="BYMONTH="+b+";")}var w=e("#ai1ec_end").val();if(w==="1")o+="COUNT="+e("#ai1ec_count").val()+";";else if(w==="2"){var E=e("#ai1ec_until-date-input").val();E=r.parseDate(E,t.date_format);var S=e("#ai1ec_start-time").val();S=r.parseDate(S,t.date_format),S=new Date(S);var x=E.getUTCDate(),T=E.getUTCMonth()+1,N=S.getUTCHours(),C=S.getUTCMinutes();T=T<10?"0"+T:T,x=x<10?"0"+x:x,N=N<10?"0"+N:N,C=C<10?"0"+C:C,E=E.getUTCFullYear()+""+T+x+"T235959Z",o+="UNTIL="+E+";"}var k={action:"ai1ec_rrule_to_text",rrule:o};i.button("loading").next().addClass("ai1ec-disabled"),e.post(s,k,function(t){t.error?(i.button("reset").next().removeClass("ai1ec-disabled"),"1"===e("#ai1ec_is_box_repeat").val()?n.repeat_form_error("#ai1ec_rrule","#ai1ec_repeat_label",t,i):n.repeat_form_error("#ai1ec_exrule","#ai1ec_exclude_label",t,i)):"1"===e("#ai1ec_is_box_repeat").val()?n.repeat_form_success("#ai1ec_rrule","#ai1ec_repeat_label","#ai1ec_repeat_text > a",o,i,t):n.repeat_form_success("#ai1ec_exrule","#ai1ec_exclude_label","#ai1ec_exclude_text > a",o,i,t)},"json")},f=function(){return e("#ai1ec_is_box_repeat").val()==="1"?n.click_on_modal_cancel("#ai1ec_repeat_text > a","#ai1ec_repeat","#ai1ec_repeat_label"):n.click_on_modal_cancel("#ai1ec_exclude_text > a","#ai1ec_exclude","#ai1ec_exclude_label"),e("#ai1ec_repeat_box").modal("hide"),!1},l=function(){e(this).is("#ai1ec_monthly_type_bymonthday")?(e("#ai1ec_repeat_monthly_byday").collapse("hide"),e("#ai1ec_repeat_monthly_bymonthday").collapse("show")):(e("#ai1ec_repeat_monthly_bymonthday").collapse("hide"),e("#ai1ec_repeat_monthly_byday").collapse("show"))},c=function(){var t=e(this),n=[],r=t.closest(".ai1ec-btn-group-grid"),i;t.toggleClass("ai1ec-active"),e("a",r).each(function(){var t=e(this);t.is(".ai1ec-active")&&(i=t.next().val(),n.push(i))}),r.next().val(n.join())},h=function(){n.click_on_ics_rule_text("#ai1ec_repeat_text > a","#ai1ec_repeat","#ai1ec_repeat_label",{action:"ai1ec_get_repeat_box",repeat:1,post_id:e("#post_ID").val()},n.init_modal_widgets),n.click_on_ics_rule_text("#ai1ec_exclude_text > a","#ai1ec_exclude","#ai1ec_exclude_label",{action:"ai1ec_get_repeat_box",repeat:0,post_id:e("#post_ID").val()},n.init_modal_widgets),n.click_on_checkbox("#ai1ec_repeat","#ai1ec_repeat_text > a","#ai1ec_repeat_label",{action:"ai1ec_get_repeat_box",repeat:1,post_id:e("#post_ID").val()},n.init_modal_widgets),n.click_on_checkbox("#ai1ec_exclude","#ai1ec_exclude_text > a","#ai1ec_exclude_label",{action:"ai1ec_get_repeat_box",repeat:0,post_id:e("#post_ID").val()},n.init_modal_widgets)},p=function(t){var n=e(this).data("state")===undefined?!1:e(this).data("state");return e("#widgetCalendar").stop().animate({height:n?0:e("#widgetCalendar div.datepicker").get(0).offsetHeight},500),e(this).data("state",!n),!1},d=function(){e(".ai1ec-modal-content",this).not(".ai1ec-loading ").remove().end().removeClass("ai1ec-hide")};return{show_end_fields:o,trigger_publish:u,handle_click_on_apply_button:a,handle_click_on_cancel_modal:f,handle_checkbox_monthly_tab_modal:l,execute_pseudo_handlers:h,handle_animation_of_calendar_widget:p,handle_click_on_toggle_buttons:c,handle_modal_hide:d}});
public/js/scripts/calendar.js CHANGED
@@ -304,4 +304,4 @@ OTHER DEALINGS IN THE SOFTWARE.
304
  * limitations under the License.
305
  * ======================================================================== */
306
 
307
- timely.define("scripts/calendar/print",["jquery_timely"],function(e){var t=function(t){t.preventDefault();var n=e("body"),r=e("html"),i=e("#ai1ec-container").html(),s=n.html();s=s.replace(/<script.*?>([\s\S]*?)<\/script>/gmi,""),n.empty(),n.addClass("timely"),r.addClass("ai1ec-print"),n.html(i),e("span").click(function(){return!1}),window.print(),n.removeClass("timely"),r.removeClass("ai1ec-print"),n.html(s)};return{handle_click_on_print_button:t}}),timely.define("scripts/calendar/agenda_view",["jquery_timely"],function(e){var t=function(){e(this).closest(".ai1ec-event").toggleClass("ai1ec-expanded").find(".ai1ec-event-summary").slideToggle(300)},n=function(){e(".ai1ec-expanded .ai1ec-event-toggle").click()},r=function(){e(".ai1ec-event:not(.ai1ec-expanded) .ai1ec-event-toggle").click()};return{toggle_event:t,collapse_all:n,expand_all:r}}),timely.define("external_libs/modernizr",[],function(){var e=function(e,t,n){function S(e){f.cssText=e}function x(e,t){return S(h.join(e+";")+(t||""))}function T(e,t){return typeof e===t}function N(e,t){return!!~(""+e).indexOf(t)}function C(e,t,r){for(var i in e){var s=t[e[i]];if(s!==n)return r===!1?e[i]:T(s,"function")?s.bind(r||t):s}return!1}var r="2.5.3",i={},s=!0,o=t.documentElement,u="modernizr",a=t.createElement(u),f=a.style,l,c={}.toString,h=" -webkit- -moz- -o- -ms- ".split(" "),p={},d={},v={},m=[],g=m.slice,y,b=function(e,n,r,i){var s,a,f,l=t.createElement("div"),c=t.body,h=c?c:t.createElement("body");if(parseInt(r,10))while(r--)f=t.createElement("div"),f.id=i?i[r]:u+(r+1),l.appendChild(f);return s=["&#173;","<style>",e,"</style>"].join(""),l.id=u,(c?l:h).innerHTML+=s,h.appendChild(l),c||(h.style.background="",o.appendChild(h)),a=n(l,e),c?l.parentNode.removeChild(l):h.parentNode.removeChild(h),!!a},w={}.hasOwnProperty,E;!T(w,"undefined")&&!T(w.call,"undefined")?E=function(e,t){return w.call(e,t)}:E=function(e,t){return t in e&&T(e.constructor.prototype[t],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if(typeof n!="function")throw new TypeError;var r=g.call(arguments,1),i=function(){if(this instanceof i){var e=function(){};e.prototype=n.prototype;var s=new e,o=n.apply(s,r.concat(g.call(arguments)));return Object(o)===o?o:s}return n.apply(t,r.concat(g.call(arguments)))};return i});var k=function(n,r){var s=n.join(""),o=r.length;b(s,function(n,r){var s=t.styleSheets[t.styleSheets.length-1],u=s?s.cssRules&&s.cssRules[0]?s.cssRules[0].cssText:s.cssText||"":"",a=n.childNodes,f={};while(o--)f[a[o].id]=a[o];i.touch="ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch||(f.touch&&f.touch.offsetTop)===9},o,r)}([,["@media (",h.join("touch-enabled),("),u,")","{#touch{top:9px;position:absolute}}"].join("")],[,"touch"]);p.touch=function(){return i.touch};for(var L in p)E(p,L)&&(y=L.toLowerCase(),i[y]=p[L](),m.push((i[y]?"":"no-")+y));return S(""),a=l=null,i._version=r,i._prefixes=h,i.testStyles=b,o.className=o.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(s?" js "+m.join(" "):""),i}(window,window.document);return e}),timely.define("scripts/calendar/month_view",["jquery_timely","external_libs/modernizr"],function(e,t){var n=navigator.userAgent.match(/opera/i),r=navigator.userAgent.match(/webkit/i),i=function(){var t=e(".ai1ec-day"),n=e(".ai1ec-week:first .ai1ec-day").length;e(".ai1ec-month-view .ai1ec-multiday").each(function(){var n=this.parentNode,r=e(this).outerHeight(!0),i=parseInt(e(this).data("endDay"),10),u=e(".ai1ec-date",n),a=parseInt(u.text(),10),f=e(this).data("endTruncated");f&&(i=parseInt(e(t[t.length-1]).text(),10));var l=e(this),c=e(".ai1ec-event",l)[0].style.backgroundColor,h=0,p=i-a+1,d=p,v,m=0;t.each(function(t){var n=e(".ai1ec-date",this),r=e(this.parentNode),u=r.index(),f=parseInt(n.text(),10);if(f>=a&&f<=i){f===a&&(v=parseInt(n.css("marginBottom"),10)+16),h===0&&m++;if(u===0&&f>a&&d!==0){var p=l.next(".ai1ec-popup").andSelf().clone(!1);n.parent().append(p);var g=p.first();g.addClass("ai1ec-multiday-bar ai1ec-multiday-clone"),g.css({position:"absolute",left:"1px",top:parseInt(n.css("marginBottom"),10)+13,backgroundColor:c});var y=d>7?7:d;g.css("width",s(y)),d>7&&g.append(o(1,c)),g.append(o(2,c))}h===0?n.css({marginBottom:v+"px"}):n.css({marginBottom:"+=16px"}),d--,d>0&&u===6&&h++}});if(f){var g=e("."+l[0].className.replace(/\s+/igm,".")).last();g.append(o(1,c))}e(this).css({position:"absolute",top:u.outerHeight(!0)-r-1+"px",left:"1px",width:s(m)}),h>0&&e(this).append(o(1,c)),e(this).data("startTruncated")&&e(this).append(o(2,c)).addClass("ai1ec-multiday-bar")})},s=function(e){var t;switch(e){case 1:t=97.5;break;case 2:t=198.7;break;case 3:t=300;break;case 4:t=401;break;case 5:r||n?t=507:t=503.4;break;case 6:r||n?t=608:t=603.5;break;case 7:r||n?t=709:t=705}return t+"%"},o=function(t,n){var r=e('<div class="ai1ec-multiday-arrow'+t+'"></div>');return t===1?r.css({borderLeftColor:n}):r.css({borderTopColor:n,borderRightColor:n,borderBottomColor:n}),r};return{extend_multiday_events:i}}),timely.define("libs/frontend_utils",[],function(){var e=function(e){var t,n;t=function(e){if(/&[^;]+;/.test(e)){var t=document.createElement("div");return t.innerHTML=e,t.firstChild?t.firstChild.nodeValue:e}return e};if(typeof e=="string")return t(e);if(typeof e=="object")for(n in e)typeof e[n]=="string"&&(e[n]=t(e[n]));return e},t=function(e,t,n){var r,i,s,o,u;if("#"===e.charAt(0)||"?"===e.charAt(0))e=e.substring(1);r={},e=e.split(t);for(i=0;i<e.length;i++)o=e[i].trim(),-1!==(u=o.indexOf(n))?(s=o.substring(0,u).trim(),o=o.substring(u+1).trim()):(s=o,o=!0),r[s]=o;return r},n=function(e){var n,r,i,s,o;e=t(e,"&","="),i=Object.keys(e),n={ai1ec:{},action:"month"};for(r=0;r<i.length;r++)if("ai1ec"===i[r]){var u=t(e[i[r]],"|",":");for(s in u)if(""!==u[s]){if("action"===s||"view"===s)n.action=u[s];n.ai1ec[s]=u[s]}}else"ai1ec_"===i[r].substring(0,6)?n.ai1ec[i[r].substring(6)]=e[i[r]]:n[i[r]]=e[i[r]];"ai1ec_"!==n.action.substring(0,6)&&(n.action="ai1ec_"+n.action),o="action="+n.action+"&ai1ec=";for(s in n.ai1ec)n.ai1ec.hasOwnProperty(s)&&(o+=escape(s)+":"+escape(n.ai1ec[s])+"|");o=o.substring(0,o.length-1);for(s in n)"ai1ec"!==s&&"action"!==s&&(o+="&"+s+"="+escape(n[s]));return o};return{ai1ec_convert_entities:e,ai1ec_map_internal_query:n,ai1ec_tokenize_uri:t}}),timely.define("external_libs/bootstrap/tab",["jquery_timely"],function(e){var t=function(t){this.element=e(t)};t.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.ai1ec-dropdown-menu)"),r=t.data("target");r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("ai1ec-active"))return;var i=n.find(".ai1ec-active:last a")[0],s=e.Event("show.bs.tab",{relatedTarget:i});t.trigger(s);if(s.isDefaultPrevented())return;var o=e(r);this.activate(t.parent("li"),n),this.activate(o,o.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:i})})},t.prototype.activate=function(t,n,r){function o(){i.removeClass("ai1ec-active").find("> .ai1ec-dropdown-menu > .ai1ec-active").removeClass("ai1ec-active"),t.addClass("ai1ec-active"),s?(t[0].offsetWidth,t.addClass("ai1ec-in")):t.removeClass("ai1ec-fade"),t.parent(".ai1ec-dropdown-menu")&&t.closest("li.ai1ec-dropdown").addClass("ai1ec-active"),r&&r()}var i=n.find("> .ai1ec-active"),s=r&&e.support.transition&&i.hasClass("ai1ec-fade");s?i.one(e.support.transition.end,o).emulateTransitionEnd(150):o(),i.removeClass("ai1ec-in")};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tab");i||r.data("bs.tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.bs.tab.data-api",'[data-toggle="ai1ec-tab"], [data-toggle="ai1ec-pill"]',function(t){t.preventDefault(),e(this).tab("show")})}),timely.define("libs/utils",["jquery_timely","external_libs/bootstrap/tab"],function(e){var t=function(){return{is_float:function(e){return!isNaN(parseFloat(e))},is_valid_coordinate:function(e,t){var n=t?90:180;return this.is_float(e)&&Math.abs(e)<n},convert_comma_to_dot:function(e){return e.replace(",",".")},field_has_value:function(t){var n="#"+t,r=e(n),i=!1;return r.length===1&&(i=e.trim(r.val())!==""),i},make_alert:function(t,n,r){var i="";switch(n){case"error":i="ai1ec-alert ai1ec-alert-danger";break;case"success":i="ai1ec-alert ai1ec-alert-success";break;default:i="ai1ec-alert"}var s=e("<div />",{"class":i,html:t});if(!r){var o=e("<button>",{type:"button","class":"ai1ec-close","data-dismiss":"ai1ec-alert",text:"×"});s.prepend(o)}return s},get_ajax_url:function(){return typeof window.ajaxurl=="undefined"?"http://localhost/wordpress/wp-admin/admin-ajax.php":window.ajaxurl},isUrl:function(e){var t=/(http|https|webcal):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(e)},isValidEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)},activate_saved_tab_on_page_load:function(t){null===t||undefined===t?e("ul.ai1ec-nav a:first").tab("show"):e("ul.ai1ec-nav a[href="+t+"]").tab("show")}}}();return t}),timely.define("domReady",[],function(){function u(e){var t;for(t=0;t<e.length;t++)e[t](n)}function a(){var e=r;t&&e.length&&(r=[],u(e))}function f(){t||(t=!0,o&&clearInterval(o),a())}function c(e){return t?e(n):r.push(e),c}var e=typeof window!="undefined"&&window.document,t=!e,n=e?document:null,r=[],i,s,o;if(e){if(document.addEventListener)document.addEventListener("DOMContentLoaded",f,!1),window.addEventListener("load",f,!1);else if(window.attachEvent){window.attachEvent("onload",f),s=document.createElement("div");try{i=window.frameElement===null}catch(l){}s.doScroll&&i&&window.external&&(o=setInterval(function(){try{s.doScroll(),f()}catch(e){}},30))}(document.readyState==="complete"||document.readyState==="interactive")&&f()}return c.version="2.0.0",c.load=function(e,t,n,r){r.isBuild?n(null):c(n)},c}),timely.define("scripts/common_scripts/frontend/common_event_handlers",["jquery_timely"],function(e){var t=function(t){var n=e(this),r=n.next(".ai1ec-popup"),i,s,o;if(r.length===0)return;i=r.html(),s=r.attr("class");var u=n.closest("#ai1ec-calendar-view");u.length===0&&(u=e("body")),n.offset().left-u.offset().left>182?o="left":o="right",n.constrained_popover({content:i,title:"",placement:o,trigger:"manual",html:!0,template:'<div class="timely ai1ec-popover '+s+'">'+'<div class="ai1ec-arrow"></div>'+'<div class="ai1ec-popover-inner">'+'<div class="ai1ec-popover-content"><div></div></div>'+"</div>"+"</div>",container:"body"}).constrained_popover("show")},n=function(t){var n=e(t.toElement||t.relatedTarget);n.closest(".ai1ec-popup").length===0&&e(this).constrained_popover("hide")},r=function(t){var n=e(t.toElement||t.relatedTarget);n.closest(".ai1ec-tooltip").length===0&&(e(this).remove(),e("body > .ai1ec-tooltip").remove())},i=function(t){var n=e(this),r={template:'<div class="timely ai1ec-tooltip"><div class="ai1ec-tooltip-arrow"></div><div class="ai1ec-tooltip-inner"></div></div>',trigger:"manual",container:"body"};if(n.is(".ai1ec-category .ai1ec-color-swatch"))return;n.tooltip(r),n.tooltip("show")},s=function(t){var n=e(t.toElement||t.relatedTarget);n.closest(".ai1ec-tooltip").length===0&&e(this).data("bs.tooltip")&&e(this).tooltip("hide")},o=function(t){var n=e(t.toElement||t.relatedTarget);n.closest(".ai1ec-tooltip-trigger").length===0&&e(this).remove(),n.closest(".ai1ec-popup").length===0&&e("body > .ai1ec-popup").remove()};return{handle_popover_over:t,handle_popover_out:n,handle_popover_self_out:r,handle_tooltip_over:i,handle_tooltip_out:s,handle_tooltip_self_out:o}}),timely.define("external_libs/bootstrap/tooltip",["jquery_timely"],function(e){var t=function(e,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",e,t)};t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="ai1ec-tooltip"><div class="ai1ec-tooltip-arrow"></div><div class="ai1ec-tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},t.prototype.init=function(t,n,r){this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(r);var i=this.options.trigger.split(" ");for(var s=i.length;s--;){var o=i[s];if(o=="click")this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if(o!="manual"){var u=o=="hover"?"mouseenter":"focus",a=o=="hover"?"mouseleave":"blur";this.$element.on(u+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(a+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.getOptions=function(t){return t=e.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},t.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,function(e,r){n[e]!=r&&(t[e]=r)}),t},t.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(n.timeout),n.hoverState="in";if(!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},t.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(n.timeout),n.hoverState="out";if(!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},t.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.tip();this.setContent(),this.options.animation&&n.addClass("ai1ec-fade");var r=typeof this.options.placement=="function"?this.options.placement.call(this,n[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,s=i.test(r);s&&(r=r.replace(i,"")||"top"),n.detach().css({top:0,left:0,display:"block"}).addClass("ai1ec-"+r),this.options.container?n.appendTo(this.options.container):n.insertAfter(this.$element);var o=this.getPosition(),u=n[0].offsetWidth,a=n[0].offsetHeight;if(s){var f=this.$element.parent(),l=r,c=document.documentElement.scrollTop||document.body.scrollTop,h=this.options.container=="body"?window.innerWidth:f.outerWidth(),p=this.options.container=="body"?window.innerHeight:f.outerHeight(),d=this.options.container=="body"?0:f.offset().left;r=r=="bottom"&&o.top+o.height+a-c>p?"top":r=="top"&&o.top-c-a<0?"bottom":r=="right"&&o.right+u>h?"left":r=="left"&&o.left-u<d?"right":r,n.removeClass("ai1ec-"+l).addClass("ai1ec-"+r)}var v=this.getCalculatedOffset(r,o,u,a);this.applyPlacement(v,r),this.$element.trigger("shown.bs."+this.type)}},t.prototype.applyPlacement=function(e,t){var n,r=this.tip(),i=r[0].offsetWidth,s=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),u=parseInt(r.css("margin-left"),10);isNaN(o)&&(o=0),isNaN(u)&&(u=0),e.top=e.top+o,e.left=e.left+u,r.offset(e).addClass("ai1ec-in");var a=r[0].offsetWidth,f=r[0].offsetHeight;t=="top"&&f!=s&&(n=!0,e.top=e.top+s-f);if(/bottom|top/.test(t)){var l=0;e.left<0&&(l=e.left*-2,e.left=0,r.offset(e),a=r[0].offsetWidth,f=r[0].offsetHeight),this.replaceArrow(l-i+a,a,"left")}else this.replaceArrow(f-s,f,"top");n&&r.offset(e)},t.prototype.replaceArrow=function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".ai1ec-tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("ai1ec-fade ai1ec-in ai1ec-top ai1ec-bottom ai1ec-left ai1ec-right")},t.prototype.hide=function(){function i(){t.hoverState!="in"&&n.detach()}var t=this,n=this.tip(),r=e.Event("hide.bs."+this.type);this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("ai1ec-in"),e.support.transition&&this.$tip.hasClass("ai1ec-fade")?n.one(e.support.transition.end,i).emulateTransitionEnd(150):i(),this.$element.trigger("hidden.bs."+this.type),this},t.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},t.prototype.hasContent=function(){return this.getTitle()},t.prototype.getPosition=function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},t.prototype.getCalculatedOffset=function(e,t,n,r){return e=="bottom"?{top:t.top+t.height,left:t.left+t.width/2-n/2}:e=="top"?{top:t.top-r,left:t.left+t.width/2-n/2}:e=="left"?{top:t.top+t.height/2-r/2,left:t.left-n}:{top:t.top+t.height/2-r/2,left:t.left+t.width}},t.prototype.getTitle=function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},t.prototype.tip=function(){return this.$tip=this.$tip||e(this.options.template)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".ai1ec-tooltip-arrow")},t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},t.prototype.enable=function(){this.enabled=!0},t.prototype.disable=function(){this.enabled=!1},t.prototype.toggleEnabled=function(){this.enabled=!this.enabled},t.prototype.toggle=function(t){var n=t?e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;n.tip().hasClass("ai1ec-in")?n.leave(n):n.enter(n)},t.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tooltip"),s=typeof n=="object"&&n;i||r.data("bs.tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}),timely.define("external_libs/bootstrap/popover",["jquery_timely","external_libs/bootstrap/tooltip"],function(e){var t=function(e,t){this.init("popover",e,t)};if(!e.fn.tooltip)throw new Error("Popover requires tooltip.js");t.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="ai1ec-popover"><div class="ai1ec-arrow"></div><h3 class="ai1ec-popover-title"></h3><div class="ai1ec-popover-content"></div></div>'}),t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),t.prototype.constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".ai1ec-popover-title")[this.options.html?"html":"text"](t),e.find(".ai1ec-popover-content")[this.options.html?"html":"text"](n),e.removeClass("ai1ec-fade ai1ec-top ai1ec-bottom ai1ec-left ai1ec-right ai1ec-in"),e.find(".ai1ec-popover-title").html()||e.find(".ai1ec-popover-title").hide()},t.prototype.hasContent=function(){return this.getTitle()||this.getContent()},t.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||(typeof t.content=="function"?t.content.call(e[0]):t.content)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".ai1ec-arrow")},t.prototype.tip=function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip};var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("bs.popover"),s=typeof n=="object"&&n;i||r.data("bs.popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}),timely.define("external_libs/constrained_popover",["jquery_timely","external_libs/bootstrap/popover"],function(e){var t=function(e,t){this.init("constrained_popover",e,t)};t.DEFAULTS=e.extend({},e.fn.popover.Constructor.DEFAULTS,{container:"",content:this.options}),t.prototype=e.extend({},e.fn.popover.Constructor.prototype),t.prototype.constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.applyPlacement=function(t,n){e.fn.popover.Constructor.prototype.applyPlacement.call(this,t,n);var r=this.tip(),i=r[0].offsetWidth,s=r[0].offsetHeight,o=this.getPosition(),u={};switch(n){case"left":newPos=this.defineBounds(o),typeof newPos.top=="undefined"?u.top=o.top+o.height/2-s/2:u.top=newPos.top-s/2,typeof newPos.left=="undefined"?u.left=o.left-i:u.left=newPos.left-i,r.offset(u);break;case"right":newPos=this.defineBounds(o),typeof newPos.top=="undefined"?u.top=o.top+o.height/2-s/2:u.top=newPos.top-s/2,typeof newPos.left=="undefined"?u.left=o.left+o.width:u.left=newPos.left+o.width,r.offset(u)}},t.prototype.defineBounds=function(t){var n,r,i,s,o,u={},a=e(this.options.container);return a.length?(n=a.offset(),r=n.top,i=n.left,s=r+a.height(),o=i+a.width(),t.top+t.height/2<r&&(u.top=r),t.top+t.height/2>s&&(u.top=s),t.left-t.width/2<i&&(u.left=i),t.left-t.width/2>o&&(u.left=o),u):!1};var n=e.fn.popover;e.fn.constrained_popover=function(n){return this.each(function(){var r=e(this),i=r.data("ai1ec.constrained_popover"),s=typeof n=="object"&&n;i||r.data("ai1ec.constrained_popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.constrained_popover.Constructor=t,e.fn.constrained_popover.noConflict=function(){return e.fn.constrained_popover=n,this}}),timely.define("external_libs/bootstrap/dropdown",["jquery_timely"],function(e){function i(){e(t).remove(),e(n).each(function(t){var n=s(e(this));if(!n.hasClass("ai1ec-open"))return;n.trigger(t=e.Event("hide.bs.dropdown"));if(t.isDefaultPrevented())return;n.removeClass("ai1ec-open").trigger("hidden.bs.dropdown")})}function s(t){var n=t.attr("data-target");n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r=n&&e(n);return r&&r.length?r:t.parent()}var t=".ai1ec-dropdown-backdrop",n="[data-toggle=ai1ec-dropdown]",r=function(t){e(t).on("click.bs.dropdown",this.toggle)};r.prototype.toggle=function(t){var n=e(this);if(n.is(".ai1ec-disabled, :disabled"))return;var r=s(n),o=r.hasClass("ai1ec-open");i();if(!o){"ontouchstart"in document.documentElement&&!r.closest(".ai1ec-navbar-nav").length&&e('<div class="ai1ec-dropdown-backdrop"/>').insertAfter(e(this)).on("click",i),r.trigger(t=e.Event("show.bs.dropdown"));if(t.isDefaultPrevented())return;r.toggleClass("ai1ec-open").trigger("shown.bs.dropdown"),n.focus()}return!1},r.prototype.keydown=function(t){if(!/(38|40|27)/.test(t.keyCode))return;var r=e(this);t.preventDefault(),t.stopPropagation();if(r.is(".ai1ec-disabled, :disabled"))return;var i=s(r),o=i.hasClass("ai1ec-open");if(!o||o&&t.keyCode==27)return t.which==27&&i.find(n).focus(),r.click();var u=e("[role=menu] li:not(.ai1ec-divider):visible a",i);if(!u.length)return;var a=u.index(u.filter(":focus"));t.keyCode==38&&a>0&&a--,t.keyCode==40&&a<u.length-1&&a++,~a||(a=0),u.eq(a).focus()};var o=e.fn.dropdown;e.fn.dropdown=function(t){return this.each(function(){var n=e(this),i=n.data("bs.dropdown");i||n.data("bs.dropdown",i=new r(this)),typeof t=="string"&&i[t].call(n)})},e.fn.dropdown.Constructor=r,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=o,this},e(document).on("click.bs.dropdown.data-api",i).on("click.bs.dropdown.data-api",".ai1ec-dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",n,r.prototype.toggle).on("keydown.bs.dropdown.data-api",n+", [role=menu]",r.prototype.keydown)}),timely.define("scripts/common_scripts/frontend/common_frontend",["jquery_timely","domReady","scripts/common_scripts/frontend/common_event_handlers","ai1ec_calendar","external_libs/modernizr","external_libs/bootstrap/tooltip","external_libs/constrained_popover","external_libs/bootstrap/dropdown"],function(e,t,n,r,i){var s=!1,o=function(){s=!0,e(document).on("mouseenter",".ai1ec-popup-trigger",n.handle_popover_over),e(document).on("mouseleave",".ai1ec-popup-trigger",n.handle_popover_out),e(document).on("mouseleave",".ai1ec-popup",n.handle_popover_self_out),e(document).on("mouseenter",".ai1ec-tooltip-trigger",n.handle_tooltip_over),e(document).on("mouseleave",".ai1ec-tooltip-trigger",n.handle_tooltip_out),e(document).on("mouseleave",".ai1ec-tooltip",n.handle_tooltip_self_out)},u=function(){t(function(){o()})},a=function(){return s};return{start:u,are_event_listeners_attached:a}}),timely.define("external_libs/select2",["jquery_timely"],function(e){(function(e){typeof e.fn.each2=="undefined"&&e.fn.extend({each2:function(t){var n=e([0]),r=-1,i=this.length;while(++r<i&&(n.context=n[0]=this[r])&&t.call(n[0],r,n)!==!1);return this}})})(e),function(e,t){function l(e,t){var n=0,r=t.length;for(;n<r;n+=1)if(c(e,t[n]))return n;return-1}function c(e,n){return e===n?!0:e===t||n===t?!1:e===null||n===null?!1:e.constructor===String?e===n+"":n.constructor===String?n===e+"":!1}function h(t,n){var r,i,s;if(t===null||t.length<1)return[];r=t.split(n);for(i=0,s=r.length;i<s;i+=1)r[i]=e.trim(r[i]);return r}function p(e){return e.outerWidth(!1)-e.width()}function d(n){var r="keyup-change-value";n.bind("keydown",function(){e.data(n,r)===t&&e.data(n,r,n.val())}),n.bind("keyup",function(){var i=e.data(n,r);i!==t&&n.val()!==i&&(e.removeData(n,r),n.trigger("keyup-change"))})}function v(n){n.bind("mousemove",function(n){var r=a;(r===t||r.x!==n.pageX||r.y!==n.pageY)&&e(n.target).trigger("mousemove-filtered",n)})}function m(e,n,r){r=r||t;var i;return function(){var t=arguments;window.clearTimeout(i),i=window.setTimeout(function(){n.apply(r,t)},e)}}function g(e){var t=!1,n;return function(){return t===!1&&(n=e(),t=!0),n}}function y(e,t){var n=m(e,function(e){t.trigger("scroll-debounced",e)});t.bind("scroll",function(e){l(e.target,t.get())>=0&&n(e)})}function b(e){if(e[0]===document.activeElement)return;window.setTimeout(function(){var t=e[0],n=e.val().length,r;e.focus(),t.setSelectionRange?t.setSelectionRange(n,n):t.createTextRange&&(r=t.createTextRange(),r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",n),r.select())},0)}function w(e){e.preventDefault(),e.stopPropagation()}function E(e){e.preventDefault(),e.stopImmediatePropagation()}function S(t){if(!u){var n=t[0].currentStyle||window.getComputedStyle(t[0],null);u=e(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:n.fontSize,fontFamily:n.fontFamily,fontStyle:n.fontStyle,fontWeight:n.fontWeight,letterSpacing:n.letterSpacing,textTransform:n.textTransform,whiteSpace:"nowrap"}),u.attr("class","select2-sizer"),e("body").append(u)}return u.text(t.val()),u.width()}function x(t,n,r){var i,s=[],o;i=t.attr("class"),typeof i=="string"&&e(i.split(" ")).each2(function(){this.indexOf("select2-")===0&&s.push(this)}),i=n.attr("class"),typeof i=="string"&&e(i.split(" ")).each2(function(){this.indexOf("select2-")!==0&&(o=r(this),typeof o=="string"&&o.length>0&&s.push(this))}),t.attr("class",s.join(" "))}function T(e,t,n,r){var i=e.toUpperCase().indexOf(t.toUpperCase()),s=t.length;if(i<0){n.push(r(e));return}n.push(r(e.substring(0,i))),n.push("<span class='select2-match'>"),n.push(r(e.substring(i,i+s))),n.push("</span>"),n.push(r(e.substring(i+s,e.length)))}function N(t){var n,r=0,i=null,s=t.quietMillis||100,o=t.url,u=this;return function(a){window.clearTimeout(n),n=window.setTimeout(function(){r+=1;var n=r,s=t.data,f=o,l=t.transport||e.ajax,c=t.type||"GET",h={};s=s?s.call(u,a.term,a.page,a.context):null,f=typeof f=="function"?f.call(u,a.term,a.page,a.context):f,null!==i&&i.abort(),t.params&&(e.isFunction(t.params)?e.extend(h,t.params.call(u)):e.extend(h,t.params)),e.extend(h,{url:f,dataType:t.dataType,data:s,type:c,cache:!1,success:function(e){if(n<r)return;var i=t.results(e,a.page);a.callback(i)}}),i=l.call(u,h)},s)}}function C(t){var n=t,r,i,s=function(e){return""+e.text};e.isArray(n)&&(i=n,n={results:i}),e.isFunction(n)===!1&&(i=n,n=function(){return i});var o=n();return o.text&&(s=o.text,e.isFunction(s)||(r=n.text,s=function(e){return e[r]})),function(t){var r=t.term,i={results:[]},o;if(r===""){t.callback(n());return}o=function(n,i){var u,a;n=n[0];if(n.children){u={};for(a in n)n.hasOwnProperty(a)&&(u[a]=n[a]);u.children=[],e(n.children).each2(function(e,t){o(t,u.children)}),(u.children.length||t.matcher(r,s(u),n))&&i.push(u)}else t.matcher(r,s(n),n)&&i.push(n)},e(n().results).each2(function(e,t){o(t,i.results)}),t.callback(i)}}function k(n){var r=e.isFunction(n);return function(i){var s=i.term,o={results:[]};e(r?n():n).each(function(){var e=this.text!==t,n=e?this.text:this;(s===""||i.matcher(s,n))&&o.results.push(e?this:{id:this,text:this})}),i.callback(o)}}function L(t,n){if(e.isFunction(t))return!0;if(!t)return!1;throw new Error("formatterName must be a function or a falsy value")}function A(t){return e.isFunction(t)?t():t}function O(t){var n=0;return e.each(t,function(e,t){t.children?n+=O(t.children):n++}),n}function M(e,n,r,i){var s=e,o=!1,u,a,f,l,h;if(!i.createSearchChoice||!i.tokenSeparators||i.tokenSeparators.length<1)return t;for(;;){a=-1;for(f=0,l=i.tokenSeparators.length;f<l;f++){h=i.tokenSeparators[f],a=e.indexOf(h);if(a>=0)break}if(a<0)break;u=e.substring(0,a),e=e.substring(a+h.length);if(u.length>0){u=i.createSearchChoice(u,n);if(u!==t&&u!==null&&i.id(u)!==t&&i.id(u)!==null){o=!1;for(f=0,l=n.length;f<l;f++)if(c(i.id(u),i.id(n[f]))){o=!0;break}o||r(u)}}}if(s!==e)return e}function _(t,n){var r=function(){};return r.prototype=new t,r.prototype.constructor=r,r.prototype.parent=t.prototype,r.prototype=e.extend(r.prototype,n),r}var n,r,i,s,o,u,a,f;n={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){e=e.which?e.which:e;switch(e){case n.LEFT:case n.RIGHT:case n.UP:case n.DOWN:return!0}return!1},isControl:function(e){var t=e.which;switch(t){case n.SHIFT:case n.CTRL:case n.ALT:return!0}return e.metaKey?!0:!1},isFunctionKey:function(e){return e=e.which?e.which:e,e>=112&&e<=123}},f=e(document),o=function(){var e=1;return function(){return e++}}(),f.bind("mousemove",function(e){a={x:e.pageX,y:e.pageY}}),r=_(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(n){var r,i,s=".select2-results",u;this.opts=n=this.prepareOpts(n),this.id=n.id,n.element.data("select2")!==t&&n.element.data("select2")!==null&&this.destroy(),this.enabled=!0,this.container=this.createContainer(),this.containerId="s2id_"+(n.element.attr("id")||"autogen"+o()),this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.body=g(function(){return n.element.closest("body")}),x(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.css(A(n.containerCss)),this.container.addClass(A(n.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabIndex"),this.opts.element.data("select2",this).addClass("select2-offscreen").bind("focus.select2",function(){e(this).select2("focus")}).attr("tabIndex","-1").before(this.container),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),this.dropdown.addClass(A(n.dropdownCssClass)),this.dropdown.data("select2",this),this.results=r=this.container.find(s),this.search=i=this.container.find("input.select2-input"),i.attr("tabIndex",this.elementTabIndex),this.resultsPage=0,this.context=null,this.initContainer(),v(this.results),this.dropdown.delegate(s,"mousemove-filtered touchstart touchmove touchend",this.bind(this.highlightUnderEvent)),y(80,this.results),this.dropdown.delegate(s,"scroll-debounced",this.bind(this.loadMoreIfNeeded)),e.fn.mousewheel&&r.mousewheel(function(e,t,n,i){var s=r.scrollTop(),o;i>0&&s-i<=0?(r.scrollTop(0),w(e)):i<0&&r.get(0).scrollHeight-r.scrollTop()+i<=r.height()&&(r.scrollTop(r.get(0).scrollHeight-r.height()),w(e))}),d(i),i.bind("keyup-change input paste",this.bind(this.updateResults)),i.bind("focus",function(){i.addClass("select2-focused")}),i.bind("blur",function(){i.removeClass("select2-focused")}),this.dropdown.delegate(s,"mouseup",this.bind(function(t){e(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.bind("click mouseup mousedown",function(e){e.stopPropagation()}),e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),(n.element.is(":disabled")||n.element.is("[readonly='readonly']"))&&this.disable()},destroy:function(){var e=this.opts.element.data("select2");this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),e!==t&&(e.container.remove(),e.dropdown.remove(),e.opts.element.removeClass("select2-offscreen").removeData("select2").unbind(".select2").attr({tabIndex:this.elementTabIndex}).show())},prepareOpts:function(n){var r,i,s,o;r=n.element,r.get(0).tagName.toLowerCase()==="select"&&(this.select=i=n.element),i&&e.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in n)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),n=e.extend({},{populateResults:function(r,i,s){var o,u,a,f,l=this.opts.id,c=this;o=function(r,i,u){var a,f,h,p,d,v,m,g,y,b;r=n.sortResults(r,i,s);for(a=0,f=r.length;a<f;a+=1)h=r[a],d=h.disabled===!0,p=!d&&l(h)!==t,v=h.children&&h.children.length>0,m=e("<li></li>"),m.addClass("select2-results-dept-"+u),m.addClass("select2-result"),m.addClass(p?"select2-result-selectable":"select2-result-unselectable"),d&&m.addClass("select2-disabled"),v&&m.addClass("select2-result-with-children"),m.addClass(c.opts.formatResultCssClass(h)),g=e(document.createElement("div")),g.addClass("select2-result-label"),b=n.formatResult(h,g,s,c.opts.escapeMarkup),b!==t&&g.html(b),m.append(g),v&&(y=e("<ul></ul>"),y.addClass("select2-result-sub"),o(h.children,y,u+1),m.append(y)),m.data("select2-data",h),i.append(m)},o(i,r,0)}},e.fn.select2.defaults,n),typeof n.id!="function"&&(s=n.id,n.id=function(e){return e[s]});if(e.isArray(n.element.data("select2Tags"))){if("tags"in n)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+n.element.attr("id");n.tags=n.element.attr("data-select2-tags")}i?(n.query=this.bind(function(n){var i={results:[],more:!1},s=n.term,o,u,a;a=function(e,t){var r;e.is("option")?n.matcher(s,e.text(),e)&&t.push({id:e.attr("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:c(e.attr("disabled"),"disabled")}):e.is("optgroup")&&(r={text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")},e.children().each2(function(e,t){a(t,r.children)}),r.children.length>0&&t.push(r))},o=r.children(),this.getPlaceholder()!==t&&o.length>0&&(u=o[0],e(u).text()===""&&(o=o.not(u))),o.each2(function(e,t){a(t,i.results)}),n.callback(i)}),n.id=function(e){return e.id},n.formatResultCssClass=function(e){return e.css}):"query"in n||("ajax"in n?(o=n.element.data("ajax-url"),o&&o.length>0&&(n.ajax.url=o),n.query=N.call(n.element,n.ajax)):"data"in n?n.query=C(n.data):"tags"in n&&(n.query=k(n.tags),n.createSearchChoice===t&&(n.createSearchChoice=function(e){return{id:e,text:e}}),n.initSelection===t&&(n.initSelection=function(t,r){var i=[];e(h(t.val(),n.separator)).each(function(){var t=this,r=this,s=n.tags;e.isFunction(s)&&(s=s()),e(s).each(function(){if(c(this.id,t))return r=this.text,!1}),i.push({id:t,text:r})}),r(i)})));if(typeof n.query!="function")throw"query function not defined for Select2 "+n.element.attr("id");return n},monitorSource:function(){var e=this.opts.element,t;e.bind("change.select2",this.bind(function(e){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),t=this.bind(function(){var e,t,n=this;e=this.opts.element.attr("disabled")!=="disabled",t=this.opts.element.attr("readonly")==="readonly",e=e&&!t,this.enabled!==e&&(e?this.enable():this.disable()),x(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(A(this.opts.containerCssClass)),x(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(A(this.opts.dropdownCssClass))}),e.bind("propertychange.select2 DOMAttrModified.select2",t),typeof WebKitMutationObserver!="undefined"&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new WebKitMutationObserver(function(e){e.forEach(t)}),this.propertyObserver.observe(e.get(0),{attributes:!0,subtree:!1}))},triggerChange:function(t){t=t||{},t=e.extend({},t,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},enable:function(){if(this.enabled)return;this.enabled=!0,this.container.removeClass("select2-container-disabled"),this.opts.element.removeAttr("disabled")},disable:function(){if(!this.enabled)return;this.close(),this.enabled=!1,this.container.addClass("select2-container-disabled"),this.opts.element.attr("disabled","disabled")},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var t=this.container.offset(),n=this.container.outerHeight(!1),r=this.container.outerWidth(!1),i=this.dropdown.outerHeight(!1),s=e(window).scrollLeft()+e(window).width(),o=e(window).scrollTop()+e(window).height(),u=t.top+n,a=t.left,f=u+i<=o,l=t.top-i>=this.body().scrollTop(),c=this.dropdown.outerWidth(!1),h=a+c<=s,p=this.dropdown.hasClass("select2-drop-above"),d,v,m;this.body().css("position")!=="static"&&(d=this.body().offset(),u-=d.top,a-=d.left),p?(v=!0,!l&&f&&(v=!1)):(v=!1,!f&&l&&(v=!0)),h||(a=t.left+r-c),v?(u=t.top-i,this.container.addClass("select2-drop-above"),this.dropdown.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")),m=e.extend({top:u,left:a,width:r},A(this.opts.dropdownCss)),this.dropdown.css(m)},shouldOpen:function(){var t;return this.opened()?!1:(t=e.Event("opening"),this.opts.element.trigger(t),!t.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(window.setTimeout(this.bind(this.opening),1),!0):!1},opening:function(){var t=this.containerId,n="scroll."+t,r="resize."+t,i="orientationchange."+t,s;this.clearDropdownAlignmentPreference(),this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body()),this.updateResults(!0),s=e("#select2-drop-mask"),s.length==0&&(s=e(document.createElement("div")),s.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),s.hide(),s.appendTo(this.body()),s.bind("mousedown touchstart",function(t){var n=e("#select2-drop"),r;n.length>0&&(r=n.data("select2"),r.opts.selectOnBlur&&r.selectHighlighted({noFocus:!0}),r.close())})),this.dropdown.prev()[0]!==s[0]&&this.dropdown.before(s),e("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),s.css({width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight}),s.show(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active"),this.ensureHighlightVisible();var o=this;this.container.parents().add(window).each(function(){e(this).bind(r+" "+n+" "+i,function(t){e("#select2-drop-mask").css({width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight}),o.positionDropdown()})}),this.focusSearch()},close:function(){if(!this.opened())return;var t=this.containerId,n="scroll."+t,r="resize."+t,i="orientationchange."+t;this.container.parents().add(window).each(function(){e(this).unbind(n).unbind(r).unbind(i)}),this.clearDropdownAlignmentPreference(),e("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open"),this.results.empty(),this.clearSearch(),this.opts.element.trigger(e.Event("close"))},clearSearch:function(){},getMaximumSelectionSize:function(){return A(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var t=this.results,n,r,i,s,o,u,a;r=this.highlight();if(r<0)return;if(r==0){t.scrollTop(0);return}n=this.findHighlightableChoices(),i=e(n[r]),s=i.offset().top+i.outerHeight(!0),r===n.length-1&&(a=t.find("li.select2-more-results"),a.length>0&&(s=a.offset().top+a.outerHeight(!0))),o=t.offset().top+t.outerHeight(!0),s>o&&t.scrollTop(t.scrollTop()+(s-o)),u=i.offset().top-t.offset().top,u<0&&i.css("display")!="none"&&t.scrollTop(t.scrollTop()+u)},findHighlightableChoices:function(){var e=this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)");return this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)")},moveHighlight:function(t){var n=this.findHighlightableChoices(),r=this.highlight();while(r>-1&&r<n.length){r+=t;var i=e(n[r]);if(i.hasClass("select2-result-selectable")&&!i.hasClass("select2-disabled")&&!i.hasClass("select2-selected")){this.highlight(r);break}}},highlight:function(t){var n=this.findHighlightableChoices(),r,i;if(arguments.length===0)return l(n.filter(".select2-highlighted")[0],n.get());t>=n.length&&(t=n.length-1),t<0&&(t=0),this.results.find(".select2-highlighted").removeClass("select2-highlighted"),r=e(n[t]),r.addClass("select2-highlighted"),this.ensureHighlightVisible(),i=r.data("select2-data"),i&&this.opts.element.trigger({type:"highlight",val:this.id(i),choice:i})},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var n=e(t.target).closest(".select2-result-selectable");if(n.length>0&&!n.is(".select2-highlighted")){var r=this.findHighlightableChoices();this.highlight(r.index(n))}else n.length==0&&this.results.find(".select2-highlighted").removeClass("select2-highlighted")},loadMoreIfNeeded:function(){var e=this.results,t=e.find("li.select2-more-results"),n,r=-1,i=this.resultsPage+1,s=this,o=this.search.val(),u=this.context;if(t.length===0)return;n=t.offset().top-e.offset().top-e.height(),n<=this.opts.loadMorePadding&&(t.addClass("select2-active"),this.opts.query({element:this.opts.element,term:o,page:i,context:u,matcher:this.opts.matcher,callback:this.bind(function(n){if(!s.opened())return;s.opts.populateResults.call(this,e,n.results,{term:o,page:i,context:u}),n.more===!0?(t.detach().appendTo(e).text(s.opts.formatLoadMore(i+1)),window.setTimeout(function(){s.loadMoreIfNeeded()},10)):t.remove(),s.positionDropdown(),s.resultsPage=i,s.context=n.context})}))},tokenize:function(){},updateResults:function(n){function f(){i.scrollTop(0),r.removeClass("select2-active"),u.positionDropdown()}function l(e){i.html(e),f()}var r=this.search,i=this.results,s=this.opts,o,u=this,a;if(n!==!0&&(this.showSearchInput===!1||!this.opened()))return;r.addClass("select2-active");var h=this.getMaximumSelectionSize();if(h>=1){o=this.data();if(e.isArray(o)&&o.length>=h&&L(s.formatSelectionTooBig,"formatSelectionTooBig")){l("<li class='select2-selection-limit'>"+s.formatSelectionTooBig(h)+"</li>");return}}if(r.val().length<s.minimumInputLength){L(s.formatInputTooShort,"formatInputTooShort")?l("<li class='select2-no-results'>"+s.formatInputTooShort(r.val(),s.minimumInputLength)+"</li>"):l("");return}s.formatSearching()&&n===!0&&l("<li class='select2-searching'>"+s.formatSearching()+"</li>");if(s.maximumInputLength&&r.val().length>s.maximumInputLength){L(s.formatInputTooLong,"formatInputTooLong")?l("<li class='select2-no-results'>"+s.formatInputTooLong(r.val(),s.maximumInputLength)+"</li>"):l("");return}a=this.tokenize(),a!=t&&a!=null&&r.val(a),this.resultsPage=1,s.query({element:s.element,term:r.val(),page:this.resultsPage,context:null,matcher:s.matcher,callback:this.bind(function(o){var a;if(!this.opened())return;this.context=o.context===t?null:o.context,this.opts.createSearchChoice&&r.val()!==""&&(a=this.opts.createSearchChoice.call(null,r.val(),o.results),a!==t&&a!==null&&u.id(a)!==t&&u.id(a)!==null&&e(o.results).filter(function(){return c(u.id(this),u.id(a))}).length===0&&o.results.unshift(a));if(o.results.length===0&&L(s.formatNoMatches,"formatNoMatches")){l("<li class='select2-no-results'>"+s.formatNoMatches(r.val())+"</li>");return}i.empty(),u.opts.populateResults.call(this,i,o.results,{term:r.val(),page:this.resultsPage,context:null}),o.more===!0&&L(s.formatLoadMore,"formatLoadMore")&&(i.append("<li class='select2-more-results'>"+u.opts.escapeMarkup(s.formatLoadMore(this.resultsPage))+"</li>"),window.setTimeout(function(){u.loadMoreIfNeeded()},10)),this.postprocessResults(o,n),f()})})},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){b(this.search)},selectHighlighted:function(e){var t=this.highlight(),n=this.results.find(".select2-highlighted"),r=n.closest(".select2-result").data("select2-data");r&&(this.highlight(t),this.onSelect(r,e))},getPlaceholder:function(){return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder},initContainerWidth:function(){function n(){var n,r,i,s,o;if(this.opts.width==="off")return null;if(this.opts.width==="element")return this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px";if(this.opts.width==="copy"||this.opts.width==="resolve"){n=this.opts.element.attr("style");if(n!==t){r=n.split(";");for(s=0,o=r.length;s<o;s+=1){i=r[s].replace(/\s/g,"").match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/);if(i!==null&&i.length>=1)return i[1]}}return this.opts.width==="resolve"?(n=this.opts.element.css("width"),n.indexOf("%")>0?n:this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px"):null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}var r=n.call(this);r!==null&&this.container.css("width",r)}}),i=_(r,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>"," <span></span><abbr class='select2-search-choice-close' style='display:none;'></abbr>"," <div><b></b></div>","</a>","<input class='select2-focusser select2-offscreen' type='text'/>","<div class='select2-drop' style='display:none'>"," <div class='select2-search'>"," <input type='text' autocomplete='off' class='select2-input'/>"," </div>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return t},disable:function(){if(!this.enabled)return;this.parent.disable.apply(this,arguments),this.focusser.attr("disabled","disabled")},enable:function(){if(this.enabled)return;this.parent.enable.apply(this,arguments),this.focusser.removeAttr("disabled")},opening:function(){this.parent.opening.apply(this,arguments),this.focusser.attr("disabled","disabled"),this.opts.element.trigger(e.Event("open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments),this.focusser.removeAttr("disabled"),b(this.focusser)},focus:function(){this.opened()?this.close():(this.focusser.removeAttr("disabled"),this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus()},initContainer:function(){var e,t=this.container,r=this.dropdown,i=!1;this.showSearch(this.opts.minimumResultsForSearch>=0),this.selection=e=t.find(".select2-choice"),this.focusser=t.find(".select2-focusser"),this.search.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.PAGE_UP||e.which===n.PAGE_DOWN){w(e);return}switch(e.which){case n.UP:case n.DOWN:this.moveHighlight(e.which===n.UP?-1:1),w(e);return;case n.TAB:case n.ENTER:this.selectHighlighted(),w(e);return;case n.ESC:this.cancel(e),w(e);return}})),this.focusser.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.TAB||n.isControl(e)||n.isFunctionKey(e)||e.which===n.ESC)return;if(this.opts.openOnEnter===!1&&e.which===n.ENTER){w(e);return}if(e.which==n.DOWN||e.which==n.UP||e.which==n.ENTER&&this.opts.openOnEnter){this.open(),w(e);return}if(e.which==n.DELETE||e.which==n.BACKSPACE){this.opts.allowClear&&this.clear(),w(e);return}})),d(this.focusser),this.focusser.bind("keyup-change input",this.bind(function(e){if(this.opened())return;this.open(),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.focusser.val(""),w(e)})),e.delegate("abbr","mousedown",this.bind(function(e){if(!this.enabled)return;this.clear(),E(e),this.close(),this.selection.focus()})),e.bind("mousedown",this.bind(function(e){i=!0,this.opened()?this.close():this.enabled&&this.open(),w(e),i=!1})),r.bind("mousedown",this.bind(function(){this.search.focus()})),e.bind("focus",this.bind(function(e){w(e)})),this.focusser.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")})).bind("blur",this.bind(function(){this.opened()||this.container.removeClass("select2-container-active")})),this.search.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.setPlaceholder()},clear:function(){var e=this.selection.data("select2-data");this.opts.element.val(""),this.selection.find("span").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),this.opts.element.trigger({type:"removed",val:this.id(e),choice:e}),this.triggerChange({removed:e})},initSelection:function(){var e;if(this.opts.element.val()===""&&this.opts.element.text()==="")this.close(),this.setPlaceholder();else{var n=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==t&&e!==null&&(n.updateSelection(e),n.close(),n.setPlaceholder())})}},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(t,n){var r=t.find(":selected");e.isFunction(n)&&n({id:r.attr("value"),text:r.text(),element:r})}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=n.val();t.query({matcher:function(e,n,r){return c(i,t.id(r))},callback:e.isFunction(r)?function(e){r(e.results.length?e.results[0]:null)}:e.noop})}),t},getPlaceholder:function(){return this.select&&this.select.find("option").first().text()!==""?t:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(this.opts.element.val()===""&&e!==t){if(this.select&&this.select.find("option:first").text()!=="")return;this.selection.find("span").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.selection.find("abbr").hide()}},postprocessResults:function(e,t){var n=0,r=this,i=!0;this.findHighlightableChoices().each2(function(e,t){if(c(r.id(t.data("select2-data")),r.opts.element.val()))return n=e,!1}),this.highlight(n);if(t===!0){var s=this.opts.minimumResultsForSearch;i=s<0?!1:O(e.results)>=s,this.showSearch(i)}},showSearch:function(t){this.showSearchInput=t,this.dropdown.find(".select2-search")[t?"removeClass":"addClass"]("select2-search-hidden"),e(this.dropdown,this.container)[t?"addClass":"removeClass"]("select2-with-searchbox")},onSelect:function(e,t){var n=this.opts.element.val();this.opts.element.val(this.id(e)),this.updateSelection(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),this.close(),(!t||!t.noFocus)&&this.selection.focus(),c(n,this.id(e))||this.triggerChange()},updateSelection:function(e){var n=this.selection.find("span"),r;this.selection.data("select2-data",e),n.empty(),r=this.opts.formatSelection(e,n),r!==t&&n.append(this.opts.escapeMarkup(r)),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.selection.find("abbr").show()},val:function(){var e,n=!1,r=null,i=this;if(arguments.length===0)return this.opts.element.val();e=arguments[0],arguments.length>1&&(n=arguments[1]);if(this.select)this.select.val(e).find(":selected").each2(function(e,t){return r={id:t.attr("value"),text:t.text()},!1}),this.updateSelection(r),this.setPlaceholder(),n&&this.triggerChange();else{if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");if(!e&&e!==0){this.clear(),n&&this.triggerChange();return}this.opts.element.val(e),this.opts.initSelection(this.opts.element,function(e){i.opts.element.val(e?i.id(e):""),i.updateSelection(e),i.setPlaceholder(),n&&i.triggerChange()})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e){var n;if(arguments.length===0)return n=this.selection.data("select2-data"),n==t&&(n=null),n;!e||e===""?this.clear():(this.opts.element.val(e?this.id(e):""),this.updateSelection(e))}}),s=_(r,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html([" <ul class='select2-choices'>"," <li class='select2-search-field'>"," <input type='text' autocomplete='off' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi' style='display:none;'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return t},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(e,t){var n=[];e.find(":selected").each2(function(e,t){n.push({id:t.attr("value"),text:t.text(),element:t[0]})}),t(n)}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=h(n.val(),t.separator);t.query({matcher:function(n,r,s){return e.grep(i,function(e){return c(e,t.id(s))}).length},callback:e.isFunction(r)?function(e){r(e.results)}:e.noop})}),t},initContainer:function(){var t=".select2-choices",r;this.searchContainer=this.container.find(".select2-search-field"),this.selection=r=this.container.find(t),this.search.bind("input paste",this.bind(function(){if(!this.enabled)return;this.opened()||this.open()})),this.search.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.BACKSPACE&&this.search.val()===""){this.close();var t,i=r.find(".select2-search-choice-focus");if(i.length>0){this.unselect(i.first()),this.search.width(10),w(e);return}t=r.find(".select2-search-choice:not(.select2-locked)"),t.length>0&&t.last().addClass("select2-search-choice-focus")}else r.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");if(this.opened())switch(e.which){case n.UP:case n.DOWN:this.moveHighlight(e.which===n.UP?-1:1),w(e);return;case n.ENTER:case n.TAB:this.selectHighlighted(),w(e);return;case n.ESC:this.cancel(e),w(e);return}if(e.which===n.TAB||n.isControl(e)||n.isFunctionKey(e)||e.which===n.BACKSPACE||e.which===n.ESC)return;if(e.which===n.ENTER){if(this.opts.openOnEnter===!1)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),(e.which===n.PAGE_UP||e.which===n.PAGE_DOWN)&&w(e)})),this.search.bind("keyup",this.bind(this.resizeSearch)),this.search.bind("blur",this.bind(function(e){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.opened()||this.clearSearch(),e.stopImmediatePropagation()})),this.container.delegate(t,"mousedown",this.bind(function(t){if(!this.enabled)return;if(e(t.target).closest(".select2-search-choice").length>0)return;this.clearPlaceholder(),this.open(),this.focusSearch(),t.preventDefault()})),this.container.delegate(t,"focus",this.bind(function(){if(!this.enabled)return;this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder()})),this.initContainerWidth(),this.clearSearch()},enable:function(){if(this.enabled)return;this.parent.enable.apply(this,arguments),this.search.removeAttr("disabled")},disable:function(){if(!this.enabled)return;this.parent.disable.apply(this,arguments),this.search.attr("disabled",!0)},initSelection:function(){var e;this.opts.element.val()===""&&this.opts.element.text()===""&&(this.updateSelection([]),this.close(),this.clearSearch());if(this.select||this.opts.element.val()!==""){var n=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==t&&e!==null&&(n.updateSelection(e),n.close(),n.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder();e!==t&&this.getVal().length===0&&this.search.hasClass("select2-focused")===!1?(this.search.val(e).addClass("select2-default"),this.resizeSearch()):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.parent.opening.apply(this,arguments),this.clearPlaceholder(),this.resizeSearch(),this.focusSearch(),this.opts.element.trigger(e.Event("open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus(),this.opts.element.triggerHandler("focus")},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var n=[],r=[],i=this;e(t).each(function(){l(i.id(this),n)<0&&(n.push(i.id(this)),r.push(this))}),t=r,this.selection.find(".select2-search-choice").remove(),e(t).each(function(){i.addSelectedChoice(this)}),i.postprocessResults()},tokenize:function(){var e=this.search.val();e=this.opts.tokenizer(e,this.data(),this.bind(this.onSelect),this.opts),e!=null&&e!=t&&(this.search.val(e),e.length>0&&this.open())},onSelect:function(e,t){this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.val().length>=this.getMaximumSelectionSize()&&this.updateResults(!0),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),(!t||!t.noFocus)&&this.focusSearch()},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(n){var r=!n.locked,i=e("<li class='select2-search-choice'> <div></div> <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),s=e("<li class='select2-search-choice select2-locked'><div></div></li>"),o=r?i:s,u=this.id(n),a=this.getVal(),f;f=this.opts.formatSelection(n,o.find("div")),f!=t&&o.find("div").replaceWith("<div>"+this.opts.escapeMarkup(f)+"</div>"),r&&o.find(".select2-search-choice-close").bind("mousedown",w).bind("click dblclick",this.bind(function(t){if(!this.enabled)return;e(t.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(e(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),this.close(),this.focusSearch()})).dequeue(),w(t)})).bind("focus",this.bind(function(){if(!this.enabled)return;this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active")})),o.data("select2-data",n),o.insertBefore(this.searchContainer),a.push(u),this.setVal(a)},unselect:function(e){var t=this.getVal(),n,r;e=e.closest(".select2-search-choice");if(e.length===0)throw"Invalid argument: "+e+". Must be .select2-search-choice";n=e.data("select2-data");if(!n)return;r=l(this.id(n),t),r>=0&&(t.splice(r,1),this.setVal(t),this.select&&this.postprocessResults()),e.remove(),this.opts.element.trigger({type:"removed",val:this.id(n),choice:n}),this.triggerChange({removed:n})},postprocessResults:function(){var e=this.getVal(),t=this.results.find(".select2-result"),n=this.results.find(".select2-result-with-children"),r=this;t.each2(function(t,n){var i=r.id(n.data("select2-data"));l(i,e)>=0&&(n.addClass("select2-selected"),n.find(".select2-result-selectable").addClass("select2-selected"))}),n.each2(function(e,t){!t.is(".select2-result-selectable")&&t.find(".select2-result-selectable:not(.select2-selected)").length===0&&t.addClass("select2-selected")}),this.highlight()==-1&&r.highlight(0)},resizeSearch:function(){var e,t,n,r,i,s=p(this.search);e=S(this.search)+10,t=this.search.offset().left,n=this.selection.width(),r=this.selection.offset().left,i=n-(t-r)-s,i<e&&(i=n-s),i<40&&(i=n-s),i<=0&&(i=e),this.search.width(i)},getVal:function(){var e;return this.select?(e=this.select.val(),e===null?[]:e):(e=this.opts.element.val(),h(e,this.opts.separator))},setVal:function(t){var n;this.select?this.select.val(t):(n=[],e(t).each(function(){l(this,n)<0&&n.push(this)}),this.opts.element.val(n.length===0?"":n.join(this.opts.separator)))},val:function(){var n,r=!1,i=[],s=this;if(arguments.length===0)return this.getVal();n=arguments[0],arguments.length>1&&(r=arguments[1]);if(!n&&n!==0){this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),r&&this.triggerChange();return}this.setVal(n);if(this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),r&&this.triggerChange();else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var n=e(t).map(s.id);s.setVal(n),s.updateSelection(t),s.clearSearch(),r&&s.triggerChange()})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var t=[],n=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(n.opts.id(e(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t){var n=this,r;if(arguments.length===0)return this.selection.find(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get();t||(t=[]),r=e.map(t,function(e){return n.opts.id(e)}),this.setVal(r),this.updateSelection(t),this.clearSearch()}}),e.fn.select2=function(){var n=Array.prototype.slice.call(arguments,0),r,o,u,a,f=["val","destroy","opened","open","close","focus","isFocused","container","onSortStart","onSortEnd","enable","disable","positionDropdown","data"];return this.each(function(){if(n.length===0||typeof n[0]=="object")r=n.length===0?{}:e.extend({},n[0]),r.element=e(this),r.element.get(0).tagName.toLowerCase()==="select"?a=r.element.attr("multiple"):(a=r.multiple||!1,"tags"in r&&(r.multiple=a=!0)),o=a?new s:new i,o.init(r);else{if(typeof n[0]!="string")throw"Invalid arguments to select2 plugin: "+n;if(l(n[0],f)<0)throw"Unknown method: "+n[0];u=t,o=e(this).data("select2");if(o===t)return;n[0]==="container"?u=o.container:u=o[n[0]].apply(o,n.slice(1));if(u!==t)return!1}}),u===t?this:u},e.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,n,r){var i=[];return T(e.text,n.term,i,r),i.join("")},formatSelection:function(e,n){return e?e.text:t},sortResults:function(e,t,n){return e},formatResultCssClass:function(e){return t},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(e,t){var n=t-e.length;return"Please enter "+n+" more character"+(n==1?"":"s")},formatInputTooLong:function(e,t){var n=e.length-t;return"Please enter "+n+" less character"+(n==1?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(e==1?"":"s")},formatLoadMore:function(e){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e.id},matcher:function(e,t){return t.toUpperCase().indexOf(e.toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:M,escapeMarkup:function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;","/":"&#47;"};return String(e).replace(/[&<>"'/\\]/g,function(e){return t[e[0]]})},blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(e){return null}}}(e)}),timely.define("libs/select2_multiselect_helper",["jquery_timely","external_libs/select2"],function(e){var t=function(t){var n=e(t.element),r=n.data("color"),i=n.data("description"),s="";return typeof r!="undefined"&&r!==""&&(s+='<span class="ai1ec-color-swatch" style="background: '+n.data("color")+'"></span> '),s+=t.text,s='<span title="'+i+'">'+s+"</span>",s},n=function(t){var n=e(t.element),r=n.data("color"),i=n.data("description"),s="";return typeof r!="undefined"&&r!==""?s+='<span class="ai1ec-color-swatch" style="background: '+n.data("color")+'"></span> ':s+='<span class="ai1ec-color-swatch-empty"></span> ',s+=t.text,s='<span title="'+i+'">'+s+"</span>",s},r=function(r){typeof r=="undefined"&&(r=e(document)),e(".ai1ec-select2-multiselect-selector",r).select2({allowClear:!0,formatResult:n,formatSelection:t,escapeMarkup:function(e){return e}})},i=function(t){e(".ai1ec-select2-multiselect-selector.select2-container",t).each(function(){e(this).data("select2").resizeSearch()})};return{init:r,refresh:i}}),timely.define("external_libs/jquery_history",["jquery_timely"],function(e){try{(function(t,n){var r=t.History=t.History||{};if(typeof r.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");r.Adapter={bind:function(t,n,r){e(t).bind(n,r)},trigger:function(t,n,r){e(t).trigger(n,r)},extractEventData:function(e,t,r){var i=t&&t.originalEvent&&t.originalEvent[e]||r&&r[e]||n;return i},onDomLoad:function(t){e(t)}},typeof r.init!="undefined"&&r.init()})(window),function(e,t){var n=e.document,r=e.setTimeout||r,i=e.clearTimeout||i,s=e.setInterval||s,o=e.History=e.History||{};if(typeof o.initHtml4!="undefined")throw new Error("History.js HTML4 Support has already been loaded...");o.initHtml4=function(){if(typeof o.initHtml4.initialized!="undefined")return!1;o.initHtml4.initialized=!0,o.enabled=!0,o.savedHashes=[],o.isLastHash=function(e){var t=o.getHashByIndex(),n;return n=e===t,n},o.saveHash=function(e){return o.isLastHash(e)?!1:(o.savedHashes.push(e),!0)},o.getHashByIndex=function(e){var t=null;return typeof e=="undefined"?t=o.savedHashes[o.savedHashes.length-1]:e<0?t=o.savedHashes[o.savedHashes.length+e]:t=o.savedHashes[e],t},o.discardedHashes={},o.discardedStates={},o.discardState=function(e,t,n){var r=o.getHashByState(e),i;return i={discardedState:e,backState:n,forwardState:t},o.discardedStates[r]=i,!0},o.discardHash=function(e,t,n){var r={discardedHash:e,backState:n,forwardState:t};return o.discardedHashes[e]=r,!0},o.discardedState=function(e){var t=o.getHashByState(e),n;return n=o.discardedStates[t]||!1,n},o.discardedHash=function(e){var t=o.discardedHashes[e]||!1;return t},o.recycleState=function(e){var t=o.getHashByState(e);return o.discardedState(e)&&delete o.discardedStates[t],!0},o.emulated.hashChange&&(o.hashChangeInit=function(){o.checkerFunction=null;var t="",r,i,u,a;return o.isInternetExplorer()?(r="historyjs-iframe",i=n.createElement("iframe"),i.setAttribute("id",r),i.style.display="none",n.body.appendChild(i),i.contentWindow.document.open(),i.contentWindow.document.close(),u="",a=!1,o.checkerFunction=function(){if(a)return!1;a=!0;var n=o.getHash()||"",r=o.unescapeHash(i.contentWindow.document.location.hash)||"";return n!==t?(t=n,r!==n&&(u=r=n,i.contentWindow.document.open(),i.contentWindow.document.close(),i.contentWindow.document.location.hash=o.escapeHash(n)),o.Adapter.trigger(e,"hashchange")):r!==u&&(u=r,o.setHash(r,!1)),a=!1,!0}):o.checkerFunction=function(){var n=o.getHash();return n!==t&&(t=n,o.Adapter.trigger(e,"hashchange")),!0},o.intervalList.push(s(o.checkerFunction,o.options.hashChangeInterval)),!0},o.Adapter.onDomLoad(o.hashChangeInit)),o.emulated.pushState&&(o.onHashChange=function(t){var r=t&&t.newURL||n.location.href,i=o.getHashByUrl(r),s=null,u=null,a=null,f;return o.isLastHash(i)?(o.busy(!1),!1):(o.doubleCheckComplete(),o.saveHash(i),i&&o.isTraditionalAnchor(i)?(o.Adapter.trigger(e,"anchorchange"),o.busy(!1),!1):(s=o.extractState(o.getFullUrl(i||n.location.href,!1),!0),o.isLastSavedState(s)?(o.busy(!1),!1):(u=o.getHashByState(s),f=o.discardedState(s),f?(o.getHashByIndex(-2)===o.getHashByState(f.forwardState)?o.back(!1):o.forward(!1),!1):(o.pushState(s.data,s.title,s.url,!1),!0))))},o.Adapter.bind(e,"hashchange",o.onHashChange),o.pushState=function(t,r,i,s){if(o.getHashByUrl(i))throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(s!==!1&&o.busy())return o.pushQueue({scope:o,callback:o.pushState,args:arguments,queue:s}),!1;o.busy(!0);var u=o.createStateObject(t,r,i),a=o.getHashByState(u),f=o.getState(!1),l=o.getHashByState(f),c=o.getHash();return o.storeState(u),o.expectedStateId=u.id,o.recycleState(u),o.setTitle(u),a===l?(o.busy(!1),!1):a!==c&&a!==o.getShortUrl(n.location.href)?(o.setHash(a,!1),!1):(o.saveState(u),o.Adapter.trigger(e,"statechange"),o.busy(!1),!0)},o.replaceState=function(e,t,n,r){if(o.getHashByUrl(n))throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(r!==!1&&o.busy())return o.pushQueue({scope:o,callback:o.replaceState,args:arguments,queue:r}),!1;o.busy(!0);var i=o.createStateObject(e,t,n),s=o.getState(!1),u=o.getStateByIndex(-2);return o.discardState(s,i,u),o.pushState(i.data,i.title,i.url,!1),!0}),o.emulated.pushState&&o.getHash()&&!o.emulated.hashChange&&o.Adapter.onDomLoad(function(){o.Adapter.trigger(e,"hashchange")})},typeof o.init!="undefined"&&o.init()}(window),function(e,t){var n=e.console||t,r=e.document,i=e.navigator,s=e.sessionStorage||!1,o=e.setTimeout,u=e.clearTimeout,a=e.setInterval,f=e.clearInterval,l=e.JSON,c=e.alert,h=e.History=e.History||{},p=e.history;l.stringify=l.stringify||l.encode,l.parse=l.parse||l.decode;if(typeof h.init!="undefined")throw new Error("History.js Core has already been loaded...");h.init=function(){return typeof h.Adapter=="undefined"?!1:(typeof h.initCore!="undefined"&&h.initCore(),typeof h.initHtml4!="undefined"&&h.initHtml4(),!0)},h.initCore=function(){if(typeof h.initCore.initialized!="undefined")return!1;h.initCore.initialized=!0,h.options=h.options||{},h.options.hashChangeInterval=h.options.hashChangeInterval||100,h.options.safariPollInterval=h.options.safariPollInterval||500,h.options.doubleCheckInterval=h.options.doubleCheckInterval||500,h.options.storeInterval=h.options.storeInterval||1e3,h.options.busyDelay=h.options.busyDelay||250,h.options.debug=h.options.debug||!1,h.options.initialTitle=h.options.initialTitle||r.title,h.intervalList=[],h.clearAllIntervals=function(){var e,t=h.intervalList;if(typeof t!="undefined"&&t!==null){for(e=0;e<t.length;e++)f(t[e]);h.intervalList=null}},h.debug=function(){(h.options.debug||!1)&&h.log.apply(h,arguments)},h.log=function(){var e=typeof n!="undefined"&&typeof n.log!="undefined"&&typeof n.log.apply!="undefined",t=r.getElementById("log"),i,s,o,u,a;e?(u=Array.prototype.slice.call(arguments),i=u.shift(),typeof n.debug!="undefined"?n.debug.apply(n,[i,u]):n.log.apply(n,[i,u])):i="\n"+arguments[0]+"\n";for(s=1,o=arguments.length;s<o;++s){a=arguments[s];if(typeof a=="object"&&typeof l!="undefined")try{a=l.stringify(a)}catch(f){}i+="\n"+a+"\n"}return t?(t.value+=i+"\n-----\n",t.scrollTop=t.scrollHeight-t.clientHeight):e||c(i),!0},h.getInternetExplorerMajorVersion=function(){var e=h.getInternetExplorerMajorVersion.cached=typeof h.getInternetExplorerMajorVersion.cached!="undefined"?h.getInternetExplorerMajorVersion.cached:function(){var e=3,t=r.createElement("div"),n=t.getElementsByTagName("i");while((t.innerHTML="<!--[if gt IE "+ ++e+"]><i></i><![endif]-->")&&n[0]);return e>4?e:!1}();return e},h.isInternetExplorer=function(){var e=h.isInternetExplorer.cached=typeof h.isInternetExplorer.cached!="undefined"?h.isInternetExplorer.cached:Boolean(h.getInternetExplorerMajorVersion());return e},h.emulated={pushState:!Boolean(e.history&&e.history.pushState&&e.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(i.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(i.userAgent)),hashChange:Boolean(!("onhashchange"in e||"onhashchange"in r)||h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8)},h.enabled=!h.emulated.pushState,h.bugs={setHash:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),safariPoll:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),ieDoubleCheck:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<7)},h.isEmptyObject=function(e){for(var t in e)return!1;return!0},h.cloneObject=function(e){var t,n;return e?(t=l.stringify(e),n=l.parse(t)):n={},n},h.getRootUrl=function(){var e=r.location.protocol+"//"+(r.location.hostname||r.location.host);if(r.location.port||!1)e+=":"+r.location.port;return e+="/",e},h.getBaseHref=function(){var e=r.getElementsByTagName("base"),t=null,n="";return e.length===1&&(t=e[0],n=t.href.replace(/[^\/]+$/,"")),n=n.replace(/\/+$/,""),n&&(n+="/"),n},h.getBaseUrl=function(){var e=h.getBaseHref()||h.getBasePageUrl()||h.getRootUrl();return e},h.getPageUrl=function(){var e=h.getState(!1,!1),t=(e||{}).url||r.location.href,n;return n=t.replace(/\/+$/,"").replace(/[^\/]+$/,function(e,t,n){return/\./.test(e)?e:e+"/"}),n},h.getBasePageUrl=function(){var e=r.location.href.replace(/[#\?].*/,"").replace(/[^\/]+$/,function(e,t,n){return/[^\/]$/.test(e)?"":e}).replace(/\/+$/,"")+"/";return e},h.getFullUrl=function(e,t){var n=e,r=e.substring(0,1);return t=typeof t=="undefined"?!0:t,/[a-z]+\:\/\//.test(e)||(r==="/"?n=h.getRootUrl()+e.replace(/^\/+/,""):r==="#"?n=h.getPageUrl().replace(/#.*/,"")+e:r==="?"?n=h.getPageUrl().replace(/[\?#].*/,"")+e:t?n=h.getBaseUrl()+e.replace(/^(\.\/)+/,""):n=h.getBasePageUrl()+e.replace(/^(\.\/)+/,"")),n.replace(/\#$/,"")},h.getShortUrl=function(e){var t=e,n=h.getBaseUrl(),r=h.getRootUrl();return h.emulated.pushState&&(t=t.replace(n,"")),t=t.replace(r,"/"),h.isTraditionalAnchor(t)&&(t="./"+t),t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),t},h.store={},h.idToState=h.idToState||{},h.stateToId=h.stateToId||{},h.urlToId=h.urlToId||{},h.storedStates=h.storedStates||[],h.savedStates=h.savedStates||[],h.normalizeStore=function(){h.store.idToState=h.store.idToState||{},h.store.urlToId=h.store.urlToId||{},h.store.stateToId=h.store.stateToId||{}},h.getState=function(e,t){typeof e=="undefined"&&(e=!0),typeof t=="undefined"&&(t=!0);var n=h.getLastSavedState();return!n&&t&&(n=h.createStateObject()),e&&(n=h.cloneObject(n),n.url=n.cleanUrl||n.url),n},h.getIdByState=function(e){var t=h.extractId(e.url),n;if(!t){n=h.getStateString(e);if(typeof h.stateToId[n]!="undefined")t=h.stateToId[n];else if(typeof h.store.stateToId[n]!="undefined")t=h.store.stateToId[n];else{for(;;){t=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof h.idToState[t]=="undefined"&&typeof h.store.idToState[t]=="undefined")break}h.stateToId[n]=t,h.idToState[t]=e}}return t},h.normalizeState=function(e){var t,n;if(!e||typeof e!="object")e={};if(typeof e.normalized!="undefined")return e;if(!e.data||typeof e.data!="object")e.data={};t={},t.normalized=!0,t.title=e.title||"",t.url=h.getFullUrl(h.unescapeString(e.url||r.location.href)),t.hash=h.getShortUrl(t.url),t.data=h.cloneObject(e.data),t.id=h.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,n=!h.isEmptyObject(t.data);if(t.title||n)t.hash=h.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id;return t.hashedUrl=h.getFullUrl(t.hash),(h.emulated.pushState||h.bugs.safariPoll)&&h.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t},h.createStateObject=function(e,t,n){var r={data:e,title:t,url:n};return r=h.normalizeState(r),r},h.getStateById=function(e){e=String(e);var n=h.idToState[e]||h.store.idToState[e]||t;return n},h.getStateString=function(e){var t,n,r;return t=h.normalizeState(e),n={data:t.data,title:e.title,url:e.url},r=l.stringify(n),r},h.getStateId=function(e){var t,n;return t=h.normalizeState(e),n=t.id,n},h.getHashByState=function(e){var t,n;return t=h.normalizeState(e),n=t.hash,n},h.extractId=function(e){var t,n,r;return n=/(.*)\&_suid=([0-9]+)$/.exec(e),r=n?n[1]||e:e,t=n?String(n[2]||""):"",t||!1},h.isTraditionalAnchor=function(e){var t=!/[\/\?\.]/.test(e);return t},h.extractState=function(e,t){var n=null,r,i;return t=t||!1,r=h.extractId(e),r&&(n=h.getStateById(r)),n||(i=h.getFullUrl(e),r=h.getIdByUrl(i)||!1,r&&(n=h.getStateById(r)),!n&&t&&!h.isTraditionalAnchor(e)&&(n=h.createStateObject(null,null,i))),n},h.getIdByUrl=function(e){var n=h.urlToId[e]||h.store.urlToId[e]||t;return n},h.getLastSavedState=function(){return h.savedStates[h.savedStates.length-1]||t},h.getLastStoredState=function(){return h.storedStates[h.storedStates.length-1]||t},h.hasUrlDuplicate=function(e){var t=!1,n;return n=h.extractState(e.url),t=n&&n.id!==e.id,t},h.storeState=function(e){return h.urlToId[e.url]=e.id,h.storedStates.push(h.cloneObject(e)),e},h.isLastSavedState=function(e){var t=!1,n,r,i;return h.savedStates.length&&(n=e.id,r=h.getLastSavedState(),i=r.id,t=n===i),t},h.saveState=function(e){return h.isLastSavedState(e)?!1:(h.savedStates.push(h.cloneObject(e)),!0)},h.getStateByIndex=function(e){var t=null;return typeof e=="undefined"?t=h.savedStates[h.savedStates.length-1]:e<0?t=h.savedStates[h.savedStates.length+e]:t=h.savedStates[e],t},h.getHash=function(){var e=h.unescapeHash(r.location.hash);return e},h.unescapeString=function(t){var n=t,r;for(;;){r=e.unescape(n);if(r===n)break;n=r}return n},h.unescapeHash=function(e){var t=h.normalizeHash(e);return t=h.unescapeString(t),t},h.normalizeHash=function(e){var t=e.replace(/[^#]*#/,"").replace(/#.*/,"");return t},h.setHash=function(e,t){var n,i,s;return t!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.setHash,args:arguments,queue:t}),!1):(n=h.escapeHash(e),h.busy(!0),i=h.extractState(e,!0),i&&!h.emulated.pushState?h.pushState(i.data,i.title,i.url,!1):r.location.hash!==n&&(h.bugs.setHash?(s=h.getPageUrl(),h.pushState(null,null,s+"#"+n,!1)):r.location.hash=n),h)},h.escapeHash=function(t){var n=h.normalizeHash(t);return n=e.escape(n),h.bugs.hashEscape||(n=n.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),n},h.getHashByUrl=function(e){var t=String(e).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return t=h.unescapeHash(t),t},h.setTitle=function(e){var t=e.title,n;t||(n=h.getStateByIndex(0),n&&n.url===e.url&&(t=n.title||h.options.initialTitle));try{r.getElementsByTagName("title")[0].innerHTML=t.replace("<","&lt;").replace(">","&gt;").replace(" & "," &amp; ")}catch(i){}return r.title=t,h},h.queues=[],h.busy=function(e){typeof e!="undefined"?h.busy.flag=e:typeof h.busy.flag=="undefined"&&(h.busy.flag=!1);if(!h.busy.flag){u(h.busy.timeout);var t=function(){var e,n,r;if(h.busy.flag)return;for(e=h.queues.length-1;e>=0;--e){n=h.queues[e];if(n.length===0)continue;r=n.shift(),h.fireQueueItem(r),h.busy.timeout=o(t,h.options.busyDelay)}};h.busy.timeout=o(t,h.options.busyDelay)}return h.busy.flag},h.busy.flag=!1,h.fireQueueItem=function(e){return e.callback.apply(e.scope||h,e.args||[])},h.pushQueue=function(e){return h.queues[e.queue||0]=h.queues[e.queue||0]||[],h.queues[e.queue||0].push(e),h},h.queue=function(e,t){return typeof e=="function"&&(e={callback:e}),typeof t!="undefined"&&(e.queue=t),h.busy()?h.pushQueue(e):h.fireQueueItem(e),h},h.clearQueue=function(){return h.busy.flag=!1,h.queues=[],h},h.stateChanged=!1,h.doubleChecker=!1,h.doubleCheckComplete=function(){return h.stateChanged=!0,h.doubleCheckClear(),h},h.doubleCheckClear=function(){return h.doubleChecker&&(u(h.doubleChecker),h.doubleChecker=!1),h},h.doubleCheck=function(e){return h.stateChanged=!1,h.doubleCheckClear(),h.bugs.ieDoubleCheck&&(h.doubleChecker=o(function(){return h.doubleCheckClear(),h.stateChanged||e(),!0},h.options.doubleCheckInterval)),h},h.safariStatePoll=function(){var t=h.extractState(r.location.href),n;if(!h.isLastSavedState(t))return n=t,n||(n=h.createStateObject()),h.Adapter.trigger(e,"popstate"),h;return},h.back=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.back,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.back(!1)}),p.go(-1),!0)},h.forward=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.forward,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.forward(!1)}),p.go(1),!0)},h.go=function(e,t){var n;if(e>0)for(n=1;n<=e;++n)h.forward(t);else{if(!(e<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(n=-1;n>=e;--n)h.back(t)}return h};if(h.emulated.pushState){var d=function(){};h.pushState=h.pushState||d,h.replaceState=h.replaceState||d}else h.onPopState=function(t,n){var i=!1,s=!1,o,u;return h.doubleCheckComplete(),o=h.getHash(),o?(u=h.extractState(o||r.location.href,!0),u?h.replaceState(u.data,u.title,u.url,!1):(h.Adapter.trigger(e,"anchorchange"),h.busy(!1)),h.expectedStateId=!1,!1):(i=h.Adapter.extractEventData("state",t,n)||!1,i?s=h.getStateById(i):h.expectedStateId?s=h.getStateById(h.expectedStateId):s=h.extractState(r.location.href),s||(s=h.createStateObject(null,null,r.location.href)),h.expectedStateId=!1,h.isLastSavedState(s)?(h.busy(!1),!1):(h.storeState(s),h.saveState(s),h.setTitle(s),h.Adapter.trigger(e,"statechange"),h.busy(!1),!0))},h.Adapter.bind(e,"popstate",h.onPopState),h.pushState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.pushState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.pushState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0},h.replaceState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.replaceState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.replaceState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0};if(s){try{h.store=l.parse(s.getItem("History.store"))||{}}catch(v){h.store={}}h.normalizeStore()}else h.store={},h.normalizeStore();h.Adapter.bind(e,"beforeunload",h.clearAllIntervals),h.Adapter.bind(e,"unload",h.clearAllIntervals),h.saveState(h.storeState(h.extractState(r.location.href,!0))),s&&(h.onUnload=function(){var e,t;try{e=l.parse(s.getItem("History.store"))||{}}catch(n){e={}}e.idToState=e.idToState||{},e.urlToId=e.urlToId||{},e.stateToId=e.stateToId||{};for(t in h.idToState){if(!h.idToState.hasOwnProperty(t))continue;e.idToState[t]=h.idToState[t]}for(t in h.urlToId){if(!h.urlToId.hasOwnProperty(t))continue;e.urlToId[t]=h.urlToId[t]}for(t in h.stateToId){if(!h.stateToId.hasOwnProperty(t))continue;e.stateToId[t]=h.stateToId[t]}h.store=e,h.normalizeStore(),s.setItem("History.store",l.stringify(e))},h.intervalList.push(a(h.onUnload,h.options.storeInterval)),h.Adapter.bind(e,"beforeunload",h.onUnload),h.Adapter.bind(e,"unload",h.onUnload));if(!h.emulated.pushState){h.bugs.safariPoll&&h.intervalList.push(a(h.safariStatePoll,h.options.safariPollInterval));if(i.vendor==="Apple Computer, Inc."||(i.appCodeName||"")==="Mozilla")h.Adapter.bind(e,"hashchange",function(){h.Adapter.trigger(e,"popstate")}),h.getHash()&&h.Adapter.onDomLoad(function(){h.Adapter.trigger(e,"hashchange")})}},h.init()}(window)}catch(t){}}),timely.define("external_libs/jquery.tablescroller",["jquery_timely"],function(e){function n(){if(t)return t;var n=e('<div style="width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;"><div style="height:100px;"></div></div>');e("body").append(n);var r=e("div",n).innerWidth();n.css("overflow-y","auto");var i=e("div",n).innerWidth();return e(n).remove(),t=r-i,t}var t=0;e.fn.tableScroll=function(t){if(t=="undo"){var r=e(this).parent().parent();r.hasClass("tablescroll_wrapper")&&(r.find(".tablescroll_head thead").prependTo(this),r.find(".tablescroll_foot tfoot").appendTo(this),r.before(this),r.empty());return}var i=e.extend({},e.fn.tableScroll.defaults,t);return i.scrollbarWidth=n(),this.each(function(){var t=i.flush,n=e(this).addClass("tablescroll_body"),r=e('<div class="tablescroll_wrapper ai1ec-popover-boundary"></div>').insertBefore(n).append(n);r.parent("div").hasClass(i.containerClass)||e("<div></div>").addClass(i.containerClass).insertBefore(r).append(r);var s=i.width?i.width:n.outerWidth(),o=i.scroll?"auto":"hidden";r.css({width:s+"px",height:i.height+"px",overflow:o}),n.css("width",s+"px");var u=r.outerWidth(),a=u-s;r.css({width:s-a-2+"px"}),n.css("width",s-a-i.scrollbarWidth+"px"),n.outerHeight()<=i.height&&(r.css({height:"auto",width:s-a+"px"}),t=!1);var f=e("thead",n).length?!0:!1,l=e("tfoot",n).length?!0:!1,c=e("thead tr:first",n),h=e("tbody tr:first",n),p=e("tfoot tr:first",n),d=0;e("th, td",c).each(function(t){d=e(this).width(),e("th:eq("+t+"), td:eq("+t+")",c).css("width",d+"px"),e("th:eq("+t+"), td:eq("+t+")",h).css("width",d+"px"),l&&e("th:eq("+t+"), td:eq("+t+")",p).css("width",d+"px")});if(f)var v=e('<table class="tablescroll_head" cellspacing="0"></table>').insertBefore(r).prepend(e("thead",n));if(l)var m=e('<table class="tablescroll_foot" cellspacing="0"></table>').insertAfter(r).prepend(e("tfoot",n));v!=undefined&&(v.css("width",s+"px"),t&&(e("tr:first th:last, tr:first td:last",v).css("width",d+i.scrollbarWidth+"px"),v.css("width",r.outerWidth()+"px"))),m!=undefined&&(m.css("width",s+"px"),t&&(e("tr:first th:last, tr:first td:last",m).css("width",d+i.scrollbarWidth+"px"),m.css("width",r.outerWidth()+"px")))}),this},e.fn.tableScroll.defaults={flush:!0,width:null,height:100,containerClass:"tablescroll",scroll:!0}}),timely.define("external_libs/jquery.scrollTo",["jquery_timely"],function(e){function n(e){return typeof e=="object"?e:{top:e,left:e}}var t=e.scrollTo=function(t,n,r){e(window).scrollTo(t,n,r)};t.defaults={axis:"xy",duration:parseFloat(e.fn.jquery)>=1.3?0:1,limit:!0},t.window=function(t){return e(window)._scrollable()},e.fn._scrollable=function(){return this.map(function(){var t=this,n=!t.nodeName||e.inArray(t.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!n)return t;var r=(t.contentWindow||t).document||t.ownerDocument||t;return/webkit/i.test(navigator.userAgent)||r.compatMode=="BackCompat"?r.body:r.documentElement})},e.fn.scrollTo=function(r,i,s){return typeof i=="object"&&(s=i,i=0),typeof s=="function"&&(s={onAfter:s}),r=="max"&&(r=9e9),s=e.extend({},t.defaults,s),i=i||s.duration,s.queue=s.queue&&s.axis.length>1,s.queue&&(i/=2),s.offset=n(s.offset),s.over=n(s.over),this._scrollable().each(function(){function h(e){u.animate(l,i,s.easing,e&&function(){e.call(this,r,s)})}if(r==null)return;var o=this,u=e(o),a=r,f,l={},c=u.is("html,body");switch(typeof a){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(a)){a=n(a);break}a=e(a,this);if(!a.length)return;case"object":if(a.is||a.style)f=(a=e(a)).offset()}e.each(s.axis.split(""),function(e,n){var r=n=="x"?"Left":"Top",i=r.toLowerCase(),p="scroll"+r,d=o[p],v=t.max(o,n);if(f)l[p]=f[i]+(c?0:d-u.offset()[i]),s.margin&&(l[p]-=parseInt(a.css("margin"+r))||0,l[p]-=parseInt(a.css("border"+r+"Width"))||0),l[p]+=s.offset[i]||0,s.over[i]&&(l[p]+=a[n=="x"?"width":"height"]()*s.over[i]);else{var m=a[i];l[p]=m.slice&&m.slice(-1)=="%"?parseFloat(m)/100*v:m}s.limit&&/^\d+$/.test(l[p])&&(l[p]=l[p]<=0?0:Math.min(l[p],v)),!e&&s.queue&&(d!=l[p]&&h(s.onAfterFirst),delete l[p])}),h(s.onAfter)}).end()},t.max=function(t,n){var r=n=="x"?"Width":"Height",i="scroll"+r;if(!e(t).is("html,body"))return t[i]-e(t)[r.toLowerCase()]();var s="client"+r,o=t.ownerDocument.documentElement,u=t.ownerDocument.body;return Math.max(o[i],u[i])-Math.min(o[s],u[s])}}),timely.define("external_libs/locales/bootstrap-datepicker.bg",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.bg={days:["Неделя","Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота","Неделя"],daysShort:["Нед","Пон","Вто","Сря","Чет","Пет","Съб","Нед"],daysMin:["Н","П","В","С","Ч","П","С","Н"],months:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],monthsShort:["Ян","Фев","Мар","Апр","Май","Юни","Юли","Авг","Сеп","Окт","Ное","Дек"],today:"днес"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.br",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.br={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"]}}}}),timely.define("external_libs/locales/bootstrap-datepicker.cs",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.cs={days:["Neděle","Pondělí","Úterý","Středa","Čtvrtek","Pátek","Sobota","Neděle"],daysShort:["Ned","Pon","Úte","Stř","Čtv","Pát","Sob","Ned"],daysMin:["Ne","Po","Út","St","Čt","Pá","So","Ne"],months:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],monthsShort:["Led","Úno","Bře","Dub","Kvě","Čer","Čnc","Srp","Zář","Říj","Lis","Pro"],today:"Dnes"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.da",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.da={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I Dag",clear:"Nulstil"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.de",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.de={days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"],daysShort:["Son","Mon","Die","Mit","Don","Fre","Sam","Son"],daysMin:["So","Mo","Di","Mi","Do","Fr","Sa","So"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",clear:"Löschen",weekStart:1,format:"dd.mm.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.es",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.es={days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"],daysShort:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb","Dom"],daysMin:["Do","Lu","Ma","Mi","Ju","Vi","Sa","Do"],months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthsShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],today:"Hoy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.fi",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.fi={days:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai","sunnuntai"],daysShort:["sun","maa","tii","kes","tor","per","lau","sun"],daysMin:["su","ma","ti","ke","to","pe","la","su"],months:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],monthsShort:["tam","hel","maa","huh","tou","kes","hei","elo","syy","lok","mar","jou"],today:"tänään",weekStart:1,format:"d.m.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.fr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.fr={days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],daysMin:["D","L","Ma","Me","J","V","S","D"],months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthsShort:["Jan","Fév","Mar","Avr","Mai","Jui","Jul","Aou","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",clear:"Effacer",weekStart:1,format:"dd/mm/yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.id",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.id={days:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu","Minggu"],daysShort:["Mgu","Sen","Sel","Rab","Kam","Jum","Sab","Mgu"],daysMin:["Mg","Sn","Sl","Ra","Ka","Ju","Sa","Mg"],months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ags","Sep","Okt","Nov","Des"],today:"Hari Ini",clear:"Kosongkan"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.is",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.is={days:["Sunnudagur","Mánudagur","Þriðjudagur","Miðvikudagur","Fimmtudagur","Föstudagur","Laugardagur","Sunnudagur"],daysShort:["Sun","Mán","Þri","Mið","Fim","Fös","Lau","Sun"],daysMin:["Su","Má","Þr","Mi","Fi","Fö","La","Su"],months:["Janúar","Febrúar","Mars","Apríl","Maí","Júní","Júlí","Ágúst","September","Október","Nóvember","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Maí","Jún","Júl","Ágú","Sep","Okt","Nóv","Des"],today:"Í Dag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.it",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.it={days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato","Domenica"],daysShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab","Dom"],daysMin:["Do","Lu","Ma","Me","Gi","Ve","Sa","Do"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthsShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],today:"Oggi",clear:"Cancella",weekStart:1,format:"dd/mm/yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ja",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ja={days:["日曜","月曜","火曜","水曜","木曜","金曜","土曜","日曜"],daysShort:["日","月","火","水","木","金","土","日"],daysMin:["日","月","火","水","木","金","土","日"],months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],today:"今日",format:"yyyy/mm/dd"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.kr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.kr={days:["일요일","월요일","화요일","수요일","목요일","금요일","토요일","일요일"],daysShort:["일","월","화","수","목","금","토","일"],daysMin:["일","월","화","수","목","금","토","일"],months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],monthsShort:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]}}}}),timely.define("external_libs/locales/bootstrap-datepicker.lt",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.lt={days:["Sekmadienis","Pirmadienis","Antradienis","Trečiadienis","Ketvirtadienis","Penktadienis","Šeštadienis","Sekmadienis"],daysShort:["S","Pr","A","T","K","Pn","Š","S"],daysMin:["Sk","Pr","An","Tr","Ke","Pn","Št","Sk"],months:["Sausis","Vasaris","Kovas","Balandis","Gegužė","Birželis","Liepa","Rugpjūtis","Rugsėjis","Spalis","Lapkritis","Gruodis"],monthsShort:["Sau","Vas","Kov","Bal","Geg","Bir","Lie","Rugp","Rugs","Spa","Lap","Gru"],today:"Šiandien",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.lv",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.lv={days:["Svētdiena","Pirmdiena","Otrdiena","Trešdiena","Ceturtdiena","Piektdiena","Sestdiena","Svētdiena"],daysShort:["Sv","P","O","T","C","Pk","S","Sv"],daysMin:["Sv","Pr","Ot","Tr","Ce","Pk","Se","Sv"],months:["Janvāris","Februāris","Marts","Aprīlis","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jūn","Jūl","Aug","Sep","Okt","Nov","Dec"],today:"Šodien",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ms",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ms={days:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu","Ahad"],daysShort:["Aha","Isn","Sel","Rab","Kha","Jum","Sab","Aha"],daysMin:["Ah","Is","Se","Ra","Kh","Ju","Sa","Ah"],months:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],today:"Hari Ini"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.nb",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.nb={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],today:"I Dag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.nl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.nl={days:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zondag"],daysShort:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],daysMin:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],months:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"Vandaag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.pl={days:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota","Niedziela"],daysShort:["Nie","Pn","Wt","Śr","Czw","Pt","So","Nie"],daysMin:["N","Pn","Wt","Śr","Cz","Pt","So","N"],months:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],monthsShort:["Sty","Lu","Mar","Kw","Maj","Cze","Lip","Sie","Wrz","Pa","Lis","Gru"],today:"Dzisiaj",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pt-BR",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",clear:"Limpar"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pt",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.pt={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",clear:"Limpar"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ru",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ru={days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота","Воскресенье"],daysShort:["Вск","Пнд","Втр","Срд","Чтв","Птн","Суб","Вск"],daysMin:["Вс","Пн","Вт","Ср","Чт","Пт","Сб","Вс"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthsShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],today:"Сегодня",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.sl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.sl={days:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota","Nedelja"],daysShort:["Ned","Pon","Tor","Sre","Čet","Pet","Sob","Ned"],daysMin:["Ne","Po","To","Sr","Če","Pe","So","Ne"],months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],today:"Danes"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.sv",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.sv={days:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag","Söndag"],daysShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör","Sön"],daysMin:["Sö","Må","Ti","On","To","Fr","Lö","Sö"],months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I Dag",format:"yyyy-mm-dd",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.th",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.th={days:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัส","ศุกร์","เสาร์","อาทิตย์"],daysShort:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],daysMin:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],months:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],monthsShort:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],today:"วันนี้"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.tr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.tr={days:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi","Pazar"],daysShort:["Pz","Pzt","Sal","Çrş","Prş","Cu","Cts","Pz"],daysMin:["Pz","Pzt","Sa","Çr","Pr","Cu","Ct","Pz"],months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],monthsShort:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],today:"Bugün",format:"dd.mm.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.zh-CN",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["zh-CN"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今日",format:"yyyy年mm月dd日",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.zh-TW",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["zh-TW"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["週日","週一","週二","週三","週四","週五","週六","週日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今天",format:"yyyy年mm月dd日",weekStart:1}}}}),timely.define("external_libs/bootstrap_datepicker",["jquery_timely","ai1ec_config","external_libs/locales/bootstrap-datepicker.bg","external_libs/locales/bootstrap-datepicker.br","external_libs/locales/bootstrap-datepicker.cs","external_libs/locales/bootstrap-datepicker.da","external_libs/locales/bootstrap-datepicker.de","external_libs/locales/bootstrap-datepicker.es","external_libs/locales/bootstrap-datepicker.fi","external_libs/locales/bootstrap-datepicker.fr","external_libs/locales/bootstrap-datepicker.id","external_libs/locales/bootstrap-datepicker.is","external_libs/locales/bootstrap-datepicker.it","external_libs/locales/bootstrap-datepicker.ja","external_libs/locales/bootstrap-datepicker.kr","external_libs/locales/bootstrap-datepicker.lt","external_libs/locales/bootstrap-datepicker.lv","external_libs/locales/bootstrap-datepicker.ms","external_libs/locales/bootstrap-datepicker.nb","external_libs/locales/bootstrap-datepicker.nl","external_libs/locales/bootstrap-datepicker.pl","external_libs/locales/bootstrap-datepicker.pt-BR","external_libs/locales/bootstrap-datepicker.pt","external_libs/locales/bootstrap-datepicker.ru","external_libs/locales/bootstrap-datepicker.sl","external_libs/locales/bootstrap-datepicker.sv","external_libs/locales/bootstrap-datepicker.th","external_libs/locales/bootstrap-datepicker.tr","external_libs/locales/bootstrap-datepicker.zh-CN","external_libs/locales/bootstrap-datepicker.zh-TW"],function(e,t){function r(){return new Date(Date.UTC.apply(Date,arguments))}function i(){var e=new Date;return r(e.getFullYear(),e.getMonth(),e.getDate())}function s(e){return function(){return this[e].apply(this,arguments)}}function f(t,n){var r=e(t).data(),i={},s,o=new RegExp("^"+n.toLowerCase()+"([A-Z])"),n=new RegExp("^"+n.toLowerCase());for(var u in r)n.test(u)&&(s=u.replace(o,function(e,t){return t.toLowerCase()}),i[s]=r[u]);return i}function l(t){var n={};if(!d[t]){t=t.split("-")[0];if(!d[t])return}var r=d[t];return e.each(p,function(e,t){t in r&&(n[t]=r[t])}),n}var n=e(window),o=function(){var t={get:function(e){return this.slice(e)[0]},contains:function(e){var t=e&&e.valueOf();for(var n=0,r=this.length;n<r;n++)if(this[n].valueOf()===t)return n;return-1},remove:function(e){this.splice(e,1)},replace:function(t){if(!t)return;e.isArray(t)||(t=[t]),this.clear(),this.push.apply(this,t)},clear:function(){this.splice(0)},copy:function(){var e=new o;return e.replace(this),e}};return function(){var n=[];return n.push.apply(n,arguments),e.extend(n,t),n}}(),u=function(t,n){this.dates=new o,this.viewDate=i(),this.focusDate=null,this._process_options(n),this.element=e(t),this.isInline=!1,this.isInput=this.element.is("input"),this.component=this.element.is(".ai1ec-date")?this.element.find(".ai1ec-input-group, .ai1ec-input-group-addon, .ai1ec-btn"):!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&this.component.length===0&&(this.component=!1),this.picker=e(v.template),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("ai1ec-datepicker-inline").appendTo(this.element):this.picker.addClass("ai1ec-datepicker-dropdown ai1ec-dropdown-menu"),this.o.rtl&&this.picker.addClass("ai1ec-datepicker-rtl"),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("tfoot th.ai1ec-today").attr("colspan",function(e,t){return parseInt(t)+1}),this._allow_update=!1,this.setStartDate(this._o.startDate),this.setEndDate(this._o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};u.prototype={constructor:u,_process_options:function(n){this._o=e.extend({},this._o,n);var r=this.o=e.extend({},this._o),i=r.language;d[i]||(i=i.split("-")[0],d[i]||(i=t.language,d[i]||(i=h.language))),r.language=i;switch(r.startView){case 2:case"decade":r.startView=2;break;case 1:case"year":r.startView=1;break;default:r.startView=0}switch(r.minViewMode){case 1:case"months":r.minViewMode=1;break;case 2:case"years":r.minViewMode=2;break;default:r.minViewMode=0}r.startView=Math.max(r.startView,r.minViewMode),r.multidate!==!0&&(r.multidate=Number(r.multidate)||!1,r.multidate!==!1?r.multidate=Math.max(0,r.multidate):r.multidate=1),r.multidateSeparator=String(r.multidateSeparator),r.weekStart%=7,r.weekEnd=(r.weekStart+6)%7;var s=v.parseFormat(r.format);r.startDate!==-Infinity&&(r.startDate?r.startDate instanceof Date?r.startDate=this._local_to_utc(this._zero_time(r.startDate)):r.startDate=v.parseDate(r.startDate,s,r.language):r.startDate=-Infinity),r.endDate!==Infinity&&(r.endDate?r.endDate instanceof Date?r.endDate=this._local_to_utc(this._zero_time(r.endDate)):r.endDate=v.parseDate(r.endDate,s,r.language):r.endDate=Infinity),r.daysOfWeekDisabled=r.daysOfWeekDisabled||[],e.isArray(r.daysOfWeekDisabled)||(r.daysOfWeekDisabled=r.daysOfWeekDisabled.split(/[,\s]*/)),r.daysOfWeekDisabled=e.map(r.daysOfWeekDisabled,function(e){return parseInt(e,10)});var o=String(r.orientation).toLowerCase().split(/\s+/g),u=r.orientation.toLowerCase();o=e.grep(o,function(e){return/^auto|left|right|top|bottom$/.test(e)}),r.orientation={x:"auto",y:"auto"};if(!!u&&u!=="auto")if(o.length===1)switch(o[0]){case"top":case"bottom":r.orientation.y=o[0];break;case"left":case"right":r.orientation.x=o[0]}else u=e.grep(o,function(e){return/^left|right$/.test(e)}),r.orientation.x=u[0]||"auto",u=e.grep(o,function(e){return/^top|bottom$/.test(e)}),r.orientation.y=u[0]||"auto"},_events:[],_secondaryEvents:[],_applyEvents:function(e){for(var t=0,n,r,i;t<e.length;t++)n=e[t][0],e[t].length==2?(r=undefined,i=e[t][1]):e[t].length==3&&(r=e[t][1],i=e[t][2]),n.on(i,r)},_unapplyEvents:function(e){for(var t=0,n,r,i;t<e.length;t++)n=e[t][0],e[t].length==2?(i=undefined,r=e[t][1]):e[t].length==3&&(i=e[t][1],r=e[t][2]),n.off(r,i)},_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:e.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:e.proxy(this.keydown,this)}],[this.component,{click:e.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:e.proxy(this.show,this)}]],this._events.push([this.element,"*",{blur:e.proxy(function(e){this._focused_from=e.target},this)}],[this.element,{blur:e.proxy(function(e){this._focused_from=e.target},this)}]),this._secondaryEvents=[[this.picker,{click:e.proxy(this.click,this)}],[e(window),{resize:e.proxy(this.place,this)}],[e(document),{"mousedown touchstart":e.proxy(function(e){this.element.is(e.target)||this.element.find(e.target).length||this.picker.is(e.target)||this.picker.find(e.target).length||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(t,n){var r=n||this.dates.get(-1),i=this._utc_to_local(r);this.element.trigger({type:t,date:i,dates:e.map(this.dates,this._utc_to_local),format:e.proxy(function(e,t){arguments.length===0?(e=this.dates.length-1,t=this.o.format):typeof e=="string"&&(t=e,e=this.dates.length-1),t=t||this.o.format;var n=this.dates.get(e);return v.formatDate(n,t,this.o.language)},this)})},show:function(e){this.isInline||this.picker.appendTo("body"),this.picker.show(),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.place(),this._attachSecondaryEvents(),this._trigger("show")},hide:function(){if(this.isInline)return;if(!this.picker.is(":visible"))return;this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide")},remove:function(){this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date},_utc_to_local:function(e){return e&&new Date(e.getTime()+e.getTimezoneOffset()*6e4)},_local_to_utc:function(e){return e&&new Date(e.getTime()-e.getTimezoneOffset()*6e4)},_zero_time:function(e){return e&&new Date(e.getFullYear(),e.getMonth(),e.getDate())},_zero_utc_time:function(e){return e&&new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},getDates:function(){return e.map(this.dates,this._utc_to_local)},getUTCDates:function(){return e.map(this.dates,function(e){return new Date(e)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){return new Date(this.dates.get(-1))},setDates:function(){this.update.apply(this,arguments),this._trigger("changeDate"),this.setValue()},setUTCDates:function(){this.update.apply(this,e.map(arguments,this._utc_to_local)),this._trigger("changeDate"),this.setValue()},setDate:s("setDates"),setUTCDate:s("setUTCDates"),setValue:function(){var e=this.getFormattedDate();this.isInput?this.element.val(e).change():this.component&&this.element.find("input").val(e).change()},getFormattedDate:function(t){t===undefined&&(t=this.o.format);var n=this.o.language;return e.map(this.dates,function(e){return v.formatDate(e,t,n)}).join(this.o.multidateSeparator)},setStartDate:function(e){this._process_options({startDate:e}),this.update(),this.updateNavArrows()},setEndDate:function(e){this._process_options({endDate:e}),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(e){this._process_options({daysOfWeekDisabled:e}),this.update(),this.updateNavArrows()},place:function(){if(this.isInline)return;var t=this.picker.outerWidth(),r=this.picker.outerHeight(),i=10,s=n.width(),o=n.height(),u=n.scrollTop(),a=parseInt(this.element.parents().filter(function(){return e(this).css("z-index")!="auto"}).first().css("z-index"))+10,f=this.component?this.component.parent().offset():this.element.offset(),l=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),c=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),h=f.left,p=f.top;this.picker.removeClass("ai1ec-datepicker-orient-top ai1ec-datepicker-orient-bottom ai1ec-datepicker-orient-right ai1ec-datepicker-orient-left"),this.o.orientation.x!=="auto"?(this.picker.addClass("ai1ec-datepicker-orient-"+this.o.orientation.x),this.o.orientation.x==="right"&&(h-=t-c)):(this.picker.addClass("ai1ec-datepicker-orient-left"),f.left<0?h-=f.left-i:f.left+t>s&&(h=s-t-i));var d=this.o.orientation.y,v,m;d==="auto"&&(v=-u+f.top-r,m=u+o-(f.top+l+r),Math.max(v,m)===m?d="top":d="bottom"),this.picker.addClass("ai1ec-datepicker-orient-"+d),d==="top"?p+=l:p-=r+parseInt(this.picker.css("padding-top")),this.picker.css({top:p,left:h,zIndex:a})},_allow_update:!0,update:function(){if(!this._allow_update)return;var t=this.dates.copy(),n=[],r=!1;arguments.length?(e.each(arguments,e.proxy(function(e,t){t instanceof Date&&(t=this._local_to_utc(t)),n.push(t)},this)),r=!0):(n=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),n&&this.o.multidate?n=n.split(this.o.multidateSeparator):n=[n],delete this.element.data().date),n=e.map(n,e.proxy(function(e){return v.parseDate(e,this.o.format,this.o.language)},this)),n=e.grep(n,e.proxy(function(e){return e<this.o.startDate||e>this.o.endDate||!e},this),!0),this.dates.replace(n),this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate&&(this.viewDate=new Date(this.o.endDate)),r?this.setValue():n.length&&String(t)!==String(this.dates)&&this._trigger("changeDate"),!this.dates.length&&t.length&&this._trigger("clearDate"),this.fill()},fillDow:function(){var e=this.o.weekStart,t="<tr>";if(this.o.calendarWeeks){var n='<th class="ai1ec-cw">&nbsp;</th>';t+=n,this.picker.find(".ai1ec-datepicker-days thead tr:first-child").prepend(n)}while(e<this.o.weekStart+7)t+='<th class="ai1ec-dow">'+d[this.o.language].daysMin[e++%7]+"</th>";t+="</tr>",this.picker.find(".ai1ec-datepicker-days thead").append(t)},fillMonths:function(){var e="",t=0;while(t<12)e+='<span class="ai1ec-month">'+d[this.o.language].monthsShort[t++]+"</span>";this.picker.find(".ai1ec-datepicker-months td").html(e)},setRange:function(t){!t||!t.length?delete this.range:this.range=e.map(t,function(e){return e.valueOf()}),this.fill()},getClassNames:function(t){var n=[],r=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth(),s=new Date;return t.getUTCFullYear()<r||t.getUTCFullYear()==r&&t.getUTCMonth()<i?n.push("ai1ec-old"):(t.getUTCFullYear()>r||t.getUTCFullYear()==r&&t.getUTCMonth()>i)&&n.push("ai1ec-new"),this.focusDate&&t.valueOf()===this.focusDate.valueOf()&&n.push("ai1ec-focused"),this.o.todayHighlight&&t.getUTCFullYear()==s.getFullYear()&&t.getUTCMonth()==s.getMonth()&&t.getUTCDate()==s.getDate()&&n.push("ai1ec-today"),this.dates.contains(t)!==-1&&n.push("ai1ec-active"),(t.valueOf()<this.o.startDate||t.valueOf()>this.o.endDate||e.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled)!==-1)&&n.push("ai1ec-disabled"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&n.push("ai1ec-range"),e.inArray(t.valueOf(),this.range)!=-1&&n.push("ai1ec-selected")),n},fill:function(){var t=new Date(this.viewDate),n=t.getUTCFullYear(),i=t.getUTCMonth(),s=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,o=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,u=this.o.endDate!==Infinity?this.o.endDate.getUTCFullYear():Infinity,a=this.o.endDate!==Infinity?this.o.endDate.getUTCMonth():Infinity,f,l;this.picker.find(".ai1ec-datepicker-days thead th.ai1ec-datepicker-switch").text(d[this.o.language].months[i]+" "+n),this.picker.find("tfoot th.ai1ec-today").text(d[this.o.language].today).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot th.ai1ec-clear").text(d[this.o.language].clear).toggle(this.o.clearBtn!==!1),this.updateNavArrows(),this.fillMonths();var c=r(n,i-1,28),h=v.getDaysInMonth(c.getUTCFullYear(),c.getUTCMonth());c.setUTCDate(h),c.setUTCDate(h-(c.getUTCDay()-this.o.weekStart+7)%7);var p=new Date(c);p.setUTCDate(p.getUTCDate()+42),p=p.valueOf();var m=[],g;while(c.valueOf()<p){if(c.getUTCDay()==this.o.weekStart){m.push("<tr>");if(this.o.calendarWeeks){var y=new Date(+c+(this.o.weekStart-c.getUTCDay()-7)%7*864e5),b=new Date(+y+(11-y.getUTCDay())%7*864e5),w=new Date(+(w=r(b.getUTCFullYear(),0,1))+(11-w.getUTCDay())%7*864e5),E=(b-w)/864e5/7+1;m.push('<td class="ai1ec-cw">'+E+"</td>")}}g=this.getClassNames(c),g.push("ai1ec-day");if(this.o.beforeShowDay!==e.noop){var S=this.o.beforeShowDay(this._utc_to_local(c));S===undefined?S={}:typeof S=="boolean"?S={enabled:S}:typeof S=="string"&&(S={classes:S}),S.enabled===!1&&g.push("ai1ec-disabled"),S.classes&&(g=g.concat(S.classes.split(/\s+/))),S.tooltip&&(f=S.tooltip)}g=e.unique(g),m.push('<td class="'+g.join(" ")+'"'+(f?' title="'+f+'"':"")+">"+c.getUTCDate()+"</td>"),c.getUTCDay()==this.o.weekEnd&&m.push("</tr>"),c.setUTCDate(c.getUTCDate()+1)}this.picker.find(".ai1ec-datepicker-days tbody").empty().append(m.join(""));var x=this.picker.find(".ai1ec-datepicker-months").find("th:eq(1)").text(n).end().find("span").removeClass("ai1ec-active");e.each(this.dates,function(e,t){t.getUTCFullYear()==n&&x.eq(t.getUTCMonth()).addClass("ai1ec-active")}),(n<s||n>u)&&x.addClass("ai1ec-disabled"),n==s&&x.slice(0,o).addClass("ai1ec-disabled"),n==u&&x.slice(a+1).addClass("ai1ec-disabled"),m="",n=parseInt(n/10,10)*10;var T=this.picker.find(".ai1ec-datepicker-years").find("th:eq(1)").text(n+"-"+(n+9)).end().find("td");n-=1;var N=e.map(this.dates,function(e){return e.getUTCFullYear()}),C;for(var k=-1;k<11;k++)C=["ai1ec-year"],k===-1?C.push("ai1ec-old"):k===10&&C.push("ai1ec-new"),e.inArray(n,N)!==-1&&C.push("ai1ec-active"),(n<s||n>u)&&C.push("ai1ec-disabled"),m+='<span class="'+C.join(" ")+'">'+n+"</span>",n+=1;T.html(m)},updateNavArrows:function(){if(!this._allow_update)return;var e=new Date(this.viewDate),t=e.getUTCFullYear(),n=e.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-Infinity&&t<=this.o.startDate.getUTCFullYear()&&n<=this.o.startDate.getUTCMonth()?this.picker.find(".ai1ec-prev").css({visibility:"hidden"}):this.picker.find(".ai1ec-prev").css({visibility:"visible"}),this.o.endDate!==Infinity&&t>=this.o.endDate.getUTCFullYear()&&n>=this.o.endDate.getUTCMonth()?this.picker.find(".ai1ec-next").css({visibility:"hidden"}):this.picker.find(".ai1ec-next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-Infinity&&t<=this.o.startDate.getUTCFullYear()?this.picker.find(".ai1ec-prev").css({visibility:"hidden"}):this.picker.find(".ai1ec-prev").css({visibility:"visible"}),this.o.endDate!==Infinity&&t>=this.o.endDate.getUTCFullYear()?this.picker.find(".ai1ec-next").css({visibility:"hidden"}):this.picker.find(".ai1ec-next").css({visibility:"visible"})}},click:function(t){t.preventDefault();var n=e(t.target).closest("span, td, th"),i,s,o;if(n.length==1)switch(n[0].nodeName.toLowerCase()){case"th":switch(n[0].className){case"ai1ec-datepicker-switch":this.showMode(1);break;case"ai1ec-prev":case"ai1ec-next":var u=v.modes[this.viewMode].navStep*(n[0].className=="ai1ec-prev"?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,u),this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,u),this.viewMode===1&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"ai1ec-today":var a=new Date;a=r(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0),this.showMode(-2);var f=this.o.todayBtn=="linked"?null:"view";this._setDate(a,f);break;case"ai1ec-clear":var l;this.isInput?l=this.element:this.component&&(l=this.element.find("input")),l&&l.val("").change(),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()}break;case"span":n.is(".ai1ec-disabled")||(this.viewDate.setUTCDate(1),n.is(".ai1ec-month")?(o=1,s=n.parent().find("span").index(n),i=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(s),this._trigger("changeMonth",this.viewDate),this.o.minViewMode===1&&this._setDate(r(i,s,o))):(o=1,s=0,i=parseInt(n.text(),10)||0,this.viewDate.setUTCFullYear(i),this._trigger("changeYear",this.viewDate),this.o.minViewMode===2&&this._setDate(r(i,s,o))),this.showMode(-1),this.fill());break;case"td":n.is(".ai1ec-day")&&!n.is(".ai1ec-disabled")&&(o=parseInt(n.text(),10)||1,i=this.viewDate.getUTCFullYear(),s=this.viewDate.getUTCMonth(),n.is(".ai1ec-old")?s===0?(s=11,i-=1):s-=1:n.is(".ai1ec-new")&&(s==11?(s=0,i+=1):s+=1),this._setDate(r(i,s,o)))}this.picker.is(":visible")&&this._focused_from&&e(this._focused_from).focus(),delete this._focused_from},_toggle_multidate:function(e){var t=this.dates.contains(e);e?t!==-1?this.dates.remove(t):this.dates.push(e):this.dates.clear();if(typeof this.o.multidate=="number")while(this.dates.length>this.o.multidate)this.dates.remove(0)},_setDate:function(e,t){(!t||t=="date")&&this._toggle_multidate(e&&new Date(e));if(!t||t=="view")this.viewDate=e&&new Date(e);this.fill(),this.setValue(),this._trigger("changeDate");var n;this.isInput?n=this.element:this.component&&(n=this.element.find("input")),n&&n.change(),this.o.autoclose&&(!t||t=="date")&&this.hide()},moveMonth:function(e,t){if(!e)return undefined;if(!t)return e;var n=new Date(e.valueOf()),r=n.getUTCDate(),i=n.getUTCMonth(),s=Math.abs(t),o,u;t=t>0?1:-1;if(s==1){u=t==-1?function(){return n.getUTCMonth()==i}:function(){return n.getUTCMonth()!=o},o=i+t,n.setUTCMonth(o);if(o<0||o>11)o=(o+12)%12}else{for(var a=0;a<s;a++)n=this.moveMonth(n,t);o=n.getUTCMonth(),n.setUTCDate(r),u=function(){return o!=n.getUTCMonth()}}while(u())n.setUTCDate(--r),n.setUTCMonth(o);return n},moveYear:function(e,t){return this.moveMonth(e,t*12)},dateWithinRange:function(e){return e>=this.o.startDate&&e<=this.o.endDate},keydown:function(e){if(this.picker.is(":not(:visible)")){e.keyCode==27&&this.show();return}var t=!1,n,r,s,o=this.focusDate||this.viewDate;switch(e.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),e.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;n=e.keyCode==37?-1:1,e.ctrlKey?(r=this.moveYear(this.dates.get(-1)||i(),n),s=this.moveYear(o,n),this._trigger("changeYear",this.viewDate)):e.shiftKey?(r=this.moveMonth(this.dates.get(-1)||i(),n),s=this.moveMonth(o,n),this._trigger("changeMonth",this.viewDate)):(r=new Date(this.dates.get(-1)||i()),r.setUTCDate(r.getUTCDate()+n),s=new Date(o),s.setUTCDate(o.getUTCDate()+n)),this.dateWithinRange(r)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),e.preventDefault());break;case 38:case 40:if(!this.o.keyboardNavigation)break;n=e.keyCode==38?-1:1,e.ctrlKey?(r=this.moveYear(this.dates.get(-1)||i(),n),s=this.moveYear(o,n),this._trigger("changeYear",this.viewDate)):e.shiftKey?(r=this.moveMonth(this.dates.get(-1)||i(),n),s=this.moveMonth(o,n),this._trigger("changeMonth",this.viewDate)):(r=new Date(this.dates.get(-1)||i()),r.setUTCDate(r.getUTCDate()+n*7),s=new Date(o),s.setUTCDate(o.getUTCDate()+n*7)),this.dateWithinRange(r)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),e.preventDefault());break;case 32:break;case 13:o=this.focusDate||this.dates.get(-1)||this.viewDate,this._toggle_multidate(o),t=!0,this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(e.preventDefault(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}if(t){this.dates.length?this._trigger("changeDate"):this._trigger("clearDate");var u;this.isInput?u=this.element:this.component&&(u=this.element.find("input")),u&&u.change()}},showMode:function(e){e&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+e))),this.picker.find(">div").hide().filter(".ai1ec-datepicker-"+v.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}};var a=function(t,n){this.element=e(t),this.inputs=e.map(n.inputs,function(e){return e.jquery?e[0]:e}),delete n.inputs,e(this.inputs).datepicker(n).bind("changeDate",e.proxy(this.dateUpdated,this)),this.pickers=e.map(this.inputs,function(t){return e(t).data("datepicker")}),this.updateDates()};a.prototype={updateDates:function(){this.dates=e.map(this.pickers,function(e){return e.getUTCDate()}),this.updateRanges()},updateRanges:function(){var t=e.map(this.dates,function(e){return e.valueOf()});e.each(this.pickers,function(e,n){n.setRange(t)})},dateUpdated:function(t){if(this.updating)return;this.updating=!0;var n=e(t.target).data("datepicker"),r=n.getUTCDate(),i=e.inArray(t.target,this.inputs),s=this.inputs.length;if(i==-1)return;e.each(this.pickers,function(e,t){t.getUTCDate()||t.setUTCDate(r)});if(r<this.dates[i])while(i>=0&&r<this.dates[i])this.pickers[i--].setUTCDate(r);else if(r>this.dates[i])while(i<s&&r>this.dates[i])this.pickers[i++].setUTCDate(r);this.updateDates(),delete this.updating},remove:function(){e.map(this.pickers,function(e){e.remove()}),delete this.element.data().datepicker}};var c=e.fn.datepicker;e.fn.datepicker=function(t){var n=Array.apply(null,arguments);n.shift();var r;return this.each(function(){var i=e(this),s=i.data("datepicker"),o=typeof t=="object"&&t;if(!s){var c=f(this,"date"),p=e.extend({},h,c,o),d=l(p.language),v=e.extend({},h,d,c,o);if(i.is(".ai1ec-input-daterange")||v.inputs){var m={inputs:v.inputs||i.find("input").toArray()};i.data("datepicker",s=new a(this,e.extend(v,m)))}else i.data("datepicker",s=new u(this,v))}if(typeof t=="string"&&typeof s[t]=="function"){r=s[t].apply(s,n);if(r!==undefined)return!1}}),r!==undefined?r:this};var h=e.fn.datepicker.defaults={autoclose:!1,beforeShowDay:e.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:Infinity,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-Infinity,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0},p=e.fn.datepicker.locale_opts=["format","rtl","weekStart"];e.fn.datepicker.Constructor=u;var d=e.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"}},v={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(e){return e%4===0&&e%100!==0||e%400===0},getDaysInMonth:function(e,t){return[31,v.isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(e){var t=e.replace(this.validParts,"\0").split("\0"),n=e.match(this.validParts);if(!t||!t.length||!n||n.length===0)throw new Error("Invalid date format.");return{separators:t,parts:n}},parseDate:function(t,n,i){if(!t)return undefined;if(t instanceof Date)return t;typeof n=="string"&&(n=v.parseFormat(n));if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(t)){var s=/([\-+]\d+)([dmwy])/,o=t.match(/([\-+]\d+)([dmwy])/g),a,f;t=new Date;for(var l=0;l<o.length;l++){a=s.exec(o[l]),f=parseInt(a[1]);switch(a[2]){case"d":t.setUTCDate(t.getUTCDate()+f);break;case"m":t=u.prototype.moveMonth.call(u.prototype,t,f);break;case"w":t.setUTCDate(t.getUTCDate()+f*7);break;case"y":t=u.prototype.moveYear.call(u.prototype,t,f)}}return r(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),0,0,0)}var o=t&&t.match(this.nonpunctuation)||[],t=new Date,c={},h=["yyyy","yy","M","MM","m","mm","d","dd"],p={yyyy:function(e,t){return e.setUTCFullYear(t)},yy:function(e,t){return e.setUTCFullYear(2e3+t)},m:function(e,t){if(isNaN(e))return e;t-=1;while(t<0)t+=12;t%=12,e.setUTCMonth(t);while(e.getUTCMonth()!=t)e.setUTCDate(e.getUTCDate()-1);return e},d:function(e,t){return e.setUTCDate(t)}},m,g,a;p.M=p.MM=p.mm=p.m,p.dd=p.d,t=r(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0);var y=n.parts.slice();o.length!=y.length&&(y=e(y).filter(function(t,n){return e.inArray(n,h)!==-1}).toArray());if(o.length==y.length){for(var l=0,b=y.length;l<b;l++){m=parseInt(o[l],10),a=y[l];if(isNaN(m))switch(a){case"MM":g=e(d[i].months).filter(function(){var e=this.slice(0,o[l].length),t=o[l].slice(0,e.length);return e==t}),m=e.inArray(g[0],d[i].months)+1;break;case"M":g=e(d[i].monthsShort).filter(function(){var e=this.slice(0,o[l].length),t=o[l].slice(0,e.length);return e==t}),m=e.inArray(g[0],d[i].monthsShort)+1}c[a]=m}for(var l=0,w,E;l<h.length;l++)E=h[l],E in c&&!isNaN(c[E])&&(w=new Date(t),p[E](w,c[E]),isNaN(w)||(t=w))}return t},formatDate:function(t,n,r){if(!t)return"";typeof n=="string"&&(n=v.parseFormat(n));var i={d:t.getUTCDate(),D:d[r].daysShort[t.getUTCDay()],DD:d[r].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:d[r].monthsShort[t.getUTCMonth()],MM:d[r].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()};i.dd=(i.d<10?"0":"")+i.d,i.mm=(i.m<10?"0":"")+i.m;var t=[],s=e.extend([],n.separators);for(var o=0,u=n.parts.length;o<=u;o++)s.length&&t.push(s.shift()),t.push(i[n.parts[o]]);return t.join("")},headTemplate:'<thead><tr><th class="ai1ec-prev"><i class="ai1ec-fa ai1ec-fa-arrow-left"></i></th><th colspan="5" class="ai1ec-datepicker-switch"></th><th class="ai1ec-next"><i class="ai1ec-fa ai1ec-fa-arrow-right"></i></th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="ai1ec-today"></th></tr><tr><th colspan="7" class="ai1ec-clear"></th></tr></tfoot>'};v.template='<div class="ai1ec-datepicker"><div class="ai1ec-datepicker-days"><table class=" ai1ec-table-condensed">'+v.headTemplate+"<tbody></tbody>"+v.footTemplate+"</table>"+"</div>"+'<div class="ai1ec-datepicker-months">'+'<table class="ai1ec-table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table>"+"</div>"+'<div class="ai1ec-datepicker-years">'+'<table class="ai1ec-table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table>"+"</div>"+"</div>",e.fn.datepicker.DPGlobal=v,e.fn.datepicker.noConflict=function(){return e.fn.datepicker=c,this},e(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var n=e(this);if(n.data("datepicker"))return;t.preventDefault(),n.datepicker("show")}),e(function(){e('[data-provide="datepicker-inline"]').datepicker()});for(var m=2,g=arguments.length;m<g;m++)arguments[m].localize()}),timely.define("external_libs/bootstrap/alert",["jquery_timely"],function(e){var t='[data-dismiss="ai1ec-alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed.bs.alert").remove()}var n=e(this),r=n.attr("data-target");r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));var i=e(r);t&&t.preventDefault(),i.length||(i=n.hasClass("ai1ec-alert")?n:n.parent()),i.trigger(t=e.Event("close.bs.alert"));if(t.isDefaultPrevented())return;i.removeClass("ai1ec-in"),e.support.transition&&i.hasClass("ai1ec-fade")?i.one(e.support.transition.end,s).emulateTransitionEnd(150):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("bs.alert");i||r.data("bs.alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.bs.alert.data-api",t,n.prototype.close)}),timely.define("external_libs/jquery_cookie",["jquery_timely"],function(e){function n(e){return u.raw?e:encodeURIComponent(e)}function r(e){return u.raw?e:decodeURIComponent(e)}function i(e){return n(u.json?JSON.stringify(e):String(e))}function s(e){e.indexOf('"')===0&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(t," ")),u.json?JSON.parse(e):e}catch(n){}}function o(t,n){var r=u.raw?t:s(t);return e.isFunction(n)?n(r):r}var t=/\+/g,u=e.cookie=function(t,s,a){if(s!==undefined&&!e.isFunction(s)){a=e.extend({},u.defaults,a);if(typeof a.expires=="number"){var f=a.expires,l=a.expires=new Date;l.setTime(+l+f*864e5)}return document.cookie=[n(t),"=",i(s),a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+a.domain:"",a.secure?"; secure":""].join("")}var c=t?undefined:{},h=document.cookie?document.cookie.split("; "):[];for(var p=0,d=h.length;p<d;p++){var v=h[p].split("="),m=r(v.shift()),g=v.join("=");if(t&&t===m){c=o(g,s);break}!t&&(g=o(g))!==undefined&&(c[m]=g)}return c};u.defaults={},e.removeCookie=function(t,n){return e.cookie(t)===undefined?!1:(e.cookie(t,"",e.extend({},n,{expires:-1})),!e.cookie(t))}}),timely.define("scripts/calendar/load_views",["jquery_timely","scripts/calendar/print","scripts/calendar/agenda_view","scripts/calendar/month_view","libs/frontend_utils","libs/utils","ai1ec_calendar","ai1ec_config","scripts/common_scripts/frontend/common_frontend","libs/select2_multiselect_helper","external_libs/jquery_history","external_libs/jquery.tablescroller","external_libs/jquery.scrollTo","external_libs/bootstrap_datepicker","external_libs/bootstrap/alert","external_libs/jquery_cookie"],function(e,t,n,r,i,s,o,u,a,f){e.cookie.json=!0;var l="ai1ec_saved_filter",c=!e("#save_filtered_views").hasClass("ai1ec-hide"),h=function(){var t=e("#ai1ec-view-dropdown .ai1ec-dropdown-menu .ai1ec-active a"),n=u.week_view_ends_at-u.week_view_starts_at,i=n*60;e("table.ai1ec-week-view-original").tableScroll({height:i,containerClass:"ai1ec-week-view ai1ec-popover-boundary",scroll:!1}),e("table.ai1ec-oneday-view-original").tableScroll({height:i,containerClass:"ai1ec-oneday-view ai1ec-popover-boundary",scroll:!1});if(e(".ai1ec-week-view").length||e(".ai1ec-oneday-view").length)e(".ai1ec-oneday-view .tablescroll_wrapper, .ai1ec-week-view .tablescroll_wrapper").scrollTo(".ai1ec-hour-marker:eq("+u.week_view_starts_at+")"),e(".ai1ec-hour-marker:eq("+u.week_view_starts_at+")").addClass("ai1ec-first-visible");e(".ai1ec-month-view .ai1ec-multiday").length&&r.extend_multiday_events(),e("#ai1ec-calendar-view-container").trigger("initialize_view.ai1ec")},p=function(){e("#ai1ec-calendar-view-container").trigger("destroy_view.ai1ec");var t=e(".ai1ec-minical-trigger").data("datepicker");typeof t!="undefined"&&(t.picker.remove(),e(document).off("changeDate",".ai1ec-minical-trigger")),e(".ai1ec-tooltip.ai1ec-in, .ai1ec-popup").remove()},d=function(){var t=[],n=[],r=[],i;e(".ai1ec-category-filter .ai1ec-dropdown-menu .ai1ec-active").each(function(){t.push(e(this).data("term"))}),e(".ai1ec-tag-filter .ai1ec-dropdown-menu .ai1ec-active").each(function(){n.push(e(this).data("term"))}),e(".ai1ec-author-filter .ai1ec-dropdown-menu .ai1ec-active").each(function(){r.push(e(this).data("term"))});var s={};return s.cat_ids=t,s.tag_ids=n,s.auth_ids=r,i=e(".ai1ec-views-dropdown .ai1ec-dropdown-menu .ai1ec-active").data("action"),s.action=i,s},v=function(){var t=History.getState(),n=e.cookie(l);if(null===n||undefined===n)n={};var r=d();u.is_calendar_page?n.calendar_page=r:n[t.url]=r,e.cookie(l,n,{path:"/",expires:365}),e("#save_filtered_views").addClass("ai1ec-active").attr("data-original-title",u.clear_saved_filter_text);var i=s.make_alert(u.save_filter_text_ok,"success");e("#ai1ec-calendar").prepend(i)},m=function(t){t.stopImmediatePropagation();var n=e.cookie(l);if(u.is_calendar_page)delete n.calendar_page;else{var r=History.getState();delete n[r.url]}e.cookie(l,n,{path:"/",expires:365}),e("#save_filtered_views").removeClass("ai1ec-active").attr("data-original-title",u.reset_saved_filter_text),c||e("#save_filtered_views").addClass("ai1ec-hide");var i=s.make_alert(u.remove_filter_text_ok,"success");e("#ai1ec-calendar").prepend(i)},g=function(t,n){e("#ai1ec-calendar-view-loading").fadeIn("fast"),e("#ai1ec-calendar-view").fadeTo("fast",.3,function(){var r={request_type:n,ai1ec_doing_ajax:!0};e.ajax({url:t,dataType:n,data:r,method:"get",success:function(t){p(),typeof t.views_dropdown=="string"&&e(".ai1ec-views-dropdown").replaceWith(t.views_dropdown),typeof t.categories=="string"&&(e(".ai1ec-category-filter").replaceWith(t.categories),u.use_select2&&f.init(e(".ai1ec-category-filter"))),typeof t.authors=="string"&&(e(".ai1ec-author-filter").replaceWith(t.authors),u.use_select2&&f.init(e(".ai1ec-author-filter"))),typeof t.tags=="string"&&(e(".ai1ec-tag-filter").replaceWith(t.tags),u.use_select2&&f.init(e(".ai1ec-tag-filter"))),typeof t.subscribe_buttons=="string"&&e(".ai1ec-subscribe-container").replaceWith(t.subscribe_buttons),typeof t.save_view_btngroup=="string"&&e("#save_filtered_views").closest(".ai1ec-btn-group").replaceWith(t.save_view_btngroup),c=t.are_filters_set;var n=e("#ai1ec-calendar-view-container");n.height(n.height());var r=e("#ai1ec-calendar-view").html(t.html).height();n.animate({height:r},{complete:function(){n.height("auto")}}),e("#ai1ec-calendar-view-loading").fadeOut("fast"),e("#ai1ec-calendar-view").fadeTo("fast",1),h()}})})},y=!1,b=function(e){var t=History.getState();if(t.data.ai1ec!==undefined&&!0===t.data.ai1ec||!0===y)y=!0,g(t.url,"json")},w=function(e,t){if(e==="json"){var n={ai1ec:!0};History.pushState(n,document.title,t)}else g(t,"jsonp")},E=function(t){var n=e(this);t.preventDefault(),w(n.data("type"),n.attr("href"))},S=function(t){var n=e(this);t.preventDefault();if(typeof n.data("datepicker")=="undefined"){n.datepicker({todayBtn:"linked",todayHighlight:!0});var r=n.data("datepicker");r.picker.addClass("ai1ec-right-aligned");var i=r.place;r.place=function(){i.call(this);var t=this.component?this.component:this.element,n=t.offset();this.picker.css({left:"auto",right:e(document).width()-n.left-t.outerWidth()})},e(document).on("changeDate",".ai1ec-minical-trigger",x)}n.datepicker("show")},x=function(t){var n,r=e(this),i;r.datepicker("hide"),n=r.data("href"),i=t.format(),i=i.replace(/\//g,"-"),n=n.replace("__DATE__",i),w(r.data("type"),n)},T=function(t){var n;typeof t.added!="undefined"?n=e(t.added.element).data("href"):n=e("option[value="+t.removed.id+"]",t.target).data("href"),data={ai1ec:!0},History.pushState(data,null,n)},N=function(){w(e(this).data("type"),e(this).data("href"))};return{initialize_view:h,handle_click_on_link_to_load_view:E,handle_minical_trigger:S,handle_minical_change_date:x,clear_filters:N,handle_state_change:b,load_view:g,save_current_filter:v,remove_current_filter:m,load_view_from_select2_filter:T,load_view_according_to_datatype:w}}),timely.define("external_libs/bootstrap/transition",["jquery_timely"],function(e){function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(e.style[n]!==undefined)return{end:t[n]}}e.fn.emulateTransitionEnd=function(t){var n=!1,r=this;e(this).one(e.support.transition.end,function(){n=!0});var i=function(){n||e(r).trigger(e.support.transition.end)};return setTimeout(i,t),this},e(function(){e.support.transition=t()})}),timely.define("external_libs/bootstrap/modal",["jquery_timely"],function(e){var t=function(t,n){this.options=n,this.$element=e(t),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.load(this.options.remote)};t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},t.prototype.toggle=function(e){return this[this.isShown?"hide":"show"](e)},t.prototype.show=function(t){var n=this,r=e.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(r);if(this.isShown||r.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.$element.on("click.dismiss.modal",'[data-dismiss="ai1ec-modal"]',e.proxy(this.hide,this)),this.backdrop(function(){var r=e.support.transition&&n.$element.hasClass("ai1ec-fade");n.$element.parent().length||n.$element.appendTo(document.body),n.$element.show(),r&&n.$element[0].offsetWidth,n.$element.addClass("ai1ec-in").attr("aria-hidden",!1),n.enforceFocus();var i=e.Event("shown.bs.modal",{relatedTarget:t});r?n.$element.find(".ai1ec-modal-dialog").one(e.support.transition.end,function(){n.$element.focus().trigger(i)}).emulateTransitionEnd(300):n.$element.focus().trigger(i)})},t.prototype.hide=function(t){t&&t.preventDefault(),t=e.Event("hide.bs.modal"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.bs.modal"),this.$element.removeClass("ai1ec-in").attr("aria-hidden",!0).off("click.dismiss.modal"),e.support.transition&&this.$element.hasClass("ai1ec-fade")?this.$element.one(e.support.transition.end,e.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()},t.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){this.$element[0]!==e.target&&!this.$element.has(e.target).length&&this.$element.focus()},this))},t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",e.proxy(function(e){e.which==27&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},t.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden.bs.modal")})},t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},t.prototype.backdrop=function(t){var n=this,r=this.$element.hasClass("ai1ec-fade")?"ai1ec-fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="ai1ec-modal-backdrop '+r+'" />').appendTo(document.body),this.$element.on("click.dismiss.modal",e.proxy(function(e){if(e.target!==e.currentTarget)return;this.options.backdrop=="static"?this.$element[0].focus.call(this.$element[0]):this.hide.call(this)},this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("ai1ec-in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("ai1ec-in"),e.support.transition&&this.$element.hasClass("ai1ec-fade")?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()):t&&t()};var n=e.fn.modal;e.fn.modal=function(n,r){return this.each(function(){var i=e(this),s=i.data("bs.modal"),o=e.extend({},t.DEFAULTS,i.data(),typeof n=="object"&&n);s||i.data("bs.modal",s=new t(this,o)),typeof n=="string"?s[n](r):o.show&&s.show(r)})},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.bs.modal.data-api",'[data-toggle="ai1ec-modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s,this).one("hide",function(){n.is(":visible")&&n.focus()})}),e(document).on("show.bs.modal",".ai1ec-modal",function(){e(document.body).addClass("ai1ec-modal-open")}).on("hidden.bs.modal",".ai1ec-modal",function(){e(document.body).removeClass("ai1ec-modal-open")})}),timely.define("scripts/calendar",["jquery_timely","scripts/calendar/load_views","scripts/calendar/print","scripts/calendar/agenda_view","scripts/calendar/month_view","ai1ec_calendar","ai1ec_config","scripts/common_scripts/frontend/common_frontend","libs/utils","libs/select2_multiselect_helper","external_libs/bootstrap/transition","external_libs/bootstrap/modal","external_libs/jquery.scrollTo","external_libs/jquery_cookie"],function(e,t,n,r,i,s,o,u,a,f){var l=function(){if(s.selector!==undefined&&s.selector!==""&&e(s.selector).length===1){var t=e(":header:contains("+s.title+"):first");t.length||(t=e('<h1 class="page-title"></h1>'),t.text(s.title));var n=e("#ai1ec-container").detach().before(t);e(s.selector).empty().append(n).hide().css("visibility","visible").fadeIn("fast")}},c=function(){var t=e(this).data("instanceId");e(".ai1ec-event-instance-id-"+t).addClass("ai1ec-hover")},h=function(){var t=e(this).data("instanceId");e(".ai1ec-event-instance-id-"+t).removeClass("ai1ec-hover")},p=function(){var t=e(this),n=t.data("instanceId");t.delay(500).queue(function(){e(".ai1ec-event-instance-id-"+n).addClass("ai1ec-raised")})},d=function(t){var n=e(this),r=n.data("instanceId"),i=e(t.toElement||t.relatedTarget);if(i.is(".ai1ec-event-instance-id-"+r)||i.parent().is(".ai1ec-event-instance-id-"+r))return;e(".ai1ec-event-instance-id-"+r).clearQueue().removeClass("ai1ec-raised")},v=function(){l()},m=function(){e(document).on({mouseenter:c,mouseleave:h},".ai1ec-event-container.ai1ec-multiday"),e(document).on({mouseenter:p,mouseleave:d},".ai1ec-oneday-view .ai1ec-oneday .ai1ec-event-container, .ai1ec-week-view .ai1ec-week .ai1ec-event-container"),e(document).on("click",".ai1ec-agenda-view .ai1ec-event-header",r.toggle_event),e(document).on("click","#ai1ec-agenda-expand-all",r.expand_all),e(document).on("click","#ai1ec-agenda-collapse-all",r.collapse_all),e(document).on("click","a.ai1ec-load-view",t.handle_click_on_link_to_load_view),e(document).on("click",".ai1ec-minical-trigger",t.handle_minical_trigger),e(document).on("click",".ai1ec-clear-filter",t.clear_filters),e(document).on("click","#ai1ec-print-button",n.handle_click_on_print_button),e(document).on("click",".ai1ec-reveal-full-day button",function(){e(this).fadeOut();var t=e(".ai1ec-oneday-view-original"),n=e(".ai1ec-week-view-original");n.length===0&&(n=t);var r=e(".tablescroll_wrapper").offset().top-n.offset().top;e(window).scrollTo("+="+r+"px",400);var i=1440;e(".tablescroll_wrapper").animate({height:i+"px"})}),History.Adapter.bind(window,"statechange",t.handle_state_change),e(document).on("click","#ai1ec-calendar-view .ai1ec-load-event",function(t){t.preventDefault(),e.cookie.raw=!1,e.cookie("ai1ec_calendar_url",document.URL),window.location.href=this.href})},g=function(){f.init(e(".ai1ec-select2-filters")),e(document).on("change",".ai1ec-select2-multiselect-selector",t.load_view_from_select2_filter)},y=function(){e(document).on("page_ready.ai1ec",function(){v(),o.use_select2&&g(),m(),t.initialize_view()})};return{start:y}});
304
  * limitations under the License.
305
  * ======================================================================== */
306
 
307
+ timely.define("scripts/calendar/print",["jquery_timely"],function(e){var t=function(t){t.preventDefault();var n=e("body"),r=e("html"),i=e("#ai1ec-container").html(),s=n.html();s=s.replace(/<script.*?>([\s\S]*?)<\/script>/gmi,""),n.empty(),n.addClass("timely"),r.addClass("ai1ec-print"),n.html(i),e("span").click(function(){return!1}),window.print(),n.removeClass("timely"),r.removeClass("ai1ec-print"),n.html(s)};return{handle_click_on_print_button:t}}),timely.define("scripts/calendar/agenda_view",["jquery_timely"],function(e){var t=function(){e(this).closest(".ai1ec-event").toggleClass("ai1ec-expanded").find(".ai1ec-event-summary").slideToggle(300)},n=function(){e(".ai1ec-expanded .ai1ec-event-toggle").click()},r=function(){e(".ai1ec-event:not(.ai1ec-expanded) .ai1ec-event-toggle").click()};return{toggle_event:t,collapse_all:n,expand_all:r}}),timely.define("external_libs/modernizr",[],function(){var e=function(e,t,n){function S(e){f.cssText=e}function x(e,t){return S(h.join(e+";")+(t||""))}function T(e,t){return typeof e===t}function N(e,t){return!!~(""+e).indexOf(t)}function C(e,t,r){for(var i in e){var s=t[e[i]];if(s!==n)return r===!1?e[i]:T(s,"function")?s.bind(r||t):s}return!1}var r="2.5.3",i={},s=!0,o=t.documentElement,u="modernizr",a=t.createElement(u),f=a.style,l,c={}.toString,h=" -webkit- -moz- -o- -ms- ".split(" "),p={},d={},v={},m=[],g=m.slice,y,b=function(e,n,r,i){var s,a,f,l=t.createElement("div"),c=t.body,h=c?c:t.createElement("body");if(parseInt(r,10))while(r--)f=t.createElement("div"),f.id=i?i[r]:u+(r+1),l.appendChild(f);return s=["&#173;","<style>",e,"</style>"].join(""),l.id=u,(c?l:h).innerHTML+=s,h.appendChild(l),c||(h.style.background="",o.appendChild(h)),a=n(l,e),c?l.parentNode.removeChild(l):h.parentNode.removeChild(h),!!a},w={}.hasOwnProperty,E;!T(w,"undefined")&&!T(w.call,"undefined")?E=function(e,t){return w.call(e,t)}:E=function(e,t){return t in e&&T(e.constructor.prototype[t],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if(typeof n!="function")throw new TypeError;var r=g.call(arguments,1),i=function(){if(this instanceof i){var e=function(){};e.prototype=n.prototype;var s=new e,o=n.apply(s,r.concat(g.call(arguments)));return Object(o)===o?o:s}return n.apply(t,r.concat(g.call(arguments)))};return i});var k=function(n,r){var s=n.join(""),o=r.length;b(s,function(n,r){var s=t.styleSheets[t.styleSheets.length-1],u=s?s.cssRules&&s.cssRules[0]?s.cssRules[0].cssText:s.cssText||"":"",a=n.childNodes,f={};while(o--)f[a[o].id]=a[o];i.touch="ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch||(f.touch&&f.touch.offsetTop)===9},o,r)}([,["@media (",h.join("touch-enabled),("),u,")","{#touch{top:9px;position:absolute}}"].join("")],[,"touch"]);p.touch=function(){return i.touch};for(var L in p)E(p,L)&&(y=L.toLowerCase(),i[y]=p[L](),m.push((i[y]?"":"no-")+y));return S(""),a=l=null,i._version=r,i._prefixes=h,i.testStyles=b,o.className=o.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(s?" js "+m.join(" "):""),i}(window,window.document);return e}),timely.define("scripts/calendar/month_view",["jquery_timely","external_libs/modernizr"],function(e,t){var n=navigator.userAgent.match(/opera/i),r=navigator.userAgent.match(/webkit/i),i=function(){var t=e(".ai1ec-day"),n=e(".ai1ec-week:first .ai1ec-day").length;e(".ai1ec-month-view .ai1ec-multiday").each(function(){var n=this.parentNode,r=e(this).outerHeight(!0),i=parseInt(e(this).data("endDay"),10),u=e(".ai1ec-date",n),a=parseInt(u.text(),10),f=e(this).data("endTruncated");f&&(i=parseInt(e(t[t.length-1]).text(),10));var l=e(this),c=e(".ai1ec-event",l)[0].style.backgroundColor,h=0,p=i-a+1,d=p,v,m=0;t.each(function(t){var n=e(".ai1ec-date",this),r=e(this.parentNode),u=r.index(),f=parseInt(n.text(),10);if(f>=a&&f<=i){f===a&&(v=parseInt(n.css("marginBottom"),10)+16),h===0&&m++;if(u===0&&f>a&&d!==0){var p=l.next(".ai1ec-popup").andSelf().clone(!1);n.parent().append(p);var g=p.first();g.addClass("ai1ec-multiday-bar ai1ec-multiday-clone"),g.css({position:"absolute",left:"1px",top:parseInt(n.css("marginBottom"),10)+13,backgroundColor:c});var y=d>7?7:d;g.css("width",s(y)),d>7&&g.append(o(1,c)),g.append(o(2,c))}h===0?n.css({marginBottom:v+"px"}):n.css({marginBottom:"+=16px"}),d--,d>0&&u===6&&h++}});if(f){var g=e("."+l[0].className.replace(/\s+/igm,".")).last();g.append(o(1,c))}e(this).css({position:"absolute",top:u.outerHeight(!0)-r-1+"px",left:"1px",width:s(m)}),h>0&&e(this).append(o(1,c)),e(this).data("startTruncated")&&e(this).append(o(2,c)).addClass("ai1ec-multiday-bar")})},s=function(e){var t;switch(e){case 1:t=97.5;break;case 2:t=198.7;break;case 3:t=300;break;case 4:t=401;break;case 5:r||n?t=507:t=503.4;break;case 6:r||n?t=608:t=603.5;break;case 7:r||n?t=709:t=705}return t+"%"},o=function(t,n){var r=e('<div class="ai1ec-multiday-arrow'+t+'"></div>');return t===1?r.css({borderLeftColor:n}):r.css({borderTopColor:n,borderRightColor:n,borderBottomColor:n}),r};return{extend_multiday_events:i}}),timely.define("libs/frontend_utils",[],function(){var e=function(e){var t,n;t=function(e){if(/&[^;]+;/.test(e)){var t=document.createElement("div");return t.innerHTML=e,t.firstChild?t.firstChild.nodeValue:e}return e};if(typeof e=="string")return t(e);if(typeof e=="object")for(n in e)typeof e[n]=="string"&&(e[n]=t(e[n]));return e},t=function(e,t,n){var r,i,s,o,u;if("#"===e.charAt(0)||"?"===e.charAt(0))e=e.substring(1);r={},e=e.split(t);for(i=0;i<e.length;i++)o=e[i].trim(),-1!==(u=o.indexOf(n))?(s=o.substring(0,u).trim(),o=o.substring(u+1).trim()):(s=o,o=!0),r[s]=o;return r},n=function(e){var n,r,i,s,o;e=t(e,"&","="),i=Object.keys(e),n={ai1ec:{},action:"month"};for(r=0;r<i.length;r++)if("ai1ec"===i[r]){var u=t(e[i[r]],"|",":");for(s in u)if(""!==u[s]){if("action"===s||"view"===s)n.action=u[s];n.ai1ec[s]=u[s]}}else"ai1ec_"===i[r].substring(0,6)?n.ai1ec[i[r].substring(6)]=e[i[r]]:n[i[r]]=e[i[r]];"ai1ec_"!==n.action.substring(0,6)&&(n.action="ai1ec_"+n.action),o="action="+n.action+"&ai1ec=";for(s in n.ai1ec)n.ai1ec.hasOwnProperty(s)&&(o+=escape(s)+":"+escape(n.ai1ec[s])+"|");o=o.substring(0,o.length-1);for(s in n)"ai1ec"!==s&&"action"!==s&&(o+="&"+s+"="+escape(n[s]));return o};return{ai1ec_convert_entities:e,ai1ec_map_internal_query:n,ai1ec_tokenize_uri:t}}),timely.define("external_libs/bootstrap/tab",["jquery_timely"],function(e){var t=function(t){this.element=e(t)};t.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.ai1ec-dropdown-menu)"),r=t.data("target");r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("ai1ec-active"))return;var i=n.find(".ai1ec-active:last a")[0],s=e.Event("show.bs.tab",{relatedTarget:i});t.trigger(s);if(s.isDefaultPrevented())return;var o=e(r);this.activate(t.parent("li"),n),this.activate(o,o.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:i})})},t.prototype.activate=function(t,n,r){function o(){i.removeClass("ai1ec-active").find("> .ai1ec-dropdown-menu > .ai1ec-active").removeClass("ai1ec-active"),t.addClass("ai1ec-active"),s?(t[0].offsetWidth,t.addClass("ai1ec-in")):t.removeClass("ai1ec-fade"),t.parent(".ai1ec-dropdown-menu")&&t.closest("li.ai1ec-dropdown").addClass("ai1ec-active"),r&&r()}var i=n.find("> .ai1ec-active"),s=r&&e.support.transition&&i.hasClass("ai1ec-fade");s?i.one(e.support.transition.end,o).emulateTransitionEnd(150):o(),i.removeClass("ai1ec-in")};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tab");i||r.data("bs.tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.bs.tab.data-api",'[data-toggle="ai1ec-tab"], [data-toggle="ai1ec-pill"]',function(t){t.preventDefault(),e(this).tab("show")})}),timely.define("libs/utils",["jquery_timely","external_libs/bootstrap/tab"],function(e){var t=function(){return{is_float:function(e){return!isNaN(parseFloat(e))},is_valid_coordinate:function(e,t){var n=t?90:180;return this.is_float(e)&&Math.abs(e)<n},convert_comma_to_dot:function(e){return e.replace(",",".")},field_has_value:function(t){var n="#"+t,r=e(n),i=!1;return r.length===1&&(i=e.trim(r.val())!==""),i},make_alert:function(t,n,r){var i="";switch(n){case"error":i="ai1ec-alert ai1ec-alert-danger";break;case"success":i="ai1ec-alert ai1ec-alert-success";break;default:i="ai1ec-alert"}var s=e("<div />",{"class":i,html:t});if(!r){var o=e("<button>",{type:"button","class":"ai1ec-close","data-dismiss":"ai1ec-alert",text:"×"});s.prepend(o)}return s},get_ajax_url:function(){return typeof window.ajaxurl=="undefined"?"http://localhost/wordpress/wp-admin/admin-ajax.php":window.ajaxurl},isUrl:function(e){var t=/(http|https|webcal):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(e)},isValidEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)},activate_saved_tab_on_page_load:function(t){null===t||undefined===t?e("ul.ai1ec-nav a:first").tab("show"):e("ul.ai1ec-nav a[href="+t+"]").tab("show")}}}();return t}),timely.define("domReady",[],function(){function u(e){var t;for(t=0;t<e.length;t++)e[t](n)}function a(){var e=r;t&&e.length&&(r=[],u(e))}function f(){t||(t=!0,o&&clearInterval(o),a())}function c(e){return t?e(n):r.push(e),c}var e=typeof window!="undefined"&&window.document,t=!e,n=e?document:null,r=[],i,s,o;if(e){if(document.addEventListener)document.addEventListener("DOMContentLoaded",f,!1),window.addEventListener("load",f,!1);else if(window.attachEvent){window.attachEvent("onload",f),s=document.createElement("div");try{i=window.frameElement===null}catch(l){}s.doScroll&&i&&window.external&&(o=setInterval(function(){try{s.doScroll(),f()}catch(e){}},30))}(document.readyState==="complete"||document.readyState==="interactive")&&f()}return c.version="2.0.0",c.load=function(e,t,n,r){r.isBuild?n(null):c(n)},c}),timely.define("scripts/common_scripts/frontend/common_event_handlers",["jquery_timely"],function(e){var t=function(t){var n=e(this),r=n.next(".ai1ec-popup"),i,s,o;if(r.length===0)return;i=r.html(),s=r.attr("class");var u=n.closest("#ai1ec-calendar-view");u.length===0&&(u=e("body")),n.offset().left-u.offset().left>182?o="left":o="right",n.constrained_popover({content:i,title:"",placement:o,trigger:"manual",html:!0,template:'<div class="timely ai1ec-popover '+s+'">'+'<div class="ai1ec-arrow"></div>'+'<div class="ai1ec-popover-inner">'+'<div class="ai1ec-popover-content"><div></div></div>'+"</div>"+"</div>",container:"body"}).constrained_popover("show")},n=function(t){var n=e(t.toElement||t.relatedTarget);n.closest(".ai1ec-popup").length===0&&e(this).constrained_popover("hide")},r=function(t){var n=e(t.toElement||t.relatedTarget);n.closest(".ai1ec-tooltip").length===0&&(e(this).remove(),e("body > .ai1ec-tooltip").remove())},i=function(t){var n=e(this),r={template:'<div class="timely ai1ec-tooltip"><div class="ai1ec-tooltip-arrow"></div><div class="ai1ec-tooltip-inner"></div></div>',trigger:"manual",container:"body"};if(n.is(".ai1ec-category .ai1ec-color-swatch"))return;n.tooltip(r),n.tooltip("show")},s=function(t){var n=e(t.toElement||t.relatedTarget);n.closest(".ai1ec-tooltip").length===0&&e(this).data("bs.tooltip")&&e(this).tooltip("hide")},o=function(t){var n=e(t.toElement||t.relatedTarget);n.closest(".ai1ec-tooltip-trigger").length===0&&e(this).remove(),n.closest(".ai1ec-popup").length===0&&e("body > .ai1ec-popup").remove()};return{handle_popover_over:t,handle_popover_out:n,handle_popover_self_out:r,handle_tooltip_over:i,handle_tooltip_out:s,handle_tooltip_self_out:o}}),timely.define("external_libs/bootstrap/tooltip",["jquery_timely"],function(e){var t=function(e,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",e,t)};t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="ai1ec-tooltip"><div class="ai1ec-tooltip-arrow"></div><div class="ai1ec-tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},t.prototype.init=function(t,n,r){this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(r);var i=this.options.trigger.split(" ");for(var s=i.length;s--;){var o=i[s];if(o=="click")this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if(o!="manual"){var u=o=="hover"?"mouseenter":"focus",a=o=="hover"?"mouseleave":"blur";this.$element.on(u+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(a+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.getOptions=function(t){return t=e.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},t.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,function(e,r){n[e]!=r&&(t[e]=r)}),t},t.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(n.timeout),n.hoverState="in";if(!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},t.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(n.timeout),n.hoverState="out";if(!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},t.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.tip();this.setContent(),this.options.animation&&n.addClass("ai1ec-fade");var r=typeof this.options.placement=="function"?this.options.placement.call(this,n[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,s=i.test(r);s&&(r=r.replace(i,"")||"top"),n.detach().css({top:0,left:0,display:"block"}).addClass("ai1ec-"+r),this.options.container?n.appendTo(this.options.container):n.insertAfter(this.$element);var o=this.getPosition(),u=n[0].offsetWidth,a=n[0].offsetHeight;if(s){var f=this.$element.parent(),l=r,c=document.documentElement.scrollTop||document.body.scrollTop,h=this.options.container=="body"?window.innerWidth:f.outerWidth(),p=this.options.container=="body"?window.innerHeight:f.outerHeight(),d=this.options.container=="body"?0:f.offset().left;r=r=="bottom"&&o.top+o.height+a-c>p?"top":r=="top"&&o.top-c-a<0?"bottom":r=="right"&&o.right+u>h?"left":r=="left"&&o.left-u<d?"right":r,n.removeClass("ai1ec-"+l).addClass("ai1ec-"+r)}var v=this.getCalculatedOffset(r,o,u,a);this.applyPlacement(v,r),this.$element.trigger("shown.bs."+this.type)}},t.prototype.applyPlacement=function(e,t){var n,r=this.tip(),i=r[0].offsetWidth,s=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),u=parseInt(r.css("margin-left"),10);isNaN(o)&&(o=0),isNaN(u)&&(u=0),e.top=e.top+o,e.left=e.left+u,r.offset(e).addClass("ai1ec-in");var a=r[0].offsetWidth,f=r[0].offsetHeight;t=="top"&&f!=s&&(n=!0,e.top=e.top+s-f);if(/bottom|top/.test(t)){var l=0;e.left<0&&(l=e.left*-2,e.left=0,r.offset(e),a=r[0].offsetWidth,f=r[0].offsetHeight),this.replaceArrow(l-i+a,a,"left")}else this.replaceArrow(f-s,f,"top");n&&r.offset(e)},t.prototype.replaceArrow=function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".ai1ec-tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("ai1ec-fade ai1ec-in ai1ec-top ai1ec-bottom ai1ec-left ai1ec-right")},t.prototype.hide=function(){function i(){t.hoverState!="in"&&n.detach()}var t=this,n=this.tip(),r=e.Event("hide.bs."+this.type);this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("ai1ec-in"),e.support.transition&&this.$tip.hasClass("ai1ec-fade")?n.one(e.support.transition.end,i).emulateTransitionEnd(150):i(),this.$element.trigger("hidden.bs."+this.type),this},t.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},t.prototype.hasContent=function(){return this.getTitle()},t.prototype.getPosition=function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},t.prototype.getCalculatedOffset=function(e,t,n,r){return e=="bottom"?{top:t.top+t.height,left:t.left+t.width/2-n/2}:e=="top"?{top:t.top-r,left:t.left+t.width/2-n/2}:e=="left"?{top:t.top+t.height/2-r/2,left:t.left-n}:{top:t.top+t.height/2-r/2,left:t.left+t.width}},t.prototype.getTitle=function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},t.prototype.tip=function(){return this.$tip=this.$tip||e(this.options.template)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".ai1ec-tooltip-arrow")},t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},t.prototype.enable=function(){this.enabled=!0},t.prototype.disable=function(){this.enabled=!1},t.prototype.toggleEnabled=function(){this.enabled=!this.enabled},t.prototype.toggle=function(t){var n=t?e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;n.tip().hasClass("ai1ec-in")?n.leave(n):n.enter(n)},t.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tooltip"),s=typeof n=="object"&&n;i||r.data("bs.tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}),timely.define("external_libs/bootstrap/popover",["jquery_timely","external_libs/bootstrap/tooltip"],function(e){var t=function(e,t){this.init("popover",e,t)};if(!e.fn.tooltip)throw new Error("Popover requires tooltip.js");t.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="ai1ec-popover"><div class="ai1ec-arrow"></div><h3 class="ai1ec-popover-title"></h3><div class="ai1ec-popover-content"></div></div>'}),t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),t.prototype.constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".ai1ec-popover-title")[this.options.html?"html":"text"](t),e.find(".ai1ec-popover-content")[this.options.html?"html":"text"](n),e.removeClass("ai1ec-fade ai1ec-top ai1ec-bottom ai1ec-left ai1ec-right ai1ec-in"),e.find(".ai1ec-popover-title").html()||e.find(".ai1ec-popover-title").hide()},t.prototype.hasContent=function(){return this.getTitle()||this.getContent()},t.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||(typeof t.content=="function"?t.content.call(e[0]):t.content)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".ai1ec-arrow")},t.prototype.tip=function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip};var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("bs.popover"),s=typeof n=="object"&&n;i||r.data("bs.popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}),timely.define("external_libs/constrained_popover",["jquery_timely","external_libs/bootstrap/popover"],function(e){var t=function(e,t){this.init("constrained_popover",e,t)};t.DEFAULTS=e.extend({},e.fn.popover.Constructor.DEFAULTS,{container:"",content:this.options}),t.prototype=e.extend({},e.fn.popover.Constructor.prototype),t.prototype.constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.applyPlacement=function(t,n){e.fn.popover.Constructor.prototype.applyPlacement.call(this,t,n);var r=this.tip(),i=r[0].offsetWidth,s=r[0].offsetHeight,o=this.getPosition(),u={};switch(n){case"left":newPos=this.defineBounds(o),typeof newPos.top=="undefined"?u.top=o.top+o.height/2-s/2:u.top=newPos.top-s/2,typeof newPos.left=="undefined"?u.left=o.left-i:u.left=newPos.left-i,r.offset(u);break;case"right":newPos=this.defineBounds(o),typeof newPos.top=="undefined"?u.top=o.top+o.height/2-s/2:u.top=newPos.top-s/2,typeof newPos.left=="undefined"?u.left=o.left+o.width:u.left=newPos.left+o.width,r.offset(u)}},t.prototype.defineBounds=function(t){var n,r,i,s,o,u={},a=e(this.options.container);return a.length?(n=a.offset(),r=n.top,i=n.left,s=r+a.height(),o=i+a.width(),t.top+t.height/2<r&&(u.top=r),t.top+t.height/2>s&&(u.top=s),t.left-t.width/2<i&&(u.left=i),t.left-t.width/2>o&&(u.left=o),u):!1};var n=e.fn.popover;e.fn.constrained_popover=function(n){return this.each(function(){var r=e(this),i=r.data("ai1ec.constrained_popover"),s=typeof n=="object"&&n;i||r.data("ai1ec.constrained_popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.constrained_popover.Constructor=t,e.fn.constrained_popover.noConflict=function(){return e.fn.constrained_popover=n,this}}),timely.define("external_libs/bootstrap/dropdown",["jquery_timely"],function(e){function i(){e(t).remove(),e(n).each(function(t){var n=s(e(this));if(!n.hasClass("ai1ec-open"))return;n.trigger(t=e.Event("hide.bs.dropdown"));if(t.isDefaultPrevented())return;n.removeClass("ai1ec-open").trigger("hidden.bs.dropdown")})}function s(t){var n=t.attr("data-target");n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r=n&&e(n);return r&&r.length?r:t.parent()}var t=".ai1ec-dropdown-backdrop",n="[data-toggle=ai1ec-dropdown]",r=function(t){e(t).on("click.bs.dropdown",this.toggle)};r.prototype.toggle=function(t){var n=e(this);if(n.is(".ai1ec-disabled, :disabled"))return;var r=s(n),o=r.hasClass("ai1ec-open");i();if(!o){"ontouchstart"in document.documentElement&&!r.closest(".ai1ec-navbar-nav").length&&e('<div class="ai1ec-dropdown-backdrop"/>').insertAfter(e(this)).on("click",i),r.trigger(t=e.Event("show.bs.dropdown"));if(t.isDefaultPrevented())return;r.toggleClass("ai1ec-open").trigger("shown.bs.dropdown"),n.focus()}return!1},r.prototype.keydown=function(t){if(!/(38|40|27)/.test(t.keyCode))return;var r=e(this);t.preventDefault(),t.stopPropagation();if(r.is(".ai1ec-disabled, :disabled"))return;var i=s(r),o=i.hasClass("ai1ec-open");if(!o||o&&t.keyCode==27)return t.which==27&&i.find(n).focus(),r.click();var u=e("[role=menu] li:not(.ai1ec-divider):visible a",i);if(!u.length)return;var a=u.index(u.filter(":focus"));t.keyCode==38&&a>0&&a--,t.keyCode==40&&a<u.length-1&&a++,~a||(a=0),u.eq(a).focus()};var o=e.fn.dropdown;e.fn.dropdown=function(t){return this.each(function(){var n=e(this),i=n.data("bs.dropdown");i||n.data("bs.dropdown",i=new r(this)),typeof t=="string"&&i[t].call(n)})},e.fn.dropdown.Constructor=r,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=o,this},e(document).on("click.bs.dropdown.data-api",i).on("click.bs.dropdown.data-api",".ai1ec-dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",n,r.prototype.toggle).on("keydown.bs.dropdown.data-api",n+", [role=menu]",r.prototype.keydown)}),timely.define("scripts/common_scripts/frontend/common_frontend",["jquery_timely","domReady","scripts/common_scripts/frontend/common_event_handlers","ai1ec_calendar","external_libs/modernizr","external_libs/bootstrap/tooltip","external_libs/constrained_popover","external_libs/bootstrap/dropdown"],function(e,t,n,r,i){var s=!1,o=function(){s=!0,e(document).on("mouseenter",".ai1ec-popup-trigger",n.handle_popover_over),e(document).on("mouseleave",".ai1ec-popup-trigger",n.handle_popover_out),e(document).on("mouseleave",".ai1ec-popup",n.handle_popover_self_out),e(document).on("mouseenter",".ai1ec-tooltip-trigger",n.handle_tooltip_over),e(document).on("mouseleave",".ai1ec-tooltip-trigger",n.handle_tooltip_out),e(document).on("mouseleave",".ai1ec-tooltip",n.handle_tooltip_self_out)},u=function(){t(function(){o()})},a=function(){return s};return{start:u,are_event_listeners_attached:a}}),timely.define("external_libs/select2",["jquery_timely"],function(e){(function(e){typeof e.fn.each2=="undefined"&&e.fn.extend({each2:function(t){var n=e([0]),r=-1,i=this.length;while(++r<i&&(n.context=n[0]=this[r])&&t.call(n[0],r,n)!==!1);return this}})})(e),function(e,t){function l(e,t){var n=0,r=t.length;for(;n<r;n+=1)if(c(e,t[n]))return n;return-1}function c(e,n){return e===n?!0:e===t||n===t?!1:e===null||n===null?!1:e.