Packpin_Pptrack - Version 1.7.2

Version Notes

Fixed issue where estimated delivery date was displayed incorrectly

Download this release

Release Info

Developer Packpin Packpin
Extension Packpin_Pptrack
Version 1.7.2
Comparing to
See all releases


Code changes from version 1.7.1 to 1.7.2

Files changed (96) hide show
  1. app/code/community/Packpin/Pptrack/Block/Adminhtml/Dashboard.php +210 -210
  2. app/code/community/Packpin/Pptrack/Block/Adminhtml/Sales/Order/Shipment/Create/Tracking.php +38 -38
  3. app/code/community/Packpin/Pptrack/Block/Adminhtml/Sales/Order/Shipment/View/Tracking.php +64 -64
  4. app/code/community/Packpin/Pptrack/Block/Adminhtml/System/Config/Fieldset/Hint-owner.php +0 -20
  5. app/code/community/Packpin/Pptrack/Block/Adminhtml/System/Config/Fieldset/Hint.php +53 -53
  6. app/code/community/Packpin/Pptrack/Block/Adminhtml/System/Config/Fieldset/Scripts.php +53 -53
  7. app/code/community/Packpin/Pptrack/Block/Adminhtml/System/Config/Form/Fieldset/Carrier.php +80 -80
  8. app/code/community/Packpin/Pptrack/Block/Adminhtml/Tracks.php +14 -14
  9. app/code/community/Packpin/Pptrack/Block/Adminhtml/Tracks/Edit.php +32 -32
  10. app/code/community/Packpin/Pptrack/Block/Adminhtml/Tracks/Edit/Form.php +53 -53
  11. app/code/community/Packpin/Pptrack/Block/Adminhtml/Tracks/Grid.php +142 -142
  12. app/code/community/Packpin/Pptrack/Block/Ads.php +38 -38
  13. app/code/community/Packpin/Pptrack/Block/Crosssell.php +25 -25
  14. app/code/community/Packpin/Pptrack/Block/Index.php +174 -174
  15. app/code/community/Packpin/Pptrack/Block/Script.php +8 -8
  16. app/code/community/Packpin/Pptrack/Block/Trackings.php +39 -39
  17. app/code/community/Packpin/Pptrack/Helper/Data.php +377 -377
  18. app/code/community/Packpin/Pptrack/Model/Adminhtml/System/Config/Source/Crossviews.php +13 -13
  19. app/code/community/Packpin/Pptrack/Model/Adminhtml/System/Config/Source/Crossviewspage.php +14 -14
  20. app/code/community/Packpin/Pptrack/Model/Adminhtml/System/Config/Source/Templateimage.php +13 -13
  21. app/code/community/Packpin/Pptrack/Model/Adminhtml/System/Config/Source/Templatetype.php +13 -13
  22. app/code/community/Packpin/Pptrack/Model/Api.php +137 -137
  23. app/code/community/Packpin/Pptrack/Model/Carrier.php +177 -177
  24. app/code/community/Packpin/Pptrack/Model/EnableNotifications.php +91 -91
  25. app/code/community/Packpin/Pptrack/Model/Observer.php +335 -335
  26. app/code/community/Packpin/Pptrack/Model/Order/Shipment.php +40 -40
  27. app/code/community/Packpin/Pptrack/Model/Resource/Carrier.php +9 -9
  28. app/code/community/Packpin/Pptrack/Model/Resource/Carrier/Collection.php +7 -7
  29. app/code/community/Packpin/Pptrack/Model/Resource/Setting.php +9 -9
  30. app/code/community/Packpin/Pptrack/Model/Resource/Setting/Collection.php +7 -7
  31. app/code/community/Packpin/Pptrack/Model/Resource/Track.php +9 -9
  32. app/code/community/Packpin/Pptrack/Model/Resource/Track/Collection.php +7 -7
  33. app/code/community/Packpin/Pptrack/Model/Resource/Trackdetail.php +7 -7
  34. app/code/community/Packpin/Pptrack/Model/Resource/Trackdetail/Collection.php +7 -7
  35. app/code/community/Packpin/Pptrack/Model/Resource/Trackunsubscribed.php +7 -7
  36. app/code/community/Packpin/Pptrack/Model/Resource/Trackunsubscribed/Collection.php +7 -7
  37. app/code/community/Packpin/Pptrack/Model/Resource/Visit.php +9 -9
  38. app/code/community/Packpin/Pptrack/Model/Resource/Visit/Collection.php +7 -7
  39. app/code/community/Packpin/Pptrack/Model/Setting.php +28 -28
  40. app/code/community/Packpin/Pptrack/Model/Track.php +527 -527
  41. app/code/community/Packpin/Pptrack/Model/Trackdetail.php +89 -89
  42. app/code/community/Packpin/Pptrack/Model/Trackunsubscribed.php +31 -31
  43. app/code/community/Packpin/Pptrack/Model/Translate.php +38 -38
  44. app/code/community/Packpin/Pptrack/Model/Visit.php +24 -24
  45. app/code/community/Packpin/Pptrack/controllers/Adminhtml/PackpintracksController.php +117 -117
  46. app/code/community/Packpin/Pptrack/controllers/Adminhtml/PpnotificationsController.php +28 -28
  47. app/code/community/Packpin/Pptrack/controllers/IndexController.php +38 -38
  48. app/code/community/Packpin/Pptrack/controllers/UnsubscribeController.php +30 -30
  49. app/code/community/Packpin/Pptrack/controllers/unsubscribeController.php +31 -0
  50. app/code/community/Packpin/Pptrack/data/pptrack_setup/data-upgrade-0.1.5-1.1.0.php +33 -33
  51. app/code/community/Packpin/Pptrack/etc/adminhtml.xml +60 -60
  52. app/code/community/Packpin/Pptrack/etc/api.xml +42 -42
  53. app/code/community/Packpin/Pptrack/etc/config.xml +325 -321
  54. app/code/community/Packpin/Pptrack/etc/system.xml +664 -664
  55. app/code/community/Packpin/Pptrack/sql/pptrack_setup/mysql4-install-0.1.2.php +85 -85
  56. app/code/community/Packpin/Pptrack/sql/pptrack_setup/mysql4-upgrade-0.1.2-0.1.5.php +21 -21
  57. app/code/community/Packpin/Pptrack/sql/pptrack_setup/mysql4-upgrade-0.1.5-1.3.0.php +31 -31
  58. app/code/community/Packpin/Pptrack/sql/pptrack_setup/mysql4-upgrade-0.3.0-1.5.5.php +0 -18
  59. app/design/adminhtml/default/default/layout/pptrack.xml +27 -27
  60. app/design/adminhtml/default/default/template/pptrack/dashboard/index.phtml +182 -182
  61. app/design/adminhtml/default/default/template/pptrack/dashboard/packpin.phtml +21 -21
  62. app/design/adminhtml/default/default/template/pptrack/system/config/fieldset/hint.phtml +16 -16
  63. app/design/adminhtml/default/default/template/pptrack/system/config/fieldset/scripts.phtml +96 -96
  64. app/design/frontend/base/default/layout/pptrack.xml +52 -52
  65. app/design/frontend/base/default/template/pptrack/ads.phtml +15 -15
  66. app/design/frontend/base/default/template/pptrack/ads_email.phtml +15 -15
  67. app/design/frontend/base/default/template/pptrack/crosssell.phtml +48 -48
  68. app/design/frontend/base/default/template/pptrack/crosssell_email.phtml +32 -32
  69. app/design/frontend/base/default/template/pptrack/email/order/shipment/track.phtml +26 -26
  70. app/design/frontend/base/default/template/pptrack/index.phtml +179 -179
  71. app/design/frontend/base/default/template/pptrack/index_new.phtml +210 -210
  72. app/design/frontend/base/default/template/pptrack/index_v2.phtml +253 -219
  73. app/design/frontend/base/default/template/pptrack/popup.phtml +29 -29
  74. app/design/frontend/base/default/template/pptrack/script.phtml +1 -1
  75. app/design/frontend/base/default/template/pptrack/unsubscribe.phtml +0 -0
  76. app/etc/modules/Packpin_Pptrack.xml +9 -9
  77. app/locale/de_DE/Packpin_Pptrack.csv +39 -39
  78. app/locale/en_US/Packpin_Pptrack.csv +39 -39
  79. app/locale/en_US/template/email/packpin/packpin_delivered_email.html +86 -86
  80. app/locale/en_US/template/email/packpin/packpin_exception_email.html +86 -86
  81. app/locale/en_US/template/email/packpin/packpin_failed_attempt_email.html +86 -86
  82. app/locale/en_US/template/email/packpin/packpin_in_transit_email.html +86 -86
  83. app/locale/en_US/template/email/packpin/packpin_info_received_email.html +86 -86
  84. app/locale/en_US/template/email/packpin/packpin_out_for_delivery_email.html +86 -86
  85. app/locale/es_ES/Packpin_Pptrack.csv +39 -39
  86. app/locale/nl_NL/Packpin_Pptrack.csv +39 -39
  87. app/locale/pt_PT/Packpin_Pptrack.csv +39 -39
  88. package.xml +4 -4
  89. skin/adminhtml/default/default/pptrack/css/dashboard.css +25 -25
  90. skin/adminhtml/default/default/pptrack/css/pptrack.css +65 -65
  91. skin/adminhtml/default/default/pptrack/images/mg_template1_o.png +0 -0
  92. skin/adminhtml/default/default/pptrack/images/mg_template2_o.png +0 -0
  93. skin/adminhtml/default/default/pptrack/images/pp_logo1.png +0 -0
  94. skin/adminhtml/default/default/pptrack/js/dashboard.js +27 -27
  95. skin/adminhtml/default/default/pptrack/js/pptrack.js +0 -0
  96. skin/frontend/base/default/css/pptrack.css +0 -341
app/code/community/Packpin/Pptrack/Block/Adminhtml/Dashboard.php CHANGED
@@ -1,211 +1,211 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Block_Adminhtml_Dashboard extends Mage_Adminhtml_Block_Dashboard_Abstract
4
- {
5
-
6
- protected function _construct()
7
- {
8
- parent::_construct();
9
- $this->setTemplate('pptrack/dashboard/packpin.phtml');
10
- }
11
-
12
- public function getTotalShipments()
13
- {
14
- $count = Mage::getModel('pptrack/track')
15
- ->getTotalCount();
16
-
17
- return $count;
18
- }
19
-
20
- public function getTotalVisits()
21
- {
22
- $count = Mage::getModel('pptrack/visit')
23
- ->getTotalCount();
24
-
25
- return number_format($count);
26
- }
27
-
28
- public function getPlanDetails()
29
- {
30
- $helper = Mage::helper('pptrack');
31
- $res = $helper->getPlanDetails();
32
-
33
- //map new data to current model
34
- if ($res && $res["statusCode"] == 200) {
35
- $info = $res["body"];
36
-
37
- return $info;
38
- }
39
-
40
- return array();
41
- }
42
-
43
- /**
44
- * Get info for range selector
45
- */
46
- public function getRangeInfo()
47
- {
48
- $now = date("Y-m-d");
49
- $date = new DateTime();
50
- $d30 = $date->modify("-30 day")->format("Y-m-d");
51
- $date = new DateTime();
52
- $d1 = $date->modify("-1 day")->format("Y-m-d");
53
- $date = new DateTime();
54
- $d7 = $date->modify("-7 day")->format("Y-m-d");
55
-
56
- $dateStart = Mage::app()->getRequest()->getParam('date_from');
57
- $dateEnd = Mage::app()->getRequest()->getParam('date_to');
58
-
59
-
60
- $rangeInfo = array(
61
- 'last30days' => array(
62
- 'label' => Mage::helper('pptrack')->__('Last 30 days'),
63
- 'date_start' => $d30,
64
- 'date_end' => $now,
65
- ),
66
- 'last7days' => array(
67
- 'label' => Mage::helper('pptrack')->__('Last 7 days'),
68
- 'date_start' => $d7,
69
- 'date_end' => $now,
70
- ),
71
- 'yesterday' => array(
72
- 'label' => Mage::helper('pptrack')->__('Yesterday'),
73
- 'date_start' => $d1,
74
- 'date_end' => $d1,
75
- ),
76
- 'today' => array(
77
- 'label' => Mage::helper('pptrack')->__('Today'),
78
- 'date_start' => $now,
79
- 'date_end' => $now,
80
- ),
81
- 'custom' => array(
82
- 'label' => Mage::helper('pptrack')->__('Custom'),
83
- 'date_start' => $dateStart,
84
- 'date_end' => $dateEnd,
85
- ),
86
- );
87
-
88
- return $rangeInfo;
89
- }
90
-
91
- public function getSelectedRange()
92
- {
93
- $ranges = $this->getRangeInfo();
94
- $range = Mage::app()->getRequest()->getParam('range', key($ranges));
95
-
96
- return $range;
97
- }
98
-
99
- /**
100
- * @return array
101
- */
102
- public function getRangeStats()
103
- {
104
- $stats = array(
105
- 'trackings' => 0,
106
- 'emails' => '?',
107
- 'visits' => 0,
108
- 'average' => 0,
109
- 'graph' => array(),
110
- );
111
-
112
- $rangeInfo = $this->getRangeInfo();
113
- $range = $this->getSelectedRange();
114
-
115
- $start = $rangeInfo[$range]['date_start'];
116
- $startTime = strtotime($start . ' 00:00:00');
117
- $end = $rangeInfo[$range]['date_end'];
118
- $endTime = strtotime($end . ' 23:59:59');
119
-
120
- $stats['trackings'] = Mage::getModel('pptrack/track')
121
- ->getCollection()
122
- ->addFieldToFilter("created_at", array('gteq' => $startTime))
123
- ->addFieldToFilter("created_at", array('lteq' => $endTime))
124
- ->getSize();
125
-
126
- $stats['visits'] = Mage::getModel('pptrack/visit')
127
- ->getCollection()
128
- ->addFieldToFilter(new Zend_Db_Expr("DATE(created_at)"), array('gteq' => $start))
129
- ->addFieldToFilter(new Zend_Db_Expr("DATE(created_at)"), array('lteq' => $end))
130
- ->getSize();
131
-
132
- $stats['average'] = $stats['trackings'] ? $stats['visits'] / $stats['trackings'] : 0;
133
-
134
- //email stats
135
- $helper = Mage::helper('pptrack');
136
- $res = $helper->getEmailCount($start, $end);
137
-
138
- //map new data to current model
139
- if ($res && $res["statusCode"] == 200) {
140
- $stats['emails'] = $res["body"]['count'];
141
- }
142
-
143
- //graph data
144
- $data = array();
145
- $list1 = array();
146
- $list2 = array();
147
- $collection = Mage::getModel('pptrack/track')
148
- ->getCollection()
149
- ->addFieldToFilter("created_at", array('gteq' => $startTime))
150
- ->addFieldToFilter("created_at", array('lteq' => $endTime));
151
- $collection->getSelect()
152
- ->group(new Zend_Db_Expr('DATE(FROM_UNIXTIME(created_at))'))
153
- ->columns(new Zend_Db_Expr('DATE(FROM_UNIXTIME(created_at)) as date, COUNT(*) as count'));
154
- $list1Raw = $collection->getData();
155
-
156
- $collection = Mage::getModel('pptrack/visit')
157
- ->getCollection()
158
- ->addFieldToFilter(new Zend_Db_Expr("DATE(created_at)"), array('gteq' => $start))
159
- ->addFieldToFilter(new Zend_Db_Expr("DATE(created_at)"), array('lteq' => $end));
160
- $collection->getSelect()
161
- ->group(new Zend_Db_Expr('DATE(created_at)'))
162
- ->columns(new Zend_Db_Expr('DATE(created_at) as date, COUNT(*) as count'));
163
- $list2Raw = $collection->getData();
164
-
165
- foreach ($list1Raw as $item) {
166
- $list1[$item['date']] = $item['count'];
167
- }
168
- foreach ($list2Raw as $item) {
169
- $list2[$item['date']] = $item['count'];
170
- }
171
-
172
- $startObj = DateTime::createFromFormat("Y-m-d", $start);
173
- $endObj = DateTime::createFromFormat("Y-m-d", $end);
174
- $ct = 0;
175
- try {
176
- do {
177
- $date = $startObj->format('Y-m-d');
178
-
179
- $count = isset($list1[$date]) ? $list1[$date] : 0;
180
- $count2 = isset($list2[$date]) ? $list2[$date] : 0;
181
-
182
- $data[$date] = array(
183
- 'period' => $date,
184
- 'count' => $count,
185
- 'count2' => $count2,
186
- );
187
-
188
-
189
- $startObj->modify('1 day');
190
- $ct++;
191
- } while ($startObj <= $endObj && $ct < 5000);
192
- } catch (Exception $e) {
193
-
194
- }
195
-
196
- $stats['graph'] = $data;
197
-
198
- return $stats;
199
- }
200
-
201
- public function pluginEnabled()
202
- {
203
- return Mage::getStoreConfig('pp_section_setttings/settings/status');
204
- }
205
-
206
- public function notificationsEnabled()
207
- {
208
- return Mage::getStoreConfig('pp_section_setttings/settings/pp_enable_notifications');
209
- }
210
-
211
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Block_Adminhtml_Dashboard extends Mage_Adminhtml_Block_Dashboard_Abstract
4
+ {
5
+
6
+ protected function _construct()
7
+ {
8
+ parent::_construct();
9
+ $this->setTemplate('pptrack/dashboard/packpin.phtml');
10
+ }
11
+
12
+ public function getTotalShipments()
13
+ {
14
+ $count = Mage::getModel('pptrack/track')
15
+ ->getTotalCount();
16
+
17
+ return $count;
18
+ }
19
+
20
+ public function getTotalVisits()
21
+ {
22
+ $count = Mage::getModel('pptrack/visit')
23
+ ->getTotalCount();
24
+
25
+ return number_format($count);
26
+ }
27
+
28
+ public function getPlanDetails()
29
+ {
30
+ $helper = Mage::helper('pptrack');
31
+ $res = $helper->getPlanDetails();
32
+
33
+ //map new data to current model
34
+ if ($res && $res["statusCode"] == 200) {
35
+ $info = $res["body"];
36
+
37
+ return $info;
38
+ }
39
+
40
+ return array();
41
+ }
42
+
43
+ /**
44
+ * Get info for range selector
45
+ */
46
+ public function getRangeInfo()
47
+ {
48
+ $now = date("Y-m-d");
49
+ $date = new DateTime();
50
+ $d30 = $date->modify("-30 day")->format("Y-m-d");
51
+ $date = new DateTime();
52
+ $d1 = $date->modify("-1 day")->format("Y-m-d");
53
+ $date = new DateTime();
54
+ $d7 = $date->modify("-7 day")->format("Y-m-d");
55
+
56
+ $dateStart = Mage::app()->getRequest()->getParam('date_from');
57
+ $dateEnd = Mage::app()->getRequest()->getParam('date_to');
58
+
59
+
60
+ $rangeInfo = array(
61
+ 'last30days' => array(
62
+ 'label' => Mage::helper('pptrack')->__('Last 30 days'),
63
+ 'date_start' => $d30,
64
+ 'date_end' => $now,
65
+ ),
66
+ 'last7days' => array(
67
+ 'label' => Mage::helper('pptrack')->__('Last 7 days'),
68
+ 'date_start' => $d7,
69
+ 'date_end' => $now,
70
+ ),
71
+ 'yesterday' => array(
72
+ 'label' => Mage::helper('pptrack')->__('Yesterday'),
73
+ 'date_start' => $d1,
74
+ 'date_end' => $d1,
75
+ ),
76
+ 'today' => array(
77
+ 'label' => Mage::helper('pptrack')->__('Today'),
78
+ 'date_start' => $now,
79
+ 'date_end' => $now,
80
+ ),
81
+ 'custom' => array(
82
+ 'label' => Mage::helper('pptrack')->__('Custom'),
83
+ 'date_start' => $dateStart,
84
+ 'date_end' => $dateEnd,
85
+ ),
86
+ );
87
+
88
+ return $rangeInfo;
89
+ }
90
+
91
+ public function getSelectedRange()
92
+ {
93
+ $ranges = $this->getRangeInfo();
94
+ $range = Mage::app()->getRequest()->getParam('range', key($ranges));
95
+
96
+ return $range;
97
+ }
98
+
99
+ /**
100
+ * @return array
101
+ */
102
+ public function getRangeStats()
103
+ {
104
+ $stats = array(
105
+ 'trackings' => 0,
106
+ 'emails' => '?',
107
+ 'visits' => 0,
108
+ 'average' => 0,
109
+ 'graph' => array(),
110
+ );
111
+
112
+ $rangeInfo = $this->getRangeInfo();
113
+ $range = $this->getSelectedRange();
114
+
115
+ $start = $rangeInfo[$range]['date_start'];
116
+ $startTime = strtotime($start . ' 00:00:00');
117
+ $end = $rangeInfo[$range]['date_end'];
118
+ $endTime = strtotime($end . ' 23:59:59');
119
+
120
+ $stats['trackings'] = Mage::getModel('pptrack/track')
121
+ ->getCollection()
122
+ ->addFieldToFilter("created_at", array('gteq' => $startTime))
123
+ ->addFieldToFilter("created_at", array('lteq' => $endTime))
124
+ ->getSize();
125
+
126
+ $stats['visits'] = Mage::getModel('pptrack/visit')
127
+ ->getCollection()
128
+ ->addFieldToFilter(new Zend_Db_Expr("DATE(created_at)"), array('gteq' => $start))
129
+ ->addFieldToFilter(new Zend_Db_Expr("DATE(created_at)"), array('lteq' => $end))
130
+ ->getSize();
131
+
132
+ $stats['average'] = $stats['trackings'] ? $stats['visits'] / $stats['trackings'] : 0;
133
+
134
+ //email stats
135
+ $helper = Mage::helper('pptrack');
136
+ $res = $helper->getEmailCount($start, $end);
137
+
138
+ //map new data to current model
139
+ if ($res && $res["statusCode"] == 200) {
140
+ $stats['emails'] = $res["body"]['count'];
141
+ }
142
+
143
+ //graph data
144
+ $data = array();
145
+ $list1 = array();
146
+ $list2 = array();
147
+ $collection = Mage::getModel('pptrack/track')
148
+ ->getCollection()
149
+ ->addFieldToFilter("created_at", array('gteq' => $startTime))
150
+ ->addFieldToFilter("created_at", array('lteq' => $endTime));
151
+ $collection->getSelect()
152
+ ->group(new Zend_Db_Expr('DATE(FROM_UNIXTIME(created_at))'))
153
+ ->columns(new Zend_Db_Expr('DATE(FROM_UNIXTIME(created_at)) as date, COUNT(*) as count'));
154
+ $list1Raw = $collection->getData();
155
+
156
+ $collection = Mage::getModel('pptrack/visit')
157
+ ->getCollection()
158
+ ->addFieldToFilter(new Zend_Db_Expr("DATE(created_at)"), array('gteq' => $start))
159
+ ->addFieldToFilter(new Zend_Db_Expr("DATE(created_at)"), array('lteq' => $end));
160
+ $collection->getSelect()
161
+ ->group(new Zend_Db_Expr('DATE(created_at)'))
162
+ ->columns(new Zend_Db_Expr('DATE(created_at) as date, COUNT(*) as count'));
163
+ $list2Raw = $collection->getData();
164
+
165
+ foreach ($list1Raw as $item) {
166
+ $list1[$item['date']] = $item['count'];
167
+ }
168
+ foreach ($list2Raw as $item) {
169
+ $list2[$item['date']] = $item['count'];
170
+ }
171
+
172
+ $startObj = DateTime::createFromFormat("Y-m-d", $start);
173
+ $endObj = DateTime::createFromFormat("Y-m-d", $end);
174
+ $ct = 0;
175
+ try {
176
+ do {
177
+ $date = $startObj->format('Y-m-d');
178
+
179
+ $count = isset($list1[$date]) ? $list1[$date] : 0;
180
+ $count2 = isset($list2[$date]) ? $list2[$date] : 0;
181
+
182
+ $data[$date] = array(
183
+ 'period' => $date,
184
+ 'count' => $count,
185
+ 'count2' => $count2,
186
+ );
187
+
188
+
189
+ $startObj->modify('1 day');
190
+ $ct++;
191
+ } while ($startObj <= $endObj && $ct < 5000);
192
+ } catch (Exception $e) {
193
+
194
+ }
195
+
196
+ $stats['graph'] = $data;
197
+
198
+ return $stats;
199
+ }
200
+
201
+ public function pluginEnabled()
202
+ {
203
+ return Mage::getStoreConfig('pp_section_setttings/settings/status');
204
+ }
205
+
206
+ public function notificationsEnabled()
207
+ {
208
+ return Mage::getStoreConfig('pp_section_setttings/settings/pp_enable_notifications');
209
+ }
210
+
211
  }
app/code/community/Packpin/Pptrack/Block/Adminhtml/Sales/Order/Shipment/Create/Tracking.php CHANGED
@@ -1,39 +1,39 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Block_Adminhtml_Sales_Order_Shipment_Create_Tracking extends Mage_Adminhtml_Block_Sales_Order_Shipment_Create_Tracking
4
- {
5
-
6
- /**
7
- * Retrieve
8
- *
9
- * @return unknown
10
- */
11
- public function getCarriers()
12
- {
13
- $carriers = parent::getCarriers();
14
-
15
- $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
16
- if (!$enabled)
17
- return $carriers;
18
-
19
- $disableDefault = isset($config['disable_default_carriers']) && $config['disable_default_carriers'] ? 1 : 0;
20
-
21
- //get Packpin Additional carriers
22
- $packpinCarriers = Mage::getModel('pptrack/carrier')
23
- ->getList();
24
- if ($packpinCarriers) {
25
- if ($disableDefault) {
26
- $carriers = array();
27
- }
28
- else {
29
- $carriers[''] = Mage::helper('pptrack')->__('----- Packpin carriers -----');
30
- }
31
- foreach ($packpinCarriers as $item) {
32
- $carriers[$item->getPrefixedCode()] = $item->getData('name');
33
- }
34
- }
35
-
36
- return $carriers;
37
- }
38
-
39
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Block_Adminhtml_Sales_Order_Shipment_Create_Tracking extends Mage_Adminhtml_Block_Sales_Order_Shipment_Create_Tracking
4
+ {
5
+
6
+ /**
7
+ * Retrieve
8
+ *
9
+ * @return unknown
10
+ */
11
+ public function getCarriers()
12
+ {
13
+ $carriers = parent::getCarriers();
14
+
15
+ $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
16
+ if (!$enabled)
17
+ return $carriers;
18
+
19
+ $disableDefault = isset($config['disable_default_carriers']) && $config['disable_default_carriers'] ? 1 : 0;
20
+
21
+ //get Packpin Additional carriers
22
+ $packpinCarriers = Mage::getModel('pptrack/carrier')
23
+ ->getList();
24
+ if ($packpinCarriers) {
25
+ if ($disableDefault) {
26
+ $carriers = array();
27
+ }
28
+ else {
29
+ $carriers[''] = Mage::helper('pptrack')->__('----- Packpin carriers -----');
30
+ }
31
+ foreach ($packpinCarriers as $item) {
32
+ $carriers[$item->getPrefixedCode()] = $item->getData('name');
33
+ }
34
+ }
35
+
36
+ return $carriers;
37
+ }
38
+
39
  }
app/code/community/Packpin/Pptrack/Block/Adminhtml/Sales/Order/Shipment/View/Tracking.php CHANGED
@@ -1,65 +1,65 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Block_Adminhtml_Sales_Order_Shipment_View_Tracking extends Mage_Adminhtml_Block_Sales_Order_Shipment_View_Tracking
4
- {
5
-
6
- /**
7
- * Carrier list for static cache
8
- *
9
- * @var array
10
- */
11
- public static $carrierList = array();
12
-
13
- /**
14
- * Retrieve carriers
15
- *
16
- * @return array
17
- */
18
- public function getCarriers()
19
- {
20
- if (!self::$carrierList) {
21
- $carriers = parent::getCarriers();
22
-
23
- $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
24
- if (!$enabled)
25
- return $carriers;
26
-
27
- $disableDefault = isset($config['disable_default_carriers']) && $config['disable_default_carriers'] ? 1 : 0;
28
-
29
- //get Packpin Additional carriers
30
- $packpinCarriers = Mage::getModel('pptrack/carrier')
31
- ->getList();
32
- if ($packpinCarriers) {
33
- if ($disableDefault) {
34
- $carriers = array();
35
- }
36
- else {
37
- $carriers[''] = Mage::helper('pptrack')->__('----- Packpin carriers -----');
38
- }
39
- foreach ($packpinCarriers as $item) {
40
- $carriers[$item->getPrefixedCode()] = $item->getData('name');
41
- }
42
- }
43
-
44
- self::$carrierList = $carriers;
45
- }
46
-
47
- return self::$carrierList;
48
- }
49
-
50
- public function getCarrierTitle($code)
51
- {
52
- $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
53
- if (!$enabled)
54
- return parent::getCarrierTitle($code);
55
-
56
- $allCarriers = $this->getCarriers();
57
-
58
- if (isset($allCarriers[$code]))
59
- return $allCarriers[$code];
60
- else
61
- return parent::getCarrierTitle($code);
62
-
63
- }
64
-
65
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Block_Adminhtml_Sales_Order_Shipment_View_Tracking extends Mage_Adminhtml_Block_Sales_Order_Shipment_View_Tracking
4
+ {
5
+
6
+ /**
7
+ * Carrier list for static cache
8
+ *
9
+ * @var array
10
+ */
11
+ public static $carrierList = array();
12
+
13
+ /**
14
+ * Retrieve carriers
15
+ *
16
+ * @return array
17
+ */
18
+ public function getCarriers()
19
+ {
20
+ if (!self::$carrierList) {
21
+ $carriers = parent::getCarriers();
22
+
23
+ $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
24
+ if (!$enabled)
25
+ return $carriers;
26
+
27
+ $disableDefault = isset($config['disable_default_carriers']) && $config['disable_default_carriers'] ? 1 : 0;
28
+
29
+ //get Packpin Additional carriers
30
+ $packpinCarriers = Mage::getModel('pptrack/carrier')
31
+ ->getList();
32
+ if ($packpinCarriers) {
33
+ if ($disableDefault) {
34
+ $carriers = array();
35
+ }
36
+ else {
37
+ $carriers[''] = Mage::helper('pptrack')->__('----- Packpin carriers -----');
38
+ }
39
+ foreach ($packpinCarriers as $item) {
40
+ $carriers[$item->getPrefixedCode()] = $item->getData('name');
41
+ }
42
+ }
43
+
44
+ self::$carrierList = $carriers;
45
+ }
46
+
47
+ return self::$carrierList;
48
+ }
49
+
50
+ public function getCarrierTitle($code)
51
+ {
52
+ $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
53
+ if (!$enabled)
54
+ return parent::getCarrierTitle($code);
55
+
56
+ $allCarriers = $this->getCarriers();
57
+
58
+ if (isset($allCarriers[$code]))
59
+ return $allCarriers[$code];
60
+ else
61
+ return parent::getCarrierTitle($code);
62
+
63
+ }
64
+
65
  }
app/code/community/Packpin/Pptrack/Block/Adminhtml/System/Config/Fieldset/Hint-owner.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Block_Adminhtml_System_Config_Fieldset_Hint
4
- extends Mage_Adminhtml_Block_Abstract
5
- implements Varien_Data_Form_Element_Renderer_Interface
6
- {
7
- protected $_template = 'pptrack/system/config/fieldset/hint-owner.phtml';
8
-
9
- /**
10
- * Render fieldset html
11
- *
12
- * @param Varien_Data_Form_Element_Abstract $element
13
- * @return string
14
- */
15
- public function render(Varien_Data_Form_Element_Abstract $element)
16
- {
17
- return $this->toHtml();
18
- }
19
- }
20
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Packpin/Pptrack/Block/Adminhtml/System/Config/Fieldset/Hint.php CHANGED
@@ -1,53 +1,53 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Block_Adminhtml_System_Config_Fieldset_Hint
4
- extends Mage_Adminhtml_Block_Abstract
5
- implements Varien_Data_Form_Element_Renderer_Interface
6
- {
7
- protected $_template = 'pptrack/system/config/fieldset/hint.phtml';
8
-
9
- /**
10
- * Render fieldset html
11
- *
12
- * @param Varien_Data_Form_Element_Abstract $element
13
- * @return string
14
- */
15
- public function render(Varien_Data_Form_Element_Abstract $element)
16
- {
17
- return $this->toHtml();
18
- }
19
-
20
- /**
21
- * Check if user still using temporary key
22
- *
23
- * @return bool
24
- */
25
- public function haveTempKey()
26
- {
27
- $key = Mage::getStoreConfig('pp_section_setttings/settings/api_key');
28
- $tempKey = Mage::getStoreConfig('pp_section_setttings/settings/temp_api_key');
29
-
30
- if ($tempKey && $tempKey == $key) {
31
- return true;
32
- }
33
-
34
- return false;
35
- }
36
-
37
- /**
38
- * Get days left till temp key expiration
39
- *
40
- * @return string
41
- */
42
- public function getDaysLeft()
43
- {
44
- $tempKeyInstalled = Mage::getStoreConfig('pp_section_setttings/settings/temp_key_installed');
45
- $timeDiff = $tempKeyInstalled + (86400 * 7) - time();
46
- if ($timeDiff > 0) {
47
- return ceil($timeDiff / 86400);
48
- }
49
-
50
- return 0;
51
- }
52
- }
53
-
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Block_Adminhtml_System_Config_Fieldset_Hint
4
+ extends Mage_Adminhtml_Block_Abstract
5
+ implements Varien_Data_Form_Element_Renderer_Interface
6
+ {
7
+ protected $_template = 'pptrack/system/config/fieldset/hint.phtml';
8
+
9
+ /**
10
+ * Render fieldset html
11
+ *
12
+ * @param Varien_Data_Form_Element_Abstract $element
13
+ * @return string
14
+ */
15
+ public function render(Varien_Data_Form_Element_Abstract $element)
16
+ {
17
+ return $this->toHtml();
18
+ }
19
+
20
+ /**
21
+ * Check if user still using temporary key
22
+ *
23
+ * @return bool
24
+ */
25
+ public function haveTempKey()
26
+ {
27
+ $key = Mage::getStoreConfig('pp_section_setttings/settings/api_key');
28
+ $tempKey = Mage::getStoreConfig('pp_section_setttings/settings/temp_api_key');
29
+
30
+ if ($tempKey && $tempKey == $key) {
31
+ return true;
32
+ }
33
+
34
+ return false;
35
+ }
36
+
37
+ /**
38
+ * Get days left till temp key expiration
39
+ *
40
+ * @return string
41
+ */
42
+ public function getDaysLeft()
43
+ {
44
+ $tempKeyInstalled = Mage::getStoreConfig('pp_section_setttings/settings/temp_key_installed');
45
+ $timeDiff = $tempKeyInstalled + (86400 * 7) - time();
46
+ if ($timeDiff > 0) {
47
+ return ceil($timeDiff / 86400);
48
+ }
49
+
50
+ return 0;
51
+ }
52
+ }
53
+
app/code/community/Packpin/Pptrack/Block/Adminhtml/System/Config/Fieldset/Scripts.php CHANGED
@@ -1,53 +1,53 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Block_Adminhtml_System_Config_Fieldset_Scripts
4
- extends Mage_Adminhtml_Block_Abstract
5
- implements Varien_Data_Form_Element_Renderer_Interface
6
- {
7
- protected $_template = 'pptrack/system/config/fieldset/scripts.phtml';
8
-
9
- /**
10
- * Render fieldset html
11
- *
12
- * @param Varien_Data_Form_Element_Abstract $element
13
- * @return string
14
- */
15
- public function render(Varien_Data_Form_Element_Abstract $element)
16
- {
17
- return $this->toHtml();
18
- }
19
-
20
- /**
21
- * Check if user still using temporary key
22
- *
23
- * @return bool
24
- */
25
- public function haveTempKey()
26
- {
27
- $key = Mage::getStoreConfig('pp_section_setttings/settings/api_key');
28
- $tempKey = Mage::getStoreConfig('pp_section_setttings/settings/temp_api_key');
29
-
30
- if ($tempKey && $tempKey == $key) {
31
- return true;
32
- }
33
-
34
- return false;
35
- }
36
-
37
- /**
38
- * Get days left till temp key expiration
39
- *
40
- * @return string
41
- */
42
- public function getDaysLeft()
43
- {
44
- $tempKeyInstalled = Mage::getStoreConfig('pp_section_setttings/settings/temp_key_installed');
45
- $timeDiff = $tempKeyInstalled + (86400 * 7) - time();
46
- if ($timeDiff > 0) {
47
- return ceil($timeDiff / 86400);
48
- }
49
-
50
- return 0;
51
- }
52
- }
53
-
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Block_Adminhtml_System_Config_Fieldset_Scripts
4
+ extends Mage_Adminhtml_Block_Abstract
5
+ implements Varien_Data_Form_Element_Renderer_Interface
6
+ {
7
+ protected $_template = 'pptrack/system/config/fieldset/scripts.phtml';
8
+
9
+ /**
10
+ * Render fieldset html
11
+ *
12
+ * @param Varien_Data_Form_Element_Abstract $element
13
+ * @return string
14
+ */
15
+ public function render(Varien_Data_Form_Element_Abstract $element)
16
+ {
17
+ return $this->toHtml();
18
+ }
19
+
20
+ /**
21
+ * Check if user still using temporary key
22
+ *
23
+ * @return bool
24
+ */
25
+ public function haveTempKey()
26
+ {
27
+ $key = Mage::getStoreConfig('pp_section_setttings/settings/api_key');
28
+ $tempKey = Mage::getStoreConfig('pp_section_setttings/settings/temp_api_key');
29
+
30
+ if ($tempKey && $tempKey == $key) {
31
+ return true;
32
+ }
33
+
34
+ return false;
35
+ }
36
+
37
+ /**
38
+ * Get days left till temp key expiration
39
+ *
40
+ * @return string
41
+ */
42
+ public function getDaysLeft()
43
+ {
44
+ $tempKeyInstalled = Mage::getStoreConfig('pp_section_setttings/settings/temp_key_installed');
45
+ $timeDiff = $tempKeyInstalled + (86400 * 7) - time();
46
+ if ($timeDiff > 0) {
47
+ return ceil($timeDiff / 86400);
48
+ }
49
+
50
+ return 0;
51
+ }
52
+ }
53
+
app/code/community/Packpin/Pptrack/Block/Adminhtml/System/Config/Form/Fieldset/Carrier.php CHANGED
@@ -1,81 +1,81 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Block_Adminhtml_System_Config_Form_Fieldset_Carrier extends
4
- Mage_Adminhtml_Block_System_Config_Form_Fieldset
5
- {
6
- protected $_dummyElement;
7
- protected $_fieldRenderer;
8
- protected $_values;
9
- protected $_dataSource;
10
- protected $_hidden = '';
11
-
12
- public function render(Varien_Data_Form_Element_Abstract $element)
13
- {
14
- $html = $this->_getHeaderHtml($element);
15
-
16
- $carriers = Mage::getModel('pptrack/carrier')->getList(true);
17
-
18
- //check all button
19
- $html .= '<tr><td class="label"></td><td>';
20
- $html .= $this->_getCheckAllButton('$$(\'.pp_carrier\').forEach(function(el){el.writeAttribute(\'checked\', true)});', $this->helper('pptrack')->__('Select All'));
21
- $html .= ' ';
22
- $html .= $this->_getCheckAllButton('$$(\'.pp_carrier\').forEach(function(el){el.writeAttribute(\'checked\', false)});', $this->helper('pptrack')->__('Unselect All'));
23
- $html .= '</td></tr>';
24
-
25
- $fields = '';
26
- foreach ($carriers as $carrier) {
27
- $fields .= $this->_getFieldHtml($element, $carrier);
28
- }
29
- $html .= $fields;
30
- $html .= $this->_getFooterHtml($element);
31
-
32
- return $this->_hidden . $html;
33
- }
34
-
35
- protected function _getFieldRenderer()
36
- {
37
- if (empty($this->_fieldRenderer)) {
38
- $this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
39
- }
40
- return $this->_fieldRenderer;
41
- }
42
-
43
- protected function _getValues()
44
- {
45
- if (!$this->_dataSource)
46
- $this->_dataSource = Mage::getSingleton('adminhtml/system_config_source_enabledisable')->toOptionArray();
47
-
48
- return $this->_dataSource;
49
- }
50
-
51
- protected function _getFieldHtml($fieldset, $carrier)
52
- {
53
- $name = 'groups[carriers][fields][' . $carrier->getCode() . '][value]';
54
- $this->_hidden .= '<input type="hidden" name="'. $name .'" value="0">';
55
-
56
- $field = $fieldset->addField($carrier->getCode(), 'checkbox',
57
- array(
58
- 'name' => $name,
59
- 'label' => $carrier->getName(),
60
- 'class' => 'pp_carrier',
61
- 'value' => 1,
62
- 'checked' => $carrier->getEnabled(),
63
- // 'values' => $this->_getValues(),
64
- 'can_use_default_value' => 0,
65
- 'can_use_website_value' => 0,
66
- ))->setRenderer($this->_getFieldRenderer());
67
-
68
- return $field->toHtml();
69
- }
70
-
71
- protected function _getCheckAllButton($action, $label)
72
- {
73
- $button = $this->getLayout()->createBlock('adminhtml/widget_button')
74
- ->setData(array(
75
- 'label' => $label,
76
- 'onclick' => 'javascript:'. $action .'; return false;'
77
- ));
78
-
79
- return $button->toHtml();
80
- }
81
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Block_Adminhtml_System_Config_Form_Fieldset_Carrier extends
4
+ Mage_Adminhtml_Block_System_Config_Form_Fieldset
5
+ {
6
+ protected $_dummyElement;
7
+ protected $_fieldRenderer;
8
+ protected $_values;
9
+ protected $_dataSource;
10
+ protected $_hidden = '';
11
+
12
+ public function render(Varien_Data_Form_Element_Abstract $element)
13
+ {
14
+ $html = $this->_getHeaderHtml($element);
15
+
16
+ $carriers = Mage::getModel('pptrack/carrier')->getList(true);
17
+
18
+ //check all button
19
+ $html .= '<tr><td class="label"></td><td>';
20
+ $html .= $this->_getCheckAllButton('$$(\'.pp_carrier\').forEach(function(el){el.writeAttribute(\'checked\', true)});', $this->helper('pptrack')->__('Select All'));
21
+ $html .= ' ';
22
+ $html .= $this->_getCheckAllButton('$$(\'.pp_carrier\').forEach(function(el){el.writeAttribute(\'checked\', false)});', $this->helper('pptrack')->__('Unselect All'));
23
+ $html .= '</td></tr>';
24
+
25
+ $fields = '';
26
+ foreach ($carriers as $carrier) {
27
+ $fields .= $this->_getFieldHtml($element, $carrier);
28
+ }
29
+ $html .= $fields;
30
+ $html .= $this->_getFooterHtml($element);
31
+
32
+ return $this->_hidden . $html;
33
+ }
34
+
35
+ protected function _getFieldRenderer()
36
+ {
37
+ if (empty($this->_fieldRenderer)) {
38
+ $this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
39
+ }
40
+ return $this->_fieldRenderer;
41
+ }
42
+
43
+ protected function _getValues()
44
+ {
45
+ if (!$this->_dataSource)
46
+ $this->_dataSource = Mage::getSingleton('adminhtml/system_config_source_enabledisable')->toOptionArray();
47
+
48
+ return $this->_dataSource;
49
+ }
50
+
51
+ protected function _getFieldHtml($fieldset, $carrier)
52
+ {
53
+ $name = 'groups[carriers][fields][' . $carrier->getCode() . '][value]';
54
+ $this->_hidden .= '<input type="hidden" name="'. $name .'" value="0">';
55
+
56
+ $field = $fieldset->addField($carrier->getCode(), 'checkbox',
57
+ array(
58
+ 'name' => $name,
59
+ 'label' => $carrier->getName(),
60
+ 'class' => 'pp_carrier',
61
+ 'value' => 1,
62
+ 'checked' => $carrier->getEnabled(),
63
+ // 'values' => $this->_getValues(),
64
+ 'can_use_default_value' => 0,
65
+ 'can_use_website_value' => 0,
66
+ ))->setRenderer($this->_getFieldRenderer());
67
+
68
+ return $field->toHtml();
69
+ }
70
+
71
+ protected function _getCheckAllButton($action, $label)
72
+ {
73
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button')
74
+ ->setData(array(
75
+ 'label' => $label,
76
+ 'onclick' => 'javascript:'. $action .'; return false;'
77
+ ));
78
+
79
+ return $button->toHtml();
80
+ }
81
  }
app/code/community/Packpin/Pptrack/Block/Adminhtml/Tracks.php CHANGED
@@ -1,15 +1,15 @@
1
- <?php
2
- class Packpin_Pptrack_Block_Adminhtml_Tracks extends Mage_Adminhtml_Block_Widget_Grid_Container
3
- {
4
- public function __construct()
5
- {
6
- // The blockGroup must match the first half of how we call the block, and controller matches the second half
7
- // ie. foo_bar/adminhtml_baz
8
- $this->_blockGroup = 'pptrack';
9
- $this->_controller = 'adminhtml_tracks';
10
- $this->_headerText = $this->__('Tracked shipments');
11
-
12
- parent::__construct();
13
- $this->_removeButton('add');
14
- }
15
  }
1
+ <?php
2
+ class Packpin_Pptrack_Block_Adminhtml_Tracks extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ // The blockGroup must match the first half of how we call the block, and controller matches the second half
7
+ // ie. foo_bar/adminhtml_baz
8
+ $this->_blockGroup = 'pptrack';
9
+ $this->_controller = 'adminhtml_tracks';
10
+ $this->_headerText = $this->__('Tracked shipments');
11
+
12
+ parent::__construct();
13
+ $this->_removeButton('add');
14
+ }
15
  }
app/code/community/Packpin/Pptrack/Block/Adminhtml/Tracks/Edit.php CHANGED
@@ -1,33 +1,33 @@
1
- <?php
2
- class Packpin_Pptrack_Block_Adminhtml_Tracks_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
3
- {
4
- /**
5
- * Init class
6
- */
7
- public function __construct()
8
- {
9
- $this->_blockGroup = 'pptrack';
10
- $this->_controller = 'adminhtml_tracks';
11
-
12
- parent::__construct();
13
-
14
- $this->_updateButton('save', 'label', $this->__('Save Track'));
15
- $this->_updateButton('delete', 'label', $this->__('Delete Track'));
16
- $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getUrl('*/*/dashboard/') . '\')');
17
- }
18
-
19
- /**
20
- * Get Header text
21
- *
22
- * @return string
23
- */
24
- public function getHeaderText()
25
- {
26
- if (Mage::registry('pptrack')->getId()) {
27
- return $this->__('Edit Track');
28
- }
29
- else {
30
- return $this->__('New Track');
31
- }
32
- }
33
  }
1
+ <?php
2
+ class Packpin_Pptrack_Block_Adminhtml_Tracks_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
3
+ {
4
+ /**
5
+ * Init class
6
+ */
7
+ public function __construct()
8
+ {
9
+ $this->_blockGroup = 'pptrack';
10
+ $this->_controller = 'adminhtml_tracks';
11
+
12
+ parent::__construct();
13
+
14
+ $this->_updateButton('save', 'label', $this->__('Save Track'));
15
+ $this->_updateButton('delete', 'label', $this->__('Delete Track'));
16
+ $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getUrl('*/*/dashboard/') . '\')');
17
+ }
18
+
19
+ /**
20
+ * Get Header text
21
+ *
22
+ * @return string
23
+ */
24
+ public function getHeaderText()
25
+ {
26
+ if (Mage::registry('pptrack')->getId()) {
27
+ return $this->__('Edit Track');
28
+ }
29
+ else {
30
+ return $this->__('New Track');
31
+ }
32
+ }
33
  }
app/code/community/Packpin/Pptrack/Block/Adminhtml/Tracks/Edit/Form.php CHANGED
@@ -1,54 +1,54 @@
1
- <?php
2
- class Packpin_Pptrack_Block_Adminhtml_Tracks_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
3
- {
4
- /**
5
- * Init class
6
- */
7
- public function __construct()
8
- {
9
- parent::__construct();
10
-
11
- $this->setId('pptrack_tracks_form');
12
- $this->setTitle($this->__('Track Information'));
13
- }
14
-
15
- /**
16
- * Setup form fields for inserts/updates
17
- *
18
- * return Mage_Adminhtml_Block_Widget_Form
19
- */
20
- protected function _prepareForm()
21
- {
22
- $model = Mage::registry('pptrack');
23
-
24
- $form = new Varien_Data_Form(array(
25
- 'id' => 'edit_form',
26
- 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
27
- 'method' => 'post'
28
- ));
29
-
30
- $fieldset = $form->addFieldset('base_fieldset', array(
31
- 'legend' => Mage::helper('checkout')->__('Track Information'),
32
- 'class' => 'fieldset-wide',
33
- ));
34
-
35
- if ($model->getId()) {
36
- $fieldset->addField('id', 'hidden', array(
37
- 'name' => 'id',
38
- ));
39
- }
40
-
41
- $fieldset->addField('email', 'text', array(
42
- 'name' => 'email',
43
- 'label' => Mage::helper('checkout')->__('Email'),
44
- 'title' => Mage::helper('checkout')->__('Email'),
45
- 'required' => false,
46
- ));
47
-
48
- $form->setValues($model->getData());
49
- $form->setUseContainer(true);
50
- $this->setForm($form);
51
-
52
- return parent::_prepareForm();
53
- }
54
  }
1
+ <?php
2
+ class Packpin_Pptrack_Block_Adminhtml_Tracks_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ /**
5
+ * Init class
6
+ */
7
+ public function __construct()
8
+ {
9
+ parent::__construct();
10
+
11
+ $this->setId('pptrack_tracks_form');
12
+ $this->setTitle($this->__('Track Information'));
13
+ }
14
+
15
+ /**
16
+ * Setup form fields for inserts/updates
17
+ *
18
+ * return Mage_Adminhtml_Block_Widget_Form
19
+ */
20
+ protected function _prepareForm()
21
+ {
22
+ $model = Mage::registry('pptrack');
23
+
24
+ $form = new Varien_Data_Form(array(
25
+ 'id' => 'edit_form',
26
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
27
+ 'method' => 'post'
28
+ ));
29
+
30
+ $fieldset = $form->addFieldset('base_fieldset', array(
31
+ 'legend' => Mage::helper('checkout')->__('Track Information'),
32
+ 'class' => 'fieldset-wide',
33
+ ));
34
+
35
+ if ($model->getId()) {
36
+ $fieldset->addField('id', 'hidden', array(
37
+ 'name' => 'id',
38
+ ));
39
+ }
40
+
41
+ $fieldset->addField('email', 'text', array(
42
+ 'name' => 'email',
43
+ 'label' => Mage::helper('checkout')->__('Email'),
44
+ 'title' => Mage::helper('checkout')->__('Email'),
45
+ 'required' => false,
46
+ ));
47
+
48
+ $form->setValues($model->getData());
49
+ $form->setUseContainer(true);
50
+ $this->setForm($form);
51
+
52
+ return parent::_prepareForm();
53
+ }
54
  }
app/code/community/Packpin/Pptrack/Block/Adminhtml/Tracks/Grid.php CHANGED
@@ -1,143 +1,143 @@
1
- <?php
2
- class Packpin_Pptrack_Block_Adminhtml_Tracks_Grid extends Mage_Adminhtml_Block_Widget_Grid
3
- {
4
- public function __construct()
5
- {
6
- parent::__construct();
7
-
8
- $this->setDefaultSort('ship_date');
9
- $this->setId('pptrack_tracks_grid');
10
- $this->setDefaultDir('desc');
11
- $this->setSaveParametersInSession(true);
12
- // $this->setUseAjax(true);
13
- }
14
-
15
- protected function _getCollectionClass()
16
- {
17
- // This is the model we are using for the grid
18
- return 'pptrack/track_collection';
19
- }
20
-
21
- protected function _prepareCollection()
22
- {
23
- // Get and set our collection for the grid
24
- $collection = Mage::getResourceModel($this->_getCollectionClass());
25
- $collection->join(
26
- array('a' => 'sales/order_grid'),
27
- 'main_table.order_id=a.entity_id',
28
- array('shipping_name')
29
- );
30
- $collection->join(
31
- array('b' => 'sales/shipment_track'),
32
- 'main_table.shipment_id=b.entity_id',
33
- array('parent_id', 'created_at')
34
- );
35
-
36
- $this->setCollection($collection);
37
-
38
- return parent::_prepareCollection();
39
- }
40
-
41
- protected function _prepareColumns()
42
- {
43
- $helper = Mage::helper('pptrack');
44
-
45
- // Add the columns that should appear in the grid
46
-
47
- $this->addColumn('code',
48
- array(
49
- 'header'=> $this->__('Tracking Code #'),
50
- 'index' => 'code'
51
- )
52
- );
53
- $this->addColumn('carrier_name',
54
- array(
55
- 'header'=> $this->__('Carrier'),
56
- 'index' => 'carrier_name'
57
- )
58
- );
59
- // $this->addColumn('status',
60
- // array(
61
- // 'header'=> $this->__('Status'),
62
- // 'index' => 'status',
63
- // 'filter_index' => 'main_table.status',
64
- // )
65
- // );
66
- $this->addColumn('created_at', array(
67
- 'header' => $this->__('Created at'),
68
- 'type' => 'datetime',
69
- 'index' => 'created_at',
70
- 'filter_index' => 'b.created_at'
71
- ));
72
- $this->addColumn('order_id',
73
- array(
74
- 'header'=> $this->__('Order #'),
75
- 'index' => 'order_id',
76
- 'filter_index' => 'main_table.order_id',
77
- )
78
- );
79
- $this->addColumn('shipping_name',
80
- array(
81
- 'header'=> $this->__('Ship to name'),
82
- 'index' => 'shipping_name'
83
- )
84
- );
85
-
86
- // $this->addColumn('total_qty', array(
87
- // 'header' => $this->__('Total Qty'),
88
- // 'index' => 'total_qty',
89
- // 'type' => 'number',
90
- // ));
91
-
92
- // $this->addColumn('action',
93
- // array(
94
- // 'header' => Mage::helper('pptrack')->__('Action'),
95
- // 'width' => '50px',
96
- // 'type' => 'action',
97
- // 'getter' => 'getId',
98
- // 'actions' => array(
99
- // array(
100
- // 'caption' => Mage::helper('pptrack')>__('View/Edit'),
101
- // 'url' => array('base'=>'*/*/edit'),
102
- // 'field' => 'id',
103
- // 'data-column' => 'action',
104
- // )
105
- // ),
106
- // 'filter' => false,
107
- // 'sortable' => false,
108
- // 'index' => 'stores',
109
- // 'is_system' => true,
110
- // ));
111
-
112
-
113
- $this->addExportType('*/*/exportTracksCsv', $helper->__('CSV'));
114
- $this->addExportType('*/*/exportTracksExcel', $helper->__('Excel XML'));
115
-
116
- $this->setDefaultSort('created_at');
117
- $this->setDefaultDir('desc');
118
-
119
- return parent::_prepareColumns();
120
- }
121
-
122
- protected function _prepareMassaction()
123
- {
124
- // $this->setMassactionIdField('entity_id');
125
- // $this->getMassactionBlock()->setFormFieldName('order_ids');
126
- // $this->getMassactionBlock()->setUseSelectAll(false);
127
- //
128
- // if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/cancel')) {
129
- // $this->getMassactionBlock()->addItem('cancel_order', array(
130
- // 'label'=> Mage::helper('sales')->__('Cancel'),
131
- // 'url' => $this->getUrl('*/sales_order/massCancel'),
132
- // ));
133
- // }
134
-
135
- return $this;
136
- }
137
-
138
- public function getRowUrl($row)
139
- {
140
- // This is where our row data will link to
141
- return $this->getUrl('*/sales_shipment/view/', array('shipment_id' => $row->getParentId()));
142
- }
143
  }
1
+ <?php
2
+ class Packpin_Pptrack_Block_Adminhtml_Tracks_Grid extends Mage_Adminhtml_Block_Widget_Grid
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+
8
+ $this->setDefaultSort('ship_date');
9
+ $this->setId('pptrack_tracks_grid');
10
+ $this->setDefaultDir('desc');
11
+ $this->setSaveParametersInSession(true);
12
+ // $this->setUseAjax(true);
13
+ }
14
+
15
+ protected function _getCollectionClass()
16
+ {
17
+ // This is the model we are using for the grid
18
+ return 'pptrack/track_collection';
19
+ }
20
+
21
+ protected function _prepareCollection()
22
+ {
23
+ // Get and set our collection for the grid
24
+ $collection = Mage::getResourceModel($this->_getCollectionClass());
25
+ $collection->join(
26
+ array('a' => 'sales/order_grid'),
27
+ 'main_table.order_id=a.entity_id',
28
+ array('shipping_name')
29
+ );
30
+ $collection->join(
31
+ array('b' => 'sales/shipment_track'),
32
+ 'main_table.shipment_id=b.entity_id',
33
+ array('parent_id', 'created_at')
34
+ );
35
+
36
+ $this->setCollection($collection);
37
+
38
+ return parent::_prepareCollection();
39
+ }
40
+
41
+ protected function _prepareColumns()
42
+ {
43
+ $helper = Mage::helper('pptrack');
44
+
45
+ // Add the columns that should appear in the grid
46
+
47
+ $this->addColumn('code',
48
+ array(
49
+ 'header'=> $this->__('Tracking Code #'),
50
+ 'index' => 'code'
51
+ )
52
+ );
53
+ $this->addColumn('carrier_name',
54
+ array(
55
+ 'header'=> $this->__('Carrier'),
56
+ 'index' => 'carrier_name'
57
+ )
58
+ );
59
+ // $this->addColumn('status',
60
+ // array(
61
+ // 'header'=> $this->__('Status'),
62
+ // 'index' => 'status',
63
+ // 'filter_index' => 'main_table.status',
64
+ // )
65
+ // );
66
+ $this->addColumn('created_at', array(
67
+ 'header' => $this->__('Created at'),
68
+ 'type' => 'datetime',
69
+ 'index' => 'created_at',
70
+ 'filter_index' => 'b.created_at'
71
+ ));
72
+ $this->addColumn('order_id',
73
+ array(
74
+ 'header'=> $this->__('Order #'),
75
+ 'index' => 'order_id',
76
+ 'filter_index' => 'main_table.order_id',
77
+ )
78
+ );
79
+ $this->addColumn('shipping_name',
80
+ array(
81
+ 'header'=> $this->__('Ship to name'),
82
+ 'index' => 'shipping_name'
83
+ )
84
+ );
85
+
86
+ // $this->addColumn('total_qty', array(
87
+ // 'header' => $this->__('Total Qty'),
88
+ // 'index' => 'total_qty',
89
+ // 'type' => 'number',
90
+ // ));
91
+
92
+ // $this->addColumn('action',
93
+ // array(
94
+ // 'header' => Mage::helper('pptrack')->__('Action'),
95
+ // 'width' => '50px',
96
+ // 'type' => 'action',
97
+ // 'getter' => 'getId',
98
+ // 'actions' => array(
99
+ // array(
100
+ // 'caption' => Mage::helper('pptrack')>__('View/Edit'),
101
+ // 'url' => array('base'=>'*/*/edit'),
102
+ // 'field' => 'id',
103
+ // 'data-column' => 'action',
104
+ // )
105
+ // ),
106
+ // 'filter' => false,
107
+ // 'sortable' => false,
108
+ // 'index' => 'stores',
109
+ // 'is_system' => true,
110
+ // ));
111
+
112
+
113
+ $this->addExportType('*/*/exportTracksCsv', $helper->__('CSV'));
114
+ $this->addExportType('*/*/exportTracksExcel', $helper->__('Excel XML'));
115
+
116
+ $this->setDefaultSort('created_at');
117
+ $this->setDefaultDir('desc');
118
+
119
+ return parent::_prepareColumns();
120
+ }
121
+
122
+ protected function _prepareMassaction()
123
+ {
124
+ // $this->setMassactionIdField('entity_id');
125
+ // $this->getMassactionBlock()->setFormFieldName('order_ids');
126
+ // $this->getMassactionBlock()->setUseSelectAll(false);
127
+ //
128
+ // if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/cancel')) {
129
+ // $this->getMassactionBlock()->addItem('cancel_order', array(
130
+ // 'label'=> Mage::helper('sales')->__('Cancel'),
131
+ // 'url' => $this->getUrl('*/sales_order/massCancel'),
132
+ // ));
133
+ // }
134
+
135
+ return $this;
136
+ }
137
+
138
+ public function getRowUrl($row)
139
+ {
140
+ // This is where our row data will link to
141
+ return $this->getUrl('*/sales_shipment/view/', array('shipment_id' => $row->getParentId()));
142
+ }
143
  }
app/code/community/Packpin/Pptrack/Block/Ads.php CHANGED
@@ -1,39 +1,39 @@
1
- <?php
2
- class Packpin_Pptrack_Block_Ads extends Mage_Catalog_Block_Product_Abstract
3
- {
4
- public function getImage()
5
- {
6
- $image = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_image');
7
-
8
- if ($image) {
9
- return Mage::getBaseUrl('media') . 'theme' . DIRECTORY_SEPARATOR . $image;
10
- }
11
-
12
- return false;
13
- }
14
-
15
- public function getEmailImage()
16
- {
17
- $image = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email_image');
18
-
19
- if ($image) {
20
- return Mage::getBaseUrl('media') . 'theme' . DIRECTORY_SEPARATOR . $image;
21
- }
22
-
23
- return false;
24
- }
25
-
26
- public function getImageUrl()
27
- {
28
- $url = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_image_url');
29
-
30
- return $url;
31
- }
32
-
33
- public function getEmailImageUrl()
34
- {
35
- $url = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email_image_url');
36
-
37
- return $url;
38
- }
39
  }
1
+ <?php
2
+ class Packpin_Pptrack_Block_Ads extends Mage_Catalog_Block_Product_Abstract
3
+ {
4
+ public function getImage()
5
+ {
6
+ $image = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_image');
7
+
8
+ if ($image) {
9
+ return Mage::getBaseUrl('media') . 'theme' . DIRECTORY_SEPARATOR . $image;
10
+ }
11
+
12
+ return false;
13
+ }
14
+
15
+ public function getEmailImage()
16
+ {
17
+ $image = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email_image');
18
+
19
+ if ($image) {
20
+ return Mage::getBaseUrl('media') . 'theme' . DIRECTORY_SEPARATOR . $image;
21
+ }
22
+
23
+ return false;
24
+ }
25
+
26
+ public function getImageUrl()
27
+ {
28
+ $url = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_image_url');
29
+
30
+ return $url;
31
+ }
32
+
33
+ public function getEmailImageUrl()
34
+ {
35
+ $url = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email_image_url');
36
+
37
+ return $url;
38
+ }
39
  }
app/code/community/Packpin/Pptrack/Block/Crosssell.php CHANGED
@@ -1,26 +1,26 @@
1
- <?php
2
- class Packpin_Pptrack_Block_Crosssell extends Mage_Catalog_Block_Product_Abstract
3
- {
4
- public function getCrossSellingItemsByOrderId($orderId, $limit)
5
- {
6
- $crossSellingItemsArray = array();
7
- $orders = Mage::getModel('sales/order')->load($orderId);
8
- $items = $orders->getAllVisibleItems();
9
-
10
- foreach ($items as $item) {
11
- $product = Mage::getModel('catalog/product')->load($item->getProductId());
12
- $crossSellCollection = $product->getCrossSellProductCollection();
13
- $crossSellCollection->getSelect()->order(new Zend_Db_Expr('RAND()'))->limit($limit);
14
- // $crossSellCollection->setPage(1, 5);
15
- foreach ($crossSellCollection as $crossSellItem) {
16
- $crossSellingItemsArray[] = Mage::getModel('catalog/product')->load($crossSellItem->getId());
17
- //multiple products in 1 order
18
- if (count($crossSellingItemsArray) >= $limit) {
19
- return $crossSellingItemsArray;
20
- }
21
- }
22
- }
23
- return $crossSellingItemsArray;
24
- }
25
-
26
  }
1
+ <?php
2
+ class Packpin_Pptrack_Block_Crosssell extends Mage_Catalog_Block_Product_Abstract
3
+ {
4
+ public function getCrossSellingItemsByOrderId($orderId, $limit)
5
+ {
6
+ $crossSellingItemsArray = array();
7
+ $orders = Mage::getModel('sales/order')->load($orderId);
8
+ $items = $orders->getAllVisibleItems();
9
+
10
+ foreach ($items as $item) {
11
+ $product = Mage::getModel('catalog/product')->load($item->getProductId());
12
+ $crossSellCollection = $product->getCrossSellProductCollection();
13
+ $crossSellCollection->getSelect()->order(new Zend_Db_Expr('RAND()'))->limit($limit);
14
+ // $crossSellCollection->setPage(1, 5);
15
+ foreach ($crossSellCollection as $crossSellItem) {
16
+ $crossSellingItemsArray[] = Mage::getModel('catalog/product')->load($crossSellItem->getId());
17
+ //multiple products in 1 order
18
+ if (count($crossSellingItemsArray) >= $limit) {
19
+ return $crossSellingItemsArray;
20
+ }
21
+ }
22
+ }
23
+ return $crossSellingItemsArray;
24
+ }
25
+
26
  }
app/code/community/Packpin/Pptrack/Block/Index.php CHANGED
@@ -1,175 +1,175 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Block_Index extends Mage_Core_Block_Template
4
- {
5
- public $newTemplate = false;
6
-
7
- public $email = null;
8
- public $orderNumber = null;
9
- public $msg = null;
10
- public $orderId = null;
11
-
12
- // public $model = null;
13
- public $trackModels = array();
14
-
15
- /**
16
- * 1 = we track by order number and client email address
17
- * 2 = we track by carrier / tracking numbers
18
- * @var int
19
- */
20
- public $trackingType = 1;
21
-
22
- public $carrier;
23
- public $trackingNumbers;
24
-
25
- protected function _construct()
26
- {
27
- parent::_construct();
28
-
29
- $model = Mage::getModel('pptrack/track');
30
-
31
- $hash = Mage::app()->getRequest()->getParam('h');
32
- $adminHash = Mage::app()->getRequest()->getParam('hash');
33
- if ($hash) {
34
- $model->loadInfoByHash($hash);
35
- $this->model = $model;
36
- }
37
- elseif ($adminHash) {
38
-
39
- }
40
- else {
41
- $this->newTemplate = true;
42
-
43
- $this->email = Mage::app()->getRequest()->getParam('email');
44
- $this->orderNumber = Mage::app()->getRequest()->getParam('order');
45
- $this->carrier = Mage::app()->getRequest()->getParam('carrier');
46
- $this->trackingNumbers = Mage::app()->getRequest()->getParam('tracking_numbers');
47
- //get track models
48
- if ($this->email && $this->orderNumber) {
49
- $order = Mage::getModel('sales/order')->loadByIncrementId($this->orderNumber);
50
- if (!$order->getId()) {
51
- $this->msg = Mage::helper('pptrack')->__('Order not found');
52
- }
53
- elseif ($order->customer_email != $this->email) {
54
- $this->orderId = $order->getId();
55
-
56
- $this->msg = Mage::helper('pptrack')->__('Incorrect email');
57
- }
58
- else {
59
- $this->orderId = $order->getId();
60
- $tracks = $order->getTracksCollection();
61
- if ($tracks) {
62
- foreach ($tracks as $track) {
63
- $collection = Mage::getModel('pptrack/track')
64
- ->getCollection()
65
- ->addFieldToFilter('shipment_id', array('eq' => $track->getId()));
66
- $trackModel = $collection->getFirstItem();
67
-
68
- if (!$trackModel->getId()) {
69
- try {
70
- $carrierTitle = $track->title ? trim($track->title) : null;
71
- $carrierCode = Mage::getModel('pptrack/carrier')
72
- ->detectCarrier($track->carrier_code, $carrierTitle);
73
-
74
- $trackingCode = $track->track_number ? trim($track->track_number) : trim($track->number);
75
- $addressData = $order->getShippingAddress()->getData();
76
-
77
- $trackModel->setOrderId($order->getId());
78
- $trackModel->setShipmentId($track->getId());
79
- $trackModel->setCode($trackingCode);
80
- $trackModel->setCarrierCode($carrierCode);
81
- $trackModel->setCarrierName($carrierTitle);
82
- $trackModel->setEmail($order->customer_email);
83
-
84
- //tracking attributes
85
- $trackModel->setPostalCode($addressData['postcode']);
86
- $trackModel->setDestinationCountry($addressData['country_id']);
87
-
88
- $trackModel->setStatus(Packpin_Pptrack_Model_Track::STATUS_PENDING);
89
- $trackModel->save();
90
- $trackModel->updateApi();
91
- }
92
- catch (Exception $e) {
93
- continue;
94
- }
95
- }
96
- $trackModel->updateApiData();
97
-
98
- $this->trackModels[] = $trackModel;
99
- }
100
- }
101
-
102
- //log user session
103
- try {
104
- $trackId = $order->getId();
105
- $ip = isset($_SERVER["REMOTE_ADDR"]) ? $_SERVER["REMOTE_ADDR"] : '';
106
- $agent = isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : null;
107
-
108
- $userHash = md5($trackId . $ip . $agent);
109
-
110
- $model = Mage::getModel('pptrack/visit')
111
- ->getCollection()
112
- ->addFieldToFilter('user_hash', array('eq' => $userHash))
113
- ->addFieldToFilter("DATE_ADD(created_at, INTERVAL 1 DAY)", array('gteq' => date("Y-m-d H:i:s")))
114
- ->getFirstItem();
115
- if (!$model->getId()) {
116
- $model->track_id = $trackId;
117
- $model->user_hash = $userHash;
118
- $model->user_ip = $ip;
119
- $model->user_agent = $agent;
120
- $model->save();
121
- }
122
- }
123
- catch (Exception $e) {
124
-
125
- }
126
- }
127
-
128
- /**
129
- * Track by carrier / numbers
130
- */
131
- } elseif ($this->carrier && $this->trackingNumbers) {
132
- $this->trackingType = 2;
133
- // Can provide multiple numbers for same carrier
134
- $numbers = explode(',', $this->trackingNumbers);
135
- $this->trackingNumbers = $numbers;
136
- $this->carrier = strtolower($this->carrier);
137
-
138
- if ($this->trackingNumbers) {
139
- foreach ($this->trackingNumbers as $trackingCode) {
140
- $collection = Mage::getModel('pptrack/track')
141
- ->getCollection()
142
- ->addFieldToFilter('code', array('eq' => $trackingCode))
143
- ->addFieldToFilter('carrier_code', array('eq' => $this->carrier));
144
- $trackModel = $collection->getFirstItem();
145
-
146
- if (!$trackModel->getId()) {
147
- try {
148
- $carrierTitle = $this->carrier;
149
- $carrierCode = Mage::getModel('pptrack/carrier')
150
- ->detectCarrier($this->carrier);
151
-
152
- $trackModel->setOrderId('');
153
- $trackModel->setCode($trackingCode);
154
- $trackModel->setCarrierCode($carrierCode);
155
- $trackModel->setCarrierName($carrierTitle);
156
-
157
- $trackModel->setStatus(Packpin_Pptrack_Model_Track::STATUS_PENDING);
158
- $trackModel->save();
159
- $trackModel->updateApi(true);
160
- }
161
- catch (Exception $e) {
162
- continue;
163
- }
164
- }
165
- $trackModel->updateApiData();
166
-
167
- $this->trackModels[] = $trackModel;
168
- }
169
- }
170
- }
171
- }
172
-
173
- }
174
-
175
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Block_Index extends Mage_Core_Block_Template
4
+ {
5
+ public $newTemplate = false;
6
+
7
+ public $email = null;
8
+ public $orderNumber = null;
9
+ public $msg = null;
10
+ public $orderId = null;
11
+
12
+ // public $model = null;
13
+ public $trackModels = array();
14
+
15
+ /**
16
+ * 1 = we track by order number and client email address
17
+ * 2 = we track by carrier / tracking numbers
18
+ * @var int
19
+ */
20
+ public $trackingType = 1;
21
+
22
+ public $carrier;
23
+ public $trackingNumbers;
24
+
25
+ protected function _construct()
26
+ {
27
+ parent::_construct();
28
+
29
+ $model = Mage::getModel('pptrack/track');
30
+
31
+ $hash = Mage::app()->getRequest()->getParam('h');
32
+ $adminHash = Mage::app()->getRequest()->getParam('hash');
33
+ if ($hash) {
34
+ $model->loadInfoByHash($hash);
35
+ $this->model = $model;
36
+ }
37
+ elseif ($adminHash) {
38
+
39
+ }
40
+ else {
41
+ $this->newTemplate = true;
42
+
43
+ $this->email = Mage::app()->getRequest()->getParam('email');
44
+ $this->orderNumber = Mage::app()->getRequest()->getParam('order');
45
+ $this->carrier = Mage::app()->getRequest()->getParam('carrier');
46
+ $this->trackingNumbers = Mage::app()->getRequest()->getParam('tracking_numbers');
47
+ //get track models
48
+ if ($this->email && $this->orderNumber) {
49
+ $order = Mage::getModel('sales/order')->loadByIncrementId($this->orderNumber);
50
+ if (!$order->getId()) {
51
+ $this->msg = Mage::helper('pptrack')->__('Order not found');
52
+ }
53
+ elseif ($order->customer_email != $this->email) {
54
+ $this->orderId = $order->getId();
55
+
56
+ $this->msg = Mage::helper('pptrack')->__('Incorrect email');
57
+ }
58
+ else {
59
+ $this->orderId = $order->getId();
60
+ $tracks = $order->getTracksCollection();
61
+ if ($tracks) {
62
+ foreach ($tracks as $track) {
63
+ $collection = Mage::getModel('pptrack/track')
64
+ ->getCollection()
65
+ ->addFieldToFilter('shipment_id', array('eq' => $track->getId()));
66
+ $trackModel = $collection->getFirstItem();
67
+
68
+ if (!$trackModel->getId()) {
69
+ try {
70
+ $carrierTitle = $track->title ? trim($track->title) : null;
71
+ $carrierCode = Mage::getModel('pptrack/carrier')
72
+ ->detectCarrier($track->carrier_code, $carrierTitle);
73
+
74
+ $trackingCode = $track->track_number ? trim($track->track_number) : trim($track->number);
75
+ $addressData = $order->getShippingAddress()->getData();
76
+
77
+ $trackModel->setOrderId($order->getId());
78
+ $trackModel->setShipmentId($track->getId());
79
+ $trackModel->setCode($trackingCode);
80
+ $trackModel->setCarrierCode($carrierCode);
81
+ $trackModel->setCarrierName($carrierTitle);
82
+ $trackModel->setEmail($order->customer_email);
83
+
84
+ //tracking attributes
85
+ $trackModel->setPostalCode($addressData['postcode']);
86
+ $trackModel->setDestinationCountry($addressData['country_id']);
87
+
88
+ $trackModel->setStatus(Packpin_Pptrack_Model_Track::STATUS_PENDING);
89
+ $trackModel->save();
90
+ $trackModel->updateApi();
91
+ }
92
+ catch (Exception $e) {
93
+ continue;
94
+ }
95
+ }
96
+ $trackModel->updateApiData();
97
+
98
+ $this->trackModels[] = $trackModel;
99
+ }
100
+ }
101
+
102
+ //log user session
103
+ try {
104
+ $trackId = $order->getId();
105
+ $ip = isset($_SERVER["REMOTE_ADDR"]) ? $_SERVER["REMOTE_ADDR"] : '';
106
+ $agent = isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : null;
107
+
108
+ $userHash = md5($trackId . $ip . $agent);
109
+
110
+ $model = Mage::getModel('pptrack/visit')
111
+ ->getCollection()
112
+ ->addFieldToFilter('user_hash', array('eq' => $userHash))
113
+ ->addFieldToFilter("DATE_ADD(created_at, INTERVAL 1 DAY)", array('gteq' => date("Y-m-d H:i:s")))
114
+ ->getFirstItem();
115
+ if (!$model->getId()) {
116
+ $model->track_id = $trackId;
117
+ $model->user_hash = $userHash;
118
+ $model->user_ip = $ip;
119
+ $model->user_agent = $agent;
120
+ $model->save();
121
+ }
122
+ }
123
+ catch (Exception $e) {
124
+
125
+ }
126
+ }
127
+
128
+ /**
129
+ * Track by carrier / numbers
130
+ */
131
+ } elseif ($this->carrier && $this->trackingNumbers) {
132
+ $this->trackingType = 2;
133
+ // Can provide multiple numbers for same carrier
134
+ $numbers = explode(',', $this->trackingNumbers);
135
+ $this->trackingNumbers = $numbers;
136
+ $this->carrier = strtolower($this->carrier);
137
+
138
+ if ($this->trackingNumbers) {
139
+ foreach ($this->trackingNumbers as $trackingCode) {
140
+ $collection = Mage::getModel('pptrack/track')
141
+ ->getCollection()
142
+ ->addFieldToFilter('code', array('eq' => $trackingCode))
143
+ ->addFieldToFilter('carrier_code', array('eq' => $this->carrier));
144
+ $trackModel = $collection->getFirstItem();
145
+
146
+ if (!$trackModel->getId()) {
147
+ try {
148
+ $carrierTitle = $this->carrier;
149
+ $carrierCode = Mage::getModel('pptrack/carrier')
150
+ ->detectCarrier($this->carrier);
151
+
152
+ $trackModel->setOrderId('');
153
+ $trackModel->setCode($trackingCode);
154
+ $trackModel->setCarrierCode($carrierCode);
155
+ $trackModel->setCarrierName($carrierTitle);
156
+
157
+ $trackModel->setStatus(Packpin_Pptrack_Model_Track::STATUS_PENDING);
158
+ $trackModel->save();
159
+ $trackModel->updateApi(true);
160
+ }
161
+ catch (Exception $e) {
162
+ continue;
163
+ }
164
+ }
165
+ $trackModel->updateApiData();
166
+
167
+ $this->trackModels[] = $trackModel;
168
+ }
169
+ }
170
+ }
171
+ }
172
+
173
+ }
174
+
175
  }
app/code/community/Packpin/Pptrack/Block/Script.php CHANGED
@@ -1,9 +1,9 @@
1
- <?php
2
- class Packpin_Pptrack_Block_Script extends Mage_Catalog_Block_Product_Abstract
3
- {
4
- public function getScript()
5
- {
6
- return Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_script');
7
- }
8
-
9
  }
1
+ <?php
2
+ class Packpin_Pptrack_Block_Script extends Mage_Catalog_Block_Product_Abstract
3
+ {
4
+ public function getScript()
5
+ {
6
+ return Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_script');
7
+ }
8
+
9
  }
app/code/community/Packpin/Pptrack/Block/Trackings.php CHANGED
@@ -1,40 +1,40 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Block_Trackings extends Mage_Core_Block_Template
4
- {
5
-
6
- /**
7
- * @var Packpin_Pptrack_Model_Track
8
- */
9
- protected $_trackModel;
10
-
11
- /**
12
- * Check if Packpin tracks a shipment
13
- *
14
- * @param Mage_Sales_Model_Order_Shipment_Track $track
15
- * @param Mage_Sales_Model_Order $order
16
- * @return bool
17
- */
18
- public function shipmentTracked(Mage_Sales_Model_Order_Shipment_Track $track, Mage_Sales_Model_Order $order)
19
- {
20
- $collection = Mage::getModel('pptrack/track')
21
- ->getCollection()
22
- ->addFieldToFilter('order_id', array('eq' => $order->getId()))
23
- ->addFieldToFilter('shipment_id', array('eq' => $track->getId()));
24
- $this->_trackModel = $collection->getFirstItem();
25
-
26
- if ($this->_trackModel->getId())
27
- return true;
28
-
29
- return false;
30
- }
31
-
32
- /**
33
- * @return Packpin_Pptrack_Model_Track
34
- */
35
- public function getTrackModel()
36
- {
37
- return $this->_trackModel;
38
- }
39
-
40
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Block_Trackings extends Mage_Core_Block_Template
4
+ {
5
+
6
+ /**
7
+ * @var Packpin_Pptrack_Model_Track
8
+ */
9
+ protected $_trackModel;
10
+
11
+ /**
12
+ * Check if Packpin tracks a shipment
13
+ *
14
+ * @param Mage_Sales_Model_Order_Shipment_Track $track
15
+ * @param Mage_Sales_Model_Order $order
16
+ * @return bool
17
+ */
18
+ public function shipmentTracked(Mage_Sales_Model_Order_Shipment_Track $track, Mage_Sales_Model_Order $order)
19
+ {
20
+ $collection = Mage::getModel('pptrack/track')
21
+ ->getCollection()
22
+ ->addFieldToFilter('order_id', array('eq' => $order->getId()))
23
+ ->addFieldToFilter('shipment_id', array('eq' => $track->getId()));
24
+ $this->_trackModel = $collection->getFirstItem();
25
+
26
+ if ($this->_trackModel->getId())
27
+ return true;
28
+
29
+ return false;
30
+ }
31
+
32
+ /**
33
+ * @return Packpin_Pptrack_Model_Track
34
+ */
35
+ public function getTrackModel()
36
+ {
37
+ return $this->_trackModel;
38
+ }
39
+
40
  }
app/code/community/Packpin/Pptrack/Helper/Data.php CHANGED
@@ -1,378 +1,378 @@
1
- <?php
2
-
3
- /**
4
- * Class Packpin_Pptrack_Helper_Data
5
- *
6
- * API calls helpers
7
- * see https://packpin.com/docs for more documentation
8
- */
9
- class Packpin_Pptrack_Helper_Data extends Mage_Core_Helper_Abstract
10
- {
11
- /**
12
- * Backend
13
- */
14
- const API_BACKEND = 'https://api.packpin.com/v2/';
15
-
16
- /**
17
- * Api routes
18
- */
19
- const API_PATH_CARRIERS = 'carriers';
20
- const API_PATH_TRACKINGS = 'trackings';
21
- const API_PATH_RTT = 'rtt';
22
- const API_PATH_TRACKINGS_BATCH = 'trackings/batch';
23
- const API_PATH_TRACKING_INFO = 'trackings/%s/%s';
24
- const API_PATH_CONNECTORS = 'connectors';
25
- const API_PATH_TEST = 'test/1';
26
- const API_PATH_GENERATE_TEMP_KEY = 'genkey';
27
- const API_PATH_PLAN_INFO = 'planinfo';
28
- const API_PATH_EMAIL_COUNT = 'emails/count';
29
-
30
-
31
- const API_ROLE_NAME = 'packpin_connection';
32
-
33
- /**
34
- * Config paths
35
- */
36
- const XML_PATH_API_KEY = 'pp_section_setttings/settings/api_key';
37
-
38
- /**
39
- * Packpin API key
40
- *
41
- * @var string
42
- */
43
- protected $_apiKey;
44
-
45
- /**
46
- * Last API call status code
47
- *
48
- * @var integer
49
- */
50
- protected $_lastStatusCode;
51
-
52
- protected function _getApiKey()
53
- {
54
- if ($this->_apiKey === null) {
55
- $this->_apiKey = Mage::getStoreConfig(self::XML_PATH_API_KEY);
56
- }
57
-
58
- return $this->_apiKey;
59
- }
60
-
61
- /**
62
- * Make API request
63
- *
64
- * @param string $route
65
- * @param string $method
66
- * @param array $body
67
- *
68
- * @return bool|array
69
- */
70
- protected function _apiRequest($route, $method = 'GET', $body = array())
71
- {
72
- $store = Mage::app()->getStore();
73
- $body['plugin_type'] = 'magento';
74
- $body['plugin_version'] = $this->getExtensionVersion();
75
- $body['plugin_shop_version'] = Mage::getVersion();
76
- $body['plugin_user'] = Mage::getStoreConfig('trans_email/ident_general/name');
77
- $body['plugin_email'] = Mage::getStoreConfig('trans_email/ident_general/email');
78
- $body['plugin_url'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
79
-
80
- $url = self::API_BACKEND . $route;
81
-
82
- $ch = curl_init($url);
83
- if ($method == 'POST') {
84
- curl_setopt($ch, CURLOPT_POST, 1);
85
- } elseif ($method == 'PUT') {
86
- curl_setopt($ch, CURLOPT_PUT, true);
87
- } elseif ($method != 'PUT') {
88
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
89
- }
90
- //timeouts
91
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 25);
92
- curl_setopt($ch, CURLOPT_TIMEOUT, 90);
93
-
94
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
95
- curl_setopt($ch, CURLOPT_HEADER, 0);
96
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
97
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
98
- $headers = array(
99
- 'packpin-api-key: ' . $this->_getApiKey(),
100
- 'Content-Type: application/json',
101
- );
102
- if ($body) {
103
- $dataString = json_encode($body);
104
- curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
105
- $headers[] = 'Content-Length: ' . strlen($dataString);
106
- }
107
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
108
-
109
- $response = curl_exec($ch);
110
- $this->_lastStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
111
- curl_close($ch);
112
- unset($ch);
113
-
114
- return $response;
115
- }
116
-
117
- /**
118
- * Get info about single tracking object
119
- *
120
- * @param string $carrierCode
121
- * @param string $trackingCode
122
- *
123
- * @return array
124
- */
125
- public function getTrackingInfo($carrierCode, $trackingCode)
126
- {
127
- $info = array();
128
-
129
- $url = sprintf(self::API_PATH_TRACKING_INFO, $carrierCode, $trackingCode);
130
-
131
- $res = $this->_apiRequest($url, 'GET');
132
- if ($res) {
133
- $info = json_decode($res, true);
134
- }
135
-
136
- return $info;
137
- }
138
-
139
- /**
140
- * Get list of available carriers
141
- *
142
- * @return array
143
- */
144
- public function getCarrierList()
145
- {
146
- $info = array();
147
-
148
- $url = self::API_PATH_CARRIERS;
149
-
150
- $res = $this->_apiRequest($url, 'GET');
151
- if ($res) {
152
- $info = json_decode($res, true);
153
- }
154
-
155
- return $info;
156
- }
157
-
158
- /**
159
- * Add new tracking code
160
- *
161
- * @param string $carrierCode
162
- * @param string $trackingCode
163
- * @param string|null $description
164
- * @param string|null $postalCode
165
- * @param string|null $destinationCountry
166
- * @param string|null $shipDate
167
- * @param integer|null $orderId
168
- * @param bool $waitForResponse
169
- *
170
- * @return array
171
- */
172
- public function addTrackingCode($carrierCode, $trackingCode, $description = null,
173
- $postalCode = null, $destinationCountry = null,
174
- $shipDate = null, $orderId = null, $waitForResponse = false)
175
- {
176
- $info = array();
177
-
178
- if ($waitForResponse === true) {
179
- $url = self::API_PATH_RTT;
180
- } else {
181
- $url = self::API_PATH_TRACKINGS;
182
- }
183
- $body = array(
184
- 'code' => $trackingCode,
185
- 'carrier' => $carrierCode,
186
- 'description' => $description,
187
- 'track_postal_code' => $postalCode,
188
- 'track_ship_date' => $shipDate,
189
- 'track_destination_country' => $destinationCountry,
190
- 'order_id' => $orderId
191
- );
192
-
193
- $res = $this->_apiRequest($url, 'POST', $body);
194
- if ($res) {
195
- $info = json_decode($res, true);
196
- }
197
-
198
- return $info;
199
- }
200
-
201
- public function removeTrackingCode($carrierCode, $trackingCode)
202
- {
203
- $info = array();
204
-
205
- $url = sprintf(self::API_PATH_TRACKING_INFO, $carrierCode, $trackingCode);
206
-
207
- $res = $this->_apiRequest($url, 'DELETE');
208
-
209
- if ($res) {
210
- $info = json_decode($res, true);
211
- } else {
212
- $info = array(
213
- "statusCode" => $this->_lastStatusCode
214
- );
215
- }
216
-
217
- return $info;
218
- }
219
-
220
- public function enableConnector($status = 0)
221
- {
222
- $info = array();
223
-
224
- $url = self::API_PATH_CONNECTORS;
225
- $body = array(
226
- 'path' => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB),
227
- 'enabled' => $status,
228
- );
229
-
230
- $res = $this->_apiRequest($url, 'POST', $body);
231
-
232
- if ($res) {
233
- $info = json_decode($res, true);
234
- }
235
-
236
- if (!$info && preg_match('#SOAP-ERROR#ui', $res, $m)) {
237
- $info = array(
238
- 'statusCode' => 400,
239
- 'body' => array(
240
- 'reason' => 'Could not connect to Magento shop API'
241
- ),
242
- );
243
- }
244
-
245
- return $info;
246
- }
247
-
248
- public function testApiKey()
249
- {
250
- $info = array();
251
-
252
- $url = self::API_PATH_TEST;
253
- $res = $this->_apiRequest($url, 'GET');
254
- if ($res) {
255
- $info = json_decode($res, true);
256
- }
257
-
258
- return $info;
259
- }
260
-
261
- public function createSoapUserAndRole($apiKey)
262
- {
263
-
264
- $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
265
- try {
266
- $connection->beginTransaction();
267
-
268
- $user = Mage::getModel('api/user')->loadByUsername("packpin");
269
- $user->setUsername('packpin')->setFirstname('packpin')->setLastname('packpin')->setEmail('info@packpin.com')->setApiKey($apiKey)->setApiKeyConfirmation($apiKey)->setIsActive(1)->save();
270
-
271
- $role = Mage::getModel('api/roles')->load(self::API_ROLE_NAME, "role_name");
272
- if (!$role->getId()) {
273
- $res = Mage::getModel('api/role')->setParentId('0')->setTreeLevel('1')->setSortOrder('0')->setRoleName(self::API_ROLE_NAME)->setRoleType('G')->save();
274
- $rules = Mage::getModel('api/rules')->setRoleId($res->getRoleId())->setResources(array("pptrack", "pptrack/info", "pptrack/test"));
275
- //for newer magento versions
276
- $rrModel = Mage::getModel('api/resource_rules');
277
- if ($rrModel) {
278
- $rrModel->saveRel($rules);
279
- }
280
- //Mage 1.5
281
- else {
282
- $rules->saveRel();
283
- }
284
-
285
- $role = $res;
286
- }
287
-
288
- $user->setRoleIds(array($role->getId()))
289
- ->setRoleUserId($user->getUserId())
290
- ->saveRelations();
291
-
292
-
293
- ////Stupid hack. Should be fixed properly in the future
294
- $transactionLevel = $connection->getTransactionLevel();
295
- for ($i = 1; $i <= $transactionLevel; $i++) {
296
- $connection->commit();
297
- }
298
-
299
- } catch (Exception $e) {
300
- $connection->rollback();
301
- }
302
-
303
- return true;
304
- }
305
-
306
- public function getExtensionVersion()
307
- {
308
- return (string) Mage::getConfig()->getNode()->modules->Packpin_Pptrack->version;
309
- }
310
-
311
- /**
312
- * Generates temporary API key for fresh plugin install
313
- *
314
- * @return string
315
- */
316
- public function generateTempKey()
317
- {
318
- $url = self::API_PATH_GENERATE_TEMP_KEY;
319
- $body = array(
320
- 'name' => Mage::getStoreConfig('trans_email/ident_general/name'),
321
- 'email' => Mage::getStoreConfig('trans_email/ident_general/email'),
322
- );
323
-
324
- $res = $this->_apiRequest($url, 'POST', $body);
325
- if ($res) {
326
- $info = json_decode($res, true);
327
- if (isset($info['body']['key']))
328
- return $info['body']['key'];
329
- }
330
-
331
- return false;
332
- }
333
-
334
- /**
335
- * Get details about current plan
336
- *
337
- * @return array
338
- */
339
- public function getPlanDetails()
340
- {
341
- $info = array();
342
- $url = self::API_PATH_PLAN_INFO;
343
-
344
- $res = $this->_apiRequest($url, 'GET');
345
- if ($res) {
346
- $info = json_decode($res, true);
347
- }
348
-
349
- return $info;
350
- }
351
-
352
- /**
353
- * Get email sent count for period
354
- *
355
- * @param string $start
356
- * @param string $end
357
- *
358
- * @return array
359
- */
360
- public function getEmailCount($start, $end)
361
- {
362
- $info = array();
363
- $url = self::API_PATH_EMAIL_COUNT;
364
- $body = array(
365
- 'start' => $start,
366
- 'end' => $end,
367
- );
368
-
369
- $res = $this->_apiRequest($url, 'POST', $body);
370
- if ($res) {
371
- $info = json_decode($res, true);
372
- }
373
-
374
- return $info;
375
- }
376
-
377
- }
378
 
1
+ <?php
2
+
3
+ /**
4
+ * Class Packpin_Pptrack_Helper_Data
5
+ *
6
+ * API calls helpers
7
+ * see https://packpin.com/docs for more documentation
8
+ */
9
+ class Packpin_Pptrack_Helper_Data extends Mage_Core_Helper_Abstract
10
+ {
11
+ /**
12
+ * Backend
13
+ */
14
+ const API_BACKEND = 'https://api.packpin.com/v2/';
15
+
16
+ /**
17
+ * Api routes
18
+ */
19
+ const API_PATH_CARRIERS = 'carriers';
20
+ const API_PATH_TRACKINGS = 'trackings';
21
+ const API_PATH_RTT = 'rtt';
22
+ const API_PATH_TRACKINGS_BATCH = 'trackings/batch';
23
+ const API_PATH_TRACKING_INFO = 'trackings/%s/%s';
24
+ const API_PATH_CONNECTORS = 'connectors';
25
+ const API_PATH_TEST = 'test/1';
26
+ const API_PATH_GENERATE_TEMP_KEY = 'genkey';
27
+ const API_PATH_PLAN_INFO = 'planinfo';
28
+ const API_PATH_EMAIL_COUNT = 'emails/count';
29
+
30
+
31
+ const API_ROLE_NAME = 'packpin_connection';
32
+
33
+ /**
34
+ * Config paths
35
+ */
36
+ const XML_PATH_API_KEY = 'pp_section_setttings/settings/api_key';
37
+
38
+ /**
39
+ * Packpin API key
40
+ *
41
+ * @var string
42
+ */
43
+ protected $_apiKey;
44
+
45
+ /**
46
+ * Last API call status code
47
+ *
48
+ * @var integer
49
+ */
50
+ protected $_lastStatusCode;
51
+
52
+ protected function _getApiKey()
53
+ {
54
+ if ($this->_apiKey === null) {
55
+ $this->_apiKey = Mage::getStoreConfig(self::XML_PATH_API_KEY);
56
+ }
57
+
58
+ return $this->_apiKey;
59
+ }
60
+
61
+ /**
62
+ * Make API request
63
+ *
64
+ * @param string $route
65
+ * @param string $method
66
+ * @param array $body
67
+ *
68
+ * @return bool|array
69
+ */
70
+ protected function _apiRequest($route, $method = 'GET', $body = array())
71
+ {
72
+ $store = Mage::app()->getStore();
73
+ $body['plugin_type'] = 'magento';
74
+ $body['plugin_version'] = $this->getExtensionVersion();
75
+ $body['plugin_shop_version'] = Mage::getVersion();
76
+ $body['plugin_user'] = Mage::getStoreConfig('trans_email/ident_general/name');
77
+ $body['plugin_email'] = Mage::getStoreConfig('trans_email/ident_general/email');
78
+ $body['plugin_url'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
79
+
80
+ $url = self::API_BACKEND . $route;
81
+
82
+ $ch = curl_init($url);
83
+ if ($method == 'POST') {
84
+ curl_setopt($ch, CURLOPT_POST, 1);
85
+ } elseif ($method == 'PUT') {
86
+ curl_setopt($ch, CURLOPT_PUT, true);
87
+ } elseif ($method != 'PUT') {
88
+ curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
89
+ }
90
+ //timeouts
91
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 25);
92
+ curl_setopt($ch, CURLOPT_TIMEOUT, 90);
93
+
94
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
95
+ curl_setopt($ch, CURLOPT_HEADER, 0);
96
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
97
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
98
+ $headers = array(
99
+ 'packpin-api-key: ' . $this->_getApiKey(),
100
+ 'Content-Type: application/json',
101
+ );
102
+ if ($body) {
103
+ $dataString = json_encode($body);
104
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
105
+ $headers[] = 'Content-Length: ' . strlen($dataString);
106
+ }
107
+ curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
108
+
109
+ $response = curl_exec($ch);
110
+ $this->_lastStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
111
+ curl_close($ch);
112
+ unset($ch);
113
+
114
+ return $response;
115
+ }
116
+
117
+ /**
118
+ * Get info about single tracking object
119
+ *
120
+ * @param string $carrierCode
121
+ * @param string $trackingCode
122
+ *
123
+ * @return array
124
+ */
125
+ public function getTrackingInfo($carrierCode, $trackingCode)
126
+ {
127
+ $info = array();
128
+
129
+ $url = sprintf(self::API_PATH_TRACKING_INFO, $carrierCode, $trackingCode);
130
+
131
+ $res = $this->_apiRequest($url, 'GET');
132
+ if ($res) {
133
+ $info = json_decode($res, true);
134
+ }
135
+
136
+ return $info;
137
+ }
138
+
139
+ /**
140
+ * Get list of available carriers
141
+ *
142
+ * @return array
143
+ */
144
+ public function getCarrierList()
145
+ {
146
+ $info = array();
147
+
148
+ $url = self::API_PATH_CARRIERS;
149
+
150
+ $res = $this->_apiRequest($url, 'GET');
151
+ if ($res) {
152
+ $info = json_decode($res, true);
153
+ }
154
+
155
+ return $info;
156
+ }
157
+
158
+ /**
159
+ * Add new tracking code
160
+ *
161
+ * @param string $carrierCode
162
+ * @param string $trackingCode
163
+ * @param string|null $description
164
+ * @param string|null $postalCode
165
+ * @param string|null $destinationCountry
166
+ * @param string|null $shipDate
167
+ * @param integer|null $orderId
168
+ * @param bool $waitForResponse
169
+ *
170
+ * @return array
171
+ */
172
+ public function addTrackingCode($carrierCode, $trackingCode, $description = null,
173
+ $postalCode = null, $destinationCountry = null,
174
+ $shipDate = null, $orderId = null, $waitForResponse = false)
175
+ {
176
+ $info = array();
177
+
178
+ if ($waitForResponse === true) {
179
+ $url = self::API_PATH_RTT;
180
+ } else {
181
+ $url = self::API_PATH_TRACKINGS;
182
+ }
183
+ $body = array(
184
+ 'code' => $trackingCode,
185
+ 'carrier' => $carrierCode,
186
+ 'description' => $description,
187
+ 'track_postal_code' => $postalCode,
188
+ 'track_ship_date' => $shipDate,
189
+ 'track_destination_country' => $destinationCountry,
190
+ 'order_id' => $orderId
191
+ );
192
+
193
+ $res = $this->_apiRequest($url, 'POST', $body);
194
+ if ($res) {
195
+ $info = json_decode($res, true);
196
+ }
197
+
198
+ return $info;
199
+ }
200
+
201
+ public function removeTrackingCode($carrierCode, $trackingCode)
202
+ {
203
+ $info = array();
204
+
205
+ $url = sprintf(self::API_PATH_TRACKING_INFO, $carrierCode, $trackingCode);
206
+
207
+ $res = $this->_apiRequest($url, 'DELETE');
208
+
209
+ if ($res) {
210
+ $info = json_decode($res, true);
211
+ } else {
212
+ $info = array(
213
+ "statusCode" => $this->_lastStatusCode
214
+ );
215
+ }
216
+
217
+ return $info;
218
+ }
219
+
220
+ public function enableConnector($status = 0)
221
+ {
222
+ $info = array();
223
+
224
+ $url = self::API_PATH_CONNECTORS;
225
+ $body = array(
226
+ 'path' => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB),
227
+ 'enabled' => $status,
228
+ );
229
+
230
+ $res = $this->_apiRequest($url, 'POST', $body);
231
+
232
+ if ($res) {
233
+ $info = json_decode($res, true);
234
+ }
235
+
236
+ if (!$info && preg_match('#SOAP-ERROR#ui', $res, $m)) {
237
+ $info = array(
238
+ 'statusCode' => 400,
239
+ 'body' => array(
240
+ 'reason' => 'Could not connect to Magento shop API'
241
+ ),
242
+ );
243
+ }
244
+
245
+ return $info;
246
+ }
247
+
248
+ public function testApiKey()
249
+ {
250
+ $info = array();
251
+
252
+ $url = self::API_PATH_TEST;
253
+ $res = $this->_apiRequest($url, 'GET');
254
+ if ($res) {
255
+ $info = json_decode($res, true);
256
+ }
257
+
258
+ return $info;
259
+ }
260
+
261
+ public function createSoapUserAndRole($apiKey)
262
+ {
263
+
264
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
265
+ try {
266
+ $connection->beginTransaction();
267
+
268
+ $user = Mage::getModel('api/user')->loadByUsername("packpin");
269
+ $user->setUsername('packpin')->setFirstname('packpin')->setLastname('packpin')->setEmail('info@packpin.com')->setApiKey($apiKey)->setApiKeyConfirmation($apiKey)->setIsActive(1)->save();
270
+
271
+ $role = Mage::getModel('api/roles')->load(self::API_ROLE_NAME, "role_name");
272
+ if (!$role->getId()) {
273
+ $res = Mage::getModel('api/role')->setParentId('0')->setTreeLevel('1')->setSortOrder('0')->setRoleName(self::API_ROLE_NAME)->setRoleType('G')->save();
274
+ $rules = Mage::getModel('api/rules')->setRoleId($res->getRoleId())->setResources(array("pptrack", "pptrack/info", "pptrack/test"));
275
+ //for newer magento versions
276
+ $rrModel = Mage::getModel('api/resource_rules');
277
+ if ($rrModel) {
278
+ $rrModel->saveRel($rules);
279
+ }
280
+ //Mage 1.5
281
+ else {
282
+ $rules->saveRel();
283
+ }
284
+
285
+ $role = $res;
286
+ }
287
+
288
+ $user->setRoleIds(array($role->getId()))
289
+ ->setRoleUserId($user->getUserId())
290
+ ->saveRelations();
291
+
292
+
293
+ ////Stupid hack. Should be fixed properly in the future
294
+ $transactionLevel = $connection->getTransactionLevel();
295
+ for ($i = 1; $i <= $transactionLevel; $i++) {
296
+ $connection->commit();
297
+ }
298
+
299
+ } catch (Exception $e) {
300
+ $connection->rollback();
301
+ }
302
+
303
+ return true;
304
+ }
305
+
306
+ public function getExtensionVersion()
307
+ {
308
+ return (string) Mage::getConfig()->getNode()->modules->Packpin_Pptrack->version;
309
+ }
310
+
311
+ /**
312
+ * Generates temporary API key for fresh plugin install
313
+ *
314
+ * @return string
315
+ */
316
+ public function generateTempKey()
317
+ {
318
+ $url = self::API_PATH_GENERATE_TEMP_KEY;
319
+ $body = array(
320
+ 'name' => Mage::getStoreConfig('trans_email/ident_general/name'),
321
+ 'email' => Mage::getStoreConfig('trans_email/ident_general/email'),
322
+ );
323
+
324
+ $res = $this->_apiRequest($url, 'POST', $body);
325
+ if ($res) {
326
+ $info = json_decode($res, true);
327
+ if (isset($info['body']['key']))
328
+ return $info['body']['key'];
329
+ }
330
+
331
+ return false;
332
+ }
333
+
334
+ /**
335
+ * Get details about current plan
336
+ *
337
+ * @return array
338
+ */
339
+ public function getPlanDetails()
340
+ {
341
+ $info = array();
342
+ $url = self::API_PATH_PLAN_INFO;
343
+
344
+ $res = $this->_apiRequest($url, 'GET');
345
+ if ($res) {
346
+ $info = json_decode($res, true);
347
+ }
348
+
349
+ return $info;
350
+ }
351
+
352
+ /**
353
+ * Get email sent count for period
354
+ *
355
+ * @param string $start
356
+ * @param string $end
357
+ *
358
+ * @return array
359
+ */
360
+ public function getEmailCount($start, $end)
361
+ {
362
+ $info = array();
363
+ $url = self::API_PATH_EMAIL_COUNT;
364
+ $body = array(
365
+ 'start' => $start,
366
+ 'end' => $end,
367
+ );
368
+
369
+ $res = $this->_apiRequest($url, 'POST', $body);
370
+ if ($res) {
371
+ $info = json_decode($res, true);
372
+ }
373
+
374
+ return $info;
375
+ }
376
+
377
+ }
378
 
app/code/community/Packpin/Pptrack/Model/Adminhtml/System/Config/Source/Crossviews.php CHANGED
@@ -1,14 +1,14 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Crossviews
4
- {
5
- public function toOptionArray()
6
- {
7
- $options = array(
8
- array('value' => 'products', 'label' => 'Assigned cross-sell products'),
9
- array('value' => 'ads', 'label' => 'Ads banner'),
10
- );
11
-
12
- return $options;
13
- }
14
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Crossviews
4
+ {
5
+ public function toOptionArray()
6
+ {
7
+ $options = array(
8
+ array('value' => 'products', 'label' => 'Assigned cross-sell products'),
9
+ array('value' => 'ads', 'label' => 'Ads banner'),
10
+ );
11
+
12
+ return $options;
13
+ }
14
  }
app/code/community/Packpin/Pptrack/Model/Adminhtml/System/Config/Source/Crossviewspage.php CHANGED
@@ -1,15 +1,15 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Crossviewspage
4
- {
5
- public function toOptionArray()
6
- {
7
- $options = array(
8
- array('value' => 'products', 'label' => 'Assigned cross-sell products'),
9
- array('value' => 'ads', 'label' => 'Ads banner'),
10
- array('value' => 'script', 'label' => 'Custom script'),
11
- );
12
-
13
- return $options;
14
- }
15
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Crossviewspage
4
+ {
5
+ public function toOptionArray()
6
+ {
7
+ $options = array(
8
+ array('value' => 'products', 'label' => 'Assigned cross-sell products'),
9
+ array('value' => 'ads', 'label' => 'Ads banner'),
10
+ array('value' => 'script', 'label' => 'Custom script'),
11
+ );
12
+
13
+ return $options;
14
+ }
15
  }
app/code/community/Packpin/Pptrack/Model/Adminhtml/System/Config/Source/Templateimage.php CHANGED
@@ -1,14 +1,14 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Templateimage
4
- {
5
- public function toOptionArray()
6
- {
7
- $options = array(
8
- array('value' => 'default', 'label' => 'Default template image'),
9
- array('value' => 'custom', 'label' => 'Custom image'),
10
- );
11
-
12
- return $options;
13
- }
14
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Templateimage
4
+ {
5
+ public function toOptionArray()
6
+ {
7
+ $options = array(
8
+ array('value' => 'default', 'label' => 'Default template image'),
9
+ array('value' => 'custom', 'label' => 'Custom image'),
10
+ );
11
+
12
+ return $options;
13
+ }
14
  }
app/code/community/Packpin/Pptrack/Model/Adminhtml/System/Config/Source/Templatetype.php CHANGED
@@ -1,14 +1,14 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Templatetype
4
- {
5
- public function toOptionArray()
6
- {
7
- $options = array(
8
- array('value' => 'v1', 'label' => 'Template 1'),
9
- array('value' => 'v2', 'label' => 'Template 2'),
10
- );
11
-
12
- return $options;
13
- }
14
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Templatetype
4
+ {
5
+ public function toOptionArray()
6
+ {
7
+ $options = array(
8
+ array('value' => 'v1', 'label' => 'Template 1'),
9
+ array('value' => 'v2', 'label' => 'Template 2'),
10
+ );
11
+
12
+ return $options;
13
+ }
14
  }
app/code/community/Packpin/Pptrack/Model/Api.php CHANGED
@@ -1,138 +1,138 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Model_Api extends Mage_Api_Model_Resource_Abstract
4
- {
5
-
6
- const ERROR_EXTENSION_DISABLED = 'extension_disabled';
7
- const ERROR_NOTIFICATIONS_DISABLED = 'notifications_disabled';
8
- const ERROR_NO_TEMPLATE = 'no_template';
9
-
10
- const DEFAULT_LOCALE = 'en_US';
11
-
12
- /**
13
- * Get email info
14
- *
15
- * @param string $carrierCode
16
- * @param string $trackingCode
17
- *
18
- * @return array
19
- */
20
- public function info($carrierCode, $trackingCode, $status)
21
- {
22
- //extension disabled
23
- $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
24
- if (!$enabled)
25
- return array(
26
- 'error' => self::ERROR_EXTENSION_DISABLED
27
- );
28
-
29
- //notifications disabled
30
- $enabled = Mage::getStoreConfig('pp_section_setttings/settings/pp_enable_notifications');
31
- if (!$enabled)
32
- return false;
33
-
34
- $trackModel = Mage::getModel('pptrack/track')
35
- ->loadByCarrierAndCode($carrierCode, $trackingCode);
36
-
37
- //maybe changed to custom by some API's (for older versions)
38
- if (!$trackModel->getId()) {
39
- $trackModel = Mage::getModel('pptrack/track')
40
- ->loadByCarrierAndCode('custom', $trackingCode);
41
- }
42
-
43
- if ($trackModel->getId()) {
44
- $order = Mage::getModel('sales/order')->load($trackModel->getOrderId());
45
- $store = $order->getStore();
46
- $storeId = $store->getId();
47
-
48
- $templateSettings = Mage::getStoreConfig('pp_section_notification_emails/' . $status, $storeId);
49
- if (!$templateSettings || (!$templateSettings['enabled_owner'] && !$templateSettings['enabled_client']))
50
- return self::ERROR_NOTIFICATIONS_DISABLED;
51
-
52
- $data = array();
53
-
54
- //sender data
55
- $data['sender_name'] = Mage::getStoreConfig('trans_email/ident_'. $templateSettings['identity'] .'/name');
56
- $data['sender_email'] = Mage::getStoreConfig('trans_email/ident_'. $templateSettings['identity'] .'/email');
57
-
58
- //shop data
59
- if ($templateSettings['enabled_owner']) {
60
- $data['owner_name'] = Mage::getStoreConfig('trans_email/ident_general/name');
61
- $data['owner_email'] = Mage::getStoreConfig('trans_email/ident_general/email');
62
- }
63
-
64
- //client data
65
- //check if client unsubscribed
66
- try {
67
- $unsubscribed = Mage::getModel('pptrack/trackunsubscribed')
68
- ->load($trackModel->getId(), 'track_id');
69
- }
70
- catch (Exception $e) {
71
- $unsubscribed = Mage::getModel('pptrack/trackunsubscribed');
72
- }
73
-
74
- if (!$unsubscribed->getId() && $templateSettings['enabled_client']) {
75
- $data['client_name'] = $order->getCustomerName();
76
- $data['client_email'] = $order->getCustomerEmail();
77
- }
78
-
79
- //email template data
80
- $templateId = $templateSettings['template'];
81
-
82
- Mage::getDesign()->setStore($store);
83
- $emailTemplate = Mage::getModel('core/email_template');
84
- $emailTemplate->emulateDesign($storeId);
85
- if (is_numeric($templateId)) {
86
- $emailTemplate->load($templateId);
87
- } else {
88
- $templateId = 'packpin_'. $status .'_email';
89
-
90
- // $storeId = $order->getStore()->getId();
91
- // $localeCode = Mage::getStoreConfig('general/locale/code', $storeId);
92
- $localeCode = self::DEFAULT_LOCALE;
93
-
94
- $emailTemplate->loadDefault($templateId, $localeCode);
95
- }
96
-
97
- $crossSell = '';
98
- $banner = '';
99
- if (Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email')) {
100
- if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email_type'), array('ads'))) {
101
- $banner = Mage::app()->getLayout()->createBlock('pptrack/ads')->setTemplate('pptrack/ads_email.phtml')->toHtml();
102
- }
103
- else {
104
- $crossSell = Mage::app()->getLayout()->createBlock('pptrack/crosssell')->setData(array('orderId' => $trackModel->getOrderId()))->setTemplate('pptrack/crosssell_email.phtml')->toHtml();
105
- }
106
- }
107
-
108
- $variables = array(
109
- 'email' => $order->getCustomerEmail(),
110
- 'track' => $trackModel,
111
- 'crossSell' => $crossSell,
112
- 'banner' => $banner,
113
- );
114
-
115
- $processedTemplate = $emailTemplate->getProcessedTemplate($variables);
116
- if (!$processedTemplate)
117
- return array(
118
- 'error' => self::ERROR_NO_TEMPLATE
119
- );
120
-
121
-
122
- $data['email_subject'] = $emailTemplate->getProcessedTemplateSubject($variables);
123
- $data['email_body'] = $processedTemplate;
124
-
125
- return $data;
126
- }
127
-
128
- return false;
129
- }
130
-
131
- public function test()
132
- {
133
- return array(
134
- 'status' => 1
135
- );
136
- }
137
-
138
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Model_Api extends Mage_Api_Model_Resource_Abstract
4
+ {
5
+
6
+ const ERROR_EXTENSION_DISABLED = 'extension_disabled';
7
+ const ERROR_NOTIFICATIONS_DISABLED = 'notifications_disabled';
8
+ const ERROR_NO_TEMPLATE = 'no_template';
9
+
10
+ const DEFAULT_LOCALE = 'en_US';
11
+
12
+ /**
13
+ * Get email info
14
+ *
15
+ * @param string $carrierCode
16
+ * @param string $trackingCode
17
+ *
18
+ * @return array
19
+ */
20
+ public function info($carrierCode, $trackingCode, $status)
21
+ {
22
+ //extension disabled
23
+ $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
24
+ if (!$enabled)
25
+ return array(
26
+ 'error' => self::ERROR_EXTENSION_DISABLED
27
+ );
28
+
29
+ //notifications disabled
30
+ $enabled = Mage::getStoreConfig('pp_section_setttings/settings/pp_enable_notifications');
31
+ if (!$enabled)
32
+ return false;
33
+
34
+ $trackModel = Mage::getModel('pptrack/track')
35
+ ->loadByCarrierAndCode($carrierCode, $trackingCode);
36
+
37
+ //maybe changed to custom by some API's (for older versions)
38
+ if (!$trackModel->getId()) {
39
+ $trackModel = Mage::getModel('pptrack/track')
40
+ ->loadByCarrierAndCode('custom', $trackingCode);
41
+ }
42
+
43
+ if ($trackModel->getId()) {
44
+ $order = Mage::getModel('sales/order')->load($trackModel->getOrderId());
45
+ $store = $order->getStore();
46
+ $storeId = $store->getId();
47
+
48
+ $templateSettings = Mage::getStoreConfig('pp_section_notification_emails/' . $status, $storeId);
49
+ if (!$templateSettings || (!$templateSettings['enabled_owner'] && !$templateSettings['enabled_client']))
50
+ return self::ERROR_NOTIFICATIONS_DISABLED;
51
+
52
+ $data = array();
53
+
54
+ //sender data
55
+ $data['sender_name'] = Mage::getStoreConfig('trans_email/ident_'. $templateSettings['identity'] .'/name');
56
+ $data['sender_email'] = Mage::getStoreConfig('trans_email/ident_'. $templateSettings['identity'] .'/email');
57
+
58
+ //shop data
59
+ if ($templateSettings['enabled_owner']) {
60
+ $data['owner_name'] = Mage::getStoreConfig('trans_email/ident_general/name');
61
+ $data['owner_email'] = Mage::getStoreConfig('trans_email/ident_general/email');
62
+ }
63
+
64
+ //client data
65
+ //check if client unsubscribed
66
+ try {
67
+ $unsubscribed = Mage::getModel('pptrack/trackunsubscribed')
68
+ ->load($trackModel->getId(), 'track_id');
69
+ }
70
+ catch (Exception $e) {
71
+ $unsubscribed = Mage::getModel('pptrack/trackunsubscribed');
72
+ }
73
+
74
+ if (!$unsubscribed->getId() && $templateSettings['enabled_client']) {
75
+ $data['client_name'] = $order->getCustomerName();
76
+ $data['client_email'] = $order->getCustomerEmail();
77
+ }
78
+
79
+ //email template data
80
+ $templateId = $templateSettings['template'];
81
+
82
+ Mage::getDesign()->setStore($store);
83
+ $emailTemplate = Mage::getModel('core/email_template');
84
+ $emailTemplate->emulateDesign($storeId);
85
+ if (is_numeric($templateId)) {
86
+ $emailTemplate->load($templateId);
87
+ } else {
88
+ $templateId = 'packpin_'. $status .'_email';
89
+
90
+ // $storeId = $order->getStore()->getId();
91
+ // $localeCode = Mage::getStoreConfig('general/locale/code', $storeId);
92
+ $localeCode = self::DEFAULT_LOCALE;
93
+
94
+ $emailTemplate->loadDefault($templateId, $localeCode);
95
+ }
96
+
97
+ $crossSell = '';
98
+ $banner = '';
99
+ if (Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email')) {
100
+ if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email_type'), array('ads'))) {
101
+ $banner = Mage::app()->getLayout()->createBlock('pptrack/ads')->setTemplate('pptrack/ads_email.phtml')->toHtml();
102
+ }
103
+ else {
104
+ $crossSell = Mage::app()->getLayout()->createBlock('pptrack/crosssell')->setData(array('orderId' => $trackModel->getOrderId()))->setTemplate('pptrack/crosssell_email.phtml')->toHtml();
105
+ }
106
+ }
107
+
108
+ $variables = array(
109
+ 'email' => $order->getCustomerEmail(),
110
+ 'track' => $trackModel,
111
+ 'crossSell' => $crossSell,
112
+ 'banner' => $banner,
113
+ );
114
+
115
+ $processedTemplate = $emailTemplate->getProcessedTemplate($variables);
116
+ if (!$processedTemplate)
117
+ return array(
118
+ 'error' => self::ERROR_NO_TEMPLATE
119
+ );
120
+
121
+
122
+ $data['email_subject'] = $emailTemplate->getProcessedTemplateSubject($variables);
123
+ $data['email_body'] = $processedTemplate;
124
+
125
+ return $data;
126
+ }
127
+
128
+ return false;
129
+ }
130
+
131
+ public function test()
132
+ {
133
+ return array(
134
+ 'status' => 1
135
+ );
136
+ }
137
+
138
  }
app/code/community/Packpin/Pptrack/Model/Carrier.php CHANGED
@@ -1,177 +1,177 @@
1
- <?php
2
-
3
- /**
4
- * Class Packpin_Pptrack_Model_Carrier
5
- *
6
- * Model for pp_carriers table
7
- */
8
- class Packpin_Pptrack_Model_Carrier extends Mage_Core_Model_Abstract
9
- {
10
- /**
11
- * Update once per day
12
- */
13
- const API_UPDATE_INTERVAL = 86400;
14
-
15
- /**
16
- * Append carrier code with prefix to prevent conflicts
17
- */
18
- const CODE_PREFIX = 'pp_';
19
-
20
- const URL_ICONS = 'https://button.packpin.com/assets/images/carriers_v2/';
21
-
22
- public $assocList = array();
23
-
24
- protected function _construct()
25
- {
26
- $this->_init('pptrack/carrier');
27
- }
28
-
29
- /**
30
- * Get carrier list if needed - update from API
31
- * @param bool $fetchAll
32
- * @return array
33
- */
34
- public function getList($fetchAll = false)
35
- {
36
- $collection = Mage::getModel('pptrack/carrier')
37
- ->getCollection();
38
-
39
- if (!$fetchAll)
40
- $collection->addFieldToFilter('enabled', array('eq' => 1));
41
-
42
- $carriers = $collection->getItems();
43
-
44
- //check last updated
45
- $config = Mage::getStoreConfig('pp_section_setttings/settings');
46
- $updated = isset($config['last_carrier_update']) ? $config['last_carrier_update'] : null;
47
-
48
- //try to get info from API
49
- if (!$carriers || !$updated || $updated + self::API_UPDATE_INTERVAL < time()) {
50
- $helper = Mage::helper('pptrack');
51
- $res = $helper->getCarrierList();
52
- if ($res && $res["statusCode"] == 200) {
53
- $list = $res["body"];
54
-
55
- if (is_array($list)) {
56
- $newList = array();
57
-
58
- //prepare old list data for updates
59
- $oldList = array();
60
- foreach ($carriers as $item) {
61
- $oldList[$item->code] = $item;
62
- }
63
-
64
- foreach ($list as $item) {
65
- $model = Mage::getModel('pptrack/carrier')
66
- ->load($item['code'], 'code');
67
-
68
- if ($model->getId()) {
69
- if (isset($oldList[$item['code']]))
70
- unset($oldList[$item['code']]);
71
- }
72
- else {
73
- $model->enabled = 1;
74
- }
75
-
76
- $model->code = $item['code'];
77
- $model->name = $item['name'];
78
- $model->phone = $item['phone'];
79
- $model->homepage = $item['homepage'];
80
-
81
- $model->save();
82
-
83
- if ($fetchAll || $model->enabled)
84
- $newList[] = $model;
85
- }
86
-
87
- //remove old no longer supported carriers.. should never happen o_0
88
- foreach ($oldList as $model) {
89
- $model->delete();
90
- }
91
-
92
- //update config
93
- Mage::getModel('core/config')->saveConfig('pp_section_setttings/settings/last_carrier_update', time());
94
-
95
- $carriers = $newList;
96
- }
97
- }
98
- }
99
-
100
- return $carriers;
101
- }
102
-
103
- /**
104
- * Get list of carriers with carrier code as key
105
- *
106
- * @param bool $fetchAll
107
- * @return array
108
- */
109
- public function getAssocList($fetchAll = false)
110
- {
111
- if (!$this->assocList) {
112
- $this->assocList = array();
113
- $list = $this->getList($fetchAll);
114
-
115
- foreach ($list as $item) {
116
- $this->assocList[$item->getCode()] = $item->getData('name');
117
- }
118
- }
119
-
120
- return $this->assocList;
121
- }
122
-
123
- /**
124
- * Get carrier code with prefix
125
- *
126
- * @return string
127
- */
128
- public function getPrefixedCode()
129
- {
130
- return self::CODE_PREFIX . $this->getCode();
131
- }
132
-
133
- public function getIconUrl()
134
- {
135
- return self::URL_ICONS . $this->getCode() . '.png';
136
- }
137
-
138
- /**
139
- * Get carrier code from pp_carriers string on detect from custom carrier title
140
- *
141
- * @param string $carrierCode
142
- * @param string|null $carrierTitle
143
- * @return bool|string
144
- */
145
- public function detectCarrier($carrierCode, $carrierTitle = null)
146
- {
147
- $carrierList = $this->getAssocList();
148
-
149
- $carrierCode = str_replace(Packpin_Pptrack_Model_Carrier::CODE_PREFIX, '', $carrierCode);
150
- $carrierCode2 = str_replace(Packpin_Pptrack_Model_Carrier::CODE_PREFIX, '', $carrierTitle);
151
-
152
- if (isset($carrierList[$carrierCode])) {
153
- return $carrierCode;
154
- } elseif (isset($carrierList[$carrierCode2])) {
155
- return $carrierCode2;
156
- } elseif (isset($carrierList[$carrierTitle])) {
157
- return $carrierTitle;
158
- }
159
-
160
- //try to identify by custom carrier code
161
- $regStr = implode('|', array_keys($carrierList));
162
- if (preg_match("#$regStr#ui", $carrierCode, $m)) {
163
- return $m[0];
164
- }
165
-
166
- //try to identify by carrier title
167
- if ($carrierTitle) {
168
- foreach ($carrierList as $code => $title) {
169
- if (stripos($carrierTitle, $title) !== false) {
170
- return $code;
171
- }
172
- }
173
- }
174
-
175
- return false;
176
- }
177
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class Packpin_Pptrack_Model_Carrier
5
+ *
6
+ * Model for pp_carriers table
7
+ */
8
+ class Packpin_Pptrack_Model_Carrier extends Mage_Core_Model_Abstract
9
+ {
10
+ /**
11
+ * Update once per day
12
+ */
13
+ const API_UPDATE_INTERVAL = 86400;
14
+
15
+ /**
16
+ * Append carrier code with prefix to prevent conflicts
17
+ */
18
+ const CODE_PREFIX = 'pp_';
19
+
20
+ const URL_ICONS = 'https://button.packpin.com/assets/images/carriers_v2/';
21
+
22
+ public $assocList = array();
23
+
24
+ protected function _construct()
25
+ {
26
+ $this->_init('pptrack/carrier');
27
+ }
28
+
29
+ /**
30
+ * Get carrier list if needed - update from API
31
+ * @param bool $fetchAll
32
+ * @return array
33
+ */
34
+ public function getList($fetchAll = false)
35
+ {
36
+ $collection = Mage::getModel('pptrack/carrier')
37
+ ->getCollection();
38
+
39
+ if (!$fetchAll)
40
+ $collection->addFieldToFilter('enabled', array('eq' => 1));
41
+
42
+ $carriers = $collection->getItems();
43
+
44
+ //check last updated
45
+ $config = Mage::getStoreConfig('pp_section_setttings/settings');
46
+ $updated = isset($config['last_carrier_update']) ? $config['last_carrier_update'] : null;
47
+
48
+ //try to get info from API
49
+ if (!$carriers || !$updated || $updated + self::API_UPDATE_INTERVAL < time()) {
50
+ $helper = Mage::helper('pptrack');
51
+ $res = $helper->getCarrierList();
52
+ if ($res && $res["statusCode"] == 200) {
53
+ $list = $res["body"];
54
+
55
+ if (is_array($list)) {
56
+ $newList = array();
57
+
58
+ //prepare old list data for updates
59
+ $oldList = array();
60
+ foreach ($carriers as $item) {
61
+ $oldList[$item->code] = $item;
62
+ }
63
+
64
+ foreach ($list as $item) {
65
+ $model = Mage::getModel('pptrack/carrier')
66
+ ->load($item['code'], 'code');
67
+
68
+ if ($model->getId()) {
69
+ if (isset($oldList[$item['code']]))
70
+ unset($oldList[$item['code']]);
71
+ }
72
+ else {
73
+ $model->enabled = 1;
74
+ }
75
+
76
+ $model->code = $item['code'];
77
+ $model->name = $item['name'];
78
+ $model->phone = $item['phone'];
79
+ $model->homepage = $item['homepage'];
80
+
81
+ $model->save();
82
+
83
+ if ($fetchAll || $model->enabled)
84
+ $newList[] = $model;
85
+ }
86
+
87
+ //remove old no longer supported carriers.. should never happen o_0
88
+ foreach ($oldList as $model) {
89
+ $model->delete();
90
+ }
91
+
92
+ //update config
93
+ Mage::getModel('core/config')->saveConfig('pp_section_setttings/settings/last_carrier_update', time());
94
+
95
+ $carriers = $newList;
96
+ }
97
+ }
98
+ }
99
+
100
+ return $carriers;
101
+ }
102
+
103
+ /**
104
+ * Get list of carriers with carrier code as key
105
+ *
106
+ * @param bool $fetchAll
107
+ * @return array
108
+ */
109
+ public function getAssocList($fetchAll = false)
110
+ {
111
+ if (!$this->assocList) {
112
+ $this->assocList = array();
113
+ $list = $this->getList($fetchAll);
114
+
115
+ foreach ($list as $item) {
116
+ $this->assocList[$item->getCode()] = $item->getData('name');
117
+ }
118
+ }
119
+
120
+ return $this->assocList;
121
+ }
122
+
123
+ /**
124
+ * Get carrier code with prefix
125
+ *
126
+ * @return string
127
+ */
128
+ public function getPrefixedCode()
129
+ {
130
+ return self::CODE_PREFIX . $this->getCode();
131
+ }
132
+
133
+ public function getIconUrl()
134
+ {
135
+ return self::URL_ICONS . $this->getCode() . '.png';
136
+ }
137
+
138
+ /**
139
+ * Get carrier code from pp_carriers string on detect from custom carrier title
140
+ *
141
+ * @param string $carrierCode
142
+ * @param string|null $carrierTitle
143
+ * @return bool|string
144
+ */
145
+ public function detectCarrier($carrierCode, $carrierTitle = null)
146
+ {
147
+ $carrierList = $this->getAssocList();
148
+
149
+ $carrierCode = str_replace(Packpin_Pptrack_Model_Carrier::CODE_PREFIX, '', $carrierCode);
150
+ $carrierCode2 = str_replace(Packpin_Pptrack_Model_Carrier::CODE_PREFIX, '', $carrierTitle);
151
+
152
+ if (isset($carrierList[$carrierCode])) {
153
+ return $carrierCode;
154
+ } elseif (isset($carrierList[$carrierCode2])) {
155
+ return $carrierCode2;
156
+ } elseif (isset($carrierList[$carrierTitle])) {
157
+ return $carrierTitle;
158
+ }
159
+
160
+ //try to identify by custom carrier code
161
+ $regStr = implode('|', array_keys($carrierList));
162
+ if (preg_match("#$regStr#ui", $carrierCode, $m)) {
163
+ return $m[0];
164
+ }
165
+
166
+ //try to identify by carrier title
167
+ if ($carrierTitle) {
168
+ foreach ($carrierList as $code => $title) {
169
+ if (stripos($carrierTitle, $title) !== false) {
170
+ return $code;
171
+ }
172
+ }
173
+ }
174
+
175
+ return false;
176
+ }
177
+ }
app/code/community/Packpin/Pptrack/Model/EnableNotifications.php CHANGED
@@ -1,92 +1,92 @@
1
- <?php
2
-
3
- /**
4
- * Class Packpin_Pptrack_Model_Validation
5
- */
6
- class Packpin_Pptrack_Model_Enablenotifications extends Mage_Core_Model_Config_Data
7
- {
8
-
9
- public function save()
10
- {
11
-
12
-
13
- $helper = Mage::helper('pptrack');
14
-
15
- $apiKey = $this->_data['groups']['settings']['fields']['api_key']['value'];
16
- $pluginStatus = $this->_data['groups']['settings']['fields']['status']['value'];
17
- $notificationStatus = $this->_data['groups']['settings']['fields']['pp_enable_notifications']['value'];
18
-
19
- $oldApiKey = Mage::getStoreConfig('pp_section_setttings/settings/api_key');
20
- $oldPluginStatus = Mage::getStoreConfig('pp_section_setttings/settings/status');
21
-
22
- // Change API key config so we can get proper API key instantly
23
- Mage::app()->getStore()->setConfig('pp_section_setttings/settings/api_key', $apiKey);
24
-
25
- // Check if API key is missing
26
- if(!$apiKey) {
27
- Mage::throwException(Mage::helper('pptrack')->__('You have to enter API key before saving config!'));
28
- }
29
-
30
- //Check if status set to disabled and API key changed
31
- if(!$pluginStatus AND $oldApiKey !== $apiKey) {
32
- $info = $helper->testApiKey();
33
-
34
- if(!$info OR $info['statusCode'] == 400) {
35
- if ($info['body']['reason']) {
36
- Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__($info['body']['reason']));
37
- } else {
38
- Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__('Error sending data to API'));
39
- }
40
- }
41
- }
42
-
43
- // Check if plugin status set to Enable and API key changed then do API key check
44
- if(($pluginStatus AND $oldApiKey !== $apiKey) OR ($pluginStatus AND !$oldPluginStatus)) {
45
- $info = $helper->testApiKey();
46
-
47
- if(!$info OR $info['statusCode'] == 400) {
48
- if($info['body']['reason']) {
49
- Mage::throwException(Mage::helper('pptrack')->__($info['body']['reason']));
50
- }
51
- else {
52
- Mage::throwException(Mage::helper('pptrack')->__('Error sending data to API'));
53
- }
54
- }
55
- }
56
-
57
- // Check if plugin or notification status disabled then do API call to disable notifications connector
58
- if(!$pluginStatus OR !$notificationStatus) {
59
- $info = $helper->enableConnector('0');
60
-
61
- if(!$info OR $info['statusCode'] == 400 AND Mage::getStoreConfig('pp_section_setttings/settings/pp_enable_notifications') == 1) {
62
- if($info['body']['reason']) {
63
- Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__($info['body']['reason']));
64
- }
65
- else {
66
- Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__('Error sending data to API'));
67
- }
68
- }
69
- }
70
-
71
- // If API key exists and both plugin and notifications status set to enable call API to enable connector
72
- if($apiKey AND $pluginStatus AND $notificationStatus) {
73
-
74
- if($helper->createSoapUserAndRole($apiKey)) {
75
- $info = $helper->enableConnector($notificationStatus);
76
-
77
- if(!$info OR $info['statusCode'] == 400) {
78
- $helpLocal = '<br>Please note that we will not be able to reach your shop(for notification emails) if you are testing on local enviroment. <br><br>If you need help with setup or have any questions, use chat window on the right or email <a href="mailto:support@packpin.com">support@packpin.com</a>';
79
-
80
- if(isset($info['body']['reason']) && !empty($info['body']['reason'])) {
81
- Mage::throwException('Could not enable notifications: '.$info['body']['reason'] . $helpLocal);
82
- }
83
- else {
84
- Mage::throwException('Could not enable notifications: Could not connect to API' . $helpLocal);
85
- }
86
- }
87
- }
88
- }
89
- return parent::save();
90
-
91
- }
92
  }
1
+ <?php
2
+
3
+ /**
4
+ * Class Packpin_Pptrack_Model_Validation
5
+ */
6
+ class Packpin_Pptrack_Model_Enablenotifications extends Mage_Core_Model_Config_Data
7
+ {
8
+
9
+ public function save()
10
+ {
11
+
12
+
13
+ $helper = Mage::helper('pptrack');
14
+
15
+ $apiKey = $this->_data['groups']['settings']['fields']['api_key']['value'];
16
+ $pluginStatus = $this->_data['groups']['settings']['fields']['status']['value'];
17
+ $notificationStatus = $this->_data['groups']['settings']['fields']['pp_enable_notifications']['value'];
18
+
19
+ $oldApiKey = Mage::getStoreConfig('pp_section_setttings/settings/api_key');
20
+ $oldPluginStatus = Mage::getStoreConfig('pp_section_setttings/settings/status');
21
+
22
+ // Change API key config so we can get proper API key instantly
23
+ Mage::app()->getStore()->setConfig('pp_section_setttings/settings/api_key', $apiKey);
24
+
25
+ // Check if API key is missing
26
+ if(!$apiKey) {
27
+ Mage::throwException(Mage::helper('pptrack')->__('You have to enter API key before saving config!'));
28
+ }
29
+
30
+ //Check if status set to disabled and API key changed
31
+ if(!$pluginStatus AND $oldApiKey !== $apiKey) {
32
+ $info = $helper->testApiKey();
33
+
34
+ if(!$info OR $info['statusCode'] == 400) {
35
+ if ($info['body']['reason']) {
36
+ Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__($info['body']['reason']));
37
+ } else {
38
+ Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__('Error sending data to API'));
39
+ }
40
+ }
41
+ }
42
+
43
+ // Check if plugin status set to Enable and API key changed then do API key check
44
+ if(($pluginStatus AND $oldApiKey !== $apiKey) OR ($pluginStatus AND !$oldPluginStatus)) {
45
+ $info = $helper->testApiKey();
46
+
47
+ if(!$info OR $info['statusCode'] == 400) {
48
+ if($info['body']['reason']) {
49
+ Mage::throwException(Mage::helper('pptrack')->__($info['body']['reason']));
50
+ }
51
+ else {
52
+ Mage::throwException(Mage::helper('pptrack')->__('Error sending data to API'));
53
+ }
54
+ }
55
+ }
56
+
57
+ // Check if plugin or notification status disabled then do API call to disable notifications connector
58
+ if(!$pluginStatus OR !$notificationStatus) {
59
+ $info = $helper->enableConnector('0');
60
+
61
+ if(!$info OR $info['statusCode'] == 400 AND Mage::getStoreConfig('pp_section_setttings/settings/pp_enable_notifications') == 1) {
62
+ if($info['body']['reason']) {
63
+ Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__($info['body']['reason']));
64
+ }
65
+ else {
66
+ Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__('Error sending data to API'));
67
+ }
68
+ }
69
+ }
70
+
71
+ // If API key exists and both plugin and notifications status set to enable call API to enable connector
72
+ if($apiKey AND $pluginStatus AND $notificationStatus) {
73
+
74
+ if($helper->createSoapUserAndRole($apiKey)) {
75
+ $info = $helper->enableConnector($notificationStatus);
76
+
77
+ if(!$info OR $info['statusCode'] == 400) {
78
+ $helpLocal = '<br>Please note that we will not be able to reach your shop(for notification emails) if you are testing on local enviroment. <br><br>If you need help with setup or have any questions, use chat window on the right or email <a href="mailto:support@packpin.com">support@packpin.com</a>';
79
+
80
+ if(isset($info['body']['reason']) && !empty($info['body']['reason'])) {
81
+ Mage::throwException('Could not enable notifications: '.$info['body']['reason'] . $helpLocal);
82
+ }
83
+ else {
84
+ Mage::throwException('Could not enable notifications: Could not connect to API' . $helpLocal);
85
+ }
86
+ }
87
+ }
88
+ }
89
+ return parent::save();
90
+
91
+ }
92
  }
app/code/community/Packpin/Pptrack/Model/Observer.php CHANGED
@@ -1,336 +1,336 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Model_Observer
4
- {
5
-
6
- /**
7
- * For static cache
8
- *
9
- * @var array
10
- */
11
- protected $_config = array();
12
-
13
- /**
14
- * Event fired before Tracking popup view (in admin shipments)
15
- *
16
- * @param Varien_Event_Observer $observer
17
- * @return bool|void
18
- */
19
- public function trackingPopupPreDispatch(Varien_Event_Observer $observer)
20
- {
21
- $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
22
- if (!$enabled)
23
- return false;
24
-
25
- $shippingTrackModel = null;
26
- $shippingList = null;
27
-
28
- $hash = Mage::app()->getRequest()->getParam('hash');
29
- $shippingInfoModel = Mage::getModel('shipping/info')->loadByHash($hash);
30
- $shippingTrackId = $shippingInfoModel->getTrackId();
31
- if ($shippingTrackId) {
32
- $shippingTrackModel = Mage::getModel('sales/order_shipment_track')->load($shippingTrackId);
33
- }
34
- else {
35
- $trackingInfo = $shippingInfoModel->getTrackingInfo();
36
- if ($trackingInfo) {
37
- $shippingList = current($trackingInfo);
38
- }
39
- }
40
-
41
- //for multiple shipment popup
42
- if ($shippingList) {
43
- $orderId = $shippingInfoModel->getOrderId();
44
- if (!$orderId) {
45
- $shipId = $shippingInfoModel->getShipId();
46
- if ($shipId) {
47
- $shipModel = Mage::getModel('sales/order_shipment')->load($shipId);
48
-
49
- $orderId = $shipModel->getOrderId();
50
- }
51
- }
52
-
53
- $models = array();
54
- foreach ($shippingList as $item) {
55
- $trackModel = Mage::getModel('pptrack/track')
56
- ->loadByOrder($orderId, $item['number']);
57
- if ($trackModel->getId()) {
58
- $models[] = $trackModel;
59
- }
60
- }
61
-
62
- if ($models) {
63
- Mage::register('models', $models);
64
-
65
- //redirect to our controller :)
66
- $request = Mage::app()->getRequest();
67
- $request->initForward()
68
- ->setControllerName('index')
69
- ->setModuleName('pptrack')
70
- ->setActionName('popup')
71
- ->setDispatched(false);
72
-
73
- return false;
74
- }
75
- }
76
- //for single shipment popup
77
- elseif ($shippingTrackModel->getId()) {
78
- $trackData = $shippingTrackModel->getData();
79
- $trackModel = Mage::getModel('pptrack/track')
80
- ->loadByOrder($trackData['order_id'], $this->_getTrackingCode($trackData));
81
- if ($trackModel->getId()) {
82
- Mage::register('model', $trackModel);
83
-
84
- //redirect to our controller :)
85
- $request = Mage::app()->getRequest();
86
- $request->initForward()
87
- ->setControllerName('index')
88
- ->setModuleName('pptrack')
89
- ->setActionName('popup')
90
- ->setDispatched(false);
91
-
92
- return false;
93
- }
94
- }
95
- }
96
-
97
- /**
98
- * Observe Event after new tracking has been added to shipment
99
- *
100
- * @param Varien_Event_Observer $observer
101
- * @return bool|void
102
- */
103
- public function afterShipmentSaved(Varien_Event_Observer $observer)
104
- {
105
- //plugin disabled
106
- $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
107
- if (!$enabled)
108
- return false;
109
-
110
- $track = $observer->getEvent()->getTrack();
111
- $shipment = $track->getShipment();
112
- $order = $shipment->getOrder();
113
-
114
-
115
- $trackData = $track->getData();
116
- $orderData = $order->getData();
117
- $addressData = $order->getShippingAddress()->getData();
118
-
119
- //detect carrier
120
- $carrierTitle = isset($trackData['title']) ? trim($trackData['title']) : null;
121
- $carrierCode = Mage::getModel('pptrack/carrier')
122
- ->detectCarrier($trackData['carrier_code'], $carrierTitle);
123
- if (!$carrierCode)
124
- return false;
125
-
126
- // replace custom carrier with real one if needed
127
- if ($trackData['carrier_code'] === 'custom') {
128
- $track->setCarrierCode(Packpin_Pptrack_Model_Carrier::CODE_PREFIX . $carrierCode);
129
- $track->save();
130
- }
131
-
132
- $trackingCode = $this->_getTrackingCode($trackData);
133
- $email = trim($orderData['customer_email']) ? $orderData['customer_email'] : null;
134
- $phone = trim($addressData['telephone']) ? $addressData['telephone'] : null;
135
-
136
- $collection = Mage::getModel('pptrack/track')
137
- ->getCollection()
138
- ->addFieldToFilter('code', array('eq' => $trackingCode))
139
- ->addFieldToFilter('order_id', array('eq' => $order->getId()));
140
- $trackModel = $collection->getFirstItem();
141
- $trackModel->setSubmitted(Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_PENDING);
142
-
143
- if (!$trackModel->getId()) {
144
- //tracking attributes
145
- $trackModel->setPostalCode($addressData['postcode']);
146
- $trackModel->setDestinationCountry($addressData['country_id']);
147
- // $trackModel->setShipDate(date("Y-m-d"));
148
-
149
- $trackModel->setStatus(Packpin_Pptrack_Model_Track::STATUS_PENDING);
150
- }
151
-
152
- $trackModel->setOrderId($order->getId());
153
- $trackModel->setShipmentId($track->getId());
154
- $trackModel->setCode($trackingCode);
155
- $trackModel->setCarrierCode($carrierCode);
156
- $trackModel->setCarrierName($trackData['title']);
157
- $trackModel->setPhone($phone);
158
- $trackModel->setEmail($email);
159
-
160
- $trackModel->save();
161
-
162
- //send email?
163
- try {
164
- $send = Mage::getStoreConfig('pp_section_setttings/advanced/trigger_shipped_email');
165
- if ($email && $send) {
166
- $cache = Mage::app()->getCache();
167
- $key = md5($email . $trackingCode);
168
- $lifetime = 60 * 60 * 24;
169
- $res = $cache->load($key);
170
- if (!$res) {
171
- $shipment->sendEmail(true, '');
172
- $shipment->setEmailSent(true);
173
-
174
-
175
- $cache->save('sent', $key, array('packpin_cache_emails'), $lifetime);
176
- }
177
- }
178
- }
179
- catch (Exception $e) {
180
-
181
- }
182
-
183
- $trackModel->updateApi();
184
- }
185
-
186
- /**
187
- * Observe Event after new tracking has been removed from shipment
188
- *
189
- * @param Varien_Event_Observer $observer
190
- * @return bool|void
191
- */
192
- public function afterShipmentRemoved(Varien_Event_Observer $observer)
193
- {
194
- //plugin disabled
195
- $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
196
- if (!$enabled)
197
- return false;
198
-
199
- $track = $observer->getEvent()->getTrack();
200
- $order = $track->getShipment()->getOrder();
201
-
202
- $trackData = $track->getData();
203
- $trackingCode = $this->_getTrackingCode($trackData);
204
-
205
- $collection = Mage::getModel('pptrack/track')
206
- ->getCollection()
207
- ->addFieldToFilter('code', array('eq' => $trackingCode))
208
- ->addFieldToFilter('order_id', array('eq' => $order->getId()));
209
- $trackModel = $collection->getFirstItem();
210
-
211
- if ($trackModel->getId()) {
212
- $trackModel->setSubmitted(Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_REMOVE_PENDING);
213
- $trackModel->save();
214
-
215
- $trackModel->updateApi();
216
- }
217
- }
218
-
219
- /**
220
- * Get tracking code from Magento track data
221
- * Up to ver 1.6.2.0 `number` field is used
222
- * Later it's track_number
223
- *
224
- * @param array $trackData
225
- *
226
- * @return string
227
- */
228
- protected function _getTrackingCode($trackData)
229
- {
230
- $trackingCode = trim($trackData['track_number']) ? trim($trackData['track_number']) : trim($trackData['number']);
231
-
232
- return $trackingCode;
233
- }
234
-
235
- /**
236
- * @param Mage_Sales_Model_Order $order
237
- *
238
- * @return mixed
239
- */
240
- protected function _getConfig(Mage_Sales_Model_Order $order) {
241
- $websiteId = $order->getStore()->getWebsiteId();
242
-
243
- if (!isset($this->_config[$websiteId])) {
244
- $config = Mage::app()->getWebsite($websiteId)->getConfig('pp_section_setttings');
245
-
246
- $this->_config[$websiteId] = (object)((array)$config['settings']);
247
- }
248
-
249
- return $this->_config[$websiteId];
250
- }
251
-
252
- /**
253
- * Run cron and check if we have trackings that were not sent to API
254
- */
255
- public function cron()
256
- {
257
- $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
258
- if (!$enabled)
259
- return false;
260
-
261
- set_time_limit(0);
262
-
263
- $list = Mage::getModel('pptrack/track')
264
- ->getCollection()
265
- ->addFieldToFilter('submitted', array('neq' => Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_SENT))
266
- ->load();
267
-
268
- if ($list) {
269
- foreach ($list as $trackModel) {
270
- $trackModel->updateApi();
271
- }
272
- }
273
- }
274
-
275
- /**
276
- * Triggered after carriers are saved in admin configuration
277
- */
278
- public function saveCarriers(Varien_Event_Observer $observer)
279
- {
280
- $carriers = Mage::getModel('pptrack/carrier')->getList(true);
281
- foreach ($carriers as $carrier) {
282
- $configValue = (int) Mage::getStoreConfig('pp_section_carriers/carriers/' . $carrier->getCode());
283
-
284
- if ($carrier->enabled != $configValue) {
285
- $carrier->setEnabled($configValue);
286
- $carrier->save();
287
- }
288
- }
289
- }
290
-
291
- public function coreBlockAbstractPrepareLayoutAfter(Varien_Event_Observer $observer)
292
- {
293
- $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
294
- if (!$enabled)
295
- return false;
296
-
297
- try {
298
- if (Mage::app()->getFrontController()->getAction()->getFullActionName() === 'adminhtml_dashboard_index')
299
- {
300
- $block = $observer->getBlock();
301
- if ($block->getNameInLayout() === 'dashboard')
302
- {
303
- $block->getChild('sales')->setUseAsDashboardHook(true);
304
- }
305
- }
306
- }
307
- catch (Exception $e) {
308
-
309
- }
310
- }
311
-
312
- public function coreBlockAbstractToHtmlAfter(Varien_Event_Observer $observer)
313
- {
314
- $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
315
- if (!$enabled)
316
- return false;
317
-
318
- try {
319
- if (Mage::app()->getFrontController()->getAction()->getFullActionName() === 'adminhtml_dashboard_index')
320
- {
321
- if ($observer->getBlock()->getUseAsDashboardHook())
322
- {
323
- $html = $observer->getTransport()->getHtml();
324
- $myBlock = $observer->getBlock()->getLayout()
325
- ->createBlock('pptrack_adminhtml/dashboard');
326
- $html .= $myBlock->toHtml();
327
- $observer->getTransport()->setHtml($html);
328
- }
329
- }
330
- }
331
- catch (Exception $e) {
332
-
333
- }
334
- }
335
-
336
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Model_Observer
4
+ {
5
+
6
+ /**
7
+ * For static cache
8
+ *
9
+ * @var array
10
+ */
11
+ protected $_config = array();
12
+
13
+ /**
14
+ * Event fired before Tracking popup view (in admin shipments)
15
+ *
16
+ * @param Varien_Event_Observer $observer
17
+ * @return bool|void
18
+ */
19
+ public function trackingPopupPreDispatch(Varien_Event_Observer $observer)
20
+ {
21
+ $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
22
+ if (!$enabled)
23
+ return false;
24
+
25
+ $shippingTrackModel = null;
26
+ $shippingList = null;
27
+
28
+ $hash = Mage::app()->getRequest()->getParam('hash');
29
+ $shippingInfoModel = Mage::getModel('shipping/info')->loadByHash($hash);
30
+ $shippingTrackId = $shippingInfoModel->getTrackId();
31
+ if ($shippingTrackId) {
32
+ $shippingTrackModel = Mage::getModel('sales/order_shipment_track')->load($shippingTrackId);
33
+ }
34
+ else {
35
+ $trackingInfo = $shippingInfoModel->getTrackingInfo();
36
+ if ($trackingInfo) {
37
+ $shippingList = current($trackingInfo);
38
+ }
39
+ }
40
+
41
+ //for multiple shipment popup
42
+ if ($shippingList) {
43
+ $orderId = $shippingInfoModel->getOrderId();
44
+ if (!$orderId) {
45
+ $shipId = $shippingInfoModel->getShipId();
46
+ if ($shipId) {
47
+ $shipModel = Mage::getModel('sales/order_shipment')->load($shipId);
48
+
49
+ $orderId = $shipModel->getOrderId();
50
+ }
51
+ }
52
+
53
+ $models = array();
54
+ foreach ($shippingList as $item) {
55
+ $trackModel = Mage::getModel('pptrack/track')
56
+ ->loadByOrder($orderId, $item['number']);
57
+ if ($trackModel->getId()) {
58
+ $models[] = $trackModel;
59
+ }
60
+ }
61
+
62
+ if ($models) {
63
+ Mage::register('models', $models);
64
+
65
+ //redirect to our controller :)
66
+ $request = Mage::app()->getRequest();
67
+ $request->initForward()
68
+ ->setControllerName('index')
69
+ ->setModuleName('pptrack')
70
+ ->setActionName('popup')
71
+ ->setDispatched(false);
72
+
73
+ return false;
74
+ }
75
+ }
76
+ //for single shipment popup
77
+ elseif ($shippingTrackModel->getId()) {
78
+ $trackData = $shippingTrackModel->getData();
79
+ $trackModel = Mage::getModel('pptrack/track')
80
+ ->loadByOrder($trackData['order_id'], $this->_getTrackingCode($trackData));
81
+ if ($trackModel->getId()) {
82
+ Mage::register('model', $trackModel);
83
+
84
+ //redirect to our controller :)
85
+ $request = Mage::app()->getRequest();
86
+ $request->initForward()
87
+ ->setControllerName('index')
88
+ ->setModuleName('pptrack')
89
+ ->setActionName('popup')
90
+ ->setDispatched(false);
91
+
92
+ return false;
93
+ }
94
+ }
95
+ }
96
+
97
+ /**
98
+ * Observe Event after new tracking has been added to shipment
99
+ *
100
+ * @param Varien_Event_Observer $observer
101
+ * @return bool|void
102
+ */
103
+ public function afterShipmentSaved(Varien_Event_Observer $observer)
104
+ {
105
+ //plugin disabled
106
+ $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
107
+ if (!$enabled)
108
+ return false;
109
+
110
+ $track = $observer->getEvent()->getTrack();
111
+ $shipment = $track->getShipment();
112
+ $order = $shipment->getOrder();
113
+
114
+
115
+ $trackData = $track->getData();
116
+ $orderData = $order->getData();
117
+ $addressData = $order->getShippingAddress()->getData();
118
+
119
+ //detect carrier
120
+ $carrierTitle = isset($trackData['title']) ? trim($trackData['title']) : null;
121
+ $carrierCode = Mage::getModel('pptrack/carrier')
122
+ ->detectCarrier($trackData['carrier_code'], $carrierTitle);
123
+ if (!$carrierCode)
124
+ return false;
125
+
126
+ // replace custom carrier with real one if needed
127
+ if ($trackData['carrier_code'] === 'custom') {
128
+ $track->setCarrierCode(Packpin_Pptrack_Model_Carrier::CODE_PREFIX . $carrierCode);
129
+ $track->save();
130
+ }
131
+
132
+ $trackingCode = $this->_getTrackingCode($trackData);
133
+ $email = trim($orderData['customer_email']) ? $orderData['customer_email'] : null;
134
+ $phone = trim($addressData['telephone']) ? $addressData['telephone'] : null;
135
+
136
+ $collection = Mage::getModel('pptrack/track')
137
+ ->getCollection()
138
+ ->addFieldToFilter('code', array('eq' => $trackingCode))
139
+ ->addFieldToFilter('order_id', array('eq' => $order->getId()));
140
+ $trackModel = $collection->getFirstItem();
141
+ $trackModel->setSubmitted(Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_PENDING);
142
+
143
+ if (!$trackModel->getId()) {
144
+ //tracking attributes
145
+ $trackModel->setPostalCode($addressData['postcode']);
146
+ $trackModel->setDestinationCountry($addressData['country_id']);
147
+ // $trackModel->setShipDate(date("Y-m-d"));
148
+
149
+ $trackModel->setStatus(Packpin_Pptrack_Model_Track::STATUS_PENDING);
150
+ }
151
+
152
+ $trackModel->setOrderId($order->getId());
153
+ $trackModel->setShipmentId($track->getId());
154
+ $trackModel->setCode($trackingCode);
155
+ $trackModel->setCarrierCode($carrierCode);
156
+ $trackModel->setCarrierName($trackData['title']);
157
+ $trackModel->setPhone($phone);
158
+ $trackModel->setEmail($email);
159
+
160
+ $trackModel->save();
161
+
162
+ //send email?
163
+ try {
164
+ $send = Mage::getStoreConfig('pp_section_setttings/advanced/trigger_shipped_email');
165
+ if ($email && $send) {
166
+ $cache = Mage::app()->getCache();
167
+ $key = md5($email . $trackingCode);
168
+ $lifetime = 60 * 60 * 24;
169
+ $res = $cache->load($key);
170
+ if (!$res) {
171
+ $shipment->sendEmail(true, '');
172
+ $shipment->setEmailSent(true);
173
+
174
+
175
+ $cache->save('sent', $key, array('packpin_cache_emails'), $lifetime);
176
+ }
177
+ }
178
+ }
179
+ catch (Exception $e) {
180
+
181
+ }
182
+
183
+ $trackModel->updateApi();
184
+ }
185
+
186
+ /**
187
+ * Observe Event after new tracking has been removed from shipment
188
+ *
189
+ * @param Varien_Event_Observer $observer
190
+ * @return bool|void
191
+ */
192
+ public function afterShipmentRemoved(Varien_Event_Observer $observer)
193
+ {
194
+ //plugin disabled
195
+ $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
196
+ if (!$enabled)
197
+ return false;
198
+
199
+ $track = $observer->getEvent()->getTrack();
200
+ $order = $track->getShipment()->getOrder();
201
+
202
+ $trackData = $track->getData();
203
+ $trackingCode = $this->_getTrackingCode($trackData);
204
+
205
+ $collection = Mage::getModel('pptrack/track')
206
+ ->getCollection()
207
+ ->addFieldToFilter('code', array('eq' => $trackingCode))
208
+ ->addFieldToFilter('order_id', array('eq' => $order->getId()));
209
+ $trackModel = $collection->getFirstItem();
210
+
211
+ if ($trackModel->getId()) {
212
+ $trackModel->setSubmitted(Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_REMOVE_PENDING);
213
+ $trackModel->save();
214
+
215
+ $trackModel->updateApi();
216
+ }
217
+ }
218
+
219
+ /**
220
+ * Get tracking code from Magento track data
221
+ * Up to ver 1.6.2.0 `number` field is used
222
+ * Later it's track_number
223
+ *
224
+ * @param array $trackData
225
+ *
226
+ * @return string
227
+ */
228
+ protected function _getTrackingCode($trackData)
229
+ {
230
+ $trackingCode = trim($trackData['track_number']) ? trim($trackData['track_number']) : trim($trackData['number']);
231
+
232
+ return $trackingCode;
233
+ }
234
+
235
+ /**
236
+ * @param Mage_Sales_Model_Order $order
237
+ *
238
+ * @return mixed
239
+ */
240
+ protected function _getConfig(Mage_Sales_Model_Order $order) {
241
+ $websiteId = $order->getStore()->getWebsiteId();
242
+
243
+ if (!isset($this->_config[$websiteId])) {
244
+ $config = Mage::app()->getWebsite($websiteId)->getConfig('pp_section_setttings');
245
+
246
+ $this->_config[$websiteId] = (object)((array)$config['settings']);
247
+ }
248
+
249
+ return $this->_config[$websiteId];
250
+ }
251
+
252
+ /**
253
+ * Run cron and check if we have trackings that were not sent to API
254
+ */
255
+ public function cron()
256
+ {
257
+ $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
258
+ if (!$enabled)
259
+ return false;
260
+
261
+ set_time_limit(0);
262
+
263
+ $list = Mage::getModel('pptrack/track')
264
+ ->getCollection()
265
+ ->addFieldToFilter('submitted', array('neq' => Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_SENT))
266
+ ->load();
267
+
268
+ if ($list) {
269
+ foreach ($list as $trackModel) {
270
+ $trackModel->updateApi();
271
+ }
272
+ }
273
+ }
274
+
275
+ /**
276
+ * Triggered after carriers are saved in admin configuration
277
+ */
278
+ public function saveCarriers(Varien_Event_Observer $observer)
279
+ {
280
+ $carriers = Mage::getModel('pptrack/carrier')->getList(true);
281
+ foreach ($carriers as $carrier) {
282
+ $configValue = (int) Mage::getStoreConfig('pp_section_carriers/carriers/' . $carrier->getCode());
283
+
284
+ if ($carrier->enabled != $configValue) {
285
+ $carrier->setEnabled($configValue);
286
+ $carrier->save();
287
+ }
288
+ }
289
+ }
290
+
291
+ public function coreBlockAbstractPrepareLayoutAfter(Varien_Event_Observer $observer)
292
+ {
293
+ $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
294
+ if (!$enabled)
295
+ return false;
296
+
297
+ try {
298
+ if (Mage::app()->getFrontController()->getAction()->getFullActionName() === 'adminhtml_dashboard_index')
299
+ {
300
+ $block = $observer->getBlock();
301
+ if ($block->getNameInLayout() === 'dashboard')
302
+ {
303
+ $block->getChild('sales')->setUseAsDashboardHook(true);
304
+ }
305
+ }
306
+ }
307
+ catch (Exception $e) {
308
+
309
+ }
310
+ }
311
+
312
+ public function coreBlockAbstractToHtmlAfter(Varien_Event_Observer $observer)
313
+ {
314
+ $enabled = Mage::getStoreConfig('pp_section_setttings/settings/status');
315
+ if (!$enabled)
316
+ return false;
317
+
318
+ try {
319
+ if (Mage::app()->getFrontController()->getAction()->getFullActionName() === 'adminhtml_dashboard_index')
320
+ {
321
+ if ($observer->getBlock()->getUseAsDashboardHook())
322
+ {
323
+ $html = $observer->getTransport()->getHtml();
324
+ $myBlock = $observer->getBlock()->getLayout()
325
+ ->createBlock('pptrack_adminhtml/dashboard');
326
+ $html .= $myBlock->toHtml();
327
+ $observer->getTransport()->setHtml($html);
328
+ }
329
+ }
330
+ }
331
+ catch (Exception $e) {
332
+
333
+ }
334
+ }
335
+
336
  }
app/code/community/Packpin/Pptrack/Model/Order/Shipment.php CHANGED
@@ -1,40 +1,40 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Model_Order_Shipment extends Mage_Sales_Model_Order_Shipment {
4
-
5
-
6
- /**
7
- * Get all track and override tracking title to add tracking back link
8
- *
9
- * @return array
10
- */
11
- /*
12
- public function getAllTracks()
13
- {
14
- $tracks = parent::getAllTracks();
15
-
16
- $config = Mage::getStoreConfig('pp_section_setttings/settings');
17
- if (!$config['status'])
18
- return $tracks;
19
-
20
- //check if function called from email template
21
- //@FIXME maybe there is a better way to override this stuff o_0
22
- $callers = debug_backtrace();
23
- $args = $callers[1]['args'];
24
- if (count($args) && strstr($args[0], 'template/email/order/shipment/track.phtml')) {
25
- //override names
26
- $newItems = array();
27
- foreach ($tracks as $num => $item) {
28
- $newTitle = $item->getTitle() . ' (Whata fuck)';
29
- $item->title = $newTitle;
30
- $newItems[] = $item;
31
- }
32
-
33
- $tracks = $newItems;
34
- }
35
-
36
- return $tracks;
37
- }
38
- */
39
-
40
- }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Model_Order_Shipment extends Mage_Sales_Model_Order_Shipment {
4
+
5
+
6
+ /**
7
+ * Get all track and override tracking title to add tracking back link
8
+ *
9
+ * @return array
10
+ */
11
+ /*
12
+ public function getAllTracks()
13
+ {
14
+ $tracks = parent::getAllTracks();
15
+
16
+ $config = Mage::getStoreConfig('pp_section_setttings/settings');
17
+ if (!$config['status'])
18
+ return $tracks;
19
+
20
+ //check if function called from email template
21
+ //@FIXME maybe there is a better way to override this stuff o_0
22
+ $callers = debug_backtrace();
23
+ $args = $callers[1]['args'];
24
+ if (count($args) && strstr($args[0], 'template/email/order/shipment/track.phtml')) {
25
+ //override names
26
+ $newItems = array();
27
+ foreach ($tracks as $num => $item) {
28
+ $newTitle = $item->getTitle() . ' (Whata fuck)';
29
+ $item->title = $newTitle;
30
+ $newItems[] = $item;
31
+ }
32
+
33
+ $tracks = $newItems;
34
+ }
35
+
36
+ return $tracks;
37
+ }
38
+ */
39
+
40
+ }
app/code/community/Packpin/Pptrack/Model/Resource/Carrier.php CHANGED
@@ -1,10 +1,10 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Model_Resource_Carrier extends Mage_Core_Model_Mysql4_Abstract
4
- {
5
- protected function _construct()
6
- {
7
- $this->_init('pptrack/carrier', 'id');
8
- }
9
-
10
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Model_Resource_Carrier extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ protected function _construct()
6
+ {
7
+ $this->_init('pptrack/carrier', 'id');
8
+ }
9
+
10
  }
app/code/community/Packpin/Pptrack/Model/Resource/Carrier/Collection.php CHANGED
@@ -1,8 +1,8 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Model_Resource_Carrier_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- protected function _construct() {
6
- $this->_init('pptrack/carrier');
7
- }
8
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Model_Resource_Carrier_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ protected function _construct() {
6
+ $this->_init('pptrack/carrier');
7
+ }
8
  }
app/code/community/Packpin/Pptrack/Model/Resource/Setting.php CHANGED
@@ -1,10 +1,10 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Model_Resource_Setting extends Mage_Core_Model_Mysql4_Abstract
4
- {
5
- protected function _construct()
6
- {
7
- $this->_init('pptrack/setting', 'id');
8
- }
9
-
10
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Model_Resource_Setting extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ protected function _construct()
6
+ {
7
+ $this->_init('pptrack/setting', 'id');
8
+ }
9
+
10
  }
app/code/community/Packpin/Pptrack/Model/Resource/Setting/Collection.php CHANGED
@@ -1,8 +1,8 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Model_Resource_Setting_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- protected function _construct() {
6
- $this->_init('pptrack/setting');
7
- }
8
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Model_Resource_Setting_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ protected function _construct() {
6
+ $this->_init('pptrack/setting');
7
+ }
8
  }
app/code/community/Packpin/Pptrack/Model/Resource/Track.php CHANGED
@@ -1,10 +1,10 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Model_Resource_Track extends Mage_Core_Model_Mysql4_Abstract
4
- {
5
- protected function _construct()
6
- {
7
- $this->_init('pptrack/track', 'id');
8
- }
9
-
10
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Model_Resource_Track extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ protected function _construct()
6
+ {
7
+ $this->_init('pptrack/track', 'id');
8
+ }
9
+
10
  }
app/code/community/Packpin/Pptrack/Model/Resource/Track/Collection.php CHANGED
@@ -1,8 +1,8 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Model_Resource_Track_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- protected function _construct() {
6
- $this->_init('pptrack/track');
7
- }
8
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Model_Resource_Track_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ protected function _construct() {
6
+ $this->_init('pptrack/track');
7
+ }
8
  }
app/code/community/Packpin/Pptrack/Model/Resource/Trackdetail.php CHANGED
@@ -1,8 +1,8 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Model_Resource_Trackdetail extends Mage_Core_Model_Mysql4_Abstract
4
- {
5
- protected function _construct() {
6
- $this->_init('pptrack/trackdetail', 'id');
7
- }
8
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Model_Resource_Trackdetail extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ protected function _construct() {
6
+ $this->_init('pptrack/trackdetail', 'id');
7
+ }
8
  }
app/code/community/Packpin/Pptrack/Model/Resource/Trackdetail/Collection.php CHANGED
@@ -1,8 +1,8 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Model_Resource_Trackdetail_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- protected function _construct() {
6
- $this->_init('pptrack/trackdetail');
7
- }
8
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Model_Resource_Trackdetail_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ protected function _construct() {
6
+ $this->_init('pptrack/trackdetail');
7
+ }
8
  }
app/code/community/Packpin/Pptrack/Model/Resource/Trackunsubscribed.php CHANGED
@@ -1,8 +1,8 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Model_Resource_Trackunsubscribed extends Mage_Core_Model_Mysql4_Abstract
4
- {
5
- protected function _construct() {
6
- $this->_init('pptrack/trackunsubscribed', 'id');
7
- }
8
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Model_Resource_Trackunsubscribed extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ protected function _construct() {
6
+ $this->_init('pptrack/trackunsubscribed', 'id');
7
+ }
8
  }
app/code/community/Packpin/Pptrack/Model/Resource/Trackunsubscribed/Collection.php CHANGED
@@ -1,8 +1,8 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Model_Resource_Trackunsubscribed_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- protected function _construct() {
6
- $this->_init('pptrack/trackunsubscribed');
7
- }
8
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Model_Resource_Trackunsubscribed_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ protected function _construct() {
6
+ $this->_init('pptrack/trackunsubscribed');
7
+ }
8
  }
app/code/community/Packpin/Pptrack/Model/Resource/Visit.php CHANGED
@@ -1,10 +1,10 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Model_Resource_Visit extends Mage_Core_Model_Mysql4_Abstract
4
- {
5
- protected function _construct()
6
- {
7
- $this->_init('pptrack/visit', 'id');
8
- }
9
-
10
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Model_Resource_Visit extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ protected function _construct()
6
+ {
7
+ $this->_init('pptrack/visit', 'id');
8
+ }
9
+
10
  }
app/code/community/Packpin/Pptrack/Model/Resource/Visit/Collection.php CHANGED
@@ -1,8 +1,8 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_Model_Resource_Visit_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- protected function _construct() {
6
- $this->_init('pptrack/visit');
7
- }
8
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_Model_Resource_Visit_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ protected function _construct() {
6
+ $this->_init('pptrack/visit');
7
+ }
8
  }
app/code/community/Packpin/Pptrack/Model/Setting.php CHANGED
@@ -1,28 +1,28 @@
1
- <?php
2
-
3
- /**
4
- * Class Packpin_Pptrack_Model_Setting
5
- *
6
- * Model for pp_settings table
7
- */
8
- class Packpin_Pptrack_Model_Setting extends Mage_Core_Model_Abstract
9
- {
10
- const SETTING_CARRIER_UPDATED = 'carrier_updated';
11
-
12
- protected function _construct()
13
- {
14
- $this->_init('pptrack/setting');
15
- }
16
-
17
-
18
- /**
19
- * Get setting value
20
- *
21
- * @param string $setting
22
- */
23
- public function loadModelBySetting($setting)
24
- {
25
- $this->load($setting, 'setting');
26
- }
27
-
28
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class Packpin_Pptrack_Model_Setting
5
+ *
6
+ * Model for pp_settings table
7
+ */
8
+ class Packpin_Pptrack_Model_Setting extends Mage_Core_Model_Abstract
9
+ {
10
+ const SETTING_CARRIER_UPDATED = 'carrier_updated';
11
+
12
+ protected function _construct()
13
+ {
14
+ $this->_init('pptrack/setting');
15
+ }
16
+
17
+
18
+ /**
19
+ * Get setting value
20
+ *
21
+ * @param string $setting
22
+ */
23
+ public function loadModelBySetting($setting)
24
+ {
25
+ $this->load($setting, 'setting');
26
+ }
27
+
28
+ }
app/code/community/Packpin/Pptrack/Model/Track.php CHANGED
@@ -1,527 +1,527 @@
1
- <?php
2
-
3
- /**
4
- * Class Packpin_Pptrack_Model_Track
5
- *
6
- * Model for pp_tracks table
7
- */
8
- class Packpin_Pptrack_Model_Track extends Mage_Core_Model_Abstract
9
- {
10
- protected function _construct()
11
- {
12
- $this->_init('pptrack/track');
13
- }
14
-
15
- const STATUS_PENDING = 'pending';
16
- const STATUS_DELIVERED = 'delivered';
17
- const STATUS_OUT_FOR_DELIVERY = 'out_for_delivery';
18
- const STATUS_IN_TRANSIT = 'in_transit';
19
- const STATUS_INFO_RECEIVED = 'info_received';
20
- const STATUS_DISPATCHED_TO_OVERSEAS = 'to_overseas';
21
- const STATUS_FAILED_ATTEMPT = 'failed_attempt';
22
- const STATUS_EXCEPTION = 'exception';
23
- const STATUS_NO_INFO = 'no_info';
24
-
25
-
26
- /**
27
- * Model created but not sent to API
28
- */
29
- const TYPE_SUBMITTED_PENDING = 0;
30
-
31
- /**
32
- * Model data sent
33
- */
34
- const TYPE_SUBMITTED_SENT = 1;
35
-
36
- /**
37
- * Model pending to be removed
38
- */
39
- const TYPE_SUBMITTED_REMOVE_PENDING = 2;
40
-
41
- /**
42
- * Data fields we can map with API data
43
- *
44
- * @var array
45
- */
46
- public static $mapCols = array(
47
- 'status',
48
- );
49
-
50
- /**
51
- * Response body for last API request
52
- *
53
- * @var array
54
- */
55
- public $apiResponseData;
56
-
57
- /**
58
- * Tracking details
59
- *
60
- * @var null|array
61
- */
62
- protected $_details;
63
-
64
- /**
65
- * Shipping Info
66
- *
67
- * @var null|array
68
- */
69
- protected $_shippingInfo;
70
-
71
- /**
72
- * Carrier model
73
- *
74
- * @var
75
- */
76
- protected $_carrier;
77
-
78
- /**
79
- * Get list of statuses with order number
80
- *
81
- * @return array
82
- */
83
- public static function getOrderedStatusList()
84
- {
85
- return array(
86
- self::STATUS_PENDING => 10,
87
- self::STATUS_NO_INFO => 10,
88
- self::STATUS_INFO_RECEIVED => 10,
89
- self::STATUS_IN_TRANSIT => 30,
90
- self::STATUS_DISPATCHED_TO_OVERSEAS => 30,
91
- self::STATUS_FAILED_ATTEMPT => 30,
92
- self::STATUS_EXCEPTION => 30,
93
- self::STATUS_OUT_FOR_DELIVERY => 50,
94
- self::STATUS_DELIVERED => 60,
95
- );
96
- }
97
-
98
- /**
99
- * @return array
100
- */
101
- public static function getStatusStrings()
102
- {
103
- return array(
104
- self::STATUS_PENDING => Mage::helper('pptrack')->__('Pending'),
105
- self::STATUS_NO_INFO => Mage::helper('pptrack')->__('No Info'),
106
- self::STATUS_INFO_RECEIVED => Mage::helper('pptrack')->__('In Transit'),
107
- self::STATUS_IN_TRANSIT => Mage::helper('pptrack')->__('In Transit'),
108
- self::STATUS_DISPATCHED_TO_OVERSEAS => Mage::helper('pptrack')->__('In Transit'),
109
- self::STATUS_FAILED_ATTEMPT => Mage::helper('pptrack')->__('Failed Attempt'),
110
- self::STATUS_EXCEPTION => Mage::helper('pptrack')->__('In Transit'),
111
- self::STATUS_OUT_FOR_DELIVERY => Mage::helper('pptrack')->__('Out For Delivery'),
112
- self::STATUS_DELIVERED => Mage::helper('pptrack')->__('Delivered'),
113
- );
114
- }
115
-
116
- /**
117
- * Update unix times
118
- *
119
- * @return mixed
120
- */
121
- protected function _beforeSave()
122
- {
123
- //new model
124
- if (!$this->getId()) {
125
- $this->hash = $this->_generateHash();
126
- $this->created_at = time();
127
- }
128
- $this->updated_at = time();
129
-
130
- return parent::_beforeSave();
131
- }
132
-
133
- /**
134
- * Generate UUID (v4) for usage in track details url backlink
135
- *
136
- * @return string
137
- */
138
- protected function _generateHash()
139
- {
140
- return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
141
-
142
- // 32 bits for "time_low"
143
- mt_rand(0, 0xffff), mt_rand(0, 0xffff),
144
-
145
- // 16 bits for "time_mid"
146
- mt_rand(0, 0xffff),
147
-
148
- // 16 bits for "time_hi_and_version",
149
- // four most significant bits holds version number 4
150
- mt_rand(0, 0x0fff) | 0x4000,
151
-
152
- // 16 bits, 8 bits for "clk_seq_hi_res",
153
- // 8 bits for "clk_seq_low",
154
- // two most significant bits holds zero and one for variant DCE1.1
155
- mt_rand(0, 0x3fff) | 0x8000,
156
-
157
- // 48 bits for "node"
158
- mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
159
- );
160
- }
161
-
162
- /**
163
- * Updates model info from API
164
- */
165
- protected function _fetchData()
166
- {
167
- $helper = Mage::helper('pptrack');
168
- $res = $helper->getTrackingInfo($this->getCarrierCode(), $this->getCode());
169
-
170
- //map new data to current model
171
- if ($res && $res["statusCode"] == 200) {
172
- $info = $res["body"];
173
- $this->apiResponseData = $info;
174
-
175
- $this->updateInfo($info);
176
-
177
- //Track details info
178
- if (isset($info['track_details']) && $info['track_details']) {
179
- //remove old details
180
- $list = $this->getDetails();
181
- foreach ($list as $model) {
182
- $model->delete();
183
- }
184
- $this->_details = array();
185
-
186
- foreach ($info['track_details'] as $detailInfo) {
187
- $model = Mage::getModel('pptrack/trackdetail');
188
- $model->track_id = $this->getId();
189
- $model->updateInfo($detailInfo);
190
- $this->_details[] = $model;
191
- }
192
- }
193
-
194
- }
195
- }
196
-
197
- public function updateApiData()
198
- {
199
- $this->_fetchData();
200
- }
201
-
202
- /**
203
- * Update Track info
204
- *
205
- * @param array $data
206
- */
207
- public function updateInfo($data)
208
- {
209
- foreach (self::$mapCols as $field) {
210
- if (isset($data[$field]))
211
- $this->$field = $data[$field];
212
- }
213
-
214
- $this->save();
215
- }
216
-
217
- /**
218
- * Get Tracking info by order and tracking code
219
- *
220
- * @param int $orderId
221
- * @param string $code
222
- * @param bool $fetchData Fetch new data from API
223
- * @return $this
224
- */
225
- public function loadByOrder($orderId, $code, $fetchData = true)
226
- {
227
- $collection = Mage::getModel('pptrack/track')
228
- ->getCollection()
229
- ->addFieldToFilter('code', array('eq' => $code))
230
- ->addFieldToFilter('order_id', array('eq' => $orderId));
231
- $trackModel = $collection->getFirstItem();
232
- $this->setData($trackModel->getData());
233
-
234
- if ($this->getId() && $fetchData) {
235
- $this->_fetchData();
236
- }
237
-
238
- return $this;
239
- }
240
-
241
- /**
242
- * Get Tracking info by carrier and tracking code
243
- *
244
- * @param string $carrier
245
- * @param string $code
246
- * @return $this
247
- */
248
- public function loadByCarrierAndCode($carrier, $code)
249
- {
250
- $collection = Mage::getModel('pptrack/track')
251
- ->getCollection()
252
- ->addFieldToFilter('code', array('eq' => $code))
253
- ->addFieldToFilter('carrier_code', array('eq' => $carrier));
254
- $trackModel = $collection->getFirstItem();
255
- $this->setData($trackModel->getData());
256
-
257
- return $this;
258
- }
259
-
260
- /**
261
- * Get Tracking info by hash string
262
- *
263
- * @param string $hash
264
- * @param bool $fetchData Fetch new data from API
265
- */
266
- public function loadInfoByHash($hash, $fetchData = true)
267
- {
268
- $this->load($hash, 'hash');
269
-
270
- if ($this->getId() && $fetchData) {
271
- $this->_fetchData();
272
- }
273
- }
274
-
275
- /**
276
- * Get track details
277
- *
278
- * @return array
279
- */
280
- public function getDetails()
281
- {
282
- if ($this->_details === null) {
283
- if ($this->isEmpty()) {
284
- return array();
285
- }
286
-
287
- $this->_details = Mage::getModel('pptrack/trackdetail')
288
- ->getCollection()
289
- ->addFieldToFilter('track_id', array('eq' => $this->getId()))
290
- ->getItems();
291
- }
292
-
293
- return $this->_details;
294
- }
295
-
296
- /**
297
- * Get shipping information
298
- *
299
- * @return array
300
- */
301
- public function getShippingInfo()
302
- {
303
- if($this->_shippingInfo === null) {
304
- if ($this->isEmpty()) {
305
- return array();
306
- }
307
-
308
- $order = Mage::getModel('sales/order')->load($this->getOrderId());
309
- if ($order->getId()) {
310
- $address = $order->getShippingAddress();
311
- if ($address->getId()) {
312
- $shippingInfo = $address->getData();
313
-
314
- $this->_shippingInfo = $shippingInfo;
315
- }
316
- }
317
- }
318
- return $this->_shippingInfo;
319
- }
320
-
321
- /**
322
- * Get Track details url
323
- */
324
- public function getDetailsUrl()
325
- {
326
- $order = Mage::getModel('sales/order')->load($this->order_id);
327
-
328
- // $orders = Mage::getModel('sales/order')->getCollection()
329
- // ->setOrder('created_at','DESC')
330
- // ->addFieldToFilter('id', array('eq' => $this->order_id))
331
- // ->setPageSize(1)
332
- // ->setCurPage(1);
333
- // $order = $orders->getFirstItem();
334
-
335
- $url = Mage::getUrl('pptrack') . '?email=' . $order->customer_email . '&order=' . $order->getIncrementId();
336
-
337
- return $url;
338
- }
339
-
340
- public function getUnsubscribeLink()
341
- {
342
- $url = Mage::getUrl('pptrack/unsubscribe') . '?h=' . $this->hash;
343
-
344
- return $url;
345
- }
346
-
347
- /**
348
- * Try to sync this model with API
349
- * @param bool $waitForResponse
350
- */
351
- public function updateApi($waitForResponse = false)
352
- {
353
- $helper = Mage::helper('pptrack');
354
-
355
- $submitted = $this->getSubmitted();
356
-
357
- if ($submitted == Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_PENDING) {
358
- $res = $helper->addTrackingCode(
359
- $this->getCarrierCode(),
360
- $this->getCode(),
361
- $this->getCarrierName(),
362
- $this->getPostalCode(),
363
- $this->getDestinationCountry(),
364
- $this->getShipDate(),
365
- $this->getOrderId(),
366
- $waitForResponse
367
- );
368
-
369
- //400 statuscode goes for "tracking already in the list"
370
- if ($res && in_array($res["statusCode"], array(201, 400))) {
371
- $this->setSubmitted(Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_SENT);
372
-
373
- $this->save();
374
- }
375
- }
376
- elseif ($submitted == Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_REMOVE_PENDING) {
377
- $res = $helper->removeTrackingCode(
378
- $this->getCarrierCode(),
379
- $this->getCode()
380
- );
381
-
382
- //404 goes for already removed
383
- if ($res && in_array($res["statusCode"], array(200, 204, 404))) {
384
- $this->delete();
385
- }
386
- }
387
- }
388
-
389
- /**
390
- * Get given status css class compared to current status
391
- *
392
- * @param $status
393
- * @return string
394
- */
395
- public function getStatusClass($status)
396
- {
397
- $list = self::getOrderedStatusList();
398
-
399
- if (!isset($list[$status]) || !isset($list[$this->getStatus()]))
400
- return '';
401
-
402
- if ($list[$status] < $list[$this->getStatus()])
403
- return 'done';
404
- elseif ($list[$status] == $list[$this->getStatus()])
405
- return 'active';
406
-
407
- return '';
408
- }
409
-
410
- /**
411
- * @return mixed
412
- */
413
- public function getOrderNumber()
414
- {
415
- $order = Mage::getModel('sales/order')->load($this->getOrderId());
416
-
417
- return $order->getIncrementId();
418
- }
419
-
420
- /**
421
- * Get carrier model
422
- *
423
- * @return array
424
- */
425
- public function getCarrier()
426
- {
427
- if ($this->_carrier === null) {
428
- $this->_carrier = Mage::getModel('pptrack/carrier')
429
- ->load($this->getCarrierCode(), 'code');
430
- }
431
-
432
- return $this->_carrier;
433
- }
434
-
435
- /**
436
- * @return string
437
- */
438
- public function getCarrierIcon()
439
- {
440
- $carrier = $this->getCarrier();
441
- if ($carrier && $carrier->getId()) {
442
- return $carrier->getIconUrl();
443
- }
444
-
445
- return '';
446
- }
447
-
448
- /**
449
- * @return string
450
- */
451
- public function getCarrierName()
452
- {
453
- $carrier = $this->getCarrier();
454
- if ($carrier && $carrier->getId()) {
455
- return $carrier->getName();
456
- }
457
-
458
- return '';
459
- }
460
-
461
- /**
462
- * @return string
463
- */
464
- public function getCarrierPhone()
465
- {
466
- $carrier = $this->getCarrier();
467
- if ($carrier && $carrier->getId()) {
468
- return $carrier->getPhone();
469
- }
470
-
471
- return '';
472
- }
473
-
474
- /**
475
- * @return string
476
- */
477
- public function getCarrierHomepage()
478
- {
479
- $carrier = $this->getCarrier();
480
- if ($carrier && $carrier->getId()) {
481
- return $carrier->getHomepage();
482
- }
483
-
484
- return '';
485
- }
486
-
487
- /**
488
- * @return string
489
- */
490
- public function getShippingDate($format = 'medium')
491
- {
492
- $time = $this->getCreatedAt();
493
-
494
- $dateFormatted = Mage::helper('core')->formatTime(date("Y-m-d H:i:s", $time), $format, true);
495
- return $dateFormatted;
496
- }
497
-
498
- public function getTotalCount()
499
- {
500
- $count = $this->getCollection()
501
- ->getSize();
502
-
503
- return $count;
504
- }
505
-
506
- public function getEstimatedDelivery()
507
- {
508
- if (isset($this->apiResponseData['estimated_delivery'])) {
509
- return Mage::helper('core')->formatDate($this->apiResponseData['estimated_delivery'], 'full', false);
510
- }
511
- }
512
-
513
- /**
514
- * Get package status as string
515
- * @return string
516
- */
517
- public function getStatusString()
518
- {
519
- $list = self::getStatusStrings();
520
-
521
- if (!isset($list[$this->getStatus()]))
522
- return '';
523
-
524
- return $list[$this->getStatus()];
525
- }
526
-
527
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class Packpin_Pptrack_Model_Track
5
+ *
6
+ * Model for pp_tracks table
7
+ */
8
+ class Packpin_Pptrack_Model_Track extends Mage_Core_Model_Abstract
9
+ {
10
+ protected function _construct()
11
+ {
12
+ $this->_init('pptrack/track');
13
+ }
14
+
15
+ const STATUS_PENDING = 'pending';
16
+ const STATUS_DELIVERED = 'delivered';
17
+ const STATUS_OUT_FOR_DELIVERY = 'out_for_delivery';
18
+ const STATUS_IN_TRANSIT = 'in_transit';
19
+ const STATUS_INFO_RECEIVED = 'info_received';
20
+ const STATUS_DISPATCHED_TO_OVERSEAS = 'to_overseas';
21
+ const STATUS_FAILED_ATTEMPT = 'failed_attempt';
22
+ const STATUS_EXCEPTION = 'exception';
23
+ const STATUS_NO_INFO = 'no_info';
24
+
25
+
26
+ /**
27
+ * Model created but not sent to API
28
+ */
29
+ const TYPE_SUBMITTED_PENDING = 0;
30
+
31
+ /**
32
+ * Model data sent
33
+ */
34
+ const TYPE_SUBMITTED_SENT = 1;
35
+
36
+ /**
37
+ * Model pending to be removed
38
+ */
39
+ const TYPE_SUBMITTED_REMOVE_PENDING = 2;
40
+
41
+ /**
42
+ * Data fields we can map with API data
43
+ *
44
+ * @var array
45
+ */
46
+ public static $mapCols = array(
47
+ 'status',
48
+ );
49
+
50
+ /**
51
+ * Response body for last API request
52
+ *
53
+ * @var array
54
+ */
55
+ public $apiResponseData;
56
+
57
+ /**
58
+ * Tracking details
59
+ *
60
+ * @var null|array
61
+ */
62
+ protected $_details;
63
+
64
+ /**
65
+ * Shipping Info
66
+ *
67
+ * @var null|array
68
+ */
69
+ protected $_shippingInfo;
70
+
71
+ /**
72
+ * Carrier model
73
+ *
74
+ * @var
75
+ */
76
+ protected $_carrier;
77
+
78
+ /**
79
+ * Get list of statuses with order number
80
+ *
81
+ * @return array
82
+ */
83
+ public static function getOrderedStatusList()
84
+ {
85
+ return array(
86
+ self::STATUS_PENDING => 10,
87
+ self::STATUS_NO_INFO => 10,
88
+ self::STATUS_INFO_RECEIVED => 10,
89
+ self::STATUS_IN_TRANSIT => 30,
90
+ self::STATUS_DISPATCHED_TO_OVERSEAS => 30,
91
+ self::STATUS_FAILED_ATTEMPT => 30,
92
+ self::STATUS_EXCEPTION => 30,
93
+ self::STATUS_OUT_FOR_DELIVERY => 50,
94
+ self::STATUS_DELIVERED => 60,
95
+ );
96
+ }
97
+
98
+ /**
99
+ * @return array
100
+ */
101
+ public static function getStatusStrings()
102
+ {
103
+ return array(
104
+ self::STATUS_PENDING => Mage::helper('pptrack')->__('Pending'),
105
+ self::STATUS_NO_INFO => Mage::helper('pptrack')->__('No Info'),
106
+ self::STATUS_INFO_RECEIVED => Mage::helper('pptrack')->__('In Transit'),
107
+ self::STATUS_IN_TRANSIT => Mage::helper('pptrack')->__('In Transit'),
108
+ self::STATUS_DISPATCHED_TO_OVERSEAS => Mage::helper('pptrack')->__('In Transit'),
109
+ self::STATUS_FAILED_ATTEMPT => Mage::helper('pptrack')->__('Failed Attempt'),
110
+ self::STATUS_EXCEPTION => Mage::helper('pptrack')->__('In Transit'),
111
+ self::STATUS_OUT_FOR_DELIVERY => Mage::helper('pptrack')->__('Out For Delivery'),
112
+ self::STATUS_DELIVERED => Mage::helper('pptrack')->__('Delivered'),
113
+ );
114
+ }
115
+
116
+ /**
117
+ * Update unix times
118
+ *
119
+ * @return mixed
120
+ */
121
+ protected function _beforeSave()
122
+ {
123
+ //new model
124
+ if (!$this->getId()) {
125
+ $this->hash = $this->_generateHash();
126
+ $this->created_at = time();
127
+ }
128
+ $this->updated_at = time();
129
+
130
+ return parent::_beforeSave();
131
+ }
132
+
133
+ /**
134
+ * Generate UUID (v4) for usage in track details url backlink
135
+ *
136
+ * @return string
137
+ */
138
+ protected function _generateHash()
139
+ {
140
+ return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
141
+
142
+ // 32 bits for "time_low"
143
+ mt_rand(0, 0xffff), mt_rand(0, 0xffff),
144
+
145
+ // 16 bits for "time_mid"
146
+ mt_rand(0, 0xffff),
147
+
148
+ // 16 bits for "time_hi_and_version",
149
+ // four most significant bits holds version number 4
150
+ mt_rand(0, 0x0fff) | 0x4000,
151
+
152
+ // 16 bits, 8 bits for "clk_seq_hi_res",
153
+ // 8 bits for "clk_seq_low",
154
+ // two most significant bits holds zero and one for variant DCE1.1
155
+ mt_rand(0, 0x3fff) | 0x8000,
156
+
157
+ // 48 bits for "node"
158
+ mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
159
+ );
160
+ }
161
+
162
+ /**
163
+ * Updates model info from API
164
+ */
165
+ protected function _fetchData()
166
+ {
167
+ $helper = Mage::helper('pptrack');
168
+ $res = $helper->getTrackingInfo($this->getCarrierCode(), $this->getCode());
169
+
170
+ //map new data to current model
171
+ if ($res && $res["statusCode"] == 200) {
172
+ $info = $res["body"];
173
+ $this->apiResponseData = $info;
174
+
175
+ $this->updateInfo($info);
176
+
177
+ //Track details info
178
+ if (isset($info['track_details']) && $info['track_details']) {
179
+ //remove old details
180
+ $list = $this->getDetails();
181
+ foreach ($list as $model) {
182
+ $model->delete();
183
+ }
184
+ $this->_details = array();
185
+
186
+ foreach ($info['track_details'] as $detailInfo) {
187
+ $model = Mage::getModel('pptrack/trackdetail');
188
+ $model->track_id = $this->getId();
189
+ $model->updateInfo($detailInfo);
190
+ $this->_details[] = $model;
191
+ }
192
+ }
193
+
194
+ }
195
+ }
196
+
197
+ public function updateApiData()
198
+ {
199
+ $this->_fetchData();
200
+ }
201
+
202
+ /**
203
+ * Update Track info
204
+ *
205
+ * @param array $data
206
+ */
207
+ public function updateInfo($data)
208
+ {
209
+ foreach (self::$mapCols as $field) {
210
+ if (isset($data[$field]))
211
+ $this->$field = $data[$field];
212
+ }
213
+
214
+ $this->save();
215
+ }
216
+
217
+ /**
218
+ * Get Tracking info by order and tracking code
219
+ *
220
+ * @param int $orderId
221
+ * @param string $code
222
+ * @param bool $fetchData Fetch new data from API
223
+ * @return $this
224
+ */
225
+ public function loadByOrder($orderId, $code, $fetchData = true)
226
+ {
227
+ $collection = Mage::getModel('pptrack/track')
228
+ ->getCollection()
229
+ ->addFieldToFilter('code', array('eq' => $code))
230
+ ->addFieldToFilter('order_id', array('eq' => $orderId));
231
+ $trackModel = $collection->getFirstItem();
232
+ $this->setData($trackModel->getData());
233
+
234
+ if ($this->getId() && $fetchData) {
235
+ $this->_fetchData();
236
+ }
237
+
238
+ return $this;
239
+ }
240
+
241
+ /**
242
+ * Get Tracking info by carrier and tracking code
243
+ *
244
+ * @param string $carrier
245
+ * @param string $code
246
+ * @return $this
247
+ */
248
+ public function loadByCarrierAndCode($carrier, $code)
249
+ {
250
+ $collection = Mage::getModel('pptrack/track')
251
+ ->getCollection()
252
+ ->addFieldToFilter('code', array('eq' => $code))
253
+ ->addFieldToFilter('carrier_code', array('eq' => $carrier));
254
+ $trackModel = $collection->getFirstItem();
255
+ $this->setData($trackModel->getData());
256
+
257
+ return $this;
258
+ }
259
+
260
+ /**
261
+ * Get Tracking info by hash string
262
+ *
263
+ * @param string $hash
264
+ * @param bool $fetchData Fetch new data from API
265
+ */
266
+ public function loadInfoByHash($hash, $fetchData = true)
267
+ {
268
+ $this->load($hash, 'hash');
269
+
270
+ if ($this->getId() && $fetchData) {
271
+ $this->_fetchData();
272
+ }
273
+ }
274
+
275
+ /**
276
+ * Get track details
277
+ *
278
+ * @return array
279
+ */
280
+ public function getDetails()
281
+ {
282
+ if ($this->_details === null) {
283
+ if ($this->isEmpty()) {
284
+ return array();
285
+ }
286
+
287
+ $this->_details = Mage::getModel('pptrack/trackdetail')
288
+ ->getCollection()
289
+ ->addFieldToFilter('track_id', array('eq' => $this->getId()))
290
+ ->getItems();
291
+ }
292
+
293
+ return $this->_details;
294
+ }
295
+
296
+ /**
297
+ * Get shipping information
298
+ *
299
+ * @return array
300
+ */
301
+ public function getShippingInfo()
302
+ {
303
+ if($this->_shippingInfo === null) {
304
+ if ($this->isEmpty()) {
305
+ return array();
306
+ }
307
+
308
+ $order = Mage::getModel('sales/order')->load($this->getOrderId());
309
+ if ($order->getId()) {
310
+ $address = $order->getShippingAddress();
311
+ if ($address->getId()) {
312
+ $shippingInfo = $address->getData();
313
+
314
+ $this->_shippingInfo = $shippingInfo;
315
+ }
316
+ }
317
+ }
318
+ return $this->_shippingInfo;
319
+ }
320
+
321
+ /**
322
+ * Get Track details url
323
+ */
324
+ public function getDetailsUrl()
325
+ {
326
+ $order = Mage::getModel('sales/order')->load($this->order_id);
327
+
328
+ // $orders = Mage::getModel('sales/order')->getCollection()
329
+ // ->setOrder('created_at','DESC')
330
+ // ->addFieldToFilter('id', array('eq' => $this->order_id))
331
+ // ->setPageSize(1)
332
+ // ->setCurPage(1);
333
+ // $order = $orders->getFirstItem();
334
+
335
+ $url = Mage::getUrl('pptrack') . '?email=' . $order->customer_email . '&order=' . $order->getIncrementId();
336
+
337
+ return $url;
338
+ }
339
+
340
+ public function getUnsubscribeLink()
341
+ {
342
+ $url = Mage::getUrl('pptrack/unsubscribe') . '?h=' . $this->hash;
343
+
344
+ return $url;
345
+ }
346
+
347
+ /**
348
+ * Try to sync this model with API
349
+ * @param bool $waitForResponse
350
+ */
351
+ public function updateApi($waitForResponse = false)
352
+ {
353
+ $helper = Mage::helper('pptrack');
354
+
355
+ $submitted = $this->getSubmitted();
356
+
357
+ if ($submitted == Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_PENDING) {
358
+ $res = $helper->addTrackingCode(
359
+ $this->getCarrierCode(),
360
+ $this->getCode(),
361
+ $this->getCarrierName(),
362
+ $this->getPostalCode(),
363
+ $this->getDestinationCountry(),
364
+ $this->getShipDate(),
365
+ $this->getOrderId(),
366
+ $waitForResponse
367
+ );
368
+
369
+ //400 statuscode goes for "tracking already in the list"
370
+ if ($res && in_array($res["statusCode"], array(201, 400))) {
371
+ $this->setSubmitted(Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_SENT);
372
+
373
+ $this->save();
374
+ }
375
+ }
376
+ elseif ($submitted == Packpin_Pptrack_Model_Track::TYPE_SUBMITTED_REMOVE_PENDING) {
377
+ $res = $helper->removeTrackingCode(
378
+ $this->getCarrierCode(),
379
+ $this->getCode()
380
+ );
381
+
382
+ //404 goes for already removed
383
+ if ($res && in_array($res["statusCode"], array(200, 204, 404))) {
384
+ $this->delete();
385
+ }
386
+ }
387
+ }
388
+
389
+ /**
390
+ * Get given status css class compared to current status
391
+ *
392
+ * @param $status
393
+ * @return string
394
+ */
395
+ public function getStatusClass($status)
396
+ {
397
+ $list = self::getOrderedStatusList();
398
+
399
+ if (!isset($list[$status]) || !isset($list[$this->getStatus()]))
400
+ return '';
401
+
402
+ if ($list[$status] < $list[$this->getStatus()])
403
+ return 'done';
404
+ elseif ($list[$status] == $list[$this->getStatus()])
405
+ return 'active';
406
+
407
+ return '';
408
+ }
409
+
410
+ /**
411
+ * @return mixed
412
+ */
413
+ public function getOrderNumber()
414
+ {
415
+ $order = Mage::getModel('sales/order')->load($this->getOrderId());
416
+
417
+ return $order->getIncrementId();
418
+ }
419
+
420
+ /**
421
+ * Get carrier model
422
+ *
423
+ * @return array
424
+ */
425
+ public function getCarrier()
426
+ {
427
+ if ($this->_carrier === null) {
428
+ $this->_carrier = Mage::getModel('pptrack/carrier')
429
+ ->load($this->getCarrierCode(), 'code');
430
+ }
431
+
432
+ return $this->_carrier;
433
+ }
434
+
435
+ /**
436
+ * @return string
437
+ */
438
+ public function getCarrierIcon()
439
+ {
440
+ $carrier = $this->getCarrier();
441
+ if ($carrier && $carrier->getId()) {
442
+ return $carrier->getIconUrl();
443
+ }
444
+
445
+ return '';
446
+ }
447
+
448
+ /**
449
+ * @return string
450
+ */
451
+ public function getCarrierName()
452
+ {
453
+ $carrier = $this->getCarrier();
454
+ if ($carrier && $carrier->getId()) {
455
+ return $carrier->getName();
456
+ }
457
+
458
+ return '';
459
+ }
460
+
461
+ /**
462
+ * @return string
463
+ */
464
+ public function getCarrierPhone()
465
+ {
466
+ $carrier = $this->getCarrier();
467
+ if ($carrier && $carrier->getId()) {
468
+ return $carrier->getPhone();
469
+ }
470
+
471
+ return '';
472
+ }
473
+
474
+ /**
475
+ * @return string
476
+ */
477
+ public function getCarrierHomepage()
478
+ {
479
+ $carrier = $this->getCarrier();
480
+ if ($carrier && $carrier->getId()) {
481
+ return $carrier->getHomepage();
482
+ }
483
+
484
+ return '';
485
+ }
486
+
487
+ /**
488
+ * @return string
489
+ */
490
+ public function getShippingDate($format = 'medium')
491
+ {
492
+ $time = $this->getCreatedAt();
493
+
494
+ $dateFormatted = Mage::helper('core')->formatTime(date("Y-m-d H:i:s", $time), $format, true);
495
+ return $dateFormatted;
496
+ }
497
+
498
+ public function getTotalCount()
499
+ {
500
+ $count = $this->getCollection()
501
+ ->getSize();
502
+
503
+ return $count;
504
+ }
505
+
506
+ public function getEstimatedDelivery()
507
+ {
508
+ if (isset($this->apiResponseData['estimated_delivery'])) {
509
+ return Mage::helper('core')->formatDate($this->apiResponseData['estimated_delivery'], 'full', false);
510
+ }
511
+ }
512
+
513
+ /**
514
+ * Get package status as string
515
+ * @return string
516
+ */
517
+ public function getStatusString()
518
+ {
519
+ $list = self::getStatusStrings();
520
+
521
+ if (!isset($list[$this->getStatus()]))
522
+ return '';
523
+
524
+ return $list[$this->getStatus()];
525
+ }
526
+
527
+ }
app/code/community/Packpin/Pptrack/Model/Trackdetail.php CHANGED
@@ -1,90 +1,90 @@
1
- <?php
2
-
3
- /**
4
- * Class Packpin_Pptrack_Model_Trackdetail
5
- *
6
- * Model for pp_track_details table
7
- */
8
- class Packpin_Pptrack_Model_Trackdetail extends Mage_Core_Model_Abstract
9
- {
10
- protected function _construct()
11
- {
12
- $this->_init('pptrack/trackdetail');
13
- }
14
-
15
- /**
16
- * Data fields we can map with API data
17
- *
18
- * @var array
19
- */
20
- public static $mapCols = array(
21
- 'carrier',
22
- 'status',
23
- 'status_string',
24
- 'event_date',
25
- 'event_time',
26
- 'address',
27
- 'country',
28
- );
29
-
30
- /**
31
- * Update Track detail info
32
- *
33
- * @param array $data
34
- */
35
- public function updateInfo($data)
36
- {
37
- foreach (self::$mapCols as $field) {
38
- if (isset($data[$field])) {
39
- if ($field == 'address') {
40
- $params = array(
41
- 'address',
42
- 'state',
43
- 'zip',
44
- );
45
- $address = '';
46
- foreach ($params as $param) {
47
- if (isset($data[$param]) && $data[$param]) {
48
- if ($address)
49
- $address .= ', ';
50
- $address .= ' ' . $data[$param];
51
- }
52
- }
53
- $this->$field = $address;
54
- }
55
- else {
56
- $this->$field = $data[$field];
57
- }
58
- }
59
- }
60
-
61
- $this->save();
62
- }
63
-
64
- /**
65
- * Get event location string
66
- *
67
- * @return mixed|string
68
- */
69
- public function getLocation()
70
- {
71
- // if ($this->address)
72
- // return $this->address;
73
-
74
- $params = array(
75
- 'address',
76
- 'country',
77
- );
78
- $address = '';
79
- foreach ($params as $param) {
80
- if ($this->$param) {
81
- if ($address)
82
- $address .= ', ';
83
- $address .= ' ' . $this->$param;
84
- }
85
- }
86
- return $address;
87
- }
88
-
89
-
90
  }
1
+ <?php
2
+
3
+ /**
4
+ * Class Packpin_Pptrack_Model_Trackdetail
5
+ *
6
+ * Model for pp_track_details table
7
+ */
8
+ class Packpin_Pptrack_Model_Trackdetail extends Mage_Core_Model_Abstract
9
+ {
10
+ protected function _construct()
11
+ {
12
+ $this->_init('pptrack/trackdetail');
13
+ }
14
+
15
+ /**
16
+ * Data fields we can map with API data
17
+ *
18
+ * @var array
19
+ */
20
+ public static $mapCols = array(
21
+ 'carrier',
22
+ 'status',
23
+ 'status_string',
24
+ 'event_date',
25
+ 'event_time',
26
+ 'address',
27
+ 'country',
28
+ );
29
+
30
+ /**
31
+ * Update Track detail info
32
+ *
33
+ * @param array $data
34
+ */
35
+ public function updateInfo($data)
36
+ {
37
+ foreach (self::$mapCols as $field) {
38
+ if (isset($data[$field])) {
39
+ if ($field == 'address') {
40
+ $params = array(
41
+ 'address',
42
+ 'state',
43
+ 'zip',
44
+ );
45
+ $address = '';
46
+ foreach ($params as $param) {
47
+ if (isset($data[$param]) && $data[$param]) {
48
+ if ($address)
49
+ $address .= ', ';
50
+ $address .= ' ' . $data[$param];
51
+ }
52
+ }
53
+ $this->$field = $address;
54
+ }
55
+ else {
56
+ $this->$field = $data[$field];
57
+ }
58
+ }
59
+ }
60
+
61
+ $this->save();
62
+ }
63
+
64
+ /**
65
+ * Get event location string
66
+ *
67
+ * @return mixed|string
68
+ */
69
+ public function getLocation()
70
+ {
71
+ // if ($this->address)
72
+ // return $this->address;
73
+
74
+ $params = array(
75
+ 'address',
76
+ 'country',
77
+ );
78
+ $address = '';
79
+ foreach ($params as $param) {
80
+ if ($this->$param) {
81
+ if ($address)
82
+ $address .= ', ';
83
+ $address .= ' ' . $this->$param;
84
+ }
85
+ }
86
+ return $address;
87
+ }
88
+
89
+
90
  }
app/code/community/Packpin/Pptrack/Model/Trackunsubscribed.php CHANGED
@@ -1,31 +1,31 @@
1
- <?php
2
-
3
- /**
4
- * Class Packpin_Pptrack_Model_Trackunsubscribed
5
- *
6
- * Model for pp_tracks_unsubscribed table
7
- */
8
- class Packpin_Pptrack_Model_Trackunsubscribed extends Mage_Core_Model_Abstract
9
- {
10
-
11
- protected function _construct()
12
- {
13
- $this->_init('pptrack/trackunsubscribed');
14
- }
15
-
16
- public function unsubscribeTrack($trackId)
17
- {
18
- $this->load($trackId, 'track_id');
19
-
20
- if ($this->getId()) {
21
- return false;
22
- }
23
- else {
24
- $this->setTrackId($trackId);
25
- $this->save();
26
-
27
- return true;
28
- }
29
- }
30
-
31
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class Packpin_Pptrack_Model_Trackunsubscribed
5
+ *
6
+ * Model for pp_tracks_unsubscribed table
7
+ */
8
+ class Packpin_Pptrack_Model_Trackunsubscribed extends Mage_Core_Model_Abstract
9
+ {
10
+
11
+ protected function _construct()
12
+ {
13
+ $this->_init('pptrack/trackunsubscribed');
14
+ }
15
+
16
+ public function unsubscribeTrack($trackId)
17
+ {
18
+ $this->load($trackId, 'track_id');
19
+
20
+ if ($this->getId()) {
21
+ return false;
22
+ }
23
+ else {
24
+ $this->setTrackId($trackId);
25
+ $this->save();
26
+
27
+ return true;
28
+ }
29
+ }
30
+
31
+ }
app/code/community/Packpin/Pptrack/Model/Translate.php CHANGED
@@ -1,39 +1,39 @@
1
- <?php
2
-
3
- /**
4
- * Class Packpin_Pptrack_Model_Translate
5
- * Temporary override email processing to include back link to shop
6
- *
7
- * Used for dirty shipment back link injection
8
- * Hope temporary o_0
9
- */
10
- class Packpin_Pptrack_Model_Translate extends Mage_Core_Model_Translate
11
- {
12
- /**
13
- * Retrieve translated template file
14
- *
15
- * @param string $file
16
- * @param string $type
17
- * @param string $localeCode
18
- * @return string
19
- */
20
- public function getTemplateFile($file, $type, $localeCode=null)
21
- {
22
- $fileContent = parent::getTemplateFile($file, $type, $localeCode);
23
-
24
- $config = Mage::getStoreConfig('pp_section_setttings/settings');
25
- if (!$config['status'])
26
- return $fileContent;
27
-
28
- if (in_array($file, array('sales/shipment_new.html', 'sales/shipment_new_guest.html'))) {
29
- $newBlock = '{{block type=\'pptrack/trackings\' area=\'frontend\' template=\'pptrack/email/order/shipment/track.phtml\' shipment=$shipment order=$order}}';
30
-
31
- //replace trackings table if found
32
- if (preg_match('#{{[^}]+track\.phtml[^}]+}}#ui', $fileContent, $m)) {
33
- $fileContent = preg_replace('#{{[^}]+track\.phtml[^}]+}}#ui', $newBlock, $fileContent);
34
- }
35
- }
36
-
37
- return $fileContent;
38
- }
39
  }
1
+ <?php
2
+
3
+ /**
4
+ * Class Packpin_Pptrack_Model_Translate
5
+ * Temporary override email processing to include back link to shop
6
+ *
7
+ * Used for dirty shipment back link injection
8
+ * Hope temporary o_0
9
+ */
10
+ class Packpin_Pptrack_Model_Translate extends Mage_Core_Model_Translate
11
+ {
12
+ /**
13
+ * Retrieve translated template file
14
+ *
15
+ * @param string $file
16
+ * @param string $type
17
+ * @param string $localeCode
18
+ * @return string
19
+ */
20
+ public function getTemplateFile($file, $type, $localeCode=null)
21
+ {
22
+ $fileContent = parent::getTemplateFile($file, $type, $localeCode);
23
+
24
+ $config = Mage::getStoreConfig('pp_section_setttings/settings');
25
+ if (!$config['status'])
26
+ return $fileContent;
27
+
28
+ if (in_array($file, array('sales/shipment_new.html', 'sales/shipment_new_guest.html'))) {
29
+ $newBlock = '{{block type=\'pptrack/trackings\' area=\'frontend\' template=\'pptrack/email/order/shipment/track.phtml\' shipment=$shipment order=$order}}';
30
+
31
+ //replace trackings table if found
32
+ if (preg_match('#{{[^}]+track\.phtml[^}]+}}#ui', $fileContent, $m)) {
33
+ $fileContent = preg_replace('#{{[^}]+track\.phtml[^}]+}}#ui', $newBlock, $fileContent);
34
+ }
35
+ }
36
+
37
+ return $fileContent;
38
+ }
39
  }
app/code/community/Packpin/Pptrack/Model/Visit.php CHANGED
@@ -1,24 +1,24 @@
1
- <?php
2
-
3
- /**
4
- * Class Packpin_Pptrack_Model_Visit
5
- *
6
- * Model for pp_visits table
7
- */
8
- class Packpin_Pptrack_Model_Visit extends Mage_Core_Model_Abstract
9
- {
10
-
11
- protected function _construct()
12
- {
13
- $this->_init('pptrack/visit');
14
- }
15
-
16
- public function getTotalCount()
17
- {
18
- $count = $this->getCollection()
19
- ->getSize();
20
-
21
- return $count;
22
- }
23
-
24
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class Packpin_Pptrack_Model_Visit
5
+ *
6
+ * Model for pp_visits table
7
+ */
8
+ class Packpin_Pptrack_Model_Visit extends Mage_Core_Model_Abstract
9
+ {
10
+
11
+ protected function _construct()
12
+ {
13
+ $this->_init('pptrack/visit');
14
+ }
15
+
16
+ public function getTotalCount()
17
+ {
18
+ $count = $this->getCollection()
19
+ ->getSize();
20
+
21
+ return $count;
22
+ }
23
+
24
+ }
app/code/community/Packpin/Pptrack/controllers/Adminhtml/PackpintracksController.php CHANGED
@@ -1,118 +1,118 @@
1
- <?php
2
- class Packpin_Pptrack_Adminhtml_PackpintracksController extends Mage_Adminhtml_Controller_Action
3
- {
4
- protected function _initAction()
5
- {
6
- $this->loadLayout()
7
- ->_setActiveMenu('dashboard/pptrack');
8
-
9
- return $this;
10
- }
11
-
12
- public function dashboardAction()
13
- {
14
- $this->_initAction()
15
- ->_title($this->__('Dashboard'))->_title($this->__('Packpin'))
16
- ->_addBreadcrumb($this->__('Dashboard'), $this->__('Dashboard'))
17
- ->_addBreadcrumb($this->__('pptrack'), $this->__('Packpin'))
18
- ->renderLayout();
19
- }
20
-
21
- public function indexAction()
22
- {
23
- $this->_initAction()
24
- ->_title($this->__('Dashboard'))->_title($this->__('Packpin'))
25
- ->_addBreadcrumb($this->__('Dashboard'), $this->__('Dashboard'))
26
- ->_addBreadcrumb($this->__('pptrack'), $this->__('Packpin'))
27
- ->renderLayout();
28
- }
29
-
30
- public function newAction()
31
- {
32
- // We just forward the new action to a blank edit form
33
- $this->_forward('edit');
34
- }
35
-
36
- public function editAction()
37
- {
38
- $this->_initAction();
39
-
40
- // Get id if available
41
- $id = $this->getRequest()->getParam('id');
42
- $model = Mage::getModel('pptrack/track');
43
-
44
- if ($id) {
45
- // Load record
46
- $model->load($id);
47
-
48
- // Check if record is loaded
49
- if (!$model->getId()) {
50
- Mage::getSingleton('adminhtml/session')->addError($this->__('This Track no longer exists.'));
51
- $this->_redirect('*/*/');
52
-
53
- return;
54
- }
55
- }
56
-
57
- $this->_title($model->getId() ? $model->getName() : $this->__('New Track'));
58
-
59
- $data = Mage::getSingleton('adminhtml/session')->getTracksData(true);
60
- if (!empty($data)) {
61
- $model->setData($data);
62
- }
63
-
64
- Mage::register('pptrack', $model);
65
-
66
- $this->_initAction()
67
- ->_addBreadcrumb($id ? $this->__('Edit Track') : $this->__('New Track'), $id ? $this->__('Edit Track') : $this->__('New Track'))
68
- ->_addContent($this->getLayout()->createBlock('pptrack/adminhtml_tracks_edit')->setData('action', $this->getUrl('*/*/save')))
69
- ->renderLayout();
70
- }
71
-
72
- public function saveAction()
73
- {
74
- if ($postData = $this->getRequest()->getPost()) {
75
- $model = Mage::getSingleton('pptrack/Track');
76
- $model->setData($postData);
77
-
78
- try {
79
- $model->save();
80
-
81
- Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The Track has been saved.'));
82
- $this->_redirect('*/*/');
83
-
84
- return;
85
- }
86
- catch (Mage_Core_Exception $e) {
87
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
88
- }
89
- catch (Exception $e) {
90
- Mage::getSingleton('adminhtml/session')->addError($this->__('An error occurred while saving this track.'));
91
- }
92
-
93
- Mage::getSingleton('adminhtml/session')->setBazData($postData);
94
- $this->_redirectReferer();
95
- }
96
- }
97
-
98
- public function messageAction()
99
- {
100
- $data = Mage::getModel('pptrack/Track')->load($this->getRequest()->getParam('id'));
101
- echo $data->getContent();
102
- }
103
-
104
- public function exportTracksCsvAction()
105
- {
106
- $fileName = 'tracks.csv';
107
- $grid = $this->getLayout()->createBlock('pptrack/adminhtml_tracks_grid');
108
- $this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
109
- }
110
-
111
- public function exportTracksExcelAction()
112
- {
113
- $fileName = 'tracks.xml';
114
- $grid = $this->getLayout()->createBlock('pptrack/adminhtml_tracks_grid');
115
- $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));
116
- }
117
-
118
  }
1
+ <?php
2
+ class Packpin_Pptrack_Adminhtml_PackpintracksController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ protected function _initAction()
5
+ {
6
+ $this->loadLayout()
7
+ ->_setActiveMenu('dashboard/pptrack');
8
+
9
+ return $this;
10
+ }
11
+
12
+ public function dashboardAction()
13
+ {
14
+ $this->_initAction()
15
+ ->_title($this->__('Dashboard'))->_title($this->__('Packpin'))
16
+ ->_addBreadcrumb($this->__('Dashboard'), $this->__('Dashboard'))
17
+ ->_addBreadcrumb($this->__('pptrack'), $this->__('Packpin'))
18
+ ->renderLayout();
19
+ }
20
+
21
+ public function indexAction()
22
+ {
23
+ $this->_initAction()
24
+ ->_title($this->__('Dashboard'))->_title($this->__('Packpin'))
25
+ ->_addBreadcrumb($this->__('Dashboard'), $this->__('Dashboard'))
26
+ ->_addBreadcrumb($this->__('pptrack'), $this->__('Packpin'))
27
+ ->renderLayout();
28
+ }
29
+
30
+ public function newAction()
31
+ {
32
+ // We just forward the new action to a blank edit form
33
+ $this->_forward('edit');
34
+ }
35
+
36
+ public function editAction()
37
+ {
38
+ $this->_initAction();
39
+
40
+ // Get id if available
41
+ $id = $this->getRequest()->getParam('id');
42
+ $model = Mage::getModel('pptrack/track');
43
+
44
+ if ($id) {
45
+ // Load record
46
+ $model->load($id);
47
+
48
+ // Check if record is loaded
49
+ if (!$model->getId()) {
50
+ Mage::getSingleton('adminhtml/session')->addError($this->__('This Track no longer exists.'));
51
+ $this->_redirect('*/*/');
52
+
53
+ return;
54
+ }
55
+ }
56
+
57
+ $this->_title($model->getId() ? $model->getName() : $this->__('New Track'));
58
+
59
+ $data = Mage::getSingleton('adminhtml/session')->getTracksData(true);
60
+ if (!empty($data)) {
61
+ $model->setData($data);
62
+ }
63
+
64
+ Mage::register('pptrack', $model);
65
+
66
+ $this->_initAction()
67
+ ->_addBreadcrumb($id ? $this->__('Edit Track') : $this->__('New Track'), $id ? $this->__('Edit Track') : $this->__('New Track'))
68
+ ->_addContent($this->getLayout()->createBlock('pptrack/adminhtml_tracks_edit')->setData('action', $this->getUrl('*/*/save')))
69
+ ->renderLayout();
70
+ }
71
+
72
+ public function saveAction()
73
+ {
74
+ if ($postData = $this->getRequest()->getPost()) {
75
+ $model = Mage::getSingleton('pptrack/Track');
76
+ $model->setData($postData);
77
+
78
+ try {
79
+ $model->save();
80
+
81
+ Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The Track has been saved.'));
82
+ $this->_redirect('*/*/');
83
+
84
+ return;
85
+ }
86
+ catch (Mage_Core_Exception $e) {
87
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
88
+ }
89
+ catch (Exception $e) {
90
+ Mage::getSingleton('adminhtml/session')->addError($this->__('An error occurred while saving this track.'));
91
+ }
92
+
93
+ Mage::getSingleton('adminhtml/session')->setBazData($postData);
94
+ $this->_redirectReferer();
95
+ }
96
+ }
97
+
98
+ public function messageAction()
99
+ {
100
+ $data = Mage::getModel('pptrack/Track')->load($this->getRequest()->getParam('id'));
101
+ echo $data->getContent();
102
+ }
103
+
104
+ public function exportTracksCsvAction()
105
+ {
106
+ $fileName = 'tracks.csv';
107
+ $grid = $this->getLayout()->createBlock('pptrack/adminhtml_tracks_grid');
108
+ $this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
109
+ }
110
+
111
+ public function exportTracksExcelAction()
112
+ {
113
+ $fileName = 'tracks.xml';
114
+ $grid = $this->getLayout()->createBlock('pptrack/adminhtml_tracks_grid');
115
+ $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));
116
+ }
117
+
118
  }
app/code/community/Packpin/Pptrack/controllers/Adminhtml/PpnotificationsController.php CHANGED
@@ -1,29 +1,29 @@
1
- <?php
2
- class Packpin_Pptrack_Adminhtml_PpnotificationsController extends Mage_Adminhtml_Controller_Action
3
- {
4
- protected function _initAction()
5
- {
6
- $this->loadLayout()
7
- ->_setActiveMenu('packpin/pptrack');
8
-
9
- return $this;
10
- }
11
-
12
- public function indexAction()
13
- {
14
- $this->_initAction()
15
- ->_title(Mage::helper('pptrack')->__("Packpin Notifications"))
16
- ->renderLayout();
17
- }
18
-
19
- /**
20
- * Notification setting page
21
- */
22
- public function settingsAction()
23
- {
24
- $this->_initAction()
25
- ->_title(Mage::helper('pptrack')->__("Packpin Notification Settings"))
26
- ->renderLayout();
27
- }
28
-
29
  }
1
+ <?php
2
+ class Packpin_Pptrack_Adminhtml_PpnotificationsController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ protected function _initAction()
5
+ {
6
+ $this->loadLayout()
7
+ ->_setActiveMenu('packpin/pptrack');
8
+
9
+ return $this;
10
+ }
11
+
12
+ public function indexAction()
13
+ {
14
+ $this->_initAction()
15
+ ->_title(Mage::helper('pptrack')->__("Packpin Notifications"))
16
+ ->renderLayout();
17
+ }
18
+
19
+ /**
20
+ * Notification setting page
21
+ */
22
+ public function settingsAction()
23
+ {
24
+ $this->_initAction()
25
+ ->_title(Mage::helper('pptrack')->__("Packpin Notification Settings"))
26
+ ->renderLayout();
27
+ }
28
+
29
  }
app/code/community/Packpin/Pptrack/controllers/IndexController.php CHANGED
@@ -1,39 +1,39 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_IndexController extends Mage_Core_Controller_Front_Action
4
- {
5
- public function indexAction()
6
- {
7
- if (isset($_REQUEST['PPTRACK_DEBUG'])) {
8
- restore_error_handler();
9
- error_reporting(E_ALL);
10
- ini_set("display_errors", "on");
11
- }
12
-
13
-
14
- $this->loadLayout();
15
- $this->getLayout()->getBlock("head")->setTitle(Mage::helper('pptrack')->__("Shipment status"));
16
- $breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
17
- $breadcrumbs->addCrumb("home", array(
18
- "label" => $this->__("Home"),
19
- "title" => $this->__("Home"),
20
- "link" => Mage::getBaseUrl()
21
- ));
22
-
23
- $breadcrumbs->addCrumb("shipment status", array(
24
- "label" => Mage::helper('pptrack')->__("Shipment status"),
25
- "title" => Mage::helper('pptrack')->__("Shipment status")
26
- ));
27
-
28
-
29
- $this->renderLayout();
30
-
31
- }
32
-
33
- public function popupAction()
34
- {
35
- $this->loadLayout();
36
- $this->getLayout()->getBlock("head")->setTitle(Mage::helper('pptrack')->__("Shipment status"));
37
- $this->renderLayout();
38
- }
39
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_IndexController extends Mage_Core_Controller_Front_Action
4
+ {
5
+ public function indexAction()
6
+ {
7
+ if (isset($_REQUEST['PPTRACK_DEBUG'])) {
8
+ restore_error_handler();
9
+ error_reporting(E_ALL);
10
+ ini_set("display_errors", "on");
11
+ }
12
+
13
+
14
+ $this->loadLayout();
15
+ $this->getLayout()->getBlock("head")->setTitle(Mage::helper('pptrack')->__("Shipment status"));
16
+ $breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
17
+ $breadcrumbs->addCrumb("home", array(
18
+ "label" => $this->__("Home"),
19
+ "title" => $this->__("Home"),
20
+ "link" => Mage::getBaseUrl()
21
+ ));
22
+
23
+ $breadcrumbs->addCrumb("shipment status", array(
24
+ "label" => Mage::helper('pptrack')->__("Shipment status"),
25
+ "title" => Mage::helper('pptrack')->__("Shipment status")
26
+ ));
27
+
28
+
29
+ $this->renderLayout();
30
+
31
+ }
32
+
33
+ public function popupAction()
34
+ {
35
+ $this->loadLayout();
36
+ $this->getLayout()->getBlock("head")->setTitle(Mage::helper('pptrack')->__("Shipment status"));
37
+ $this->renderLayout();
38
+ }
39
  }
app/code/community/Packpin/Pptrack/controllers/UnsubscribeController.php CHANGED
@@ -1,31 +1,31 @@
1
- <?php
2
-
3
- class Packpin_Pptrack_UnsubscribeController extends Mage_Core_Controller_Front_Action
4
- {
5
- public function indexAction(){
6
-
7
- $model = Mage::getModel('pptrack/track');
8
- $hash = Mage::app()->getRequest()->getParam('h');
9
- if ($hash) {
10
- $model->loadInfoByHash($hash);
11
-
12
- if($model->getId()) {
13
- $unsubscribedModel = Mage::getModel('pptrack/trackunsubscribed');
14
- $res = $unsubscribedModel->unsubscribeTrack($model->getId());
15
- if($res) {
16
- Mage::getSingleton('core/session')->addSuccess(Mage::helper('pptrack')->__('You have successfully unsubscribed from package status updates'));
17
- }
18
- else {
19
- Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__('Subscription not found or already unsubscribed!'));
20
- }
21
- }
22
- else {
23
- Mage::getSingleton('core/session')->addError(Mage::helper('pptrack')->__('Tracking info not found!'));
24
- }
25
- }
26
-
27
- $this->loadLayout();
28
- $this->getLayout()->getBlock("head")->setTitle(Mage::helper('pptrack')->__("Unsubscribe"));
29
- $this->renderLayout();
30
- }
31
  }
1
+ <?php
2
+
3
+ class Packpin_Pptrack_UnsubscribeController extends Mage_Core_Controller_Front_Action
4
+ {
5
+ public function indexAction(){
6
+
7
+ $model = Mage::getModel('pptrack/track');
8
+ $hash = Mage::app()->getRequest()->getParam('h');
9
+ if ($hash) {
10
+ $model->loadInfoByHash($hash);
11
+
12
+ if($model->getId()) {
13
+ $unsubscribedModel = Mage::getModel('pptrack/trackunsubscribed');
14
+ $res = $unsubscribedModel->unsubscribeTrack($model->getId());
15
+ if($res) {
16
+ Mage::getSingleton('core/session')->addSuccess(Mage::helper('pptrack')->__('You have successfully unsubscribed from package status updates'));
17
+ }
18
+ else {
19
+ Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__('Subscription not found or already unsubscribed!'));
20
+ }
21
+ }
22
+ else {
23
+ Mage::getSingleton('core/session')->addError(Mage::helper('pptrack')->__('Tracking info not found!'));
24
+ }
25
+ }
26
+
27
+ $this->loadLayout();
28
+ $this->getLayout()->getBlock("head")->setTitle(Mage::helper('pptrack')->__("Unsubscribe"));
29
+ $this->renderLayout();
30
+ }
31
  }
app/code/community/Packpin/Pptrack/controllers/unsubscribeController.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Packpin_Pptrack_UnsubscribeController extends Mage_Core_Controller_Front_Action
4
+ {
5
+ public function indexAction(){
6
+
7
+ $model = Mage::getModel('pptrack/track');
8
+ $hash = Mage::app()->getRequest()->getParam('h');
9
+ if ($hash) {
10
+ $model->loadInfoByHash($hash);
11
+
12
+ if($model->getId()) {
13
+ $unsubscribedModel = Mage::getModel('pptrack/trackunsubscribed');
14
+ $res = $unsubscribedModel->unsubscribeTrack($model->getId());
15
+ if($res) {
16
+ Mage::getSingleton('core/session')->addSuccess(Mage::helper('pptrack')->__('You have successfully unsubscribed from package status updates'));
17
+ }
18
+ else {
19
+ Mage::getSingleton('core/session')->addWarning(Mage::helper('pptrack')->__('Subscription not found or already unsubscribed!'));
20
+ }
21
+ }
22
+ else {
23
+ Mage::getSingleton('core/session')->addError(Mage::helper('pptrack')->__('Tracking info not found!'));
24
+ }
25
+ }
26
+
27
+ $this->loadLayout();
28
+ $this->getLayout()->getBlock("head")->setTitle(Mage::helper('pptrack')->__("Unsubscribe"));
29
+ $this->renderLayout();
30
+ }
31
+ }
app/code/community/Packpin/Pptrack/data/pptrack_setup/data-upgrade-0.1.5-1.1.0.php CHANGED
@@ -1,33 +1,33 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
-
7
- //generate temp API key
8
- $helper = Mage::helper('pptrack');
9
- $key = Mage::getStoreConfig('pp_section_setttings/settings/api_key');
10
-
11
- if (!$key) {
12
- try {
13
- $newKey = $helper->generateTempKey();
14
-
15
- if ($newKey) {
16
- $this->setConfigData('pp_section_setttings/settings/api_key', $newKey);
17
- $this->setConfigData('pp_section_setttings/settings/temp_api_key', $newKey);
18
- $this->setConfigData('pp_section_setttings/settings/temp_key_installed', time());
19
- }
20
- else {
21
- $this->setConfigData('pp_section_setttings/settings/status', 0);
22
- }
23
- } catch (Exception $e) {
24
- $this->setConfigData('pp_section_setttings/settings/status', 0);
25
- }
26
- }
27
-
28
- $installer->endSetup();
29
-
30
-
31
-
32
-
33
-
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ //generate temp API key
8
+ $helper = Mage::helper('pptrack');
9
+ $key = Mage::getStoreConfig('pp_section_setttings/settings/api_key');
10
+
11
+ if (!$key) {
12
+ try {
13
+ $newKey = $helper->generateTempKey();
14
+
15
+ if ($newKey) {
16
+ $this->setConfigData('pp_section_setttings/settings/api_key', $newKey);
17
+ $this->setConfigData('pp_section_setttings/settings/temp_api_key', $newKey);
18
+ $this->setConfigData('pp_section_setttings/settings/temp_key_installed', time());
19
+ }
20
+ else {
21
+ $this->setConfigData('pp_section_setttings/settings/status', 0);
22
+ }
23
+ } catch (Exception $e) {
24
+ $this->setConfigData('pp_section_setttings/settings/status', 0);
25
+ }
26
+ }
27
+
28
+ $installer->endSetup();
29
+
30
+
31
+
32
+
33
+
app/code/community/Packpin/Pptrack/etc/adminhtml.xml CHANGED
@@ -1,61 +1,61 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <layout>
4
- <updates>
5
- <pptrack>
6
- <file>pptrack.xml</file>
7
- </pptrack>
8
- </updates>
9
- </layout>
10
- <menu>
11
- <dashboard>
12
- <children>
13
- <packpin_pptrack translate="title" module="pptrack">
14
- <title>Packpin Dashboard</title>
15
- <sort_order>903</sort_order>
16
- <!--depends>
17
- <module>Packpin_Pptrack</module>
18
- </depends-->
19
- <action>adminhtml/packpintracks/dashboard</action>
20
- </packpin_pptrack>
21
- </children>
22
- </dashboard>
23
- </menu>
24
- <acl>
25
- <resources>
26
- <admin>
27
- <children>
28
- <dashboard>
29
- <children>
30
- <packpin_pptrack translate="title" module="pptrack">
31
- <title>Packpim Dashboard</title>
32
- <sort_order>903</sort_order>
33
- <action>adminhtml/packpintracks/dashboard</action>
34
- </packpin_pptrack>
35
- </children>
36
- </dashboard>
37
- <system>
38
- <children>
39
- <config>
40
- <children>
41
- <pp_section_setttings translate="title" module="pptrack">
42
- <title>Packpin General Settings Section</title>
43
- <sort_order>51001</sort_order>
44
- </pp_section_setttings>
45
- <pp_section_notification_emails translate="title" module="pptrack">
46
- <title>Packpin Notification Emails</title>
47
- <sort_order>51002</sort_order>
48
- </pp_section_notification_emails>
49
- <pp_section_carriers translate="title" module="pptrack">
50
- <title>Packpin Carrier Settings</title>
51
- <sort_order>51003</sort_order>
52
- </pp_section_carriers>
53
- </children>
54
- </config>
55
- </children>
56
- </system>
57
- </children>
58
- </admin>
59
- </resources>
60
- </acl>
61
  </config>
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <layout>
4
+ <updates>
5
+ <pptrack>
6
+ <file>pptrack.xml</file>
7
+ </pptrack>
8
+ </updates>
9
+ </layout>
10
+ <menu>
11
+ <dashboard>
12
+ <children>
13
+ <packpin_pptrack translate="title" module="pptrack">
14
+ <title>Packpin Dashboard</title>
15
+ <sort_order>903</sort_order>
16
+ <!--depends>
17
+ <module>Packpin_Pptrack</module>
18
+ </depends-->
19
+ <action>adminhtml/packpintracks/dashboard</action>
20
+ </packpin_pptrack>
21
+ </children>
22
+ </dashboard>
23
+ </menu>
24
+ <acl>
25
+ <resources>
26
+ <admin>
27
+ <children>
28
+ <dashboard>
29
+ <children>
30
+ <packpin_pptrack translate="title" module="pptrack">
31
+ <title>Packpim Dashboard</title>
32
+ <sort_order>903</sort_order>
33
+ <action>adminhtml/packpintracks/dashboard</action>
34
+ </packpin_pptrack>
35
+ </children>
36
+ </dashboard>
37
+ <system>
38
+ <children>
39
+ <config>
40
+ <children>
41
+ <pp_section_setttings translate="title" module="pptrack">
42
+ <title>Packpin General Settings Section</title>
43
+ <sort_order>51001</sort_order>
44
+ </pp_section_setttings>
45
+ <pp_section_notification_emails translate="title" module="pptrack">
46
+ <title>Packpin Notification Emails</title>
47
+ <sort_order>51002</sort_order>
48
+ </pp_section_notification_emails>
49
+ <pp_section_carriers translate="title" module="pptrack">
50
+ <title>Packpin Carrier Settings</title>
51
+ <sort_order>51003</sort_order>
52
+ </pp_section_carriers>
53
+ </children>
54
+ </config>
55
+ </children>
56
+ </system>
57
+ </children>
58
+ </admin>
59
+ </resources>
60
+ </acl>
61
  </config>
app/code/community/Packpin/Pptrack/etc/api.xml CHANGED
@@ -1,43 +1,43 @@
1
- <config>
2
- <api>
3
- <resources>
4
- <pptrack translate="title" module="pptrack">
5
- <title>Packpin Email Resource</title>
6
- <model>pptrack/api</model>
7
- <methods>
8
- <info translate="title" module="pptrack">
9
- <title>Retrieve notification email info</title>
10
- </info>
11
- <test translate="title" module="pptrack">
12
- <title>Test Packpin API connection</title>
13
- </test>
14
- </methods>
15
- <faults module="pptrack">
16
- <data_invalid>
17
- <code>100</code >
18
- <message>Invalid tracking data. Details in error message.</message>
19
- </data_invalid>
20
- <not_exists>
21
- <code>102</code >
22
- <message>Tracking code does not exist.</message>
23
- </not_exists>
24
- </faults>
25
- </pptrack>
26
- </resources>
27
- <acl>
28
- <resources>
29
- <pptrack translate="title" module="pptrack">
30
- <title>Packpin notifications</title>
31
- <info translate="title" module="pptrack">
32
- <title>Get Email Template Info</title>
33
- <acl>pptrack/info</acl>
34
- </info>
35
- <test translate="title" module="pptrack">
36
- <title>Test Packpin API connection</title>
37
- <acl>pptrack/test</acl>
38
- </test>
39
- </pptrack>
40
- </resources>
41
- </acl>
42
- </api>
43
  </config>
1
+ <config>
2
+ <api>
3
+ <resources>
4
+ <pptrack translate="title" module="pptrack">
5
+ <title>Packpin Email Resource</title>
6
+ <model>pptrack/api</model>
7
+ <methods>
8
+ <info translate="title" module="pptrack">
9
+ <title>Retrieve notification email info</title>
10
+ </info>
11
+ <test translate="title" module="pptrack">
12
+ <title>Test Packpin API connection</title>
13
+ </test>
14
+ </methods>
15
+ <faults module="pptrack">
16
+ <data_invalid>
17
+ <code>100</code >
18
+ <message>Invalid tracking data. Details in error message.</message>
19
+ </data_invalid>
20
+ <not_exists>
21
+ <code>102</code >
22
+ <message>Tracking code does not exist.</message>
23
+ </not_exists>
24
+ </faults>
25
+ </pptrack>
26
+ </resources>
27
+ <acl>
28
+ <resources>
29
+ <pptrack translate="title" module="pptrack">
30
+ <title>Packpin notifications</title>
31
+ <info translate="title" module="pptrack">
32
+ <title>Get Email Template Info</title>
33
+ <acl>pptrack/info</acl>
34
+ </info>
35
+ <test translate="title" module="pptrack">
36
+ <title>Test Packpin API connection</title>
37
+ <acl>pptrack/test</acl>
38
+ </test>
39
+ </pptrack>
40
+ </resources>
41
+ </acl>
42
+ </api>
43
  </config>
app/code/community/Packpin/Pptrack/etc/config.xml CHANGED
@@ -1,322 +1,326 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Packpin_Pptrack>
5
- <version>1.7.1</version>
6
- </Packpin_Pptrack>
7
- </modules>
8
- <frontend>
9
- <routers>
10
- <pptrack>
11
- <use>standard</use>
12
- <args>
13
- <module>Packpin_Pptrack</module>
14
- <frontName>pptrack</frontName>
15
- </args>
16
- </pptrack>
17
- </routers>
18
- <layout>
19
- <updates>
20
- <pptrack>
21
- <file>pptrack.xml</file>
22
- </pptrack>
23
- <pptrack_unsubscribe>
24
- <file>pptrackunsubscribe.xml</file>
25
- </pptrack_unsubscribe>
26
- </updates>
27
- </layout>
28
- <translate>
29
- <modules>
30
- <Packpin_Pptrack>
31
- <files>
32
- <default>Packpin_Pptrack.csv</default>
33
- </files>
34
- </Packpin_Pptrack>
35
- </modules>
36
- </translate>
37
- </frontend>
38
- <global>
39
- <models>
40
- <packpinpptrackvalidation>
41
- <class>Packpin_Pptrack_Model</class>
42
- </packpinpptrackvalidation>
43
- <pptrack>
44
- <class>Packpin_Pptrack_Model</class>
45
- <resourceModel>pptrack_resource</resourceModel>
46
- </pptrack>
47
- <pptrackcron>
48
- <class>Packpin_Pptrack_Model</class>
49
- <resourceModel>pptrack_resource</resourceModel>
50
- </pptrackcron>
51
- <pptrack_resource>
52
- <class>Packpin_Pptrack_Model_Resource</class>
53
- <entities>
54
- <track>
55
- <table>pp_tracks</table>
56
- </track>
57
- <trackunsubscribed>
58
- <table>pp_tracks_unsubscribed</table>
59
- </trackunsubscribed>
60
- <trackdetail>
61
- <table>pp_track_details</table>
62
- </trackdetail>
63
- <carrier>
64
- <table>pp_carriers</table>
65
- </carrier>
66
- <setting>
67
- <table>pp_settings</table>
68
- </setting>
69
- <notification_setting>
70
- <table>pp_notification_settings</table>
71
- </notification_setting>
72
- <notification_template>
73
- <table>pp_notification_templates</table>
74
- </notification_template>
75
- <visit>
76
- <table>pp_visits</table>
77
- </visit>
78
- </entities>
79
- </pptrack_resource>
80
- <status>
81
- <class>Packpin_Track_Model</class>
82
- </status>
83
- <cron_job>
84
- <class>Packpin_Track_Model</class>
85
- </cron_job>
86
- <notification>
87
- <class>Packpin_Track_Model</class>
88
- </notification>
89
- <sales>
90
- <rewrite>
91
- <order_shipment>Packpin_Pptrack_Model_Order_Shipment</order_shipment>
92
- </rewrite>
93
- </sales>
94
- <core>
95
- <rewrite>
96
- <translate>Packpin_Pptrack_Model_Translate</translate>
97
- </rewrite>
98
- </core>
99
- </models>
100
- <helpers>
101
- <pptrack>
102
- <class>Packpin_Pptrack_Helper</class>
103
- </pptrack>
104
- </helpers>
105
- <blocks>
106
- <pptrack>
107
- <class>Packpin_Pptrack_Block</class>
108
- <trackings>
109
- <class>Packpin_Pptrack_Block_Trackings</class>
110
- </trackings>
111
- </pptrack>
112
- <pptrack_adminhtml>
113
- <class>Packpin_Pptrack_Block_Adminhtml</class>
114
- </pptrack_adminhtml>
115
- <adminhtml>
116
- <rewrite>
117
- <sales_order_shipment_view_tracking>Packpin_Pptrack_Block_Adminhtml_Sales_Order_Shipment_View_Tracking</sales_order_shipment_view_tracking>
118
- <sales_order_shipment_create_tracking>Packpin_Pptrack_Block_Adminhtml_Sales_Order_Shipment_Create_Tracking</sales_order_shipment_create_tracking>
119
- </rewrite>
120
- </adminhtml>
121
- </blocks>
122
- <resources>
123
- <pptrack_setup>
124
- <setup>
125
- <module>Packpin_Pptrack</module>
126
- </setup>
127
- <connection>
128
- <use>core_setup</use>
129
- </connection>
130
- </pptrack_setup>
131
- <pptrack_write>
132
- <connection>
133
- <use>core_write</use>
134
- </connection>
135
- </pptrack_write>
136
- <pptrack_read>
137
- <connection>
138
- <use>core_read</use>
139
- </connection>
140
- </pptrack_read>
141
- </resources>
142
- <events>
143
- <sales_order_shipment_track_save_after>
144
- <observers>
145
- <pp_track_save>
146
- <type>singleton</type>
147
- <class>pptrack/observer</class>
148
- <method>afterShipmentSaved</method>
149
- </pp_track_save>
150
- </observers>
151
- </sales_order_shipment_track_save_after>
152
- <sales_order_shipment_track_delete_after>
153
- <observers>
154
- <pp_track_delete>
155
- <type>singleton</type>
156
- <class>pptrack/observer</class>
157
- <method>afterShipmentRemoved</method>
158
- </pp_track_delete>
159
- </observers>
160
- </sales_order_shipment_track_delete_after>
161
- <controller_action_predispatch_shipping_tracking_popup>
162
- <observers>
163
- <pp_tracking_popup_predispatch>
164
- <type>singleton</type>
165
- <class>pptrack/observer</class>
166
- <method>trackingPopupPreDispatch</method>
167
- </pp_tracking_popup_predispatch>
168
- </observers>
169
- </controller_action_predispatch_shipping_tracking_popup>
170
- <admin_system_config_changed_section_pp_section_carriers>
171
- <observers>
172
- <module_name>
173
- <type>singleton</type>
174
- <class>pptrack/observer</class>
175
- <method>saveCarriers</method>
176
- </module_name>
177
- </observers>
178
- </admin_system_config_changed_section_pp_section_carriers>
179
- </events>
180
- <template>
181
- <email>
182
- <packpin_delivered_email>
183
- <label>Packpin Delivered Notification Email</label>
184
- <file>packpin/packpin_delivered_email.html</file>
185
- <type>html</type>
186
- </packpin_delivered_email>
187
- <packpin_exception_email>
188
- <label>Packpin Exception Notification Email</label>
189
- <file>packpin/packpin_exception_email.html</file>
190
- <type>html</type>
191
- </packpin_exception_email>
192
- <packpin_failed_attempt_email>
193
- <label>Packpin Failed Attempt Notification Email</label>
194
- <file>packpin/packpin_failed_attempt_email.html</file>
195
- <type>html</type>
196
- </packpin_failed_attempt_email>
197
- <packpin_in_transit_email>
198
- <label>Packpin in Transit Notification Email</label>
199
- <file>packpin/packpin_in_transit_email.html</file>
200
- <type>html</type>
201
- </packpin_in_transit_email>
202
- <packpin_info_received_email>
203
- <label>Packpin Info Received Notification Email</label>
204
- <file>packpin/packpin_info_received_email.html</file>
205
- <type>html</type>
206
- </packpin_info_received_email>
207
- <packpin_out_for_delivery_email>
208
- <label>Packpin Out for Delivery Notification Email</label>
209
- <file>packpin/packpin_out_for_delivery_email.html</file>
210
- <type>html</type>
211
- </packpin_out_for_delivery_email>
212
- </email>
213
- </template>
214
- </global>
215
- <crontab>
216
- <jobs>
217
- <pptrack_check_tracks>
218
- <schedule>
219
- <cron_expr>1 */2 * * *</cron_expr>
220
- </schedule>
221
- <run>
222
- <model>pptrack/observer::cron</model>
223
- </run>
224
- </pptrack_check_tracks>
225
- </jobs>
226
- </crontab>
227
- <admin>
228
- <routers>
229
- <adminhtml>
230
- <args>
231
- <modules>
232
- <Packpin_Pptrack before="Mage_Adminhtml">Packpin_Pptrack_Adminhtml</Packpin_Pptrack>
233
- </modules>
234
- </args>
235
- </adminhtml>
236
- </routers>
237
- </admin>
238
- <adminhtml>
239
- <translate>
240
- <modules>
241
- <Packpin_Pptrack>
242
- <files>
243
- <default>Packpin_Pptrack.csv</default>
244
- </files>
245
- </Packpin_Pptrack>
246
- </modules>
247
- </translate>
248
- <layout>
249
- <updates>
250
- <pptrack>
251
- <file>pptrack.xml</file>
252
- </pptrack>
253
- </updates>
254
- </layout>
255
- <events>
256
- <core_block_abstract_prepare_layout_after>
257
- <observers>
258
- <Packpin_Pptrack>
259
- <class>pptrack/observer</class>
260
- <method>coreBlockAbstractPrepareLayoutAfter</method>
261
- </Packpin_Pptrack>
262
- </observers>
263
- </core_block_abstract_prepare_layout_after>
264
- <core_block_abstract_to_html_after>
265
- <observers>
266
- <Packpin_Pptrack>
267
- <class>pptrack/observer</class>
268
- <method>coreBlockAbstractToHtmlAfter</method>
269
- </Packpin_Pptrack>
270
- </observers>
271
- </core_block_abstract_to_html_after>
272
- </events>
273
- </adminhtml>
274
- <default>
275
- <pp_section_setttings>
276
- <settings>
277
- <status>1</status>
278
- </settings>
279
- <crosssell>
280
- <cross_sell_page>1</cross_sell_page>
281
- <cross_sell_email>1</cross_sell_email>
282
- <cross_sell_page_items>8</cross_sell_page_items>
283
- <cross_sell_email_items>4</cross_sell_email_items>
284
- <cross_sell_page_type>products</cross_sell_page_type>
285
- <cross_sell_email_type>products</cross_sell_email_type>
286
- </crosssell>
287
- <template>
288
- <template_type>v1</template_type>
289
- <template_image_type>default</template_image_type>
290
- </template>
291
- <advanced>
292
- <trigger_shipped_email>0</trigger_shipped_email>
293
- </advanced>
294
- </pp_section_setttings>
295
- <pp_section_notification_emails>
296
- <info_received>
297
- <enabled_client>1</enabled_client>
298
- <identity>general</identity>
299
- </info_received>
300
- <in_transit>
301
- <enabled_client>1</enabled_client>
302
- <identity>general</identity>
303
- </in_transit>
304
- <out_for_delivery>
305
- <enabled_client>1</enabled_client>
306
- <identity>general</identity>
307
- </out_for_delivery>
308
- <delivered>
309
- <enabled_client>1</enabled_client>
310
- <identity>general</identity>
311
- </delivered>
312
- <exception>
313
- <enabled_client>1</enabled_client>
314
- <identity>general</identity>
315
- </exception>
316
- <failed_attempt>
317
- <enabled_client>1</enabled_client>
318
- <identity>general</identity>
319
- </failed_attempt>
320
- </pp_section_notification_emails>
321
- </default>
 
 
 
 
322
  </config>
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Packpin_Pptrack>
5
+ <version>1.7.2</version>
6
+ </Packpin_Pptrack>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <pptrack>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Packpin_Pptrack</module>
14
+ <frontName>pptrack</frontName>
15
+ </args>
16
+ </pptrack>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <pptrack>
21
+ <file>pptrack.xml</file>
22
+ </pptrack>
23
+ <pptrack_unsubscribe>
24
+ <file>pptrackunsubscribe.xml</file>
25
+ </pptrack_unsubscribe>
26
+ </updates>
27
+ </layout>
28
+ <translate>
29
+ <modules>
30
+ <Packpin_Pptrack>
31
+ <files>
32
+ <default>Packpin_Pptrack.csv</default>
33
+ </files>
34
+ </Packpin_Pptrack>
35
+ </modules>
36
+ </translate>
37
+ </frontend>
38
+ <global>
39
+ <models>
40
+ <packpinpptrackvalidation>
41
+ <class>Packpin_Pptrack_Model</class>
42
+ </packpinpptrackvalidation>
43
+ <pptrack>
44
+ <class>Packpin_Pptrack_Model</class>
45
+ <resourceModel>pptrack_resource</resourceModel>
46
+ </pptrack>
47
+ <pptrackcron>
48
+ <class>Packpin_Pptrack_Model</class>
49
+ <resourceModel>pptrack_resource</resourceModel>
50
+ </pptrackcron>
51
+ <pptrack_resource>
52
+ <class>Packpin_Pptrack_Model_Resource</class>
53
+ <entities>
54
+ <track>
55
+ <table>pp_tracks</table>
56
+ </track>
57
+ <trackunsubscribed>
58
+ <table>pp_tracks_unsubscribed</table>
59
+ </trackunsubscribed>
60
+ <trackdetail>
61
+ <table>pp_track_details</table>
62
+ </trackdetail>
63
+ <carrier>
64
+ <table>pp_carriers</table>
65
+ </carrier>
66
+ <setting>
67
+ <table>pp_settings</table>
68
+ </setting>
69
+ <notification_setting>
70
+ <table>pp_notification_settings</table>
71
+ </notification_setting>
72
+ <notification_template>
73
+ <table>pp_notification_templates</table>
74
+ </notification_template>
75
+ <visit>
76
+ <table>pp_visits</table>
77
+ </visit>
78
+ </entities>
79
+ </pptrack_resource>
80
+ <status>
81
+ <class>Packpin_Track_Model</class>
82
+ </status>
83
+ <cron_job>
84
+ <class>Packpin_Track_Model</class>
85
+ </cron_job>
86
+ <notification>
87
+ <class>Packpin_Track_Model</class>
88
+ </notification>
89
+ <sales>
90
+ <rewrite>
91
+ <order_shipment>Packpin_Pptrack_Model_Order_Shipment</order_shipment>
92
+ </rewrite>
93
+ </sales>
94
+ <core>
95
+ <rewrite>
96
+ <translate>Packpin_Pptrack_Model_Translate</translate>
97
+ </rewrite>
98
+ </core>
99
+ </models>
100
+ <helpers>
101
+ <pptrack>
102
+ <class>Packpin_Pptrack_Helper</class>
103
+ </pptrack>
104
+ </helpers>
105
+ <blocks>
106
+ <pptrack>
107
+ <class>Packpin_Pptrack_Block</class>
108
+ <trackings>
109
+ <class>Packpin_Pptrack_Block_Trackings</class>
110
+ </trackings>
111
+ </pptrack>
112
+ <pptrack_adminhtml>
113
+ <class>Packpin_Pptrack_Block_Adminhtml</class>
114
+ </pptrack_adminhtml>
115
+ <adminhtml>
116
+ <rewrite>
117
+ <sales_order_shipment_view_tracking>
118
+ Packpin_Pptrack_Block_Adminhtml_Sales_Order_Shipment_View_Tracking
119
+ </sales_order_shipment_view_tracking>
120
+ <sales_order_shipment_create_tracking>
121
+ Packpin_Pptrack_Block_Adminhtml_Sales_Order_Shipment_Create_Tracking
122
+ </sales_order_shipment_create_tracking>
123
+ </rewrite>
124
+ </adminhtml>
125
+ </blocks>
126
+ <resources>
127
+ <pptrack_setup>
128
+ <setup>
129
+ <module>Packpin_Pptrack</module>
130
+ </setup>
131
+ <connection>
132
+ <use>core_setup</use>
133
+ </connection>
134
+ </pptrack_setup>
135
+ <pptrack_write>
136
+ <connection>
137
+ <use>core_write</use>
138
+ </connection>
139
+ </pptrack_write>
140
+ <pptrack_read>
141
+ <connection>
142
+ <use>core_read</use>
143
+ </connection>
144
+ </pptrack_read>
145
+ </resources>
146
+ <events>
147
+ <sales_order_shipment_track_save_after>
148
+ <observers>
149
+ <pp_track_save>
150
+ <type>singleton</type>
151
+ <class>pptrack/observer</class>
152
+ <method>afterShipmentSaved</method>
153
+ </pp_track_save>
154
+ </observers>
155
+ </sales_order_shipment_track_save_after>
156
+ <sales_order_shipment_track_delete_after>
157
+ <observers>
158
+ <pp_track_delete>
159
+ <type>singleton</type>
160
+ <class>pptrack/observer</class>
161
+ <method>afterShipmentRemoved</method>
162
+ </pp_track_delete>
163
+ </observers>
164
+ </sales_order_shipment_track_delete_after>
165
+ <controller_action_predispatch_shipping_tracking_popup>
166
+ <observers>
167
+ <pp_tracking_popup_predispatch>
168
+ <type>singleton</type>
169
+ <class>pptrack/observer</class>
170
+ <method>trackingPopupPreDispatch</method>
171
+ </pp_tracking_popup_predispatch>
172
+ </observers>
173
+ </controller_action_predispatch_shipping_tracking_popup>
174
+ <admin_system_config_changed_section_pp_section_carriers>
175
+ <observers>
176
+ <module_name>
177
+ <type>singleton</type>
178
+ <class>pptrack/observer</class>
179
+ <method>saveCarriers</method>
180
+ </module_name>
181
+ </observers>
182
+ </admin_system_config_changed_section_pp_section_carriers>
183
+ </events>
184
+ <template>
185
+ <email>
186
+ <packpin_delivered_email>
187
+ <label>Packpin Delivered Notification Email</label>
188
+ <file>packpin/packpin_delivered_email.html</file>
189
+ <type>html</type>
190
+ </packpin_delivered_email>
191
+ <packpin_exception_email>
192
+ <label>Packpin Exception Notification Email</label>
193
+ <file>packpin/packpin_exception_email.html</file>
194
+ <type>html</type>
195
+ </packpin_exception_email>
196
+ <packpin_failed_attempt_email>
197
+ <label>Packpin Failed Attempt Notification Email</label>
198
+ <file>packpin/packpin_failed_attempt_email.html</file>
199
+ <type>html</type>
200
+ </packpin_failed_attempt_email>
201
+ <packpin_in_transit_email>
202
+ <label>Packpin in Transit Notification Email</label>
203
+ <file>packpin/packpin_in_transit_email.html</file>
204
+ <type>html</type>
205
+ </packpin_in_transit_email>
206
+ <packpin_info_received_email>
207
+ <label>Packpin Info Received Notification Email</label>
208
+ <file>packpin/packpin_info_received_email.html</file>
209
+ <type>html</type>
210
+ </packpin_info_received_email>
211
+ <packpin_out_for_delivery_email>
212
+ <label>Packpin Out for Delivery Notification Email</label>
213
+ <file>packpin/packpin_out_for_delivery_email.html</file>
214
+ <type>html</type>
215
+ </packpin_out_for_delivery_email>
216
+ </email>
217
+ </template>
218
+ </global>
219
+ <crontab>
220
+ <jobs>
221
+ <pptrack_check_tracks>
222
+ <schedule>
223
+ <cron_expr>1 */2 * * *</cron_expr>
224
+ </schedule>
225
+ <run>
226
+ <model>pptrack/observer::cron</model>
227
+ </run>
228
+ </pptrack_check_tracks>
229
+ </jobs>
230
+ </crontab>
231
+ <admin>
232
+ <routers>
233
+ <adminhtml>
234
+ <args>
235
+ <modules>
236
+ <Packpin_Pptrack before="Mage_Adminhtml">Packpin_Pptrack_Adminhtml</Packpin_Pptrack>
237
+ </modules>
238
+ </args>
239
+ </adminhtml>
240
+ </routers>
241
+ </admin>
242
+ <adminhtml>
243
+ <translate>
244
+ <modules>
245
+ <Packpin_Pptrack>
246
+ <files>
247
+ <default>Packpin_Pptrack.csv</default>
248
+ </files>
249
+ </Packpin_Pptrack>
250
+ </modules>
251
+ </translate>
252
+ <layout>
253
+ <updates>
254
+ <pptrack>
255
+ <file>pptrack.xml</file>
256
+ </pptrack>
257
+ </updates>
258
+ </layout>
259
+ <events>
260
+ <core_block_abstract_prepare_layout_after>
261
+ <observers>
262
+ <Packpin_Pptrack>
263
+ <class>pptrack/observer</class>
264
+ <method>coreBlockAbstractPrepareLayoutAfter</method>
265
+ </Packpin_Pptrack>
266
+ </observers>
267
+ </core_block_abstract_prepare_layout_after>
268
+ <core_block_abstract_to_html_after>
269
+ <observers>
270
+ <Packpin_Pptrack>
271
+ <class>pptrack/observer</class>
272
+ <method>coreBlockAbstractToHtmlAfter</method>
273
+ </Packpin_Pptrack>
274
+ </observers>
275
+ </core_block_abstract_to_html_after>
276
+ </events>
277
+ </adminhtml>
278
+ <default>
279
+ <pp_section_setttings>
280
+ <settings>
281
+ <status>1</status>
282
+ </settings>
283
+ <crosssell>
284
+ <cross_sell_page>1</cross_sell_page>
285
+ <cross_sell_email>1</cross_sell_email>
286
+ <cross_sell_page_items>8</cross_sell_page_items>
287
+ <cross_sell_email_items>4</cross_sell_email_items>
288
+ <cross_sell_page_type>products</cross_sell_page_type>
289
+ <cross_sell_email_type>products</cross_sell_email_type>
290
+ </crosssell>
291
+ <template>
292
+ <template_type>v1</template_type>
293
+ <template_image_type>default</template_image_type>
294
+ </template>
295
+ <advanced>
296
+ <trigger_shipped_email>0</trigger_shipped_email>
297
+ </advanced>
298
+ </pp_section_setttings>
299
+ <pp_section_notification_emails>
300
+ <info_received>
301
+ <enabled_client>1</enabled_client>
302
+ <identity>general</identity>
303
+ </info_received>
304
+ <in_transit>
305
+ <enabled_client>1</enabled_client>
306
+ <identity>general</identity>
307
+ </in_transit>
308
+ <out_for_delivery>
309
+ <enabled_client>1</enabled_client>
310
+ <identity>general</identity>
311
+ </out_for_delivery>
312
+ <delivered>
313
+ <enabled_client>1</enabled_client>
314
+ <identity>general</identity>
315
+ </delivered>
316
+ <exception>
317
+ <enabled_client>1</enabled_client>
318
+ <identity>general</identity>
319
+ </exception>
320
+ <failed_attempt>
321
+ <enabled_client>1</enabled_client>
322
+ <identity>general</identity>
323
+ </failed_attempt>
324
+ </pp_section_notification_emails>
325
+ </default>
326
  </config>
app/code/community/Packpin/Pptrack/etc/system.xml CHANGED
@@ -1,664 +1,664 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <tabs>
4
- <pp_tab translate="label" module="pptrack">
5
- <label>Packpin</label>
6
- <sort_order>51000</sort_order>
7
- </pp_tab>
8
- </tabs>
9
- <sections>
10
- <pp_section_setttings translate="label" module="pptrack">
11
- <label>Packpin Settings</label>
12
- <class>packpin-settings</class>
13
- <tab>pp_tab</tab>
14
- <frontend_type>text</frontend_type>
15
- <sort_order>51001</sort_order>
16
- <show_in_default>1</show_in_default>
17
- <show_in_website>1</show_in_website>
18
- <show_in_store>1</show_in_store>
19
- <groups>
20
- <hint>
21
- <frontend_model>pptrack/adminhtml_system_config_fieldset_hint</frontend_model>
22
- <sort_order>0</sort_order>
23
- <show_in_default>1</show_in_default>
24
- <show_in_website>1</show_in_website>
25
- <show_in_store>1</show_in_store>
26
- </hint>
27
- <settings translate="label">
28
- <expanded>1</expanded>
29
- <label>General settings</label>
30
- <frontend_type>text</frontend_type>
31
- <sort_order>1</sort_order>
32
- <show_in_default>1</show_in_default>
33
- <show_in_website>1</show_in_website>
34
- <show_in_store>0</show_in_store>
35
- <fields>
36
- <status translate="label">
37
- <label>Status</label>
38
- <frontend_type>select</frontend_type>
39
- <source_model>adminhtml/system_config_source_enabledisable</source_model>
40
- <sort_order>11</sort_order>
41
- <show_in_default>1</show_in_default>
42
- <show_in_website>1</show_in_website>
43
- <show_in_store>0</show_in_store>
44
- </status>
45
- <api_key translate="label">
46
- <label><![CDATA[ API key <strong style="color:red">*</strong>]]></label>
47
- <frontend_type>text</frontend_type>
48
- <sort_order>5</sort_order>
49
- <show_in_default>1</show_in_default>
50
- <show_in_website>1</show_in_website>
51
- <show_in_store>0</show_in_store>
52
- <validate>required-entry</validate>
53
- </api_key>
54
- <last_cron>
55
- <label>Last Cron Time</label>
56
- <frontend_type>text</frontend_type>
57
- <sort_order>101</sort_order>
58
- <show_in_default>0</show_in_default>
59
- <show_in_website>0</show_in_website>
60
- <show_in_store>0</show_in_store>
61
- </last_cron>
62
- <last_carrier_update>
63
- <label>Last Carrier Update</label>
64
- <frontend_type>text</frontend_type>
65
- <sort_order>102</sort_order>
66
- <show_in_default>0</show_in_default>
67
- <show_in_website>0</show_in_website>
68
- <show_in_store>0</show_in_store>
69
- </last_carrier_update>
70
- <temp_api_key>
71
- <label>Is key being used a temporary one</label>
72
- <frontend_type>text</frontend_type>
73
- <sort_order>104</sort_order>
74
- <show_in_default>0</show_in_default>
75
- <show_in_website>0</show_in_website>
76
- <show_in_store>0</show_in_store>
77
- </temp_api_key>
78
- <temp_key_installed>
79
- <label>Unix time when temp key has been installed</label>
80
- <frontend_type>text</frontend_type>
81
- <sort_order>105</sort_order>
82
- <show_in_default>0</show_in_default>
83
- <show_in_website>0</show_in_website>
84
- <show_in_store>0</show_in_store>
85
- </temp_key_installed>
86
- <upgrade_note>
87
- <label><![CDATA[<strong>How to setup</strong>]]></label>
88
- <frontend_type>note</frontend_type>
89
- <sort_order>1</sort_order>
90
- <show_in_default>1</show_in_default>
91
- <show_in_website>1</show_in_website>
92
- <show_in_store>0</show_in_store>
93
- <comment>
94
- <![CDATA[
95
- <ol>
96
- <li style="margin-bottom:10px !important;"><b>We will generate a temporary API key for you during installation. </b></li>
97
- <li style="margin-bottom:10px !important;">In order to use all the features, please follow these steps:</li>
98
- <li style="margin-bottom:10px !important;">1. Sign up at <a href="https://panel.packpin.com/" target="_blank">panel.packpin.com</a></li>
99
- <li style="margin-bottom:10px !important;">2. Go to <a href="https://panel.packpin.com/api_keys" taget="_blank">"API keys"</a> and generate new key</li>
100
- <li style="margin-bottom:10px !important;">3. Copy API key and paste to the field below</li>
101
- <li>4. Now the plugin is active and running</li>
102
- </ol>
103
- ]]>
104
- </comment>
105
- </upgrade_note>
106
- <disable_default_carriers translate="label">
107
- <label>Disable default carriers</label>
108
- <frontend_type>select</frontend_type>
109
- <source_model>adminhtml/system_config_source_yesno</source_model>
110
- <sort_order>20</sort_order>
111
- <show_in_default>1</show_in_default>
112
- <show_in_website>1</show_in_website>
113
- <show_in_store>0</show_in_store>
114
- </disable_default_carriers>
115
- <pp_enable_notifications translate="label">
116
- <backend_model>packpinpptrackvalidation/enableNotifications</backend_model>
117
- <label>Enable Notifications</label>
118
- <frontend_type>select</frontend_type>
119
- <source_model>adminhtml/system_config_source_enabledisable</source_model>
120
- <sort_order>21</sort_order>
121
- <show_in_default>1</show_in_default>
122
- <show_in_website>1</show_in_website>
123
- <show_in_store>0</show_in_store>
124
- <comment>In order to enable notifications we will create SOAP/XML-RPC role and user.</comment>
125
- </pp_enable_notifications>
126
- </fields>
127
- </settings>
128
- <crosssell>
129
- <expanded>1</expanded>
130
- <label>Cross-sell settings</label>
131
- <frontend_type>text</frontend_type>
132
- <sort_order>2</sort_order>
133
- <show_in_default>1</show_in_default>
134
- <show_in_website>1</show_in_website>
135
- <show_in_store>0</show_in_store>
136
- <fields>
137
- <cross_sell_page translate="label">
138
- <label>Show cross-sell items on shipment information page</label>
139
- <frontend_type>select</frontend_type>
140
- <source_model>adminhtml/system_config_source_enabledisable</source_model>
141
- <sort_order>30</sort_order>
142
- <show_in_default>1</show_in_default>
143
- <show_in_website>1</show_in_website>
144
- <show_in_store>0</show_in_store>
145
- </cross_sell_page>
146
- <cross_sell_page_type translate="label">
147
- <label>What cross-sell items to show on page</label>
148
- <frontend_type>select</frontend_type>
149
- <source_model>Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Crossviewspage</source_model>
150
- <sort_order>35</sort_order>
151
- <show_in_default>1</show_in_default>
152
- <show_in_website>1</show_in_website>
153
- <show_in_store>0</show_in_store>
154
- </cross_sell_page_type>
155
- <cross_sell_page_items translate="label">
156
- <label>Number of cross-sell products on page</label>
157
- <frontend_type>text</frontend_type>
158
- <sort_order>40</sort_order>
159
- <show_in_default>1</show_in_default>
160
- <show_in_website>1</show_in_website>
161
- <show_in_store>0</show_in_store>
162
- <comment>Recommended value is between 4 and 6</comment>
163
- </cross_sell_page_items>
164
- <cross_sell_page_image translate="label">
165
- <label>Banner image</label>
166
- <comment>Allowed file types: jpeg, gif, png.</comment>
167
- <frontend_type>image</frontend_type>
168
- <backend_model>adminhtml/system_config_backend_image</backend_model>
169
- <upload_dir config="system/filesystem/media" scope_info="1">theme</upload_dir>
170
- <base_url type="media" scope_info="1">theme</base_url>
171
- <sort_order>42</sort_order>
172
- <show_in_default>1</show_in_default>
173
- <show_in_website>1</show_in_website>
174
- <show_in_store>0</show_in_store>
175
- </cross_sell_page_image>
176
- <cross_sell_page_image_url translate="label">
177
- <label>Banner url</label>
178
- <comment><![CDATA[
179
- Should start with <b>http</b>
180
- ]]></comment>
181
- <frontend_type>text</frontend_type>
182
- <sort_order>44</sort_order>
183
- <show_in_default>1</show_in_default>
184
- <show_in_website>1</show_in_website>
185
- <show_in_store>0</show_in_store>
186
- </cross_sell_page_image_url>
187
- <cross_sell_page_script translate="label">
188
- <label>Script</label>
189
- <frontend_type>textarea</frontend_type>
190
- <sort_order>46</sort_order>
191
- <show_in_default>1</show_in_default>
192
- <show_in_website>1</show_in_website>
193
- <show_in_store>0</show_in_store>
194
- <comment>Can enter HTML or JavaScript code here</comment>
195
- </cross_sell_page_script>
196
-
197
-
198
- <cross_sell_email translate="label">
199
- <label>Show cross-sell items in notification emails</label>
200
- <frontend_type>select</frontend_type>
201
- <source_model>adminhtml/system_config_source_enabledisable</source_model>
202
- <sort_order>50</sort_order>
203
- <show_in_default>1</show_in_default>
204
- <show_in_website>1</show_in_website>
205
- <show_in_store>0</show_in_store>
206
- </cross_sell_email>
207
- <cross_sell_email_type translate="label">
208
- <label>What cross-sell items to show in email</label>
209
- <frontend_type>select</frontend_type>
210
- <source_model>Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Crossviews</source_model>
211
- <sort_order>55</sort_order>
212
- <show_in_default>1</show_in_default>
213
- <show_in_website>1</show_in_website>
214
- <show_in_store>0</show_in_store>
215
- </cross_sell_email_type>
216
- <cross_sell_email_items translate="label">
217
- <label>Number of cross-sell items in emails</label>
218
- <frontend_type>text</frontend_type>
219
- <sort_order>60</sort_order>
220
- <show_in_default>1</show_in_default>
221
- <show_in_website>1</show_in_website>
222
- <show_in_store>0</show_in_store>
223
- </cross_sell_email_items>
224
- <cross_sell_email_image translate="label">
225
- <label>Banner image</label>
226
- <comment>Height should be at least 100px.</comment>
227
- <frontend_type>image</frontend_type>
228
- <backend_model>adminhtml/system_config_backend_image</backend_model>
229
- <upload_dir config="system/filesystem/media" scope_info="1">theme</upload_dir>
230
- <base_url type="media" scope_info="1">theme</base_url>
231
- <sort_order>62</sort_order>
232
- <show_in_default>1</show_in_default>
233
- <show_in_website>1</show_in_website>
234
- <show_in_store>0</show_in_store>
235
- </cross_sell_email_image>
236
- <cross_sell_email_image_url translate="label">
237
- <label>Banner url</label>
238
- <comment><![CDATA[
239
- Should start with <b>http</b>
240
- ]]></comment>
241
- <frontend_type>text</frontend_type>
242
- <sort_order>64</sort_order>
243
- <show_in_default>1</show_in_default>
244
- <show_in_website>1</show_in_website>
245
- <show_in_store>0</show_in_store>
246
- </cross_sell_email_image_url>
247
- <cross_sell_scripts>
248
- <frontend_type>text</frontend_type>
249
- <frontend_model>pptrack/adminhtml_system_config_fieldset_scripts</frontend_model>
250
- <sort_order>70</sort_order>
251
- <show_in_default>1</show_in_default>
252
- <show_in_website>1</show_in_website>
253
- <show_in_store>0</show_in_store>
254
- </cross_sell_scripts>
255
- </fields>
256
- </crosssell>
257
- <template translate="label">
258
- <expanded>1</expanded>
259
- <label>Page template</label>
260
- <frontend_type>text</frontend_type>
261
- <sort_order>4</sort_order>
262
- <show_in_default>1</show_in_default>
263
- <show_in_website>1</show_in_website>
264
- <show_in_store>0</show_in_store>
265
- <fields>
266
- <template_type translate="label">
267
- <label>Page template</label>
268
- <frontend_type>select</frontend_type>
269
- <source_model>Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Templatetype</source_model>
270
- <sort_order>5</sort_order>
271
- <show_in_default>1</show_in_default>
272
- <show_in_website>1</show_in_website>
273
- <show_in_store>0</show_in_store>
274
- <comment>
275
- <![CDATA[
276
- <div class="pp-preview-row">
277
- <div class="pp-preview-item-wrap">
278
- <div class="pp-preview-image pp-preview-template1"></div>
279
- <div class="pp-preview-item-title">
280
- Template 1
281
- </div>
282
- </div>
283
- <div class="pp-preview-item-wrap">
284
- <div class="pp-preview-image pp-preview-template2"></div>
285
- <div class="pp-preview-item-title">
286
- Template 2
287
- </div>
288
- </div>
289
- </div>
290
- ]]>
291
- </comment>
292
- </template_type>
293
- <template_image_type translate="label">
294
- <label>Image</label>
295
- <frontend_type>select</frontend_type>
296
- <source_model>Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Templateimage</source_model>
297
- <sort_order>10</sort_order>
298
- <show_in_default>1</show_in_default>
299
- <show_in_website>1</show_in_website>
300
- <show_in_store>0</show_in_store>
301
- </template_image_type>
302
- <template_image translate="label">
303
- <label>Custom image</label>
304
- <frontend_type>image</frontend_type>
305
- <backend_model>adminhtml/system_config_backend_image</backend_model>
306
- <upload_dir config="system/filesystem/media" scope_info="1">theme</upload_dir>
307
- <base_url type="media" scope_info="1">theme</base_url>
308
- <sort_order>30</sort_order>
309
- <show_in_default>1</show_in_default>
310
- <show_in_website>1</show_in_website>
311
- <show_in_store>0</show_in_store>
312
- </template_image>
313
- <template_image_link translate="label">
314
- <label>Image links to</label>
315
- <comment><![CDATA[
316
- Should start with <b>http</b>
317
- ]]></comment>
318
- <frontend_type>text</frontend_type>
319
- <sort_order>40</sort_order>
320
- <show_in_default>1</show_in_default>
321
- <show_in_website>1</show_in_website>
322
- <show_in_store>0</show_in_store>
323
- </template_image_link>
324
- </fields>
325
- </template>
326
- <advanced translate="label">
327
- <expanded>0</expanded>
328
- <label>Advanced</label>
329
- <frontend_type>text</frontend_type>
330
- <sort_order>5</sort_order>
331
- <show_in_default>1</show_in_default>
332
- <show_in_website>1</show_in_website>
333
- <show_in_store>0</show_in_store>
334
- <fields>
335
- <trigger_shipped_email translate="label">
336
- <label>Automatically send email to client when tracking information has been added</label>
337
- <frontend_type>select</frontend_type>
338
- <source_model>adminhtml/system_config_source_yesno</source_model>
339
- <sort_order>1</sort_order>
340
- <show_in_default>1</show_in_default>
341
- <show_in_website>1</show_in_website>
342
- <show_in_store>0</show_in_store>
343
- <comment>Should only be enabled if your tracking information is being populated through 3rd party connector</comment>
344
- </trigger_shipped_email>
345
- </fields>
346
- </advanced>
347
- </groups>
348
- </pp_section_setttings>
349
-
350
- <pp_section_notification_emails translate="label" module="sales">
351
- <label>Notification Emails</label>
352
- <class>packpin-settings</class>
353
- <tab>pp_tab</tab>
354
- <frontend_type>text</frontend_type>
355
- <sort_order>51002</sort_order>
356
- <show_in_default>1</show_in_default>
357
- <show_in_website>1</show_in_website>
358
- <show_in_store>1</show_in_store>
359
- <groups>
360
- <info_received translate="label">
361
- <label>Info Received</label>
362
- <frontend_type>text</frontend_type>
363
- <sort_order>1</sort_order>
364
- <show_in_default>1</show_in_default>
365
- <show_in_website>1</show_in_website>
366
- <show_in_store>1</show_in_store>
367
- <fields>
368
- <enabled_client translate="label">
369
- <label>Enabled for client</label>
370
- <frontend_type>select</frontend_type>
371
- <source_model>adminhtml/system_config_source_yesno</source_model>
372
- <sort_order>0</sort_order>
373
- <show_in_default>1</show_in_default>
374
- <show_in_website>1</show_in_website>
375
- <show_in_store>1</show_in_store>
376
- </enabled_client>
377
- <enabled_owner translate="label">
378
- <label>Enabled for owner</label>
379
- <frontend_type>select</frontend_type>
380
- <source_model>adminhtml/system_config_source_yesno</source_model>
381
- <sort_order>0</sort_order>
382
- <show_in_default>1</show_in_default>
383
- <show_in_website>1</show_in_website>
384
- <show_in_store>1</show_in_store>
385
- </enabled_owner>
386
- <identity translate="label">
387
- <label>Sender Email</label>
388
- <frontend_type>select</frontend_type>
389
- <source_model>adminhtml/system_config_source_email_identity</source_model>
390
- <sort_order>1</sort_order>
391
- <show_in_default>1</show_in_default>
392
- <show_in_website>1</show_in_website>
393
- <show_in_store>1</show_in_store>
394
- </identity>
395
- <template translate="label">
396
- <label>Template</label>
397
- <frontend_type>select</frontend_type>
398
- <source_model>adminhtml/system_config_source_email_template</source_model>
399
- <sort_order>2</sort_order>
400
- <show_in_default>1</show_in_default>
401
- <show_in_website>1</show_in_website>
402
- <show_in_store>1</show_in_store>
403
- </template>
404
- </fields>
405
- </info_received>
406
-
407
- <in_transit translate="label">
408
- <label>In Transit</label>
409
- <frontend_type>text</frontend_type>
410
- <sort_order>2</sort_order>
411
- <show_in_default>1</show_in_default>
412
- <show_in_website>1</show_in_website>
413
- <show_in_store>1</show_in_store>
414
- <fields>
415
- <enabled_client translate="label">
416
- <label>Enabled for client</label>
417
- <frontend_type>select</frontend_type>
418
- <source_model>adminhtml/system_config_source_yesno</source_model>
419
- <sort_order>0</sort_order>
420
- <show_in_default>1</show_in_default>
421
- <show_in_website>1</show_in_website>
422
- <show_in_store>1</show_in_store>
423
- </enabled_client>
424
- <enabled_owner translate="label">
425
- <label>Enabled for owner</label>
426
- <frontend_type>select</frontend_type>
427
- <source_model>adminhtml/system_config_source_yesno</source_model>
428
- <sort_order>0</sort_order>
429
- <show_in_default>1</show_in_default>
430
- <show_in_website>1</show_in_website>
431
- <show_in_store>1</show_in_store>
432
- </enabled_owner>
433
- <identity translate="label">
434
- <label>Sender Email</label>
435
- <frontend_type>select</frontend_type>
436
- <source_model>adminhtml/system_config_source_email_identity</source_model>
437
- <sort_order>1</sort_order>
438
- <show_in_default>1</show_in_default>
439
- <show_in_website>1</show_in_website>
440
- <show_in_store>1</show_in_store>
441
- </identity>
442
- <template translate="label">
443
- <label>Template</label>
444
- <frontend_type>select</frontend_type>
445
- <source_model>adminhtml/system_config_source_email_template</source_model>
446
- <sort_order>2</sort_order>
447
- <show_in_default>1</show_in_default>
448
- <show_in_website>1</show_in_website>
449
- <show_in_store>1</show_in_store>
450
- </template>
451
- </fields>
452
- </in_transit>
453
-
454
- <out_for_delivery translate="label">
455
- <label>Out for Delivery</label>
456
- <frontend_type>text</frontend_type>
457
- <sort_order>3</sort_order>
458
- <show_in_default>1</show_in_default>
459
- <show_in_website>1</show_in_website>
460
- <show_in_store>1</show_in_store>
461
- <fields>
462
- <enabled_client translate="label">
463
- <label>Enabled for client</label>
464
- <frontend_type>select</frontend_type>
465
- <source_model>adminhtml/system_config_source_yesno</source_model>
466
- <sort_order>0</sort_order>
467
- <show_in_default>1</show_in_default>
468
- <show_in_website>1</show_in_website>
469
- <show_in_store>1</show_in_store>
470
- </enabled_client>
471
- <enabled_owner translate="label">
472
- <label>Enabled for owner</label>
473
- <frontend_type>select</frontend_type>
474
- <source_model>adminhtml/system_config_source_yesno</source_model>
475
- <sort_order>0</sort_order>
476
- <show_in_default>1</show_in_default>
477
- <show_in_website>1</show_in_website>
478
- <show_in_store>1</show_in_store>
479
- </enabled_owner>
480
- <identity translate="label">
481
- <label>Sender Email</label>
482
- <frontend_type>select</frontend_type>
483
- <source_model>adminhtml/system_config_source_email_identity</source_model>
484
- <sort_order>1</sort_order>
485
- <show_in_default>1</show_in_default>
486
- <show_in_website>1</show_in_website>
487
- <show_in_store>1</show_in_store>
488
- </identity>
489
- <template translate="label">
490
- <label>Template</label>
491
- <frontend_type>select</frontend_type>
492
- <source_model>adminhtml/system_config_source_email_template</source_model>
493
- <sort_order>2</sort_order>
494
- <show_in_default>1</show_in_default>
495
- <show_in_website>1</show_in_website>
496
- <show_in_store>1</show_in_store>
497
- </template>
498
- </fields>
499
- </out_for_delivery>
500
- <delivered translate="label">
501
- <label>Delivered</label>
502
- <frontend_type>text</frontend_type>
503
- <sort_order>4</sort_order>
504
- <show_in_default>1</show_in_default>
505
- <show_in_website>1</show_in_website>
506
- <show_in_store>1</show_in_store>
507
- <fields>
508
- <enabled_client translate="label">
509
- <label>Enabled for client</label>
510
- <frontend_type>select</frontend_type>
511
- <source_model>adminhtml/system_config_source_yesno</source_model>
512
- <sort_order>0</sort_order>
513
- <show_in_default>1</show_in_default>
514
- <show_in_website>1</show_in_website>
515
- <show_in_store>1</show_in_store>
516
- </enabled_client>
517
- <enabled_owner translate="label">
518
- <label>Enabled for owner</label>
519
- <frontend_type>select</frontend_type>
520
- <source_model>adminhtml/system_config_source_yesno</source_model>
521
- <sort_order>0</sort_order>
522
- <show_in_default>1</show_in_default>
523
- <show_in_website>1</show_in_website>
524
- <show_in_store>1</show_in_store>
525
- </enabled_owner>
526
- <identity translate="label">
527
- <label>Sender Email</label>
528
- <frontend_type>select</frontend_type>
529
- <source_model>adminhtml/system_config_source_email_identity</source_model>
530
- <sort_order>1</sort_order>
531
- <show_in_default>1</show_in_default>
532
- <show_in_website>1</show_in_website>
533
- <show_in_store>1</show_in_store>
534
- </identity>
535
- <template translate="label">
536
- <label>Template</label>
537
- <frontend_type>select</frontend_type>
538
- <source_model>adminhtml/system_config_source_email_template</source_model>
539
- <sort_order>2</sort_order>
540
- <show_in_default>1</show_in_default>
541
- <show_in_website>1</show_in_website>
542
- <show_in_store>1</show_in_store>
543
- </template>
544
- </fields>
545
- </delivered>
546
-
547
- <exception translate="label">
548
- <label>Exception</label>
549
- <frontend_type>text</frontend_type>
550
- <sort_order>5</sort_order>
551
- <show_in_default>1</show_in_default>
552
- <show_in_website>1</show_in_website>
553
- <show_in_store>1</show_in_store>
554
- <fields>
555
- <enabled_client translate="label">
556
- <label>Enabled for client</label>
557
- <frontend_type>select</frontend_type>
558
- <source_model>adminhtml/system_config_source_yesno</source_model>
559
- <sort_order>0</sort_order>
560
- <show_in_default>1</show_in_default>
561
- <show_in_website>1</show_in_website>
562
- <show_in_store>1</show_in_store>
563
- </enabled_client>
564
- <enabled_owner translate="label">
565
- <label>Enabled for owner</label>
566
- <frontend_type>select</frontend_type>
567
- <source_model>adminhtml/system_config_source_yesno</source_model>
568
- <sort_order>0</sort_order>
569
- <show_in_default>1</show_in_default>
570
- <show_in_website>1</show_in_website>
571
- <show_in_store>1</show_in_store>
572
- </enabled_owner>
573
- <identity translate="label">
574
- <label>Sender Email</label>
575
- <frontend_type>select</frontend_type>
576
- <source_model>adminhtml/system_config_source_email_identity</source_model>
577
- <sort_order>1</sort_order>
578
- <show_in_default>1</show_in_default>
579
- <show_in_website>1</show_in_website>
580
- <show_in_store>1</show_in_store>
581
- </identity>
582
- <template translate="label">
583
- <label>Template</label>
584
- <frontend_type>select</frontend_type>
585
- <source_model>adminhtml/system_config_source_email_template</source_model>
586
- <sort_order>2</sort_order>
587
- <show_in_default>1</show_in_default>
588
- <show_in_website>1</show_in_website>
589
- <show_in_store>1</show_in_store>
590
- </template>
591
- </fields>
592
- </exception>
593
- <failed_attempt translate="label">
594
- <label>Failed Attempt</label>
595
- <frontend_type>text</frontend_type>
596
- <sort_order>6</sort_order>
597
- <show_in_default>1</show_in_default>
598
- <show_in_website>1</show_in_website>
599
- <show_in_store>1</show_in_store>
600
- <fields>
601
- <enabled_client translate="label">
602
- <label>Enabled for client</label>
603
- <frontend_type>select</frontend_type>
604
- <source_model>adminhtml/system_config_source_yesno</source_model>
605
- <sort_order>0</sort_order>
606
- <show_in_default>1</show_in_default>
607
- <show_in_website>1</show_in_website>
608
- <show_in_store>1</show_in_store>
609
- </enabled_client>
610
- <enabled_owner translate="label">
611
- <label>Enabled for owner</label>
612
- <frontend_type>select</frontend_type>
613
- <source_model>adminhtml/system_config_source_yesno</source_model>
614
- <sort_order>0</sort_order>
615
- <show_in_default>1</show_in_default>
616
- <show_in_website>1</show_in_website>
617
- <show_in_store>1</show_in_store>
618
- </enabled_owner>
619
- <identity translate="label">
620
- <label>Sender Email</label>
621
- <frontend_type>select</frontend_type>
622
- <source_model>adminhtml/system_config_source_email_identity</source_model>
623
- <sort_order>1</sort_order>
624
- <show_in_default>1</show_in_default>
625
- <show_in_website>1</show_in_website>
626
- <show_in_store>1</show_in_store>
627
- </identity>
628
- <template translate="label">
629
- <label>Template</label>
630
- <frontend_type>select</frontend_type>
631
- <source_model>adminhtml/system_config_source_email_template</source_model>
632
- <sort_order>2</sort_order>
633
- <show_in_default>1</show_in_default>
634
- <show_in_website>1</show_in_website>
635
- <show_in_store>1</show_in_store>
636
- </template>
637
- </fields>
638
- </failed_attempt>
639
- </groups>
640
- </pp_section_notification_emails>
641
- <pp_section_carriers>
642
- <label>Carrier Settings</label>
643
- <class>packpin-settings</class>
644
- <tab>pp_tab</tab>
645
- <frontend_type>text</frontend_type>
646
- <sort_order>51003</sort_order>
647
- <show_in_default>1</show_in_default>
648
- <show_in_website>1</show_in_website>
649
- <show_in_store>0</show_in_store>
650
- <groups>
651
- <carriers translate="label">
652
- <expanded>1</expanded>
653
- <label>Enabled Carriers</label>
654
- <frontend_type>text</frontend_type>
655
- <frontend_model>pptrack/adminhtml_system_config_form_fieldset_carrier</frontend_model>
656
- <sort_order>1</sort_order>
657
- <show_in_default>1</show_in_default>
658
- <show_in_website>1</show_in_website>
659
- <show_in_store>0</show_in_store>
660
- </carriers>
661
- </groups>
662
- </pp_section_carriers>
663
- </sections>
664
- </config>
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <pp_tab translate="label" module="pptrack">
5
+ <label>Packpin</label>
6
+ <sort_order>51000</sort_order>
7
+ </pp_tab>
8
+ </tabs>
9
+ <sections>
10
+ <pp_section_setttings translate="label" module="pptrack">
11
+ <label>Packpin Settings</label>
12
+ <class>packpin-settings</class>
13
+ <tab>pp_tab</tab>
14
+ <frontend_type>text</frontend_type>
15
+ <sort_order>51001</sort_order>
16
+ <show_in_default>1</show_in_default>
17
+ <show_in_website>1</show_in_website>
18
+ <show_in_store>1</show_in_store>
19
+ <groups>
20
+ <hint>
21
+ <frontend_model>pptrack/adminhtml_system_config_fieldset_hint</frontend_model>
22
+ <sort_order>0</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ </hint>
27
+ <settings translate="label">
28
+ <expanded>1</expanded>
29
+ <label>General settings</label>
30
+ <frontend_type>text</frontend_type>
31
+ <sort_order>1</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>0</show_in_store>
35
+ <fields>
36
+ <status translate="label">
37
+ <label>Status</label>
38
+ <frontend_type>select</frontend_type>
39
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
40
+ <sort_order>11</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>0</show_in_store>
44
+ </status>
45
+ <api_key translate="label">
46
+ <label><![CDATA[ API key <strong style="color:red">*</strong>]]></label>
47
+ <frontend_type>text</frontend_type>
48
+ <sort_order>5</sort_order>
49
+ <show_in_default>1</show_in_default>
50
+ <show_in_website>1</show_in_website>
51
+ <show_in_store>0</show_in_store>
52
+ <validate>required-entry</validate>
53
+ </api_key>
54
+ <last_cron>
55
+ <label>Last Cron Time</label>
56
+ <frontend_type>text</frontend_type>
57
+ <sort_order>101</sort_order>
58
+ <show_in_default>0</show_in_default>
59
+ <show_in_website>0</show_in_website>
60
+ <show_in_store>0</show_in_store>
61
+ </last_cron>
62
+ <last_carrier_update>
63
+ <label>Last Carrier Update</label>
64
+ <frontend_type>text</frontend_type>
65
+ <sort_order>102</sort_order>
66
+ <show_in_default>0</show_in_default>
67
+ <show_in_website>0</show_in_website>
68
+ <show_in_store>0</show_in_store>
69
+ </last_carrier_update>
70
+ <temp_api_key>
71
+ <label>Is key being used a temporary one</label>
72
+ <frontend_type>text</frontend_type>
73
+ <sort_order>104</sort_order>
74
+ <show_in_default>0</show_in_default>
75
+ <show_in_website>0</show_in_website>
76
+ <show_in_store>0</show_in_store>
77
+ </temp_api_key>
78
+ <temp_key_installed>
79
+ <label>Unix time when temp key has been installed</label>
80
+ <frontend_type>text</frontend_type>
81
+ <sort_order>105</sort_order>
82
+ <show_in_default>0</show_in_default>
83
+ <show_in_website>0</show_in_website>
84
+ <show_in_store>0</show_in_store>
85
+ </temp_key_installed>
86
+ <upgrade_note>
87
+ <label><![CDATA[<strong>How to setup</strong>]]></label>
88
+ <frontend_type>note</frontend_type>
89
+ <sort_order>1</sort_order>
90
+ <show_in_default>1</show_in_default>
91
+ <show_in_website>1</show_in_website>
92
+ <show_in_store>0</show_in_store>
93
+ <comment>
94
+ <![CDATA[
95
+ <ol>
96
+ <li style="margin-bottom:10px !important;"><b>We will generate a temporary API key for you during installation. </b></li>
97
+ <li style="margin-bottom:10px !important;">In order to use all the features, please follow these steps:</li>
98
+ <li style="margin-bottom:10px !important;">1. Sign up at <a href="https://panel.packpin.com/" target="_blank">panel.packpin.com</a></li>
99
+ <li style="margin-bottom:10px !important;">2. Go to <a href="https://panel.packpin.com/api_keys" taget="_blank">"API keys"</a> and generate new key</li>
100
+ <li style="margin-bottom:10px !important;">3. Copy API key and paste to the field below</li>
101
+ <li>4. Now the plugin is active and running</li>
102
+ </ol>
103
+ ]]>
104
+ </comment>
105
+ </upgrade_note>
106
+ <disable_default_carriers translate="label">
107
+ <label>Disable default carriers</label>
108
+ <frontend_type>select</frontend_type>
109
+ <source_model>adminhtml/system_config_source_yesno</source_model>
110
+ <sort_order>20</sort_order>
111
+ <show_in_default>1</show_in_default>
112
+ <show_in_website>1</show_in_website>
113
+ <show_in_store>0</show_in_store>
114
+ </disable_default_carriers>
115
+ <pp_enable_notifications translate="label">
116
+ <backend_model>packpinpptrackvalidation/enableNotifications</backend_model>
117
+ <label>Enable Notifications</label>
118
+ <frontend_type>select</frontend_type>
119
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
120
+ <sort_order>21</sort_order>
121
+ <show_in_default>1</show_in_default>
122
+ <show_in_website>1</show_in_website>
123
+ <show_in_store>0</show_in_store>
124
+ <comment>In order to enable notifications we will create SOAP/XML-RPC role and user.</comment>
125
+ </pp_enable_notifications>
126
+ </fields>
127
+ </settings>
128
+ <crosssell>
129
+ <expanded>1</expanded>
130
+ <label>Cross-sell settings</label>
131
+ <frontend_type>text</frontend_type>
132
+ <sort_order>2</sort_order>
133
+ <show_in_default>1</show_in_default>
134
+ <show_in_website>1</show_in_website>
135
+ <show_in_store>0</show_in_store>
136
+ <fields>
137
+ <cross_sell_page translate="label">
138
+ <label>Show cross-sell items on shipment information page</label>
139
+ <frontend_type>select</frontend_type>
140
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
141
+ <sort_order>30</sort_order>
142
+ <show_in_default>1</show_in_default>
143
+ <show_in_website>1</show_in_website>
144
+ <show_in_store>0</show_in_store>
145
+ </cross_sell_page>
146
+ <cross_sell_page_type translate="label">
147
+ <label>What cross-sell items to show on page</label>
148
+ <frontend_type>select</frontend_type>
149
+ <source_model>Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Crossviewspage</source_model>
150
+ <sort_order>35</sort_order>
151
+ <show_in_default>1</show_in_default>
152
+ <show_in_website>1</show_in_website>
153
+ <show_in_store>0</show_in_store>
154
+ </cross_sell_page_type>
155
+ <cross_sell_page_items translate="label">
156
+ <label>Number of cross-sell products on page</label>
157
+ <frontend_type>text</frontend_type>
158
+ <sort_order>40</sort_order>
159
+ <show_in_default>1</show_in_default>
160
+ <show_in_website>1</show_in_website>
161
+ <show_in_store>0</show_in_store>
162
+ <comment>Recommended value is between 4 and 6</comment>
163
+ </cross_sell_page_items>
164
+ <cross_sell_page_image translate="label">
165
+ <label>Banner image</label>
166
+ <comment>Allowed file types: jpeg, gif, png.</comment>
167
+ <frontend_type>image</frontend_type>
168
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
169
+ <upload_dir config="system/filesystem/media" scope_info="1">theme</upload_dir>
170
+ <base_url type="media" scope_info="1">theme</base_url>
171
+ <sort_order>42</sort_order>
172
+ <show_in_default>1</show_in_default>
173
+ <show_in_website>1</show_in_website>
174
+ <show_in_store>0</show_in_store>
175
+ </cross_sell_page_image>
176
+ <cross_sell_page_image_url translate="label">
177
+ <label>Banner url</label>
178
+ <comment><![CDATA[
179
+ Should start with <b>http</b>
180
+ ]]></comment>
181
+ <frontend_type>text</frontend_type>
182
+ <sort_order>44</sort_order>
183
+ <show_in_default>1</show_in_default>
184
+ <show_in_website>1</show_in_website>
185
+ <show_in_store>0</show_in_store>
186
+ </cross_sell_page_image_url>
187
+ <cross_sell_page_script translate="label">
188
+ <label>Script</label>
189
+ <frontend_type>textarea</frontend_type>
190
+ <sort_order>46</sort_order>
191
+ <show_in_default>1</show_in_default>
192
+ <show_in_website>1</show_in_website>
193
+ <show_in_store>0</show_in_store>
194
+ <comment>Can enter HTML or JavaScript code here</comment>
195
+ </cross_sell_page_script>
196
+
197
+
198
+ <cross_sell_email translate="label">
199
+ <label>Show cross-sell items in notification emails</label>
200
+ <frontend_type>select</frontend_type>
201
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
202
+ <sort_order>50</sort_order>
203
+ <show_in_default>1</show_in_default>
204
+ <show_in_website>1</show_in_website>
205
+ <show_in_store>0</show_in_store>
206
+ </cross_sell_email>
207
+ <cross_sell_email_type translate="label">
208
+ <label>What cross-sell items to show in email</label>
209
+ <frontend_type>select</frontend_type>
210
+ <source_model>Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Crossviews</source_model>
211
+ <sort_order>55</sort_order>
212
+ <show_in_default>1</show_in_default>
213
+ <show_in_website>1</show_in_website>
214
+ <show_in_store>0</show_in_store>
215
+ </cross_sell_email_type>
216
+ <cross_sell_email_items translate="label">
217
+ <label>Number of cross-sell items in emails</label>
218
+ <frontend_type>text</frontend_type>
219
+ <sort_order>60</sort_order>
220
+ <show_in_default>1</show_in_default>
221
+ <show_in_website>1</show_in_website>
222
+ <show_in_store>0</show_in_store>
223
+ </cross_sell_email_items>
224
+ <cross_sell_email_image translate="label">
225
+ <label>Banner image</label>
226
+ <comment>Height should be at least 100px.</comment>
227
+ <frontend_type>image</frontend_type>
228
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
229
+ <upload_dir config="system/filesystem/media" scope_info="1">theme</upload_dir>
230
+ <base_url type="media" scope_info="1">theme</base_url>
231
+ <sort_order>62</sort_order>
232
+ <show_in_default>1</show_in_default>
233
+ <show_in_website>1</show_in_website>
234
+ <show_in_store>0</show_in_store>
235
+ </cross_sell_email_image>
236
+ <cross_sell_email_image_url translate="label">
237
+ <label>Banner url</label>
238
+ <comment><![CDATA[
239
+ Should start with <b>http</b>
240
+ ]]></comment>
241
+ <frontend_type>text</frontend_type>
242
+ <sort_order>64</sort_order>
243
+ <show_in_default>1</show_in_default>
244
+ <show_in_website>1</show_in_website>
245
+ <show_in_store>0</show_in_store>
246
+ </cross_sell_email_image_url>
247
+ <cross_sell_scripts>
248
+ <frontend_type>text</frontend_type>
249
+ <frontend_model>pptrack/adminhtml_system_config_fieldset_scripts</frontend_model>
250
+ <sort_order>70</sort_order>
251
+ <show_in_default>1</show_in_default>
252
+ <show_in_website>1</show_in_website>
253
+ <show_in_store>0</show_in_store>
254
+ </cross_sell_scripts>
255
+ </fields>
256
+ </crosssell>
257
+ <template translate="label">
258
+ <expanded>1</expanded>
259
+ <label>Page template</label>
260
+ <frontend_type>text</frontend_type>
261
+ <sort_order>4</sort_order>
262
+ <show_in_default>1</show_in_default>
263
+ <show_in_website>1</show_in_website>
264
+ <show_in_store>0</show_in_store>
265
+ <fields>
266
+ <template_type translate="label">
267
+ <label>Page template</label>
268
+ <frontend_type>select</frontend_type>
269
+ <source_model>Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Templatetype</source_model>
270
+ <sort_order>5</sort_order>
271
+ <show_in_default>1</show_in_default>
272
+ <show_in_website>1</show_in_website>
273
+ <show_in_store>0</show_in_store>
274
+ <comment>
275
+ <![CDATA[
276
+ <div class="pp-preview-row">
277
+ <div class="pp-preview-item-wrap">
278
+ <div class="pp-preview-image pp-preview-template1"></div>
279
+ <div class="pp-preview-item-title">
280
+ Template 1
281
+ </div>
282
+ </div>
283
+ <div class="pp-preview-item-wrap">
284
+ <div class="pp-preview-image pp-preview-template2"></div>
285
+ <div class="pp-preview-item-title">
286
+ Template 2
287
+ </div>
288
+ </div>
289
+ </div>
290
+ ]]>
291
+ </comment>
292
+ </template_type>
293
+ <template_image_type translate="label">
294
+ <label>Image</label>
295
+ <frontend_type>select</frontend_type>
296
+ <source_model>Packpin_Pptrack_Model_Adminhtml_System_Config_Source_Templateimage</source_model>
297
+ <sort_order>10</sort_order>
298
+ <show_in_default>1</show_in_default>
299
+ <show_in_website>1</show_in_website>
300
+ <show_in_store>0</show_in_store>
301
+ </template_image_type>
302
+ <template_image translate="label">
303
+ <label>Custom image</label>
304
+ <frontend_type>image</frontend_type>
305
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
306
+ <upload_dir config="system/filesystem/media" scope_info="1">theme</upload_dir>
307
+ <base_url type="media" scope_info="1">theme</base_url>
308
+ <sort_order>30</sort_order>
309
+ <show_in_default>1</show_in_default>
310
+ <show_in_website>1</show_in_website>
311
+ <show_in_store>0</show_in_store>
312
+ </template_image>
313
+ <template_image_link translate="label">
314
+ <label>Image links to</label>
315
+ <comment><![CDATA[
316
+ Should start with <b>http</b>
317
+ ]]></comment>
318
+ <frontend_type>text</frontend_type>
319
+ <sort_order>40</sort_order>
320
+ <show_in_default>1</show_in_default>
321
+ <show_in_website>1</show_in_website>
322
+ <show_in_store>0</show_in_store>
323
+ </template_image_link>
324
+ </fields>
325
+ </template>
326
+ <advanced translate="label">
327
+ <expanded>0</expanded>
328
+ <label>Advanced</label>
329
+ <frontend_type>text</frontend_type>
330
+ <sort_order>5</sort_order>
331
+ <show_in_default>1</show_in_default>
332
+ <show_in_website>1</show_in_website>
333
+ <show_in_store>0</show_in_store>
334
+ <fields>
335
+ <trigger_shipped_email translate="label">
336
+ <label>Automatically send email to client when tracking information has been added</label>
337
+ <frontend_type>select</frontend_type>
338
+ <source_model>adminhtml/system_config_source_yesno</source_model>
339
+ <sort_order>1</sort_order>
340
+ <show_in_default>1</show_in_default>
341
+ <show_in_website>1</show_in_website>
342
+ <show_in_store>0</show_in_store>
343
+ <comment>Should only be enabled if your tracking information is being populated through 3rd party connector</comment>
344
+ </trigger_shipped_email>
345
+ </fields>
346
+ </advanced>
347
+ </groups>
348
+ </pp_section_setttings>
349
+
350
+ <pp_section_notification_emails translate="label" module="sales">
351
+ <label>Notification Emails</label>
352
+ <class>packpin-settings</class>
353
+ <tab>pp_tab</tab>
354
+ <frontend_type>text</frontend_type>
355
+ <sort_order>51002</sort_order>
356
+ <show_in_default>1</show_in_default>
357
+ <show_in_website>1</show_in_website>
358
+ <show_in_store>1</show_in_store>
359
+ <groups>
360
+ <info_received translate="label">
361
+ <label>Info Received</label>
362
+ <frontend_type>text</frontend_type>
363
+ <sort_order>1</sort_order>
364
+ <show_in_default>1</show_in_default>
365
+ <show_in_website>1</show_in_website>
366
+ <show_in_store>1</show_in_store>
367
+ <fields>
368
+ <enabled_client translate="label">
369
+ <label>Enabled for client</label>
370
+ <frontend_type>select</frontend_type>
371
+ <source_model>adminhtml/system_config_source_yesno</source_model>
372
+ <sort_order>0</sort_order>
373
+ <show_in_default>1</show_in_default>
374
+ <show_in_website>1</show_in_website>
375
+ <show_in_store>1</show_in_store>
376
+ </enabled_client>
377
+ <enabled_owner translate="label">
378
+ <label>Enabled for owner</label>
379
+ <frontend_type>select</frontend_type>
380
+ <source_model>adminhtml/system_config_source_yesno</source_model>
381
+ <sort_order>0</sort_order>
382
+ <show_in_default>1</show_in_default>
383
+ <show_in_website>1</show_in_website>
384
+ <show_in_store>1</show_in_store>
385
+ </enabled_owner>
386
+ <identity translate="label">
387
+ <label>Sender Email</label>
388
+ <frontend_type>select</frontend_type>
389
+ <source_model>adminhtml/system_config_source_email_identity</source_model>
390
+ <sort_order>1</sort_order>
391
+ <show_in_default>1</show_in_default>
392
+ <show_in_website>1</show_in_website>
393
+ <show_in_store>1</show_in_store>
394
+ </identity>
395
+ <template translate="label">
396
+ <label>Template</label>
397
+ <frontend_type>select</frontend_type>
398
+ <source_model>adminhtml/system_config_source_email_template</source_model>
399
+ <sort_order>2</sort_order>
400
+ <show_in_default>1</show_in_default>
401
+ <show_in_website>1</show_in_website>
402
+ <show_in_store>1</show_in_store>
403
+ </template>
404
+ </fields>
405
+ </info_received>
406
+
407
+ <in_transit translate="label">
408
+ <label>In Transit</label>
409
+ <frontend_type>text</frontend_type>
410
+ <sort_order>2</sort_order>
411
+ <show_in_default>1</show_in_default>
412
+ <show_in_website>1</show_in_website>
413
+ <show_in_store>1</show_in_store>
414
+ <fields>
415
+ <enabled_client translate="label">
416
+ <label>Enabled for client</label>
417
+ <frontend_type>select</frontend_type>
418
+ <source_model>adminhtml/system_config_source_yesno</source_model>
419
+ <sort_order>0</sort_order>
420
+ <show_in_default>1</show_in_default>
421
+ <show_in_website>1</show_in_website>
422
+ <show_in_store>1</show_in_store>
423
+ </enabled_client>
424
+ <enabled_owner translate="label">
425
+ <label>Enabled for owner</label>
426
+ <frontend_type>select</frontend_type>
427
+ <source_model>adminhtml/system_config_source_yesno</source_model>
428
+ <sort_order>0</sort_order>
429
+ <show_in_default>1</show_in_default>
430
+ <show_in_website>1</show_in_website>
431
+ <show_in_store>1</show_in_store>
432
+ </enabled_owner>
433
+ <identity translate="label">
434
+ <label>Sender Email</label>
435
+ <frontend_type>select</frontend_type>
436
+ <source_model>adminhtml/system_config_source_email_identity</source_model>
437
+ <sort_order>1</sort_order>
438
+ <show_in_default>1</show_in_default>
439
+ <show_in_website>1</show_in_website>
440
+ <show_in_store>1</show_in_store>
441
+ </identity>
442
+ <template translate="label">
443
+ <label>Template</label>
444
+ <frontend_type>select</frontend_type>
445
+ <source_model>adminhtml/system_config_source_email_template</source_model>
446
+ <sort_order>2</sort_order>
447
+ <show_in_default>1</show_in_default>
448
+ <show_in_website>1</show_in_website>
449
+ <show_in_store>1</show_in_store>
450
+ </template>
451
+ </fields>
452
+ </in_transit>
453
+
454
+ <out_for_delivery translate="label">
455
+ <label>Out for Delivery</label>
456
+ <frontend_type>text</frontend_type>
457
+ <sort_order>3</sort_order>
458
+ <show_in_default>1</show_in_default>
459
+ <show_in_website>1</show_in_website>
460
+ <show_in_store>1</show_in_store>
461
+ <fields>
462
+ <enabled_client translate="label">
463
+ <label>Enabled for client</label>
464
+ <frontend_type>select</frontend_type>
465
+ <source_model>adminhtml/system_config_source_yesno</source_model>
466
+ <sort_order>0</sort_order>
467
+ <show_in_default>1</show_in_default>
468
+ <show_in_website>1</show_in_website>
469
+ <show_in_store>1</show_in_store>
470
+ </enabled_client>
471
+ <enabled_owner translate="label">
472
+ <label>Enabled for owner</label>
473
+ <frontend_type>select</frontend_type>
474
+ <source_model>adminhtml/system_config_source_yesno</source_model>
475
+ <sort_order>0</sort_order>
476
+ <show_in_default>1</show_in_default>
477
+ <show_in_website>1</show_in_website>
478
+ <show_in_store>1</show_in_store>
479
+ </enabled_owner>
480
+ <identity translate="label">
481
+ <label>Sender Email</label>
482
+ <frontend_type>select</frontend_type>
483
+ <source_model>adminhtml/system_config_source_email_identity</source_model>
484
+ <sort_order>1</sort_order>
485
+ <show_in_default>1</show_in_default>
486
+ <show_in_website>1</show_in_website>
487
+ <show_in_store>1</show_in_store>
488
+ </identity>
489
+ <template translate="label">
490
+ <label>Template</label>
491
+ <frontend_type>select</frontend_type>
492
+ <source_model>adminhtml/system_config_source_email_template</source_model>
493
+ <sort_order>2</sort_order>
494
+ <show_in_default>1</show_in_default>
495
+ <show_in_website>1</show_in_website>
496
+ <show_in_store>1</show_in_store>
497
+ </template>
498
+ </fields>
499
+ </out_for_delivery>
500
+ <delivered translate="label">
501
+ <label>Delivered</label>
502
+ <frontend_type>text</frontend_type>
503
+ <sort_order>4</sort_order>
504
+ <show_in_default>1</show_in_default>
505
+ <show_in_website>1</show_in_website>
506
+ <show_in_store>1</show_in_store>
507
+ <fields>
508
+ <enabled_client translate="label">
509
+ <label>Enabled for client</label>
510
+ <frontend_type>select</frontend_type>
511
+ <source_model>adminhtml/system_config_source_yesno</source_model>
512
+ <sort_order>0</sort_order>
513
+ <show_in_default>1</show_in_default>
514
+ <show_in_website>1</show_in_website>
515
+ <show_in_store>1</show_in_store>
516
+ </enabled_client>
517
+ <enabled_owner translate="label">
518
+ <label>Enabled for owner</label>
519
+ <frontend_type>select</frontend_type>
520
+ <source_model>adminhtml/system_config_source_yesno</source_model>
521
+ <sort_order>0</sort_order>
522
+ <show_in_default>1</show_in_default>
523
+ <show_in_website>1</show_in_website>
524
+ <show_in_store>1</show_in_store>
525
+ </enabled_owner>
526
+ <identity translate="label">
527
+ <label>Sender Email</label>
528
+ <frontend_type>select</frontend_type>
529
+ <source_model>adminhtml/system_config_source_email_identity</source_model>
530
+ <sort_order>1</sort_order>
531
+ <show_in_default>1</show_in_default>
532
+ <show_in_website>1</show_in_website>
533
+ <show_in_store>1</show_in_store>
534
+ </identity>
535
+ <template translate="label">
536
+ <label>Template</label>
537
+ <frontend_type>select</frontend_type>
538
+ <source_model>adminhtml/system_config_source_email_template</source_model>
539
+ <sort_order>2</sort_order>
540
+ <show_in_default>1</show_in_default>
541
+ <show_in_website>1</show_in_website>
542
+ <show_in_store>1</show_in_store>
543
+ </template>
544
+ </fields>
545
+ </delivered>
546
+
547
+ <exception translate="label">
548
+ <label>Exception</label>
549
+ <frontend_type>text</frontend_type>
550
+ <sort_order>5</sort_order>
551
+ <show_in_default>1</show_in_default>
552
+ <show_in_website>1</show_in_website>
553
+ <show_in_store>1</show_in_store>
554
+ <fields>
555
+ <enabled_client translate="label">
556
+ <label>Enabled for client</label>
557
+ <frontend_type>select</frontend_type>
558
+ <source_model>adminhtml/system_config_source_yesno</source_model>
559
+ <sort_order>0</sort_order>
560
+ <show_in_default>1</show_in_default>
561
+ <show_in_website>1</show_in_website>
562
+ <show_in_store>1</show_in_store>
563
+ </enabled_client>
564
+ <enabled_owner translate="label">
565
+ <label>Enabled for owner</label>
566
+ <frontend_type>select</frontend_type>
567
+ <source_model>adminhtml/system_config_source_yesno</source_model>
568
+ <sort_order>0</sort_order>
569
+ <show_in_default>1</show_in_default>
570
+ <show_in_website>1</show_in_website>
571
+ <show_in_store>1</show_in_store>
572
+ </enabled_owner>
573
+ <identity translate="label">
574
+ <label>Sender Email</label>
575
+ <frontend_type>select</frontend_type>
576
+ <source_model>adminhtml/system_config_source_email_identity</source_model>
577
+ <sort_order>1</sort_order>
578
+ <show_in_default>1</show_in_default>
579
+ <show_in_website>1</show_in_website>
580
+ <show_in_store>1</show_in_store>
581
+ </identity>
582
+ <template translate="label">
583
+ <label>Template</label>
584
+ <frontend_type>select</frontend_type>
585
+ <source_model>adminhtml/system_config_source_email_template</source_model>
586
+ <sort_order>2</sort_order>
587
+ <show_in_default>1</show_in_default>
588
+ <show_in_website>1</show_in_website>
589
+ <show_in_store>1</show_in_store>
590
+ </template>
591
+ </fields>
592
+ </exception>
593
+ <failed_attempt translate="label">
594
+ <label>Failed Attempt</label>
595
+ <frontend_type>text</frontend_type>
596
+ <sort_order>6</sort_order>
597
+ <show_in_default>1</show_in_default>
598
+ <show_in_website>1</show_in_website>
599
+ <show_in_store>1</show_in_store>
600
+ <fields>
601
+ <enabled_client translate="label">
602
+ <label>Enabled for client</label>
603
+ <frontend_type>select</frontend_type>
604
+ <source_model>adminhtml/system_config_source_yesno</source_model>
605
+ <sort_order>0</sort_order>
606
+ <show_in_default>1</show_in_default>
607
+ <show_in_website>1</show_in_website>
608
+ <show_in_store>1</show_in_store>
609
+ </enabled_client>
610
+ <enabled_owner translate="label">
611
+ <label>Enabled for owner</label>
612
+ <frontend_type>select</frontend_type>
613
+ <source_model>adminhtml/system_config_source_yesno</source_model>
614
+ <sort_order>0</sort_order>
615
+ <show_in_default>1</show_in_default>
616
+ <show_in_website>1</show_in_website>
617
+ <show_in_store>1</show_in_store>
618
+ </enabled_owner>
619
+ <identity translate="label">
620
+ <label>Sender Email</label>
621
+ <frontend_type>select</frontend_type>
622
+ <source_model>adminhtml/system_config_source_email_identity</source_model>
623
+ <sort_order>1</sort_order>
624
+ <show_in_default>1</show_in_default>
625
+ <show_in_website>1</show_in_website>
626
+ <show_in_store>1</show_in_store>
627
+ </identity>
628
+ <template translate="label">
629
+ <label>Template</label>
630
+ <frontend_type>select</frontend_type>
631
+ <source_model>adminhtml/system_config_source_email_template</source_model>
632
+ <sort_order>2</sort_order>
633
+ <show_in_default>1</show_in_default>
634
+ <show_in_website>1</show_in_website>
635
+ <show_in_store>1</show_in_store>
636
+ </template>
637
+ </fields>
638
+ </failed_attempt>
639
+ </groups>
640
+ </pp_section_notification_emails>
641
+ <pp_section_carriers>
642
+ <label>Carrier Settings</label>
643
+ <class>packpin-settings</class>
644
+ <tab>pp_tab</tab>
645
+ <frontend_type>text</frontend_type>
646
+ <sort_order>51003</sort_order>
647
+ <show_in_default>1</show_in_default>
648
+ <show_in_website>1</show_in_website>
649
+ <show_in_store>0</show_in_store>
650
+ <groups>
651
+ <carriers translate="label">
652
+ <expanded>1</expanded>
653
+ <label>Enabled Carriers</label>
654
+ <frontend_type>text</frontend_type>
655
+ <frontend_model>pptrack/adminhtml_system_config_form_fieldset_carrier</frontend_model>
656
+ <sort_order>1</sort_order>
657
+ <show_in_default>1</show_in_default>
658
+ <show_in_website>1</show_in_website>
659
+ <show_in_store>0</show_in_store>
660
+ </carriers>
661
+ </groups>
662
+ </pp_section_carriers>
663
+ </sections>
664
+ </config>
app/code/community/Packpin/Pptrack/sql/pptrack_setup/mysql4-install-0.1.2.php CHANGED
@@ -1,86 +1,86 @@
1
- <?php
2
- $installer = $this;
3
-
4
- $installer->startSetup();
5
-
6
- $tableNameTrack = $installer->getTable('pptrack/track');
7
- $tableNameDetails = $installer->getTable('pptrack/trackdetail');
8
- $tableNameCarriers = $installer->getTable('pptrack/carrier');
9
- $tableNameSettings = $installer->getTable('pptrack/setting');
10
-
11
- $installer->run("DROP TABLE IF EXISTS `{$tableNameDetails}`;");
12
- $installer->run("DROP TABLE IF EXISTS `{$tableNameTrack}`;");
13
- $installer->run("DROP TABLE IF EXISTS `{$tableNameCarriers}`;");
14
- $installer->run("DROP TABLE IF EXISTS `{$tableNameSettings}`;");
15
-
16
- $sql=<<<SQLTEXT
17
-
18
- CREATE TABLE IF NOT EXISTS `{$tableNameTrack}` (
19
- `id` INT NOT NULL AUTO_INCREMENT ,
20
- `hash` varchar(255) NOT NULL,
21
- `order_id` varchar(255) NOT NULL,
22
- `shipment_id` INT DEFAULT NULL,
23
- `code` varchar(50) NOT NULL,
24
- `carrier_code` varchar(50) DEFAULT NULL,
25
- `carrier_name` varchar(255) DEFAULT NULL,
26
- `postal_code` varchar(50) DEFAULT NULL,
27
- `ship_date` varchar(50) DEFAULT NULL,
28
- `destination_country` varchar(50) DEFAULT NULL,
29
- `status` varchar(50) DEFAULT 'pending',
30
- `email` varchar(255) DEFAULT NULL,
31
- `phone` varchar(255) DEFAULT NULL,
32
- `created_at` INT DEFAULT NULL,
33
- `updated_at` INT DEFAULT NULL,
34
- `submitted` INT NOT NULL DEFAULT '0',
35
- PRIMARY KEY (`id`),
36
- KEY `hash` (`hash`),
37
- KEY `order_id` (`order_id`),
38
- KEY `submitted` (`submitted`)
39
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
40
-
41
-
42
- CREATE TABLE IF NOT EXISTS `{$tableNameDetails}` (
43
- `id` INT NOT NULL AUTO_INCREMENT ,
44
- `track_id` INT NOT NULL,
45
- `carrier` varchar(50) DEFAULT NULL,
46
- `status` varchar(50) NOT NULL,
47
- `status_string` varchar(255) DEFAULT NULL,
48
- `event_date` DATE DEFAULT NULL,
49
- `event_time` TIME DEFAULT NULL,
50
- `address` varchar(255) DEFAULT NULL,
51
- `country` char(2) DEFAULT NULL,
52
- PRIMARY KEY (`id`)
53
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
54
-
55
-
56
- CREATE TABLE IF NOT EXISTS `{$tableNameCarriers}` (
57
- `id` INT NOT NULL AUTO_INCREMENT ,
58
- `code` varchar(50) NOT NULL,
59
- `name` varchar(255) NOT NULL,
60
- `phone` varchar(255) DEFAULT NULL,
61
- `homepage` varchar(255) DEFAULT NULL,
62
- `enabled` INT NOT NULL DEFAULT '1',
63
- PRIMARY KEY (`id`)
64
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
65
-
66
- CREATE TABLE IF NOT EXISTS `{$tableNameSettings}` (
67
- `id` INT NOT NULL AUTO_INCREMENT ,
68
- `setting` varchar(255) NOT NULL,
69
- `value` varchar(255) NOT NULL,
70
- PRIMARY KEY (`id`)
71
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
72
-
73
- ALTER TABLE `{$tableNameDetails}`
74
- ADD KEY `track_details_track_id_foreign` (`track_id`);
75
-
76
- ALTER TABLE `{$tableNameDetails}`
77
- ADD CONSTRAINT `track_details_track_id_foreign` FOREIGN KEY (`track_id`) REFERENCES `{$tableNameTrack}` (`id`) ON DELETE CASCADE;
78
-
79
- ALTER TABLE `$tableNameSettings`
80
- ADD UNIQUE KEY `pp_settings_setting_unique` (`setting`);
81
-
82
- SQLTEXT;
83
-
84
- $installer->run($sql);
85
-
86
  $installer->endSetup();
1
+ <?php
2
+ $installer = $this;
3
+
4
+ $installer->startSetup();
5
+
6
+ $tableNameTrack = $installer->getTable('pptrack/track');
7
+ $tableNameDetails = $installer->getTable('pptrack/trackdetail');
8
+ $tableNameCarriers = $installer->getTable('pptrack/carrier');
9
+ $tableNameSettings = $installer->getTable('pptrack/setting');
10
+
11
+ $installer->run("DROP TABLE IF EXISTS `{$tableNameDetails}`;");
12
+ $installer->run("DROP TABLE IF EXISTS `{$tableNameTrack}`;");
13
+ $installer->run("DROP TABLE IF EXISTS `{$tableNameCarriers}`;");
14
+ $installer->run("DROP TABLE IF EXISTS `{$tableNameSettings}`;");
15
+
16
+ $sql=<<<SQLTEXT
17
+
18
+ CREATE TABLE IF NOT EXISTS `{$tableNameTrack}` (
19
+ `id` INT NOT NULL AUTO_INCREMENT ,
20
+ `hash` varchar(255) NOT NULL,
21
+ `order_id` varchar(255) NOT NULL,
22
+ `shipment_id` INT DEFAULT NULL,
23
+ `code` varchar(50) NOT NULL,
24
+ `carrier_code` varchar(50) DEFAULT NULL,
25
+ `carrier_name` varchar(255) DEFAULT NULL,
26
+ `postal_code` varchar(50) DEFAULT NULL,
27
+ `ship_date` varchar(50) DEFAULT NULL,
28
+ `destination_country` varchar(50) DEFAULT NULL,
29
+ `status` varchar(50) DEFAULT 'pending',
30
+ `email` varchar(255) DEFAULT NULL,
31
+ `phone` varchar(255) DEFAULT NULL,
32
+ `created_at` INT DEFAULT NULL,
33
+ `updated_at` INT DEFAULT NULL,
34
+ `submitted` INT NOT NULL DEFAULT '0',
35
+ PRIMARY KEY (`id`),
36
+ KEY `hash` (`hash`),
37
+ KEY `order_id` (`order_id`),
38
+ KEY `submitted` (`submitted`)
39
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
40
+
41
+
42
+ CREATE TABLE IF NOT EXISTS `{$tableNameDetails}` (
43
+ `id` INT NOT NULL AUTO_INCREMENT ,
44
+ `track_id` INT NOT NULL,
45
+ `carrier` varchar(50) DEFAULT NULL,
46
+ `status` varchar(50) NOT NULL,
47
+ `status_string` varchar(255) DEFAULT NULL,
48
+ `event_date` DATE DEFAULT NULL,
49
+ `event_time` TIME DEFAULT NULL,
50
+ `address` varchar(255) DEFAULT NULL,
51
+ `country` char(2) DEFAULT NULL,
52
+ PRIMARY KEY (`id`)
53
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
54
+
55
+
56
+ CREATE TABLE IF NOT EXISTS `{$tableNameCarriers}` (
57
+ `id` INT NOT NULL AUTO_INCREMENT ,
58
+ `code` varchar(50) NOT NULL,
59
+ `name` varchar(255) NOT NULL,
60
+ `phone` varchar(255) DEFAULT NULL,
61
+ `homepage` varchar(255) DEFAULT NULL,
62
+ `enabled` INT NOT NULL DEFAULT '1',
63
+ PRIMARY KEY (`id`)
64
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
65
+
66
+ CREATE TABLE IF NOT EXISTS `{$tableNameSettings}` (
67
+ `id` INT NOT NULL AUTO_INCREMENT ,
68
+ `setting` varchar(255) NOT NULL,
69
+ `value` varchar(255) NOT NULL,
70
+ PRIMARY KEY (`id`)
71
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
72
+
73
+ ALTER TABLE `{$tableNameDetails}`
74
+ ADD KEY `track_details_track_id_foreign` (`track_id`);
75
+
76
+ ALTER TABLE `{$tableNameDetails}`
77
+ ADD CONSTRAINT `track_details_track_id_foreign` FOREIGN KEY (`track_id`) REFERENCES `{$tableNameTrack}` (`id`) ON DELETE CASCADE;
78
+
79
+ ALTER TABLE `$tableNameSettings`
80
+ ADD UNIQUE KEY `pp_settings_setting_unique` (`setting`);
81
+
82
+ SQLTEXT;
83
+
84
+ $installer->run($sql);
85
+
86
  $installer->endSetup();
app/code/community/Packpin/Pptrack/sql/pptrack_setup/mysql4-upgrade-0.1.2-0.1.5.php CHANGED
@@ -1,22 +1,22 @@
1
- <?php
2
- $installer = $this;
3
-
4
- $installer->startSetup();
5
-
6
- $tableNameUnsubscribe = $installer->getTable('pptrack/trackunsubscribed');
7
-
8
-
9
- $sql=<<<SQLTEXT
10
-
11
- CREATE TABLE IF NOT EXISTS `{$tableNameUnsubscribe}` (
12
- `id` INT NOT NULL AUTO_INCREMENT ,
13
- `track_id` INT NOT NULL,
14
- PRIMARY KEY (`id`),
15
- KEY `track_id` (`track_id`)
16
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
17
-
18
- SQLTEXT;
19
-
20
- $installer->run($sql);
21
-
22
  $installer->endSetup();
1
+ <?php
2
+ $installer = $this;
3
+
4
+ $installer->startSetup();
5
+
6
+ $tableNameUnsubscribe = $installer->getTable('pptrack/trackunsubscribed');
7
+
8
+
9
+ $sql=<<<SQLTEXT
10
+
11
+ CREATE TABLE IF NOT EXISTS `{$tableNameUnsubscribe}` (
12
+ `id` INT NOT NULL AUTO_INCREMENT ,
13
+ `track_id` INT NOT NULL,
14
+ PRIMARY KEY (`id`),
15
+ KEY `track_id` (`track_id`)
16
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
17
+
18
+ SQLTEXT;
19
+
20
+ $installer->run($sql);
21
+
22
  $installer->endSetup();
app/code/community/Packpin/Pptrack/sql/pptrack_setup/mysql4-upgrade-0.1.5-1.3.0.php CHANGED
@@ -1,32 +1,32 @@
1
- <?php
2
- $installer = $this;
3
-
4
- $installer->startSetup();
5
-
6
- $table = $installer->getTable('pptrack/visit');
7
- $tableNameTrack = $installer->getTable('pptrack/track');
8
-
9
-
10
-
11
- $sql=<<<SQLTEXT
12
-
13
- CREATE TABLE IF NOT EXISTS `{$table}` (
14
- `id` INT NOT NULL AUTO_INCREMENT ,
15
- `track_id` INT DEFAULT NULL,
16
- `user_hash` char(32) NOT NULL,
17
- `user_ip` varchar(255) NOT NULL,
18
- `user_agent` varchar(255) DEFAULT NULL,
19
- `created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
20
- PRIMARY KEY (`id`),
21
- KEY `track_id` (`track_id`),
22
- KEY `user_hash` (`user_hash`),
23
- KEY `created_at` (`created_at`)
24
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
25
-
26
- ALTER TABLE `{$tableNameTrack}` ADD INDEX(`created_at`);
27
-
28
- SQLTEXT;
29
-
30
- $installer->run($sql);
31
-
32
  $installer->endSetup();
1
+ <?php
2
+ $installer = $this;
3
+
4
+ $installer->startSetup();
5
+
6
+ $table = $installer->getTable('pptrack/visit');
7
+ $tableNameTrack = $installer->getTable('pptrack/track');
8
+
9
+
10
+
11
+ $sql=<<<SQLTEXT
12
+
13
+ CREATE TABLE IF NOT EXISTS `{$table}` (
14
+ `id` INT NOT NULL AUTO_INCREMENT ,
15
+ `track_id` INT DEFAULT NULL,
16
+ `user_hash` char(32) NOT NULL,
17
+ `user_ip` varchar(255) NOT NULL,
18
+ `user_agent` varchar(255) DEFAULT NULL,
19
+ `created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
20
+ PRIMARY KEY (`id`),
21
+ KEY `track_id` (`track_id`),
22
+ KEY `user_hash` (`user_hash`),
23
+ KEY `created_at` (`created_at`)
24
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
25
+
26
+ ALTER TABLE `{$tableNameTrack}` ADD INDEX(`created_at`);
27
+
28
+ SQLTEXT;
29
+
30
+ $installer->run($sql);
31
+
32
  $installer->endSetup();
app/code/community/Packpin/Pptrack/sql/pptrack_setup/mysql4-upgrade-0.3.0-1.5.5.php DELETED
@@ -1,18 +0,0 @@
1
- <?php
2
- $installer = $this;
3
-
4
- $installer->startSetup();
5
-
6
- $tableNameTrack = $installer->getTable('pptrack/track');
7
-
8
-
9
-
10
- $sql=<<<SQLTEXT
11
-
12
- ALTER TABLE `{$tableNameTrack}` ADD `order_number` VARCHAR(50) NULL , ADD INDEX (`order_number`) ;
13
-
14
- SQLTEXT;
15
-
16
- $installer->run($sql);
17
-
18
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/layout/pptrack.xml CHANGED
@@ -1,28 +1,28 @@
1
- <?xml version="1.0"?>
2
- <layout version="1.3.3">
3
- <adminhtml_packpintracks_dashboard>
4
- <reference name="head">
5
- <action method="addCss">
6
- <name>pptrack/css/dashboard.css</name>
7
- </action>
8
- <action method="addCss">
9
- <name>pptrack/css/pptrack.css</name>
10
- </action>
11
- <action method="addItem">
12
- <type>skin_js</type>
13
- <name>pptrack/js/dashboard.js</name>
14
- </action>
15
- </reference>
16
- <reference name="content">
17
- <block type="pptrack/adminhtml_dashboard" name="pptrack_adminhtml_trackings.dashboard" template="pptrack/dashboard/index.phtml"/>
18
- <block type="pptrack/adminhtml_tracks" name="pptrack_tracks" />
19
- </reference>
20
- </adminhtml_packpintracks_dashboard>
21
- <adminhtml_system_config_edit>
22
- <reference name="head">
23
- <action method="addCss">
24
- <name>pptrack/css/pptrack.css</name>
25
- </action>
26
- </reference>
27
- </adminhtml_system_config_edit>
28
  </layout>
1
+ <?xml version="1.0"?>
2
+ <layout version="1.3.3">
3
+ <adminhtml_packpintracks_dashboard>
4
+ <reference name="head">
5
+ <action method="addCss">
6
+ <name>pptrack/css/dashboard.css</name>
7
+ </action>
8
+ <action method="addCss">
9
+ <name>pptrack/css/pptrack.css</name>
10
+ </action>
11
+ <action method="addItem">
12
+ <type>skin_js</type>
13
+ <name>pptrack/js/dashboard.js</name>
14
+ </action>
15
+ </reference>
16
+ <reference name="content">
17
+ <block type="pptrack/adminhtml_dashboard" name="pptrack_adminhtml_trackings.dashboard" template="pptrack/dashboard/index.phtml"/>
18
+ <block type="pptrack/adminhtml_tracks" name="pptrack_tracks" />
19
+ </reference>
20
+ </adminhtml_packpintracks_dashboard>
21
+ <adminhtml_system_config_edit>
22
+ <reference name="head">
23
+ <action method="addCss">
24
+ <name>pptrack/css/pptrack.css</name>
25
+ </action>
26
+ </reference>
27
+ </adminhtml_system_config_edit>
28
  </layout>
app/design/adminhtml/default/default/template/pptrack/dashboard/index.phtml CHANGED
@@ -1,182 +1,182 @@
1
- <?php
2
- $planDetails = $this->getPlanDetails();
3
- $rangeInfo = $this->getRangeInfo();
4
- $range = $this->getSelectedRange();
5
- $rangeStats = $this->getRangeStats();
6
- $data = $rangeStats['graph'];
7
- ?>
8
- <div class="content-header">
9
- <table cellspacing="0">
10
- <tr>
11
- <td style="width:50%;"><h3><?php echo Mage::helper('pptrack')->__('Packpin Dashboard') ?></h3></td>
12
- </tr>
13
- </table>
14
- </div>
15
-
16
- <?php if (!$this->pluginEnabled() || !$this->notificationsEnabled()) : ?>
17
- <ul class="messages">
18
- <li class="error-msg">
19
- <ul>
20
- <li>
21
- <span>
22
- <?php echo !$this->pluginEnabled() ? Mage::helper('pptrack')->__('Packpin extension is disabled.') : Mage::helper('pptrack')->__('Packpin notifications are disabled.') ?>
23
- <a href="<?php echo $this->getUrl('adminhtml/system_config/edit/section/pp_section_setttings') ?>"><?php echo Mage::helper('pptrack')->__('Click here') ?></a> <?php echo Mage::helper('pptrack')->__('to change your settings') ?>
24
- </span>
25
- </li>
26
- </ul>
27
- </li>
28
- </ul>
29
- <?php endif; ?>
30
-
31
- <div id="dashboard_diagram_totals" class="box">
32
- <div class="entry-edit">
33
- <table width="100%" cellspacing="0">
34
- <tbody><tr>
35
- <td style="width:33%;" class="a-center bold">
36
- <span><?php echo Mage::helper('pptrack')->__('Plan Name') ?></span><br>
37
- <span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo isset($planDetails['name']) ? $planDetails['name'] : '?' ?></span>
38
- </td>
39
- <td style="width:33%;" class="a-center bold">
40
- <span><?php echo Mage::helper('pptrack')->__('Total Trackings') ?></span><br>
41
- <span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo isset($planDetails['trackings']['count']) ? number_format($planDetails['trackings']['count']) : '?' ?></span>
42
- </td>
43
- <td style="width:33%;" class="a-center bold">
44
- <span><?php echo Mage::helper('pptrack')->__('Trackings Left This Month') ?></span><br>
45
- <span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo isset($planDetails['trackings']['left']) ? number_format($planDetails['trackings']['left']) : '?' ?></span>
46
- </td>
47
- </tr>
48
- </tbody></table>
49
- </div>
50
- </div>
51
-
52
-
53
-
54
- <div class="dashboard-container">
55
- <form id="dateRangeForm" method="get" action="<?php echo $this->getUrl('adminhtml/packpintracks/dashboard') ?>">
56
- <p class="switcher"><label for="store_switcher"><?php echo Mage::helper('pptrack')->__('Date range') ?></label>
57
- <select id="range_switcher" name="range">
58
- <?php foreach ($rangeInfo as $code => $item) : ?>
59
- <option <?php echo $range == $code ? 'selected="selected"' : '' ?> value="<?php echo $code ?>"><?php echo $item['label'] ?></option>
60
- <?php endforeach; ?>
61
- </select>
62
-
63
- <input class="a-center" type="text" name="date_from" id="date_from" value="<?php echo $rangeInfo[$range]['date_start'] ?>" >
64
- <img src="<?php echo $this->getSkinUrl('images/grid-cal.gif') ?>" class="v-middle" id="date_from_trig"/>
65
- <input class="a-center" type="text" name="date_to" id="date_to" value="<?php echo $rangeInfo[$range]['date_end'] ?>" >
66
- <img src="<?php echo $this->getSkinUrl('images/grid-cal.gif') ?>" class="v-middle" id="date_to_trig"/>
67
- </p>
68
- </form>
69
- <table cellspacing='5' width='100%'>
70
- <tr>
71
- <td style="width: 25%;">
72
- <div class="entry-edit">
73
- <div class="entry-edit-head"><h4><?php echo Mage::helper('pptrack')->__('Shipments Tracked') ?></h4>
74
- </div>
75
- <fieldset class="a-center bold" style="padding:20px 0;">
76
- <span style="font-size:18px;" class="nowrap"><?php echo number_format($rangeStats['trackings']) ?></span>
77
- </fieldset>
78
- </div>
79
- </td>
80
- <td style="width: 25%;">
81
- <div class="entry-edit">
82
- <div class="entry-edit-head"><h4><?php echo Mage::helper('pptrack')->__('Notification Emails Sent') ?></h4>
83
- </div>
84
- <fieldset class="a-center bold" style="padding:20px 0;">
85
- <span style="font-size:18px;" class="nowrap"><?php echo is_int($rangeStats['emails']) ? number_format($rangeStats['emails']) : $rangeStats['emails'] ?></span>
86
- </fieldset>
87
- </div>
88
- </td>
89
- <td style="width: 25%;">
90
- <div class="entry-edit">
91
- <div class="entry-edit-head"><h4><?php echo Mage::helper('pptrack')->__('Visits Generated') ?></h4>
92
- </div>
93
- <fieldset class="a-center bold" style="padding:20px 0;">
94
- <span style="font-size:18px;" class="nowrap"><?php echo number_format($rangeStats['visits']) ?></span>
95
- </fieldset>
96
- </div>
97
- </td>
98
- <td style="width: 25%;">
99
- <div class="entry-edit">
100
- <div class="entry-edit-head">
101
- <h4><?php echo Mage::helper('pptrack')->__('Average trackings per shipment') ?></h4></div>
102
- <fieldset class="a-center bold" style="padding:20px 0;">
103
- <span style="font-size:18px;"
104
- class="nowrap"><?php echo number_format($rangeStats['average'], 2) ?></span>
105
- </fieldset>
106
- </div>
107
- </td>
108
- </tr>
109
- </table>
110
- <div id="graph1"></div>
111
- </div>
112
- <br>
113
- <br>
114
- <br>
115
- <script type="text/javascript">
116
- var rangeInfo = <?php echo json_encode($rangeInfo) ?>;
117
-
118
- Calendar.setup({
119
- inputField: 'date_from',
120
- ifFormat: '%Y-%m-%d',
121
- button: 'date_from_trig',
122
- align: 'Bl',
123
- singleClick: true,
124
- onUpdate: function() {
125
- jQuery("#range_switcher").val("custom");
126
- jQuery("#dateRangeForm").submit();
127
- }
128
- });
129
-
130
- Calendar.setup({
131
- inputField: 'date_to',
132
- ifFormat: '%Y-%m-%d',
133
- button: 'date_to_trig',
134
- align: 'Bl',
135
- singleClick: true,
136
- onUpdate: function() {
137
- jQuery("#range_switcher").val("custom");
138
- jQuery("#dateRangeForm").submit();
139
- }
140
- });
141
-
142
- jQuery("#date_from,#date_to").change(function() {
143
- jQuery("#range_switcher").val("custom");
144
- jQuery("#dateRangeForm").submit();
145
- });
146
- jQuery("#range_switcher").change(function() {
147
- var v = jQuery(this).val();
148
- if (v != "custom") {
149
- jQuery("#dateRangeForm").submit();
150
- }
151
- });
152
-
153
-
154
- Morris.Area({
155
- element: 'graph1',
156
- data: <?php echo json_encode(array_values($data)) ?>,
157
- xkey: 'period',
158
- ykeys: ['count', 'count2'],
159
- labels: ['Shipments', 'Visits'],
160
- pointSize: 2,
161
- hideHover: 'auto',
162
- lineWidth: 2,
163
- resize: false,
164
- xLabels: "day"
165
- });
166
-
167
- <?php $user = Mage::getSingleton('admin/session'); ?>
168
- window.intercomSettings = {
169
- "plugin": "magento",
170
- name: "<?php echo $user->getUser()->getFirstname() . ' ' . $user->getUser()->getLastname() ?>",
171
- email: "<?php echo $user->getUser()->getEmail() ?>",
172
- app_id: "n806bjdu",
173
- "api_key": "<?php echo Mage::getStoreConfig('pp_section_setttings/settings/api_key') ?>",
174
- "plugin_version": "<?php echo (string) Mage::getConfig()->getNode()->modules->Packpin_Pptrack->version ?>",
175
- "plugin_shop_version": "<?php echo Mage::getVersion() ?>",
176
- "shop_name": "<?php echo Mage::getStoreConfig('trans_email/ident_general/name') ?>",
177
- "shop_email": "<?php echo Mage::getStoreConfig('trans_email/ident_general/email') ?>",
178
- "shop_url": "<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) ?>"
179
- };
180
- (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/n806bjdu';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
181
-
182
- </script>
1
+ <?php
2
+ $planDetails = $this->getPlanDetails();
3
+ $rangeInfo = $this->getRangeInfo();
4
+ $range = $this->getSelectedRange();
5
+ $rangeStats = $this->getRangeStats();
6
+ $data = $rangeStats['graph'];
7
+ ?>
8
+ <div class="content-header">
9
+ <table cellspacing="0">
10
+ <tr>
11
+ <td style="width:50%;"><h3><?php echo Mage::helper('pptrack')->__('Packpin Dashboard') ?></h3></td>
12
+ </tr>
13
+ </table>
14
+ </div>
15
+
16
+ <?php if (!$this->pluginEnabled() || !$this->notificationsEnabled()) : ?>
17
+ <ul class="messages">
18
+ <li class="error-msg">
19
+ <ul>
20
+ <li>
21
+ <span>
22
+ <?php echo !$this->pluginEnabled() ? Mage::helper('pptrack')->__('Packpin extension is disabled.') : Mage::helper('pptrack')->__('Packpin notifications are disabled.') ?>
23
+ <a href="<?php echo $this->getUrl('adminhtml/system_config/edit/section/pp_section_setttings') ?>"><?php echo Mage::helper('pptrack')->__('Click here') ?></a> <?php echo Mage::helper('pptrack')->__('to change your settings') ?>
24
+ </span>
25
+ </li>
26
+ </ul>
27
+ </li>
28
+ </ul>
29
+ <?php endif; ?>
30
+
31
+ <div id="dashboard_diagram_totals" class="box">
32
+ <div class="entry-edit">
33
+ <table width="100%" cellspacing="0">
34
+ <tbody><tr>
35
+ <td style="width:33%;" class="a-center bold">
36
+ <span><?php echo Mage::helper('pptrack')->__('Plan Name') ?></span><br>
37
+ <span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo isset($planDetails['name']) ? $planDetails['name'] : '?' ?></span>
38
+ </td>
39
+ <td style="width:33%;" class="a-center bold">
40
+ <span><?php echo Mage::helper('pptrack')->__('Total Trackings') ?></span><br>
41
+ <span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo isset($planDetails['trackings']['count']) ? number_format($planDetails['trackings']['count']) : '?' ?></span>
42
+ </td>
43
+ <td style="width:33%;" class="a-center bold">
44
+ <span><?php echo Mage::helper('pptrack')->__('Trackings Left This Month') ?></span><br>
45
+ <span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo isset($planDetails['trackings']['left']) ? number_format($planDetails['trackings']['left']) : '?' ?></span>
46
+ </td>
47
+ </tr>
48
+ </tbody></table>
49
+ </div>
50
+ </div>
51
+
52
+
53
+
54
+ <div class="dashboard-container">
55
+ <form id="dateRangeForm" method="get" action="<?php echo $this->getUrl('adminhtml/packpintracks/dashboard') ?>">
56
+ <p class="switcher"><label for="store_switcher"><?php echo Mage::helper('pptrack')->__('Date range') ?></label>
57
+ <select id="range_switcher" name="range">
58
+ <?php foreach ($rangeInfo as $code => $item) : ?>
59
+ <option <?php echo $range == $code ? 'selected="selected"' : '' ?> value="<?php echo $code ?>"><?php echo $item['label'] ?></option>
60
+ <?php endforeach; ?>
61
+ </select>
62
+
63
+ <input class="a-center" type="text" name="date_from" id="date_from" value="<?php echo $rangeInfo[$range]['date_start'] ?>" >
64
+ <img src="<?php echo $this->getSkinUrl('images/grid-cal.gif') ?>" class="v-middle" id="date_from_trig"/>
65
+ <input class="a-center" type="text" name="date_to" id="date_to" value="<?php echo $rangeInfo[$range]['date_end'] ?>" >
66
+ <img src="<?php echo $this->getSkinUrl('images/grid-cal.gif') ?>" class="v-middle" id="date_to_trig"/>
67
+ </p>
68
+ </form>
69
+ <table cellspacing='5' width='100%'>
70
+ <tr>
71
+ <td style="width: 25%;">
72
+ <div class="entry-edit">
73
+ <div class="entry-edit-head"><h4><?php echo Mage::helper('pptrack')->__('Shipments Tracked') ?></h4>
74
+ </div>
75
+ <fieldset class="a-center bold" style="padding:20px 0;">
76
+ <span style="font-size:18px;" class="nowrap"><?php echo number_format($rangeStats['trackings']) ?></span>
77
+ </fieldset>
78
+ </div>
79
+ </td>
80
+ <td style="width: 25%;">
81
+ <div class="entry-edit">
82
+ <div class="entry-edit-head"><h4><?php echo Mage::helper('pptrack')->__('Notification Emails Sent') ?></h4>
83
+ </div>
84
+ <fieldset class="a-center bold" style="padding:20px 0;">
85
+ <span style="font-size:18px;" class="nowrap"><?php echo is_int($rangeStats['emails']) ? number_format($rangeStats['emails']) : $rangeStats['emails'] ?></span>
86
+ </fieldset>
87
+ </div>
88
+ </td>
89
+ <td style="width: 25%;">
90
+ <div class="entry-edit">
91
+ <div class="entry-edit-head"><h4><?php echo Mage::helper('pptrack')->__('Visits Generated') ?></h4>
92
+ </div>
93
+ <fieldset class="a-center bold" style="padding:20px 0;">
94
+ <span style="font-size:18px;" class="nowrap"><?php echo number_format($rangeStats['visits']) ?></span>
95
+ </fieldset>
96
+ </div>
97
+ </td>
98
+ <td style="width: 25%;">
99
+ <div class="entry-edit">
100
+ <div class="entry-edit-head">
101
+ <h4><?php echo Mage::helper('pptrack')->__('Average trackings per shipment') ?></h4></div>
102
+ <fieldset class="a-center bold" style="padding:20px 0;">
103
+ <span style="font-size:18px;"
104
+ class="nowrap"><?php echo number_format($rangeStats['average'], 2) ?></span>
105
+ </fieldset>
106
+ </div>
107
+ </td>
108
+ </tr>
109
+ </table>
110
+ <div id="graph1"></div>
111
+ </div>
112
+ <br>
113
+ <br>
114
+ <br>
115
+ <script type="text/javascript">
116
+ var rangeInfo = <?php echo json_encode($rangeInfo) ?>;
117
+
118
+ Calendar.setup({
119
+ inputField: 'date_from',
120
+ ifFormat: '%Y-%m-%d',
121
+ button: 'date_from_trig',
122
+ align: 'Bl',
123
+ singleClick: true,
124
+ onUpdate: function() {
125
+ jQuery("#range_switcher").val("custom");
126
+ jQuery("#dateRangeForm").submit();
127
+ }
128
+ });
129
+
130
+ Calendar.setup({
131
+ inputField: 'date_to',
132
+ ifFormat: '%Y-%m-%d',
133
+ button: 'date_to_trig',
134
+ align: 'Bl',
135
+ singleClick: true,
136
+ onUpdate: function() {
137
+ jQuery("#range_switcher").val("custom");
138
+ jQuery("#dateRangeForm").submit();
139
+ }
140
+ });
141
+
142
+ jQuery("#date_from,#date_to").change(function() {
143
+ jQuery("#range_switcher").val("custom");
144
+ jQuery("#dateRangeForm").submit();
145
+ });
146
+ jQuery("#range_switcher").change(function() {
147
+ var v = jQuery(this).val();
148
+ if (v != "custom") {
149
+ jQuery("#dateRangeForm").submit();
150
+ }
151
+ });
152
+
153
+
154
+ Morris.Area({
155
+ element: 'graph1',
156
+ data: <?php echo json_encode(array_values($data)) ?>,
157
+ xkey: 'period',
158
+ ykeys: ['count', 'count2'],
159
+ labels: ['Shipments', 'Visits'],
160
+ pointSize: 2,
161
+ hideHover: 'auto',
162
+ lineWidth: 2,
163
+ resize: false,
164
+ xLabels: "day"
165
+ });
166
+
167
+ <?php $user = Mage::getSingleton('admin/session'); ?>
168
+ window.intercomSettings = {
169
+ "plugin": "magento",
170
+ name: "<?php echo $user->getUser()->getFirstname() . ' ' . $user->getUser()->getLastname() ?>",
171
+ email: "<?php echo $user->getUser()->getEmail() ?>",
172
+ app_id: "n806bjdu",
173
+ "api_key": "<?php echo Mage::getStoreConfig('pp_section_setttings/settings/api_key') ?>",
174
+ "plugin_version": "<?php echo (string) Mage::getConfig()->getNode()->modules->Packpin_Pptrack->version ?>",
175
+ "plugin_shop_version": "<?php echo Mage::getVersion() ?>",
176
+ "shop_name": "<?php echo Mage::getStoreConfig('trans_email/ident_general/name') ?>",
177
+ "shop_email": "<?php echo Mage::getStoreConfig('trans_email/ident_general/email') ?>",
178
+ "shop_url": "<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) ?>"
179
+ };
180
+ (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/n806bjdu';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
181
+
182
+ </script>
app/design/adminhtml/default/default/template/pptrack/dashboard/packpin.phtml CHANGED
@@ -1,22 +1,22 @@
1
- <div class="entry-edit">
2
- <div class="entry-edit-head"><h4><?php echo Mage::helper('pptrack')->__('Packpin Stats') ?></h4></div>
3
- <fieldset style="padding:10px 0 0;">
4
- <table width="100%" cellspacing="0">
5
- <tbody>
6
- <tr>
7
- <td class="a-center bold">
8
- <span><?php echo Mage::helper('pptrack')->__('Shipments Tracked') ?></span><br>
9
- <span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo $this->getTotalShipments() ?></span>
10
- </td>
11
- <td class="a-center bold">
12
- <span><?php echo Mage::helper('pptrack')->__('Visits Generated') ?></span><br>
13
- <span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo $this->getTotalVisits() ?></span>
14
- </td>
15
- </tr>
16
- </tbody>
17
- </table>
18
- <a class="a-right"
19
- style="display:block;text-decoration:none;padding:5px 15px;border-top:1px solid #dadfe0;margin-top:10px;"
20
- href="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/packpintracks/dashboard") ?>"><?php echo Mage::helper('pptrack')->__('More Details') ?> &raquo;</a>
21
- </fieldset>
22
  </div>
1
+ <div class="entry-edit">
2
+ <div class="entry-edit-head"><h4><?php echo Mage::helper('pptrack')->__('Packpin Stats') ?></h4></div>
3
+ <fieldset style="padding:10px 0 0;">
4
+ <table width="100%" cellspacing="0">
5
+ <tbody>
6
+ <tr>
7
+ <td class="a-center bold">
8
+ <span><?php echo Mage::helper('pptrack')->__('Shipments Tracked') ?></span><br>
9
+ <span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo $this->getTotalShipments() ?></span>
10
+ </td>
11
+ <td class="a-center bold">
12
+ <span><?php echo Mage::helper('pptrack')->__('Visits Generated') ?></span><br>
13
+ <span style="font-size:18px; color:#EA7601;" class="nowrap"><?php echo $this->getTotalVisits() ?></span>
14
+ </td>
15
+ </tr>
16
+ </tbody>
17
+ </table>
18
+ <a class="a-right"
19
+ style="display:block;text-decoration:none;padding:5px 15px;border-top:1px solid #dadfe0;margin-top:10px;"
20
+ href="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/packpintracks/dashboard") ?>"><?php echo Mage::helper('pptrack')->__('More Details') ?> &raquo;</a>
21
+ </fieldset>
22
  </div>
app/design/adminhtml/default/default/template/pptrack/system/config/fieldset/hint.phtml CHANGED
@@ -1,17 +1,17 @@
1
- <?php
2
- /**
3
- * @see Packpin_Pptrack_Block_Adminhtml_System_Config_Fieldset_Hint
4
- */
5
- ?>
6
- <?php if ($this->haveTempKey()) : ?>
7
- <div class="packpin-notice">
8
- <h4>
9
- <?php if (!$this->getDaysLeft()) : ?>
10
- <span class="packpin-notice-date"><?php echo Mage::helper('pptrack')->__('Your temporary API key has expired!') ?></span>
11
- <?php else : ?>
12
- <?php echo Mage::helper('pptrack')->__('Your temporary API key will expire in') ?>
13
- <span class="packpin-notice-date"><?php echo sprintf(Mage::helper('pptrack')->__('%s days'), $this->getDaysLeft()) ?>!</span>
14
- <?php endif; ?>
15
- </h4>
16
- </div>
17
  <?php endif; ?>
1
+ <?php
2
+ /**
3
+ * @see Packpin_Pptrack_Block_Adminhtml_System_Config_Fieldset_Hint
4
+ */
5
+ ?>
6
+ <?php if ($this->haveTempKey()) : ?>
7
+ <div class="packpin-notice">
8
+ <h4>
9
+ <?php if (!$this->getDaysLeft()) : ?>
10
+ <span class="packpin-notice-date"><?php echo Mage::helper('pptrack')->__('Your temporary API key has expired!') ?></span>
11
+ <?php else : ?>
12
+ <?php echo Mage::helper('pptrack')->__('Your temporary API key will expire in') ?>
13
+ <span class="packpin-notice-date"><?php echo sprintf(Mage::helper('pptrack')->__('%s days'), $this->getDaysLeft()) ?>!</span>
14
+ <?php endif; ?>
15
+ </h4>
16
+ </div>
17
  <?php endif; ?>
app/design/adminhtml/default/default/template/pptrack/system/config/fieldset/scripts.phtml CHANGED
@@ -1,97 +1,97 @@
1
- <script>
2
- function checkCrossInputs() {
3
- var v1 = $('pp_section_setttings_crosssell_cross_sell_page_type').value;
4
- var v2 = $('pp_section_setttings_crosssell_cross_sell_email_type').value;
5
-
6
- if (v1 == 'products') {
7
- $('row_pp_section_setttings_crosssell_cross_sell_page_image').hide();
8
- $('row_pp_section_setttings_crosssell_cross_sell_page_image_url').hide();
9
- $('row_pp_section_setttings_crosssell_cross_sell_page_script').hide();
10
- $('row_pp_section_setttings_crosssell_cross_sell_page_items').show();
11
- }
12
- else if (v1 == 'ads') {
13
- $('row_pp_section_setttings_crosssell_cross_sell_page_image').show();
14
- $('row_pp_section_setttings_crosssell_cross_sell_page_image_url').show();
15
- $('row_pp_section_setttings_crosssell_cross_sell_page_items').hide();
16
- $('row_pp_section_setttings_crosssell_cross_sell_page_script').hide();
17
- }
18
- else {
19
- $('row_pp_section_setttings_crosssell_cross_sell_page_script').show();
20
- $('row_pp_section_setttings_crosssell_cross_sell_page_image').hide();
21
- $('row_pp_section_setttings_crosssell_cross_sell_page_image_url').hide();
22
- $('row_pp_section_setttings_crosssell_cross_sell_page_items').hide();
23
- }
24
-
25
- if (v2 == 'products') {
26
- $('row_pp_section_setttings_crosssell_cross_sell_email_image').hide();
27
- $('row_pp_section_setttings_crosssell_cross_sell_email_image_url').hide();
28
- $('row_pp_section_setttings_crosssell_cross_sell_email_items').show();
29
- }
30
- else if (v2 == 'ads') {
31
- $('row_pp_section_setttings_crosssell_cross_sell_email_image').show();
32
- $('row_pp_section_setttings_crosssell_cross_sell_email_image_url').show();
33
- $('row_pp_section_setttings_crosssell_cross_sell_email_items').hide();
34
- }
35
- else {
36
- $('row_pp_section_setttings_crosssell_cross_sell_email_image').show();
37
- $('row_pp_section_setttings_crosssell_cross_sell_email_image_url').show();
38
- $('row_pp_section_setttings_crosssell_cross_sell_email_items').show();
39
- }
40
- }
41
-
42
- function checkTemplateInputs() {
43
- var v1 = $('pp_section_setttings_template_template_image_type').value;
44
- var v2 = $('pp_section_setttings_template_template_type').value;
45
- if (v2 == 'v2') {
46
- $('row_pp_section_setttings_template_template_image_type').show();
47
- $('row_pp_section_setttings_template_template_image').show();
48
- $('row_pp_section_setttings_template_template_image_link').show();
49
- } else {
50
- $('row_pp_section_setttings_template_template_image_type').hide();
51
- $('row_pp_section_setttings_template_template_image').hide();
52
- $('row_pp_section_setttings_template_template_image_link').hide();
53
- }
54
- if (v1 == 'custom') {
55
- $('row_pp_section_setttings_template_template_image').show();
56
- } else {
57
- $('row_pp_section_setttings_template_template_image').hide();
58
- }
59
- }
60
-
61
- Event.observe(window, "load", function() {
62
- checkCrossInputs();
63
- Event.observe('pp_section_setttings_crosssell_cross_sell_page_type', 'change', checkCrossInputs);
64
- Event.observe('pp_section_setttings_crosssell_cross_sell_email_type', 'change', checkCrossInputs);
65
-
66
- checkTemplateInputs();
67
- Event.observe('pp_section_setttings_template_template_image_type', 'change', checkTemplateInputs);
68
- Event.observe('pp_section_setttings_template_template_type', 'change', checkTemplateInputs);
69
- });
70
-
71
- //for packpin chat
72
- <?php $user = Mage::getSingleton('admin/session'); ?>
73
- window.intercomSettings = {
74
- "plugin": "magento",
75
- name: "<?php echo $user->getUser()->getFirstname() . ' ' . $user->getUser()->getLastname() ?>",
76
- email: "<?php echo $user->getUser()->getEmail() ?>",
77
- app_id: "n806bjdu",
78
- "api_key": "<?php echo Mage::getStoreConfig('pp_section_setttings/settings/api_key') ?>",
79
- "plugin_version": "<?php echo (string) Mage::getConfig()->getNode()->modules->Packpin_Pptrack->version ?>",
80
- "plugin_shop_version": "<?php echo Mage::getVersion() ?>",
81
- "shop_name": "<?php echo Mage::getStoreConfig('trans_email/ident_general/name') ?>",
82
- "shop_email": "<?php echo Mage::getStoreConfig('trans_email/ident_general/email') ?>",
83
- "shop_url": "<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) ?>"
84
- };
85
- (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/n806bjdu';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
86
-
87
- if ($$(".error-msg").length) {
88
- Intercom('showNewMessage');
89
-
90
- if ($$(".error-msg")[0].innerHTML.indexOf("notifications") != -1) {
91
-
92
- }
93
- else {
94
-
95
- }
96
- }
97
  </script>
1
+ <script>
2
+ function checkCrossInputs() {
3
+ var v1 = $('pp_section_setttings_crosssell_cross_sell_page_type').value;
4
+ var v2 = $('pp_section_setttings_crosssell_cross_sell_email_type').value;
5
+
6
+ if (v1 == 'products') {
7
+ $('row_pp_section_setttings_crosssell_cross_sell_page_image').hide();
8
+ $('row_pp_section_setttings_crosssell_cross_sell_page_image_url').hide();
9
+ $('row_pp_section_setttings_crosssell_cross_sell_page_script').hide();
10
+ $('row_pp_section_setttings_crosssell_cross_sell_page_items').show();
11
+ }
12
+ else if (v1 == 'ads') {
13
+ $('row_pp_section_setttings_crosssell_cross_sell_page_image').show();
14
+ $('row_pp_section_setttings_crosssell_cross_sell_page_image_url').show();
15
+ $('row_pp_section_setttings_crosssell_cross_sell_page_items').hide();
16
+ $('row_pp_section_setttings_crosssell_cross_sell_page_script').hide();
17
+ }
18
+ else {
19
+ $('row_pp_section_setttings_crosssell_cross_sell_page_script').show();
20
+ $('row_pp_section_setttings_crosssell_cross_sell_page_image').hide();
21
+ $('row_pp_section_setttings_crosssell_cross_sell_page_image_url').hide();
22
+ $('row_pp_section_setttings_crosssell_cross_sell_page_items').hide();
23
+ }
24
+
25
+ if (v2 == 'products') {
26
+ $('row_pp_section_setttings_crosssell_cross_sell_email_image').hide();
27
+ $('row_pp_section_setttings_crosssell_cross_sell_email_image_url').hide();
28
+ $('row_pp_section_setttings_crosssell_cross_sell_email_items').show();
29
+ }
30
+ else if (v2 == 'ads') {
31
+ $('row_pp_section_setttings_crosssell_cross_sell_email_image').show();
32
+ $('row_pp_section_setttings_crosssell_cross_sell_email_image_url').show();
33
+ $('row_pp_section_setttings_crosssell_cross_sell_email_items').hide();
34
+ }
35
+ else {
36
+ $('row_pp_section_setttings_crosssell_cross_sell_email_image').show();
37
+ $('row_pp_section_setttings_crosssell_cross_sell_email_image_url').show();
38
+ $('row_pp_section_setttings_crosssell_cross_sell_email_items').show();
39
+ }
40
+ }
41
+
42
+ function checkTemplateInputs() {
43
+ var v1 = $('pp_section_setttings_template_template_image_type').value;
44
+ var v2 = $('pp_section_setttings_template_template_type').value;
45
+ if (v2 == 'v2') {
46
+ $('row_pp_section_setttings_template_template_image_type').show();
47
+ $('row_pp_section_setttings_template_template_image').show();
48
+ $('row_pp_section_setttings_template_template_image_link').show();
49
+ } else {
50
+ $('row_pp_section_setttings_template_template_image_type').hide();
51
+ $('row_pp_section_setttings_template_template_image').hide();
52
+ $('row_pp_section_setttings_template_template_image_link').hide();
53
+ }
54
+ if (v1 == 'custom') {
55
+ $('row_pp_section_setttings_template_template_image').show();
56
+ } else {
57
+ $('row_pp_section_setttings_template_template_image').hide();
58
+ }
59
+ }
60
+
61
+ Event.observe(window, "load", function() {
62
+ checkCrossInputs();
63
+ Event.observe('pp_section_setttings_crosssell_cross_sell_page_type', 'change', checkCrossInputs);
64
+ Event.observe('pp_section_setttings_crosssell_cross_sell_email_type', 'change', checkCrossInputs);
65
+
66
+ checkTemplateInputs();
67
+ Event.observe('pp_section_setttings_template_template_image_type', 'change', checkTemplateInputs);
68
+ Event.observe('pp_section_setttings_template_template_type', 'change', checkTemplateInputs);
69
+ });
70
+
71
+ //for packpin chat
72
+ <?php $user = Mage::getSingleton('admin/session'); ?>
73
+ window.intercomSettings = {
74
+ "plugin": "magento",
75
+ name: "<?php echo $user->getUser()->getFirstname() . ' ' . $user->getUser()->getLastname() ?>",
76
+ email: "<?php echo $user->getUser()->getEmail() ?>",
77
+ app_id: "n806bjdu",
78
+ "api_key": "<?php echo Mage::getStoreConfig('pp_section_setttings/settings/api_key') ?>",
79
+ "plugin_version": "<?php echo (string) Mage::getConfig()->getNode()->modules->Packpin_Pptrack->version ?>",
80
+ "plugin_shop_version": "<?php echo Mage::getVersion() ?>",
81
+ "shop_name": "<?php echo Mage::getStoreConfig('trans_email/ident_general/name') ?>",
82
+ "shop_email": "<?php echo Mage::getStoreConfig('trans_email/ident_general/email') ?>",
83
+ "shop_url": "<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) ?>"
84
+ };
85
+ (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/n806bjdu';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
86
+
87
+ if ($$(".error-msg").length) {
88
+ Intercom('showNewMessage');
89
+
90
+ if ($$(".error-msg")[0].innerHTML.indexOf("notifications") != -1) {
91
+
92
+ }
93
+ else {
94
+
95
+ }
96
+ }
97
  </script>
app/design/frontend/base/default/layout/pptrack.xml CHANGED
@@ -1,52 +1,52 @@
1
- <?xml version="1.0"?>
2
- <layout version="1.7.1">
3
- <pptrack_index_index>
4
- <reference name="root">
5
- <action method="setTemplate">
6
- <template>page/1column.phtml</template>
7
- </action>
8
- </reference>
9
- <reference name="head">
10
- <action method="addCss">
11
- <stylesheet>css/pptrack.css</stylesheet>
12
- </action>
13
- </reference>
14
- <reference name="content">
15
- <block type="pptrack/index" name="pptrack_index" template="pptrack/index.phtml">
16
- <block type="pptrack/crosssell" name="pptrack_crosssell" template="pptrack/crosssell.phtml"/>
17
- <block type="pptrack/ads" name="pptrack_ads" template="pptrack/ads.phtml"/>
18
- <block type="pptrack/script" name="pptrack_script" template="pptrack/script.phtml"/>
19
- </block>
20
- </reference>
21
- </pptrack_index_index>
22
- <pptrack_index_popup>
23
- <reference name="root">
24
- <action method="setTemplate">
25
- <template>page/popup.phtml</template>
26
- </action>
27
- </reference>
28
- <reference name="head">
29
- <action method="addCss">
30
- <stylesheet>css/pptrack.css</stylesheet>
31
- </action>
32
- </reference>
33
- <reference name="content">
34
- <block type="pptrack/index" name="pptrack_popup" template="pptrack/popup.phtml"/>
35
- </reference>
36
- </pptrack_index_popup>
37
- <pptrack_unsubscribe_index>
38
- <reference name="root">
39
- <action method="setTemplate">
40
- <template>page/1column.phtml</template>
41
- </action>
42
- </reference>
43
- <reference name="head">
44
- <action method="addCss">
45
- <stylesheet>css/pptrack.css</stylesheet>
46
- </action>
47
- </reference>
48
- <reference name="content">
49
- <block type="pptrack/index" name="pptrack_unsubscribe_index" template="pptrack/unsubscribe.phtml"/>
50
- </reference>
51
- </pptrack_unsubscribe_index>
52
- </layout>
1
+ <?xml version="1.0"?>
2
+ <layout version="1.7.1">
3
+ <pptrack_index_index>
4
+ <reference name="root">
5
+ <action method="setTemplate">
6
+ <template>page/1column.phtml</template>
7
+ </action>
8
+ </reference>
9
+ <reference name="head">
10
+ <action method="addCss">
11
+ <stylesheet>css/pptrack.css</stylesheet>
12
+ </action>
13
+ </reference>
14
+ <reference name="content">
15
+ <block type="pptrack/index" name="pptrack_index" template="pptrack/index.phtml">
16
+ <block type="pptrack/crosssell" name="pptrack_crosssell" template="pptrack/crosssell.phtml"/>
17
+ <block type="pptrack/ads" name="pptrack_ads" template="pptrack/ads.phtml"/>
18
+ <block type="pptrack/script" name="pptrack_script" template="pptrack/script.phtml"/>
19
+ </block>
20
+ </reference>
21
+ </pptrack_index_index>
22
+ <pptrack_index_popup>
23
+ <reference name="root">
24
+ <action method="setTemplate">
25
+ <template>page/popup.phtml</template>
26
+ </action>
27
+ </reference>
28
+ <reference name="head">
29
+ <action method="addCss">
30
+ <stylesheet>css/pptrack.css</stylesheet>
31
+ </action>
32
+ </reference>
33
+ <reference name="content">
34
+ <block type="pptrack/index" name="pptrack_popup" template="pptrack/popup.phtml"/>
35
+ </reference>
36
+ </pptrack_index_popup>
37
+ <pptrack_unsubscribe_index>
38
+ <reference name="root">
39
+ <action method="setTemplate">
40
+ <template>page/1column.phtml</template>
41
+ </action>
42
+ </reference>
43
+ <reference name="head">
44
+ <action method="addCss">
45
+ <stylesheet>css/pptrack.css</stylesheet>
46
+ </action>
47
+ </reference>
48
+ <reference name="content">
49
+ <block type="pptrack/index" name="pptrack_unsubscribe_index" template="pptrack/unsubscribe.phtml"/>
50
+ </reference>
51
+ </pptrack_unsubscribe_index>
52
+ </layout>
app/design/frontend/base/default/template/pptrack/ads.phtml CHANGED
@@ -1,15 +1,15 @@
1
- <?php
2
- $image = $this->getImage();
3
- $url = $this->getImageUrl();
4
- ?>
5
- <?php if ($image) : ?>
6
- <div class="pptrack-top-image">
7
- <?php if ($url) : ?>
8
- <a href="<?php echo $url ?>" target="_blank">
9
- <?php endif; ?>
10
- <img src="<?php echo $image ?>" alt="">
11
- <?php if ($url) : ?>
12
- </a>
13
- <?php endif; ?>
14
- </div>
15
- <?php endif; ?>
1
+ <?php
2
+ $image = $this->getImage();
3
+ $url = $this->getImageUrl();
4
+ ?>
5
+ <?php if ($image) : ?>
6
+ <div class="pptrack-top-image">
7
+ <?php if ($url) : ?>
8
+ <a href="<?php echo $url ?>" target="_blank">
9
+ <?php endif; ?>
10
+ <img src="<?php echo $image ?>" alt="">
11
+ <?php if ($url) : ?>
12
+ </a>
13
+ <?php endif; ?>
14
+ </div>
15
+ <?php endif; ?>
app/design/frontend/base/default/template/pptrack/ads_email.phtml CHANGED
@@ -1,15 +1,15 @@
1
- <?php
2
- $image = $this->getEmailImage();
3
- $url = $this->getEmailImageUrl();
4
- ?>
5
- <?php if ($image) : ?>
6
- <div class="pptrack-top-image" style="margin-top:5px;text-align:center;width:100%;">
7
- <?php if ($url) : ?>
8
- <a style="display:block;text-align:center;width:100%;text-decoration: none;" href="<?php echo $url ?>" target="_blank">
9
- <?php endif; ?>
10
- <img style="max-width: 100%;height: auto;margin: 0 auto;" src="<?php echo $image ?>" alt="">
11
- <?php if ($url) : ?>
12
- </a>
13
- <?php endif; ?>
14
- </div>
15
- <?php endif; ?>
1
+ <?php
2
+ $image = $this->getEmailImage();
3
+ $url = $this->getEmailImageUrl();
4
+ ?>
5
+ <?php if ($image) : ?>
6
+ <div class="pptrack-top-image" style="margin-top:5px;text-align:center;width:100%;">
7
+ <?php if ($url) : ?>
8
+ <a style="display:block;text-align:center;width:100%;text-decoration: none;" href="<?php echo $url ?>" target="_blank">
9
+ <?php endif; ?>
10
+ <img style="max-width: 100%;height: auto;margin: 0 auto;" src="<?php echo $image ?>" alt="">
11
+ <?php if ($url) : ?>
12
+ </a>
13
+ <?php endif; ?>
14
+ </div>
15
+ <?php endif; ?>
app/design/frontend/base/default/template/pptrack/crosssell.phtml CHANGED
@@ -1,48 +1,48 @@
1
- <?php
2
- $limit = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_items');
3
- $collection = $this->getCrossSellingItemsByOrderId($this->getData('orderId'), $limit);
4
- $count = count($collection);
5
- ?>
6
- <?php if($count): ?>
7
- <div class="pptrack-crosssell">
8
- <h2><?php echo Mage::helper('pptrack')->__('While waiting, we have something for you. Check offerings bellow:') ?></h2>
9
- <ul class="pptrack-products-grid pptrack-products-grid--col-<?php echo $count ?>">
10
- <?php foreach ($collection as $_item): ?>
11
- <li>
12
- <div class="pptrack-list-info-box-wrap">
13
- <div class="pptrack-list-info-box">
14
- <a class="pptrack-product-image" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>">
15
- <img src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(null, 150); ?>" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" />
16
- </a>
17
- <h3 class="pptrack-product-name"><a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a></h3>
18
- <?php echo $this->getPriceHtml($_item, true) ?>
19
- </div>
20
- </div>
21
- <button type="button" title="<?php echo Mage::helper('pptrack')->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_item) ?>')"><span><span><?php echo Mage::helper('pptrack')->__('Add to Cart') ?></span></span></button>
22
- </li>
23
- <?php endforeach; ?>
24
- </ul>
25
- </div>
26
- <script type="text/javascript">
27
- function fixCrossBoxes() {
28
- var max = 0;
29
- $$(".pptrack-list-info-box").forEach(function (el) {
30
- max = Math.max(max, el.getHeight());
31
- });
32
- $$(".pptrack-list-info-box-wrap").forEach(function (el) {
33
- el.setStyle({
34
- height: max + 'px'
35
- });
36
- });
37
- }
38
- window.onresize = function(event) {
39
- fixCrossBoxes();
40
- };
41
-
42
- Event.observe(window, "load", function() {
43
- fixCrossBoxes();
44
-
45
- }, false);
46
-
47
- </script>
48
- <?php endif; ?>
1
+ <?php
2
+ $limit = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_items');
3
+ $collection = $this->getCrossSellingItemsByOrderId($this->getData('orderId'), $limit);
4
+ $count = count($collection);
5
+ ?>
6
+ <?php if($count): ?>
7
+ <div class="pptrack-crosssell">
8
+ <h2><?php echo Mage::helper('pptrack')->__('While waiting, we have something for you. Check offerings bellow:') ?></h2>
9
+ <ul class="pptrack-products-grid pptrack-products-grid--col-<?php echo $count ?>">
10
+ <?php foreach ($collection as $_item): ?>
11
+ <li>
12
+ <div class="pptrack-list-info-box-wrap">
13
+ <div class="pptrack-list-info-box">
14
+ <a class="pptrack-product-image" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>">
15
+ <img src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(null, 150); ?>" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" />
16
+ </a>
17
+ <h3 class="pptrack-product-name"><a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a></h3>
18
+ <?php echo $this->getPriceHtml($_item, true) ?>
19
+ </div>
20
+ </div>
21
+ <button type="button" title="<?php echo Mage::helper('pptrack')->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_item) ?>')"><span><span><?php echo Mage::helper('pptrack')->__('Add to Cart') ?></span></span></button>
22
+ </li>
23
+ <?php endforeach; ?>
24
+ </ul>
25
+ </div>
26
+ <script type="text/javascript">
27
+ function fixCrossBoxes() {
28
+ var max = 0;
29
+ $$(".pptrack-list-info-box").forEach(function (el) {
30
+ max = Math.max(max, el.getHeight());
31
+ });
32
+ $$(".pptrack-list-info-box-wrap").forEach(function (el) {
33
+ el.setStyle({
34
+ height: max + 'px'
35
+ });
36
+ });
37
+ }
38
+ window.onresize = function(event) {
39
+ fixCrossBoxes();
40
+ };
41
+
42
+ Event.observe(window, "load", function() {
43
+ fixCrossBoxes();
44
+
45
+ }, false);
46
+
47
+ </script>
48
+ <?php endif; ?>
app/design/frontend/base/default/template/pptrack/crosssell_email.phtml CHANGED
@@ -1,32 +1,32 @@
1
- <?php
2
- $limit = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email_items');
3
- $collection = $this->getCrossSellingItemsByOrderId($this->getData('orderId'), $limit);
4
- ?>
5
-
6
- <?php if(count($collection)): ?>
7
- <div style="margin-top:5px;font-size:12px;font-weight:400;text-align:center;;line-height:14px;">
8
- While you are waiting, we have something for you.
9
- <br>
10
- Check the offerings bellow:
11
- </div>
12
- <div style="margin-top:20px;">
13
- <table border="0" cellspacing="10" width="100%;">
14
- <tr>
15
- <?php foreach ($collection as $_item): ?>
16
- <td valign="top" style="text-align:center !important;font-size:11px;background:#ffffff;padding:10px;">
17
- <a style="display:block;text-decoration:none;" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>">
18
- <img style="max-width:100%;" src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(null, 100); ?>" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" />
19
- </a>
20
- <a style="display:block;text-decoration:none;font-size:11px;font-weight:400;text-align:center;color:#333333;text-transform:uppercase;" href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a>
21
- <div style="margin-top:7px;font-size:11px;font-weight:700;text-align:center;">
22
- <?php echo $this->getPriceHtml($_item, false) ?>
23
- </div>
24
- <a style="display:inline-block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;margin-top:3px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>">
25
- READ MORE
26
- </a>
27
- </td>
28
- <?php endforeach; ?>
29
- </tr>
30
- </table>
31
- </div>
32
- <?php endif; ?>
1
+ <?php
2
+ $limit = Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_email_items');
3
+ $collection = $this->getCrossSellingItemsByOrderId($this->getData('orderId'), $limit);
4
+ ?>
5
+
6
+ <?php if(count($collection)): ?>
7
+ <div style="margin-top:5px;font-size:12px;font-weight:400;text-align:center;;line-height:14px;">
8
+ While you are waiting, we have something for you.
9
+ <br>
10
+ Check the offerings bellow:
11
+ </div>
12
+ <div style="margin-top:20px;">
13
+ <table border="0" cellspacing="10" width="100%;">
14
+ <tr>
15
+ <?php foreach ($collection as $_item): ?>
16
+ <td valign="top" style="text-align:center !important;font-size:11px;background:#ffffff;padding:10px;">
17
+ <a style="display:block;text-decoration:none;" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>">
18
+ <img style="max-width:100%;" src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(null, 100); ?>" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" />
19
+ </a>
20
+ <a style="display:block;text-decoration:none;font-size:11px;font-weight:400;text-align:center;color:#333333;text-transform:uppercase;" href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a>
21
+ <div style="margin-top:7px;font-size:11px;font-weight:700;text-align:center;">
22
+ <?php echo $this->getPriceHtml($_item, false) ?>
23
+ </div>
24
+ <a style="display:inline-block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;margin-top:3px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>">
25
+ READ MORE
26
+ </a>
27
+ </td>
28
+ <?php endforeach; ?>
29
+ </tr>
30
+ </table>
31
+ </div>
32
+ <?php endif; ?>
app/design/frontend/base/default/template/pptrack/email/order/shipment/track.phtml CHANGED
@@ -1,27 +1,27 @@
1
- <?php $_shipment=$this->getShipment() ?>
2
- <?php $_order=$this->getOrder() ?>
3
- <?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
4
- <table cellspacing="0" cellpadding="0" border="0" width="650" style="border:1px solid #EAEAEA;">
5
- <thead>
6
- <tr>
7
- <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo Mage::helper('pptrack')->__('Shipped By') ?></th>
8
- <th align="center" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo Mage::helper('pptrack')->__('Tracking Number') ?></th>
9
- <th bgcolor="#EAEAEA" style="padding:3px 9px">&nbsp;</th>
10
- </tr>
11
- </thead>
12
- <tbody>
13
- <?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
14
- <tr <?php echo $i%2?'bgcolor="#F6F6F6"':'' ?>>
15
- <td align="left" valign="top" style="padding:10px 9px 3px"><?php echo $this->escapeHtml($_item->getTitle()) ?></td>
16
- <td align="center" valign="top" style="padding:10px 9px 3px"><?php echo $this->escapeHtml($_item->getNumber()) ?></td>
17
- <td align="center" valign="top" style="padding:3px 9px">
18
- <?php if ($this->shipmentTracked($_item, $_order)) : ?>
19
- <?php $ppTrack = $this->getTrackModel(); ?>
20
- <a href="<?php echo $ppTrack->getDetailsUrl() ?>" style="cursor:pointer;text-decoration:none;display:inline-block;padding:4px 14px;border:1px solid transparent;border-radius:6px;color:#ffffff;background: #24aaa3;"><img style="vertical-align: middle;margin-right:7px;" width="16" height="16" src="<?php echo $this->getSkinUrl('images/pptrack/truck.png') ?>" alt="track"><?php echo Mage::helper('pptrack')->__('Track your item') ?></a>
21
- <?php endif; ?>
22
- </td>
23
- </tr>
24
- <?php endforeach ?>
25
- </tbody>
26
- </table>
27
  <?php endif; ?>
1
+ <?php $_shipment=$this->getShipment() ?>
2
+ <?php $_order=$this->getOrder() ?>
3
+ <?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
4
+ <table cellspacing="0" cellpadding="0" border="0" width="650" style="border:1px solid #EAEAEA;">
5
+ <thead>
6
+ <tr>
7
+ <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo Mage::helper('pptrack')->__('Shipped By') ?></th>
8
+ <th align="center" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo Mage::helper('pptrack')->__('Tracking Number') ?></th>
9
+ <th bgcolor="#EAEAEA" style="padding:3px 9px">&nbsp;</th>
10
+ </tr>
11
+ </thead>
12
+ <tbody>
13
+ <?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
14
+ <tr <?php echo $i%2?'bgcolor="#F6F6F6"':'' ?>>
15
+ <td align="left" valign="top" style="padding:10px 9px 3px"><?php echo $this->escapeHtml($_item->getTitle()) ?></td>
16
+ <td align="center" valign="top" style="padding:10px 9px 3px"><?php echo $this->escapeHtml($_item->getNumber()) ?></td>
17
+ <td align="center" valign="top" style="padding:3px 9px">
18
+ <?php if ($this->shipmentTracked($_item, $_order)) : ?>
19
+ <?php $ppTrack = $this->getTrackModel(); ?>
20
+ <a href="<?php echo $ppTrack->getDetailsUrl() ?>" style="cursor:pointer;text-decoration:none;display:inline-block;padding:4px 14px;border:1px solid transparent;border-radius:6px;color:#ffffff;background: #24aaa3;"><img style="vertical-align: middle;margin-right:7px;" width="16" height="16" src="<?php echo $this->getSkinUrl('images/pptrack/truck.png') ?>" alt="track"><?php echo Mage::helper('pptrack')->__('Track your item') ?></a>
21
+ <?php endif; ?>
22
+ </td>
23
+ </tr>
24
+ <?php endforeach ?>
25
+ </tbody>
26
+ </table>
27
  <?php endif; ?>
app/design/frontend/base/default/template/pptrack/index.phtml CHANGED
@@ -1,179 +1,179 @@
1
- <?php
2
- if ($this->newTemplate) {
3
- if (Mage::getStoreConfig('pp_section_setttings/template/template_type') === 'v2') {
4
- echo $this->setTemplate('pptrack/index_v2.phtml')->toHtml();
5
- } else {
6
- echo $this->setTemplate('pptrack/index_new.phtml')->toHtml();
7
- }
8
-
9
- return false;
10
- }
11
-
12
-
13
- if ($this->model)
14
- $model = $this->model;
15
- else
16
- $model = Mage::registry('model');
17
-
18
- $shippingInfo = $model->getShippingInfo();
19
- $_helper = $this->helper('catalog/output');
20
- ?>
21
-
22
- <?php
23
- if (Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page')) {
24
- if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('script'))) {
25
- $child = $this->getChild("pptrack_script");
26
- if ($child) {
27
- echo $this->getChildHtml('pptrack_script');
28
- }
29
- }
30
- if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('ads', 'both'))) {
31
- $child = $this->getChild("pptrack_ads");
32
- if ($child) {
33
- echo $this->getChildHtml('pptrack_ads');
34
- }
35
- }
36
- if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('products', 'both'))) {
37
- $child = $this->getChild("pptrack_crosssell");
38
- if ($child) {
39
- $child->setData("orderId", $model->getOrderId());
40
- echo $this->getChildHtml('pptrack_crosssell');
41
- }
42
- }
43
- }
44
- ?>
45
-
46
- <div style="clear:both;"></div>
47
- <?php if (!$model->getStatus()): ?>
48
- <br>
49
- <br>
50
- <h2><?php echo Mage::helper('pptrack')->__('No tracking info!'); ?></h2>
51
- <br>
52
- <?php else: ?>
53
-
54
- <div class="pptrack-wrapper">
55
- <h2><?php echo Mage::helper('pptrack')->__('Shipment Information'); ?></h2>
56
- <br/>
57
-
58
- <div class="pptrack-progress">
59
- <div class="pptrack-progress-bar-wrapper">
60
- <div class="pptrack-progress-bar-wrapper">
61
- <ul class="pptrack-progress-bar <?php if ($model->getStatus() == 'delivered') echo "pptrack-progress-bar-done"; ?>">
62
- <li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_PENDING) ?>">
63
- <div
64
- class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Dispatched'); ?></div>
65
- <span class="pptrack-progress-bubble"></span>
66
- </li>
67
- <li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_IN_TRANSIT) ?>">
68
- <div
69
- class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('In Transit'); ?></div>
70
- <span class="pptrack-progress-bubble"></span>
71
- </li>
72
- <li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_OUT_FOR_DELIVERY) ?>">
73
- <div
74
- class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Out for delivery'); ?></div>
75
- <span class="pptrack-progress-bubble"></span>
76
- </li>
77
- <li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_DELIVERED) ?>">
78
- <div class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Delivered'); ?></div>
79
- <span class="pptrack-progress-bubble"></span>
80
- </li>
81
- </ul>
82
- </div>
83
- </div>
84
- </div>
85
- <br/>
86
- <br/>
87
-
88
- <div class="pptrack-tracking-info">
89
- <h2><?php echo Mage::helper('pptrack')->__('Tracking Info'); ?></h2>
90
-
91
- <div class="pptrack-tracking-info-details">
92
- <?php $details = $model->getDetails(); ?>
93
- <?php if (!$details) : ?>
94
- <div class="pptrack-info-row">
95
- <div class="pptrack-info-row-date"><?php echo date("Y-m-d", $model->created_at) ?>
96
- <br/><?php echo date("H:i:s", $model->created_at) ?></div>
97
- <div class="pptrack-info-row-details-wrapper">
98
- <div class="pptrack-info-row-details">
99
- <?php echo Mage::helper('pptrack')->__("Package prepared for dispatch") ?>
100
- </div>
101
- </div>
102
- <div style="clear:both;display:table;"></div>
103
- </div>
104
- <?php else : ?>
105
- <?php foreach ($details as $detail): ?>
106
- <div class="pptrack-info-row">
107
- <div>
108
- <div class="pptrack-info-row-date"><?php echo $detail->getEventDate(); ?>
109
- <br/><?php echo $detail->getEventTime(); ?></div>
110
- <div class="pptrack-info-row-details-wrapper">
111
- <div class="pptrack-info-row-details">
112
- <?php echo Mage::helper('pptrack')->__($detail->getStatusString()); ?>
113
- <div
114
- class="pptrack-info-row-details-location"><?php echo $detail->getLocation() ?></div>
115
- </div>
116
- </div>
117
- <div style="clear:both;display:table;"></div>
118
- </div>
119
- </div>
120
- <?php endforeach; ?>
121
- <?php endif; ?>
122
- </div>
123
- </div>
124
- <div class="pptrack-tracking-general-info">
125
- <h2>Info</h2>
126
-
127
- <div class="pptrack-tracking-general-info-details">
128
- <div class="pptrack-tracking-row">
129
- <span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Order number'); ?></span>
130
- <span class="pptrack-tracking-general-info-value"><?php echo $model->getOrderNumber(); ?></span>
131
- <br style="clear: both;"/>
132
- </div>
133
- <div class="pptrack-tracking-row">
134
- <span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Tracking code'); ?></span>
135
- <span class="pptrack-tracking-general-info-value"><?php echo $model->getCode(); ?></span>
136
- <br style="clear: both;"/>
137
- </div>
138
- <div class="pptrack-tracking-row">
139
- <span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Shipped on'); ?></span>
140
- <span class="pptrack-tracking-general-info-value"><?php echo $model->getShippingDate(); ?></span>
141
- <br style="clear: both;"/>
142
- </div>
143
- <div class="pptrack-tracking-row">
144
- <span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Ships to'); ?></span>
145
- <span
146
- class="pptrack-tracking-general-info-value"><?php echo $shippingInfo['firstname'] . ' ' . $shippingInfo['lastname']; ?>
147
- <br/><?php echo $shippingInfo['street'] . ', ' . $shippingInfo['city']; ?>
148
- <br/><?php echo $shippingInfo['region'] ? $shippingInfo['region'] . '<br />' : ''; ?><?php echo $shippingInfo['postcode']; ?> <?php echo Mage::app()->getLocale()->getCountryTranslation($shippingInfo['country_id']); ?></span>
149
- <br style="clear: both;"/>
150
- </div>
151
-
152
- <br/>
153
-
154
- <div class="pptrack-tracking-carrier-info-wrapper">
155
- <span><?php echo Mage::helper('pptrack')->__('For questions regarding your shipment contact carrier directly'); ?></span><br/>
156
- <br/>
157
-
158
- <div class="pptrack-tracking-courier-logo">
159
- <img src="<?php echo $model->getCarrierIcon() ?>"/>
160
- </div>
161
- <div class="pptrack-tracking-courier-info">
162
- <h3><?php echo $model->getCarrierName() ?></h3>
163
- <?php
164
- $phone = $model->getCarrierPhone();
165
- $homepage = $model->getCarrierHomepage();
166
- ?>
167
- <?php if ($phone) : ?>
168
- <span><?php echo $phone ?></span><br/>
169
- <?php endif; ?>
170
- <?php if ($homepage) : ?>
171
- <a href="<?php echo $homepage ?>"><?php echo $homepage ?></a>
172
- <?php endif; ?>
173
- </div>
174
- <div style="clear:both;"></div>
175
- </div>
176
- </div>
177
- </div>
178
- </div>
179
- <?php endif; ?>
1
+ <?php
2
+ if ($this->newTemplate) {
3
+ if (Mage::getStoreConfig('pp_section_setttings/template/template_type') === 'v2') {
4
+ echo $this->setTemplate('pptrack/index_v2.phtml')->toHtml();
5
+ } else {
6
+ echo $this->setTemplate('pptrack/index_new.phtml')->toHtml();
7
+ }
8
+
9
+ return false;
10
+ }
11
+
12
+
13
+ if ($this->model)
14
+ $model = $this->model;
15
+ else
16
+ $model = Mage::registry('model');
17
+
18
+ $shippingInfo = $model->getShippingInfo();
19
+ $_helper = $this->helper('catalog/output');
20
+ ?>
21
+
22
+ <?php
23
+ if (Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page')) {
24
+ if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('script'))) {
25
+ $child = $this->getChild("pptrack_script");
26
+ if ($child) {
27
+ echo $this->getChildHtml('pptrack_script');
28
+ }
29
+ }
30
+ if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('ads', 'both'))) {
31
+ $child = $this->getChild("pptrack_ads");
32
+ if ($child) {
33
+ echo $this->getChildHtml('pptrack_ads');
34
+ }
35
+ }
36
+ if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('products', 'both'))) {
37
+ $child = $this->getChild("pptrack_crosssell");
38
+ if ($child) {
39
+ $child->setData("orderId", $model->getOrderId());
40
+ echo $this->getChildHtml('pptrack_crosssell');
41
+ }
42
+ }
43
+ }
44
+ ?>
45
+
46
+ <div style="clear:both;"></div>
47
+ <?php if (!$model->getStatus()): ?>
48
+ <br>
49
+ <br>
50
+ <h2><?php echo Mage::helper('pptrack')->__('No tracking info!'); ?></h2>
51
+ <br>
52
+ <?php else: ?>
53
+
54
+ <div class="pptrack-wrapper">
55
+ <h2><?php echo Mage::helper('pptrack')->__('Shipment Information'); ?></h2>
56
+ <br/>
57
+
58
+ <div class="pptrack-progress">
59
+ <div class="pptrack-progress-bar-wrapper">
60
+ <div class="pptrack-progress-bar-wrapper">
61
+ <ul class="pptrack-progress-bar <?php if ($model->getStatus() == 'delivered') echo "pptrack-progress-bar-done"; ?>">
62
+ <li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_PENDING) ?>">
63
+ <div
64
+ class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Dispatched'); ?></div>
65
+ <span class="pptrack-progress-bubble"></span>
66
+ </li>
67
+ <li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_IN_TRANSIT) ?>">
68
+ <div
69
+ class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('In Transit'); ?></div>
70
+ <span class="pptrack-progress-bubble"></span>
71
+ </li>
72
+ <li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_OUT_FOR_DELIVERY) ?>">
73
+ <div
74
+ class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Out for delivery'); ?></div>
75
+ <span class="pptrack-progress-bubble"></span>
76
+ </li>
77
+ <li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_DELIVERED) ?>">
78
+ <div class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Delivered'); ?></div>
79
+ <span class="pptrack-progress-bubble"></span>
80
+ </li>
81
+ </ul>
82
+ </div>
83
+ </div>
84
+ </div>
85
+ <br/>
86
+ <br/>
87
+
88
+ <div class="pptrack-tracking-info">
89
+ <h2><?php echo Mage::helper('pptrack')->__('Tracking Info'); ?></h2>
90
+
91
+ <div class="pptrack-tracking-info-details">
92
+ <?php $details = $model->getDetails(); ?>
93
+ <?php if (!$details) : ?>
94
+ <div class="pptrack-info-row">
95
+ <div class="pptrack-info-row-date"><?php echo date("Y-m-d", $model->created_at) ?>
96
+ <br/><?php echo date("H:i:s", $model->created_at) ?></div>
97
+ <div class="pptrack-info-row-details-wrapper">
98
+ <div class="pptrack-info-row-details">
99
+ <?php echo Mage::helper('pptrack')->__("Package prepared for dispatch") ?>
100
+ </div>
101
+ </div>
102
+ <div style="clear:both;display:table;"></div>
103
+ </div>
104
+ <?php else : ?>
105
+ <?php foreach ($details as $detail): ?>
106
+ <div class="pptrack-info-row">
107
+ <div>
108
+ <div class="pptrack-info-row-date"><?php echo $detail->getEventDate(); ?>
109
+ <br/><?php echo $detail->getEventTime(); ?></div>
110
+ <div class="pptrack-info-row-details-wrapper">
111
+ <div class="pptrack-info-row-details">
112
+ <?php echo Mage::helper('pptrack')->__($detail->getStatusString()); ?>
113
+ <div
114
+ class="pptrack-info-row-details-location"><?php echo $detail->getLocation() ?></div>
115
+ </div>
116
+ </div>
117
+ <div style="clear:both;display:table;"></div>
118
+ </div>
119
+ </div>
120
+ <?php endforeach; ?>
121
+ <?php endif; ?>
122
+ </div>
123
+ </div>
124
+ <div class="pptrack-tracking-general-info">
125
+ <h2>Info</h2>
126
+
127
+ <div class="pptrack-tracking-general-info-details">
128
+ <div class="pptrack-tracking-row">
129
+ <span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Order number'); ?></span>
130
+ <span class="pptrack-tracking-general-info-value"><?php echo $model->getOrderNumber(); ?></span>
131
+ <br style="clear: both;"/>
132
+ </div>
133
+ <div class="pptrack-tracking-row">
134
+ <span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Tracking code'); ?></span>
135
+ <span class="pptrack-tracking-general-info-value"><?php echo $model->getCode(); ?></span>
136
+ <br style="clear: both;"/>
137
+ </div>
138
+ <div class="pptrack-tracking-row">
139
+ <span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Shipped on'); ?></span>
140
+ <span class="pptrack-tracking-general-info-value"><?php echo $model->getShippingDate(); ?></span>
141
+ <br style="clear: both;"/>
142
+ </div>
143
+ <div class="pptrack-tracking-row">
144
+ <span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Ships to'); ?></span>
145
+ <span
146
+ class="pptrack-tracking-general-info-value"><?php echo $shippingInfo['firstname'] . ' ' . $shippingInfo['lastname']; ?>
147
+ <br/><?php echo $shippingInfo['street'] . ', ' . $shippingInfo['city']; ?>
148
+ <br/><?php echo $shippingInfo['region'] ? $shippingInfo['region'] . '<br />' : ''; ?><?php echo $shippingInfo['postcode']; ?> <?php echo Mage::app()->getLocale()->getCountryTranslation($shippingInfo['country_id']); ?></span>
149
+ <br style="clear: both;"/>
150
+ </div>
151
+
152
+ <br/>
153
+
154
+ <div class="pptrack-tracking-carrier-info-wrapper">
155
+ <span><?php echo Mage::helper('pptrack')->__('For questions regarding your shipment contact carrier directly'); ?></span><br/>
156
+ <br/>
157
+
158
+ <div class="pptrack-tracking-courier-logo">
159
+ <img src="<?php echo $model->getCarrierIcon() ?>"/>
160
+ </div>
161
+ <div class="pptrack-tracking-courier-info">
162
+ <h3><?php echo $model->getCarrierName() ?></h3>
163
+ <?php
164
+ $phone = $model->getCarrierPhone();
165
+ $homepage = $model->getCarrierHomepage();
166
+ ?>
167
+ <?php if ($phone) : ?>
168
+ <span><?php echo $phone ?></span><br/>
169
+ <?php endif; ?>
170
+ <?php if ($homepage) : ?>
171
+ <a href="<?php echo $homepage ?>"><?php echo $homepage ?></a>
172
+ <?php endif; ?>
173
+ </div>
174
+ <div style="clear:both;"></div>
175
+ </div>
176
+ </div>
177
+ </div>
178
+ </div>
179
+ <?php endif; ?>
app/design/frontend/base/default/template/pptrack/index_new.phtml CHANGED
@@ -1,210 +1,210 @@
1
- <?php
2
- $_helper = $this->helper('catalog/output');
3
- ?>
4
-
5
- <?php
6
- if (Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page')) {
7
- if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('script'))) {
8
- $child = $this->getChild("pptrack_script");
9
- if ($child) {
10
- echo $this->getChildHtml('pptrack_script');
11
- }
12
- }
13
- if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('ads', 'both'))) {
14
- $child = $this->getChild("pptrack_ads");
15
- if ($child) {
16
- echo $this->getChildHtml('pptrack_ads');
17
- }
18
- }
19
- if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('products', 'both'))) {
20
- $child = $this->getChild("pptrack_crosssell");
21
- if ($child) {
22
- $child->setData("orderId", $this->orderId);
23
- echo $this->getChildHtml('pptrack_crosssell');
24
- }
25
- }
26
- }
27
- ?>
28
-
29
- <div class="clearfix"></div>
30
- <?php if ($this->trackingType === 1) : ?>
31
- <h2><?php echo Mage::helper('pptrack')->__('Track your order'); ?></h2>
32
- <div class="clearfix"></div>
33
- <form class="pptrack-form pptrack-boxmodel" method="get" action="">
34
- <div class="pptrack-row">
35
- <div class="pptrack-form-controls">
36
- <label class="pptrack-label" for="pp_email"><?php echo Mage::helper('pptrack')->__('Your email'); ?></label>
37
- <input value="<?php echo $this->email ?>" id="pp_email" class="pptrack-input" name="email" type="text" required>
38
- </div>
39
- <div class="pptrack-form-controls">
40
- <label class="pptrack-label" for="pp_order"><?php echo Mage::helper('pptrack')->__('Order number'); ?></label>
41
- <input value="<?php echo $this->orderNumber ?>" id="pp_order" class="pptrack-input" name="order"
42
- type="text" required>
43
- </div>
44
- </div>
45
- <button class="btn button pptrack-btn" type="submit"><?php echo Mage::helper('pptrack')->__('Submit'); ?></button>
46
- </form>
47
- <?php endif; ?>
48
- <?php if ($this->msg) : ?>
49
- <div class="pptrack-info">
50
- <?php echo $this->msg ?>
51
- </div>
52
- <?php endif; ?>
53
-
54
- <?php foreach($this->trackModels as $model) : ?>
55
- <?php
56
- $shippingInfo = $model->getShippingInfo();
57
- ?>
58
- <br>
59
- <div class="clearfix"></div>
60
- <?php if (!$model->getStatus()): ?>
61
- <br>
62
- <br>
63
- <h2><?php echo Mage::helper('pptrack')->__('No tracking info!'); ?></h2>
64
- <br>
65
- <?php else: ?>
66
-
67
- <div class="pptrack-wrapper clearfix">
68
- <?php if ($this->trackingType === 1) : ?>
69
- <h2><?php echo count($this->trackModels) == 1 ? Mage::helper('pptrack')->__('Shipment Information') : Mage::helper('pptrack')->__('Package:') . ' ' . strtoupper($model->code); ?></h2>
70
- <?php endif; ?>
71
- <br/>
72
-
73
- <div id="#<?php echo strtoupper($model->code) ?>" class="pptrack-progress">
74
- <div class="pptrack-progress-bar-wrapper">
75
- <div class="pptrack-progress-bar-wrapper">
76
- <ul class="pptrack-progress-bar <?php if ($model->getStatus() == 'delivered') echo "pptrack-progress-bar-done"; ?>">
77
- <li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_PENDING) ?>">
78
- <div
79
- class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Dispatched'); ?></div>
80
- <span class="pptrack-progress-bubble"></span>
81
- </li>
82
- <li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_IN_TRANSIT) ?>">
83
- <div
84
- class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('In Transit'); ?></div>
85
- <span class="pptrack-progress-bubble"></span>
86
- </li>
87
- <li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_OUT_FOR_DELIVERY) ?>">
88
- <div
89
- class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Out for delivery'); ?></div>
90
- <span class="pptrack-progress-bubble"></span>
91
- </li>
92
- <li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_DELIVERED) ?>">
93
- <div class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Delivered'); ?></div>
94
- <span class="pptrack-progress-bubble"></span>
95
- </li>
96
- </ul>
97
- </div>
98
- </div>
99
- </div>
100
- <br/>
101
- <br/>
102
-
103
- <div class="pptrack-tracking-info">
104
- <h2><?php echo Mage::helper('pptrack')->__('Tracking Info'); ?></h2>
105
-
106
- <div class="pptrack-tracking-info-details">
107
- <?php $details = $model->getDetails(); ?>
108
- <?php if (!$details) : ?>
109
- <div class="pptrack-info-row">
110
- <div class="pptrack-info-row-date"><?php echo date("Y-m-d", $model->created_at) ?>
111
- <br/><?php echo date("H:i:s", $model->created_at) ?></div>
112
- <div class="pptrack-info-row-details-wrapper">
113
- <div class="pptrack-info-row-details">
114
- <?php if ($model->status == Packpin_Pptrack_Model_Track::STATUS_PENDING) : ?>
115
- <?php echo Mage::helper('pptrack')->__("Package status pending"); ?>
116
- <?php else : ?>
117
- <?php echo Mage::helper('pptrack')->__("Package prepared for dispatch"); ?>
118
- <?php endif; ?>
119
- </div>
120
- </div>
121
- <div style="clear:both;display:table;"></div>
122
- </div>
123
- <?php else : ?>
124
- <?php foreach ($details as $detail): ?>
125
- <div class="pptrack-info-row">
126
- <div>
127
- <div class="pptrack-info-row-date"><?php echo $detail->getEventDate(); ?>
128
- <br/><?php echo $detail->getEventTime(); ?></div>
129
- <div class="pptrack-info-row-details-wrapper">
130
- <div class="pptrack-info-row-details">
131
- <?php echo Mage::helper('pptrack')->__($detail->getStatusString()); ?>
132
- <div
133
- class="pptrack-info-row-details-location"><?php echo $detail->getLocation() ?></div>
134
- </div>
135
- </div>
136
- <div style="clear:both;display:table;"></div>
137
- </div>
138
- </div>
139
- <?php endforeach; ?>
140
- <?php endif; ?>
141
- </div>
142
- </div>
143
- <div class="pptrack-tracking-general-info">
144
- <h2>Info</h2>
145
-
146
- <div class="pptrack-tracking-general-info-details">
147
- <?php if ($this->trackingType === 1) : ?>
148
- <div class="pptrack-tracking-row">
149
- <span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Order number'); ?></span>
150
- <span class="pptrack-tracking-general-info-value"><?php echo $model->getOrderNumber(); ?></span>
151
- <br style="clear: both;"/>
152
- </div>
153
- <?php endif; ?>
154
- <div class="pptrack-tracking-row">
155
- <span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Tracking code'); ?></span>
156
- <span class="pptrack-tracking-general-info-value"><?php echo $model->getCode(); ?></span>
157
- <br style="clear: both;"/>
158
- </div>
159
- <?php if ($model->apiResponseData && isset($model->apiResponseData['estimated_delivery']) && $model->apiResponseData['estimated_delivery']) : ?>
160
- <div class="pptrack-tracking-row">
161
- <span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Estimated delivery day'); ?></span>
162
- <span class="pptrack-tracking-general-info-value"><?php echo $model->getEstimatedDelivery() ?></span>
163
- <br style="clear: both;"/>
164
- </div>
165
- <?php endif; ?>
166
- <?php if ($this->trackingType === 1) : ?>
167
- <div class="pptrack-tracking-row">
168
- <span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Shipped on'); ?></span>
169
- <span class="pptrack-tracking-general-info-value"><?php echo $model->getShippingDate(); ?></span>
170
- <br style="clear: both;"/>
171
- </div>
172
- <div class="pptrack-tracking-row">
173
- <span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Ships to'); ?></span>
174
- <span
175
- class="pptrack-tracking-general-info-value"><?php echo $shippingInfo['firstname'] . ' ' . $shippingInfo['lastname']; ?>
176
- <br/><?php echo $shippingInfo['street'] . ', ' . $shippingInfo['city']; ?>
177
- <br/><?php echo $shippingInfo['region'] ? $shippingInfo['region'] . '<br />' : ''; ?><?php echo $shippingInfo['postcode']; ?> <?php echo Mage::app()->getLocale()->getCountryTranslation($shippingInfo['country_id']); ?></span>
178
- <br style="clear: both;"/>
179
- </div>
180
- <?php endif; ?>
181
-
182
- <br/>
183
-
184
- <div class="pptrack-tracking-carrier-info-wrapper">
185
- <span><?php echo Mage::helper('pptrack')->__('For questions regarding your shipment contact carrier directly'); ?></span><br/>
186
- <br/>
187
-
188
- <div class="pptrack-tracking-courier-logo">
189
- <img src="<?php echo $model->getCarrierIcon() ?>"/>
190
- </div>
191
- <div class="pptrack-tracking-courier-info">
192
- <h3><?php echo $model->getCarrierName() ?></h3>
193
- <?php
194
- $phone = $model->getCarrierPhone();
195
- $homepage = $model->getCarrierHomepage();
196
- ?>
197
- <?php if ($phone) : ?>
198
- <span><?php echo $phone ?></span><br/>
199
- <?php endif; ?>
200
- <?php if ($homepage) : ?>
201
- <a href="<?php echo $homepage ?>"><?php echo $homepage ?></a>
202
- <?php endif; ?>
203
- </div>
204
- <div style="clear:both;"></div>
205
- </div>
206
- </div>
207
- </div>
208
- </div>
209
- <?php endif; ?>
210
- <?php endforeach; ?>
1
+ <?php
2
+ $_helper = $this->helper('catalog/output');
3
+ ?>
4
+
5
+ <?php
6
+ if (Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page')) {
7
+ if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('script'))) {
8
+ $child = $this->getChild("pptrack_script");
9
+ if ($child) {
10
+ echo $this->getChildHtml('pptrack_script');
11
+ }
12
+ }
13
+ if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('ads', 'both'))) {
14
+ $child = $this->getChild("pptrack_ads");
15
+ if ($child) {
16
+ echo $this->getChildHtml('pptrack_ads');
17
+ }
18
+ }
19
+ if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('products', 'both'))) {
20
+ $child = $this->getChild("pptrack_crosssell");
21
+ if ($child) {
22
+ $child->setData("orderId", $this->orderId);
23
+ echo $this->getChildHtml('pptrack_crosssell');
24
+ }
25
+ }
26
+ }
27
+ ?>
28
+
29
+ <div class="clearfix"></div>
30
+ <?php if ($this->trackingType === 1) : ?>
31
+ <h2><?php echo Mage::helper('pptrack')->__('Track your order'); ?></h2>
32
+ <div class="clearfix"></div>
33
+ <form class="pptrack-form pptrack-boxmodel" method="get" action="">
34
+ <div class="pptrack-row">
35
+ <div class="pptrack-form-controls">
36
+ <label class="pptrack-label" for="pp_email"><?php echo Mage::helper('pptrack')->__('Your email'); ?></label>
37
+ <input value="<?php echo $this->email ?>" id="pp_email" class="pptrack-input" name="email" type="text" required>
38
+ </div>
39
+ <div class="pptrack-form-controls">
40
+ <label class="pptrack-label" for="pp_order"><?php echo Mage::helper('pptrack')->__('Order number'); ?></label>
41
+ <input value="<?php echo $this->orderNumber ?>" id="pp_order" class="pptrack-input" name="order"
42
+ type="text" required>
43
+ </div>
44
+ </div>
45
+ <button class="btn button pptrack-btn" type="submit"><?php echo Mage::helper('pptrack')->__('Submit'); ?></button>
46
+ </form>
47
+ <?php endif; ?>
48
+ <?php if ($this->msg) : ?>
49
+ <div class="pptrack-info">
50
+ <?php echo $this->msg ?>
51
+ </div>
52
+ <?php endif; ?>
53
+
54
+ <?php foreach($this->trackModels as $model) : ?>
55
+ <?php
56
+ $shippingInfo = $model->getShippingInfo();
57
+ ?>
58
+ <br>
59
+ <div class="clearfix"></div>
60
+ <?php if (!$model->getStatus()): ?>
61
+ <br>
62
+ <br>
63
+ <h2><?php echo Mage::helper('pptrack')->__('No tracking info!'); ?></h2>
64
+ <br>
65
+ <?php else: ?>
66
+
67
+ <div class="pptrack-wrapper clearfix">
68
+ <?php if ($this->trackingType === 1) : ?>
69
+ <h2><?php echo count($this->trackModels) == 1 ? Mage::helper('pptrack')->__('Shipment Information') : Mage::helper('pptrack')->__('Package:') . ' ' . strtoupper($model->code); ?></h2>
70
+ <?php endif; ?>
71
+ <br/>
72
+
73
+ <div id="#<?php echo strtoupper($model->code) ?>" class="pptrack-progress">
74
+ <div class="pptrack-progress-bar-wrapper">
75
+ <div class="pptrack-progress-bar-wrapper">
76
+ <ul class="pptrack-progress-bar <?php if ($model->getStatus() == 'delivered') echo "pptrack-progress-bar-done"; ?>">
77
+ <li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_PENDING) ?>">
78
+ <div
79
+ class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Dispatched'); ?></div>
80
+ <span class="pptrack-progress-bubble"></span>
81
+ </li>
82
+ <li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_IN_TRANSIT) ?>">
83
+ <div
84
+ class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('In Transit'); ?></div>
85
+ <span class="pptrack-progress-bubble"></span>
86
+ </li>
87
+ <li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_OUT_FOR_DELIVERY) ?>">
88
+ <div
89
+ class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Out for delivery'); ?></div>
90
+ <span class="pptrack-progress-bubble"></span>
91
+ </li>
92
+ <li class="<?php echo $model->getStatusClass(Packpin_Pptrack_Model_Track::STATUS_DELIVERED) ?>">
93
+ <div class="pptrack-tracking-progress-bar-label"><?php echo Mage::helper('pptrack')->__('Delivered'); ?></div>
94
+ <span class="pptrack-progress-bubble"></span>
95
+ </li>
96
+ </ul>
97
+ </div>
98
+ </div>
99
+ </div>
100
+ <br/>
101
+ <br/>
102
+
103
+ <div class="pptrack-tracking-info">
104
+ <h2><?php echo Mage::helper('pptrack')->__('Tracking Info'); ?></h2>
105
+
106
+ <div class="pptrack-tracking-info-details">
107
+ <?php $details = $model->getDetails(); ?>
108
+ <?php if (!$details) : ?>
109
+ <div class="pptrack-info-row">
110
+ <div class="pptrack-info-row-date"><?php echo date("Y-m-d", $model->created_at) ?>
111
+ <br/><?php echo date("H:i:s", $model->created_at) ?></div>
112
+ <div class="pptrack-info-row-details-wrapper">
113
+ <div class="pptrack-info-row-details">
114
+ <?php if ($model->status == Packpin_Pptrack_Model_Track::STATUS_PENDING) : ?>
115
+ <?php echo Mage::helper('pptrack')->__("Package status pending"); ?>
116
+ <?php else : ?>
117
+ <?php echo Mage::helper('pptrack')->__("Package prepared for dispatch"); ?>
118
+ <?php endif; ?>
119
+ </div>
120
+ </div>
121
+ <div style="clear:both;display:table;"></div>
122
+ </div>
123
+ <?php else : ?>
124
+ <?php foreach ($details as $detail): ?>
125
+ <div class="pptrack-info-row">
126
+ <div>
127
+ <div class="pptrack-info-row-date"><?php echo $detail->getEventDate(); ?>
128
+ <br/><?php echo $detail->getEventTime(); ?></div>
129
+ <div class="pptrack-info-row-details-wrapper">
130
+ <div class="pptrack-info-row-details">
131
+ <?php echo Mage::helper('pptrack')->__($detail->getStatusString()); ?>
132
+ <div
133
+ class="pptrack-info-row-details-location"><?php echo $detail->getLocation() ?></div>
134
+ </div>
135
+ </div>
136
+ <div style="clear:both;display:table;"></div>
137
+ </div>
138
+ </div>
139
+ <?php endforeach; ?>
140
+ <?php endif; ?>
141
+ </div>
142
+ </div>
143
+ <div class="pptrack-tracking-general-info">
144
+ <h2>Info</h2>
145
+
146
+ <div class="pptrack-tracking-general-info-details">
147
+ <?php if ($this->trackingType === 1) : ?>
148
+ <div class="pptrack-tracking-row">
149
+ <span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Order number'); ?></span>
150
+ <span class="pptrack-tracking-general-info-value"><?php echo $model->getOrderNumber(); ?></span>
151
+ <br style="clear: both;"/>
152
+ </div>
153
+ <?php endif; ?>
154
+ <div class="pptrack-tracking-row">
155
+ <span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Tracking code'); ?></span>
156
+ <span class="pptrack-tracking-general-info-value"><?php echo $model->getCode(); ?></span>
157
+ <br style="clear: both;"/>
158
+ </div>
159
+ <?php if ($model->apiResponseData && isset($model->apiResponseData['estimated_delivery']) && $model->apiResponseData['estimated_delivery']) : ?>
160
+ <div class="pptrack-tracking-row">
161
+ <span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Estimated delivery day'); ?></span>
162
+ <span class="pptrack-tracking-general-info-value"><?php echo $model->getEstimatedDelivery() ?></span>
163
+ <br style="clear: both;"/>
164
+ </div>
165
+ <?php endif; ?>
166
+ <?php if ($this->trackingType === 1) : ?>
167
+ <div class="pptrack-tracking-row">
168
+ <span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Shipped on'); ?></span>
169
+ <span class="pptrack-tracking-general-info-value"><?php echo $model->getShippingDate(); ?></span>
170
+ <br style="clear: both;"/>
171
+ </div>
172
+ <div class="pptrack-tracking-row">
173
+ <span class="pptrack-tracking-general-info-label"><?php echo Mage::helper('pptrack')->__('Ships to'); ?></span>
174
+ <span
175
+ class="pptrack-tracking-general-info-value"><?php echo $shippingInfo['firstname'] . ' ' . $shippingInfo['lastname']; ?>
176
+ <br/><?php echo $shippingInfo['street'] . ', ' . $shippingInfo['city']; ?>
177
+ <br/><?php echo $shippingInfo['region'] ? $shippingInfo['region'] . '<br />' : ''; ?><?php echo $shippingInfo['postcode']; ?> <?php echo Mage::app()->getLocale()->getCountryTranslation($shippingInfo['country_id']); ?></span>
178
+ <br style="clear: both;"/>
179
+ </div>
180
+ <?php endif; ?>
181
+
182
+ <br/>
183
+
184
+ <div class="pptrack-tracking-carrier-info-wrapper">
185
+ <span><?php echo Mage::helper('pptrack')->__('For questions regarding your shipment contact carrier directly'); ?></span><br/>
186
+ <br/>
187
+
188
+ <div class="pptrack-tracking-courier-logo">
189
+ <img src="<?php echo $model->getCarrierIcon() ?>"/>
190
+ </div>
191
+ <div class="pptrack-tracking-courier-info">
192
+ <h3><?php echo $model->getCarrierName() ?></h3>
193
+ <?php
194
+ $phone = $model->getCarrierPhone();
195
+ $homepage = $model->getCarrierHomepage();
196
+ ?>
197
+ <?php if ($phone) : ?>
198
+ <span><?php echo $phone ?></span><br/>
199
+ <?php endif; ?>
200
+ <?php if ($homepage) : ?>
201
+ <a href="<?php echo $homepage ?>"><?php echo $homepage ?></a>
202
+ <?php endif; ?>
203
+ </div>
204
+ <div style="clear:both;"></div>
205
+ </div>
206
+ </div>
207
+ </div>
208
+ </div>
209
+ <?php endif; ?>
210
+ <?php endforeach; ?>
app/design/frontend/base/default/template/pptrack/index_v2.phtml CHANGED
@@ -1,219 +1,253 @@
1
- <style>
2
- @import url(https://fonts.googleapis.com/css?family=Roboto+Slab:400,300,700);
3
- </style>
4
-
5
- <?php
6
- $_helper = $this->helper('catalog/output');
7
- ?>
8
-
9
- <?php
10
- if (Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page')) {
11
- if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('script'))) {
12
- $child = $this->getChild("pptrack_script");
13
- if ($child) {
14
- echo $this->getChildHtml('pptrack_script');
15
- }
16
- }
17
- if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('ads', 'both'))) {
18
- $child = $this->getChild("pptrack_ads");
19
- if ($child) {
20
- echo $this->getChildHtml('pptrack_ads');
21
- }
22
- }
23
- if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('products', 'both'))) {
24
- $child = $this->getChild("pptrack_crosssell");
25
- if ($child) {
26
- $child->setData("orderId", $this->orderId);
27
- echo $this->getChildHtml('pptrack_crosssell');
28
- }
29
- }
30
- }
31
- $count = 0;
32
- $imageType = Mage::getStoreConfig('pp_section_setttings/template/template_image_type');
33
- $imageLink = Mage::getStoreConfig('pp_section_setttings/template/template_image_link');
34
- $image = Mage::getStoreConfig('pp_section_setttings/template/template_image');
35
- $customImage = $imageType === 'custom' && !empty($image) ? Mage::getBaseUrl('media') . 'theme' . DIRECTORY_SEPARATOR . $image : false;
36
- ?>
37
-
38
- <div class="clearfix"></div>
39
- <?php if ($this->trackingType === 1) : ?>
40
- <h2><?php echo Mage::helper('pptrack')->__('Track your order'); ?></h2>
41
- <div class="clearfix"></div>
42
- <form class="pptrack-form pptrack-boxmodel" method="get" action="">
43
- <div class="pptrack-row">
44
- <div class="pptrack-form-controls">
45
- <label class="pptrack-label" for="pp_email"><?php echo Mage::helper('pptrack')->__('Your email'); ?></label>
46
- <input value="<?php echo $this->email ?>" id="pp_email" class="pptrack-input" name="email" type="text" required>
47
- </div>
48
- <div class="pptrack-form-controls">
49
- <label class="pptrack-label" for="pp_order"><?php echo Mage::helper('pptrack')->__('Order number'); ?></label>
50
- <input value="<?php echo $this->orderNumber ?>" id="pp_order" class="pptrack-input" name="order"
51
- type="text" required>
52
- </div>
53
- </div>
54
- <button class="btn button pptrack-btn" type="submit"><?php echo Mage::helper('pptrack')->__('Submit'); ?></button>
55
- </form>
56
- <?php endif; ?>
57
- <?php if ($this->msg) : ?>
58
- <div class="pptrack-info">
59
- <?php echo $this->msg ?>
60
- </div>
61
- <?php endif; ?>
62
-
63
- <?php foreach($this->trackModels as $model) : ?>
64
- <?php
65
- $count++;
66
- $shippingInfo = $model->getShippingInfo();
67
- ?>
68
- <br>
69
- <div class="clearfix"></div>
70
- <?php if (!$model->getStatus()): ?>
71
- <br>
72
- <br>
73
- <h2><?php echo Mage::helper('pptrack')->__('No tracking info!'); ?></h2>
74
- <br>
75
- <?php else: ?>
76
-
77
- <div class="pptrack-wrapper pptrack-v2 pptrack-boxmodel clearfix">
78
- <div class="pptrack-v2-row clearfix">
79
- <div id="pptrack-v2-block-track-back<?php echo $count ?>" class="pptrack-v2-block" style="display:none;">
80
- <div class="pptrack-v2-block-inner pptrack-v2-block-inner-res">
81
- <div class="pptrack-v2-title1"><?php echo Mage::helper('pptrack')->__('ESTIMATED DELIVERY DATE & DETAILS'); ?></div>
82
- <div class="pptrack-v2-details">
83
- <?php $details = $model->getDetails(); ?>
84
- <?php if (!$details) : ?>
85
- <div class="pptrack-v2-info-row">
86
- <div class="pptrack-v2-info-row-date">
87
- <?php echo date("M j", $model->created_at) ?>,
88
- <?php echo date("H:i:s", $model->created_at) ?>
89
- </div>
90
- <div class="pptrack-info-row-details-wrapper">
91
- <div class="pptrack-v2-info-row-details">
92
- <?php if ($model->status == Packpin_Pptrack_Model_Track::STATUS_PENDING) : ?>
93
- <?php echo Mage::helper('pptrack')->__("Package status pending"); ?>
94
- <?php else : ?>
95
- <?php echo Mage::helper('pptrack')->__("Package prepared for dispatch"); ?>
96
- <?php endif; ?>
97
- </div>
98
- </div>
99
- </div>
100
- <?php else : ?>
101
- <?php foreach ($details as $detail): ?>
102
- <div class="pptrack-v2-info-row">
103
- <div>
104
- <div class="pptrack-v2-info-row-date">
105
- <?php echo date("M j", strtotime($detail->getEventDate())); ?>,
106
- <?php echo $detail->getEventTime(); ?>
107
- </div>
108
- <div class="pptrack-v2-info-row-details">
109
- <?php echo Mage::helper('pptrack')->__($detail->getStatusString()); ?>
110
- <div
111
- class="pptrack-v2-info-row-details-location"><?php echo $detail->getLocation() ?></div>
112
- </div>
113
- </div>
114
- </div>
115
- <?php endforeach; ?>
116
- <?php endif; ?>
117
- </div>
118
- <div id="pptrack-v2-track-link2" onclick="ppShowFront(<?php echo $count ?>)"><?php echo Mage::helper('pptrack')->__('BACK'); ?></div>
119
- </div>
120
- </div>
121
- <div id="pptrack-v2-block-track-front<?php echo $count ?>" class="pptrack-v2-block">
122
- <div class="pptrack-v2-block-inner">
123
- <div class="pptrack-v2-title1"><?php echo Mage::helper('pptrack')->__('ESTIMATED DELIVERY DATE & DETAILS'); ?></div>
124
- <?php if ($model->apiResponseData && isset($model->apiResponseData['estimated_delivery']) && $model->apiResponseData['estimated_delivery']) : ?>
125
- <?php $dateTime = new DateTime($model->apiResponseData['estimated_delivery']);
126
- $day = $dateTime->format('d');
127
- $weekday = $dateTime->format('l');
128
- $month = $dateTime->format('M');
129
- ?>
130
- <div class="pptrack-v2-est clearfix">
131
- <div class="pptrack-v2-est-day"><?php echo $day ?></div>
132
- <div class="pptrack-v2-est-det">
133
- <div class="pptrack-v2-est-weekday"><?php echo $weekday ?></div>
134
- <div class="pptrack-v2-est-month"><?php echo $month ?></div>
135
- <div class="pptrack-v2-est-status"><?php echo $model->getStatusString() ?></div>
136
- </div>
137
- </div>
138
- <?php else: ?>
139
- <div class="pptrack-v2-est clearfix">
140
- <div class="pptrack-v2-est-status2"><?php echo $model->getStatusString() ?></div>
141
- </div>
142
- <?php endif; ?>
143
- <?php if ($this->trackingType === 1) : ?>
144
- <div class="pptrack-v2-label1"><?php echo Mage::helper('pptrack')->__('Delivery Location:'); ?></div>
145
- <div class="pptrack-v2-value1">
146
- <?php echo $shippingInfo['street'] . ', ' . $shippingInfo['city']; ?>
147
- , <?php echo $shippingInfo['postcode']; ?> <?php echo Mage::app()->getLocale()->getCountryTranslation($shippingInfo['country_id']); ?>
148
- </div>
149
- <?php endif; ?>
150
- <div class="pptrack-v2-label1" style="margin-top:10px;"><?php echo Mage::helper('pptrack')->__('Tracking Number:'); ?></div>
151
- <div class="pptrack-v2-value1"><?php echo $model->getCode(); ?></div>
152
- <div id="pptrack-v2-track-link" onclick="ppShowBack(<?php echo $count ?>)"><?php echo Mage::helper('pptrack')->__('TRACK IT'); ?></div>
153
- </div>
154
- </div>
155
- <div class="pptrack-v2-block pptrack-v2-block-hide-small">
156
- <div class="pptrack-v2-block-inner">
157
- <div class="pptrack-v2-title2"><?php echo Mage::helper('pptrack')->__('STAY IN THE KNOW'); ?></div>
158
- <?php if ($this->trackingType === 1) : ?>
159
- <div class="clearfix" style="margin-top:90px;">
160
- <div class="pptrack-v2-label2"><?php echo Mage::helper('pptrack')->__('Order Number'); ?></div>
161
- <div class="pptrack-v2-value2"><?php echo $model->getOrderNumber(); ?></div>
162
- </div>
163
- <div class="clearfix">
164
- <div class="pptrack-v2-label2"><?php echo Mage::helper('pptrack')->__('Tracking Number'); ?></div>
165
- <div class="pptrack-v2-value2"><?php echo $model->getCode(); ?></div>
166
- </div>
167
- <div class="clearfix">
168
- <div class="pptrack-v2-label2"><?php echo Mage::helper('pptrack')->__('Shipped On'); ?></div>
169
- <div class="pptrack-v2-value2"><?php echo $model->getShippingDate('short'); ?></div>
170
- </div>
171
- <div class="clearfix">
172
- <div class="pptrack-v2-label2"><?php echo Mage::helper('pptrack')->__('Ships To'); ?></div>
173
- <div class="pptrack-v2-value2">
174
- <?php echo $shippingInfo['firstname'] . ' ' . $shippingInfo['lastname']; ?>
175
- <br/><?php echo $shippingInfo['street'] . ', ' . $shippingInfo['city']; ?>
176
- <br/><?php echo $shippingInfo['region'] ? $shippingInfo['region'] . '<br />' : ''; ?><?php echo $shippingInfo['postcode']; ?> <?php echo Mage::app()->getLocale()->getCountryTranslation($shippingInfo['country_id']); ?>
177
- </div>
178
- </div>
179
- <?php endif; ?>
180
- <div class="pptrack-v2-carrier">
181
- <div class="pptrack-v2-carrier-logo">
182
- <img src="<?php echo $model->getCarrierIcon() ?>"/>
183
- <span class="pptrack-v2-carrier-line"></span>
184
- </div>
185
- <div class="pptrack-v2-carrier-name"><?php echo $model->getCarrierName() ?></div>
186
- <div class="pptrack-v2-carrier-det">
187
- <?php
188
- $phone = $model->getCarrierPhone();
189
- $homepage = $model->getCarrierHomepage();
190
- ?>
191
- <?php if ($phone) : ?>
192
- <span><?php echo $phone ?></span><br/>
193
- <?php endif; ?>
194
- <?php if ($homepage) : ?>
195
- <a href="<?php echo $homepage ?>"><?php echo $homepage ?></a>
196
- <?php endif; ?>
197
- </div>
198
- </div>
199
- </div>
200
- </div>
201
- <div class="pptrack-v2-block pptrack-v2-block-hide-small">
202
- <a target="_blank" href="<?php echo $imageLink ? $imageLink : 'javascript:void(0)' ?>" <?php echo $customImage ? 'style="background:url('. $customImage .') no-repeat center center;background-size:cover;"' : '' ?> class="pptrack-v2-block-inner <?php echo $customImage ? '' : 'pptrack-v2-block3-default' ?>"></a>
203
- </div>
204
- </div>
205
- </div>
206
-
207
- <?php endif; ?>
208
- <?php endforeach; ?>
209
-
210
- <script>
211
- function ppShowBack(num) {
212
- document.querySelector("#pptrack-v2-block-track-front" + num).style.display = 'none';
213
- document.querySelector("#pptrack-v2-block-track-back" + num).style.display = 'block';
214
- }
215
- function ppShowFront(num) {
216
- document.querySelector("#pptrack-v2-block-track-back" + num).style.display = 'none';
217
- document.querySelector("#pptrack-v2-block-track-front" + num).style.display = 'block';
218
- }
219
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style>
2
+ @import url(https://fonts.googleapis.com/css?family=Roboto+Slab:400,300,700);
3
+ </style>
4
+
5
+ <?php
6
+ $_helper = $this->helper('catalog/output');
7
+ ?>
8
+
9
+ <?php
10
+ if (Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page')) {
11
+ if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('script'))) {
12
+ $child = $this->getChild("pptrack_script");
13
+ if ($child) {
14
+ echo $this->getChildHtml('pptrack_script');
15
+ }
16
+ }
17
+ if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'), array('ads', 'both'))) {
18
+ $child = $this->getChild("pptrack_ads");
19
+ if ($child) {
20
+ echo $this->getChildHtml('pptrack_ads');
21
+ }
22
+ }
23
+ if (in_array(Mage::getStoreConfig('pp_section_setttings/crosssell/cross_sell_page_type'),
24
+ array('products', 'both'))) {
25
+ $child = $this->getChild("pptrack_crosssell");
26
+ if ($child) {
27
+ $child->setData("orderId", $this->orderId);
28
+ echo $this->getChildHtml('pptrack_crosssell');
29
+ }
30
+ }
31
+ }
32
+ $count = 0;
33
+ $imageType = Mage::getStoreConfig('pp_section_setttings/template/template_image_type');
34
+ $imageLink = Mage::getStoreConfig('pp_section_setttings/template/template_image_link');
35
+ $image = Mage::getStoreConfig('pp_section_setttings/template/template_image');
36
+ $customImage = $imageType === 'custom' && !empty($image) ? Mage::getBaseUrl('media') . 'theme' . DIRECTORY_SEPARATOR . $image : false;
37
+ ?>
38
+
39
+ <div class="clearfix"></div>
40
+ <?php if ($this->trackingType === 1) : ?>
41
+ <h2><?php echo Mage::helper('pptrack')->__('Track your order'); ?></h2>
42
+ <div class="clearfix"></div>
43
+ <form class="pptrack-form pptrack-boxmodel" method="get" action="">
44
+ <div class="pptrack-row">
45
+ <div class="pptrack-form-controls">
46
+ <label class="pptrack-label"
47
+ for="pp_email"><?php echo Mage::helper('pptrack')->__('Your email'); ?></label>
48
+ <input value="<?php echo $this->email ?>" id="pp_email" class="pptrack-input" name="email" type="text"
49
+ required>
50
+ </div>
51
+ <div class="pptrack-form-controls">
52
+ <label class="pptrack-label"
53
+ for="pp_order"><?php echo Mage::helper('pptrack')->__('Order number'); ?></label>
54
+ <input value="<?php echo $this->orderNumber ?>" id="pp_order" class="pptrack-input" name="order"
55
+ type="text" required>
56
+ </div>
57
+ </div>
58
+ <button class="btn button pptrack-btn"
59
+ type="submit"><?php echo Mage::helper('pptrack')->__('Submit'); ?></button>
60
+ </form>
61
+ <?php endif; ?>
62
+ <?php if ($this->msg) : ?>
63
+ <div class="pptrack-info">
64
+ <?php echo $this->msg ?>
65
+ </div>
66
+ <?php endif; ?>
67
+
68
+ <?php foreach ($this->trackModels as $model) : ?>
69
+ <?php
70
+ $count++;
71
+ $shippingInfo = $model->getShippingInfo();
72
+ ?>
73
+ <br>
74
+ <div class="clearfix"></div>
75
+ <?php if (!$model->getStatus()): ?>
76
+ <br>
77
+ <br>
78
+ <h2><?php echo Mage::helper('pptrack')->__('No tracking info!'); ?></h2>
79
+ <br>
80
+ <?php else: ?>
81
+
82
+ <div class="pptrack-wrapper pptrack-v2 pptrack-boxmodel clearfix">
83
+ <div class="pptrack-v2-row clearfix">
84
+ <div id="pptrack-v2-block-track-back<?php echo $count ?>" class="pptrack-v2-block"
85
+ style="display:none;">
86
+ <div class="pptrack-v2-block-inner pptrack-v2-block-inner-res">
87
+ <div class="pptrack-v2-title1"><?php echo Mage::helper('pptrack')->__('ESTIMATED DELIVERY DATE & DETAILS'); ?></div>
88
+ <div class="pptrack-v2-details">
89
+ <?php $details = $model->getDetails(); ?>
90
+ <?php if (!$details) : ?>
91
+ <div class="pptrack-v2-info-row">
92
+ <div class="pptrack-v2-info-row-date">
93
+ <?php echo date("M j", $model->created_at) ?>,
94
+ <?php echo date("H:i:s", $model->created_at) ?>
95
+ </div>
96
+ <div class="pptrack-info-row-details-wrapper">
97
+ <div class="pptrack-v2-info-row-details">
98
+ <?php if ($model->status == Packpin_Pptrack_Model_Track::STATUS_PENDING) : ?>
99
+ <?php echo Mage::helper('pptrack')->__("Package status pending"); ?>
100
+ <?php else : ?>
101
+ <?php echo Mage::helper('pptrack')->__("Package prepared for dispatch"); ?>
102
+ <?php endif; ?>
103
+ </div>
104
+ </div>
105
+ </div>
106
+ <?php else : ?>
107
+ <?php foreach ($details as $detail): ?>
108
+ <div class="pptrack-v2-info-row">
109
+ <div>
110
+ <div class="pptrack-v2-info-row-date">
111
+ <?php echo date("M j", strtotime($detail->getEventDate())); ?>,
112
+ <?php echo $detail->getEventTime(); ?>
113
+ </div>
114
+ <div class="pptrack-v2-info-row-details">
115
+ <?php echo Mage::helper('pptrack')->__($detail->getStatusString()); ?>
116
+ <div
117
+ class="pptrack-v2-info-row-details-location"><?php echo $detail->getLocation() ?></div>
118
+ </div>
119
+ </div>
120
+ </div>
121
+ <?php endforeach; ?>
122
+ <?php endif; ?>
123
+ </div>
124
+ <div id="pptrack-v2-track-link2"
125
+ onclick="ppShowFront(<?php echo $count ?>)"><?php echo Mage::helper('pptrack')->__('BACK'); ?></div>
126
+ </div>
127
+ </div>
128
+ <div id="pptrack-v2-block-track-front<?php echo $count ?>" class="pptrack-v2-block">
129
+ <div class="pptrack-v2-block-inner">
130
+ <div class="pptrack-v2-title1"><?php echo Mage::helper('pptrack')->__('ESTIMATED DELIVERY DATE & DETAILS'); ?></div>
131
+ <?php if ($model->apiResponseData && isset($model->apiResponseData['estimated_delivery']) && $model->apiResponseData['estimated_delivery']) : ?>
132
+ <?php $dateTime = new DateTime($model->apiResponseData['estimated_delivery']);
133
+ $day = $dateTime->format('d');
134
+ $weekday = $dateTime->format('l');
135
+ $month = $dateTime->format('M');
136
+ ?>
137
+ <div class="pptrack-v2-est clearfix">
138
+ <div class="pptrack-v2-est-day"><?php echo $day ?></div>
139
+ <div class="pptrack-v2-est-det">
140
+ <div class="pptrack-v2-est-weekday"><?php echo $weekday ?></div>
141
+ <div class="pptrack-v2-est-month"><?php echo $month ?></div>
142
+ <div class="pptrack-v2-est-status"><?php echo $model->getStatusString() ?></div>
143
+ </div>
144
+ </div>
145
+ <?php else: ?>
146
+ <div class="pptrack-v2-est clearfix">
147
+ <div class="pptrack-v2-est-status2"><?php echo $model->getStatusString() ?></div>
148
+ </div>
149
+ <?php endif; ?>
150
+ <?php if ($this->trackingType === 1) : ?>
151
+ <div class="pptrack-v2-label1"><?php echo Mage::helper('pptrack')->__('Delivery Location:'); ?></div>
152
+ <div class="pptrack-v2-value1">
153
+ <?php echo $shippingInfo['street'] . ', ' . $shippingInfo['city']; ?>
154
+ , <?php echo $shippingInfo['postcode']; ?> <?php echo Mage::app()->getLocale()->getCountryTranslation($shippingInfo['country_id']); ?>
155
+ </div>
156
+ <?php endif; ?>
157
+ <div class="pptrack-v2-label1"
158
+ style="margin-top:10px;"><?php echo Mage::helper('pptrack')->__('Tracking Number:'); ?></div>
159
+ <div class="pptrack-v2-value1"><?php echo $model->getCode(); ?></div>
160
+ <div id="pptrack-v2-track-link"
161
+ onclick="ppShowBack(<?php echo $count ?>)"><?php echo Mage::helper('pptrack')->__('TRACK IT'); ?></div>
162
+ </div>
163
+ </div>
164
+ <div class="pptrack-v2-block pptrack-v2-block-hide-small">
165
+ <div class="pptrack-v2-block-inner">
166
+ <div class="pptrack-v2-title2"><?php echo Mage::helper('pptrack')->__('STAY IN THE KNOW'); ?></div>
167
+ <?php if ($this->trackingType === 1) : ?>
168
+ <div class="clearfix" style="margin-top:40px;">
169
+ <div class="pptrack-v2-label2"><?php echo Mage::helper('pptrack')->__('Order Number'); ?></div>
170
+ <div class="pptrack-v2-value2"><?php echo $model->getOrderNumber(); ?></div>
171
+ </div>
172
+ <div class="clearfix">
173
+ <div class="pptrack-v2-label2"><?php echo Mage::helper('pptrack')->__('Tracking Number'); ?></div>
174
+ <div class="pptrack-v2-value2"
175
+ style="word-wrap: break-word;"><?php echo $model->getCode(); ?></div>
176
+ </div>
177
+ <div class="clearfix">
178
+ <div class="pptrack-v2-label2"><?php echo Mage::helper('pptrack')->__('Shipped On'); ?></div>
179
+ <div class="pptrack-v2-value2"><?php echo $model->getShippingDate('short'); ?></div>
180
+ </div>
181
+ <div class="clearfix">
182
+ <div class="pptrack-v2-label2"><?php echo Mage::helper('pptrack')->__('Ships To'); ?></div>
183
+ <div class="pptrack-v2-value2" style="word-wrap: break-word;">
184
+ <?php echo $shippingInfo['firstname'] . ' ' . $shippingInfo['lastname']; ?>
185
+ <br/><?php echo $shippingInfo['street'] . ', ' . $shippingInfo['city']; ?>
186
+ <br/><?php echo $shippingInfo['region'] ? $shippingInfo['region'] . '<br />' : ''; ?><?php echo $shippingInfo['postcode']; ?> <?php echo Mage::app()->getLocale()->getCountryTranslation($shippingInfo['country_id']); ?>
187
+ </div>
188
+ </div>
189
+ <?php endif; ?>
190
+ <div class="pptrack-v2-carrier">
191
+ <div class="pptrack-v2-carrier-logo">
192
+ <img src="<?php echo $model->getCarrierIcon() ?>"/>
193
+ <span class="pptrack-v2-carrier-line"></span>
194
+ </div>
195
+ <div class="pptrack-v2-carrier-name"><?php echo $model->getCarrierName() ?></div>
196
+ <div class="pptrack-v2-carrier-det">
197
+ <?php
198
+ $phone = $model->getCarrierPhone();
199
+ $homepage = $model->getCarrierHomepage();
200
+ ?>
201
+ <?php if ($phone) : ?>
202
+ <span><?php echo $phone ?></span><br/>
203
+ <?php endif; ?>
204
+ <?php if ($homepage) : ?>
205
+ <a href="<?php echo $homepage ?>"><?php echo $homepage ?></a>
206
+ <?php endif; ?>
207
+ </div>
208
+ </div>
209
+ </div>
210
+ </div>
211
+ <div class="pptrack-v2-block pptrack-v2-block-hide-small">
212
+ <a target="_blank"
213
+ href="<?php echo $imageLink ? $imageLink : 'javascript:void(0)' ?>" <?php echo $customImage ? 'style="background:url(' . $customImage . ') no-repeat center center;background-size:cover;"' : '' ?>
214
+ class="pptrack-v2-block-inner <?php echo $customImage ? '' : 'pptrack-v2-block3-default' ?>"></a>
215
+ </div>
216
+ </div>
217
+ </div>
218
+
219
+ <?php endif; ?>
220
+ <?php endforeach; ?>
221
+
222
+ <script>
223
+ function ppShowBack(num) {
224
+ document.querySelector("#pptrack-v2-block-track-front" + num).style.display = 'none';
225
+ document.querySelector("#pptrack-v2-block-track-back" + num).style.display = 'block';
226
+ }
227
+ function ppShowFront(num) {
228
+ document.querySelector("#pptrack-v2-block-track-back" + num).style.display = 'none';
229
+ document.querySelector("#pptrack-v2-block-track-front" + num).style.display = 'block';
230
+ }
231
+ </script>
232
+
233
+ <?php
234
+ if (version_compare(Mage::getVersion(), '1.9', '<')) { ?>
235
+ <style>
236
+ .pptrack-v2-est-day {
237
+ font-size: 102px;
238
+ }
239
+
240
+ .pptrack-v2-est-weekday {
241
+ font-size: 24px;
242
+ }
243
+
244
+ .pptrack-v2-label2, .pptrack-v2-value2 {
245
+ margin-top: 5px;
246
+ }
247
+
248
+ .pptrack-v2-block-inner {
249
+ height: 540px;
250
+ }
251
+ </style>
252
+ <?php
253
+ }
app/design/frontend/base/default/template/pptrack/popup.phtml CHANGED
@@ -1,29 +1,29 @@
1
- <div class="page-title title-buttons">
2
- <h1><?php echo $this->__('Tracking Information'); ?></h1>
3
- <button class="button" onclick="window.close(); window.opener.focus();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
4
- </div>
5
- <br>
6
- <?php $models = Mage::registry('models'); ?>
7
- <?php if ($models) : ?>
8
- <?php foreach ($models as $trackModel) : ?>
9
- <table class="tracking-table-popup data-table" style="margin-bottom:25px;">
10
- <colgroup><col width="15%">
11
- <col>
12
- </colgroup><tbody>
13
- <tr class="first last odd">
14
- <th class="label"><?php echo $trackModel->getCarrierName() ?>: </th>
15
- <td class="value last"><?php echo $trackModel->getCode() ?></td>
16
- </tr>
17
- </tbody>
18
- </table>
19
- <?php echo $this->getLayout()->createBlock('pptrack/index')->setData(array('model' => $trackModel))->setTemplate('pptrack/index.phtml')->toHtml(); ?>
20
- <div class="clearfix"></div>
21
- <br>
22
- <?php endforeach; ?>
23
- <?php else : ?>
24
- <?php echo $this->getLayout()->createBlock('pptrack/index')->setTemplate('pptrack/index.phtml')->toHtml(); ?>
25
- <?php endif; ?>
26
- <div class="clearfix"></div>
27
- <div class="buttons-set" style="margin-top:20px;">
28
- <button type="button" title="<?php echo $this->__('Close Window') ?>" class="button" onclick="window.close(); window.opener.focus();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
29
- </div>
1
+ <div class="page-title title-buttons">
2
+ <h1><?php echo $this->__('Tracking Information'); ?></h1>
3
+ <button class="button" onclick="window.close(); window.opener.focus();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
4
+ </div>
5
+ <br>
6
+ <?php $models = Mage::registry('models'); ?>
7
+ <?php if ($models) : ?>
8
+ <?php foreach ($models as $trackModel) : ?>
9
+ <table class="tracking-table-popup data-table" style="margin-bottom:25px;">
10
+ <colgroup><col width="15%">
11
+ <col>
12
+ </colgroup><tbody>
13
+ <tr class="first last odd">
14
+ <th class="label"><?php echo $trackModel->getCarrierName() ?>: </th>
15
+ <td class="value last"><?php echo $trackModel->getCode() ?></td>
16
+ </tr>
17
+ </tbody>
18
+ </table>
19
+ <?php echo $this->getLayout()->createBlock('pptrack/index')->setData(array('model' => $trackModel))->setTemplate('pptrack/index.phtml')->toHtml(); ?>
20
+ <div class="clearfix"></div>
21
+ <br>
22
+ <?php endforeach; ?>
23
+ <?php else : ?>
24
+ <?php echo $this->getLayout()->createBlock('pptrack/index')->setTemplate('pptrack/index.phtml')->toHtml(); ?>
25
+ <?php endif; ?>
26
+ <div class="clearfix"></div>
27
+ <div class="buttons-set" style="margin-top:20px;">
28
+ <button type="button" title="<?php echo $this->__('Close Window') ?>" class="button" onclick="window.close(); window.opener.focus();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
29
+ </div>
app/design/frontend/base/default/template/pptrack/script.phtml CHANGED
@@ -1 +1 @@
1
- <?php echo $this->getScript(); ?>
1
+ <?php echo $this->getScript(); ?>
app/design/frontend/base/default/template/pptrack/unsubscribe.phtml CHANGED
File without changes
app/etc/modules/Packpin_Pptrack.xml CHANGED
@@ -1,10 +1,10 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Packpin_Pptrack>
5
- <active>true</active>
6
- <codePool>community</codePool>
7
- <version>1.7.1</version>
8
- </Packpin_Pptrack>
9
- </modules>
10
  </config>
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Packpin_Pptrack>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <version>1.7.2</version>
8
+ </Packpin_Pptrack>
9
+ </modules>
10
  </config>
app/locale/de_DE/Packpin_Pptrack.csv CHANGED
@@ -1,39 +1,39 @@
1
- "Total tracks","Total tracks"
2
- "Unique sessions","Unique sessions"
3
- "More Details","More Details"
4
- "Visits Generated","Visits Generated"
5
- "Shipments Tracked","Shipments Tracked"
6
- "Packpin Stats","Packpin Stats"
7
- "----- Packpin carriers -----","----- Packpin-Boten -----"
8
- "Select All","Alle markieren"
9
- "Unselect All","Keine markieren"
10
- "Packpin Notifications","Packpin Nachrichten"
11
- "Packpin Notification Settings","Einstellungen der Packpin nachrichten"
12
- "Shipment status","Sendungsstatus"
13
- "You have successfully unsubscribed from package status updates","Sie haben die Aktualisierung des Sendungsstatus erfolgreich abbestellt"
14
- "Subscription not found or already unsubscribed!","Abbonement nicht gefunden oder wurde von Ihnen abbestellt"
15
- "Tracking info not found!","Verfolgungsinformation nicht gefunden"
16
- "Unsubscribe","Newsletter abbestellen"
17
- "You have to enter API key before saving config!","Geben Sie ihr Kennwort ein, um die Änderungen zu speichern!"
18
- "Error sending data to API","Fehler beim Senden die Daten zur API"
19
- "Your temporary API key has expired!","Vorübergehendes Kennwort ist nicht mehr gültig"
20
- "Your temporary API key will expire in","Die Gültigkeit ihres temporäres Kennworts endet in"
21
- "%s days","%s dag(en)"
22
- "While waiting, we have something for you. Check offerings bellow:","Während der Wartezeit haben wir etwas für Sie. Die Angebote weiter unten:"
23
- "Add to Cart","In den Warenkorb"
24
- "Shipped By","Absender"
25
- "Tracking Number","Sendungsnummer"
26
- "Track your item","Sendungsverfolgung"
27
- "No tracking info!","Keine Verfolgungsinformation vorhanden!"
28
- "Shipment Information","Sendungsinformation"
29
- "Dispatched","Versant"
30
- "In Transit","Unterwegs"
31
- "Out for delivery","In Zustellung"
32
- "Delivered","Zugestellt"
33
- "Tracking Info","Verfolgungsinformation"
34
- "Package prepared for dispatch","Die Sendung liegt für den Versand bereit"
35
- "Order number","Bestellungsnummer"
36
- "Tracking code","Verfolgungs-Code"
37
- "Shipped on","Versandt am"
38
- "Ships to","Versand nach"
39
- "For questions regarding your shipment contact carrier directly","Für weitere Fragen kontaktieren Sie bitte den Boten"
1
+ "Total tracks","Total tracks"
2
+ "Unique sessions","Unique sessions"
3
+ "More Details","More Details"
4
+ "Visits Generated","Visits Generated"
5
+ "Shipments Tracked","Shipments Tracked"
6
+ "Packpin Stats","Packpin Stats"
7
+ "----- Packpin carriers -----","----- Packpin-Boten -----"
8
+ "Select All","Alle markieren"
9
+ "Unselect All","Keine markieren"
10
+ "Packpin Notifications","Packpin Nachrichten"
11
+ "Packpin Notification Settings","Einstellungen der Packpin nachrichten"
12
+ "Shipment status","Sendungsstatus"
13
+ "You have successfully unsubscribed from package status updates","Sie haben die Aktualisierung des Sendungsstatus erfolgreich abbestellt"
14
+ "Subscription not found or already unsubscribed!","Abbonement nicht gefunden oder wurde von Ihnen abbestellt"
15
+ "Tracking info not found!","Verfolgungsinformation nicht gefunden"
16
+ "Unsubscribe","Newsletter abbestellen"
17
+ "You have to enter API key before saving config!","Geben Sie ihr Kennwort ein, um die Änderungen zu speichern!"
18
+ "Error sending data to API","Fehler beim Senden die Daten zur API"
19
+ "Your temporary API key has expired!","Vorübergehendes Kennwort ist nicht mehr gültig"
20
+ "Your temporary API key will expire in","Die Gültigkeit ihres temporäres Kennworts endet in"
21
+ "%s days","%s dag(en)"
22
+ "While waiting, we have something for you. Check offerings bellow:","Während der Wartezeit haben wir etwas für Sie. Die Angebote weiter unten:"
23
+ "Add to Cart","In den Warenkorb"
24
+ "Shipped By","Absender"
25
+ "Tracking Number","Sendungsnummer"
26
+ "Track your item","Sendungsverfolgung"
27
+ "No tracking info!","Keine Verfolgungsinformation vorhanden!"
28
+ "Shipment Information","Sendungsinformation"
29
+ "Dispatched","Versant"
30
+ "In Transit","Unterwegs"
31
+ "Out for delivery","In Zustellung"
32
+ "Delivered","Zugestellt"
33
+ "Tracking Info","Verfolgungsinformation"
34
+ "Package prepared for dispatch","Die Sendung liegt für den Versand bereit"
35
+ "Order number","Bestellungsnummer"
36
+ "Tracking code","Verfolgungs-Code"
37
+ "Shipped on","Versandt am"
38
+ "Ships to","Versand nach"
39
+ "For questions regarding your shipment contact carrier directly","Für weitere Fragen kontaktieren Sie bitte den Boten"
app/locale/en_US/Packpin_Pptrack.csv CHANGED
@@ -1,39 +1,39 @@
1
- "Total tracks","Total tracks"
2
- "Unique sessions","Unique sessions"
3
- "More Details","More Details"
4
- "Visits Generated","Visits Generated"
5
- "Shipments Tracked","Shipments Tracked"
6
- "Packpin Stats","Packpin Stats"
7
- "----- Packpin carriers -----","----- Packpin carriers -----"
8
- "Select All","Select All"
9
- "Unselect All","Unselect All"
10
- "Packpin Notifications","Packpin Notifications"
11
- "Packpin Notification Settings","Packpin Notification Settings"
12
- "Shipment status","Shipment status"
13
- "You have successfully unsubscribed from package status updates","You have successfully unsubscribed from package status updates"
14
- "Subscription not found or already unsubscribed!","Subscription not found or already unsubscribed!"
15
- "Tracking info not found!","Tracking info not found!"
16
- "Unsubscribe","Unsubscribe"
17
- "You have to enter API key before saving config!","You have to enter API key before saving config!"
18
- "Error sending data to API","Error sending data to API"
19
- "Your temporary API key has expired!","Your temporary API key has expired!"
20
- "Your temporary API key will expire in","Your temporary API key will expire in"
21
- "%s days","%s days"
22
- "While waiting, we have something for you. Check offerings bellow:","While waiting, we have something for you. Check offerings bellow:"
23
- "Add to Cart","Add to Cart"
24
- "Shipped By","Shipped By"
25
- "Tracking Number","Tracking Number"
26
- "Track your item","Track your item"
27
- "No tracking info!","No tracking info!"
28
- "Shipment Information","Shipment Information"
29
- "Dispatched","Dispatched"
30
- "In Transit","In Transit"
31
- "Out for delivery","Out for delivery"
32
- "Delivered","Delivered"
33
- "Tracking Info","Tracking Info"
34
- "Package prepared for dispatch","Package prepared for dispatch"
35
- "Order number","Order number"
36
- "Tracking code","Tracking code"
37
- "Shipped on","Shipped on"
38
- "Ships to","Ships to"
39
- "For questions regarding your shipment contact carrier directly","For questions regarding your shipment contact carrier directly"
1
+ "Total tracks","Total tracks"
2
+ "Unique sessions","Unique sessions"
3
+ "More Details","More Details"
4
+ "Visits Generated","Visits Generated"
5
+ "Shipments Tracked","Shipments Tracked"
6
+ "Packpin Stats","Packpin Stats"
7
+ "----- Packpin carriers -----","----- Packpin carriers -----"
8
+ "Select All","Select All"
9
+ "Unselect All","Unselect All"
10
+ "Packpin Notifications","Packpin Notifications"
11
+ "Packpin Notification Settings","Packpin Notification Settings"
12
+ "Shipment status","Shipment status"
13
+ "You have successfully unsubscribed from package status updates","You have successfully unsubscribed from package status updates"
14
+ "Subscription not found or already unsubscribed!","Subscription not found or already unsubscribed!"
15
+ "Tracking info not found!","Tracking info not found!"
16
+ "Unsubscribe","Unsubscribe"
17
+ "You have to enter API key before saving config!","You have to enter API key before saving config!"
18
+ "Error sending data to API","Error sending data to API"
19
+ "Your temporary API key has expired!","Your temporary API key has expired!"
20
+ "Your temporary API key will expire in","Your temporary API key will expire in"
21
+ "%s days","%s days"
22
+ "While waiting, we have something for you. Check offerings bellow:","While waiting, we have something for you. Check offerings bellow:"
23
+ "Add to Cart","Add to Cart"
24
+ "Shipped By","Shipped By"
25
+ "Tracking Number","Tracking Number"
26
+ "Track your item","Track your item"
27
+ "No tracking info!","No tracking info!"
28
+ "Shipment Information","Shipment Information"
29
+ "Dispatched","Dispatched"
30
+ "In Transit","In Transit"
31
+ "Out for delivery","Out for delivery"
32
+ "Delivered","Delivered"
33
+ "Tracking Info","Tracking Info"
34
+ "Package prepared for dispatch","Package prepared for dispatch"
35
+ "Order number","Order number"
36
+ "Tracking code","Tracking code"
37
+ "Shipped on","Shipped on"
38
+ "Ships to","Ships to"
39
+ "For questions regarding your shipment contact carrier directly","For questions regarding your shipment contact carrier directly"
app/locale/en_US/template/email/packpin/packpin_delivered_email.html CHANGED
@@ -1,87 +1,87 @@
1
- <!--@subject Order shipment status has been updated. @-->
2
- <!DOCTYPE html>
3
- <html>
4
- <head>
5
- <meta charset="utf-8">
6
- <style>
7
- @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
8
- </style>
9
- </head>
10
- <body style="background:#ebebeb;">
11
- <div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
12
- <div style="background:#ececed;">
13
- <a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
14
- <img
15
- {{if logo_width}}
16
- width="{{var logo_width}}"
17
- {{else}}
18
- width="auto"
19
- {{/if}}
20
- {{if logo_height}}
21
- height="{{var logo_height}}"
22
- {{else}}
23
- height="35"
24
- {{/if}}
25
- style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
26
- </a>
27
- <div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
28
- YOUR PACKAGE STATUS HAS BEEN UPDATED!
29
- </div>
30
- {{var banner}}
31
- {{var crossSell}}
32
- <fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
33
- <legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
34
- <table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
35
- <tr>
36
- <td valign="top" style="text-align:left;font-weight:600">
37
- Order number:
38
- </td>
39
- <td valign="top" style="text-align:left;font-weight:400">
40
- {{var track.getOrderNumber()}}
41
- </td>
42
- <td valign="top" style="text-align:left;font-weight:600">
43
- Carrier:
44
- </td>
45
- <td valign="top" style="text-align:left;font-weight:400">
46
- {{var track.getCarrierName()}}
47
- </td>
48
- </tr>
49
- <tr>
50
- <td valign="top" style="text-align:left;font-weight:600">
51
- </td>
52
- <td valign="top" style="text-align:left;font-weight:400">
53
- </td>
54
- <td valign="top" style="text-align:left;font-weight:600">
55
- Tracking number:
56
- </td>
57
- <td valign="top" style="text-align:left;font-weight:400">
58
- {{var track.getCode()}}
59
- </td>
60
- </tr>
61
- <tr>
62
- <td>&nbsp;</td>
63
- </tr>
64
- <tr>
65
- <td valign="top" colspan="2" style="text-align:left;line-height:15px;">
66
- If you have questions regarding shipment,
67
- <br>
68
- please contact carrier direcly.
69
- </td>
70
- <td valign="top" colspan="2">
71
- <a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
72
- SEE FULL TRACKING INFO
73
- </a>
74
- </td>
75
- </tr>
76
- </table>
77
- </fieldset>
78
- </div>
79
- <div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
80
- This email was sent to {{var email}}
81
- <br>
82
- No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
83
- </div>
84
- </div>
85
-
86
- </body>
87
  </html>
1
+ <!--@subject Order shipment status has been updated. @-->
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <style>
7
+ @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
8
+ </style>
9
+ </head>
10
+ <body style="background:#ebebeb;">
11
+ <div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
12
+ <div style="background:#ececed;">
13
+ <a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
14
+ <img
15
+ {{if logo_width}}
16
+ width="{{var logo_width}}"
17
+ {{else}}
18
+ width="auto"
19
+ {{/if}}
20
+ {{if logo_height}}
21
+ height="{{var logo_height}}"
22
+ {{else}}
23
+ height="35"
24
+ {{/if}}
25
+ style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
26
+ </a>
27
+ <div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
28
+ YOUR PACKAGE STATUS HAS BEEN UPDATED!
29
+ </div>
30
+ {{var banner}}
31
+ {{var crossSell}}
32
+ <fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
33
+ <legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
34
+ <table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
35
+ <tr>
36
+ <td valign="top" style="text-align:left;font-weight:600">
37
+ Order number:
38
+ </td>
39
+ <td valign="top" style="text-align:left;font-weight:400">
40
+ {{var track.getOrderNumber()}}
41
+ </td>
42
+ <td valign="top" style="text-align:left;font-weight:600">
43
+ Carrier:
44
+ </td>
45
+ <td valign="top" style="text-align:left;font-weight:400">
46
+ {{var track.getCarrierName()}}
47
+ </td>
48
+ </tr>
49
+ <tr>
50
+ <td valign="top" style="text-align:left;font-weight:600">
51
+ </td>
52
+ <td valign="top" style="text-align:left;font-weight:400">
53
+ </td>
54
+ <td valign="top" style="text-align:left;font-weight:600">
55
+ Tracking number:
56
+ </td>
57
+ <td valign="top" style="text-align:left;font-weight:400">
58
+ {{var track.getCode()}}
59
+ </td>
60
+ </tr>
61
+ <tr>
62
+ <td>&nbsp;</td>
63
+ </tr>
64
+ <tr>
65
+ <td valign="top" colspan="2" style="text-align:left;line-height:15px;">
66
+ If you have questions regarding shipment,
67
+ <br>
68
+ please contact carrier direcly.
69
+ </td>
70
+ <td valign="top" colspan="2">
71
+ <a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
72
+ SEE FULL TRACKING INFO
73
+ </a>
74
+ </td>
75
+ </tr>
76
+ </table>
77
+ </fieldset>
78
+ </div>
79
+ <div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
80
+ This email was sent to {{var email}}
81
+ <br>
82
+ No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
83
+ </div>
84
+ </div>
85
+
86
+ </body>
87
  </html>
app/locale/en_US/template/email/packpin/packpin_exception_email.html CHANGED
@@ -1,87 +1,87 @@
1
- <!--@subject Order shipment status has been updated. @-->
2
- <!DOCTYPE html>
3
- <html>
4
- <head>
5
- <meta charset="utf-8">
6
- <style>
7
- @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
8
- </style>
9
- </head>
10
- <body style="background:#ebebeb;">
11
- <div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
12
- <div style="background:#ececed;">
13
- <a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
14
- <img
15
- {{if logo_width}}
16
- width="{{var logo_width}}"
17
- {{else}}
18
- width="auto"
19
- {{/if}}
20
- {{if logo_height}}
21
- height="{{var logo_height}}"
22
- {{else}}
23
- height="35"
24
- {{/if}}
25
- style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
26
- </a>
27
- <div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
28
- YOUR PACKAGE STATUS HAS BEEN UPDATED!
29
- </div>
30
- {{var banner}}
31
- {{var crossSell}}
32
- <fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
33
- <legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
34
- <table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
35
- <tr>
36
- <td valign="top" style="text-align:left;font-weight:600">
37
- Order number:
38
- </td>
39
- <td valign="top" style="text-align:left;font-weight:400">
40
- {{var track.getOrderNumber()}}
41
- </td>
42
- <td valign="top" style="text-align:left;font-weight:600">
43
- Carrier:
44
- </td>
45
- <td valign="top" style="text-align:left;font-weight:400">
46
- {{var track.getCarrierName()}}
47
- </td>
48
- </tr>
49
- <tr>
50
- <td valign="top" style="text-align:left;font-weight:600">
51
- </td>
52
- <td valign="top" style="text-align:left;font-weight:400">
53
- </td>
54
- <td valign="top" style="text-align:left;font-weight:600">
55
- Tracking number:
56
- </td>
57
- <td valign="top" style="text-align:left;font-weight:400">
58
- {{var track.getCode()}}
59
- </td>
60
- </tr>
61
- <tr>
62
- <td>&nbsp;</td>
63
- </tr>
64
- <tr>
65
- <td valign="top" colspan="2" style="text-align:left;line-height:15px;">
66
- If you have questions regarding shipment,
67
- <br>
68
- please contact carrier direcly.
69
- </td>
70
- <td valign="top" colspan="2">
71
- <a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
72
- SEE FULL TRACKING INFO
73
- </a>
74
- </td>
75
- </tr>
76
- </table>
77
- </fieldset>
78
- </div>
79
- <div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
80
- This email was sent to {{var email}}
81
- <br>
82
- No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
83
- </div>
84
- </div>
85
-
86
- </body>
87
  </html>
1
+ <!--@subject Order shipment status has been updated. @-->
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <style>
7
+ @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
8
+ </style>
9
+ </head>
10
+ <body style="background:#ebebeb;">
11
+ <div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
12
+ <div style="background:#ececed;">
13
+ <a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
14
+ <img
15
+ {{if logo_width}}
16
+ width="{{var logo_width}}"
17
+ {{else}}
18
+ width="auto"
19
+ {{/if}}
20
+ {{if logo_height}}
21
+ height="{{var logo_height}}"
22
+ {{else}}
23
+ height="35"
24
+ {{/if}}
25
+ style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
26
+ </a>
27
+ <div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
28
+ YOUR PACKAGE STATUS HAS BEEN UPDATED!
29
+ </div>
30
+ {{var banner}}
31
+ {{var crossSell}}
32
+ <fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
33
+ <legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
34
+ <table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
35
+ <tr>
36
+ <td valign="top" style="text-align:left;font-weight:600">
37
+ Order number:
38
+ </td>
39
+ <td valign="top" style="text-align:left;font-weight:400">
40
+ {{var track.getOrderNumber()}}
41
+ </td>
42
+ <td valign="top" style="text-align:left;font-weight:600">
43
+ Carrier:
44
+ </td>
45
+ <td valign="top" style="text-align:left;font-weight:400">
46
+ {{var track.getCarrierName()}}
47
+ </td>
48
+ </tr>
49
+ <tr>
50
+ <td valign="top" style="text-align:left;font-weight:600">
51
+ </td>
52
+ <td valign="top" style="text-align:left;font-weight:400">
53
+ </td>
54
+ <td valign="top" style="text-align:left;font-weight:600">
55
+ Tracking number:
56
+ </td>
57
+ <td valign="top" style="text-align:left;font-weight:400">
58
+ {{var track.getCode()}}
59
+ </td>
60
+ </tr>
61
+ <tr>
62
+ <td>&nbsp;</td>
63
+ </tr>
64
+ <tr>
65
+ <td valign="top" colspan="2" style="text-align:left;line-height:15px;">
66
+ If you have questions regarding shipment,
67
+ <br>
68
+ please contact carrier direcly.
69
+ </td>
70
+ <td valign="top" colspan="2">
71
+ <a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
72
+ SEE FULL TRACKING INFO
73
+ </a>
74
+ </td>
75
+ </tr>
76
+ </table>
77
+ </fieldset>
78
+ </div>
79
+ <div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
80
+ This email was sent to {{var email}}
81
+ <br>
82
+ No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
83
+ </div>
84
+ </div>
85
+
86
+ </body>
87
  </html>
app/locale/en_US/template/email/packpin/packpin_failed_attempt_email.html CHANGED
@@ -1,87 +1,87 @@
1
- <!--@subject Order shipment status has been updated. @-->
2
- <!DOCTYPE html>
3
- <html>
4
- <head>
5
- <meta charset="utf-8">
6
- <style>
7
- @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
8
- </style>
9
- </head>
10
- <body style="background:#ebebeb;">
11
- <div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
12
- <div style="background:#ececed;">
13
- <a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
14
- <img
15
- {{if logo_width}}
16
- width="{{var logo_width}}"
17
- {{else}}
18
- width="auto"
19
- {{/if}}
20
- {{if logo_height}}
21
- height="{{var logo_height}}"
22
- {{else}}
23
- height="35"
24
- {{/if}}
25
- style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
26
- </a>
27
- <div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
28
- YOUR PACKAGE STATUS HAS BEEN UPDATED!
29
- </div>
30
- {{var banner}}
31
- {{var crossSell}}
32
- <fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
33
- <legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
34
- <table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
35
- <tr>
36
- <td valign="top" style="text-align:left;font-weight:600">
37
- Order number:
38
- </td>
39
- <td valign="top" style="text-align:left;font-weight:400">
40
- {{var track.getOrderNumber()}}
41
- </td>
42
- <td valign="top" style="text-align:left;font-weight:600">
43
- Carrier:
44
- </td>
45
- <td valign="top" style="text-align:left;font-weight:400">
46
- {{var track.getCarrierName()}}
47
- </td>
48
- </tr>
49
- <tr>
50
- <td valign="top" style="text-align:left;font-weight:600">
51
- </td>
52
- <td valign="top" style="text-align:left;font-weight:400">
53
- </td>
54
- <td valign="top" style="text-align:left;font-weight:600">
55
- Tracking number:
56
- </td>
57
- <td valign="top" style="text-align:left;font-weight:400">
58
- {{var track.getCode()}}
59
- </td>
60
- </tr>
61
- <tr>
62
- <td>&nbsp;</td>
63
- </tr>
64
- <tr>
65
- <td valign="top" colspan="2" style="text-align:left;line-height:15px;">
66
- If you have questions regarding shipment,
67
- <br>
68
- please contact carrier direcly.
69
- </td>
70
- <td valign="top" colspan="2">
71
- <a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
72
- SEE FULL TRACKING INFO
73
- </a>
74
- </td>
75
- </tr>
76
- </table>
77
- </fieldset>
78
- </div>
79
- <div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
80
- This email was sent to {{var email}}
81
- <br>
82
- No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
83
- </div>
84
- </div>
85
-
86
- </body>
87
  </html>
1
+ <!--@subject Order shipment status has been updated. @-->
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <style>
7
+ @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
8
+ </style>
9
+ </head>
10
+ <body style="background:#ebebeb;">
11
+ <div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
12
+ <div style="background:#ececed;">
13
+ <a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
14
+ <img
15
+ {{if logo_width}}
16
+ width="{{var logo_width}}"
17
+ {{else}}
18
+ width="auto"
19
+ {{/if}}
20
+ {{if logo_height}}
21
+ height="{{var logo_height}}"
22
+ {{else}}
23
+ height="35"
24
+ {{/if}}
25
+ style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
26
+ </a>
27
+ <div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
28
+ YOUR PACKAGE STATUS HAS BEEN UPDATED!
29
+ </div>
30
+ {{var banner}}
31
+ {{var crossSell}}
32
+ <fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
33
+ <legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
34
+ <table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
35
+ <tr>
36
+ <td valign="top" style="text-align:left;font-weight:600">
37
+ Order number:
38
+ </td>
39
+ <td valign="top" style="text-align:left;font-weight:400">
40
+ {{var track.getOrderNumber()}}
41
+ </td>
42
+ <td valign="top" style="text-align:left;font-weight:600">
43
+ Carrier:
44
+ </td>
45
+ <td valign="top" style="text-align:left;font-weight:400">
46
+ {{var track.getCarrierName()}}
47
+ </td>
48
+ </tr>
49
+ <tr>
50
+ <td valign="top" style="text-align:left;font-weight:600">
51
+ </td>
52
+ <td valign="top" style="text-align:left;font-weight:400">
53
+ </td>
54
+ <td valign="top" style="text-align:left;font-weight:600">
55
+ Tracking number:
56
+ </td>
57
+ <td valign="top" style="text-align:left;font-weight:400">
58
+ {{var track.getCode()}}
59
+ </td>
60
+ </tr>
61
+ <tr>
62
+ <td>&nbsp;</td>
63
+ </tr>
64
+ <tr>
65
+ <td valign="top" colspan="2" style="text-align:left;line-height:15px;">
66
+ If you have questions regarding shipment,
67
+ <br>
68
+ please contact carrier direcly.
69
+ </td>
70
+ <td valign="top" colspan="2">
71
+ <a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
72
+ SEE FULL TRACKING INFO
73
+ </a>
74
+ </td>
75
+ </tr>
76
+ </table>
77
+ </fieldset>
78
+ </div>
79
+ <div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
80
+ This email was sent to {{var email}}
81
+ <br>
82
+ No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
83
+ </div>
84
+ </div>
85
+
86
+ </body>
87
  </html>
app/locale/en_US/template/email/packpin/packpin_in_transit_email.html CHANGED
@@ -1,87 +1,87 @@
1
- <!--@subject Order shipment status has been updated. @-->
2
- <!DOCTYPE html>
3
- <html>
4
- <head>
5
- <meta charset="utf-8">
6
- <style>
7
- @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
8
- </style>
9
- </head>
10
- <body style="background:#ebebeb;">
11
- <div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
12
- <div style="background:#ececed;">
13
- <a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
14
- <img
15
- {{if logo_width}}
16
- width="{{var logo_width}}"
17
- {{else}}
18
- width="auto"
19
- {{/if}}
20
- {{if logo_height}}
21
- height="{{var logo_height}}"
22
- {{else}}
23
- height="35"
24
- {{/if}}
25
- style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
26
- </a>
27
- <div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
28
- YOUR PACKAGE STATUS HAS BEEN UPDATED!
29
- </div>
30
- {{var banner}}
31
- {{var crossSell}}
32
- <fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
33
- <legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
34
- <table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
35
- <tr>
36
- <td valign="top" style="text-align:left;font-weight:600">
37
- Order number:
38
- </td>
39
- <td valign="top" style="text-align:left;font-weight:400">
40
- {{var track.getOrderNumber()}}
41
- </td>
42
- <td valign="top" style="text-align:left;font-weight:600">
43
- Carrier:
44
- </td>
45
- <td valign="top" style="text-align:left;font-weight:400">
46
- {{var track.getCarrierName()}}
47
- </td>
48
- </tr>
49
- <tr>
50
- <td valign="top" style="text-align:left;font-weight:600">
51
- </td>
52
- <td valign="top" style="text-align:left;font-weight:400">
53
- </td>
54
- <td valign="top" style="text-align:left;font-weight:600">
55
- Tracking number:
56
- </td>
57
- <td valign="top" style="text-align:left;font-weight:400">
58
- {{var track.getCode()}}
59
- </td>
60
- </tr>
61
- <tr>
62
- <td>&nbsp;</td>
63
- </tr>
64
- <tr>
65
- <td valign="top" colspan="2" style="text-align:left;line-height:15px;">
66
- If you have questions regarding shipment,
67
- <br>
68
- please contact carrier direcly.
69
- </td>
70
- <td valign="top" colspan="2">
71
- <a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
72
- SEE FULL TRACKING INFO
73
- </a>
74
- </td>
75
- </tr>
76
- </table>
77
- </fieldset>
78
- </div>
79
- <div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
80
- This email was sent to {{var email}}
81
- <br>
82
- No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
83
- </div>
84
- </div>
85
-
86
- </body>
87
  </html>
1
+ <!--@subject Order shipment status has been updated. @-->
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <style>
7
+ @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
8
+ </style>
9
+ </head>
10
+ <body style="background:#ebebeb;">
11
+ <div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
12
+ <div style="background:#ececed;">
13
+ <a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
14
+ <img
15
+ {{if logo_width}}
16
+ width="{{var logo_width}}"
17
+ {{else}}
18
+ width="auto"
19
+ {{/if}}
20
+ {{if logo_height}}
21
+ height="{{var logo_height}}"
22
+ {{else}}
23
+ height="35"
24
+ {{/if}}
25
+ style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
26
+ </a>
27
+ <div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
28
+ YOUR PACKAGE STATUS HAS BEEN UPDATED!
29
+ </div>
30
+ {{var banner}}
31
+ {{var crossSell}}
32
+ <fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
33
+ <legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
34
+ <table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
35
+ <tr>
36
+ <td valign="top" style="text-align:left;font-weight:600">
37
+ Order number:
38
+ </td>
39
+ <td valign="top" style="text-align:left;font-weight:400">
40
+ {{var track.getOrderNumber()}}
41
+ </td>
42
+ <td valign="top" style="text-align:left;font-weight:600">
43
+ Carrier:
44
+ </td>
45
+ <td valign="top" style="text-align:left;font-weight:400">
46
+ {{var track.getCarrierName()}}
47
+ </td>
48
+ </tr>
49
+ <tr>
50
+ <td valign="top" style="text-align:left;font-weight:600">
51
+ </td>
52
+ <td valign="top" style="text-align:left;font-weight:400">
53
+ </td>
54
+ <td valign="top" style="text-align:left;font-weight:600">
55
+ Tracking number:
56
+ </td>
57
+ <td valign="top" style="text-align:left;font-weight:400">
58
+ {{var track.getCode()}}
59
+ </td>
60
+ </tr>
61
+ <tr>
62
+ <td>&nbsp;</td>
63
+ </tr>
64
+ <tr>
65
+ <td valign="top" colspan="2" style="text-align:left;line-height:15px;">
66
+ If you have questions regarding shipment,
67
+ <br>
68
+ please contact carrier direcly.
69
+ </td>
70
+ <td valign="top" colspan="2">
71
+ <a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
72
+ SEE FULL TRACKING INFO
73
+ </a>
74
+ </td>
75
+ </tr>
76
+ </table>
77
+ </fieldset>
78
+ </div>
79
+ <div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
80
+ This email was sent to {{var email}}
81
+ <br>
82
+ No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
83
+ </div>
84
+ </div>
85
+
86
+ </body>
87
  </html>
app/locale/en_US/template/email/packpin/packpin_info_received_email.html CHANGED
@@ -1,87 +1,87 @@
1
- <!--@subject Order shipment status has been updated. @-->
2
- <!DOCTYPE html>
3
- <html>
4
- <head>
5
- <meta charset="utf-8">
6
- <style>
7
- @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
8
- </style>
9
- </head>
10
- <body style="background:#ebebeb;">
11
- <div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
12
- <div style="background:#ececed;">
13
- <a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
14
- <img
15
- {{if logo_width}}
16
- width="{{var logo_width}}"
17
- {{else}}
18
- width="auto"
19
- {{/if}}
20
- {{if logo_height}}
21
- height="{{var logo_height}}"
22
- {{else}}
23
- height="35"
24
- {{/if}}
25
- style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
26
- </a>
27
- <div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
28
- YOUR PACKAGE STATUS HAS BEEN UPDATED!
29
- </div>
30
- {{var banner}}
31
- {{var crossSell}}
32
- <fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
33
- <legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
34
- <table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
35
- <tr>
36
- <td valign="top" style="text-align:left;font-weight:600">
37
- Order number:
38
- </td>
39
- <td valign="top" style="text-align:left;font-weight:400">
40
- {{var track.getOrderNumber()}}
41
- </td>
42
- <td valign="top" style="text-align:left;font-weight:600">
43
- Carrier:
44
- </td>
45
- <td valign="top" style="text-align:left;font-weight:400">
46
- {{var track.getCarrierName()}}
47
- </td>
48
- </tr>
49
- <tr>
50
- <td valign="top" style="text-align:left;font-weight:600">
51
- </td>
52
- <td valign="top" style="text-align:left;font-weight:400">
53
- </td>
54
- <td valign="top" style="text-align:left;font-weight:600">
55
- Tracking number:
56
- </td>
57
- <td valign="top" style="text-align:left;font-weight:400">
58
- {{var track.getCode()}}
59
- </td>
60
- </tr>
61
- <tr>
62
- <td>&nbsp;</td>
63
- </tr>
64
- <tr>
65
- <td valign="top" colspan="2" style="text-align:left;line-height:15px;">
66
- If you have questions regarding shipment,
67
- <br>
68
- please contact carrier direcly.
69
- </td>
70
- <td valign="top" colspan="2">
71
- <a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
72
- SEE FULL TRACKING INFO
73
- </a>
74
- </td>
75
- </tr>
76
- </table>
77
- </fieldset>
78
- </div>
79
- <div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
80
- This email was sent to {{var email}}
81
- <br>
82
- No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
83
- </div>
84
- </div>
85
-
86
- </body>
87
  </html>
1
+ <!--@subject Order shipment status has been updated. @-->
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <style>
7
+ @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
8
+ </style>
9
+ </head>
10
+ <body style="background:#ebebeb;">
11
+ <div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
12
+ <div style="background:#ececed;">
13
+ <a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
14
+ <img
15
+ {{if logo_width}}
16
+ width="{{var logo_width}}"
17
+ {{else}}
18
+ width="auto"
19
+ {{/if}}
20
+ {{if logo_height}}
21
+ height="{{var logo_height}}"
22
+ {{else}}
23
+ height="35"
24
+ {{/if}}
25
+ style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
26
+ </a>
27
+ <div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
28
+ YOUR PACKAGE STATUS HAS BEEN UPDATED!
29
+ </div>
30
+ {{var banner}}
31
+ {{var crossSell}}
32
+ <fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
33
+ <legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
34
+ <table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
35
+ <tr>
36
+ <td valign="top" style="text-align:left;font-weight:600">
37
+ Order number:
38
+ </td>
39
+ <td valign="top" style="text-align:left;font-weight:400">
40
+ {{var track.getOrderNumber()}}
41
+ </td>
42
+ <td valign="top" style="text-align:left;font-weight:600">
43
+ Carrier:
44
+ </td>
45
+ <td valign="top" style="text-align:left;font-weight:400">
46
+ {{var track.getCarrierName()}}
47
+ </td>
48
+ </tr>
49
+ <tr>
50
+ <td valign="top" style="text-align:left;font-weight:600">
51
+ </td>
52
+ <td valign="top" style="text-align:left;font-weight:400">
53
+ </td>
54
+ <td valign="top" style="text-align:left;font-weight:600">
55
+ Tracking number:
56
+ </td>
57
+ <td valign="top" style="text-align:left;font-weight:400">
58
+ {{var track.getCode()}}
59
+ </td>
60
+ </tr>
61
+ <tr>
62
+ <td>&nbsp;</td>
63
+ </tr>
64
+ <tr>
65
+ <td valign="top" colspan="2" style="text-align:left;line-height:15px;">
66
+ If you have questions regarding shipment,
67
+ <br>
68
+ please contact carrier direcly.
69
+ </td>
70
+ <td valign="top" colspan="2">
71
+ <a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
72
+ SEE FULL TRACKING INFO
73
+ </a>
74
+ </td>
75
+ </tr>
76
+ </table>
77
+ </fieldset>
78
+ </div>
79
+ <div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
80
+ This email was sent to {{var email}}
81
+ <br>
82
+ No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
83
+ </div>
84
+ </div>
85
+
86
+ </body>
87
  </html>
app/locale/en_US/template/email/packpin/packpin_out_for_delivery_email.html CHANGED
@@ -1,87 +1,87 @@
1
- <!--@subject Order shipment status has been updated. @-->
2
- <!DOCTYPE html>
3
- <html>
4
- <head>
5
- <meta charset="utf-8">
6
- <style>
7
- @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
8
- </style>
9
- </head>
10
- <body style="background:#ebebeb;">
11
- <div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
12
- <div style="background:#ececed;">
13
- <a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
14
- <img
15
- {{if logo_width}}
16
- width="{{var logo_width}}"
17
- {{else}}
18
- width="auto"
19
- {{/if}}
20
- {{if logo_height}}
21
- height="{{var logo_height}}"
22
- {{else}}
23
- height="35"
24
- {{/if}}
25
- style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
26
- </a>
27
- <div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
28
- YOUR PACKAGE STATUS HAS BEEN UPDATED!
29
- </div>
30
- {{var banner}}
31
- {{var crossSell}}
32
- <fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
33
- <legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
34
- <table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
35
- <tr>
36
- <td valign="top" style="text-align:left;font-weight:600">
37
- Order number:
38
- </td>
39
- <td valign="top" style="text-align:left;font-weight:400">
40
- {{var track.getOrderNumber()}}
41
- </td>
42
- <td valign="top" style="text-align:left;font-weight:600">
43
- Carrier:
44
- </td>
45
- <td valign="top" style="text-align:left;font-weight:400">
46
- {{var track.getCarrierName()}}
47
- </td>
48
- </tr>
49
- <tr>
50
- <td valign="top" style="text-align:left;font-weight:600">
51
- </td>
52
- <td valign="top" style="text-align:left;font-weight:400">
53
- </td>
54
- <td valign="top" style="text-align:left;font-weight:600">
55
- Tracking number:
56
- </td>
57
- <td valign="top" style="text-align:left;font-weight:400">
58
- {{var track.getCode()}}
59
- </td>
60
- </tr>
61
- <tr>
62
- <td>&nbsp;</td>
63
- </tr>
64
- <tr>
65
- <td valign="top" colspan="2" style="text-align:left;line-height:15px;">
66
- If you have questions regarding shipment,
67
- <br>
68
- please contact carrier direcly.
69
- </td>
70
- <td valign="top" colspan="2">
71
- <a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
72
- SEE FULL TRACKING INFO
73
- </a>
74
- </td>
75
- </tr>
76
- </table>
77
- </fieldset>
78
- </div>
79
- <div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
80
- This email was sent to {{var email}}
81
- <br>
82
- No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
83
- </div>
84
- </div>
85
-
86
- </body>
87
  </html>
1
+ <!--@subject Order shipment status has been updated. @-->
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <style>
7
+ @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=latin,latin-ext);
8
+ </style>
9
+ </head>
10
+ <body style="background:#ebebeb;">
11
+ <div style="max-width:600px;margin-top:10px;margin-right:auto;margin-bottom:0;margin-left:auto;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;background:#ffffff;font-family:'Open Sans',sans-serif;color:#333333;">
12
+ <div style="background:#ececed;">
13
+ <a style="display:block;text-decoration:none;text-align:center;padding-top:26px;padding-bottom:20px;padding-left:10px;padding-right:10px;" href="{{store url=""}}">
14
+ <img
15
+ {{if logo_width}}
16
+ width="{{var logo_width}}"
17
+ {{else}}
18
+ width="auto"
19
+ {{/if}}
20
+ {{if logo_height}}
21
+ height="{{var logo_height}}"
22
+ {{else}}
23
+ height="35"
24
+ {{/if}}
25
+ style="max-width:100%;" src="{{var logo_url}}" alt="{{var logo_alt}}" border="0"/>
26
+ </a>
27
+ <div style="font-size:18px;font-weight:700;text-align:center;padding-left:10px;padding-right:10px;">
28
+ YOUR PACKAGE STATUS HAS BEEN UPDATED!
29
+ </div>
30
+ {{var banner}}
31
+ {{var crossSell}}
32
+ <fieldset style="margin-top:20px;border-left-style:none;border-right-style:none;border-bottom-style:none;margin-left:10px;margin-right:10px;">
33
+ <legend style="font-size:14px;">YOUR PACKAGE INFORMATION</legend>
34
+ <table style="font-size:12px;margin-top:15px;line-height:20px;" border="0" cellspacing="0" cellpadding="0" width="100%;">
35
+ <tr>
36
+ <td valign="top" style="text-align:left;font-weight:600">
37
+ Order number:
38
+ </td>
39
+ <td valign="top" style="text-align:left;font-weight:400">
40
+ {{var track.getOrderNumber()}}
41
+ </td>
42
+ <td valign="top" style="text-align:left;font-weight:600">
43
+ Carrier:
44
+ </td>
45
+ <td valign="top" style="text-align:left;font-weight:400">
46
+ {{var track.getCarrierName()}}
47
+ </td>
48
+ </tr>
49
+ <tr>
50
+ <td valign="top" style="text-align:left;font-weight:600">
51
+ </td>
52
+ <td valign="top" style="text-align:left;font-weight:400">
53
+ </td>
54
+ <td valign="top" style="text-align:left;font-weight:600">
55
+ Tracking number:
56
+ </td>
57
+ <td valign="top" style="text-align:left;font-weight:400">
58
+ {{var track.getCode()}}
59
+ </td>
60
+ </tr>
61
+ <tr>
62
+ <td>&nbsp;</td>
63
+ </tr>
64
+ <tr>
65
+ <td valign="top" colspan="2" style="text-align:left;line-height:15px;">
66
+ If you have questions regarding shipment,
67
+ <br>
68
+ please contact carrier direcly.
69
+ </td>
70
+ <td valign="top" colspan="2">
71
+ <a style="white-space:nowrap;display:block;padding-top:2px;padding-bottom:2px;padding-left:7px;padding-right:7px;text-decoration:none;color:#ffffff;background-color:#484950;font-size:11px;text-align:center;" href="{{var track.getDetailsUrl()}}">
72
+ SEE FULL TRACKING INFO
73
+ </a>
74
+ </td>
75
+ </tr>
76
+ </table>
77
+ </fieldset>
78
+ </div>
79
+ <div style="background:#c1c1c1;font-size:11px;line-height:15px;text-align:center;font-size:11px;padding-top:5px;padding-bottom:5px;">
80
+ This email was sent to {{var email}}
81
+ <br>
82
+ No longer wish to be notified about your shipment? <a style="text-decoration:underline;color:#333333;" href="{{var track.getUnsubscribeLink()}}">Unsubscribe</a>
83
+ </div>
84
+ </div>
85
+
86
+ </body>
87
  </html>
app/locale/es_ES/Packpin_Pptrack.csv CHANGED
@@ -1,39 +1,39 @@
1
- "Total tracks","Total tracks"
2
- "Unique sessions","Unique sessions"
3
- "More Details","More Details"
4
- "Visits Generated","Visits Generated"
5
- "Shipments Tracked","Shipments Tracked"
6
- "Packpin Stats","Packpin Stats"
7
- "----- Packpin carriers -----","----- Packpin carriers -----"
8
- "Select All","Seleccionar todo"
9
- "Unselect All","Deseleccionar todo"
10
- "Packpin Notifications","Packpin notificaciones"
11
- "Packpin Notification Settings","Ajustes de Packpin notificaciones"
12
- "Shipment status","Estado del envío"
13
- "You have successfully unsubscribed from package status updates","Usted ha anulado su suscripción a las actualizaciones del estado del envío"
14
- "Subscription not found or already unsubscribed!","Suscripción no encontrada o anulada!"
15
- "Tracking info not found!","Información de seguimiento no encontrada!"
16
- "Unsubscribe","Darse de baja"
17
- "You have to enter API key before saving config!","Se debe entrar la clave de API para guardar configuración!"
18
- "Error sending data to API","Error al enviar datos a API"
19
- "Your temporary API key has expired!","Su clave API temporal ha caducado!"
20
- "Your temporary API key will expire in","Su clave API temporal caducará en"
21
- "%s days","%s días"
22
- "While waiting, we have something for you. Check offerings bellow:","Mientras espere, tenemos algo para usted. Mire las ofertas:"
23
- "Add to Cart","Añadir a cesta"
24
- "Shipped By","Enviado por"
25
- "Tracking Number","Número de seguimiento"
26
- "Track your item","Seguir su artículo"
27
- "No tracking info!","No hay información de seguimiento!"
28
- "Shipment Information","Información de envío"
29
- "Dispatched","Enviado"
30
- "In Transit","En tránsito"
31
- "Out for delivery","Por entregar"
32
- "Delivered","Entregado"
33
- "Tracking Info","Información de seguimiento"
34
- "Package prepared for dispatch","Paquete preparado para enviar"
35
- "Order number","Número del pedido"
36
- "Tracking code","Código de seguimiento"
37
- "Shipped on","Enviado el (fecha)"
38
- "Ships to","Se puede enviar a"
39
- "For questions regarding your shipment contact carrier directly","Si tiene preguntas sobre el envío, contacte al transportista directamente"
1
+ "Total tracks","Total tracks"
2
+ "Unique sessions","Unique sessions"
3
+ "More Details","More Details"
4
+ "Visits Generated","Visits Generated"
5
+ "Shipments Tracked","Shipments Tracked"
6
+ "Packpin Stats","Packpin Stats"
7
+ "----- Packpin carriers -----","----- Packpin carriers -----"
8
+ "Select All","Seleccionar todo"
9
+ "Unselect All","Deseleccionar todo"
10
+ "Packpin Notifications","Packpin notificaciones"
11
+ "Packpin Notification Settings","Ajustes de Packpin notificaciones"
12
+ "Shipment status","Estado del envío"
13
+ "You have successfully unsubscribed from package status updates","Usted ha anulado su suscripción a las actualizaciones del estado del envío"
14
+ "Subscription not found or already unsubscribed!","Suscripción no encontrada o anulada!"
15
+ "Tracking info not found!","Información de seguimiento no encontrada!"
16
+ "Unsubscribe","Darse de baja"
17
+ "You have to enter API key before saving config!","Se debe entrar la clave de API para guardar configuración!"
18
+ "Error sending data to API","Error al enviar datos a API"
19
+ "Your temporary API key has expired!","Su clave API temporal ha caducado!"
20
+ "Your temporary API key will expire in","Su clave API temporal caducará en"
21
+ "%s days","%s días"
22
+ "While waiting, we have something for you. Check offerings bellow:","Mientras espere, tenemos algo para usted. Mire las ofertas:"
23
+ "Add to Cart","Añadir a cesta"
24
+ "Shipped By","Enviado por"
25
+ "Tracking Number","Número de seguimiento"
26
+ "Track your item","Seguir su artículo"
27
+ "No tracking info!","No hay información de seguimiento!"
28
+ "Shipment Information","Información de envío"
29
+ "Dispatched","Enviado"
30
+ "In Transit","En tránsito"
31
+ "Out for delivery","Por entregar"
32
+ "Delivered","Entregado"
33
+ "Tracking Info","Información de seguimiento"
34
+ "Package prepared for dispatch","Paquete preparado para enviar"
35
+ "Order number","Número del pedido"
36
+ "Tracking code","Código de seguimiento"
37
+ "Shipped on","Enviado el (fecha)"
38
+ "Ships to","Se puede enviar a"
39
+ "For questions regarding your shipment contact carrier directly","Si tiene preguntas sobre el envío, contacte al transportista directamente"
app/locale/nl_NL/Packpin_Pptrack.csv CHANGED
@@ -1,39 +1,39 @@
1
- "Total tracks","Total tracks"
2
- "Unique sessions","Unieke sessies"
3
- "More Details","Meer informatie"
4
- "Visits Generated","Gegenereerde bezoeken"
5
- "Shipments Tracked","Getraceerde verzendingen"
6
- "Packpin Stats","Packpin Statistieken"
7
- "----- Packpin carriers -----","----- Packpin Vervoerders -----"
8
- "Select All","Alles Aanvinken"
9
- "Unselect All","Alles Uitvinken"
10
- "Packpin Notifications","Packpin Meldingen"
11
- "Packpin Notification Settings","Packpin Meldingen Instellingen"
12
- "Shipment status","Status Verzending"
13
- "You have successfully unsubscribed from package status updates","U heeft zich nu uitgeschreven van Packpin status updates"
14
- "Subscription not found or already unsubscribed!","Uw gegevens zijn niet gevonden, of u heeft zich al uitgeschreven!"
15
- "Tracking info not found!","Verzendinformatie niet gevonden!"
16
- "Unsubscribe","Uitschrijven"
17
- "You have to enter API key before saving config!","U moet uw API sleutel invoeren voordat u deze instellingen opslaat"
18
- "Error sending data to API","Er is een fout opgetreden bij het verzenden van informatie naar de API"
19
- "Your temporary API key has expired!","Uw tijdelijke API sleutel is verlopen"
20
- "Your temporary API key will expire in","Uw tijdelijke API sleutel verloopt over"
21
- "%s days","%s dag(en)"
22
- "While waiting, we have something for you. Check offerings bellow:","Terwijl u wacht hebben we iets voor u. Bekijk het volgende aanbod:"
23
- "Add to Cart","Aan winkelwagen toevoegen"
24
- "Shipped By","Verzonden Door"
25
- "Tracking Number","Volgnummer Verzending"
26
- "Track your item","Volg uw verzending"
27
- "No tracking info!","Geen verzendinformatie gevonden!"
28
- "Shipment Information","Verzendinformatie"
29
- "Dispatched","Vrijgegeven"
30
- "In Transit","Op Tussenstation"
31
- "Out for delivery","Onderweg naar bezorgadres"
32
- "Delivered","Bezorgd"
33
- "Tracking Info","Volg Informatie"
34
- "Package prepared for dispatch","Pakket Klaar voor Bezorging"
35
- "Order number","Ordernummer"
36
- "Tracking code","Volgnummer"
37
- "Shipped on","Verzonden op"
38
- "Ships to","Verzonden naar"
39
- "For questions regarding your shipment contact carrier directly","Voor vragen met betrekking tot uw verzending vragen wij u contact op te nemen met het verzendbedrijf"
1
+ "Total tracks","Total tracks"
2
+ "Unique sessions","Unieke sessies"
3
+ "More Details","Meer informatie"
4
+ "Visits Generated","Gegenereerde bezoeken"
5
+ "Shipments Tracked","Getraceerde verzendingen"
6
+ "Packpin Stats","Packpin Statistieken"
7
+ "----- Packpin carriers -----","----- Packpin Vervoerders -----"
8
+ "Select All","Alles Aanvinken"
9
+ "Unselect All","Alles Uitvinken"
10
+ "Packpin Notifications","Packpin Meldingen"
11
+ "Packpin Notification Settings","Packpin Meldingen Instellingen"
12
+ "Shipment status","Status Verzending"
13
+ "You have successfully unsubscribed from package status updates","U heeft zich nu uitgeschreven van Packpin status updates"
14
+ "Subscription not found or already unsubscribed!","Uw gegevens zijn niet gevonden, of u heeft zich al uitgeschreven!"
15
+ "Tracking info not found!","Verzendinformatie niet gevonden!"
16
+ "Unsubscribe","Uitschrijven"
17
+ "You have to enter API key before saving config!","U moet uw API sleutel invoeren voordat u deze instellingen opslaat"
18
+ "Error sending data to API","Er is een fout opgetreden bij het verzenden van informatie naar de API"
19
+ "Your temporary API key has expired!","Uw tijdelijke API sleutel is verlopen"
20
+ "Your temporary API key will expire in","Uw tijdelijke API sleutel verloopt over"
21
+ "%s days","%s dag(en)"
22
+ "While waiting, we have something for you. Check offerings bellow:","Terwijl u wacht hebben we iets voor u. Bekijk het volgende aanbod:"
23
+ "Add to Cart","Aan winkelwagen toevoegen"
24
+ "Shipped By","Verzonden Door"
25
+ "Tracking Number","Volgnummer Verzending"
26
+ "Track your item","Volg uw verzending"
27
+ "No tracking info!","Geen verzendinformatie gevonden!"
28
+ "Shipment Information","Verzendinformatie"
29
+ "Dispatched","Vrijgegeven"
30
+ "In Transit","Op Tussenstation"
31
+ "Out for delivery","Onderweg naar bezorgadres"
32
+ "Delivered","Bezorgd"
33
+ "Tracking Info","Volg Informatie"
34
+ "Package prepared for dispatch","Pakket Klaar voor Bezorging"
35
+ "Order number","Ordernummer"
36
+ "Tracking code","Volgnummer"
37
+ "Shipped on","Verzonden op"
38
+ "Ships to","Verzonden naar"
39
+ "For questions regarding your shipment contact carrier directly","Voor vragen met betrekking tot uw verzending vragen wij u contact op te nemen met het verzendbedrijf"
app/locale/pt_PT/Packpin_Pptrack.csv CHANGED
@@ -1,39 +1,39 @@
1
- "Total tracks","Total tracks"
2
- "Unique sessions","Unique sessions"
3
- "More Details","More Details"
4
- "Visits Generated","Visits Generated"
5
- "Shipments Tracked","Shipments Tracked"
6
- "Packpin Stats","Packpin Stats"
7
- "----- Packpin carriers -----","----- Packpin carriers -----"
8
- "Select All","Seleccionar todos"
9
- "Unselect All","Desseleccionar todos"
10
- "Packpin Notifications","Packpin Notifications"
11
- "Packpin Notification Settings","Packpin Notification Settings"
12
- "Shipment status","Estado do envio"
13
- "You have successfully unsubscribed from package status updates","Você cancelou as actualizações de estado de encomenda"
14
- "Subscription not found or already unsubscribed!","Inscrição não foi encontrada ou já foi cancelada!"
15
- "Tracking info not found!","Informação de localização não encontrada!"
16
- "Unsubscribe","Anular inscrição"
17
- "You have to enter API key before saving config!","Você tem de introduzir a chave API antes de salvar as configurações"
18
- "Error sending data to API","Erro de envio de dados para API"
19
- "Your temporary API key has expired!","A sua chave API temporária expirou!"
20
- "Your temporary API key will expire in","A sua chave API vai expirar em"
21
- "%s days","%s days"
22
- "While waiting, we have something for you. Check offerings bellow:","Enquanto espera nós temos algo para si. Verifique as ofertas abaixo:"
23
- "Add to Cart","Adicionar ao carrinho"
24
- "Shipped By","Enviado por"
25
- "Tracking Number","Número para localização"
26
- "Track your item","Localize o seu item"
27
- "No tracking info!","Sem informação de localização!"
28
- "Shipment Information","Informação do despacho"
29
- "Dispatched","Postado"
30
- "In Transit","Em trânsito"
31
- "Out for delivery","Expedido para entrega"
32
- "Delivered","Entregue"
33
- "Tracking Info","Informação de localização"
34
- "Package prepared for dispatch","Encomenda preparada para expedição"
35
- "Order number","Número de pedido"
36
- "Tracking code","Código de localização"
37
- "Shipped on","Enviado"
38
- "Ships to","Envios para"
39
- "For questions regarding your shipment contact carrier directly","Para questões relacionadas com o seu envio contacte directamente a sua transportadora"
1
+ "Total tracks","Total tracks"
2
+ "Unique sessions","Unique sessions"
3
+ "More Details","More Details"
4
+ "Visits Generated","Visits Generated"
5
+ "Shipments Tracked","Shipments Tracked"
6
+ "Packpin Stats","Packpin Stats"
7
+ "----- Packpin carriers -----","----- Packpin carriers -----"
8
+ "Select All","Seleccionar todos"
9
+ "Unselect All","Desseleccionar todos"
10
+ "Packpin Notifications","Packpin Notifications"
11
+ "Packpin Notification Settings","Packpin Notification Settings"
12
+ "Shipment status","Estado do envio"
13
+ "You have successfully unsubscribed from package status updates","Você cancelou as actualizações de estado de encomenda"
14
+ "Subscription not found or already unsubscribed!","Inscrição não foi encontrada ou já foi cancelada!"
15
+ "Tracking info not found!","Informação de localização não encontrada!"
16
+ "Unsubscribe","Anular inscrição"
17
+ "You have to enter API key before saving config!","Você tem de introduzir a chave API antes de salvar as configurações"
18
+ "Error sending data to API","Erro de envio de dados para API"
19
+ "Your temporary API key has expired!","A sua chave API temporária expirou!"
20
+ "Your temporary API key will expire in","A sua chave API vai expirar em"
21
+ "%s days","%s days"
22
+ "While waiting, we have something for you. Check offerings bellow:","Enquanto espera nós temos algo para si. Verifique as ofertas abaixo:"
23
+ "Add to Cart","Adicionar ao carrinho"
24
+ "Shipped By","Enviado por"
25
+ "Tracking Number","Número para localização"
26
+ "Track your item","Localize o seu item"
27
+ "No tracking info!","Sem informação de localização!"
28
+ "Shipment Information","Informação do despacho"
29
+ "Dispatched","Postado"
30
+ "In Transit","Em trânsito"
31
+ "Out for delivery","Expedido para entrega"
32
+ "Delivered","Entregue"
33
+ "Tracking Info","Informação de localização"
34
+ "Package prepared for dispatch","Encomenda preparada para expedição"
35
+ "Order number","Número de pedido"
36
+ "Tracking code","Código de localização"
37
+ "Shipped on","Enviado"
38
+ "Ships to","Envios para"
39
+ "For questions regarding your shipment contact carrier directly","Para questões relacionadas com o seu envio contacte directamente a sua transportadora"
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Packpin_Pptrack</name>
4
- <version>1.7.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/gpl-license.php">GNU General Public License (GPL)</license>
7
  <channel>community</channel>
@@ -20,9 +20,9 @@ Packpin created shipment tracking and cross selling solution within email notifi
20
  - Easy 10 minutes installation.</description>
21
  <notes>Fixed issue where estimated delivery date was displayed incorrectly</notes>
22
  <authors><author><name>Packpin Packpin</name><user>packpin</user><email>info@packpin.com</email></author></authors>
23
- <date>2016-06-30</date>
24
- <time>16:53:32</time>
25
- <contents><target name="magecommunity"><dir name="Packpin"><dir name="Pptrack"><dir name="Block"><dir name="Adminhtml"><file name="Dashboard.php" hash="920d24633d790843d7262d194984a4d2"/><dir name="Sales"><dir name="Order"><dir name="Shipment"><dir name="Create"><file name="Tracking.php" hash="616b55c4a6d34e63e70df593b0db228d"/></dir><dir name="View"><file name="Tracking.php" hash="9a2caca0e7aeeef3c5e4cdd8db18a0bd"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint-owner.php" hash="3f3029efceb1d0e1c8f37f08aa21a371"/><file name="Hint.php" hash="c4dff2072bfda0f7e380fa81485d4ab3"/><file name="Scripts.php" hash="cc9b7d5c648a742d75601da4753e85a8"/></dir><dir name="Form"><dir name="Fieldset"><file name="Carrier.php" hash="39e5dbca24ca0e2a6126b8073fa554fa"/></dir></dir></dir></dir><dir name="Tracks"><dir name="Edit"><file name="Form.php" hash="bb8dec319616ac5e0bb649655f6157ba"/></dir><file name="Edit.php" hash="b1295a8eae49bcfb67f939ccb566c986"/><file name="Grid.php" hash="27a72f977e2a9c668f9dd66d29e62937"/></dir><file name="Tracks.php" hash="32ac885537dc7ce3b35671e353d25abe"/></dir><file name="Ads.php" hash="a446e608892e7d05060b32137db1f03c"/><file name="Crosssell.php" hash="254965744ef4259867383f27ab7bdb13"/><file name="Index.php" hash="9c9dd7229b2df3604b3e0a6dc39157e7"/><file name="Script.php" hash="d5a454b4ec9f08300e2056ef2d89da0c"/><file name="Trackings.php" hash="3ca3418bcc566ee1a00b3c2e2265114e"/></dir><dir name="Helper"><file name="Data.php" hash="946412f35a12cc7c3be52e8407184235"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Crossviews.php" hash="351f19d3a8fb2909c617441d90a7f944"/><file name="Crossviewspage.php" hash="1e3958a9c934eb3ba27c38515cf10d5e"/><file name="Templateimage.php" hash="6f92da5eaae483c45c5b89c8a61d3244"/><file name="Templatetype.php" hash="85d87baf75bf628d1761f7fe8ce2dcee"/></dir></dir></dir></dir><file name="Api.php" hash="9844dad347d95f010e8ad6d612fae74f"/><file name="Carrier.php" hash="b0d3d77bd69e52160aae165ea660a62f"/><file name="EnableNotifications.php" hash="5c0e3b122acc8d0216ee078fcefd9d50"/><file name="Observer.php" hash="0b4113c403564203ddf2d7bf830932ca"/><dir name="Order"><file name="Shipment.php" hash="9ee3a28f2bb41fef2434d2a556d08a1f"/></dir><dir name="Resource"><dir name="Carrier"><file name="Collection.php" hash="ca3d8884d9a1d9a1dbb4c36cffd931e1"/></dir><file name="Carrier.php" hash="6ea29fe6b81b3f150ea683316654299b"/><dir name="Setting"><file name="Collection.php" hash="30e53e9dc4973fec4f0e6bd68f29412d"/></dir><file name="Setting.php" hash="dff1ce85bebf8e48c64a7653d5c8ac4e"/><dir name="Track"><file name="Collection.php" hash="360902f340284bd6e37a79955b0265b9"/></dir><file name="Track.php" hash="043618746031d58f437d8f6864f344ba"/><dir name="Trackdetail"><file name="Collection.php" hash="34749cd437737d3fef0181e6a2d4adaf"/></dir><file name="Trackdetail.php" hash="b6ecc039ed80366e3cc969645d57a7cf"/><dir name="Trackunsubscribed"><file name="Collection.php" hash="b15d2d83f287dbabbce646f12902cc39"/></dir><file name="Trackunsubscribed.php" hash="1b3d6508bb8e93c4272224bba1106b6a"/><dir name="Visit"><file name="Collection.php" hash="5b9a70fb53daece2efd716c6193d5794"/></dir><file name="Visit.php" hash="c8474419b1298b1c9989d781a0b44fd5"/></dir><file name="Setting.php" hash="ec277f1b93dbb4f4e271d39cccd3424d"/><file name="Track.php" hash="17ba62001cebe8e210a5dd50df7468d8"/><file name="Trackdetail.php" hash="b385925f9770f84ce9a98f6af2baa0b6"/><file name="Trackunsubscribed.php" hash="9fa077052e8c1e6cc9d92fbead95b5b6"/><file name="Translate.php" hash="9f1887b6969ddedb551fee93452839e8"/><file name="Visit.php" hash="73af7da05602b349f3edf1a841274c92"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="PackpintracksController.php" hash="a0535a604ed2782c9e58d4933a9f8445"/><file name="PpnotificationsController.php" hash="6e838648091201e517c1982ed13a0318"/></dir><file name="IndexController.php" hash="6f85dc709b23f5d36027562e1bddc32a"/><file name="UnsubscribeController.php" hash="df56f68d860aba0724ab2206e10e3266"/></dir><dir name="data"><dir name="pptrack_setup"><file name="data-upgrade-0.1.5-1.1.0.php" hash="fc015f14bf96711532b08ee447254e80"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="9d0afe8b7348803af05fd6cbdd8666c2"/><file name="api.xml" hash="7b3b9aca175d02617293b2833bf72e26"/><file name="config.xml" hash="c666ba1c9bffec89aed07b6125f75775"/><file name="system.xml" hash="4885fbcdc9ec95185c65dfdee44422ea"/></dir><dir name="sql"><dir name="pptrack_setup"><file name="mysql4-install-0.1.2.php" hash="51665242241e4cf49ef1c3d0c03e9bbd"/><file name="mysql4-upgrade-0.1.2-0.1.5.php" hash="48c7400eceaaed4a7395697362289cab"/><file name="mysql4-upgrade-0.1.5-1.3.0.php" hash="82848914065e9549d21c44fd19cef3d3"/><file name="mysql4-upgrade-0.3.0-1.5.5.php" hash="efb4d41d21be9be1e44f57f6ca0e57b9"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="pptrack.xml" hash="2f28a7e93ac5390235b9a9e6c8fd6c1a"/></dir><dir name="template"><dir name="pptrack"><file name="ads.phtml" hash="1fdd498f350d6482e233dfd9b6dc8227"/><file name="ads_email.phtml" hash="8e513589d31ecf120155022e3d623432"/><file name="crosssell.phtml" hash="8e180d67c2df0da3437be1fbc1f96b97"/><file name="crosssell_email.phtml" hash="e7363c178d6e8d50bc2f49ba4e78a8b2"/><dir name="email"><dir name="order"><dir name="shipment"><file name="track.phtml" hash="c73ad2f9e8f9a4f788bf8e3149d2c75b"/></dir></dir></dir><file name="index.phtml" hash="e7cad3679ec48072a82cf77171e4be1e"/><file name="index_new.phtml" hash="d12925d0ba87e233cb4b16ecb1440228"/><file name="index_v2.phtml" hash="955044bdd4ab93fa4514869a8e2d96b9"/><file name="popup.phtml" hash="fc6d4a9cb9dccc2e5bbf716f90cab8ff"/><file name="script.phtml" hash="a90b9e61aa2550a3b4cbf7c6e57c3a05"/><file name="unsubscribe.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="pptrack.xml" hash="677b2cfae47ab3c30cd6b8d2a23b8aa2"/></dir><dir name="template"><dir name="pptrack"><dir name="dashboard"><file name="index.phtml" hash="0b02b9768ba6e5743453a93903f3cf05"/><file name="packpin.phtml" hash="641727a031613c7d6486371b57580b86"/></dir><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="fb57796c9ddd69c3e5075d326957ab29"/><file name="scripts.phtml" hash="4e831a7157a41cf6c7585b06d2d41540"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Packpin_Pptrack.xml" hash="bc89771d1118c9545a3de42756f79fda"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="pptrack.css" hash="37b50c86df54bd7b3affbddb4afe94cf"/></dir><dir name="images"><dir name="pptrack"><file name="bulletIcon.png" hash="15f6fd65c7a62f940b7d17b9186a2b35"/><file name="checkedIcon.png" hash="cef38265bdd7675a0497a2296f5b7332"/><file name="postnlLogo.png" hash="3b4595ba4262c574c1147ed39e862092"/><file name="trackingStatus.png" hash="6dcf522f4e22b69bb25c3b3c199bb464"/><file name="truck.png" hash="3eb50f750a0fefa1903613e0bc26a2ee"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="pptrack"><dir name="css"><file name="dashboard.css" hash="4343c79f6bd24b14004f2a5c8723021d"/><file name="pptrack.css" hash="4fedcc9501a7474cef1341a339456868"/></dir><dir name="images"><file name="mg_template1_o.png" hash="ffa5396781b7d1188a7be8d8d60af495"/><file name="mg_template2_o.png" hash="a459c74db32b4a05072051b9d9bb932c"/><file name="pp_logo1.png" hash="1a79f10d0f028271ac0b2646243e39d1"/></dir><dir name="js"><file name="dashboard.js" hash="bbc739e9b13ba6bb6f309e464b8817b8"/><file name="pptrack.js" hash="7bc0ee636b3b83484fc3b9348863bd22"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="packpin"><file name="packpin_delivered_email.html" hash="b8fbabbb6633d214752ae49d289bb2a1"/><file name="packpin_exception_email.html" hash="8cf8461838af3b8c9ce2c74b8ea4765f"/><file name="packpin_failed_attempt_email.html" hash="8cf8461838af3b8c9ce2c74b8ea4765f"/><file name="packpin_in_transit_email.html" hash="8cf8461838af3b8c9ce2c74b8ea4765f"/><file name="packpin_info_received_email.html" hash="8cf8461838af3b8c9ce2c74b8ea4765f"/><file name="packpin_out_for_delivery_email.html" hash="8cf8461838af3b8c9ce2c74b8ea4765f"/></dir></dir></dir><file name="Packpin_Pptrack.csv" hash="de614713c9a1e184f303eb38284b5ca9"/></dir><dir name="es_ES"><file name="Packpin_Pptrack.csv" hash="42b28f85af8c85568b670dc9f1e5bc65"/></dir><dir name="de_DE"><file name="Packpin_Pptrack.csv" hash="0e0f4cdf6e51bc74fcb017adebe667bd"/></dir><dir name="nl_NL"><file name="Packpin_Pptrack.csv" hash="94baa20e1a27e1856f27206bdf88f53e"/></dir><dir name="pt_PT"><file name="Packpin_Pptrack.csv" hash="f46682dd7dd5abbe788895b942985658"/></dir></target></contents>
26
  <compatible/>
27
  <dependencies><required><php><min>5.2.13</min><max>5.7.0</max></php></required></dependencies>
28
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Packpin_Pptrack</name>
4
+ <version>1.7.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/gpl-license.php">GNU General Public License (GPL)</license>
7
  <channel>community</channel>
20
  - Easy 10 minutes installation.</description>
21
  <notes>Fixed issue where estimated delivery date was displayed incorrectly</notes>
22
  <authors><author><name>Packpin Packpin</name><user>packpin</user><email>info@packpin.com</email></author></authors>
23
+ <date>2016-12-02</date>
24
+ <time>12:07:11</time>
25
+ <contents><target name="magecommunity"><dir name="Packpin"><dir name="Pptrack"><dir name="Block"><dir name="Adminhtml"><file name="Dashboard.php" hash="98e5af0b3aba902beb4bf1c65b27113e"/><dir name="Sales"><dir name="Order"><dir name="Shipment"><dir name="Create"><file name="Tracking.php" hash="1b38e83ca0aee989764fe3a7d0cf1bac"/></dir><dir name="View"><file name="Tracking.php" hash="401f134f83a17d7d6cf9f0d8ede13ec8"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="c961a7b4cd0ce5d7b8024a2996262028"/><file name="Scripts.php" hash="79d629b135d51296ee0ba3e3a805ba5f"/></dir><dir name="Form"><dir name="Fieldset"><file name="Carrier.php" hash="8dcd2c2fbfbd6eb5938f06e537c939e3"/></dir></dir></dir></dir><dir name="Tracks"><dir name="Edit"><file name="Form.php" hash="556852017b6608fef3997cea97c069df"/></dir><file name="Edit.php" hash="b623cd711954618b9cc6d26af85791b3"/><file name="Grid.php" hash="663ffc50c29fa8cc8ca34bfbb10928da"/></dir><file name="Tracks.php" hash="b0f5a7507dfb3e1425ca9a85d262cf5f"/></dir><file name="Ads.php" hash="aa56b07b8771fb94b9bd11a95aa4e872"/><file name="Crosssell.php" hash="6c6a9ea8e913e79930efdcd9af6c7829"/><file name="Index.php" hash="0da225c33353af49c081a3cd5967c5a8"/><file name="Script.php" hash="f7f9d2f660f958e4e4448f88c860d91c"/><file name="Trackings.php" hash="94b741604e1ab5e77afd516c3fa0b5c2"/></dir><dir name="Helper"><file name="Data.php" hash="645eb60a1cabc30310d94a472d82ca08"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Crossviews.php" hash="2f353f1eca123be3d5d6628cd6fec9bc"/><file name="Crossviewspage.php" hash="c28db6e0df790fd0f0cd521d31340618"/><file name="Templateimage.php" hash="caf1774770632cba2d1c352a8ea14777"/><file name="Templatetype.php" hash="57f65cf498c58dca0cf7976460078b29"/></dir></dir></dir></dir><file name="Api.php" hash="88d205736602d9f9cf839d3cf487be5c"/><file name="Carrier.php" hash="11ce349a0436963eca6ce10bb0f05b91"/><file name="EnableNotifications.php" hash="989324234904a700f3bd0c529d35789e"/><file name="Observer.php" hash="39f79a0a4d129b64149404178255ffbf"/><dir name="Order"><file name="Shipment.php" hash="97b3f6ad711842e3066300db6dc8a2c5"/></dir><dir name="Resource"><dir name="Carrier"><file name="Collection.php" hash="03005aa1067c8df71710d1224b9eb838"/></dir><file name="Carrier.php" hash="353d1d39c03e23dbbeacc181c1eb7ce9"/><dir name="Setting"><file name="Collection.php" hash="aa4e67bcd7016180fc6febf974533c93"/></dir><file name="Setting.php" hash="3eeee7198164abc0885e3c938b7d8bb4"/><dir name="Track"><file name="Collection.php" hash="cc6adf831c0248a202394e36d458b623"/></dir><file name="Track.php" hash="3f1d555d29f49ef8f6d2f6967d355ee8"/><dir name="Trackdetail"><file name="Collection.php" hash="941c6277814680ec85eb12c51ecf89d4"/></dir><file name="Trackdetail.php" hash="aedb43bb11215a694251e49ad9425eb6"/><dir name="Trackunsubscribed"><file name="Collection.php" hash="33f9820631af51c4e3aa62f34b5a7a3c"/></dir><file name="Trackunsubscribed.php" hash="038ffa7b345e528c808b03932baaf99c"/><dir name="Visit"><file name="Collection.php" hash="69c7a74f615ca0a833ea8e9d31c95ae1"/></dir><file name="Visit.php" hash="db8e9038a1b941a8ef403715d99327e0"/></dir><file name="Setting.php" hash="1f7b781d526211dcb29c78cb498033a2"/><file name="Track.php" hash="45e5ccee9f07af3a89fdbc36087607fb"/><file name="Trackdetail.php" hash="5a30f656c2e02258722edb5763d69f9b"/><file name="Trackunsubscribed.php" hash="47770b68d49a554c7e18250578ecddfc"/><file name="Translate.php" hash="dd80869c7e8dec6c0c3260db5cff3ccd"/><file name="Visit.php" hash="260383440fcde030413a650cf44010c6"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="PackpintracksController.php" hash="858bc6389e9e255e0a1dcc40b711601b"/><file name="PpnotificationsController.php" hash="3f7422b0c1a272ad9a8948b8ee076054"/></dir><file name="IndexController.php" hash="3ce7caeb86a0229f54293c4d7fc902cc"/><file name="UnsubscribeController.php" hash="76fb169f4e2dd8c23504899276ae9152"/><file name="unsubscribeController.php" hash="76fb169f4e2dd8c23504899276ae9152"/></dir><dir name="data"><dir name="pptrack_setup"><file name="data-upgrade-0.1.5-1.1.0.php" hash="412052d61996b3b32ab4608bf1d1dffc"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="d940f0fddfc4410080890cf7072c1284"/><file name="api.xml" hash="5986c3cfd16372143cf2d4d0d3252f38"/><file name="config.xml" hash="a2f50880fd9f4e4da7224d5c0f1cb7ea"/><file name="system.xml" hash="dc2f7804ed00088c6338317c35214a00"/></dir><dir name="sql"><dir name="pptrack_setup"><file name="mysql4-install-0.1.2.php" hash="41ddf13aef299e050bd4586c4473eb66"/><file name="mysql4-upgrade-0.1.2-0.1.5.php" hash="edfc436309165f115aeacf29df9d3398"/><file name="mysql4-upgrade-0.1.5-1.3.0.php" hash="c149678902df0b2df795b5eddc0cf696"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="pptrack.xml" hash="83f130ce5536d2023c11df86c2bcc9bf"/></dir><dir name="template"><dir name="pptrack"><file name="ads.phtml" hash="c96197f43506ae6b5cd88c832fa88d1a"/><file name="ads_email.phtml" hash="962207b6baf56c12716b4727e6849444"/><file name="crosssell.phtml" hash="8ab02a9bda48c988dba66e633cb65c76"/><file name="crosssell_email.phtml" hash="84a09283849c332a9a65c60f2a69c6e8"/><dir name="email"><dir name="order"><dir name="shipment"><file name="track.phtml" hash="8b072e5dc5ec2007b344641b805e4a76"/></dir></dir></dir><file name="index.phtml" hash="8ea92de958fbbfa50710ff1352330555"/><file name="index_new.phtml" hash="f717d8cc11828f1d34f67fd31b73a7ce"/><file name="index_v2.phtml" hash="b9d2ff8099db392bcbf5ccca09073325"/><file name="popup.phtml" hash="f8692aeedd28f2b13c92f626b2f6c6ad"/><file name="script.phtml" hash="213e0fc610eb4d66f3ec67cfa82a63a4"/><file name="unsubscribe.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="pptrack.xml" hash="8e9588311bebd12448389b8af68f20fc"/></dir><dir name="template"><dir name="pptrack"><dir name="dashboard"><file name="index.phtml" hash="950540d4e17ee56be117b665585fc7a1"/><file name="packpin.phtml" hash="5471f95ed5f17669265762c7814b7dde"/></dir><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="cb1396e7c7f78da4b3d4fe993c37da49"/><file name="scripts.phtml" hash="7682ed96d76653f647c4694f407bbe14"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Packpin_Pptrack.xml" hash="6430c01bb93cf22e4080d2a96f4b7ec5"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="pptrack.css" hash="06569c710259d96ab860b012c64dc647"/></dir><dir name="images"><dir name="pptrack"><file name="bulletIcon.png" hash="15f6fd65c7a62f940b7d17b9186a2b35"/><file name="checkedIcon.png" hash="cef38265bdd7675a0497a2296f5b7332"/><file name="postnlLogo.png" hash="3b4595ba4262c574c1147ed39e862092"/><file name="trackingStatus.png" hash="6dcf522f4e22b69bb25c3b3c199bb464"/><file name="truck.png" hash="3eb50f750a0fefa1903613e0bc26a2ee"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="pptrack"><dir name="css"><file name="dashboard.css" hash="b6b60f1fca6cafc98cf4483c3299ab4d"/><file name="pptrack.css" hash="e6a7c3120db5fba2621177a8c3d472c3"/></dir><dir name="images"><file name="mg_template1_o.png" hash="ffa5396781b7d1188a7be8d8d60af495"/><file name="mg_template2_o.png" hash="a459c74db32b4a05072051b9d9bb932c"/><file name="pp_logo1.png" hash="1a79f10d0f028271ac0b2646243e39d1"/></dir><dir name="js"><file name="dashboard.js" hash="1a4bd65a41a4c5d4d7ba6d4f94fe4955"/><file name="pptrack.js" hash="7bc0ee636b3b83484fc3b9348863bd22"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="packpin"><file name="packpin_delivered_email.html" hash="11d00272d82b3607068429ea494f08f3"/><file name="packpin_exception_email.html" hash="483af61fd9c1fbbca098d1bfcee0ad75"/><file name="packpin_failed_attempt_email.html" hash="483af61fd9c1fbbca098d1bfcee0ad75"/><file name="packpin_in_transit_email.html" hash="483af61fd9c1fbbca098d1bfcee0ad75"/><file name="packpin_info_received_email.html" hash="483af61fd9c1fbbca098d1bfcee0ad75"/><file name="packpin_out_for_delivery_email.html" hash="483af61fd9c1fbbca098d1bfcee0ad75"/></dir></dir></dir><file name="Packpin_Pptrack.csv" hash="582366fe3cf0fc6e79bdf1a09d6922ab"/></dir><dir name="es_ES"><file name="Packpin_Pptrack.csv" hash="b181ac70f3ac3d59a07b3c31ff3c34fe"/></dir><dir name="de_DE"><file name="Packpin_Pptrack.csv" hash="25ca5c6bb882bb2b9f3bfc5342fa76d1"/></dir><dir name="nl_NL"><file name="Packpin_Pptrack.csv" hash="df991ddd35ed4835a29b37b457bf3981"/></dir><dir name="pt_PT"><file name="Packpin_Pptrack.csv" hash="e3c8561588c07affcb0d509940301685"/></dir></target></contents>
26
  <compatible/>
27
  <dependencies><required><php><min>5.2.13</min><max>5.7.0</max></php></required></dependencies>
28
  </package>
skin/adminhtml/default/default/pptrack/css/dashboard.css CHANGED
@@ -1,25 +1,25 @@
1
- .morris-hover {
2
- position: absolute;
3
- z-index: 1000
4
- }
5
-
6
- .morris-hover.morris-default-style {
7
- border-radius: 10px;
8
- padding: 6px;
9
- color: #666;
10
- background: rgba(255, 255, 255, 0.8);
11
- border: solid 2px rgba(230, 230, 230, 0.8);
12
- font-family: sans-serif;
13
- font-size: 12px;
14
- text-align: center
15
- }
16
-
17
- .morris-hover.morris-default-style .morris-hover-row-label {
18
- font-weight: bold;
19
- margin: 0.25em 0
20
- }
21
-
22
- .morris-hover.morris-default-style .morris-hover-point {
23
- white-space: nowrap;
24
- margin: 0.1em 0
25
- }
1
+ .morris-hover {
2
+ position: absolute;
3
+ z-index: 1000
4
+ }
5
+
6
+ .morris-hover.morris-default-style {
7
+ border-radius: 10px;
8
+ padding: 6px;
9
+ color: #666;
10
+ background: rgba(255, 255, 255, 0.8);
11
+ border: solid 2px rgba(230, 230, 230, 0.8);
12
+ font-family: sans-serif;
13
+ font-size: 12px;
14
+ text-align: center
15
+ }
16
+
17
+ .morris-hover.morris-default-style .morris-hover-row-label {
18
+ font-weight: bold;
19
+ margin: 0.25em 0
20
+ }
21
+
22
+ .morris-hover.morris-default-style .morris-hover-point {
23
+ white-space: nowrap;
24
+ margin: 0.1em 0
25
+ }
skin/adminhtml/default/default/pptrack/css/pptrack.css CHANGED
@@ -1,66 +1,66 @@
1
- ul.tabs a.packpin-settings span,
2
- ul.tabs a.packpin-settings:hover span {
3
- background-image: url("../images/pp_logo1.png");
4
- background-repeat: no-repeat;
5
- background-position: 17px center;
6
- line-height: 24px;
7
- padding-left: 43px;
8
- border-bottom: 1px dotted;
9
- }
10
- ul.tabs dd:last-child a.packpin-settings span,
11
- ul.tabs dd:last-child a.packpin-settings:hover span {
12
- border-bottom: none;
13
- }
14
- .packpin-notice {
15
- background: #eaf0ee;
16
- border: 1px solid #cccccc;
17
- margin-bottom: 10px;
18
- padding: 11px 0 0 10px;
19
- }
20
- .packpin-notice-date {
21
- color: red;
22
- }
23
- #row_pp_section_setttings_crosssell_cross_sell_email td {
24
- border-top: 3px solid #6f8992 !important;
25
- padding-top: 15px !important;
26
- }
27
- #intercom-container .intercom-launcher-button {
28
- width: 105px !important;
29
- height: 40px !important;
30
- background: #c03a2b url("https://packpin.com/packpinSupportLogo.png") no-repeat center center !important;
31
- -webkit-border-radius: 20px !important;
32
- -moz-border-radius: 20px !important;
33
- border-radius: 20px !important;
34
- }
35
- .pp-preview-row {
36
- display: block;
37
- margin: 3px -15px;
38
- min-width: 500px;
39
- }
40
- .pp-preview-item-wrap {
41
- position: relative;
42
- display: inline-block;
43
- margin: 0 15px;
44
- width: 200px;
45
- height: auto;
46
- border: 1px solid #eaf0ee;
47
- }
48
- .pp-preview-image {
49
- height: 100px;
50
- }
51
- .pp-preview-image.pp-preview-template1 {
52
- background: #fff url("../images/mg_template1_o.png") no-repeat center center;
53
- background-size: contain;
54
- }
55
- .pp-preview-image.pp-preview-template2 {
56
- background: #fff url("../images/mg_template2_o.png") no-repeat center center;
57
- background-size: contain;
58
- }
59
- .pp-preview-item-title {
60
- height: 16px;
61
- line-height: 16px;
62
- text-align: center;
63
- font-size: 11px;
64
- color: #696969;
65
- text-shadow: #FFFFFF;
66
  }
1
+ ul.tabs a.packpin-settings span,
2
+ ul.tabs a.packpin-settings:hover span {
3
+ background-image: url("../images/pp_logo1.png");
4
+ background-repeat: no-repeat;
5
+ background-position: 17px center;
6
+ line-height: 24px;
7
+ padding-left: 43px;
8
+ border-bottom: 1px dotted;
9
+ }
10
+ ul.tabs dd:last-child a.packpin-settings span,
11
+ ul.tabs dd:last-child a.packpin-settings:hover span {
12
+ border-bottom: none;
13
+ }
14
+ .packpin-notice {
15
+ background: #eaf0ee;
16
+ border: 1px solid #cccccc;
17
+ margin-bottom: 10px;
18
+ padding: 11px 0 0 10px;
19
+ }
20
+ .packpin-notice-date {
21
+ color: red;
22
+ }
23
+ #row_pp_section_setttings_crosssell_cross_sell_email td {
24
+ border-top: 3px solid #6f8992 !important;
25
+ padding-top: 15px !important;
26
+ }
27
+ #intercom-container .intercom-launcher-button {
28
+ width: 105px !important;
29
+ height: 40px !important;
30
+ background: #c03a2b url("https://packpin.com/packpinSupportLogo.png") no-repeat center center !important;
31
+ -webkit-border-radius: 20px !important;
32
+ -moz-border-radius: 20px !important;
33
+ border-radius: 20px !important;
34
+ }
35
+ .pp-preview-row {
36
+ display: block;
37
+ margin: 3px -15px;
38
+ min-width: 500px;
39
+ }
40
+ .pp-preview-item-wrap {
41
+ position: relative;
42
+ display: inline-block;
43
+ margin: 0 15px;
44
+ width: 200px;
45
+ height: auto;
46
+ border: 1px solid #eaf0ee;
47
+ }
48
+ .pp-preview-image {
49
+ height: 100px;
50
+ }
51
+ .pp-preview-image.pp-preview-template1 {
52
+ background: #fff url("../images/mg_template1_o.png") no-repeat center center;
53
+ background-size: contain;
54
+ }
55
+ .pp-preview-image.pp-preview-template2 {
56
+ background: #fff url("../images/mg_template2_o.png") no-repeat center center;
57
+ background-size: contain;
58
+ }
59
+ .pp-preview-item-title {
60
+ height: 16px;
61
+ line-height: 16px;
62
+ text-align: center;
63
+ font-size: 11px;
64
+ color: #696969;
65
+ text-shadow: #FFFFFF;
66
  }
skin/adminhtml/default/default/pptrack/images/mg_template1_o.png CHANGED
File without changes
skin/adminhtml/default/default/pptrack/images/mg_template2_o.png CHANGED
File without changes
skin/adminhtml/default/default/pptrack/images/pp_logo1.png CHANGED
File without changes
skin/adminhtml/default/default/pptrack/js/dashboard.js CHANGED
@@ -1,28 +1,28 @@
1
- //jquery
2
- if (typeof jQuery == 'undefined') {
3
- /*! jQuery v1.9.0 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license */(function(e,t){"use strict";function n(e){var t=e.length,n=st.type(e);return st.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}function r(e){var t=Tt[e]={};return st.each(e.match(lt)||[],function(e,n){t[n]=!0}),t}function i(e,n,r,i){if(st.acceptData(e)){var o,a,s=st.expando,u="string"==typeof n,l=e.nodeType,c=l?st.cache:e,f=l?e[s]:e[s]&&s;if(f&&c[f]&&(i||c[f].data)||!u||r!==t)return f||(l?e[s]=f=K.pop()||st.guid++:f=s),c[f]||(c[f]={},l||(c[f].toJSON=st.noop)),("object"==typeof n||"function"==typeof n)&&(i?c[f]=st.extend(c[f],n):c[f].data=st.extend(c[f].data,n)),o=c[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[st.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[st.camelCase(n)])):a=o,a}}function o(e,t,n){if(st.acceptData(e)){var r,i,o,a=e.nodeType,u=a?st.cache:e,l=a?e[st.expando]:st.expando;if(u[l]){if(t&&(r=n?u[l]:u[l].data)){st.isArray(t)?t=t.concat(st.map(t,st.camelCase)):t in r?t=[t]:(t=st.camelCase(t),t=t in r?[t]:t.split(" "));for(i=0,o=t.length;o>i;i++)delete r[t[i]];if(!(n?s:st.isEmptyObject)(r))return}(n||(delete u[l].data,s(u[l])))&&(a?st.cleanData([e],!0):st.support.deleteExpando||u!=u.window?delete u[l]:u[l]=null)}}}function a(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(Nt,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:wt.test(r)?st.parseJSON(r):r}catch(o){}st.data(e,n,r)}else r=t}return r}function s(e){var t;for(t in e)if(("data"!==t||!st.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function u(){return!0}function l(){return!1}function c(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function f(e,t,n){if(t=t||0,st.isFunction(t))return st.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return st.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=st.grep(e,function(e){return 1===e.nodeType});if(Wt.test(t))return st.filter(t,r,!n);t=st.filter(t,r)}return st.grep(e,function(e){return st.inArray(e,t)>=0===n})}function p(e){var t=zt.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function d(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function h(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function g(e){var t=nn.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function m(e,t){for(var n,r=0;null!=(n=e[r]);r++)st._data(n,"globalEval",!t||st._data(t[r],"globalEval"))}function y(e,t){if(1===t.nodeType&&st.hasData(e)){var n,r,i,o=st._data(e),a=st._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)st.event.add(t,n,s[n][r])}a.data&&(a.data=st.extend({},a.data))}}function v(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!st.support.noCloneEvent&&t[st.expando]){r=st._data(t);for(i in r.events)st.removeEvent(t,i,r.handle);t.removeAttribute(st.expando)}"script"===n&&t.text!==e.text?(h(t).text=e.text,g(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),st.support.html5Clone&&e.innerHTML&&!st.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Zt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function b(e,n){var r,i,o=0,a=e.getElementsByTagName!==t?e.getElementsByTagName(n||"*"):e.querySelectorAll!==t?e.querySelectorAll(n||"*"):t;if(!a)for(a=[],r=e.childNodes||e;null!=(i=r[o]);o++)!n||st.nodeName(i,n)?a.push(i):st.merge(a,b(i,n));return n===t||n&&st.nodeName(e,n)?st.merge([e],a):a}function x(e){Zt.test(e.type)&&(e.defaultChecked=e.checked)}function T(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Nn.length;i--;)if(t=Nn[i]+n,t in e)return t;return r}function w(e,t){return e=t||e,"none"===st.css(e,"display")||!st.contains(e.ownerDocument,e)}function N(e,t){for(var n,r=[],i=0,o=e.length;o>i;i++)n=e[i],n.style&&(r[i]=st._data(n,"olddisplay"),t?(r[i]||"none"!==n.style.display||(n.style.display=""),""===n.style.display&&w(n)&&(r[i]=st._data(n,"olddisplay",S(n.nodeName)))):r[i]||w(n)||st._data(n,"olddisplay",st.css(n,"display")));for(i=0;o>i;i++)n=e[i],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?r[i]||"":"none"));return e}function C(e,t,n){var r=mn.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function k(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=st.css(e,n+wn[o],!0,i)),r?("content"===n&&(a-=st.css(e,"padding"+wn[o],!0,i)),"margin"!==n&&(a-=st.css(e,"border"+wn[o]+"Width",!0,i))):(a+=st.css(e,"padding"+wn[o],!0,i),"padding"!==n&&(a+=st.css(e,"border"+wn[o]+"Width",!0,i)));return a}function E(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=ln(e),a=st.support.boxSizing&&"border-box"===st.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=un(e,t,o),(0>i||null==i)&&(i=e.style[t]),yn.test(i))return i;r=a&&(st.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+k(e,t,n||(a?"border":"content"),r,o)+"px"}function S(e){var t=V,n=bn[e];return n||(n=A(e,t),"none"!==n&&n||(cn=(cn||st("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(cn[0].contentWindow||cn[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=A(e,t),cn.detach()),bn[e]=n),n}function A(e,t){var n=st(t.createElement(e)).appendTo(t.body),r=st.css(n[0],"display");return n.remove(),r}function j(e,t,n,r){var i;if(st.isArray(t))st.each(t,function(t,i){n||kn.test(e)?r(e,i):j(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==st.type(t))r(e,t);else for(i in t)j(e+"["+i+"]",t[i],n,r)}function D(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(lt)||[];if(st.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function L(e,n,r,i){function o(u){var l;return a[u]=!0,st.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||s||a[c]?s?!(l=c):t:(n.dataTypes.unshift(c),o(c),!1)}),l}var a={},s=e===$n;return o(n.dataTypes[0])||!a["*"]&&o("*")}function H(e,n){var r,i,o=st.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((o[r]?e:i||(i={}))[r]=n[r]);return i&&st.extend(!0,e,i),e}function M(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(o in c)o in r&&(n[c[o]]=r[o]);for(;"*"===l[0];)l.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("Content-Type"));if(i)for(o in u)if(u[o]&&u[o].test(i)){l.unshift(o);break}if(l[0]in r)a=l[0];else{for(o in r){if(!l[0]||e.converters[o+" "+l[0]]){a=o;break}s||(s=o)}a=a||s}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function q(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=u[++s];)if("*"!==i){if("*"!==l&&l!==i){if(n=a[l+" "+i]||a["* "+i],!n)for(r in a)if(o=r.split(" "),o[1]===i&&(n=a[l+" "+o[0]]||a["* "+o[0]])){n===!0?n=a[r]:a[r]!==!0&&(i=o[0],u.splice(s--,0,i));break}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(c){return{state:"parsererror",error:n?c:"No conversion from "+l+" to "+i}}}l=i}return{state:"success",data:t}}function _(){try{return new e.XMLHttpRequest}catch(t){}}function F(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function O(){return setTimeout(function(){Qn=t}),Qn=st.now()}function B(e,t){st.each(t,function(t,n){for(var r=(rr[t]||[]).concat(rr["*"]),i=0,o=r.length;o>i;i++)if(r[i].call(e,t,n))return})}function P(e,t,n){var r,i,o=0,a=nr.length,s=st.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=Qn||O(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:st.extend({},t),opts:st.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Qn||O(),duration:n.duration,tweens:[],createTween:function(t,n){var r=st.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(R(c,l.opts.specialEasing);a>o;o++)if(r=nr[o].call(l,e,c,l.opts))return r;return B(l,c),st.isFunction(l.opts.start)&&l.opts.start.call(e,l),st.fx.timer(st.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function R(e,t){var n,r,i,o,a;for(n in e)if(r=st.camelCase(n),i=t[r],o=e[n],st.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=st.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function W(e,t,n){var r,i,o,a,s,u,l,c,f,p=this,d=e.style,h={},g=[],m=e.nodeType&&w(e);n.queue||(c=st._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,f=c.empty.fire,c.empty.fire=function(){c.unqueued||f()}),c.unqueued++,p.always(function(){p.always(function(){c.unqueued--,st.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===st.css(e,"display")&&"none"===st.css(e,"float")&&(st.support.inlineBlockNeedsLayout&&"inline"!==S(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",st.support.shrinkWrapBlocks||p.done(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(r in t)if(o=t[r],Zn.exec(o)){if(delete t[r],u=u||"toggle"===o,o===(m?"hide":"show"))continue;g.push(r)}if(a=g.length){s=st._data(e,"fxshow")||st._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?st(e).show():p.done(function(){st(e).hide()}),p.done(function(){var t;st._removeData(e,"fxshow");for(t in h)st.style(e,t,h[t])});for(r=0;a>r;r++)i=g[r],l=p.createTween(i,m?s[i]:0),h[i]=s[i]||st.style(e,i),i in s||(s[i]=l.start,m&&(l.end=l.start,l.start="width"===i||"height"===i?1:0))}}function $(e,t,n,r,i){return new $.prototype.init(e,t,n,r,i)}function I(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=wn[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function z(e){return st.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var X,U,V=e.document,Y=e.location,J=e.jQuery,G=e.$,Q={},K=[],Z="1.9.0",et=K.concat,tt=K.push,nt=K.slice,rt=K.indexOf,it=Q.toString,ot=Q.hasOwnProperty,at=Z.trim,st=function(e,t){return new st.fn.init(e,t,X)},ut=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,lt=/\S+/g,ct=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ft=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,pt=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,dt=/^[\],:{}\s]*$/,ht=/(?:^|:|,)(?:\s*\[)+/g,gt=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,mt=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,yt=/^-ms-/,vt=/-([\da-z])/gi,bt=function(e,t){return t.toUpperCase()},xt=function(){V.addEventListener?(V.removeEventListener("DOMContentLoaded",xt,!1),st.ready()):"complete"===V.readyState&&(V.detachEvent("onreadystatechange",xt),st.ready())};st.fn=st.prototype={jquery:Z,constructor:st,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:ft.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof st?n[0]:n,st.merge(this,st.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:V,!0)),pt.test(i[1])&&st.isPlainObject(n))for(i in n)st.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=V.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=V,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):st.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),st.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return nt.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=st.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return st.each(this,e,t)},ready:function(e){return st.ready.promise().done(e),this},slice:function(){return this.pushStack(nt.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(st.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:tt,sort:[].sort,splice:[].splice},st.fn.init.prototype=st.fn,st.extend=st.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||st.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(e=arguments[u]))for(n in e)r=s[n],i=e[n],s!==i&&(c&&i&&(st.isPlainObject(i)||(o=st.isArray(i)))?(o?(o=!1,a=r&&st.isArray(r)?r:[]):a=r&&st.isPlainObject(r)?r:{},s[n]=st.extend(c,a,i)):i!==t&&(s[n]=i));return s},st.extend({noConflict:function(t){return e.$===st&&(e.$=G),t&&e.jQuery===st&&(e.jQuery=J),st},isReady:!1,readyWait:1,holdReady:function(e){e?st.readyWait++:st.ready(!0)},ready:function(e){if(e===!0?!--st.readyWait:!st.isReady){if(!V.body)return setTimeout(st.ready);st.isReady=!0,e!==!0&&--st.readyWait>0||(U.resolveWith(V,[st]),st.fn.trigger&&st(V).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===st.type(e)},isArray:Array.isArray||function(e){return"array"===st.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?Q[it.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==st.type(e)||e.nodeType||st.isWindow(e))return!1;try{if(e.constructor&&!ot.call(e,"constructor")&&!ot.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||ot.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||V;var r=pt.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=st.buildFragment([e],t,i),i&&st(i).remove(),st.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=st.trim(n),n&&dt.test(n.replace(gt,"@").replace(mt,"]").replace(ht,"")))?Function("return "+n)():(st.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||st.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&st.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(yt,"ms-").replace(vt,bt)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,r){var i,o=0,a=e.length,s=n(e);if(r){if(s)for(;a>o&&(i=t.apply(e[o],r),i!==!1);o++);else for(o in e)if(i=t.apply(e[o],r),i===!1)break}else if(s)for(;a>o&&(i=t.call(e[o],o,e[o]),i!==!1);o++);else for(o in e)if(i=t.call(e[o],o,e[o]),i===!1)break;return e},trim:at&&!at.call("\ufeff\u00a0")?function(e){return null==e?"":at.call(e)}:function(e){return null==e?"":(e+"").replace(ct,"")},makeArray:function(e,t){var r=t||[];return null!=e&&(n(Object(e))?st.merge(r,"string"==typeof e?[e]:e):tt.call(r,e)),r},inArray:function(e,t,n){var r;if(t){if(rt)return rt.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else for(;n[o]!==t;)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,r){var i,o=0,a=e.length,s=n(e),u=[];if(s)for(;a>o;o++)i=t(e[o],o,r),null!=i&&(u[u.length]=i);else for(o in e)i=t(e[o],o,r),null!=i&&(u[u.length]=i);return et.apply([],u)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(r=e[n],n=e,e=r),st.isFunction(e)?(i=nt.call(arguments,2),o=function(){return e.apply(n||this,i.concat(nt.call(arguments)))},o.guid=e.guid=e.guid||st.guid++,o):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===st.type(r)){o=!0;for(u in r)st.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,st.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(st(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),st.ready.promise=function(t){if(!U)if(U=st.Deferred(),"complete"===V.readyState)setTimeout(st.ready);else if(V.addEventListener)V.addEventListener("DOMContentLoaded",xt,!1),e.addEventListener("load",st.ready,!1);else{V.attachEvent("onreadystatechange",xt),e.attachEvent("onload",st.ready);var n=!1;try{n=null==e.frameElement&&V.documentElement}catch(r){}n&&n.doScroll&&function i(){if(!st.isReady){try{n.doScroll("left")}catch(e){return setTimeout(i,50)}st.ready()}}()}return U.promise(t)},st.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){Q["[object "+t+"]"]=t.toLowerCase()}),X=st(V);var Tt={};st.Callbacks=function(e){e="string"==typeof e?Tt[e]||r(e):st.extend({},e);var n,i,o,a,s,u,l=[],c=!e.once&&[],f=function(t){for(n=e.memory&&t,i=!0,u=a||0,a=0,s=l.length,o=!0;l&&s>u;u++)if(l[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}o=!1,l&&(c?c.length&&f(c.shift()):n?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function r(t){st.each(t,function(t,n){var i=st.type(n);"function"===i?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==i&&r(n)})})(arguments),o?s=l.length:n&&(a=t,f(n))}return this},remove:function(){return l&&st.each(arguments,function(e,t){for(var n;(n=st.inArray(t,l,n))>-1;)l.splice(n,1),o&&(s>=n&&s--,u>=n&&u--)}),this},has:function(e){return st.inArray(e,l)>-1},empty:function(){return l=[],this},disable:function(){return l=c=n=t,this},disabled:function(){return!l},lock:function(){return c=t,n||p.disable(),this},locked:function(){return!c},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!l||i&&!c||(o?c.push(t):f(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},st.extend({Deferred:function(e){var t=[["resolve","done",st.Callbacks("once memory"),"resolved"],["reject","fail",st.Callbacks("once memory"),"rejected"],["notify","progress",st.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return st.Deferred(function(n){st.each(t,function(t,o){var a=o[0],s=st.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&st.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?st.extend(e,r):r}},i={};return r.pipe=r.then,st.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=nt.call(arguments),a=o.length,s=1!==a||e&&st.isFunction(e.promise)?a:0,u=1===s?e:st.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?nt.call(arguments):i,r===t?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(t=Array(a),n=Array(a),r=Array(a);a>i;i++)o[i]&&st.isFunction(o[i].promise)?o[i].promise().done(l(i,r,o)).fail(u.reject).progress(l(i,n,t)):--s;return s||u.resolveWith(r,o),u.promise()}}),st.support=function(){var n,r,i,o,a,s,u,l,c,f,p=V.createElement("div");if(p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",r=p.getElementsByTagName("*"),i=p.getElementsByTagName("a")[0],!r||!i||!r.length)return{};o=V.createElement("select"),a=o.appendChild(V.createElement("option")),s=p.getElementsByTagName("input")[0],i.style.cssText="top:1px;float:left;opacity:.5",n={getSetAttribute:"t"!==p.className,leadingWhitespace:3===p.firstChild.nodeType,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:"/a"===i.getAttribute("href"),opacity:/^0.5/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:!!s.value,optSelected:a.selected,enctype:!!V.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==V.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===V.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},s.checked=!0,n.noCloneChecked=s.cloneNode(!0).checked,o.disabled=!0,n.optDisabled=!a.disabled;try{delete p.test}catch(d){n.deleteExpando=!1}s=V.createElement("input"),s.setAttribute("value",""),n.input=""===s.getAttribute("value"),s.value="t",s.setAttribute("type","radio"),n.radioValue="t"===s.value,s.setAttribute("checked","t"),s.setAttribute("name","t"),u=V.createDocumentFragment(),u.appendChild(s),n.appendChecked=s.checked,n.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,p.attachEvent&&(p.attachEvent("onclick",function(){n.noCloneEvent=!1}),p.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})p.setAttribute(l="on"+f,"t"),n[f+"Bubbles"]=l in e||p.attributes[l].expando===!1;return p.style.backgroundClip="content-box",p.cloneNode(!0).style.backgroundClip="",n.clearCloneStyle="content-box"===p.style.backgroundClip,st(function(){var r,i,o,a="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",s=V.getElementsByTagName("body")[0];s&&(r=V.createElement("div"),r.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",s.appendChild(r).appendChild(p),p.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=p.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",c=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",n.reliableHiddenOffsets=c&&0===o[0].offsetHeight,p.innerHTML="",p.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",n.boxSizing=4===p.offsetWidth,n.doesNotIncludeMarginInBodyOffset=1!==s.offsetTop,e.getComputedStyle&&(n.pixelPosition="1%"!==(e.getComputedStyle(p,null)||{}).top,n.boxSizingReliable="4px"===(e.getComputedStyle(p,null)||{width:"4px"}).width,i=p.appendChild(V.createElement("div")),i.style.cssText=p.style.cssText=a,i.style.marginRight=i.style.width="0",p.style.width="1px",n.reliableMarginRight=!parseFloat((e.getComputedStyle(i,null)||{}).marginRight)),p.style.zoom!==t&&(p.innerHTML="",p.style.cssText=a+"width:1px;padding:1px;display:inline;zoom:1",n.inlineBlockNeedsLayout=3===p.offsetWidth,p.style.display="block",p.innerHTML="<div></div>",p.firstChild.style.width="5px",n.shrinkWrapBlocks=3!==p.offsetWidth,s.style.zoom=1),s.removeChild(r),r=p=o=i=null)}),r=o=u=a=i=s=null,n}();var wt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,Nt=/([A-Z])/g;st.extend({cache:{},expando:"jQuery"+(Z+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?st.cache[e[st.expando]]:e[st.expando],!!e&&!s(e)},data:function(e,t,n){return i(e,t,n,!1)},removeData:function(e,t){return o(e,t,!1)},_data:function(e,t,n){return i(e,t,n,!0)},_removeData:function(e,t){return o(e,t,!0)},acceptData:function(e){var t=e.nodeName&&st.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),st.fn.extend({data:function(e,n){var r,i,o=this[0],s=0,u=null;if(e===t){if(this.length&&(u=st.data(o),1===o.nodeType&&!st._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>s;s++)i=r[s].name,i.indexOf("data-")||(i=st.camelCase(i.substring(5)),a(o,i,u[i]));st._data(o,"parsedAttrs",!0)}return u}return"object"==typeof e?this.each(function(){st.data(this,e)}):st.access(this,function(n){return n===t?o?a(o,e,st.data(o,e)):null:(this.each(function(){st.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){st.removeData(this,e)})}}),st.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=st._data(e,n),r&&(!i||st.isArray(r)?i=st._data(e,n,st.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=st.queue(e,t),r=n.length,i=n.shift(),o=st._queueHooks(e,t),a=function(){st.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return st._data(e,n)||st._data(e,n,{empty:st.Callbacks("once memory").add(function(){st._removeData(e,t+"queue"),st._removeData(e,n)})})}}),st.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?st.queue(this[0],e):n===t?this:this.each(function(){var t=st.queue(this,e,n);st._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&st.dequeue(this,e)})},dequeue:function(e){return this.each(function(){st.dequeue(this,e)})},delay:function(e,t){return e=st.fx?st.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=st.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)r=st._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var Ct,kt,Et=/[\t\r\n]/g,St=/\r/g,At=/^(?:input|select|textarea|button|object)$/i,jt=/^(?:a|area)$/i,Dt=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,Lt=/^(?:checked|selected)$/i,Ht=st.support.getSetAttribute,Mt=st.support.input;st.fn.extend({attr:function(e,t){return st.access(this,st.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){st.removeAttr(this,e)})},prop:function(e,t){return st.access(this,st.prop,e,t,arguments.length>1)},removeProp:function(e){return e=st.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(st.isFunction(e))return this.each(function(t){st(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(lt)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Et," "):" ")){for(o=0;i=t[o++];)0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=st.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(st.isFunction(e))return this.each(function(t){st(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(lt)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Et," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");n.className=e?st.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return st.isFunction(e)?this.each(function(n){st(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var i,o=0,a=st(this),s=t,u=e.match(lt)||[];i=u[o++];)s=r?s:!a.hasClass(i),a[s?"addClass":"removeClass"](i);else("undefined"===n||"boolean"===n)&&(this.className&&st._data(this,"__className__",this.className),this.className=this.className||e===!1?"":st._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(Et," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=st.isFunction(e),this.each(function(r){var o,a=st(this);1===this.nodeType&&(o=i?e.call(this,r,a.val()):e,null==o?o="":"number"==typeof o?o+="":st.isArray(o)&&(o=st.map(o,function(e){return null==e?"":e+""})),n=st.valHooks[this.type]||st.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&n.set(this,o,"value")!==t||(this.value=o))});if(o)return n=st.valHooks[o.type]||st.valHooks[o.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(o,"value"))!==t?r:(r=o.value,"string"==typeof r?r.replace(St,""):null==r?"":r)}}}),st.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(st.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&st.nodeName(n.parentNode,"optgroup"))){if(t=st(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=st.makeArray(t);return st(e).find("option").each(function(){this.selected=st.inArray(st(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return e.getAttribute===t?st.prop(e,n,r):(a=1!==s||!st.isXMLDoc(e),a&&(n=n.toLowerCase(),o=st.attrHooks[n]||(Dt.test(n)?kt:Ct)),r===t?o&&a&&"get"in o&&null!==(i=o.get(e,n))?i:(e.getAttribute!==t&&(i=e.getAttribute(n)),null==i?t:i):null!==r?o&&a&&"set"in o&&(i=o.set(e,r,n))!==t?i:(e.setAttribute(n,r+""),r):(st.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(lt);if(o&&1===e.nodeType)for(;n=o[i++];)r=st.propFix[n]||n,Dt.test(n)?!Ht&&Lt.test(n)?e[st.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:st.attr(e,n,""),e.removeAttribute(Ht?n:r)},attrHooks:{type:{set:function(e,t){if(!st.support.radioValue&&"radio"===t&&st.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!st.isXMLDoc(e),a&&(n=st.propFix[n]||n,o=st.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):At.test(e.nodeName)||jt.test(e.nodeName)&&e.href?0:t}}}}),kt={get:function(e,n){var r=st.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?Mt&&Ht?null!=i:Lt.test(n)?e[st.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?st.removeAttr(e,n):Mt&&Ht||!Lt.test(n)?e.setAttribute(!Ht&&st.propFix[n]||n,n):e[st.camelCase("default-"+n)]=e[n]=!0,n}},Mt&&Ht||(st.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return st.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t
4
- },set:function(e,n,r){return st.nodeName(e,"input")?(e.defaultValue=n,t):Ct&&Ct.set(e,n,r)}}),Ht||(Ct=st.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},st.attrHooks.contenteditable={get:Ct.get,set:function(e,t,n){Ct.set(e,""===t?!1:t,n)}},st.each(["width","height"],function(e,n){st.attrHooks[n]=st.extend(st.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),st.support.hrefNormalized||(st.each(["href","src","width","height"],function(e,n){st.attrHooks[n]=st.extend(st.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),st.each(["href","src"],function(e,t){st.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),st.support.style||(st.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),st.support.optSelected||(st.propHooks.selected=st.extend(st.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),st.support.enctype||(st.propFix.enctype="encoding"),st.support.checkOn||st.each(["radio","checkbox"],function(){st.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),st.each(["radio","checkbox"],function(){st.valHooks[this]=st.extend(st.valHooks[this],{set:function(e,n){return st.isArray(n)?e.checked=st.inArray(st(e).val(),n)>=0:t}})});var qt=/^(?:input|select|textarea)$/i,_t=/^key/,Ft=/^(?:mouse|contextmenu)|click/,Ot=/^(?:focusinfocus|focusoutblur)$/,Bt=/^([^.]*)(?:\.(.+)|)$/;st.event={global:{},add:function(e,n,r,i,o){var a,s,u,l,c,f,p,d,h,g,m,y=3!==e.nodeType&&8!==e.nodeType&&st._data(e);if(y){for(r.handler&&(a=r,r=a.handler,o=a.selector),r.guid||(r.guid=st.guid++),(l=y.events)||(l=y.events={}),(s=y.handle)||(s=y.handle=function(e){return st===t||e&&st.event.triggered===e.type?t:st.event.dispatch.apply(s.elem,arguments)},s.elem=e),n=(n||"").match(lt)||[""],c=n.length;c--;)u=Bt.exec(n[c])||[],h=m=u[1],g=(u[2]||"").split(".").sort(),p=st.event.special[h]||{},h=(o?p.delegateType:p.bindType)||h,p=st.event.special[h]||{},f=st.extend({type:h,origType:m,data:i,handler:r,guid:r.guid,selector:o,needsContext:o&&st.expr.match.needsContext.test(o),namespace:g.join(".")},a),(d=l[h])||(d=l[h]=[],d.delegateCount=0,p.setup&&p.setup.call(e,i,g,s)!==!1||(e.addEventListener?e.addEventListener(h,s,!1):e.attachEvent&&e.attachEvent("on"+h,s))),p.add&&(p.add.call(e,f),f.handler.guid||(f.handler.guid=r.guid)),o?d.splice(d.delegateCount++,0,f):d.push(f),st.event.global[h]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,m=st.hasData(e)&&st._data(e);if(m&&(u=m.events)){for(t=(t||"").match(lt)||[""],l=t.length;l--;)if(s=Bt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){for(f=st.event.special[d]||{},d=(r?f.delegateType:f.bindType)||d,p=u[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&f.teardown.call(e,h,m.handle)!==!1||st.removeEvent(e,d,m.handle),delete u[d])}else for(d in u)st.event.remove(e,d+t[l],n,r,!0);st.isEmptyObject(u)&&(delete m.handle,st._removeData(e,"events"))}},trigger:function(n,r,i,o){var a,s,u,l,c,f,p,d=[i||V],h=n.type||n,g=n.namespace?n.namespace.split("."):[];if(s=u=i=i||V,3!==i.nodeType&&8!==i.nodeType&&!Ot.test(h+st.event.triggered)&&(h.indexOf(".")>=0&&(g=h.split("."),h=g.shift(),g.sort()),c=0>h.indexOf(":")&&"on"+h,n=n[st.expando]?n:new st.Event(h,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=g.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:st.makeArray(r,[n]),p=st.event.special[h]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!st.isWindow(i)){for(l=p.delegateType||h,Ot.test(l+h)||(s=s.parentNode);s;s=s.parentNode)d.push(s),u=s;u===(i.ownerDocument||V)&&d.push(u.defaultView||u.parentWindow||e)}for(a=0;(s=d[a++])&&!n.isPropagationStopped();)n.type=a>1?l:p.bindType||h,f=(st._data(s,"events")||{})[n.type]&&st._data(s,"handle"),f&&f.apply(s,r),f=c&&s[c],f&&st.acceptData(s)&&f.apply&&f.apply(s,r)===!1&&n.preventDefault();if(n.type=h,!(o||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===h&&st.nodeName(i,"a")||!st.acceptData(i)||!c||!i[h]||st.isWindow(i))){u=i[c],u&&(i[c]=null),st.event.triggered=h;try{i[h]()}catch(m){}st.event.triggered=t,u&&(i[c]=u)}return n.result}},dispatch:function(e){e=st.event.fix(e);var n,r,i,o,a,s=[],u=nt.call(arguments),l=(st._data(this,"events")||{})[e.type]||[],c=st.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(s=st.event.handlers.call(this,e,l),n=0;(o=s[n++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,r=0;(a=o.handlers[r++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(a.namespace))&&(e.handleObj=a,e.data=a.data,i=((st.event.special[a.origType]||{}).handle||a.handler).apply(o.elem,u),i!==t&&(e.result=i)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(l.disabled!==!0||"click"!==e.type){for(i=[],r=0;u>r;r++)a=n[r],o=a.selector+" ",i[o]===t&&(i[o]=a.needsContext?st(o,this).index(l)>=0:st.find(o,this,null,[l]).length),i[o]&&i.push(a);i.length&&s.push({elem:l,handlers:i})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[st.expando])return e;var t,n,r=e,i=st.event.fixHooks[e.type]||{},o=i.props?this.props.concat(i.props):this.props;for(e=new st.Event(r),t=o.length;t--;)n=o[t],e[n]=r[n];return e.target||(e.target=r.srcElement||V),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,i.filter?i.filter(e,r):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,a=n.button,s=n.fromElement;return null==e.pageX&&null!=n.clientX&&(r=e.target.ownerDocument||V,i=r.documentElement,o=r.body,e.pageX=n.clientX+(i&&i.scrollLeft||o&&o.scrollLeft||0)-(i&&i.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(i&&i.scrollTop||o&&o.scrollTop||0)-(i&&i.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&s&&(e.relatedTarget=s===e.target?n.toElement:s),e.which||a===t||(e.which=1&a?1:2&a?3:4&a?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return st.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==V.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===V.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=st.extend(new st.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?st.event.trigger(i,null,t):st.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},st.removeEvent=V.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,n,r){var i="on"+n;e.detachEvent&&(e[i]===t&&(e[i]=null),e.detachEvent(i,r))},st.Event=function(e,n){return this instanceof st.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?u:l):this.type=e,n&&st.extend(this,n),this.timeStamp=e&&e.timeStamp||st.now(),this[st.expando]=!0,t):new st.Event(e,n)},st.Event.prototype={isDefaultPrevented:l,isPropagationStopped:l,isImmediatePropagationStopped:l,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=u,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=u,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u,this.stopPropagation()}},st.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){st.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!st.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),st.support.submitBubbles||(st.event.special.submit={setup:function(){return st.nodeName(this,"form")?!1:(st.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=st.nodeName(n,"input")||st.nodeName(n,"button")?n.form:t;r&&!st._data(r,"submitBubbles")&&(st.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),st._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&st.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return st.nodeName(this,"form")?!1:(st.event.remove(this,"._submit"),t)}}),st.support.changeBubbles||(st.event.special.change={setup:function(){return qt.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(st.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),st.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),st.event.simulate("change",this,e,!0)})),!1):(st.event.add(this,"beforeactivate._change",function(e){var t=e.target;qt.test(t.nodeName)&&!st._data(t,"changeBubbles")&&(st.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||st.event.simulate("change",this.parentNode,e,!0)}),st._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return st.event.remove(this,"._change"),!qt.test(this.nodeName)}}),st.support.focusinBubbles||st.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){st.event.simulate(t,e.target,st.event.fix(e),!0)};st.event.special[t]={setup:function(){0===n++&&V.addEventListener(e,r,!0)},teardown:function(){0===--n&&V.removeEventListener(e,r,!0)}}}),st.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(s in e)this.on(s,n,r,e[s],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=l;else if(!i)return this;return 1===o&&(a=i,i=function(e){return st().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=st.guid++)),this.each(function(){st.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,st(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=l),this.each(function(){st.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){st.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?st.event.trigger(e,n,r,!0):t},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),st.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){st.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)},_t.test(t)&&(st.event.fixHooks[t]=st.event.keyHooks),Ft.test(t)&&(st.event.fixHooks[t]=st.event.mouseHooks)}),function(e,t){function n(e){return ht.test(e+"")}function r(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>C.cacheLength&&delete e[t.shift()],e[n]=r}}function i(e){return e[P]=!0,e}function o(e){var t=L.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function a(e,t,n,r){var i,o,a,s,u,l,c,d,h,g;if((t?t.ownerDocument||t:R)!==L&&D(t),t=t||L,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!M&&!r){if(i=gt.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&O(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Q.apply(n,K.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&W.getByClassName&&t.getElementsByClassName)return Q.apply(n,K.call(t.getElementsByClassName(a),0)),n}if(W.qsa&&!q.test(e)){if(c=!0,d=P,h=t,g=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(l=f(e),(c=t.getAttribute("id"))?d=c.replace(vt,"\\$&"):t.setAttribute("id",d),d="[id='"+d+"'] ",u=l.length;u--;)l[u]=d+p(l[u]);h=dt.test(e)&&t.parentNode||t,g=l.join(",")}if(g)try{return Q.apply(n,K.call(h.querySelectorAll(g),0)),n}catch(m){}finally{c||t.removeAttribute("id")}}}return x(e.replace(at,"$1"),t,n,r)}function s(e,t){for(var n=e&&t&&e.nextSibling;n;n=n.nextSibling)if(n===t)return-1;return e?1:-1}function u(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return i(function(t){return t=+t,i(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function f(e,t){var n,r,i,o,s,u,l,c=X[e+" "];if(c)return t?0:c.slice(0);for(s=e,u=[],l=C.preFilter;s;){(!n||(r=ut.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(i=[])),n=!1,(r=lt.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(at," ")}),s=s.slice(n.length));for(o in C.filter)!(r=pt[o].exec(s))||l[o]&&!(r=l[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?a.error(e):X(e,u).slice(0)}function p(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function d(e,t,n){var r=t.dir,i=n&&"parentNode"===t.dir,o=I++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,u,l,c=$+" "+o;if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i)if(l=t[P]||(t[P]={}),(u=l[r])&&u[0]===c){if((s=u[1])===!0||s===N)return s===!0}else if(u=l[r]=[c],u[1]=e(t,n,a)||N,u[1]===!0)return!0}}function h(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function m(e,t,n,r,o,a){return r&&!r[P]&&(r=m(r)),o&&!o[P]&&(o=m(o,a)),i(function(i,a,s,u){var l,c,f,p=[],d=[],h=a.length,m=i||b(t||"*",s.nodeType?[s]:s,[]),y=!e||!i&&t?m:g(m,p,e,s,u),v=n?o||(i?e:h||r)?[]:a:y;if(n&&n(y,v,s,u),r)for(l=g(v,d),r(l,[],s,u),c=l.length;c--;)(f=l[c])&&(v[d[c]]=!(y[d[c]]=f));if(i){if(o||e){if(o){for(l=[],c=v.length;c--;)(f=v[c])&&l.push(y[c]=f);o(null,v=[],l,u)}for(c=v.length;c--;)(f=v[c])&&(l=o?Z.call(i,f):p[c])>-1&&(i[l]=!(a[l]=f))}}else v=g(v===a?v.splice(h,v.length):v),o?o(null,a,v,u):Q.apply(a,v)})}function y(e){for(var t,n,r,i=e.length,o=C.relative[e[0].type],a=o||C.relative[" "],s=o?1:0,u=d(function(e){return e===t},a,!0),l=d(function(e){return Z.call(t,e)>-1},a,!0),c=[function(e,n,r){return!o&&(r||n!==j)||((t=n).nodeType?u(e,n,r):l(e,n,r))}];i>s;s++)if(n=C.relative[e[s].type])c=[d(h(c),n)];else{if(n=C.filter[e[s].type].apply(null,e[s].matches),n[P]){for(r=++s;i>r&&!C.relative[e[r].type];r++);return m(s>1&&h(c),s>1&&p(e.slice(0,s-1)).replace(at,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&p(e))}c.push(n)}return h(c)}function v(e,t){var n=0,r=t.length>0,o=e.length>0,s=function(i,s,u,l,c){var f,p,d,h=[],m=0,y="0",v=i&&[],b=null!=c,x=j,T=i||o&&C.find.TAG("*",c&&s.parentNode||s),w=$+=null==x?1:Math.E;for(b&&(j=s!==L&&s,N=n);null!=(f=T[y]);y++){if(o&&f){for(p=0;d=e[p];p++)if(d(f,s,u)){l.push(f);break}b&&($=w,N=++n)}r&&((f=!d&&f)&&m--,i&&v.push(f))}if(m+=y,r&&y!==m){for(p=0;d=t[p];p++)d(v,h,s,u);if(i){if(m>0)for(;y--;)v[y]||h[y]||(h[y]=G.call(l));h=g(h)}Q.apply(l,h),b&&!i&&h.length>0&&m+t.length>1&&a.uniqueSort(l)}return b&&($=w,j=x),v};return r?i(s):s}function b(e,t,n){for(var r=0,i=t.length;i>r;r++)a(e,t[r],n);return n}function x(e,t,n,r){var i,o,a,s,u,l=f(e);if(!r&&1===l.length){if(o=l[0]=l[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&9===t.nodeType&&!M&&C.relative[o[1].type]){if(t=C.find.ID(a.matches[0].replace(xt,Tt),t)[0],!t)return n;e=e.slice(o.shift().value.length)}for(i=pt.needsContext.test(e)?-1:o.length-1;i>=0&&(a=o[i],!C.relative[s=a.type]);i--)if((u=C.find[s])&&(r=u(a.matches[0].replace(xt,Tt),dt.test(o[0].type)&&t.parentNode||t))){if(o.splice(i,1),e=r.length&&p(o),!e)return Q.apply(n,K.call(r,0)),n;break}}return S(e,l)(r,t,M,n,dt.test(e)),n}function T(){}var w,N,C,k,E,S,A,j,D,L,H,M,q,_,F,O,B,P="sizzle"+-new Date,R=e.document,W={},$=0,I=0,z=r(),X=r(),U=r(),V=typeof t,Y=1<<31,J=[],G=J.pop,Q=J.push,K=J.slice,Z=J.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},et="[\\x20\\t\\r\\n\\f]",tt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",nt=tt.replace("w","w#"),rt="([*^$|!~]?=)",it="\\["+et+"*("+tt+")"+et+"*(?:"+rt+et+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+nt+")|)|)"+et+"*\\]",ot=":("+tt+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+it.replace(3,8)+")*)|.*)\\)|)",at=RegExp("^"+et+"+|((?:^|[^\\\\])(?:\\\\.)*)"+et+"+$","g"),ut=RegExp("^"+et+"*,"+et+"*"),lt=RegExp("^"+et+"*([\\x20\\t\\r\\n\\f>+~])"+et+"*"),ct=RegExp(ot),ft=RegExp("^"+nt+"$"),pt={ID:RegExp("^#("+tt+")"),CLASS:RegExp("^\\.("+tt+")"),NAME:RegExp("^\\[name=['\"]?("+tt+")['\"]?\\]"),TAG:RegExp("^("+tt.replace("w","w*")+")"),ATTR:RegExp("^"+it),PSEUDO:RegExp("^"+ot),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+et+"*(even|odd|(([+-]|)(\\d*)n|)"+et+"*(?:([+-]|)"+et+"*(\\d+)|))"+et+"*\\)|)","i"),needsContext:RegExp("^"+et+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+et+"*((?:-\\d)?\\d*)"+et+"*\\)|)(?=[^-]|$)","i")},dt=/[\x20\t\r\n\f]*[+~]/,ht=/\{\s*\[native code\]\s*\}/,gt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,mt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,vt=/'|\\/g,bt=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,xt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,Tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{K.call(H.childNodes,0)[0].nodeType}catch(wt){K=function(e){for(var t,n=[];t=this[e];e++)n.push(t);return n}}E=a.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},D=a.setDocument=function(e){var r=e?e.ownerDocument||e:R;return r!==L&&9===r.nodeType&&r.documentElement?(L=r,H=r.documentElement,M=E(r),W.tagNameNoComments=o(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),W.attributes=o(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),W.getByClassName=o(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),W.getByName=o(function(e){e.id=P+0,e.innerHTML="<a name='"+P+"'></a><div name='"+P+"'></div>",H.insertBefore(e,H.firstChild);var t=r.getElementsByName&&r.getElementsByName(P).length===2+r.getElementsByName(P+0).length;return W.getIdNotName=!r.getElementById(P),H.removeChild(e),t}),C.attrHandle=o(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==V&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},W.getIdNotName?(C.find.ID=function(e,t){if(typeof t.getElementById!==V&&!M){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},C.filter.ID=function(e){var t=e.replace(xt,Tt);return function(e){return e.getAttribute("id")===t}}):(C.find.ID=function(e,n){if(typeof n.getElementById!==V&&!M){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==V&&r.getAttributeNode("id").value===e?[r]:t:[]}},C.filter.ID=function(e){var t=e.replace(xt,Tt);return function(e){var n=typeof e.getAttributeNode!==V&&e.getAttributeNode("id");return n&&n.value===t}}),C.find.TAG=W.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==V?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i];i++)1===n.nodeType&&r.push(n);return r}return o},C.find.NAME=W.getByName&&function(e,n){return typeof n.getElementsByName!==V?n.getElementsByName(name):t},C.find.CLASS=W.getByClassName&&function(e,n){return typeof n.getElementsByClassName===V||M?t:n.getElementsByClassName(e)},_=[],q=[":focus"],(W.qsa=n(r.querySelectorAll))&&(o(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||q.push("\\["+et+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||q.push(":checked")}),o(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&q.push("[*^$]="+et+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),q.push(",.*:")})),(W.matchesSelector=n(F=H.matchesSelector||H.mozMatchesSelector||H.webkitMatchesSelector||H.oMatchesSelector||H.msMatchesSelector))&&o(function(e){W.disconnectedMatch=F.call(e,"div"),F.call(e,"[s!='']:x"),_.push("!=",ot)}),q=RegExp(q.join("|")),_=RegExp(_.join("|")),O=n(H.contains)||H.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},B=H.compareDocumentPosition?function(e,t){var n;return e===t?(A=!0,0):(n=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&n||e.parentNode&&11===e.parentNode.nodeType?e===r||O(R,e)?-1:t===r||O(R,t)?1:0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var n,i=0,o=e.parentNode,a=t.parentNode,u=[e],l=[t];if(e===t)return A=!0,0;if(e.sourceIndex&&t.sourceIndex)return(~t.sourceIndex||Y)-(O(R,e)&&~e.sourceIndex||Y);if(!o||!a)return e===r?-1:t===r?1:o?-1:a?1:0;if(o===a)return s(e,t);for(n=e;n=n.parentNode;)u.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;u[i]===l[i];)i++;return i?s(u[i],l[i]):u[i]===R?-1:l[i]===R?1:0},A=!1,[0,0].sort(B),W.detectDuplicates=A,L):L},a.matches=function(e,t){return a(e,null,null,t)},a.matchesSelector=function(e,t){if((e.ownerDocument||e)!==L&&D(e),t=t.replace(bt,"='$1']"),!(!W.matchesSelector||M||_&&_.test(t)||q.test(t)))try{var n=F.call(e,t);if(n||W.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return a(t,L,null,[e]).length>0},a.contains=function(e,t){return(e.ownerDocument||e)!==L&&D(e),O(e,t)},a.attr=function(e,t){var n;return(e.ownerDocument||e)!==L&&D(e),M||(t=t.toLowerCase()),(n=C.attrHandle[t])?n(e):M||W.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},a.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},a.uniqueSort=function(e){var t,n=[],r=1,i=0;if(A=!W.detectDuplicates,e.sort(B),A){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return e},k=a.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=k(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=k(t);return n},C=a.selectors={cacheLength:50,createPseudo:i,match:pt,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xt,Tt),e[3]=(e[4]||e[5]||"").replace(xt,Tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||a.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&a.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return pt.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&ct.test(n)&&(t=f(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(xt,Tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=z[e+" "];return t||(t=RegExp("(^|"+et+")"+e+"("+et+"|$)"))&&z(e,function(e){return t.test(e.className||typeof e.getAttribute!==V&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=a.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.substr(i.length-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){for(;g;){for(f=t;f=f[g];)if(s?f.nodeName.toLowerCase()===y:1===f.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(c=m[P]||(m[P]={}),l=c[e]||[],d=l[0]===$&&l[1],p=l[0]===$&&l[2],f=d&&m.childNodes[d];f=++d&&f&&f[g]||(p=d=0)||h.pop();)if(1===f.nodeType&&++p&&f===t){c[e]=[$,d,p];break}}else if(v&&(l=(t[P]||(t[P]={}))[e])&&l[0]===$)p=l[1];else for(;(f=++d&&f&&f[g]||(p=d=0)||h.pop())&&((s?f.nodeName.toLowerCase()!==y:1!==f.nodeType)||!++p||(v&&((f[P]||(f[P]={}))[e]=[$,p]),f!==t)););return p-=i,p===r||0===p%r&&p/r>=0}}},PSEUDO:function(e,t){var n,r=C.pseudos[e]||C.setFilters[e.toLowerCase()]||a.error("unsupported pseudo: "+e);return r[P]?r(t):r.length>1?(n=[e,e,"",t],C.setFilters.hasOwnProperty(e.toLowerCase())?i(function(e,n){for(var i,o=r(e,t),a=o.length;a--;)i=Z.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:i(function(e){var t=[],n=[],r=S(e.replace(at,"$1"));return r[P]?i(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:i(function(e){return function(t){return a(e,t).length>0}}),contains:i(function(e){return function(t){return(t.textContent||t.innerText||k(t)).indexOf(e)>-1}}),lang:i(function(e){return ft.test(e||"")||a.error("unsupported lang: "+e),e=e.replace(xt,Tt).toLowerCase(),function(t){var n;do if(n=M?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===H},focus:function(e){return e===L.activeElement&&(!L.hasFocus||L.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!C.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return mt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}};for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})C.pseudos[w]=u(w);for(w in{submit:!0,reset:!0})C.pseudos[w]=l(w);S=a.compile=function(e,t){var n,r=[],i=[],o=U[e+" "];if(!o){for(t||(t=f(e)),n=t.length;n--;)o=y(t[n]),o[P]?r.push(o):i.push(o);o=U(e,v(i,r))}return o},C.pseudos.nth=C.pseudos.eq,C.filters=T.prototype=C.pseudos,C.setFilters=new T,D(),a.attr=st.attr,st.find=a,st.expr=a.selectors,st.expr[":"]=st.expr.pseudos,st.unique=a.uniqueSort,st.text=a.getText,st.isXMLDoc=a.isXML,st.contains=a.contains}(e);var Pt=/Until$/,Rt=/^(?:parents|prev(?:Until|All))/,Wt=/^.[^:#\[\.,]*$/,$t=st.expr.match.needsContext,It={children:!0,contents:!0,next:!0,prev:!0};st.fn.extend({find:function(e){var t,n,r;if("string"!=typeof e)return r=this,this.pushStack(st(e).filter(function(){for(t=0;r.length>t;t++)if(st.contains(r[t],this))return!0}));for(n=[],t=0;this.length>t;t++)st.find(e,this[t],n);return n=this.pushStack(st.unique(n)),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=st(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(st.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(f(this,e,!1))},filter:function(e){return this.pushStack(f(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?$t.test(e)?st(e,this.context).index(this[0])>=0:st.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=$t.test(e)||"string"!=typeof e?st(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:st.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}return this.pushStack(o.length>1?st.unique(o):o)},index:function(e){return e?"string"==typeof e?st.inArray(this[0],st(e)):st.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?st(e,t):st.makeArray(e&&e.nodeType?[e]:e),r=st.merge(this.get(),n);return this.pushStack(st.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),st.fn.andSelf=st.fn.addBack,st.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return st.dir(e,"parentNode")},parentsUntil:function(e,t,n){return st.dir(e,"parentNode",n)},next:function(e){return c(e,"nextSibling")},prev:function(e){return c(e,"previousSibling")
5
- },nextAll:function(e){return st.dir(e,"nextSibling")},prevAll:function(e){return st.dir(e,"previousSibling")},nextUntil:function(e,t,n){return st.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return st.dir(e,"previousSibling",n)},siblings:function(e){return st.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return st.sibling(e.firstChild)},contents:function(e){return st.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:st.merge([],e.childNodes)}},function(e,t){st.fn[e]=function(n,r){var i=st.map(this,t,n);return Pt.test(e)||(r=n),r&&"string"==typeof r&&(i=st.filter(r,i)),i=this.length>1&&!It[e]?st.unique(i):i,this.length>1&&Rt.test(e)&&(i=i.reverse()),this.pushStack(i)}}),st.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?st.find.matchesSelector(t[0],e)?[t[0]]:[]:st.find.matches(e,t)},dir:function(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!st(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var zt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Xt=/ jQuery\d+="(?:null|\d+)"/g,Ut=RegExp("<(?:"+zt+")[\\s/>]","i"),Vt=/^\s+/,Yt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Jt=/<([\w:]+)/,Gt=/<tbody/i,Qt=/<|&#?\w+;/,Kt=/<(?:script|style|link)/i,Zt=/^(?:checkbox|radio)$/i,en=/checked\s*(?:[^=]|=\s*.checked.)/i,tn=/^$|\/(?:java|ecma)script/i,nn=/^true\/(.*)/,rn=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,on={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:st.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},an=p(V),sn=an.appendChild(V.createElement("div"));on.optgroup=on.option,on.tbody=on.tfoot=on.colgroup=on.caption=on.thead,on.th=on.td,st.fn.extend({text:function(e){return st.access(this,function(e){return e===t?st.text(this):this.empty().append((this[0]&&this[0].ownerDocument||V).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(st.isFunction(e))return this.each(function(t){st(this).wrapAll(e.call(this,t))});if(this[0]){var t=st(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return st.isFunction(e)?this.each(function(t){st(this).wrapInner(e.call(this,t))}):this.each(function(){var t=st(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=st.isFunction(e);return this.each(function(n){st(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){st.nodeName(this,"body")||st(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||st.filter(e,[n]).length>0)&&(t||1!==n.nodeType||st.cleanData(b(n)),n.parentNode&&(t&&st.contains(n.ownerDocument,n)&&m(b(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&st.cleanData(b(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&st.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return st.clone(this,e,t)})},html:function(e){return st.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(Xt,""):t;if(!("string"!=typeof e||Kt.test(e)||!st.support.htmlSerialize&&Ut.test(e)||!st.support.leadingWhitespace&&Vt.test(e)||on[(Jt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(Yt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(st.cleanData(b(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=st.isFunction(e);return t||"string"==typeof e||(e=st(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;(n&&1===this.nodeType||11===this.nodeType)&&(st(this).remove(),t?t.parentNode.insertBefore(e,t):n.appendChild(e))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=et.apply([],e);var i,o,a,s,u,l,c=0,f=this.length,p=this,m=f-1,y=e[0],v=st.isFunction(y);if(v||!(1>=f||"string"!=typeof y||st.support.checkClone)&&en.test(y))return this.each(function(i){var o=p.eq(i);v&&(e[0]=y.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(f&&(i=st.buildFragment(e,this[0].ownerDocument,!1,this),o=i.firstChild,1===i.childNodes.length&&(i=o),o)){for(n=n&&st.nodeName(o,"tr"),a=st.map(b(i,"script"),h),s=a.length;f>c;c++)u=i,c!==m&&(u=st.clone(u,!0,!0),s&&st.merge(a,b(u,"script"))),r.call(n&&st.nodeName(this[c],"table")?d(this[c],"tbody"):this[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,st.map(a,g),c=0;s>c;c++)u=a[c],tn.test(u.type||"")&&!st._data(u,"globalEval")&&st.contains(l,u)&&(u.src?st.ajax({url:u.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):st.globalEval((u.text||u.textContent||u.innerHTML||"").replace(rn,"")));i=o=null}return this}}),st.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){st.fn[e]=function(e){for(var n,r=0,i=[],o=st(e),a=o.length-1;a>=r;r++)n=r===a?this:this.clone(!0),st(o[r])[t](n),tt.apply(i,n.get());return this.pushStack(i)}}),st.extend({clone:function(e,t,n){var r,i,o,a,s,u=st.contains(e.ownerDocument,e);if(st.support.html5Clone||st.isXMLDoc(e)||!Ut.test("<"+e.nodeName+">")?s=e.cloneNode(!0):(sn.innerHTML=e.outerHTML,sn.removeChild(s=sn.firstChild)),!(st.support.noCloneEvent&&st.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||st.isXMLDoc(e)))for(r=b(s),i=b(e),a=0;null!=(o=i[a]);++a)r[a]&&v(o,r[a]);if(t)if(n)for(i=i||b(e),r=r||b(s),a=0;null!=(o=i[a]);a++)y(o,r[a]);else y(e,s);return r=b(s,"script"),r.length>0&&m(r,!u&&b(e,"script")),r=i=o=null,s},buildFragment:function(e,t,n,r){for(var i,o,a,s,u,l,c,f=e.length,d=p(t),h=[],g=0;f>g;g++)if(o=e[g],o||0===o)if("object"===st.type(o))st.merge(h,o.nodeType?[o]:o);else if(Qt.test(o)){for(s=s||d.appendChild(t.createElement("div")),a=(Jt.exec(o)||["",""])[1].toLowerCase(),u=on[a]||on._default,s.innerHTML=u[1]+o.replace(Yt,"<$1></$2>")+u[2],c=u[0];c--;)s=s.lastChild;if(!st.support.leadingWhitespace&&Vt.test(o)&&h.push(t.createTextNode(Vt.exec(o)[0])),!st.support.tbody)for(o="table"!==a||Gt.test(o)?"<table>"!==u[1]||Gt.test(o)?0:s:s.firstChild,c=o&&o.childNodes.length;c--;)st.nodeName(l=o.childNodes[c],"tbody")&&!l.childNodes.length&&o.removeChild(l);for(st.merge(h,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=d.lastChild}else h.push(t.createTextNode(o));for(s&&d.removeChild(s),st.support.appendChecked||st.grep(b(h,"input"),x),g=0;o=h[g++];)if((!r||-1===st.inArray(o,r))&&(i=st.contains(o.ownerDocument,o),s=b(d.appendChild(o),"script"),i&&m(s),n))for(c=0;o=s[c++];)tn.test(o.type||"")&&n.push(o);return s=null,d},cleanData:function(e,n){for(var r,i,o,a,s=0,u=st.expando,l=st.cache,c=st.support.deleteExpando,f=st.event.special;null!=(o=e[s]);s++)if((n||st.acceptData(o))&&(i=o[u],r=i&&l[i])){if(r.events)for(a in r.events)f[a]?st.event.remove(o,a):st.removeEvent(o,a,r.handle);l[i]&&(delete l[i],c?delete o[u]:o.removeAttribute!==t?o.removeAttribute(u):o[u]=null,K.push(i))}}});var un,ln,cn,fn=/alpha\([^)]*\)/i,pn=/opacity\s*=\s*([^)]*)/,dn=/^(top|right|bottom|left)$/,hn=/^(none|table(?!-c[ea]).+)/,gn=/^margin/,mn=RegExp("^("+ut+")(.*)$","i"),yn=RegExp("^("+ut+")(?!px)[a-z%]+$","i"),vn=RegExp("^([+-])=("+ut+")","i"),bn={BODY:"block"},xn={position:"absolute",visibility:"hidden",display:"block"},Tn={letterSpacing:0,fontWeight:400},wn=["Top","Right","Bottom","Left"],Nn=["Webkit","O","Moz","ms"];st.fn.extend({css:function(e,n){return st.access(this,function(e,n,r){var i,o,a={},s=0;if(st.isArray(n)){for(i=ln(e),o=n.length;o>s;s++)a[n[s]]=st.css(e,n[s],!1,i);return a}return r!==t?st.style(e,n,r):st.css(e,n)},e,n,arguments.length>1)},show:function(){return N(this,!0)},hide:function(){return N(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:w(this))?st(this).show():st(this).hide()})}}),st.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=un(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":st.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=st.camelCase(n),l=e.style;if(n=st.cssProps[u]||(st.cssProps[u]=T(l,u)),s=st.cssHooks[n]||st.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=vn.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(st.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||st.cssNumber[u]||(r+="px"),st.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=st.camelCase(n);return n=st.cssProps[u]||(st.cssProps[u]=T(e.style,u)),s=st.cssHooks[n]||st.cssHooks[u],s&&"get"in s&&(o=s.get(e,!0,r)),o===t&&(o=un(e,n,i)),"normal"===o&&n in Tn&&(o=Tn[n]),r?(a=parseFloat(o),r===!0||st.isNumeric(a)?a||0:o):o},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(ln=function(t){return e.getComputedStyle(t,null)},un=function(e,n,r){var i,o,a,s=r||ln(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||st.contains(e.ownerDocument,e)||(u=st.style(e,n)),yn.test(u)&&gn.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):V.documentElement.currentStyle&&(ln=function(e){return e.currentStyle},un=function(e,n,r){var i,o,a,s=r||ln(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),yn.test(u)&&!dn.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u}),st.each(["height","width"],function(e,n){st.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&hn.test(st.css(e,"display"))?st.swap(e,xn,function(){return E(e,n,i)}):E(e,n,i):t},set:function(e,t,r){var i=r&&ln(e);return C(e,t,r?k(e,n,r,st.support.boxSizing&&"border-box"===st.css(e,"boxSizing",!1,i),i):0)}}}),st.support.opacity||(st.cssHooks.opacity={get:function(e,t){return pn.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=st.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===st.trim(o.replace(fn,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=fn.test(o)?o.replace(fn,i):o+" "+i)}}),st(function(){st.support.reliableMarginRight||(st.cssHooks.marginRight={get:function(e,n){return n?st.swap(e,{display:"inline-block"},un,[e,"marginRight"]):t}}),!st.support.pixelPosition&&st.fn.position&&st.each(["top","left"],function(e,n){st.cssHooks[n]={get:function(e,r){return r?(r=un(e,n),yn.test(r)?st(e).position()[n]+"px":r):t}}})}),st.expr&&st.expr.filters&&(st.expr.filters.hidden=function(e){return 0===e.offsetWidth&&0===e.offsetHeight||!st.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||st.css(e,"display"))},st.expr.filters.visible=function(e){return!st.expr.filters.hidden(e)}),st.each({margin:"",padding:"",border:"Width"},function(e,t){st.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+wn[r]+t]=o[r]||o[r-2]||o[0];return i}},gn.test(e)||(st.cssHooks[e+t].set=C)});var Cn=/%20/g,kn=/\[\]$/,En=/\r?\n/g,Sn=/^(?:submit|button|image|reset)$/i,An=/^(?:input|select|textarea|keygen)/i;st.fn.extend({serialize:function(){return st.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=st.prop(this,"elements");return e?st.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!st(this).is(":disabled")&&An.test(this.nodeName)&&!Sn.test(e)&&(this.checked||!Zt.test(e))}).map(function(e,t){var n=st(this).val();return null==n?null:st.isArray(n)?st.map(n,function(e){return{name:t.name,value:e.replace(En,"\r\n")}}):{name:t.name,value:n.replace(En,"\r\n")}}).get()}}),st.param=function(e,n){var r,i=[],o=function(e,t){t=st.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=st.ajaxSettings&&st.ajaxSettings.traditional),st.isArray(e)||e.jquery&&!st.isPlainObject(e))st.each(e,function(){o(this.name,this.value)});else for(r in e)j(r,e[r],n,o);return i.join("&").replace(Cn,"+")};var jn,Dn,Ln=st.now(),Hn=/\?/,Mn=/#.*$/,qn=/([?&])_=[^&]*/,_n=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Fn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,On=/^(?:GET|HEAD)$/,Bn=/^\/\//,Pn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Rn=st.fn.load,Wn={},$n={},In="*/".concat("*");try{Dn=Y.href}catch(zn){Dn=V.createElement("a"),Dn.href="",Dn=Dn.href}jn=Pn.exec(Dn.toLowerCase())||[],st.fn.load=function(e,n,r){if("string"!=typeof e&&Rn)return Rn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),st.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(o="POST"),s.length>0&&st.ajax({url:e,type:o,dataType:"html",data:n}).done(function(e){a=arguments,s.html(i?st("<div>").append(st.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,a||[e.responseText,t,e])}),this},st.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){st.fn[t]=function(e){return this.on(t,e)}}),st.each(["get","post"],function(e,n){st[n]=function(e,r,i,o){return st.isFunction(r)&&(o=o||i,i=r,r=t),st.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),st.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Dn,type:"GET",isLocal:Fn.test(jn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":In,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":st.parseJSON,"text xml":st.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?H(H(e,st.ajaxSettings),t):H(st.ajaxSettings,e)},ajaxPrefilter:D(Wn),ajaxTransport:D($n),ajax:function(e,n){function r(e,n,r,s){var l,f,v,b,T,N=n;2!==x&&(x=2,u&&clearTimeout(u),i=t,a=s||"",w.readyState=e>0?4:0,r&&(b=M(p,w,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=w.getResponseHeader("Last-Modified"),T&&(st.lastModified[o]=T),T=w.getResponseHeader("etag"),T&&(st.etag[o]=T)),304===e?(l=!0,N="notmodified"):(l=q(p,b),N=l.state,f=l.data,v=l.error,l=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),w.status=e,w.statusText=(n||N)+"",l?g.resolveWith(d,[f,N,w]):g.rejectWith(d,[w,N,v]),w.statusCode(y),y=t,c&&h.trigger(l?"ajaxSuccess":"ajaxError",[w,p,l?f:v]),m.fireWith(d,[w,N]),c&&(h.trigger("ajaxComplete",[w,p]),--st.active||st.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var i,o,a,s,u,l,c,f,p=st.ajaxSetup({},n),d=p.context||p,h=p.context&&(d.nodeType||d.jquery)?st(d):st.event,g=st.Deferred(),m=st.Callbacks("once memory"),y=p.statusCode||{},v={},b={},x=0,T="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!s)for(s={};t=_n.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=b[n]=b[n]||e,v[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)y[t]=[y[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||T;return i&&i.abort(t),r(0,t),this}};if(g.promise(w).complete=m.add,w.success=w.done,w.error=w.fail,p.url=((e||p.url||Dn)+"").replace(Mn,"").replace(Bn,jn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=st.trim(p.dataType||"*").toLowerCase().match(lt)||[""],null==p.crossDomain&&(l=Pn.exec(p.url.toLowerCase()),p.crossDomain=!(!l||l[1]===jn[1]&&l[2]===jn[2]&&(l[3]||("http:"===l[1]?80:443))==(jn[3]||("http:"===jn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=st.param(p.data,p.traditional)),L(Wn,p,n,w),2===x)return w;c=p.global,c&&0===st.active++&&st.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!On.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(Hn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=qn.test(o)?o.replace(qn,"$1_="+Ln++):o+(Hn.test(o)?"&":"?")+"_="+Ln++)),p.ifModified&&(st.lastModified[o]&&w.setRequestHeader("If-Modified-Since",st.lastModified[o]),st.etag[o]&&w.setRequestHeader("If-None-Match",st.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&w.setRequestHeader("Content-Type",p.contentType),w.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+In+"; q=0.01":""):p.accepts["*"]);for(f in p.headers)w.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(p.beforeSend.call(d,w,p)===!1||2===x))return w.abort();T="abort";for(f in{success:1,error:1,complete:1})w[f](p[f]);if(i=L($n,p,n,w)){w.readyState=1,c&&h.trigger("ajaxSend",[w,p]),p.async&&p.timeout>0&&(u=setTimeout(function(){w.abort("timeout")},p.timeout));try{x=1,i.send(v,r)}catch(N){if(!(2>x))throw N;r(-1,N)}}else r(-1,"No Transport");return w},getScript:function(e,n){return st.get(e,t,n,"script")},getJSON:function(e,t,n){return st.get(e,t,n,"json")}}),st.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return st.globalEval(e),e}}}),st.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),st.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=V.head||st("head")[0]||V.documentElement;return{send:function(t,i){n=V.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Xn=[],Un=/(=)\?(?=&|$)|\?\?/;st.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xn.pop()||st.expando+"_"+Ln++;return this[e]=!0,e}}),st.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Un.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Un.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=st.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Un,"$1"+o):n.jsonp!==!1&&(n.url+=(Hn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||st.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Xn.push(o)),s&&st.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Vn,Yn,Jn=0,Gn=e.ActiveXObject&&function(){var e;for(e in Vn)Vn[e](t,!0)};st.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&_()||F()}:_,Yn=st.ajaxSettings.xhr(),st.support.cors=!!Yn&&"withCredentials"in Yn,Yn=st.support.ajax=!!Yn,Yn&&st.ajaxTransport(function(n){if(!n.crossDomain||st.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,f,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=st.noop,Gn&&delete Vn[a]),i)4!==u.readyState&&u.abort();else{f={},s=u.status,p=u.responseXML,c=u.getAllResponseHeaders(),p&&p.documentElement&&(f.xml=p),"string"==typeof u.responseText&&(f.text=u.responseText);try{l=u.statusText}catch(d){l=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=f.text?200:404}}catch(h){i||o(-1,h)}f&&o(s,l,f,c)},n.async?4===u.readyState?setTimeout(r):(a=++Jn,Gn&&(Vn||(Vn={},st(e).unload(Gn)),Vn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Qn,Kn,Zn=/^(?:toggle|show|hide)$/,er=RegExp("^(?:([+-])=|)("+ut+")([a-z%]*)$","i"),tr=/queueHooks$/,nr=[W],rr={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=er.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(st.cssNumber[e]?"":"px"),"px"!==r&&s){s=st.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,st.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};st.Animation=st.extend(P,{tweener:function(e,t){st.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],rr[n]=rr[n]||[],rr[n].unshift(t)},prefilter:function(e,t){t?nr.unshift(e):nr.push(e)}}),st.Tween=$,$.prototype={constructor:$,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(st.cssNumber[n]?"":"px")},cur:function(){var e=$.propHooks[this.prop];return e&&e.get?e.get(this):$.propHooks._default.get(this)},run:function(e){var t,n=$.propHooks[this.prop];return this.pos=t=this.options.duration?st.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):$.propHooks._default.set(this),this}},$.prototype.init.prototype=$.prototype,$.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=st.css(e.elem,e.prop,"auto"),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){st.fx.step[e.prop]?st.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[st.cssProps[e.prop]]||st.cssHooks[e.prop])?st.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},$.propHooks.scrollTop=$.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},st.each(["toggle","show","hide"],function(e,t){var n=st.fn[t];st.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(I(t,!0),e,r,i)}}),st.fn.extend({fadeTo:function(e,t,n,r){return this.filter(w).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=st.isEmptyObject(e),o=st.speed(t,n,r),a=function(){var t=P(this,st.extend({},e),o);a.finish=function(){t.stop(!0)},(i||st._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=st.timers,a=st._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&tr.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&st.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=st._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=st.timers,a=r?r.length:0;for(n.finish=!0,st.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),st.each({slideDown:I("show"),slideUp:I("hide"),slideToggle:I("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){st.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),st.speed=function(e,t,n){var r=e&&"object"==typeof e?st.extend({},e):{complete:n||!n&&t||st.isFunction(e)&&e,duration:e,easing:n&&t||t&&!st.isFunction(t)&&t};return r.duration=st.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in st.fx.speeds?st.fx.speeds[r.duration]:st.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){st.isFunction(r.old)&&r.old.call(this),r.queue&&st.dequeue(this,r.queue)},r},st.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},st.timers=[],st.fx=$.prototype.init,st.fx.tick=function(){var e,n=st.timers,r=0;for(Qn=st.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||st.fx.stop(),Qn=t},st.fx.timer=function(e){e()&&st.timers.push(e)&&st.fx.start()},st.fx.interval=13,st.fx.start=function(){Kn||(Kn=setInterval(st.fx.tick,st.fx.interval))},st.fx.stop=function(){clearInterval(Kn),Kn=null},st.fx.speeds={slow:600,fast:200,_default:400},st.fx.step={},st.expr&&st.expr.filters&&(st.expr.filters.animated=function(e){return st.grep(st.timers,function(t){return e===t.elem}).length}),st.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){st.offset.setOffset(this,e,t)});var n,r,i={top:0,left:0},o=this[0],a=o&&o.ownerDocument;if(a)return n=a.documentElement,st.contains(n,o)?(o.getBoundingClientRect!==t&&(i=o.getBoundingClientRect()),r=z(a),{top:i.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:i.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):i},st.offset={setOffset:function(e,t,n){var r=st.css(e,"position");"static"===r&&(e.style.position="relative");var i,o,a=st(e),s=a.offset(),u=st.css(e,"top"),l=st.css(e,"left"),c=("absolute"===r||"fixed"===r)&&st.inArray("auto",[u,l])>-1,f={},p={};c?(p=a.position(),i=p.top,o=p.left):(i=parseFloat(u)||0,o=parseFloat(l)||0),st.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(f.top=t.top-s.top+i),null!=t.left&&(f.left=t.left-s.left+o),"using"in t?t.using.call(e,f):a.css(f)}},st.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===st.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),st.nodeName(e[0],"html")||(n=e.offset()),n.top+=st.css(e[0],"borderTopWidth",!0),n.left+=st.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-st.css(r,"marginTop",!0),left:t.left-n.left-st.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||V.documentElement;e&&!st.nodeName(e,"html")&&"static"===st.css(e,"position");)e=e.offsetParent;return e||V.documentElement})}}),st.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);st.fn[e]=function(i){return st.access(this,function(e,i,o){var a=z(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?st(a).scrollLeft():o,r?o:st(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}}),st.each({Height:"height",Width:"width"},function(e,n){st.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){st.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return st.access(this,function(n,r,i){var o;return st.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?st.css(n,r,s):st.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=st,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return st})})(window);
6
- //@ sourceMappingURL=jquery.min.map
7
- $.noConflict();
8
- }
9
- //raphael
10
- // ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” \\
11
- // ā”‚ RaphaĆ«l 2.1.0 - JavaScript Vector Library ā”‚ \\
12
- // ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤ \\
13
- // ā”‚ Copyright Ā© 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com) ā”‚ \\
14
- // ā”‚ Copyright Ā© 2008-2012 Sencha Labs (http://sencha.com) ā”‚ \\
15
- // ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤ \\
16
- // ā”‚ Licensed under the MIT (http://raphaeljs.com/license.html) license.ā”‚ \\
17
- // ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ \\
18
-
19
- (function(a){var b="0.3.4",c="hasOwnProperty",d=/[\.\/]/,e="*",f=function(){},g=function(a,b){return a-b},h,i,j={n:{}},k=function(a,b){var c=j,d=i,e=Array.prototype.slice.call(arguments,2),f=k.listeners(a),l=0,m=!1,n,o=[],p={},q=[],r=h,s=[];h=a,i=0;for(var t=0,u=f.length;t<u;t++)"zIndex"in f[t]&&(o.push(f[t].zIndex),f[t].zIndex<0&&(p[f[t].zIndex]=f[t]));o.sort(g);while(o[l]<0){n=p[o[l++]],q.push(n.apply(b,e));if(i){i=d;return q}}for(t=0;t<u;t++){n=f[t];if("zIndex"in n)if(n.zIndex==o[l]){q.push(n.apply(b,e));if(i)break;do{l++,n=p[o[l]],n&&q.push(n.apply(b,e));if(i)break}while(n)}else p[n.zIndex]=n;else{q.push(n.apply(b,e));if(i)break}}i=d,h=r;return q.length?q:null};k.listeners=function(a){var b=a.split(d),c=j,f,g,h,i,k,l,m,n,o=[c],p=[];for(i=0,k=b.length;i<k;i++){n=[];for(l=0,m=o.length;l<m;l++){c=o[l].n,g=[c[b[i]],c[e]],h=2;while(h--)f=g[h],f&&(n.push(f),p=p.concat(f.f||[]))}o=n}return p},k.on=function(a,b){var c=a.split(d),e=j;for(var g=0,h=c.length;g<h;g++)e=e.n,!e[c[g]]&&(e[c[g]]={n:{}}),e=e[c[g]];e.f=e.f||[];for(g=0,h=e.f.length;g<h;g++)if(e.f[g]==b)return f;e.f.push(b);return function(a){+a==+a&&(b.zIndex=+a)}},k.stop=function(){i=1},k.nt=function(a){if(a)return(new RegExp("(?:\\.|\\/|^)"+a+"(?:\\.|\\/|$)")).test(h);return h},k.off=k.unbind=function(a,b){var f=a.split(d),g,h,i,k,l,m,n,o=[j];for(k=0,l=f.length;k<l;k++)for(m=0;m<o.length;m+=i.length-2){i=[m,1],g=o[m].n;if(f[k]!=e)g[f[k]]&&i.push(g[f[k]]);else for(h in g)g[c](h)&&i.push(g[h]);o.splice.apply(o,i)}for(k=0,l=o.length;k<l;k++){g=o[k];while(g.n){if(b){if(g.f){for(m=0,n=g.f.length;m<n;m++)if(g.f[m]==b){g.f.splice(m,1);break}!g.f.length&&delete g.f}for(h in g.n)if(g.n[c](h)&&g.n[h].f){var p=g.n[h].f;for(m=0,n=p.length;m<n;m++)if(p[m]==b){p.splice(m,1);break}!p.length&&delete g.n[h].f}}else{delete g.f;for(h in g.n)g.n[c](h)&&g.n[h].f&&delete g.n[h].f}g=g.n}}},k.once=function(a,b){var c=function(){var d=b.apply(this,arguments);k.unbind(a,c);return d};return k.on(a,c)},k.version=b,k.toString=function(){return"You are running Eve "+b},typeof module!="undefined"&&module.exports?module.exports=k:typeof define!="undefined"?define("eve",[],function(){return k}):a.eve=k})(this),function(){function cF(a){for(var b=0;b<cy.length;b++)cy[b].el.paper==a&&cy.splice(b--,1)}function cE(b,d,e,f,h,i){e=Q(e);var j,k,l,m=[],o,p,q,t=b.ms,u={},v={},w={};if(f)for(y=0,z=cy.length;y<z;y++){var x=cy[y];if(x.el.id==d.id&&x.anim==b){x.percent!=e?(cy.splice(y,1),l=1):k=x,d.attr(x.totalOrigin);break}}else f=+v;for(var y=0,z=b.percents.length;y<z;y++){if(b.percents[y]==e||b.percents[y]>f*b.top){e=b.percents[y],p=b.percents[y-1]||0,t=t/b.top*(e-p),o=b.percents[y+1],j=b.anim[e];break}f&&d.attr(b.anim[b.percents[y]])}if(!!j){if(!k){for(var A in j)if(j[g](A))if(U[g](A)||d.paper.customAttributes[g](A)){u[A]=d.attr(A),u[A]==null&&(u[A]=T[A]),v[A]=j[A];switch(U[A]){case C:w[A]=(v[A]-u[A])/t;break;case"colour":u[A]=a.getRGB(u[A]);var B=a.getRGB(v[A]);w[A]={r:(B.r-u[A].r)/t,g:(B.g-u[A].g)/t,b:(B.b-u[A].b)/t};break;case"path":var D=bR(u[A],v[A]),E=D[1];u[A]=D[0],w[A]=[];for(y=0,z=u[A].length;y<z;y++){w[A][y]=[0];for(var F=1,G=u[A][y].length;F<G;F++)w[A][y][F]=(E[y][F]-u[A][y][F])/t}break;case"transform":var H=d._,I=ca(H[A],v[A]);if(I){u[A]=I.from,v[A]=I.to,w[A]=[],w[A].real=!0;for(y=0,z=u[A].length;y<z;y++){w[A][y]=[u[A][y][0]];for(F=1,G=u[A][y].length;F<G;F++)w[A][y][F]=(v[A][y][F]-u[A][y][F])/t}}else{var J=d.matrix||new cb,K={_:{transform:H.transform},getBBox:function(){return d.getBBox(1)}};u[A]=[J.a,J.b,J.c,J.d,J.e,J.f],b$(K,v[A]),v[A]=K._.transform,w[A]=[(K.matrix.a-J.a)/t,(K.matrix.b-J.b)/t,(K.matrix.c-J.c)/t,(K.matrix.d-J.d)/t,(K.matrix.e-J.e)/t,(K.matrix.f-J.f)/t]}break;case"csv":var L=r(j[A])[s](c),M=r(u[A])[s](c);if(A=="clip-rect"){u[A]=M,w[A]=[],y=M.length;while(y--)w[A][y]=(L[y]-u[A][y])/t}v[A]=L;break;default:L=[][n](j[A]),M=[][n](u[A]),w[A]=[],y=d.paper.customAttributes[A].length;while(y--)w[A][y]=((L[y]||0)-(M[y]||0))/t}}var O=j.easing,P=a.easing_formulas[O];if(!P){P=r(O).match(N);if(P&&P.length==5){var R=P;P=function(a){return cC(a,+R[1],+R[2],+R[3],+R[4],t)}}else P=bf}q=j.start||b.start||+(new Date),x={anim:b,percent:e,timestamp:q,start:q+(b.del||0),status:0,initstatus:f||0,stop:!1,ms:t,easing:P,from:u,diff:w,to:v,el:d,callback:j.callback,prev:p,next:o,repeat:i||b.times,origin:d.attr(),totalOrigin:h},cy.push(x);if(f&&!k&&!l){x.stop=!0,x.start=new Date-t*f;if(cy.length==1)return cA()}l&&(x.start=new Date-x.ms*f),cy.length==1&&cz(cA)}else k.initstatus=f,k.start=new Date-k.ms*f;eve("raphael.anim.start."+d.id,d,b)}}function cD(a,b){var c=[],d={};this.ms=b,this.times=1;if(a){for(var e in a)a[g](e)&&(d[Q(e)]=a[e],c.push(Q(e)));c.sort(bd)}this.anim=d,this.top=c[c.length-1],this.percents=c}function cC(a,b,c,d,e,f){function o(a,b){var c,d,e,f,j,k;for(e=a,k=0;k<8;k++){f=m(e)-a;if(z(f)<b)return e;j=(3*i*e+2*h)*e+g;if(z(j)<1e-6)break;e=e-f/j}c=0,d=1,e=a;if(e<c)return c;if(e>d)return d;while(c<d){f=m(e);if(z(f-a)<b)return e;a>f?c=e:d=e,e=(d-c)/2+c}return e}function n(a,b){var c=o(a,b);return((l*c+k)*c+j)*c}function m(a){return((i*a+h)*a+g)*a}var g=3*b,h=3*(d-b)-g,i=1-g-h,j=3*c,k=3*(e-c)-j,l=1-j-k;return n(a,1/(200*f))}function cq(){return this.x+q+this.y+q+this.width+" Ć— "+this.height}function cp(){return this.x+q+this.y}function cb(a,b,c,d,e,f){a!=null?(this.a=+a,this.b=+b,this.c=+c,this.d=+d,this.e=+e,this.f=+f):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}function bH(b,c,d){b=a._path2curve(b),c=a._path2curve(c);var e,f,g,h,i,j,k,l,m,n,o=d?0:[];for(var p=0,q=b.length;p<q;p++){var r=b[p];if(r[0]=="M")e=i=r[1],f=j=r[2];else{r[0]=="C"?(m=[e,f].concat(r.slice(1)),e=m[6],f=m[7]):(m=[e,f,e,f,i,j,i,j],e=i,f=j);for(var s=0,t=c.length;s<t;s++){var u=c[s];if(u[0]=="M")g=k=u[1],h=l=u[2];else{u[0]=="C"?(n=[g,h].concat(u.slice(1)),g=n[6],h=n[7]):(n=[g,h,g,h,k,l,k,l],g=k,h=l);var v=bG(m,n,d);if(d)o+=v;else{for(var w=0,x=v.length;w<x;w++)v[w].segment1=p,v[w].segment2=s,v[w].bez1=m,v[w].bez2=n;o=o.concat(v)}}}}}return o}function bG(b,c,d){var e=a.bezierBBox(b),f=a.bezierBBox(c);if(!a.isBBoxIntersect(e,f))return d?0:[];var g=bB.apply(0,b),h=bB.apply(0,c),i=~~(g/5),j=~~(h/5),k=[],l=[],m={},n=d?0:[];for(var o=0;o<i+1;o++){var p=a.findDotsAtSegment.apply(a,b.concat(o/i));k.push({x:p.x,y:p.y,t:o/i})}for(o=0;o<j+1;o++)p=a.findDotsAtSegment.apply(a,c.concat(o/j)),l.push({x:p.x,y:p.y,t:o/j});for(o=0;o<i;o++)for(var q=0;q<j;q++){var r=k[o],s=k[o+1],t=l[q],u=l[q+1],v=z(s.x-r.x)<.001?"y":"x",w=z(u.x-t.x)<.001?"y":"x",x=bD(r.x,r.y,s.x,s.y,t.x,t.y,u.x,u.y);if(x){if(m[x.x.toFixed(4)]==x.y.toFixed(4))continue;m[x.x.toFixed(4)]=x.y.toFixed(4);var y=r.t+z((x[v]-r[v])/(s[v]-r[v]))*(s.t-r.t),A=t.t+z((x[w]-t[w])/(u[w]-t[w]))*(u.t-t.t);y>=0&&y<=1&&A>=0&&A<=1&&(d?n++:n.push({x:x.x,y:x.y,t1:y,t2:A}))}}return n}function bF(a,b){return bG(a,b,1)}function bE(a,b){return bG(a,b)}function bD(a,b,c,d,e,f,g,h){if(!(x(a,c)<y(e,g)||y(a,c)>x(e,g)||x(b,d)<y(f,h)||y(b,d)>x(f,h))){var i=(a*d-b*c)*(e-g)-(a-c)*(e*h-f*g),j=(a*d-b*c)*(f-h)-(b-d)*(e*h-f*g),k=(a-c)*(f-h)-(b-d)*(e-g);if(!k)return;var l=i/k,m=j/k,n=+l.toFixed(2),o=+m.toFixed(2);if(n<+y(a,c).toFixed(2)||n>+x(a,c).toFixed(2)||n<+y(e,g).toFixed(2)||n>+x(e,g).toFixed(2)||o<+y(b,d).toFixed(2)||o>+x(b,d).toFixed(2)||o<+y(f,h).toFixed(2)||o>+x(f,h).toFixed(2))return;return{x:l,y:m}}}function bC(a,b,c,d,e,f,g,h,i){if(!(i<0||bB(a,b,c,d,e,f,g,h)<i)){var j=1,k=j/2,l=j-k,m,n=.01;m=bB(a,b,c,d,e,f,g,h,l);while(z(m-i)>n)k/=2,l+=(m<i?1:-1)*k,m=bB(a,b,c,d,e,f,g,h,l);return l}}function bB(a,b,c,d,e,f,g,h,i){i==null&&(i=1),i=i>1?1:i<0?0:i;var j=i/2,k=12,l=[-0.1252,.1252,-0.3678,.3678,-0.5873,.5873,-0.7699,.7699,-0.9041,.9041,-0.9816,.9816],m=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],n=0;for(var o=0;o<k;o++){var p=j*l[o]+j,q=bA(p,a,c,e,g),r=bA(p,b,d,f,h),s=q*q+r*r;n+=m[o]*w.sqrt(s)}return j*n}function bA(a,b,c,d,e){var f=-3*b+9*c-9*d+3*e,g=a*f+6*b-12*c+6*d;return a*g-3*b+3*c}function by(a,b){var c=[];for(var d=0,e=a.length;e-2*!b>d;d+=2){var f=[{x:+a[d-2],y:+a[d-1]},{x:+a[d],y:+a[d+1]},{x:+a[d+2],y:+a[d+3]},{x:+a[d+4],y:+a[d+5]}];b?d?e-4==d?f[3]={x:+a[0],y:+a[1]}:e-2==d&&(f[2]={x:+a[0],y:+a[1]},f[3]={x:+a[2],y:+a[3]}):f[0]={x:+a[e-2],y:+a[e-1]}:e-4==d?f[3]=f[2]:d||(f[0]={x:+a[d],y:+a[d+1]}),c.push(["C",(-f[0].x+6*f[1].x+f[2].x)/6,(-f[0].y+6*f[1].y+f[2].y)/6,(f[1].x+6*f[2].x-f[3].x)/6,(f[1].y+6*f[2].y-f[3].y)/6,f[2].x,f[2].y])}return c}function bx(){return this.hex}function bv(a,b,c){function d(){var e=Array.prototype.slice.call(arguments,0),f=e.join("ā€"),h=d.cache=d.cache||{},i=d.count=d.count||[];if(h[g](f)){bu(i,f);return c?c(h[f]):h[f]}i.length>=1e3&&delete h[i.shift()],i.push(f),h[f]=a[m](b,e);return c?c(h[f]):h[f]}return d}function bu(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return a.push(a.splice(c,1)[0])}function bm(a){if(Object(a)!==a)return a;var b=new a.constructor;for(var c in a)a[g](c)&&(b[c]=bm(a[c]));return b}function a(c){if(a.is(c,"function"))return b?c():eve.on("raphael.DOMload",c);if(a.is(c,E))return a._engine.create[m](a,c.splice(0,3+a.is(c[0],C))).add(c);var d=Array.prototype.slice.call(arguments,0);if(a.is(d[d.length-1],"function")){var e=d.pop();return b?e.call(a._engine.create[m](a,d)):eve.on("raphael.DOMload",function(){e.call(a._engine.create[m](a,d))})}return a._engine.create[m](a,arguments)}a.version="2.1.0",a.eve=eve;var b,c=/[, ]+/,d={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},e=/\{(\d+)\}/g,f="prototype",g="hasOwnProperty",h={doc:document,win:window},i={was:Object.prototype[g].call(h.win,"Raphael"),is:h.win.Raphael},j=function(){this.ca=this.customAttributes={}},k,l="appendChild",m="apply",n="concat",o="createTouch"in h.doc,p="",q=" ",r=String,s="split",t="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[s](q),u={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},v=r.prototype.toLowerCase,w=Math,x=w.max,y=w.min,z=w.abs,A=w.pow,B=w.PI,C="number",D="string",E="array",F="toString",G="fill",H=Object.prototype.toString,I={},J="push",K=a._ISURL=/^url\(['"]?([^\)]+?)['"]?\)$/i,L=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,M={NaN:1,Infinity:1,"-Infinity":1},N=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,O=w.round,P="setAttribute",Q=parseFloat,R=parseInt,S=r.prototype.toUpperCase,T=a._availableAttrs={"arrow-end":"none","arrow-start":"none",blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/","letter-spacing":0,opacity:1,path:"M0,0",r:0,rx:0,ry:0,src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",transform:"",width:0,x:0,y:0},U=a._availableAnimAttrs={blur:C,"clip-rect":"csv",cx:C,cy:C,fill:"colour","fill-opacity":C,"font-size":C,height:C,opacity:C,path:"path",r:C,rx:C,ry:C,stroke:"colour","stroke-opacity":C,"stroke-width":C,transform:"transform",width:C,x:C,y:C},V=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]/g,W=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/,X={hs:1,rg:1},Y=/,?([achlmqrstvxz]),?/gi,Z=/([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/ig,$=/([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/ig,_=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/ig,ba=a._radial_gradient=/^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/,bb={},bc=function(a,b){return a.key-b.key},bd=function(a,b){return Q(a)-Q(b)},be=function(){},bf=function(a){return a},bg=a._rectPath=function(a,b,c,d,e){if(e)return[["M",a+e,b],["l",c-e*2,0],["a",e,e,0,0,1,e,e],["l",0,d-e*2],["a",e,e,0,0,1,-e,e],["l",e*2-c,0],["a",e,e,0,0,1,-e,-e],["l",0,e*2-d],["a",e,e,0,0,1,e,-e],["z"]];return[["M",a,b],["l",c,0],["l",0,d],["l",-c,0],["z"]]},bh=function(a,b,c,d){d==null&&(d=c);return[["M",a,b],["m",0,-d],["a",c,d,0,1,1,0,2*d],["a",c,d,0,1,1,0,-2*d],["z"]]},bi=a._getPath={path:function(a){return a.attr("path")},circle:function(a){var b=a.attrs;return bh(b.cx,b.cy,b.r)},ellipse:function(a){var b=a.attrs;return bh(b.cx,b.cy,b.rx,b.ry)},rect:function(a){var b=a.attrs;return bg(b.x,b.y,b.width,b.height,b.r)},image:function(a){var b=a.attrs;return bg(b.x,b.y,b.width,b.height)},text:function(a){var b=a._getBBox();return bg(b.x,b.y,b.width,b.height)}},bj=a.mapPath=function(a,b){if(!b)return a;var c,d,e,f,g,h,i;a=bR(a);for(e=0,g=a.length;e<g;e++){i=a[e];for(f=1,h=i.length;f<h;f+=2)c=b.x(i[f],i[f+1]),d=b.y(i[f],i[f+1]),i[f]=c,i[f+1]=d}return a};a._g=h,a.type=h.win.SVGAngle||h.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML";if(a.type=="VML"){var bk=h.doc.createElement("div"),bl;bk.innerHTML='<v:shape adj="1"/>',bl=bk.firstChild,bl.style.behavior="url(#default#VML)";if(!bl||typeof bl.adj!="object")return a.type=p;bk=null}a.svg=!(a.vml=a.type=="VML"),a._Paper=j,a.fn=k=j.prototype=a.prototype,a._id=0,a._oid=0,a.is=function(a,b){b=v.call(b);if(b=="finite")return!M[g](+a);if(b=="array")return a instanceof Array;return b=="null"&&a===null||b==typeof a&&a!==null||b=="object"&&a===Object(a)||b=="array"&&Array.isArray&&Array.isArray(a)||H.call(a).slice(8,-1).toLowerCase()==b},a.angle=function(b,c,d,e,f,g){if(f==null){var h=b-d,i=c-e;if(!h&&!i)return 0;return(180+w.atan2(-i,-h)*180/B+360)%360}return a.angle(b,c,f,g)-a.angle(d,e,f,g)},a.rad=function(a){return a%360*B/180},a.deg=function(a){return a*180/B%360},a.snapTo=function(b,c,d){d=a.is(d,"finite")?d:10;if(a.is(b,E)){var e=b.length;while(e--)if(z(b[e]-c)<=d)return b[e]}else{b=+b;var f=c%b;if(f<d)return c-f;if(f>b-d)return c-f+b}return c};var bn=a.createUUID=function(a,b){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,b).toUpperCase()}}(/[xy]/g,function(a){var b=w.random()*16|0,c=a=="x"?b:b&3|8;return c.toString(16)});a.setWindow=function(b){eve("raphael.setWindow",a,h.win,b),h.win=b,h.doc=h.win.document,a._engine.initWin&&a._engine.initWin(h.win)};var bo=function(b){if(a.vml){var c=/^\s+|\s+$/g,d;try{var e=new ActiveXObject("htmlfile");e.write("<body>"),e.close(),d=e.body}catch(f){d=createPopup().document.body}var g=d.createTextRange();bo=bv(function(a){try{d.style.color=r(a).replace(c,p);var b=g.queryCommandValue("ForeColor");b=(b&255)<<16|b&65280|(b&16711680)>>>16;return"#"+("000000"+b.toString(16)).slice(-6)}catch(e){return"none"}})}else{var i=h.doc.createElement("i");i.title="RaphaĆ«l Colour Picker",i.style.display="none",h.doc.body.appendChild(i),bo=bv(function(a){i.style.color=a;return h.doc.defaultView.getComputedStyle(i,p).getPropertyValue("color")})}return bo(b)},bp=function(){return"hsb("+[this.h,this.s,this.b]+")"},bq=function(){return"hsl("+[this.h,this.s,this.l]+")"},br=function(){return this.hex},bs=function(b,c,d){c==null&&a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b&&(d=b.b,c=b.g,b=b.r);if(c==null&&a.is(b,D)){var e=a.getRGB(b);b=e.r,c=e.g,d=e.b}if(b>1||c>1||d>1)b/=255,c/=255,d/=255;return[b,c,d]},bt=function(b,c,d,e){b*=255,c*=255,d*=255;var f={r:b,g:c,b:d,hex:a.rgb(b,c,d),toString:br};a.is(e,"finite")&&(f.opacity=e);return f};a.color=function(b){var c;a.is(b,"object")&&"h"in b&&"s"in b&&"b"in b?(c=a.hsb2rgb(b),b.r=c.r,b.g=c.g,b.b=c.b,b.hex=c.hex):a.is(b,"object")&&"h"in b&&"s"in b&&"l"in b?(c=a.hsl2rgb(b),b.r=c.r,b.g=c.g,b.b=c.b,b.hex=c.hex):(a.is(b,"string")&&(b=a.getRGB(b)),a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b?(c=a.rgb2hsl(b),b.h=c.h,b.s=c.s,b.l=c.l,c=a.rgb2hsb(b),b.v=c.b):(b={hex:"none"},b.r=b.g=b.b=b.h=b.s=b.v=b.l=-1)),b.toString=br;return b},a.hsb2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"b"in a&&(c=a.b,b=a.s,a=a.h,d=a.o),a*=360;var e,f,g,h,i;a=a%360/60,i=c*b,h=i*(1-z(a%2-1)),e=f=g=c-i,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a];return bt(e,f,g,d)},a.hsl2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"l"in a&&(c=a.l,b=a.s,a=a.h);if(a>1||b>1||c>1)a/=360,b/=100,c/=100;a*=360;var e,f,g,h,i;a=a%360/60,i=2*b*(c<.5?c:1-c),h=i*(1-z(a%2-1)),e=f=g=c-i/2,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a];return bt(e,f,g,d)},a.rgb2hsb=function(a,b,c){c=bs(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g;f=x(a,b,c),g=f-y(a,b,c),d=g==0?null:f==a?(b-c)/g:f==b?(c-a)/g+2:(a-b)/g+4,d=(d+360)%6*60/360,e=g==0?0:g/f;return{h:d,s:e,b:f,toString:bp}},a.rgb2hsl=function(a,b,c){c=bs(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g,h,i;g=x(a,b,c),h=y(a,b,c),i=g-h,d=i==0?null:g==a?(b-c)/i:g==b?(c-a)/i+2:(a-b)/i+4,d=(d+360)%6*60/360,f=(g+h)/2,e=i==0?0:f<.5?i/(2*f):i/(2-2*f);return{h:d,s:e,l:f,toString:bq}},a._path2string=function(){return this.join(",").replace(Y,"$1")};var bw=a._preload=function(a,b){var c=h.doc.createElement("img");c.style.cssText="position:absolute;left:-9999em;top:-9999em",c.onload=function(){b.call(this),this.onload=null,h.doc.body.removeChild(this)},c.onerror=function(){h.doc.body.removeChild(this)},h.doc.body.appendChild(c),c.src=a};a.getRGB=bv(function(b){if(!b||!!((b=r(b)).indexOf("-")+1))return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:bx};if(b=="none")return{r:-1,g:-1,b:-1,hex:"none",toString:bx};!X[g](b.toLowerCase().substring(0,2))&&b.charAt()!="#"&&(b=bo(b));var c,d,e,f,h,i,j,k=b.match(L);if(k){k[2]&&(f=R(k[2].substring(5),16),e=R(k[2].substring(3,5),16),d=R(k[2].substring(1,3),16)),k[3]&&(f=R((i=k[3].charAt(3))+i,16),e=R((i=k[3].charAt(2))+i,16),d=R((i=k[3].charAt(1))+i,16)),k[4]&&(j=k[4][s](W),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),k[1].toLowerCase().slice(0,4)=="rgba"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100));if(k[5]){j=k[5][s](W),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="Ā°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsba"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsb2rgb(d,e,f,h)}if(k[6]){j=k[6][s](W),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="Ā°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsla"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsl2rgb(d,e,f,h)}k={r:d,g:e,b:f,toString:bx},k.hex="#"+(16777216|f|e<<8|d<<16).toString(16).slice(1),a.is(h,"finite")&&(k.opacity=h);return k}return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:bx}},a),a.hsb=bv(function(b,c,d){return a.hsb2rgb(b,c,d).hex}),a.hsl=bv(function(b,c,d){return a.hsl2rgb(b,c,d).hex}),a.rgb=bv(function(a,b,c){return"#"+(16777216|c|b<<8|a<<16).toString(16).slice(1)}),a.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||.75},c=this.hsb2rgb(b.h,b.s,b.b);b.h+=.075,b.h>1&&(b.h=0,b.s-=.2,b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b}));return c.hex},a.getColor.reset=function(){delete this.start},a.parsePathString=function(b){if(!b)return null;var c=bz(b);if(c.arr)return bJ(c.arr);var d={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},e=[];a.is(b,E)&&a.is(b[0],E)&&(e=bJ(b)),e.length||r(b).replace(Z,function(a,b,c){var f=[],g=b.toLowerCase();c.replace(_,function(a,b){b&&f.push(+b)}),g=="m"&&f.length>2&&(e.push([b][n](f.splice(0,2))),g="l",b=b=="m"?"l":"L");if(g=="r")e.push([b][n](f));else while(f.length>=d[g]){e.push([b][n](f.splice(0,d[g])));if(!d[g])break}}),e.toString=a._path2string,c.arr=bJ(e);return e},a.parseTransformString=bv(function(b){if(!b)return null;var c={r:3,s:4,t:2,m:6},d=[];a.is(b,E)&&a.is(b[0],E)&&(d=bJ(b)),d.length||r(b).replace($,function(a,b,c){var e=[],f=v.call(b);c.replace(_,function(a,b){b&&e.push(+b)}),d.push([b][n](e))}),d.toString=a._path2string;return d});var bz=function(a){var b=bz.ps=bz.ps||{};b[a]?b[a].sleep=100:b[a]={sleep:100},setTimeout(function(){for(var c in b)b[g](c)&&c!=a&&(b[c].sleep--,!b[c].sleep&&delete b[c])});return b[a]};a.findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=A(j,3),l=A(j,2),m=i*i,n=m*i,o=k*a+l*3*i*c+j*3*i*i*e+n*g,p=k*b+l*3*i*d+j*3*i*i*f+n*h,q=a+2*i*(c-a)+m*(e-2*c+a),r=b+2*i*(d-b)+m*(f-2*d+b),s=c+2*i*(e-c)+m*(g-2*e+c),t=d+2*i*(f-d)+m*(h-2*f+d),u=j*a+i*c,v=j*b+i*d,x=j*e+i*g,y=j*f+i*h,z=90-w.atan2(q-s,r-t)*180/B;(q>s||r<t)&&(z+=180);return{x:o,y:p,m:{x:q,y:r},n:{x:s,y:t},start:{x:u,y:v},end:{x:x,y:y},alpha:z}},a.bezierBBox=function(b,c,d,e,f,g,h,i){a.is(b,"array")||(b=[b,c,d,e,f,g,h,i]);var j=bQ.apply(null,b);return{x:j.min.x,y:j.min.y,x2:j.max.x,y2:j.max.y,width:j.max.x-j.min.x,height:j.max.y-j.min.y}},a.isPointInsideBBox=function(a,b,c){return b>=a.x&&b<=a.x2&&c>=a.y&&c<=a.y2},a.isBBoxIntersect=function(b,c){var d=a.isPointInsideBBox;return d(c,b.x,b.y)||d(c,b.x2,b.y)||d(c,b.x,b.y2)||d(c,b.x2,b.y2)||d(b,c.x,c.y)||d(b,c.x2,c.y)||d(b,c.x,c.y2)||d(b,c.x2,c.y2)||(b.x<c.x2&&b.x>c.x||c.x<b.x2&&c.x>b.x)&&(b.y<c.y2&&b.y>c.y||c.y<b.y2&&c.y>b.y)},a.pathIntersection=function(a,b){return bH(a,b)},a.pathIntersectionNumber=function(a,b){return bH(a,b,1)},a.isPointInsidePath=function(b,c,d){var e=a.pathBBox(b);return a.isPointInsideBBox(e,c,d)&&bH(b,[["M",c,d],["H",e.x2+10]],1)%2==1},a._removedFactory=function(a){return function(){eve("raphael.log",null,"RaphaĆ«l: you are calling to method ā€œ"+a+"ā€¯ of removed object",a)}};var bI=a.pathBBox=function(a){var b=bz(a);if(b.bbox)return b.bbox;if(!a)return{x:0,y:0,width:0,height:0,x2:0,y2:0};a=bR(a);var c=0,d=0,e=[],f=[],g;for(var h=0,i=a.length;h<i;h++){g=a[h];if(g[0]=="M")c=g[1],d=g[2],e.push(c),f.push(d);else{var j=bQ(c,d,g[1],g[2],g[3],g[4],g[5],g[6]);e=e[n](j.min.x,j.max.x),f=f[n](j.min.y,j.max.y),c=g[5],d=g[6]}}var k=y[m](0,e),l=y[m](0,f),o=x[m](0,e),p=x[m](0,f),q={x:k,y:l,x2:o,y2:p,width:o-k,height:p-l};b.bbox=bm(q);return q},bJ=function(b){var c=bm(b);c.toString=a._path2string;return c},bK=a._pathToRelative=function(b){var c=bz(b);if(c.rel)return bJ(c.rel);if(!a.is(b,E)||!a.is(b&&b[0],E))b=a.parsePathString(b);var d=[],e=0,f=0,g=0,h=0,i=0;b[0][0]=="M"&&(e=b[0][1],f=b[0][2],g=e,h=f,i++,d.push(["M",e,f]));for(var j=i,k=b.length;j<k;j++){var l=d[j]=[],m=b[j];if(m[0]!=v.call(m[0])){l[0]=v.call(m[0]);switch(l[0]){case"a":l[1]=m[1],l[2]=m[2],l[3]=m[3],l[4]=m[4],l[5]=m[5],l[6]=+(m[6]-e).toFixed(3),l[7]=+(m[7]-f).toFixed(3);break;case"v":l[1]=+(m[1]-f).toFixed(3);break;case"m":g=m[1],h=m[2];default:for(var n=1,o=m.length;n<o;n++)l[n]=+(m[n]-(n%2?e:f)).toFixed(3)}}else{l=d[j]=[],m[0]=="m"&&(g=m[1]+e,h=m[2]+f);for(var p=0,q=m.length;p<q;p++)d[j][p]=m[p]}var r=d[j].length;switch(d[j][0]){case"z":e=g,f=h;break;case"h":e+=+d[j][r-1];break;case"v":f+=+d[j][r-1];break;default:e+=+d[j][r-2],f+=+d[j][r-1]}}d.toString=a._path2string,c.rel=bJ(d);return d},bL=a._pathToAbsolute=function(b){var c=bz(b);if(c.abs)return bJ(c.abs);if(!a.is(b,E)||!a.is(b&&b[0],E))b=a.parsePathString(b);if(!b||!b.length)return[["M",0,0]];var d=[],e=0,f=0,g=0,h=0,i=0;b[0][0]=="M"&&(e=+b[0][1],f=+b[0][2],g=e,h=f,i++,d[0]=["M",e,f]);var j=b.length==3&&b[0][0]=="M"&&b[1][0].toUpperCase()=="R"&&b[2][0].toUpperCase()=="Z";for(var k,l,m=i,o=b.length;m<o;m++){d.push(k=[]),l=b[m];if(l[0]!=S.call(l[0])){k[0]=S.call(l[0]);switch(k[0]){case"A":k[1]=l[1],k[2]=l[2],k[3]=l[3],k[4]=l[4],k[5]=l[5],k[6]=+(l[6]+e),k[7]=+(l[7]+f);break;case"V":k[1]=+l[1]+f;break;case"H":k[1]=+l[1]+e;break;case"R":var p=[e,f][n](l.slice(1));for(var q=2,r=p.length;q<r;q++)p[q]=+p[q]+e,p[++q]=+p[q]+f;d.pop(),d=d[n](by(p,j));break;case"M":g=+l[1]+e,h=+l[2]+f;default:for(q=1,r=l.length;q<r;q++)k[q]=+l[q]+(q%2?e:f)}}else if(l[0]=="R")p=[e,f][n](l.slice(1)),d.pop(),d=d[n](by(p,j)),k=["R"][n](l.slice(-2));else for(var s=0,t=l.length;s<t;s++)k[s]=l[s];switch(k[0]){case"Z":e=g,f=h;break;case"H":e=k[1];break;case"V":f=k[1];break;case"M":g=k[k.length-2],h=k[k.length-1];default:e=k[k.length-2],f=k[k.length-1]}}d.toString=a._path2string,c.abs=bJ(d);return d},bM=function(a,b,c,d){return[a,b,c,d,c,d]},bN=function(a,b,c,d,e,f){var g=1/3,h=2/3;return[g*a+h*c,g*b+h*d,g*e+h*c,g*f+h*d,e,f]},bO=function(a,b,c,d,e,f,g,h,i,j){var k=B*120/180,l=B/180*(+e||0),m=[],o,p=bv(function(a,b,c){var d=a*w.cos(c)-b*w.sin(c),e=a*w.sin(c)+b*w.cos(c);return{x:d,y:e}});if(!j){o=p(a,b,-l),a=o.x,b=o.y,o=p(h,i,-l),h=o.x,i=o.y;var q=w.cos(B/180*e),r=w.sin(B/180*e),t=(a-h)/2,u=(b-i)/2,v=t*t/(c*c)+u*u/(d*d);v>1&&(v=w.sqrt(v),c=v*c,d=v*d);var x=c*c,y=d*d,A=(f==g?-1:1)*w.sqrt(z((x*y-x*u*u-y*t*t)/(x*u*u+y*t*t))),C=A*c*u/d+(a+h)/2,D=A*-d*t/c+(b+i)/2,E=w.asin(((b-D)/d).toFixed(9)),F=w.asin(((i-D)/d).toFixed(9));E=a<C?B-E:E,F=h<C?B-F:F,E<0&&(E=B*2+E),F<0&&(F=B*2+F),g&&E>F&&(E=E-B*2),!g&&F>E&&(F=F-B*2)}else E=j[0],F=j[1],C=j[2],D=j[3];var G=F-E;if(z(G)>k){var H=F,I=h,J=i;F=E+k*(g&&F>E?1:-1),h=C+c*w.cos(F),i=D+d*w.sin(F),m=bO(h,i,c,d,e,0,g,I,J,[F,H,C,D])}G=F-E;var K=w.cos(E),L=w.sin(E),M=w.cos(F),N=w.sin(F),O=w.tan(G/4),P=4/3*c*O,Q=4/3*d*O,R=[a,b],S=[a+P*L,b-Q*K],T=[h+P*N,i-Q*M],U=[h,i];S[0]=2*R[0]-S[0],S[1]=2*R[1]-S[1];if(j)return[S,T,U][n](m);m=[S,T,U][n](m).join()[s](",");var V=[];for(var W=0,X=m.length;W<X;W++)V[W]=W%2?p(m[W-1],m[W],l).y:p(m[W],m[W+1],l).x;return V},bP=function(a,b,c,d,e,f,g,h,i){var j=1-i;return{x:A(j,3)*a+A(j,2)*3*i*c+j*3*i*i*e+A(i,3)*g,y:A(j,3)*b+A(j,2)*3*i*d+j*3*i*i*f+A(i,3)*h}},bQ=bv(function(a,b,c,d,e,f,g,h){var i=e-2*c+a-(g-2*e+c),j=2*(c-a)-2*(e-c),k=a-c,l=(-j+w.sqrt(j*j-4*i*k))/2/i,n=(-j-w.sqrt(j*j-4*i*k))/2/i,o=[b,h],p=[a,g],q;z(l)>"1e12"&&(l=.5),z(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bP(a,b,c,d,e,f,g,h,l),p.push(q.x),o.push(q.y)),n>0&&n<1&&(q=bP(a,b,c,d,e,f,g,h,n),p.push(q.x),o.push(q.y)),i=f-2*d+b-(h-2*f+d),j=2*(d-b)-2*(f-d),k=b-d,l=(-j+w.sqrt(j*j-4*i*k))/2/i,n=(-j-w.sqrt(j*j-4*i*k))/2/i,z(l)>"1e12"&&(l=.5),z(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bP(a,b,c,d,e,f,g,h,l),p.push(q.x),o.push(q.y)),n>0&&n<1&&(q=bP(a,b,c,d,e,f,g,h,n),p.push(q.x),o.push(q.y));return{min:{x:y[m](0,p),y:y[m](0,o)},max:{x:x[m](0,p),y:x[m](0,o)}}}),bR=a._path2curve=bv(function(a,b){var c=!b&&bz(a);if(!b&&c.curve)return bJ(c.curve);var d=bL(a),e=b&&bL(b),f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},h=function(a,b){var c,d;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null);switch(a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"][n](bO[m](0,[b.x,b.y][n](a.slice(1))));break;case"S":c=b.x+(b.x-(b.bx||b.x)),d=b.y+(b.y-(b.by||b.y)),a=["C",c,d][n](a.slice(1));break;case"T":b.qx=b.x+(b.x-(b.qx||b.x)),b.qy=b.y+(b.y-(b.qy||b.y)),a=["C"][n](bN(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"][n](bN(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][n](bM(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][n](bM(b.x,b.y,a[1],b.y));break;case"V":a=["C"][n](bM(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][n](bM(b.x,b.y,b.X,b.Y))}return a},i=function(a,b){if(a[b].length>7){a[b].shift();var c=a[b];while(c.length)a.splice(b++,0,["C"][n](c.splice(0,6)));a.splice(b,1),l=x(d.length,e&&e.length||0)}},j=function(a,b,c,f,g){a&&b&&a[g][0]=="M"&&b[g][0]!="M"&&(b.splice(g,0,["M",f.x,f.y]),c.bx=0,c.by=0,c.x=a[g][1],c.y=a[g][2],l=x(d.length,e&&e.length||0))};for(var k=0,l=x(d.length,e&&e.length||0);k<l;k++){d[k]=h(d[k],f),i(d,k),e&&(e[k]=h(e[k],g)),e&&i(e,k),j(d,e,f,g,k),j(e,d,g,f,k);var o=d[k],p=e&&e[k],q=o.length,r=e&&p.length;f.x=o[q-2],f.y=o[q-1],f.bx=Q(o[q-4])||f.x,f.by=Q(o[q-3])||f.y,g.bx=e&&(Q(p[r-4])||g.x),g.by=e&&(Q(p[r-3])||g.y),g.x=e&&p[r-2],g.y=e&&p[r-1]}e||(c.curve=bJ(d));return e?[d,e]:d},null,bJ),bS=a._parseDots=bv(function(b){var c=[];for(var d=0,e=b.length;d<e;d++){var f={},g=b[d].match(/^([^:]*):?([\d\.]*)/);f.color=a.getRGB(g[1]);if(f.color.error)return null;f.color=f.color.hex,g[2]&&(f.offset=g[2]+"%"),c.push(f)}for(d=1,e=c.length-1;d<e;d++)if(!c[d].offset){var h=Q(c[d-1].offset||0),i=0;for(var j=d+1;j<e;j++)if(c[j].offset){i=c[j].offset;break}i||(i=100,j=e),i=Q(i);var k=(i-h)/(j-d+1);for(;d<j;d++)h+=k,c[d].offset=h+"%"}return c}),bT=a._tear=function(a,b){a==b.top&&(b.top=a.prev),a==b.bottom&&(b.bottom=a.next),a.next&&(a.next.prev=a.prev),a.prev&&(a.prev.next=a.next)},bU=a._tofront=function(a,b){b.top!==a&&(bT(a,b),a.next=null,a.prev=b.top,b.top.next=a,b.top=a)},bV=a._toback=function(a,b){b.bottom!==a&&(bT(a,b),a.next=b.bottom,a.prev=null,b.bottom.prev=a,b.bottom=a)},bW=a._insertafter=function(a,b,c){bT(a,c),b==c.top&&(c.top=a),b.next&&(b.next.prev=a),a.next=b.next,a.prev=b,b.next=a},bX=a._insertbefore=function(a,b,c){bT(a,c),b==c.bottom&&(c.bottom=a),b.prev&&(b.prev.next=a),a.prev=b.prev,b.prev=a,a.next=b},bY=a.toMatrix=function(a,b){var c=bI(a),d={_:{transform:p},getBBox:function(){return c}};b$(d,b);return d.matrix},bZ=a.transformPath=function(a,b){return bj(a,bY(a,b))},b$=a._extractTransform=function(b,c){if(c==null)return b._.transform;c=r(c).replace(/\.{3}|\u2026/g,b._.transform||p);var d=a.parseTransformString(c),e=0,f=0,g=0,h=1,i=1,j=b._,k=new cb;j.transform=d||[];if(d)for(var l=0,m=d.length;l<m;l++){var n=d[l],o=n.length,q=r(n[0]).toLowerCase(),s=n[0]!=q,t=s?k.invert():0,u,v,w,x,y;q=="t"&&o==3?s?(u=t.x(0,0),v=t.y(0,0),w=t.x(n[1],n[2]),x=t.y(n[1],n[2]),k.translate(w-u,x-v)):k.translate(n[1],n[2]):q=="r"?o==2?(y=y||b.getBBox(1),k.rotate(n[1],y.x+y.width/2,y.y+y.height/2),e+=n[1]):o==4&&(s?(w=t.x(n[2],n[3]),x=t.y(n[2],n[3]),k.rotate(n[1],w,x)):k.rotate(n[1],n[2],n[3]),e+=n[1]):q=="s"?o==2||o==3?(y=y||b.getBBox(1),k.scale(n[1],n[o-1],y.x+y.width/2,y.y+y.height/2),h*=n[1],i*=n[o-1]):o==5&&(s?(w=t.x(n[3],n[4]),x=t.y(n[3],n[4]),k.scale(n[1],n[2],w,x)):k.scale(n[1],n[2],n[3],n[4]),h*=n[1],i*=n[2]):q=="m"&&o==7&&k.add(n[1],n[2],n[3],n[4],n[5],n[6]),j.dirtyT=1,b.matrix=k}b.matrix=k,j.sx=h,j.sy=i,j.deg=e,j.dx=f=k.e,j.dy=g=k.f,h==1&&i==1&&!e&&j.bbox?(j.bbox.x+=+f,j.bbox.y+=+g):j.dirtyT=1},b_=function(a){var b=a[0];switch(b.toLowerCase()){case"t":return[b,0,0];case"m":return[b,1,0,0,1,0,0];case"r":return a.length==4?[b,0,a[2],a[3]]:[b,0];case"s":return a.length==5?[b,1,1,a[3],a[4]]:a.length==3?[b,1,1]:[b,1]}},ca=a._equaliseTransform=function(b,c){c=r(c).replace(/\.{3}|\u2026/g,b),b=a.parseTransformString(b)||[],c=a.parseTransformString(c)||[];var d=x(b.length,c.length),e=[],f=[],g=0,h,i,j,k;for(;g<d;g++){j=b[g]||b_(c[g]),k=c[g]||b_(j);if(j[0]!=k[0]||j[0].toLowerCase()=="r"&&(j[2]!=k[2]||j[3]!=k[3])||j[0].toLowerCase()=="s"&&(j[3]!=k[3]||j[4]!=k[4]))return;e[g]=[],f[g]=[];for(h=0,i=x(j.length,k.length);h<i;h++)h in j&&(e[g][h]=j[h]),h in k&&(f[g][h]=k[h])}return{from:e,to:f}};a._getContainer=function(b,c,d,e){var f;f=e==null&&!a.is(b,"object")?h.doc.getElementById(b):b;if(f!=null){if(f.tagName)return c==null?{container:f,width:f.style.pixelWidth||f.offsetWidth,height:f.style.pixelHeight||f.offsetHeight}:{container:f,width:c,height:d};return{container:1,x:b,y:c,width:d,height:e}}},a.pathToRelative=bK,a._engine={},a.path2curve=bR,a.matrix=function(a,b,c,d,e,f){return new cb(a,b,c,d,e,f)},function(b){function d(a){var b=w.sqrt(c(a));a[0]&&(a[0]/=b),a[1]&&(a[1]/=b)}function c(a){return a[0]*a[0]+a[1]*a[1]}b.add=function(a,b,c,d,e,f){var g=[[],[],[]],h=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],i=[[a,c,e],[b,d,f],[0,0,1]],j,k,l,m;a&&a instanceof cb&&(i=[[a.a,a.c,a.e],[a.b,a.d,a.f],[0,0,1]]);for(j=0;j<3;j++)for(k=0;k<3;k++){m=0;for(l=0;l<3;l++)m+=h[j][l]*i[l][k];g[j][k]=m}this.a=g[0][0],this.b=g[1][0],this.c=g[0][1],this.d=g[1][1],this.e=g[0][2],this.f=g[1][2]},b.invert=function(){var a=this,b=a.a*a.d-a.b*a.c;return new cb(a.d/b,-a.b/b,-a.c/b,a.a/b,(a.c*a.f-a.d*a.e)/b,(a.b*a.e-a.a*a.f)/b)},b.clone=function(){return new cb(this.a,this.b,this.c,this.d,this.e,this.f)},b.translate=function(a,b){this.add(1,0,0,1,a,b)},b.scale=function(a,b,c,d){b==null&&(b=a),(c||d)&&this.add(1,0,0,1,c,d),this.add(a,0,0,b,0,0),(c||d)&&this.add(1,0,0,1,-c,-d)},b.rotate=function(b,c,d){b=a.rad(b),c=c||0,d=d||0;var e=+w.cos(b).toFixed(9),f=+w.sin(b).toFixed(9);this.add(e,f,-f,e,c,d),this.add(1,0,0,1,-c,-d)},b.x=function(a,b){return a*this.a+b*this.c+this.e},b.y=function(a,b){return a*this.b+b*this.d+this.f},b.get=function(a){return+this[r.fromCharCode(97+a)].toFixed(4)},b.toString=function(){return a.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},b.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},b.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},b.split=function(){var b={};b.dx=this.e,b.dy=this.f;var e=[[this.a,this.c],[this.b,this.d]];b.scalex=w.sqrt(c(e[0])),d(e[0]),b.shear=e[0][0]*e[1][0]+e[0][1]*e[1][1],e[1]=[e[1][0]-e[0][0]*b.shear,e[1][1]-e[0][1]*b.shear],b.scaley=w.sqrt(c(e[1])),d(e[1]),b.shear/=b.scaley;var f=-e[0][1],g=e[1][1];g<0?(b.rotate=a.deg(w.acos(g)),f<0&&(b.rotate=360-b.rotate)):b.rotate=a.deg(w.asin(f)),b.isSimple=!+b.shear.toFixed(9)&&(b.scalex.toFixed(9)==b.scaley.toFixed(9)||!b.rotate),b.isSuperSimple=!+b.shear.toFixed(9)&&b.scalex.toFixed(9)==b.scaley.toFixed(9)&&!b.rotate,b.noRotation=!+b.shear.toFixed(9)&&!b.rotate;return b},b.toTransformString=function(a){var b=a||this[s]();if(b.isSimple){b.scalex=+b.scalex.toFixed(4),b.scaley=+b.scaley.toFixed(4),b.rotate=+b.rotate.toFixed(4);return(b.dx||b.dy?"t"+[b.dx,b.dy]:p)+(b.scalex!=1||b.scaley!=1?"s"+[b.scalex,b.scaley,0,0]:p)+(b.rotate?"r"+[b.rotate,0,0]:p)}return"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(cb.prototype);var cc=navigator.userAgent.match(/Version\/(.*?)\s/)||navigator.userAgent.match(/Chrome\/(\d+)/);navigator.vendor=="Apple Computer, Inc."&&(cc&&cc[1]<4||navigator.platform.slice(0,2)=="iP")||navigator.vendor=="Google Inc."&&cc&&cc[1]<8?k.safari=function(){var a=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});setTimeout(function(){a.remove()})}:k.safari=be;var cd=function(){this.returnValue=!1},ce=function(){return this.originalEvent.preventDefault()},cf=function(){this.cancelBubble=!0},cg=function(){return this.originalEvent.stopPropagation()},ch=function(){if(h.doc.addEventListener)return function(a,b,c,d){var e=o&&u[b]?u[b]:b,f=function(e){var f=h.doc.documentElement.scrollTop||h.doc.body.scrollTop,i=h.doc.documentElement.scrollLeft||h.doc.body.scrollLeft,j=e.clientX+i,k=e.clientY+f;if(o&&u[g](b))for(var l=0,m=e.targetTouches&&e.targetTouches.length;l<m;l++)if(e.targetTouches[l].target==a){var n=e;e=e.targetTouches[l],e.originalEvent=n,e.preventDefault=ce,e.stopPropagation=cg;break}return c.call(d,e,j,k)};a.addEventListener(e,f,!1);return function(){a.removeEventListener(e,f,!1);return!0}};if(h.doc.attachEvent)return function(a,b,c,d){var e=function(a){a=a||h.win.event;var b=h.doc.documentElement.scrollTop||h.doc.body.scrollTop,e=h.doc.documentElement.scrollLeft||h.doc.body.scrollLeft,f=a.clientX+e,g=a.clientY+b;a.preventDefault=a.preventDefault||cd,a.stopPropagation=a.stopPropagation||cf;return c.call(d,a,f,g)};a.attachEvent("on"+b,e);var f=function(){a.detachEvent("on"+b,e);return!0};return f}}(),ci=[],cj=function(a){var b=a.clientX,c=a.clientY,d=h.doc.documentElement.scrollTop||h.doc.body.scrollTop,e=h.doc.documentElement.scrollLeft||h.doc.body.scrollLeft,f,g=ci.length;while(g--){f=ci[g];if(o){var i=a.touches.length,j;while(i--){j=a.touches[i];if(j.identifier==f.el._drag.id){b=j.clientX,c=j.clientY,(a.originalEvent?a.originalEvent:a).preventDefault();break}}}else a.preventDefault();var k=f.el.node,l,m=k.nextSibling,n=k.parentNode,p=k.style.display;h.win.opera&&n.removeChild(k),k.style.display="none",l=f.el.paper.getElementByPoint(b,c),k.style.display=p,h.win.opera&&(m?n.insertBefore(k,m):n.appendChild(k)),l&&eve("raphael.drag.over."+f.el.id,f.el,l),b+=e,c+=d,eve("raphael.drag.move."+f.el.id,f.move_scope||f.el,b-f.el._drag.x,c-f.el._drag.y,b,c,a)}},ck=function(b){a.unmousemove(cj).unmouseup(ck);var c=ci.length,d;while(c--)d=ci[c],d.el._drag={},eve("raphael.drag.end."+d.el.id,d.end_scope||d.start_scope||d.move_scope||d.el,b);ci=[]},cl=a.el={};for(var cm=t.length;cm--;)(function(b){a[b]=cl[b]=function(c,d){a.is(c,"function")&&(this.events=this.events||[],this.events.push({name:b,f:c,unbind:ch(this.shape||this.node||h.doc,b,c,d||this)}));return this},a["un"+b]=cl["un"+b]=function(a){var c=this.events||[],d=c.length;while(d--)if(c[d].name==b&&c[d].f==a){c[d].unbind(),c.splice(d,1),!c.length&&delete this.events;return this}return this}})(t[cm]);cl.data=function(b,c){var d=bb[this.id]=bb[this.id]||{};if(arguments.length==1){if(a.is(b,"object")){for(var e in b)b[g](e)&&this.data(e,b[e]);return this}eve("raphael.data.get."+this.id,this,d[b],b);return d[b]}d[b]=c,eve("raphael.data.set."+this.id,this,c,b);return this},cl.removeData=function(a){a==null?bb[this.id]={}:bb[this.id]&&delete bb[this.id][a];return this},cl.hover=function(a,b,c,d){return this.mouseover(a,c).mouseout(b,d||c)},cl.unhover=function(a,b){return this.unmouseover(a).unmouseout(b)};var cn=[];cl.drag=function(b,c,d,e,f,g){function i(i){(i.originalEvent||i).preventDefault();var j=h.doc.documentElement.scrollTop||h.doc.body.scrollTop,k=h.doc.documentElement.scrollLeft||h.doc.body.scrollLeft;this._drag.x=i.clientX+k,this._drag.y=i.clientY+j,this._drag.id=i.identifier,!ci.length&&a.mousemove(cj).mouseup(ck),ci.push({el:this,move_scope:e,start_scope:f,end_scope:g}),c&&eve.on("raphael.drag.start."+this.id,c),b&&eve.on("raphael.drag.move."+this.id,b),d&&eve.on("raphael.drag.end."+this.id,d),eve("raphael.drag.start."+this.id,f||e||this,i.clientX+k,i.clientY+j,i)}this._drag={},cn.push({el:this,start:i}),this.mousedown(i);return this},cl.onDragOver=function(a){a?eve.on("raphael.drag.over."+this.id,a):eve.unbind("raphael.drag.over."+this.id)},cl.undrag=function(){var b=cn.length;while(b--)cn[b].el==this&&(this.unmousedown(cn[b].start),cn.splice(b,1),eve.unbind("raphael.drag.*."+this.id));!cn.length&&a.unmousemove(cj).unmouseup(ck)},k.circle=function(b,c,d){var e=a._engine.circle(this,b||0,c||0,d||0);this.__set__&&this.__set__.push(e);return e},k.rect=function(b,c,d,e,f){var g=a._engine.rect(this,b||0,c||0,d||0,e||0,f||0);this.__set__&&this.__set__.push(g);return g},k.ellipse=function(b,c,d,e){var f=a._engine.ellipse(this,b||0,c||0,d||0,e||0);this.__set__&&this.__set__.push(f);return f},k.path=function(b){b&&!a.is(b,D)&&!a.is(b[0],E)&&(b+=p);var c=a._engine.path(a.format[m](a,arguments),this);this.__set__&&this.__set__.push(c);return c},k.image=function(b,c,d,e,f){var g=a._engine.image(this,b||"about:blank",c||0,d||0,e||0,f||0);this.__set__&&this.__set__.push(g);return g},k.text=function(b,c,d){var e=a._engine.text(this,b||0,c||0,r(d));this.__set__&&this.__set__.push(e);return e},k.set=function(b){!a.is(b,"array")&&(b=Array.prototype.splice.call(arguments,0,arguments.length));var c=new cG(b);this.__set__&&this.__set__.push(c);return c},k.setStart=function(a){this.__set__=a||this.set()},k.setFinish=function(a){var b=this.__set__;delete this.__set__;return b},k.setSize=function(b,c){return a._engine.setSize.call(this,b,c)},k.setViewBox=function(b,c,d,e,f){return a._engine.setViewBox.call(this,b,c,d,e,f)},k.top=k.bottom=null,k.raphael=a;var co=function(a){var b=a.getBoundingClientRect(),c=a.ownerDocument,d=c.body,e=c.documentElement,f=e.clientTop||d.clientTop||0,g=e.clientLeft||d.clientLeft||0,i=b.top+(h.win.pageYOffset||e.scrollTop||d.scrollTop)-f,j=b.left+(h.win.pageXOffset||e.scrollLeft||d.scrollLeft)-g;return{y:i,x:j}};k.getElementByPoint=function(a,b){var c=this,d=c.canvas,e=h.doc.elementFromPoint(a,b);if(h.win.opera&&e.tagName=="svg"){var f=co(d),g=d.createSVGRect();g.x=a-f.x,g.y=b-f.y,g.width=g.height=1;var i=d.getIntersectionList(g,null);i.length&&(e=i[i.length-1])}if(!e)return null;while(e.parentNode&&e!=d.parentNode&&!e.raphael)e=e.parentNode;e==c.canvas.parentNode&&(e=d),e=e&&e.raphael?c.getById(e.raphaelid):null;return e},k.getById=function(a){var b=this.bottom;while(b){if(b.id==a)return b;b=b.next}return null},k.forEach=function(a,b){var c=this.bottom;while(c){if(a.call(b,c)===!1)return this;c=c.next}return this},k.getElementsByPoint=function(a,b){var c=this.set();this.forEach(function(d){d.isPointInside(a,b)&&c.push(d)});return c},cl.isPointInside=function(b,c){var d=this.realPath=this.realPath||bi[this.type](this);return a.isPointInsidePath(d,b,c)},cl.getBBox=function(a){if(this.removed)return{};var b=this._;if(a){if(b.dirty||!b.bboxwt)this.realPath=bi[this.type](this),b.bboxwt=bI(this.realPath),b.bboxwt.toString=cq,b.dirty=0;return b.bboxwt}if(b.dirty||b.dirtyT||!b.bbox){if(b.dirty||!this.realPath)b.bboxwt=0,this.realPath=bi[this.type](this);b.bbox=bI(bj(this.realPath,this.matrix)),b.bbox.toString=cq,b.dirty=b.dirtyT=0}return b.bbox},cl.clone=function(){if(this.removed)return null;var a=this.paper[this.type]().attr(this.attr());this.__set__&&this.__set__.push(a);return a},cl.glow=function(a){if(this.type=="text")return null;a=a||{};var b={width:(a.width||10)+(+this.attr("stroke-width")||1),fill:a.fill||!1,opacity:a.opacity||.5,offsetx:a.offsetx||0,offsety:a.offsety||0,color:a.color||"#000"},c=b.width/2,d=this.paper,e=d.set(),f=this.realPath||bi[this.type](this);f=this.matrix?bj(f,this.matrix):f;for(var g=1;g<c+1;g++)e.push(d.path(f).attr({stroke:b.color,fill:b.fill?b.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(b.width/c*g).toFixed(3),opacity:+(b.opacity/c).toFixed(3)}));return e.insertBefore(this).translate(b.offsetx,b.offsety)};var cr={},cs=function(b,c,d,e,f,g,h,i,j){return j==null?bB(b,c,d,e,f,g,h,i):a.findDotsAtSegment(b,c,d,e,f,g,h,i,bC(b,c,d,e,f,g,h,i,j))},ct=function(b,c){return function(d,e,f){d=bR(d);var g,h,i,j,k="",l={},m,n=0;for(var o=0,p=d.length;o<p;o++){i=d[o];if(i[0]=="M")g=+i[1],h=+i[2];else{j=cs(g,h,i[1],i[2],i[3],i[4],i[5],i[6]);if(n+j>e){if(c&&!l.start){m=cs(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),k+=["C"+m.start.x,m.start.y,m.m.x,m.m.y,m.x,m.y];if(f)return k;l.start=k,k=["M"+m.x,m.y+"C"+m.n.x,m.n.y,m.end.x,m.end.y,i[5],i[6]].join(),n+=j,g=+i[5],h=+i[6];continue}if(!b&&!c){m=cs(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n);return{x:m.x,y:m.y,alpha:m.alpha}}}n+=j,g=+i[5],h=+i[6]}k+=i.shift()+i}l.end=k,m=b?n:c?l:a.findDotsAtSegment(g,h,i[0],i[1],i[2],i[3],i[4],i[5],1),m.alpha&&(m={x:m.x,y:m.y,alpha:m.alpha});return m}},cu=ct(1),cv=ct(),cw=ct(0,1);a.getTotalLength=cu,a.getPointAtLength=cv,a.getSubpath=function(a,b,c){if(this.getTotalLength(a)-c<1e-6)return cw(a,b).end;var d=cw(a,c,1);return b?cw(d,b).end:d},cl.getTotalLength=function(){if(this.type=="path"){if(this.node.getTotalLength)return this.node.getTotalLength();return cu(this.attrs.path)}},cl.getPointAtLength=function(a){if(this.type=="path")return cv(this.attrs.path,a)},cl.getSubpath=function(b,c){if(this.type=="path")return a.getSubpath(this.attrs.path,b,c)};var cx=a.easing_formulas={linear:function(a){return a},"<":function(a){return A(a,1.7)},">":function(a){return A(a,.48)},"<>":function(a){var b=.48-a/1.04,c=w.sqrt(.1734+b*b),d=c-b,e=A(z(d),1/3)*(d<0?-1:1),f=-c-b,g=A(z(f),1/3)*(f<0?-1:1),h=e+g+.5;return(1-h)*3*h*h+h*h*h},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a=a-1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){if(a==!!a)return a;return A(2,-10*a)*w.sin((a-.075)*2*B/.3)+1},bounce:function(a){var b=7.5625,c=2.75,d;a<1/c?d=b*a*a:a<2/c?(a-=1.5/c,d=b*a*a+.75):a<2.5/c?(a-=2.25/c,d=b*a*a+.9375):(a-=2.625/c,d=b*a*a+.984375);return d}};cx.easeIn=cx["ease-in"]=cx["<"],cx.easeOut=cx["ease-out"]=cx[">"],cx.easeInOut=cx["ease-in-out"]=cx["<>"],cx["back-in"]=cx.backIn,cx["back-out"]=cx.backOut;var cy=[],cz=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,16)},cA=function(){var b=+(new Date),c=0;for(;c<cy.length;c++){var d=cy[c];if(d.el.removed||d.paused)continue;var e=b-d.start,f=d.ms,h=d.easing,i=d.from,j=d.diff,k=d.to,l=d.t,m=d.el,o={},p,r={},s;d.initstatus?(e=(d.initstatus*d.anim.top-d.prev)/(d.percent-d.prev)*f,d.status=d.initstatus,delete d.initstatus,d.stop&&cy.splice(c--,1)):d.status=(d.prev+(d.percent-d.prev)*(e/f))/d.anim.top;if(e<0)continue;if(e<f){var t=h(e/f);for(var u in i)if(i[g](u)){switch(U[u]){case C:p=+i[u]+t*f*j[u];break;case"colour":p="rgb("+[cB(O(i[u].r+t*f*j[u].r)),cB(O(i[u].g+t*f*j[u].g)),cB(O(i[u].b+t*f*j[u].b))].join(",")+")";break;case"path":p=[];for(var v=0,w=i[u].length;v<w;v++){p[v]=[i[u][v][0]];for(var x=1,y=i[u][v].length;x<y;x++)p[v][x]=+i[u][v][x]+t*f*j[u][v][x];p[v]=p[v].join(q)}p=p.join(q);break;case"transform":if(j[u].real){p=[];for(v=0,w=i[u].length;v<w;v++){p[v]=[i[u][v][0]];for(x=1,y=i[u][v].length;x<y;x++)p[v][x]=i[u][v][x]+t*f*j[u][v][x]}}else{var z=function(a){return+i[u][a]+t*f*j[u][a]};p=[["m",z(0),z(1),z(2),z(3),z(4),z(5)]]}break;case"csv":if(u=="clip-rect"){p=[],v=4;while(v--)p[v]=+i[u][v]+t*f*j[u][v]}break;default:var A=[][n](i[u]);p=[],v=m.paper.customAttributes[u].length;while(v--)p[v]=+A[v]+t*f*j[u][v]}o[u]=p}m.attr(o),function(a,b,c){setTimeout(function(){eve("raphael.anim.frame."+a,b,c)})}(m.id,m,d.anim)}else{(function(b,c,d){setTimeout(function(){eve("raphael.anim.frame."+c.id,c,d),eve("raphael.anim.finish."+c.id,c,d),a.is(b,"function")&&b.call(c)})})(d.callback,m,d.anim),m.attr(k),cy.splice(c--,1);if(d.repeat>1&&!d.next){for(s in k)k[g](s)&&(r[s]=d.totalOrigin[s]);d.el.attr(r),cE(d.anim,d.el,d.anim.percents[0],null,d.totalOrigin,d.repeat-1)}d.next&&!d.stop&&cE(d.anim,d.el,d.next,null,d.totalOrigin,d.repeat)}}a.svg&&m&&m.paper&&m.paper.safari(),cy.length&&cz(cA)},cB=function(a){return a>255?255:a<0?0:a};cl.animateWith=function(b,c,d,e,f,g){var h=this;if(h.removed){g&&g.call(h);return h}var i=d instanceof cD?d:a.animation(d,e,f,g),j,k;cE(i,h,i.percents[0],null,h.attr());for(var l=0,m=cy.length;l<m;l++)if(cy[l].anim==c&&cy[l].el==b){cy[m-1].start=cy[l].start;break}return h},cl.onAnimation=function(a){a?eve.on("raphael.anim.frame."+this.id,a):eve.unbind("raphael.anim.frame."+this.id);return this},cD.prototype.delay=function(a){var b=new cD(this.anim,this.ms);b.times=this.times,b.del=+a||0;return b},cD.prototype.repeat=function(a){var b=new cD(this.anim,this.ms);b.del=this.del,b.times=w.floor(x(a,0))||1;return b},a.animation=function(b,c,d,e){if(b instanceof cD)return b;if(a.is(d,"function")||!d)e=e||d||null,d=null;b=Object(b),c=+c||0;var f={},h,i;for(i in b)b[g](i)&&Q(i)!=i&&Q(i)+"%"!=i&&(h=!0,f[i]=b[i]);if(!h)return new cD(b,c);d&&(f.easing=d),e&&(f.callback=e);return new cD({100:f},c)},cl.animate=function(b,c,d,e){var f=this;if(f.removed){e&&e.call(f);return f}var g=b instanceof cD?b:a.animation(b,c,d,e);cE(g,f,g.percents[0],null,f.attr());return f},cl.setTime=function(a,b){a&&b!=null&&this.status(a,y(b,a.ms)/a.ms);return this},cl.status=function(a,b){var c=[],d=0,e,f;if(b!=null){cE(a,this,-1,y(b,1));return this}e=cy.length;for(;d<e;d++){f=cy[d];if(f.el.id==this.id&&(!a||f.anim==a)){if(a)return f.status;c.push({anim:f.anim,status:f.status})}}if(a)return 0;return c},cl.pause=function(a){for(var b=0;b<cy.length;b++)cy[b].el.id==this.id&&(!a||cy[b].anim==a)&&eve("raphael.anim.pause."+this.id,this,cy[b].anim)!==!1&&(cy[b].paused=!0);return this},cl.resume=function(a){for(var b=0;b<cy.length;b++)if(cy[b].el.id==this.id&&(!a||cy[b].anim==a)){var c=cy[b];eve("raphael.anim.resume."+this.id,this,c.anim)!==!1&&(delete c.paused,this.status(c.anim,c.status))}return this},cl.stop=function(a){for(var b=0;b<cy.length;b++)cy[b].el.id==this.id&&(!a||cy[b].anim==a)&&eve("raphael.anim.stop."+this.id,this,cy[b].anim)!==!1&&cy.splice(b--,1);return this},eve.on("raphael.remove",cF),eve.on("raphael.clear",cF),cl.toString=function(){return"RaphaĆ«lā€™s object"};var cG=function(a){this.items=[],this.length=0,this.type="set";if(a)for(var b=0,c=a.length;b<c;b++)a[b]&&(a[b].constructor==cl.constructor||a[b].constructor==cG)&&(this[this.items.length]=this.items[this.items.length]=a[b],this.length++)},cH=cG.prototype;cH.push=function(){var a,b;for(var c=0,d=arguments.length;c<d;c++)a=arguments[c],a&&(a.constructor==cl.constructor||a.constructor==cG)&&(b=this.items.length,this[b]=this.items[b]=a,this.length++);return this},cH.pop=function(){this.length&&delete this[this.length--];return this.items.pop()},cH.forEach=function(a,b){for(var c=0,d=this.items.length;c<d;c++)if(a.call(b,this.items[c],c)===!1)return this;return this};for(var cI in cl)cl[g](cI)&&(cH[cI]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a][m](c,b)})}}(cI));cH.attr=function(b,c){if(b&&a.is(b,E)&&a.is(b[0],"object"))for(var d=0,e=b.length;d<e;d++)this.items[d].attr(b[d]);else for(var f=0,g=this.items.length;f<g;f++)this.items[f].attr(b,c);return this},cH.clear=function(){while(this.length)this.pop()},cH.splice=function(a,b,c){a=a<0?x(this.length+a,0):a,b=x(0,y(this.length-a,b));var d=[],e=[],f=[],g;for(g=2;g<arguments.length;g++)f.push(arguments[g]);for(g=0;g<b;g++)e.push(this[a+g]);for(;g<this.length-a;g++)d.push(this[a+g]);var h=f.length;for(g=0;g<h+d.length;g++)this.items[a+g]=this[a+g]=g<h?f[g]:d[g-h];g=this.items.length=this.length-=b-h;while(this[g])delete this[g++];return new cG(e)},cH.exclude=function(a){for(var b=0,c=this.length;b<c;b++)if(this[b]==a){this.splice(b,1);return!0}},cH.animate=function(b,c,d,e){(a.is(d,"function")||!d)&&(e=d||null);var f=this.items.length,g=f,h,i=this,j;if(!f)return this;e&&(j=function(){!--f&&e.call(i)}),d=a.is(d,D)?d:j;var k=a.animation(b,c,d,j);h=this.items[--g].animate(k);while(g--)this.items[g]&&!this.items[g].removed&&this.items[g].animateWith(h,k,k);return this},cH.insertAfter=function(a){var b=this.items.length;while(b--)this.items[b].insertAfter(a);return this},cH.getBBox=function(){var a=[],b=[],c=[],d=[];for(var e=this.items.length;e--;)if(!this.items[e].removed){var f=this.items[e].getBBox();a.push(f.x),b.push(f.y),c.push(f.x+f.width),d.push(f.y+f.height)}a=y[m](0,a),b=y[m](0,b),c=x[m](0,c),d=x[m](0,d);return{x:a,y:b,x2:c,y2:d,width:c-a,height:d-b}},cH.clone=function(a){a=new cG;for(var b=0,c=this.items.length;b<c;b++)a.push(this.items[b].clone());return a},cH.toString=function(){return"RaphaĆ«lā€˜s set"},a.registerFont=function(a){if(!a.face)return a;this.fonts=this.fonts||{};var b={w:a.w,face:{},glyphs:{}},c=a.face["font-family"];for(var d in a.face)a.face[g](d)&&(b.face[d]=a.face[d]);this.fonts[c]?this.fonts[c].push(b):this.fonts[c]=[b];if(!a.svg){b.face["units-per-em"]=R(a.face["units-per-em"],10);for(var e in a.glyphs)if(a.glyphs[g](e)){var f=a.glyphs[e];b.glyphs[e]={w:f.w,k:{},d:f.d&&"M"+f.d.replace(/[mlcxtrv]/g,function(a){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[a]||"M"})+"z"};if(f.k)for(var h in f.k)f[g](h)&&(b.glyphs[e].k[h]=f.k[h])}}return a},k.getFont=function(b,c,d,e){e=e||"normal",d=d||"normal",c=+c||{normal:400,bold:700,lighter:300,bolder:800}[c]||400;if(!!a.fonts){var f=a.fonts[b];if(!f){var h=new RegExp("(^|\\s)"+b.replace(/[^\w\d\s+!~.:_-]/g,p)+"(\\s|$)","i");for(var i in a.fonts)if(a.fonts[g](i)&&h.test(i)){f=a.fonts[i];break}}var j;if(f)for(var k=0,l=f.length;k<l;k++){j=f[k];if(j.face["font-weight"]==c&&(j.face["font-style"]==d||!j.face["font-style"])&&j.face["font-stretch"]==e)break}return j}},k.print=function(b,d,e,f,g,h,i){h=h||"middle",i=x(y(i||0,1),-1);var j=r(e)[s](p),k=0,l=0,m=p,n;a.is(f,e)&&(f=this.getFont(f));if(f){n=(g||16)/f.face["units-per-em"];var o=f.face.bbox[s](c),q=+o[0],t=o[3]-o[1],u=0,v=+o[1]+(h=="baseline"?t+ +f.face.descent:t/2);for(var w=0,z=j.length;w<z;w++){if(j[w]=="\n")k=0,B=0,l=0,u+=t;else{var A=l&&f.glyphs[j[w-1]]||{},B=f.glyphs[j[w]];k+=l?(A.w||f.w)+(A.k&&A.k[j[w]]||0)+f.w*i:0,l=1}B&&B.d&&(m+=a.transformPath(B.d,["t",k*n,u*n,"s",n,n,q,v,"t",(b-q)/n,(d-v)/n]))}}return this.path(m).attr({fill:"#000",stroke:"none"})},k.add=function(b){if(a.is(b,"array")){var c=this.set(),e=0,f=b.length,h;for(;e<f;e++)h=b[e]||{},d[g](h.type)&&c.push(this[h.type]().attr(h))}return c},a.format=function(b,c){var d=a.is(c,E)?[0][n](c):arguments;b&&a.is(b,D)&&d.length-1&&(b=b.replace(e,function(a,b){return d[++b]==null?p:d[b]}));return b||p},a.fullfill=function(){var a=/\{([^\}]+)\}/g,b=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,c=function(a,c,d){var e=d;c.replace(b,function(a,b,c,d,f){b=b||d,e&&(b in e&&(e=e[b]),typeof e=="function"&&f&&(e=e()))}),e=(e==null||e==d?a:e)+"";return e};return function(b,d){return String(b).replace(a,function(a,b){return c(a,b,d)})}}(),a.ninja=function(){i.was?h.win.Raphael=i.is:delete Raphael;return a},a.st=cH,function(b,c,d){function e(){/in/.test(b.readyState)?setTimeout(e,9):a.eve("raphael.DOMload")}b.readyState==null&&b.addEventListener&&(b.addEventListener(c,d=function(){b.removeEventListener(c,d,!1),b.readyState="complete"},!1),b.readyState="loading"),e()}(document,"DOMContentLoaded"),i.was?h.win.Raphael=a:Raphael=a,eve.on("raphael.DOMload",function(){b=!0})}(),window.Raphael.svg&&function(a){var b="hasOwnProperty",c=String,d=parseFloat,e=parseInt,f=Math,g=f.max,h=f.abs,i=f.pow,j=/[, ]+/,k=a.eve,l="",m=" ",n="http://www.w3.org/1999/xlink",o={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},p={};a.toString=function(){return"Your browser supports SVG.\nYou are running RaphaĆ«l "+this.version};var q=function(d,e){if(e){typeof d=="string"&&(d=q(d));for(var f in e)e[b](f)&&(f.substring(0,6)=="xlink:"?d.setAttributeNS(n,f.substring(6),c(e[f])):d.setAttribute(f,c(e[f])))}else d=a._g.doc.createElementNS("http://www.w3.org/2000/svg",d),d.style&&(d.style.webkitTapHighlightColor="rgba(0,0,0,0)");return d},r=function(b,e){var j="linear",k=b.id+e,m=.5,n=.5,o=b.node,p=b.paper,r=o.style,s=a._g.doc.getElementById(k);if(!s){e=c(e).replace(a._radial_gradient,function(a,b,c){j="radial";if(b&&c){m=d(b),n=d(c);var e=(n>.5)*2-1;i(m-.5,2)+i(n-.5,2)>.25&&(n=f.sqrt(.25-i(m-.5,2))*e+.5)&&n!=.5&&(n=n.toFixed(5)-1e-5*e)}return l}),e=e.split(/\s*\-\s*/);if(j=="linear"){var t=e.shift();t=-d(t);if(isNaN(t))return null;var u=[0,0,f.cos(a.rad(t)),f.sin(a.rad(t))],v=1/(g(h(u[2]),h(u[3]))||1);u[2]*=v,u[3]*=v,u[2]<0&&(u[0]=-u[2],u[2]=0),u[3]<0&&(u[1]=-u[3],u[3]=0)}var w=a._parseDots(e);if(!w)return null;k=k.replace(/[\(\)\s,\xb0#]/g,"_"),b.gradient&&k!=b.gradient.id&&(p.defs.removeChild(b.gradient),delete b.gradient);if(!b.gradient){s=q(j+"Gradient",{id:k}),b.gradient=s,q(s,j=="radial"?{fx:m,fy:n}:{x1:u[0],y1:u[1],x2:u[2],y2:u[3],gradientTransform:b.matrix.invert()}),p.defs.appendChild(s);for(var x=0,y=w.length;x<y;x++)s.appendChild(q("stop",{offset:w[x].offset?w[x].offset:x?"100%":"0%","stop-color":w[x].color||"#fff"}))}}q(o,{fill:"url(#"+k+")",opacity:1,"fill-opacity":1}),r.fill=l,r.opacity=1,r.fillOpacity=1;return 1},s=function(a){var b=a.getBBox(1);q(a.pattern,{patternTransform:a.matrix.invert()+" translate("+b.x+","+b.y+")"})},t=function(d,e,f){if(d.type=="path"){var g=c(e).toLowerCase().split("-"),h=d.paper,i=f?"end":"start",j=d.node,k=d.attrs,m=k["stroke-width"],n=g.length,r="classic",s,t,u,v,w,x=3,y=3,z=5;while(n--)switch(g[n]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":r=g[n];break;case"wide":y=5;break;case"narrow":y=2;break;case"long":x=5;break;case"short":x=2}r=="open"?(x+=2,y+=2,z+=2,u=1,v=f?4:1,w={fill:"none",stroke:k.stroke}):(v=u=x/2,w={fill:k.stroke,stroke:"none"}),d._.arrows?f?(d._.arrows.endPath&&p[d._.arrows.endPath]--,d._.arrows.endMarker&&p[d._.arrows.endMarker]--):(d._.arrows.startPath&&p[d._.arrows.startPath]--,d._.arrows.startMarker&&p[d._.arrows.startMarker]--):d._.arrows={};if(r!="none"){var A="raphael-marker-"+r,B="raphael-marker-"+i+r+x+y;a._g.doc.getElementById(A)?p[A]++:(h.defs.appendChild(q(q("path"),{"stroke-linecap":"round",d:o[r],id:A})),p[A]=1);var C=a._g.doc.getElementById(B),D;C?(p[B]++,D=C.getElementsByTagName("use")[0]):(C=q(q("marker"),{id:B,markerHeight:y,markerWidth:x,orient:"auto",refX:v,refY:y/2}),D=q(q("use"),{"xlink:href":"#"+A,transform:(f?"rotate(180 "+x/2+" "+y/2+") ":l)+"scale("+x/z+","+y/z+")","stroke-width":(1/((x/z+y/z)/2)).toFixed(4)}),C.appendChild(D),h.defs.appendChild(C),p[B]=1),q(D,w);var F=u*(r!="diamond"&&r!="oval");f?(s=d._.arrows.startdx*m||0,t=a.getTotalLength(k.path)-F*m):(s=F*m,t=a.getTotalLength(k.path)-(d._.arrows.enddx*m||0)),w={},w["marker-"+i]="url(#"+B+")";if(t||s)w.d=Raphael.getSubpath(k.path,s,t);q(j,w),d._.arrows[i+"Path"]=A,d._.arrows[i+"Marker"]=B,d._.arrows[i+"dx"]=F,d._.arrows[i+"Type"]=r,d._.arrows[i+"String"]=e}else f?(s=d._.arrows.startdx*m||0,t=a.getTotalLength(k.path)-s):(s=0,t=a.getTotalLength(k.path)-(d._.arrows.enddx*m||0)),d._.arrows[i+"Path"]&&q(j,{d:Raphael.getSubpath(k.path,s,t)}),delete d._.arrows[i+"Path"],delete d._.arrows[i+"Marker"],delete d._.arrows[i+"dx"],delete d._.arrows[i+"Type"],delete d._.arrows[i+"String"];for(w in p)if(p[b](w)&&!p[w]){var G=a._g.doc.getElementById(w);G&&G.parentNode.removeChild(G)}}},u={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},v=function(a,b,d){b=u[c(b).toLowerCase()];if(b){var e=a.attrs["stroke-width"]||"1",f={round:e,square:e,butt:0}[a.attrs["stroke-linecap"]||d["stroke-linecap"]]||0,g=[],h=b.length;while(h--)g[h]=b[h]*e+(h%2?1:-1)*f;q(a.node,{"stroke-dasharray":g.join(",")})}},w=function(d,f){var i=d.node,k=d.attrs,m=i.style.visibility;i.style.visibility="hidden";for(var o in f)if(f[b](o)){if(!a._availableAttrs[b](o))continue;var p=f[o];k[o]=p;switch(o){case"blur":d.blur(p);break;case"href":case"title":case"target":var u=i.parentNode;if(u.tagName.toLowerCase()!="a"){var w=q("a");u.insertBefore(w,i),w.appendChild(i),u=w}o=="target"?u.setAttributeNS(n,"show",p=="blank"?"new":p):u.setAttributeNS(n,o,p);break;case"cursor":i.style.cursor=p;break;case"transform":d.transform(p);break;case"arrow-start":t(d,p);break;case"arrow-end":t(d,p,1);break;case"clip-rect":var x=c(p).split(j);if(x.length==4){d.clip&&d.clip.parentNode.parentNode.removeChild(d.clip.parentNode);var z=q("clipPath"),A=q("rect");z.id=a.createUUID(),q(A,{x:x[0],y:x[1],width:x[2],height:x[3]}),z.appendChild(A),d.paper.defs.appendChild(z),q(i,{"clip-path":"url(#"+z.id+")"}),d.clip=A}if(!p){var B=i.getAttribute("clip-path");if(B){var C=a._g.doc.getElementById(B.replace(/(^url\(#|\)$)/g,l));C&&C.parentNode.removeChild(C),q(i,{"clip-path":l}),delete d.clip}}break;case"path":d.type=="path"&&(q(i,{d:p?k.path=a._pathToAbsolute(p):"M0,0"}),d._.dirty=1,d._.arrows&&("startString"in d._.arrows&&t(d,d._.arrows.startString),"endString"in d._.arrows&&t(d,d._.arrows.endString,1)));break;case"width":i.setAttribute(o,p),d._.dirty=1;if(k.fx)o="x",p=k.x;else break;case"x":k.fx&&(p=-k.x-(k.width||0));case"rx":if(o=="rx"&&d.type=="rect")break;case"cx":i.setAttribute(o,p),d.pattern&&s(d),d._.dirty=1;break;case"height":i.setAttribute(o,p),d._.dirty=1;if(k.fy)o="y",p=k.y;else break;case"y":k.fy&&(p=-k.y-(k.height||0));case"ry":if(o=="ry"&&d.type=="rect")break;case"cy":i.setAttribute(o,p),d.pattern&&s(d),d._.dirty=1;break;case"r":d.type=="rect"?q(i,{rx:p,ry:p}):i.setAttribute(o,p),d._.dirty=1;break;case"src":d.type=="image"&&i.setAttributeNS(n,"href",p);break;case"stroke-width":if(d._.sx!=1||d._.sy!=1)p/=g(h(d._.sx),h(d._.sy))||1;d.paper._vbSize&&(p*=d.paper._vbSize),i.setAttribute(o,p),k["stroke-dasharray"]&&v(d,k["stroke-dasharray"],f),d._.arrows&&("startString"in d._.arrows&&t(d,d._.arrows.startString),"endString"in d._.arrows&&t(d,d._.arrows.endString,1));break;case"stroke-dasharray":v(d,p,f);break;case"fill":var D=c(p).match(a._ISURL);if(D){z=q("pattern");var F=q("image");z.id=a.createUUID(),q(z,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),q(F,{x:0,y:0,"xlink:href":D[1]}),z.appendChild(F),function(b){a._preload(D[1],function(){var a=this.offsetWidth,c=this.offsetHeight;q(b,{width:a,height:c}),q(F,{width:a,height:c}),d.paper.safari()})}(z),d.paper.defs.appendChild(z),q(i,{fill:"url(#"+z.id+")"}),d.pattern=z,d.pattern&&s(d);break}var G=a.getRGB(p);if(!G.error)delete f.gradient,delete k.gradient,!a.is(k.opacity,"undefined")&&a.is(f.opacity,"undefined")&&q(i,{opacity:k.opacity}),!a.is(k["fill-opacity"],"undefined")&&a.is(f["fill-opacity"],"undefined")&&q(i,{"fill-opacity":k["fill-opacity"]});else if((d.type=="circle"||d.type=="ellipse"||c(p).charAt()!="r")&&r(d,p)){if("opacity"in k||"fill-opacity"in k){var H=a._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,l));if(H){var I=H.getElementsByTagName("stop");q(I[I.length-1],{"stop-opacity":("opacity"in k?k.opacity:1)*("fill-opacity"in k?k["fill-opacity"]:1)})}}k.gradient=p,k.fill="none";break}G[b]("opacity")&&q(i,{"fill-opacity":G.opacity>1?G.opacity/100:G.opacity});case"stroke":G=a.getRGB(p),i.setAttribute(o,G.hex),o=="stroke"&&G[b]("opacity")&&q(i,{"stroke-opacity":G.opacity>1?G.opacity/100:G.opacity}),o=="stroke"&&d._.arrows&&("startString"in d._.arrows&&t(d,d._.arrows.startString),"endString"in d._.arrows&&t(d,d._.arrows.endString,1));break;case"gradient":(d.type=="circle"||d.type=="ellipse"||c(p).charAt()!="r")&&r(d,p);break;case"opacity":k.gradient&&!k[b]("stroke-opacity")&&q(i,{"stroke-opacity":p>1?p/100:p});case"fill-opacity":if(k.gradient){H=a._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,l)),H&&(I=H.getElementsByTagName("stop"),q(I[I.length-1],{"stop-opacity":p}));break};default:o=="font-size"&&(p=e(p,10)+"px");var J=o.replace(/(\-.)/g,function(a){return a.substring(1).toUpperCase()});i.style[J]=p,d._.dirty=1,i.setAttribute(o,p)}}y(d,f),i.style.visibility=m},x=1.2,y=function(d,f){if(d.type=="text"&&!!(f[b]("text")||f[b]("font")||f[b]("font-size")||f[b]("x")||f[b]("y"))){var g=d.attrs,h=d.node,i=h.firstChild?e(a._g.doc.defaultView.getComputedStyle(h.firstChild,l).getPropertyValue("font-size"),10):10;if(f[b]("text")){g.text=f.text;while(h.firstChild)h.removeChild(h.firstChild);var j=c(f.text).split("\n"),k=[],m;for(var n=0,o=j.length;n<o;n++)m=q("tspan"),n&&q(m,{dy:i*x,x:g.x}),m.appendChild(a._g.doc.createTextNode(j[n])),h.appendChild(m),k[n]=m}else{k=h.getElementsByTagName("tspan");for(n=0,o=k.length;n<o;n++)n?q(k[n],{dy:i*x,x:g.x}):q(k[0],{dy:0})}q(h,{x:g.x,y:g.y}),d._.dirty=1;var p=d._getBBox(),r=g.y-(p.y+p.height/2);r&&a.is(r,"finite")&&q(k[0],{dy:r})}},z=function(b,c){var d=0,e=0;this[0]=this.node=b,b.raphael=!0,this.id=a._oid++,b.raphaelid=this.id,this.matrix=a.matrix(),this.realPath=null,this.paper=c,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!c.bottom&&(c.bottom=this),this.prev=c.top,c.top&&(c.top.next=this),c.top=this,this.next=null},A=a.el;z.prototype=A,A.constructor=z,a._engine.path=function(a,b){var c=q("path");b.canvas&&b.canvas.appendChild(c);var d=new z(c,b);d.type="path",w(d,{fill:"none",stroke:"#000",path:a});return d},A.rotate=function(a,b,e){if(this.removed)return this;a=c(a).split(j),a.length-1&&(b=d(a[1]),e=d(a[2])),a=d(a[0]),e==null&&(b=e);if(b==null||e==null){var f=this.getBBox(1);b=f.x+f.width/2,e=f.y+f.height/2}this.transform(this._.transform.concat([["r",a,b,e]]));return this},A.scale=function(a,b,e,f){if(this.removed)return this;a=c(a).split(j),a.length-1&&(b=d(a[1]),e=d(a[2]),f=d(a[3])),a=d(a[0]),b==null&&(b=a),f==null&&(e=f);if(e==null||f==null)var g=this.getBBox(1);e=e==null?g.x+g.width/2:e,f=f==null?g.y+g.height/2:f,this.transform(this._.transform.concat([["s",a,b,e,f]]));return this},A.translate=function(a,b){if(this.removed)return this;a=c(a).split(j),a.length-1&&(b=d(a[1])),a=d(a[0])||0,b=+b||0,this.transform(this._.transform.concat([["t",a,b]]));return this},A.transform=function(c){var d=this._;if(c==null)return d.transform;a._extractTransform(this,c),this.clip&&q(this.clip,{transform:this.matrix.invert()}),this.pattern&&s(this),this.node&&q(this.node,{transform:this.matrix});if(d.sx!=1||d.sy!=1){var e=this.attrs[b]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":e})}return this},A.hide=function(){!this.removed&&this.paper.safari(this.node.style.display="none");return this},A.show=function(){!this.removed&&this.paper.safari(this.node.style.display="");return this},A.remove=function(){if(!this.removed&&!!this.node.parentNode){var b=this.paper;b.__set__&&b.__set__.exclude(this),k.unbind("raphael.*.*."+this.id),this.gradient&&b.defs.removeChild(this.gradient),a._tear(this,b),this.node.parentNode.tagName.toLowerCase()=="a"?this.node.parentNode.parentNode.removeChild(this.node.parentNode):this.node.parentNode.removeChild(this.node);for(var c in this)this[c]=typeof this[c]=="function"?a._removedFactory(c):null;this.removed=!0}},A._getBBox=function(){if(this.node.style.display=="none"){this.show();var a=!0}var b={};try{b=this.node.getBBox()}catch(c){}finally{b=b||{}}a&&this.hide();return b},A.attr=function(c,d){if(this.removed)return this;if(c==null){var e={};for(var f in this.attrs)this.attrs[b](f)&&(e[f]=this.attrs[f]);e.gradient&&e.fill=="none"&&(e.fill=e.gradient)&&delete e.gradient,e.transform=this._.transform;return e}if(d==null&&a.is(c,"string")){if(c=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;if(c=="transform")return this._.transform;var g=c.split(j),h={};for(var i=0,l=g.length;i<l;i++)c=g[i],c in this.attrs?h[c]=this.attrs[c]:a.is(this.paper.customAttributes[c],"function")?h[c]=this.paper.customAttributes[c].def:h[c]=a._availableAttrs[c];return l-1?h:h[g[0]]}if(d==null&&a.is(c,"array")){h={};for(i=0,l=c.length;i<l;i++)h[c[i]]=this.attr(c[i]);return h}if(d!=null){var m={};m[c]=d}else c!=null&&a.is(c,"object")&&(m=c);for(var n in m)k("raphael.attr."+n+"."+this.id,this,m[n]);for(n in this.paper.customAttributes)if(this.paper.customAttributes[b](n)&&m[b](n)&&a.is(this.paper.customAttributes[n],"function")){var o=this.paper.customAttributes[n].apply(this,[].concat(m[n]));this.attrs[n]=m[n];for(var p in o)o[b](p)&&(m[p]=o[p])}w(this,m);return this},A.toFront=function(){if(this.removed)return this;this.node.parentNode.tagName.toLowerCase()=="a"?this.node.parentNode.parentNode.appendChild(this.node.parentNode):this.node.parentNode.appendChild(this.node);var b=this.paper;b.top!=this&&a._tofront(this,b);return this},A.toBack=function(){if(this.removed)return this;var b=this.node.parentNode;b.tagName.toLowerCase()=="a"?b.parentNode.insertBefore(this.node.parentNode,this.node.parentNode.parentNode.firstChild):b.firstChild!=this.node&&b.insertBefore(this.node,this.node.parentNode.firstChild),a._toback(this,this.paper);var c=this.paper;return this},A.insertAfter=function(b){if(this.removed)return this;var c=b.node||b[b.length-1].node;c.nextSibling?c.parentNode.insertBefore(this.node,c.nextSibling):c.parentNode.appendChild(this.node),a._insertafter(this,b,this.paper);return this},A.insertBefore=function(b){if(this.removed)return this;var c=b.node||b[0].node;c.parentNode.insertBefore(this.node,c),a._insertbefore(this,b,this.paper);return this},A.blur=function(b){var c=this;if(+b!==0){var d=q("filter"),e=q("feGaussianBlur");c.attrs.blur=b,d.id=a.createUUID(),q(e,{stdDeviation:+b||1.5}),d.appendChild(e),c.paper.defs.appendChild(d),c._blur=d,q(c.node,{filter:"url(#"+d.id+")"})}else c._blur&&(c._blur.parentNode.removeChild(c._blur),delete c._blur,delete c.attrs.blur),c.node.removeAttribute("filter")},a._engine.circle=function(a,b,c,d){var e=q("circle");a.canvas&&a.canvas.appendChild(e);var f=new z(e,a);f.attrs={cx:b,cy:c,r:d,fill:"none",stroke:"#000"},f.type="circle",q(e,f.attrs);return f},a._engine.rect=function(a,b,c,d,e,f){var g=q("rect");a.canvas&&a.canvas.appendChild(g);var h=new z(g,a);h.attrs={x:b,y:c,width:d,height:e,r:f||0,rx:f||0,ry:f||0,fill:"none",stroke:"#000"},h.type="rect",q(g,h.attrs);return h},a._engine.ellipse=function(a,b,c,d,e){var f=q("ellipse");a.canvas&&a.canvas.appendChild(f);var g=new z(f,a);g.attrs={cx:b,cy:c,rx:d,ry:e,fill:"none",stroke:"#000"},g.type="ellipse",q(f,g.attrs);return g},a._engine.image=function(a,b,c,d,e,f){var g=q("image");q(g,{x:c,y:d,width:e,height:f,preserveAspectRatio:"none"}),g.setAttributeNS(n,"href",b),a.canvas&&a.canvas.appendChild(g);var h=new z(g,a);h.attrs={x:c,y:d,width:e,height:f,src:b},h.type="image";return h},a._engine.text=function(b,c,d,e){var f=q("text");b.canvas&&b.canvas.appendChild(f);var g=new z(f,b);g.attrs={x:c,y:d,"text-anchor":"middle",text:e,font:a._availableAttrs.font,stroke:"none",fill:"#000"},g.type="text",w(g,g.attrs);return g},a._engine.setSize=function(a,b){this.width=a||this.width,this.height=b||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox);return this},a._engine.create=function(){var b=a._getContainer.apply(0,arguments),c=b&&b.container,d=b.x,e=b.y,f=b.width,g=b.height;if(!c)throw new Error("SVG container not found.");var h=q("svg"),i="overflow:hidden;",j;d=d||0,e=e||0,f=f||512,g=g||342,q(h,{height:g,version:1.1,width:f,xmlns:"http://www.w3.org/2000/svg"}),c==1?(h.style.cssText=i+"position:absolute;left:"+d+"px;top:"+e+"px",a._g.doc.body.appendChild(h),j=1):(h.style.cssText=i+"position:relative",c.firstChild?c.insertBefore(h,c.firstChild):c.appendChild(h)),c=new a._Paper,c.width=f,c.height=g,c.canvas=h,c.clear(),c._left=c._top=0,j&&(c.renderfix=function(){}),c.renderfix();return c},a._engine.setViewBox=function(a,b,c,d,e){k("raphael.setViewBox",this,this._viewBox,[a,b,c,d,e]);var f=g(c/this.width,d/this.height),h=this.top,i=e?"meet":"xMinYMin",j,l;a==null?(this._vbSize&&(f=1),delete this._vbSize,j="0 0 "+this.width+m+this.height):(this._vbSize=f,j=a+m+b+m+c+m+d),q(this.canvas,{viewBox:j,preserveAspectRatio:i});while(f&&h)l="stroke-width"in h.attrs?h.attrs["stroke-width"]:1,h.attr({"stroke-width":l}),h._.dirty=1,h._.dirtyT=1,h=h.prev;this._viewBox=[a,b,c,d,!!e];return this},a.prototype.renderfix=function(){var a=this.canvas,b=a.style,c;try{c=a.getScreenCTM()||a.createSVGMatrix()}catch(d){c=a.createSVGMatrix()}var e=-c.e%1,f=-c.f%1;if(e||f)e&&(this._left=(this._left+e)%1,b.left=this._left+"px"),f&&(this._top=(this._top+f)%1,b.top=this._top+"px")},a.prototype.clear=function(){a.eve("raphael.clear",this);var b=this.canvas;while(b.firstChild)b.removeChild(b.firstChild);this.bottom=this.top=null,(this.desc=q("desc")).appendChild(a._g.doc.createTextNode("Created with RaphaĆ«l "+a.version)),b.appendChild(this.desc),b.appendChild(this.defs=q("defs"))},a.prototype.remove=function(){k("raphael.remove",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var b in this)this[b]=typeof this[b]=="function"?a._removedFactory(b):null};var B=a.st;for(var C in A)A[b](C)&&!B[b](C)&&(B[C]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(C))}(window.Raphael),window.Raphael.vml&&function(a){var b="hasOwnProperty",c=String,d=parseFloat,e=Math,f=e.round,g=e.max,h=e.min,i=e.abs,j="fill",k=/[, ]+/,l=a.eve,m=" progid:DXImageTransform.Microsoft",n=" ",o="",p={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},q=/([clmz]),?([^clmz]*)/gi,r=/ progid:\S+Blur\([^\)]+\)/g,s=/-?[^,\s-]+/g,t="position:absolute;left:0;top:0;width:1px;height:1px",u=21600,v={path:1,rect:1,image:1},w={circle:1,ellipse:1},x=function(b){var d=/[ahqstv]/ig,e=a._pathToAbsolute;c(b).match(d)&&(e=a._path2curve),d=/[clmz]/g;if(e==a._pathToAbsolute&&!c(b).match(d)){var g=c(b).replace(q,function(a,b,c){var d=[],e=b.toLowerCase()=="m",g=p[b];c.replace(s,function(a){e&&d.length==2&&(g+=d+p[b=="m"?"l":"L"],d=[]),d.push(f(a*u))});return g+d});return g}var h=e(b),i,j;g=[];for(var k=0,l=h.length;k<l;k++){i=h[k],j=h[k][0].toLowerCase(),j=="z"&&(j="x");for(var m=1,r=i.length;m<r;m++)j+=f(i[m]*u)+(m!=r-1?",":o);g.push(j)}return g.join(n)},y=function(b,c,d){var e=a.matrix();e.rotate(-b,.5,.5);return{dx:e.x(c,d),dy:e.y(c,d)}},z=function(a,b,c,d,e,f){var g=a._,h=a.matrix,k=g.fillpos,l=a.node,m=l.style,o=1,p="",q,r=u/b,s=u/c;m.visibility="hidden";if(!!b&&!!c){l.coordsize=i(r)+n+i(s),m.rotation=f*(b*c<0?-1:1);if(f){var t=y(f,d,e);d=t.dx,e=t.dy}b<0&&(p+="x"),c<0&&(p+=" y")&&(o=-1),m.flip=p,l.coordorigin=d*-r+n+e*-s;if(k||g.fillsize){var v=l.getElementsByTagName(j);v=v&&v[0],l.removeChild(v),k&&(t=y(f,h.x(k[0],k[1]),h.y(k[0],k[1])),v.position=t.dx*o+n+t.dy*o),g.fillsize&&(v.size=g.fillsize[0]*i(b)+n+g.fillsize[1]*i(c)),l.appendChild(v)}m.visibility="visible"}};a.toString=function(){return"Your browser doesnā€™t support SVG. Falling down to VML.\nYou are running RaphaĆ«l "+this.version};var A=function(a,b,d){var e=c(b).toLowerCase().split("-"),f=d?"end":"start",g=e.length,h="classic",i="medium",j="medium";while(g--)switch(e[g]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":h=e[g];break;case"wide":case"narrow":j=e[g];break;case"long":case"short":i=e[g]}var k=a.node.getElementsByTagName("stroke")[0];k[f+"arrow"]=h,k[f+"arrowlength"]=i,k[f+"arrowwidth"]=j},B=function(e,i){e.attrs=e.attrs||{};var l=e.node,m=e.attrs,p=l.style,q,r=v[e.type]&&(i.x!=m.x||i.y!=m.y||i.width!=m.width||i.height!=m.height||i.cx!=m.cx||i.cy!=m.cy||i.rx!=m.rx||i.ry!=m.ry||i.r!=m.r),s=w[e.type]&&(m.cx!=i.cx||m.cy!=i.cy||m.r!=i.r||m.rx!=i.rx||m.ry!=i.ry),t=e;for(var y in i)i[b](y)&&(m[y]=i[y]);r&&(m.path=a._getPath[e.type](e),e._.dirty=1),i.href&&(l.href=i.href),i.title&&(l.title=i.title),i.target&&(l.target=i.target),i.cursor&&(p.cursor=i.cursor),"blur"in i&&e.blur(i.blur);if(i.path&&e.type=="path"||r)l.path=x(~c(m.path).toLowerCase().indexOf("r")?a._pathToAbsolute(m.path):m.path),e.type=="image"&&(e._.fillpos=[m.x,m.y],e._.fillsize=[m.width,m.height],z(e,1,1,0,0,0));"transform"in i&&e.transform(i.transform);if(s){var B=+m.cx,D=+m.cy,E=+m.rx||+m.r||0,G=+m.ry||+m.r||0;l.path=a.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",f((B-E)*u),f((D-G)*u),f((B+E)*u),f((D+G)*u),f(B*u))}if("clip-rect"in i){var H=c(i["clip-rect"]).split(k);if(H.length==4){H[2]=+H[2]+ +H[0],H[3]=+H[3]+ +H[1];var I=l.clipRect||a._g.doc.createElement("div"),J=I.style;J.clip=a.format("rect({1}px {2}px {3}px {0}px)",H),l.clipRect||(J.position="absolute",J.top=0,J.left=0,J.width=e.paper.width+"px",J.height=e.paper.height+"px",l.parentNode.insertBefore(I,l),I.appendChild(l),l.clipRect=I)}i["clip-rect"]||l.clipRect&&(l.clipRect.style.clip="auto")}if(e.textpath){var K=e.textpath.style;i.font&&(K.font=i.font),i["font-family"]&&(K.fontFamily='"'+i["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,o)+'"'),i["font-size"]&&(K.fontSize=i["font-size"]),i["font-weight"]&&(K.fontWeight=i["font-weight"]),i["font-style"]&&(K.fontStyle=i["font-style"])}"arrow-start"in i&&A(t,i["arrow-start"]),"arrow-end"in i&&A(t,i["arrow-end"],1);if(i.opacity!=null||i["stroke-width"]!=null||i.fill!=null||i.src!=null||i.stroke!=null||i["stroke-width"]!=null||i["stroke-opacity"]!=null||i["fill-opacity"]!=null||i["stroke-dasharray"]!=null||i["stroke-miterlimit"]!=null||i["stroke-linejoin"]!=null||i["stroke-linecap"]!=null){var L=l.getElementsByTagName(j),M=!1;L=L&&L[0],!L&&(M=L=F(j)),e.type=="image"&&i.src&&(L.src=i.src),i.fill&&(L.on=!0);if(L.on==null||i.fill=="none"||i.fill===null)L.on=!1;if(L.on&&i.fill){var N=c(i.fill).match(a._ISURL);if(N){L.parentNode==l&&l.removeChild(L),L.rotate=!0,L.src=N[1],L.type="tile";var O=e.getBBox(1);L.position=O.x+n+O.y,e._.fillpos=[O.x,O.y],a._preload(N[1],function(){e._.fillsize=[this.offsetWidth,this.offsetHeight]})}else L.color=a.getRGB(i.fill).hex,L.src=o,L.type="solid",a.getRGB(i.fill).error&&(t.type in{circle:1,ellipse:1}||c(i.fill).charAt()!="r")&&C(t,i.fill,L)&&(m.fill="none",m.gradient=i.fill,L.rotate=!1)}if("fill-opacity"in i||"opacity"in i){var P=((+m["fill-opacity"]+1||2)-1)*((+m.opacity+1||2)-1)*((+a.getRGB(i.fill).o+1||2)-1);P=h(g(P,0),1),L.opacity=P,L.src&&(L.color="none")}l.appendChild(L);var Q=l.getElementsByTagName("stroke")&&l.getElementsByTagName("stroke")[0],T=!1;!Q&&(T=Q=F("stroke"));if(i.stroke&&i.stroke!="none"||i["stroke-width"]||i["stroke-opacity"]!=null||i["stroke-dasharray"]||i["stroke-miterlimit"]||i["stroke-linejoin"]||i["stroke-linecap"])Q.on=!0;(i.stroke=="none"||i.stroke===null||Q.on==null||i.stroke==0||i["stroke-width"]==0)&&(Q.on=!1);var U=a.getRGB(i.stroke);Q.on&&i.stroke&&(Q.color=U.hex),P=((+m["stroke-opacity"]+1||2)-1)*((+m.opacity+1||2)-1)*((+U.o+1||2)-1);var V=(d(i["stroke-width"])||1)*.75;P=h(g(P,0),1),i["stroke-width"]==null&&(V=m["stroke-width"]),i["stroke-width"]&&(Q.weight=V),V&&V<1&&(P*=V)&&(Q.weight=1),Q.opacity=P,i["stroke-linejoin"]&&(Q.joinstyle=i["stroke-linejoin"]||"miter"),Q.miterlimit=i["stroke-miterlimit"]||8,i["stroke-linecap"]&&(Q.endcap=i["stroke-linecap"]=="butt"?"flat":i["stroke-linecap"]=="square"?"square":"round");if(i["stroke-dasharray"]){var W={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};Q.dashstyle=W[b](i["stroke-dasharray"])?W[i["stroke-dasharray"]]:o}T&&l.appendChild(Q)}if(t.type=="text"){t.paper.canvas.style.display=o;var X=t.paper.span,Y=100,Z=m.font&&m.font.match(/\d+(?:\.\d*)?(?=px)/);p=X.style,m.font&&(p.font=m.font),m["font-family"]&&(p.fontFamily=m["font-family"]),m["font-weight"]&&(p.fontWeight=m["font-weight"]),m["font-style"]&&(p.fontStyle=m["font-style"]),Z=d(m["font-size"]||Z&&Z[0])||10,p.fontSize=Z*Y+"px",t.textpath.string&&(X.innerHTML=c(t.textpath.string).replace(/</g,"&#60;").replace(/&/g,"&#38;").replace(/\n/g,"<br>"));var $=X.getBoundingClientRect();t.W=m.w=($.right-$.left)/Y,t.H=m.h=($.bottom-$.top)/Y,t.X=m.x,t.Y=m.y+t.H/2,("x"in i||"y"in i)&&(t.path.v=a.format("m{0},{1}l{2},{1}",f(m.x*u),f(m.y*u),f(m.x*u)+1));var _=["x","y","text","font","font-family","font-weight","font-style","font-size"];for(var ba=0,bb=_.length;ba<bb;ba++)if(_[ba]in i){t._.dirty=1;break}switch(m["text-anchor"]){case"start":t.textpath.style["v-text-align"]="left",t.bbx=t.W/2;break;case"end":t.textpath.style["v-text-align"]="right",t.bbx=-t.W/2;break;default:t.textpath.style["v-text-align"]="center",t.bbx=0}t.textpath.style["v-text-kern"]=!0}},C=function(b,f,g){b.attrs=b.attrs||{};var h=b.attrs,i=Math.pow,j,k,l="linear",m=".5 .5";b.attrs.gradient=f,f=c(f).replace(a._radial_gradient,function(a,b,c){l="radial",b&&c&&(b=d(b),c=d(c),i(b-.5,2)+i(c-.5,2)>.25&&(c=e.sqrt(.25-i(b-.5,2))*((c>.5)*2-1)+.5),m=b+n+c);return o}),f=f.split(/\s*\-\s*/);if(l=="linear"){var p=f.shift();p=-d(p);if(isNaN(p))return null}var q=a._parseDots(f);if(!q)return null;b=b.shape||b.node;if(q.length){b.removeChild(g),g.on=!0,g.method="none",g.color=q[0].color,g.color2=q[q.length-1].color;var r=[];for(var s=0,t=q.length;s<t;s++)q[s].offset&&r.push(q[s].offset+n+q[s].color);g.colors=r.length?r.join():"0% "+g.color,l=="radial"?(g.type="gradientTitle",g.focus="100%",g.focussize="0 0",g.focusposition=m,g.angle=0):(g.type="gradient",g.angle=(270-p)%360),b.appendChild(g)}return 1},D=function(b,c){this[0]=this.node=b,b.raphael=!0,this.id=a._oid++,b.raphaelid=this.id,this.X=0,this.Y=0,this.attrs={},this.paper=c,this.matrix=a.matrix(),this._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},!c.bottom&&(c.bottom=this),this.prev=c.top,c.top&&(c.top.next=this),c.top=this,this.next=null},E=a.el;D.prototype=E,E.constructor=D,E.transform=function(b){if(b==null)return this._.transform;var d=this.paper._viewBoxShift,e=d?"s"+[d.scale,d.scale]+"-1-1t"+[d.dx,d.dy]:o,f;d&&(f=b=c(b).replace(/\.{3}|\u2026/g,this._.transform||o)),a._extractTransform(this,e+b);var g=this.matrix.clone(),h=this.skew,i=this.node,j,k=~c(this.attrs.fill).indexOf("-"),l=!c(this.attrs.fill).indexOf("url(");g.translate(-0.5,-0.5);if(l||k||this.type=="image"){h.matrix="1 0 0 1",h.offset="0 0",j=g.split();if(k&&j.noRotation||!j.isSimple){i.style.filter=g.toFilter();var m=this.getBBox(),p=this.getBBox(1),q=m.x-p.x,r=m.y-p.y;i.coordorigin=q*-u+n+r*-u,z(this,1,1,q,r,0)}else i.style.filter=o,z(this,j.scalex,j.scaley,j.dx,j.dy,j.rotate)}else i.style.filter=o,h.matrix=c(g),h.offset=g.offset();f&&(this._.transform=f);return this},E.rotate=function(a,b,e){if(this.removed)return this;if(a!=null){a=c(a).split(k),a.length-1&&(b=d(a[1]),e=d(a[2])),a=d(a[0]),e==null&&(b=e);if(b==null||e==null){var f=this.getBBox(1);b=f.x+f.width/2,e=f.y+f.height/2}this._.dirtyT=1,this.transform(this._.transform.concat([["r",a,b,e]]));return this}},E.translate=function(a,b){if(this.removed)return this;a=c(a).split(k),a.length-1&&(b=d(a[1])),a=d(a[0])||0,b=+b||0,this._.bbox&&(this._.bbox.x+=a,this._.bbox.y+=b),this.transform(this._.transform.concat([["t",a,b]]));return this},E.scale=function(a,b,e,f){if(this.removed)return this;a=c(a).split(k),a.length-1&&(b=d(a[1]),e=d(a[2]),f=d(a[3]),isNaN(e)&&(e=null),isNaN(f)&&(f=null)),a=d(a[0]),b==null&&(b=a),f==null&&(e=f);if(e==null||f==null)var g=this.getBBox(1);e=e==null?g.x+g.width/2:e,f=f==null?g.y+g.height/2:f,this.transform(this._.transform.concat([["s",a,b,e,f]])),this._.dirtyT=1;return this},E.hide=function(){!this.removed&&(this.node.style.display="none");return this},E.show=function(){!this.removed&&(this.node.style.display=o);return this},E._getBBox=function(){if(this.removed)return{};return{x:this.X+(this.bbx||0)-this.W/2,y:this.Y-this.H,width:this.W,height:this.H}},E.remove=function(){if(!this.removed&&!!this.node.parentNode){this.paper.__set__&&this.paper.__set__.exclude(this),a.eve.unbind("raphael.*.*."+this.id),a._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape);for(var b in this)this[b]=typeof this[b]=="function"?a._removedFactory(b):null;this.removed=!0}},E.attr=function(c,d){if(this.removed)return this;if(c==null){var e={};for(var f in this.attrs)this.attrs[b](f)&&(e[f]=this.attrs[f]);e.gradient&&e.fill=="none"&&(e.fill=e.gradient)&&delete e.gradient,e.transform=this._.transform;return e}if(d==null&&a.is(c,"string")){if(c==j&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;var g=c.split(k),h={};for(var i=0,m=g.length;i<m;i++)c=g[i],c in this.attrs?h[c]=this.attrs[c]:a.is(this.paper.customAttributes[c],"function")?h[c]=this.paper.customAttributes[c].def:h[c]=a._availableAttrs[c];return m-1?h:h[g[0]]}if(this.attrs&&d==null&&a.is(c,"array")){h={};for(i=0,m=c.length;i<m;i++)h[c[i]]=this.attr(c[i]);return h}var n;d!=null&&(n={},n[c]=d),d==null&&a.is(c,"object")&&(n=c);for(var o in n)l("raphael.attr."+o+"."+this.id,this,n[o]);if(n){for(o in this.paper.customAttributes)if(this.paper.customAttributes[b](o)&&n[b](o)&&a.is(this.paper.customAttributes[o],"function")){var p=this.paper.customAttributes[o].apply(this,[].concat(n[o]));this.attrs[o]=n[o];for(var q in p)p[b](q)&&(n[q]=p[q])}n.text&&this.type=="text"&&(this.textpath.string=n.text),B(this,n)}return this},E.toFront=function(){!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&a._tofront(this,this.paper);return this},E.toBack=function(){if(this.removed)return this;this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),a._toback(this,this.paper));return this},E.insertAfter=function(b){if(this.removed)return this;b.constructor==a.st.constructor&&(b=b[b.length-1]),b.node.nextSibling?b.node.parentNode.insertBefore(this.node,b.node.nextSibling):b.node.parentNode.appendChild(this.node),a._insertafter(this,b,this.paper);return this},E.insertBefore=function(b){if(this.removed)return this;b.constructor==a.st.constructor&&(b=b[0]),b.node.parentNode.insertBefore(this.node,b.node),a._insertbefore(this,b,this.paper);return this},E.blur=function(b){var c=this.node.runtimeStyle,d=c.filter;d=d.replace(r,o),+b!==0?(this.attrs.blur=b,c.filter=d+n+m+".Blur(pixelradius="+(+b||1.5)+")",c.margin=a.format("-{0}px 0 0 -{0}px",f(+b||1.5))):(c.filter=d,c.margin=0,delete this.attrs.blur)},a._engine.path=function(a,b){var c=F("shape");c.style.cssText=t,c.coordsize=u+n+u,c.coordorigin=b.coordorigin;var d=new D(c,b),e={fill:"none",stroke:"#000"};a&&(e.path=a),d.type="path",d.path=[],d.Path=o,B(d,e),b.canvas.appendChild(c);var f=F("skew");f.on=!0,c.appendChild(f),d.skew=f,d.transform(o);return d},a._engine.rect=function(b,c,d,e,f,g){var h=a._rectPath(c,d,e,f,g),i=b.path(h),j=i.attrs;i.X=j.x=c,i.Y=j.y=d,i.W=j.width=e,i.H=j.height=f,j.r=g,j.path=h,i.type="rect";return i},a._engine.ellipse=function(a,b,c,d,e){var f=a.path(),g=f.attrs;f.X=b-d,f.Y=c-e,f.W=d*2,f.H=e*2,f.type="ellipse",B(f,{cx:b,cy:c,rx:d,ry:e});return f},a._engine.circle=function(a,b,c,d){var e=a.path(),f=e.attrs;e.X=b-d,e.Y=c-d,e.W=e.H=d*2,e.type="circle",B(e,{cx:b,cy:c,r:d});return e},a._engine.image=function(b,c,d,e,f,g){var h=a._rectPath(d,e,f,g),i=b.path(h).attr({stroke:"none"}),k=i.attrs,l=i.node,m=l.getElementsByTagName(j)[0];k.src=c,i.X=k.x=d,i.Y=k.y=e,i.W=k.width=f,i.H=k.height=g,k.path=h,i.type="image",m.parentNode==l&&l.removeChild(m),m.rotate=!0,m.src=c,m.type="tile",i._.fillpos=[d,e],i._.fillsize=[f,g],l.appendChild(m),z(i,1,1,0,0,0);return i},a._engine.text=function(b,d,e,g){var h=F("shape"),i=F("path"),j=F("textpath");d=d||0,e=e||0,g=g||"",i.v=a.format("m{0},{1}l{2},{1}",f(d*u),f(e*u),f(d*u)+1),i.textpathok=!0,j.string=c(g),j.on=!0,h.style.cssText=t,h.coordsize=u+n+u,h.coordorigin="0 0";var k=new D(h,b),l={fill:"#000",stroke:"none",font:a._availableAttrs.font,text:g};k.shape=h,k.path=i,k.textpath=j,k.type="text",k.attrs.text=c(g),k.attrs.x=d,k.attrs.y=e,k.attrs.w=1,k.attrs.h=1,B(k,l),h.appendChild(j),h.appendChild(i),b.canvas.appendChild(h);var m=F("skew");m.on=!0,h.appendChild(m),k.skew=m,k.transform(o);return k},a._engine.setSize=function(b,c){var d=this.canvas.style;this.width=b,this.height=c,b==+b&&(b+="px"),c==+c&&(c+="px"),d.width=b,d.height=c,d.clip="rect(0 "+b+" "+c+" 0)",this._viewBox&&a._engine.setViewBox.apply(this,this._viewBox);return this},a._engine.setViewBox=function(b,c,d,e,f){a.eve("raphael.setViewBox",this,this._viewBox,[b,c,d,e,f]);var h=this.width,i=this.height,j=1/g(d/h,e/i),k,l;f&&(k=i/e,l=h/d,d*k<h&&(b-=(h-d*k)/2/k),e*l<i&&(c-=(i-e*l)/2/l)),this._viewBox=[b,c,d,e,!!f],this._viewBoxShift={dx:-b,dy:-c,scale:j},this.forEach(function(a){a.transform("...")});return this};var F;a._engine.initWin=function(a){var b=a.document;b.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!b.namespaces.rvml&&b.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),F=function(a){return b.createElement("<rvml:"+a+' class="rvml">')}}catch(c){F=function(a){return b.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},a._engine.initWin(a._g.win),a._engine.create=function(){var b=a._getContainer.apply(0,arguments),c=b.container,d=b.height,e,f=b.width,g=b.x,h=b.y;if(!c)throw new Error("VML container not found.");var i=new a._Paper,j=i.canvas=a._g.doc.createElement("div"),k=j.style;g=g||0,h=h||0,f=f||512,d=d||342,i.width=f,i.height=d,f==+f&&(f+="px"),d==+d&&(d+="px"),i.coordsize=u*1e3+n+u*1e3,i.coordorigin="0 0",i.span=a._g.doc.createElement("span"),i.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",j.appendChild(i.span),k.cssText=a.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",f,d),c==1?(a._g.doc.body.appendChild(j),k.left=g+"px",k.top=h+"px",k.position="absolute"):c.firstChild?c.insertBefore(j,c.firstChild):c.appendChild(j),i.renderfix=function(){};return i},a.prototype.clear=function(){a.eve("raphael.clear",this),this.canvas.innerHTML=o,this.span=a._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},a.prototype.remove=function(){a.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var b in this)this[b]=typeof this[b]=="function"?a._removedFactory(b):null;return!0};var G=a.st;for(var H in E)E[b](H)&&!G[b](H)&&(G[H]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(H))}(window.Raphael);
20
-
21
- //morris
22
- /* @license
23
- morris.js v0.5.0
24
- Copyright 2014 Olly Smith All rights reserved.
25
- Licensed under the BSD-2-Clause License.
26
- */
27
- (function(){var a,b,c,d,e=[].slice,f=function(a,b){return function(){return a.apply(b,arguments)}},g={}.hasOwnProperty,h=function(a,b){function c(){this.constructor=a}for(var d in b)g.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},i=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};b=window.Morris={},a=jQuery,b.EventEmitter=function(){function a(){}return a.prototype.on=function(a,b){return null==this.handlers&&(this.handlers={}),null==this.handlers[a]&&(this.handlers[a]=[]),this.handlers[a].push(b),this},a.prototype.fire=function(){var a,b,c,d,f,g,h;if(c=arguments[0],a=2<=arguments.length?e.call(arguments,1):[],null!=this.handlers&&null!=this.handlers[c]){for(g=this.handlers[c],h=[],d=0,f=g.length;f>d;d++)b=g[d],h.push(b.apply(null,a));return h}},a}(),b.commas=function(a){var b,c,d,e;return null!=a?(d=0>a?"-":"",b=Math.abs(a),c=Math.floor(b).toFixed(0),d+=c.replace(/(?=(?:\d{3})+$)(?!^)/g,","),e=b.toString(),e.length>c.length&&(d+=e.slice(c.length)),d):"-"},b.pad2=function(a){return(10>a?"0":"")+a},b.Grid=function(c){function d(b){this.resizeHandler=f(this.resizeHandler,this);var c=this;if(this.el="string"==typeof b.element?a(document.getElementById(b.element)):a(b.element),null==this.el||0===this.el.length)throw new Error("Graph container element not found");"static"===this.el.css("position")&&this.el.css("position","relative"),this.options=a.extend({},this.gridDefaults,this.defaults||{},b),"string"==typeof this.options.units&&(this.options.postUnits=b.units),this.raphael=new Raphael(this.el[0]),this.elementWidth=null,this.elementHeight=null,this.dirty=!1,this.selectFrom=null,this.init&&this.init(),this.setData(this.options.data),this.el.bind("mousemove",function(a){var b,d,e,f,g;return d=c.el.offset(),g=a.pageX-d.left,c.selectFrom?(b=c.data[c.hitTest(Math.min(g,c.selectFrom))]._x,e=c.data[c.hitTest(Math.max(g,c.selectFrom))]._x,f=e-b,c.selectionRect.attr({x:b,width:f})):c.fire("hovermove",g,a.pageY-d.top)}),this.el.bind("mouseleave",function(){return c.selectFrom&&(c.selectionRect.hide(),c.selectFrom=null),c.fire("hoverout")}),this.el.bind("touchstart touchmove touchend",function(a){var b,d;return d=a.originalEvent.touches[0]||a.originalEvent.changedTouches[0],b=c.el.offset(),c.fire("hovermove",d.pageX-b.left,d.pageY-b.top)}),this.el.bind("click",function(a){var b;return b=c.el.offset(),c.fire("gridclick",a.pageX-b.left,a.pageY-b.top)}),this.options.rangeSelect&&(this.selectionRect=this.raphael.rect(0,0,0,this.el.innerHeight()).attr({fill:this.options.rangeSelectColor,stroke:!1}).toBack().hide(),this.el.bind("mousedown",function(a){var b;return b=c.el.offset(),c.startRange(a.pageX-b.left)}),this.el.bind("mouseup",function(a){var b;return b=c.el.offset(),c.endRange(a.pageX-b.left),c.fire("hovermove",a.pageX-b.left,a.pageY-b.top)})),this.options.resize&&a(window).bind("resize",function(){return null!=c.timeoutId&&window.clearTimeout(c.timeoutId),c.timeoutId=window.setTimeout(c.resizeHandler,100)}),this.el.css("-webkit-tap-highlight-color","rgba(0,0,0,0)"),this.postInit&&this.postInit()}return h(d,c),d.prototype.gridDefaults={dateFormat:null,axes:!0,grid:!0,gridLineColor:"#aaa",gridStrokeWidth:.5,gridTextColor:"#888",gridTextSize:12,gridTextFamily:"sans-serif",gridTextWeight:"normal",hideHover:!1,yLabelFormat:null,xLabelAngle:0,numLines:5,padding:25,parseTime:!0,postUnits:"",preUnits:"",ymax:"auto",ymin:"auto 0",goals:[],goalStrokeWidth:1,goalLineColors:["#666633","#999966","#cc6666","#663333"],events:[],eventStrokeWidth:1,eventLineColors:["#005a04","#ccffbb","#3a5f0b","#005502"],rangeSelect:null,rangeSelectColor:"#eef",resize:!1},d.prototype.setData=function(a,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;return null==c&&(c=!0),this.options.data=a,null==a||0===a.length?(this.data=[],this.raphael.clear(),null!=this.hover&&this.hover.hide(),void 0):(o=this.cumulative?0:null,p=this.cumulative?0:null,this.options.goals.length>0&&(h=Math.min.apply(Math,this.options.goals),g=Math.max.apply(Math,this.options.goals),p=null!=p?Math.min(p,h):h,o=null!=o?Math.max(o,g):g),this.data=function(){var c,d,g;for(g=[],f=c=0,d=a.length;d>c;f=++c)j=a[f],i={src:j},i.label=j[this.options.xkey],this.options.parseTime?(i.x=b.parseDate(i.label),this.options.dateFormat?i.label=this.options.dateFormat(i.x):"number"==typeof i.label&&(i.label=new Date(i.label).toString())):(i.x=f,this.options.xLabelFormat&&(i.label=this.options.xLabelFormat(i))),l=0,i.y=function(){var a,b,c,d;for(c=this.options.ykeys,d=[],e=a=0,b=c.length;b>a;e=++a)n=c[e],q=j[n],"string"==typeof q&&(q=parseFloat(q)),null!=q&&"number"!=typeof q&&(q=null),null!=q&&(this.cumulative?l+=q:null!=o?(o=Math.max(q,o),p=Math.min(q,p)):o=p=q),this.cumulative&&null!=l&&(o=Math.max(l,o),p=Math.min(l,p)),d.push(q);return d}.call(this),g.push(i);return g}.call(this),this.options.parseTime&&(this.data=this.data.sort(function(a,b){return(a.x>b.x)-(b.x>a.x)})),this.xmin=this.data[0].x,this.xmax=this.data[this.data.length-1].x,this.events=[],this.options.events.length>0&&(this.events=this.options.parseTime?function(){var a,c,e,f;for(e=this.options.events,f=[],a=0,c=e.length;c>a;a++)d=e[a],f.push(b.parseDate(d));return f}.call(this):this.options.events,this.xmax=Math.max(this.xmax,Math.max.apply(Math,this.events)),this.xmin=Math.min(this.xmin,Math.min.apply(Math,this.events))),this.xmin===this.xmax&&(this.xmin-=1,this.xmax+=1),this.ymin=this.yboundary("min",p),this.ymax=this.yboundary("max",o),this.ymin===this.ymax&&(p&&(this.ymin-=1),this.ymax+=1),((r=this.options.axes)===!0||"both"===r||"y"===r||this.options.grid===!0)&&(this.options.ymax===this.gridDefaults.ymax&&this.options.ymin===this.gridDefaults.ymin?(this.grid=this.autoGridLines(this.ymin,this.ymax,this.options.numLines),this.ymin=Math.min(this.ymin,this.grid[0]),this.ymax=Math.max(this.ymax,this.grid[this.grid.length-1])):(k=(this.ymax-this.ymin)/(this.options.numLines-1),this.grid=function(){var a,b,c,d;for(d=[],m=a=b=this.ymin,c=this.ymax;k>0?c>=a:a>=c;m=a+=k)d.push(m);return d}.call(this))),this.dirty=!0,c?this.redraw():void 0)},d.prototype.yboundary=function(a,b){var c,d;return c=this.options["y"+a],"string"==typeof c?"auto"===c.slice(0,4)?c.length>5?(d=parseInt(c.slice(5),10),null==b?d:Math[a](b,d)):null!=b?b:0:parseInt(c,10):c},d.prototype.autoGridLines=function(a,b,c){var d,e,f,g,h,i,j,k,l;return h=b-a,l=Math.floor(Math.log(h)/Math.log(10)),j=Math.pow(10,l),e=Math.floor(a/j)*j,d=Math.ceil(b/j)*j,i=(d-e)/(c-1),1===j&&i>1&&Math.ceil(i)!==i&&(i=Math.ceil(i),d=e+i*(c-1)),0>e&&d>0&&(e=Math.floor(a/i)*i,d=Math.ceil(b/i)*i),1>i?(g=Math.floor(Math.log(i)/Math.log(10)),f=function(){var a,b;for(b=[],k=a=e;i>0?d>=a:a>=d;k=a+=i)b.push(parseFloat(k.toFixed(1-g)));return b}()):f=function(){var a,b;for(b=[],k=a=e;i>0?d>=a:a>=d;k=a+=i)b.push(k);return b}(),f},d.prototype._calc=function(){var a,b,c,d,e,f,g,h;return e=this.el.width(),c=this.el.height(),(this.elementWidth!==e||this.elementHeight!==c||this.dirty)&&(this.elementWidth=e,this.elementHeight=c,this.dirty=!1,this.left=this.options.padding,this.right=this.elementWidth-this.options.padding,this.top=this.options.padding,this.bottom=this.elementHeight-this.options.padding,((g=this.options.axes)===!0||"both"===g||"y"===g)&&(f=function(){var a,c,d,e;for(d=this.grid,e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(this.measureText(this.yAxisFormat(b)).width);return e}.call(this),this.left+=Math.max.apply(Math,f)),((h=this.options.axes)===!0||"both"===h||"x"===h)&&(a=function(){var a,b,c;for(c=[],d=a=0,b=this.data.length;b>=0?b>a:a>b;d=b>=0?++a:--a)c.push(this.measureText(this.data[d].text,-this.options.xLabelAngle).height);return c}.call(this),this.bottom-=Math.max.apply(Math,a)),this.width=Math.max(1,this.right-this.left),this.height=Math.max(1,this.bottom-this.top),this.dx=this.width/(this.xmax-this.xmin),this.dy=this.height/(this.ymax-this.ymin),this.calc)?this.calc():void 0},d.prototype.transY=function(a){return this.bottom-(a-this.ymin)*this.dy},d.prototype.transX=function(a){return 1===this.data.length?(this.left+this.right)/2:this.left+(a-this.xmin)*this.dx},d.prototype.redraw=function(){return this.raphael.clear(),this._calc(),this.drawGrid(),this.drawGoals(),this.drawEvents(),this.draw?this.draw():void 0},d.prototype.measureText=function(a,b){var c,d;return null==b&&(b=0),d=this.raphael.text(100,100,a).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).rotate(b),c=d.getBBox(),d.remove(),c},d.prototype.yAxisFormat=function(a){return this.yLabelFormat(a)},d.prototype.yLabelFormat=function(a){return"function"==typeof this.options.yLabelFormat?this.options.yLabelFormat(a):""+this.options.preUnits+b.commas(a)+this.options.postUnits},d.prototype.drawGrid=function(){var a,b,c,d,e,f,g,h;if(this.options.grid!==!1||(e=this.options.axes)===!0||"both"===e||"y"===e){for(f=this.grid,h=[],c=0,d=f.length;d>c;c++)a=f[c],b=this.transY(a),((g=this.options.axes)===!0||"both"===g||"y"===g)&&this.drawYAxisLabel(this.left-this.options.padding/2,b,this.yAxisFormat(a)),this.options.grid?h.push(this.drawGridLine("M"+this.left+","+b+"H"+(this.left+this.width))):h.push(void 0);return h}},d.prototype.drawGoals=function(){var a,b,c,d,e,f,g;for(f=this.options.goals,g=[],c=d=0,e=f.length;e>d;c=++d)b=f[c],a=this.options.goalLineColors[c%this.options.goalLineColors.length],g.push(this.drawGoal(b,a));return g},d.prototype.drawEvents=function(){var a,b,c,d,e,f,g;for(f=this.events,g=[],c=d=0,e=f.length;e>d;c=++d)b=f[c],a=this.options.eventLineColors[c%this.options.eventLineColors.length],g.push(this.drawEvent(b,a));return g},d.prototype.drawGoal=function(a,b){return this.raphael.path("M"+this.left+","+this.transY(a)+"H"+this.right).attr("stroke",b).attr("stroke-width",this.options.goalStrokeWidth)},d.prototype.drawEvent=function(a,b){return this.raphael.path("M"+this.transX(a)+","+this.bottom+"V"+this.top).attr("stroke",b).attr("stroke-width",this.options.eventStrokeWidth)},d.prototype.drawYAxisLabel=function(a,b,c){return this.raphael.text(a,b,c).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor).attr("text-anchor","end")},d.prototype.drawGridLine=function(a){return this.raphael.path(a).attr("stroke",this.options.gridLineColor).attr("stroke-width",this.options.gridStrokeWidth)},d.prototype.startRange=function(a){return this.hover.hide(),this.selectFrom=a,this.selectionRect.attr({x:a,width:0}).show()},d.prototype.endRange=function(a){var b,c;return this.selectFrom?(c=Math.min(this.selectFrom,a),b=Math.max(this.selectFrom,a),this.options.rangeSelect.call(this.el,{start:this.data[this.hitTest(c)].x,end:this.data[this.hitTest(b)].x}),this.selectFrom=null):void 0},d.prototype.resizeHandler=function(){return this.timeoutId=null,this.raphael.setSize(this.el.width(),this.el.height()),this.redraw()},d}(b.EventEmitter),b.parseDate=function(a){var b,c,d,e,f,g,h,i,j,k,l;return"number"==typeof a?a:(c=a.match(/^(\d+) Q(\d)$/),e=a.match(/^(\d+)-(\d+)$/),f=a.match(/^(\d+)-(\d+)-(\d+)$/),h=a.match(/^(\d+) W(\d+)$/),i=a.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+)(Z|([+-])(\d\d):?(\d\d))?$/),j=a.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+):(\d+(\.\d+)?)(Z|([+-])(\d\d):?(\d\d))?$/),c?new Date(parseInt(c[1],10),3*parseInt(c[2],10)-1,1).getTime():e?new Date(parseInt(e[1],10),parseInt(e[2],10)-1,1).getTime():f?new Date(parseInt(f[1],10),parseInt(f[2],10)-1,parseInt(f[3],10)).getTime():h?(k=new Date(parseInt(h[1],10),0,1),4!==k.getDay()&&k.setMonth(0,1+(4-k.getDay()+7)%7),k.getTime()+6048e5*parseInt(h[2],10)):i?i[6]?(g=0,"Z"!==i[6]&&(g=60*parseInt(i[8],10)+parseInt(i[9],10),"+"===i[7]&&(g=0-g)),Date.UTC(parseInt(i[1],10),parseInt(i[2],10)-1,parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10)+g)):new Date(parseInt(i[1],10),parseInt(i[2],10)-1,parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10)).getTime():j?(l=parseFloat(j[6]),b=Math.floor(l),d=Math.round(1e3*(l-b)),j[8]?(g=0,"Z"!==j[8]&&(g=60*parseInt(j[10],10)+parseInt(j[11],10),"+"===j[9]&&(g=0-g)),Date.UTC(parseInt(j[1],10),parseInt(j[2],10)-1,parseInt(j[3],10),parseInt(j[4],10),parseInt(j[5],10)+g,b,d)):new Date(parseInt(j[1],10),parseInt(j[2],10)-1,parseInt(j[3],10),parseInt(j[4],10),parseInt(j[5],10),b,d).getTime()):new Date(parseInt(a,10),0,1).getTime())},b.Hover=function(){function c(c){null==c&&(c={}),this.options=a.extend({},b.Hover.defaults,c),this.el=a("<div class='"+this.options["class"]+"'></div>"),this.el.hide(),this.options.parent.append(this.el)}return c.defaults={"class":"morris-hover morris-default-style"},c.prototype.update=function(a,b,c){return a?(this.html(a),this.show(),this.moveTo(b,c)):this.hide()},c.prototype.html=function(a){return this.el.html(a)},c.prototype.moveTo=function(a,b){var c,d,e,f,g,h;return g=this.options.parent.innerWidth(),f=this.options.parent.innerHeight(),d=this.el.outerWidth(),c=this.el.outerHeight(),e=Math.min(Math.max(0,a-d/2),g-d),null!=b?(h=b-c-10,0>h&&(h=b+10,h+c>f&&(h=f/2-c/2))):h=f/2-c/2,this.el.css({left:e+"px",top:parseInt(h)+"px"})},c.prototype.show=function(){return this.el.show()},c.prototype.hide=function(){return this.el.hide()},c}(),b.Line=function(a){function c(a){return this.hilight=f(this.hilight,this),this.onHoverOut=f(this.onHoverOut,this),this.onHoverMove=f(this.onHoverMove,this),this.onGridClick=f(this.onGridClick,this),this instanceof b.Line?(c.__super__.constructor.call(this,a),void 0):new b.Line(a)}return h(c,a),c.prototype.init=function(){return"always"!==this.options.hideHover?(this.hover=new b.Hover({parent:this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)):void 0},c.prototype.defaults={lineWidth:3,pointSize:4,lineColors:["#0b62a4","#7A92A3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],pointStrokeWidths:[1],pointStrokeColors:["#ffffff"],pointFillColors:[],smooth:!0,xLabels:"auto",xLabelFormat:null,xLabelMargin:24,hideHover:!1},c.prototype.calc=function(){return this.calcPoints(),this.generatePaths()},c.prototype.calcPoints=function(){var a,b,c,d,e,f;for(e=this.data,f=[],c=0,d=e.length;d>c;c++)a=e[c],a._x=this.transX(a.x),a._y=function(){var c,d,e,f;for(e=a.y,f=[],c=0,d=e.length;d>c;c++)b=e[c],null!=b?f.push(this.transY(b)):f.push(b);return f}.call(this),f.push(a._ymax=Math.min.apply(Math,[this.bottom].concat(function(){var c,d,e,f;for(e=a._y,f=[],c=0,d=e.length;d>c;c++)b=e[c],null!=b&&f.push(b);return f}())));return f},c.prototype.hitTest=function(a){var b,c,d,e,f;if(0===this.data.length)return null;for(f=this.data.slice(1),b=d=0,e=f.length;e>d&&(c=f[b],!(a<(c._x+this.data[b]._x)/2));b=++d);return b},c.prototype.onGridClick=function(a,b){var c;return c=this.hitTest(a),this.fire("click",c,this.data[c].src,a,b)},c.prototype.onHoverMove=function(a){var b;return b=this.hitTest(a),this.displayHoverForRow(b)},c.prototype.onHoverOut=function(){return this.options.hideHover!==!1?this.displayHoverForRow(null):void 0},c.prototype.displayHoverForRow=function(a){var b;return null!=a?((b=this.hover).update.apply(b,this.hoverContentForRow(a)),this.hilight(a)):(this.hover.hide(),this.hilight())},c.prototype.hoverContentForRow=function(a){var b,c,d,e,f,g,h;for(d=this.data[a],b="<div class='morris-hover-row-label'>"+d.label+"</div>",h=d.y,c=f=0,g=h.length;g>f;c=++f)e=h[c],b+="<div class='morris-hover-point' style='color: "+this.colorFor(d,c,"label")+"'>\n "+this.options.labels[c]+":\n "+this.yLabelFormat(e)+"\n</div>";return"function"==typeof this.options.hoverCallback&&(b=this.options.hoverCallback(a,this.options,b,d.src)),[b,d._x,d._ymax]},c.prototype.generatePaths=function(){var a,c,d,e;return this.paths=function(){var f,g,h,j;for(j=[],c=f=0,g=this.options.ykeys.length;g>=0?g>f:f>g;c=g>=0?++f:--f)e="boolean"==typeof this.options.smooth?this.options.smooth:(h=this.options.ykeys[c],i.call(this.options.smooth,h)>=0),a=function(){var a,b,e,f;for(e=this.data,f=[],a=0,b=e.length;b>a;a++)d=e[a],void 0!==d._y[c]&&f.push({x:d._x,y:d._y[c]});return f}.call(this),a.length>1?j.push(b.Line.createPath(a,e,this.bottom)):j.push(null);return j}.call(this)},c.prototype.draw=function(){var a;return((a=this.options.axes)===!0||"both"===a||"x"===a)&&this.drawXAxis(),this.drawSeries(),this.options.hideHover===!1?this.displayHoverForRow(this.data.length-1):void 0},c.prototype.drawXAxis=function(){var a,c,d,e,f,g,h,i,j,k,l=this;for(h=this.bottom+this.options.padding/2,f=null,e=null,a=function(a,b){var c,d,g,i,j;return c=l.drawXAxisLabel(l.transX(b),h,a),j=c.getBBox(),c.transform("r"+-l.options.xLabelAngle),d=c.getBBox(),c.transform("t0,"+d.height/2+"..."),0!==l.options.xLabelAngle&&(i=-.5*j.width*Math.cos(l.options.xLabelAngle*Math.PI/180),c.transform("t"+i+",0...")),d=c.getBBox(),(null==f||f>=d.x+d.width||null!=e&&e>=d.x)&&d.x>=0&&d.x+d.width<l.el.width()?(0!==l.options.xLabelAngle&&(g=1.25*l.options.gridTextSize/Math.sin(l.options.xLabelAngle*Math.PI/180),e=d.x-g),f=d.x-l.options.xLabelMargin):c.remove()},d=this.options.parseTime?1===this.data.length&&"auto"===this.options.xLabels?[[this.data[0].label,this.data[0].x]]:b.labelSeries(this.xmin,this.xmax,this.width,this.options.xLabels,this.options.xLabelFormat):function(){var a,b,c,d;for(c=this.data,d=[],a=0,b=c.length;b>a;a++)g=c[a],d.push([g.label,g.x]);return d}.call(this),d.reverse(),k=[],i=0,j=d.length;j>i;i++)c=d[i],k.push(a(c[0],c[1]));return k},c.prototype.drawSeries=function(){var a,b,c,d,e,f;for(this.seriesPoints=[],a=b=d=this.options.ykeys.length-1;0>=d?0>=b:b>=0;a=0>=d?++b:--b)this._drawLineFor(a);for(f=[],a=c=e=this.options.ykeys.length-1;0>=e?0>=c:c>=0;a=0>=e?++c:--c)f.push(this._drawPointFor(a));return f},c.prototype._drawPointFor=function(a){var b,c,d,e,f,g;for(this.seriesPoints[a]=[],f=this.data,g=[],d=0,e=f.length;e>d;d++)c=f[d],b=null,null!=c._y[a]&&(b=this.drawLinePoint(c._x,c._y[a],this.colorFor(c,a,"point"),a)),g.push(this.seriesPoints[a].push(b));return g},c.prototype._drawLineFor=function(a){var b;return b=this.paths[a],null!==b?this.drawLinePath(b,this.colorFor(null,a,"line"),a):void 0},c.createPath=function(a,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(k="",c&&(g=b.Line.gradients(a)),l={y:null},h=q=0,r=a.length;r>q;h=++q)e=a[h],null!=e.y&&(null!=l.y?c?(f=g[h],j=g[h-1],i=(e.x-l.x)/4,m=l.x+i,o=Math.min(d,l.y+i*j),n=e.x-i,p=Math.min(d,e.y-i*f),k+="C"+m+","+o+","+n+","+p+","+e.x+","+e.y):k+="L"+e.x+","+e.y:c&&null==g[h]||(k+="M"+e.x+","+e.y)),l=e;return k},c.gradients=function(a){var b,c,d,e,f,g,h,i;for(c=function(a,b){return(a.y-b.y)/(a.x-b.x)},i=[],d=g=0,h=a.length;h>g;d=++g)b=a[d],null!=b.y?(e=a[d+1]||{y:null},f=a[d-1]||{y:null},null!=f.y&&null!=e.y?i.push(c(f,e)):null!=f.y?i.push(c(f,b)):null!=e.y?i.push(c(b,e)):i.push(null)):i.push(null);return i},c.prototype.hilight=function(a){var b,c,d,e,f;if(null!==this.prevHilight&&this.prevHilight!==a)for(b=c=0,e=this.seriesPoints.length-1;e>=0?e>=c:c>=e;b=e>=0?++c:--c)this.seriesPoints[b][this.prevHilight]&&this.seriesPoints[b][this.prevHilight].animate(this.pointShrinkSeries(b));if(null!==a&&this.prevHilight!==a)for(b=d=0,f=this.seriesPoints.length-1;f>=0?f>=d:d>=f;b=f>=0?++d:--d)this.seriesPoints[b][a]&&this.seriesPoints[b][a].animate(this.pointGrowSeries(b));return this.prevHilight=a},c.prototype.colorFor=function(a,b,c){return"function"==typeof this.options.lineColors?this.options.lineColors.call(this,a,b,c):"point"===c?this.options.pointFillColors[b%this.options.pointFillColors.length]||this.options.lineColors[b%this.options.lineColors.length]:this.options.lineColors[b%this.options.lineColors.length]},c.prototype.drawXAxisLabel=function(a,b,c){return this.raphael.text(a,b,c).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor)},c.prototype.drawLinePath=function(a,b,c){return this.raphael.path(a).attr("stroke",b).attr("stroke-width",this.lineWidthForSeries(c))},c.prototype.drawLinePoint=function(a,b,c,d){return this.raphael.circle(a,b,this.pointSizeForSeries(d)).attr("fill",c).attr("stroke-width",this.pointStrokeWidthForSeries(d)).attr("stroke",this.pointStrokeColorForSeries(d))},c.prototype.pointStrokeWidthForSeries=function(a){return this.options.pointStrokeWidths[a%this.options.pointStrokeWidths.length]},c.prototype.pointStrokeColorForSeries=function(a){return this.options.pointStrokeColors[a%this.options.pointStrokeColors.length]},c.prototype.lineWidthForSeries=function(a){return this.options.lineWidth instanceof Array?this.options.lineWidth[a%this.options.lineWidth.length]:this.options.lineWidth},c.prototype.pointSizeForSeries=function(a){return this.options.pointSize instanceof Array?this.options.pointSize[a%this.options.pointSize.length]:this.options.pointSize},c.prototype.pointGrowSeries=function(a){return Raphael.animation({r:this.pointSizeForSeries(a)+3},25,"linear")},c.prototype.pointShrinkSeries=function(a){return Raphael.animation({r:this.pointSizeForSeries(a)},25,"linear")},c}(b.Grid),b.labelSeries=function(c,d,e,f,g){var h,i,j,k,l,m,n,o,p,q,r;if(j=200*(d-c)/e,i=new Date(c),n=b.LABEL_SPECS[f],void 0===n)for(r=b.AUTO_LABEL_ORDER,p=0,q=r.length;q>p;p++)if(k=r[p],m=b.LABEL_SPECS[k],j>=m.span){n=m;break}for(void 0===n&&(n=b.LABEL_SPECS.second),g&&(n=a.extend({},n,{fmt:g})),h=n.start(i),l=[];(o=h.getTime())<=d;)o>=c&&l.push([n.fmt(h),o]),n.incr(h);return l},c=function(a){return{span:60*a*1e3,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours())},fmt:function(a){return""+b.pad2(a.getHours())+":"+b.pad2(a.getMinutes())},incr:function(b){return b.setUTCMinutes(b.getUTCMinutes()+a)}}},d=function(a){return{span:1e3*a,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes())},fmt:function(a){return""+b.pad2(a.getHours())+":"+b.pad2(a.getMinutes())+":"+b.pad2(a.getSeconds())},incr:function(b){return b.setUTCSeconds(b.getUTCSeconds()+a)}}},b.LABEL_SPECS={decade:{span:1728e8,start:function(a){return new Date(a.getFullYear()-a.getFullYear()%10,0,1)},fmt:function(a){return""+a.getFullYear()},incr:function(a){return a.setFullYear(a.getFullYear()+10)}},year:{span:1728e7,start:function(a){return new Date(a.getFullYear(),0,1)},fmt:function(a){return""+a.getFullYear()},incr:function(a){return a.setFullYear(a.getFullYear()+1)}},month:{span:24192e5,start:function(a){return new Date(a.getFullYear(),a.getMonth(),1)},fmt:function(a){return""+a.getFullYear()+"-"+b.pad2(a.getMonth()+1)},incr:function(a){return a.setMonth(a.getMonth()+1)}},week:{span:6048e5,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())},fmt:function(a){return""+a.getFullYear()+"-"+b.pad2(a.getMonth()+1)+"-"+b.pad2(a.getDate())},incr:function(a){return a.setDate(a.getDate()+7)}},day:{span:864e5,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())},fmt:function(a){return""+a.getFullYear()+"-"+b.pad2(a.getMonth()+1)+"-"+b.pad2(a.getDate())},incr:function(a){return a.setDate(a.getDate()+1)}},hour:c(60),"30min":c(30),"15min":c(15),"10min":c(10),"5min":c(5),minute:c(1),"30sec":d(30),"15sec":d(15),"10sec":d(10),"5sec":d(5),second:d(1)},b.AUTO_LABEL_ORDER=["decade","year","month","week","day","hour","30min","15min","10min","5min","minute","30sec","15sec","10sec","5sec","second"],b.Area=function(c){function d(c){var f;return this instanceof b.Area?(f=a.extend({},e,c),this.cumulative=!f.behaveLikeLine,"auto"===f.fillOpacity&&(f.fillOpacity=f.behaveLikeLine?.8:1),d.__super__.constructor.call(this,f),void 0):new b.Area(c)}var e;return h(d,c),e={fillOpacity:"auto",behaveLikeLine:!1},d.prototype.calcPoints=function(){var a,b,c,d,e,f,g;for(f=this.data,g=[],d=0,e=f.length;e>d;d++)a=f[d],a._x=this.transX(a.x),b=0,a._y=function(){var d,e,f,g;for(f=a.y,g=[],d=0,e=f.length;e>d;d++)c=f[d],this.options.behaveLikeLine?g.push(this.transY(c)):(b+=c||0,g.push(this.transY(b)));return g}.call(this),g.push(a._ymax=Math.max.apply(Math,a._y));return g},d.prototype.drawSeries=function(){var a,b,c,d,e,f,g,h;for(this.seriesPoints=[],b=this.options.behaveLikeLine?function(){f=[];for(var a=0,b=this.options.ykeys.length-1;b>=0?b>=a:a>=b;b>=0?a++:a--)f.push(a);return f}.apply(this):function(){g=[];for(var a=e=this.options.ykeys.length-1;0>=e?0>=a:a>=0;0>=e?a++:a--)g.push(a);return g}.apply(this),h=[],c=0,d=b.length;d>c;c++)a=b[c],this._drawFillFor(a),this._drawLineFor(a),h.push(this._drawPointFor(a));return h},d.prototype._drawFillFor=function(a){var b;return b=this.paths[a],null!==b?(b+="L"+this.transX(this.xmax)+","+this.bottom+"L"+this.transX(this.xmin)+","+this.bottom+"Z",this.drawFilledPath(b,this.fillForSeries(a))):void 0},d.prototype.fillForSeries=function(a){var b;return b=Raphael.rgb2hsl(this.colorFor(this.data[a],a,"line")),Raphael.hsl(b.h,this.options.behaveLikeLine?.9*b.s:.75*b.s,Math.min(.98,this.options.behaveLikeLine?1.2*b.l:1.25*b.l))},d.prototype.drawFilledPath=function(a,b){return this.raphael.path(a).attr("fill",b).attr("fill-opacity",this.options.fillOpacity).attr("stroke","none")},d}(b.Line),b.Bar=function(c){function d(c){return this.onHoverOut=f(this.onHoverOut,this),this.onHoverMove=f(this.onHoverMove,this),this.onGridClick=f(this.onGridClick,this),this instanceof b.Bar?(d.__super__.constructor.call(this,a.extend({},c,{parseTime:!1})),void 0):new b.Bar(c)}return h(d,c),d.prototype.init=function(){return this.cumulative=this.options.stacked,"always"!==this.options.hideHover?(this.hover=new b.Hover({parent:this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)):void 0},d.prototype.defaults={barSizeRatio:.75,barGap:3,barColors:["#0b62a4","#7a92a3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],barOpacity:1,barRadius:[0,0,0,0],xLabelMargin:50},d.prototype.calc=function(){var a;return this.calcBars(),this.options.hideHover===!1?(a=this.hover).update.apply(a,this.hoverContentForRow(this.data.length-1)):void 0},d.prototype.calcBars=function(){var a,b,c,d,e,f,g;for(f=this.data,g=[],a=d=0,e=f.length;e>d;a=++d)b=f[a],b._x=this.left+this.width*(a+.5)/this.data.length,g.push(b._y=function(){var a,d,e,f;for(e=b.y,f=[],a=0,d=e.length;d>a;a++)c=e[a],null!=c?f.push(this.transY(c)):f.push(null);return f}.call(this));return g},d.prototype.draw=function(){var a;return((a=this.options.axes)===!0||"both"===a||"x"===a)&&this.drawXAxis(),this.drawSeries()},d.prototype.drawXAxis=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m;for(j=this.bottom+(this.options.xAxisLabelTopPadding||this.options.padding/2),g=null,f=null,m=[],a=k=0,l=this.data.length;l>=0?l>k:k>l;a=l>=0?++k:--k)h=this.data[this.data.length-1-a],b=this.drawXAxisLabel(h._x,j,h.label),i=b.getBBox(),b.transform("r"+-this.options.xLabelAngle),c=b.getBBox(),b.transform("t0,"+c.height/2+"..."),0!==this.options.xLabelAngle&&(e=-.5*i.width*Math.cos(this.options.xLabelAngle*Math.PI/180),b.transform("t"+e+",0...")),(null==g||g>=c.x+c.width||null!=f&&f>=c.x)&&c.x>=0&&c.x+c.width<this.el.width()?(0!==this.options.xLabelAngle&&(d=1.25*this.options.gridTextSize/Math.sin(this.options.xLabelAngle*Math.PI/180),f=c.x-d),m.push(g=c.x-this.options.xLabelMargin)):m.push(b.remove());return m},d.prototype.drawSeries=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;return c=this.width/this.options.data.length,h=this.options.stacked?1:this.options.ykeys.length,a=(c*this.options.barSizeRatio-this.options.barGap*(h-1))/h,this.options.barSize&&(a=Math.min(a,this.options.barSize)),l=c-a*h-this.options.barGap*(h-1),g=l/2,o=this.ymin<=0&&this.ymax>=0?this.transY(0):null,this.bars=function(){var h,l,p,q;for(p=this.data,q=[],d=h=0,l=p.length;l>h;d=++h)i=p[d],e=0,q.push(function(){var h,l,p,q;for(p=i._y,q=[],j=h=0,l=p.length;l>h;j=++h)n=p[j],null!==n?(o?(m=Math.min(n,o),b=Math.max(n,o)):(m=n,b=this.bottom),f=this.left+d*c+g,this.options.stacked||(f+=j*(a+this.options.barGap)),k=b-m,this.options.verticalGridCondition&&this.options.verticalGridCondition(i.x)&&this.drawBar(this.left+d*c,this.top,c,Math.abs(this.top-this.bottom),this.options.verticalGridColor,this.options.verticalGridOpacity,this.options.barRadius),this.options.stacked&&(m-=e),this.drawBar(f,m,a,k,this.colorFor(i,j,"bar"),this.options.barOpacity,this.options.barRadius),q.push(e+=k)):q.push(null);return q}.call(this));return q}.call(this)},d.prototype.colorFor=function(a,b,c){var d,e;return"function"==typeof this.options.barColors?(d={x:a.x,y:a.y[b],label:a.label},e={index:b,key:this.options.ykeys[b],label:this.options.labels[b]},this.options.barColors.call(this,d,e,c)):this.options.barColors[b%this.options.barColors.length]},d.prototype.hitTest=function(a){return 0===this.data.length?null:(a=Math.max(Math.min(a,this.right),this.left),Math.min(this.data.length-1,Math.floor((a-this.left)/(this.width/this.data.length))))},d.prototype.onGridClick=function(a,b){var c;return c=this.hitTest(a),this.fire("click",c,this.data[c].src,a,b)},d.prototype.onHoverMove=function(a){var b,c;return b=this.hitTest(a),(c=this.hover).update.apply(c,this.hoverContentForRow(b))},d.prototype.onHoverOut=function(){return this.options.hideHover!==!1?this.hover.hide():void 0},d.prototype.hoverContentForRow=function(a){var b,c,d,e,f,g,h,i;for(d=this.data[a],b="<div class='morris-hover-row-label'>"+d.label+"</div>",i=d.y,c=g=0,h=i.length;h>g;c=++g)f=i[c],b+="<div class='morris-hover-point' style='color: "+this.colorFor(d,c,"label")+"'>\n "+this.options.labels[c]+":\n "+this.yLabelFormat(f)+"\n</div>";return"function"==typeof this.options.hoverCallback&&(b=this.options.hoverCallback(a,this.options,b,d.src)),e=this.left+(a+.5)*this.width/this.data.length,[b,e]},d.prototype.drawXAxisLabel=function(a,b,c){var d;return d=this.raphael.text(a,b,c).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor)},d.prototype.drawBar=function(a,b,c,d,e,f,g){var h,i;return h=Math.max.apply(Math,g),i=0===h||h>d?this.raphael.rect(a,b,c,d):this.raphael.path(this.roundedRect(a,b,c,d,g)),i.attr("fill",e).attr("fill-opacity",f).attr("stroke","none")},d.prototype.roundedRect=function(a,b,c,d,e){return null==e&&(e=[0,0,0,0]),["M",a,e[0]+b,"Q",a,b,a+e[0],b,"L",a+c-e[1],b,"Q",a+c,b,a+c,b+e[1],"L",a+c,b+d-e[2],"Q",a+c,b+d,a+c-e[2],b+d,"L",a+e[3],b+d,"Q",a,b+d,a,b+d-e[3],"Z"]},d}(b.Grid),b.Donut=function(c){function d(c){this.resizeHandler=f(this.resizeHandler,this),this.select=f(this.select,this),this.click=f(this.click,this);var d=this;if(!(this instanceof b.Donut))return new b.Donut(c);if(this.options=a.extend({},this.defaults,c),this.el="string"==typeof c.element?a(document.getElementById(c.element)):a(c.element),null===this.el||0===this.el.length)throw new Error("Graph placeholder not found.");void 0!==c.data&&0!==c.data.length&&(this.raphael=new Raphael(this.el[0]),this.options.resize&&a(window).bind("resize",function(){return null!=d.timeoutId&&window.clearTimeout(d.timeoutId),d.timeoutId=window.setTimeout(d.resizeHandler,100)}),this.setData(c.data))}return h(d,c),d.prototype.defaults={colors:["#0B62A4","#3980B5","#679DC6","#95BBD7","#B0CCE1","#095791","#095085","#083E67","#052C48","#042135"],backgroundColor:"#FFFFFF",labelColor:"#000000",formatter:b.commas,resize:!1},d.prototype.redraw=function(){var a,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;for(this.raphael.clear(),c=this.el.width()/2,d=this.el.height()/2,n=(Math.min(c,d)-10)/3,l=0,u=this.values,o=0,r=u.length;r>o;o++)m=u[o],l+=m;for(i=5/(2*n),a=1.9999*Math.PI-i*this.data.length,g=0,f=0,this.segments=[],v=this.values,e=p=0,s=v.length;s>p;e=++p)m=v[e],j=g+i+a*(m/l),k=new b.DonutSegment(c,d,2*n,n,g,j,this.data[e].color||this.options.colors[f%this.options.colors.length],this.options.backgroundColor,f,this.raphael),k.render(),this.segments.push(k),k.on("hover",this.select),k.on("click",this.click),g=j,f+=1;for(this.text1=this.drawEmptyDonutLabel(c,d-10,this.options.labelColor,15,800),this.text2=this.drawEmptyDonutLabel(c,d+10,this.options.labelColor,14),h=Math.max.apply(Math,this.values),f=0,w=this.values,x=[],q=0,t=w.length;t>q;q++){if(m=w[q],m===h){this.select(f);
28
  break}x.push(f+=1)}return x},d.prototype.setData=function(a){var b;return this.data=a,this.values=function(){var a,c,d,e;for(d=this.data,e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(parseFloat(b.value));return e}.call(this),this.redraw()},d.prototype.click=function(a){return this.fire("click",a,this.data[a])},d.prototype.select=function(a){var b,c,d,e,f,g;for(g=this.segments,e=0,f=g.length;f>e;e++)c=g[e],c.deselect();return d=this.segments[a],d.select(),b=this.data[a],this.setLabels(b.label,this.options.formatter(b.value,b))},d.prototype.setLabels=function(a,b){var c,d,e,f,g,h,i,j;return c=2*(Math.min(this.el.width()/2,this.el.height()/2)-10)/3,f=1.8*c,e=c/2,d=c/3,this.text1.attr({text:a,transform:""}),g=this.text1.getBBox(),h=Math.min(f/g.width,e/g.height),this.text1.attr({transform:"S"+h+","+h+","+(g.x+g.width/2)+","+(g.y+g.height)}),this.text2.attr({text:b,transform:""}),i=this.text2.getBBox(),j=Math.min(f/i.width,d/i.height),this.text2.attr({transform:"S"+j+","+j+","+(i.x+i.width/2)+","+i.y})},d.prototype.drawEmptyDonutLabel=function(a,b,c,d,e){var f;return f=this.raphael.text(a,b,"").attr("font-size",d).attr("fill",c),null!=e&&f.attr("font-weight",e),f},d.prototype.resizeHandler=function(){return this.timeoutId=null,this.raphael.setSize(this.el.width(),this.el.height()),this.redraw()},d}(b.EventEmitter),b.DonutSegment=function(a){function b(a,b,c,d,e,g,h,i,j,k){this.cx=a,this.cy=b,this.inner=c,this.outer=d,this.color=h,this.backgroundColor=i,this.index=j,this.raphael=k,this.deselect=f(this.deselect,this),this.select=f(this.select,this),this.sin_p0=Math.sin(e),this.cos_p0=Math.cos(e),this.sin_p1=Math.sin(g),this.cos_p1=Math.cos(g),this.is_long=g-e>Math.PI?1:0,this.path=this.calcSegment(this.inner+3,this.inner+this.outer-5),this.selectedPath=this.calcSegment(this.inner+3,this.inner+this.outer),this.hilight=this.calcArc(this.inner)}return h(b,a),b.prototype.calcArcPoints=function(a){return[this.cx+a*this.sin_p0,this.cy+a*this.cos_p0,this.cx+a*this.sin_p1,this.cy+a*this.cos_p1]},b.prototype.calcSegment=function(a,b){var c,d,e,f,g,h,i,j,k,l;return k=this.calcArcPoints(a),c=k[0],e=k[1],d=k[2],f=k[3],l=this.calcArcPoints(b),g=l[0],i=l[1],h=l[2],j=l[3],"M"+c+","+e+("A"+a+","+a+",0,"+this.is_long+",0,"+d+","+f)+("L"+h+","+j)+("A"+b+","+b+",0,"+this.is_long+",1,"+g+","+i)+"Z"},b.prototype.calcArc=function(a){var b,c,d,e,f;return f=this.calcArcPoints(a),b=f[0],d=f[1],c=f[2],e=f[3],"M"+b+","+d+("A"+a+","+a+",0,"+this.is_long+",0,"+c+","+e)},b.prototype.render=function(){var a=this;return this.arc=this.drawDonutArc(this.hilight,this.color),this.seg=this.drawDonutSegment(this.path,this.color,this.backgroundColor,function(){return a.fire("hover",a.index)},function(){return a.fire("click",a.index)})},b.prototype.drawDonutArc=function(a,b){return this.raphael.path(a).attr({stroke:b,"stroke-width":2,opacity:0})},b.prototype.drawDonutSegment=function(a,b,c,d,e){return this.raphael.path(a).attr({fill:b,stroke:c,"stroke-width":3}).hover(d).click(e)},b.prototype.select=function(){return this.selected?void 0:(this.seg.animate({path:this.selectedPath},150,"<>"),this.arc.animate({opacity:1},150,"<>"),this.selected=!0)},b.prototype.deselect=function(){return this.selected?(this.seg.animate({path:this.path},150,"<>"),this.arc.animate({opacity:0},150,"<>"),this.selected=!1):void 0},b}(b.EventEmitter)}).call(this);
1
+ //jquery
2
+ if (typeof jQuery == 'undefined') {
3
+ /*! jQuery v1.9.0 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license */(function(e,t){"use strict";function n(e){var t=e.length,n=st.type(e);return st.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}function r(e){var t=Tt[e]={};return st.each(e.match(lt)||[],function(e,n){t[n]=!0}),t}function i(e,n,r,i){if(st.acceptData(e)){var o,a,s=st.expando,u="string"==typeof n,l=e.nodeType,c=l?st.cache:e,f=l?e[s]:e[s]&&s;if(f&&c[f]&&(i||c[f].data)||!u||r!==t)return f||(l?e[s]=f=K.pop()||st.guid++:f=s),c[f]||(c[f]={},l||(c[f].toJSON=st.noop)),("object"==typeof n||"function"==typeof n)&&(i?c[f]=st.extend(c[f],n):c[f].data=st.extend(c[f].data,n)),o=c[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[st.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[st.camelCase(n)])):a=o,a}}function o(e,t,n){if(st.acceptData(e)){var r,i,o,a=e.nodeType,u=a?st.cache:e,l=a?e[st.expando]:st.expando;if(u[l]){if(t&&(r=n?u[l]:u[l].data)){st.isArray(t)?t=t.concat(st.map(t,st.camelCase)):t in r?t=[t]:(t=st.camelCase(t),t=t in r?[t]:t.split(" "));for(i=0,o=t.length;o>i;i++)delete r[t[i]];if(!(n?s:st.isEmptyObject)(r))return}(n||(delete u[l].data,s(u[l])))&&(a?st.cleanData([e],!0):st.support.deleteExpando||u!=u.window?delete u[l]:u[l]=null)}}}function a(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(Nt,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:wt.test(r)?st.parseJSON(r):r}catch(o){}st.data(e,n,r)}else r=t}return r}function s(e){var t;for(t in e)if(("data"!==t||!st.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function u(){return!0}function l(){return!1}function c(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function f(e,t,n){if(t=t||0,st.isFunction(t))return st.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return st.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=st.grep(e,function(e){return 1===e.nodeType});if(Wt.test(t))return st.filter(t,r,!n);t=st.filter(t,r)}return st.grep(e,function(e){return st.inArray(e,t)>=0===n})}function p(e){var t=zt.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function d(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function h(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function g(e){var t=nn.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function m(e,t){for(var n,r=0;null!=(n=e[r]);r++)st._data(n,"globalEval",!t||st._data(t[r],"globalEval"))}function y(e,t){if(1===t.nodeType&&st.hasData(e)){var n,r,i,o=st._data(e),a=st._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)st.event.add(t,n,s[n][r])}a.data&&(a.data=st.extend({},a.data))}}function v(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!st.support.noCloneEvent&&t[st.expando]){r=st._data(t);for(i in r.events)st.removeEvent(t,i,r.handle);t.removeAttribute(st.expando)}"script"===n&&t.text!==e.text?(h(t).text=e.text,g(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),st.support.html5Clone&&e.innerHTML&&!st.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Zt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function b(e,n){var r,i,o=0,a=e.getElementsByTagName!==t?e.getElementsByTagName(n||"*"):e.querySelectorAll!==t?e.querySelectorAll(n||"*"):t;if(!a)for(a=[],r=e.childNodes||e;null!=(i=r[o]);o++)!n||st.nodeName(i,n)?a.push(i):st.merge(a,b(i,n));return n===t||n&&st.nodeName(e,n)?st.merge([e],a):a}function x(e){Zt.test(e.type)&&(e.defaultChecked=e.checked)}function T(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Nn.length;i--;)if(t=Nn[i]+n,t in e)return t;return r}function w(e,t){return e=t||e,"none"===st.css(e,"display")||!st.contains(e.ownerDocument,e)}function N(e,t){for(var n,r=[],i=0,o=e.length;o>i;i++)n=e[i],n.style&&(r[i]=st._data(n,"olddisplay"),t?(r[i]||"none"!==n.style.display||(n.style.display=""),""===n.style.display&&w(n)&&(r[i]=st._data(n,"olddisplay",S(n.nodeName)))):r[i]||w(n)||st._data(n,"olddisplay",st.css(n,"display")));for(i=0;o>i;i++)n=e[i],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?r[i]||"":"none"));return e}function C(e,t,n){var r=mn.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function k(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=st.css(e,n+wn[o],!0,i)),r?("content"===n&&(a-=st.css(e,"padding"+wn[o],!0,i)),"margin"!==n&&(a-=st.css(e,"border"+wn[o]+"Width",!0,i))):(a+=st.css(e,"padding"+wn[o],!0,i),"padding"!==n&&(a+=st.css(e,"border"+wn[o]+"Width",!0,i)));return a}function E(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=ln(e),a=st.support.boxSizing&&"border-box"===st.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=un(e,t,o),(0>i||null==i)&&(i=e.style[t]),yn.test(i))return i;r=a&&(st.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+k(e,t,n||(a?"border":"content"),r,o)+"px"}function S(e){var t=V,n=bn[e];return n||(n=A(e,t),"none"!==n&&n||(cn=(cn||st("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(cn[0].contentWindow||cn[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=A(e,t),cn.detach()),bn[e]=n),n}function A(e,t){var n=st(t.createElement(e)).appendTo(t.body),r=st.css(n[0],"display");return n.remove(),r}function j(e,t,n,r){var i;if(st.isArray(t))st.each(t,function(t,i){n||kn.test(e)?r(e,i):j(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==st.type(t))r(e,t);else for(i in t)j(e+"["+i+"]",t[i],n,r)}function D(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(lt)||[];if(st.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function L(e,n,r,i){function o(u){var l;return a[u]=!0,st.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||s||a[c]?s?!(l=c):t:(n.dataTypes.unshift(c),o(c),!1)}),l}var a={},s=e===$n;return o(n.dataTypes[0])||!a["*"]&&o("*")}function H(e,n){var r,i,o=st.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((o[r]?e:i||(i={}))[r]=n[r]);return i&&st.extend(!0,e,i),e}function M(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(o in c)o in r&&(n[c[o]]=r[o]);for(;"*"===l[0];)l.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("Content-Type"));if(i)for(o in u)if(u[o]&&u[o].test(i)){l.unshift(o);break}if(l[0]in r)a=l[0];else{for(o in r){if(!l[0]||e.converters[o+" "+l[0]]){a=o;break}s||(s=o)}a=a||s}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function q(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=u[++s];)if("*"!==i){if("*"!==l&&l!==i){if(n=a[l+" "+i]||a["* "+i],!n)for(r in a)if(o=r.split(" "),o[1]===i&&(n=a[l+" "+o[0]]||a["* "+o[0]])){n===!0?n=a[r]:a[r]!==!0&&(i=o[0],u.splice(s--,0,i));break}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(c){return{state:"parsererror",error:n?c:"No conversion from "+l+" to "+i}}}l=i}return{state:"success",data:t}}function _(){try{return new e.XMLHttpRequest}catch(t){}}function F(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function O(){return setTimeout(function(){Qn=t}),Qn=st.now()}function B(e,t){st.each(t,function(t,n){for(var r=(rr[t]||[]).concat(rr["*"]),i=0,o=r.length;o>i;i++)if(r[i].call(e,t,n))return})}function P(e,t,n){var r,i,o=0,a=nr.length,s=st.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=Qn||O(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:st.extend({},t),opts:st.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Qn||O(),duration:n.duration,tweens:[],createTween:function(t,n){var r=st.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(R(c,l.opts.specialEasing);a>o;o++)if(r=nr[o].call(l,e,c,l.opts))return r;return B(l,c),st.isFunction(l.opts.start)&&l.opts.start.call(e,l),st.fx.timer(st.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function R(e,t){var n,r,i,o,a;for(n in e)if(r=st.camelCase(n),i=t[r],o=e[n],st.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=st.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function W(e,t,n){var r,i,o,a,s,u,l,c,f,p=this,d=e.style,h={},g=[],m=e.nodeType&&w(e);n.queue||(c=st._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,f=c.empty.fire,c.empty.fire=function(){c.unqueued||f()}),c.unqueued++,p.always(function(){p.always(function(){c.unqueued--,st.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===st.css(e,"display")&&"none"===st.css(e,"float")&&(st.support.inlineBlockNeedsLayout&&"inline"!==S(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",st.support.shrinkWrapBlocks||p.done(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(r in t)if(o=t[r],Zn.exec(o)){if(delete t[r],u=u||"toggle"===o,o===(m?"hide":"show"))continue;g.push(r)}if(a=g.length){s=st._data(e,"fxshow")||st._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?st(e).show():p.done(function(){st(e).hide()}),p.done(function(){var t;st._removeData(e,"fxshow");for(t in h)st.style(e,t,h[t])});for(r=0;a>r;r++)i=g[r],l=p.createTween(i,m?s[i]:0),h[i]=s[i]||st.style(e,i),i in s||(s[i]=l.start,m&&(l.end=l.start,l.start="width"===i||"height"===i?1:0))}}function $(e,t,n,r,i){return new $.prototype.init(e,t,n,r,i)}function I(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=wn[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function z(e){return st.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var X,U,V=e.document,Y=e.location,J=e.jQuery,G=e.$,Q={},K=[],Z="1.9.0",et=K.concat,tt=K.push,nt=K.slice,rt=K.indexOf,it=Q.toString,ot=Q.hasOwnProperty,at=Z.trim,st=function(e,t){return new st.fn.init(e,t,X)},ut=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,lt=/\S+/g,ct=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ft=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,pt=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,dt=/^[\],:{}\s]*$/,ht=/(?:^|:|,)(?:\s*\[)+/g,gt=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,mt=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,yt=/^-ms-/,vt=/-([\da-z])/gi,bt=function(e,t){return t.toUpperCase()},xt=function(){V.addEventListener?(V.removeEventListener("DOMContentLoaded",xt,!1),st.ready()):"complete"===V.readyState&&(V.detachEvent("onreadystatechange",xt),st.ready())};st.fn=st.prototype={jquery:Z,constructor:st,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:ft.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof st?n[0]:n,st.merge(this,st.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:V,!0)),pt.test(i[1])&&st.isPlainObject(n))for(i in n)st.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=V.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=V,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):st.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),st.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return nt.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=st.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return st.each(this,e,t)},ready:function(e){return st.ready.promise().done(e),this},slice:function(){return this.pushStack(nt.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(st.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:tt,sort:[].sort,splice:[].splice},st.fn.init.prototype=st.fn,st.extend=st.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||st.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(e=arguments[u]))for(n in e)r=s[n],i=e[n],s!==i&&(c&&i&&(st.isPlainObject(i)||(o=st.isArray(i)))?(o?(o=!1,a=r&&st.isArray(r)?r:[]):a=r&&st.isPlainObject(r)?r:{},s[n]=st.extend(c,a,i)):i!==t&&(s[n]=i));return s},st.extend({noConflict:function(t){return e.$===st&&(e.$=G),t&&e.jQuery===st&&(e.jQuery=J),st},isReady:!1,readyWait:1,holdReady:function(e){e?st.readyWait++:st.ready(!0)},ready:function(e){if(e===!0?!--st.readyWait:!st.isReady){if(!V.body)return setTimeout(st.ready);st.isReady=!0,e!==!0&&--st.readyWait>0||(U.resolveWith(V,[st]),st.fn.trigger&&st(V).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===st.type(e)},isArray:Array.isArray||function(e){return"array"===st.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?Q[it.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==st.type(e)||e.nodeType||st.isWindow(e))return!1;try{if(e.constructor&&!ot.call(e,"constructor")&&!ot.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||ot.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||V;var r=pt.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=st.buildFragment([e],t,i),i&&st(i).remove(),st.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=st.trim(n),n&&dt.test(n.replace(gt,"@").replace(mt,"]").replace(ht,"")))?Function("return "+n)():(st.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||st.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&st.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(yt,"ms-").replace(vt,bt)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,r){var i,o=0,a=e.length,s=n(e);if(r){if(s)for(;a>o&&(i=t.apply(e[o],r),i!==!1);o++);else for(o in e)if(i=t.apply(e[o],r),i===!1)break}else if(s)for(;a>o&&(i=t.call(e[o],o,e[o]),i!==!1);o++);else for(o in e)if(i=t.call(e[o],o,e[o]),i===!1)break;return e},trim:at&&!at.call("\ufeff\u00a0")?function(e){return null==e?"":at.call(e)}:function(e){return null==e?"":(e+"").replace(ct,"")},makeArray:function(e,t){var r=t||[];return null!=e&&(n(Object(e))?st.merge(r,"string"==typeof e?[e]:e):tt.call(r,e)),r},inArray:function(e,t,n){var r;if(t){if(rt)return rt.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else for(;n[o]!==t;)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,r){var i,o=0,a=e.length,s=n(e),u=[];if(s)for(;a>o;o++)i=t(e[o],o,r),null!=i&&(u[u.length]=i);else for(o in e)i=t(e[o],o,r),null!=i&&(u[u.length]=i);return et.apply([],u)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(r=e[n],n=e,e=r),st.isFunction(e)?(i=nt.call(arguments,2),o=function(){return e.apply(n||this,i.concat(nt.call(arguments)))},o.guid=e.guid=e.guid||st.guid++,o):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===st.type(r)){o=!0;for(u in r)st.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,st.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(st(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),st.ready.promise=function(t){if(!U)if(U=st.Deferred(),"complete"===V.readyState)setTimeout(st.ready);else if(V.addEventListener)V.addEventListener("DOMContentLoaded",xt,!1),e.addEventListener("load",st.ready,!1);else{V.attachEvent("onreadystatechange",xt),e.attachEvent("onload",st.ready);var n=!1;try{n=null==e.frameElement&&V.documentElement}catch(r){}n&&n.doScroll&&function i(){if(!st.isReady){try{n.doScroll("left")}catch(e){return setTimeout(i,50)}st.ready()}}()}return U.promise(t)},st.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){Q["[object "+t+"]"]=t.toLowerCase()}),X=st(V);var Tt={};st.Callbacks=function(e){e="string"==typeof e?Tt[e]||r(e):st.extend({},e);var n,i,o,a,s,u,l=[],c=!e.once&&[],f=function(t){for(n=e.memory&&t,i=!0,u=a||0,a=0,s=l.length,o=!0;l&&s>u;u++)if(l[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}o=!1,l&&(c?c.length&&f(c.shift()):n?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function r(t){st.each(t,function(t,n){var i=st.type(n);"function"===i?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==i&&r(n)})})(arguments),o?s=l.length:n&&(a=t,f(n))}return this},remove:function(){return l&&st.each(arguments,function(e,t){for(var n;(n=st.inArray(t,l,n))>-1;)l.splice(n,1),o&&(s>=n&&s--,u>=n&&u--)}),this},has:function(e){return st.inArray(e,l)>-1},empty:function(){return l=[],this},disable:function(){return l=c=n=t,this},disabled:function(){return!l},lock:function(){return c=t,n||p.disable(),this},locked:function(){return!c},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!l||i&&!c||(o?c.push(t):f(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},st.extend({Deferred:function(e){var t=[["resolve","done",st.Callbacks("once memory"),"resolved"],["reject","fail",st.Callbacks("once memory"),"rejected"],["notify","progress",st.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return st.Deferred(function(n){st.each(t,function(t,o){var a=o[0],s=st.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&st.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?st.extend(e,r):r}},i={};return r.pipe=r.then,st.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=nt.call(arguments),a=o.length,s=1!==a||e&&st.isFunction(e.promise)?a:0,u=1===s?e:st.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?nt.call(arguments):i,r===t?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(t=Array(a),n=Array(a),r=Array(a);a>i;i++)o[i]&&st.isFunction(o[i].promise)?o[i].promise().done(l(i,r,o)).fail(u.reject).progress(l(i,n,t)):--s;return s||u.resolveWith(r,o),u.promise()}}),st.support=function(){var n,r,i,o,a,s,u,l,c,f,p=V.createElement("div");if(p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",r=p.getElementsByTagName("*"),i=p.getElementsByTagName("a")[0],!r||!i||!r.length)return{};o=V.createElement("select"),a=o.appendChild(V.createElement("option")),s=p.getElementsByTagName("input")[0],i.style.cssText="top:1px;float:left;opacity:.5",n={getSetAttribute:"t"!==p.className,leadingWhitespace:3===p.firstChild.nodeType,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:"/a"===i.getAttribute("href"),opacity:/^0.5/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:!!s.value,optSelected:a.selected,enctype:!!V.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==V.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===V.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},s.checked=!0,n.noCloneChecked=s.cloneNode(!0).checked,o.disabled=!0,n.optDisabled=!a.disabled;try{delete p.test}catch(d){n.deleteExpando=!1}s=V.createElement("input"),s.setAttribute("value",""),n.input=""===s.getAttribute("value"),s.value="t",s.setAttribute("type","radio"),n.radioValue="t"===s.value,s.setAttribute("checked","t"),s.setAttribute("name","t"),u=V.createDocumentFragment(),u.appendChild(s),n.appendChecked=s.checked,n.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,p.attachEvent&&(p.attachEvent("onclick",function(){n.noCloneEvent=!1}),p.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})p.setAttribute(l="on"+f,"t"),n[f+"Bubbles"]=l in e||p.attributes[l].expando===!1;return p.style.backgroundClip="content-box",p.cloneNode(!0).style.backgroundClip="",n.clearCloneStyle="content-box"===p.style.backgroundClip,st(function(){var r,i,o,a="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",s=V.getElementsByTagName("body")[0];s&&(r=V.createElement("div"),r.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",s.appendChild(r).appendChild(p),p.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=p.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",c=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",n.reliableHiddenOffsets=c&&0===o[0].offsetHeight,p.innerHTML="",p.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",n.boxSizing=4===p.offsetWidth,n.doesNotIncludeMarginInBodyOffset=1!==s.offsetTop,e.getComputedStyle&&(n.pixelPosition="1%"!==(e.getComputedStyle(p,null)||{}).top,n.boxSizingReliable="4px"===(e.getComputedStyle(p,null)||{width:"4px"}).width,i=p.appendChild(V.createElement("div")),i.style.cssText=p.style.cssText=a,i.style.marginRight=i.style.width="0",p.style.width="1px",n.reliableMarginRight=!parseFloat((e.getComputedStyle(i,null)||{}).marginRight)),p.style.zoom!==t&&(p.innerHTML="",p.style.cssText=a+"width:1px;padding:1px;display:inline;zoom:1",n.inlineBlockNeedsLayout=3===p.offsetWidth,p.style.display="block",p.innerHTML="<div></div>",p.firstChild.style.width="5px",n.shrinkWrapBlocks=3!==p.offsetWidth,s.style.zoom=1),s.removeChild(r),r=p=o=i=null)}),r=o=u=a=i=s=null,n}();var wt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,Nt=/([A-Z])/g;st.extend({cache:{},expando:"jQuery"+(Z+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?st.cache[e[st.expando]]:e[st.expando],!!e&&!s(e)},data:function(e,t,n){return i(e,t,n,!1)},removeData:function(e,t){return o(e,t,!1)},_data:function(e,t,n){return i(e,t,n,!0)},_removeData:function(e,t){return o(e,t,!0)},acceptData:function(e){var t=e.nodeName&&st.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),st.fn.extend({data:function(e,n){var r,i,o=this[0],s=0,u=null;if(e===t){if(this.length&&(u=st.data(o),1===o.nodeType&&!st._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>s;s++)i=r[s].name,i.indexOf("data-")||(i=st.camelCase(i.substring(5)),a(o,i,u[i]));st._data(o,"parsedAttrs",!0)}return u}return"object"==typeof e?this.each(function(){st.data(this,e)}):st.access(this,function(n){return n===t?o?a(o,e,st.data(o,e)):null:(this.each(function(){st.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){st.removeData(this,e)})}}),st.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=st._data(e,n),r&&(!i||st.isArray(r)?i=st._data(e,n,st.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=st.queue(e,t),r=n.length,i=n.shift(),o=st._queueHooks(e,t),a=function(){st.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return st._data(e,n)||st._data(e,n,{empty:st.Callbacks("once memory").add(function(){st._removeData(e,t+"queue"),st._removeData(e,n)})})}}),st.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?st.queue(this[0],e):n===t?this:this.each(function(){var t=st.queue(this,e,n);st._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&st.dequeue(this,e)})},dequeue:function(e){return this.each(function(){st.dequeue(this,e)})},delay:function(e,t){return e=st.fx?st.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=st.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)r=st._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var Ct,kt,Et=/[\t\r\n]/g,St=/\r/g,At=/^(?:input|select|textarea|button|object)$/i,jt=/^(?:a|area)$/i,Dt=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,Lt=/^(?:checked|selected)$/i,Ht=st.support.getSetAttribute,Mt=st.support.input;st.fn.extend({attr:function(e,t){return st.access(this,st.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){st.removeAttr(this,e)})},prop:function(e,t){return st.access(this,st.prop,e,t,arguments.length>1)},removeProp:function(e){return e=st.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(st.isFunction(e))return this.each(function(t){st(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(lt)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Et," "):" ")){for(o=0;i=t[o++];)0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=st.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(st.isFunction(e))return this.each(function(t){st(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(lt)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Et," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");n.className=e?st.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return st.isFunction(e)?this.each(function(n){st(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var i,o=0,a=st(this),s=t,u=e.match(lt)||[];i=u[o++];)s=r?s:!a.hasClass(i),a[s?"addClass":"removeClass"](i);else("undefined"===n||"boolean"===n)&&(this.className&&st._data(this,"__className__",this.className),this.className=this.className||e===!1?"":st._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(Et," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=st.isFunction(e),this.each(function(r){var o,a=st(this);1===this.nodeType&&(o=i?e.call(this,r,a.val()):e,null==o?o="":"number"==typeof o?o+="":st.isArray(o)&&(o=st.map(o,function(e){return null==e?"":e+""})),n=st.valHooks[this.type]||st.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&n.set(this,o,"value")!==t||(this.value=o))});if(o)return n=st.valHooks[o.type]||st.valHooks[o.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(o,"value"))!==t?r:(r=o.value,"string"==typeof r?r.replace(St,""):null==r?"":r)}}}),st.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(st.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&st.nodeName(n.parentNode,"optgroup"))){if(t=st(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=st.makeArray(t);return st(e).find("option").each(function(){this.selected=st.inArray(st(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return e.getAttribute===t?st.prop(e,n,r):(a=1!==s||!st.isXMLDoc(e),a&&(n=n.toLowerCase(),o=st.attrHooks[n]||(Dt.test(n)?kt:Ct)),r===t?o&&a&&"get"in o&&null!==(i=o.get(e,n))?i:(e.getAttribute!==t&&(i=e.getAttribute(n)),null==i?t:i):null!==r?o&&a&&"set"in o&&(i=o.set(e,r,n))!==t?i:(e.setAttribute(n,r+""),r):(st.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(lt);if(o&&1===e.nodeType)for(;n=o[i++];)r=st.propFix[n]||n,Dt.test(n)?!Ht&&Lt.test(n)?e[st.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:st.attr(e,n,""),e.removeAttribute(Ht?n:r)},attrHooks:{type:{set:function(e,t){if(!st.support.radioValue&&"radio"===t&&st.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!st.isXMLDoc(e),a&&(n=st.propFix[n]||n,o=st.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):At.test(e.nodeName)||jt.test(e.nodeName)&&e.href?0:t}}}}),kt={get:function(e,n){var r=st.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?Mt&&Ht?null!=i:Lt.test(n)?e[st.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?st.removeAttr(e,n):Mt&&Ht||!Lt.test(n)?e.setAttribute(!Ht&&st.propFix[n]||n,n):e[st.camelCase("default-"+n)]=e[n]=!0,n}},Mt&&Ht||(st.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return st.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t
4
+ },set:function(e,n,r){return st.nodeName(e,"input")?(e.defaultValue=n,t):Ct&&Ct.set(e,n,r)}}),Ht||(Ct=st.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},st.attrHooks.contenteditable={get:Ct.get,set:function(e,t,n){Ct.set(e,""===t?!1:t,n)}},st.each(["width","height"],function(e,n){st.attrHooks[n]=st.extend(st.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),st.support.hrefNormalized||(st.each(["href","src","width","height"],function(e,n){st.attrHooks[n]=st.extend(st.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),st.each(["href","src"],function(e,t){st.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),st.support.style||(st.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),st.support.optSelected||(st.propHooks.selected=st.extend(st.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),st.support.enctype||(st.propFix.enctype="encoding"),st.support.checkOn||st.each(["radio","checkbox"],function(){st.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),st.each(["radio","checkbox"],function(){st.valHooks[this]=st.extend(st.valHooks[this],{set:function(e,n){return st.isArray(n)?e.checked=st.inArray(st(e).val(),n)>=0:t}})});var qt=/^(?:input|select|textarea)$/i,_t=/^key/,Ft=/^(?:mouse|contextmenu)|click/,Ot=/^(?:focusinfocus|focusoutblur)$/,Bt=/^([^.]*)(?:\.(.+)|)$/;st.event={global:{},add:function(e,n,r,i,o){var a,s,u,l,c,f,p,d,h,g,m,y=3!==e.nodeType&&8!==e.nodeType&&st._data(e);if(y){for(r.handler&&(a=r,r=a.handler,o=a.selector),r.guid||(r.guid=st.guid++),(l=y.events)||(l=y.events={}),(s=y.handle)||(s=y.handle=function(e){return st===t||e&&st.event.triggered===e.type?t:st.event.dispatch.apply(s.elem,arguments)},s.elem=e),n=(n||"").match(lt)||[""],c=n.length;c--;)u=Bt.exec(n[c])||[],h=m=u[1],g=(u[2]||"").split(".").sort(),p=st.event.special[h]||{},h=(o?p.delegateType:p.bindType)||h,p=st.event.special[h]||{},f=st.extend({type:h,origType:m,data:i,handler:r,guid:r.guid,selector:o,needsContext:o&&st.expr.match.needsContext.test(o),namespace:g.join(".")},a),(d=l[h])||(d=l[h]=[],d.delegateCount=0,p.setup&&p.setup.call(e,i,g,s)!==!1||(e.addEventListener?e.addEventListener(h,s,!1):e.attachEvent&&e.attachEvent("on"+h,s))),p.add&&(p.add.call(e,f),f.handler.guid||(f.handler.guid=r.guid)),o?d.splice(d.delegateCount++,0,f):d.push(f),st.event.global[h]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,m=st.hasData(e)&&st._data(e);if(m&&(u=m.events)){for(t=(t||"").match(lt)||[""],l=t.length;l--;)if(s=Bt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){for(f=st.event.special[d]||{},d=(r?f.delegateType:f.bindType)||d,p=u[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&f.teardown.call(e,h,m.handle)!==!1||st.removeEvent(e,d,m.handle),delete u[d])}else for(d in u)st.event.remove(e,d+t[l],n,r,!0);st.isEmptyObject(u)&&(delete m.handle,st._removeData(e,"events"))}},trigger:function(n,r,i,o){var a,s,u,l,c,f,p,d=[i||V],h=n.type||n,g=n.namespace?n.namespace.split("."):[];if(s=u=i=i||V,3!==i.nodeType&&8!==i.nodeType&&!Ot.test(h+st.event.triggered)&&(h.indexOf(".")>=0&&(g=h.split("."),h=g.shift(),g.sort()),c=0>h.indexOf(":")&&"on"+h,n=n[st.expando]?n:new st.Event(h,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=g.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:st.makeArray(r,[n]),p=st.event.special[h]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!st.isWindow(i)){for(l=p.delegateType||h,Ot.test(l+h)||(s=s.parentNode);s;s=s.parentNode)d.push(s),u=s;u===(i.ownerDocument||V)&&d.push(u.defaultView||u.parentWindow||e)}for(a=0;(s=d[a++])&&!n.isPropagationStopped();)n.type=a>1?l:p.bindType||h,f=(st._data(s,"events")||{})[n.type]&&st._data(s,"handle"),f&&f.apply(s,r),f=c&&s[c],f&&st.acceptData(s)&&f.apply&&f.apply(s,r)===!1&&n.preventDefault();if(n.type=h,!(o||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===h&&st.nodeName(i,"a")||!st.acceptData(i)||!c||!i[h]||st.isWindow(i))){u=i[c],u&&(i[c]=null),st.event.triggered=h;try{i[h]()}catch(m){}st.event.triggered=t,u&&(i[c]=u)}return n.result}},dispatch:function(e){e=st.event.fix(e);var n,r,i,o,a,s=[],u=nt.call(arguments),l=(st._data(this,"events")||{})[e.type]||[],c=st.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(s=st.event.handlers.call(this,e,l),n=0;(o=s[n++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,r=0;(a=o.handlers[r++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(a.namespace))&&(e.handleObj=a,e.data=a.data,i=((st.event.special[a.origType]||{}).handle||a.handler).apply(o.elem,u),i!==t&&(e.result=i)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(l.disabled!==!0||"click"!==e.type){for(i=[],r=0;u>r;r++)a=n[r],o=a.selector+" ",i[o]===t&&(i[o]=a.needsContext?st(o,this).index(l)>=0:st.find(o,this,null,[l]).length),i[o]&&i.push(a);i.length&&s.push({elem:l,handlers:i})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[st.expando])return e;var t,n,r=e,i=st.event.fixHooks[e.type]||{},o=i.props?this.props.concat(i.props):this.props;for(e=new st.Event(r),t=o.length;t--;)n=o[t],e[n]=r[n];return e.target||(e.target=r.srcElement||V),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,i.filter?i.filter(e,r):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,a=n.button,s=n.fromElement;return null==e.pageX&&null!=n.clientX&&(r=e.target.ownerDocument||V,i=r.documentElement,o=r.body,e.pageX=n.clientX+(i&&i.scrollLeft||o&&o.scrollLeft||0)-(i&&i.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(i&&i.scrollTop||o&&o.scrollTop||0)-(i&&i.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&s&&(e.relatedTarget=s===e.target?n.toElement:s),e.which||a===t||(e.which=1&a?1:2&a?3:4&a?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return st.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==V.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===V.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=st.extend(new st.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?st.event.trigger(i,null,t):st.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},st.removeEvent=V.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,n,r){var i="on"+n;e.detachEvent&&(e[i]===t&&(e[i]=null),e.detachEvent(i,r))},st.Event=function(e,n){return this instanceof st.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?u:l):this.type=e,n&&st.extend(this,n),this.timeStamp=e&&e.timeStamp||st.now(),this[st.expando]=!0,t):new st.Event(e,n)},st.Event.prototype={isDefaultPrevented:l,isPropagationStopped:l,isImmediatePropagationStopped:l,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=u,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=u,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u,this.stopPropagation()}},st.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){st.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!st.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),st.support.submitBubbles||(st.event.special.submit={setup:function(){return st.nodeName(this,"form")?!1:(st.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=st.nodeName(n,"input")||st.nodeName(n,"button")?n.form:t;r&&!st._data(r,"submitBubbles")&&(st.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),st._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&st.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return st.nodeName(this,"form")?!1:(st.event.remove(this,"._submit"),t)}}),st.support.changeBubbles||(st.event.special.change={setup:function(){return qt.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(st.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),st.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),st.event.simulate("change",this,e,!0)})),!1):(st.event.add(this,"beforeactivate._change",function(e){var t=e.target;qt.test(t.nodeName)&&!st._data(t,"changeBubbles")&&(st.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||st.event.simulate("change",this.parentNode,e,!0)}),st._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return st.event.remove(this,"._change"),!qt.test(this.nodeName)}}),st.support.focusinBubbles||st.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){st.event.simulate(t,e.target,st.event.fix(e),!0)};st.event.special[t]={setup:function(){0===n++&&V.addEventListener(e,r,!0)},teardown:function(){0===--n&&V.removeEventListener(e,r,!0)}}}),st.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(s in e)this.on(s,n,r,e[s],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=l;else if(!i)return this;return 1===o&&(a=i,i=function(e){return st().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=st.guid++)),this.each(function(){st.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,st(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=l),this.each(function(){st.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){st.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?st.event.trigger(e,n,r,!0):t},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),st.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){st.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)},_t.test(t)&&(st.event.fixHooks[t]=st.event.keyHooks),Ft.test(t)&&(st.event.fixHooks[t]=st.event.mouseHooks)}),function(e,t){function n(e){return ht.test(e+"")}function r(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>C.cacheLength&&delete e[t.shift()],e[n]=r}}function i(e){return e[P]=!0,e}function o(e){var t=L.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function a(e,t,n,r){var i,o,a,s,u,l,c,d,h,g;if((t?t.ownerDocument||t:R)!==L&&D(t),t=t||L,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!M&&!r){if(i=gt.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&O(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Q.apply(n,K.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&W.getByClassName&&t.getElementsByClassName)return Q.apply(n,K.call(t.getElementsByClassName(a),0)),n}if(W.qsa&&!q.test(e)){if(c=!0,d=P,h=t,g=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(l=f(e),(c=t.getAttribute("id"))?d=c.replace(vt,"\\$&"):t.setAttribute("id",d),d="[id='"+d+"'] ",u=l.length;u--;)l[u]=d+p(l[u]);h=dt.test(e)&&t.parentNode||t,g=l.join(",")}if(g)try{return Q.apply(n,K.call(h.querySelectorAll(g),0)),n}catch(m){}finally{c||t.removeAttribute("id")}}}return x(e.replace(at,"$1"),t,n,r)}function s(e,t){for(var n=e&&t&&e.nextSibling;n;n=n.nextSibling)if(n===t)return-1;return e?1:-1}function u(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return i(function(t){return t=+t,i(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function f(e,t){var n,r,i,o,s,u,l,c=X[e+" "];if(c)return t?0:c.slice(0);for(s=e,u=[],l=C.preFilter;s;){(!n||(r=ut.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(i=[])),n=!1,(r=lt.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(at," ")}),s=s.slice(n.length));for(o in C.filter)!(r=pt[o].exec(s))||l[o]&&!(r=l[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?a.error(e):X(e,u).slice(0)}function p(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function d(e,t,n){var r=t.dir,i=n&&"parentNode"===t.dir,o=I++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,u,l,c=$+" "+o;if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i)if(l=t[P]||(t[P]={}),(u=l[r])&&u[0]===c){if((s=u[1])===!0||s===N)return s===!0}else if(u=l[r]=[c],u[1]=e(t,n,a)||N,u[1]===!0)return!0}}function h(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function m(e,t,n,r,o,a){return r&&!r[P]&&(r=m(r)),o&&!o[P]&&(o=m(o,a)),i(function(i,a,s,u){var l,c,f,p=[],d=[],h=a.length,m=i||b(t||"*",s.nodeType?[s]:s,[]),y=!e||!i&&t?m:g(m,p,e,s,u),v=n?o||(i?e:h||r)?[]:a:y;if(n&&n(y,v,s,u),r)for(l=g(v,d),r(l,[],s,u),c=l.length;c--;)(f=l[c])&&(v[d[c]]=!(y[d[c]]=f));if(i){if(o||e){if(o){for(l=[],c=v.length;c--;)(f=v[c])&&l.push(y[c]=f);o(null,v=[],l,u)}for(c=v.length;c--;)(f=v[c])&&(l=o?Z.call(i,f):p[c])>-1&&(i[l]=!(a[l]=f))}}else v=g(v===a?v.splice(h,v.length):v),o?o(null,a,v,u):Q.apply(a,v)})}function y(e){for(var t,n,r,i=e.length,o=C.relative[e[0].type],a=o||C.relative[" "],s=o?1:0,u=d(function(e){return e===t},a,!0),l=d(function(e){return Z.call(t,e)>-1},a,!0),c=[function(e,n,r){return!o&&(r||n!==j)||((t=n).nodeType?u(e,n,r):l(e,n,r))}];i>s;s++)if(n=C.relative[e[s].type])c=[d(h(c),n)];else{if(n=C.filter[e[s].type].apply(null,e[s].matches),n[P]){for(r=++s;i>r&&!C.relative[e[r].type];r++);return m(s>1&&h(c),s>1&&p(e.slice(0,s-1)).replace(at,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&p(e))}c.push(n)}return h(c)}function v(e,t){var n=0,r=t.length>0,o=e.length>0,s=function(i,s,u,l,c){var f,p,d,h=[],m=0,y="0",v=i&&[],b=null!=c,x=j,T=i||o&&C.find.TAG("*",c&&s.parentNode||s),w=$+=null==x?1:Math.E;for(b&&(j=s!==L&&s,N=n);null!=(f=T[y]);y++){if(o&&f){for(p=0;d=e[p];p++)if(d(f,s,u)){l.push(f);break}b&&($=w,N=++n)}r&&((f=!d&&f)&&m--,i&&v.push(f))}if(m+=y,r&&y!==m){for(p=0;d=t[p];p++)d(v,h,s,u);if(i){if(m>0)for(;y--;)v[y]||h[y]||(h[y]=G.call(l));h=g(h)}Q.apply(l,h),b&&!i&&h.length>0&&m+t.length>1&&a.uniqueSort(l)}return b&&($=w,j=x),v};return r?i(s):s}function b(e,t,n){for(var r=0,i=t.length;i>r;r++)a(e,t[r],n);return n}function x(e,t,n,r){var i,o,a,s,u,l=f(e);if(!r&&1===l.length){if(o=l[0]=l[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&9===t.nodeType&&!M&&C.relative[o[1].type]){if(t=C.find.ID(a.matches[0].replace(xt,Tt),t)[0],!t)return n;e=e.slice(o.shift().value.length)}for(i=pt.needsContext.test(e)?-1:o.length-1;i>=0&&(a=o[i],!C.relative[s=a.type]);i--)if((u=C.find[s])&&(r=u(a.matches[0].replace(xt,Tt),dt.test(o[0].type)&&t.parentNode||t))){if(o.splice(i,1),e=r.length&&p(o),!e)return Q.apply(n,K.call(r,0)),n;break}}return S(e,l)(r,t,M,n,dt.test(e)),n}function T(){}var w,N,C,k,E,S,A,j,D,L,H,M,q,_,F,O,B,P="sizzle"+-new Date,R=e.document,W={},$=0,I=0,z=r(),X=r(),U=r(),V=typeof t,Y=1<<31,J=[],G=J.pop,Q=J.push,K=J.slice,Z=J.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},et="[\\x20\\t\\r\\n\\f]",tt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",nt=tt.replace("w","w#"),rt="([*^$|!~]?=)",it="\\["+et+"*("+tt+")"+et+"*(?:"+rt+et+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+nt+")|)|)"+et+"*\\]",ot=":("+tt+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+it.replace(3,8)+")*)|.*)\\)|)",at=RegExp("^"+et+"+|((?:^|[^\\\\])(?:\\\\.)*)"+et+"+$","g"),ut=RegExp("^"+et+"*,"+et+"*"),lt=RegExp("^"+et+"*([\\x20\\t\\r\\n\\f>+~])"+et+"*"),ct=RegExp(ot),ft=RegExp("^"+nt+"$"),pt={ID:RegExp("^#("+tt+")"),CLASS:RegExp("^\\.("+tt+")"),NAME:RegExp("^\\[name=['\"]?("+tt+")['\"]?\\]"),TAG:RegExp("^("+tt.replace("w","w*")+")"),ATTR:RegExp("^"+it),PSEUDO:RegExp("^"+ot),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+et+"*(even|odd|(([+-]|)(\\d*)n|)"+et+"*(?:([+-]|)"+et+"*(\\d+)|))"+et+"*\\)|)","i"),needsContext:RegExp("^"+et+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+et+"*((?:-\\d)?\\d*)"+et+"*\\)|)(?=[^-]|$)","i")},dt=/[\x20\t\r\n\f]*[+~]/,ht=/\{\s*\[native code\]\s*\}/,gt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,mt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,vt=/'|\\/g,bt=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,xt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,Tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{K.call(H.childNodes,0)[0].nodeType}catch(wt){K=function(e){for(var t,n=[];t=this[e];e++)n.push(t);return n}}E=a.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},D=a.setDocument=function(e){var r=e?e.ownerDocument||e:R;return r!==L&&9===r.nodeType&&r.documentElement?(L=r,H=r.documentElement,M=E(r),W.tagNameNoComments=o(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),W.attributes=o(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),W.getByClassName=o(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),W.getByName=o(function(e){e.id=P+0,e.innerHTML="<a name='"+P+"'></a><div name='"+P+"'></div>",H.insertBefore(e,H.firstChild);var t=r.getElementsByName&&r.getElementsByName(P).length===2+r.getElementsByName(P+0).length;return W.getIdNotName=!r.getElementById(P),H.removeChild(e),t}),C.attrHandle=o(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==V&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},W.getIdNotName?(C.find.ID=function(e,t){if(typeof t.getElementById!==V&&!M){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},C.filter.ID=function(e){var t=e.replace(xt,Tt);return function(e){return e.getAttribute("id")===t}}):(C.find.ID=function(e,n){if(typeof n.getElementById!==V&&!M){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==V&&r.getAttributeNode("id").value===e?[r]:t:[]}},C.filter.ID=function(e){var t=e.replace(xt,Tt);return function(e){var n=typeof e.getAttributeNode!==V&&e.getAttributeNode("id");return n&&n.value===t}}),C.find.TAG=W.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==V?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i];i++)1===n.nodeType&&r.push(n);return r}return o},C.find.NAME=W.getByName&&function(e,n){return typeof n.getElementsByName!==V?n.getElementsByName(name):t},C.find.CLASS=W.getByClassName&&function(e,n){return typeof n.getElementsByClassName===V||M?t:n.getElementsByClassName(e)},_=[],q=[":focus"],(W.qsa=n(r.querySelectorAll))&&(o(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||q.push("\\["+et+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||q.push(":checked")}),o(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&q.push("[*^$]="+et+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),q.push(",.*:")})),(W.matchesSelector=n(F=H.matchesSelector||H.mozMatchesSelector||H.webkitMatchesSelector||H.oMatchesSelector||H.msMatchesSelector))&&o(function(e){W.disconnectedMatch=F.call(e,"div"),F.call(e,"[s!='']:x"),_.push("!=",ot)}),q=RegExp(q.join("|")),_=RegExp(_.join("|")),O=n(H.contains)||H.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},B=H.compareDocumentPosition?function(e,t){var n;return e===t?(A=!0,0):(n=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&n||e.parentNode&&11===e.parentNode.nodeType?e===r||O(R,e)?-1:t===r||O(R,t)?1:0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var n,i=0,o=e.parentNode,a=t.parentNode,u=[e],l=[t];if(e===t)return A=!0,0;if(e.sourceIndex&&t.sourceIndex)return(~t.sourceIndex||Y)-(O(R,e)&&~e.sourceIndex||Y);if(!o||!a)return e===r?-1:t===r?1:o?-1:a?1:0;if(o===a)return s(e,t);for(n=e;n=n.parentNode;)u.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;u[i]===l[i];)i++;return i?s(u[i],l[i]):u[i]===R?-1:l[i]===R?1:0},A=!1,[0,0].sort(B),W.detectDuplicates=A,L):L},a.matches=function(e,t){return a(e,null,null,t)},a.matchesSelector=function(e,t){if((e.ownerDocument||e)!==L&&D(e),t=t.replace(bt,"='$1']"),!(!W.matchesSelector||M||_&&_.test(t)||q.test(t)))try{var n=F.call(e,t);if(n||W.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return a(t,L,null,[e]).length>0},a.contains=function(e,t){return(e.ownerDocument||e)!==L&&D(e),O(e,t)},a.attr=function(e,t){var n;return(e.ownerDocument||e)!==L&&D(e),M||(t=t.toLowerCase()),(n=C.attrHandle[t])?n(e):M||W.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},a.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},a.uniqueSort=function(e){var t,n=[],r=1,i=0;if(A=!W.detectDuplicates,e.sort(B),A){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return e},k=a.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=k(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=k(t);return n},C=a.selectors={cacheLength:50,createPseudo:i,match:pt,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xt,Tt),e[3]=(e[4]||e[5]||"").replace(xt,Tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||a.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&a.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return pt.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&ct.test(n)&&(t=f(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(xt,Tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=z[e+" "];return t||(t=RegExp("(^|"+et+")"+e+"("+et+"|$)"))&&z(e,function(e){return t.test(e.className||typeof e.getAttribute!==V&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=a.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.substr(i.length-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){for(;g;){for(f=t;f=f[g];)if(s?f.nodeName.toLowerCase()===y:1===f.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(c=m[P]||(m[P]={}),l=c[e]||[],d=l[0]===$&&l[1],p=l[0]===$&&l[2],f=d&&m.childNodes[d];f=++d&&f&&f[g]||(p=d=0)||h.pop();)if(1===f.nodeType&&++p&&f===t){c[e]=[$,d,p];break}}else if(v&&(l=(t[P]||(t[P]={}))[e])&&l[0]===$)p=l[1];else for(;(f=++d&&f&&f[g]||(p=d=0)||h.pop())&&((s?f.nodeName.toLowerCase()!==y:1!==f.nodeType)||!++p||(v&&((f[P]||(f[P]={}))[e]=[$,p]),f!==t)););return p-=i,p===r||0===p%r&&p/r>=0}}},PSEUDO:function(e,t){var n,r=C.pseudos[e]||C.setFilters[e.toLowerCase()]||a.error("unsupported pseudo: "+e);return r[P]?r(t):r.length>1?(n=[e,e,"",t],C.setFilters.hasOwnProperty(e.toLowerCase())?i(function(e,n){for(var i,o=r(e,t),a=o.length;a--;)i=Z.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:i(function(e){var t=[],n=[],r=S(e.replace(at,"$1"));return r[P]?i(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:i(function(e){return function(t){return a(e,t).length>0}}),contains:i(function(e){return function(t){return(t.textContent||t.innerText||k(t)).indexOf(e)>-1}}),lang:i(function(e){return ft.test(e||"")||a.error("unsupported lang: "+e),e=e.replace(xt,Tt).toLowerCase(),function(t){var n;do if(n=M?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===H},focus:function(e){return e===L.activeElement&&(!L.hasFocus||L.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!C.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return mt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}};for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})C.pseudos[w]=u(w);for(w in{submit:!0,reset:!0})C.pseudos[w]=l(w);S=a.compile=function(e,t){var n,r=[],i=[],o=U[e+" "];if(!o){for(t||(t=f(e)),n=t.length;n--;)o=y(t[n]),o[P]?r.push(o):i.push(o);o=U(e,v(i,r))}return o},C.pseudos.nth=C.pseudos.eq,C.filters=T.prototype=C.pseudos,C.setFilters=new T,D(),a.attr=st.attr,st.find=a,st.expr=a.selectors,st.expr[":"]=st.expr.pseudos,st.unique=a.uniqueSort,st.text=a.getText,st.isXMLDoc=a.isXML,st.contains=a.contains}(e);var Pt=/Until$/,Rt=/^(?:parents|prev(?:Until|All))/,Wt=/^.[^:#\[\.,]*$/,$t=st.expr.match.needsContext,It={children:!0,contents:!0,next:!0,prev:!0};st.fn.extend({find:function(e){var t,n,r;if("string"!=typeof e)return r=this,this.pushStack(st(e).filter(function(){for(t=0;r.length>t;t++)if(st.contains(r[t],this))return!0}));for(n=[],t=0;this.length>t;t++)st.find(e,this[t],n);return n=this.pushStack(st.unique(n)),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=st(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(st.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(f(this,e,!1))},filter:function(e){return this.pushStack(f(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?$t.test(e)?st(e,this.context).index(this[0])>=0:st.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=$t.test(e)||"string"!=typeof e?st(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:st.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}return this.pushStack(o.length>1?st.unique(o):o)},index:function(e){return e?"string"==typeof e?st.inArray(this[0],st(e)):st.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?st(e,t):st.makeArray(e&&e.nodeType?[e]:e),r=st.merge(this.get(),n);return this.pushStack(st.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),st.fn.andSelf=st.fn.addBack,st.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return st.dir(e,"parentNode")},parentsUntil:function(e,t,n){return st.dir(e,"parentNode",n)},next:function(e){return c(e,"nextSibling")},prev:function(e){return c(e,"previousSibling")
5
+ },nextAll:function(e){return st.dir(e,"nextSibling")},prevAll:function(e){return st.dir(e,"previousSibling")},nextUntil:function(e,t,n){return st.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return st.dir(e,"previousSibling",n)},siblings:function(e){return st.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return st.sibling(e.firstChild)},contents:function(e){return st.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:st.merge([],e.childNodes)}},function(e,t){st.fn[e]=function(n,r){var i=st.map(this,t,n);return Pt.test(e)||(r=n),r&&"string"==typeof r&&(i=st.filter(r,i)),i=this.length>1&&!It[e]?st.unique(i):i,this.length>1&&Rt.test(e)&&(i=i.reverse()),this.pushStack(i)}}),st.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?st.find.matchesSelector(t[0],e)?[t[0]]:[]:st.find.matches(e,t)},dir:function(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!st(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var zt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Xt=/ jQuery\d+="(?:null|\d+)"/g,Ut=RegExp("<(?:"+zt+")[\\s/>]","i"),Vt=/^\s+/,Yt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Jt=/<([\w:]+)/,Gt=/<tbody/i,Qt=/<|&#?\w+;/,Kt=/<(?:script|style|link)/i,Zt=/^(?:checkbox|radio)$/i,en=/checked\s*(?:[^=]|=\s*.checked.)/i,tn=/^$|\/(?:java|ecma)script/i,nn=/^true\/(.*)/,rn=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,on={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:st.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},an=p(V),sn=an.appendChild(V.createElement("div"));on.optgroup=on.option,on.tbody=on.tfoot=on.colgroup=on.caption=on.thead,on.th=on.td,st.fn.extend({text:function(e){return st.access(this,function(e){return e===t?st.text(this):this.empty().append((this[0]&&this[0].ownerDocument||V).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(st.isFunction(e))return this.each(function(t){st(this).wrapAll(e.call(this,t))});if(this[0]){var t=st(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return st.isFunction(e)?this.each(function(t){st(this).wrapInner(e.call(this,t))}):this.each(function(){var t=st(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=st.isFunction(e);return this.each(function(n){st(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){st.nodeName(this,"body")||st(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||st.filter(e,[n]).length>0)&&(t||1!==n.nodeType||st.cleanData(b(n)),n.parentNode&&(t&&st.contains(n.ownerDocument,n)&&m(b(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&st.cleanData(b(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&st.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return st.clone(this,e,t)})},html:function(e){return st.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(Xt,""):t;if(!("string"!=typeof e||Kt.test(e)||!st.support.htmlSerialize&&Ut.test(e)||!st.support.leadingWhitespace&&Vt.test(e)||on[(Jt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(Yt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(st.cleanData(b(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=st.isFunction(e);return t||"string"==typeof e||(e=st(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;(n&&1===this.nodeType||11===this.nodeType)&&(st(this).remove(),t?t.parentNode.insertBefore(e,t):n.appendChild(e))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=et.apply([],e);var i,o,a,s,u,l,c=0,f=this.length,p=this,m=f-1,y=e[0],v=st.isFunction(y);if(v||!(1>=f||"string"!=typeof y||st.support.checkClone)&&en.test(y))return this.each(function(i){var o=p.eq(i);v&&(e[0]=y.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(f&&(i=st.buildFragment(e,this[0].ownerDocument,!1,this),o=i.firstChild,1===i.childNodes.length&&(i=o),o)){for(n=n&&st.nodeName(o,"tr"),a=st.map(b(i,"script"),h),s=a.length;f>c;c++)u=i,c!==m&&(u=st.clone(u,!0,!0),s&&st.merge(a,b(u,"script"))),r.call(n&&st.nodeName(this[c],"table")?d(this[c],"tbody"):this[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,st.map(a,g),c=0;s>c;c++)u=a[c],tn.test(u.type||"")&&!st._data(u,"globalEval")&&st.contains(l,u)&&(u.src?st.ajax({url:u.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):st.globalEval((u.text||u.textContent||u.innerHTML||"").replace(rn,"")));i=o=null}return this}}),st.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){st.fn[e]=function(e){for(var n,r=0,i=[],o=st(e),a=o.length-1;a>=r;r++)n=r===a?this:this.clone(!0),st(o[r])[t](n),tt.apply(i,n.get());return this.pushStack(i)}}),st.extend({clone:function(e,t,n){var r,i,o,a,s,u=st.contains(e.ownerDocument,e);if(st.support.html5Clone||st.isXMLDoc(e)||!Ut.test("<"+e.nodeName+">")?s=e.cloneNode(!0):(sn.innerHTML=e.outerHTML,sn.removeChild(s=sn.firstChild)),!(st.support.noCloneEvent&&st.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||st.isXMLDoc(e)))for(r=b(s),i=b(e),a=0;null!=(o=i[a]);++a)r[a]&&v(o,r[a]);if(t)if(n)for(i=i||b(e),r=r||b(s),a=0;null!=(o=i[a]);a++)y(o,r[a]);else y(e,s);return r=b(s,"script"),r.length>0&&m(r,!u&&b(e,"script")),r=i=o=null,s},buildFragment:function(e,t,n,r){for(var i,o,a,s,u,l,c,f=e.length,d=p(t),h=[],g=0;f>g;g++)if(o=e[g],o||0===o)if("object"===st.type(o))st.merge(h,o.nodeType?[o]:o);else if(Qt.test(o)){for(s=s||d.appendChild(t.createElement("div")),a=(Jt.exec(o)||["",""])[1].toLowerCase(),u=on[a]||on._default,s.innerHTML=u[1]+o.replace(Yt,"<$1></$2>")+u[2],c=u[0];c--;)s=s.lastChild;if(!st.support.leadingWhitespace&&Vt.test(o)&&h.push(t.createTextNode(Vt.exec(o)[0])),!st.support.tbody)for(o="table"!==a||Gt.test(o)?"<table>"!==u[1]||Gt.test(o)?0:s:s.firstChild,c=o&&o.childNodes.length;c--;)st.nodeName(l=o.childNodes[c],"tbody")&&!l.childNodes.length&&o.removeChild(l);for(st.merge(h,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=d.lastChild}else h.push(t.createTextNode(o));for(s&&d.removeChild(s),st.support.appendChecked||st.grep(b(h,"input"),x),g=0;o=h[g++];)if((!r||-1===st.inArray(o,r))&&(i=st.contains(o.ownerDocument,o),s=b(d.appendChild(o),"script"),i&&m(s),n))for(c=0;o=s[c++];)tn.test(o.type||"")&&n.push(o);return s=null,d},cleanData:function(e,n){for(var r,i,o,a,s=0,u=st.expando,l=st.cache,c=st.support.deleteExpando,f=st.event.special;null!=(o=e[s]);s++)if((n||st.acceptData(o))&&(i=o[u],r=i&&l[i])){if(r.events)for(a in r.events)f[a]?st.event.remove(o,a):st.removeEvent(o,a,r.handle);l[i]&&(delete l[i],c?delete o[u]:o.removeAttribute!==t?o.removeAttribute(u):o[u]=null,K.push(i))}}});var un,ln,cn,fn=/alpha\([^)]*\)/i,pn=/opacity\s*=\s*([^)]*)/,dn=/^(top|right|bottom|left)$/,hn=/^(none|table(?!-c[ea]).+)/,gn=/^margin/,mn=RegExp("^("+ut+")(.*)$","i"),yn=RegExp("^("+ut+")(?!px)[a-z%]+$","i"),vn=RegExp("^([+-])=("+ut+")","i"),bn={BODY:"block"},xn={position:"absolute",visibility:"hidden",display:"block"},Tn={letterSpacing:0,fontWeight:400},wn=["Top","Right","Bottom","Left"],Nn=["Webkit","O","Moz","ms"];st.fn.extend({css:function(e,n){return st.access(this,function(e,n,r){var i,o,a={},s=0;if(st.isArray(n)){for(i=ln(e),o=n.length;o>s;s++)a[n[s]]=st.css(e,n[s],!1,i);return a}return r!==t?st.style(e,n,r):st.css(e,n)},e,n,arguments.length>1)},show:function(){return N(this,!0)},hide:function(){return N(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:w(this))?st(this).show():st(this).hide()})}}),st.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=un(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":st.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=st.camelCase(n),l=e.style;if(n=st.cssProps[u]||(st.cssProps[u]=T(l,u)),s=st.cssHooks[n]||st.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=vn.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(st.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||st.cssNumber[u]||(r+="px"),st.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=st.camelCase(n);return n=st.cssProps[u]||(st.cssProps[u]=T(e.style,u)),s=st.cssHooks[n]||st.cssHooks[u],s&&"get"in s&&(o=s.get(e,!0,r)),o===t&&(o=un(e,n,i)),"normal"===o&&n in Tn&&(o=Tn[n]),r?(a=parseFloat(o),r===!0||st.isNumeric(a)?a||0:o):o},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(ln=function(t){return e.getComputedStyle(t,null)},un=function(e,n,r){var i,o,a,s=r||ln(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||st.contains(e.ownerDocument,e)||(u=st.style(e,n)),yn.test(u)&&gn.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):V.documentElement.currentStyle&&(ln=function(e){return e.currentStyle},un=function(e,n,r){var i,o,a,s=r||ln(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),yn.test(u)&&!dn.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u}),st.each(["height","width"],function(e,n){st.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&hn.test(st.css(e,"display"))?st.swap(e,xn,function(){return E(e,n,i)}):E(e,n,i):t},set:function(e,t,r){var i=r&&ln(e);return C(e,t,r?k(e,n,r,st.support.boxSizing&&"border-box"===st.css(e,"boxSizing",!1,i),i):0)}}}),st.support.opacity||(st.cssHooks.opacity={get:function(e,t){return pn.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=st.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===st.trim(o.replace(fn,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=fn.test(o)?o.replace(fn,i):o+" "+i)}}),st(function(){st.support.reliableMarginRight||(st.cssHooks.marginRight={get:function(e,n){return n?st.swap(e,{display:"inline-block"},un,[e,"marginRight"]):t}}),!st.support.pixelPosition&&st.fn.position&&st.each(["top","left"],function(e,n){st.cssHooks[n]={get:function(e,r){return r?(r=un(e,n),yn.test(r)?st(e).position()[n]+"px":r):t}}})}),st.expr&&st.expr.filters&&(st.expr.filters.hidden=function(e){return 0===e.offsetWidth&&0===e.offsetHeight||!st.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||st.css(e,"display"))},st.expr.filters.visible=function(e){return!st.expr.filters.hidden(e)}),st.each({margin:"",padding:"",border:"Width"},function(e,t){st.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+wn[r]+t]=o[r]||o[r-2]||o[0];return i}},gn.test(e)||(st.cssHooks[e+t].set=C)});var Cn=/%20/g,kn=/\[\]$/,En=/\r?\n/g,Sn=/^(?:submit|button|image|reset)$/i,An=/^(?:input|select|textarea|keygen)/i;st.fn.extend({serialize:function(){return st.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=st.prop(this,"elements");return e?st.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!st(this).is(":disabled")&&An.test(this.nodeName)&&!Sn.test(e)&&(this.checked||!Zt.test(e))}).map(function(e,t){var n=st(this).val();return null==n?null:st.isArray(n)?st.map(n,function(e){return{name:t.name,value:e.replace(En,"\r\n")}}):{name:t.name,value:n.replace(En,"\r\n")}}).get()}}),st.param=function(e,n){var r,i=[],o=function(e,t){t=st.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=st.ajaxSettings&&st.ajaxSettings.traditional),st.isArray(e)||e.jquery&&!st.isPlainObject(e))st.each(e,function(){o(this.name,this.value)});else for(r in e)j(r,e[r],n,o);return i.join("&").replace(Cn,"+")};var jn,Dn,Ln=st.now(),Hn=/\?/,Mn=/#.*$/,qn=/([?&])_=[^&]*/,_n=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Fn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,On=/^(?:GET|HEAD)$/,Bn=/^\/\//,Pn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Rn=st.fn.load,Wn={},$n={},In="*/".concat("*");try{Dn=Y.href}catch(zn){Dn=V.createElement("a"),Dn.href="",Dn=Dn.href}jn=Pn.exec(Dn.toLowerCase())||[],st.fn.load=function(e,n,r){if("string"!=typeof e&&Rn)return Rn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),st.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(o="POST"),s.length>0&&st.ajax({url:e,type:o,dataType:"html",data:n}).done(function(e){a=arguments,s.html(i?st("<div>").append(st.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,a||[e.responseText,t,e])}),this},st.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){st.fn[t]=function(e){return this.on(t,e)}}),st.each(["get","post"],function(e,n){st[n]=function(e,r,i,o){return st.isFunction(r)&&(o=o||i,i=r,r=t),st.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),st.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Dn,type:"GET",isLocal:Fn.test(jn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":In,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":st.parseJSON,"text xml":st.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?H(H(e,st.ajaxSettings),t):H(st.ajaxSettings,e)},ajaxPrefilter:D(Wn),ajaxTransport:D($n),ajax:function(e,n){function r(e,n,r,s){var l,f,v,b,T,N=n;2!==x&&(x=2,u&&clearTimeout(u),i=t,a=s||"",w.readyState=e>0?4:0,r&&(b=M(p,w,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=w.getResponseHeader("Last-Modified"),T&&(st.lastModified[o]=T),T=w.getResponseHeader("etag"),T&&(st.etag[o]=T)),304===e?(l=!0,N="notmodified"):(l=q(p,b),N=l.state,f=l.data,v=l.error,l=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),w.status=e,w.statusText=(n||N)+"",l?g.resolveWith(d,[f,N,w]):g.rejectWith(d,[w,N,v]),w.statusCode(y),y=t,c&&h.trigger(l?"ajaxSuccess":"ajaxError",[w,p,l?f:v]),m.fireWith(d,[w,N]),c&&(h.trigger("ajaxComplete",[w,p]),--st.active||st.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var i,o,a,s,u,l,c,f,p=st.ajaxSetup({},n),d=p.context||p,h=p.context&&(d.nodeType||d.jquery)?st(d):st.event,g=st.Deferred(),m=st.Callbacks("once memory"),y=p.statusCode||{},v={},b={},x=0,T="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!s)for(s={};t=_n.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=b[n]=b[n]||e,v[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)y[t]=[y[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||T;return i&&i.abort(t),r(0,t),this}};if(g.promise(w).complete=m.add,w.success=w.done,w.error=w.fail,p.url=((e||p.url||Dn)+"").replace(Mn,"").replace(Bn,jn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=st.trim(p.dataType||"*").toLowerCase().match(lt)||[""],null==p.crossDomain&&(l=Pn.exec(p.url.toLowerCase()),p.crossDomain=!(!l||l[1]===jn[1]&&l[2]===jn[2]&&(l[3]||("http:"===l[1]?80:443))==(jn[3]||("http:"===jn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=st.param(p.data,p.traditional)),L(Wn,p,n,w),2===x)return w;c=p.global,c&&0===st.active++&&st.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!On.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(Hn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=qn.test(o)?o.replace(qn,"$1_="+Ln++):o+(Hn.test(o)?"&":"?")+"_="+Ln++)),p.ifModified&&(st.lastModified[o]&&w.setRequestHeader("If-Modified-Since",st.lastModified[o]),st.etag[o]&&w.setRequestHeader("If-None-Match",st.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&w.setRequestHeader("Content-Type",p.contentType),w.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+In+"; q=0.01":""):p.accepts["*"]);for(f in p.headers)w.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(p.beforeSend.call(d,w,p)===!1||2===x))return w.abort();T="abort";for(f in{success:1,error:1,complete:1})w[f](p[f]);if(i=L($n,p,n,w)){w.readyState=1,c&&h.trigger("ajaxSend",[w,p]),p.async&&p.timeout>0&&(u=setTimeout(function(){w.abort("timeout")},p.timeout));try{x=1,i.send(v,r)}catch(N){if(!(2>x))throw N;r(-1,N)}}else r(-1,"No Transport");return w},getScript:function(e,n){return st.get(e,t,n,"script")},getJSON:function(e,t,n){return st.get(e,t,n,"json")}}),st.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return st.globalEval(e),e}}}),st.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),st.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=V.head||st("head")[0]||V.documentElement;return{send:function(t,i){n=V.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Xn=[],Un=/(=)\?(?=&|$)|\?\?/;st.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xn.pop()||st.expando+"_"+Ln++;return this[e]=!0,e}}),st.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Un.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Un.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=st.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Un,"$1"+o):n.jsonp!==!1&&(n.url+=(Hn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||st.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Xn.push(o)),s&&st.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Vn,Yn,Jn=0,Gn=e.ActiveXObject&&function(){var e;for(e in Vn)Vn[e](t,!0)};st.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&_()||F()}:_,Yn=st.ajaxSettings.xhr(),st.support.cors=!!Yn&&"withCredentials"in Yn,Yn=st.support.ajax=!!Yn,Yn&&st.ajaxTransport(function(n){if(!n.crossDomain||st.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,f,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=st.noop,Gn&&delete Vn[a]),i)4!==u.readyState&&u.abort();else{f={},s=u.status,p=u.responseXML,c=u.getAllResponseHeaders(),p&&p.documentElement&&(f.xml=p),"string"==typeof u.responseText&&(f.text=u.responseText);try{l=u.statusText}catch(d){l=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=f.text?200:404}}catch(h){i||o(-1,h)}f&&o(s,l,f,c)},n.async?4===u.readyState?setTimeout(r):(a=++Jn,Gn&&(Vn||(Vn={},st(e).unload(Gn)),Vn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Qn,Kn,Zn=/^(?:toggle|show|hide)$/,er=RegExp("^(?:([+-])=|)("+ut+")([a-z%]*)$","i"),tr=/queueHooks$/,nr=[W],rr={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=er.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(st.cssNumber[e]?"":"px"),"px"!==r&&s){s=st.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,st.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};st.Animation=st.extend(P,{tweener:function(e,t){st.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],rr[n]=rr[n]||[],rr[n].unshift(t)},prefilter:function(e,t){t?nr.unshift(e):nr.push(e)}}),st.Tween=$,$.prototype={constructor:$,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(st.cssNumber[n]?"":"px")},cur:function(){var e=$.propHooks[this.prop];return e&&e.get?e.get(this):$.propHooks._default.get(this)},run:function(e){var t,n=$.propHooks[this.prop];return this.pos=t=this.options.duration?st.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):$.propHooks._default.set(this),this}},$.prototype.init.prototype=$.prototype,$.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=st.css(e.elem,e.prop,"auto"),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){st.fx.step[e.prop]?st.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[st.cssProps[e.prop]]||st.cssHooks[e.prop])?st.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},$.propHooks.scrollTop=$.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},st.each(["toggle","show","hide"],function(e,t){var n=st.fn[t];st.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(I(t,!0),e,r,i)}}),st.fn.extend({fadeTo:function(e,t,n,r){return this.filter(w).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=st.isEmptyObject(e),o=st.speed(t,n,r),a=function(){var t=P(this,st.extend({},e),o);a.finish=function(){t.stop(!0)},(i||st._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=st.timers,a=st._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&tr.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&st.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=st._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=st.timers,a=r?r.length:0;for(n.finish=!0,st.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),st.each({slideDown:I("show"),slideUp:I("hide"),slideToggle:I("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){st.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),st.speed=function(e,t,n){var r=e&&"object"==typeof e?st.extend({},e):{complete:n||!n&&t||st.isFunction(e)&&e,duration:e,easing:n&&t||t&&!st.isFunction(t)&&t};return r.duration=st.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in st.fx.speeds?st.fx.speeds[r.duration]:st.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){st.isFunction(r.old)&&r.old.call(this),r.queue&&st.dequeue(this,r.queue)},r},st.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},st.timers=[],st.fx=$.prototype.init,st.fx.tick=function(){var e,n=st.timers,r=0;for(Qn=st.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||st.fx.stop(),Qn=t},st.fx.timer=function(e){e()&&st.timers.push(e)&&st.fx.start()},st.fx.interval=13,st.fx.start=function(){Kn||(Kn=setInterval(st.fx.tick,st.fx.interval))},st.fx.stop=function(){clearInterval(Kn),Kn=null},st.fx.speeds={slow:600,fast:200,_default:400},st.fx.step={},st.expr&&st.expr.filters&&(st.expr.filters.animated=function(e){return st.grep(st.timers,function(t){return e===t.elem}).length}),st.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){st.offset.setOffset(this,e,t)});var n,r,i={top:0,left:0},o=this[0],a=o&&o.ownerDocument;if(a)return n=a.documentElement,st.contains(n,o)?(o.getBoundingClientRect!==t&&(i=o.getBoundingClientRect()),r=z(a),{top:i.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:i.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):i},st.offset={setOffset:function(e,t,n){var r=st.css(e,"position");"static"===r&&(e.style.position="relative");var i,o,a=st(e),s=a.offset(),u=st.css(e,"top"),l=st.css(e,"left"),c=("absolute"===r||"fixed"===r)&&st.inArray("auto",[u,l])>-1,f={},p={};c?(p=a.position(),i=p.top,o=p.left):(i=parseFloat(u)||0,o=parseFloat(l)||0),st.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(f.top=t.top-s.top+i),null!=t.left&&(f.left=t.left-s.left+o),"using"in t?t.using.call(e,f):a.css(f)}},st.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===st.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),st.nodeName(e[0],"html")||(n=e.offset()),n.top+=st.css(e[0],"borderTopWidth",!0),n.left+=st.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-st.css(r,"marginTop",!0),left:t.left-n.left-st.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||V.documentElement;e&&!st.nodeName(e,"html")&&"static"===st.css(e,"position");)e=e.offsetParent;return e||V.documentElement})}}),st.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);st.fn[e]=function(i){return st.access(this,function(e,i,o){var a=z(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?st(a).scrollLeft():o,r?o:st(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}}),st.each({Height:"height",Width:"width"},function(e,n){st.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){st.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return st.access(this,function(n,r,i){var o;return st.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?st.css(n,r,s):st.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=st,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return st})})(window);
6
+ //@ sourceMappingURL=jquery.min.map
7
+ $.noConflict();
8
+ }
9
+ //raphael
10
+ // ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” \\
11
+ // ā”‚ RaphaĆ«l 2.1.0 - JavaScript Vector Library ā”‚ \\
12
+ // ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤ \\
13
+ // ā”‚ Copyright Ā© 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com) ā”‚ \\
14
+ // ā”‚ Copyright Ā© 2008-2012 Sencha Labs (http://sencha.com) ā”‚ \\
15
+ // ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤ \\
16
+ // ā”‚ Licensed under the MIT (http://raphaeljs.com/license.html) license.ā”‚ \\
17
+ // ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ \\
18
+
19
+ (function(a){var b="0.3.4",c="hasOwnProperty",d=/[\.\/]/,e="*",f=function(){},g=function(a,b){return a-b},h,i,j={n:{}},k=function(a,b){var c=j,d=i,e=Array.prototype.slice.call(arguments,2),f=k.listeners(a),l=0,m=!1,n,o=[],p={},q=[],r=h,s=[];h=a,i=0;for(var t=0,u=f.length;t<u;t++)"zIndex"in f[t]&&(o.push(f[t].zIndex),f[t].zIndex<0&&(p[f[t].zIndex]=f[t]));o.sort(g);while(o[l]<0){n=p[o[l++]],q.push(n.apply(b,e));if(i){i=d;return q}}for(t=0;t<u;t++){n=f[t];if("zIndex"in n)if(n.zIndex==o[l]){q.push(n.apply(b,e));if(i)break;do{l++,n=p[o[l]],n&&q.push(n.apply(b,e));if(i)break}while(n)}else p[n.zIndex]=n;else{q.push(n.apply(b,e));if(i)break}}i=d,h=r;return q.length?q:null};k.listeners=function(a){var b=a.split(d),c=j,f,g,h,i,k,l,m,n,o=[c],p=[];for(i=0,k=b.length;i<k;i++){n=[];for(l=0,m=o.length;l<m;l++){c=o[l].n,g=[c[b[i]],c[e]],h=2;while(h--)f=g[h],f&&(n.push(f),p=p.concat(f.f||[]))}o=n}return p},k.on=function(a,b){var c=a.split(d),e=j;for(var g=0,h=c.length;g<h;g++)e=e.n,!e[c[g]]&&(e[c[g]]={n:{}}),e=e[c[g]];e.f=e.f||[];for(g=0,h=e.f.length;g<h;g++)if(e.f[g]==b)return f;e.f.push(b);return function(a){+a==+a&&(b.zIndex=+a)}},k.stop=function(){i=1},k.nt=function(a){if(a)return(new RegExp("(?:\\.|\\/|^)"+a+"(?:\\.|\\/|$)")).test(h);return h},k.off=k.unbind=function(a,b){var f=a.split(d),g,h,i,k,l,m,n,o=[j];for(k=0,l=f.length;k<l;k++)for(m=0;m<o.length;m+=i.length-2){i=[m,1],g=o[m].n;if(f[k]!=e)g[f[k]]&&i.push(g[f[k]]);else for(h in g)g[c](h)&&i.push(g[h]);o.splice.apply(o,i)}for(k=0,l=o.length;k<l;k++){g=o[k];while(g.n){if(b){if(g.f){for(m=0,n=g.f.length;m<n;m++)if(g.f[m]==b){g.f.splice(m,1);break}!g.f.length&&delete g.f}for(h in g.n)if(g.n[c](h)&&g.n[h].f){var p=g.n[h].f;for(m=0,n=p.length;m<n;m++)if(p[m]==b){p.splice(m,1);break}!p.length&&delete g.n[h].f}}else{delete g.f;for(h in g.n)g.n[c](h)&&g.n[h].f&&delete g.n[h].f}g=g.n}}},k.once=function(a,b){var c=function(){var d=b.apply(this,arguments);k.unbind(a,c);return d};return k.on(a,c)},k.version=b,k.toString=function(){return"You are running Eve "+b},typeof module!="undefined"&&module.exports?module.exports=k:typeof define!="undefined"?define("eve",[],function(){return k}):a.eve=k})(this),function(){function cF(a){for(var b=0;b<cy.length;b++)cy[b].el.paper==a&&cy.splice(b--,1)}function cE(b,d,e,f,h,i){e=Q(e);var j,k,l,m=[],o,p,q,t=b.ms,u={},v={},w={};if(f)for(y=0,z=cy.length;y<z;y++){var x=cy[y];if(x.el.id==d.id&&x.anim==b){x.percent!=e?(cy.splice(y,1),l=1):k=x,d.attr(x.totalOrigin);break}}else f=+v;for(var y=0,z=b.percents.length;y<z;y++){if(b.percents[y]==e||b.percents[y]>f*b.top){e=b.percents[y],p=b.percents[y-1]||0,t=t/b.top*(e-p),o=b.percents[y+1],j=b.anim[e];break}f&&d.attr(b.anim[b.percents[y]])}if(!!j){if(!k){for(var A in j)if(j[g](A))if(U[g](A)||d.paper.customAttributes[g](A)){u[A]=d.attr(A),u[A]==null&&(u[A]=T[A]),v[A]=j[A];switch(U[A]){case C:w[A]=(v[A]-u[A])/t;break;case"colour":u[A]=a.getRGB(u[A]);var B=a.getRGB(v[A]);w[A]={r:(B.r-u[A].r)/t,g:(B.g-u[A].g)/t,b:(B.b-u[A].b)/t};break;case"path":var D=bR(u[A],v[A]),E=D[1];u[A]=D[0],w[A]=[];for(y=0,z=u[A].length;y<z;y++){w[A][y]=[0];for(var F=1,G=u[A][y].length;F<G;F++)w[A][y][F]=(E[y][F]-u[A][y][F])/t}break;case"transform":var H=d._,I=ca(H[A],v[A]);if(I){u[A]=I.from,v[A]=I.to,w[A]=[],w[A].real=!0;for(y=0,z=u[A].length;y<z;y++){w[A][y]=[u[A][y][0]];for(F=1,G=u[A][y].length;F<G;F++)w[A][y][F]=(v[A][y][F]-u[A][y][F])/t}}else{var J=d.matrix||new cb,K={_:{transform:H.transform},getBBox:function(){return d.getBBox(1)}};u[A]=[J.a,J.b,J.c,J.d,J.e,J.f],b$(K,v[A]),v[A]=K._.transform,w[A]=[(K.matrix.a-J.a)/t,(K.matrix.b-J.b)/t,(K.matrix.c-J.c)/t,(K.matrix.d-J.d)/t,(K.matrix.e-J.e)/t,(K.matrix.f-J.f)/t]}break;case"csv":var L=r(j[A])[s](c),M=r(u[A])[s](c);if(A=="clip-rect"){u[A]=M,w[A]=[],y=M.length;while(y--)w[A][y]=(L[y]-u[A][y])/t}v[A]=L;break;default:L=[][n](j[A]),M=[][n](u[A]),w[A]=[],y=d.paper.customAttributes[A].length;while(y--)w[A][y]=((L[y]||0)-(M[y]||0))/t}}var O=j.easing,P=a.easing_formulas[O];if(!P){P=r(O).match(N);if(P&&P.length==5){var R=P;P=function(a){return cC(a,+R[1],+R[2],+R[3],+R[4],t)}}else P=bf}q=j.start||b.start||+(new Date),x={anim:b,percent:e,timestamp:q,start:q+(b.del||0),status:0,initstatus:f||0,stop:!1,ms:t,easing:P,from:u,diff:w,to:v,el:d,callback:j.callback,prev:p,next:o,repeat:i||b.times,origin:d.attr(),totalOrigin:h},cy.push(x);if(f&&!k&&!l){x.stop=!0,x.start=new Date-t*f;if(cy.length==1)return cA()}l&&(x.start=new Date-x.ms*f),cy.length==1&&cz(cA)}else k.initstatus=f,k.start=new Date-k.ms*f;eve("raphael.anim.start."+d.id,d,b)}}function cD(a,b){var c=[],d={};this.ms=b,this.times=1;if(a){for(var e in a)a[g](e)&&(d[Q(e)]=a[e],c.push(Q(e)));c.sort(bd)}this.anim=d,this.top=c[c.length-1],this.percents=c}function cC(a,b,c,d,e,f){function o(a,b){var c,d,e,f,j,k;for(e=a,k=0;k<8;k++){f=m(e)-a;if(z(f)<b)return e;j=(3*i*e+2*h)*e+g;if(z(j)<1e-6)break;e=e-f/j}c=0,d=1,e=a;if(e<c)return c;if(e>d)return d;while(c<d){f=m(e);if(z(f-a)<b)return e;a>f?c=e:d=e,e=(d-c)/2+c}return e}function n(a,b){var c=o(a,b);return((l*c+k)*c+j)*c}function m(a){return((i*a+h)*a+g)*a}var g=3*b,h=3*(d-b)-g,i=1-g-h,j=3*c,k=3*(e-c)-j,l=1-j-k;return n(a,1/(200*f))}function cq(){return this.x+q+this.y+q+this.width+" Ć— "+this.height}function cp(){return this.x+q+this.y}function cb(a,b,c,d,e,f){a!=null?(this.a=+a,this.b=+b,this.c=+c,this.d=+d,this.e=+e,this.f=+f):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}function bH(b,c,d){b=a._path2curve(b),c=a._path2curve(c);var e,f,g,h,i,j,k,l,m,n,o=d?0:[];for(var p=0,q=b.length;p<q;p++){var r=b[p];if(r[0]=="M")e=i=r[1],f=j=r[2];else{r[0]=="C"?(m=[e,f].concat(r.slice(1)),e=m[6],f=m[7]):(m=[e,f,e,f,i,j,i,j],e=i,f=j);for(var s=0,t=c.length;s<t;s++){var u=c[s];if(u[0]=="M")g=k=u[1],h=l=u[2];else{u[0]=="C"?(n=[g,h].concat(u.slice(1)),g=n[6],h=n[7]):(n=[g,h,g,h,k,l,k,l],g=k,h=l);var v=bG(m,n,d);if(d)o+=v;else{for(var w=0,x=v.length;w<x;w++)v[w].segment1=p,v[w].segment2=s,v[w].bez1=m,v[w].bez2=n;o=o.concat(v)}}}}}return o}function bG(b,c,d){var e=a.bezierBBox(b),f=a.bezierBBox(c);if(!a.isBBoxIntersect(e,f))return d?0:[];var g=bB.apply(0,b),h=bB.apply(0,c),i=~~(g/5),j=~~(h/5),k=[],l=[],m={},n=d?0:[];for(var o=0;o<i+1;o++){var p=a.findDotsAtSegment.apply(a,b.concat(o/i));k.push({x:p.x,y:p.y,t:o/i})}for(o=0;o<j+1;o++)p=a.findDotsAtSegment.apply(a,c.concat(o/j)),l.push({x:p.x,y:p.y,t:o/j});for(o=0;o<i;o++)for(var q=0;q<j;q++){var r=k[o],s=k[o+1],t=l[q],u=l[q+1],v=z(s.x-r.x)<.001?"y":"x",w=z(u.x-t.x)<.001?"y":"x",x=bD(r.x,r.y,s.x,s.y,t.x,t.y,u.x,u.y);if(x){if(m[x.x.toFixed(4)]==x.y.toFixed(4))continue;m[x.x.toFixed(4)]=x.y.toFixed(4);var y=r.t+z((x[v]-r[v])/(s[v]-r[v]))*(s.t-r.t),A=t.t+z((x[w]-t[w])/(u[w]-t[w]))*(u.t-t.t);y>=0&&y<=1&&A>=0&&A<=1&&(d?n++:n.push({x:x.x,y:x.y,t1:y,t2:A}))}}return n}function bF(a,b){return bG(a,b,1)}function bE(a,b){return bG(a,b)}function bD(a,b,c,d,e,f,g,h){if(!(x(a,c)<y(e,g)||y(a,c)>x(e,g)||x(b,d)<y(f,h)||y(b,d)>x(f,h))){var i=(a*d-b*c)*(e-g)-(a-c)*(e*h-f*g),j=(a*d-b*c)*(f-h)-(b-d)*(e*h-f*g),k=(a-c)*(f-h)-(b-d)*(e-g);if(!k)return;var l=i/k,m=j/k,n=+l.toFixed(2),o=+m.toFixed(2);if(n<+y(a,c).toFixed(2)||n>+x(a,c).toFixed(2)||n<+y(e,g).toFixed(2)||n>+x(e,g).toFixed(2)||o<+y(b,d).toFixed(2)||o>+x(b,d).toFixed(2)||o<+y(f,h).toFixed(2)||o>+x(f,h).toFixed(2))return;return{x:l,y:m}}}function bC(a,b,c,d,e,f,g,h,i){if(!(i<0||bB(a,b,c,d,e,f,g,h)<i)){var j=1,k=j/2,l=j-k,m,n=.01;m=bB(a,b,c,d,e,f,g,h,l);while(z(m-i)>n)k/=2,l+=(m<i?1:-1)*k,m=bB(a,b,c,d,e,f,g,h,l);return l}}function bB(a,b,c,d,e,f,g,h,i){i==null&&(i=1),i=i>1?1:i<0?0:i;var j=i/2,k=12,l=[-0.1252,.1252,-0.3678,.3678,-0.5873,.5873,-0.7699,.7699,-0.9041,.9041,-0.9816,.9816],m=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],n=0;for(var o=0;o<k;o++){var p=j*l[o]+j,q=bA(p,a,c,e,g),r=bA(p,b,d,f,h),s=q*q+r*r;n+=m[o]*w.sqrt(s)}return j*n}function bA(a,b,c,d,e){var f=-3*b+9*c-9*d+3*e,g=a*f+6*b-12*c+6*d;return a*g-3*b+3*c}function by(a,b){var c=[];for(var d=0,e=a.length;e-2*!b>d;d+=2){var f=[{x:+a[d-2],y:+a[d-1]},{x:+a[d],y:+a[d+1]},{x:+a[d+2],y:+a[d+3]},{x:+a[d+4],y:+a[d+5]}];b?d?e-4==d?f[3]={x:+a[0],y:+a[1]}:e-2==d&&(f[2]={x:+a[0],y:+a[1]},f[3]={x:+a[2],y:+a[3]}):f[0]={x:+a[e-2],y:+a[e-1]}:e-4==d?f[3]=f[2]:d||(f[0]={x:+a[d],y:+a[d+1]}),c.push(["C",(-f[0].x+6*f[1].x+f[2].x)/6,(-f[0].y+6*f[1].y+f[2].y)/6,(f[1].x+6*f[2].x-f[3].x)/6,(f[1].y+6*f[2].y-f[3].y)/6,f[2].x,f[2].y])}return c}function bx(){return this.hex}function bv(a,b,c){function d(){var e=Array.prototype.slice.call(arguments,0),f=e.join("ā€"),h=d.cache=d.cache||{},i=d.count=d.count||[];if(h[g](f)){bu(i,f);return c?c(h[f]):h[f]}i.length>=1e3&&delete h[i.shift()],i.push(f),h[f]=a[m](b,e);return c?c(h[f]):h[f]}return d}function bu(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return a.push(a.splice(c,1)[0])}function bm(a){if(Object(a)!==a)return a;var b=new a.constructor;for(var c in a)a[g](c)&&(b[c]=bm(a[c]));return b}function a(c){if(a.is(c,"function"))return b?c():eve.on("raphael.DOMload",c);if(a.is(c,E))return a._engine.create[m](a,c.splice(0,3+a.is(c[0],C))).add(c);var d=Array.prototype.slice.call(arguments,0);if(a.is(d[d.length-1],"function")){var e=d.pop();return b?e.call(a._engine.create[m](a,d)):eve.on("raphael.DOMload",function(){e.call(a._engine.create[m](a,d))})}return a._engine.create[m](a,arguments)}a.version="2.1.0",a.eve=eve;var b,c=/[, ]+/,d={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},e=/\{(\d+)\}/g,f="prototype",g="hasOwnProperty",h={doc:document,win:window},i={was:Object.prototype[g].call(h.win,"Raphael"),is:h.win.Raphael},j=function(){this.ca=this.customAttributes={}},k,l="appendChild",m="apply",n="concat",o="createTouch"in h.doc,p="",q=" ",r=String,s="split",t="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[s](q),u={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},v=r.prototype.toLowerCase,w=Math,x=w.max,y=w.min,z=w.abs,A=w.pow,B=w.PI,C="number",D="string",E="array",F="toString",G="fill",H=Object.prototype.toString,I={},J="push",K=a._ISURL=/^url\(['"]?([^\)]+?)['"]?\)$/i,L=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,M={NaN:1,Infinity:1,"-Infinity":1},N=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,O=w.round,P="setAttribute",Q=parseFloat,R=parseInt,S=r.prototype.toUpperCase,T=a._availableAttrs={"arrow-end":"none","arrow-start":"none",blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/","letter-spacing":0,opacity:1,path:"M0,0",r:0,rx:0,ry:0,src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",transform:"",width:0,x:0,y:0},U=a._availableAnimAttrs={blur:C,"clip-rect":"csv",cx:C,cy:C,fill:"colour","fill-opacity":C,"font-size":C,height:C,opacity:C,path:"path",r:C,rx:C,ry:C,stroke:"colour","stroke-opacity":C,"stroke-width":C,transform:"transform",width:C,x:C,y:C},V=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]/g,W=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/,X={hs:1,rg:1},Y=/,?([achlmqrstvxz]),?/gi,Z=/([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/ig,$=/([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/ig,_=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/ig,ba=a._radial_gradient=/^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/,bb={},bc=function(a,b){return a.key-b.key},bd=function(a,b){return Q(a)-Q(b)},be=function(){},bf=function(a){return a},bg=a._rectPath=function(a,b,c,d,e){if(e)return[["M",a+e,b],["l",c-e*2,0],["a",e,e,0,0,1,e,e],["l",0,d-e*2],["a",e,e,0,0,1,-e,e],["l",e*2-c,0],["a",e,e,0,0,1,-e,-e],["l",0,e*2-d],["a",e,e,0,0,1,e,-e],["z"]];return[["M",a,b],["l",c,0],["l",0,d],["l",-c,0],["z"]]},bh=function(a,b,c,d){d==null&&(d=c);return[["M",a,b],["m",0,-d],["a",c,d,0,1,1,0,2*d],["a",c,d,0,1,1,0,-2*d],["z"]]},bi=a._getPath={path:function(a){return a.attr("path")},circle:function(a){var b=a.attrs;return bh(b.cx,b.cy,b.r)},ellipse:function(a){var b=a.attrs;return bh(b.cx,b.cy,b.rx,b.ry)},rect:function(a){var b=a.attrs;return bg(b.x,b.y,b.width,b.height,b.r)},image:function(a){var b=a.attrs;return bg(b.x,b.y,b.width,b.height)},text:function(a){var b=a._getBBox();return bg(b.x,b.y,b.width,b.height)}},bj=a.mapPath=function(a,b){if(!b)return a;var c,d,e,f,g,h,i;a=bR(a);for(e=0,g=a.length;e<g;e++){i=a[e];for(f=1,h=i.length;f<h;f+=2)c=b.x(i[f],i[f+1]),d=b.y(i[f],i[f+1]),i[f]=c,i[f+1]=d}return a};a._g=h,a.type=h.win.SVGAngle||h.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML";if(a.type=="VML"){var bk=h.doc.createElement("div"),bl;bk.innerHTML='<v:shape adj="1"/>',bl=bk.firstChild,bl.style.behavior="url(#default#VML)";if(!bl||typeof bl.adj!="object")return a.type=p;bk=null}a.svg=!(a.vml=a.type=="VML"),a._Paper=j,a.fn=k=j.prototype=a.prototype,a._id=0,a._oid=0,a.is=function(a,b){b=v.call(b);if(b=="finite")return!M[g](+a);if(b=="array")return a instanceof Array;return b=="null"&&a===null||b==typeof a&&a!==null||b=="object"&&a===Object(a)||b=="array"&&Array.isArray&&Array.isArray(a)||H.call(a).slice(8,-1).toLowerCase()==b},a.angle=function(b,c,d,e,f,g){if(f==null){var h=b-d,i=c-e;if(!h&&!i)return 0;return(180+w.atan2(-i,-h)*180/B+360)%360}return a.angle(b,c,f,g)-a.angle(d,e,f,g)},a.rad=function(a){return a%360*B/180},a.deg=function(a){return a*180/B%360},a.snapTo=function(b,c,d){d=a.is(d,"finite")?d:10;if(a.is(b,E)){var e=b.length;while(e--)if(z(b[e]-c)<=d)return b[e]}else{b=+b;var f=c%b;if(f<d)return c-f;if(f>b-d)return c-f+b}return c};var bn=a.createUUID=function(a,b){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,b).toUpperCase()}}(/[xy]/g,function(a){var b=w.random()*16|0,c=a=="x"?b:b&3|8;return c.toString(16)});a.setWindow=function(b){eve("raphael.setWindow",a,h.win,b),h.win=b,h.doc=h.win.document,a._engine.initWin&&a._engine.initWin(h.win)};var bo=function(b){if(a.vml){var c=/^\s+|\s+$/g,d;try{var e=new ActiveXObject("htmlfile");e.write("<body>"),e.close(),d=e.body}catch(f){d=createPopup().document.body}var g=d.createTextRange();bo=bv(function(a){try{d.style.color=r(a).replace(c,p);var b=g.queryCommandValue("ForeColor");b=(b&255)<<16|b&65280|(b&16711680)>>>16;return"#"+("000000"+b.toString(16)).slice(-6)}catch(e){return"none"}})}else{var i=h.doc.createElement("i");i.title="RaphaĆ«l Colour Picker",i.style.display="none",h.doc.body.appendChild(i),bo=bv(function(a){i.style.color=a;return h.doc.defaultView.getComputedStyle(i,p).getPropertyValue("color")})}return bo(b)},bp=function(){return"hsb("+[this.h,this.s,this.b]+")"},bq=function(){return"hsl("+[this.h,this.s,this.l]+")"},br=function(){return this.hex},bs=function(b,c,d){c==null&&a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b&&(d=b.b,c=b.g,b=b.r);if(c==null&&a.is(b,D)){var e=a.getRGB(b);b=e.r,c=e.g,d=e.b}if(b>1||c>1||d>1)b/=255,c/=255,d/=255;return[b,c,d]},bt=function(b,c,d,e){b*=255,c*=255,d*=255;var f={r:b,g:c,b:d,hex:a.rgb(b,c,d),toString:br};a.is(e,"finite")&&(f.opacity=e);return f};a.color=function(b){var c;a.is(b,"object")&&"h"in b&&"s"in b&&"b"in b?(c=a.hsb2rgb(b),b.r=c.r,b.g=c.g,b.b=c.b,b.hex=c.hex):a.is(b,"object")&&"h"in b&&"s"in b&&"l"in b?(c=a.hsl2rgb(b),b.r=c.r,b.g=c.g,b.b=c.b,b.hex=c.hex):(a.is(b,"string")&&(b=a.getRGB(b)),a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b?(c=a.rgb2hsl(b),b.h=c.h,b.s=c.s,b.l=c.l,c=a.rgb2hsb(b),b.v=c.b):(b={hex:"none"},b.r=b.g=b.b=b.h=b.s=b.v=b.l=-1)),b.toString=br;return b},a.hsb2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"b"in a&&(c=a.b,b=a.s,a=a.h,d=a.o),a*=360;var e,f,g,h,i;a=a%360/60,i=c*b,h=i*(1-z(a%2-1)),e=f=g=c-i,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a];return bt(e,f,g,d)},a.hsl2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"l"in a&&(c=a.l,b=a.s,a=a.h);if(a>1||b>1||c>1)a/=360,b/=100,c/=100;a*=360;var e,f,g,h,i;a=a%360/60,i=2*b*(c<.5?c:1-c),h=i*(1-z(a%2-1)),e=f=g=c-i/2,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a];return bt(e,f,g,d)},a.rgb2hsb=function(a,b,c){c=bs(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g;f=x(a,b,c),g=f-y(a,b,c),d=g==0?null:f==a?(b-c)/g:f==b?(c-a)/g+2:(a-b)/g+4,d=(d+360)%6*60/360,e=g==0?0:g/f;return{h:d,s:e,b:f,toString:bp}},a.rgb2hsl=function(a,b,c){c=bs(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g,h,i;g=x(a,b,c),h=y(a,b,c),i=g-h,d=i==0?null:g==a?(b-c)/i:g==b?(c-a)/i+2:(a-b)/i+4,d=(d+360)%6*60/360,f=(g+h)/2,e=i==0?0:f<.5?i/(2*f):i/(2-2*f);return{h:d,s:e,l:f,toString:bq}},a._path2string=function(){return this.join(",").replace(Y,"$1")};var bw=a._preload=function(a,b){var c=h.doc.createElement("img");c.style.cssText="position:absolute;left:-9999em;top:-9999em",c.onload=function(){b.call(this),this.onload=null,h.doc.body.removeChild(this)},c.onerror=function(){h.doc.body.removeChild(this)},h.doc.body.appendChild(c),c.src=a};a.getRGB=bv(function(b){if(!b||!!((b=r(b)).indexOf("-")+1))return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:bx};if(b=="none")return{r:-1,g:-1,b:-1,hex:"none",toString:bx};!X[g](b.toLowerCase().substring(0,2))&&b.charAt()!="#"&&(b=bo(b));var c,d,e,f,h,i,j,k=b.match(L);if(k){k[2]&&(f=R(k[2].substring(5),16),e=R(k[2].substring(3,5),16),d=R(k[2].substring(1,3),16)),k[3]&&(f=R((i=k[3].charAt(3))+i,16),e=R((i=k[3].charAt(2))+i,16),d=R((i=k[3].charAt(1))+i,16)),k[4]&&(j=k[4][s](W),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),k[1].toLowerCase().slice(0,4)=="rgba"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100));if(k[5]){j=k[5][s](W),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="Ā°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsba"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsb2rgb(d,e,f,h)}if(k[6]){j=k[6][s](W),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="Ā°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsla"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsl2rgb(d,e,f,h)}k={r:d,g:e,b:f,toString:bx},k.hex="#"+(16777216|f|e<<8|d<<16).toString(16).slice(1),a.is(h,"finite")&&(k.opacity=h);return k}return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:bx}},a),a.hsb=bv(function(b,c,d){return a.hsb2rgb(b,c,d).hex}),a.hsl=bv(function(b,c,d){return a.hsl2rgb(b,c,d).hex}),a.rgb=bv(function(a,b,c){return"#"+(16777216|c|b<<8|a<<16).toString(16).slice(1)}),a.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||.75},c=this.hsb2rgb(b.h,b.s,b.b);b.h+=.075,b.h>1&&(b.h=0,b.s-=.2,b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b}));return c.hex},a.getColor.reset=function(){delete this.start},a.parsePathString=function(b){if(!b)return null;var c=bz(b);if(c.arr)return bJ(c.arr);var d={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},e=[];a.is(b,E)&&a.is(b[0],E)&&(e=bJ(b)),e.length||r(b).replace(Z,function(a,b,c){var f=[],g=b.toLowerCase();c.replace(_,function(a,b){b&&f.push(+b)}),g=="m"&&f.length>2&&(e.push([b][n](f.splice(0,2))),g="l",b=b=="m"?"l":"L");if(g=="r")e.push([b][n](f));else while(f.length>=d[g]){e.push([b][n](f.splice(0,d[g])));if(!d[g])break}}),e.toString=a._path2string,c.arr=bJ(e);return e},a.parseTransformString=bv(function(b){if(!b)return null;var c={r:3,s:4,t:2,m:6},d=[];a.is(b,E)&&a.is(b[0],E)&&(d=bJ(b)),d.length||r(b).replace($,function(a,b,c){var e=[],f=v.call(b);c.replace(_,function(a,b){b&&e.push(+b)}),d.push([b][n](e))}),d.toString=a._path2string;return d});var bz=function(a){var b=bz.ps=bz.ps||{};b[a]?b[a].sleep=100:b[a]={sleep:100},setTimeout(function(){for(var c in b)b[g](c)&&c!=a&&(b[c].sleep--,!b[c].sleep&&delete b[c])});return b[a]};a.findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=A(j,3),l=A(j,2),m=i*i,n=m*i,o=k*a+l*3*i*c+j*3*i*i*e+n*g,p=k*b+l*3*i*d+j*3*i*i*f+n*h,q=a+2*i*(c-a)+m*(e-2*c+a),r=b+2*i*(d-b)+m*(f-2*d+b),s=c+2*i*(e-c)+m*(g-2*e+c),t=d+2*i*(f-d)+m*(h-2*f+d),u=j*a+i*c,v=j*b+i*d,x=j*e+i*g,y=j*f+i*h,z=90-w.atan2(q-s,r-t)*180/B;(q>s||r<t)&&(z+=180);return{x:o,y:p,m:{x:q,y:r},n:{x:s,y:t},start:{x:u,y:v},end:{x:x,y:y},alpha:z}},a.bezierBBox=function(b,c,d,e,f,g,h,i){a.is(b,"array")||(b=[b,c,d,e,f,g,h,i]);var j=bQ.apply(null,b);return{x:j.min.x,y:j.min.y,x2:j.max.x,y2:j.max.y,width:j.max.x-j.min.x,height:j.max.y-j.min.y}},a.isPointInsideBBox=function(a,b,c){return b>=a.x&&b<=a.x2&&c>=a.y&&c<=a.y2},a.isBBoxIntersect=function(b,c){var d=a.isPointInsideBBox;return d(c,b.x,b.y)||d(c,b.x2,b.y)||d(c,b.x,b.y2)||d(c,b.x2,b.y2)||d(b,c.x,c.y)||d(b,c.x2,c.y)||d(b,c.x,c.y2)||d(b,c.x2,c.y2)||(b.x<c.x2&&b.x>c.x||c.x<b.x2&&c.x>b.x)&&(b.y<c.y2&&b.y>c.y||c.y<b.y2&&c.y>b.y)},a.pathIntersection=function(a,b){return bH(a,b)},a.pathIntersectionNumber=function(a,b){return bH(a,b,1)},a.isPointInsidePath=function(b,c,d){var e=a.pathBBox(b);return a.isPointInsideBBox(e,c,d)&&bH(b,[["M",c,d],["H",e.x2+10]],1)%2==1},a._removedFactory=function(a){return function(){eve("raphael.log",null,"RaphaĆ«l: you are calling to method ā€œ"+a+"ā€¯ of removed object",a)}};var bI=a.pathBBox=function(a){var b=bz(a);if(b.bbox)return b.bbox;if(!a)return{x:0,y:0,width:0,height:0,x2:0,y2:0};a=bR(a);var c=0,d=0,e=[],f=[],g;for(var h=0,i=a.length;h<i;h++){g=a[h];if(g[0]=="M")c=g[1],d=g[2],e.push(c),f.push(d);else{var j=bQ(c,d,g[1],g[2],g[3],g[4],g[5],g[6]);e=e[n](j.min.x,j.max.x),f=f[n](j.min.y,j.max.y),c=g[5],d=g[6]}}var k=y[m](0,e),l=y[m](0,f),o=x[m](0,e),p=x[m](0,f),q={x:k,y:l,x2:o,y2:p,width:o-k,height:p-l};b.bbox=bm(q);return q},bJ=function(b){var c=bm(b);c.toString=a._path2string;return c},bK=a._pathToRelative=function(b){var c=bz(b);if(c.rel)return bJ(c.rel);if(!a.is(b,E)||!a.is(b&&b[0],E))b=a.parsePathString(b);var d=[],e=0,f=0,g=0,h=0,i=0;b[0][0]=="M"&&(e=b[0][1],f=b[0][2],g=e,h=f,i++,d.push(["M",e,f]));for(var j=i,k=b.length;j<k;j++){var l=d[j]=[],m=b[j];if(m[0]!=v.call(m[0])){l[0]=v.call(m[0]);switch(l[0]){case"a":l[1]=m[1],l[2]=m[2],l[3]=m[3],l[4]=m[4],l[5]=m[5],l[6]=+(m[6]-e).toFixed(3),l[7]=+(m[7]-f).toFixed(3);break;case"v":l[1]=+(m[1]-f).toFixed(3);break;case"m":g=m[1],h=m[2];default:for(var n=1,o=m.length;n<o;n++)l[n]=+(m[n]-(n%2?e:f)).toFixed(3)}}else{l=d[j]=[],m[0]=="m"&&(g=m[1]+e,h=m[2]+f);for(var p=0,q=m.length;p<q;p++)d[j][p]=m[p]}var r=d[j].length;switch(d[j][0]){case"z":e=g,f=h;break;case"h":e+=+d[j][r-1];break;case"v":f+=+d[j][r-1];break;default:e+=+d[j][r-2],f+=+d[j][r-1]}}d.toString=a._path2string,c.rel=bJ(d);return d},bL=a._pathToAbsolute=function(b){var c=bz(b);if(c.abs)return bJ(c.abs);if(!a.is(b,E)||!a.is(b&&b[0],E))b=a.parsePathString(b);if(!b||!b.length)return[["M",0,0]];var d=[],e=0,f=0,g=0,h=0,i=0;b[0][0]=="M"&&(e=+b[0][1],f=+b[0][2],g=e,h=f,i++,d[0]=["M",e,f]);var j=b.length==3&&b[0][0]=="M"&&b[1][0].toUpperCase()=="R"&&b[2][0].toUpperCase()=="Z";for(var k,l,m=i,o=b.length;m<o;m++){d.push(k=[]),l=b[m];if(l[0]!=S.call(l[0])){k[0]=S.call(l[0]);switch(k[0]){case"A":k[1]=l[1],k[2]=l[2],k[3]=l[3],k[4]=l[4],k[5]=l[5],k[6]=+(l[6]+e),k[7]=+(l[7]+f);break;case"V":k[1]=+l[1]+f;break;case"H":k[1]=+l[1]+e;break;case"R":var p=[e,f][n](l.slice(1));for(var q=2,r=p.length;q<r;q++)p[q]=+p[q]+e,p[++q]=+p[q]+f;d.pop(),d=d[n](by(p,j));break;case"M":g=+l[1]+e,h=+l[2]+f;default:for(q=1,r=l.length;q<r;q++)k[q]=+l[q]+(q%2?e:f)}}else if(l[0]=="R")p=[e,f][n](l.slice(1)),d.pop(),d=d[n](by(p,j)),k=["R"][n](l.slice(-2));else for(var s=0,t=l.length;s<t;s++)k[s]=l[s];switch(k[0]){case"Z":e=g,f=h;break;case"H":e=k[1];break;case"V":f=k[1];break;case"M":g=k[k.length-2],h=k[k.length-1];default:e=k[k.length-2],f=k[k.length-1]}}d.toString=a._path2string,c.abs=bJ(d);return d},bM=function(a,b,c,d){return[a,b,c,d,c,d]},bN=function(a,b,c,d,e,f){var g=1/3,h=2/3;return[g*a+h*c,g*b+h*d,g*e+h*c,g*f+h*d,e,f]},bO=function(a,b,c,d,e,f,g,h,i,j){var k=B*120/180,l=B/180*(+e||0),m=[],o,p=bv(function(a,b,c){var d=a*w.cos(c)-b*w.sin(c),e=a*w.sin(c)+b*w.cos(c);return{x:d,y:e}});if(!j){o=p(a,b,-l),a=o.x,b=o.y,o=p(h,i,-l),h=o.x,i=o.y;var q=w.cos(B/180*e),r=w.sin(B/180*e),t=(a-h)/2,u=(b-i)/2,v=t*t/(c*c)+u*u/(d*d);v>1&&(v=w.sqrt(v),c=v*c,d=v*d);var x=c*c,y=d*d,A=(f==g?-1:1)*w.sqrt(z((x*y-x*u*u-y*t*t)/(x*u*u+y*t*t))),C=A*c*u/d+(a+h)/2,D=A*-d*t/c+(b+i)/2,E=w.asin(((b-D)/d).toFixed(9)),F=w.asin(((i-D)/d).toFixed(9));E=a<C?B-E:E,F=h<C?B-F:F,E<0&&(E=B*2+E),F<0&&(F=B*2+F),g&&E>F&&(E=E-B*2),!g&&F>E&&(F=F-B*2)}else E=j[0],F=j[1],C=j[2],D=j[3];var G=F-E;if(z(G)>k){var H=F,I=h,J=i;F=E+k*(g&&F>E?1:-1),h=C+c*w.cos(F),i=D+d*w.sin(F),m=bO(h,i,c,d,e,0,g,I,J,[F,H,C,D])}G=F-E;var K=w.cos(E),L=w.sin(E),M=w.cos(F),N=w.sin(F),O=w.tan(G/4),P=4/3*c*O,Q=4/3*d*O,R=[a,b],S=[a+P*L,b-Q*K],T=[h+P*N,i-Q*M],U=[h,i];S[0]=2*R[0]-S[0],S[1]=2*R[1]-S[1];if(j)return[S,T,U][n](m);m=[S,T,U][n](m).join()[s](",");var V=[];for(var W=0,X=m.length;W<X;W++)V[W]=W%2?p(m[W-1],m[W],l).y:p(m[W],m[W+1],l).x;return V},bP=function(a,b,c,d,e,f,g,h,i){var j=1-i;return{x:A(j,3)*a+A(j,2)*3*i*c+j*3*i*i*e+A(i,3)*g,y:A(j,3)*b+A(j,2)*3*i*d+j*3*i*i*f+A(i,3)*h}},bQ=bv(function(a,b,c,d,e,f,g,h){var i=e-2*c+a-(g-2*e+c),j=2*(c-a)-2*(e-c),k=a-c,l=(-j+w.sqrt(j*j-4*i*k))/2/i,n=(-j-w.sqrt(j*j-4*i*k))/2/i,o=[b,h],p=[a,g],q;z(l)>"1e12"&&(l=.5),z(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bP(a,b,c,d,e,f,g,h,l),p.push(q.x),o.push(q.y)),n>0&&n<1&&(q=bP(a,b,c,d,e,f,g,h,n),p.push(q.x),o.push(q.y)),i=f-2*d+b-(h-2*f+d),j=2*(d-b)-2*(f-d),k=b-d,l=(-j+w.sqrt(j*j-4*i*k))/2/i,n=(-j-w.sqrt(j*j-4*i*k))/2/i,z(l)>"1e12"&&(l=.5),z(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bP(a,b,c,d,e,f,g,h,l),p.push(q.x),o.push(q.y)),n>0&&n<1&&(q=bP(a,b,c,d,e,f,g,h,n),p.push(q.x),o.push(q.y));return{min:{x:y[m](0,p),y:y[m](0,o)},max:{x:x[m](0,p),y:x[m](0,o)}}}),bR=a._path2curve=bv(function(a,b){var c=!b&&bz(a);if(!b&&c.curve)return bJ(c.curve);var d=bL(a),e=b&&bL(b),f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},h=function(a,b){var c,d;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null);switch(a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"][n](bO[m](0,[b.x,b.y][n](a.slice(1))));break;case"S":c=b.x+(b.x-(b.bx||b.x)),d=b.y+(b.y-(b.by||b.y)),a=["C",c,d][n](a.slice(1));break;case"T":b.qx=b.x+(b.x-(b.qx||b.x)),b.qy=b.y+(b.y-(b.qy||b.y)),a=["C"][n](bN(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"][n](bN(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][n](bM(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][n](bM(b.x,b.y,a[1],b.y));break;case"V":a=["C"][n](bM(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][n](bM(b.x,b.y,b.X,b.Y))}return a},i=function(a,b){if(a[b].length>7){a[b].shift();var c=a[b];while(c.length)a.splice(b++,0,["C"][n](c.splice(0,6)));a.splice(b,1),l=x(d.length,e&&e.length||0)}},j=function(a,b,c,f,g){a&&b&&a[g][0]=="M"&&b[g][0]!="M"&&(b.splice(g,0,["M",f.x,f.y]),c.bx=0,c.by=0,c.x=a[g][1],c.y=a[g][2],l=x(d.length,e&&e.length||0))};for(var k=0,l=x(d.length,e&&e.length||0);k<l;k++){d[k]=h(d[k],f),i(d,k),e&&(e[k]=h(e[k],g)),e&&i(e,k),j(d,e,f,g,k),j(e,d,g,f,k);var o=d[k],p=e&&e[k],q=o.length,r=e&&p.length;f.x=o[q-2],f.y=o[q-1],f.bx=Q(o[q-4])||f.x,f.by=Q(o[q-3])||f.y,g.bx=e&&(Q(p[r-4])||g.x),g.by=e&&(Q(p[r-3])||g.y),g.x=e&&p[r-2],g.y=e&&p[r-1]}e||(c.curve=bJ(d));return e?[d,e]:d},null,bJ),bS=a._parseDots=bv(function(b){var c=[];for(var d=0,e=b.length;d<e;d++){var f={},g=b[d].match(/^([^:]*):?([\d\.]*)/);f.color=a.getRGB(g[1]);if(f.color.error)return null;f.color=f.color.hex,g[2]&&(f.offset=g[2]+"%"),c.push(f)}for(d=1,e=c.length-1;d<e;d++)if(!c[d].offset){var h=Q(c[d-1].offset||0),i=0;for(var j=d+1;j<e;j++)if(c[j].offset){i=c[j].offset;break}i||(i=100,j=e),i=Q(i);var k=(i-h)/(j-d+1);for(;d<j;d++)h+=k,c[d].offset=h+"%"}return c}),bT=a._tear=function(a,b){a==b.top&&(b.top=a.prev),a==b.bottom&&(b.bottom=a.next),a.next&&(a.next.prev=a.prev),a.prev&&(a.prev.next=a.next)},bU=a._tofront=function(a,b){b.top!==a&&(bT(a,b),a.next=null,a.prev=b.top,b.top.next=a,b.top=a)},bV=a._toback=function(a,b){b.bottom!==a&&(bT(a,b),a.next=b.bottom,a.prev=null,b.bottom.prev=a,b.bottom=a)},bW=a._insertafter=function(a,b,c){bT(a,c),b==c.top&&(c.top=a),b.next&&(b.next.prev=a),a.next=b.next,a.prev=b,b.next=a},bX=a._insertbefore=function(a,b,c){bT(a,c),b==c.bottom&&(c.bottom=a),b.prev&&(b.prev.next=a),a.prev=b.prev,b.prev=a,a.next=b},bY=a.toMatrix=function(a,b){var c=bI(a),d={_:{transform:p},getBBox:function(){return c}};b$(d,b);return d.matrix},bZ=a.transformPath=function(a,b){return bj(a,bY(a,b))},b$=a._extractTransform=function(b,c){if(c==null)return b._.transform;c=r(c).replace(/\.{3}|\u2026/g,b._.transform||p);var d=a.parseTransformString(c),e=0,f=0,g=0,h=1,i=1,j=b._,k=new cb;j.transform=d||[];if(d)for(var l=0,m=d.length;l<m;l++){var n=d[l],o=n.length,q=r(n[0]).toLowerCase(),s=n[0]!=q,t=s?k.invert():0,u,v,w,x,y;q=="t"&&o==3?s?(u=t.x(0,0),v=t.y(0,0),w=t.x(n[1],n[2]),x=t.y(n[1],n[2]),k.translate(w-u,x-v)):k.translate(n[1],n[2]):q=="r"?o==2?(y=y||b.getBBox(1),k.rotate(n[1],y.x+y.width/2,y.y+y.height/2),e+=n[1]):o==4&&(s?(w=t.x(n[2],n[3]),x=t.y(n[2],n[3]),k.rotate(n[1],w,x)):k.rotate(n[1],n[2],n[3]),e+=n[1]):q=="s"?o==2||o==3?(y=y||b.getBBox(1),k.scale(n[1],n[o-1],y.x+y.width/2,y.y+y.height/2),h*=n[1],i*=n[o-1]):o==5&&(s?(w=t.x(n[3],n[4]),x=t.y(n[3],n[4]),k.scale(n[1],n[2],w,x)):k.scale(n[1],n[2],n[3],n[4]),h*=n[1],i*=n[2]):q=="m"&&o==7&&k.add(n[1],n[2],n[3],n[4],n[5],n[6]),j.dirtyT=1,b.matrix=k}b.matrix=k,j.sx=h,j.sy=i,j.deg=e,j.dx=f=k.e,j.dy=g=k.f,h==1&&i==1&&!e&&j.bbox?(j.bbox.x+=+f,j.bbox.y+=+g):j.dirtyT=1},b_=function(a){var b=a[0];switch(b.toLowerCase()){case"t":return[b,0,0];case"m":return[b,1,0,0,1,0,0];case"r":return a.length==4?[b,0,a[2],a[3]]:[b,0];case"s":return a.length==5?[b,1,1,a[3],a[4]]:a.length==3?[b,1,1]:[b,1]}},ca=a._equaliseTransform=function(b,c){c=r(c).replace(/\.{3}|\u2026/g,b),b=a.parseTransformString(b)||[],c=a.parseTransformString(c)||[];var d=x(b.length,c.length),e=[],f=[],g=0,h,i,j,k;for(;g<d;g++){j=b[g]||b_(c[g]),k=c[g]||b_(j);if(j[0]!=k[0]||j[0].toLowerCase()=="r"&&(j[2]!=k[2]||j[3]!=k[3])||j[0].toLowerCase()=="s"&&(j[3]!=k[3]||j[4]!=k[4]))return;e[g]=[],f[g]=[];for(h=0,i=x(j.length,k.length);h<i;h++)h in j&&(e[g][h]=j[h]),h in k&&(f[g][h]=k[h])}return{from:e,to:f}};a._getContainer=function(b,c,d,e){var f;f=e==null&&!a.is(b,"object")?h.doc.getElementById(b):b;if(f!=null){if(f.tagName)return c==null?{container:f,width:f.style.pixelWidth||f.offsetWidth,height:f.style.pixelHeight||f.offsetHeight}:{container:f,width:c,height:d};return{container:1,x:b,y:c,width:d,height:e}}},a.pathToRelative=bK,a._engine={},a.path2curve=bR,a.matrix=function(a,b,c,d,e,f){return new cb(a,b,c,d,e,f)},function(b){function d(a){var b=w.sqrt(c(a));a[0]&&(a[0]/=b),a[1]&&(a[1]/=b)}function c(a){return a[0]*a[0]+a[1]*a[1]}b.add=function(a,b,c,d,e,f){var g=[[],[],[]],h=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],i=[[a,c,e],[b,d,f],[0,0,1]],j,k,l,m;a&&a instanceof cb&&(i=[[a.a,a.c,a.e],[a.b,a.d,a.f],[0,0,1]]);for(j=0;j<3;j++)for(k=0;k<3;k++){m=0;for(l=0;l<3;l++)m+=h[j][l]*i[l][k];g[j][k]=m}this.a=g[0][0],this.b=g[1][0],this.c=g[0][1],this.d=g[1][1],this.e=g[0][2],this.f=g[1][2]},b.invert=function(){var a=this,b=a.a*a.d-a.b*a.c;return new cb(a.d/b,-a.b/b,-a.c/b,a.a/b,(a.c*a.f-a.d*a.e)/b,(a.b*a.e-a.a*a.f)/b)},b.clone=function(){return new cb(this.a,this.b,this.c,this.d,this.e,this.f)},b.translate=function(a,b){this.add(1,0,0,1,a,b)},b.scale=function(a,b,c,d){b==null&&(b=a),(c||d)&&this.add(1,0,0,1,c,d),this.add(a,0,0,b,0,0),(c||d)&&this.add(1,0,0,1,-c,-d)},b.rotate=function(b,c,d){b=a.rad(b),c=c||0,d=d||0;var e=+w.cos(b).toFixed(9),f=+w.sin(b).toFixed(9);this.add(e,f,-f,e,c,d),this.add(1,0,0,1,-c,-d)},b.x=function(a,b){return a*this.a+b*this.c+this.e},b.y=function(a,b){return a*this.b+b*this.d+this.f},b.get=function(a){return+this[r.fromCharCode(97+a)].toFixed(4)},b.toString=function(){return a.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},b.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},b.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},b.split=function(){var b={};b.dx=this.e,b.dy=this.f;var e=[[this.a,this.c],[this.b,this.d]];b.scalex=w.sqrt(c(e[0])),d(e[0]),b.shear=e[0][0]*e[1][0]+e[0][1]*e[1][1],e[1]=[e[1][0]-e[0][0]*b.shear,e[1][1]-e[0][1]*b.shear],b.scaley=w.sqrt(c(e[1])),d(e[1]),b.shear/=b.scaley;var f=-e[0][1],g=e[1][1];g<0?(b.rotate=a.deg(w.acos(g)),f<0&&(b.rotate=360-b.rotate)):b.rotate=a.deg(w.asin(f)),b.isSimple=!+b.shear.toFixed(9)&&(b.scalex.toFixed(9)==b.scaley.toFixed(9)||!b.rotate),b.isSuperSimple=!+b.shear.toFixed(9)&&b.scalex.toFixed(9)==b.scaley.toFixed(9)&&!b.rotate,b.noRotation=!+b.shear.toFixed(9)&&!b.rotate;return b},b.toTransformString=function(a){var b=a||this[s]();if(b.isSimple){b.scalex=+b.scalex.toFixed(4),b.scaley=+b.scaley.toFixed(4),b.rotate=+b.rotate.toFixed(4);return(b.dx||b.dy?"t"+[b.dx,b.dy]:p)+(b.scalex!=1||b.scaley!=1?"s"+[b.scalex,b.scaley,0,0]:p)+(b.rotate?"r"+[b.rotate,0,0]:p)}return"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(cb.prototype);var cc=navigator.userAgent.match(/Version\/(.*?)\s/)||navigator.userAgent.match(/Chrome\/(\d+)/);navigator.vendor=="Apple Computer, Inc."&&(cc&&cc[1]<4||navigator.platform.slice(0,2)=="iP")||navigator.vendor=="Google Inc."&&cc&&cc[1]<8?k.safari=function(){var a=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});setTimeout(function(){a.remove()})}:k.safari=be;var cd=function(){this.returnValue=!1},ce=function(){return this.originalEvent.preventDefault()},cf=function(){this.cancelBubble=!0},cg=function(){return this.originalEvent.stopPropagation()},ch=function(){if(h.doc.addEventListener)return function(a,b,c,d){var e=o&&u[b]?u[b]:b,f=function(e){var f=h.doc.documentElement.scrollTop||h.doc.body.scrollTop,i=h.doc.documentElement.scrollLeft||h.doc.body.scrollLeft,j=e.clientX+i,k=e.clientY+f;if(o&&u[g](b))for(var l=0,m=e.targetTouches&&e.targetTouches.length;l<m;l++)if(e.targetTouches[l].target==a){var n=e;e=e.targetTouches[l],e.originalEvent=n,e.preventDefault=ce,e.stopPropagation=cg;break}return c.call(d,e,j,k)};a.addEventListener(e,f,!1);return function(){a.removeEventListener(e,f,!1);return!0}};if(h.doc.attachEvent)return function(a,b,c,d){var e=function(a){a=a||h.win.event;var b=h.doc.documentElement.scrollTop||h.doc.body.scrollTop,e=h.doc.documentElement.scrollLeft||h.doc.body.scrollLeft,f=a.clientX+e,g=a.clientY+b;a.preventDefault=a.preventDefault||cd,a.stopPropagation=a.stopPropagation||cf;return c.call(d,a,f,g)};a.attachEvent("on"+b,e);var f=function(){a.detachEvent("on"+b,e);return!0};return f}}(),ci=[],cj=function(a){var b=a.clientX,c=a.clientY,d=h.doc.documentElement.scrollTop||h.doc.body.scrollTop,e=h.doc.documentElement.scrollLeft||h.doc.body.scrollLeft,f,g=ci.length;while(g--){f=ci[g];if(o){var i=a.touches.length,j;while(i--){j=a.touches[i];if(j.identifier==f.el._drag.id){b=j.clientX,c=j.clientY,(a.originalEvent?a.originalEvent:a).preventDefault();break}}}else a.preventDefault();var k=f.el.node,l,m=k.nextSibling,n=k.parentNode,p=k.style.display;h.win.opera&&n.removeChild(k),k.style.display="none",l=f.el.paper.getElementByPoint(b,c),k.style.display=p,h.win.opera&&(m?n.insertBefore(k,m):n.appendChild(k)),l&&eve("raphael.drag.over."+f.el.id,f.el,l),b+=e,c+=d,eve("raphael.drag.move."+f.el.id,f.move_scope||f.el,b-f.el._drag.x,c-f.el._drag.y,b,c,a)}},ck=function(b){a.unmousemove(cj).unmouseup(ck);var c=ci.length,d;while(c--)d=ci[c],d.el._drag={},eve("raphael.drag.end."+d.el.id,d.end_scope||d.start_scope||d.move_scope||d.el,b);ci=[]},cl=a.el={};for(var cm=t.length;cm--;)(function(b){a[b]=cl[b]=function(c,d){a.is(c,"function")&&(this.events=this.events||[],this.events.push({name:b,f:c,unbind:ch(this.shape||this.node||h.doc,b,c,d||this)}));return this},a["un"+b]=cl["un"+b]=function(a){var c=this.events||[],d=c.length;while(d--)if(c[d].name==b&&c[d].f==a){c[d].unbind(),c.splice(d,1),!c.length&&delete this.events;return this}return this}})(t[cm]);cl.data=function(b,c){var d=bb[this.id]=bb[this.id]||{};if(arguments.length==1){if(a.is(b,"object")){for(var e in b)b[g](e)&&this.data(e,b[e]);return this}eve("raphael.data.get."+this.id,this,d[b],b);return d[b]}d[b]=c,eve("raphael.data.set."+this.id,this,c,b);return this},cl.removeData=function(a){a==null?bb[this.id]={}:bb[this.id]&&delete bb[this.id][a];return this},cl.hover=function(a,b,c,d){return this.mouseover(a,c).mouseout(b,d||c)},cl.unhover=function(a,b){return this.unmouseover(a).unmouseout(b)};var cn=[];cl.drag=function(b,c,d,e,f,g){function i(i){(i.originalEvent||i).preventDefault();var j=h.doc.documentElement.scrollTop||h.doc.body.scrollTop,k=h.doc.documentElement.scrollLeft||h.doc.body.scrollLeft;this._drag.x=i.clientX+k,this._drag.y=i.clientY+j,this._drag.id=i.identifier,!ci.length&&a.mousemove(cj).mouseup(ck),ci.push({el:this,move_scope:e,start_scope:f,end_scope:g}),c&&eve.on("raphael.drag.start."+this.id,c),b&&eve.on("raphael.drag.move."+this.id,b),d&&eve.on("raphael.drag.end."+this.id,d),eve("raphael.drag.start."+this.id,f||e||this,i.clientX+k,i.clientY+j,i)}this._drag={},cn.push({el:this,start:i}),this.mousedown(i);return this},cl.onDragOver=function(a){a?eve.on("raphael.drag.over."+this.id,a):eve.unbind("raphael.drag.over."+this.id)},cl.undrag=function(){var b=cn.length;while(b--)cn[b].el==this&&(this.unmousedown(cn[b].start),cn.splice(b,1),eve.unbind("raphael.drag.*."+this.id));!cn.length&&a.unmousemove(cj).unmouseup(ck)},k.circle=function(b,c,d){var e=a._engine.circle(this,b||0,c||0,d||0);this.__set__&&this.__set__.push(e);return e},k.rect=function(b,c,d,e,f){var g=a._engine.rect(this,b||0,c||0,d||0,e||0,f||0);this.__set__&&this.__set__.push(g);return g},k.ellipse=function(b,c,d,e){var f=a._engine.ellipse(this,b||0,c||0,d||0,e||0);this.__set__&&this.__set__.push(f);return f},k.path=function(b){b&&!a.is(b,D)&&!a.is(b[0],E)&&(b+=p);var c=a._engine.path(a.format[m](a,arguments),this);this.__set__&&this.__set__.push(c);return c},k.image=function(b,c,d,e,f){var g=a._engine.image(this,b||"about:blank",c||0,d||0,e||0,f||0);this.__set__&&this.__set__.push(g);return g},k.text=function(b,c,d){var e=a._engine.text(this,b||0,c||0,r(d));this.__set__&&this.__set__.push(e);return e},k.set=function(b){!a.is(b,"array")&&(b=Array.prototype.splice.call(arguments,0,arguments.length));var c=new cG(b);this.__set__&&this.__set__.push(c);return c},k.setStart=function(a){this.__set__=a||this.set()},k.setFinish=function(a){var b=this.__set__;delete this.__set__;return b},k.setSize=function(b,c){return a._engine.setSize.call(this,b,c)},k.setViewBox=function(b,c,d,e,f){return a._engine.setViewBox.call(this,b,c,d,e,f)},k.top=k.bottom=null,k.raphael=a;var co=function(a){var b=a.getBoundingClientRect(),c=a.ownerDocument,d=c.body,e=c.documentElement,f=e.clientTop||d.clientTop||0,g=e.clientLeft||d.clientLeft||0,i=b.top+(h.win.pageYOffset||e.scrollTop||d.scrollTop)-f,j=b.left+(h.win.pageXOffset||e.scrollLeft||d.scrollLeft)-g;return{y:i,x:j}};k.getElementByPoint=function(a,b){var c=this,d=c.canvas,e=h.doc.elementFromPoint(a,b);if(h.win.opera&&e.tagName=="svg"){var f=co(d),g=d.createSVGRect();g.x=a-f.x,g.y=b-f.y,g.width=g.height=1;var i=d.getIntersectionList(g,null);i.length&&(e=i[i.length-1])}if(!e)return null;while(e.parentNode&&e!=d.parentNode&&!e.raphael)e=e.parentNode;e==c.canvas.parentNode&&(e=d),e=e&&e.raphael?c.getById(e.raphaelid):null;return e},k.getById=function(a){var b=this.bottom;while(b){if(b.id==a)return b;b=b.next}return null},k.forEach=function(a,b){var c=this.bottom;while(c){if(a.call(b,c)===!1)return this;c=c.next}return this},k.getElementsByPoint=function(a,b){var c=this.set();this.forEach(function(d){d.isPointInside(a,b)&&c.push(d)});return c},cl.isPointInside=function(b,c){var d=this.realPath=this.realPath||bi[this.type](this);return a.isPointInsidePath(d,b,c)},cl.getBBox=function(a){if(this.removed)return{};var b=this._;if(a){if(b.dirty||!b.bboxwt)this.realPath=bi[this.type](this),b.bboxwt=bI(this.realPath),b.bboxwt.toString=cq,b.dirty=0;return b.bboxwt}if(b.dirty||b.dirtyT||!b.bbox){if(b.dirty||!this.realPath)b.bboxwt=0,this.realPath=bi[this.type](this);b.bbox=bI(bj(this.realPath,this.matrix)),b.bbox.toString=cq,b.dirty=b.dirtyT=0}return b.bbox},cl.clone=function(){if(this.removed)return null;var a=this.paper[this.type]().attr(this.attr());this.__set__&&this.__set__.push(a);return a},cl.glow=function(a){if(this.type=="text")return null;a=a||{};var b={width:(a.width||10)+(+this.attr("stroke-width")||1),fill:a.fill||!1,opacity:a.opacity||.5,offsetx:a.offsetx||0,offsety:a.offsety||0,color:a.color||"#000"},c=b.width/2,d=this.paper,e=d.set(),f=this.realPath||bi[this.type](this);f=this.matrix?bj(f,this.matrix):f;for(var g=1;g<c+1;g++)e.push(d.path(f).attr({stroke:b.color,fill:b.fill?b.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(b.width/c*g).toFixed(3),opacity:+(b.opacity/c).toFixed(3)}));return e.insertBefore(this).translate(b.offsetx,b.offsety)};var cr={},cs=function(b,c,d,e,f,g,h,i,j){return j==null?bB(b,c,d,e,f,g,h,i):a.findDotsAtSegment(b,c,d,e,f,g,h,i,bC(b,c,d,e,f,g,h,i,j))},ct=function(b,c){return function(d,e,f){d=bR(d);var g,h,i,j,k="",l={},m,n=0;for(var o=0,p=d.length;o<p;o++){i=d[o];if(i[0]=="M")g=+i[1],h=+i[2];else{j=cs(g,h,i[1],i[2],i[3],i[4],i[5],i[6]);if(n+j>e){if(c&&!l.start){m=cs(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),k+=["C"+m.start.x,m.start.y,m.m.x,m.m.y,m.x,m.y];if(f)return k;l.start=k,k=["M"+m.x,m.y+"C"+m.n.x,m.n.y,m.end.x,m.end.y,i[5],i[6]].join(),n+=j,g=+i[5],h=+i[6];continue}if(!b&&!c){m=cs(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n);return{x:m.x,y:m.y,alpha:m.alpha}}}n+=j,g=+i[5],h=+i[6]}k+=i.shift()+i}l.end=k,m=b?n:c?l:a.findDotsAtSegment(g,h,i[0],i[1],i[2],i[3],i[4],i[5],1),m.alpha&&(m={x:m.x,y:m.y,alpha:m.alpha});return m}},cu=ct(1),cv=ct(),cw=ct(0,1);a.getTotalLength=cu,a.getPointAtLength=cv,a.getSubpath=function(a,b,c){if(this.getTotalLength(a)-c<1e-6)return cw(a,b).end;var d=cw(a,c,1);return b?cw(d,b).end:d},cl.getTotalLength=function(){if(this.type=="path"){if(this.node.getTotalLength)return this.node.getTotalLength();return cu(this.attrs.path)}},cl.getPointAtLength=function(a){if(this.type=="path")return cv(this.attrs.path,a)},cl.getSubpath=function(b,c){if(this.type=="path")return a.getSubpath(this.attrs.path,b,c)};var cx=a.easing_formulas={linear:function(a){return a},"<":function(a){return A(a,1.7)},">":function(a){return A(a,.48)},"<>":function(a){var b=.48-a/1.04,c=w.sqrt(.1734+b*b),d=c-b,e=A(z(d),1/3)*(d<0?-1:1),f=-c-b,g=A(z(f),1/3)*(f<0?-1:1),h=e+g+.5;return(1-h)*3*h*h+h*h*h},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a=a-1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){if(a==!!a)return a;return A(2,-10*a)*w.sin((a-.075)*2*B/.3)+1},bounce:function(a){var b=7.5625,c=2.75,d;a<1/c?d=b*a*a:a<2/c?(a-=1.5/c,d=b*a*a+.75):a<2.5/c?(a-=2.25/c,d=b*a*a+.9375):(a-=2.625/c,d=b*a*a+.984375);return d}};cx.easeIn=cx["ease-in"]=cx["<"],cx.easeOut=cx["ease-out"]=cx[">"],cx.easeInOut=cx["ease-in-out"]=cx["<>"],cx["back-in"]=cx.backIn,cx["back-out"]=cx.backOut;var cy=[],cz=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,16)},cA=function(){var b=+(new Date),c=0;for(;c<cy.length;c++){var d=cy[c];if(d.el.removed||d.paused)continue;var e=b-d.start,f=d.ms,h=d.easing,i=d.from,j=d.diff,k=d.to,l=d.t,m=d.el,o={},p,r={},s;d.initstatus?(e=(d.initstatus*d.anim.top-d.prev)/(d.percent-d.prev)*f,d.status=d.initstatus,delete d.initstatus,d.stop&&cy.splice(c--,1)):d.status=(d.prev+(d.percent-d.prev)*(e/f))/d.anim.top;if(e<0)continue;if(e<f){var t=h(e/f);for(var u in i)if(i[g](u)){switch(U[u]){case C:p=+i[u]+t*f*j[u];break;case"colour":p="rgb("+[cB(O(i[u].r+t*f*j[u].r)),cB(O(i[u].g+t*f*j[u].g)),cB(O(i[u].b+t*f*j[u].b))].join(",")+")";break;case"path":p=[];for(var v=0,w=i[u].length;v<w;v++){p[v]=[i[u][v][0]];for(var x=1,y=i[u][v].length;x<y;x++)p[v][x]=+i[u][v][x]+t*f*j[u][v][x];p[v]=p[v].join(q)}p=p.join(q);break;case"transform":if(j[u].real){p=[];for(v=0,w=i[u].length;v<w;v++){p[v]=[i[u][v][0]];for(x=1,y=i[u][v].length;x<y;x++)p[v][x]=i[u][v][x]+t*f*j[u][v][x]}}else{var z=function(a){return+i[u][a]+t*f*j[u][a]};p=[["m",z(0),z(1),z(2),z(3),z(4),z(5)]]}break;case"csv":if(u=="clip-rect"){p=[],v=4;while(v--)p[v]=+i[u][v]+t*f*j[u][v]}break;default:var A=[][n](i[u]);p=[],v=m.paper.customAttributes[u].length;while(v--)p[v]=+A[v]+t*f*j[u][v]}o[u]=p}m.attr(o),function(a,b,c){setTimeout(function(){eve("raphael.anim.frame."+a,b,c)})}(m.id,m,d.anim)}else{(function(b,c,d){setTimeout(function(){eve("raphael.anim.frame."+c.id,c,d),eve("raphael.anim.finish."+c.id,c,d),a.is(b,"function")&&b.call(c)})})(d.callback,m,d.anim),m.attr(k),cy.splice(c--,1);if(d.repeat>1&&!d.next){for(s in k)k[g](s)&&(r[s]=d.totalOrigin[s]);d.el.attr(r),cE(d.anim,d.el,d.anim.percents[0],null,d.totalOrigin,d.repeat-1)}d.next&&!d.stop&&cE(d.anim,d.el,d.next,null,d.totalOrigin,d.repeat)}}a.svg&&m&&m.paper&&m.paper.safari(),cy.length&&cz(cA)},cB=function(a){return a>255?255:a<0?0:a};cl.animateWith=function(b,c,d,e,f,g){var h=this;if(h.removed){g&&g.call(h);return h}var i=d instanceof cD?d:a.animation(d,e,f,g),j,k;cE(i,h,i.percents[0],null,h.attr());for(var l=0,m=cy.length;l<m;l++)if(cy[l].anim==c&&cy[l].el==b){cy[m-1].start=cy[l].start;break}return h},cl.onAnimation=function(a){a?eve.on("raphael.anim.frame."+this.id,a):eve.unbind("raphael.anim.frame."+this.id);return this},cD.prototype.delay=function(a){var b=new cD(this.anim,this.ms);b.times=this.times,b.del=+a||0;return b},cD.prototype.repeat=function(a){var b=new cD(this.anim,this.ms);b.del=this.del,b.times=w.floor(x(a,0))||1;return b},a.animation=function(b,c,d,e){if(b instanceof cD)return b;if(a.is(d,"function")||!d)e=e||d||null,d=null;b=Object(b),c=+c||0;var f={},h,i;for(i in b)b[g](i)&&Q(i)!=i&&Q(i)+"%"!=i&&(h=!0,f[i]=b[i]);if(!h)return new cD(b,c);d&&(f.easing=d),e&&(f.callback=e);return new cD({100:f},c)},cl.animate=function(b,c,d,e){var f=this;if(f.removed){e&&e.call(f);return f}var g=b instanceof cD?b:a.animation(b,c,d,e);cE(g,f,g.percents[0],null,f.attr());return f},cl.setTime=function(a,b){a&&b!=null&&this.status(a,y(b,a.ms)/a.ms);return this},cl.status=function(a,b){var c=[],d=0,e,f;if(b!=null){cE(a,this,-1,y(b,1));return this}e=cy.length;for(;d<e;d++){f=cy[d];if(f.el.id==this.id&&(!a||f.anim==a)){if(a)return f.status;c.push({anim:f.anim,status:f.status})}}if(a)return 0;return c},cl.pause=function(a){for(var b=0;b<cy.length;b++)cy[b].el.id==this.id&&(!a||cy[b].anim==a)&&eve("raphael.anim.pause."+this.id,this,cy[b].anim)!==!1&&(cy[b].paused=!0);return this},cl.resume=function(a){for(var b=0;b<cy.length;b++)if(cy[b].el.id==this.id&&(!a||cy[b].anim==a)){var c=cy[b];eve("raphael.anim.resume."+this.id,this,c.anim)!==!1&&(delete c.paused,this.status(c.anim,c.status))}return this},cl.stop=function(a){for(var b=0;b<cy.length;b++)cy[b].el.id==this.id&&(!a||cy[b].anim==a)&&eve("raphael.anim.stop."+this.id,this,cy[b].anim)!==!1&&cy.splice(b--,1);return this},eve.on("raphael.remove",cF),eve.on("raphael.clear",cF),cl.toString=function(){return"RaphaĆ«lā€™s object"};var cG=function(a){this.items=[],this.length=0,this.type="set";if(a)for(var b=0,c=a.length;b<c;b++)a[b]&&(a[b].constructor==cl.constructor||a[b].constructor==cG)&&(this[this.items.length]=this.items[this.items.length]=a[b],this.length++)},cH=cG.prototype;cH.push=function(){var a,b;for(var c=0,d=arguments.length;c<d;c++)a=arguments[c],a&&(a.constructor==cl.constructor||a.constructor==cG)&&(b=this.items.length,this[b]=this.items[b]=a,this.length++);return this},cH.pop=function(){this.length&&delete this[this.length--];return this.items.pop()},cH.forEach=function(a,b){for(var c=0,d=this.items.length;c<d;c++)if(a.call(b,this.items[c],c)===!1)return this;return this};for(var cI in cl)cl[g](cI)&&(cH[cI]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a][m](c,b)})}}(cI));cH.attr=function(b,c){if(b&&a.is(b,E)&&a.is(b[0],"object"))for(var d=0,e=b.length;d<e;d++)this.items[d].attr(b[d]);else for(var f=0,g=this.items.length;f<g;f++)this.items[f].attr(b,c);return this},cH.clear=function(){while(this.length)this.pop()},cH.splice=function(a,b,c){a=a<0?x(this.length+a,0):a,b=x(0,y(this.length-a,b));var d=[],e=[],f=[],g;for(g=2;g<arguments.length;g++)f.push(arguments[g]);for(g=0;g<b;g++)e.push(this[a+g]);for(;g<this.length-a;g++)d.push(this[a+g]);var h=f.length;for(g=0;g<h+d.length;g++)this.items[a+g]=this[a+g]=g<h?f[g]:d[g-h];g=this.items.length=this.length-=b-h;while(this[g])delete this[g++];return new cG(e)},cH.exclude=function(a){for(var b=0,c=this.length;b<c;b++)if(this[b]==a){this.splice(b,1);return!0}},cH.animate=function(b,c,d,e){(a.is(d,"function")||!d)&&(e=d||null);var f=this.items.length,g=f,h,i=this,j;if(!f)return this;e&&(j=function(){!--f&&e.call(i)}),d=a.is(d,D)?d:j;var k=a.animation(b,c,d,j);h=this.items[--g].animate(k);while(g--)this.items[g]&&!this.items[g].removed&&this.items[g].animateWith(h,k,k);return this},cH.insertAfter=function(a){var b=this.items.length;while(b--)this.items[b].insertAfter(a);return this},cH.getBBox=function(){var a=[],b=[],c=[],d=[];for(var e=this.items.length;e--;)if(!this.items[e].removed){var f=this.items[e].getBBox();a.push(f.x),b.push(f.y),c.push(f.x+f.width),d.push(f.y+f.height)}a=y[m](0,a),b=y[m](0,b),c=x[m](0,c),d=x[m](0,d);return{x:a,y:b,x2:c,y2:d,width:c-a,height:d-b}},cH.clone=function(a){a=new cG;for(var b=0,c=this.items.length;b<c;b++)a.push(this.items[b].clone());return a},cH.toString=function(){return"RaphaĆ«lā€˜s set"},a.registerFont=function(a){if(!a.face)return a;this.fonts=this.fonts||{};var b={w:a.w,face:{},glyphs:{}},c=a.face["font-family"];for(var d in a.face)a.face[g](d)&&(b.face[d]=a.face[d]);this.fonts[c]?this.fonts[c].push(b):this.fonts[c]=[b];if(!a.svg){b.face["units-per-em"]=R(a.face["units-per-em"],10);for(var e in a.glyphs)if(a.glyphs[g](e)){var f=a.glyphs[e];b.glyphs[e]={w:f.w,k:{},d:f.d&&"M"+f.d.replace(/[mlcxtrv]/g,function(a){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[a]||"M"})+"z"};if(f.k)for(var h in f.k)f[g](h)&&(b.glyphs[e].k[h]=f.k[h])}}return a},k.getFont=function(b,c,d,e){e=e||"normal",d=d||"normal",c=+c||{normal:400,bold:700,lighter:300,bolder:800}[c]||400;if(!!a.fonts){var f=a.fonts[b];if(!f){var h=new RegExp("(^|\\s)"+b.replace(/[^\w\d\s+!~.:_-]/g,p)+"(\\s|$)","i");for(var i in a.fonts)if(a.fonts[g](i)&&h.test(i)){f=a.fonts[i];break}}var j;if(f)for(var k=0,l=f.length;k<l;k++){j=f[k];if(j.face["font-weight"]==c&&(j.face["font-style"]==d||!j.face["font-style"])&&j.face["font-stretch"]==e)break}return j}},k.print=function(b,d,e,f,g,h,i){h=h||"middle",i=x(y(i||0,1),-1);var j=r(e)[s](p),k=0,l=0,m=p,n;a.is(f,e)&&(f=this.getFont(f));if(f){n=(g||16)/f.face["units-per-em"];var o=f.face.bbox[s](c),q=+o[0],t=o[3]-o[1],u=0,v=+o[1]+(h=="baseline"?t+ +f.face.descent:t/2);for(var w=0,z=j.length;w<z;w++){if(j[w]=="\n")k=0,B=0,l=0,u+=t;else{var A=l&&f.glyphs[j[w-1]]||{},B=f.glyphs[j[w]];k+=l?(A.w||f.w)+(A.k&&A.k[j[w]]||0)+f.w*i:0,l=1}B&&B.d&&(m+=a.transformPath(B.d,["t",k*n,u*n,"s",n,n,q,v,"t",(b-q)/n,(d-v)/n]))}}return this.path(m).attr({fill:"#000",stroke:"none"})},k.add=function(b){if(a.is(b,"array")){var c=this.set(),e=0,f=b.length,h;for(;e<f;e++)h=b[e]||{},d[g](h.type)&&c.push(this[h.type]().attr(h))}return c},a.format=function(b,c){var d=a.is(c,E)?[0][n](c):arguments;b&&a.is(b,D)&&d.length-1&&(b=b.replace(e,function(a,b){return d[++b]==null?p:d[b]}));return b||p},a.fullfill=function(){var a=/\{([^\}]+)\}/g,b=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,c=function(a,c,d){var e=d;c.replace(b,function(a,b,c,d,f){b=b||d,e&&(b in e&&(e=e[b]),typeof e=="function"&&f&&(e=e()))}),e=(e==null||e==d?a:e)+"";return e};return function(b,d){return String(b).replace(a,function(a,b){return c(a,b,d)})}}(),a.ninja=function(){i.was?h.win.Raphael=i.is:delete Raphael;return a},a.st=cH,function(b,c,d){function e(){/in/.test(b.readyState)?setTimeout(e,9):a.eve("raphael.DOMload")}b.readyState==null&&b.addEventListener&&(b.addEventListener(c,d=function(){b.removeEventListener(c,d,!1),b.readyState="complete"},!1),b.readyState="loading"),e()}(document,"DOMContentLoaded"),i.was?h.win.Raphael=a:Raphael=a,eve.on("raphael.DOMload",function(){b=!0})}(),window.Raphael.svg&&function(a){var b="hasOwnProperty",c=String,d=parseFloat,e=parseInt,f=Math,g=f.max,h=f.abs,i=f.pow,j=/[, ]+/,k=a.eve,l="",m=" ",n="http://www.w3.org/1999/xlink",o={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},p={};a.toString=function(){return"Your browser supports SVG.\nYou are running RaphaĆ«l "+this.version};var q=function(d,e){if(e){typeof d=="string"&&(d=q(d));for(var f in e)e[b](f)&&(f.substring(0,6)=="xlink:"?d.setAttributeNS(n,f.substring(6),c(e[f])):d.setAttribute(f,c(e[f])))}else d=a._g.doc.createElementNS("http://www.w3.org/2000/svg",d),d.style&&(d.style.webkitTapHighlightColor="rgba(0,0,0,0)");return d},r=function(b,e){var j="linear",k=b.id+e,m=.5,n=.5,o=b.node,p=b.paper,r=o.style,s=a._g.doc.getElementById(k);if(!s){e=c(e).replace(a._radial_gradient,function(a,b,c){j="radial";if(b&&c){m=d(b),n=d(c);var e=(n>.5)*2-1;i(m-.5,2)+i(n-.5,2)>.25&&(n=f.sqrt(.25-i(m-.5,2))*e+.5)&&n!=.5&&(n=n.toFixed(5)-1e-5*e)}return l}),e=e.split(/\s*\-\s*/);if(j=="linear"){var t=e.shift();t=-d(t);if(isNaN(t))return null;var u=[0,0,f.cos(a.rad(t)),f.sin(a.rad(t))],v=1/(g(h(u[2]),h(u[3]))||1);u[2]*=v,u[3]*=v,u[2]<0&&(u[0]=-u[2],u[2]=0),u[3]<0&&(u[1]=-u[3],u[3]=0)}var w=a._parseDots(e);if(!w)return null;k=k.replace(/[\(\)\s,\xb0#]/g,"_"),b.gradient&&k!=b.gradient.id&&(p.defs.removeChild(b.gradient),delete b.gradient);if(!b.gradient){s=q(j+"Gradient",{id:k}),b.gradient=s,q(s,j=="radial"?{fx:m,fy:n}:{x1:u[0],y1:u[1],x2:u[2],y2:u[3],gradientTransform:b.matrix.invert()}),p.defs.appendChild(s);for(var x=0,y=w.length;x<y;x++)s.appendChild(q("stop",{offset:w[x].offset?w[x].offset:x?"100%":"0%","stop-color":w[x].color||"#fff"}))}}q(o,{fill:"url(#"+k+")",opacity:1,"fill-opacity":1}),r.fill=l,r.opacity=1,r.fillOpacity=1;return 1},s=function(a){var b=a.getBBox(1);q(a.pattern,{patternTransform:a.matrix.invert()+" translate("+b.x+","+b.y+")"})},t=function(d,e,f){if(d.type=="path"){var g=c(e).toLowerCase().split("-"),h=d.paper,i=f?"end":"start",j=d.node,k=d.attrs,m=k["stroke-width"],n=g.length,r="classic",s,t,u,v,w,x=3,y=3,z=5;while(n--)switch(g[n]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":r=g[n];break;case"wide":y=5;break;case"narrow":y=2;break;case"long":x=5;break;case"short":x=2}r=="open"?(x+=2,y+=2,z+=2,u=1,v=f?4:1,w={fill:"none",stroke:k.stroke}):(v=u=x/2,w={fill:k.stroke,stroke:"none"}),d._.arrows?f?(d._.arrows.endPath&&p[d._.arrows.endPath]--,d._.arrows.endMarker&&p[d._.arrows.endMarker]--):(d._.arrows.startPath&&p[d._.arrows.startPath]--,d._.arrows.startMarker&&p[d._.arrows.startMarker]--):d._.arrows={};if(r!="none"){var A="raphael-marker-"+r,B="raphael-marker-"+i+r+x+y;a._g.doc.getElementById(A)?p[A]++:(h.defs.appendChild(q(q("path"),{"stroke-linecap":"round",d:o[r],id:A})),p[A]=1);var C=a._g.doc.getElementById(B),D;C?(p[B]++,D=C.getElementsByTagName("use")[0]):(C=q(q("marker"),{id:B,markerHeight:y,markerWidth:x,orient:"auto",refX:v,refY:y/2}),D=q(q("use"),{"xlink:href":"#"+A,transform:(f?"rotate(180 "+x/2+" "+y/2+") ":l)+"scale("+x/z+","+y/z+")","stroke-width":(1/((x/z+y/z)/2)).toFixed(4)}),C.appendChild(D),h.defs.appendChild(C),p[B]=1),q(D,w);var F=u*(r!="diamond"&&r!="oval");f?(s=d._.arrows.startdx*m||0,t=a.getTotalLength(k.path)-F*m):(s=F*m,t=a.getTotalLength(k.path)-(d._.arrows.enddx*m||0)),w={},w["marker-"+i]="url(#"+B+")";if(t||s)w.d=Raphael.getSubpath(k.path,s,t);q(j,w),d._.arrows[i+"Path"]=A,d._.arrows[i+"Marker"]=B,d._.arrows[i+"dx"]=F,d._.arrows[i+"Type"]=r,d._.arrows[i+"String"]=e}else f?(s=d._.arrows.startdx*m||0,t=a.getTotalLength(k.path)-s):(s=0,t=a.getTotalLength(k.path)-(d._.arrows.enddx*m||0)),d._.arrows[i+"Path"]&&q(j,{d:Raphael.getSubpath(k.path,s,t)}),delete d._.arrows[i+"Path"],delete d._.arrows[i+"Marker"],delete d._.arrows[i+"dx"],delete d._.arrows[i+"Type"],delete d._.arrows[i+"String"];for(w in p)if(p[b](w)&&!p[w]){var G=a._g.doc.getElementById(w);G&&G.parentNode.removeChild(G)}}},u={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},v=function(a,b,d){b=u[c(b).toLowerCase()];if(b){var e=a.attrs["stroke-width"]||"1",f={round:e,square:e,butt:0}[a.attrs["stroke-linecap"]||d["stroke-linecap"]]||0,g=[],h=b.length;while(h--)g[h]=b[h]*e+(h%2?1:-1)*f;q(a.node,{"stroke-dasharray":g.join(",")})}},w=function(d,f){var i=d.node,k=d.attrs,m=i.style.visibility;i.style.visibility="hidden";for(var o in f)if(f[b](o)){if(!a._availableAttrs[b](o))continue;var p=f[o];k[o]=p;switch(o){case"blur":d.blur(p);break;case"href":case"title":case"target":var u=i.parentNode;if(u.tagName.toLowerCase()!="a"){var w=q("a");u.insertBefore(w,i),w.appendChild(i),u=w}o=="target"?u.setAttributeNS(n,"show",p=="blank"?"new":p):u.setAttributeNS(n,o,p);break;case"cursor":i.style.cursor=p;break;case"transform":d.transform(p);break;case"arrow-start":t(d,p);break;case"arrow-end":t(d,p,1);break;case"clip-rect":var x=c(p).split(j);if(x.length==4){d.clip&&d.clip.parentNode.parentNode.removeChild(d.clip.parentNode);var z=q("clipPath"),A=q("rect");z.id=a.createUUID(),q(A,{x:x[0],y:x[1],width:x[2],height:x[3]}),z.appendChild(A),d.paper.defs.appendChild(z),q(i,{"clip-path":"url(#"+z.id+")"}),d.clip=A}if(!p){var B=i.getAttribute("clip-path");if(B){var C=a._g.doc.getElementById(B.replace(/(^url\(#|\)$)/g,l));C&&C.parentNode.removeChild(C),q(i,{"clip-path":l}),delete d.clip}}break;case"path":d.type=="path"&&(q(i,{d:p?k.path=a._pathToAbsolute(p):"M0,0"}),d._.dirty=1,d._.arrows&&("startString"in d._.arrows&&t(d,d._.arrows.startString),"endString"in d._.arrows&&t(d,d._.arrows.endString,1)));break;case"width":i.setAttribute(o,p),d._.dirty=1;if(k.fx)o="x",p=k.x;else break;case"x":k.fx&&(p=-k.x-(k.width||0));case"rx":if(o=="rx"&&d.type=="rect")break;case"cx":i.setAttribute(o,p),d.pattern&&s(d),d._.dirty=1;break;case"height":i.setAttribute(o,p),d._.dirty=1;if(k.fy)o="y",p=k.y;else break;case"y":k.fy&&(p=-k.y-(k.height||0));case"ry":if(o=="ry"&&d.type=="rect")break;case"cy":i.setAttribute(o,p),d.pattern&&s(d),d._.dirty=1;break;case"r":d.type=="rect"?q(i,{rx:p,ry:p}):i.setAttribute(o,p),d._.dirty=1;break;case"src":d.type=="image"&&i.setAttributeNS(n,"href",p);break;case"stroke-width":if(d._.sx!=1||d._.sy!=1)p/=g(h(d._.sx),h(d._.sy))||1;d.paper._vbSize&&(p*=d.paper._vbSize),i.setAttribute(o,p),k["stroke-dasharray"]&&v(d,k["stroke-dasharray"],f),d._.arrows&&("startString"in d._.arrows&&t(d,d._.arrows.startString),"endString"in d._.arrows&&t(d,d._.arrows.endString,1));break;case"stroke-dasharray":v(d,p,f);break;case"fill":var D=c(p).match(a._ISURL);if(D){z=q("pattern");var F=q("image");z.id=a.createUUID(),q(z,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),q(F,{x:0,y:0,"xlink:href":D[1]}),z.appendChild(F),function(b){a._preload(D[1],function(){var a=this.offsetWidth,c=this.offsetHeight;q(b,{width:a,height:c}),q(F,{width:a,height:c}),d.paper.safari()})}(z),d.paper.defs.appendChild(z),q(i,{fill:"url(#"+z.id+")"}),d.pattern=z,d.pattern&&s(d);break}var G=a.getRGB(p);if(!G.error)delete f.gradient,delete k.gradient,!a.is(k.opacity,"undefined")&&a.is(f.opacity,"undefined")&&q(i,{opacity:k.opacity}),!a.is(k["fill-opacity"],"undefined")&&a.is(f["fill-opacity"],"undefined")&&q(i,{"fill-opacity":k["fill-opacity"]});else if((d.type=="circle"||d.type=="ellipse"||c(p).charAt()!="r")&&r(d,p)){if("opacity"in k||"fill-opacity"in k){var H=a._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,l));if(H){var I=H.getElementsByTagName("stop");q(I[I.length-1],{"stop-opacity":("opacity"in k?k.opacity:1)*("fill-opacity"in k?k["fill-opacity"]:1)})}}k.gradient=p,k.fill="none";break}G[b]("opacity")&&q(i,{"fill-opacity":G.opacity>1?G.opacity/100:G.opacity});case"stroke":G=a.getRGB(p),i.setAttribute(o,G.hex),o=="stroke"&&G[b]("opacity")&&q(i,{"stroke-opacity":G.opacity>1?G.opacity/100:G.opacity}),o=="stroke"&&d._.arrows&&("startString"in d._.arrows&&t(d,d._.arrows.startString),"endString"in d._.arrows&&t(d,d._.arrows.endString,1));break;case"gradient":(d.type=="circle"||d.type=="ellipse"||c(p).charAt()!="r")&&r(d,p);break;case"opacity":k.gradient&&!k[b]("stroke-opacity")&&q(i,{"stroke-opacity":p>1?p/100:p});case"fill-opacity":if(k.gradient){H=a._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,l)),H&&(I=H.getElementsByTagName("stop"),q(I[I.length-1],{"stop-opacity":p}));break};default:o=="font-size"&&(p=e(p,10)+"px");var J=o.replace(/(\-.)/g,function(a){return a.substring(1).toUpperCase()});i.style[J]=p,d._.dirty=1,i.setAttribute(o,p)}}y(d,f),i.style.visibility=m},x=1.2,y=function(d,f){if(d.type=="text"&&!!(f[b]("text")||f[b]("font")||f[b]("font-size")||f[b]("x")||f[b]("y"))){var g=d.attrs,h=d.node,i=h.firstChild?e(a._g.doc.defaultView.getComputedStyle(h.firstChild,l).getPropertyValue("font-size"),10):10;if(f[b]("text")){g.text=f.text;while(h.firstChild)h.removeChild(h.firstChild);var j=c(f.text).split("\n"),k=[],m;for(var n=0,o=j.length;n<o;n++)m=q("tspan"),n&&q(m,{dy:i*x,x:g.x}),m.appendChild(a._g.doc.createTextNode(j[n])),h.appendChild(m),k[n]=m}else{k=h.getElementsByTagName("tspan");for(n=0,o=k.length;n<o;n++)n?q(k[n],{dy:i*x,x:g.x}):q(k[0],{dy:0})}q(h,{x:g.x,y:g.y}),d._.dirty=1;var p=d._getBBox(),r=g.y-(p.y+p.height/2);r&&a.is(r,"finite")&&q(k[0],{dy:r})}},z=function(b,c){var d=0,e=0;this[0]=this.node=b,b.raphael=!0,this.id=a._oid++,b.raphaelid=this.id,this.matrix=a.matrix(),this.realPath=null,this.paper=c,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!c.bottom&&(c.bottom=this),this.prev=c.top,c.top&&(c.top.next=this),c.top=this,this.next=null},A=a.el;z.prototype=A,A.constructor=z,a._engine.path=function(a,b){var c=q("path");b.canvas&&b.canvas.appendChild(c);var d=new z(c,b);d.type="path",w(d,{fill:"none",stroke:"#000",path:a});return d},A.rotate=function(a,b,e){if(this.removed)return this;a=c(a).split(j),a.length-1&&(b=d(a[1]),e=d(a[2])),a=d(a[0]),e==null&&(b=e);if(b==null||e==null){var f=this.getBBox(1);b=f.x+f.width/2,e=f.y+f.height/2}this.transform(this._.transform.concat([["r",a,b,e]]));return this},A.scale=function(a,b,e,f){if(this.removed)return this;a=c(a).split(j),a.length-1&&(b=d(a[1]),e=d(a[2]),f=d(a[3])),a=d(a[0]),b==null&&(b=a),f==null&&(e=f);if(e==null||f==null)var g=this.getBBox(1);e=e==null?g.x+g.width/2:e,f=f==null?g.y+g.height/2:f,this.transform(this._.transform.concat([["s",a,b,e,f]]));return this},A.translate=function(a,b){if(this.removed)return this;a=c(a).split(j),a.length-1&&(b=d(a[1])),a=d(a[0])||0,b=+b||0,this.transform(this._.transform.concat([["t",a,b]]));return this},A.transform=function(c){var d=this._;if(c==null)return d.transform;a._extractTransform(this,c),this.clip&&q(this.clip,{transform:this.matrix.invert()}),this.pattern&&s(this),this.node&&q(this.node,{transform:this.matrix});if(d.sx!=1||d.sy!=1){var e=this.attrs[b]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":e})}return this},A.hide=function(){!this.removed&&this.paper.safari(this.node.style.display="none");return this},A.show=function(){!this.removed&&this.paper.safari(this.node.style.display="");return this},A.remove=function(){if(!this.removed&&!!this.node.parentNode){var b=this.paper;b.__set__&&b.__set__.exclude(this),k.unbind("raphael.*.*."+this.id),this.gradient&&b.defs.removeChild(this.gradient),a._tear(this,b),this.node.parentNode.tagName.toLowerCase()=="a"?this.node.parentNode.parentNode.removeChild(this.node.parentNode):this.node.parentNode.removeChild(this.node);for(var c in this)this[c]=typeof this[c]=="function"?a._removedFactory(c):null;this.removed=!0}},A._getBBox=function(){if(this.node.style.display=="none"){this.show();var a=!0}var b={};try{b=this.node.getBBox()}catch(c){}finally{b=b||{}}a&&this.hide();return b},A.attr=function(c,d){if(this.removed)return this;if(c==null){var e={};for(var f in this.attrs)this.attrs[b](f)&&(e[f]=this.attrs[f]);e.gradient&&e.fill=="none"&&(e.fill=e.gradient)&&delete e.gradient,e.transform=this._.transform;return e}if(d==null&&a.is(c,"string")){if(c=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;if(c=="transform")return this._.transform;var g=c.split(j),h={};for(var i=0,l=g.length;i<l;i++)c=g[i],c in this.attrs?h[c]=this.attrs[c]:a.is(this.paper.customAttributes[c],"function")?h[c]=this.paper.customAttributes[c].def:h[c]=a._availableAttrs[c];return l-1?h:h[g[0]]}if(d==null&&a.is(c,"array")){h={};for(i=0,l=c.length;i<l;i++)h[c[i]]=this.attr(c[i]);return h}if(d!=null){var m={};m[c]=d}else c!=null&&a.is(c,"object")&&(m=c);for(var n in m)k("raphael.attr."+n+"."+this.id,this,m[n]);for(n in this.paper.customAttributes)if(this.paper.customAttributes[b](n)&&m[b](n)&&a.is(this.paper.customAttributes[n],"function")){var o=this.paper.customAttributes[n].apply(this,[].concat(m[n]));this.attrs[n]=m[n];for(var p in o)o[b](p)&&(m[p]=o[p])}w(this,m);return this},A.toFront=function(){if(this.removed)return this;this.node.parentNode.tagName.toLowerCase()=="a"?this.node.parentNode.parentNode.appendChild(this.node.parentNode):this.node.parentNode.appendChild(this.node);var b=this.paper;b.top!=this&&a._tofront(this,b);return this},A.toBack=function(){if(this.removed)return this;var b=this.node.parentNode;b.tagName.toLowerCase()=="a"?b.parentNode.insertBefore(this.node.parentNode,this.node.parentNode.parentNode.firstChild):b.firstChild!=this.node&&b.insertBefore(this.node,this.node.parentNode.firstChild),a._toback(this,this.paper);var c=this.paper;return this},A.insertAfter=function(b){if(this.removed)return this;var c=b.node||b[b.length-1].node;c.nextSibling?c.parentNode.insertBefore(this.node,c.nextSibling):c.parentNode.appendChild(this.node),a._insertafter(this,b,this.paper);return this},A.insertBefore=function(b){if(this.removed)return this;var c=b.node||b[0].node;c.parentNode.insertBefore(this.node,c),a._insertbefore(this,b,this.paper);return this},A.blur=function(b){var c=this;if(+b!==0){var d=q("filter"),e=q("feGaussianBlur");c.attrs.blur=b,d.id=a.createUUID(),q(e,{stdDeviation:+b||1.5}),d.appendChild(e),c.paper.defs.appendChild(d),c._blur=d,q(c.node,{filter:"url(#"+d.id+")"})}else c._blur&&(c._blur.parentNode.removeChild(c._blur),delete c._blur,delete c.attrs.blur),c.node.removeAttribute("filter")},a._engine.circle=function(a,b,c,d){var e=q("circle");a.canvas&&a.canvas.appendChild(e);var f=new z(e,a);f.attrs={cx:b,cy:c,r:d,fill:"none",stroke:"#000"},f.type="circle",q(e,f.attrs);return f},a._engine.rect=function(a,b,c,d,e,f){var g=q("rect");a.canvas&&a.canvas.appendChild(g);var h=new z(g,a);h.attrs={x:b,y:c,width:d,height:e,r:f||0,rx:f||0,ry:f||0,fill:"none",stroke:"#000"},h.type="rect",q(g,h.attrs);return h},a._engine.ellipse=function(a,b,c,d,e){var f=q("ellipse");a.canvas&&a.canvas.appendChild(f);var g=new z(f,a);g.attrs={cx:b,cy:c,rx:d,ry:e,fill:"none",stroke:"#000"},g.type="ellipse",q(f,g.attrs);return g},a._engine.image=function(a,b,c,d,e,f){var g=q("image");q(g,{x:c,y:d,width:e,height:f,preserveAspectRatio:"none"}),g.setAttributeNS(n,"href",b),a.canvas&&a.canvas.appendChild(g);var h=new z(g,a);h.attrs={x:c,y:d,width:e,height:f,src:b},h.type="image";return h},a._engine.text=function(b,c,d,e){var f=q("text");b.canvas&&b.canvas.appendChild(f);var g=new z(f,b);g.attrs={x:c,y:d,"text-anchor":"middle",text:e,font:a._availableAttrs.font,stroke:"none",fill:"#000"},g.type="text",w(g,g.attrs);return g},a._engine.setSize=function(a,b){this.width=a||this.width,this.height=b||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox);return this},a._engine.create=function(){var b=a._getContainer.apply(0,arguments),c=b&&b.container,d=b.x,e=b.y,f=b.width,g=b.height;if(!c)throw new Error("SVG container not found.");var h=q("svg"),i="overflow:hidden;",j;d=d||0,e=e||0,f=f||512,g=g||342,q(h,{height:g,version:1.1,width:f,xmlns:"http://www.w3.org/2000/svg"}),c==1?(h.style.cssText=i+"position:absolute;left:"+d+"px;top:"+e+"px",a._g.doc.body.appendChild(h),j=1):(h.style.cssText=i+"position:relative",c.firstChild?c.insertBefore(h,c.firstChild):c.appendChild(h)),c=new a._Paper,c.width=f,c.height=g,c.canvas=h,c.clear(),c._left=c._top=0,j&&(c.renderfix=function(){}),c.renderfix();return c},a._engine.setViewBox=function(a,b,c,d,e){k("raphael.setViewBox",this,this._viewBox,[a,b,c,d,e]);var f=g(c/this.width,d/this.height),h=this.top,i=e?"meet":"xMinYMin",j,l;a==null?(this._vbSize&&(f=1),delete this._vbSize,j="0 0 "+this.width+m+this.height):(this._vbSize=f,j=a+m+b+m+c+m+d),q(this.canvas,{viewBox:j,preserveAspectRatio:i});while(f&&h)l="stroke-width"in h.attrs?h.attrs["stroke-width"]:1,h.attr({"stroke-width":l}),h._.dirty=1,h._.dirtyT=1,h=h.prev;this._viewBox=[a,b,c,d,!!e];return this},a.prototype.renderfix=function(){var a=this.canvas,b=a.style,c;try{c=a.getScreenCTM()||a.createSVGMatrix()}catch(d){c=a.createSVGMatrix()}var e=-c.e%1,f=-c.f%1;if(e||f)e&&(this._left=(this._left+e)%1,b.left=this._left+"px"),f&&(this._top=(this._top+f)%1,b.top=this._top+"px")},a.prototype.clear=function(){a.eve("raphael.clear",this);var b=this.canvas;while(b.firstChild)b.removeChild(b.firstChild);this.bottom=this.top=null,(this.desc=q("desc")).appendChild(a._g.doc.createTextNode("Created with RaphaĆ«l "+a.version)),b.appendChild(this.desc),b.appendChild(this.defs=q("defs"))},a.prototype.remove=function(){k("raphael.remove",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var b in this)this[b]=typeof this[b]=="function"?a._removedFactory(b):null};var B=a.st;for(var C in A)A[b](C)&&!B[b](C)&&(B[C]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(C))}(window.Raphael),window.Raphael.vml&&function(a){var b="hasOwnProperty",c=String,d=parseFloat,e=Math,f=e.round,g=e.max,h=e.min,i=e.abs,j="fill",k=/[, ]+/,l=a.eve,m=" progid:DXImageTransform.Microsoft",n=" ",o="",p={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},q=/([clmz]),?([^clmz]*)/gi,r=/ progid:\S+Blur\([^\)]+\)/g,s=/-?[^,\s-]+/g,t="position:absolute;left:0;top:0;width:1px;height:1px",u=21600,v={path:1,rect:1,image:1},w={circle:1,ellipse:1},x=function(b){var d=/[ahqstv]/ig,e=a._pathToAbsolute;c(b).match(d)&&(e=a._path2curve),d=/[clmz]/g;if(e==a._pathToAbsolute&&!c(b).match(d)){var g=c(b).replace(q,function(a,b,c){var d=[],e=b.toLowerCase()=="m",g=p[b];c.replace(s,function(a){e&&d.length==2&&(g+=d+p[b=="m"?"l":"L"],d=[]),d.push(f(a*u))});return g+d});return g}var h=e(b),i,j;g=[];for(var k=0,l=h.length;k<l;k++){i=h[k],j=h[k][0].toLowerCase(),j=="z"&&(j="x");for(var m=1,r=i.length;m<r;m++)j+=f(i[m]*u)+(m!=r-1?",":o);g.push(j)}return g.join(n)},y=function(b,c,d){var e=a.matrix();e.rotate(-b,.5,.5);return{dx:e.x(c,d),dy:e.y(c,d)}},z=function(a,b,c,d,e,f){var g=a._,h=a.matrix,k=g.fillpos,l=a.node,m=l.style,o=1,p="",q,r=u/b,s=u/c;m.visibility="hidden";if(!!b&&!!c){l.coordsize=i(r)+n+i(s),m.rotation=f*(b*c<0?-1:1);if(f){var t=y(f,d,e);d=t.dx,e=t.dy}b<0&&(p+="x"),c<0&&(p+=" y")&&(o=-1),m.flip=p,l.coordorigin=d*-r+n+e*-s;if(k||g.fillsize){var v=l.getElementsByTagName(j);v=v&&v[0],l.removeChild(v),k&&(t=y(f,h.x(k[0],k[1]),h.y(k[0],k[1])),v.position=t.dx*o+n+t.dy*o),g.fillsize&&(v.size=g.fillsize[0]*i(b)+n+g.fillsize[1]*i(c)),l.appendChild(v)}m.visibility="visible"}};a.toString=function(){return"Your browser doesnā€™t support SVG. Falling down to VML.\nYou are running RaphaĆ«l "+this.version};var A=function(a,b,d){var e=c(b).toLowerCase().split("-"),f=d?"end":"start",g=e.length,h="classic",i="medium",j="medium";while(g--)switch(e[g]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":h=e[g];break;case"wide":case"narrow":j=e[g];break;case"long":case"short":i=e[g]}var k=a.node.getElementsByTagName("stroke")[0];k[f+"arrow"]=h,k[f+"arrowlength"]=i,k[f+"arrowwidth"]=j},B=function(e,i){e.attrs=e.attrs||{};var l=e.node,m=e.attrs,p=l.style,q,r=v[e.type]&&(i.x!=m.x||i.y!=m.y||i.width!=m.width||i.height!=m.height||i.cx!=m.cx||i.cy!=m.cy||i.rx!=m.rx||i.ry!=m.ry||i.r!=m.r),s=w[e.type]&&(m.cx!=i.cx||m.cy!=i.cy||m.r!=i.r||m.rx!=i.rx||m.ry!=i.ry),t=e;for(var y in i)i[b](y)&&(m[y]=i[y]);r&&(m.path=a._getPath[e.type](e),e._.dirty=1),i.href&&(l.href=i.href),i.title&&(l.title=i.title),i.target&&(l.target=i.target),i.cursor&&(p.cursor=i.cursor),"blur"in i&&e.blur(i.blur);if(i.path&&e.type=="path"||r)l.path=x(~c(m.path).toLowerCase().indexOf("r")?a._pathToAbsolute(m.path):m.path),e.type=="image"&&(e._.fillpos=[m.x,m.y],e._.fillsize=[m.width,m.height],z(e,1,1,0,0,0));"transform"in i&&e.transform(i.transform);if(s){var B=+m.cx,D=+m.cy,E=+m.rx||+m.r||0,G=+m.ry||+m.r||0;l.path=a.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",f((B-E)*u),f((D-G)*u),f((B+E)*u),f((D+G)*u),f(B*u))}if("clip-rect"in i){var H=c(i["clip-rect"]).split(k);if(H.length==4){H[2]=+H[2]+ +H[0],H[3]=+H[3]+ +H[1];var I=l.clipRect||a._g.doc.createElement("div"),J=I.style;J.clip=a.format("rect({1}px {2}px {3}px {0}px)",H),l.clipRect||(J.position="absolute",J.top=0,J.left=0,J.width=e.paper.width+"px",J.height=e.paper.height+"px",l.parentNode.insertBefore(I,l),I.appendChild(l),l.clipRect=I)}i["clip-rect"]||l.clipRect&&(l.clipRect.style.clip="auto")}if(e.textpath){var K=e.textpath.style;i.font&&(K.font=i.font),i["font-family"]&&(K.fontFamily='"'+i["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,o)+'"'),i["font-size"]&&(K.fontSize=i["font-size"]),i["font-weight"]&&(K.fontWeight=i["font-weight"]),i["font-style"]&&(K.fontStyle=i["font-style"])}"arrow-start"in i&&A(t,i["arrow-start"]),"arrow-end"in i&&A(t,i["arrow-end"],1);if(i.opacity!=null||i["stroke-width"]!=null||i.fill!=null||i.src!=null||i.stroke!=null||i["stroke-width"]!=null||i["stroke-opacity"]!=null||i["fill-opacity"]!=null||i["stroke-dasharray"]!=null||i["stroke-miterlimit"]!=null||i["stroke-linejoin"]!=null||i["stroke-linecap"]!=null){var L=l.getElementsByTagName(j),M=!1;L=L&&L[0],!L&&(M=L=F(j)),e.type=="image"&&i.src&&(L.src=i.src),i.fill&&(L.on=!0);if(L.on==null||i.fill=="none"||i.fill===null)L.on=!1;if(L.on&&i.fill){var N=c(i.fill).match(a._ISURL);if(N){L.parentNode==l&&l.removeChild(L),L.rotate=!0,L.src=N[1],L.type="tile";var O=e.getBBox(1);L.position=O.x+n+O.y,e._.fillpos=[O.x,O.y],a._preload(N[1],function(){e._.fillsize=[this.offsetWidth,this.offsetHeight]})}else L.color=a.getRGB(i.fill).hex,L.src=o,L.type="solid",a.getRGB(i.fill).error&&(t.type in{circle:1,ellipse:1}||c(i.fill).charAt()!="r")&&C(t,i.fill,L)&&(m.fill="none",m.gradient=i.fill,L.rotate=!1)}if("fill-opacity"in i||"opacity"in i){var P=((+m["fill-opacity"]+1||2)-1)*((+m.opacity+1||2)-1)*((+a.getRGB(i.fill).o+1||2)-1);P=h(g(P,0),1),L.opacity=P,L.src&&(L.color="none")}l.appendChild(L);var Q=l.getElementsByTagName("stroke")&&l.getElementsByTagName("stroke")[0],T=!1;!Q&&(T=Q=F("stroke"));if(i.stroke&&i.stroke!="none"||i["stroke-width"]||i["stroke-opacity"]!=null||i["stroke-dasharray"]||i["stroke-miterlimit"]||i["stroke-linejoin"]||i["stroke-linecap"])Q.on=!0;(i.stroke=="none"||i.stroke===null||Q.on==null||i.stroke==0||i["stroke-width"]==0)&&(Q.on=!1);var U=a.getRGB(i.stroke);Q.on&&i.stroke&&(Q.color=U.hex),P=((+m["stroke-opacity"]+1||2)-1)*((+m.opacity+1||2)-1)*((+U.o+1||2)-1);var V=(d(i["stroke-width"])||1)*.75;P=h(g(P,0),1),i["stroke-width"]==null&&(V=m["stroke-width"]),i["stroke-width"]&&(Q.weight=V),V&&V<1&&(P*=V)&&(Q.weight=1),Q.opacity=P,i["stroke-linejoin"]&&(Q.joinstyle=i["stroke-linejoin"]||"miter"),Q.miterlimit=i["stroke-miterlimit"]||8,i["stroke-linecap"]&&(Q.endcap=i["stroke-linecap"]=="butt"?"flat":i["stroke-linecap"]=="square"?"square":"round");if(i["stroke-dasharray"]){var W={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};Q.dashstyle=W[b](i["stroke-dasharray"])?W[i["stroke-dasharray"]]:o}T&&l.appendChild(Q)}if(t.type=="text"){t.paper.canvas.style.display=o;var X=t.paper.span,Y=100,Z=m.font&&m.font.match(/\d+(?:\.\d*)?(?=px)/);p=X.style,m.font&&(p.font=m.font),m["font-family"]&&(p.fontFamily=m["font-family"]),m["font-weight"]&&(p.fontWeight=m["font-weight"]),m["font-style"]&&(p.fontStyle=m["font-style"]),Z=d(m["font-size"]||Z&&Z[0])||10,p.fontSize=Z*Y+"px",t.textpath.string&&(X.innerHTML=c(t.textpath.string).replace(/</g,"&#60;").replace(/&/g,"&#38;").replace(/\n/g,"<br>"));var $=X.getBoundingClientRect();t.W=m.w=($.right-$.left)/Y,t.H=m.h=($.bottom-$.top)/Y,t.X=m.x,t.Y=m.y+t.H/2,("x"in i||"y"in i)&&(t.path.v=a.format("m{0},{1}l{2},{1}",f(m.x*u),f(m.y*u),f(m.x*u)+1));var _=["x","y","text","font","font-family","font-weight","font-style","font-size"];for(var ba=0,bb=_.length;ba<bb;ba++)if(_[ba]in i){t._.dirty=1;break}switch(m["text-anchor"]){case"start":t.textpath.style["v-text-align"]="left",t.bbx=t.W/2;break;case"end":t.textpath.style["v-text-align"]="right",t.bbx=-t.W/2;break;default:t.textpath.style["v-text-align"]="center",t.bbx=0}t.textpath.style["v-text-kern"]=!0}},C=function(b,f,g){b.attrs=b.attrs||{};var h=b.attrs,i=Math.pow,j,k,l="linear",m=".5 .5";b.attrs.gradient=f,f=c(f).replace(a._radial_gradient,function(a,b,c){l="radial",b&&c&&(b=d(b),c=d(c),i(b-.5,2)+i(c-.5,2)>.25&&(c=e.sqrt(.25-i(b-.5,2))*((c>.5)*2-1)+.5),m=b+n+c);return o}),f=f.split(/\s*\-\s*/);if(l=="linear"){var p=f.shift();p=-d(p);if(isNaN(p))return null}var q=a._parseDots(f);if(!q)return null;b=b.shape||b.node;if(q.length){b.removeChild(g),g.on=!0,g.method="none",g.color=q[0].color,g.color2=q[q.length-1].color;var r=[];for(var s=0,t=q.length;s<t;s++)q[s].offset&&r.push(q[s].offset+n+q[s].color);g.colors=r.length?r.join():"0% "+g.color,l=="radial"?(g.type="gradientTitle",g.focus="100%",g.focussize="0 0",g.focusposition=m,g.angle=0):(g.type="gradient",g.angle=(270-p)%360),b.appendChild(g)}return 1},D=function(b,c){this[0]=this.node=b,b.raphael=!0,this.id=a._oid++,b.raphaelid=this.id,this.X=0,this.Y=0,this.attrs={},this.paper=c,this.matrix=a.matrix(),this._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},!c.bottom&&(c.bottom=this),this.prev=c.top,c.top&&(c.top.next=this),c.top=this,this.next=null},E=a.el;D.prototype=E,E.constructor=D,E.transform=function(b){if(b==null)return this._.transform;var d=this.paper._viewBoxShift,e=d?"s"+[d.scale,d.scale]+"-1-1t"+[d.dx,d.dy]:o,f;d&&(f=b=c(b).replace(/\.{3}|\u2026/g,this._.transform||o)),a._extractTransform(this,e+b);var g=this.matrix.clone(),h=this.skew,i=this.node,j,k=~c(this.attrs.fill).indexOf("-"),l=!c(this.attrs.fill).indexOf("url(");g.translate(-0.5,-0.5);if(l||k||this.type=="image"){h.matrix="1 0 0 1",h.offset="0 0",j=g.split();if(k&&j.noRotation||!j.isSimple){i.style.filter=g.toFilter();var m=this.getBBox(),p=this.getBBox(1),q=m.x-p.x,r=m.y-p.y;i.coordorigin=q*-u+n+r*-u,z(this,1,1,q,r,0)}else i.style.filter=o,z(this,j.scalex,j.scaley,j.dx,j.dy,j.rotate)}else i.style.filter=o,h.matrix=c(g),h.offset=g.offset();f&&(this._.transform=f);return this},E.rotate=function(a,b,e){if(this.removed)return this;if(a!=null){a=c(a).split(k),a.length-1&&(b=d(a[1]),e=d(a[2])),a=d(a[0]),e==null&&(b=e);if(b==null||e==null){var f=this.getBBox(1);b=f.x+f.width/2,e=f.y+f.height/2}this._.dirtyT=1,this.transform(this._.transform.concat([["r",a,b,e]]));return this}},E.translate=function(a,b){if(this.removed)return this;a=c(a).split(k),a.length-1&&(b=d(a[1])),a=d(a[0])||0,b=+b||0,this._.bbox&&(this._.bbox.x+=a,this._.bbox.y+=b),this.transform(this._.transform.concat([["t",a,b]]));return this},E.scale=function(a,b,e,f){if(this.removed)return this;a=c(a).split(k),a.length-1&&(b=d(a[1]),e=d(a[2]),f=d(a[3]),isNaN(e)&&(e=null),isNaN(f)&&(f=null)),a=d(a[0]),b==null&&(b=a),f==null&&(e=f);if(e==null||f==null)var g=this.getBBox(1);e=e==null?g.x+g.width/2:e,f=f==null?g.y+g.height/2:f,this.transform(this._.transform.concat([["s",a,b,e,f]])),this._.dirtyT=1;return this},E.hide=function(){!this.removed&&(this.node.style.display="none");return this},E.show=function(){!this.removed&&(this.node.style.display=o);return this},E._getBBox=function(){if(this.removed)return{};return{x:this.X+(this.bbx||0)-this.W/2,y:this.Y-this.H,width:this.W,height:this.H}},E.remove=function(){if(!this.removed&&!!this.node.parentNode){this.paper.__set__&&this.paper.__set__.exclude(this),a.eve.unbind("raphael.*.*."+this.id),a._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape);for(var b in this)this[b]=typeof this[b]=="function"?a._removedFactory(b):null;this.removed=!0}},E.attr=function(c,d){if(this.removed)return this;if(c==null){var e={};for(var f in this.attrs)this.attrs[b](f)&&(e[f]=this.attrs[f]);e.gradient&&e.fill=="none"&&(e.fill=e.gradient)&&delete e.gradient,e.transform=this._.transform;return e}if(d==null&&a.is(c,"string")){if(c==j&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;var g=c.split(k),h={};for(var i=0,m=g.length;i<m;i++)c=g[i],c in this.attrs?h[c]=this.attrs[c]:a.is(this.paper.customAttributes[c],"function")?h[c]=this.paper.customAttributes[c].def:h[c]=a._availableAttrs[c];return m-1?h:h[g[0]]}if(this.attrs&&d==null&&a.is(c,"array")){h={};for(i=0,m=c.length;i<m;i++)h[c[i]]=this.attr(c[i]);return h}var n;d!=null&&(n={},n[c]=d),d==null&&a.is(c,"object")&&(n=c);for(var o in n)l("raphael.attr."+o+"."+this.id,this,n[o]);if(n){for(o in this.paper.customAttributes)if(this.paper.customAttributes[b](o)&&n[b](o)&&a.is(this.paper.customAttributes[o],"function")){var p=this.paper.customAttributes[o].apply(this,[].concat(n[o]));this.attrs[o]=n[o];for(var q in p)p[b](q)&&(n[q]=p[q])}n.text&&this.type=="text"&&(this.textpath.string=n.text),B(this,n)}return this},E.toFront=function(){!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&a._tofront(this,this.paper);return this},E.toBack=function(){if(this.removed)return this;this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),a._toback(this,this.paper));return this},E.insertAfter=function(b){if(this.removed)return this;b.constructor==a.st.constructor&&(b=b[b.length-1]),b.node.nextSibling?b.node.parentNode.insertBefore(this.node,b.node.nextSibling):b.node.parentNode.appendChild(this.node),a._insertafter(this,b,this.paper);return this},E.insertBefore=function(b){if(this.removed)return this;b.constructor==a.st.constructor&&(b=b[0]),b.node.parentNode.insertBefore(this.node,b.node),a._insertbefore(this,b,this.paper);return this},E.blur=function(b){var c=this.node.runtimeStyle,d=c.filter;d=d.replace(r,o),+b!==0?(this.attrs.blur=b,c.filter=d+n+m+".Blur(pixelradius="+(+b||1.5)+")",c.margin=a.format("-{0}px 0 0 -{0}px",f(+b||1.5))):(c.filter=d,c.margin=0,delete this.attrs.blur)},a._engine.path=function(a,b){var c=F("shape");c.style.cssText=t,c.coordsize=u+n+u,c.coordorigin=b.coordorigin;var d=new D(c,b),e={fill:"none",stroke:"#000"};a&&(e.path=a),d.type="path",d.path=[],d.Path=o,B(d,e),b.canvas.appendChild(c);var f=F("skew");f.on=!0,c.appendChild(f),d.skew=f,d.transform(o);return d},a._engine.rect=function(b,c,d,e,f,g){var h=a._rectPath(c,d,e,f,g),i=b.path(h),j=i.attrs;i.X=j.x=c,i.Y=j.y=d,i.W=j.width=e,i.H=j.height=f,j.r=g,j.path=h,i.type="rect";return i},a._engine.ellipse=function(a,b,c,d,e){var f=a.path(),g=f.attrs;f.X=b-d,f.Y=c-e,f.W=d*2,f.H=e*2,f.type="ellipse",B(f,{cx:b,cy:c,rx:d,ry:e});return f},a._engine.circle=function(a,b,c,d){var e=a.path(),f=e.attrs;e.X=b-d,e.Y=c-d,e.W=e.H=d*2,e.type="circle",B(e,{cx:b,cy:c,r:d});return e},a._engine.image=function(b,c,d,e,f,g){var h=a._rectPath(d,e,f,g),i=b.path(h).attr({stroke:"none"}),k=i.attrs,l=i.node,m=l.getElementsByTagName(j)[0];k.src=c,i.X=k.x=d,i.Y=k.y=e,i.W=k.width=f,i.H=k.height=g,k.path=h,i.type="image",m.parentNode==l&&l.removeChild(m),m.rotate=!0,m.src=c,m.type="tile",i._.fillpos=[d,e],i._.fillsize=[f,g],l.appendChild(m),z(i,1,1,0,0,0);return i},a._engine.text=function(b,d,e,g){var h=F("shape"),i=F("path"),j=F("textpath");d=d||0,e=e||0,g=g||"",i.v=a.format("m{0},{1}l{2},{1}",f(d*u),f(e*u),f(d*u)+1),i.textpathok=!0,j.string=c(g),j.on=!0,h.style.cssText=t,h.coordsize=u+n+u,h.coordorigin="0 0";var k=new D(h,b),l={fill:"#000",stroke:"none",font:a._availableAttrs.font,text:g};k.shape=h,k.path=i,k.textpath=j,k.type="text",k.attrs.text=c(g),k.attrs.x=d,k.attrs.y=e,k.attrs.w=1,k.attrs.h=1,B(k,l),h.appendChild(j),h.appendChild(i),b.canvas.appendChild(h);var m=F("skew");m.on=!0,h.appendChild(m),k.skew=m,k.transform(o);return k},a._engine.setSize=function(b,c){var d=this.canvas.style;this.width=b,this.height=c,b==+b&&(b+="px"),c==+c&&(c+="px"),d.width=b,d.height=c,d.clip="rect(0 "+b+" "+c+" 0)",this._viewBox&&a._engine.setViewBox.apply(this,this._viewBox);return this},a._engine.setViewBox=function(b,c,d,e,f){a.eve("raphael.setViewBox",this,this._viewBox,[b,c,d,e,f]);var h=this.width,i=this.height,j=1/g(d/h,e/i),k,l;f&&(k=i/e,l=h/d,d*k<h&&(b-=(h-d*k)/2/k),e*l<i&&(c-=(i-e*l)/2/l)),this._viewBox=[b,c,d,e,!!f],this._viewBoxShift={dx:-b,dy:-c,scale:j},this.forEach(function(a){a.transform("...")});return this};var F;a._engine.initWin=function(a){var b=a.document;b.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!b.namespaces.rvml&&b.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),F=function(a){return b.createElement("<rvml:"+a+' class="rvml">')}}catch(c){F=function(a){return b.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},a._engine.initWin(a._g.win),a._engine.create=function(){var b=a._getContainer.apply(0,arguments),c=b.container,d=b.height,e,f=b.width,g=b.x,h=b.y;if(!c)throw new Error("VML container not found.");var i=new a._Paper,j=i.canvas=a._g.doc.createElement("div"),k=j.style;g=g||0,h=h||0,f=f||512,d=d||342,i.width=f,i.height=d,f==+f&&(f+="px"),d==+d&&(d+="px"),i.coordsize=u*1e3+n+u*1e3,i.coordorigin="0 0",i.span=a._g.doc.createElement("span"),i.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",j.appendChild(i.span),k.cssText=a.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",f,d),c==1?(a._g.doc.body.appendChild(j),k.left=g+"px",k.top=h+"px",k.position="absolute"):c.firstChild?c.insertBefore(j,c.firstChild):c.appendChild(j),i.renderfix=function(){};return i},a.prototype.clear=function(){a.eve("raphael.clear",this),this.canvas.innerHTML=o,this.span=a._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},a.prototype.remove=function(){a.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var b in this)this[b]=typeof this[b]=="function"?a._removedFactory(b):null;return!0};var G=a.st;for(var H in E)E[b](H)&&!G[b](H)&&(G[H]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(H))}(window.Raphael);
20
+
21
+ //morris
22
+ /* @license
23
+ morris.js v0.5.0
24
+ Copyright 2014 Olly Smith All rights reserved.
25
+ Licensed under the BSD-2-Clause License.
26
+ */
27
+ (function(){var a,b,c,d,e=[].slice,f=function(a,b){return function(){return a.apply(b,arguments)}},g={}.hasOwnProperty,h=function(a,b){function c(){this.constructor=a}for(var d in b)g.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},i=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};b=window.Morris={},a=jQuery,b.EventEmitter=function(){function a(){}return a.prototype.on=function(a,b){return null==this.handlers&&(this.handlers={}),null==this.handlers[a]&&(this.handlers[a]=[]),this.handlers[a].push(b),this},a.prototype.fire=function(){var a,b,c,d,f,g,h;if(c=arguments[0],a=2<=arguments.length?e.call(arguments,1):[],null!=this.handlers&&null!=this.handlers[c]){for(g=this.handlers[c],h=[],d=0,f=g.length;f>d;d++)b=g[d],h.push(b.apply(null,a));return h}},a}(),b.commas=function(a){var b,c,d,e;return null!=a?(d=0>a?"-":"",b=Math.abs(a),c=Math.floor(b).toFixed(0),d+=c.replace(/(?=(?:\d{3})+$)(?!^)/g,","),e=b.toString(),e.length>c.length&&(d+=e.slice(c.length)),d):"-"},b.pad2=function(a){return(10>a?"0":"")+a},b.Grid=function(c){function d(b){this.resizeHandler=f(this.resizeHandler,this);var c=this;if(this.el="string"==typeof b.element?a(document.getElementById(b.element)):a(b.element),null==this.el||0===this.el.length)throw new Error("Graph container element not found");"static"===this.el.css("position")&&this.el.css("position","relative"),this.options=a.extend({},this.gridDefaults,this.defaults||{},b),"string"==typeof this.options.units&&(this.options.postUnits=b.units),this.raphael=new Raphael(this.el[0]),this.elementWidth=null,this.elementHeight=null,this.dirty=!1,this.selectFrom=null,this.init&&this.init(),this.setData(this.options.data),this.el.bind("mousemove",function(a){var b,d,e,f,g;return d=c.el.offset(),g=a.pageX-d.left,c.selectFrom?(b=c.data[c.hitTest(Math.min(g,c.selectFrom))]._x,e=c.data[c.hitTest(Math.max(g,c.selectFrom))]._x,f=e-b,c.selectionRect.attr({x:b,width:f})):c.fire("hovermove",g,a.pageY-d.top)}),this.el.bind("mouseleave",function(){return c.selectFrom&&(c.selectionRect.hide(),c.selectFrom=null),c.fire("hoverout")}),this.el.bind("touchstart touchmove touchend",function(a){var b,d;return d=a.originalEvent.touches[0]||a.originalEvent.changedTouches[0],b=c.el.offset(),c.fire("hovermove",d.pageX-b.left,d.pageY-b.top)}),this.el.bind("click",function(a){var b;return b=c.el.offset(),c.fire("gridclick",a.pageX-b.left,a.pageY-b.top)}),this.options.rangeSelect&&(this.selectionRect=this.raphael.rect(0,0,0,this.el.innerHeight()).attr({fill:this.options.rangeSelectColor,stroke:!1}).toBack().hide(),this.el.bind("mousedown",function(a){var b;return b=c.el.offset(),c.startRange(a.pageX-b.left)}),this.el.bind("mouseup",function(a){var b;return b=c.el.offset(),c.endRange(a.pageX-b.left),c.fire("hovermove",a.pageX-b.left,a.pageY-b.top)})),this.options.resize&&a(window).bind("resize",function(){return null!=c.timeoutId&&window.clearTimeout(c.timeoutId),c.timeoutId=window.setTimeout(c.resizeHandler,100)}),this.el.css("-webkit-tap-highlight-color","rgba(0,0,0,0)"),this.postInit&&this.postInit()}return h(d,c),d.prototype.gridDefaults={dateFormat:null,axes:!0,grid:!0,gridLineColor:"#aaa",gridStrokeWidth:.5,gridTextColor:"#888",gridTextSize:12,gridTextFamily:"sans-serif",gridTextWeight:"normal",hideHover:!1,yLabelFormat:null,xLabelAngle:0,numLines:5,padding:25,parseTime:!0,postUnits:"",preUnits:"",ymax:"auto",ymin:"auto 0",goals:[],goalStrokeWidth:1,goalLineColors:["#666633","#999966","#cc6666","#663333"],events:[],eventStrokeWidth:1,eventLineColors:["#005a04","#ccffbb","#3a5f0b","#005502"],rangeSelect:null,rangeSelectColor:"#eef",resize:!1},d.prototype.setData=function(a,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;return null==c&&(c=!0),this.options.data=a,null==a||0===a.length?(this.data=[],this.raphael.clear(),null!=this.hover&&this.hover.hide(),void 0):(o=this.cumulative?0:null,p=this.cumulative?0:null,this.options.goals.length>0&&(h=Math.min.apply(Math,this.options.goals),g=Math.max.apply(Math,this.options.goals),p=null!=p?Math.min(p,h):h,o=null!=o?Math.max(o,g):g),this.data=function(){var c,d,g;for(g=[],f=c=0,d=a.length;d>c;f=++c)j=a[f],i={src:j},i.label=j[this.options.xkey],this.options.parseTime?(i.x=b.parseDate(i.label),this.options.dateFormat?i.label=this.options.dateFormat(i.x):"number"==typeof i.label&&(i.label=new Date(i.label).toString())):(i.x=f,this.options.xLabelFormat&&(i.label=this.options.xLabelFormat(i))),l=0,i.y=function(){var a,b,c,d;for(c=this.options.ykeys,d=[],e=a=0,b=c.length;b>a;e=++a)n=c[e],q=j[n],"string"==typeof q&&(q=parseFloat(q)),null!=q&&"number"!=typeof q&&(q=null),null!=q&&(this.cumulative?l+=q:null!=o?(o=Math.max(q,o),p=Math.min(q,p)):o=p=q),this.cumulative&&null!=l&&(o=Math.max(l,o),p=Math.min(l,p)),d.push(q);return d}.call(this),g.push(i);return g}.call(this),this.options.parseTime&&(this.data=this.data.sort(function(a,b){return(a.x>b.x)-(b.x>a.x)})),this.xmin=this.data[0].x,this.xmax=this.data[this.data.length-1].x,this.events=[],this.options.events.length>0&&(this.events=this.options.parseTime?function(){var a,c,e,f;for(e=this.options.events,f=[],a=0,c=e.length;c>a;a++)d=e[a],f.push(b.parseDate(d));return f}.call(this):this.options.events,this.xmax=Math.max(this.xmax,Math.max.apply(Math,this.events)),this.xmin=Math.min(this.xmin,Math.min.apply(Math,this.events))),this.xmin===this.xmax&&(this.xmin-=1,this.xmax+=1),this.ymin=this.yboundary("min",p),this.ymax=this.yboundary("max",o),this.ymin===this.ymax&&(p&&(this.ymin-=1),this.ymax+=1),((r=this.options.axes)===!0||"both"===r||"y"===r||this.options.grid===!0)&&(this.options.ymax===this.gridDefaults.ymax&&this.options.ymin===this.gridDefaults.ymin?(this.grid=this.autoGridLines(this.ymin,this.ymax,this.options.numLines),this.ymin=Math.min(this.ymin,this.grid[0]),this.ymax=Math.max(this.ymax,this.grid[this.grid.length-1])):(k=(this.ymax-this.ymin)/(this.options.numLines-1),this.grid=function(){var a,b,c,d;for(d=[],m=a=b=this.ymin,c=this.ymax;k>0?c>=a:a>=c;m=a+=k)d.push(m);return d}.call(this))),this.dirty=!0,c?this.redraw():void 0)},d.prototype.yboundary=function(a,b){var c,d;return c=this.options["y"+a],"string"==typeof c?"auto"===c.slice(0,4)?c.length>5?(d=parseInt(c.slice(5),10),null==b?d:Math[a](b,d)):null!=b?b:0:parseInt(c,10):c},d.prototype.autoGridLines=function(a,b,c){var d,e,f,g,h,i,j,k,l;return h=b-a,l=Math.floor(Math.log(h)/Math.log(10)),j=Math.pow(10,l),e=Math.floor(a/j)*j,d=Math.ceil(b/j)*j,i=(d-e)/(c-1),1===j&&i>1&&Math.ceil(i)!==i&&(i=Math.ceil(i),d=e+i*(c-1)),0>e&&d>0&&(e=Math.floor(a/i)*i,d=Math.ceil(b/i)*i),1>i?(g=Math.floor(Math.log(i)/Math.log(10)),f=function(){var a,b;for(b=[],k=a=e;i>0?d>=a:a>=d;k=a+=i)b.push(parseFloat(k.toFixed(1-g)));return b}()):f=function(){var a,b;for(b=[],k=a=e;i>0?d>=a:a>=d;k=a+=i)b.push(k);return b}(),f},d.prototype._calc=function(){var a,b,c,d,e,f,g,h;return e=this.el.width(),c=this.el.height(),(this.elementWidth!==e||this.elementHeight!==c||this.dirty)&&(this.elementWidth=e,this.elementHeight=c,this.dirty=!1,this.left=this.options.padding,this.right=this.elementWidth-this.options.padding,this.top=this.options.padding,this.bottom=this.elementHeight-this.options.padding,((g=this.options.axes)===!0||"both"===g||"y"===g)&&(f=function(){var a,c,d,e;for(d=this.grid,e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(this.measureText(this.yAxisFormat(b)).width);return e}.call(this),this.left+=Math.max.apply(Math,f)),((h=this.options.axes)===!0||"both"===h||"x"===h)&&(a=function(){var a,b,c;for(c=[],d=a=0,b=this.data.length;b>=0?b>a:a>b;d=b>=0?++a:--a)c.push(this.measureText(this.data[d].text,-this.options.xLabelAngle).height);return c}.call(this),this.bottom-=Math.max.apply(Math,a)),this.width=Math.max(1,this.right-this.left),this.height=Math.max(1,this.bottom-this.top),this.dx=this.width/(this.xmax-this.xmin),this.dy=this.height/(this.ymax-this.ymin),this.calc)?this.calc():void 0},d.prototype.transY=function(a){return this.bottom-(a-this.ymin)*this.dy},d.prototype.transX=function(a){return 1===this.data.length?(this.left+this.right)/2:this.left+(a-this.xmin)*this.dx},d.prototype.redraw=function(){return this.raphael.clear(),this._calc(),this.drawGrid(),this.drawGoals(),this.drawEvents(),this.draw?this.draw():void 0},d.prototype.measureText=function(a,b){var c,d;return null==b&&(b=0),d=this.raphael.text(100,100,a).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).rotate(b),c=d.getBBox(),d.remove(),c},d.prototype.yAxisFormat=function(a){return this.yLabelFormat(a)},d.prototype.yLabelFormat=function(a){return"function"==typeof this.options.yLabelFormat?this.options.yLabelFormat(a):""+this.options.preUnits+b.commas(a)+this.options.postUnits},d.prototype.drawGrid=function(){var a,b,c,d,e,f,g,h;if(this.options.grid!==!1||(e=this.options.axes)===!0||"both"===e||"y"===e){for(f=this.grid,h=[],c=0,d=f.length;d>c;c++)a=f[c],b=this.transY(a),((g=this.options.axes)===!0||"both"===g||"y"===g)&&this.drawYAxisLabel(this.left-this.options.padding/2,b,this.yAxisFormat(a)),this.options.grid?h.push(this.drawGridLine("M"+this.left+","+b+"H"+(this.left+this.width))):h.push(void 0);return h}},d.prototype.drawGoals=function(){var a,b,c,d,e,f,g;for(f=this.options.goals,g=[],c=d=0,e=f.length;e>d;c=++d)b=f[c],a=this.options.goalLineColors[c%this.options.goalLineColors.length],g.push(this.drawGoal(b,a));return g},d.prototype.drawEvents=function(){var a,b,c,d,e,f,g;for(f=this.events,g=[],c=d=0,e=f.length;e>d;c=++d)b=f[c],a=this.options.eventLineColors[c%this.options.eventLineColors.length],g.push(this.drawEvent(b,a));return g},d.prototype.drawGoal=function(a,b){return this.raphael.path("M"+this.left+","+this.transY(a)+"H"+this.right).attr("stroke",b).attr("stroke-width",this.options.goalStrokeWidth)},d.prototype.drawEvent=function(a,b){return this.raphael.path("M"+this.transX(a)+","+this.bottom+"V"+this.top).attr("stroke",b).attr("stroke-width",this.options.eventStrokeWidth)},d.prototype.drawYAxisLabel=function(a,b,c){return this.raphael.text(a,b,c).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor).attr("text-anchor","end")},d.prototype.drawGridLine=function(a){return this.raphael.path(a).attr("stroke",this.options.gridLineColor).attr("stroke-width",this.options.gridStrokeWidth)},d.prototype.startRange=function(a){return this.hover.hide(),this.selectFrom=a,this.selectionRect.attr({x:a,width:0}).show()},d.prototype.endRange=function(a){var b,c;return this.selectFrom?(c=Math.min(this.selectFrom,a),b=Math.max(this.selectFrom,a),this.options.rangeSelect.call(this.el,{start:this.data[this.hitTest(c)].x,end:this.data[this.hitTest(b)].x}),this.selectFrom=null):void 0},d.prototype.resizeHandler=function(){return this.timeoutId=null,this.raphael.setSize(this.el.width(),this.el.height()),this.redraw()},d}(b.EventEmitter),b.parseDate=function(a){var b,c,d,e,f,g,h,i,j,k,l;return"number"==typeof a?a:(c=a.match(/^(\d+) Q(\d)$/),e=a.match(/^(\d+)-(\d+)$/),f=a.match(/^(\d+)-(\d+)-(\d+)$/),h=a.match(/^(\d+) W(\d+)$/),i=a.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+)(Z|([+-])(\d\d):?(\d\d))?$/),j=a.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+):(\d+(\.\d+)?)(Z|([+-])(\d\d):?(\d\d))?$/),c?new Date(parseInt(c[1],10),3*parseInt(c[2],10)-1,1).getTime():e?new Date(parseInt(e[1],10),parseInt(e[2],10)-1,1).getTime():f?new Date(parseInt(f[1],10),parseInt(f[2],10)-1,parseInt(f[3],10)).getTime():h?(k=new Date(parseInt(h[1],10),0,1),4!==k.getDay()&&k.setMonth(0,1+(4-k.getDay()+7)%7),k.getTime()+6048e5*parseInt(h[2],10)):i?i[6]?(g=0,"Z"!==i[6]&&(g=60*parseInt(i[8],10)+parseInt(i[9],10),"+"===i[7]&&(g=0-g)),Date.UTC(parseInt(i[1],10),parseInt(i[2],10)-1,parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10)+g)):new Date(parseInt(i[1],10),parseInt(i[2],10)-1,parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10)).getTime():j?(l=parseFloat(j[6]),b=Math.floor(l),d=Math.round(1e3*(l-b)),j[8]?(g=0,"Z"!==j[8]&&(g=60*parseInt(j[10],10)+parseInt(j[11],10),"+"===j[9]&&(g=0-g)),Date.UTC(parseInt(j[1],10),parseInt(j[2],10)-1,parseInt(j[3],10),parseInt(j[4],10),parseInt(j[5],10)+g,b,d)):new Date(parseInt(j[1],10),parseInt(j[2],10)-1,parseInt(j[3],10),parseInt(j[4],10),parseInt(j[5],10),b,d).getTime()):new Date(parseInt(a,10),0,1).getTime())},b.Hover=function(){function c(c){null==c&&(c={}),this.options=a.extend({},b.Hover.defaults,c),this.el=a("<div class='"+this.options["class"]+"'></div>"),this.el.hide(),this.options.parent.append(this.el)}return c.defaults={"class":"morris-hover morris-default-style"},c.prototype.update=function(a,b,c){return a?(this.html(a),this.show(),this.moveTo(b,c)):this.hide()},c.prototype.html=function(a){return this.el.html(a)},c.prototype.moveTo=function(a,b){var c,d,e,f,g,h;return g=this.options.parent.innerWidth(),f=this.options.parent.innerHeight(),d=this.el.outerWidth(),c=this.el.outerHeight(),e=Math.min(Math.max(0,a-d/2),g-d),null!=b?(h=b-c-10,0>h&&(h=b+10,h+c>f&&(h=f/2-c/2))):h=f/2-c/2,this.el.css({left:e+"px",top:parseInt(h)+"px"})},c.prototype.show=function(){return this.el.show()},c.prototype.hide=function(){return this.el.hide()},c}(),b.Line=function(a){function c(a){return this.hilight=f(this.hilight,this),this.onHoverOut=f(this.onHoverOut,this),this.onHoverMove=f(this.onHoverMove,this),this.onGridClick=f(this.onGridClick,this),this instanceof b.Line?(c.__super__.constructor.call(this,a),void 0):new b.Line(a)}return h(c,a),c.prototype.init=function(){return"always"!==this.options.hideHover?(this.hover=new b.Hover({parent:this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)):void 0},c.prototype.defaults={lineWidth:3,pointSize:4,lineColors:["#0b62a4","#7A92A3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],pointStrokeWidths:[1],pointStrokeColors:["#ffffff"],pointFillColors:[],smooth:!0,xLabels:"auto",xLabelFormat:null,xLabelMargin:24,hideHover:!1},c.prototype.calc=function(){return this.calcPoints(),this.generatePaths()},c.prototype.calcPoints=function(){var a,b,c,d,e,f;for(e=this.data,f=[],c=0,d=e.length;d>c;c++)a=e[c],a._x=this.transX(a.x),a._y=function(){var c,d,e,f;for(e=a.y,f=[],c=0,d=e.length;d>c;c++)b=e[c],null!=b?f.push(this.transY(b)):f.push(b);return f}.call(this),f.push(a._ymax=Math.min.apply(Math,[this.bottom].concat(function(){var c,d,e,f;for(e=a._y,f=[],c=0,d=e.length;d>c;c++)b=e[c],null!=b&&f.push(b);return f}())));return f},c.prototype.hitTest=function(a){var b,c,d,e,f;if(0===this.data.length)return null;for(f=this.data.slice(1),b=d=0,e=f.length;e>d&&(c=f[b],!(a<(c._x+this.data[b]._x)/2));b=++d);return b},c.prototype.onGridClick=function(a,b){var c;return c=this.hitTest(a),this.fire("click",c,this.data[c].src,a,b)},c.prototype.onHoverMove=function(a){var b;return b=this.hitTest(a),this.displayHoverForRow(b)},c.prototype.onHoverOut=function(){return this.options.hideHover!==!1?this.displayHoverForRow(null):void 0},c.prototype.displayHoverForRow=function(a){var b;return null!=a?((b=this.hover).update.apply(b,this.hoverContentForRow(a)),this.hilight(a)):(this.hover.hide(),this.hilight())},c.prototype.hoverContentForRow=function(a){var b,c,d,e,f,g,h;for(d=this.data[a],b="<div class='morris-hover-row-label'>"+d.label+"</div>",h=d.y,c=f=0,g=h.length;g>f;c=++f)e=h[c],b+="<div class='morris-hover-point' style='color: "+this.colorFor(d,c,"label")+"'>\n "+this.options.labels[c]+":\n "+this.yLabelFormat(e)+"\n</div>";return"function"==typeof this.options.hoverCallback&&(b=this.options.hoverCallback(a,this.options,b,d.src)),[b,d._x,d._ymax]},c.prototype.generatePaths=function(){var a,c,d,e;return this.paths=function(){var f,g,h,j;for(j=[],c=f=0,g=this.options.ykeys.length;g>=0?g>f:f>g;c=g>=0?++f:--f)e="boolean"==typeof this.options.smooth?this.options.smooth:(h=this.options.ykeys[c],i.call(this.options.smooth,h)>=0),a=function(){var a,b,e,f;for(e=this.data,f=[],a=0,b=e.length;b>a;a++)d=e[a],void 0!==d._y[c]&&f.push({x:d._x,y:d._y[c]});return f}.call(this),a.length>1?j.push(b.Line.createPath(a,e,this.bottom)):j.push(null);return j}.call(this)},c.prototype.draw=function(){var a;return((a=this.options.axes)===!0||"both"===a||"x"===a)&&this.drawXAxis(),this.drawSeries(),this.options.hideHover===!1?this.displayHoverForRow(this.data.length-1):void 0},c.prototype.drawXAxis=function(){var a,c,d,e,f,g,h,i,j,k,l=this;for(h=this.bottom+this.options.padding/2,f=null,e=null,a=function(a,b){var c,d,g,i,j;return c=l.drawXAxisLabel(l.transX(b),h,a),j=c.getBBox(),c.transform("r"+-l.options.xLabelAngle),d=c.getBBox(),c.transform("t0,"+d.height/2+"..."),0!==l.options.xLabelAngle&&(i=-.5*j.width*Math.cos(l.options.xLabelAngle*Math.PI/180),c.transform("t"+i+",0...")),d=c.getBBox(),(null==f||f>=d.x+d.width||null!=e&&e>=d.x)&&d.x>=0&&d.x+d.width<l.el.width()?(0!==l.options.xLabelAngle&&(g=1.25*l.options.gridTextSize/Math.sin(l.options.xLabelAngle*Math.PI/180),e=d.x-g),f=d.x-l.options.xLabelMargin):c.remove()},d=this.options.parseTime?1===this.data.length&&"auto"===this.options.xLabels?[[this.data[0].label,this.data[0].x]]:b.labelSeries(this.xmin,this.xmax,this.width,this.options.xLabels,this.options.xLabelFormat):function(){var a,b,c,d;for(c=this.data,d=[],a=0,b=c.length;b>a;a++)g=c[a],d.push([g.label,g.x]);return d}.call(this),d.reverse(),k=[],i=0,j=d.length;j>i;i++)c=d[i],k.push(a(c[0],c[1]));return k},c.prototype.drawSeries=function(){var a,b,c,d,e,f;for(this.seriesPoints=[],a=b=d=this.options.ykeys.length-1;0>=d?0>=b:b>=0;a=0>=d?++b:--b)this._drawLineFor(a);for(f=[],a=c=e=this.options.ykeys.length-1;0>=e?0>=c:c>=0;a=0>=e?++c:--c)f.push(this._drawPointFor(a));return f},c.prototype._drawPointFor=function(a){var b,c,d,e,f,g;for(this.seriesPoints[a]=[],f=this.data,g=[],d=0,e=f.length;e>d;d++)c=f[d],b=null,null!=c._y[a]&&(b=this.drawLinePoint(c._x,c._y[a],this.colorFor(c,a,"point"),a)),g.push(this.seriesPoints[a].push(b));return g},c.prototype._drawLineFor=function(a){var b;return b=this.paths[a],null!==b?this.drawLinePath(b,this.colorFor(null,a,"line"),a):void 0},c.createPath=function(a,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(k="",c&&(g=b.Line.gradients(a)),l={y:null},h=q=0,r=a.length;r>q;h=++q)e=a[h],null!=e.y&&(null!=l.y?c?(f=g[h],j=g[h-1],i=(e.x-l.x)/4,m=l.x+i,o=Math.min(d,l.y+i*j),n=e.x-i,p=Math.min(d,e.y-i*f),k+="C"+m+","+o+","+n+","+p+","+e.x+","+e.y):k+="L"+e.x+","+e.y:c&&null==g[h]||(k+="M"+e.x+","+e.y)),l=e;return k},c.gradients=function(a){var b,c,d,e,f,g,h,i;for(c=function(a,b){return(a.y-b.y)/(a.x-b.x)},i=[],d=g=0,h=a.length;h>g;d=++g)b=a[d],null!=b.y?(e=a[d+1]||{y:null},f=a[d-1]||{y:null},null!=f.y&&null!=e.y?i.push(c(f,e)):null!=f.y?i.push(c(f,b)):null!=e.y?i.push(c(b,e)):i.push(null)):i.push(null);return i},c.prototype.hilight=function(a){var b,c,d,e,f;if(null!==this.prevHilight&&this.prevHilight!==a)for(b=c=0,e=this.seriesPoints.length-1;e>=0?e>=c:c>=e;b=e>=0?++c:--c)this.seriesPoints[b][this.prevHilight]&&this.seriesPoints[b][this.prevHilight].animate(this.pointShrinkSeries(b));if(null!==a&&this.prevHilight!==a)for(b=d=0,f=this.seriesPoints.length-1;f>=0?f>=d:d>=f;b=f>=0?++d:--d)this.seriesPoints[b][a]&&this.seriesPoints[b][a].animate(this.pointGrowSeries(b));return this.prevHilight=a},c.prototype.colorFor=function(a,b,c){return"function"==typeof this.options.lineColors?this.options.lineColors.call(this,a,b,c):"point"===c?this.options.pointFillColors[b%this.options.pointFillColors.length]||this.options.lineColors[b%this.options.lineColors.length]:this.options.lineColors[b%this.options.lineColors.length]},c.prototype.drawXAxisLabel=function(a,b,c){return this.raphael.text(a,b,c).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor)},c.prototype.drawLinePath=function(a,b,c){return this.raphael.path(a).attr("stroke",b).attr("stroke-width",this.lineWidthForSeries(c))},c.prototype.drawLinePoint=function(a,b,c,d){return this.raphael.circle(a,b,this.pointSizeForSeries(d)).attr("fill",c).attr("stroke-width",this.pointStrokeWidthForSeries(d)).attr("stroke",this.pointStrokeColorForSeries(d))},c.prototype.pointStrokeWidthForSeries=function(a){return this.options.pointStrokeWidths[a%this.options.pointStrokeWidths.length]},c.prototype.pointStrokeColorForSeries=function(a){return this.options.pointStrokeColors[a%this.options.pointStrokeColors.length]},c.prototype.lineWidthForSeries=function(a){return this.options.lineWidth instanceof Array?this.options.lineWidth[a%this.options.lineWidth.length]:this.options.lineWidth},c.prototype.pointSizeForSeries=function(a){return this.options.pointSize instanceof Array?this.options.pointSize[a%this.options.pointSize.length]:this.options.pointSize},c.prototype.pointGrowSeries=function(a){return Raphael.animation({r:this.pointSizeForSeries(a)+3},25,"linear")},c.prototype.pointShrinkSeries=function(a){return Raphael.animation({r:this.pointSizeForSeries(a)},25,"linear")},c}(b.Grid),b.labelSeries=function(c,d,e,f,g){var h,i,j,k,l,m,n,o,p,q,r;if(j=200*(d-c)/e,i=new Date(c),n=b.LABEL_SPECS[f],void 0===n)for(r=b.AUTO_LABEL_ORDER,p=0,q=r.length;q>p;p++)if(k=r[p],m=b.LABEL_SPECS[k],j>=m.span){n=m;break}for(void 0===n&&(n=b.LABEL_SPECS.second),g&&(n=a.extend({},n,{fmt:g})),h=n.start(i),l=[];(o=h.getTime())<=d;)o>=c&&l.push([n.fmt(h),o]),n.incr(h);return l},c=function(a){return{span:60*a*1e3,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours())},fmt:function(a){return""+b.pad2(a.getHours())+":"+b.pad2(a.getMinutes())},incr:function(b){return b.setUTCMinutes(b.getUTCMinutes()+a)}}},d=function(a){return{span:1e3*a,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes())},fmt:function(a){return""+b.pad2(a.getHours())+":"+b.pad2(a.getMinutes())+":"+b.pad2(a.getSeconds())},incr:function(b){return b.setUTCSeconds(b.getUTCSeconds()+a)}}},b.LABEL_SPECS={decade:{span:1728e8,start:function(a){return new Date(a.getFullYear()-a.getFullYear()%10,0,1)},fmt:function(a){return""+a.getFullYear()},incr:function(a){return a.setFullYear(a.getFullYear()+10)}},year:{span:1728e7,start:function(a){return new Date(a.getFullYear(),0,1)},fmt:function(a){return""+a.getFullYear()},incr:function(a){return a.setFullYear(a.getFullYear()+1)}},month:{span:24192e5,start:function(a){return new Date(a.getFullYear(),a.getMonth(),1)},fmt:function(a){return""+a.getFullYear()+"-"+b.pad2(a.getMonth()+1)},incr:function(a){return a.setMonth(a.getMonth()+1)}},week:{span:6048e5,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())},fmt:function(a){return""+a.getFullYear()+"-"+b.pad2(a.getMonth()+1)+"-"+b.pad2(a.getDate())},incr:function(a){return a.setDate(a.getDate()+7)}},day:{span:864e5,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())},fmt:function(a){return""+a.getFullYear()+"-"+b.pad2(a.getMonth()+1)+"-"+b.pad2(a.getDate())},incr:function(a){return a.setDate(a.getDate()+1)}},hour:c(60),"30min":c(30),"15min":c(15),"10min":c(10),"5min":c(5),minute:c(1),"30sec":d(30),"15sec":d(15),"10sec":d(10),"5sec":d(5),second:d(1)},b.AUTO_LABEL_ORDER=["decade","year","month","week","day","hour","30min","15min","10min","5min","minute","30sec","15sec","10sec","5sec","second"],b.Area=function(c){function d(c){var f;return this instanceof b.Area?(f=a.extend({},e,c),this.cumulative=!f.behaveLikeLine,"auto"===f.fillOpacity&&(f.fillOpacity=f.behaveLikeLine?.8:1),d.__super__.constructor.call(this,f),void 0):new b.Area(c)}var e;return h(d,c),e={fillOpacity:"auto",behaveLikeLine:!1},d.prototype.calcPoints=function(){var a,b,c,d,e,f,g;for(f=this.data,g=[],d=0,e=f.length;e>d;d++)a=f[d],a._x=this.transX(a.x),b=0,a._y=function(){var d,e,f,g;for(f=a.y,g=[],d=0,e=f.length;e>d;d++)c=f[d],this.options.behaveLikeLine?g.push(this.transY(c)):(b+=c||0,g.push(this.transY(b)));return g}.call(this),g.push(a._ymax=Math.max.apply(Math,a._y));return g},d.prototype.drawSeries=function(){var a,b,c,d,e,f,g,h;for(this.seriesPoints=[],b=this.options.behaveLikeLine?function(){f=[];for(var a=0,b=this.options.ykeys.length-1;b>=0?b>=a:a>=b;b>=0?a++:a--)f.push(a);return f}.apply(this):function(){g=[];for(var a=e=this.options.ykeys.length-1;0>=e?0>=a:a>=0;0>=e?a++:a--)g.push(a);return g}.apply(this),h=[],c=0,d=b.length;d>c;c++)a=b[c],this._drawFillFor(a),this._drawLineFor(a),h.push(this._drawPointFor(a));return h},d.prototype._drawFillFor=function(a){var b;return b=this.paths[a],null!==b?(b+="L"+this.transX(this.xmax)+","+this.bottom+"L"+this.transX(this.xmin)+","+this.bottom+"Z",this.drawFilledPath(b,this.fillForSeries(a))):void 0},d.prototype.fillForSeries=function(a){var b;return b=Raphael.rgb2hsl(this.colorFor(this.data[a],a,"line")),Raphael.hsl(b.h,this.options.behaveLikeLine?.9*b.s:.75*b.s,Math.min(.98,this.options.behaveLikeLine?1.2*b.l:1.25*b.l))},d.prototype.drawFilledPath=function(a,b){return this.raphael.path(a).attr("fill",b).attr("fill-opacity",this.options.fillOpacity).attr("stroke","none")},d}(b.Line),b.Bar=function(c){function d(c){return this.onHoverOut=f(this.onHoverOut,this),this.onHoverMove=f(this.onHoverMove,this),this.onGridClick=f(this.onGridClick,this),this instanceof b.Bar?(d.__super__.constructor.call(this,a.extend({},c,{parseTime:!1})),void 0):new b.Bar(c)}return h(d,c),d.prototype.init=function(){return this.cumulative=this.options.stacked,"always"!==this.options.hideHover?(this.hover=new b.Hover({parent:this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)):void 0},d.prototype.defaults={barSizeRatio:.75,barGap:3,barColors:["#0b62a4","#7a92a3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],barOpacity:1,barRadius:[0,0,0,0],xLabelMargin:50},d.prototype.calc=function(){var a;return this.calcBars(),this.options.hideHover===!1?(a=this.hover).update.apply(a,this.hoverContentForRow(this.data.length-1)):void 0},d.prototype.calcBars=function(){var a,b,c,d,e,f,g;for(f=this.data,g=[],a=d=0,e=f.length;e>d;a=++d)b=f[a],b._x=this.left+this.width*(a+.5)/this.data.length,g.push(b._y=function(){var a,d,e,f;for(e=b.y,f=[],a=0,d=e.length;d>a;a++)c=e[a],null!=c?f.push(this.transY(c)):f.push(null);return f}.call(this));return g},d.prototype.draw=function(){var a;return((a=this.options.axes)===!0||"both"===a||"x"===a)&&this.drawXAxis(),this.drawSeries()},d.prototype.drawXAxis=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m;for(j=this.bottom+(this.options.xAxisLabelTopPadding||this.options.padding/2),g=null,f=null,m=[],a=k=0,l=this.data.length;l>=0?l>k:k>l;a=l>=0?++k:--k)h=this.data[this.data.length-1-a],b=this.drawXAxisLabel(h._x,j,h.label),i=b.getBBox(),b.transform("r"+-this.options.xLabelAngle),c=b.getBBox(),b.transform("t0,"+c.height/2+"..."),0!==this.options.xLabelAngle&&(e=-.5*i.width*Math.cos(this.options.xLabelAngle*Math.PI/180),b.transform("t"+e+",0...")),(null==g||g>=c.x+c.width||null!=f&&f>=c.x)&&c.x>=0&&c.x+c.width<this.el.width()?(0!==this.options.xLabelAngle&&(d=1.25*this.options.gridTextSize/Math.sin(this.options.xLabelAngle*Math.PI/180),f=c.x-d),m.push(g=c.x-this.options.xLabelMargin)):m.push(b.remove());return m},d.prototype.drawSeries=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;return c=this.width/this.options.data.length,h=this.options.stacked?1:this.options.ykeys.length,a=(c*this.options.barSizeRatio-this.options.barGap*(h-1))/h,this.options.barSize&&(a=Math.min(a,this.options.barSize)),l=c-a*h-this.options.barGap*(h-1),g=l/2,o=this.ymin<=0&&this.ymax>=0?this.transY(0):null,this.bars=function(){var h,l,p,q;for(p=this.data,q=[],d=h=0,l=p.length;l>h;d=++h)i=p[d],e=0,q.push(function(){var h,l,p,q;for(p=i._y,q=[],j=h=0,l=p.length;l>h;j=++h)n=p[j],null!==n?(o?(m=Math.min(n,o),b=Math.max(n,o)):(m=n,b=this.bottom),f=this.left+d*c+g,this.options.stacked||(f+=j*(a+this.options.barGap)),k=b-m,this.options.verticalGridCondition&&this.options.verticalGridCondition(i.x)&&this.drawBar(this.left+d*c,this.top,c,Math.abs(this.top-this.bottom),this.options.verticalGridColor,this.options.verticalGridOpacity,this.options.barRadius),this.options.stacked&&(m-=e),this.drawBar(f,m,a,k,this.colorFor(i,j,"bar"),this.options.barOpacity,this.options.barRadius),q.push(e+=k)):q.push(null);return q}.call(this));return q}.call(this)},d.prototype.colorFor=function(a,b,c){var d,e;return"function"==typeof this.options.barColors?(d={x:a.x,y:a.y[b],label:a.label},e={index:b,key:this.options.ykeys[b],label:this.options.labels[b]},this.options.barColors.call(this,d,e,c)):this.options.barColors[b%this.options.barColors.length]},d.prototype.hitTest=function(a){return 0===this.data.length?null:(a=Math.max(Math.min(a,this.right),this.left),Math.min(this.data.length-1,Math.floor((a-this.left)/(this.width/this.data.length))))},d.prototype.onGridClick=function(a,b){var c;return c=this.hitTest(a),this.fire("click",c,this.data[c].src,a,b)},d.prototype.onHoverMove=function(a){var b,c;return b=this.hitTest(a),(c=this.hover).update.apply(c,this.hoverContentForRow(b))},d.prototype.onHoverOut=function(){return this.options.hideHover!==!1?this.hover.hide():void 0},d.prototype.hoverContentForRow=function(a){var b,c,d,e,f,g,h,i;for(d=this.data[a],b="<div class='morris-hover-row-label'>"+d.label+"</div>",i=d.y,c=g=0,h=i.length;h>g;c=++g)f=i[c],b+="<div class='morris-hover-point' style='color: "+this.colorFor(d,c,"label")+"'>\n "+this.options.labels[c]+":\n "+this.yLabelFormat(f)+"\n</div>";return"function"==typeof this.options.hoverCallback&&(b=this.options.hoverCallback(a,this.options,b,d.src)),e=this.left+(a+.5)*this.width/this.data.length,[b,e]},d.prototype.drawXAxisLabel=function(a,b,c){var d;return d=this.raphael.text(a,b,c).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor)},d.prototype.drawBar=function(a,b,c,d,e,f,g){var h,i;return h=Math.max.apply(Math,g),i=0===h||h>d?this.raphael.rect(a,b,c,d):this.raphael.path(this.roundedRect(a,b,c,d,g)),i.attr("fill",e).attr("fill-opacity",f).attr("stroke","none")},d.prototype.roundedRect=function(a,b,c,d,e){return null==e&&(e=[0,0,0,0]),["M",a,e[0]+b,"Q",a,b,a+e[0],b,"L",a+c-e[1],b,"Q",a+c,b,a+c,b+e[1],"L",a+c,b+d-e[2],"Q",a+c,b+d,a+c-e[2],b+d,"L",a+e[3],b+d,"Q",a,b+d,a,b+d-e[3],"Z"]},d}(b.Grid),b.Donut=function(c){function d(c){this.resizeHandler=f(this.resizeHandler,this),this.select=f(this.select,this),this.click=f(this.click,this);var d=this;if(!(this instanceof b.Donut))return new b.Donut(c);if(this.options=a.extend({},this.defaults,c),this.el="string"==typeof c.element?a(document.getElementById(c.element)):a(c.element),null===this.el||0===this.el.length)throw new Error("Graph placeholder not found.");void 0!==c.data&&0!==c.data.length&&(this.raphael=new Raphael(this.el[0]),this.options.resize&&a(window).bind("resize",function(){return null!=d.timeoutId&&window.clearTimeout(d.timeoutId),d.timeoutId=window.setTimeout(d.resizeHandler,100)}),this.setData(c.data))}return h(d,c),d.prototype.defaults={colors:["#0B62A4","#3980B5","#679DC6","#95BBD7","#B0CCE1","#095791","#095085","#083E67","#052C48","#042135"],backgroundColor:"#FFFFFF",labelColor:"#000000",formatter:b.commas,resize:!1},d.prototype.redraw=function(){var a,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;for(this.raphael.clear(),c=this.el.width()/2,d=this.el.height()/2,n=(Math.min(c,d)-10)/3,l=0,u=this.values,o=0,r=u.length;r>o;o++)m=u[o],l+=m;for(i=5/(2*n),a=1.9999*Math.PI-i*this.data.length,g=0,f=0,this.segments=[],v=this.values,e=p=0,s=v.length;s>p;e=++p)m=v[e],j=g+i+a*(m/l),k=new b.DonutSegment(c,d,2*n,n,g,j,this.data[e].color||this.options.colors[f%this.options.colors.length],this.options.backgroundColor,f,this.raphael),k.render(),this.segments.push(k),k.on("hover",this.select),k.on("click",this.click),g=j,f+=1;for(this.text1=this.drawEmptyDonutLabel(c,d-10,this.options.labelColor,15,800),this.text2=this.drawEmptyDonutLabel(c,d+10,this.options.labelColor,14),h=Math.max.apply(Math,this.values),f=0,w=this.values,x=[],q=0,t=w.length;t>q;q++){if(m=w[q],m===h){this.select(f);
28
  break}x.push(f+=1)}return x},d.prototype.setData=function(a){var b;return this.data=a,this.values=function(){var a,c,d,e;for(d=this.data,e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(parseFloat(b.value));return e}.call(this),this.redraw()},d.prototype.click=function(a){return this.fire("click",a,this.data[a])},d.prototype.select=function(a){var b,c,d,e,f,g;for(g=this.segments,e=0,f=g.length;f>e;e++)c=g[e],c.deselect();return d=this.segments[a],d.select(),b=this.data[a],this.setLabels(b.label,this.options.formatter(b.value,b))},d.prototype.setLabels=function(a,b){var c,d,e,f,g,h,i,j;return c=2*(Math.min(this.el.width()/2,this.el.height()/2)-10)/3,f=1.8*c,e=c/2,d=c/3,this.text1.attr({text:a,transform:""}),g=this.text1.getBBox(),h=Math.min(f/g.width,e/g.height),this.text1.attr({transform:"S"+h+","+h+","+(g.x+g.width/2)+","+(g.y+g.height)}),this.text2.attr({text:b,transform:""}),i=this.text2.getBBox(),j=Math.min(f/i.width,d/i.height),this.text2.attr({transform:"S"+j+","+j+","+(i.x+i.width/2)+","+i.y})},d.prototype.drawEmptyDonutLabel=function(a,b,c,d,e){var f;return f=this.raphael.text(a,b,"").attr("font-size",d).attr("fill",c),null!=e&&f.attr("font-weight",e),f},d.prototype.resizeHandler=function(){return this.timeoutId=null,this.raphael.setSize(this.el.width(),this.el.height()),this.redraw()},d}(b.EventEmitter),b.DonutSegment=function(a){function b(a,b,c,d,e,g,h,i,j,k){this.cx=a,this.cy=b,this.inner=c,this.outer=d,this.color=h,this.backgroundColor=i,this.index=j,this.raphael=k,this.deselect=f(this.deselect,this),this.select=f(this.select,this),this.sin_p0=Math.sin(e),this.cos_p0=Math.cos(e),this.sin_p1=Math.sin(g),this.cos_p1=Math.cos(g),this.is_long=g-e>Math.PI?1:0,this.path=this.calcSegment(this.inner+3,this.inner+this.outer-5),this.selectedPath=this.calcSegment(this.inner+3,this.inner+this.outer),this.hilight=this.calcArc(this.inner)}return h(b,a),b.prototype.calcArcPoints=function(a){return[this.cx+a*this.sin_p0,this.cy+a*this.cos_p0,this.cx+a*this.sin_p1,this.cy+a*this.cos_p1]},b.prototype.calcSegment=function(a,b){var c,d,e,f,g,h,i,j,k,l;return k=this.calcArcPoints(a),c=k[0],e=k[1],d=k[2],f=k[3],l=this.calcArcPoints(b),g=l[0],i=l[1],h=l[2],j=l[3],"M"+c+","+e+("A"+a+","+a+",0,"+this.is_long+",0,"+d+","+f)+("L"+h+","+j)+("A"+b+","+b+",0,"+this.is_long+",1,"+g+","+i)+"Z"},b.prototype.calcArc=function(a){var b,c,d,e,f;return f=this.calcArcPoints(a),b=f[0],d=f[1],c=f[2],e=f[3],"M"+b+","+d+("A"+a+","+a+",0,"+this.is_long+",0,"+c+","+e)},b.prototype.render=function(){var a=this;return this.arc=this.drawDonutArc(this.hilight,this.color),this.seg=this.drawDonutSegment(this.path,this.color,this.backgroundColor,function(){return a.fire("hover",a.index)},function(){return a.fire("click",a.index)})},b.prototype.drawDonutArc=function(a,b){return this.raphael.path(a).attr({stroke:b,"stroke-width":2,opacity:0})},b.prototype.drawDonutSegment=function(a,b,c,d,e){return this.raphael.path(a).attr({fill:b,stroke:c,"stroke-width":3}).hover(d).click(e)},b.prototype.select=function(){return this.selected?void 0:(this.seg.animate({path:this.selectedPath},150,"<>"),this.arc.animate({opacity:1},150,"<>"),this.selected=!0)},b.prototype.deselect=function(){return this.selected?(this.seg.animate({path:this.path},150,"<>"),this.arc.animate({opacity:0},150,"<>"),this.selected=!1):void 0},b}(b.EventEmitter)}).call(this);
skin/adminhtml/default/default/pptrack/js/pptrack.js CHANGED
File without changes
skin/frontend/base/default/css/pptrack.css CHANGED
@@ -1,699 +1,794 @@
1
- .pptrack-index-index .main-container {
2
- -webkit-font-smoothing: antialiased;
3
- color: #676669;
4
- }
5
- .pptrack-wrapper {
6
- -webkit-font-smoothing: antialiased;
7
- color: #676669;
8
- margin-bottom: 20px;
9
- }
10
- .pptrack-wrapper h3 {
11
- color: #676669;
12
- }
13
-
14
- .pptrack-wrapper a {
15
- color: #676669;
16
- }
17
-
18
- .pptrack-crossSellingItems {
19
- padding-bottom: 50px;
20
- }
21
- .pptrack-progress {
22
- height: 165px;
23
- width: 100%;
24
- background: #f5f5f5;
25
- position: relative;
26
- -webkit-border-radius: 2px;
27
- -moz-border-radius: 2px;
28
- border-radius: 2px;
29
- }
30
- ul.pptrack-progress-bar {
31
- list-style: none;
32
- margin: 65px 0 0;
33
- padding: 0;
34
- display: table;
35
- width: 100%;
36
- }
37
- ul.pptrack-progress-bar li {
38
- display: table-cell;
39
- position: relative;
40
- }
41
- ul.pptrack-progress-bar li:before {
42
- position: absolute;
43
- content: "";
44
- background: #dee2e7;
45
- height: 5px;
46
- width: 100%;
47
- top: -2px;
48
- }
49
- ul.pptrack-progress-bar li:first-child:before {
50
- width: 50%;
51
- left: 50%;
52
- }
53
- ul.pptrack-progress-bar li:last-child:before {
54
- width: 50%;
55
- right: 50%;
56
- }
57
- .pptrack-tracking-progress-bar-label {
58
- padding-top: 35px;
59
- font-size: 22px;
60
- font-weight: 300;
61
- text-align: center;
62
- }
63
- .pptrack-progress-bubble {
64
- margin: 0 auto;
65
- top: -27px;
66
- left: 0;
67
- right: 0;
68
- width: 50px;
69
- height: 50px;
70
- border-radius: 50%;
71
- display: block;
72
- position: absolute;
73
- z-index:11;
74
- background-color: #dee2e7;
75
- }
76
- ul.pptrack-progress-bar li .pptrack-progress-bubble {
77
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAAEhcmxxAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjFCNzRBMDNDOUE3MTFFNDgwRjBFMzI5RkZGQzkwQzgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjFCNzRBMDRDOUE3MTFFNDgwRjBFMzI5RkZGQzkwQzgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGMUI3NEEwMUM5QTcxMUU0ODBGMEUzMjlGRkZDOTBDOCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGMUI3NEEwMkM5QTcxMUU0ODBGMEUzMjlGRkZDOTBDOCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PstXMrQAAAC5SURBVHjaYvz//z8DEOQxABl5QPwfIIAYgfg4iPgPEEAgoeP/oQAggEAcNiD+DGJDpKGAiQEJAAQQSIYNSP9kQAUXQRIgQTY0CbB2diC+gCYuAxBADFBb86C2Hoe6gAEkeP4/JmBHcRYSOIFL4gsuiXyQHdJo5l8AqQUIMJirpHE4AgbOQ9WAXZv7n3iQizOkcICfoBA8x0A8OA9yEjvUQ4TARZBamKdhiSAfiE8D8RcoPg0VY4OpAwALNzuWsCcfvQAAAABJRU5ErkJggg==);
78
- background-repeat: no-repeat;
79
- background-position: center;
80
- }
81
- ul.pptrack-progress-bar li:nth-child(1) .pptrack-progress-bubble {
82
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAhCAYAAAAyCTAQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkMxQkY0Njk3MkY5RDExRTVBOEFGRDhENjM3ODQyNzMzIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkMxQkY0Njk4MkY5RDExRTVBOEFGRDhENjM3ODQyNzMzIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QzFCRjQ2OTUyRjlEMTFFNUE4QUZEOEQ2Mzc4NDI3MzMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QzFCRjQ2OTYyRjlEMTFFNUE4QUZEOEQ2Mzc4NDI3MzMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5vAiDgAAABi0lEQVR42tTUvUsDMRjH8bQ4dBC0WlBQhIKD+DKJBaGgCOILDg5acPMfcHR0cnBXRJzEQVEEZ1GhUARHN6cOLgriWy0iSrXnN5KD82hy59UD+8CHXo/kR0ieXMSyLBGgppDCMkq6QVERrOqwhHN0/XW4Xf24wAIi1YTLsUmkMeh4H8MqjtH2Y4bccw8TOETR8q4nzNlzTaEJHFnBag9NEU23xJFDb8CzKGNRt+p9K3jlkdZtS0oz6QM3uFJ7W6k2UG/a803H4DIOMIqYY8y0K/QaY+6sSuGXaoJc5bBm25zhO2jEEMa9wmXLPaDH0Eky/A4zjneTuEfcFP6OWY/e70RrhfcnWHOHJ9UpC9WjIqA+vKnf73DZ66fYVQNaqgiX1pG1wzN4RXuVobZmPMrzkKvOqo/SluHGnSHv+N+BEcP4DLqFOnWvmje0orbkihMipIqKECv0cCvM8GItbstLmOGf/6ZbBrCCBt8zuEgFH5cth5J6vsW2jzkF+W0p/Go1/uu5tm9obYZ/CTAAH5od+MWD5NUAAAAASUVORK5CYII=);
83
- background-position: center 6px;
84
- }
85
- ul.pptrack-progress-bar li:nth-child(2) .pptrack-progress-bubble {
86
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAARCAYAAADHeGwwAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjI0MEM5RTRBMkZBNjExRTU4MDREQkE5NkM2M0E4MTlCIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjI0MEM5RTRCMkZBNjExRTU4MDREQkE5NkM2M0E4MTlCIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MjQwQzlFNDgyRkE2MTFFNTgwNERCQTk2QzYzQTgxOUIiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MjQwQzlFNDkyRkE2MTFFNTgwNERCQTk2QzYzQTgxOUIiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6Wp6DeAAAA+UlEQVR42mL6//8/Aw5cA8Q/gXgDEHPhUYcX45JI+Y8K9pFrCRMDdqCLxncE4i1AzMVAKsBhsyQQ3/mPCUj2CT5JGWpYQkiBOBBfxmEJNw49IkCsDcTMID4jkPAHhpQfEDPjCEURIPbGIn4KiN2A+COSWCsQl0PNegTE/iAbv/4nHxwHYlaoyx2wyJ9nIitlIIAFEBtA2YZY5A1AFnylwIITQHwByr6GRf4aKA58oXHAisMQaSB2ITIOpgJxFpT9Boh9CaUiXEn1KBDz49CjAMTWQMw5oPmA5jl5IjUMx1fYXUbj7wdiHyD+Rq3CDoTrgfgXpfUBQIABAN1sdDVBvGHWAAAAAElFTkSuQmCC);
87
- }
88
- ul.pptrack-progress-bar li:nth-child(3) .pptrack-progress-bubble {
89
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAXCAYAAAD3CERpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjFBMjNFRUNFMkY5RTExRTVCRDhEOEJDQjlERURFQkE3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjFBMjNFRUNGMkY5RTExRTVCRDhEOEJDQjlERURFQkE3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MUEyM0VFQ0MyRjlFMTFFNUJEOEQ4QkNCOURFREVCQTciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MUEyM0VFQ0QyRjlFMTFFNUJEOEQ4QkNCOURFREVCQTciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6tvpOPAAABhUlEQVR42mL4////sf/UAe+BWBuIGQhhJgYGBksG6gABIDYkRiETA3UBy0BYShRgBEUGFc17C8RfgPgfED8B4ulAvBxD1X/ag3b0hERtS+cCcQAQhwPxNiTxDlpaWoBkOCjqpiHJTYWK0TQhgdJKFhB3Q/kgdja9Um85EC+FsrOJzlckgCggNsAiLgilFWiRZYjKpvQuHD4NRIn0f8CKwUFl6TcgvgzEv8gw8ztU708scmxALIutRLoCxBLQUkUViJ+QUCLdAmIZqF5FIH6ARc07kE9nAvEtIP4Ldc00IH4BZd8G4oVQ9m8gfogDw/TOgNYuIHAfiOei6QWZtxZUOGRAJc5DM7YUWpBIQ+nNQByMI0iPA7EFFr0w/kEgdkWu2mC4Eer970CcAcR6QFwFxH+h4lF42j0VUDW/gDgXqrcEiH9DxbPQaxkY5gbiCzjiahcQM+GxlAOIT+HQewiIWXFZCsL8QDwJiF9DNTyFVsIcRLTyQI7uAeKXUL3PoXo50dUCBBgAHZt4aaFsbgcAAAAASUVORK5CYII=);
90
- }
91
- ul.pptrack-progress-bar li:nth-child(4) .pptrack-progress-bubble {
92
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjJCRDcwNzk3MkY5RTExRTU4QzhEQzBDREY4RUQwODhEIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjJCRDcwNzk4MkY5RTExRTU4QzhEQzBDREY4RUQwODhEIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MkJENzA3OTUyRjlFMTFFNThDOERDMENERjhFRDA4OEQiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MkJENzA3OTYyRjlFMTFFNThDOERDMENERjhFRDA4OEQiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5wtAarAAAAvklEQVR42mL4//8/AwVYB4hvAfFtKJuBEsN0gfj1fwQAsXXJNcwYzTAYeMTCQDowB+JdQMyHRe4jsq3eUIzPZeZA/PE/dnAHiGVgCjuQJDpwGGaDx7DrIMNgkdKIRQG6oU5A/A2HYZeBWBSmFkT8wKFwEhAzkmIYPhfCwGo8hp1GNww5HXb8Jw2cBGJ+bGGNzKmm1DBsOaWCgGH78BmGK+tV4DGMi1AuwiWRSY5hhAqHVGgMrwRiDmLzOUCAAQAprbf1nU4NDQAAAABJRU5ErkJggg==);
93
- }
94
- ul.pptrack-progress-bar li.done .pptrack-progress-bubble,
95
- ul.pptrack-progress-bar li.active .pptrack-progress-bubble {
96
- background-color: #e44539;
97
- }
98
-
99
- .pptrack-progress-bar-wrapper {
100
- margin: 0 auto;
101
- padding-top: 1px;
102
- }
103
-
104
- ul.pptrack-progress-bar li.done:after,
105
- ul.pptrack-progress-bar li.active:after {
106
- position: absolute;
107
- content: "";
108
- background: #e44539;
109
- height: 5px;
110
- width: 100%;
111
- top: -2px;
112
- z-index:10;
113
- }
114
- ul.pptrack-progress-bar li:first-child:after {
115
- width: 50%;
116
- left: 50%;
117
- }
118
- ul.pptrack-progress-bar li.active:after {
119
- width: 50%;
120
- right: 50%;
121
- }
122
- ul.pptrack-progress-bar li:first-child.active:after {
123
- background: #DEE2E7;
124
- }
125
-
126
- ul.pptrack-progress-bar-done li:after,
127
- ul.pptrack-progress-bar-done li:before{
128
- background: #24AAA3 !important;
129
- }
130
- ul.pptrack-progress-bar-done li .pptrack-progress-bubble{
131
- background-color: #24AAA3 !important;
132
- }
133
-
134
-
135
- .pptrack-tracking-info {
136
- width: 100%;
137
- }
138
- .pptrack-tracking-info .pptrack-tracking-info-details {
139
- border: 1px solid #e5e5e5;
140
- -webkit-border-radius: 2px;
141
- -moz-border-radius: 2px;
142
- border-radius: 2px;
143
- padding: 20px;
144
- background: #ffffff;
145
- }
146
- .pptrack-tracking-general-info {
147
- padding-top: 20px;
148
- width: 100%
149
- }
150
- .pptrack-tracking-general-info .pptrack-tracking-general-info-details {
151
- border: 1px solid #e5e5e5;
152
- -webkit-border-radius: 2px;
153
- -moz-border-radius: 2px;
154
- border-radius: 2px;
155
- padding: 18px;
156
- background: #ffffff;
157
- }
158
- .pptrack-tracking-general-info-label {
159
- width: 35%;
160
- display: block;
161
- float: left;
162
- text-align: right;
163
- font-weight: 600;
164
- font-size: 14px;
165
- }
166
- .pptrack-tracking-general-info-value {
167
- width: 60%;
168
- display: block;
169
- float: right;
170
- text-align: left;
171
- font-weight: 300;
172
- font-size: 14px;
173
- }
174
- .pptrack-tracking-general-info .pptrack-tracking-row {
175
- padding-bottom: 10px;
176
- }
177
-
178
- .pptrack-tracking-general-info .pptrack-tracking-carrier-info-wrapper {
179
- background: #f5f5f5;
180
- padding: 15px;
181
- }
182
- .pptrack-tracking-general-info .pptrack-tracking-carrier-info-wrapper span {
183
- font-size: 10px;
184
- font-weight: 300;
185
- }
186
- .pptrack-tracking-general-info .pptrack-tracking-courier-logo {
187
- float: left;
188
- padding-top: 10px;
189
- }
190
- .pptrack-tracking-general-info .pptrack-tracking-courier-info {
191
- margin-left: 75px;
192
- font-size: 14px;
193
- font-weight: 300;
194
- }
195
- .pptrack-tracking-general-info .pptrack-tracking-courier-info span, .pptrack-tracking-general-info .pptrack-tracking-courier-info a {
196
- font-size: 14px;
197
- font-weight: 300;
198
- }
199
-
200
- .pptrack-info-row {
201
- width: 100%;
202
- border-bottom: 1px solid #f4f4f4;
203
- position: relative;
204
- font-weight: 300;
205
- color: #676669;
206
- }
207
- .pptrack-info-row .pptrack-info-row-date {
208
- float: left;
209
- width: 85px;
210
- text-align: right;
211
- padding: 20px 0;
212
- }
213
- .pptrack-info-row .pptrack-info-row-details:before {
214
- content: "";
215
- position: absolute;
216
- width: 68px;
217
- top: 0;
218
- left: 85px;
219
- height: 101%;
220
- background-color: #FFF;
221
- background-image: url(data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QMxaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzAxNCA3OS4xNTY3OTcsIDIwMTQvMDgvMjAtMDk6NTM6MDIgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE0IChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkQ1NDA2NzgyQzlGQTExRTQ4MEYwRTMyOUZGRkM5MEM4IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkQ1NDA2NzgzQzlGQTExRTQ4MEYwRTMyOUZGRkM5MEM4Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6RjFCNzRBMDlDOUE3MTFFNDgwRjBFMzI5RkZGQzkwQzgiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6RjFCNzRBMEFDOUE3MTFFNDgwRjBFMzI5RkZGQzkwQzgiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7/7gAOQWRvYmUAZMAAAAAB/9sAhAAGBAQEBQQGBQUGCQYFBgkLCAYGCAsMCgoLCgoMEAwMDAwMDBAMDg8QDw4MExMUFBMTHBsbGxwfHx8fHx8fHx8fAQcHBw0MDRgQEBgaFREVGh8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx//wAARCAABAAEDAREAAhEBAxEB/8QASgABAAAAAAAAAAAAAAAAAAAABwEBAAAAAAAAAAAAAAAAAAAAABABAAAAAAAAAAAAAAAAAAAAABEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AeAf/2Q==);
222
- background-repeat: repeat-y;
223
- background-position: center;
224
- }
225
- .pptrack-info-row:first-child .pptrack-info-row-details:before {
226
- top: 50%;
227
- height: 51%;
228
- }
229
- .pptrack-info-row:last-child .pptrack-info-row-details:before {
230
- padding: 0;
231
- height: 50%;
232
- }
233
-
234
- .pptrack-info-row .pptrack-info-row-details:after {
235
- content: '';
236
- position: absolute;
237
- background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NTFBNzY3RjlDRTYyMTFFNDg1QTRENjhGQjYwRDQzNzUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NTFBNzY3RkFDRTYyMTFFNDg1QTRENjhGQjYwRDQzNzUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo1MUE3NjdGN0NFNjIxMUU0ODVBNEQ2OEZCNjBENDM3NSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo1MUE3NjdGOENFNjIxMUU0ODVBNEQ2OEZCNjBENDM3NSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pq1Fb38AAAGWSURBVHjalFNBSwJREJ55ymrRQQ+hdRKSgi4d6pKnIOhWndpLlyBE8NgfyL+xl+iYXjrXJbrZD5CozCAkTAu1RGTVnb5d19BEyYFh3/u++ebNmzfL9NcyGYpaVS95aF5Z3YCQ+hamso9KZk5PDYXy4GY5Y/gskjTAfRq1WyFrL68nv0bE0bQRYZYXLFtEYoKCk4JbcK/rc8A3n/RE9le8lDZmFEsTyw8S8qPMWe4JHZNegg6iqywUYvaEHw/i77xuGFQPyhWCY252P40xJDERZx9SFtNcURBqAHbszCA1mmDc4zt2e0jTggr3jLicNVjqhAx+N1FMkXDYBTWawoR4FWJquDtzGjEqflMWq+d+2f88suV8upxV7XanjkbZ7+uVXjMm6BzeifMoVVCvh0kb3QUYgFfGJRCnofJpx6Fk/UGPi9Pd/H0pB+IUHVyA1+xhERGz77hhDWrgHAKXbjf8l0PjuXWTomJlcRsHXI97MhE6bnHzrKifjP4YzoxfGIqUrGF5BHqDWHIQneNp7gp6ojsY+yPAALTWnp+tBEoCAAAAAElFTkSuQmCC);
238
- top: 40%;
239
- width: 15px;
240
- height: 15px;
241
- left: 112px;
242
- }
243
- .pptrack-info-row:first-child .pptrack-info-row-details:after {
244
- content: '';
245
- position: absolute;
246
- background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RDU0MDY3ODZDOUZBMTFFNDgwRjBFMzI5RkZGQzkwQzgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RDU0MDY3ODdDOUZBMTFFNDgwRjBFMzI5RkZGQzkwQzgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpENTQwNjc4NEM5RkExMUU0ODBGMEUzMjlGRkZDOTBDOCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpENTQwNjc4NUM5RkExMUU0ODBGMEUzMjlGRkZDOTBDOCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsFC2UMAAAHrSURBVHjatJbfK0NhGMefs+awKSNapqWIXNgF+VmWH7WU8uNCSUr+C3dyJeXOnXLDBcrV1sqN8mOtJaT8vHEhFAnZIq1RfB+9q2HOe86cPfXpPes8z/e7d+153lepWp0jHWEHFaAcFINHcAUuwKus2KrxTgFeMANaNfJ2wDgIg490CZY/Ct3gCIQkBiTeh0S+W6+JD1wDDxkLj6jzyUz4W63T/2L95+5TTZxgm8yJbaH3y2QNqCaZqEJPSTVpBA1kbjQkNZMmU5SdmEqa8Na6s2TCuiqblGVSnWOx0HRjB41WSf/pZWziMmpgs1pp3ttD3e5KOn26l6W72KRAK2Oy3ksrXQPkUHO/PvO62N5LNY5iGt0K0sHjncykgE1iWhkL58fksuXTcmc/1RaV0BJWp81OI1sBOos+6Nl4jE1utTIuX2I0tBkgRVHI7xskK9bhjQBdPMf0/rq3CkZ9Dh4SssxCNY/Gqj20eH5C0UTcUGPyTt5AQJbJwrOn+0YN/KyfbMaJLPXJZGrHH4szwcwIizPm24AcAHGTDFinL90UjoImk0yahF7aQ+sENIP3DMW5rkXoaB6/e6AURAwaRETdrt6LBF952kAdCErEgyKvTdQZuhJxHIJ+HrpiWvMwLQJPYlLciD7TjE8BBgA1BWucPtPhQwAAAABJRU5ErkJggg==);
247
- top: 40%;
248
- width: 25px;
249
- height: 25px;
250
- left: 107px;
251
- }
252
-
253
-
254
- .pptrack-info-row:last-child {
255
- border: 0;
256
- }
257
-
258
- .pptrack-info-row .pptrack-info-row-details-wrapper {
259
- margin-left: 153px;
260
- }
261
- .pptrack-info-row .pptrack-info-row-details {
262
- float: left;
263
- width: 100%;
264
- margin: 20px 0;
265
- }
266
-
267
- .pptrack-crosssell {
268
- width: 100%;
269
- margin-bottom: 30px;
270
- overflow: auto;
271
- }
272
- .pptrack-list-info-box-wrap,
273
- .pptrack-list-info-box {
274
- display: block;
275
- text-align: center;
276
- }
277
- .pptrack-product-name {
278
- margin: 0;
279
- }
280
- ul.pptrack-products-grid {
281
- width: 100%;
282
- }
283
- ul.pptrack-products-grid > li {
284
- width: 48%;
285
- float: left;
286
- margin: 10px 1%;
287
- text-align: center;
288
- }
289
- ul.pptrack-products-grid > li img {
290
- max-width: 100%;
291
- vertical-align: middle;
292
- margin: 0 auto;
293
- }
294
-
295
- /* Small devices (tablets, 768px and up) */
296
- @media (min-width: 768px) {
297
- .pptrack-tracking-info {
298
- width: 60% !important;
299
- float: left;
300
- }
301
- .pptrack-tracking-general-info {
302
- width: 38% !important;
303
- float: right;
304
- padding-top: 0;
305
- }
306
-
307
- ul.pptrack-products-grid > li {
308
- width: 23% !important;
309
- float: left;
310
- margin: 10px 1%;
311
- text-align: center;
312
- }
313
- }
314
-
315
- /* Medium devices (desktops, 992px and up) */
316
- @media (min-width: 992px) {
317
-
318
- }
319
-
320
- /* Large devices (large desktops, 1200px and up) */
321
- @media (min-width: 1200px) {
322
- ul.pptrack-products-grid--col-4 > li {
323
- width: 23% !important;
324
- float: left;
325
- margin: 10px 1%;
326
- text-align: center;
327
- }
328
- ul.pptrack-products-grid--col-5 > li {
329
- width: 18% !important;
330
- float: left;
331
- margin: 10px 1%;
332
- text-align: center;
333
- }
334
- ul.pptrack-products-grid--col-6 > li {
335
- width: 14.6666666667% !important;
336
- float: left;
337
- margin: 10px 1%;
338
- text-align: center;
339
- }
340
- ul.pptrack-products-grid--col-6 > li:nth-child(4) {
341
- clear:none;