Comparing version 0.10.9 to 0.11.0
@@ -1,2 +0,2 @@ | ||
var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};function n(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var e=function(){return(e=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var a in n=arguments[e])Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a]);return t}).apply(this,arguments)};function r(t,n){return Object.prototype.hasOwnProperty.call(n,t)}function a(t){return Number.isInteger(t)||t<<0===t}function i(t){return null==t}function u(t,n){return void 0===n&&(n=function(t){return Array.isArray(t)?t.slice():[t]}),t.reduce(function(t,e){return t.concat(n(e))},[])}var o=Object.freeze({hasProperty:r,isInteger:a,nullOrUndefined:i,flatMap:u});function c(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.join(".")}function s(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return n.reduce(function(t,n){return t&&void 0!==t[n]?t[n]:void 0},t)}function f(t,n,r){var a=e({},r);return a[t]=n,a}function l(t,n,r){return n.then(function(n){var a=e({},r);return a[t]=n,a})}function h(t,n){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];var u=e[0];if(e.length>1){var o=null!=t&&r(u,t)?t[u]:a(e[1])?[]:{};n=h.apply(void 0,[o,n].concat(Array.prototype.slice.call(e,1)))}return l(u,n,t)}function d(t,n){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];var u=e[0];if(e.length>1){var o=null!=t&&r(u,t)?t[u]:a(e[1])?[]:{};n=d.apply(void 0,[o,n].concat(Array.prototype.slice.call(e,1)))}return f(u,n,t)}var p=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n){return s.apply(void 0,[n].concat(t))}},w=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n,e){return d.apply(void 0,[n,e].concat(t))}},m=Object.freeze({path:function(t){return t.split(".").map(function(t){var n=parseInt(t);return isNaN(n)?t:n})},pathString:c,getPath:s,getPathPromise:function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return n.reduce(function(t,n){return t.then(function(t){return new Promise(function(e,r){t&&void 0!==t[n]?e(t[n]):r(void 0)})})},Promise.resolve(t))},setProp:f,setPropPromise:l,setPathPromise:h,setPathPromiseValue:function(t,n){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];return h.apply(void 0,[t,Promise.resolve(n)].concat(e))},setPath:d,getter:p,setter:w}),v=function(t){this.operator=t},g=function(t){function e(n,e,r,i){void 0===e&&(e=[]),void 0===r&&(r=-1),void 0===i&&(i=[]);var u=t.call(this)||this;u.type="FIELD",u.readable=c.apply(void 0,n),u.path=n.slice(),u.tags=e;var o=n.filter(function(t){return a(t)});return u.position=-1===r&&o.length>=1?o[o.length-1]:r,u.siblings=i.slice(),u}return n(e,t),e}(v);var y=function(t,n,e){this.type="FUNCTION",this.operator=e,this.body=t,this.readable=null!=n?n:t},b=function(t){function e(n,e,r){var a=t.call(this,e)||this;return a.type="BINARY",a.left=n,a.right=r,a}return n(e,t),Object.defineProperty(e.prototype,"readable",{get:function(){return this.left.readable+" "+this.operator.readable+" "+this.right.readable},enumerable:!0,configurable:!0}),e.prototype.children=function(){return[this.left,this.right]},e}(v),M={readable:"single_mapping"},D={readable:"when"},O={readable:"validate"},Y={readable:"not"},E={readable:"and"},P={readable:"or"},N={readable:"then"},I={readable:"else"},A={readable:"function"},F={readable:"has value"},T={readable:"is null"},j={readable:"is not null"},x={readable:"is defined"},_={readable:"is undefined"},S={readable:"="},L={readable:"!="},q={readable:"match all"},V={readable:"none match"},U={readable:"match any"},C={readable:"contains"},R={readable:"matches"},z={readable:"starts with"},G={readable:"ends with"},B={readable:"length"},W={readable:"as integer"},X={readable:"trimmed"},H={readable:"upper case"},k={readable:"lower case"},J={readable:"concat"},K={readable:"replace all"},Q={readable:"sub string"},Z={readable:"min"},$={readable:"max"},tt={readable:"sum"},nt={readable:"count"},et={readable:"<"},rt={readable:"<="},at={readable:">"},it={readable:">="},ut={readable:"+"},ot={readable:"-"},ct={readable:"*"},st={readable:"/"},ft="->",lt={readable:"using"},ht={readable:"multiple inputs"},dt={readable:">"},pt={readable:">="},wt={readable:"<"},mt={readable:"<="},vt={readable:"plus days"},gt={readable:"minus days"},yt={readable:"plus months"},bt={readable:"minus months"},Mt={readable:"plus years"},Dt={readable:"minus years"},Ot={readable:"format iso"},Yt={readable:"format day month year"},Et={readable:"this year"},Pt={readable:"this month"},Nt={readable:"today"},It={readable:"tomorrow"},At={readable:"with day of month"},Ft={readable:"with month"},Tt={readable:"with year"},jt={readable:"with first day of next year"},xt={readable:"with last day of last year"},_t={readable:"month of"},St={readable:"year of"},Lt={readable:"date of"},qt={readable:"number of months since"},Vt={readable:"number of months between"},Ut={readable:"number of years between"},Ct={readable:"age at"},Rt={readable:"contains all"},zt={readable:"is empty"},Gt={readable:"is not empty"},Bt={readable:"has size"},Wt={readable:"has not size"},Xt={readable:"position of"},Ht={readable:"tags of"},kt={readable:"functions"},Jt=function(t){function e(n,e){var r=t.call(this)||this;return r.type="UNARY",r.metadata=n,r.operator=e,r}return n(e,t),Object.defineProperty(e.prototype,"readable",{get:function(){return this.operator===Y?this.operator.readable+"("+this.metadata.readable+")":this.metadata.readable+" "+this.operator.readable},enumerable:!0,configurable:!0}),e.prototype.children=function(){return[this.metadata]},e}(v),Kt=function(t){function e(n){var e=t.call(this)||this;return e.type="VALUE",e.readable=JSON.stringify(n),e.value=n,e}return n(e,t),e}(v),Qt=function(t){function e(n){var e=t.call(this)||this;return e.type="ITERABLE",e.values=n,e}return n(e,t),Object.defineProperty(e.prototype,"readable",{get:function(){return"["+this.values.map(function(t){return t.readable}).join(",")+"]"},enumerable:!0,configurable:!0}),e.prototype.children=function(){return this.values},e}(v),Zt=function(){function t(t,n,e){this.metadata=t,this.get=function(t,n){if(r("interceptor",n))return n;var e=function(e,r){var a=n(e,r);return r&&r.addGetValue(t,a),a};return e.interceptor=!0,e}(t,n),this.set=e?function(t,n){if(r("interceptor",n))return n;var e=function(e,r,a){return a&&a.addSetValue(t,r),n(e,r,a)};return e.interceptor=!0,e}(t,e):void 0}return t.function=function(n){return new t(n.metadata,n.get,n.set)},t.contextual=function(n,e){return new t(n,e)},t.consumer=function(n,e){return new t(n,function(){return null},e)},t.lift=function(t,n){return new t(new Kt(n),function(){return n})},t.prototype.mapTo=function(t,n,e){var r=this;return new t(new b(this.metadata,A,new y(e||n.toString())),function(t,e){return n(r.get(t,e))})},t.prototype.hasValue=function(){var t=this;return new tn(new Jt(this.metadata,F),function(n,e){var r=t.get(n,e);return null!=r})},t.prototype.isNullOrUndefined=function(){return this.isNull().or(this.isUndefined())},t.prototype.isDefined=function(){var t=this;return new tn(new Jt(this.metadata,x),function(n,e){return void 0!==t.get(n,e)})},t.prototype.isUndefined=function(){var t=this;return new tn(new Jt(this.metadata,_),function(n,e){return void 0===t.get(n,e)})},t.prototype.isNull=function(){var t=this;return new tn(new Jt(this.metadata,T),function(n,e){return null===t.get(n,e)})},t.prototype.isNotNull=function(){var t=this;return new tn(new Jt(this.metadata,j),function(n,e){return null!==t.get(n,e)})},t.prototype.equals=function(t,n){return t===n},t.prototype.eq=function(n){var e=this;return n instanceof t?new tn(new b(this.metadata,S,n.metadata),function(t,r){return e.equals(e.get(t,r),n.get(t,r))}):new tn(new b(this.metadata,S,new Kt(n)),function(t,r){return e.equals(e.get(t,r),n)})},t.prototype.notEq=function(n){var e=this;return n instanceof t?new tn(new b(this.metadata,L,n.metadata),function(t,r){return!e.equals(e.get(t,r),n.get(t,r))}):new tn(new b(this.metadata,L,new Kt(n)),function(t,r){return!e.equals(e.get(t,r),n)})},t.prototype.matchAll=function(){for(var n=this,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var a=e.map(function(n){return n instanceof t?n.metadata:new Kt(n)});return new tn(new b(this.metadata,q,new Qt(a)),function(r,a){return e.every(function(e){return e instanceof t?n.get(r,a)===e.get(r,a):n.get(r,a)===e})})},t.prototype.noneMatch=function(){for(var n=this,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var a=e.map(function(n){return n instanceof t?n.metadata:new Kt(n)});return new tn(new b(this.metadata,V,new Qt(a)),function(r,a){return e.every(function(e){return e instanceof t?n.get(r,a)!==e.get(r,a):n.get(r,a)!==e})})},t.prototype.matchAny=function(){for(var n=this,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var a=e.map(function(n){return n instanceof t?n.metadata:new Kt(n)});return new tn(new b(this.metadata,U,new Qt(a)),function(r,a){return e.some(function(e){return e instanceof t?n.get(r,a)===e.get(r,a):n.get(r,a)===e})})},t}();function $t(t,n,e,r){return n instanceof Zt?function(a,i){var u=t.get(a,i);if(null!=u||null!=u){var o=n.get(a,i);return null!=o||null!=o?e(u,o):r}return r}:function(a,i){var u=t.get(a,i);return null!=u||null!=u?e(u,n):r}}var tn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.boolean=function(t){return new e(t.metadata,t.get,t.set)},e.prototype.not=function(){return new e(new Jt(this.metadata,Y),$t(this,!1,function(t){return!t},!1))},e.prototype.and=function(t){var n=this;return new e(new b(this.metadata,E,t.metadata),function(e,r){if(r&&r.shortCircuit){var a=n.get(e,r);if(null!=a){if(!a)return!1;var i=t.get(e,r);return a&&null!=i&&i}return!1}return $t(n,t,function(t,n){return t&&n},!1)(e,r)})},e.prototype.or=function(t){var n=this;return new e(new b(this.metadata,P,t instanceof e?t.metadata:new Kt(t)),function(r,a){if(a&&a.shortCircuit){var i=n.get(r,a);return null!=i&&(!!i||(t instanceof e?i||t.get(r,a):i||t))}return $t(n,t,function(t,n){return t||n},!1)(r,a)})},e}(Zt),nn=function(t){function e(n,e){var r=t.call(this,e)||this;return r.type="NARY",r.values=n,r}return n(e,t),Object.defineProperty(e.prototype,"readable",{get:function(){return this.values.map(function(t){return t.readable}).join(",")},enumerable:!0,configurable:!0}),e.prototype.children=function(){return this.values},e}(v),en=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.number=function(t){return new e(t.metadata,t.get,t.set)},e.min=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.map(function(t){return t instanceof e?t.metadata:new Kt(t)});return new e(new nn(r,Z),function(n,e){var r=function(t,n){return t<n?t:n};return t.reduce(function(t,a){if(a instanceof Zt){var i=a.get(n,e);return null!=i?r(i,t):t}return r(a,t)},Number.MAX_SAFE_INTEGER)})},e.max=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.map(function(t){return t instanceof e?t.metadata:new Kt(t)});return new e(new nn(r,$),function(n,e){var r=function(t,n){return t>n?t:n};return t.reduce(function(t,a){if(a instanceof Zt){var i=a.get(n,e);return null!=i?r(i,t):t}return r(a,t)},Number.MIN_SAFE_INTEGER)})},e.sum=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.map(function(t){return t instanceof e?t.metadata:new Kt(t)});return new e(new nn(r,tt),function(n,e){var r=function(t,n){return t+n};return t.reduce(function(t,a){if(a instanceof Zt){var i=a.get(n,e);return null!=i?r(i,t):t}return r(a,t)},0)})},e.prototype.lesserThan=function(t){var n=function(t,n){return t<n};return new tn(new b(this.metadata,et,t instanceof e?t.metadata:new Kt(t)),$t(this,t,n,!1))},e.prototype.lesserOrEquals=function(t){var n=function(t,n){return t<=n};return new tn(new b(this.metadata,rt,t instanceof e?t.metadata:new Kt(t)),$t(this,t,n,!1))},e.prototype.greaterThan=function(t){var n=function(t,n){return t>n};return new tn(new b(this.metadata,at,t instanceof e?t.metadata:new Kt(t)),$t(this,t,n,!1))},e.prototype.greaterOrEquals=function(t){var n=function(t,n){return t>=n};return new tn(new b(this.metadata,it,t instanceof e?t.metadata:new Kt(t)),$t(this,t,n,!1))},e.prototype.between=function(t,n){return this.greaterOrEquals(t).and(this.lesserThan(n))},e.prototype.plus=function(t){var n=function(t,n){return t+n};return new e(new b(this.metadata,ut,t instanceof e?t.metadata:new Kt(t)),$t(this,t,n,null))},e.prototype.minus=function(t){var n=function(t,n){return t-n};return new e(new b(this.metadata,ot,t instanceof e?t.metadata:new Kt(t)),$t(this,t,n,null))},e.prototype.times=function(t){var n=function(t,n){return t*n};return new e(new b(this.metadata,ct,t instanceof e?t.metadata:new Kt(t)),$t(this,t,n,null))},e.prototype.divide=function(t){var n=function(t,n){return t/n};return new e(new b(this.metadata,st,t instanceof e?t.metadata:new Kt(t)),$t(this,t,n,null))},e}(Zt),rn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.iterable=function(t){return new e(t.metadata,t.get,t.set)},e.prototype.contains=function(t){var n=function(t,n){return t.some(function(t){return t===n})};return new tn(new b(this.metadata,C,t instanceof Zt?t.metadata:new Kt(t)),$t(this,t,n,!1))},e.prototype.containsAll=function(t){var n=function(t,n){return t.some(function(t){return n.some(function(n){return n===t})})};return new tn(new b(this.metadata,Rt,t instanceof Zt?t.metadata:new Qt(t.map(function(t){return new Kt(t)}))),$t(this,t,n,!1))},e.prototype.isEmpty=function(){return new tn(new Jt(this.metadata,zt),$t(this,void 0,function(t){return 0===t.length},null))},e.prototype.isNotEmpty=function(){return new tn(new Jt(this.metadata,Gt),$t(this,void 0,function(t){return 0!==t.length},null))},e.prototype.hasSize=function(t){var n=function(t,n){return t.length===n};return new tn(new Jt(this.metadata,Bt),$t(this,t,n,null))},e.prototype.hasNotSize=function(t){var n=function(t,n){return t.length!==n};return new tn(new Jt(this.metadata,Wt),$t(this,t,n,null))},e.prototype.length=function(){return new en(new Jt(this.metadata,B),$t(this,void 0,function(t){return t.length},null))},e}(Zt),an=function(){function t(t){var n=this;this.metadata=t,this.get=p.apply(void 0,t.path),this.metadata.siblings&&this.metadata.siblings.length>0?this.set=function(e,r,a){return d.apply(void 0,[n.metadata.siblings.reduce(function(t,n){return d.apply(void 0,[t,r].concat(n))},e),r].concat(t.path))}:this.set=w.apply(void 0,t.path)}return t.field=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(new g(n))},t.prototype.withPosition=function(n){return new t(new g(this.metadata.path,this.metadata.tags,n,this.metadata.siblings))},t.prototype.withTags=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(new g(this.metadata.path,n,this.metadata.position,this.metadata.siblings))},t.prototype.withSiblings=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(new g(this.metadata.path,this.metadata.tags,this.metadata.position,n))},t.prototype.position=function(){var t=this;return new en(new Jt(this.metadata,Xt),function(){return t.metadata.position})},t.prototype.tags=function(){var t=this;return new rn(new Jt(this.metadata,Ht),function(){return t.metadata.tags})},t}(),un=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.string=function(t){return new e(t.metadata,t.get,t.set)},e.prototype.contains=function(t){var n=function(t,n){return t.includes(n)};return new tn(new b(this.metadata,C,t instanceof e?t.metadata:new Kt(t)),$t(this,t,n,!1))},e.prototype.matches=function(t){var n=function(t,n){return new RegExp(n).test(t)};return new tn(new b(this.metadata,R,t instanceof e?t.metadata:new Kt(t)),$t(this,t,n,!1))},e.prototype.startsWith=function(t){var n=function(t,n){return t.startsWith(n)};return new tn(new b(this.metadata,z,t instanceof e?t.metadata:new Kt(t)),$t(this,t,n,!1))},e.prototype.endsWith=function(t){var n=function(t,n){return t.endsWith(n)};return new tn(new b(this.metadata,G,t instanceof e?t.metadata:new Kt(t)),$t(this,t,n,!1))},e.prototype.length=function(){return new en(new Jt(this.metadata,B),$t(this,void 0,function(t){return t.length},0))},e.prototype.parseInt=function(){return new en(new Jt(this.metadata,W),$t(this,void 0,function(t){return parseInt(t)},null))},e.prototype.trim=function(){return new e(new Jt(this.metadata,X),$t(this,void 0,function(t){return t.trim()},null))},e.prototype.replaceAll=function(t,n){return new e(new b(this.metadata,K,new b(new Kt(t),E,new Kt(n))),$t(this,void 0,function(e){return e.replace(t,n)},null))},e.prototype.substring=function(t,n){return new e(new b(this.metadata,Q,new b(new Kt(t),E,new Kt(n))),$t(this,void 0,function(e){return e.substring(t,n)},null))},e.prototype.localeUpperCase=function(){return new e(new Jt(this.metadata,H),$t(this,void 0,function(t){return t.toLocaleUpperCase()},null))},e.prototype.localeLowerCase=function(){return new e(new Jt(this.metadata,k),$t(this,void 0,function(t){return t.toLocaleLowerCase()},null))},e.prototype.concat=function(t){return new e(new b(this.metadata,J,t instanceof e?t.metadata:new Kt(t)),$t(this,t,function(t,n){return t+n},null))},e}(Zt),on=function(t){function e(n,e,r){var a=t.call(this)||this;return a.type="CONDITIONAL_MAPPING",a.whenMetadata=n,a.thenMetadata=e,a.elseMetadata=r,a}return n(e,t),e.prototype.children=function(){var t=[this.whenMetadata,this.thenMetadata];return null!=this.elseMetadata?t.concat(this.elseMetadata):t},Object.defineProperty(e.prototype,"readable",{get:function(){return this.whenMetadata.readable+" "+N.readable+" "+this.thenMetadata.readable+(null!=this.elseMetadata?" "+I.readable+" "+this.elseMetadata.readable:"")},enumerable:!0,configurable:!0}),e}(v),cn=function(){function t(t){this.type="WHEN",this.metadata=t,this.operator=D}return Object.defineProperty(t.prototype,"readable",{get:function(){return this.operator.readable+" "+this.metadata.readable},enumerable:!0,configurable:!0}),t.prototype.children=function(){return[this.metadata]},t}(),sn=function(t){function e(n,e){var r=t.call(this,e)||this;return r.type="MULTIPLE_MAPPING",r.mappings=n,r}return n(e,t),Object.defineProperty(e.prototype,"readable",{get:function(){return this.mappings.map(function(t){return t.readable}).join(" , ")},enumerable:!0,configurable:!0}),e.prototype.children=function(){return this.mappings},e}(v),fn=function(){function t(t){void 0===t&&(t=!0),this.props={},this.getValues=[],this.setValues=[],this.shortCircuit=t}return t.prototype.addGetValue=function(t,n){this.getValues.push({metadata:t,value:n})},t.prototype.addSetValue=function(t,n){this.setValues.push({metadata:t,value:n})},t}(),ln=function(){function t(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];this.condition=t,this.mappings=n;var r=n.map(function(t){return t.metadata});this.metadata=new on(new cn(t.metadata),new sn(r,N))}return t.prototype.execute=function(t,n){var e=n||new fn;return this.condition.get(t,n)?this.mappings.reduce(function(t,n){return n.execute(t,e)},t):this.elseMappings?this.elseMappings.reduce(function(t,n){return n.execute(t,e)},t):t},t.prototype.executeOn=function(t,n,e){var r=e||new fn;return this.condition.get(t,e)?(this.mappings.forEach(function(e){n=e.executeOn(t,n,r)}),n):this.elseMappings?(this.elseMappings.forEach(function(e){n=e.executeOn(t,n,r)}),n):n},t.prototype.otherwise=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.elseMappings=t;var e=t.map(function(t){return t.metadata});return this.metadata=new on(this.metadata.whenMetadata,this.metadata.thenMetadata,new sn(e,I)),this},t}(),hn=function(t,n){this.value=t,this.context=n},dn=function(t){function e(n){var e=t.call(this,O)||this;return e.type="VALIDATION",e.when=n,e}return n(e,t),Object.defineProperty(e.prototype,"readable",{get:function(){return this.operator.readable+" "+this.when.readable},enumerable:!0,configurable:!0}),e.prototype.children=function(){return[this.when]},e}(v),pn=function(){function t(t){this.when=t,this.metadata=new dn(t.metadata)}return t.prototype.execute=function(t,n){void 0===t&&(t={});var e=n||new fn;return new hn(this.when.condition.get(t,e),e)},t}(),wn=function(){function t(t){this.condition=t,this.metadata=new cn(t.metadata)}return t.prototype.validate=function(){return new pn(this)},t.prototype.then=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new(ln.bind.apply(ln,[void 0,this.condition].concat(t)))},t}(),mn=function(t){function e(n,e){var r=t.call(this,M)||this;return r.type="SINGLE_MAPPING",r.sourceMetadata=n,r.targetMetadata=e,r}return n(e,t),Object.defineProperty(e.prototype,"readable",{get:function(){return this.sourceMetadata.readable+" "+ft+" "+this.targetMetadata.readable},enumerable:!0,configurable:!0}),e.prototype.children=function(){return[this.sourceMetadata,this.targetMetadata]},e}(v),vn=function(){function t(t,n){this.input=t,this.output=n,this.metadata=new mn(t.metadata,n.metadata)}return t.prototype.execute=function(t,n){var e=n||new fn;return this.output.set?this.output.set(t,this.input.get(t,e),e):t},t.prototype.executeOn=function(t,n,e){var r=e||new fn;return this.output.set?this.output.set(n,this.input.get(t,r),r):n},t}(),gn=function(t){function e(n,e){var r=t.call(this,new b(n.metadata,lt,e.metadata),function(t,r){return e.convert(t,n,r)})||this;return r.input=n,r.converter=e,r}return n(e,t),e.prototype.using=function(t){return new e(this,t)},e.prototype.to=function(t){return new vn(this,t)},e}(Zt),yn=function(){function t(t){this.input=t}return t.prototype.to=function(t){return new vn(this.input,t)},t.prototype.using=function(t){return new gn(this.input,t)},t}(),bn=function(){function t(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];this.mappings=u(n,function(n){return n instanceof t?n.mappings:[n]}),this.metadata=new sn(this.mappings.map(function(t){return t.metadata}))}return t.prototype.execute=function(t,n){var e=n||new fn;return this.mappings.reduce(function(t,n){return n.execute(t,e)},t)},t.prototype.executeOn=function(t,n,e){var r=e||new fn;return this.mappings.forEach(function(e){n=e.executeOn(t,n,r)}),n},t}(),Mn=function(t,n,e){this.type="TYPE_CONVERTER",this.operator=e,this.body=t,this.readable=null!=n?n:t},Dn=function(t,n){this.convert=t,this.metadata=new Mn(t.toString(),n)},On=function(t){function e(n,e,r){var a=t.call(this,new b(new b(n.metadata,E,e.metadata),lt,r.metadata),function(t,a){return r.convert(t,n,e,a)})||this;return a.input=n,a.input2=e,a.converter=r,a}return n(e,t),e.prototype.using=function(t){return new gn(this,t)},e.prototype.to=function(t){return new vn(this,t)},e}(Zt),Yn=function(){function t(t,n){this.input=t,this.input2=n}return t.prototype.using=function(t){return new On(this.input,this.input2,t instanceof Dn?t:new Dn(t))},t}(),En=function(t,n){this.convert=t,this.metadata=new Mn(t.toString(),n)},Pn=function(t){function e(n,e){var r=t.call(this,new b(new nn(n.map(function(t){return t.metadata}),ht),lt,e.metadata),function(t,r){return e.convert(t,n,r)})||this;return r.inputs=n,r.converter=e,r}return n(e,t),e.prototype.using=function(t){return new gn(this,t)},e.prototype.to=function(t){return new vn(this,t)},e}(Zt),Nn=function(){function t(t){this.inputs=t}return t.prototype.using=function(t){return new Pn(this.inputs,t instanceof En?t:new En(t))},t}();function In(t,n){for(t=String(t),n=n||2;t.length<n;)t="0"+t;return t}function An(){return new Date(Date.now())}function Fn(t){return new Date(t.valueOf())}function Tn(t,n,e,r,a,i,u){return new Date(Date.UTC(t,n,e||0,r||0,a||0,i||0,u||0))}function jn(t){var n=Fn(t);return n.getFullYear().toString()+In(n.getMonth()+1,2)+In(n.getDate(),2)}function xn(t){var n=Fn(t);return In(n.getDate(),2)+In(n.getMonth()+1,2)+n.getFullYear()}function _n(t){var n=Number.parseInt(t.slice(0,4)),e=Number.parseInt(t.slice(4,6))-1,r=Number.parseInt(t.slice(6,8));return new Date(n,e,r)}function Sn(t,n){var e=n||An(),r=12*(e.getFullYear()-t.getFullYear())+(e.getMonth()-t.getMonth());return e.getDate()-t.getDate()>=0?r:r-1}function Ln(t,n){var e=n.getFullYear()-t.getFullYear(),r=n.getMonth()-t.getMonth(),a=n.getDate()-t.getDate();return r>=0&&a>=0?e:e-1}var qn=Object.freeze({now:An,clone:Fn,newUTCDate:Tn,formatYYYYMMdd:jn,formatddMMYYYY:xn,formatReadable:function(t){var n=Fn(t);return In(n.getDate(),2)+"/"+In(n.getMonth()+1,2)+"/"+n.getFullYear()},formatMMMMYYYY:function(t,n){var e=Fn(t);return new Intl.DateTimeFormat(n,{month:"long"}).format(t)+" "+e.getFullYear()},formatEEEEddMMMM:function(t,n){var e=Fn(t),r=new Intl.DateTimeFormat(n,{weekday:"long"}).format(e),a=new Intl.DateTimeFormat(n,{month:"long"}).format(e);return r+" "+In(e.getDate(),2)+" "+a},formatTime:function(t){var n=Fn(t);return In(t.getHours(),2)+In(n.getMinutes(),2)+In(t.getSeconds(),2)},parse:_n,numberOfFullMonthsBetween:Sn,numberOfFullYearsBetween:Ln}),Vn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.equals=function(n,e){return n&&e?n.getTime()===e.getTime():t.prototype.equals.call(this,n,e)},e.date=function(t){return new e(t.metadata,t.get,t.set)},e.dateIso=function(t){return new e(t.metadata,function(n,e){var r=t.get(n,e);return i(r)?r:_n(r)},function(n,e,r){return i(e)?t.set?t.set(n,e,r):n:t.set?t.set(n,jn(e),r):n})},e.min=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.map(function(t){return t instanceof e?t.metadata:new Kt(t)});return new e(new nn(r,Z),function(n,r){var a=function(t,n){return t<n?t:n};return t.reduce(function(t,e){if(e instanceof Zt){var i=e.get(n,r);return null!=i?a(i,t):t}return a(e,t)},e.MAX_DATE)})},e.max=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.map(function(t){return t instanceof e?t.metadata:new Kt(t)});return new e(new nn(r,$),function(n,r){var a=function(t,n){return t>n?t:n};return t.reduce(function(t,e){if(e instanceof Zt){var i=e.get(n,r);return null!=i?a(i,t):t}return a(e,t)},e.MIN_DATE)})},e.thisYear=function(){return new en(new y("clone().getFullYear()",void 0,Et),function(){return An().getFullYear()})},e.thisMonth=function(){return new en(new y("clone().getMonth() + 1",void 0,Pt),function(){return An().getMonth()+1})},e.today=function(){return new e(new y("clone()",void 0,Nt),function(){return An()})},e.tomorrow=function(){return new e(new y("date.setDate(date.getDate() + 1)",void 0,It),function(){var t=An();return t.setDate(t.getDate()+1),t})},e.dateFrom=function(t){return new e(new y("Date{"+t+"}"),function(){return _n(t)})},e.newDate=function(t,n,r){return new e(new y("Date{ Y:"+t+" M:"+n+" D:"+r+" }"),function(){return Tn(t,n,r)})},e.newLocalDate=function(t,n,r){return new e(new y("Date{ Y:"+t+" M:"+n+" D:"+r+" }"),function(){return new Date(t,n,r)})},e.prototype.before=function(t){var n=function(t,n){return t<n};return new tn(new b(this.metadata,wt,t instanceof e?t.metadata:new Kt(t)),$t(this,t,n,!1))},e.prototype.beforeOrEquals=function(t){var n=function(t,n){return t<=n};return new tn(new b(this.metadata,mt,t instanceof e?t.metadata:new Kt(t)),$t(this,t,n,!1))},e.prototype.after=function(t){var n=function(t,n){return t>n};return new tn(new b(this.metadata,dt,t instanceof e?t.metadata:new Kt(t)),$t(this,t,n,!1))},e.prototype.afterOrEquals=function(t){var n=function(t,n){return t>=n};return new tn(new b(this.metadata,pt,t instanceof e?t.metadata:new Kt(t)),$t(this,t,n,!1))},e.prototype.between=function(t,n){return this.afterOrEquals(t).and(this.before(n))},e.prototype.plusDays=function(t){var n=function(t,n){var e=Fn(t);return e.setDate(t.getDate()+n),e};return new e(new b(this.metadata,vt,t instanceof en?t.metadata:new Kt(t)),$t(this,t,n,null))},e.prototype.minusDays=function(t){var n=function(t,n){var e=Fn(t);return e.setDate(e.getDate()-n),e};return new e(new b(this.metadata,gt,t instanceof en?t.metadata:new Kt(t)),$t(this,t,n,null))},e.prototype.plusMonths=function(t){var n=function(t,n){var e=Fn(t);return e.setMonth(e.getMonth()+n),e};return new e(new b(this.metadata,yt,t instanceof en?t.metadata:new Kt(t)),$t(this,t,n,null))},e.prototype.minusMonths=function(t){var n=function(t,n){var e=Fn(t);return e.setMonth(e.getMonth()-n),e};return new e(new b(this.metadata,bt,t instanceof en?t.metadata:new Kt(t)),$t(this,t,n,null))},e.prototype.plusYears=function(t){var n=function(t,n){var e=Fn(t);return e.setFullYear(e.getFullYear()+n),e};return new e(new b(this.metadata,Mt,t instanceof en?t.metadata:new Kt(t)),$t(this,t,n,null))},e.prototype.minusYears=function(t){var n=function(t,n){var e=Fn(t);return e.setFullYear(e.getFullYear()-n),e};return new e(new b(this.metadata,Dt,t instanceof en?t.metadata:new Kt(t)),$t(this,t,n,null))},e.prototype.formatISO=function(){return new un(new Jt(this.metadata,Ot),$t(this,void 0,function(t){return jn(t)},null))},e.prototype.dayMonthYear=function(){return new un(new Jt(this.metadata,Yt),$t(this,void 0,function(t){return xn(t)},null))},e.nbFullMonthsSince=function(t){return new en(new Jt(t.metadata,qt),$t(t,void 0,function(t){return Sn(t)},null))},e.nbFullMonthsBetween=function(t,n){return n instanceof e?new en(new b(t.metadata,Vt,n.metadata),$t(t,n,function(t,n){return Sn(t,n)},null)):new en(new b(t.metadata,Vt,new Kt(n)),$t(t,n,Sn,null))},e.nbFullYearsBetween=function(t,n){return new en(new b(t.metadata,Ut,n instanceof e?n.metadata:new Kt(n)),$t(t,n,Ln,null))},e.prototype.withDayOfMonth=function(t){var n=function(t,n){var e=Fn(t);return e.setDate(n),e};return new e(new b(this.metadata,At,new Kt(t)),$t(this,t,n,null))},e.prototype.withMonth=function(t){var n=function(t,n){var e=Fn(t);return e.setMonth(n),e};return new e(new b(this.metadata,Ft,new Kt(t)),$t(this,t,n,null))},e.prototype.withYear=function(t){var n=function(t,n){var e=Fn(t);return e.setFullYear(n),e};return new e(new b(this.metadata,Tt,new Kt(t)),$t(this,t,n,null))},e.prototype.withFirstDayOfNextYear=function(){return new e(new Jt(this.metadata,jt),$t(this,void 0,function(t){var n=Fn(t);return n.setMonth(11),n.setDate(32),n},null))},e.prototype.withLastDayOfLastYear=function(){return new e(new Jt(this.metadata,xt),$t(this,void 0,function(t){var n=Fn(t);return n.setMonth(0),n.setDate(0),n},null))},e.prototype.monthOf=function(){return new en(new Jt(this.metadata,_t),$t(this,void 0,function(t){return t.getMonth()},null))},e.prototype.yearOf=function(){return new en(new Jt(this.metadata,St),$t(this,void 0,function(t){return t.getFullYear()},null))},e.prototype.dateOf=function(){return new en(new Jt(this.metadata,Lt),$t(this,void 0,function(t){return t.getDate()},null))},e.prototype.ageAt=function(t){return new en(new b(this.metadata,Ct,t instanceof e?t.metadata:new Kt(t)),$t(this,t,Ln,null))},e.MAX_DATE=new Date(864e13),e.MIN_DATE=new Date(-864e13),e}(Zt),Un=function(t,n){this.convert=t,this.metadata=new Mn(t.toString(),n)};var Cn=Object.freeze({fieldsOf:function t(n){var e=n;return"FIELD"==e.type?[e.path]:n.children?n.children().reduce(function(n,e){return n.concat(t(e))},[]):[]}}),Rn=function(t){function e(n,e){var r=t.call(this,e)||this;return r.type="MULTIPLE_VALIDATIONS",r.mappings=n,r}return n(e,t),Object.defineProperty(e.prototype,"readable",{get:function(){return this.mappings.map(function(t){return t.readable}).join(" , ")},enumerable:!0,configurable:!0}),e.prototype.children=function(){return this.mappings},e}(v),zn=function(){function t(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];this.validations=u(n,function(n){return n instanceof t?n.validations:[n]}),this.metadata=new Rn(this.validations.map(function(t){return t.metadata}))}return t.prototype.execute=function(t,n){var e=n||new fn;return this.validations.map(function(n){return n.execute(t,e)}).find(function(t){return!0===t.value})||new hn(!1,e)},t}();function Gn(t){return Zt.function(t)}function Bn(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return an.field.apply(an,t)}function Wn(t,n){return Zt.lift(t,n)}function Xn(t){return rn.iterable(t)}function Hn(t){return tn.boolean(t)}function kn(t){return un.string(t)}function Jn(t){return en.number(t)}function Kn(t){return Vn.date(t)}function Qn(t){return Vn.dateIso(t)}function Zn(t){return new wn(t)}function $n(t,n){return n?new Yn(t instanceof Zt?t:new Zt(new Kt(t),function(n){return t}),n instanceof Zt?n:new Zt(new Kt(n),function(t){return n})):new yn(t instanceof Zt?t:new Zt(new Kt(t),function(n){return t}))}function te(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1==t.length?new vn(new Zt(new Kt(null),function(t){return null}),t[0]):new vn(new Zt(new Kt(null),function(t){return null}),Zt.consumer(new nn(t.map(function(t){return t.metadata}),kt),function(n,e,r){for(var a=0,i=t;a<i.length;a++){var u=i[a];n=u.set?u.set(n,e,r):n}return n}))}function ne(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new Nn(t)}function ee(t,n){return new Un(t,n)}function re(t,n){return new Dn(t,n)}function ae(t,n){return new En(t,n)}function ie(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new(bn.bind.apply(bn,[void 0].concat(t)))}function ue(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new(zn.bind.apply(zn,[void 0].concat(t)))}function oe(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new tn(new nn(t.map(function(t){return t.metadata}),U),function(n,e){return t.some(function(t){var r=t.get(n,e);return null!=r&&r})})}function ce(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new tn(new nn(t.map(function(t){return t.metadata}),q),function(n,e){return t.every(function(t){var r=t.get(n,e);return null!=r&&r})})}function se(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new tn(new nn(t.map(function(t){return t.metadata}),V),function(n,e){return t.every(function(t){var r=t.get(n,e);return null!=r&&!r})})}function fe(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new en(new nn(t.map(function(t){return t.metadata}),nt),function(n,e){return t.filter(function(t){var r=t.get(n,e);return null!=r&&r}).length})}function le(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new en(new nn(t.map(function(t){return t.metadata}),tt),function(n,e){return t.reduce(function(t,r){var a=r.get(n,e);return null!=a?t+a:t},0)})}function he(t){return new rn(new Jt(t.metadata,Ht),function(){return t.metadata instanceof g?t.metadata.tags:[]})}function de(t){return new en(new Jt(t.metadata,Xt),function(){return t.metadata instanceof g?t.metadata.position:void 0})}export{v as AbstractMetadata,Dn as BiTypeConverter,b as BinaryMetadata,tn as BooleanFunction,on as ConditionalMappingMetadata,Vn as DateFunction,qn as DateUtils,fn as DefaultContext,an as Field,g as FieldMetadata,Zt as Function,y as FunctionMetadata,rn as IterableFunction,Qt as IterableMetadata,Cn as MetadataUtils,sn as MultipleMappingsMetadata,Rn as MultipleValidationsMetadata,nn as NaryMetadata,En as NaryTypeConverter,en as NumberFunction,m as Paths,hn as Result,mn as SingleMappingMetadata,pn as SingleValidationRule,wn as StepWhen,un as StringFunction,Un as TypeConverter,Mn as TypeConverterMetadata,Jt as UnaryMetadata,o as Utils,dn as ValidationRuleMetadata,zn as Validations,Kt as ValueMetadata,cn as WhenMetadata,re as biConverter,Hn as boolean,$t as condition,ee as converter,fe as count,Kn as date,Qn as dateIso,Gn as f,Bn as field,Xn as iterable,Wn as lift,$n as map,ne as mapAll,te as mapNull,ie as mappings,ce as matchAll,oe as matchAny,se as matchNone,ae as naryConverter,Jn as number,de as position,kn as string,le as sum,he as tags,ue as validations,Zn as when}; | ||
var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};function e(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return(n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var a in e=arguments[n])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t}).apply(this,arguments)};function r(t,e){return Object.prototype.hasOwnProperty.call(e,t)}function a(t){return Number.isInteger(t)||t<<0===t}function u(t){return null==t}function i(t,e){return void 0===e&&(e=function(t){return Array.isArray(t)?t.slice():[t]}),t.reduce(function(t,n){return t.concat(e(n))},[])}var o=Object.freeze({hasProperty:r,isInteger:a,nullOrUndefined:u,flatMap:i});function c(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.join(".")}function s(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(t,e){return t&&void 0!==t[e]?t[e]:void 0},t)}function f(t,e,r){var a=n({},r);return a[t]=e,a}function l(t,e,r){return e.then(function(e){var a=n({},r);return a[t]=e,a})}function p(t,e){for(var n=[],u=2;u<arguments.length;u++)n[u-2]=arguments[u];var i=n[0];if(n.length>1){var o=null!=t&&r(i,t)?t[i]:a(n[1])?[]:{};e=p.apply(void 0,[o,e].concat(Array.prototype.slice.call(n,1)))}return l(i,e,t)}function h(t,e){for(var n=[],u=2;u<arguments.length;u++)n[u-2]=arguments[u];var i=n[0];if(n.length>1){var o=null!=t&&r(i,t)?t[i]:a(n[1])?[]:{};e=h.apply(void 0,[o,e].concat(Array.prototype.slice.call(n,1)))}return f(i,e,t)}var d=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return s.apply(void 0,[e].concat(t))}},w=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e,n){return h.apply(void 0,[e,n].concat(t))}},m=Object.freeze({path:function(t){return t.split(".").map(function(t){var e=parseInt(t);return isNaN(e)?t:e})},pathString:c,getPath:s,getPathPromise:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(t,e){return t.then(function(t){return new Promise(function(n,r){t&&void 0!==t[e]?n(t[e]):r(void 0)})})},Promise.resolve(t))},setProp:f,setPropPromise:l,setPathPromise:p,setPathPromiseValue:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return p.apply(void 0,[t,Promise.resolve(e)].concat(n))},setPath:h,getter:d,setter:w}),y=function(t){this.operator=t},v=function(t){function n(e,n,r,u){void 0===n&&(n=[]),void 0===r&&(r=-1),void 0===u&&(u=[]);var i=t.call(this)||this;i.type="FIELD",i.readable=c.apply(void 0,e),i.path=e.slice(),i.tags=n;var o=e.filter(function(t){return a(t)});return i.position=-1===r&&o.length>=1?o[o.length-1]:r,i.siblings=u.slice(),i}return e(n,t),n}(y);var g=function(t,e,n){this.type="FUNCTION",this.operator=n,this.body=t,this.readable=null!=e?e:t},b=function(t){function n(e,n,r){var a=t.call(this,n)||this;return a.type="BINARY",a.left=e,a.right=r,a}return e(n,t),Object.defineProperty(n.prototype,"readable",{get:function(){return this.left.readable+" "+this.operator.readable+" "+this.right.readable},enumerable:!0,configurable:!0}),n.prototype.children=function(){return[this.left,this.right]},n}(y),O={readable:"single_mapping",returnType:"OTHER"},T={readable:"when",returnType:"OTHER"},E={readable:"validate",returnType:"OTHER"},M={readable:"not",returnType:"BOOL"},R={readable:"and",returnType:"BOOL"},D={readable:"or",returnType:"BOOL"},H={readable:"then",returnType:"OTHER"},L={readable:"else",returnType:"OTHER"},Y={readable:"function",returnType:"OTHER"},P={readable:"has value",returnType:"BOOL"},N={readable:"is null",returnType:"BOOL"},B={readable:"is not null",returnType:"BOOL"},I={readable:"is defined",returnType:"BOOL"},A={readable:"is undefined",returnType:"BOOL"},F={readable:"=",returnType:"BOOL"},j={readable:"!=",returnType:"BOOL"},x={readable:"match all",returnType:"BOOL"},_={readable:"none match",returnType:"BOOL"},S={readable:"match any",returnType:"BOOL"},q={readable:"contains",returnType:"BOOL"},V={readable:"matches",returnType:"BOOL"},U={readable:"starts with",returnType:"BOOL"},C={readable:"ends with",returnType:"BOOL"},z={readable:"length",returnType:"OTHER"},G={readable:"as integer",returnType:"OTHER"},W={readable:"trimmed",returnType:"OTHER"},X={readable:"upper case",returnType:"OTHER"},k={readable:"lower case",returnType:"OTHER"},J={readable:"concat",returnType:"OTHER"},K={readable:"replace all",returnType:"OTHER"},Q={readable:"sub string",returnType:"OTHER"},Z={readable:"min",returnType:"OTHER"},$={readable:"max",returnType:"OTHER"},tt={readable:"sum",returnType:"OTHER"},et={readable:"count",returnType:"OTHER"},nt={readable:"<",returnType:"BOOL"},rt={readable:"<=",returnType:"BOOL"},at={readable:">",returnType:"BOOL"},ut={readable:">=",returnType:"BOOL"},it={readable:"+",returnType:"OTHER"},ot={readable:"-",returnType:"OTHER"},ct={readable:"*",returnType:"OTHER"},st={readable:"/",returnType:"OTHER"},ft={readable:"->",returnType:"OTHER"},lt={readable:"using",returnType:"OTHER"},pt={readable:"multiple inputs",returnType:"OTHER"},ht={readable:">",returnType:"BOOL"},dt={readable:">=",returnType:"BOOL"},wt={readable:"<",returnType:"BOOL"},mt={readable:"<=",returnType:"BOOL"},yt={readable:"plus days",returnType:"OTHER"},vt={readable:"minus days",returnType:"OTHER"},gt={readable:"plus months",returnType:"OTHER"},bt={readable:"minus months",returnType:"OTHER"},Ot={readable:"plus years",returnType:"OTHER"},Tt={readable:"minus years",returnType:"OTHER"},Et={readable:"format iso",returnType:"OTHER"},Mt={readable:"format day month year",returnType:"OTHER"},Rt={readable:"this year",returnType:"OTHER"},Dt={readable:"this month",returnType:"OTHER"},Ht={readable:"today",returnType:"OTHER"},Lt={readable:"tomorrow",returnType:"OTHER"},Yt={readable:"with day of month",returnType:"OTHER"},Pt={readable:"with month",returnType:"OTHER"},Nt={readable:"with year",returnType:"OTHER"},Bt={readable:"with first day of next year",returnType:"OTHER"},It={readable:"with last day of last year",returnType:"OTHER"},At={readable:"month of",returnType:"OTHER"},Ft={readable:"year of",returnType:"OTHER"},jt={readable:"date of",returnType:"OTHER"},xt={readable:"number of months since",returnType:"OTHER"},_t={readable:"number of months between",returnType:"OTHER"},St={readable:"number of years between",returnType:"OTHER"},qt={readable:"age at",returnType:"OTHER"},Vt={readable:"contains all",returnType:"BOOL"},Ut={readable:"is empty",returnType:"BOOL"},Ct={readable:"is not empty",returnType:"BOOL"},zt={readable:"has size",returnType:"BOOL"},Gt={readable:"has not size",returnType:"BOOL"},Wt={readable:"position of",returnType:"OTHER"},Xt={readable:"tags of",returnType:"OTHER"},kt={readable:"functions",returnType:"OTHER"},Jt={readable:":",returnType:"OTHER"},Kt=function(t){function n(e,n){var r=t.call(this)||this;return r.type="UNARY",r.metadata=e,r.operator=n,r}return e(n,t),Object.defineProperty(n.prototype,"readable",{get:function(){return this.operator===M?this.operator.readable+"("+this.metadata.readable+")":this.metadata.readable+" "+this.operator.readable},enumerable:!0,configurable:!0}),n.prototype.children=function(){return[this.metadata]},n}(y),Qt=function(t){function n(e){var n=t.call(this)||this;return n.type="VALUE",n.readable=JSON.stringify(e),n.value=e,n}return e(n,t),n}(y),Zt=function(t){function n(e){var n=t.call(this)||this;return n.type="ITERABLE",n.values=e,n}return e(n,t),Object.defineProperty(n.prototype,"readable",{get:function(){return"["+this.values.map(function(t){return t.readable}).join(",")+"]"},enumerable:!0,configurable:!0}),n.prototype.children=function(){return this.values},n}(y),$t=function(){function t(t,e,n){this.metadata=t,this.get=function(t,e){if(r("interceptor",e))return e;var n=function(n,r){var a=e(n,r);return r&&r.addGetValue(t,a),a};return n.interceptor=!0,n}(t,e),this.set=n?function(t,e){if(r("interceptor",e))return e;var n=function(n,r,a){return a&&a.addSetValue(t,r),e(n,r,a)};return n.interceptor=!0,n}(t,n):void 0}return t.function=function(e){return new t(e.metadata,e.get,e.set)},t.contextual=function(e,n){return new t(e,n)},t.consumer=function(e,n){return new t(e,function(){return null},n)},t.lift=function(t,e){return new t(new Qt(e),function(){return e})},t.prototype.mapTo=function(t,e,n){var r=this;return new t(new b(this.metadata,Y,new g(n||e.toString())),function(t,n){return e(r.get(t,n))})},t.prototype.hasValue=function(){var t=this;return new ee(new Kt(this.metadata,P),function(e,n){var r=t.get(e,n);return null!=r})},t.prototype.isNullOrUndefined=function(){return this.isNull().or(this.isUndefined())},t.prototype.isDefined=function(){var t=this;return new ee(new Kt(this.metadata,I),function(e,n){return void 0!==t.get(e,n)})},t.prototype.isUndefined=function(){var t=this;return new ee(new Kt(this.metadata,A),function(e,n){return void 0===t.get(e,n)})},t.prototype.isNull=function(){var t=this;return new ee(new Kt(this.metadata,N),function(e,n){return null===t.get(e,n)})},t.prototype.isNotNull=function(){var t=this;return new ee(new Kt(this.metadata,B),function(e,n){return null!==t.get(e,n)})},t.prototype.equals=function(t,e){return t===e},t.prototype.eq=function(e){var n=this;return e instanceof t?new ee(new b(this.metadata,F,e.metadata),function(t,r){return n.equals(n.get(t,r),e.get(t,r))}):new ee(new b(this.metadata,F,new Qt(e)),function(t,r){return n.equals(n.get(t,r),e)})},t.prototype.notEq=function(e){var n=this;return e instanceof t?new ee(new b(this.metadata,j,e.metadata),function(t,r){return!n.equals(n.get(t,r),e.get(t,r))}):new ee(new b(this.metadata,j,new Qt(e)),function(t,r){return!n.equals(n.get(t,r),e)})},t.prototype.matchAll=function(){for(var e=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var a=n.map(function(e){return e instanceof t?e.metadata:new Qt(e)});return new ee(new b(this.metadata,x,new Zt(a)),function(r,a){return n.every(function(n){return n instanceof t?e.get(r,a)===n.get(r,a):e.get(r,a)===n})})},t.prototype.noneMatch=function(){for(var e=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var a=n.map(function(e){return e instanceof t?e.metadata:new Qt(e)});return new ee(new b(this.metadata,_,new Zt(a)),function(r,a){return n.every(function(n){return n instanceof t?e.get(r,a)!==n.get(r,a):e.get(r,a)!==n})})},t.prototype.matchAny=function(){for(var e=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var a=n.map(function(e){return e instanceof t?e.metadata:new Qt(e)});return new ee(new b(this.metadata,S,new Zt(a)),function(r,a){return n.some(function(n){return n instanceof t?e.get(r,a)===n.get(r,a):e.get(r,a)===n})})},t}();function te(t,e,n,r){return e instanceof $t?function(a,u){var i=t.get(a,u);if(null!=i||null!=i){var o=e.get(a,u);return null!=o||null!=o?n(i,o):r}return r}:function(a,u){var i=t.get(a,u);return null!=i||null!=i?n(i,e):r}}var ee=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.boolean=function(t){return new n(t.metadata,t.get,t.set)},n.prototype.not=function(){return new n(new Kt(this.metadata,M),te(this,!1,function(t){return!t},!1))},n.prototype.and=function(t){var e=this;return new n(new b(this.metadata,R,t.metadata),function(n,r){if(r&&r.shortCircuit){var a=e.get(n,r);if(null!=a){if(!a)return!1;var u=t.get(n,r);return a&&null!=u&&u}return!1}return te(e,t,function(t,e){return t&&e},!1)(n,r)})},n.prototype.or=function(t){var e=this;return new n(new b(this.metadata,D,t instanceof n?t.metadata:new Qt(t)),function(r,a){if(a&&a.shortCircuit){var u=e.get(r,a);return null!=u&&(!!u||(t instanceof n?u||t.get(r,a):u||t))}return te(e,t,function(t,e){return t||e},!1)(r,a)})},n}($t),ne=function(t){function n(e,n){var r=t.call(this,n)||this;return r.type="NARY",r.values=e,r}return e(n,t),Object.defineProperty(n.prototype,"readable",{get:function(){return this.values.map(function(t){return t.readable}).join(",")},enumerable:!0,configurable:!0}),n.prototype.children=function(){return this.values},n}(y),re=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.number=function(t){return new n(t.metadata,t.get,t.set)},n.min=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.map(function(t){return t instanceof n?t.metadata:new Qt(t)});return new n(new ne(r,Z),function(e,n){var r=function(t,e){return t<e?t:e};return t.reduce(function(t,a){if(a instanceof $t){var u=a.get(e,n);return null!=u?r(u,t):t}return r(a,t)},Number.MAX_SAFE_INTEGER)})},n.max=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.map(function(t){return t instanceof n?t.metadata:new Qt(t)});return new n(new ne(r,$),function(e,n){var r=function(t,e){return t>e?t:e};return t.reduce(function(t,a){if(a instanceof $t){var u=a.get(e,n);return null!=u?r(u,t):t}return r(a,t)},Number.MIN_SAFE_INTEGER)})},n.sum=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.map(function(t){return t instanceof n?t.metadata:new Qt(t)});return new n(new ne(r,tt),function(e,n){var r=function(t,e){return t+e};return t.reduce(function(t,a){if(a instanceof $t){var u=a.get(e,n);return null!=u?r(u,t):t}return r(a,t)},0)})},n.prototype.lesserThan=function(t){var e=function(t,e){return t<e};return new ee(new b(this.metadata,nt,t instanceof n?t.metadata:new Qt(t)),te(this,t,e,!1))},n.prototype.lesserOrEquals=function(t){var e=function(t,e){return t<=e};return new ee(new b(this.metadata,rt,t instanceof n?t.metadata:new Qt(t)),te(this,t,e,!1))},n.prototype.greaterThan=function(t){var e=function(t,e){return t>e};return new ee(new b(this.metadata,at,t instanceof n?t.metadata:new Qt(t)),te(this,t,e,!1))},n.prototype.greaterOrEquals=function(t){var e=function(t,e){return t>=e};return new ee(new b(this.metadata,ut,t instanceof n?t.metadata:new Qt(t)),te(this,t,e,!1))},n.prototype.between=function(t,e){return this.greaterOrEquals(t).and(this.lesserThan(e))},n.prototype.plus=function(t){var e=function(t,e){return t+e};return new n(new b(this.metadata,it,t instanceof n?t.metadata:new Qt(t)),te(this,t,e,null))},n.prototype.minus=function(t){var e=function(t,e){return t-e};return new n(new b(this.metadata,ot,t instanceof n?t.metadata:new Qt(t)),te(this,t,e,null))},n.prototype.times=function(t){var e=function(t,e){return t*e};return new n(new b(this.metadata,ct,t instanceof n?t.metadata:new Qt(t)),te(this,t,e,null))},n.prototype.divide=function(t){var e=function(t,e){return t/e};return new n(new b(this.metadata,st,t instanceof n?t.metadata:new Qt(t)),te(this,t,e,null))},n}($t),ae=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.iterable=function(t){return new n(t.metadata,t.get,t.set)},n.prototype.contains=function(t){var e=function(t,e){return t.some(function(t){return t===e})};return new ee(new b(this.metadata,q,t instanceof $t?t.metadata:new Qt(t)),te(this,t,e,!1))},n.prototype.containsAll=function(t){var e=function(t,e){return t.some(function(t){return e.some(function(e){return e===t})})};return new ee(new b(this.metadata,Vt,t instanceof $t?t.metadata:new Zt(t.map(function(t){return new Qt(t)}))),te(this,t,e,!1))},n.prototype.isEmpty=function(){return new ee(new Kt(this.metadata,Ut),te(this,void 0,function(t){return 0===t.length},null))},n.prototype.isNotEmpty=function(){return new ee(new Kt(this.metadata,Ct),te(this,void 0,function(t){return 0!==t.length},null))},n.prototype.hasSize=function(t){var e=function(t,e){return t.length===e};return new ee(new Kt(this.metadata,zt),te(this,t,e,null))},n.prototype.hasNotSize=function(t){var e=function(t,e){return t.length!==e};return new ee(new Kt(this.metadata,Gt),te(this,t,e,null))},n.prototype.length=function(){return new re(new Kt(this.metadata,z),te(this,void 0,function(t){return t.length},null))},n}($t),ue=function(){function t(t){var e=this;this.metadata=t,this.get=d.apply(void 0,t.path),this.metadata.siblings&&this.metadata.siblings.length>0?this.set=function(n,r,a){return h.apply(void 0,[e.metadata.siblings.reduce(function(t,e){return h.apply(void 0,[t,r].concat(e))},n),r].concat(t.path))}:this.set=w.apply(void 0,t.path)}return t.field=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new t(new v(e))},t.prototype.withPosition=function(e){return new t(new v(this.metadata.path,this.metadata.tags,e,this.metadata.siblings))},t.prototype.withTags=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new t(new v(this.metadata.path,e,this.metadata.position,this.metadata.siblings))},t.prototype.withSiblings=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new t(new v(this.metadata.path,this.metadata.tags,this.metadata.position,e))},t.prototype.position=function(){var t=this;return new re(new Kt(this.metadata,Wt),function(){return t.metadata.position})},t.prototype.tags=function(){var t=this;return new ae(new Kt(this.metadata,Xt),function(){return t.metadata.tags})},t}(),ie=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.string=function(t){return new n(t.metadata,t.get,t.set)},n.prototype.contains=function(t){var e=function(t,e){return t.includes(e)};return new ee(new b(this.metadata,q,t instanceof n?t.metadata:new Qt(t)),te(this,t,e,!1))},n.prototype.matches=function(t){var e=function(t,e){return new RegExp(e).test(t)};return new ee(new b(this.metadata,V,t instanceof n?t.metadata:new Qt(t)),te(this,t,e,!1))},n.prototype.startsWith=function(t){var e=function(t,e){return t.startsWith(e)};return new ee(new b(this.metadata,U,t instanceof n?t.metadata:new Qt(t)),te(this,t,e,!1))},n.prototype.endsWith=function(t){var e=function(t,e){return t.endsWith(e)};return new ee(new b(this.metadata,C,t instanceof n?t.metadata:new Qt(t)),te(this,t,e,!1))},n.prototype.length=function(){return new re(new Kt(this.metadata,z),te(this,void 0,function(t){return t.length},0))},n.prototype.parseInt=function(){return new re(new Kt(this.metadata,G),te(this,void 0,function(t){return parseInt(t)},null))},n.prototype.trim=function(){return new n(new Kt(this.metadata,W),te(this,void 0,function(t){return t.trim()},null))},n.prototype.replaceAll=function(t,e){return new n(new b(this.metadata,K,new b(new Qt(t),R,new Qt(e))),te(this,void 0,function(n){return n.replace(t,e)},null))},n.prototype.substring=function(t,e){return new n(new b(this.metadata,Q,new b(new Qt(t),R,new Qt(e))),te(this,void 0,function(n){return n.substring(t,e)},null))},n.prototype.localeUpperCase=function(){return new n(new Kt(this.metadata,X),te(this,void 0,function(t){return t.toLocaleUpperCase()},null))},n.prototype.localeLowerCase=function(){return new n(new Kt(this.metadata,k),te(this,void 0,function(t){return t.toLocaleLowerCase()},null))},n.prototype.concat=function(t){return new n(new b(this.metadata,J,t instanceof n?t.metadata:new Qt(t)),te(this,t,function(t,e){return t+e},null))},n}($t),oe=function(t){function n(e,n,r){var a=t.call(this)||this;return a.type="CONDITIONAL_MAPPING",a.whenMetadata=e,a.thenMetadata=n,a.elseMetadata=r,a}return e(n,t),n.prototype.children=function(){var t=[this.whenMetadata,this.thenMetadata];return null!=this.elseMetadata?t.concat(this.elseMetadata):t},Object.defineProperty(n.prototype,"readable",{get:function(){return this.whenMetadata.readable+" "+H.readable+" "+this.thenMetadata.readable+(null!=this.elseMetadata?" "+L.readable+" "+this.elseMetadata.readable:"")},enumerable:!0,configurable:!0}),n}(y),ce=function(){function t(t){this.type="WHEN",this.metadata=t,this.operator=T}return Object.defineProperty(t.prototype,"readable",{get:function(){return this.operator.readable+" "+this.metadata.readable},enumerable:!0,configurable:!0}),t.prototype.children=function(){return[this.metadata]},t}(),se=function(t){function n(e,n){var r=t.call(this,n)||this;return r.type="MULTIPLE_MAPPING",r.mappings=e,r}return e(n,t),Object.defineProperty(n.prototype,"readable",{get:function(){return this.mappings.map(function(t){return t.readable}).join(" , ")},enumerable:!0,configurable:!0}),n.prototype.children=function(){return this.mappings},n}(y),fe=function(){function t(t){void 0===t&&(t=!0),this.props={},this.getValues=[],this.setValues=[],this.shortCircuit=t}return t.prototype.addGetValue=function(t,e){this.getValues.push({metadata:t,value:e})},t.prototype.addSetValue=function(t,e){this.setValues.push({metadata:t,value:e})},t}(),le=function(){function t(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this.condition=t,this.mappings=e;var r=e.map(function(t){return t.metadata});this.metadata=new oe(new ce(t.metadata),new se(r,H))}return t.prototype.execute=function(t,e){var n=e||new fe;return this.condition.get(t,e)?this.mappings.reduce(function(t,e){return e.execute(t,n)},t):this.elseMappings?this.elseMappings.reduce(function(t,e){return e.execute(t,n)},t):t},t.prototype.executeOn=function(t,e,n){var r=n||new fe;return this.condition.get(t,n)?(this.mappings.forEach(function(n){e=n.executeOn(t,e,r)}),e):this.elseMappings?(this.elseMappings.forEach(function(n){e=n.executeOn(t,e,r)}),e):e},t.prototype.otherwise=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.elseMappings=t;var n=t.map(function(t){return t.metadata});return this.metadata=new oe(this.metadata.whenMetadata,this.metadata.thenMetadata,new se(n,L)),this},t}(),pe=function(t,e){this.value=t,this.context=e},he=function(t){function n(e){var n=t.call(this,E)||this;return n.type="VALIDATION",n.when=e,n}return e(n,t),Object.defineProperty(n.prototype,"readable",{get:function(){return this.operator.readable+" "+this.when.readable},enumerable:!0,configurable:!0}),n.prototype.children=function(){return[this.when]},n}(y),de=function(){function t(t){this.when=t,this.metadata=new he(t.metadata)}return t.prototype.execute=function(t,e){void 0===t&&(t={});var n=e||new fe;return new pe(this.when.condition.get(t,n),n)},t}(),we=function(){function t(t){this.condition=t,this.metadata=new ce(t.metadata)}return t.prototype.validate=function(){return new de(this)},t.prototype.then=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new(le.bind.apply(le,[void 0,this.condition].concat(t)))},t}(),me=function(t){function n(e,n){var r=t.call(this,O)||this;return r.type="SINGLE_MAPPING",r.sourceMetadata=e,r.targetMetadata=n,r}return e(n,t),Object.defineProperty(n.prototype,"readable",{get:function(){return this.sourceMetadata.readable+" "+ft.readable+" "+this.targetMetadata.readable},enumerable:!0,configurable:!0}),n.prototype.children=function(){return[this.sourceMetadata,this.targetMetadata]},n}(y),ye=function(){function t(t,e){this.input=t,this.output=e,this.metadata=new me(t.metadata,e.metadata)}return t.prototype.execute=function(t,e){var n=e||new fe;return this.output.set?this.output.set(t,this.input.get(t,n),n):t},t.prototype.executeOn=function(t,e,n){var r=n||new fe;return this.output.set?this.output.set(e,this.input.get(t,r),r):e},t}(),ve=function(t){function n(e,n){var r=t.call(this,new b(e.metadata,lt,n.metadata),function(t,r){return n.convert(t,e,r)})||this;return r.input=e,r.converter=n,r}return e(n,t),n.prototype.using=function(t){return new n(this,t)},n.prototype.to=function(t){return new ye(this,t)},n}($t),ge=function(){function t(t){this.input=t}return t.prototype.to=function(t){return new ye(this.input,t)},t.prototype.using=function(t){return new ve(this.input,t)},t}(),be=function(){function t(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.mappings=i(e,function(e){return e instanceof t?e.mappings:[e]}),this.metadata=new se(this.mappings.map(function(t){return t.metadata}))}return t.prototype.execute=function(t,e){var n=e||new fe;return this.mappings.reduce(function(t,e){return e.execute(t,n)},t)},t.prototype.executeOn=function(t,e,n){var r=n||new fe;return this.mappings.forEach(function(n){e=n.executeOn(t,e,r)}),e},t}(),Oe=function(t,e,n){this.type="TYPE_CONVERTER",this.operator=n,this.body=t,this.readable=null!=e?e:t},Te=function(t,e){this.convert=t,this.metadata=new Oe(t.toString(),e)},Ee=function(t){function n(e,n,r){var a=t.call(this,new b(new b(e.metadata,R,n.metadata),lt,r.metadata),function(t,a){return r.convert(t,e,n,a)})||this;return a.input=e,a.input2=n,a.converter=r,a}return e(n,t),n.prototype.using=function(t){return new ve(this,t)},n.prototype.to=function(t){return new ye(this,t)},n}($t),Me=function(){function t(t,e){this.input=t,this.input2=e}return t.prototype.using=function(t){return new Ee(this.input,this.input2,t instanceof Te?t:new Te(t))},t}(),Re=function(t,e){this.convert=t,this.metadata=new Oe(t.toString(),e)},De=function(t){function n(e,n){var r=t.call(this,new b(new ne(e.map(function(t){return t.metadata}),pt),lt,n.metadata),function(t,r){return n.convert(t,e,r)})||this;return r.inputs=e,r.converter=n,r}return e(n,t),n.prototype.using=function(t){return new ve(this,t)},n.prototype.to=function(t){return new ye(this,t)},n}($t),He=function(){function t(t){this.inputs=t}return t.prototype.using=function(t){return new De(this.inputs,t instanceof Re?t:new Re(t))},t}();function Le(t,e){for(t=String(t),e=e||2;t.length<e;)t="0"+t;return t}function Ye(){return new Date(Date.now())}function Pe(t){return new Date(t.valueOf())}function Ne(t,e,n,r,a,u,i){return new Date(Date.UTC(t,e,n||0,r||0,a||0,u||0,i||0))}function Be(t){var e=Pe(t);return e.getFullYear().toString()+Le(e.getMonth()+1,2)+Le(e.getDate(),2)}function Ie(t){var e=Pe(t);return Le(e.getDate(),2)+Le(e.getMonth()+1,2)+e.getFullYear()}function Ae(t){var e=Number.parseInt(t.slice(0,4)),n=Number.parseInt(t.slice(4,6))-1,r=Number.parseInt(t.slice(6,8));return new Date(e,n,r)}function Fe(t,e){var n=e||Ye(),r=12*(n.getFullYear()-t.getFullYear())+(n.getMonth()-t.getMonth());return n.getDate()-t.getDate()>=0?r:r-1}function je(t,e){var n=e.getFullYear()-t.getFullYear(),r=e.getMonth()-t.getMonth(),a=e.getDate()-t.getDate();return r>=0&&a>=0?n:n-1}var xe=Object.freeze({now:Ye,clone:Pe,newUTCDate:Ne,formatYYYYMMdd:Be,formatddMMYYYY:Ie,formatReadable:function(t){var e=Pe(t);return Le(e.getDate(),2)+"/"+Le(e.getMonth()+1,2)+"/"+e.getFullYear()},formatMMMMYYYY:function(t,e){var n=Pe(t);return new Intl.DateTimeFormat(e,{month:"long"}).format(t)+" "+n.getFullYear()},formatEEEEddMMMM:function(t,e){var n=Pe(t),r=new Intl.DateTimeFormat(e,{weekday:"long"}).format(n),a=new Intl.DateTimeFormat(e,{month:"long"}).format(n);return r+" "+Le(n.getDate(),2)+" "+a},formatTime:function(t){var e=Pe(t);return Le(t.getHours(),2)+Le(e.getMinutes(),2)+Le(t.getSeconds(),2)},parse:Ae,numberOfFullMonthsBetween:Fe,numberOfFullYearsBetween:je}),_e=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.equals=function(e,n){return e&&n?e.getTime()===n.getTime():t.prototype.equals.call(this,e,n)},n.date=function(t){return new n(t.metadata,t.get,t.set)},n.dateIso=function(t){return new n(t.metadata,function(e,n){var r=t.get(e,n);return u(r)?r:Ae(r)},function(e,n,r){return u(n)?t.set?t.set(e,n,r):e:t.set?t.set(e,Be(n),r):e})},n.min=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.map(function(t){return t instanceof n?t.metadata:new Qt(t)});return new n(new ne(r,Z),function(e,r){var a=function(t,e){return t<e?t:e};return t.reduce(function(t,n){if(n instanceof $t){var u=n.get(e,r);return null!=u?a(u,t):t}return a(n,t)},n.MAX_DATE)})},n.max=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.map(function(t){return t instanceof n?t.metadata:new Qt(t)});return new n(new ne(r,$),function(e,r){var a=function(t,e){return t>e?t:e};return t.reduce(function(t,n){if(n instanceof $t){var u=n.get(e,r);return null!=u?a(u,t):t}return a(n,t)},n.MIN_DATE)})},n.thisYear=function(){return new re(new g("clone().getFullYear()",void 0,Rt),function(){return Ye().getFullYear()})},n.thisMonth=function(){return new re(new g("clone().getMonth() + 1",void 0,Dt),function(){return Ye().getMonth()+1})},n.today=function(){return new n(new g("clone()",void 0,Ht),function(){return Ye()})},n.tomorrow=function(){return new n(new g("date.setDate(date.getDate() + 1)",void 0,Lt),function(){var t=Ye();return t.setDate(t.getDate()+1),t})},n.dateFrom=function(t){return new n(new g("Date{"+t+"}"),function(){return Ae(t)})},n.newDate=function(t,e,r){return new n(new g("Date{ Y:"+t+" M:"+e+" D:"+r+" }"),function(){return Ne(t,e,r)})},n.newLocalDate=function(t,e,r){return new n(new g("Date{ Y:"+t+" M:"+e+" D:"+r+" }"),function(){return new Date(t,e,r)})},n.prototype.before=function(t){var e=function(t,e){return t<e};return new ee(new b(this.metadata,wt,t instanceof n?t.metadata:new Qt(t)),te(this,t,e,!1))},n.prototype.beforeOrEquals=function(t){var e=function(t,e){return t<=e};return new ee(new b(this.metadata,mt,t instanceof n?t.metadata:new Qt(t)),te(this,t,e,!1))},n.prototype.after=function(t){var e=function(t,e){return t>e};return new ee(new b(this.metadata,ht,t instanceof n?t.metadata:new Qt(t)),te(this,t,e,!1))},n.prototype.afterOrEquals=function(t){var e=function(t,e){return t>=e};return new ee(new b(this.metadata,dt,t instanceof n?t.metadata:new Qt(t)),te(this,t,e,!1))},n.prototype.between=function(t,e){return this.afterOrEquals(t).and(this.before(e))},n.prototype.plusDays=function(t){var e=function(t,e){var n=Pe(t);return n.setDate(t.getDate()+e),n};return new n(new b(this.metadata,yt,t instanceof re?t.metadata:new Qt(t)),te(this,t,e,null))},n.prototype.minusDays=function(t){var e=function(t,e){var n=Pe(t);return n.setDate(n.getDate()-e),n};return new n(new b(this.metadata,vt,t instanceof re?t.metadata:new Qt(t)),te(this,t,e,null))},n.prototype.plusMonths=function(t){var e=function(t,e){var n=Pe(t);return n.setMonth(n.getMonth()+e),n};return new n(new b(this.metadata,gt,t instanceof re?t.metadata:new Qt(t)),te(this,t,e,null))},n.prototype.minusMonths=function(t){var e=function(t,e){var n=Pe(t);return n.setMonth(n.getMonth()-e),n};return new n(new b(this.metadata,bt,t instanceof re?t.metadata:new Qt(t)),te(this,t,e,null))},n.prototype.plusYears=function(t){var e=function(t,e){var n=Pe(t);return n.setFullYear(n.getFullYear()+e),n};return new n(new b(this.metadata,Ot,t instanceof re?t.metadata:new Qt(t)),te(this,t,e,null))},n.prototype.minusYears=function(t){var e=function(t,e){var n=Pe(t);return n.setFullYear(n.getFullYear()-e),n};return new n(new b(this.metadata,Tt,t instanceof re?t.metadata:new Qt(t)),te(this,t,e,null))},n.prototype.formatISO=function(){return new ie(new Kt(this.metadata,Et),te(this,void 0,function(t){return Be(t)},null))},n.prototype.dayMonthYear=function(){return new ie(new Kt(this.metadata,Mt),te(this,void 0,function(t){return Ie(t)},null))},n.nbFullMonthsSince=function(t){return new re(new Kt(t.metadata,xt),te(t,void 0,function(t){return Fe(t)},null))},n.nbFullMonthsBetween=function(t,e){return e instanceof n?new re(new ne([t.metadata,e.metadata],_t),te(t,e,function(t,e){return Fe(t,e)},null)):new re(new ne([t.metadata,new Qt(e)],_t),te(t,e,Fe,null))},n.nbFullYearsBetween=function(t,e){return new re(new ne(e instanceof n?[t.metadata,e.metadata]:[t.metadata,new Qt(e)],St),te(t,e,je,null))},n.prototype.withDayOfMonth=function(t){var e=function(t,e){var n=Pe(t);return n.setDate(e),n};return new n(new b(this.metadata,Yt,new Qt(t)),te(this,t,e,null))},n.prototype.withMonth=function(t){var e=function(t,e){var n=Pe(t);return n.setMonth(e),n};return new n(new b(this.metadata,Pt,new Qt(t)),te(this,t,e,null))},n.prototype.withYear=function(t){var e=function(t,e){var n=Pe(t);return n.setFullYear(e),n};return new n(new b(this.metadata,Nt,new Qt(t)),te(this,t,e,null))},n.prototype.withFirstDayOfNextYear=function(){return new n(new Kt(this.metadata,Bt),te(this,void 0,function(t){var e=Pe(t);return e.setMonth(11),e.setDate(32),e},null))},n.prototype.withLastDayOfLastYear=function(){return new n(new Kt(this.metadata,It),te(this,void 0,function(t){var e=Pe(t);return e.setMonth(0),e.setDate(0),e},null))},n.prototype.monthOf=function(){return new re(new Kt(this.metadata,At),te(this,void 0,function(t){return t.getMonth()},null))},n.prototype.yearOf=function(){return new re(new Kt(this.metadata,Ft),te(this,void 0,function(t){return t.getFullYear()},null))},n.prototype.dateOf=function(){return new re(new Kt(this.metadata,jt),te(this,void 0,function(t){return t.getDate()},null))},n.prototype.ageAt=function(t){return new re(new b(this.metadata,qt,t instanceof n?t.metadata:new Qt(t)),te(this,t,je,null))},n.MAX_DATE=new Date(864e13),n.MIN_DATE=new Date(-864e13),n}($t),Se=function(t,e){this.convert=t,this.metadata=new Oe(t.toString(),e)};var qe=Object.freeze({fieldsOf:function t(e){var n=e;return"FIELD"==n.type?[n.path]:e.children?e.children().reduce(function(e,n){return e.concat(t(n))},[]):[]}}),Ve=function(t){function n(e,n){var r=t.call(this,n)||this;return r.type="MULTIPLE_VALIDATIONS",r.mappings=e,r}return e(n,t),Object.defineProperty(n.prototype,"readable",{get:function(){return this.mappings.map(function(t){return t.readable}).join(" , ")},enumerable:!0,configurable:!0}),n.prototype.children=function(){return this.mappings},n}(y),Ue=function(){function t(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.validations=i(e,function(e){return e instanceof t?e.validations:[e]}),this.metadata=new Ve(this.validations.map(function(t){return t.metadata}))}return t.prototype.execute=function(t,e){var n=e||new fe;return this.validations.map(function(e){return e.execute(t,n)}).find(function(t){return!0===t.value})||new pe(!1,n)},t}();function Ce(t){return $t.function(t)}function ze(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ue.field.apply(ue,t)}function Ge(t,e){return $t.lift(t,e)}function We(t){return ae.iterable(t)}function Xe(t){return ee.boolean(t)}function ke(t){return ie.string(t)}function Je(t){return re.number(t)}function Ke(t){return _e.date(t)}function Qe(t){return _e.dateIso(t)}function Ze(t){return new we(t)}function $e(t,e){return e?new Me(t instanceof $t?t:new $t(new Qt(t),function(e){return t}),e instanceof $t?e:new $t(new Qt(e),function(t){return e})):new ge(t instanceof $t?t:new $t(new Qt(t),function(e){return t}))}function tn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1==t.length?new ye(new $t(new Qt(null),function(t){return null}),t[0]):new ye(new $t(new Qt(null),function(t){return null}),$t.consumer(new ne(t.map(function(t){return t.metadata}),kt),function(e,n,r){for(var a=0,u=t;a<u.length;a++){var i=u[a];e=i.set?i.set(e,n,r):e}return e}))}function en(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new He(t)}function nn(t,e){return new Se(t,e)}function rn(t,e){return new Te(t,e)}function an(t,e){return new Re(t,e)}function un(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new(be.bind.apply(be,[void 0].concat(t)))}function on(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new(Ue.bind.apply(Ue,[void 0].concat(t)))}function cn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new ee(new ne(t.map(function(t){return t.metadata}),S),function(e,n){return t.some(function(t){var r=t.get(e,n);return null!=r&&r})})}function sn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new ee(new ne(t.map(function(t){return t.metadata}),x),function(e,n){return t.every(function(t){var r=t.get(e,n);return null!=r&&r})})}function fn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new ee(new ne(t.map(function(t){return t.metadata}),_),function(e,n){return t.every(function(t){var r=t.get(e,n);return null!=r&&!r})})}function ln(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new re(new ne(t.map(function(t){return t.metadata}),et),function(e,n){return t.filter(function(t){var r=t.get(e,n);return null!=r&&r}).length})}function pn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new re(new ne(t.map(function(t){return t.metadata}),tt),function(e,n){return t.reduce(function(t,r){var a=r.get(e,n);return null!=a?t+a:t},0)})}function hn(t){return new ae(new Kt(t.metadata,Xt),function(){return t.metadata instanceof v?t.metadata.tags:[]})}function dn(t){return new re(new Kt(t.metadata,Wt),function(){return t.metadata instanceof v?t.metadata.position:void 0})}export{ht as AFTER,dt as AFTER_OR_EQUALS,qt as AGE_AT,R as AND,G as AS_INT,y as AbstractMetadata,wt as BEFORE,mt as BEFORE_OR_EQUALS,Te as BiTypeConverter,b as BinaryMetadata,ee as BooleanFunction,J as CONCAT,q as CONTAINS,Vt as CONTAINS_ALL,et as COUNT,oe as ConditionalMappingMetadata,jt as DATE_OF,st as DIVIDE,_e as DateFunction,xe as DateUtils,fe as DefaultContext,L as ELSE,C as ENDS_WITH,F as EQ,Jt as FIELD_PROP,Mt as FORMAT_DAY_MONTH_YEAR,Et as FORMAT_ISO,Y as FUNCTION,kt as FUNCTIONS,ue as Field,v as FieldMetadata,$t as Function,g as FunctionMetadata,ut as GREATER_OR_EQUALS,at as GREATER_THAN,Gt as HAS_NOT_SIZE,zt as HAS_SIZE,P as HAS_VALUE,I as IS_DEFINED,Ut as IS_EMPTY,Ct as IS_NOT_EMPTY,B as IS_NOT_NULL,N as IS_NULL,A as IS_UNDEFINED,ae as IterableFunction,Zt as IterableMetadata,z as LENGTH,rt as LESSER_OR_EQUALS,nt as LESSER_THAN,k as LOWER_CASE,V as MATCHES,x as MATCH_ALL,S as MATCH_ANY,$ as MAX,Z as MIN,ot as MINUS,vt as MINUS_DAYS,bt as MINUS_MONTHS,Tt as MINUS_YEARS,At as MONTH_OF,pt as MULTIPLE_INPUTS,qe as MetadataUtils,se as MultipleMappingsMetadata,Ve as MultipleValidationsMetadata,_t as NB_OF_MONTHS_BETWEEN,xt as NB_OF_MONTHS_SINCE,St as NB_OF_YEARS_BETWEEN,_ as NONE_MATCH,M as NOT,j as NOT_EQ,ne as NaryMetadata,Re as NaryTypeConverter,re as NumberFunction,D as OR,it as PLUS,yt as PLUS_DAYS,gt as PLUS_MONTHS,Ot as PLUS_YEARS,Wt as POSITION,m as Paths,K as REPLACE_ALL,pe as Result,O as SINGLE_MAPPING,U as STARTS_WITH,Q as SUB_STRING,tt as SUM,me as SingleMappingMetadata,de as SingleValidationRule,we as StepWhen,ie as StringFunction,Xt as TAGS,H as THEN,Dt as THIS_MONTH,Rt as THIS_YEAR,ct as TIMES,ft as TO,Ht as TODAY,Lt as TOMORROW,W as TRIM,Se as TypeConverter,Oe as TypeConverterMetadata,X as UPPER_CASE,lt as USING,Kt as UnaryMetadata,o as Utils,E as VALIDATE,he as ValidationRuleMetadata,Ue as Validations,Qt as ValueMetadata,T as WHEN,Yt as WITH_DAY_OF_MONTH,Bt as WITH_FIRST_DAY_OF_NEXT_YEAR,It as WITH_LAST_DAY_OF_LAST_YEAR,Pt as WITH_MONTH,Nt as WITH_YEAR,ce as WhenMetadata,Ft as YEAR_OF,rn as biConverter,Xe as boolean,te as condition,nn as converter,ln as count,Ke as date,Qe as dateIso,Ce as f,ze as field,We as iterable,Ge as lift,$e as map,en as mapAll,tn as mapNull,un as mappings,sn as matchAll,cn as matchAny,fn as matchNone,an as naryConverter,Je as number,dn as position,ke as string,pn as sum,hn as tags,on as validations,Ze as when}; | ||
//# sourceMappingURL=doov.es.js.map |
@@ -1,2 +0,2 @@ | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t=t||self).DOOV={})}(this,function(t){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,e)};function e(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var r=function(){return(r=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var a in n=arguments[e])Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a]);return t}).apply(this,arguments)};function a(t,n){return Object.prototype.hasOwnProperty.call(n,t)}function i(t){return Number.isInteger(t)||t<<0===t}function u(t){return null==t}function o(t,n){return void 0===n&&(n=function(t){return Array.isArray(t)?t.slice():[t]}),t.reduce(function(t,e){return t.concat(n(e))},[])}var c=Object.freeze({hasProperty:a,isInteger:i,nullOrUndefined:u,flatMap:o});function s(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.join(".")}function f(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return n.reduce(function(t,n){return t&&void 0!==t[n]?t[n]:void 0},t)}function l(t,n,e){var a=r({},e);return a[t]=n,a}function d(t,n,e){return n.then(function(n){var a=r({},e);return a[t]=n,a})}function h(t,n){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];var u=e[0];if(e.length>1){var o=null!=t&&a(u,t)?t[u]:i(e[1])?[]:{};n=h.apply(void 0,[o,n].concat(Array.prototype.slice.call(e,1)))}return d(u,n,t)}function p(t,n){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];var u=e[0];if(e.length>1){var o=null!=t&&a(u,t)?t[u]:i(e[1])?[]:{};n=p.apply(void 0,[o,n].concat(Array.prototype.slice.call(e,1)))}return l(u,n,t)}var w=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n){return f.apply(void 0,[n].concat(t))}},m=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n,e){return p.apply(void 0,[n,e].concat(t))}},v=Object.freeze({path:function(t){return t.split(".").map(function(t){var n=parseInt(t);return isNaN(n)?t:n})},pathString:s,getPath:f,getPathPromise:function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return n.reduce(function(t,n){return t.then(function(t){return new Promise(function(e,r){t&&void 0!==t[n]?e(t[n]):r(void 0)})})},Promise.resolve(t))},setProp:l,setPropPromise:d,setPathPromise:h,setPathPromiseValue:function(t,n){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];return h.apply(void 0,[t,Promise.resolve(n)].concat(e))},setPath:p,getter:w,setter:m}),g=function(t){this.operator=t},y=function(t){function n(n,e,r,a){void 0===e&&(e=[]),void 0===r&&(r=-1),void 0===a&&(a=[]);var u=t.call(this)||this;u.type="FIELD",u.readable=s.apply(void 0,n),u.path=n.slice(),u.tags=e;var o=n.filter(function(t){return i(t)});return u.position=-1===r&&o.length>=1?o[o.length-1]:r,u.siblings=a.slice(),u}return e(n,t),n}(g);var b=function(t,n,e){this.type="FUNCTION",this.operator=e,this.body=t,this.readable=null!=n?n:t},M=function(t){function n(n,e,r){var a=t.call(this,e)||this;return a.type="BINARY",a.left=n,a.right=r,a}return e(n,t),Object.defineProperty(n.prototype,"readable",{get:function(){return this.left.readable+" "+this.operator.readable+" "+this.right.readable},enumerable:!0,configurable:!0}),n.prototype.children=function(){return[this.left,this.right]},n}(g),D={readable:"single_mapping"},O={readable:"when"},Y={readable:"validate"},N={readable:"not"},P={readable:"and"},F={readable:"or"},E={readable:"then"},I={readable:"else"},A={readable:"function"},T={readable:"has value"},x={readable:"is null"},j={readable:"is not null"},S={readable:"is defined"},_={readable:"is undefined"},C={readable:"="},V={readable:"!="},L={readable:"match all"},U={readable:"none match"},q={readable:"match any"},R={readable:"contains"},B={readable:"matches"},z={readable:"starts with"},G={readable:"ends with"},W={readable:"length"},X={readable:"as integer"},H={readable:"trimmed"},k={readable:"upper case"},J={readable:"lower case"},K={readable:"concat"},Q={readable:"replace all"},Z={readable:"sub string"},$={readable:"min"},tt={readable:"max"},nt={readable:"sum"},et={readable:"count"},rt={readable:"<"},at={readable:"<="},it={readable:">"},ut={readable:">="},ot={readable:"+"},ct={readable:"-"},st={readable:"*"},ft={readable:"/"},lt="->",dt={readable:"using"},ht={readable:"multiple inputs"},pt={readable:">"},wt={readable:">="},mt={readable:"<"},vt={readable:"<="},gt={readable:"plus days"},yt={readable:"minus days"},bt={readable:"plus months"},Mt={readable:"minus months"},Dt={readable:"plus years"},Ot={readable:"minus years"},Yt={readable:"format iso"},Nt={readable:"format day month year"},Pt={readable:"this year"},Ft={readable:"this month"},Et={readable:"today"},It={readable:"tomorrow"},At={readable:"with day of month"},Tt={readable:"with month"},xt={readable:"with year"},jt={readable:"with first day of next year"},St={readable:"with last day of last year"},_t={readable:"month of"},Ct={readable:"year of"},Vt={readable:"date of"},Lt={readable:"number of months since"},Ut={readable:"number of months between"},qt={readable:"number of years between"},Rt={readable:"age at"},Bt={readable:"contains all"},zt={readable:"is empty"},Gt={readable:"is not empty"},Wt={readable:"has size"},Xt={readable:"has not size"},Ht={readable:"position of"},kt={readable:"tags of"},Jt={readable:"functions"},Kt=function(t){function n(n,e){var r=t.call(this)||this;return r.type="UNARY",r.metadata=n,r.operator=e,r}return e(n,t),Object.defineProperty(n.prototype,"readable",{get:function(){return this.operator===N?this.operator.readable+"("+this.metadata.readable+")":this.metadata.readable+" "+this.operator.readable},enumerable:!0,configurable:!0}),n.prototype.children=function(){return[this.metadata]},n}(g),Qt=function(t){function n(n){var e=t.call(this)||this;return e.type="VALUE",e.readable=JSON.stringify(n),e.value=n,e}return e(n,t),n}(g),Zt=function(t){function n(n){var e=t.call(this)||this;return e.type="ITERABLE",e.values=n,e}return e(n,t),Object.defineProperty(n.prototype,"readable",{get:function(){return"["+this.values.map(function(t){return t.readable}).join(",")+"]"},enumerable:!0,configurable:!0}),n.prototype.children=function(){return this.values},n}(g),$t=function(){function t(t,n,e){this.metadata=t,this.get=function(t,n){if(a("interceptor",n))return n;var e=function(e,r){var a=n(e,r);return r&&r.addGetValue(t,a),a};return e.interceptor=!0,e}(t,n),this.set=e?function(t,n){if(a("interceptor",n))return n;var e=function(e,r,a){return a&&a.addSetValue(t,r),n(e,r,a)};return e.interceptor=!0,e}(t,e):void 0}return t.function=function(n){return new t(n.metadata,n.get,n.set)},t.contextual=function(n,e){return new t(n,e)},t.consumer=function(n,e){return new t(n,function(){return null},e)},t.lift=function(t,n){return new t(new Qt(n),function(){return n})},t.prototype.mapTo=function(t,n,e){var r=this;return new t(new M(this.metadata,A,new b(e||n.toString())),function(t,e){return n(r.get(t,e))})},t.prototype.hasValue=function(){var t=this;return new nn(new Kt(this.metadata,T),function(n,e){var r=t.get(n,e);return null!=r})},t.prototype.isNullOrUndefined=function(){return this.isNull().or(this.isUndefined())},t.prototype.isDefined=function(){var t=this;return new nn(new Kt(this.metadata,S),function(n,e){return void 0!==t.get(n,e)})},t.prototype.isUndefined=function(){var t=this;return new nn(new Kt(this.metadata,_),function(n,e){return void 0===t.get(n,e)})},t.prototype.isNull=function(){var t=this;return new nn(new Kt(this.metadata,x),function(n,e){return null===t.get(n,e)})},t.prototype.isNotNull=function(){var t=this;return new nn(new Kt(this.metadata,j),function(n,e){return null!==t.get(n,e)})},t.prototype.equals=function(t,n){return t===n},t.prototype.eq=function(n){var e=this;return n instanceof t?new nn(new M(this.metadata,C,n.metadata),function(t,r){return e.equals(e.get(t,r),n.get(t,r))}):new nn(new M(this.metadata,C,new Qt(n)),function(t,r){return e.equals(e.get(t,r),n)})},t.prototype.notEq=function(n){var e=this;return n instanceof t?new nn(new M(this.metadata,V,n.metadata),function(t,r){return!e.equals(e.get(t,r),n.get(t,r))}):new nn(new M(this.metadata,V,new Qt(n)),function(t,r){return!e.equals(e.get(t,r),n)})},t.prototype.matchAll=function(){for(var n=this,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var a=e.map(function(n){return n instanceof t?n.metadata:new Qt(n)});return new nn(new M(this.metadata,L,new Zt(a)),function(r,a){return e.every(function(e){return e instanceof t?n.get(r,a)===e.get(r,a):n.get(r,a)===e})})},t.prototype.noneMatch=function(){for(var n=this,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var a=e.map(function(n){return n instanceof t?n.metadata:new Qt(n)});return new nn(new M(this.metadata,U,new Zt(a)),function(r,a){return e.every(function(e){return e instanceof t?n.get(r,a)!==e.get(r,a):n.get(r,a)!==e})})},t.prototype.matchAny=function(){for(var n=this,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var a=e.map(function(n){return n instanceof t?n.metadata:new Qt(n)});return new nn(new M(this.metadata,q,new Zt(a)),function(r,a){return e.some(function(e){return e instanceof t?n.get(r,a)===e.get(r,a):n.get(r,a)===e})})},t}();function tn(t,n,e,r){return n instanceof $t?function(a,i){var u=t.get(a,i);if(null!=u||null!=u){var o=n.get(a,i);return null!=o||null!=o?e(u,o):r}return r}:function(a,i){var u=t.get(a,i);return null!=u||null!=u?e(u,n):r}}var nn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.boolean=function(t){return new n(t.metadata,t.get,t.set)},n.prototype.not=function(){return new n(new Kt(this.metadata,N),tn(this,!1,function(t){return!t},!1))},n.prototype.and=function(t){var e=this;return new n(new M(this.metadata,P,t.metadata),function(n,r){if(r&&r.shortCircuit){var a=e.get(n,r);if(null!=a){if(!a)return!1;var i=t.get(n,r);return a&&null!=i&&i}return!1}return tn(e,t,function(t,n){return t&&n},!1)(n,r)})},n.prototype.or=function(t){var e=this;return new n(new M(this.metadata,F,t instanceof n?t.metadata:new Qt(t)),function(r,a){if(a&&a.shortCircuit){var i=e.get(r,a);return null!=i&&(!!i||(t instanceof n?i||t.get(r,a):i||t))}return tn(e,t,function(t,n){return t||n},!1)(r,a)})},n}($t),en=function(t){function n(n,e){var r=t.call(this,e)||this;return r.type="NARY",r.values=n,r}return e(n,t),Object.defineProperty(n.prototype,"readable",{get:function(){return this.values.map(function(t){return t.readable}).join(",")},enumerable:!0,configurable:!0}),n.prototype.children=function(){return this.values},n}(g),rn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.number=function(t){return new n(t.metadata,t.get,t.set)},n.min=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.map(function(t){return t instanceof n?t.metadata:new Qt(t)});return new n(new en(r,$),function(n,e){var r=function(t,n){return t<n?t:n};return t.reduce(function(t,a){if(a instanceof $t){var i=a.get(n,e);return null!=i?r(i,t):t}return r(a,t)},Number.MAX_SAFE_INTEGER)})},n.max=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.map(function(t){return t instanceof n?t.metadata:new Qt(t)});return new n(new en(r,tt),function(n,e){var r=function(t,n){return t>n?t:n};return t.reduce(function(t,a){if(a instanceof $t){var i=a.get(n,e);return null!=i?r(i,t):t}return r(a,t)},Number.MIN_SAFE_INTEGER)})},n.sum=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.map(function(t){return t instanceof n?t.metadata:new Qt(t)});return new n(new en(r,nt),function(n,e){var r=function(t,n){return t+n};return t.reduce(function(t,a){if(a instanceof $t){var i=a.get(n,e);return null!=i?r(i,t):t}return r(a,t)},0)})},n.prototype.lesserThan=function(t){var e=function(t,n){return t<n};return new nn(new M(this.metadata,rt,t instanceof n?t.metadata:new Qt(t)),tn(this,t,e,!1))},n.prototype.lesserOrEquals=function(t){var e=function(t,n){return t<=n};return new nn(new M(this.metadata,at,t instanceof n?t.metadata:new Qt(t)),tn(this,t,e,!1))},n.prototype.greaterThan=function(t){var e=function(t,n){return t>n};return new nn(new M(this.metadata,it,t instanceof n?t.metadata:new Qt(t)),tn(this,t,e,!1))},n.prototype.greaterOrEquals=function(t){var e=function(t,n){return t>=n};return new nn(new M(this.metadata,ut,t instanceof n?t.metadata:new Qt(t)),tn(this,t,e,!1))},n.prototype.between=function(t,n){return this.greaterOrEquals(t).and(this.lesserThan(n))},n.prototype.plus=function(t){var e=function(t,n){return t+n};return new n(new M(this.metadata,ot,t instanceof n?t.metadata:new Qt(t)),tn(this,t,e,null))},n.prototype.minus=function(t){var e=function(t,n){return t-n};return new n(new M(this.metadata,ct,t instanceof n?t.metadata:new Qt(t)),tn(this,t,e,null))},n.prototype.times=function(t){var e=function(t,n){return t*n};return new n(new M(this.metadata,st,t instanceof n?t.metadata:new Qt(t)),tn(this,t,e,null))},n.prototype.divide=function(t){var e=function(t,n){return t/n};return new n(new M(this.metadata,ft,t instanceof n?t.metadata:new Qt(t)),tn(this,t,e,null))},n}($t),an=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.iterable=function(t){return new n(t.metadata,t.get,t.set)},n.prototype.contains=function(t){var n=function(t,n){return t.some(function(t){return t===n})};return new nn(new M(this.metadata,R,t instanceof $t?t.metadata:new Qt(t)),tn(this,t,n,!1))},n.prototype.containsAll=function(t){var n=function(t,n){return t.some(function(t){return n.some(function(n){return n===t})})};return new nn(new M(this.metadata,Bt,t instanceof $t?t.metadata:new Zt(t.map(function(t){return new Qt(t)}))),tn(this,t,n,!1))},n.prototype.isEmpty=function(){return new nn(new Kt(this.metadata,zt),tn(this,void 0,function(t){return 0===t.length},null))},n.prototype.isNotEmpty=function(){return new nn(new Kt(this.metadata,Gt),tn(this,void 0,function(t){return 0!==t.length},null))},n.prototype.hasSize=function(t){var n=function(t,n){return t.length===n};return new nn(new Kt(this.metadata,Wt),tn(this,t,n,null))},n.prototype.hasNotSize=function(t){var n=function(t,n){return t.length!==n};return new nn(new Kt(this.metadata,Xt),tn(this,t,n,null))},n.prototype.length=function(){return new rn(new Kt(this.metadata,W),tn(this,void 0,function(t){return t.length},null))},n}($t),un=function(){function t(t){var n=this;this.metadata=t,this.get=w.apply(void 0,t.path),this.metadata.siblings&&this.metadata.siblings.length>0?this.set=function(e,r,a){return p.apply(void 0,[n.metadata.siblings.reduce(function(t,n){return p.apply(void 0,[t,r].concat(n))},e),r].concat(t.path))}:this.set=m.apply(void 0,t.path)}return t.field=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(new y(n))},t.prototype.withPosition=function(n){return new t(new y(this.metadata.path,this.metadata.tags,n,this.metadata.siblings))},t.prototype.withTags=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(new y(this.metadata.path,n,this.metadata.position,this.metadata.siblings))},t.prototype.withSiblings=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(new y(this.metadata.path,this.metadata.tags,this.metadata.position,n))},t.prototype.position=function(){var t=this;return new rn(new Kt(this.metadata,Ht),function(){return t.metadata.position})},t.prototype.tags=function(){var t=this;return new an(new Kt(this.metadata,kt),function(){return t.metadata.tags})},t}(),on=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.string=function(t){return new n(t.metadata,t.get,t.set)},n.prototype.contains=function(t){var e=function(t,n){return t.includes(n)};return new nn(new M(this.metadata,R,t instanceof n?t.metadata:new Qt(t)),tn(this,t,e,!1))},n.prototype.matches=function(t){var e=function(t,n){return new RegExp(n).test(t)};return new nn(new M(this.metadata,B,t instanceof n?t.metadata:new Qt(t)),tn(this,t,e,!1))},n.prototype.startsWith=function(t){var e=function(t,n){return t.startsWith(n)};return new nn(new M(this.metadata,z,t instanceof n?t.metadata:new Qt(t)),tn(this,t,e,!1))},n.prototype.endsWith=function(t){var e=function(t,n){return t.endsWith(n)};return new nn(new M(this.metadata,G,t instanceof n?t.metadata:new Qt(t)),tn(this,t,e,!1))},n.prototype.length=function(){return new rn(new Kt(this.metadata,W),tn(this,void 0,function(t){return t.length},0))},n.prototype.parseInt=function(){return new rn(new Kt(this.metadata,X),tn(this,void 0,function(t){return parseInt(t)},null))},n.prototype.trim=function(){return new n(new Kt(this.metadata,H),tn(this,void 0,function(t){return t.trim()},null))},n.prototype.replaceAll=function(t,e){return new n(new M(this.metadata,Q,new M(new Qt(t),P,new Qt(e))),tn(this,void 0,function(n){return n.replace(t,e)},null))},n.prototype.substring=function(t,e){return new n(new M(this.metadata,Z,new M(new Qt(t),P,new Qt(e))),tn(this,void 0,function(n){return n.substring(t,e)},null))},n.prototype.localeUpperCase=function(){return new n(new Kt(this.metadata,k),tn(this,void 0,function(t){return t.toLocaleUpperCase()},null))},n.prototype.localeLowerCase=function(){return new n(new Kt(this.metadata,J),tn(this,void 0,function(t){return t.toLocaleLowerCase()},null))},n.prototype.concat=function(t){return new n(new M(this.metadata,K,t instanceof n?t.metadata:new Qt(t)),tn(this,t,function(t,n){return t+n},null))},n}($t),cn=function(t){function n(n,e,r){var a=t.call(this)||this;return a.type="CONDITIONAL_MAPPING",a.whenMetadata=n,a.thenMetadata=e,a.elseMetadata=r,a}return e(n,t),n.prototype.children=function(){var t=[this.whenMetadata,this.thenMetadata];return null!=this.elseMetadata?t.concat(this.elseMetadata):t},Object.defineProperty(n.prototype,"readable",{get:function(){return this.whenMetadata.readable+" "+E.readable+" "+this.thenMetadata.readable+(null!=this.elseMetadata?" "+I.readable+" "+this.elseMetadata.readable:"")},enumerable:!0,configurable:!0}),n}(g),sn=function(){function t(t){this.type="WHEN",this.metadata=t,this.operator=O}return Object.defineProperty(t.prototype,"readable",{get:function(){return this.operator.readable+" "+this.metadata.readable},enumerable:!0,configurable:!0}),t.prototype.children=function(){return[this.metadata]},t}(),fn=function(t){function n(n,e){var r=t.call(this,e)||this;return r.type="MULTIPLE_MAPPING",r.mappings=n,r}return e(n,t),Object.defineProperty(n.prototype,"readable",{get:function(){return this.mappings.map(function(t){return t.readable}).join(" , ")},enumerable:!0,configurable:!0}),n.prototype.children=function(){return this.mappings},n}(g),ln=function(){function t(t){void 0===t&&(t=!0),this.props={},this.getValues=[],this.setValues=[],this.shortCircuit=t}return t.prototype.addGetValue=function(t,n){this.getValues.push({metadata:t,value:n})},t.prototype.addSetValue=function(t,n){this.setValues.push({metadata:t,value:n})},t}(),dn=function(){function t(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];this.condition=t,this.mappings=n;var r=n.map(function(t){return t.metadata});this.metadata=new cn(new sn(t.metadata),new fn(r,E))}return t.prototype.execute=function(t,n){var e=n||new ln;return this.condition.get(t,n)?this.mappings.reduce(function(t,n){return n.execute(t,e)},t):this.elseMappings?this.elseMappings.reduce(function(t,n){return n.execute(t,e)},t):t},t.prototype.executeOn=function(t,n,e){var r=e||new ln;return this.condition.get(t,e)?(this.mappings.forEach(function(e){n=e.executeOn(t,n,r)}),n):this.elseMappings?(this.elseMappings.forEach(function(e){n=e.executeOn(t,n,r)}),n):n},t.prototype.otherwise=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.elseMappings=t;var e=t.map(function(t){return t.metadata});return this.metadata=new cn(this.metadata.whenMetadata,this.metadata.thenMetadata,new fn(e,I)),this},t}(),hn=function(t,n){this.value=t,this.context=n},pn=function(t){function n(n){var e=t.call(this,Y)||this;return e.type="VALIDATION",e.when=n,e}return e(n,t),Object.defineProperty(n.prototype,"readable",{get:function(){return this.operator.readable+" "+this.when.readable},enumerable:!0,configurable:!0}),n.prototype.children=function(){return[this.when]},n}(g),wn=function(){function t(t){this.when=t,this.metadata=new pn(t.metadata)}return t.prototype.execute=function(t,n){void 0===t&&(t={});var e=n||new ln;return new hn(this.when.condition.get(t,e),e)},t}(),mn=function(){function t(t){this.condition=t,this.metadata=new sn(t.metadata)}return t.prototype.validate=function(){return new wn(this)},t.prototype.then=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new(dn.bind.apply(dn,[void 0,this.condition].concat(t)))},t}(),vn=function(t){function n(n,e){var r=t.call(this,D)||this;return r.type="SINGLE_MAPPING",r.sourceMetadata=n,r.targetMetadata=e,r}return e(n,t),Object.defineProperty(n.prototype,"readable",{get:function(){return this.sourceMetadata.readable+" "+lt+" "+this.targetMetadata.readable},enumerable:!0,configurable:!0}),n.prototype.children=function(){return[this.sourceMetadata,this.targetMetadata]},n}(g),gn=function(){function t(t,n){this.input=t,this.output=n,this.metadata=new vn(t.metadata,n.metadata)}return t.prototype.execute=function(t,n){var e=n||new ln;return this.output.set?this.output.set(t,this.input.get(t,e),e):t},t.prototype.executeOn=function(t,n,e){var r=e||new ln;return this.output.set?this.output.set(n,this.input.get(t,r),r):n},t}(),yn=function(t){function n(n,e){var r=t.call(this,new M(n.metadata,dt,e.metadata),function(t,r){return e.convert(t,n,r)})||this;return r.input=n,r.converter=e,r}return e(n,t),n.prototype.using=function(t){return new n(this,t)},n.prototype.to=function(t){return new gn(this,t)},n}($t),bn=function(){function t(t){this.input=t}return t.prototype.to=function(t){return new gn(this.input,t)},t.prototype.using=function(t){return new yn(this.input,t)},t}(),Mn=function(){function t(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];this.mappings=o(n,function(n){return n instanceof t?n.mappings:[n]}),this.metadata=new fn(this.mappings.map(function(t){return t.metadata}))}return t.prototype.execute=function(t,n){var e=n||new ln;return this.mappings.reduce(function(t,n){return n.execute(t,e)},t)},t.prototype.executeOn=function(t,n,e){var r=e||new ln;return this.mappings.forEach(function(e){n=e.executeOn(t,n,r)}),n},t}(),Dn=function(t,n,e){this.type="TYPE_CONVERTER",this.operator=e,this.body=t,this.readable=null!=n?n:t},On=function(t,n){this.convert=t,this.metadata=new Dn(t.toString(),n)},Yn=function(t){function n(n,e,r){var a=t.call(this,new M(new M(n.metadata,P,e.metadata),dt,r.metadata),function(t,a){return r.convert(t,n,e,a)})||this;return a.input=n,a.input2=e,a.converter=r,a}return e(n,t),n.prototype.using=function(t){return new yn(this,t)},n.prototype.to=function(t){return new gn(this,t)},n}($t),Nn=function(){function t(t,n){this.input=t,this.input2=n}return t.prototype.using=function(t){return new Yn(this.input,this.input2,t instanceof On?t:new On(t))},t}(),Pn=function(t,n){this.convert=t,this.metadata=new Dn(t.toString(),n)},Fn=function(t){function n(n,e){var r=t.call(this,new M(new en(n.map(function(t){return t.metadata}),ht),dt,e.metadata),function(t,r){return e.convert(t,n,r)})||this;return r.inputs=n,r.converter=e,r}return e(n,t),n.prototype.using=function(t){return new yn(this,t)},n.prototype.to=function(t){return new gn(this,t)},n}($t),En=function(){function t(t){this.inputs=t}return t.prototype.using=function(t){return new Fn(this.inputs,t instanceof Pn?t:new Pn(t))},t}();function In(t,n){for(t=String(t),n=n||2;t.length<n;)t="0"+t;return t}function An(){return new Date(Date.now())}function Tn(t){return new Date(t.valueOf())}function xn(t,n,e,r,a,i,u){return new Date(Date.UTC(t,n,e||0,r||0,a||0,i||0,u||0))}function jn(t){var n=Tn(t);return n.getFullYear().toString()+In(n.getMonth()+1,2)+In(n.getDate(),2)}function Sn(t){var n=Tn(t);return In(n.getDate(),2)+In(n.getMonth()+1,2)+n.getFullYear()}function _n(t){var n=Number.parseInt(t.slice(0,4)),e=Number.parseInt(t.slice(4,6))-1,r=Number.parseInt(t.slice(6,8));return new Date(n,e,r)}function Cn(t,n){var e=n||An(),r=12*(e.getFullYear()-t.getFullYear())+(e.getMonth()-t.getMonth());return e.getDate()-t.getDate()>=0?r:r-1}function Vn(t,n){var e=n.getFullYear()-t.getFullYear(),r=n.getMonth()-t.getMonth(),a=n.getDate()-t.getDate();return r>=0&&a>=0?e:e-1}var Ln=Object.freeze({now:An,clone:Tn,newUTCDate:xn,formatYYYYMMdd:jn,formatddMMYYYY:Sn,formatReadable:function(t){var n=Tn(t);return In(n.getDate(),2)+"/"+In(n.getMonth()+1,2)+"/"+n.getFullYear()},formatMMMMYYYY:function(t,n){var e=Tn(t);return new Intl.DateTimeFormat(n,{month:"long"}).format(t)+" "+e.getFullYear()},formatEEEEddMMMM:function(t,n){var e=Tn(t),r=new Intl.DateTimeFormat(n,{weekday:"long"}).format(e),a=new Intl.DateTimeFormat(n,{month:"long"}).format(e);return r+" "+In(e.getDate(),2)+" "+a},formatTime:function(t){var n=Tn(t);return In(t.getHours(),2)+In(n.getMinutes(),2)+In(t.getSeconds(),2)},parse:_n,numberOfFullMonthsBetween:Cn,numberOfFullYearsBetween:Vn}),Un=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.equals=function(n,e){return n&&e?n.getTime()===e.getTime():t.prototype.equals.call(this,n,e)},n.date=function(t){return new n(t.metadata,t.get,t.set)},n.dateIso=function(t){return new n(t.metadata,function(n,e){var r=t.get(n,e);return u(r)?r:_n(r)},function(n,e,r){return u(e)?t.set?t.set(n,e,r):n:t.set?t.set(n,jn(e),r):n})},n.min=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.map(function(t){return t instanceof n?t.metadata:new Qt(t)});return new n(new en(r,$),function(e,r){var a=function(t,n){return t<n?t:n};return t.reduce(function(t,n){if(n instanceof $t){var i=n.get(e,r);return null!=i?a(i,t):t}return a(n,t)},n.MAX_DATE)})},n.max=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.map(function(t){return t instanceof n?t.metadata:new Qt(t)});return new n(new en(r,tt),function(e,r){var a=function(t,n){return t>n?t:n};return t.reduce(function(t,n){if(n instanceof $t){var i=n.get(e,r);return null!=i?a(i,t):t}return a(n,t)},n.MIN_DATE)})},n.thisYear=function(){return new rn(new b("clone().getFullYear()",void 0,Pt),function(){return An().getFullYear()})},n.thisMonth=function(){return new rn(new b("clone().getMonth() + 1",void 0,Ft),function(){return An().getMonth()+1})},n.today=function(){return new n(new b("clone()",void 0,Et),function(){return An()})},n.tomorrow=function(){return new n(new b("date.setDate(date.getDate() + 1)",void 0,It),function(){var t=An();return t.setDate(t.getDate()+1),t})},n.dateFrom=function(t){return new n(new b("Date{"+t+"}"),function(){return _n(t)})},n.newDate=function(t,e,r){return new n(new b("Date{ Y:"+t+" M:"+e+" D:"+r+" }"),function(){return xn(t,e,r)})},n.newLocalDate=function(t,e,r){return new n(new b("Date{ Y:"+t+" M:"+e+" D:"+r+" }"),function(){return new Date(t,e,r)})},n.prototype.before=function(t){var e=function(t,n){return t<n};return new nn(new M(this.metadata,mt,t instanceof n?t.metadata:new Qt(t)),tn(this,t,e,!1))},n.prototype.beforeOrEquals=function(t){var e=function(t,n){return t<=n};return new nn(new M(this.metadata,vt,t instanceof n?t.metadata:new Qt(t)),tn(this,t,e,!1))},n.prototype.after=function(t){var e=function(t,n){return t>n};return new nn(new M(this.metadata,pt,t instanceof n?t.metadata:new Qt(t)),tn(this,t,e,!1))},n.prototype.afterOrEquals=function(t){var e=function(t,n){return t>=n};return new nn(new M(this.metadata,wt,t instanceof n?t.metadata:new Qt(t)),tn(this,t,e,!1))},n.prototype.between=function(t,n){return this.afterOrEquals(t).and(this.before(n))},n.prototype.plusDays=function(t){var e=function(t,n){var e=Tn(t);return e.setDate(t.getDate()+n),e};return new n(new M(this.metadata,gt,t instanceof rn?t.metadata:new Qt(t)),tn(this,t,e,null))},n.prototype.minusDays=function(t){var e=function(t,n){var e=Tn(t);return e.setDate(e.getDate()-n),e};return new n(new M(this.metadata,yt,t instanceof rn?t.metadata:new Qt(t)),tn(this,t,e,null))},n.prototype.plusMonths=function(t){var e=function(t,n){var e=Tn(t);return e.setMonth(e.getMonth()+n),e};return new n(new M(this.metadata,bt,t instanceof rn?t.metadata:new Qt(t)),tn(this,t,e,null))},n.prototype.minusMonths=function(t){var e=function(t,n){var e=Tn(t);return e.setMonth(e.getMonth()-n),e};return new n(new M(this.metadata,Mt,t instanceof rn?t.metadata:new Qt(t)),tn(this,t,e,null))},n.prototype.plusYears=function(t){var e=function(t,n){var e=Tn(t);return e.setFullYear(e.getFullYear()+n),e};return new n(new M(this.metadata,Dt,t instanceof rn?t.metadata:new Qt(t)),tn(this,t,e,null))},n.prototype.minusYears=function(t){var e=function(t,n){var e=Tn(t);return e.setFullYear(e.getFullYear()-n),e};return new n(new M(this.metadata,Ot,t instanceof rn?t.metadata:new Qt(t)),tn(this,t,e,null))},n.prototype.formatISO=function(){return new on(new Kt(this.metadata,Yt),tn(this,void 0,function(t){return jn(t)},null))},n.prototype.dayMonthYear=function(){return new on(new Kt(this.metadata,Nt),tn(this,void 0,function(t){return Sn(t)},null))},n.nbFullMonthsSince=function(t){return new rn(new Kt(t.metadata,Lt),tn(t,void 0,function(t){return Cn(t)},null))},n.nbFullMonthsBetween=function(t,e){return e instanceof n?new rn(new M(t.metadata,Ut,e.metadata),tn(t,e,function(t,n){return Cn(t,n)},null)):new rn(new M(t.metadata,Ut,new Qt(e)),tn(t,e,Cn,null))},n.nbFullYearsBetween=function(t,e){return new rn(new M(t.metadata,qt,e instanceof n?e.metadata:new Qt(e)),tn(t,e,Vn,null))},n.prototype.withDayOfMonth=function(t){var e=function(t,n){var e=Tn(t);return e.setDate(n),e};return new n(new M(this.metadata,At,new Qt(t)),tn(this,t,e,null))},n.prototype.withMonth=function(t){var e=function(t,n){var e=Tn(t);return e.setMonth(n),e};return new n(new M(this.metadata,Tt,new Qt(t)),tn(this,t,e,null))},n.prototype.withYear=function(t){var e=function(t,n){var e=Tn(t);return e.setFullYear(n),e};return new n(new M(this.metadata,xt,new Qt(t)),tn(this,t,e,null))},n.prototype.withFirstDayOfNextYear=function(){return new n(new Kt(this.metadata,jt),tn(this,void 0,function(t){var n=Tn(t);return n.setMonth(11),n.setDate(32),n},null))},n.prototype.withLastDayOfLastYear=function(){return new n(new Kt(this.metadata,St),tn(this,void 0,function(t){var n=Tn(t);return n.setMonth(0),n.setDate(0),n},null))},n.prototype.monthOf=function(){return new rn(new Kt(this.metadata,_t),tn(this,void 0,function(t){return t.getMonth()},null))},n.prototype.yearOf=function(){return new rn(new Kt(this.metadata,Ct),tn(this,void 0,function(t){return t.getFullYear()},null))},n.prototype.dateOf=function(){return new rn(new Kt(this.metadata,Vt),tn(this,void 0,function(t){return t.getDate()},null))},n.prototype.ageAt=function(t){return new rn(new M(this.metadata,Rt,t instanceof n?t.metadata:new Qt(t)),tn(this,t,Vn,null))},n.MAX_DATE=new Date(864e13),n.MIN_DATE=new Date(-864e13),n}($t),qn=function(t,n){this.convert=t,this.metadata=new Dn(t.toString(),n)};var Rn=Object.freeze({fieldsOf:function t(n){var e=n;return"FIELD"==e.type?[e.path]:n.children?n.children().reduce(function(n,e){return n.concat(t(e))},[]):[]}}),Bn=function(t){function n(n,e){var r=t.call(this,e)||this;return r.type="MULTIPLE_VALIDATIONS",r.mappings=n,r}return e(n,t),Object.defineProperty(n.prototype,"readable",{get:function(){return this.mappings.map(function(t){return t.readable}).join(" , ")},enumerable:!0,configurable:!0}),n.prototype.children=function(){return this.mappings},n}(g),zn=function(){function t(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];this.validations=o(n,function(n){return n instanceof t?n.validations:[n]}),this.metadata=new Bn(this.validations.map(function(t){return t.metadata}))}return t.prototype.execute=function(t,n){var e=n||new ln;return this.validations.map(function(n){return n.execute(t,e)}).find(function(t){return!0===t.value})||new hn(!1,e)},t}();t.AbstractMetadata=g,t.BiTypeConverter=On,t.BinaryMetadata=M,t.BooleanFunction=nn,t.ConditionalMappingMetadata=cn,t.DateFunction=Un,t.DateUtils=Ln,t.DefaultContext=ln,t.Field=un,t.FieldMetadata=y,t.Function=$t,t.FunctionMetadata=b,t.IterableFunction=an,t.IterableMetadata=Zt,t.MetadataUtils=Rn,t.MultipleMappingsMetadata=fn,t.MultipleValidationsMetadata=Bn,t.NaryMetadata=en,t.NaryTypeConverter=Pn,t.NumberFunction=rn,t.Paths=v,t.Result=hn,t.SingleMappingMetadata=vn,t.SingleValidationRule=wn,t.StepWhen=mn,t.StringFunction=on,t.TypeConverter=qn,t.TypeConverterMetadata=Dn,t.UnaryMetadata=Kt,t.Utils=c,t.ValidationRuleMetadata=pn,t.Validations=zn,t.ValueMetadata=Qt,t.WhenMetadata=sn,t.biConverter=function(t,n){return new On(t,n)},t.boolean=function(t){return nn.boolean(t)},t.condition=tn,t.converter=function(t,n){return new qn(t,n)},t.count=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new rn(new en(t.map(function(t){return t.metadata}),et),function(n,e){return t.filter(function(t){var r=t.get(n,e);return null!=r&&r}).length})},t.date=function(t){return Un.date(t)},t.dateIso=function(t){return Un.dateIso(t)},t.f=function(t){return $t.function(t)},t.field=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return un.field.apply(un,t)},t.iterable=function(t){return an.iterable(t)},t.lift=function(t,n){return $t.lift(t,n)},t.map=function(t,n){return n?new Nn(t instanceof $t?t:new $t(new Qt(t),function(n){return t}),n instanceof $t?n:new $t(new Qt(n),function(t){return n})):new bn(t instanceof $t?t:new $t(new Qt(t),function(n){return t}))},t.mapAll=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new En(t)},t.mapNull=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1==t.length?new gn(new $t(new Qt(null),function(t){return null}),t[0]):new gn(new $t(new Qt(null),function(t){return null}),$t.consumer(new en(t.map(function(t){return t.metadata}),Jt),function(n,e,r){for(var a=0,i=t;a<i.length;a++){var u=i[a];n=u.set?u.set(n,e,r):n}return n}))},t.mappings=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new(Mn.bind.apply(Mn,[void 0].concat(t)))},t.matchAll=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new nn(new en(t.map(function(t){return t.metadata}),L),function(n,e){return t.every(function(t){var r=t.get(n,e);return null!=r&&r})})},t.matchAny=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new nn(new en(t.map(function(t){return t.metadata}),q),function(n,e){return t.some(function(t){var r=t.get(n,e);return null!=r&&r})})},t.matchNone=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new nn(new en(t.map(function(t){return t.metadata}),U),function(n,e){return t.every(function(t){var r=t.get(n,e);return null!=r&&!r})})},t.naryConverter=function(t,n){return new Pn(t,n)},t.number=function(t){return rn.number(t)},t.position=function(t){return new rn(new Kt(t.metadata,Ht),function(){return t.metadata instanceof y?t.metadata.position:void 0})},t.string=function(t){return on.string(t)},t.sum=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new rn(new en(t.map(function(t){return t.metadata}),nt),function(n,e){return t.reduce(function(t,r){var a=r.get(n,e);return null!=a?t+a:t},0)})},t.tags=function(t){return new an(new Kt(t.metadata,kt),function(){return t.metadata instanceof y?t.metadata.tags:[]})},t.validations=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new(zn.bind.apply(zn,[void 0].concat(t)))},t.when=function(t){return new mn(t)},Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).DOOV={})}(this,function(t){"use strict";var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,n)};function n(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var a in e=arguments[n])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t}).apply(this,arguments)};function a(t,e){return Object.prototype.hasOwnProperty.call(e,t)}function u(t){return Number.isInteger(t)||t<<0===t}function i(t){return null==t}function o(t,e){return void 0===e&&(e=function(t){return Array.isArray(t)?t.slice():[t]}),t.reduce(function(t,n){return t.concat(e(n))},[])}var c=Object.freeze({hasProperty:a,isInteger:u,nullOrUndefined:i,flatMap:o});function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.join(".")}function f(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(t,e){return t&&void 0!==t[e]?t[e]:void 0},t)}function l(t,e,n){var a=r({},n);return a[t]=e,a}function p(t,e,n){return e.then(function(e){var a=r({},n);return a[t]=e,a})}function d(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=n[0];if(n.length>1){var o=null!=t&&a(i,t)?t[i]:u(n[1])?[]:{};e=d.apply(void 0,[o,e].concat(Array.prototype.slice.call(n,1)))}return p(i,e,t)}function h(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=n[0];if(n.length>1){var o=null!=t&&a(i,t)?t[i]:u(n[1])?[]:{};e=h.apply(void 0,[o,e].concat(Array.prototype.slice.call(n,1)))}return l(i,e,t)}var w=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return f.apply(void 0,[e].concat(t))}},m=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e,n){return h.apply(void 0,[e,n].concat(t))}},y=Object.freeze({path:function(t){return t.split(".").map(function(t){var e=parseInt(t);return isNaN(e)?t:e})},pathString:s,getPath:f,getPathPromise:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(t,e){return t.then(function(t){return new Promise(function(n,r){t&&void 0!==t[e]?n(t[e]):r(void 0)})})},Promise.resolve(t))},setProp:l,setPropPromise:p,setPathPromise:d,setPathPromiseValue:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return d.apply(void 0,[t,Promise.resolve(e)].concat(n))},setPath:h,getter:w,setter:m}),v=function(t){this.operator=t},g=function(t){function e(e,n,r,a){void 0===n&&(n=[]),void 0===r&&(r=-1),void 0===a&&(a=[]);var i=t.call(this)||this;i.type="FIELD",i.readable=s.apply(void 0,e),i.path=e.slice(),i.tags=n;var o=e.filter(function(t){return u(t)});return i.position=-1===r&&o.length>=1?o[o.length-1]:r,i.siblings=a.slice(),i}return n(e,t),e}(v);var T=function(t,e,n){this.type="FUNCTION",this.operator=n,this.body=t,this.readable=null!=e?e:t},O=function(t){function e(e,n,r){var a=t.call(this,n)||this;return a.type="BINARY",a.left=e,a.right=r,a}return n(e,t),Object.defineProperty(e.prototype,"readable",{get:function(){return this.left.readable+" "+this.operator.readable+" "+this.right.readable},enumerable:!0,configurable:!0}),e.prototype.children=function(){return[this.left,this.right]},e}(v),b={readable:"single_mapping",returnType:"OTHER"},E={readable:"when",returnType:"OTHER"},M={readable:"validate",returnType:"OTHER"},R={readable:"not",returnType:"BOOL"},_={readable:"and",returnType:"BOOL"},N={readable:"or",returnType:"BOOL"},A={readable:"then",returnType:"OTHER"},S={readable:"else",returnType:"OTHER"},H={readable:"function",returnType:"OTHER"},I={readable:"has value",returnType:"BOOL"},L={readable:"is null",returnType:"BOOL"},D={readable:"is not null",returnType:"BOOL"},Y={readable:"is defined",returnType:"BOOL"},F={readable:"is undefined",returnType:"BOOL"},P={readable:"=",returnType:"BOOL"},B={readable:"!=",returnType:"BOOL"},U={readable:"match all",returnType:"BOOL"},C={readable:"none match",returnType:"BOOL"},x={readable:"match any",returnType:"BOOL"},j={readable:"contains",returnType:"BOOL"},V={readable:"matches",returnType:"BOOL"},W={readable:"starts with",returnType:"BOOL"},G={readable:"ends with",returnType:"BOOL"},q={readable:"length",returnType:"OTHER"},z={readable:"as integer",returnType:"OTHER"},Q={readable:"trimmed",returnType:"OTHER"},X={readable:"upper case",returnType:"OTHER"},Z={readable:"lower case",returnType:"OTHER"},k={readable:"concat",returnType:"OTHER"},J={readable:"replace all",returnType:"OTHER"},K={readable:"sub string",returnType:"OTHER"},$={readable:"min",returnType:"OTHER"},tt={readable:"max",returnType:"OTHER"},et={readable:"sum",returnType:"OTHER"},nt={readable:"count",returnType:"OTHER"},rt={readable:"<",returnType:"BOOL"},at={readable:"<=",returnType:"BOOL"},ut={readable:">",returnType:"BOOL"},it={readable:">=",returnType:"BOOL"},ot={readable:"+",returnType:"OTHER"},ct={readable:"-",returnType:"OTHER"},st={readable:"*",returnType:"OTHER"},ft={readable:"/",returnType:"OTHER"},lt={readable:"->",returnType:"OTHER"},pt={readable:"using",returnType:"OTHER"},dt={readable:"multiple inputs",returnType:"OTHER"},ht={readable:">",returnType:"BOOL"},wt={readable:">=",returnType:"BOOL"},mt={readable:"<",returnType:"BOOL"},yt={readable:"<=",returnType:"BOOL"},vt={readable:"plus days",returnType:"OTHER"},gt={readable:"minus days",returnType:"OTHER"},Tt={readable:"plus months",returnType:"OTHER"},Ot={readable:"minus months",returnType:"OTHER"},bt={readable:"plus years",returnType:"OTHER"},Et={readable:"minus years",returnType:"OTHER"},Mt={readable:"format iso",returnType:"OTHER"},Rt={readable:"format day month year",returnType:"OTHER"},_t={readable:"this year",returnType:"OTHER"},Nt={readable:"this month",returnType:"OTHER"},At={readable:"today",returnType:"OTHER"},St={readable:"tomorrow",returnType:"OTHER"},Ht={readable:"with day of month",returnType:"OTHER"},It={readable:"with month",returnType:"OTHER"},Lt={readable:"with year",returnType:"OTHER"},Dt={readable:"with first day of next year",returnType:"OTHER"},Yt={readable:"with last day of last year",returnType:"OTHER"},Ft={readable:"month of",returnType:"OTHER"},Pt={readable:"year of",returnType:"OTHER"},Bt={readable:"date of",returnType:"OTHER"},Ut={readable:"number of months since",returnType:"OTHER"},Ct={readable:"number of months between",returnType:"OTHER"},xt={readable:"number of years between",returnType:"OTHER"},jt={readable:"age at",returnType:"OTHER"},Vt={readable:"contains all",returnType:"BOOL"},Wt={readable:"is empty",returnType:"BOOL"},Gt={readable:"is not empty",returnType:"BOOL"},qt={readable:"has size",returnType:"BOOL"},zt={readable:"has not size",returnType:"BOOL"},Qt={readable:"position of",returnType:"OTHER"},Xt={readable:"tags of",returnType:"OTHER"},Zt={readable:"functions",returnType:"OTHER"},kt=function(t){function e(e,n){var r=t.call(this)||this;return r.type="UNARY",r.metadata=e,r.operator=n,r}return n(e,t),Object.defineProperty(e.prototype,"readable",{get:function(){return this.operator===R?this.operator.readable+"("+this.metadata.readable+")":this.metadata.readable+" "+this.operator.readable},enumerable:!0,configurable:!0}),e.prototype.children=function(){return[this.metadata]},e}(v),Jt=function(t){function e(e){var n=t.call(this)||this;return n.type="VALUE",n.readable=JSON.stringify(e),n.value=e,n}return n(e,t),e}(v),Kt=function(t){function e(e){var n=t.call(this)||this;return n.type="ITERABLE",n.values=e,n}return n(e,t),Object.defineProperty(e.prototype,"readable",{get:function(){return"["+this.values.map(function(t){return t.readable}).join(",")+"]"},enumerable:!0,configurable:!0}),e.prototype.children=function(){return this.values},e}(v),$t=function(){function t(t,e,n){this.metadata=t,this.get=function(t,e){if(a("interceptor",e))return e;var n=function(n,r){var a=e(n,r);return r&&r.addGetValue(t,a),a};return n.interceptor=!0,n}(t,e),this.set=n?function(t,e){if(a("interceptor",e))return e;var n=function(n,r,a){return a&&a.addSetValue(t,r),e(n,r,a)};return n.interceptor=!0,n}(t,n):void 0}return t.function=function(e){return new t(e.metadata,e.get,e.set)},t.contextual=function(e,n){return new t(e,n)},t.consumer=function(e,n){return new t(e,function(){return null},n)},t.lift=function(t,e){return new t(new Jt(e),function(){return e})},t.prototype.mapTo=function(t,e,n){var r=this;return new t(new O(this.metadata,H,new T(n||e.toString())),function(t,n){return e(r.get(t,n))})},t.prototype.hasValue=function(){var t=this;return new ee(new kt(this.metadata,I),function(e,n){var r=t.get(e,n);return null!=r})},t.prototype.isNullOrUndefined=function(){return this.isNull().or(this.isUndefined())},t.prototype.isDefined=function(){var t=this;return new ee(new kt(this.metadata,Y),function(e,n){return void 0!==t.get(e,n)})},t.prototype.isUndefined=function(){var t=this;return new ee(new kt(this.metadata,F),function(e,n){return void 0===t.get(e,n)})},t.prototype.isNull=function(){var t=this;return new ee(new kt(this.metadata,L),function(e,n){return null===t.get(e,n)})},t.prototype.isNotNull=function(){var t=this;return new ee(new kt(this.metadata,D),function(e,n){return null!==t.get(e,n)})},t.prototype.equals=function(t,e){return t===e},t.prototype.eq=function(e){var n=this;return e instanceof t?new ee(new O(this.metadata,P,e.metadata),function(t,r){return n.equals(n.get(t,r),e.get(t,r))}):new ee(new O(this.metadata,P,new Jt(e)),function(t,r){return n.equals(n.get(t,r),e)})},t.prototype.notEq=function(e){var n=this;return e instanceof t?new ee(new O(this.metadata,B,e.metadata),function(t,r){return!n.equals(n.get(t,r),e.get(t,r))}):new ee(new O(this.metadata,B,new Jt(e)),function(t,r){return!n.equals(n.get(t,r),e)})},t.prototype.matchAll=function(){for(var e=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var a=n.map(function(e){return e instanceof t?e.metadata:new Jt(e)});return new ee(new O(this.metadata,U,new Kt(a)),function(r,a){return n.every(function(n){return n instanceof t?e.get(r,a)===n.get(r,a):e.get(r,a)===n})})},t.prototype.noneMatch=function(){for(var e=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var a=n.map(function(e){return e instanceof t?e.metadata:new Jt(e)});return new ee(new O(this.metadata,C,new Kt(a)),function(r,a){return n.every(function(n){return n instanceof t?e.get(r,a)!==n.get(r,a):e.get(r,a)!==n})})},t.prototype.matchAny=function(){for(var e=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var a=n.map(function(e){return e instanceof t?e.metadata:new Jt(e)});return new ee(new O(this.metadata,x,new Kt(a)),function(r,a){return n.some(function(n){return n instanceof t?e.get(r,a)===n.get(r,a):e.get(r,a)===n})})},t}();function te(t,e,n,r){return e instanceof $t?function(a,u){var i=t.get(a,u);if(null!=i||null!=i){var o=e.get(a,u);return null!=o||null!=o?n(i,o):r}return r}:function(a,u){var i=t.get(a,u);return null!=i||null!=i?n(i,e):r}}var ee=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.boolean=function(t){return new e(t.metadata,t.get,t.set)},e.prototype.not=function(){return new e(new kt(this.metadata,R),te(this,!1,function(t){return!t},!1))},e.prototype.and=function(t){var n=this;return new e(new O(this.metadata,_,t.metadata),function(e,r){if(r&&r.shortCircuit){var a=n.get(e,r);if(null!=a){if(!a)return!1;var u=t.get(e,r);return a&&null!=u&&u}return!1}return te(n,t,function(t,e){return t&&e},!1)(e,r)})},e.prototype.or=function(t){var n=this;return new e(new O(this.metadata,N,t instanceof e?t.metadata:new Jt(t)),function(r,a){if(a&&a.shortCircuit){var u=n.get(r,a);return null!=u&&(!!u||(t instanceof e?u||t.get(r,a):u||t))}return te(n,t,function(t,e){return t||e},!1)(r,a)})},e}($t),ne=function(t){function e(e,n){var r=t.call(this,n)||this;return r.type="NARY",r.values=e,r}return n(e,t),Object.defineProperty(e.prototype,"readable",{get:function(){return this.values.map(function(t){return t.readable}).join(",")},enumerable:!0,configurable:!0}),e.prototype.children=function(){return this.values},e}(v),re=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.number=function(t){return new e(t.metadata,t.get,t.set)},e.min=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.map(function(t){return t instanceof e?t.metadata:new Jt(t)});return new e(new ne(r,$),function(e,n){var r=function(t,e){return t<e?t:e};return t.reduce(function(t,a){if(a instanceof $t){var u=a.get(e,n);return null!=u?r(u,t):t}return r(a,t)},Number.MAX_SAFE_INTEGER)})},e.max=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.map(function(t){return t instanceof e?t.metadata:new Jt(t)});return new e(new ne(r,tt),function(e,n){var r=function(t,e){return t>e?t:e};return t.reduce(function(t,a){if(a instanceof $t){var u=a.get(e,n);return null!=u?r(u,t):t}return r(a,t)},Number.MIN_SAFE_INTEGER)})},e.sum=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.map(function(t){return t instanceof e?t.metadata:new Jt(t)});return new e(new ne(r,et),function(e,n){var r=function(t,e){return t+e};return t.reduce(function(t,a){if(a instanceof $t){var u=a.get(e,n);return null!=u?r(u,t):t}return r(a,t)},0)})},e.prototype.lesserThan=function(t){var n=function(t,e){return t<e};return new ee(new O(this.metadata,rt,t instanceof e?t.metadata:new Jt(t)),te(this,t,n,!1))},e.prototype.lesserOrEquals=function(t){var n=function(t,e){return t<=e};return new ee(new O(this.metadata,at,t instanceof e?t.metadata:new Jt(t)),te(this,t,n,!1))},e.prototype.greaterThan=function(t){var n=function(t,e){return t>e};return new ee(new O(this.metadata,ut,t instanceof e?t.metadata:new Jt(t)),te(this,t,n,!1))},e.prototype.greaterOrEquals=function(t){var n=function(t,e){return t>=e};return new ee(new O(this.metadata,it,t instanceof e?t.metadata:new Jt(t)),te(this,t,n,!1))},e.prototype.between=function(t,e){return this.greaterOrEquals(t).and(this.lesserThan(e))},e.prototype.plus=function(t){var n=function(t,e){return t+e};return new e(new O(this.metadata,ot,t instanceof e?t.metadata:new Jt(t)),te(this,t,n,null))},e.prototype.minus=function(t){var n=function(t,e){return t-e};return new e(new O(this.metadata,ct,t instanceof e?t.metadata:new Jt(t)),te(this,t,n,null))},e.prototype.times=function(t){var n=function(t,e){return t*e};return new e(new O(this.metadata,st,t instanceof e?t.metadata:new Jt(t)),te(this,t,n,null))},e.prototype.divide=function(t){var n=function(t,e){return t/e};return new e(new O(this.metadata,ft,t instanceof e?t.metadata:new Jt(t)),te(this,t,n,null))},e}($t),ae=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.iterable=function(t){return new e(t.metadata,t.get,t.set)},e.prototype.contains=function(t){var e=function(t,e){return t.some(function(t){return t===e})};return new ee(new O(this.metadata,j,t instanceof $t?t.metadata:new Jt(t)),te(this,t,e,!1))},e.prototype.containsAll=function(t){var e=function(t,e){return t.some(function(t){return e.some(function(e){return e===t})})};return new ee(new O(this.metadata,Vt,t instanceof $t?t.metadata:new Kt(t.map(function(t){return new Jt(t)}))),te(this,t,e,!1))},e.prototype.isEmpty=function(){return new ee(new kt(this.metadata,Wt),te(this,void 0,function(t){return 0===t.length},null))},e.prototype.isNotEmpty=function(){return new ee(new kt(this.metadata,Gt),te(this,void 0,function(t){return 0!==t.length},null))},e.prototype.hasSize=function(t){var e=function(t,e){return t.length===e};return new ee(new kt(this.metadata,qt),te(this,t,e,null))},e.prototype.hasNotSize=function(t){var e=function(t,e){return t.length!==e};return new ee(new kt(this.metadata,zt),te(this,t,e,null))},e.prototype.length=function(){return new re(new kt(this.metadata,q),te(this,void 0,function(t){return t.length},null))},e}($t),ue=function(){function t(t){var e=this;this.metadata=t,this.get=w.apply(void 0,t.path),this.metadata.siblings&&this.metadata.siblings.length>0?this.set=function(n,r,a){return h.apply(void 0,[e.metadata.siblings.reduce(function(t,e){return h.apply(void 0,[t,r].concat(e))},n),r].concat(t.path))}:this.set=m.apply(void 0,t.path)}return t.field=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new t(new g(e))},t.prototype.withPosition=function(e){return new t(new g(this.metadata.path,this.metadata.tags,e,this.metadata.siblings))},t.prototype.withTags=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new t(new g(this.metadata.path,e,this.metadata.position,this.metadata.siblings))},t.prototype.withSiblings=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new t(new g(this.metadata.path,this.metadata.tags,this.metadata.position,e))},t.prototype.position=function(){var t=this;return new re(new kt(this.metadata,Qt),function(){return t.metadata.position})},t.prototype.tags=function(){var t=this;return new ae(new kt(this.metadata,Xt),function(){return t.metadata.tags})},t}(),ie=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.string=function(t){return new e(t.metadata,t.get,t.set)},e.prototype.contains=function(t){var n=function(t,e){return t.includes(e)};return new ee(new O(this.metadata,j,t instanceof e?t.metadata:new Jt(t)),te(this,t,n,!1))},e.prototype.matches=function(t){var n=function(t,e){return new RegExp(e).test(t)};return new ee(new O(this.metadata,V,t instanceof e?t.metadata:new Jt(t)),te(this,t,n,!1))},e.prototype.startsWith=function(t){var n=function(t,e){return t.startsWith(e)};return new ee(new O(this.metadata,W,t instanceof e?t.metadata:new Jt(t)),te(this,t,n,!1))},e.prototype.endsWith=function(t){var n=function(t,e){return t.endsWith(e)};return new ee(new O(this.metadata,G,t instanceof e?t.metadata:new Jt(t)),te(this,t,n,!1))},e.prototype.length=function(){return new re(new kt(this.metadata,q),te(this,void 0,function(t){return t.length},0))},e.prototype.parseInt=function(){return new re(new kt(this.metadata,z),te(this,void 0,function(t){return parseInt(t)},null))},e.prototype.trim=function(){return new e(new kt(this.metadata,Q),te(this,void 0,function(t){return t.trim()},null))},e.prototype.replaceAll=function(t,n){return new e(new O(this.metadata,J,new O(new Jt(t),_,new Jt(n))),te(this,void 0,function(e){return e.replace(t,n)},null))},e.prototype.substring=function(t,n){return new e(new O(this.metadata,K,new O(new Jt(t),_,new Jt(n))),te(this,void 0,function(e){return e.substring(t,n)},null))},e.prototype.localeUpperCase=function(){return new e(new kt(this.metadata,X),te(this,void 0,function(t){return t.toLocaleUpperCase()},null))},e.prototype.localeLowerCase=function(){return new e(new kt(this.metadata,Z),te(this,void 0,function(t){return t.toLocaleLowerCase()},null))},e.prototype.concat=function(t){return new e(new O(this.metadata,k,t instanceof e?t.metadata:new Jt(t)),te(this,t,function(t,e){return t+e},null))},e}($t),oe=function(t){function e(e,n,r){var a=t.call(this)||this;return a.type="CONDITIONAL_MAPPING",a.whenMetadata=e,a.thenMetadata=n,a.elseMetadata=r,a}return n(e,t),e.prototype.children=function(){var t=[this.whenMetadata,this.thenMetadata];return null!=this.elseMetadata?t.concat(this.elseMetadata):t},Object.defineProperty(e.prototype,"readable",{get:function(){return this.whenMetadata.readable+" "+A.readable+" "+this.thenMetadata.readable+(null!=this.elseMetadata?" "+S.readable+" "+this.elseMetadata.readable:"")},enumerable:!0,configurable:!0}),e}(v),ce=function(){function t(t){this.type="WHEN",this.metadata=t,this.operator=E}return Object.defineProperty(t.prototype,"readable",{get:function(){return this.operator.readable+" "+this.metadata.readable},enumerable:!0,configurable:!0}),t.prototype.children=function(){return[this.metadata]},t}(),se=function(t){function e(e,n){var r=t.call(this,n)||this;return r.type="MULTIPLE_MAPPING",r.mappings=e,r}return n(e,t),Object.defineProperty(e.prototype,"readable",{get:function(){return this.mappings.map(function(t){return t.readable}).join(" , ")},enumerable:!0,configurable:!0}),e.prototype.children=function(){return this.mappings},e}(v),fe=function(){function t(t){void 0===t&&(t=!0),this.props={},this.getValues=[],this.setValues=[],this.shortCircuit=t}return t.prototype.addGetValue=function(t,e){this.getValues.push({metadata:t,value:e})},t.prototype.addSetValue=function(t,e){this.setValues.push({metadata:t,value:e})},t}(),le=function(){function t(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this.condition=t,this.mappings=e;var r=e.map(function(t){return t.metadata});this.metadata=new oe(new ce(t.metadata),new se(r,A))}return t.prototype.execute=function(t,e){var n=e||new fe;return this.condition.get(t,e)?this.mappings.reduce(function(t,e){return e.execute(t,n)},t):this.elseMappings?this.elseMappings.reduce(function(t,e){return e.execute(t,n)},t):t},t.prototype.executeOn=function(t,e,n){var r=n||new fe;return this.condition.get(t,n)?(this.mappings.forEach(function(n){e=n.executeOn(t,e,r)}),e):this.elseMappings?(this.elseMappings.forEach(function(n){e=n.executeOn(t,e,r)}),e):e},t.prototype.otherwise=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.elseMappings=t;var n=t.map(function(t){return t.metadata});return this.metadata=new oe(this.metadata.whenMetadata,this.metadata.thenMetadata,new se(n,S)),this},t}(),pe=function(t,e){this.value=t,this.context=e},de=function(t){function e(e){var n=t.call(this,M)||this;return n.type="VALIDATION",n.when=e,n}return n(e,t),Object.defineProperty(e.prototype,"readable",{get:function(){return this.operator.readable+" "+this.when.readable},enumerable:!0,configurable:!0}),e.prototype.children=function(){return[this.when]},e}(v),he=function(){function t(t){this.when=t,this.metadata=new de(t.metadata)}return t.prototype.execute=function(t,e){void 0===t&&(t={});var n=e||new fe;return new pe(this.when.condition.get(t,n),n)},t}(),we=function(){function t(t){this.condition=t,this.metadata=new ce(t.metadata)}return t.prototype.validate=function(){return new he(this)},t.prototype.then=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new(le.bind.apply(le,[void 0,this.condition].concat(t)))},t}(),me=function(t){function e(e,n){var r=t.call(this,b)||this;return r.type="SINGLE_MAPPING",r.sourceMetadata=e,r.targetMetadata=n,r}return n(e,t),Object.defineProperty(e.prototype,"readable",{get:function(){return this.sourceMetadata.readable+" "+lt.readable+" "+this.targetMetadata.readable},enumerable:!0,configurable:!0}),e.prototype.children=function(){return[this.sourceMetadata,this.targetMetadata]},e}(v),ye=function(){function t(t,e){this.input=t,this.output=e,this.metadata=new me(t.metadata,e.metadata)}return t.prototype.execute=function(t,e){var n=e||new fe;return this.output.set?this.output.set(t,this.input.get(t,n),n):t},t.prototype.executeOn=function(t,e,n){var r=n||new fe;return this.output.set?this.output.set(e,this.input.get(t,r),r):e},t}(),ve=function(t){function e(e,n){var r=t.call(this,new O(e.metadata,pt,n.metadata),function(t,r){return n.convert(t,e,r)})||this;return r.input=e,r.converter=n,r}return n(e,t),e.prototype.using=function(t){return new e(this,t)},e.prototype.to=function(t){return new ye(this,t)},e}($t),ge=function(){function t(t){this.input=t}return t.prototype.to=function(t){return new ye(this.input,t)},t.prototype.using=function(t){return new ve(this.input,t)},t}(),Te=function(){function t(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.mappings=o(e,function(e){return e instanceof t?e.mappings:[e]}),this.metadata=new se(this.mappings.map(function(t){return t.metadata}))}return t.prototype.execute=function(t,e){var n=e||new fe;return this.mappings.reduce(function(t,e){return e.execute(t,n)},t)},t.prototype.executeOn=function(t,e,n){var r=n||new fe;return this.mappings.forEach(function(n){e=n.executeOn(t,e,r)}),e},t}(),Oe=function(t,e,n){this.type="TYPE_CONVERTER",this.operator=n,this.body=t,this.readable=null!=e?e:t},be=function(t,e){this.convert=t,this.metadata=new Oe(t.toString(),e)},Ee=function(t){function e(e,n,r){var a=t.call(this,new O(new O(e.metadata,_,n.metadata),pt,r.metadata),function(t,a){return r.convert(t,e,n,a)})||this;return a.input=e,a.input2=n,a.converter=r,a}return n(e,t),e.prototype.using=function(t){return new ve(this,t)},e.prototype.to=function(t){return new ye(this,t)},e}($t),Me=function(){function t(t,e){this.input=t,this.input2=e}return t.prototype.using=function(t){return new Ee(this.input,this.input2,t instanceof be?t:new be(t))},t}(),Re=function(t,e){this.convert=t,this.metadata=new Oe(t.toString(),e)},_e=function(t){function e(e,n){var r=t.call(this,new O(new ne(e.map(function(t){return t.metadata}),dt),pt,n.metadata),function(t,r){return n.convert(t,e,r)})||this;return r.inputs=e,r.converter=n,r}return n(e,t),e.prototype.using=function(t){return new ve(this,t)},e.prototype.to=function(t){return new ye(this,t)},e}($t),Ne=function(){function t(t){this.inputs=t}return t.prototype.using=function(t){return new _e(this.inputs,t instanceof Re?t:new Re(t))},t}();function Ae(t,e){for(t=String(t),e=e||2;t.length<e;)t="0"+t;return t}function Se(){return new Date(Date.now())}function He(t){return new Date(t.valueOf())}function Ie(t,e,n,r,a,u,i){return new Date(Date.UTC(t,e,n||0,r||0,a||0,u||0,i||0))}function Le(t){var e=He(t);return e.getFullYear().toString()+Ae(e.getMonth()+1,2)+Ae(e.getDate(),2)}function De(t){var e=He(t);return Ae(e.getDate(),2)+Ae(e.getMonth()+1,2)+e.getFullYear()}function Ye(t){var e=Number.parseInt(t.slice(0,4)),n=Number.parseInt(t.slice(4,6))-1,r=Number.parseInt(t.slice(6,8));return new Date(e,n,r)}function Fe(t,e){var n=e||Se(),r=12*(n.getFullYear()-t.getFullYear())+(n.getMonth()-t.getMonth());return n.getDate()-t.getDate()>=0?r:r-1}function Pe(t,e){var n=e.getFullYear()-t.getFullYear(),r=e.getMonth()-t.getMonth(),a=e.getDate()-t.getDate();return r>=0&&a>=0?n:n-1}var Be=Object.freeze({now:Se,clone:He,newUTCDate:Ie,formatYYYYMMdd:Le,formatddMMYYYY:De,formatReadable:function(t){var e=He(t);return Ae(e.getDate(),2)+"/"+Ae(e.getMonth()+1,2)+"/"+e.getFullYear()},formatMMMMYYYY:function(t,e){var n=He(t);return new Intl.DateTimeFormat(e,{month:"long"}).format(t)+" "+n.getFullYear()},formatEEEEddMMMM:function(t,e){var n=He(t),r=new Intl.DateTimeFormat(e,{weekday:"long"}).format(n),a=new Intl.DateTimeFormat(e,{month:"long"}).format(n);return r+" "+Ae(n.getDate(),2)+" "+a},formatTime:function(t){var e=He(t);return Ae(t.getHours(),2)+Ae(e.getMinutes(),2)+Ae(t.getSeconds(),2)},parse:Ye,numberOfFullMonthsBetween:Fe,numberOfFullYearsBetween:Pe}),Ue=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.equals=function(e,n){return e&&n?e.getTime()===n.getTime():t.prototype.equals.call(this,e,n)},e.date=function(t){return new e(t.metadata,t.get,t.set)},e.dateIso=function(t){return new e(t.metadata,function(e,n){var r=t.get(e,n);return i(r)?r:Ye(r)},function(e,n,r){return i(n)?t.set?t.set(e,n,r):e:t.set?t.set(e,Le(n),r):e})},e.min=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.map(function(t){return t instanceof e?t.metadata:new Jt(t)});return new e(new ne(r,$),function(n,r){var a=function(t,e){return t<e?t:e};return t.reduce(function(t,e){if(e instanceof $t){var u=e.get(n,r);return null!=u?a(u,t):t}return a(e,t)},e.MAX_DATE)})},e.max=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.map(function(t){return t instanceof e?t.metadata:new Jt(t)});return new e(new ne(r,tt),function(n,r){var a=function(t,e){return t>e?t:e};return t.reduce(function(t,e){if(e instanceof $t){var u=e.get(n,r);return null!=u?a(u,t):t}return a(e,t)},e.MIN_DATE)})},e.thisYear=function(){return new re(new T("clone().getFullYear()",void 0,_t),function(){return Se().getFullYear()})},e.thisMonth=function(){return new re(new T("clone().getMonth() + 1",void 0,Nt),function(){return Se().getMonth()+1})},e.today=function(){return new e(new T("clone()",void 0,At),function(){return Se()})},e.tomorrow=function(){return new e(new T("date.setDate(date.getDate() + 1)",void 0,St),function(){var t=Se();return t.setDate(t.getDate()+1),t})},e.dateFrom=function(t){return new e(new T("Date{"+t+"}"),function(){return Ye(t)})},e.newDate=function(t,n,r){return new e(new T("Date{ Y:"+t+" M:"+n+" D:"+r+" }"),function(){return Ie(t,n,r)})},e.newLocalDate=function(t,n,r){return new e(new T("Date{ Y:"+t+" M:"+n+" D:"+r+" }"),function(){return new Date(t,n,r)})},e.prototype.before=function(t){var n=function(t,e){return t<e};return new ee(new O(this.metadata,mt,t instanceof e?t.metadata:new Jt(t)),te(this,t,n,!1))},e.prototype.beforeOrEquals=function(t){var n=function(t,e){return t<=e};return new ee(new O(this.metadata,yt,t instanceof e?t.metadata:new Jt(t)),te(this,t,n,!1))},e.prototype.after=function(t){var n=function(t,e){return t>e};return new ee(new O(this.metadata,ht,t instanceof e?t.metadata:new Jt(t)),te(this,t,n,!1))},e.prototype.afterOrEquals=function(t){var n=function(t,e){return t>=e};return new ee(new O(this.metadata,wt,t instanceof e?t.metadata:new Jt(t)),te(this,t,n,!1))},e.prototype.between=function(t,e){return this.afterOrEquals(t).and(this.before(e))},e.prototype.plusDays=function(t){var n=function(t,e){var n=He(t);return n.setDate(t.getDate()+e),n};return new e(new O(this.metadata,vt,t instanceof re?t.metadata:new Jt(t)),te(this,t,n,null))},e.prototype.minusDays=function(t){var n=function(t,e){var n=He(t);return n.setDate(n.getDate()-e),n};return new e(new O(this.metadata,gt,t instanceof re?t.metadata:new Jt(t)),te(this,t,n,null))},e.prototype.plusMonths=function(t){var n=function(t,e){var n=He(t);return n.setMonth(n.getMonth()+e),n};return new e(new O(this.metadata,Tt,t instanceof re?t.metadata:new Jt(t)),te(this,t,n,null))},e.prototype.minusMonths=function(t){var n=function(t,e){var n=He(t);return n.setMonth(n.getMonth()-e),n};return new e(new O(this.metadata,Ot,t instanceof re?t.metadata:new Jt(t)),te(this,t,n,null))},e.prototype.plusYears=function(t){var n=function(t,e){var n=He(t);return n.setFullYear(n.getFullYear()+e),n};return new e(new O(this.metadata,bt,t instanceof re?t.metadata:new Jt(t)),te(this,t,n,null))},e.prototype.minusYears=function(t){var n=function(t,e){var n=He(t);return n.setFullYear(n.getFullYear()-e),n};return new e(new O(this.metadata,Et,t instanceof re?t.metadata:new Jt(t)),te(this,t,n,null))},e.prototype.formatISO=function(){return new ie(new kt(this.metadata,Mt),te(this,void 0,function(t){return Le(t)},null))},e.prototype.dayMonthYear=function(){return new ie(new kt(this.metadata,Rt),te(this,void 0,function(t){return De(t)},null))},e.nbFullMonthsSince=function(t){return new re(new kt(t.metadata,Ut),te(t,void 0,function(t){return Fe(t)},null))},e.nbFullMonthsBetween=function(t,n){return n instanceof e?new re(new ne([t.metadata,n.metadata],Ct),te(t,n,function(t,e){return Fe(t,e)},null)):new re(new ne([t.metadata,new Jt(n)],Ct),te(t,n,Fe,null))},e.nbFullYearsBetween=function(t,n){return new re(new ne(n instanceof e?[t.metadata,n.metadata]:[t.metadata,new Jt(n)],xt),te(t,n,Pe,null))},e.prototype.withDayOfMonth=function(t){var n=function(t,e){var n=He(t);return n.setDate(e),n};return new e(new O(this.metadata,Ht,new Jt(t)),te(this,t,n,null))},e.prototype.withMonth=function(t){var n=function(t,e){var n=He(t);return n.setMonth(e),n};return new e(new O(this.metadata,It,new Jt(t)),te(this,t,n,null))},e.prototype.withYear=function(t){var n=function(t,e){var n=He(t);return n.setFullYear(e),n};return new e(new O(this.metadata,Lt,new Jt(t)),te(this,t,n,null))},e.prototype.withFirstDayOfNextYear=function(){return new e(new kt(this.metadata,Dt),te(this,void 0,function(t){var e=He(t);return e.setMonth(11),e.setDate(32),e},null))},e.prototype.withLastDayOfLastYear=function(){return new e(new kt(this.metadata,Yt),te(this,void 0,function(t){var e=He(t);return e.setMonth(0),e.setDate(0),e},null))},e.prototype.monthOf=function(){return new re(new kt(this.metadata,Ft),te(this,void 0,function(t){return t.getMonth()},null))},e.prototype.yearOf=function(){return new re(new kt(this.metadata,Pt),te(this,void 0,function(t){return t.getFullYear()},null))},e.prototype.dateOf=function(){return new re(new kt(this.metadata,Bt),te(this,void 0,function(t){return t.getDate()},null))},e.prototype.ageAt=function(t){return new re(new O(this.metadata,jt,t instanceof e?t.metadata:new Jt(t)),te(this,t,Pe,null))},e.MAX_DATE=new Date(864e13),e.MIN_DATE=new Date(-864e13),e}($t),Ce=function(t,e){this.convert=t,this.metadata=new Oe(t.toString(),e)};var xe=Object.freeze({fieldsOf:function t(e){var n=e;return"FIELD"==n.type?[n.path]:e.children?e.children().reduce(function(e,n){return e.concat(t(n))},[]):[]}}),je=function(t){function e(e,n){var r=t.call(this,n)||this;return r.type="MULTIPLE_VALIDATIONS",r.mappings=e,r}return n(e,t),Object.defineProperty(e.prototype,"readable",{get:function(){return this.mappings.map(function(t){return t.readable}).join(" , ")},enumerable:!0,configurable:!0}),e.prototype.children=function(){return this.mappings},e}(v),Ve=function(){function t(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.validations=o(e,function(e){return e instanceof t?e.validations:[e]}),this.metadata=new je(this.validations.map(function(t){return t.metadata}))}return t.prototype.execute=function(t,e){var n=e||new fe;return this.validations.map(function(e){return e.execute(t,n)}).find(function(t){return!0===t.value})||new pe(!1,n)},t}();t.AFTER=ht,t.AFTER_OR_EQUALS=wt,t.AGE_AT=jt,t.AND=_,t.AS_INT=z,t.AbstractMetadata=v,t.BEFORE=mt,t.BEFORE_OR_EQUALS=yt,t.BiTypeConverter=be,t.BinaryMetadata=O,t.BooleanFunction=ee,t.CONCAT=k,t.CONTAINS=j,t.CONTAINS_ALL=Vt,t.COUNT=nt,t.ConditionalMappingMetadata=oe,t.DATE_OF=Bt,t.DIVIDE=ft,t.DateFunction=Ue,t.DateUtils=Be,t.DefaultContext=fe,t.ELSE=S,t.ENDS_WITH=G,t.EQ=P,t.FIELD_PROP={readable:":",returnType:"OTHER"},t.FORMAT_DAY_MONTH_YEAR=Rt,t.FORMAT_ISO=Mt,t.FUNCTION=H,t.FUNCTIONS=Zt,t.Field=ue,t.FieldMetadata=g,t.Function=$t,t.FunctionMetadata=T,t.GREATER_OR_EQUALS=it,t.GREATER_THAN=ut,t.HAS_NOT_SIZE=zt,t.HAS_SIZE=qt,t.HAS_VALUE=I,t.IS_DEFINED=Y,t.IS_EMPTY=Wt,t.IS_NOT_EMPTY=Gt,t.IS_NOT_NULL=D,t.IS_NULL=L,t.IS_UNDEFINED=F,t.IterableFunction=ae,t.IterableMetadata=Kt,t.LENGTH=q,t.LESSER_OR_EQUALS=at,t.LESSER_THAN=rt,t.LOWER_CASE=Z,t.MATCHES=V,t.MATCH_ALL=U,t.MATCH_ANY=x,t.MAX=tt,t.MIN=$,t.MINUS=ct,t.MINUS_DAYS=gt,t.MINUS_MONTHS=Ot,t.MINUS_YEARS=Et,t.MONTH_OF=Ft,t.MULTIPLE_INPUTS=dt,t.MetadataUtils=xe,t.MultipleMappingsMetadata=se,t.MultipleValidationsMetadata=je,t.NB_OF_MONTHS_BETWEEN=Ct,t.NB_OF_MONTHS_SINCE=Ut,t.NB_OF_YEARS_BETWEEN=xt,t.NONE_MATCH=C,t.NOT=R,t.NOT_EQ=B,t.NaryMetadata=ne,t.NaryTypeConverter=Re,t.NumberFunction=re,t.OR=N,t.PLUS=ot,t.PLUS_DAYS=vt,t.PLUS_MONTHS=Tt,t.PLUS_YEARS=bt,t.POSITION=Qt,t.Paths=y,t.REPLACE_ALL=J,t.Result=pe,t.SINGLE_MAPPING=b,t.STARTS_WITH=W,t.SUB_STRING=K,t.SUM=et,t.SingleMappingMetadata=me,t.SingleValidationRule=he,t.StepWhen=we,t.StringFunction=ie,t.TAGS=Xt,t.THEN=A,t.THIS_MONTH=Nt,t.THIS_YEAR=_t,t.TIMES=st,t.TO=lt,t.TODAY=At,t.TOMORROW=St,t.TRIM=Q,t.TypeConverter=Ce,t.TypeConverterMetadata=Oe,t.UPPER_CASE=X,t.USING=pt,t.UnaryMetadata=kt,t.Utils=c,t.VALIDATE=M,t.ValidationRuleMetadata=de,t.Validations=Ve,t.ValueMetadata=Jt,t.WHEN=E,t.WITH_DAY_OF_MONTH=Ht,t.WITH_FIRST_DAY_OF_NEXT_YEAR=Dt,t.WITH_LAST_DAY_OF_LAST_YEAR=Yt,t.WITH_MONTH=It,t.WITH_YEAR=Lt,t.WhenMetadata=ce,t.YEAR_OF=Pt,t.biConverter=function(t,e){return new be(t,e)},t.boolean=function(t){return ee.boolean(t)},t.condition=te,t.converter=function(t,e){return new Ce(t,e)},t.count=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new re(new ne(t.map(function(t){return t.metadata}),nt),function(e,n){return t.filter(function(t){var r=t.get(e,n);return null!=r&&r}).length})},t.date=function(t){return Ue.date(t)},t.dateIso=function(t){return Ue.dateIso(t)},t.f=function(t){return $t.function(t)},t.field=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ue.field.apply(ue,t)},t.iterable=function(t){return ae.iterable(t)},t.lift=function(t,e){return $t.lift(t,e)},t.map=function(t,e){return e?new Me(t instanceof $t?t:new $t(new Jt(t),function(e){return t}),e instanceof $t?e:new $t(new Jt(e),function(t){return e})):new ge(t instanceof $t?t:new $t(new Jt(t),function(e){return t}))},t.mapAll=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Ne(t)},t.mapNull=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1==t.length?new ye(new $t(new Jt(null),function(t){return null}),t[0]):new ye(new $t(new Jt(null),function(t){return null}),$t.consumer(new ne(t.map(function(t){return t.metadata}),Zt),function(e,n,r){for(var a=0,u=t;a<u.length;a++){var i=u[a];e=i.set?i.set(e,n,r):e}return e}))},t.mappings=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new(Te.bind.apply(Te,[void 0].concat(t)))},t.matchAll=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new ee(new ne(t.map(function(t){return t.metadata}),U),function(e,n){return t.every(function(t){var r=t.get(e,n);return null!=r&&r})})},t.matchAny=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new ee(new ne(t.map(function(t){return t.metadata}),x),function(e,n){return t.some(function(t){var r=t.get(e,n);return null!=r&&r})})},t.matchNone=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new ee(new ne(t.map(function(t){return t.metadata}),C),function(e,n){return t.every(function(t){var r=t.get(e,n);return null!=r&&!r})})},t.naryConverter=function(t,e){return new Re(t,e)},t.number=function(t){return re.number(t)},t.position=function(t){return new re(new kt(t.metadata,Qt),function(){return t.metadata instanceof g?t.metadata.position:void 0})},t.string=function(t){return ie.string(t)},t.sum=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new re(new ne(t.map(function(t){return t.metadata}),et),function(e,n){return t.reduce(function(t,r){var a=r.get(e,n);return null!=a?t+a:t},0)})},t.tags=function(t){return new ae(new kt(t.metadata,Xt),function(){return t.metadata instanceof g?t.metadata.tags:[]})},t.validations=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new(Ve.bind.apply(Ve,[void 0].concat(t)))},t.when=function(t){return new we(t)},Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=doov.js.map |
@@ -69,2 +69,3 @@ import { Field } from './dsl/Field'; | ||
export { Result } from './dsl/Result'; | ||
export { MappingRule } from './dsl/lang/MappingRule'; | ||
export { AbstractMetadata } from './dsl/meta/AbstractMetadata'; | ||
@@ -90,1 +91,2 @@ export { BinaryMetadata } from './dsl/meta/BinaryMetadata'; | ||
export { Paths }; | ||
export * from './dsl/lang/DefaultOperators'; |
@@ -1,83 +0,84 @@ | ||
import { Operator } from '../Operator'; | ||
export declare const SINGLE_MAPPING: Operator; | ||
export declare const WHEN: Operator; | ||
export declare const VALIDATE: Operator; | ||
export declare const NOT: Operator; | ||
export declare const AND: Operator; | ||
export declare const OR: Operator; | ||
export declare const THEN: Operator; | ||
export declare const ELSE: Operator; | ||
export declare const FUNCTION: Operator; | ||
export declare const HAS_VALUE: Operator; | ||
export declare const IS_NULL: Operator; | ||
export declare const IS_NOT_NULL: Operator; | ||
export declare const IS_DEFINED: Operator; | ||
export declare const IS_UNDEFINED: Operator; | ||
export declare const EQ: Operator; | ||
export declare const NOT_EQ: Operator; | ||
export declare const MATCH_ALL: Operator; | ||
export declare const NONE_MATCH: Operator; | ||
export declare const MATCH_ANY: Operator; | ||
export declare const CONTAINS: Operator; | ||
export declare const MATCHES: Operator; | ||
export declare const STARTS_WITH: Operator; | ||
export declare const ENDS_WITH: Operator; | ||
export declare const LENGTH: Operator; | ||
export declare const AS_INT: Operator; | ||
export declare const TRIM: Operator; | ||
export declare const UPPER_CASE: Operator; | ||
export declare const LOWER_CASE: Operator; | ||
export declare const CONCAT: Operator; | ||
export declare const REPLACE_ALL: Operator; | ||
export declare const SUB_STRING: Operator; | ||
export declare const MIN: Operator; | ||
export declare const MAX: Operator; | ||
export declare const SUM: Operator; | ||
export declare const COUNT: Operator; | ||
export declare const LESSER_THAN: Operator; | ||
export declare const LESSER_OR_EQUALS: Operator; | ||
export declare const GREATER_THAN: Operator; | ||
export declare const GREATER_OR_EQUALS: Operator; | ||
export declare const PLUS: Operator; | ||
export declare const MINUS: Operator; | ||
export declare const TIMES: Operator; | ||
export declare const DIVIDE: Operator; | ||
export declare const TO: Operator; | ||
export declare const USING: Operator; | ||
export declare const MULTIPLE_INPUTS: Operator; | ||
export declare const AFTER: Operator; | ||
export declare const AFTER_OR_EQUALS: Operator; | ||
export declare const BEFORE: Operator; | ||
export declare const BEFORE_OR_EQUALS: Operator; | ||
export declare const PLUS_DAYS: Operator; | ||
export declare const MINUS_DAYS: Operator; | ||
export declare const PLUS_MONTHS: Operator; | ||
export declare const MINUS_MONTHS: Operator; | ||
export declare const PLUS_YEARS: Operator; | ||
export declare const MINUS_YEARS: Operator; | ||
export declare const FORMAT_ISO: Operator; | ||
export declare const FORMAT_DAY_MONTH_YEAR: Operator; | ||
export declare const THIS_YEAR: Operator; | ||
export declare const THIS_MONTH: Operator; | ||
export declare const TODAY: Operator; | ||
export declare const TOMORROW: Operator; | ||
export declare const WITH_DAY_OF_MONTH: Operator; | ||
export declare const WITH_MONTH: Operator; | ||
export declare const WITH_YEAR: Operator; | ||
export declare const WITH_FIRST_DAY_OF_NEXT_YEAR: Operator; | ||
export declare const WITH_LAST_DAY_OF_LAST_YEAR: Operator; | ||
export declare const MONTH_OF: Operator; | ||
export declare const YEAR_OF: Operator; | ||
export declare const DATE_OF: Operator; | ||
export declare const NB_OF_MONTHS_SINCE: Operator; | ||
export declare const NB_OF_MONTHS_BETWEEN: Operator; | ||
export declare const NB_OF_YEARS_BETWEEN: Operator; | ||
export declare const AGE_AT: Operator; | ||
export declare const CONTAINS_ALL: Operator; | ||
export declare const IS_EMPTY: Operator; | ||
export declare const IS_NOT_EMPTY: Operator; | ||
export declare const HAS_SIZE: Operator; | ||
export declare const HAS_NOT_SIZE: Operator; | ||
export declare const POSITION: Operator; | ||
export declare const TAGS: Operator; | ||
export declare const FUNCTIONS: Operator; | ||
import { OperatorReturnType } from '../Operator'; | ||
export declare const SINGLE_MAPPING: OperatorReturnType; | ||
export declare const WHEN: OperatorReturnType; | ||
export declare const VALIDATE: OperatorReturnType; | ||
export declare const NOT: OperatorReturnType; | ||
export declare const AND: OperatorReturnType; | ||
export declare const OR: OperatorReturnType; | ||
export declare const THEN: OperatorReturnType; | ||
export declare const ELSE: OperatorReturnType; | ||
export declare const FUNCTION: OperatorReturnType; | ||
export declare const HAS_VALUE: OperatorReturnType; | ||
export declare const IS_NULL: OperatorReturnType; | ||
export declare const IS_NOT_NULL: OperatorReturnType; | ||
export declare const IS_DEFINED: OperatorReturnType; | ||
export declare const IS_UNDEFINED: OperatorReturnType; | ||
export declare const EQ: OperatorReturnType; | ||
export declare const NOT_EQ: OperatorReturnType; | ||
export declare const MATCH_ALL: OperatorReturnType; | ||
export declare const NONE_MATCH: OperatorReturnType; | ||
export declare const MATCH_ANY: OperatorReturnType; | ||
export declare const CONTAINS: OperatorReturnType; | ||
export declare const MATCHES: OperatorReturnType; | ||
export declare const STARTS_WITH: OperatorReturnType; | ||
export declare const ENDS_WITH: OperatorReturnType; | ||
export declare const LENGTH: OperatorReturnType; | ||
export declare const AS_INT: OperatorReturnType; | ||
export declare const TRIM: OperatorReturnType; | ||
export declare const UPPER_CASE: OperatorReturnType; | ||
export declare const LOWER_CASE: OperatorReturnType; | ||
export declare const CONCAT: OperatorReturnType; | ||
export declare const REPLACE_ALL: OperatorReturnType; | ||
export declare const SUB_STRING: OperatorReturnType; | ||
export declare const MIN: OperatorReturnType; | ||
export declare const MAX: OperatorReturnType; | ||
export declare const SUM: OperatorReturnType; | ||
export declare const COUNT: OperatorReturnType; | ||
export declare const LESSER_THAN: OperatorReturnType; | ||
export declare const LESSER_OR_EQUALS: OperatorReturnType; | ||
export declare const GREATER_THAN: OperatorReturnType; | ||
export declare const GREATER_OR_EQUALS: OperatorReturnType; | ||
export declare const PLUS: OperatorReturnType; | ||
export declare const MINUS: OperatorReturnType; | ||
export declare const TIMES: OperatorReturnType; | ||
export declare const DIVIDE: OperatorReturnType; | ||
export declare const TO: OperatorReturnType; | ||
export declare const USING: OperatorReturnType; | ||
export declare const MULTIPLE_INPUTS: OperatorReturnType; | ||
export declare const AFTER: OperatorReturnType; | ||
export declare const AFTER_OR_EQUALS: OperatorReturnType; | ||
export declare const BEFORE: OperatorReturnType; | ||
export declare const BEFORE_OR_EQUALS: OperatorReturnType; | ||
export declare const PLUS_DAYS: OperatorReturnType; | ||
export declare const MINUS_DAYS: OperatorReturnType; | ||
export declare const PLUS_MONTHS: OperatorReturnType; | ||
export declare const MINUS_MONTHS: OperatorReturnType; | ||
export declare const PLUS_YEARS: OperatorReturnType; | ||
export declare const MINUS_YEARS: OperatorReturnType; | ||
export declare const FORMAT_ISO: OperatorReturnType; | ||
export declare const FORMAT_DAY_MONTH_YEAR: OperatorReturnType; | ||
export declare const THIS_YEAR: OperatorReturnType; | ||
export declare const THIS_MONTH: OperatorReturnType; | ||
export declare const TODAY: OperatorReturnType; | ||
export declare const TOMORROW: OperatorReturnType; | ||
export declare const WITH_DAY_OF_MONTH: OperatorReturnType; | ||
export declare const WITH_MONTH: OperatorReturnType; | ||
export declare const WITH_YEAR: OperatorReturnType; | ||
export declare const WITH_FIRST_DAY_OF_NEXT_YEAR: OperatorReturnType; | ||
export declare const WITH_LAST_DAY_OF_LAST_YEAR: OperatorReturnType; | ||
export declare const MONTH_OF: OperatorReturnType; | ||
export declare const YEAR_OF: OperatorReturnType; | ||
export declare const DATE_OF: OperatorReturnType; | ||
export declare const NB_OF_MONTHS_SINCE: OperatorReturnType; | ||
export declare const NB_OF_MONTHS_BETWEEN: OperatorReturnType; | ||
export declare const NB_OF_YEARS_BETWEEN: OperatorReturnType; | ||
export declare const AGE_AT: OperatorReturnType; | ||
export declare const CONTAINS_ALL: OperatorReturnType; | ||
export declare const IS_EMPTY: OperatorReturnType; | ||
export declare const IS_NOT_EMPTY: OperatorReturnType; | ||
export declare const HAS_SIZE: OperatorReturnType; | ||
export declare const HAS_NOT_SIZE: OperatorReturnType; | ||
export declare const POSITION: OperatorReturnType; | ||
export declare const TAGS: OperatorReturnType; | ||
export declare const FUNCTIONS: OperatorReturnType; | ||
export declare const FIELD_PROP: OperatorReturnType; |
@@ -5,1 +5,5 @@ import { Readable } from './Readable'; | ||
} | ||
export interface OperatorReturnType extends Operator { | ||
returnType: ReturnType; | ||
} | ||
export declare type ReturnType = 'BOOL' | 'OTHER'; |
{ | ||
"name": "doov", | ||
"version": "0.10.9", | ||
"version": "0.11.0", | ||
"desciption": "dOOv (Domain Object Oriented Validation) a fluent API for type-safe bean validation and mapping", | ||
@@ -5,0 +5,0 @@ "homepage": "https://doov.io", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
421693
1148