ical-generator 5.0.2-develop.1 → 6.0.0-develop.1

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/README.md CHANGED
@@ -25,14 +25,15 @@ to generate subscriptionable calendar feeds.
25
25
  <br />
26
26
  <br />
27
27
 
28
+ ## ⚠️ Migration to v6
29
+ In version 6 some breaking changes were made to make `ical-generator` even better. A short list of
30
+ these breaking changes and how you can adapt your code can be found in our
31
+ [Migration Guide](https://github.com/sebbo2002/ical-generator/wiki/Migration-Guide:-v5-%E2%86%92-v6).
32
+
28
33
  ## 📦 Installation
29
34
 
30
35
  npm install ical-generator
31
36
 
32
- # For TypeScript Users
33
- # (see "I use Typescript and get TS2307: Cannot find module errors" section below)
34
- npm i -D @types/node rrule moment-timezone moment dayjs @types/luxon
35
-
36
37
 
37
38
  ## ⚡️ Quick Start
38
39
 
@@ -53,10 +54,16 @@ calendar.createEvent({
53
54
  url: 'http://sebbo.net/'
54
55
  });
55
56
 
56
- http.createServer((req, res) => calendar.serve(res))
57
- .listen(3000, '127.0.0.1', () => {
58
- console.log('Server running at http://127.0.0.1:3000/');
57
+ http.createServer((req, res) => {
58
+ res.writeHead(200, {
59
+ 'Content-Type': 'text/calendar; charset=utf-8',
60
+ 'Content-Disposition': 'attachment; filename="calendar.ics"'
59
61
  });
62
+
63
+ res.end(calendar.toString());
64
+ }).listen(3000, '127.0.0.1', () => {
65
+ console.log('Server running at http://127.0.0.1:3000/');
66
+ });
60
67
  ```
61
68
  See the [examples](./examples) folder for more examples.
62
69
 
@@ -114,19 +121,6 @@ npm run browser-test
114
121
 
115
122
  ## 🙋 FAQ
116
123
 
117
- ### What's `Error: Can't resolve 'fs'`?
118
- `ical-generator` uses the node.js `fs` module to save your calendar on the filesystem. In browser environments, you usually don't need this, so if you pass `null` for fs in your bundler. In webpack this looks like this:
119
-
120
- ```json
121
- {
122
- "resolve": {
123
- "fallback": {
124
- "fs": false
125
- }
126
- }
127
- }
128
- ```
129
-
130
124
  ### Where's the changelog?
131
125
  It's [here](https://github.com/sebbo2002/ical-generator/blob/develop/CHANGELOG.md). If you need the changelog for
132
126
  `ical-generator` 1.x.x and older, you'll find it [here](https://github.com/sebbo2002/ical-generator/blob/25338b8bf98f9afd3c88849e735fa33fa45fb766/CHANGELOG.md).
package/dist/index.cjs CHANGED
@@ -1,24 +1,24 @@
1
- "use strict";var H=Object.create;var x=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var Q=(n,t)=>{for(var e in t)x(n,e,{get:t[e],enumerable:!0})},j=(n,t,e,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of q(t))!Z.call(n,i)&&i!==e&&x(n,i,{get:()=>t[i],enumerable:!(a=W(t,i))||a.enumerable});return n};var K=(n,t,e)=>(e=n!=null?H(X(n)):{},j(t||!n||!n.__esModule?x(e,"default",{value:n,enumerable:!0}):e,n)),$=n=>j(x({},"__esModule",{value:!0}),n);var it={};Q(it,{ICalAlarm:()=>I,ICalAlarmType:()=>U,ICalAttendee:()=>C,ICalAttendeeRole:()=>V,ICalAttendeeStatus:()=>L,ICalAttendeeType:()=>z,ICalCalendar:()=>D,ICalCalendarMethod:()=>Y,ICalCategory:()=>p,ICalEvent:()=>y,ICalEventBusyStatus:()=>B,ICalEventClass:()=>k,ICalEventRepeatingFreq:()=>v,ICalEventStatus:()=>P,ICalEventTransparency:()=>F,ICalWeekday:()=>A,default:()=>at,escape:()=>l,foldLines:()=>N,formatDate:()=>o,formatDateTZ:()=>T});module.exports=$(it);function o(n,t,e,a){if(n!=null&&n.startsWith("/")&&(n=n.substr(1)),typeof t=="string"||t instanceof Date){let i=new Date(t),s=i.getUTCFullYear()+String(i.getUTCMonth()+1).padStart(2,"0")+i.getUTCDate().toString().padStart(2,"0");return n&&(s=i.getFullYear()+String(i.getMonth()+1).padStart(2,"0")+i.getDate().toString().padStart(2,"0")),e?s:n?(s+="T"+i.getHours().toString().padStart(2,"0")+i.getMinutes().toString().padStart(2,"0")+i.getSeconds().toString().padStart(2,"0"),s):(s+="T"+i.getUTCHours().toString().padStart(2,"0")+i.getUTCMinutes().toString().padStart(2,"0")+i.getUTCSeconds().toString().padStart(2,"0")+(a?"":"Z"),s)}else if(O(t)){let i=n?_(t)&&!t.tz()?t.clone().tz(n):t:a?t:t.utc();return i.format("YYYYMMDD")+(e?"":"T"+i.format("HHmmss")+(a||n?"":"Z"))}else if(w(t)){let i=n?t.setZone(n):a?t:t.setZone("utc");return i.toFormat("yyyyLLdd")+(e?"":"T"+i.toFormat("HHmmss")+(a||n?"":"Z"))}else{let i=t;if(n)i=typeof t.tz=="function"?t.tz(n):t;else if(!a)if(typeof t.utc=="function")i=t.utc();else throw new Error("Unable to convert dayjs object to UTC value: UTC plugin is not available!");return i.format("YYYYMMDD")+(e?"":"T"+i.format("HHmmss")+(a||n?"":"Z"))}}function T(n,t,e,a){let i="",s=(a==null?void 0:a.floating)||!1;return a!=null&&a.timezone&&(i=";TZID="+a.timezone,s=!0),t+i+":"+o(n,e,!1,s)}function l(n,t){return String(n).replace(t?/[\\"]/g:/[\\;,]/g,function(e){return"\\"+e}).replace(/(?:\r\n|\r|\n)/g,"\\n")}function N(n){return n.split(`\r
2
- `).map(function(t){let e="",a=0;for(let i=0;i<t.length;i++){let s=t.charAt(i);s>="\uD800"&&s<="\uDBFF"&&(s+=t.charAt(++i));let m=new TextEncoder().encode(s).length;a+=m,a>74&&(e+=`\r
3
- `,a=m),e+=s}return e}).join(`\r
4
- `)}function u(n,t,e){if(Array.isArray(t))n.x=t.map(a=>{if(Array.isArray(a))return a;if(typeof a.key!="string"||typeof a.value!="string")throw new Error("Either key or value is not a string!");if(a.key.substr(0,2)!=="X-")throw new Error("Key has to start with `X-`!");return[a.key,a.value]});else if(typeof t=="object")n.x=Object.entries(t).map(([a,i])=>{if(typeof a!="string"||typeof i!="string")throw new Error("Either key or value is not a string!");if(a.substr(0,2)!=="X-")throw new Error("Key has to start with `X-`!");return[a,i]});else if(typeof t=="string"&&typeof e=="string"){if(t.substr(0,2)!=="X-")throw new Error("Key has to start with `X-`!");n.x.push([t,e])}else return n.x.map(a=>({key:a[0],value:a[1]}))}function E(n){let t=n.x.map(([e,a])=>e.toUpperCase()+":"+l(a,!1)).join(`\r
1
+ "use strict";var X=Object.create;var S=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames,j=Object.getOwnPropertySymbols,K=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var J=(a,t,e)=>t in a?S(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,R=(a,t)=>{for(var e in t||(t={}))G.call(t,e)&&J(a,e,t[e]);if(j)for(var e of j(t))$.call(t,e)&&J(a,e,t[e]);return a};var _=(a,t)=>{for(var e in t)S(a,e,{get:t[e],enumerable:!0})},H=(a,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Q(t))!G.call(a,i)&&i!==e&&S(a,i,{get:()=>t[i],enumerable:!(n=Z(t,i))||n.enumerable});return a};var tt=(a,t,e)=>(e=a!=null?X(K(a)):{},H(t||!a||!a.__esModule?S(e,"default",{value:a,enumerable:!0}):e,a)),et=a=>H(S({},"__esModule",{value:!0}),a);var lt={};_(lt,{ICalAlarm:()=>I,ICalAlarmType:()=>U,ICalAttendee:()=>c,ICalAttendeeRole:()=>w,ICalAttendeeStatus:()=>L,ICalAttendeeType:()=>z,ICalCalendar:()=>y,ICalCalendarMethod:()=>Y,ICalCategory:()=>p,ICalEvent:()=>D,ICalEventBusyStatus:()=>P,ICalEventClass:()=>k,ICalEventRepeatingFreq:()=>v,ICalEventStatus:()=>B,ICalEventTransparency:()=>F,ICalWeekday:()=>b,default:()=>st,escape:()=>l,foldLines:()=>N,formatDate:()=>o,formatDateTZ:()=>T});module.exports=et(lt);function o(a,t,e,n){if(a!=null&&a.startsWith("/")&&(a=a.substr(1)),typeof t=="string"||t instanceof Date){let i=new Date(t),s=i.getUTCFullYear()+String(i.getUTCMonth()+1).padStart(2,"0")+i.getUTCDate().toString().padStart(2,"0");return a&&(s=i.getFullYear()+String(i.getMonth()+1).padStart(2,"0")+i.getDate().toString().padStart(2,"0")),e?s:a?(s+="T"+i.getHours().toString().padStart(2,"0")+i.getMinutes().toString().padStart(2,"0")+i.getSeconds().toString().padStart(2,"0"),s):(s+="T"+i.getUTCHours().toString().padStart(2,"0")+i.getUTCMinutes().toString().padStart(2,"0")+i.getUTCSeconds().toString().padStart(2,"0")+(n?"":"Z"),s)}else if(O(t)){let i=a?at(t)&&!t.tz()?t.clone().tz(a):t:n?t:t.utc();return i.format("YYYYMMDD")+(e?"":"T"+i.format("HHmmss")+(n||a?"":"Z"))}else if(M(t)){let i=a?t.setZone(a):n?t:t.setZone("utc");return i.toFormat("yyyyLLdd")+(e?"":"T"+i.toFormat("HHmmss")+(n||a?"":"Z"))}else{let i=t;if(a)i=typeof t.tz=="function"?t.tz(a):t;else if(!n)if(typeof t.utc=="function")i=t.utc();else throw new Error("Unable to convert dayjs object to UTC value: UTC plugin is not available!");return i.format("YYYYMMDD")+(e?"":"T"+i.format("HHmmss")+(n||a?"":"Z"))}}function T(a,t,e,n){let i="",s=(n==null?void 0:n.floating)||!1;return n!=null&&n.timezone&&(i=";TZID="+n.timezone,s=!0),t+i+":"+o(a,e,!1,s)}function l(a,t){return String(a).replace(t?/[\\"]/g:/[\\;,]/g,function(e){return"\\"+e}).replace(/(?:\r\n|\r|\n)/g,"\\n")}function N(a){return a.split(`\r
2
+ `).map(function(t){let e="",n=0;for(let i=0;i<t.length;i++){let s=t.charAt(i);s>="\uD800"&&s<="\uDBFF"&&(s+=t.charAt(++i));let f=new TextEncoder().encode(s).length;n+=f,n>74&&(e+=`\r
3
+ `,n=f),e+=s}return e}).join(`\r
4
+ `)}function u(a,t,e){if(Array.isArray(t))a.x=t.map(n=>{if(Array.isArray(n))return n;if(typeof n.key!="string"||typeof n.value!="string")throw new Error("Either key or value is not a string!");if(n.key.substr(0,2)!=="X-")throw new Error("Key has to start with `X-`!");return[n.key,n.value]});else if(typeof t=="object")a.x=Object.entries(t).map(([n,i])=>{if(typeof n!="string"||typeof i!="string")throw new Error("Either key or value is not a string!");if(n.substr(0,2)!=="X-")throw new Error("Key has to start with `X-`!");return[n,i]});else if(typeof t=="string"&&typeof e=="string"){if(t.substr(0,2)!=="X-")throw new Error("Key has to start with `X-`!");a.x.push([t,e])}else return a.x.map(n=>({key:n[0],value:n[1]}))}function E(a){let t=a.x.map(([e,n])=>e.toUpperCase()+":"+l(n,!1)).join(`\r
5
5
  `);return t.length?t+`\r
6
- `:""}function b(n,t){let e=null;if(typeof t=="string"){let a=t.match(/^(.+) ?<([^>]+)>$/);a?e={name:a[1].trim(),email:a[2].trim()}:t.includes("@")&&(e={name:t.trim(),email:t.trim()})}else typeof t=="object"&&(e={name:t.name,email:t.email,mailto:t.mailto,sentBy:t.sentBy});if(!e&&typeof t=="string")throw new Error("`"+n+"` isn't formated correctly. See https://sebbo2002.github.io/ical-generator/develop/reference/interfaces/ICalOrganizer.html");if(!e)throw new Error("`"+n+"` needs to be a valid formed string or an object. See https://sebbo2002.github.io/ical-generator/develop/reference/interfaces/ICalOrganizer.html");if(!e.name)throw new Error("`"+n+".name` is empty!");return e}function d(n,t){let e=Object.values(n),a=String(t).toUpperCase();if(!a||!e.includes(a))throw new Error(`Input must be one of the following: ${e.join(", ")}`);return a}function g(n,t){if(n instanceof Date&&isNaN(n.getTime())||typeof n=="string"&&isNaN(new Date(n).getTime()))throw new Error(`\`${t}\` has to be a valid date!`);if(n instanceof Date||typeof n=="string"||w(n)&&n.isValid===!0||(O(n)||tt(n))&&n.isValid())return n;throw new Error(`\`${t}\` has to be a valid date!`)}function R(n){return typeof n=="string"||n instanceof Date?new Date(n):w(n)?n.toJSDate():n.toDate()}function O(n){return n!=null&&n._isAMomentObject!=null}function _(n){return O(n)&&"tz"in n&&typeof n.tz=="function"}function tt(n){return typeof n=="object"&&n!==null&&!(n instanceof Date)&&!O(n)&&!w(n)}function w(n){return typeof n=="object"&&n!==null&&"toJSDate"in n&&typeof n.toJSDate=="function"}function J(n){return n!==null&&typeof n=="object"&&typeof n.asSeconds=="function"}function M(n){return n!==null&&typeof n=="object"&&typeof n.between=="function"&&typeof n.toString=="function"}function f(n){return n?typeof n=="string"?n:n.toJSON():null}function c(n){let t="";return n<0&&(t="-",n*=-1),t+="P",n>=86400&&(t+=Math.floor(n/86400)+"D",n%=86400),!n&&t.length>1||(t+="T",n>=3600&&(t+=Math.floor(n/3600)+"H",n%=3600),n>=60&&(t+=Math.floor(n/60)+"M",n%=60),n>0?t+=n+"S":t.length<=2&&(t+="0S")),t}var G=K(require("uuid-random"),1);var V=(i=>(i.CHAIR="CHAIR",i.REQ="REQ-PARTICIPANT",i.OPT="OPT-PARTICIPANT",i.NON="NON-PARTICIPANT",i))(V||{}),L=(s=>(s.ACCEPTED="ACCEPTED",s.TENTATIVE="TENTATIVE",s.DECLINED="DECLINED",s.DELEGATED="DELEGATED",s.NEEDSACTION="NEEDS-ACTION",s))(L||{}),z=(s=>(s.INDIVIDUAL="INDIVIDUAL",s.GROUP="GROUP",s.RESOURCE="RESOURCE",s.ROOM="ROOM",s.UNKNOWN="UNKNOWN",s))(z||{}),C=class n{constructor(t,e){if(this.data={name:null,email:null,mailto:null,sentBy:null,status:null,role:"REQ-PARTICIPANT",rsvp:null,type:null,delegatedTo:null,delegatedFrom:null,x:[]},this.event=e,!this.event)throw new Error("`event` option required!");t.name!==void 0&&this.name(t.name),t.email!==void 0&&this.email(t.email),t.mailto!==void 0&&this.mailto(t.mailto),t.sentBy!==void 0&&this.sentBy(t.sentBy),t.status!==void 0&&this.status(t.status),t.role!==void 0&&this.role(t.role),t.rsvp!==void 0&&this.rsvp(t.rsvp),t.type!==void 0&&this.type(t.type),t.delegatedTo!==void 0&&this.delegatedTo(t.delegatedTo),t.delegatedFrom!==void 0&&this.delegatedFrom(t.delegatedFrom),t.delegatesTo&&this.delegatesTo(t.delegatesTo),t.delegatesFrom&&this.delegatesFrom(t.delegatesFrom),t.x!==void 0&&this.x(t.x)}name(t){return t===void 0?this.data.name:(this.data.name=t||null,this)}email(t){return t?(this.data.email=t,this):this.data.email}mailto(t){return t===void 0?this.data.mailto:(this.data.mailto=t||null,this)}sentBy(t){return t?(this.data.sentBy=t,this):this.data.sentBy}role(t){return t===void 0?this.data.role:(this.data.role=d(V,t),this)}rsvp(t){return t===void 0?this.data.rsvp:t===null?(this.data.rsvp=null,this):(this.data.rsvp=!!t,this)}status(t){return t===void 0?this.data.status:t?(this.data.status=d(L,t),this):(this.data.status=null,this)}type(t){return t===void 0?this.data.type:t?(this.data.type=d(z,t),this):(this.data.type=null,this)}delegatedTo(t){return t===void 0?this.data.delegatedTo:t?(typeof t=="string"?this.data.delegatedTo=new n(b("delegatedTo",t),this.event):t instanceof n?this.data.delegatedTo=t:this.data.delegatedTo=new n(t,this.event),this.data.status="DELEGATED",this):(this.data.delegatedTo=null,this.data.status==="DELEGATED"&&(this.data.status=null),this)}delegatedFrom(t){return t===void 0?this.data.delegatedFrom:(t?typeof t=="string"?this.data.delegatedFrom=new n(b("delegatedFrom",t),this.event):t instanceof n?this.data.delegatedFrom=t:this.data.delegatedFrom=new n(t,this.event):this.data.delegatedFrom=null,this)}delegatesTo(t){let e=t instanceof n?t:this.event.createAttendee(t);return this.delegatedTo(e),e.delegatedFrom(this),e}delegatesFrom(t){let e=t instanceof n?t:this.event.createAttendee(t);return this.delegatedFrom(e),e.delegatedTo(this),e}x(t,e){if(t===void 0)return u(this.data);if(typeof t=="string"&&typeof e=="string")u(this.data,t,e);else if(typeof t=="object")u(this.data,t);else throw new Error("Either key or value is not a string!");return this}toJSON(){var t,e;return Object.assign({},this.data,{delegatedTo:((t=this.data.delegatedTo)==null?void 0:t.email())||null,delegatedFrom:((e=this.data.delegatedFrom)==null?void 0:e.email())||null,x:this.x()})}toString(){let t="ATTENDEE";if(!this.data.email)throw new Error("No value for `email` in ICalAttendee given!");return t+=";ROLE="+this.data.role,this.data.type&&(t+=";CUTYPE="+this.data.type),this.data.status&&(t+=";PARTSTAT="+this.data.status),this.data.rsvp!==null&&(t+=";RSVP="+this.data.rsvp.toString().toUpperCase()),this.data.sentBy!==null&&(t+=';SENT-BY="mailto:'+this.data.sentBy+'"'),this.data.delegatedTo&&(t+=';DELEGATED-TO="'+this.data.delegatedTo.email()+'"'),this.data.delegatedFrom&&(t+=';DELEGATED-FROM="'+this.data.delegatedFrom.email()+'"'),this.data.name&&(t+=';CN="'+l(this.data.name,!0)+'"'),this.data.email&&this.data.mailto&&(t+=";EMAIL="+l(this.data.email,!1)),this.data.x.length&&(t+=";"+this.data.x.map(([e,a])=>e.toUpperCase()+"="+l(a,!1)).join(";")),t+=":MAILTO:"+l(this.data.mailto||this.data.email,!1)+`\r
7
- `,t}};var U=(e=>(e.display="display",e.audio="audio",e))(U||{}),et={end:"END",start:"START"},I=class{constructor(t,e){if(this.data={type:null,trigger:null,relatesTo:null,repeat:null,interval:null,attach:null,description:null,x:[]},this.event=e,!e)throw new Error("`event` option required!");t.type!==void 0&&this.type(t.type),t.trigger!==void 0&&this.trigger(t.trigger),t.triggerBefore!==void 0&&this.triggerBefore(t.triggerBefore),t.triggerAfter!==void 0&&this.triggerAfter(t.triggerAfter),t.repeat!==void 0&&this.repeat(t.repeat),t.interval!==void 0&&this.interval(t.interval),t.attach!==void 0&&this.attach(t.attach),t.description!==void 0&&this.description(t.description),t.x!==void 0&&this.x(t.x)}type(t){if(t===void 0)return this.data.type;if(!t)return this.data.type=null,this;if(!Object.keys(U).includes(t))throw new Error("`type` is not correct, must be either `display` or `audio`!");return this.data.type=t,this}trigger(t){if(t===void 0&&typeof this.data.trigger=="number")return-1*this.data.trigger;if(t===void 0&&this.data.trigger)return this.data.trigger;if(t===void 0)return null;if(!t)this.data.trigger=null;else if(typeof t=="number"&&isFinite(t))this.data.trigger=-1*t;else{if(typeof t=="number")throw new Error("`trigger` is not correct, must be a finite number or a supported date!");this.data.trigger=g(t,"trigger")}return this}relatesTo(t){if(t===void 0)return this.data.relatesTo;if(!t)return this.data.relatesTo=null,this;if(!Object.values(et).includes(t))throw new Error("`relatesTo` is not correct, must be either `START` or `END`!");return this.data.relatesTo=t,this}triggerAfter(t){return t===void 0?this.data.trigger:this.trigger(typeof t=="number"?-1*t:t)}triggerBefore(t){return t===void 0?this.trigger():this.trigger(t)}repeat(t){if(t===void 0)return this.data.repeat;if(!t)return this.data.repeat=null,this;if(typeof t!="number"||!isFinite(t))throw new Error("`repeat` is not correct, must be numeric!");return this.data.repeat=t,this}interval(t){if(t===void 0)return this.data.interval||null;if(!t)return this.data.interval=null,this;if(typeof t!="number"||!isFinite(t))throw new Error("`interval` is not correct, must be numeric!");return this.data.interval=t,this}attach(t){if(t===void 0)return this.data.attach;if(!t)return this.data.attach=null,this;let e=null;if(typeof t=="string")e={uri:t,mime:null};else if(typeof t=="object")e={uri:t.uri,mime:t.mime||null};else throw new Error("`attachment` needs to be a valid formed string or an object. See https://sebbo2002.github.io/ical-generator/develop/reference/classes/ICalAlarm.html#attach");if(!e.uri)throw new Error("`attach.uri` is empty!");return this.data.attach={uri:e.uri,mime:e.mime},this}description(t){return t===void 0?this.data.description:t?(this.data.description=t,this):(this.data.description=null,this)}x(t,e){if(t===void 0)return u(this.data);if(typeof t=="string"&&typeof e=="string")u(this.data,t,e);else if(typeof t=="object")u(this.data,t);else throw new Error("Either key or value is not a string!");return this}toJSON(){let t=this.trigger();return Object.assign({},this.data,{trigger:typeof t=="number"?t:f(t),x:this.x()})}toString(){let t=`BEGIN:VALARM\r
8
- `;if(!this.data.type)throw new Error("No value for `type` in ICalAlarm given!");if(!this.data.trigger)throw new Error("No value for `trigger` in ICalAlarm given!");if(t+="ACTION:"+this.data.type.toUpperCase()+`\r
9
- `,typeof this.data.trigger=="number"&&this.data.relatesTo===null?this.data.trigger>0?t+="TRIGGER;RELATED=END:"+c(this.data.trigger)+`\r
10
- `:t+="TRIGGER:"+c(this.data.trigger)+`\r
11
- `:typeof this.data.trigger=="number"?t+="TRIGGER;RELATED="+this.data.relatesTo.toUpperCase()+":"+c(this.data.trigger)+`\r
6
+ `:""}function A(a,t){let e=null;if(typeof t=="string"){let n=t.match(/^(.+) ?<([^>]+)>$/);n?e={name:n[1].trim(),email:n[2].trim()}:t.includes("@")&&(e={name:t.trim(),email:t.trim()})}else typeof t=="object"&&(e={name:t.name,email:t.email,mailto:t.mailto,sentBy:t.sentBy});if(!e&&typeof t=="string")throw new Error("`"+a+"` isn't formated correctly. See https://sebbo2002.github.io/ical-generator/develop/reference/interfaces/ICalOrganizer.html");if(!e)throw new Error("`"+a+"` needs to be a valid formed string or an object. See https://sebbo2002.github.io/ical-generator/develop/reference/interfaces/ICalOrganizer.html");if(!e.name)throw new Error("`"+a+".name` is empty!");return e}function d(a,t){let e=Object.values(a),n=String(t).toUpperCase();if(!n||!e.includes(n))throw new Error(`Input must be one of the following: ${e.join(", ")}`);return n}function g(a,t){if(a instanceof Date&&isNaN(a.getTime())||typeof a=="string"&&isNaN(new Date(a).getTime()))throw new Error(`\`${t}\` has to be a valid date!`);if(a instanceof Date||typeof a=="string"||M(a)&&a.isValid===!0||(O(a)||nt(a))&&a.isValid())return a;throw new Error(`\`${t}\` has to be a valid date!`)}function x(a){return typeof a=="string"||a instanceof Date?new Date(a):M(a)?a.toJSDate():a.toDate()}function O(a){return a!=null&&a._isAMomentObject!=null}function at(a){return O(a)&&"tz"in a&&typeof a.tz=="function"}function nt(a){return typeof a=="object"&&a!==null&&!(a instanceof Date)&&!O(a)&&!M(a)}function M(a){return typeof a=="object"&&a!==null&&"toJSDate"in a&&typeof a.toJSDate=="function"}function W(a){return a!==null&&typeof a=="object"&&typeof a.asSeconds=="function"}function V(a){return a!==null&&typeof a=="object"&&typeof a.between=="function"&&typeof a.toString=="function"}function m(a){return a?typeof a=="string"?a:a.toJSON():null}function C(a){let t="";return a<0&&(t="-",a*=-1),t+="P",a>=86400&&(t+=Math.floor(a/86400)+"D",a%=86400),!a&&t.length>1||(t+="T",a>=3600&&(t+=Math.floor(a/3600)+"H",a%=3600),a>=60&&(t+=Math.floor(a/60)+"M",a%=60),a>0?t+=a+"S":t.length<=2&&(t+="0S")),t}var q=tt(require("uuid-random"),1);var w=(i=>(i.CHAIR="CHAIR",i.REQ="REQ-PARTICIPANT",i.OPT="OPT-PARTICIPANT",i.NON="NON-PARTICIPANT",i))(w||{}),L=(s=>(s.ACCEPTED="ACCEPTED",s.TENTATIVE="TENTATIVE",s.DECLINED="DECLINED",s.DELEGATED="DELEGATED",s.NEEDSACTION="NEEDS-ACTION",s))(L||{}),z=(s=>(s.INDIVIDUAL="INDIVIDUAL",s.GROUP="GROUP",s.RESOURCE="RESOURCE",s.ROOM="ROOM",s.UNKNOWN="UNKNOWN",s))(z||{}),c=class a{constructor(t,e){if(this.data={name:null,email:"",mailto:null,sentBy:null,status:null,role:"REQ-PARTICIPANT",rsvp:null,type:null,delegatedTo:null,delegatedFrom:null,x:[]},this.event=e,!this.event)throw new Error("`event` option required!");if(!t.email)throw new Error("No value for `email` in ICalAttendee given!");t.name!==void 0&&this.name(t.name),t.email!==void 0&&this.email(t.email),t.mailto!==void 0&&this.mailto(t.mailto),t.sentBy!==void 0&&this.sentBy(t.sentBy),t.status!==void 0&&this.status(t.status),t.role!==void 0&&this.role(t.role),t.rsvp!==void 0&&this.rsvp(t.rsvp),t.type!==void 0&&this.type(t.type),t.delegatedTo!==void 0&&this.delegatedTo(t.delegatedTo),t.delegatedFrom!==void 0&&this.delegatedFrom(t.delegatedFrom),t.delegatesTo&&this.delegatesTo(t.delegatesTo),t.delegatesFrom&&this.delegatesFrom(t.delegatesFrom),t.x!==void 0&&this.x(t.x)}name(t){return t===void 0?this.data.name:(this.data.name=t||null,this)}email(t){return t?(this.data.email=t,this):this.data.email}mailto(t){return t===void 0?this.data.mailto:(this.data.mailto=t||null,this)}sentBy(t){return t?(this.data.sentBy=t,this):this.data.sentBy}role(t){return t===void 0?this.data.role:(this.data.role=d(w,t),this)}rsvp(t){return t===void 0?this.data.rsvp:t===null?(this.data.rsvp=null,this):(this.data.rsvp=!!t,this)}status(t){return t===void 0?this.data.status:t?(this.data.status=d(L,t),this):(this.data.status=null,this)}type(t){return t===void 0?this.data.type:t?(this.data.type=d(z,t),this):(this.data.type=null,this)}delegatedTo(t){return t===void 0?this.data.delegatedTo:t?(typeof t=="string"?this.data.delegatedTo=new a(R({email:t},A("delegatedTo",t)),this.event):t instanceof a?this.data.delegatedTo=t:this.data.delegatedTo=new a(t,this.event),this.data.status="DELEGATED",this):(this.data.delegatedTo=null,this.data.status==="DELEGATED"&&(this.data.status=null),this)}delegatedFrom(t){return t===void 0?this.data.delegatedFrom:(t?typeof t=="string"?this.data.delegatedFrom=new a(R({email:t},A("delegatedFrom",t)),this.event):t instanceof a?this.data.delegatedFrom=t:this.data.delegatedFrom=new a(t,this.event):this.data.delegatedFrom=null,this)}delegatesTo(t){let e=t instanceof a?t:this.event.createAttendee(t);return this.delegatedTo(e),e.delegatedFrom(this),e}delegatesFrom(t){let e=t instanceof a?t:this.event.createAttendee(t);return this.delegatedFrom(e),e.delegatedTo(this),e}x(t,e){if(t===void 0)return u(this.data);if(typeof t=="string"&&typeof e=="string")u(this.data,t,e);else if(typeof t=="object")u(this.data,t);else throw new Error("Either key or value is not a string!");return this}toJSON(){var t,e;return Object.assign({},this.data,{delegatedTo:((t=this.data.delegatedTo)==null?void 0:t.email())||null,delegatedFrom:((e=this.data.delegatedFrom)==null?void 0:e.email())||null,x:this.x()})}toString(){let t="ATTENDEE";if(!this.data.email)throw new Error("No value for `email` in ICalAttendee given!");return t+=";ROLE="+this.data.role,this.data.type&&(t+=";CUTYPE="+this.data.type),this.data.status&&(t+=";PARTSTAT="+this.data.status),this.data.rsvp!==null&&(t+=";RSVP="+this.data.rsvp.toString().toUpperCase()),this.data.sentBy!==null&&(t+=';SENT-BY="mailto:'+this.data.sentBy+'"'),this.data.delegatedTo&&(t+=';DELEGATED-TO="'+this.data.delegatedTo.email()+'"'),this.data.delegatedFrom&&(t+=';DELEGATED-FROM="'+this.data.delegatedFrom.email()+'"'),this.data.name&&(t+=';CN="'+l(this.data.name,!0)+'"'),this.data.email&&this.data.mailto&&(t+=";EMAIL="+l(this.data.email,!1)),this.data.x.length&&(t+=";"+this.data.x.map(([e,n])=>e.toUpperCase()+"="+l(n,!1)).join(";")),t+=":MAILTO:"+l(this.data.mailto||this.data.email,!1)+`\r
7
+ `,t}};var U=(e=>(e.display="display",e.audio="audio",e))(U||{}),it={end:"END",start:"START"},I=class{constructor(t,e){if(this.data={type:"display",trigger:-600,relatesTo:null,repeat:null,interval:null,attach:null,description:null,x:[]},this.event=e,!e)throw new Error("`event` option required!");t.type!==void 0&&this.type(t.type),"trigger"in t&&t.trigger!==void 0&&this.trigger(t.trigger),"triggerBefore"in t&&t.triggerBefore!==void 0&&this.triggerBefore(t.triggerBefore),"triggerAfter"in t&&t.triggerAfter!==void 0&&this.triggerAfter(t.triggerAfter),t.repeat&&this.repeat(t.repeat),t.attach!==void 0&&this.attach(t.attach),t.description!==void 0&&this.description(t.description),t.x!==void 0&&this.x(t.x)}type(t){if(t===void 0)return this.data.type;if(!t||!Object.keys(U).includes(t))throw new Error("`type` is not correct, must be either `display` or `audio`!");return this.data.type=t,this}trigger(t){if(t===void 0&&typeof this.data.trigger=="number")return-1*this.data.trigger;if(t===void 0)return this.data.trigger;if(typeof t=="number"&&isFinite(t))this.data.trigger=-1*t;else{if(!t||typeof t=="number")throw new Error("`trigger` is not correct, must be a finite number or a supported date!");this.data.trigger=g(t,"trigger")}return this}relatesTo(t){if(t===void 0)return this.data.relatesTo;if(!t)return this.data.relatesTo=null,this;if(!Object.values(it).includes(t))throw new Error("`relatesTo` is not correct, must be either `START` or `END`!");return this.data.relatesTo=t,this}triggerAfter(t){return t===void 0?this.data.trigger:this.trigger(typeof t=="number"?-1*t:t)}triggerBefore(t){return t===void 0?this.trigger():this.trigger(t)}repeat(t){if(t===void 0)return this.data.repeat;if(!t)return this.data.repeat=null,this;if(typeof t!="object")throw new Error("`repeat` is not correct, must be an object!");if(typeof t.times!="number"||!isFinite(t.times))throw new Error("`repeat.times` is not correct, must be numeric!");if(typeof t.interval!="number"||!isFinite(t.interval))throw new Error("`repeat.interval` is not correct, must be numeric!");return this.data.repeat=t,this}attach(t){if(t===void 0)return this.data.attach;if(!t)return this.data.attach=null,this;let e=null;if(typeof t=="string")e={uri:t,mime:null};else if(typeof t=="object")e={uri:t.uri,mime:t.mime||null};else throw new Error("`attachment` needs to be a valid formed string or an object. See https://sebbo2002.github.io/ical-generator/develop/reference/classes/ICalAlarm.html#attach");if(!e.uri)throw new Error("`attach.uri` is empty!");return this.data.attach={uri:e.uri,mime:e.mime},this}description(t){return t===void 0?this.data.description:t?(this.data.description=t,this):(this.data.description=null,this)}x(t,e){if(t===void 0)return u(this.data);if(typeof t=="string"&&typeof e=="string")u(this.data,t,e);else if(typeof t=="object")u(this.data,t);else throw new Error("Either key or value is not a string!");return this}toJSON(){let t=this.trigger();return Object.assign({},this.data,{trigger:typeof t=="number"?t:m(t),x:this.x()})}toString(){var e;let t=`BEGIN:VALARM\r
8
+ `;if(t+="ACTION:"+this.data.type.toUpperCase()+`\r
9
+ `,typeof this.data.trigger=="number"&&this.data.relatesTo===null?this.data.trigger>0?t+="TRIGGER;RELATED=END:"+C(this.data.trigger)+`\r
10
+ `:t+="TRIGGER:"+C(this.data.trigger)+`\r
11
+ `:typeof this.data.trigger=="number"?t+="TRIGGER;RELATED="+((e=this.data.relatesTo)==null?void 0:e.toUpperCase())+":"+C(this.data.trigger)+`\r
12
12
  `:t+="TRIGGER;VALUE=DATE-TIME:"+o(this.event.timezone(),this.data.trigger)+`\r
13
- `,this.data.repeat&&!this.data.interval)throw new Error("No value for `interval` in ICalAlarm given, but required for `repeat`!");if(this.data.repeat&&(t+="REPEAT:"+this.data.repeat+`\r
14
- `),this.data.interval&&!this.data.repeat)throw new Error("No value for `repeat` in ICalAlarm given, but required for `interval`!");return this.data.interval&&(t+="DURATION:"+c(this.data.interval)+`\r
15
- `),this.data.type==="audio"&&this.data.attach&&this.data.attach.mime?t+="ATTACH;FMTTYPE="+l(this.data.attach.mime,!1)+":"+l(this.data.attach.uri,!1)+`\r
13
+ `,this.data.repeat){if(!this.data.repeat.times)throw new Error("No value for `repeat.times` in ICalAlarm given, but required for `interval`!");if(!this.data.repeat.interval)throw new Error("No value for `repeat.interval` in ICalAlarm given, but required for `repeat`!");t+="REPEAT:"+this.data.repeat.times+`\r
14
+ `,t+="DURATION:"+C(this.data.repeat.interval)+`\r
15
+ `}return this.data.type==="audio"&&this.data.attach&&this.data.attach.mime?t+="ATTACH;FMTTYPE="+l(this.data.attach.mime,!1)+":"+l(this.data.attach.uri,!1)+`\r
16
16
  `:this.data.type==="audio"&&this.data.attach?t+="ATTACH;VALUE=URI:"+l(this.data.attach.uri,!1)+`\r
17
17
  `:this.data.type==="audio"&&(t+=`ATTACH;VALUE=URI:Basso\r
18
18
  `),this.data.type==="display"&&this.data.description?t+="DESCRIPTION:"+l(this.data.description,!1)+`\r
19
19
  `:this.data.type==="display"&&(t+="DESCRIPTION:"+l(this.event.summary(),!1)+`\r
20
20
  `),t+=E(this.data),t+=`END:VALARM\r
21
- `,t}};var p=class{constructor(t){this.data={name:null},t.name!==void 0&&this.name(t.name)}name(t){return t===void 0?this.data.name:(this.data.name=t||null,this)}toJSON(){return Object.assign({},this.data)}toString(){if(!this.data.name)throw new Error("No value for `name` in ICalCategory given!");return l(this.data.name,!1)}};var v=(r=>(r.SECONDLY="SECONDLY",r.MINUTELY="MINUTELY",r.HOURLY="HOURLY",r.DAILY="DAILY",r.WEEKLY="WEEKLY",r.MONTHLY="MONTHLY",r.YEARLY="YEARLY",r))(v||{}),A=(r=>(r.SU="SU",r.MO="MO",r.TU="TU",r.WE="WE",r.TH="TH",r.FR="FR",r.SA="SA",r))(A||{});var P=(a=>(a.CONFIRMED="CONFIRMED",a.TENTATIVE="TENTATIVE",a.CANCELLED="CANCELLED",a))(P||{}),B=(i=>(i.FREE="FREE",i.TENTATIVE="TENTATIVE",i.BUSY="BUSY",i.OOF="OOF",i))(B||{}),F=(e=>(e.TRANSPARENT="TRANSPARENT",e.OPAQUE="OPAQUE",e))(F||{}),k=(a=>(a.PUBLIC="PUBLIC",a.PRIVATE="PRIVATE",a.CONFIDENTIAL="CONFIDENTIAL",a))(k||{}),y=class{constructor(t,e){if(this.data={id:(0,G.default)(),sequence:0,start:null,end:null,recurrenceId:null,timezone:null,stamp:new Date,allDay:!1,floating:!1,repeating:null,summary:"",location:null,description:null,organizer:null,attendees:[],alarms:[],categories:[],status:null,busystatus:null,priority:null,url:null,attachments:[],transparency:null,created:null,lastModified:null,class:null,x:[]},this.calendar=e,!e)throw new Error("`calendar` option required!");t.id&&this.id(t.id),t.sequence!==void 0&&this.sequence(t.sequence),t.start&&this.start(t.start),t.end!==void 0&&this.end(t.end),t.recurrenceId!==void 0&&this.recurrenceId(t.recurrenceId),t.timezone!==void 0&&this.timezone(t.timezone),t.stamp!==void 0&&this.stamp(t.stamp),t.allDay!==void 0&&this.allDay(t.allDay),t.floating!==void 0&&this.floating(t.floating),t.repeating!==void 0&&this.repeating(t.repeating),t.summary!==void 0&&this.summary(t.summary),t.location!==void 0&&this.location(t.location),t.description!==void 0&&this.description(t.description),t.organizer!==void 0&&this.organizer(t.organizer),t.attendees!==void 0&&this.attendees(t.attendees),t.alarms!==void 0&&this.alarms(t.alarms),t.categories!==void 0&&this.categories(t.categories),t.status!==void 0&&this.status(t.status),t.busystatus!==void 0&&this.busystatus(t.busystatus),t.priority!==void 0&&this.priority(t.priority),t.url!==void 0&&this.url(t.url),t.attachments!==void 0&&this.attachments(t.attachments),t.transparency!==void 0&&this.transparency(t.transparency),t.created!==void 0&&this.created(t.created),t.lastModified!==void 0&&this.lastModified(t.lastModified),t.class!==void 0&&this.class(t.class),t.x!==void 0&&this.x(t.x)}id(t){return t===void 0?this.data.id:(this.data.id=String(t),this)}uid(t){return t===void 0?this.id():this.id(t)}sequence(t){if(t===void 0)return this.data.sequence;let e=parseInt(String(t),10);if(isNaN(e))throw new Error("`sequence` must be a number!");return this.data.sequence=t,this}start(t){if(t===void 0)return this.data.start;if(this.data.start=g(t,"start"),this.data.start&&this.data.end&&R(this.data.start).getTime()>R(this.data.end).getTime()){let e=this.data.start;this.data.start=this.data.end,this.data.end=e}return this}end(t){if(t===void 0)return this.data.end;if(t===null)return this.data.end=null,this;if(this.data.end=g(t,"end"),this.data.start&&this.data.end&&R(this.data.start).getTime()>R(this.data.end).getTime()){let e=this.data.start;this.data.start=this.data.end,this.data.end=e}return this}recurrenceId(t){return t===void 0?this.data.recurrenceId:t===null?(this.data.recurrenceId=null,this):(this.data.recurrenceId=g(t,"recurrenceId"),this)}timezone(t){return t===void 0&&this.data.timezone!==null?this.data.timezone:t===void 0?this.calendar.timezone():(this.data.timezone=t&&t!=="UTC"?t.toString():null,this.data.timezone&&(this.data.floating=!1),this)}stamp(t){return t===void 0?this.data.stamp:(this.data.stamp=g(t,"stamp"),this)}timestamp(t){return t===void 0?this.stamp():this.stamp(t)}allDay(t){return t===void 0?this.data.allDay:(this.data.allDay=!!t,this)}floating(t){return t===void 0?this.data.floating:(this.data.floating=!!t,this.data.floating&&(this.data.timezone=null),this)}repeating(t){if(t===void 0)return this.data.repeating;if(!t)return this.data.repeating=null,this;if(M(t)||typeof t=="string")return this.data.repeating=t,this;if(this.data.repeating={freq:d(v,t.freq)},t.count){if(!isFinite(t.count))throw new Error("`repeating.count` must be a finite number!");this.data.repeating.count=t.count}if(t.interval){if(!isFinite(t.interval))throw new Error("`repeating.interval` must be a finite number!");this.data.repeating.interval=t.interval}if(t.until!==void 0&&(this.data.repeating.until=g(t.until,"repeating.until")),t.byDay){let e=Array.isArray(t.byDay)?t.byDay:[t.byDay];this.data.repeating.byDay=e.map(a=>d(A,a))}if(t.byMonth){let e=Array.isArray(t.byMonth)?t.byMonth:[t.byMonth];this.data.repeating.byMonth=e.map(a=>{if(typeof a!="number"||a<1||a>12)throw new Error("`repeating.byMonth` contains invalid value `"+a+"`!");return a})}if(t.byMonthDay){let e=Array.isArray(t.byMonthDay)?t.byMonthDay:[t.byMonthDay];this.data.repeating.byMonthDay=e.map(a=>{if(typeof a!="number"||a<-31||a>31||a===0)throw new Error("`repeating.byMonthDay` contains invalid value `"+a+"`!");return a})}if(t.bySetPos){if(!this.data.repeating.byDay)throw"`repeating.bySetPos` must be used along with `repeating.byDay`!";let e=Array.isArray(t.bySetPos)?t.bySetPos:[t.bySetPos];this.data.repeating.bySetPos=e.map(a=>{if(typeof a!="number"||a<-366||a>366||a===0)throw"`repeating.bySetPos` contains invalid value `"+a+"`!";return a})}if(t.exclude){let e=Array.isArray(t.exclude)?t.exclude:[t.exclude];this.data.repeating.exclude=e.map((a,i)=>g(a,`repeating.exclude[${i}]`))}return t.startOfWeek&&(this.data.repeating.startOfWeek=d(A,t.startOfWeek)),this}summary(t){return t===void 0?this.data.summary:(this.data.summary=t?String(t):"",this)}location(t){if(t===void 0)return this.data.location;if(typeof t=="string")return this.data.location={title:t},this;if(t&&!t.title||t!=null&&t.geo&&(!isFinite(t.geo.lat)||!isFinite(t.geo.lon)))throw new Error("`location` isn't formatted correctly. See https://sebbo2002.github.io/ical-generator/develop/reference/classes/ICalEvent.html#location");return this.data.location=t||null,this}description(t){return t===void 0?this.data.description:t===null?(this.data.description=null,this):(typeof t=="string"?this.data.description={plain:t}:this.data.description=t,this)}organizer(t){return t===void 0?this.data.organizer:t===null?(this.data.organizer=null,this):(this.data.organizer=b("organizer",t),this)}createAttendee(t={}){if(t instanceof C)return this.data.attendees.push(t),t;typeof t=="string"&&(t=b("data",t));let e=new C(t,this);return this.data.attendees.push(e),e}attendees(t){return t?(t.forEach(e=>this.createAttendee(e)),this):this.data.attendees}createAlarm(t={}){let e=t instanceof I?t:new I(t,this);return this.data.alarms.push(e),e}alarms(t){return t?(t.forEach(e=>this.createAlarm(e)),this):this.data.alarms}createCategory(t={}){let e=t instanceof p?t:new p(t);return this.data.categories.push(e),e}categories(t){return t?(t.forEach(e=>this.createCategory(e)),this):this.data.categories}status(t){return t===void 0?this.data.status:t===null?(this.data.status=null,this):(this.data.status=d(P,t),this)}busystatus(t){return t===void 0?this.data.busystatus:t===null?(this.data.busystatus=null,this):(this.data.busystatus=d(B,t),this)}priority(t){if(t===void 0)return this.data.priority;if(t===null)return this.data.priority=null,this;if(t<0||t>9)throw new Error("`priority` is invalid, musst be 0 \u2264 priority \u2264 9.");return this.data.priority=Math.round(t),this}url(t){return t===void 0?this.data.url:(this.data.url=t?String(t):null,this)}createAttachment(t){return this.data.attachments.push(t),this}attachments(t){return t?(t.forEach(e=>this.createAttachment(e)),this):this.data.attachments}transparency(t){return t===void 0?this.data.transparency:t?(this.data.transparency=d(F,t),this):(this.data.transparency=null,this)}created(t){return t===void 0?this.data.created:t===null?(this.data.created=null,this):(this.data.created=g(t,"created"),this)}lastModified(t){return t===void 0?this.data.lastModified:t===null?(this.data.lastModified=null,this):(this.data.lastModified=g(t,"lastModified"),this)}class(t){return t===void 0?this.data.class:t===null?(this.data.class=null,this):(this.data.class=d(k,t),this)}x(t,e){return t===void 0?u(this.data):(typeof t=="string"&&typeof e=="string"&&u(this.data,t,e),typeof t=="object"&&u(this.data,t),this)}toJSON(){var e;let t=null;return M(this.data.repeating)||typeof this.data.repeating=="string"?t=this.data.repeating.toString():this.data.repeating&&(t=Object.assign({},this.data.repeating,{until:f(this.data.repeating.until)||void 0,exclude:(e=this.data.repeating.exclude)==null?void 0:e.map(a=>f(a))})),Object.assign({},this.data,{start:f(this.data.start)||null,end:f(this.data.end)||null,recurrenceId:f(this.data.recurrenceId)||null,stamp:f(this.data.stamp)||null,created:f(this.data.created)||null,lastModified:f(this.data.lastModified)||null,repeating:t,x:this.x()})}toString(){var e,a,i,s,m;let t="";if(!this.data.start)throw new Error("No value for `start` in ICalEvent #"+this.data.id+" given!");if(t+=`BEGIN:VEVENT\r
21
+ `,t}};var p=class{constructor(t){if(this.data={name:""},!t.name)throw new Error("No value for `name` in ICalCategory given!");this.name(t.name)}name(t){return t===void 0?this.data.name:(this.data.name=t,this)}toJSON(){return Object.assign({},this.data)}toString(){return l(this.data.name,!1)}};var v=(r=>(r.SECONDLY="SECONDLY",r.MINUTELY="MINUTELY",r.HOURLY="HOURLY",r.DAILY="DAILY",r.WEEKLY="WEEKLY",r.MONTHLY="MONTHLY",r.YEARLY="YEARLY",r))(v||{}),b=(r=>(r.SU="SU",r.MO="MO",r.TU="TU",r.WE="WE",r.TH="TH",r.FR="FR",r.SA="SA",r))(b||{});var B=(n=>(n.CONFIRMED="CONFIRMED",n.TENTATIVE="TENTATIVE",n.CANCELLED="CANCELLED",n))(B||{}),P=(i=>(i.FREE="FREE",i.TENTATIVE="TENTATIVE",i.BUSY="BUSY",i.OOF="OOF",i))(P||{}),F=(e=>(e.TRANSPARENT="TRANSPARENT",e.OPAQUE="OPAQUE",e))(F||{}),k=(n=>(n.PUBLIC="PUBLIC",n.PRIVATE="PRIVATE",n.CONFIDENTIAL="CONFIDENTIAL",n))(k||{}),D=class{constructor(t,e){if(this.data={id:(0,q.default)(),sequence:0,start:new Date,end:null,recurrenceId:null,timezone:null,stamp:new Date,allDay:!1,floating:!1,repeating:null,summary:"",location:null,description:null,organizer:null,attendees:[],alarms:[],categories:[],status:null,busystatus:null,priority:null,url:null,attachments:[],transparency:null,created:null,lastModified:null,class:null,x:[]},this.calendar=e,!e)throw new Error("`calendar` option required!");t.id&&this.id(t.id),t.sequence!==void 0&&this.sequence(t.sequence),t.start&&this.start(t.start),t.end!==void 0&&this.end(t.end),t.recurrenceId!==void 0&&this.recurrenceId(t.recurrenceId),t.timezone!==void 0&&this.timezone(t.timezone),t.stamp!==void 0&&this.stamp(t.stamp),t.allDay!==void 0&&this.allDay(t.allDay),t.floating!==void 0&&this.floating(t.floating),t.repeating!==void 0&&this.repeating(t.repeating),t.summary!==void 0&&this.summary(t.summary),t.location!==void 0&&this.location(t.location),t.description!==void 0&&this.description(t.description),t.organizer!==void 0&&this.organizer(t.organizer),t.attendees!==void 0&&this.attendees(t.attendees),t.alarms!==void 0&&this.alarms(t.alarms),t.categories!==void 0&&this.categories(t.categories),t.status!==void 0&&this.status(t.status),t.busystatus!==void 0&&this.busystatus(t.busystatus),t.priority!==void 0&&this.priority(t.priority),t.url!==void 0&&this.url(t.url),t.attachments!==void 0&&this.attachments(t.attachments),t.transparency!==void 0&&this.transparency(t.transparency),t.created!==void 0&&this.created(t.created),t.lastModified!==void 0&&this.lastModified(t.lastModified),t.class!==void 0&&this.class(t.class),t.x!==void 0&&this.x(t.x)}id(t){return t===void 0?this.data.id:(this.data.id=String(t),this)}uid(t){return t===void 0?this.id():this.id(t)}sequence(t){if(t===void 0)return this.data.sequence;let e=parseInt(String(t),10);if(isNaN(e))throw new Error("`sequence` must be a number!");return this.data.sequence=t,this}start(t){if(t===void 0)return this.data.start;if(this.data.start=g(t,"start"),this.data.start&&this.data.end&&x(this.data.start).getTime()>x(this.data.end).getTime()){let e=this.data.start;this.data.start=this.data.end,this.data.end=e}return this}end(t){if(t===void 0)return this.data.end;if(t===null)return this.data.end=null,this;if(this.data.end=g(t,"end"),this.data.start&&this.data.end&&x(this.data.start).getTime()>x(this.data.end).getTime()){let e=this.data.start;this.data.start=this.data.end,this.data.end=e}return this}recurrenceId(t){return t===void 0?this.data.recurrenceId:t===null?(this.data.recurrenceId=null,this):(this.data.recurrenceId=g(t,"recurrenceId"),this)}timezone(t){return t===void 0&&this.data.timezone!==null?this.data.timezone:t===void 0?this.calendar.timezone():(this.data.timezone=t&&t!=="UTC"?t.toString():null,this.data.timezone&&(this.data.floating=!1),this)}stamp(t){return t===void 0?this.data.stamp:(this.data.stamp=g(t,"stamp"),this)}timestamp(t){return t===void 0?this.stamp():this.stamp(t)}allDay(t){return t===void 0?this.data.allDay:(this.data.allDay=!!t,this)}floating(t){return t===void 0?this.data.floating:(this.data.floating=!!t,this.data.floating&&(this.data.timezone=null),this)}repeating(t){if(t===void 0)return this.data.repeating;if(!t)return this.data.repeating=null,this;if(V(t)||typeof t=="string")return this.data.repeating=t,this;if(this.data.repeating={freq:d(v,t.freq)},t.count){if(!isFinite(t.count))throw new Error("`repeating.count` must be a finite number!");this.data.repeating.count=t.count}if(t.interval){if(!isFinite(t.interval))throw new Error("`repeating.interval` must be a finite number!");this.data.repeating.interval=t.interval}if(t.until!==void 0&&(this.data.repeating.until=g(t.until,"repeating.until")),t.byDay){let e=Array.isArray(t.byDay)?t.byDay:[t.byDay];this.data.repeating.byDay=e.map(n=>d(b,n))}if(t.byMonth){let e=Array.isArray(t.byMonth)?t.byMonth:[t.byMonth];this.data.repeating.byMonth=e.map(n=>{if(typeof n!="number"||n<1||n>12)throw new Error("`repeating.byMonth` contains invalid value `"+n+"`!");return n})}if(t.byMonthDay){let e=Array.isArray(t.byMonthDay)?t.byMonthDay:[t.byMonthDay];this.data.repeating.byMonthDay=e.map(n=>{if(typeof n!="number"||n<-31||n>31||n===0)throw new Error("`repeating.byMonthDay` contains invalid value `"+n+"`!");return n})}if(t.bySetPos){if(!this.data.repeating.byDay)throw"`repeating.bySetPos` must be used along with `repeating.byDay`!";let e=Array.isArray(t.bySetPos)?t.bySetPos:[t.bySetPos];this.data.repeating.bySetPos=e.map(n=>{if(typeof n!="number"||n<-366||n>366||n===0)throw"`repeating.bySetPos` contains invalid value `"+n+"`!";return n})}if(t.exclude){let e=Array.isArray(t.exclude)?t.exclude:[t.exclude];this.data.repeating.exclude=e.map((n,i)=>g(n,`repeating.exclude[${i}]`))}return t.startOfWeek&&(this.data.repeating.startOfWeek=d(b,t.startOfWeek)),this}summary(t){return t===void 0?this.data.summary:(this.data.summary=t?String(t):"",this)}location(t){if(t===void 0)return this.data.location;if(typeof t=="string")return this.data.location={title:t},this;if(t&&!t.title||t!=null&&t.geo&&(!isFinite(t.geo.lat)||!isFinite(t.geo.lon)))throw new Error("`location` isn't formatted correctly. See https://sebbo2002.github.io/ical-generator/develop/reference/classes/ICalEvent.html#location");return this.data.location=t||null,this}description(t){return t===void 0?this.data.description:t===null?(this.data.description=null,this):(typeof t=="string"?this.data.description={plain:t}:this.data.description=t,this)}organizer(t){return t===void 0?this.data.organizer:t===null?(this.data.organizer=null,this):(this.data.organizer=A("organizer",t),this)}createAttendee(t){if(t instanceof c)return this.data.attendees.push(t),t;typeof t=="string"&&(t=R({email:t},A("data",t)));let e=new c(t,this);return this.data.attendees.push(e),e}attendees(t){return t?(t.forEach(e=>this.createAttendee(e)),this):this.data.attendees}createAlarm(t){let e=t instanceof I?t:new I(t,this);return this.data.alarms.push(e),e}alarms(t){return t?(t.forEach(e=>this.createAlarm(e)),this):this.data.alarms}createCategory(t){let e=t instanceof p?t:new p(t);return this.data.categories.push(e),e}categories(t){return t?(t.forEach(e=>this.createCategory(e)),this):this.data.categories}status(t){return t===void 0?this.data.status:t===null?(this.data.status=null,this):(this.data.status=d(B,t),this)}busystatus(t){return t===void 0?this.data.busystatus:t===null?(this.data.busystatus=null,this):(this.data.busystatus=d(P,t),this)}priority(t){if(t===void 0)return this.data.priority;if(t===null)return this.data.priority=null,this;if(t<0||t>9)throw new Error("`priority` is invalid, musst be 0 \u2264 priority \u2264 9.");return this.data.priority=Math.round(t),this}url(t){return t===void 0?this.data.url:(this.data.url=t?String(t):null,this)}createAttachment(t){return this.data.attachments.push(t),this}attachments(t){return t?(t.forEach(e=>this.createAttachment(e)),this):this.data.attachments}transparency(t){return t===void 0?this.data.transparency:t?(this.data.transparency=d(F,t),this):(this.data.transparency=null,this)}created(t){return t===void 0?this.data.created:t===null?(this.data.created=null,this):(this.data.created=g(t,"created"),this)}lastModified(t){return t===void 0?this.data.lastModified:t===null?(this.data.lastModified=null,this):(this.data.lastModified=g(t,"lastModified"),this)}class(t){return t===void 0?this.data.class:t===null?(this.data.class=null,this):(this.data.class=d(k,t),this)}x(t,e){return t===void 0?u(this.data):(typeof t=="string"&&typeof e=="string"&&u(this.data,t,e),typeof t=="object"&&u(this.data,t),this)}toJSON(){var e;let t=null;return V(this.data.repeating)||typeof this.data.repeating=="string"?t=this.data.repeating.toString():this.data.repeating&&(t=Object.assign({},this.data.repeating,{until:m(this.data.repeating.until)||void 0,exclude:(e=this.data.repeating.exclude)==null?void 0:e.map(n=>m(n))})),Object.assign({},this.data,{start:m(this.data.start)||null,end:m(this.data.end)||null,recurrenceId:m(this.data.recurrenceId)||null,stamp:m(this.data.stamp)||null,created:m(this.data.created)||null,lastModified:m(this.data.lastModified)||null,repeating:t,x:this.x()})}toString(){var e,n,i,s,f;let t="";if(t+=`BEGIN:VEVENT\r
22
22
  `,t+="UID:"+this.data.id+`\r
23
23
  `,t+="SEQUENCE:"+this.data.sequence+`\r
24
24
  `,t+="DTSTAMP:"+o(this.calendar.timezone(),this.data.stamp)+`\r
@@ -28,7 +28,7 @@
28
28
  `,t+=`X-MICROSOFT-MSNCALENDAR-ALLDAYEVENT:TRUE\r
29
29
  `):(t+=T(this.timezone(),"DTSTART",this.data.start,this.data)+`\r
30
30
  `,this.data.end&&(t+=T(this.timezone(),"DTEND",this.data.end,this.data)+`\r
31
- `)),M(this.data.repeating)||typeof this.data.repeating=="string"){let r=this.data.repeating.toString().replace(/\r\n/g,`
31
+ `)),V(this.data.repeating)||typeof this.data.repeating=="string"){let r=this.data.repeating.toString().replace(/\r\n/g,`
32
32
  `).split(`
33
33
  `).filter(h=>h&&!h.startsWith("DTSTART:")).join(`\r
34
34
  `);!r.includes(`\r
@@ -42,12 +42,12 @@
42
42
  `,this.data.transparency&&(t+="TRANSP:"+l(this.data.transparency,!1)+`\r
43
43
  `),(e=this.data.location)!=null&&e.title&&(t+="LOCATION:"+l(this.data.location.title+(this.data.location.address?`
44
44
  `+this.data.location.address:""),!1)+`\r
45
- `,this.data.location.radius&&this.data.location.geo&&(t+="X-APPLE-STRUCTURED-LOCATION;VALUE=URI;"+(this.data.location.address?"X-ADDRESS="+l(this.data.location.address,!1)+";":"")+"X-APPLE-RADIUS="+l(this.data.location.radius,!1)+";X-TITLE="+l(this.data.location.title,!1)+":geo:"+l((a=this.data.location.geo)==null?void 0:a.lat,!1)+","+l((i=this.data.location.geo)==null?void 0:i.lon,!1)+`\r
46
- `),this.data.location.geo&&(t+="GEO:"+l((s=this.data.location.geo)==null?void 0:s.lat,!1)+";"+l((m=this.data.location.geo)==null?void 0:m.lon,!1)+`\r
45
+ `,this.data.location.radius&&this.data.location.geo&&(t+="X-APPLE-STRUCTURED-LOCATION;VALUE=URI;"+(this.data.location.address?"X-ADDRESS="+l(this.data.location.address,!1)+";":"")+"X-APPLE-RADIUS="+l(this.data.location.radius,!1)+";X-TITLE="+l(this.data.location.title,!1)+":geo:"+l((n=this.data.location.geo)==null?void 0:n.lat,!1)+","+l((i=this.data.location.geo)==null?void 0:i.lon,!1)+`\r
46
+ `),this.data.location.geo&&(t+="GEO:"+l((s=this.data.location.geo)==null?void 0:s.lat,!1)+";"+l((f=this.data.location.geo)==null?void 0:f.lon,!1)+`\r
47
47
  `)),this.data.description&&(t+="DESCRIPTION:"+l(this.data.description.plain,!1)+`\r
48
48
  `,this.data.description.html&&(t+="X-ALT-DESC;FMTTYPE=text/html:"+l(this.data.description.html,!1)+`\r
49
49
  `)),this.data.organizer&&(t+='ORGANIZER;CN="'+l(this.data.organizer.name,!0)+'"',this.data.organizer.sentBy&&(t+=';SENT-BY="mailto:'+l(this.data.organizer.sentBy,!0)+'"'),this.data.organizer.email&&this.data.organizer.mailto&&(t+=";EMAIL="+l(this.data.organizer.email,!1)),this.data.organizer.email&&(t+=":mailto:"+l(this.data.organizer.mailto||this.data.organizer.email,!1)),t+=`\r
50
- `),this.data.attendees.forEach(function(r){t+=r.toString()}),this.data.alarms.forEach(function(r){t+=r.toString()}),this.data.categories.length>0&&(t+="CATEGORIES:"+this.data.categories.map(function(r){return r.toString()}).join()+`\r
50
+ `),this.data.attendees.forEach(function(r){t+=r.toString()}),this.data.alarms.forEach(function(r){t+=r.toString()}),this.data.categories.length>0&&(t+="CATEGORIES:"+this.data.categories.map(r=>r.toString()).join()+`\r
51
51
  `),this.data.url&&(t+="URL;VALUE=URI:"+l(this.data.url,!1)+`\r
52
52
  `),this.data.attachments.length>0&&this.data.attachments.forEach(r=>{t+="ATTACH:"+l(r,!1)+`\r
53
53
  `}),this.data.status&&(t+="STATUS:"+this.data.status.toUpperCase()+`\r
@@ -57,7 +57,7 @@
57
57
  `),this.data.lastModified&&(t+="LAST-MODIFIED:"+o(this.calendar.timezone(),this.data.lastModified)+`\r
58
58
  `),this.data.class&&(t+="CLASS:"+this.data.class.toUpperCase()+`\r
59
59
  `),t+=`END:VEVENT\r
60
- `,t}};var S=require("fs"),Y=(h=>(h.PUBLISH="PUBLISH",h.REQUEST="REQUEST",h.REPLY="REPLY",h.ADD="ADD",h.CANCEL="CANCEL",h.REFRESH="REFRESH",h.COUNTER="COUNTER",h.DECLINECOUNTER="DECLINECOUNTER",h))(Y||{}),D=class{constructor(t={}){this.data={prodId:"//sebbo.net//ical-generator//EN",method:null,name:null,description:null,timezone:null,source:null,url:null,scale:null,ttl:null,events:[],x:[]},t.prodId!==void 0&&this.prodId(t.prodId),t.method!==void 0&&this.method(t.method),t.name!==void 0&&this.name(t.name),t.description!==void 0&&this.description(t.description),t.timezone!==void 0&&this.timezone(t.timezone),t.source!==void 0&&this.source(t.source),t.url!==void 0&&this.url(t.url),t.scale!==void 0&&this.scale(t.scale),t.ttl!==void 0&&this.ttl(t.ttl),t.events!==void 0&&this.events(t.events),t.x!==void 0&&this.x(t.x)}prodId(t){if(!t)return this.data.prodId;if(typeof t=="string"&&/^\/\/(.+)\/\/(.+)\/\/([A-Z]{1,4})$/.test(t))return this.data.prodId=t,this;if(typeof t=="string")throw new Error("`prodId` isn't formated correctly. See https://sebbo2002.github.io/ical-generator/develop/reference/classes/ICalCalendar.html#prodId");if(typeof t!="object")throw new Error("`prodid` needs to be a valid formed string or an object!");if(!t.company)throw new Error("`prodid.company` is a mandatory item!");if(!t.product)throw new Error("`prodid.product` is a mandatory item!");let a=(t.language||"EN").toUpperCase();return this.data.prodId="//"+t.company+"//"+t.product+"//"+a,this}method(t){return t===void 0?this.data.method:t?(this.data.method=d(Y,t),this):(this.data.method=null,this)}name(t){return t===void 0?this.data.name:(this.data.name=t?String(t):null,this)}description(t){return t===void 0?this.data.description:(this.data.description=t?String(t):null,this)}timezone(t){var e;return t===void 0?((e=this.data.timezone)==null?void 0:e.name)||null:(t==="UTC"?this.data.timezone=null:typeof t=="string"?this.data.timezone={name:t}:t===null?this.data.timezone=null:this.data.timezone=t,this)}source(t){return t===void 0?this.data.source:(this.data.source=t||null,this)}url(t){return t===void 0?this.data.url:(this.data.url=t||null,this)}scale(t){return t===void 0?this.data.scale:(t===null?this.data.scale=null:this.data.scale=t.toUpperCase(),this)}ttl(t){return t===void 0?this.data.ttl:(J(t)?this.data.ttl=t.asSeconds():t&&t>0?this.data.ttl=t:this.data.ttl=null,this)}createEvent(t){let e=t instanceof y?t:new y(t,this);return this.data.events.push(e),e}events(t){return t?(t.forEach(e=>this.createEvent(e)),this):this.data.events}clear(){return this.data.events=[],this}save(t,e){return e?((0,S.writeFile)(t,this.toString(),e),this):S.promises.writeFile(t,this.toString())}saveSync(t){return(0,S.writeFileSync)(t,this.toString()),this}serve(t,e="calendar.ics"){return t.writeHead(200,{"Content-Type":"text/calendar; charset=utf-8","Content-Disposition":`attachment; filename="${e}"`}),t.end(this.toString()),this}toBlob(){return new Blob([this.toString()],{type:"text/calendar"})}toURL(){return URL.createObjectURL(this.toBlob())}x(t,e){if(t===void 0)return u(this.data);if(typeof t=="string"&&typeof e=="string")u(this.data,t,e);else if(typeof t=="object")u(this.data,t);else throw new Error("Either key or value is not a string!");return this}toJSON(){return Object.assign({},this.data,{timezone:this.timezone(),events:this.data.events.map(t=>t.toJSON()),x:this.x()})}length(){return this.data.events.length}toString(){var e,a;let t="";return t=`BEGIN:VCALENDAR\r
60
+ `,t}};var Y=(h=>(h.PUBLISH="PUBLISH",h.REQUEST="REQUEST",h.REPLY="REPLY",h.ADD="ADD",h.CANCEL="CANCEL",h.REFRESH="REFRESH",h.COUNTER="COUNTER",h.DECLINECOUNTER="DECLINECOUNTER",h))(Y||{}),y=class{constructor(t={}){this.data={prodId:"//sebbo.net//ical-generator//EN",method:null,name:null,description:null,timezone:null,source:null,url:null,scale:null,ttl:null,events:[],x:[]},t.prodId!==void 0&&this.prodId(t.prodId),t.method!==void 0&&this.method(t.method),t.name!==void 0&&this.name(t.name),t.description!==void 0&&this.description(t.description),t.timezone!==void 0&&this.timezone(t.timezone),t.source!==void 0&&this.source(t.source),t.url!==void 0&&this.url(t.url),t.scale!==void 0&&this.scale(t.scale),t.ttl!==void 0&&this.ttl(t.ttl),t.events!==void 0&&this.events(t.events),t.x!==void 0&&this.x(t.x)}prodId(t){if(!t)return this.data.prodId;if(typeof t=="string"&&/^\/\/(.+)\/\/(.+)\/\/([A-Z]{1,4})$/.test(t))return this.data.prodId=t,this;if(typeof t=="string")throw new Error("`prodId` isn't formated correctly. See https://sebbo2002.github.io/ical-generator/develop/reference/classes/ICalCalendar.html#prodId");if(typeof t!="object")throw new Error("`prodid` needs to be a valid formed string or an object!");if(!t.company)throw new Error("`prodid.company` is a mandatory item!");if(!t.product)throw new Error("`prodid.product` is a mandatory item!");let n=(t.language||"EN").toUpperCase();return this.data.prodId="//"+t.company+"//"+t.product+"//"+n,this}method(t){return t===void 0?this.data.method:t?(this.data.method=d(Y,t),this):(this.data.method=null,this)}name(t){return t===void 0?this.data.name:(this.data.name=t?String(t):null,this)}description(t){return t===void 0?this.data.description:(this.data.description=t?String(t):null,this)}timezone(t){var e;return t===void 0?((e=this.data.timezone)==null?void 0:e.name)||null:(t==="UTC"?this.data.timezone=null:typeof t=="string"?this.data.timezone={name:t}:t===null?this.data.timezone=null:this.data.timezone=t,this)}source(t){return t===void 0?this.data.source:(this.data.source=t||null,this)}url(t){return t===void 0?this.data.url:(this.data.url=t||null,this)}scale(t){return t===void 0?this.data.scale:(t===null?this.data.scale=null:this.data.scale=t.toUpperCase(),this)}ttl(t){return t===void 0?this.data.ttl:(W(t)?this.data.ttl=t.asSeconds():t&&t>0?this.data.ttl=t:this.data.ttl=null,this)}createEvent(t){let e=t instanceof D?t:new D(t,this);return this.data.events.push(e),e}events(t){return t?(t.forEach(e=>this.createEvent(e)),this):this.data.events}clear(){return this.data.events=[],this}x(t,e){if(t===void 0)return u(this.data);if(typeof t=="string"&&typeof e=="string")u(this.data,t,e);else if(typeof t=="object")u(this.data,t);else throw new Error("Either key or value is not a string!");return this}toJSON(){return Object.assign({},this.data,{timezone:this.timezone(),events:this.data.events.map(t=>t.toJSON()),x:this.x()})}length(){return this.data.events.length}toString(){var e,n;let t="";return t=`BEGIN:VCALENDAR\r
61
61
  VERSION:2.0\r
62
62
  `,t+="PRODID:-"+this.data.prodId+`\r
63
63
  `,this.data.url&&(t+="URL:"+this.data.url+`\r
@@ -67,12 +67,12 @@ VERSION:2.0\r
67
67
  `),this.data.name&&(t+="NAME:"+this.data.name+`\r
68
68
  `,t+="X-WR-CALNAME:"+this.data.name+`\r
69
69
  `),this.data.description&&(t+="X-WR-CALDESC:"+this.data.description+`\r
70
- `),(e=this.data.timezone)!=null&&e.generator&&[...new Set([this.timezone(),...this.data.events.map(s=>s.timezone())])].filter(s=>s!==null&&!s.startsWith("/")).forEach(s=>{var r;if(!((r=this.data.timezone)!=null&&r.generator))return;let m=this.data.timezone.generator(s);m&&(t+=m.replace(/\r\n/g,`
70
+ `),(e=this.data.timezone)!=null&&e.generator&&[...new Set([this.timezone(),...this.data.events.map(s=>s.timezone())])].filter(s=>s!==null&&!s.startsWith("/")).forEach(s=>{var r;if(!((r=this.data.timezone)!=null&&r.generator))return;let f=this.data.timezone.generator(s);f&&(t+=f.replace(/\r\n/g,`
71
71
  `).replace(/\n/g,`\r
72
72
  `).trim()+`\r
73
- `)}),(a=this.data.timezone)!=null&&a.name&&(t+="TIMEZONE-ID:"+this.data.timezone.name+`\r
73
+ `)}),(n=this.data.timezone)!=null&&n.name&&(t+="TIMEZONE-ID:"+this.data.timezone.name+`\r
74
74
  `,t+="X-WR-TIMEZONE:"+this.data.timezone.name+`\r
75
- `),this.data.ttl&&(t+="REFRESH-INTERVAL;VALUE=DURATION:"+c(this.data.ttl)+`\r
76
- `,t+="X-PUBLISHED-TTL:"+c(this.data.ttl)+`\r
77
- `),this.data.events.forEach(i=>t+=i.toString()),t+=E(this.data),t+="END:VCALENDAR",N(t)}};function nt(n){return new D(n)}var at=nt;0&&(module.exports={ICalAlarm,ICalAlarmType,ICalAttendee,ICalAttendeeRole,ICalAttendeeStatus,ICalAttendeeType,ICalCalendar,ICalCalendarMethod,ICalCategory,ICalEvent,ICalEventBusyStatus,ICalEventClass,ICalEventRepeatingFreq,ICalEventStatus,ICalEventTransparency,ICalWeekday,escape,foldLines,formatDate,formatDateTZ});
75
+ `),this.data.ttl&&(t+="REFRESH-INTERVAL;VALUE=DURATION:"+C(this.data.ttl)+`\r
76
+ `,t+="X-PUBLISHED-TTL:"+C(this.data.ttl)+`\r
77
+ `),this.data.events.forEach(i=>t+=i.toString()),t+=E(this.data),t+="END:VCALENDAR",N(t)}};function rt(a){return new y(a)}var st=rt;0&&(module.exports={ICalAlarm,ICalAlarmType,ICalAttendee,ICalAttendeeRole,ICalAttendeeStatus,ICalAttendeeType,ICalCalendar,ICalCalendarMethod,ICalCategory,ICalEvent,ICalEventBusyStatus,ICalEventClass,ICalEventRepeatingFreq,ICalEventStatus,ICalEventTransparency,ICalWeekday,escape,foldLines,formatDate,formatDateTZ});
78
78
  //# sourceMappingURL=index.cjs.map