add-to-calendar-button 2.6.17 → 2.6.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.json CHANGED
@@ -22,7 +22,7 @@
22
22
  ]
23
23
  },
24
24
 
25
- "extends": ["plugin:@typescript-eslint/recommended", "eslint:recommended", "plugin:security/recommended-legacy", "plugin:prettier/recommended"],
25
+ "extends": ["plugin:@typescript-eslint/recommended", "eslint:recommended", "plugin:security/recommended-legacy", "plugin:prettier/recommended", "plugin:wc/recommended"],
26
26
 
27
27
  "plugins": ["@typescript-eslint", "prettier"],
28
28
 
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: 3D
7
7
  *
8
- * Version: 2.6.17
8
+ * Version: 2.6.19
9
9
  * Creator: Jens Kuerschner (https://jekuer.com)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: Date
7
7
  *
8
- * Version: 2.6.17
8
+ * Version: 2.6.19
9
9
  * Creator: Jens Kuerschner (https://jekuer.com)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: Flat
7
7
  *
8
- * Version: 2.6.17
8
+ * Version: 2.6.19
9
9
  * Creator: Jens Kuerschner (https://jekuer.com)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: Neumorphism
7
7
  *
8
- * Version: 2.6.17
8
+ * Version: 2.6.19
9
9
  * Creator: Jens Kuerschner (https://jekuer.com)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: Round
7
7
  *
8
- * Version: 2.6.17
8
+ * Version: 2.6.19
9
9
  * Creator: Jens Kuerschner (https://jekuer.com)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: Text
7
7
  *
8
- * Version: 2.6.17
8
+ * Version: 2.6.19
9
9
  * Creator: Jens Kuerschner (https://jekuer.com)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: Default
7
7
  *
8
- * Version: 2.6.17
8
+ * Version: 2.6.19
9
9
  * Creator: Jens Kuerschner (https://jekuer.com)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,14 +5,14 @@
5
5
  * Add to Calendar TimeZones iCal Library
6
6
  * ++++++++++++++++++++++++++++++++++++++
7
7
  *
8
- * Version: 1.8.2
8
+ * Version: 1.8.3
9
9
  * Creator: Jens Kuerschner (https://jenskuerschner.de)
10
10
  * Project: https://github.com/add2cal/timezones-ical-library
11
11
  * License: Apache-2.0
12
12
  *
13
13
  */
14
14
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
15
- const tzlibVersion = '1.8.2';
15
+ const tzlibVersion = '1.8.3';
16
16
  const tzlibZonesDB = {
17
17
  Zulu: ['Etc/UTC', 0],
18
18
  WET: ['', 1],
@@ -974,14 +974,14 @@ function tzlib_get_timezones(jsonType = false) {
974
974
  * Add to Calendar Button
975
975
  * ++++++++++++++++++++++
976
976
  *
977
- * Version: 2.6.17
977
+ * Version: 2.6.19
978
978
  * Creator: Jens Kuerschner (https://jekuer.com)
979
979
  * Project: https://github.com/add2cal/add-to-calendar-button
980
980
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
981
981
  * Note: DO NOT REMOVE THE COPYRIGHT NOTICE ABOVE!
982
982
  *
983
983
  */
984
- const atcbVersion = '2.6.17';
984
+ const atcbVersion = '2.6.19';
985
985
  const atcbCssTemplate = {};
986
986
  const atcbIsBrowser = () => {
987
987
  if (typeof window === 'undefined') {
@@ -1072,7 +1072,7 @@ const atcbAndroidInvalidOptions = ['apple'];
1072
1072
  const atcbStates = [];
1073
1073
  const atcbWcParams = [
1074
1074
  'debug',
1075
- 'prooOverride',
1075
+ 'proOverride',
1076
1076
  'cspnonce',
1077
1077
  'identifier',
1078
1078
  'name',
@@ -1149,7 +1149,7 @@ const atcbWcParams = [
1149
1149
  ];
1150
1150
  const atcbWcProParams = [
1151
1151
  'debug',
1152
- 'prooOverride',
1152
+ 'proOverride',
1153
1153
  'cspnonce',
1154
1154
  'attendee',
1155
1155
  'images',
@@ -1176,7 +1176,7 @@ const atcbWcProParams = [
1176
1176
  ];
1177
1177
  const atcbWcBooleanParams = [
1178
1178
  'debug',
1179
- 'prooOverride',
1179
+ 'proOverride',
1180
1180
  'useUserTZ',
1181
1181
  'hideIconButton',
1182
1182
  'hideIconList',
@@ -1647,7 +1647,7 @@ function atcb_date_specials_calculation(type, dateString, timeString = null, tim
1647
1647
  }
1648
1648
  const currentUtcDate = new Date().toISOString();
1649
1649
  return tmpDate.getTime() < new Date(currentUtcDate).getTime();
1650
- } catch (e) {
1650
+ } catch {
1651
1651
  return false;
1652
1652
  }
1653
1653
  }
@@ -1668,7 +1668,7 @@ function atcb_date_calculation(dateString) {
1668
1668
  }
1669
1669
  try {
1670
1670
  return newDate.toISOString().replace(/T(\d{2}:\d{2}:\d{2}\.\d{3})Z/g, '');
1671
- } catch (e) {
1671
+ } catch {
1672
1672
  return false;
1673
1673
  }
1674
1674
  }
@@ -3355,7 +3355,7 @@ function atcb_open_cal_url(data, type, url, subscribe = false, subEvent = null,
3355
3355
  }
3356
3356
  return '';
3357
3357
  })();
3358
- url = (data.dev ? 'https://dev.caldn.net/' : 'https://go.caldn.net/') + data.proKey + '/' + urlType + '/' + type + query;
3358
+ url = (data.dev ? 'https://dev.caldn.net/' : 'https://caldn.net/') + data.proKey + '/' + urlType + '/' + type + query;
3359
3359
  if (!atcb_secure_url(url)) {
3360
3360
  return;
3361
3361
  }
@@ -3387,7 +3387,8 @@ function atcb_generate_ical(host, data, subEvent = 'all', keyboardTrigger = fals
3387
3387
  return '';
3388
3388
  })();
3389
3389
  if (data.proxy) {
3390
- atcb_open_cal_url(data, 'ical', 'https://add-to-calendar-pro.com', false, subEvent);
3390
+ const langUrlPart = data.language && data.language === 'de' ? data.language + '/' : '';
3391
+ atcb_open_cal_url(data, 'ical', 'https://caldn.net/' + langUrlPart + 'no-ics-file', false, subEvent);
3391
3392
  return;
3392
3393
  }
3393
3394
  if (givenIcsFile !== '' && (!atcbIsiOS() || !atcbIsWebView() || data.bypassWebViewCheck)) {
@@ -3925,10 +3926,10 @@ function atcb_rewrite_html_elements(content, clear = false, iCalBreaks = false)
3925
3926
  content = content.replace(/\{(|\/)(hr|p|b|strong|u|i|em|li|ul|ol|h\d)\}/gi, '');
3926
3927
  content = content.replace(/&[#a-zA-Z0-9]{1,9};/gi, '');
3927
3928
  } else {
3928
- content = content.replace(/\[url\]((?:(?!\[\/url\])[\w&$+.,:;=~!*'?@^%#|\s\-()[\]/])*)\[\/url\]/gi, function (match, p1) {
3929
+ content = content.replace(/\[url\]((?:(?!\[\/url\]).)*)\[\/url\]/gi, function (match, p1) {
3929
3930
  return atcb_parse_url_code(p1);
3930
3931
  });
3931
- content = content.replace(/\{url\}((?:(?!\[\/url\])[\w&$+.,:;=~!*'?@^%#|\s\-()[\]/])*)\{\/url\}/gi, function (match, p1) {
3932
+ content = content.replace(/\{url\}((?:(?!\[\/url\]).)*)\{\/url\}/gi, function (match, p1) {
3932
3933
  return atcb_parse_url_code(p1);
3933
3934
  });
3934
3935
  content = content.replace(/\[(\/|)(br|hr|p|b|strong|u|i|em|li|ul|ol|h\d)(\s?\/?)\]/gi, '<$1$2$3>');
@@ -5078,7 +5079,7 @@ if (atcbIsBrowser()) {
5078
5079
  }
5079
5080
  }
5080
5081
  static get observedAttributes() {
5081
- const observeAdditionally = ['instance', 'prokey', 'proKey'];
5082
+ const observeAdditionally = ['instance', 'prokey', 'proKey', 'prooverride', 'proOverride'];
5082
5083
  if (this.proKey && this.proKey !== '') {
5083
5084
  return atcbWcProParams
5084
5085
  .map((element) => {
@@ -5163,9 +5164,7 @@ if (atcbIsBrowser()) {
5163
5164
  this.setAttribute('atcb-button-id', this.data.identifier);
5164
5165
  this.classList.add('add-to-calendar');
5165
5166
  try {
5166
- this.style.visibility = 'visible';
5167
- this.style.opacity = '1';
5168
- this.style.position = 'relative';
5167
+ this.setAttribute('style', 'visibility:visible;opacity:1;position:relative;outline:none !important;');
5169
5168
  await atcb_build_button(this.shadowRoot, this.data);
5170
5169
  return true;
5171
5170
  } catch (e) {
@@ -5186,7 +5185,7 @@ async function atcb_process_inline_data(el, debug = false) {
5186
5185
  try {
5187
5186
  data = atcb_read_attributes(el);
5188
5187
  await atcb_check_required(data);
5189
- } catch (e) {
5188
+ } catch {
5190
5189
  const slotInput = el.innerHTML.trim();
5191
5190
  if (!slotInput) {
5192
5191
  throw new Error('Add to Calendar Button generation failed: No data provided.');
@@ -5613,7 +5612,7 @@ async function atcb_get_pro_data(licenseKey, el = null, directData = {}) {
5613
5612
  }
5614
5613
  if (proOverride) {
5615
5614
  atcbWcParams.forEach((key) => {
5616
- if (Object.prototype.hasOwnProperty.call(dataOverrides, key)) {
5615
+ if (Object.prototype.hasOwnProperty.call(dataOverrides, key) && ['hideBranding', 'hidebranding', 'rsvp', 'ty'].indexOf(key) === -1) {
5617
5616
  data[`${key}`] = dataOverrides[`${key}`];
5618
5617
  }
5619
5618
  });
@@ -5629,7 +5628,7 @@ async function atcb_get_pro_data(licenseKey, el = null, directData = {}) {
5629
5628
  return data;
5630
5629
  }
5631
5630
  throw new Error('Not possible to read proKey config from server...');
5632
- } catch (e) {
5631
+ } catch {
5633
5632
  console.error('Add to Calendar Button proKey invalid or server not responding! Falling back to local data...');
5634
5633
  }
5635
5634
  }
@@ -5,14 +5,14 @@
5
5
  * Add to Calendar TimeZones iCal Library
6
6
  * ++++++++++++++++++++++++++++++++++++++
7
7
  *
8
- * Version: 1.8.2
8
+ * Version: 1.8.3
9
9
  * Creator: Jens Kuerschner (https://jenskuerschner.de)
10
10
  * Project: https://github.com/add2cal/timezones-ical-library
11
11
  * License: Apache-2.0
12
12
  *
13
13
  */
14
14
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
15
- const tzlibVersion = '1.8.2';
15
+ const tzlibVersion = '1.8.3';
16
16
  const tzlibZonesDB = {
17
17
  Zulu: ['Etc/UTC', 0],
18
18
  WET: ['', 1],
@@ -974,14 +974,14 @@ function tzlib_get_timezones(jsonType = false) {
974
974
  * Add to Calendar Button
975
975
  * ++++++++++++++++++++++
976
976
  *
977
- * Version: 2.6.17
977
+ * Version: 2.6.19
978
978
  * Creator: Jens Kuerschner (https://jekuer.com)
979
979
  * Project: https://github.com/add2cal/add-to-calendar-button
980
980
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
981
981
  * Note: DO NOT REMOVE THE COPYRIGHT NOTICE ABOVE!
982
982
  *
983
983
  */
984
- const atcbVersion = '2.6.17';
984
+ const atcbVersion = '2.6.19';
985
985
  const atcbCssTemplate = {
986
986
  if (typeof window === 'undefined') {
987
987
  return false;
@@ -1071,7 +1071,7 @@ const atcbAndroidInvalidOptions = ['apple'];
1071
1071
  const atcbStates = [];
1072
1072
  const atcbWcParams = [
1073
1073
  'debug',
1074
- 'prooOverride',
1074
+ 'proOverride',
1075
1075
  'cspnonce',
1076
1076
  'identifier',
1077
1077
  'name',
@@ -1148,7 +1148,7 @@ const atcbWcParams = [
1148
1148
  ];
1149
1149
  const atcbWcProParams = [
1150
1150
  'debug',
1151
- 'prooOverride',
1151
+ 'proOverride',
1152
1152
  'cspnonce',
1153
1153
  'attendee',
1154
1154
  'images',
@@ -1175,7 +1175,7 @@ const atcbWcProParams = [
1175
1175
  ];
1176
1176
  const atcbWcBooleanParams = [
1177
1177
  'debug',
1178
- 'prooOverride',
1178
+ 'proOverride',
1179
1179
  'useUserTZ',
1180
1180
  'hideIconButton',
1181
1181
  'hideIconList',
@@ -1646,7 +1646,7 @@ function atcb_date_specials_calculation(type, dateString, timeString = null, tim
1646
1646
  }
1647
1647
  const currentUtcDate = new Date().toISOString();
1648
1648
  return tmpDate.getTime() < new Date(currentUtcDate).getTime();
1649
- } catch (e) {
1649
+ } catch {
1650
1650
  return false;
1651
1651
  }
1652
1652
  }
@@ -1667,7 +1667,7 @@ function atcb_date_calculation(dateString) {
1667
1667
  }
1668
1668
  try {
1669
1669
  return newDate.toISOString().replace(/T(\d{2}:\d{2}:\d{2}\.\d{3})Z/g, '');
1670
- } catch (e) {
1670
+ } catch {
1671
1671
  return false;
1672
1672
  }
1673
1673
  }
@@ -3354,7 +3354,7 @@ function atcb_open_cal_url(data, type, url, subscribe = false, subEvent = null,
3354
3354
  }
3355
3355
  return '';
3356
3356
  })();
3357
- url = (data.dev ? 'https://dev.caldn.net/' : 'https://go.caldn.net/') + data.proKey + '/' + urlType + '/' + type + query;
3357
+ url = (data.dev ? 'https://dev.caldn.net/' : 'https://caldn.net/') + data.proKey + '/' + urlType + '/' + type + query;
3358
3358
  if (!atcb_secure_url(url)) {
3359
3359
  return;
3360
3360
  }
@@ -3386,7 +3386,8 @@ function atcb_generate_ical(host, data, subEvent = 'all', keyboardTrigger = fals
3386
3386
  return '';
3387
3387
  })();
3388
3388
  if (data.proxy) {
3389
- atcb_open_cal_url(data, 'ical', 'https://add-to-calendar-pro.com', false, subEvent);
3389
+ const langUrlPart = data.language && data.language === 'de' ? data.language + '/' : '';
3390
+ atcb_open_cal_url(data, 'ical', 'https://caldn.net/' + langUrlPart + 'no-ics-file', false, subEvent);
3390
3391
  return;
3391
3392
  }
3392
3393
  if (givenIcsFile !== '' && (!atcbIsiOS() || !atcbIsWebView() || data.bypassWebViewCheck)) {
@@ -3924,10 +3925,10 @@ function atcb_rewrite_html_elements(content, clear = false, iCalBreaks = false)
3924
3925
  content = content.replace(/\{(|\/)(hr|p|b|strong|u|i|em|li|ul|ol|h\d)\}/gi, '');
3925
3926
  content = content.replace(/&[#a-zA-Z0-9]{1,9};/gi, '');
3926
3927
  } else {
3927
- content = content.replace(/\[url\]((?:(?!\[\/url\])[\w&$+.,:;=~!*'?@^%#|\s\-()[\]/])*)\[\/url\]/gi, function (match, p1) {
3928
+ content = content.replace(/\[url\]((?:(?!\[\/url\]).)*)\[\/url\]/gi, function (match, p1) {
3928
3929
  return atcb_parse_url_code(p1);
3929
3930
  });
3930
- content = content.replace(/\{url\}((?:(?!\[\/url\])[\w&$+.,:;=~!*'?@^%#|\s\-()[\]/])*)\{\/url\}/gi, function (match, p1) {
3931
+ content = content.replace(/\{url\}((?:(?!\[\/url\]).)*)\{\/url\}/gi, function (match, p1) {
3931
3932
  return atcb_parse_url_code(p1);
3932
3933
  });
3933
3934
  content = content.replace(/\[(\/|)(br|hr|p|b|strong|u|i|em|li|ul|ol|h\d)(\s?\/?)\]/gi, '<$1$2$3>');
@@ -5077,7 +5078,7 @@ if (atcbIsBrowser()) {
5077
5078
  }
5078
5079
  }
5079
5080
  static get observedAttributes() {
5080
- const observeAdditionally = ['instance', 'prokey', 'proKey'];
5081
+ const observeAdditionally = ['instance', 'prokey', 'proKey', 'prooverride', 'proOverride'];
5081
5082
  if (this.proKey && this.proKey !== '') {
5082
5083
  return atcbWcProParams
5083
5084
  .map((element) => {
@@ -5162,9 +5163,7 @@ if (atcbIsBrowser()) {
5162
5163
  this.setAttribute('atcb-button-id', this.data.identifier);
5163
5164
  this.classList.add('add-to-calendar');
5164
5165
  try {
5165
- this.style.visibility = 'visible';
5166
- this.style.opacity = '1';
5167
- this.style.position = 'relative';
5166
+ this.setAttribute('style', 'visibility:visible;opacity:1;position:relative;outline:none !important;');
5168
5167
  await atcb_build_button(this.shadowRoot, this.data);
5169
5168
  return true;
5170
5169
  } catch (e) {
@@ -5185,7 +5184,7 @@ async function atcb_process_inline_data(el, debug = false) {
5185
5184
  try {
5186
5185
  data = atcb_read_attributes(el);
5187
5186
  await atcb_check_required(data);
5188
- } catch (e) {
5187
+ } catch {
5189
5188
  const slotInput = el.innerHTML.trim();
5190
5189
  if (!slotInput) {
5191
5190
  throw new Error('Add to Calendar Button generation failed: No data provided.');
@@ -5612,7 +5611,7 @@ async function atcb_get_pro_data(licenseKey, el = null, directData = {}) {
5612
5611
  }
5613
5612
  if (proOverride) {
5614
5613
  atcbWcParams.forEach((key) => {
5615
- if (Object.prototype.hasOwnProperty.call(dataOverrides, key)) {
5614
+ if (Object.prototype.hasOwnProperty.call(dataOverrides, key) && ['hideBranding', 'hidebranding', 'rsvp', 'ty'].indexOf(key) === -1) {
5616
5615
  data[`${key}`] = dataOverrides[`${key}`];
5617
5616
  }
5618
5617
  });
@@ -5628,7 +5627,7 @@ async function atcb_get_pro_data(licenseKey, el = null, directData = {}) {
5628
5627
  return data;
5629
5628
  }
5630
5629
  throw new Error('Not possible to read proKey config from server...');
5631
- } catch (e) {
5630
+ } catch {
5632
5631
  console.error('Add to Calendar Button proKey invalid or server not responding! Falling back to local data...');
5633
5632
  }
5634
5633
  }
@@ -5,14 +5,14 @@
5
5
  * Add to Calendar TimeZones iCal Library
6
6
  * ++++++++++++++++++++++++++++++++++++++
7
7
  *
8
- * Version: 1.8.2
8
+ * Version: 1.8.3
9
9
  * Creator: Jens Kuerschner (https://jenskuerschner.de)
10
10
  * Project: https://github.com/add2cal/timezones-ical-library
11
11
  * License: Apache-2.0
12
12
  *
13
13
  */
14
14
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
15
- const tzlibVersion = '1.8.2';
15
+ const tzlibVersion = '1.8.3';
16
16
  const tzlibZonesDB = {
17
17
  Zulu: ['Etc/UTC', 0],
18
18
  WET: ['', 1],
@@ -974,14 +974,14 @@ function tzlib_get_timezones(jsonType = false) {
974
974
  * Add to Calendar Button
975
975
  * ++++++++++++++++++++++
976
976
  *
977
- * Version: 2.6.17
977
+ * Version: 2.6.19
978
978
  * Creator: Jens Kuerschner (https://jekuer.com)
979
979
  * Project: https://github.com/add2cal/add-to-calendar-button
980
980
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
981
981
  * Note: DO NOT REMOVE THE COPYRIGHT NOTICE ABOVE!
982
982
  *
983
983
  */
984
- const atcbVersion = '2.6.17';
984
+ const atcbVersion = '2.6.19';
985
985
  const atcbCssTemplate = {};
986
986
  const atcbIsBrowser = () => {
987
987
  if (typeof window === 'undefined') {
@@ -1072,7 +1072,7 @@ const atcbAndroidInvalidOptions = ['apple'];
1072
1072
  const atcbStates = [];
1073
1073
  const atcbWcParams = [
1074
1074
  'debug',
1075
- 'prooOverride',
1075
+ 'proOverride',
1076
1076
  'cspnonce',
1077
1077
  'identifier',
1078
1078
  'name',
@@ -1149,7 +1149,7 @@ const atcbWcParams = [
1149
1149
  ];
1150
1150
  const atcbWcProParams = [
1151
1151
  'debug',
1152
- 'prooOverride',
1152
+ 'proOverride',
1153
1153
  'cspnonce',
1154
1154
  'attendee',
1155
1155
  'images',
@@ -1176,7 +1176,7 @@ const atcbWcProParams = [
1176
1176
  ];
1177
1177
  const atcbWcBooleanParams = [
1178
1178
  'debug',
1179
- 'prooOverride',
1179
+ 'proOverride',
1180
1180
  'useUserTZ',
1181
1181
  'hideIconButton',
1182
1182
  'hideIconList',
@@ -1647,7 +1647,7 @@ function atcb_date_specials_calculation(type, dateString, timeString = null, tim
1647
1647
  }
1648
1648
  const currentUtcDate = new Date().toISOString();
1649
1649
  return tmpDate.getTime() < new Date(currentUtcDate).getTime();
1650
- } catch (e) {
1650
+ } catch {
1651
1651
  return false;
1652
1652
  }
1653
1653
  }
@@ -1668,7 +1668,7 @@ function atcb_date_calculation(dateString) {
1668
1668
  }
1669
1669
  try {
1670
1670
  return newDate.toISOString().replace(/T(\d{2}:\d{2}:\d{2}\.\d{3})Z/g, '');
1671
- } catch (e) {
1671
+ } catch {
1672
1672
  return false;
1673
1673
  }
1674
1674
  }
@@ -2237,7 +2237,7 @@ async function atcb_generate_ty(hostEl, dataObj) {
2237
2237
  header.atcb = true;
2238
2238
  }
2239
2239
  tyData.fields = tyData.fields.filter((field) => field.name !== 'header');
2240
- } catch (e) {
2240
+ } catch {
2241
2241
  /* do nothing */
2242
2242
  }
2243
2243
  }
@@ -2425,13 +2425,23 @@ async function atcb_generate_rsvp_form(host, data, hostEl, keyboardTrigger = fal
2425
2425
  }
2426
2426
  return attendeeParts[0];
2427
2427
  }
2428
- return '';
2428
+ return null;
2429
2429
  })();
2430
- if (attendee !== '') {
2431
- hiddenContent += '<input type="hidden" name="' + staticID + '-email" id="' + data.identifier + '-rsvp-email" value="' + attendee + '" />';
2430
+ const customEmailField = rsvpData.fields?.find((field) => field.name === 'email');
2431
+ if (!customEmailField) {
2432
+ if (attendee) {
2433
+ hiddenContent += '<input type="hidden" name="email" id="' + data.identifier + '-rsvp-email" value="' + attendee + '" />';
2434
+ } else {
2435
+ rsvpContent += '<div class="pro-field"><label for="' + data.identifier + '-rsvp-email">' + atcb_translate_hook('form.email', data) + '<span>*</span></label>';
2436
+ rsvpContent += '<input type="email" name="email" id="' + data.identifier + '-rsvp-email" ' + (data.disabled && 'disabled') + ' aria-label="' + atcb_translate_hook('form.email', data) + '" value="" /></div>';
2437
+ }
2432
2438
  } else {
2433
- rsvpContent += '<div class="pro-field"><label for="' + data.identifier + '-rsvp-email">' + atcb_translate_hook('form.email', data) + '<span>*</span></label>';
2434
- rsvpContent += '<input type="email" name="' + staticID + '-email" id="' + data.identifier + '-rsvp-email" ' + (data.disabled && 'disabled') + ' aria-label="' + atcb_translate_hook('form.email', data) + '" value="" /></div>';
2439
+ rsvpData.fields = rsvpData.fields.map((field) => {
2440
+ if (field.name === 'email') {
2441
+ return { ...field, required: true, type: 'email', default: attendee !== '' && attendee || field.default };
2442
+ }
2443
+ return field;
2444
+ });
2435
2445
  }
2436
2446
  if (rsvpData.fields && rsvpData.fields.length > 0) {
2437
2447
  const customForm = atcb_build_form(rsvpData.fields, data.identifier + '-rsvp', data.disabled);
@@ -2531,10 +2541,8 @@ async function atcb_generate_rsvp_form(host, data, hostEl, keyboardTrigger = fal
2531
2541
  e.preventDefault();
2532
2542
  rsvpFormSubmitting.style.display = 'block';
2533
2543
  rsvpFormSubmit.style.display = 'none';
2534
- const staticFields = [
2535
- { type: 'email', name: data.proKey + '-email', fieldId: data.identifier + '-rsvp-email', required: true },
2536
- { type: 'number', name: data.proKey + '-amount', fieldId: data.identifier + '-rsvp-amount', required: true },
2537
- ];
2544
+ const staticFields = [{ type: 'number', name: data.proKey + '-amount', fieldId: data.identifier + '-rsvp-amount', required: true }];
2545
+ if (!customEmailField) staticFields.push({ type: 'email', name: 'email', fieldId: data.identifier + '-rsvp-email', required: true });
2538
2546
  let valid = atcb_validate_form(rsvpHost, [...staticFields, ...rsvpData.fields]);
2539
2547
  const amountEl = rsvpHost.getElementById(data.identifier + '-rsvp-amount');
2540
2548
  const amount = parseInt(amountEl.value) || 1;
@@ -2554,17 +2562,24 @@ async function atcb_generate_rsvp_form(host, data, hostEl, keyboardTrigger = fal
2554
2562
  if (closeBtn) closeBtn.style.display = 'block';
2555
2563
  return;
2556
2564
  }
2565
+ let fieldsCopy = JSON.parse(JSON.stringify(rsvpData.fields));
2557
2566
  const bodyData = [];
2558
2567
  bodyData.push({ name: 'prokey', value: data.proKey });
2559
2568
  bodyData.push({ name: 'language', value: data.language });
2560
2569
  const statusValEl = rsvpHost.querySelector('[name="' + data.proKey + '-status"]:checked');
2561
2570
  bodyData.push({ name: 'status', value: statusValEl ? statusValEl.value : 'confirmed' });
2562
2571
  bodyData.push({ name: 'amount', value: amount });
2563
- bodyData.push({ name: 'email', value: rsvpHost.getElementById(data.identifier + '-rsvp-email').value });
2572
+ if (!customEmailField) {
2573
+ bodyData.push({ name: 'email', value: rsvpHost.getElementById(data.identifier + '-rsvp-email').value });
2574
+ } else {
2575
+ const emailFieldId = fieldsCopy.find((field) => field.name === 'email')?.fieldId;
2576
+ bodyData.push({ name: 'email', value: rsvpHost.getElementById(emailFieldId).value });
2577
+ fieldsCopy = fieldsCopy.filter((field) => field.fieldId !== emailFieldId);
2578
+ }
2564
2579
  if (data.dev) bodyData.push({ name: 'dev', value: true });
2565
2580
  const bodyData_payload = {};
2566
2581
  let skipRadio = false;
2567
- rsvpData.fields.forEach((field) => {
2582
+ fieldsCopy.forEach((field) => {
2568
2583
  if (field.type !== 'label') {
2569
2584
  if (field.type === 'radio') {
2570
2585
  if (!skipRadio) {
@@ -2756,7 +2771,7 @@ function atcb_build_form(fields, identifier = '', disabled = false) {
2756
2771
  }
2757
2772
  function atcb_create_field_html(type, name, fieldLabel, fieldId, required = false, fieldValue, defaultVal = null, fieldPlaceholder = '', disabled = false) {
2758
2773
  let fieldHtml = '';
2759
- if ((type === 'text' || type === 'number') && (fieldLabel !== '' || required)) {
2774
+ if ((type === 'text' || type === 'email' || type === 'number') && fieldLabel !== '') {
2760
2775
  fieldHtml += '<label for="' + fieldId + '">' + fieldLabel + (required ? '<span>*</span>' : '') + '</label>';
2761
2776
  }
2762
2777
  fieldHtml +=
@@ -4061,7 +4076,7 @@ function atcb_open_cal_url(data, type, url, subscribe = false, subEvent = null,
4061
4076
  }
4062
4077
  return '';
4063
4078
  })();
4064
- url = (data.dev ? 'https://dev.caldn.net/' : 'https://go.caldn.net/') + data.proKey + '/' + urlType + '/' + type + query;
4079
+ url = (data.dev ? 'https://dev.caldn.net/' : 'https://caldn.net/') + data.proKey + '/' + urlType + '/' + type + query;
4065
4080
  if (!atcb_secure_url(url)) {
4066
4081
  return;
4067
4082
  }
@@ -4093,7 +4108,8 @@ function atcb_generate_ical(host, data, subEvent = 'all', keyboardTrigger = fals
4093
4108
  return '';
4094
4109
  })();
4095
4110
  if (data.proxy) {
4096
- atcb_open_cal_url(data, 'ical', 'https://add-to-calendar-pro.com', false, subEvent);
4111
+ const langUrlPart = data.language && data.language === 'de' ? data.language + '/' : '';
4112
+ atcb_open_cal_url(data, 'ical', 'https://caldn.net/' + langUrlPart + 'no-ics-file', false, subEvent);
4097
4113
  return;
4098
4114
  }
4099
4115
  if (givenIcsFile !== '' && (!atcbIsiOS() || !atcbIsWebView() || data.bypassWebViewCheck)) {
@@ -4631,10 +4647,10 @@ function atcb_rewrite_html_elements(content, clear = false, iCalBreaks = false)
4631
4647
  content = content.replace(/\{(|\/)(hr|p|b|strong|u|i|em|li|ul|ol|h\d)\}/gi, '');
4632
4648
  content = content.replace(/&[#a-zA-Z0-9]{1,9};/gi, '');
4633
4649
  } else {
4634
- content = content.replace(/\[url\]((?:(?!\[\/url\])[\w&$+.,:;=~!*'?@^%#|\s\-()[\]/])*)\[\/url\]/gi, function (match, p1) {
4650
+ content = content.replace(/\[url\]((?:(?!\[\/url\]).)*)\[\/url\]/gi, function (match, p1) {
4635
4651
  return atcb_parse_url_code(p1);
4636
4652
  });
4637
- content = content.replace(/\{url\}((?:(?!\[\/url\])[\w&$+.,:;=~!*'?@^%#|\s\-()[\]/])*)\{\/url\}/gi, function (match, p1) {
4653
+ content = content.replace(/\{url\}((?:(?!\[\/url\]).)*)\{\/url\}/gi, function (match, p1) {
4638
4654
  return atcb_parse_url_code(p1);
4639
4655
  });
4640
4656
  content = content.replace(/\[(\/|)(br|hr|p|b|strong|u|i|em|li|ul|ol|h\d)(\s?\/?)\]/gi, '<$1$2$3>');
@@ -5784,7 +5800,7 @@ if (atcbIsBrowser()) {
5784
5800
  }
5785
5801
  }
5786
5802
  static get observedAttributes() {
5787
- const observeAdditionally = ['instance', 'prokey', 'proKey'];
5803
+ const observeAdditionally = ['instance', 'prokey', 'proKey', 'prooverride', 'proOverride'];
5788
5804
  if (this.proKey && this.proKey !== '') {
5789
5805
  return atcbWcProParams
5790
5806
  .map((element) => {
@@ -5869,9 +5885,7 @@ if (atcbIsBrowser()) {
5869
5885
  this.setAttribute('atcb-button-id', this.data.identifier);
5870
5886
  this.classList.add('add-to-calendar');
5871
5887
  try {
5872
- this.style.visibility = 'visible';
5873
- this.style.opacity = '1';
5874
- this.style.position = 'relative';
5888
+ this.setAttribute('style', 'visibility:visible;opacity:1;position:relative;outline:none !important;');
5875
5889
  await atcb_build_button(this.shadowRoot, this.data);
5876
5890
  return true;
5877
5891
  } catch (e) {
@@ -5892,7 +5906,7 @@ async function atcb_process_inline_data(el, debug = false) {
5892
5906
  try {
5893
5907
  data = atcb_read_attributes(el);
5894
5908
  await atcb_check_required(data);
5895
- } catch (e) {
5909
+ } catch {
5896
5910
  const slotInput = el.innerHTML.trim();
5897
5911
  if (!slotInput) {
5898
5912
  throw new Error('Add to Calendar Button generation failed: No data provided.');
@@ -6319,7 +6333,7 @@ async function atcb_get_pro_data(licenseKey, el = null, directData = {}) {
6319
6333
  }
6320
6334
  if (proOverride) {
6321
6335
  atcbWcParams.forEach((key) => {
6322
- if (Object.prototype.hasOwnProperty.call(dataOverrides, key)) {
6336
+ if (Object.prototype.hasOwnProperty.call(dataOverrides, key) && ['hideBranding', 'hidebranding', 'rsvp', 'ty'].indexOf(key) === -1) {
6323
6337
  data[`${key}`] = dataOverrides[`${key}`];
6324
6338
  }
6325
6339
  });
@@ -6335,7 +6349,7 @@ async function atcb_get_pro_data(licenseKey, el = null, directData = {}) {
6335
6349
  return data;
6336
6350
  }
6337
6351
  throw new Error('Not possible to read proKey config from server...');
6338
- } catch (e) {
6352
+ } catch {
6339
6353
  console.error('Add to Calendar Button proKey invalid or server not responding! Falling back to local data...');
6340
6354
  }
6341
6355
  }