cryptpad/www/lib/ical.min.js

2 lines
80 KiB
JavaScript

"object"==typeof module?ICAL=module.exports:"object"!=typeof ICAL&&(this.ICAL={}),ICAL.foldLength=75,ICAL.newLineChar="\r\n",ICAL.helpers={updateTimezones:function(t){var e,r,n,i,a,s;if(!t||"vcalendar"!==t.name)return t;for(e=t.getAllSubcomponents(),r=[],n={},a=0;a<e.length;a++)"vtimezone"===e[a].name?n[s=e[a].getFirstProperty("tzid").getFirstValue()]=e[a]:r=r.concat(e[a].getAllProperties());for(i={},a=0;a<r.length;a++)(s=r[a].getParameter("tzid"))&&(i[s]=!0);for(a in n)n.hasOwnProperty(a)&&!i[a]&&t.removeSubcomponent(n[a]);for(a in i)i.hasOwnProperty(a)&&!n[a]&&ICAL.TimezoneService.has(a)&&t.addSubcomponent(ICAL.TimezoneService.get(a).component);return t},isStrictlyNaN:function(t){return"number"==typeof t&&isNaN(t)},strictParseInt:function(t){var e=parseInt(t,10);if(ICAL.helpers.isStrictlyNaN(e))throw new Error('Could not extract integer from "'+t+'"');return e},formatClassType:function(t,e){if(void 0!==t)return t instanceof e?t:new e(t)},unescapedIndexOf:function(t,e,r){for(;-1!==(r=t.indexOf(e,r));){if(!(0<r&&"\\"===t[r-1]))return r;r+=1}return-1},binsearchInsert:function(t,e,r){if(!t.length)return 0;for(var n,i,a=0,s=t.length-1;a<=s;)if((i=r(e,t[n=a+Math.floor((s-a)/2)]))<0)s=n-1;else{if(!(0<i))break;a=n+1}return i<0?n:0<i?n+1:n},dumpn:function(){ICAL.debug&&("undefined"!=typeof console&&"log"in console?ICAL.helpers.dumpn=function(t){console.log(t)}:ICAL.helpers.dumpn=function(t){dump(t+"\n")},ICAL.helpers.dumpn(arguments[0]))},clone:function(t,e){if(t&&"object"==typeof t){if(t instanceof Date)return new Date(t.getTime());if("clone"in t)return t.clone();if(Array.isArray(t)){for(var r=[],n=0;n<t.length;n++)r.push(e?ICAL.helpers.clone(t[n],!0):t[n]);return r}var i={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(i[a]=e?ICAL.helpers.clone(t[a],!0):t[a]);return i}return t},foldline:function(t){for(var e="",r=t||"";r.length;)e+=ICAL.newLineChar+" "+r.substr(0,ICAL.foldLength),r=r.substr(ICAL.foldLength);return e.substr(ICAL.newLineChar.length+1)},pad2:function(t){switch("string"!=typeof t&&("number"==typeof t&&(t=parseInt(t)),t=String(t)),t.length){case 0:return"00";case 1:return"0"+t;default:return t}},trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)},inherits:function(t,e,r){function n(){}n.prototype=t.prototype,e.prototype=new n,r&&ICAL.helpers.extend(r,e.prototype)},extend:function(t,e){for(var r in t){var n=Object.getOwnPropertyDescriptor(t,r);n&&!Object.getOwnPropertyDescriptor(e,r)&&Object.defineProperty(e,r,n)}return e}},ICAL.design=function(){"use strict";var t=/\\\\|\\,|\\[Nn]/g,e=/\\|,|\n/g;function r(r,n){return{matches:/.*/,fromICAL:function(t,e){return function(t,e,r){if(-1===t.indexOf("\\"))return t;r&&(e=new RegExp(e.source+"|\\\\"+r));return t.replace(e,f)}(t,r,e)},toICAL:function(t,e){var r=n;return e&&(r=new RegExp(r.source+"|"+e)),t.replace(r,function(t){switch(t){case"\\":return"\\\\";case";":return"\\;";case",":return"\\,";case"\n":return"\\n";default:return t}})}}}var n={defaultType:"text"},i={defaultType:"text",multiValue:","},a={defaultType:"text",structuredValue:";"},s={defaultType:"integer"},o={defaultType:"date-time",allowedTypes:["date-time","date"]},u={defaultType:"date-time"},h={defaultType:"uri"},c={defaultType:"utc-offset"},l={defaultType:"recur"},d={defaultType:"date-and-or-time",allowedTypes:["date-time","date","text"]};function f(t){switch(t){case"\\\\":return"\\";case"\\;":return";";case"\\,":return",";case"\\n":case"\\N":return"\n";default:return t}}var m={categories:i,url:h,version:n,uid:n},p={boolean:{values:["TRUE","FALSE"],fromICAL:function(t){switch(t){case"TRUE":return!0;case"FALSE":default:return!1}},toICAL:function(t){return t?"TRUE":"FALSE"}},float:{matches:/^[+-]?\d+\.\d+$/,fromICAL:function(t){var e=parseFloat(t);return ICAL.helpers.isStrictlyNaN(e)?0:e},toICAL:function(t){return String(t)}},integer:{fromICAL:function(t){var e=parseInt(t);return ICAL.helpers.isStrictlyNaN(e)?0:e},toICAL:function(t){return String(t)}},"utc-offset":{toICAL:function(t){return t.length<7?t.substr(0,3)+t.substr(4,2):t.substr(0,3)+t.substr(4,2)+t.substr(7,2)},fromICAL:functio
//# sourceMappingURL=ical.min.js.map