UNPKG

vcard4

Version:

An RFC 6350 compliant JavaScript library for generating and parsing version 4.0 vCards. Can also generate RFC 6351 compliant XML vCards and RFC 7095 compliant jCards. TypeScript type declarations are provided.

1 lines 165 kB
function e(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,a=Array(r);t<r;t++)a[t]=e[t];return a}function r(e,r,t){if("function"==typeof e?e===r:e.has(r))return arguments.length<3?r:t;throw new TypeError("Private element is not present on this object")}function t(e,r,t){return r=d(r),function(e,r){if(r&&("object"==typeof r||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,y()?Reflect.construct(r,t||[],d(e).constructor):r.apply(e,t))}function a(e,r){if(r.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function n(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function i(e,t){return e.get(r(e,t))}function o(e,r,t){a(e,r),r.set(e,t)}function u(e,t,a){return e.set(r(e,t),a),a}function s(e,r){a(e,r),r.add(e)}function c(e,r){for(var t=0;t<r.length;t++){var a=r[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,b(a.key),a)}}function p(e,r,t){return r&&c(e.prototype,r),t&&c(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=g(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var a=0,n=function(){};return{s:n,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,u=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){u=!0,i=e},f:function(){try{o||null==t.return||t.return()}finally{if(u)throw i}}}}function l(e,r,t){return(r=b(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&P(e,r)}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(y=function(){return!!e})()}function m(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r&&(a=a.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,a)}return t}function v(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?m(Object(t),!0).forEach((function(r){l(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function P(e,r){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,r){return e.__proto__=r,e},P(e,r)}function w(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var a,n,i,o,u=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;s=!1}else for(;!(s=(a=i.call(t)).done)&&(u.push(a.value),u.length!==r);s=!0);}catch(e){c=!0,n=e}finally{try{if(!s&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw n}}return u}}(e,r)||g(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(r){return function(r){if(Array.isArray(r))return e(r)}(r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||g(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,r||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}function g(r,t){if(r){if("string"==typeof r)return e(r,t);var a={}.toString.call(r).slice(8,-1);return"Object"===a&&r.constructor&&(a=r.constructor.name),"Map"===a||"Set"===a?Array.from(r):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?e(r,t):void 0}}function k(e){var r="function"==typeof Map?new Map:void 0;return k=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(r){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return function(e,r,t){if(y())return Reflect.construct.apply(null,arguments);var a=[null];a.push.apply(a,r);var n=new(e.bind.apply(e,a));return t&&P(n,t.prototype),n}(e,arguments,d(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),P(t,e)},k(e)}var S=function(){function e(r){var a;return n(this,e),(a=t(this,e,[r])).name="MissingArgument",a}return h(e,k(Error)),p(e)}();Object.freeze(S);var O=function(){function e(r){var a;return n(this,e),(a=t(this,e,[r])).name="InvalidArgument",a}return h(e,k(Error)),p(e)}();Object.freeze(O);var M=function(){function e(r){var a;return n(this,e),(a=t(this,e,[r])).name="InvalidVcard",a}return h(e,k(Error)),p(e)}();Object.freeze(M);var L=new WeakMap,N=function(){return p((function e(){if(n(this,e),o(this,L,["type","value","valueXML","valueJSON","identifier"]),this.constructor===e)throw new Error("Cannot create instance of base class")}),[{key:"checkAbstractPropertiesAndMethods",value:function(){var e=this;if(!i(L,this).every((function(r){return Object.prototype.hasOwnProperty.call(e,r)||Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(e),r)||Object.prototype.hasOwnProperty.call(e.constructor,r)})))throw new Error("All abstract properties and methods in abstract base class must be defined in child class")}},{key:"repr",value:function(){return this.value}},{key:"reprXML",value:function(){return this.valueXML}},{key:"reprJSON",value:function(){return this.valueJSON}}])}();Object.freeze(N);var I=new WeakMap,E=new WeakSet,X=function(){function e(a){var i;return n(this,e),s(i=t(this,e),E),o(i,I,void 0),r(E,i,J).call(i,a),u(I,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,N),p(e,[{key:"value",get:function(){return r(E,this,V).call(this,i(I,this))}},{key:"valueXML",get:function(){return"<".concat(this.constructor.type.toLowerCase(),">").concat(r(E,this,j).call(this,i(I,this)),"</").concat(this.constructor.type.toLowerCase(),">")}},{key:"valueJSON",get:function(){return[this.constructor.type.toLowerCase(),i(I,this)]}},{key:"_unsafe_raw_value",get:function(){return i(I,this)}}])}();function J(e){if(void 0===e||""===e)throw new S("Value for TextType must be supplied");if("string"!=typeof e)throw new TypeError("Only type string allowed for TextType value")}function V(e){return e.replaceAll("\\","\\\\").replaceAll(",","\\,").replaceAll(":","\\:").replaceAll(";","\\;").replaceAll("\n","\\n")}function j(e){return e.replaceAll("&","&amp;").replaceAll(">","&gt;").replaceAll("<","&lt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}l(X,"type","TEXT"),l(X,"identifier","TextType"),Object.freeze(X);var W=new WeakMap,z=new WeakSet,x=function(){function e(a){var i;return n(this,e),s(i=t(this,e),z),o(i,W,void 0),r(z,i,D).call(i,a),u(W,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,N),p(e,[{key:"value",get:function(){return i(W,this).reduce((function(e,r){return e.push(r.repr()),e}),[]).join(",")}},{key:"valueXML",get:function(){return i(W,this).reduce((function(e,r){return e+r.reprXML()}),"")}},{key:"valueJSON",get:function(){var e=i(W,this).reduce((function(e,r){return e.push(r.reprJSON().pop()),e}),[]);return e.unshift(this.constructor.type.toLowerCase()),e}}])}();function D(e){if(void 0===e)throw new S("Value for TextListType must be supplied");if(!Array.isArray(e))throw new TypeError("Value for TextListType must be passed in an array");var r,t=f(e);try{for(t.s();!(r=t.n()).done;){if("TextType"!==r.value.constructor.identifier)throw new TypeError("Invalid type for value of TextListType. It should be an array of TextTypes")}}catch(e){t.e(e)}finally{t.f()}}l(x,"type","TEXT"),l(x,"identifier","TextListType"),Object.freeze(x);var R=new WeakMap,C=new WeakSet,F=function(){function e(a){var i;return n(this,e),s(i=t(this,e),C),o(i,R,void 0),r(C,i,U).call(i,a),u(R,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,N),p(e,[{key:"value",get:function(){return"".concat(i(R,this))}},{key:"valueXML",get:function(){return"<".concat(this.constructor.type.toLowerCase(),">").concat(i(R,this),"</").concat(this.constructor.type.toLowerCase(),">")}},{key:"valueJSON",get:function(){return[this.constructor.type.toLowerCase(),i(R,this)]}}])}();function U(e){if(void 0===e)throw new S("boolValue must be supplied");if("boolean"!=typeof e)throw new TypeError("Value for BooleanType should be of type boolean")}l(F,"type","BOOLEAN"),l(F,"identifier","BooleanType"),Object.freeze(F);var $=new WeakMap,G=new WeakMap,_=new WeakMap,B=new WeakMap,Z=new WeakMap,K=new WeakMap,H=new WeakMap,Y=new WeakSet,q=function(){function e(a,c){var p;return n(this,e),s(p=t(this,e),Y),o(p,$,void 0),o(p,G,/^(?:(?:\d{4})|(?:(?:\d{4}(?:(?:(?:0[469]|11)(?:[0-2]\d|30))|(?:(?:0[13578]|1[02])(?:[0-2]\d|3[01]))))|(?:\d{2}(?:(?:(?:[02468][048]|[13579][26])(?:02)(?:[0-2]\d))|(?:(:?\d[13579]|[02468][26]|[13579][048])(?:02)(?:[0-2][0-8]|[01]9)))))|(?:-{2}(?:(?:(?:0[469]|11)(?:[0-2]\d|30)?)|(?:(?:0[13578]|1[02])(?:[0-2]\d|3[01])?)|(?:(?:02)(?:[0-2]\d)?)))|(?:-{3}(?:[0-2]\d|3[01]))|(?:\d{4}-(?:(?:0[1-9])|1[0-2])))$/),o(p,_,/^(?:(?:(?:(?:[01]\d)|(?:2[0-3]))(?:(?:[0-5]\d){1,2})?)|(?:-(?:[0-5]\d){1,2})|(?:-{2}[0-5]\d))(?:Z|(?:[+-]((?:[01]\d)|(?:2[0-3]))(?:[0-5]\d)?))?$/),o(p,B,/^(?:(?:(?:\d{4}(?:(?:(?:0[469]|11)(?:[0-2]\d|30))|(?:(?:0[13578]|1[02])(?:[0-2]\d|3[01]))))|(?:\d{2}(?:(?:(?:[02468][048]|[13579][26])(?:02)(?:[0-2]\d))|(?:(:?\d[13579]|[02468][26]|[13579][048])(?:02)(?:[0-2][0-8]|[01]9)))))|(?:-{2}(?:(?:(?:0[469]|11)(?:[0-2]\d|30))|(?:(?:0[13578]|1[02])(?:[0-2]\d|3[01]))|(?:(?:02)(?:[0-2]\d))))|(?:-{3}(?:[0-2]\d|3[01])))(?:T)(?:(?:(?:(?:[01]\d)|(?:2[0-3]))(?:(?:[0-5]\d){1,2})?)(?:Z|(?:[+-]((?:[01]\d)|(?:2[0-3]))(?:[0-5]\d)?))?)$/),o(p,Z,new RegExp("(?:".concat(i(G,p).source,"|").concat(i(_,p).source.replace("^","^T"),"|").concat(i(B,p).source,")"))),o(p,K,/^(?:(?:\d{4}(?:(?:(?:0[469]|11)(?:[0-2]\d|30))|(?:(?:0[13578]|1[02])(?:[0-2]\d|3[01]))))|(?:\d{2}(?:(?:(?:[02468][048]|[13579][26])(?:02)(?:[0-2]\d))|(?:(:?\d[13579]|[02468][26]|[13579][048])(?:02)(?:[0-2][0-8]|[01]9)))))(?:T)(?:(?:(?:(?:[01]\d)|(?:2[0-3]))(?:[0-5]\d){2})(?:Z|(?:[+-]((?:[01]\d)|(?:2[0-3]))(?:[0-5]\d)?))?)$/),o(p,H,/^(?:[+-]((?:[01]\d)|(?:2[0-3]))(?:[0-5]\d)?)$/),r(Y,p,Q).call(p,a,c),u($,p,c),p.checkAbstractPropertiesAndMethods(),Object.freeze(p),p}return h(e,N),p(e,[{key:"value",get:function(){return"".concat(i($,this))}},{key:"valueXML",get:function(){var e=this.type.toLowerCase(),r=i($,this);if("date-and-or-time"===e)switch(!0){case i(G,this).test(r):e="date";break;case i(_,this).test(r):e="time";break;case i(B,this).test(r):e="date-time"}return"<".concat(e,">").concat(r,"</").concat(e,">")}},{key:"valueJSON",get:function(){var e,r=this.type.toLowerCase();function t(e){return/^\d{8}$/.test(e)?((e=T(e)).splice(4,0,"-"),e.splice(7,0,"-"),e.join("")):/^-{2}\d{4}$/.test(e)?((e=T(e)).splice(4,0,"-"),e.join("")):e}function a(e){for(var r=[],t=0;t<e.length;t+=2)/^\d$/.test(e[t])?(r.push(e[t]),r.push(e[t+1]),/^\d$/.test(e[t+2])&&r.push(":")):(r.push(e[t]),t--);return r.join("")}switch(r){case"date":e=t(i($,this));break;case"time":case"utc-offset":e=a(i($,this));break;case"date-time":case"timestamp":e=t((e=i($,this).split("T"))[0])+"T"+a(e[1]);break;case"date-and-or-time":e=i($,this).includes("T")?t((e=i($,this).split("T"))[0])+"T"+a(e[1]):t(i($,this))}return[r,e]}}])}();function Q(e,r){if(void 0===r||void 0===e)throw new S("Value and type for DateTimeType must be supplied");if(!/^(?:(?:date((?:andor)?(?:time))?)|(?:time(?:stamp)?)|(?:utcoffset))$/.test(e))throw new O("Accepted values of type for DateTimeType are date, time, datetime, dateandortime, timestamp or utcoffset");switch(e){case"date":if(!i(G,this).test(r))throw new O("Invalid value for type date of DateTimeType");this.type="DATE";break;case"time":if(!i(_,this).test(r))throw new O("Invalid value for type time of DateTimeType");this.type="TIME";break;case"datetime":if(!i(B,this).test(r))throw new O("Invalid value for type datetime of DateTimeType");this.type="DATE-TIME";break;case"dateandortime":if(!i(Z,this).test(r))throw new O("Invalid value for type dateandortime of DateTimeType");this.type="DATE-AND-OR-TIME";break;case"timestamp":if(!i(K,this).test(r))throw new O("Invalid value for type timestamp of DateTimeType");this.type="TIMESTAMP";break;case"utcoffset":if(!i(H,this).test(r))throw new O("Invalid value for type utcoffset of DateTimeType");this.type="UTC-OFFSET";break;default:throw new O("Accepted values for type property of type object for DateTimeType are date, time, datetime, dateandortime, timestamp or utcoffset")}}l(q,"identifier","DateTimeType"),Object.freeze(q);var ee=new WeakMap,re=new WeakSet,te=function(){function e(a){var i;return n(this,e),s(i=t(this,e),re),o(i,ee,void 0),r(re,i,ae).call(i,a),u(ee,i,a),i.type=a[0].type,i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,N),p(e,[{key:"value",get:function(){return i(ee,this).reduce((function(e,r){return e.push(r.repr()),e}),[]).join(",")}},{key:"valueXML",get:function(){return i(ee,this).reduce((function(e,r){return e+r.reprXML()}),"")}},{key:"valueJSON",get:function(){var e=i(ee,this).reduce((function(e,r){return e.push(r.reprJSON().pop()),e}),[]);return e.unshift(this.type.toLowerCase()),e}}])}();function ae(e){if(void 0===e)throw new S("Value for DateTimeListType must be supplied");if(!Array.isArray(e))throw new TypeError("Value for DateTimeListType should be passed in an array");var r,t=e[0].type,a=f(e);try{for(a.s();!(r=a.n()).done;){var n=r.value;if(n.type!==t)throw new TypeError("Value for DateTimeListType should be an array of DateTimeTypes of the same type");if("UTC-OFFSET"===n.type)throw new TypeError("Invalid type for value of DateTimeListType");if("DateTimeType"!==n.constructor.identifier)throw new TypeError("Value for DateTimeListType should be an array of DateTimeTypes")}}catch(e){a.e(e)}finally{a.f()}}l(te,"identifier","DateTimeListType"),Object.freeze(te);var ne=new WeakMap,ie=new WeakSet,oe=function(){function e(a){var i;return n(this,e),s(i=t(this,e),ie),o(i,ne,void 0),r(ie,i,ue).call(i,a),u(ne,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,N),p(e,[{key:"value",get:function(){return"".concat(i(ne,this))}},{key:"valueXML",get:function(){return"<".concat(this.constructor.type.toLowerCase(),">").concat(i(ne,this),"</").concat(this.constructor.type.toLowerCase(),">")}},{key:"valueJSON",get:function(){return[this.constructor.type.toLowerCase(),i(ne,this)]}}])}();function ue(e){if(void 0===e)throw new S("Value for IntegerType must be supplied");if("number"!=typeof e&&"bigint"!=typeof e)throw new TypeError("Value for IntegerType must be of type number or bigint");if(/\./.test(e.toString()))throw new O("Invalid value for IntegerType");if(!("number"!=typeof e||-Number.MAX_SAFE_INTEGER<e&&e<Number.MAX_SAFE_INTEGER))throw new O("The maximum value is ".concat(Number.MAX_SAFE_INTEGER,", and the minimum value is ").concat(Number.MIN_SAFE_INTEGER," for number IntegerType"));if("bigint"==typeof e&&!(-9223372036854775809n<e&&e<9223372036854775808n))throw new O("The maximum value is 9223372036854775807n, and the minimum value is -9223372036854775808n for bigint IntegerType")}l(oe,"type","INTEGER"),l(oe,"identifier","IntegerType"),Object.freeze(oe);var se=new WeakMap,ce=new WeakSet,pe=function(){function e(a){var i;return n(this,e),s(i=t(this,e),ce),o(i,se,void 0),r(ce,i,fe).call(i,a),u(se,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,N),p(e,[{key:"value",get:function(){return i(se,this).reduce((function(e,r){return e.push(r.repr()),e}),[]).join(",")}},{key:"valueXML",get:function(){return i(se,this).reduce((function(e,r){return e+r.reprXML()}),"")}},{key:"valueJSON",get:function(){var e=i(se,this).reduce((function(e,r){return e.push(r.reprJSON().pop()),e}),[]);return e.unshift(this.constructor.type.toLowerCase()),e}}])}();function fe(e){if(void 0===e)throw new S("Value for IntegerListType must be supplied");if(!Array.isArray(e))throw new TypeError("Value for IntegerListType must be passed in an array");var r,t=f(e);try{for(t.s();!(r=t.n()).done;){if("IntegerType"!==r.value.constructor.identifier)throw new TypeError("Invalid type for value of IntegerListType. It should be an array of IntegerTypes")}}catch(e){t.e(e)}finally{t.f()}}l(pe,"type","INTEGER"),l(pe,"identifier","IntegerListType"),Object.freeze(pe);var le=new WeakMap,de=new WeakSet,he=function(){function e(a){var i;return n(this,e),s(i=t(this,e),de),o(i,le,void 0),r(de,i,ye).call(i,a),u(le,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,N),p(e,[{key:"value",get:function(){return"".concat(i(le,this))}},{key:"valueXML",get:function(){return"<".concat(this.constructor.type.toLowerCase(),">").concat(i(le,this),"</").concat(this.constructor.type.toLowerCase(),">")}},{key:"valueJSON",get:function(){return[this.constructor.type.toLowerCase(),i(le,this)]}}])}();function ye(e){if(void 0===e)throw new S("Value for FloatType must be supplied");if("number"!=typeof e&&!/\./.test(e)||!/^[-+]?\d+\.\d+$/.test(e))throw new TypeError("Invalid value for FloatType")}l(he,"type","FLOAT"),l(he,"identifier","FloatType"),Object.freeze(he);var me=new WeakMap,ve=new WeakSet,Pe=function(){function e(a){var i;return n(this,e),s(i=t(this,e),ve),o(i,me,void 0),r(ve,i,we).call(i,a),u(me,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,N),p(e,[{key:"value",get:function(){return i(me,this).reduce((function(e,r){return e.push(r.repr()),e}),[]).join(",")}},{key:"valueXML",get:function(){return i(me,this).reduce((function(e,r){return e+r.reprXML()}),"")}},{key:"valueJSON",get:function(){var e=i(me,this).reduce((function(e,r){return e.push(r.reprJSON().pop()),e}),[]);return e.unshift(this.constructor.type.toLowerCase()),e}}])}();function we(e){if(void 0===e)throw new S("Value for FloatListType must be supplied");if(!Array.isArray(e))throw new TypeError("Value of FloatListType should be passed in an array");var r,t=f(e);try{for(t.s();!(r=t.n()).done;){if("FloatType"!==r.value.constructor.identifier)throw new TypeError("Value of FloatListType should be an array of FloatTypes")}}catch(e){t.e(e)}finally{t.f()}}l(Pe,"type","FLOAT"),l(Pe,"identifier","FloatListType"),Object.freeze(Pe);var Te=new WeakMap,be=new WeakMap,Ae=new WeakSet,ge=function(){function e(a){var i;return n(this,e),s(i=t(this,e),Ae),o(i,Te,void 0),o(i,be,/^(?:[a-zA-Z]{2,3}(-[a-zA-Z]{3}){0,3})(-[0-9A-Za-z]+){0,3}(-x(-[0-9A-Za-z]{1,8})+)?(-[0-9A-WY-Za-wy-z]+)?(-[0-9A-Za-z]+)?$/),r(Ae,i,ke).call(i,a),u(Te,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,N),p(e,[{key:"value",get:function(){return i(Te,this)}},{key:"valueXML",get:function(){return"<".concat(this.constructor.type.toLowerCase(),">").concat(i(Te,this),"</").concat(this.constructor.type.toLowerCase(),">")}},{key:"valueJSON",get:function(){return[this.constructor.type.toLowerCase(),i(Te,this)]}}])}();function ke(e){if(void 0===e)throw new S("Value for LanguageTagType must be supplied");if("string"!=typeof e)throw new TypeError("Value for LanguageTagType should be of type string");if(!i(be,this).test(e))throw new O("Invalid language tag")}l(ge,"type","LANGUAGE-TAG"),l(ge,"identifier","LanguageTagType"),Object.freeze(ge);var Se=new WeakMap,Oe=new WeakMap,Me=new WeakSet,Le=function(){function e(a){var i;return n(this,e),s(i=t(this,e),Me),o(i,Se,void 0),o(i,Oe,new RegExp("([A-Za-z][A-Za-z0-9+\\-.]*):(?:(//)(?:((?:[A-Za-z0-9\\-._~!$&'()*+,;=:]|%[0-9A-Fa-f]{2})*)@)?((?:\\[(?:(?:(?:(?:[0-9A-Fa-f]{1,4}:){6}|::(?:[0-9A-Fa-f]{1,4}:){5}|(?:[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,1}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){3}|(?:(?:[0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){2}|(?:(?:[0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:|(?:(?:[0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})?::)(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))|(?:(?:[0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})?::)|[Vv][0-9A-Fa-f]+\\.[A-Za-z0-9\\-._~!$&'()*+,;=:]+)\\]|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|(?:[A-Za-z0-9\\-._~!$&'()*+,;=]|%[0-9A-Fa-f]{2})*))(?::([0-9]*))?((?:/(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*)|/((?:(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})+(?:/(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*)?)|((?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})+(?:/(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*)|)(?:\\?((?:[A-Za-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})*))?(?:\\#((?:[A-Za-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})*))?")),r(Me,i,Ne).call(i,a),u(Se,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,N),p(e,[{key:"value",get:function(){return i(Se,this)}},{key:"valueXML",get:function(){return"<".concat(this.constructor.type.toLowerCase(),">").concat(i(Se,this),"</").concat(this.constructor.type.toLowerCase(),">")}},{key:"valueJSON",get:function(){return[this.constructor.type.toLowerCase(),i(Se,this)]}}])}();function Ne(e){if(void 0===e)throw new S("Value for URIType must be supplied");if("string"!=typeof e)throw new TypeError("Value for URIType should be of type string");if(!i(Oe,this).test(e))throw new O("Invalid URI")}l(Le,"type","URI"),l(Le,"identifier","URIType"),Object.freeze(Le);var Ie=new WeakMap,Ee=new WeakMap,Xe=new WeakSet,Je=function(){function e(a){var i;return n(this,e),s(i=t(this,e),Xe),o(i,Ie,/^[MFONU]$/),o(i,Ee,void 0),r(Xe,i,Ve).call(i,a),u(Ee,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,N),p(e,[{key:"value",get:function(){return i(Ee,this)}},{key:"valueXML",get:function(){return"<sex>".concat(i(Ee,this),"</sex>")}},{key:"valueJSON",get:function(){return[this.constructor.type.toLowerCase(),i(Ee,this)]}}])}();function Ve(e){if(void 0===e)throw new S("Value for SexType must be supplied");if(!i(Ie,this).test(e))throw new O("Invalid sex")}l(Je,"type","TEXT"),l(Je,"identifier","SexType"),Object.freeze(Je);var je=new WeakSet,We=function(){function e(a,i){var o;return n(this,e),s(o=t(this,e),je),r(je,o,ze).call(o,a,i),o.targetProp=a.toUpperCase(),o.checkAbstractPropertiesAndMethods(),Object.freeze(o),o}return h(e,N),p(e)}();function ze(e,r){var t,a;if(void 0===r||void 0===e)throw new S("Value and target property for SpecialValueType must be supplied");var n,i;switch(!0){case/^KindProperty$/i.test(e):if("string"!=typeof r||!/^(?:individual|group|org|location|application|x-[a-z0-9-]+)$/i.test(r))throw new O("Invalid value for SpecialValueType for KindProperty");this.value=r,this.valueXML="<text>".concat(r,"</text>"),this.valueJSON=[this.constructor.type.toLowerCase(),r];break;case/^NProperty$/i.test(e):if(!Array.isArray(r)||5!==r.length)throw new O("Invalid value for SpecialValueType for NProperty. It should be an array with a length of 5");for(var o=0;o<r.length;o++)if(r[o]&&"TextType"!==r[o].constructor.identifier&&"TextListType"!==r[o].constructor.identifier)throw new TypeError("Invalid value for SpecialValueType for NProperty. The items in the array, if present, should be of type TextType or TextListType");n=T(r);for(var u=0;u<n.length;u++)n[u]&&(n[u]=n[u].repr());this.value=n.join(";"),this.valueXML="",this.valueJSON=[];for(var s=0;s<r.length;s++)switch(s){case 0:r[s]?(this.valueXML+=r[s].reprXML().replaceAll("text>","surname>"),2===(i=r[s].reprJSON()).length?this.valueJSON[s]=i.pop():(i.shift(),this.valueJSON[s]=i)):(this.valueXML+="<surname/>",this.valueJSON[s]="");break;case 1:r[s]?(this.valueXML+=r[s].reprXML().replaceAll("text>","given>"),2===(i=r[s].reprJSON()).length?this.valueJSON[s]=i.pop():(i.shift(),this.valueJSON[s]=i)):(this.valueXML+="<given/>",this.valueJSON[s]="");break;case 2:r[s]?(this.valueXML+=r[s].reprXML().replaceAll("text>","additional>"),2===(i=r[s].reprJSON()).length?this.valueJSON[s]=i.pop():(i.shift(),this.valueJSON[s]=i)):(this.valueXML+="<additional/>",this.valueJSON[s]="");break;case 3:r[s]?(this.valueXML+=r[s].reprXML().replaceAll("text>","prefix>"),2===(i=r[s].reprJSON()).length?this.valueJSON[s]=i.pop():(i.shift(),this.valueJSON[s]=i)):(this.valueXML+="<prefix/>",this.valueJSON[s]="");break;case 4:r[s]?(this.valueXML+=r[s].reprXML().replaceAll("text>","suffix>"),2===(i=r[s].reprJSON()).length?this.valueJSON[s]=i.pop():(i.shift(),this.valueJSON[s]=i)):(this.valueXML+="<suffix/>",this.valueJSON[s]="")}this.valueJSON=[this.constructor.type.toLowerCase(),this.valueJSON];break;case/^GenderProperty$/i.test(e):if(!Array.isArray(r)||2!==r.length)throw new O("Invalid value for SpecialValueType for GenderProperty. It should be an array with a length of 2");if(r[0]&&"SexType"!==r[0].constructor.identifier)throw new TypeError("Invalid value for SpecialValueType for GenderProperty. The first item in the array, if present, should be of type SexType");if(!r[0]&&!r[1]||r[1]&&"TextType"!==r[1].constructor.identifier)throw new TypeError("Invalid value for SpecialValueType for GenderProperty. The second item in the array, if present, should be of type TextType");this.value=r.reduce((function(e,r){return e?"".concat(e,";").concat(r.repr()):r.repr()}),""),this.valueXML=r.reduce((function(e,r){return e+r.reprXML()}),""),this.valueJSON=r.reduce((function(e,r){return e.push(r.reprJSON().pop()),e}),[]),1===this.valueJSON.length?this.valueJSON.unshift(this.constructor.type.toLowerCase()):this.valueJSON=[this.constructor.type.toLowerCase(),this.valueJSON];break;case/^AdrProperty$/i.test(e):if(!Array.isArray(r)||7!==r.length)throw new O("Invalid value for SpecialValueType for AdrProperty. It should be an array with a length of 7");for(var c=0;c<r.length;c++)if(r[c]&&"TextType"!==r[c].constructor.identifier)throw new TypeError("Invalid value for SpecialValueType for AdrProperty. The items in the array, if present, should be of type TextType");n=T(r);for(var p=0;p<n.length;p++)n[p]&&(n[p]=n[p].repr());this.value=n.join(";"),this.valueXML="",this.valueJSON=[];for(var f=0;f<r.length;f++)switch(f){case 0:r[f]?(this.valueXML+=r[f].reprXML().replaceAll("text>","pobox>"),2===(i=r[f].reprJSON()).length?this.valueJSON[f]=i.pop():(i.shift(),this.valueJSON[f]=i)):(this.valueXML+="<pobox/>",this.valueJSON[f]="");break;case 1:r[f]?(this.valueXML+=r[f].reprXML().replaceAll("text>","ext>"),2===(i=r[f].reprJSON()).length?this.valueJSON[f]=i.pop():(i.shift(),this.valueJSON[f]=i)):(this.valueXML+="<ext/>",this.valueJSON[f]="");break;case 2:r[f]?(this.valueXML+=r[f].reprXML().replaceAll("text>","street>"),2===(i=r[f].reprJSON()).length?this.valueJSON[f]=i.pop():(i.shift(),this.valueJSON[f]=i)):(this.valueXML+="<street/>",this.valueJSON[f]="");break;case 3:r[f]?(this.valueXML+=r[f].reprXML().replaceAll("text>","locality>"),2===(i=r[f].reprJSON()).length?this.valueJSON[f]=i.pop():(i.shift(),this.valueJSON[f]=i)):(this.valueXML+="<locality/>",this.valueJSON[f]="");break;case 4:r[f]?(this.valueXML+=r[f].reprXML().replaceAll("text>","region>"),2===(i=r[f].reprJSON()).length?this.valueJSON[f]=i.pop():(i.shift(),this.valueJSON[f]=i)):(this.valueXML+="<region/>",this.valueJSON[f]="");break;case 5:r[f]?(this.valueXML+=r[f].reprXML().replaceAll("text>","code>"),2===(i=r[f].reprJSON()).length?this.valueJSON[f]=i.pop():(i.shift(),this.valueJSON[f]=i)):(this.valueXML+="<code/>",this.valueJSON[f]="");break;case 6:r[f]?(this.valueXML+=r[f].reprXML().replaceAll("text>","country>"),2===(i=r[f].reprJSON()).length?this.valueJSON[f]=i.pop():(i.shift(),this.valueJSON[f]=i)):(this.valueXML+="<country/>",this.valueJSON[f]="")}this.valueJSON=[this.constructor.type.toLowerCase(),this.valueJSON];break;case/^OrgProperty$/i.test(e):if(!(Array.isArray(r)&&r.length>=1))throw new O("Invalid value for SpecialValueType for OrgProperty. It should be an array with at least one item");for(var l=0;l<r.length;l++){var d;if("TextType"!==(null===(d=r[l])||void 0===d||null===(d=d.constructor)||void 0===d?void 0:d.identifier))throw new TypeError("Invalid value for SpecialValueType for OrgProperty. The items in the array should be of type TextType")}this.value=r.reduce((function(e,r){return e?"".concat(e,";").concat(r.repr()):r.repr()}),""),this.valueXML=r.reduce((function(e,r){return e+r.reprXML()}),""),this.valueJSON=r.reduce((function(e,r){return e.push(r.reprJSON().pop()),e}),[]),1===this.valueJSON.length?this.valueJSON.unshift(this.constructor.type.toLowerCase()):this.valueJSON=[this.constructor.type.toLowerCase(),this.valueJSON];break;case/^ClientpidmapProperty$/i.test(e):if(!Array.isArray(r)||2!==r.length)throw new O("Invalid value for SpecialValueType for ClientpidmapProperty. It should be an array with a length of 2");if("IntegerType"!==(null===(t=r[0])||void 0===t||null===(t=t.constructor)||void 0===t?void 0:t.identifier))throw new TypeError("Invalid value for SpecialValueType for ClientpidmapProperty. The first item in the array should be of type IntegerType");if(0>=Number(r[0].repr()))throw new O("Invalid value for SpecialValueType for ClientpidmapProperty. The first item in the array should be a positive integer of type IntegerType. Zero is not allowed");if("URIType"!==(null===(a=r[1])||void 0===a||null===(a=a.constructor)||void 0===a?void 0:a.identifier))throw new TypeError("Invalid value for SpecialValueType for ClientpidmapProperty. The second item in the array should be of type URIType");this.value=r.reduce((function(e,r){return e?"".concat(e,";").concat(r.repr()):r.repr()}),""),this.valueXML=r.reduce((function(e,r){return e+r.reprXML()}),""),this.valueJSON=["unknown",r.reduce((function(e,r){return e.push(r.reprJSON().pop()),e}),[])];break;default:throw new O("Invalid target property for SpecialValueType")}}l(We,"identifier","SpecialValueType"),l(We,"type","TEXT"),Object.freeze(We);var xe=new WeakMap,De=new WeakSet,Re=function(){function e(a){var i;return n(this,e),s(i=t(this,e),De),o(i,xe,void 0),r(De,i,Ce).call(i,a),u(xe,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,N),p(e,[{key:"value",get:function(){var e=r(De,this,Fe).call(this,i(xe,this));return/[:;]/.test(e)?'"'.concat(e,'"'):e}},{key:"valueXML",get:function(){return"<".concat(this.constructor.type.toLowerCase(),">").concat(r(De,this,Ue).call(this,i(xe,this)),"</").concat(this.constructor.type.toLowerCase(),">")}},{key:"valueJSON",get:function(){return[this.constructor.type.toLowerCase(),i(xe,this)]}},{key:"_unsafe_raw_value",get:function(){return i(xe,this)}}])}();function Ce(e){if(void 0===e||""===e)throw new S("Value for ParameterValueType must be supplied");if("string"!=typeof e)throw new TypeError("Only type string allowed for ParameterValueType value");if(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/.test(e))throw new O("Value includes forbidden characters")}function Fe(e){return e.replaceAll("^","^^").replaceAll("\n","^n").replaceAll('"',"^’")}function Ue(e){return e.replaceAll("&","&amp;").replaceAll(">","&gt;").replaceAll("<","&lt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}l(Re,"type","TEXT"),l(Re,"identifier","ParameterValueType"),Object.freeze(Re);var $e=new WeakMap,Ge=function(){return p((function e(){if(n(this,e),o(this,$e,["param","value","valueXML","valueJSON","identifier"]),this.constructor===e)throw new Error("Cannot create instance of base class")}),[{key:"checkAbstractPropertiesAndMethods",value:function(){var e=this;if(!i($e,this).every((function(r){return Object.prototype.hasOwnProperty.call(e,r)||Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(e),r)||Object.prototype.hasOwnProperty.call(e.constructor,r)})))throw new Error("All abstract properties and methods in abstract base class must be defined in child class")}},{key:"repr",value:function(){return"".concat(this.constructor.param||this.param,"=").concat(this.value)}},{key:"reprXML",value:function(){var e,r,t=(null===(e=this.constructor.param)||void 0===e?void 0:e.toLowerCase())||(null===(r=this.param)||void 0===r?void 0:r.toLowerCase());return/^(?:altid|base|calscale|cc|geo|index|label|language|level|mediatype|pid|pref|sort-as|type|tz|value|x-[A-Za-z0-9]+)$/.test(t)?"value"===t?"":"<".concat(t,">").concat(this.valueXML,"</").concat(t,">"):"<unknown>".concat(this.valueXML.replace(/<[a-z\-]+?>/g,"<text>").replace(/<\/[a-z\-]+?>/g,"</text>"),"</unknown>")}},{key:"reprJSON",value:function(){var e,r,t=(null===(e=this.constructor.param)||void 0===e?void 0:e.toLowerCase())||(null===(r=this.param)||void 0===r?void 0:r.toLowerCase());if("value"===t)return{};var a=this.valueJSON;return a.shift(),1===(a=a.map((function(e){return e.toString()}))).length&&(a=a.pop()),l({},t,a)}}])}();Object.freeze(Ge);var _e=new WeakMap,Be=new WeakSet,Ze=function(){function e(a){var i;return n(this,e),s(i=t(this,e),Be),o(i,_e,void 0),r(Be,i,Ke).call(i,a),u(_e,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,Ge),p(e,[{key:"value",get:function(){return i(_e,this).repr()}},{key:"valueXML",get:function(){return i(_e,this).reprXML()}},{key:"valueJSON",get:function(){return i(_e,this).reprJSON()}}])}();function Ke(e){if(void 0===e)throw new S("Language Tag for LanguageParameter must be supplied");if("LanguageTagType"!==e.constructor.identifier)throw new TypeError("The value of the LANGUAGE property parameter should be of type LanguageTagType")}l(Ze,"param","LANGUAGE"),l(Ze,"identifier","LanguageParameter"),Object.freeze(Ze);var He=new WeakMap,Ye=new WeakSet,qe=function(){function e(a){var i;return n(this,e),s(i=t(this,e),Ye),o(i,He,void 0),r(Ye,i,Qe).call(i,a),u(He,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,Ge),p(e,[{key:"value",get:function(){return(i(He,this).type||i(He,this).constructor.type).toLowerCase()}},{key:"valueXML",get:function(){return""}},{key:"valueJSON",get:function(){return[]}}])}();function Qe(e){if(void 0===e)throw new S("Value for ValueParameter must be supplied");if(!Object.prototype.hasOwnProperty.call(e,"type")&&!Object.prototype.hasOwnProperty.call(e.constructor,"type"))throw new O("Value for ValueParameter not recognized")}l(qe,"param","VALUE"),l(qe,"identifier","ValueParameter"),Object.freeze(qe);var er=new WeakMap,rr=new WeakSet,tr=function(){function e(a){var i;return n(this,e),s(i=t(this,e),rr),o(i,er,void 0),r(rr,i,ar).call(i,a),u(er,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,Ge),p(e,[{key:"value",get:function(){return i(er,this).repr()}},{key:"valueXML",get:function(){return i(er,this).reprXML()}},{key:"valueJSON",get:function(){return i(er,this).reprJSON()}}])}();function ar(e){if(void 0===e)throw new S("Value for PrefParameter must be supplied");if("IntegerType"!==e.constructor.identifier)throw new TypeError("Value for PrefParameter should be of type IntegerType");if(Number(e.repr())<1||Number(e.repr())>100)throw new O("Value for PrefParameter must be between 1 and 100")}l(tr,"param","PREF"),l(tr,"identifier","PrefParameter"),Object.freeze(tr);var nr=new WeakMap,ir=new WeakSet,or=function(){function e(a){var i;return n(this,e),s(i=t(this,e),ir),o(i,nr,void 0),r(ir,i,ur).call(i,a),u(nr,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,Ge),p(e,[{key:"value",get:function(){return i(nr,this).repr()}},{key:"valueXML",get:function(){return i(nr,this).reprXML()}},{key:"valueJSON",get:function(){return i(nr,this).reprJSON()}}])}();function ur(e){if(void 0===e)throw new S("Value for AltidParameter must be supplied");if("ParameterValueType"!==e.constructor.identifier)throw new O("Value for AltidParameter must be of type ParameterValueType")}l(or,"param","ALTID"),l(or,"identifier","AltidParameter"),Object.freeze(or);var sr=new WeakMap,cr=new WeakMap,pr=new WeakSet,fr=function(){function e(a){var i;return n(this,e),s(i=t(this,e),pr),o(i,sr,void 0),o(i,cr,/^\d+(?:\.\d+)?$/),r(pr,i,lr).call(i,a),u(sr,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,Ge),p(e,[{key:"value",get:function(){return Array.isArray(i(sr,this))?i(sr,this).map((function(e){return Array.isArray(e)?e.map((function(e){return e.repr()})).join("."):e.repr()})).join(","):i(sr,this).repr()}},{key:"valueXML",get:function(){return(Array.isArray(i(sr,this))?i(sr,this).map((function(e){return Array.isArray(e)?"<integer>"+e.map((function(e){return e.repr()})).join(".")+"</integer>":e.reprXML()})).join(""):i(sr,this).reprXML()).replaceAll("integer","text")}},{key:"valueJSON",get:function(){return Array.isArray(i(sr,this))?["integer"].concat(T(i(sr,this).map((function(e){return Array.isArray(e)?Number(e.map((function(e){return e.repr()})).join(".")):e.reprJSON().pop()})))):i(sr,this).reprJSON()}}])}();function lr(e){if(void 0===e)throw new S("Value for PIDParameter must be supplied");if(!Array.isArray(e)&&"IntegerType"!==e.constructor.identifier)throw new O("Invalid value for PIDParameter");if(Array.isArray(e)&&!e.every((function(e){return Array.isArray(e)?2===e.length&&e.every((function(e){return"IntegerType"===e.constructor.identifier})):"IntegerType"===e.constructor.identifier})))throw new O("Invalid value for PIDParameter")}l(fr,"param","PID"),l(fr,"identifier","PIDParameter"),Object.freeze(fr);var dr=new WeakMap,hr=new WeakMap,yr=new WeakMap,mr=new WeakMap,vr=new WeakSet,Pr=function(){function e(a,i){var c;return n(this,e),s(c=t(this,e),vr),o(c,dr,void 0),o(c,hr,/^(?:work|home|x-[a-z0-9-]+)$/i),o(c,yr,/^(?:text|voice|fax|cell|video|pager|textphone|main)$/i),o(c,mr,/(?:contact|acquaintance|friend|met|co-worker|colleague|co-resident|neighbor|child|parent|sibling|spouse|kin|muse|crush|date|sweetheart|me|agent|emergency)/i),r(vr,c,wr).call(c,a,i),u(dr,c,i),c.targetProp=a.toUpperCase(),c.checkAbstractPropertiesAndMethods(),Object.freeze(c),c}return h(e,Ge),p(e,[{key:"value",get:function(){return Array.isArray(i(dr,this))?'"'.concat(i(dr,this).map((function(e){return e.repr()})).join(",").replaceAll('"',""),'"'):i(dr,this).repr()}},{key:"valueXML",get:function(){return Array.isArray(i(dr,this))?i(dr,this).map((function(e){return e.reprXML()})).join(""):i(dr,this).reprXML()}},{key:"valueJSON",get:function(){return Array.isArray(i(dr,this))?["text"].concat(T(i(dr,this).map((function(e){return e._unsafe_raw_value})))):i(dr,this).reprJSON()}}])}();function wr(e,r){var t=this;if(void 0===r||void 0===e)throw new S("Value and target property for TypeParameter must be supplied");if((Array.isArray(r)||"ParameterValueType"!==r.constructor.identifier)&&(!Array.isArray(r)||!r.every((function(e){return"ParameterValueType"===e.constructor.identifier}))))throw new TypeError("Value for TypeParameter must be of type ParameterValueType or an array of ParameterValueTypes");var a=new RegExp("(?:".concat(i(yr,this).source,"|").concat(i(hr,this).source,")"),"i"),n=new RegExp("(?:".concat(i(mr,this).source,"|").concat(i(hr,this).source,")"),"i");switch(!0){case/^TelProperty$/i.test(e):if((Array.isArray(r)||!a.test(r.repr()))&&(!Array.isArray(r)||!r.every((function(e){return a.test(e.repr())}))))throw new O("Invalid value for TypeParameter for TelProperty");break;case/^RelatedProperty$/i.test(e):if((Array.isArray(r)||!n.test(r.repr()))&&(!Array.isArray(r)||!r.every((function(e){return n.test(e.repr())}))))throw new O("Invalid value for TypeParameter for RelatedProperty");break;default:if((Array.isArray(r)||!i(hr,this).test(r.repr()))&&(!Array.isArray(r)||!r.every((function(e){return i(hr,t).test(e.repr())}))))throw new O("Invalid value for TypeParameter")}}l(Pr,"param","TYPE"),l(Pr,"identifier","TypeParameter"),Object.freeze(Pr);var Tr=new WeakMap,br=new WeakMap,Ar=new WeakMap,gr=new WeakSet,kr=function(){function e(a){var i;return n(this,e),s(i=t(this,e),gr),o(i,Tr,/^(?:[A-Za-z0-9!#\$&\.\+\-\^_]){1,127}\/(?:[A-Za-z0-9!#\$&\.\+\-\^_]){1,127}$/),o(i,br,/^[A-Za-z0-9!#\$&\.\+\-\^_]+=[A-Za-z0-9!#\$&\.\+\-\^_]+$/),o(i,Ar,void 0),r(gr,i,Sr).call(i,a),u(Ar,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,Ge),p(e,[{key:"value",get:function(){return Array.isArray(i(Ar,this))?'"'.concat(i(Ar,this).map((function(e){return e.repr()})).join(";"),'"'):i(Ar,this).repr()}},{key:"valueXML",get:function(){return Array.isArray(i(Ar,this))?"<text>"+i(Ar,this).map((function(e){return e.reprXML()})).join(";").replace(/<\/?text>/g,"")+"</text>":i(Ar,this).reprXML()}},{key:"valueJSON",get:function(){return Array.isArray(i(Ar,this))?["text",i(Ar,this).map((function(e){return e._unsafe_raw_value})).join(";")]:i(Ar,this).reprJSON()}}])}();function Sr(e){if(void 0===e)throw new S("Value for MediatypeParameter must be supplied");if(!Array.isArray(e)&&"ParameterValueType"!==e.constructor.identifier||Array.isArray(e)&&!e.every((function(e){return"ParameterValueType"===e.constructor.identifier})))throw new TypeError("Value for MediatypeParameter must be of ParameterValueType or an array of ParameterValueTypes");if(!Array.isArray(e)&&!i(Tr,this).test(e.repr()))throw new O("Invalid media type");if(Array.isArray(e)){if(2!==e.length)throw new O("Invalid value for MediatypeParameter. It should be an array with a length of 2");if(!i(Tr,this).test(e[0].repr()))throw new O("Invalid media type");if(!i(br,this).test(e[1].repr()))throw new O("Invalid media type")}}l(kr,"param","MEDIATYPE"),l(kr,"identifier","MediatypeParameter"),Object.freeze(kr);var Or=new WeakMap,Mr=new WeakMap,Lr=new WeakSet,Nr=function(){function e(a){var i;return n(this,e),s(i=t(this,e),Lr),o(i,Or,void 0),o(i,Mr,/^(?:gregorian|[Xx]-[A-Za-z0-9-]+)$/),r(Lr,i,Ir).call(i,a),u(Or,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,Ge),p(e,[{key:"value",get:function(){return i(Or,this).repr()}},{key:"valueXML",get:function(){return i(Or,this).reprXML()}},{key:"valueJSON",get:function(){return i(Or,this).reprJSON()}}])}();function Ir(e){if(void 0===e)throw new S("Value for CalscaleParameter must be supplied");if("ParameterValueType"!==e.constructor.identifier)throw new S("Value for CalscaleParameter must of type ParameterValueType");if(!i(Mr,this).test(e.repr()))throw new O("Invalid calscale value")}l(Nr,"param","CALSCALE"),l(Nr,"identifier","CalscaleParameter"),Object.freeze(Nr);var Er=new WeakMap,Xr=new WeakSet,Jr=function(){function e(a){var i;return n(this,e),s(i=t(this,e),Xr),o(i,Er,void 0),r(Xr,i,Vr).call(i,a),u(Er,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,Ge),p(e,[{key:"value",get:function(){return Array.isArray(i(Er,this))?'"'.concat(i(Er,this).map((function(e){return e.repr()})).join(",").replaceAll('"',""),'"'):i(Er,this).repr()}},{key:"valueXML",get:function(){return Array.isArray(i(Er,this))?i(Er,this).map((function(e){return e.reprXML()})).join(""):i(Er,this).reprXML()}},{key:"valueJSON",get:function(){return Array.isArray(i(Er,this))?["text"].concat(T(i(Er,this).map((function(e){return e._unsafe_raw_value})))):i(Er,this).reprJSON()}}])}();function Vr(e){if(void 0===e)throw new S("Value for SortAsParameter must be supplied");if((Array.isArray(e)||"ParameterValueType"!==e.constructor.identifier)&&(!Array.isArray(e)||!e.every((function(e){return"ParameterValueType"===e.constructor.identifier}))))throw new TypeError("Value for SortAsParameter must be of type ParameterValueType or an array of ParameterValueTypes")}l(Jr,"param","SORT-AS"),l(Jr,"identifier","SortAsParameter"),Object.freeze(Jr);var jr=new WeakMap,Wr=new WeakSet,zr=function(){function e(a){var i;return n(this,e),s(i=t(this,e),Wr),o(i,jr,void 0),r(Wr,i,xr).call(i,a),u(jr,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,Ge),p(e,[{key:"value",get:function(){return'"'.concat(i(jr,this).repr(),'"')}},{key:"valueXML",get:function(){return i(jr,this).reprXML()}},{key:"valueJSON",get:function(){return i(jr,this).reprJSON()}}])}();function xr(e){if(void 0===e)throw new S("Value for GeoParameter must be supplied");if("URIType"!==e.constructor.identifier)throw new TypeError("Value for GeoParameter must be of type URIType")}l(zr,"param","GEO"),l(zr,"identifier","GeoParameter"),Object.freeze(zr);var Dr=new WeakMap,Rr=new WeakSet,Cr=function(){function e(a){var i;return n(this,e),s(i=t(this,e),Rr),o(i,Dr,void 0),r(Rr,i,Fr).call(i,a),u(Dr,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,Ge),p(e,[{key:"value",get:function(){return"URIType"===i(Dr,this).constructor.identifier?'"'.concat(i(Dr,this).repr(),'"'):i(Dr,this).repr()}},{key:"valueXML",get:function(){return i(Dr,this).reprXML()}},{key:"valueJSON",get:function(){return i(Dr,this).reprJSON()}}])}();function Fr(e){if(void 0===e)throw new S("Value for TzParameter must be supplied");if("ParameterValueType"!==e.constructor.identifier&&"URIType"!==e.constructor.identifier&&("DateTimeType"!==e.constructor.identifier||"UTC-OFFSET"!==e.type))throw new TypeError("Invalid type for value for TzParameter")}l(Cr,"param","TZ"),l(Cr,"identifier","TzParameter"),Object.freeze(Cr);var Ur=new WeakMap,$r=new WeakMap,Gr=new WeakMap,_r=new WeakSet,Br=function(){function e(a,i){var c;return n(this,e),s(c=t(this,e),_r),o(c,Ur,void 0),o(c,$r,void 0),o(c,Gr,/^x-[a-z0-9-]+$/i),r(_r,c,Zr).call(c,a,i),u($r,c,a),u(Ur,c,i),c.checkAbstractPropertiesAndMethods(),Object.freeze(c),c}return h(e,Ge),p(e,[{key:"param",get:function(){return"".concat(i($r,this))}},{key:"value",get:function(){return i(Ur,this).repr()}},{key:"valueXML",get:function(){return i(Ur,this).reprXML()}},{key:"valueJSON",get:function(){return i(Ur,this).reprJSON()}}])}();function Zr(e,r){if(void 0===e||void 0===r)throw new S("Parameter name and value for AnyParameter must be supplied");if(!i(Gr,this).test(e))throw new O("Invalid parameter name for AnyParameter");if("ParameterValueType"!==r.constructor.identifier)throw new O("Invalid value for AnyParameter")}l(Br,"identifier","AnyParameter"),Object.freeze(Br);var Kr=new WeakMap,Hr=new WeakSet,Yr=function(){function e(a){var i;return n(this,e),s(i=t(this,e),Hr),o(i,Kr,void 0),r(Hr,i,qr).call(i,a),u(Kr,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,Ge),p(e,[{key:"value",get:function(){return i(Kr,this).repr()}},{key:"valueXML",get:function(){return i(Kr,this).reprXML()}},{key:"valueJSON",get:function(){return i(Kr,this).reprJSON()}}])}();function qr(e){if(void 0===e)throw new S("Value for LabelParameter must be supplied");if("ParameterValueType"!==e.constructor.identifier)throw new TypeError("Value for LabelParameter should be of type ParameterValueType")}l(Yr,"param","LABEL"),l(Yr,"identifier","LabelParameter"),Object.freeze(Yr);var Qr=new WeakMap,et=new WeakSet,rt=function(){function e(a){var i;return n(this,e),s(i=t(this,e),et),o(i,Qr,void 0),r(et,i,tt).call(i,a),u(Qr,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,Ge),p(e,[{key:"value",get:function(){return i(Qr,this).repr()}},{key:"valueXML",get:function(){return i(Qr,this).reprXML()}},{key:"valueJSON",get:function(){return i(Qr,this).reprJSON()}}])}();function tt(e){if(void 0===e)throw new S("Value for CCParameter must be supplied");if("ParameterValueType"!==e.constructor.identifier||!/^[A-Za-z0-9]{2}$/.test(e.repr()))throw new O("Invalid value for CCParameter")}l(rt,"param","CC"),l(rt,"identifier","CCParameter"),Object.freeze(rt);var at=new WeakMap,nt=new WeakSet,it=function(){function e(a){var i;return n(this,e),s(i=t(this,e),nt),o(i,at,void 0),r(nt,i,ot).call(i,a),u(at,i,a),i.checkAbstractPropertiesAndMethods(),Object.freeze(i),i}return h(e,Ge),p(e,[{key:"value",get:function(){return i(at,this).repr()}},{key:"valueXML",get:function(){return i(at,this).reprXML()}},{key:"valueJSON",get:function(){return i(at,this).reprJSON()}}])}();function ot(e){if(void 0===e)throw new S("Value for IndexParameter must be supplied");if("IntegerType"!==e.constructor.identifier||!(Number(e.repr())>0))throw new O("Invalid value for IndexParameter. Must be a positive integer")}l(it,"param","INDEX"),l(it,"identifier","IndexParameter"),Object.freeze(it);var ut=new WeakMap,st=new WeakMap,ct=new WeakMap,pt=new WeakSet,ft=function(){function e(a,i){var c;return n(this,e),s(c=t(this,e),pt),o(c,ut,/^(?:beginner|average|expert)$/),o(c,st,/^(?:high|medium|low)$/),o(c,ct,void 0),r(pt,c,lt).call(c,a,i),u(ct,c,i),c.targetProp=a.toUpperCase(),c.checkAbstractPropertiesAndMethods(),Object.freeze(c),c}return h(e,Ge),p(e,[{key:"value",get:function(){return i(ct,this).repr()}},{key:"valueXML",get:function(){return i(ct,this).reprXML()}},{key:"valueJSON",get:function(){return i(ct,this).reprJSON()}}])}();function lt(e,r){if(void 0===r||void 0===e)throw new S("Value and target property for LevelParameter must be supp