Comparing version 0.9.1 to 0.10.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}var u=Object.freeze({hasProperty:r,isInteger:a,nullOrUndefined:i});function o(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.join(".")}function c(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 s(t,n,r){var a=e({},r);return a[t]=n,a}function f(t,n,r){return n.then(function(n){var a=e({},r);return a[t]=n,a})}function l(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=l.apply(void 0,[o,n].concat(Array.prototype.slice.call(e,1)))}return f(u,n,t)}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 s(u,n,t)}var d=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n){return c.apply(void 0,[n].concat(t))}},p=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n,e){return h.apply(void 0,[n,e].concat(t))}},w=Object.freeze({path:function(t){return t.split(".").map(function(t){var n=parseInt(t);return isNaN(n)?t:n})},pathString:o,getPath:c,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:s,setPropPromise:f,setPathPromise:l,setPathPromiseValue:function(t,n){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];return l.apply(void 0,[t,Promise.resolve(n)].concat(e))},setPath:h,getter:d,setter:p}),m=function(t){this.operator=t},v=function(t){function e(n,e,r){void 0===e&&(e=[]),void 0===r&&(r=-1);var i=t.call(this)||this;i.type="FIELD",i.readable=o.apply(void 0,n),i.path=n.slice(),i.tags=e;var u=n.filter(function(t){return a(t)});return i.position=-1===r&&u.length>=1?u[u.length-1]:r,i}return n(e,t),e}(m);var g=function(t,n,e){this.type="FUNCTION",this.operator=e,this.body=t,this.readable=null!=n?n:t},y=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}(m),b={readable:"single_mapping"},M={readable:"when"},D={readable:"validate"},O={readable:"not"},Y={readable:"and"},P={readable:"or"},N={readable:"then"},E={readable:"else"},I={readable:"function"},A={readable:"has value"},F={readable:"is null"},T={readable:"is not null"},j={readable:"is defined"},_={readable:"is undefined"},S={readable:"="},L={readable:"!="},x={readable:"match all"},V={readable:"none match"},C={readable:"match any"},U={readable:"contains"},R={readable:"matches"},q={readable:"starts with"},z={readable:"ends with"},G={readable:"length"},W={readable:"as integer"},B={readable:"trimmed"},X={readable:"upper case"},H={readable:"lower case"},k={readable:"concat"},J={readable:"replace all"},K={readable:"sub string"},Q={readable:"min"},Z={readable:"max"},$={readable:"sum"},tt={readable:"<"},nt={readable:"<="},et={readable:">"},rt={readable:">="},at={readable:"+"},it={readable:"-"},ut={readable:"*"},ot="->",ct={readable:"using"},st={readable:"multiple inputs"},ft={readable:">"},lt={readable:">="},ht={readable:"<"},dt={readable:"<="},pt={readable:"plus days"},wt={readable:"minus days"},mt={readable:"plus months"},vt={readable:"minus months"},gt={readable:"plus years"},yt={readable:"minus years"},bt={readable:"format iso"},Mt={readable:"format day month year"},Dt={readable:"this year"},Ot={readable:"this month"},Yt={readable:"today"},Pt={readable:"tomorrow"},Nt={readable:"with day of month"},Et={readable:"with month"},It={readable:"with year"},At={readable:"with first day of next year"},Ft={readable:"with last day of last year"},Tt={readable:"month of"},jt={readable:"year of"},_t={readable:"date of"},St={readable:"number of months since"},Lt={readable:"number of months between"},xt={readable:"contains all"},Vt={readable:"is empty"},Ct={readable:"is not empty"},Ut={readable:"has size"},Rt={readable:"has not size"},qt={readable:"position of"},zt={readable:"tags of"},Gt=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.metadata.readable+" "+this.operator.readable},enumerable:!0,configurable:!0}),e.prototype.children=function(){return[this.metadata]},e}(m),Wt=function(t){function e(n){var e=t.call(this)||this;return e.type="VALUE",e.readable=String(n),e.value=n,e}return n(e,t),e}(m),Bt=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}(m),Xt=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 Wt(n),function(){return n})},t.prototype.mapTo=function(t,n,e){var r=this;return new t(new y(this.metadata,I,new g(e||n.toString())),function(t,e){return n(r.get(t,e))})},t.prototype.hasValue=function(){var t=this;return new kt(new Gt(this.metadata,A),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 kt(new Gt(this.metadata,j),function(n,e){return void 0!==t.get(n,e)})},t.prototype.isUndefined=function(){var t=this;return new kt(new Gt(this.metadata,_),function(n,e){return void 0===t.get(n,e)})},t.prototype.isNull=function(){var t=this;return new kt(new Gt(this.metadata,F),function(n,e){return null===t.get(n,e)})},t.prototype.isNotNull=function(){var t=this;return new kt(new Gt(this.metadata,T),function(n,e){return null!==t.get(n,e)})},t.prototype.eq=function(n){var e=this;return n instanceof t?new kt(new y(this.metadata,S,n.metadata),function(t,r){return e.get(t,r)===n.get(t,r)}):new kt(new y(this.metadata,S,new Wt(n)),function(t,r){return e.get(t,r)===n})},t.prototype.notEq=function(n){var e=this;return n instanceof t?new kt(new y(this.metadata,L,n.metadata),function(t,r){return e.get(t,r)!==n.get(t,r)}):new kt(new y(this.metadata,L,new Wt(n)),function(t,r){return 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 Wt(n)});return new kt(new y(this.metadata,x,new Bt(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 Wt(n)});return new kt(new y(this.metadata,V,new Bt(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 Wt(n)});return new kt(new y(this.metadata,C,new Bt(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 Ht(t,n,e,r){return n instanceof Xt?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 kt=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 Gt(this.metadata,O),Ht(this,!1,function(t){return!t},!1))},e.prototype.and=function(t){var n=this;return new e(new y(this.metadata,Y,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 Ht(n,t,function(t,n){return t&&n},!1)(e,r)})},e.prototype.or=function(t){var n=this;return new e(new y(this.metadata,P,t instanceof e?t.metadata:new Wt(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 Ht(n,t,function(t,n){return t||n},!1)(r,a)})},e}(Xt),Jt=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}(m),Kt=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 Wt(t)});return new e(new Jt(r,Q),function(n,e){var r=function(t,n){return t<n?t:n};return t.reduce(function(t,a){if(a instanceof Xt){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 Wt(t)});return new e(new Jt(r,Z),function(n,e){var r=function(t,n){return t>n?t:n};return t.reduce(function(t,a){if(a instanceof Xt){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 Wt(t)});return new e(new Jt(r,$),function(n,e){var r=function(t,n){return t+n};return t.reduce(function(t,a){if(a instanceof Xt){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 kt(new y(this.metadata,tt,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.lesserOrEquals=function(t){var n=function(t,n){return t<=n};return new kt(new y(this.metadata,nt,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.greaterThan=function(t){var n=function(t,n){return t>n};return new kt(new y(this.metadata,et,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.greaterOrEquals=function(t){var n=function(t,n){return t>=n};return new kt(new y(this.metadata,rt,t instanceof e?t.metadata:new Wt(t)),Ht(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 y(this.metadata,at,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,null))},e.prototype.minus=function(t){var n=function(t,n){return t-n};return new e(new y(this.metadata,it,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,null))},e.prototype.times=function(t){var n=function(t,n){return t*n};return new e(t instanceof e?new y(this.metadata,it,t.metadata):new y(this.metadata,ut,new Wt(t)),Ht(this,t,n,null))},e}(Xt),Qt=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 kt(new y(this.metadata,U,t instanceof Xt?t.metadata:new Wt(t)),Ht(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 kt(new y(this.metadata,xt,t instanceof Xt?t.metadata:new Bt(t.map(function(t){return new Wt(t)}))),Ht(this,t,n,!1))},e.prototype.isEmpty=function(){return new kt(new Gt(this.metadata,Vt),Ht(this,void 0,function(t){return 0===t.length},null))},e.prototype.isNotEmpty=function(){return new kt(new Gt(this.metadata,Ct),Ht(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 kt(new Gt(this.metadata,Ut),Ht(this,t,n,null))},e.prototype.hasNotSize=function(t){var n=function(t,n){return t.length!==n};return new kt(new Gt(this.metadata,Rt),Ht(this,t,n,null))},e}(Xt),Zt=function(){function t(t){this.get=d.apply(void 0,t.path),this.set=p.apply(void 0,t.path),this.metadata=t}return t.field=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(new v(n))},t.prototype.withPosition=function(n){return new t(new v(this.metadata.path,this.metadata.tags,n))},t.prototype.withTags=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(new v(this.metadata.path,n,this.metadata.position))},t.prototype.position=function(){var t=this;return new Kt(new Gt(this.metadata,qt),function(){return t.metadata.position})},t.prototype.tags=function(){var t=this;return new Qt(new Gt(this.metadata,zt),function(){return t.metadata.tags})},t}(),$t=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 kt(new y(this.metadata,U,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.matches=function(t){var n=function(t,n){var e=t.match(n);return null!=e&&e.length>=1};return new kt(new y(this.metadata,R,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.startsWith=function(t){var n=function(t,n){return t.startsWith(n)};return new kt(new y(this.metadata,q,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.endsWith=function(t){var n=function(t,n){return t.endsWith(n)};return new kt(new y(this.metadata,z,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.length=function(){return new Kt(new Gt(this.metadata,G),Ht(this,void 0,function(t){return t.length},0))},e.prototype.parseInt=function(){return new Kt(new Gt(this.metadata,W),Ht(this,void 0,function(t){return parseInt(t)},null))},e.prototype.trim=function(){return new e(new Gt(this.metadata,B),Ht(this,void 0,function(t){return t.trim()},null))},e.prototype.replaceAll=function(t,n){return new e(new y(this.metadata,J,new y(new Wt(t),Y,new Wt(n))),Ht(this,void 0,function(e){return e.replace(t,n)},null))},e.prototype.substring=function(t,n){return new e(new y(this.metadata,K,new y(new Wt(t),Y,new Wt(n))),Ht(this,void 0,function(e){return e.substring(t,n)},null))},e.prototype.localeUpperCase=function(){return new e(new Gt(this.metadata,X),Ht(this,void 0,function(t){return t.toLocaleUpperCase()},null))},e.prototype.localeLowerCase=function(){return new e(new Gt(this.metadata,H),Ht(this,void 0,function(t){return t.toLocaleLowerCase()},null))},e.prototype.concat=function(t){return new e(new y(this.metadata,k,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,function(t,n){return t+n},null))},e}(Xt),tn=function(t,n){this.value=t,this.context=n},nn=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}(),en=function(t){function e(n){var e=t.call(this,D)||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}(m),rn=function(){function t(t){this.when=t,this.metadata=new en(t.metadata)}return t.prototype.execute=function(t,n){void 0===t&&(t={});var e=n||new nn;return new tn(this.when.condition.get(t,e),e)},t}(),an=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?" "+E.readable+" "+this.elseMetadata.readable:"")},enumerable:!0,configurable:!0}),e}(m),un=function(){function t(t){this.type="WHEN",this.metadata=t,this.operator=M}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}(),on=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}(m),cn=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 an(new un(t.metadata),new on(r,N))}return t.prototype.execute=function(t,n){return this.condition.get(t,n)?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.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 an(this.metadata.whenMetadata,this.metadata.thenMetadata,new on(e,E)),this},t}(),sn=function(){function t(t){this.condition=t,this.metadata=new un(t.metadata)}return t.prototype.validate=function(){return new rn(this)},t.prototype.then=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new(cn.bind.apply(cn,[void 0,this.condition].concat(t)))},t}(),fn=function(t){function e(n,e){var r=t.call(this,b)||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+" "+ot+" "+this.targetMetadata.readable},enumerable:!0,configurable:!0}),e.prototype.children=function(){return[this.sourceMetadata,this.targetMetadata]},e}(m),ln=function(){function t(t,n){this.input=t,this.output=n,this.metadata=new fn(t.metadata,n.metadata)}return t.prototype.execute=function(t,n){var e=n||new nn;return this.output.set?this.output.set(t,this.input.get(t,e),e):t},t}(),hn=function(t){function e(n,e){var r=t.call(this,new y(n.metadata,ct,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 ln(this,t)},e}(Xt),dn=function(){function t(t){this.input=t}return t.prototype.to=function(t){return new ln(this.input,t)},t.prototype.using=function(t){return new hn(this.input,t)},t}(),pn=function(){function t(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];this.mappings=n.flatMap(function(n){return n instanceof t?n.mappings:[n]}),this.metadata=new on(this.mappings.map(function(t){return t.metadata}))}return t.prototype.execute=function(t,n){return this.mappings.reduce(function(t,e){return e.execute(t,n)},t)},t}(),wn=function(t,n,e){this.type="TYPE_CONVERTER",this.operator=e,this.body=t,this.readable=null!=n?n:t},mn=function(t,n){this.convert=t,this.metadata=new wn(t.toString(),n)},vn=function(t){function e(n,e,r){var a=t.call(this,new y(new y(n.metadata,Y,e.metadata),ct,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 hn(this,t)},e.prototype.to=function(t){return new ln(this,t)},e}(Xt),gn=function(){function t(t,n){this.input=t,this.input2=n}return t.prototype.using=function(t){return new vn(this.input,this.input2,t instanceof mn?t:new mn(t))},t}(),yn=function(t,n){this.convert=t,this.metadata=new wn(t.toString(),n)},bn=function(t){function e(n,e){var r=t.call(this,new y(new Jt(n.map(function(t){return t.metadata}),st),ct,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 hn(this,t)},e.prototype.to=function(t){return new ln(this,t)},e}(Xt),Mn=function(){function t(t){this.inputs=t}return t.prototype.using=function(t){return new bn(this.inputs,t instanceof yn?t:new yn(t))},t}();function Dn(t,n){for(t=String(t),n=n||2;t.length<n;)t="0"+t;return t}function On(){return new Date(Date.now())}function Yn(t){return new Date(t.valueOf())}function Pn(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 Nn(t){var n=Yn(t);return n.getFullYear().toString()+Dn(n.getMonth()+1,2)+Dn(n.getDate(),2)}function En(t){var n=Yn(t);return Dn(n.getDate(),2)+Dn(n.getMonth()+1,2)+n.getFullYear()}function In(t){return Pn(Number.parseInt(t.slice(0,4)),Number.parseInt(t.slice(4,6))-1,Number.parseInt(t.slice(6,8)))}function An(t,n){var e=n||On(),r=12*(e.getFullYear()-t.getFullYear())+(e.getMonth()-t.getMonth());return e.getDay()-t.getDate()>=0?r:r-1}var Fn=Object.freeze({now:On,clone:Yn,newUTCDate:Pn,formatYYYYMMdd:Nn,formatddMMYYYY:En,formatReadable:function(t){var n=Yn(t);return Dn(n.getDate(),2)+"/"+Dn(n.getMonth()+1,2)+"/"+n.getFullYear()},formatMMMMYYYY:function(t,n){var e=Yn(t);return new Intl.DateTimeFormat(n,{month:"long"}).format(t)+" "+e.getFullYear()},formatEEEEddMMMM:function(t,n){var e=Yn(t),r=new Intl.DateTimeFormat(n,{weekday:"long"}).format(e),a=new Intl.DateTimeFormat(n,{month:"long"}).format(e);return r+" "+Dn(e.getDate(),2)+" "+a},formatTime:function(t){var n=Yn(t);return Dn(t.getHours(),2)+Dn(n.getMinutes(),2)+Dn(t.getSeconds(),2)},parse:In,numberOfFullMonthsBetween:An}),Tn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),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:In(r)},function(n,e,r){return i(e)?t.set?t.set(n,e,r):n:t.set?t.set(n,Nn(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 Wt(t)});return new e(new Jt(r,Q),function(n,r){var a=function(t,n){return t<n?t:n};return t.reduce(function(t,e){if(e instanceof Xt){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 Wt(t)});return new e(new Jt(r,Z),function(n,r){var a=function(t,n){return t>n?t:n};return t.reduce(function(t,e){if(e instanceof Xt){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 Kt(new g("clone().getFullYear()",void 0,Dt),function(){return On().getFullYear()})},e.thisMonth=function(){return new Kt(new g("clone().getMonth() + 1",void 0,Ot),function(){return On().getMonth()+1})},e.today=function(){return new e(new g("clone()",void 0,Yt),function(){return On()})},e.tomorrow=function(){return new e(new g("date.setDate(date.getDate() + 1)",void 0,Pt),function(){var t=On();return t.setDate(t.getDate()+1),t})},e.dateFrom=function(t){return new e(new g("Date{"+t+"}"),function(){return In(t)})},e.newDate=function(t,n,r){return new e(new g("Date{ Y:"+t+" M:"+n+" D:"+r+" }"),function(){return Pn(t,n,r)})},e.newLocalDate=function(t,n,r){return new e(new g("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 kt(new y(this.metadata,ht,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.beforeOrEquals=function(t){var n=function(t,n){return t<=n};return new kt(new y(this.metadata,dt,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.after=function(t){var n=function(t,n){return t>n};return new kt(new y(this.metadata,ft,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.afterOrEquals=function(t){var n=function(t,n){return t>=n};return new kt(new y(this.metadata,lt,t instanceof e?t.metadata:new Wt(t)),Ht(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=Yn(t);return e.setDate(t.getDate()+n),e};return new e(new y(this.metadata,pt,t instanceof Kt?t.metadata:new Wt(t)),Ht(this,t,n,null))},e.prototype.minusDays=function(t){var n=function(t,n){var e=Yn(t);return e.setDate(e.getDate()-n),e};return new e(new y(this.metadata,wt,t instanceof Kt?t.metadata:new Wt(t)),Ht(this,t,n,null))},e.prototype.plusMonths=function(t){var n=function(t,n){var e=Yn(t);return e.setMonth(e.getMonth()+n),e};return new e(new y(this.metadata,mt,t instanceof Kt?t.metadata:new Wt(t)),Ht(this,t,n,null))},e.prototype.minusMonths=function(t){var n=function(t,n){var e=Yn(t);return e.setMonth(e.getMonth()-n),e};return new e(new y(this.metadata,vt,t instanceof Kt?t.metadata:new Wt(t)),Ht(this,t,n,null))},e.prototype.plusYears=function(t){var n=function(t,n){var e=Yn(t);return e.setFullYear(e.getFullYear()+n),e};return new e(new y(this.metadata,gt,t instanceof Kt?t.metadata:new Wt(t)),Ht(this,t,n,null))},e.prototype.minusYears=function(t){var n=function(t,n){var e=Yn(t);return e.setFullYear(e.getFullYear()-n),e};return new e(new y(this.metadata,yt,t instanceof Kt?t.metadata:new Wt(t)),Ht(this,t,n,null))},e.prototype.formatISO=function(){return new $t(new Gt(this.metadata,bt),Ht(this,void 0,function(t){return Nn(t)},null))},e.prototype.dayMonthYear=function(){return new $t(new Gt(this.metadata,Mt),Ht(this,void 0,function(t){return En(t)},null))},e.nbFullMonthsSince=function(t){return new Kt(new Gt(t.metadata,St),Ht(t,void 0,function(t){return An(t)},null))},e.nbFullMonthsBetween=function(t,n){return n instanceof e?new Kt(new y(t.metadata,Lt,n.metadata),Ht(t,n,function(t,n){return An(t,n)},null)):new Kt(new y(t.metadata,Lt,new Wt(n)),Ht(t,n,An,null))},e.prototype.withDayOfMonth=function(t){return new e(new y(this.metadata,Nt,new Wt(t)),Ht(this,t,function(t,n){var e=Yn(t);return e.setDate(n),e},null))},e.prototype.withMonth=function(t){return new e(new y(this.metadata,Et,new Wt(t)),Ht(this,t,function(t,n){var e=Yn(t);return e.setMonth(n),e},null))},e.prototype.withYear=function(t){return new e(new y(this.metadata,It,new Wt(t)),Ht(this,t,function(t,n){var e=Yn(t);return e.setFullYear(n),e},null))},e.prototype.withFirstDayOfNextYear=function(){return new e(new Gt(this.metadata,At),Ht(this,void 0,function(t){var n=Yn(t);return n.setMonth(11),n.setDate(32),n},null))},e.prototype.withLastDayOfLastYear=function(){return new e(new Gt(this.metadata,Ft),Ht(this,void 0,function(t){var n=Yn(t);return n.setMonth(0),n.setDate(0),n},null))},e.prototype.monthOf=function(){return new Kt(new Gt(this.metadata,Tt),Ht(this,void 0,function(t){return t.getMonth()},null))},e.prototype.yearOf=function(){return new Kt(new Gt(this.metadata,jt),Ht(this,void 0,function(t){return t.getFullYear()},null))},e.prototype.dateOf=function(){return new Kt(new Gt(this.metadata,_t),Ht(this,void 0,function(t){return t.getDate()},null))},e.MAX_DATE=new Date(864e13),e.MIN_DATE=new Date(-864e13),e}(Xt),jn=function(t,n){this.convert=t,this.metadata=new wn(t.toString(),n)};var _n=Object.freeze({fieldsOf:function t(n){var e=n;return"FIELD"==e.type?[e.path]:n.children?n.children().flatMap(function(n){return t(n)}):[]}});function Sn(t){return Xt.function(t)}function Ln(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Zt.field.apply(Zt,t)}function xn(t,n){return Xt.lift(t,n)}function Vn(t){return Qt.iterable(t)}function Cn(t){return kt.boolean(t)}function Un(t){return $t.string(t)}function Rn(t){return Kt.number(t)}function qn(t){return Tn.date(t)}function zn(t){return Tn.dateIso(t)}function Gn(t){return new sn(t)}function Wn(t,n){return n?new gn(t instanceof Xt?t:new Xt(new Wt(t),function(n){return t}),n instanceof Xt?n:new Xt(new Wt(n),function(t){return n})):new dn(t instanceof Xt?t:new Xt(new Wt(t),function(n){return t}))}function Bn(t){return new ln(new Xt(new Wt(null),function(t){return null}),t)}function Xn(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new Mn(t)}function Hn(t,n){return new jn(t,n)}function kn(t,n){return new mn(t,n)}function Jn(t,n){return new yn(t,n)}function Kn(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new(pn.bind.apply(pn,[void 0].concat(t)))}function Qn(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new kt(new Jt(t.map(function(t){return t.metadata}),C),function(n,e){return t.some(function(t){var r=t.get(n,e);return null!=r&&r})})}function Zn(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new kt(new Jt(t.map(function(t){return t.metadata}),x),function(n,e){return t.every(function(t){var r=t.get(n,e);return null!=r&&r})})}function $n(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new kt(new Jt(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})})}export{m as AbstractMetadata,y as BinaryMetadata,kt as BooleanFunction,an as ConditionalMappingMetadata,Tn as DateFunction,Fn as DateUtils,nn as DefaultContext,Zt as Field,v as FieldMetadata,Xt as Function,g as FunctionMetadata,Qt as IterableFunction,Bt as IterableMetadata,_n as MetadataUtils,on as MultipleMappingsMetadata,Jt as NaryMetadata,Kt as NumberFunction,w as Paths,fn as SingleMappingMetadata,$t as StringFunction,wn as TypeConverterMetadata,Gt as UnaryMetadata,u as Utils,en as ValidationRuleMetadata,Wt as ValueMetadata,un as WhenMetadata,kn as biConverter,Cn as boolean,Hn as converter,qn as date,zn as dateIso,Sn as f,Ln as field,Vn as iterable,xn as lift,Wn as map,Xn as mapAll,Bn as mapNull,Kn as mappings,Zn as matchAll,Qn as matchAny,$n as matchNone,Jn as naryConverter,Rn as number,Un as string,Gn as when}; | ||
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}var u=Object.freeze({hasProperty:r,isInteger:a,nullOrUndefined:i});function o(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.join(".")}function c(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 s(t,n,r){var a=e({},r);return a[t]=n,a}function f(t,n,r){return n.then(function(n){var a=e({},r);return a[t]=n,a})}function l(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=l.apply(void 0,[o,n].concat(Array.prototype.slice.call(e,1)))}return f(u,n,t)}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 s(u,n,t)}var p=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n){return c.apply(void 0,[n].concat(t))}},d=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n,e){return h.apply(void 0,[n,e].concat(t))}},w=Object.freeze({path:function(t){return t.split(".").map(function(t){var n=parseInt(t);return isNaN(n)?t:n})},pathString:o,getPath:c,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:s,setPropPromise:f,setPathPromise:l,setPathPromiseValue:function(t,n){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];return l.apply(void 0,[t,Promise.resolve(n)].concat(e))},setPath:h,getter:p,setter:d}),m=function(t){this.operator=t},v=function(t){function e(n,e,r){void 0===e&&(e=[]),void 0===r&&(r=-1);var i=t.call(this)||this;i.type="FIELD",i.readable=o.apply(void 0,n),i.path=n.slice(),i.tags=e;var u=n.filter(function(t){return a(t)});return i.position=-1===r&&u.length>=1?u[u.length-1]:r,i}return n(e,t),e}(m);var g=function(t,n,e){this.type="FUNCTION",this.operator=e,this.body=t,this.readable=null!=n?n:t},y=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}(m),b={readable:"single_mapping"},M={readable:"when"},O={readable:"validate"},D={readable:"not"},T={readable:"and"},Y={readable:"or"},E={readable:"then"},P={readable:"else"},N={readable:"function"},I={readable:"has value"},C={readable:"is null"},U={readable:"is not null"},A={readable:"is defined"},F={readable:"is undefined"},j={readable:"="},x={readable:"!="},_={readable:"match all"},S={readable:"none match"},L={readable:"match any"},V={readable:"contains"},R={readable:"matches"},q={readable:"starts with"},z={readable:"ends with"},G={readable:"length"},W={readable:"as integer"},B={readable:"trimmed"},X={readable:"upper case"},H={readable:"lower case"},k={readable:"concat"},J={readable:"replace all"},K={readable:"sub string"},Q={readable:"min"},Z={readable:"max"},$={readable:"sum"},tt={readable:"<"},nt={readable:"<="},et={readable:">"},rt={readable:">="},at={readable:"+"},it={readable:"-"},ut={readable:"*"},ot="->",ct={readable:"using"},st={readable:"multiple inputs"},ft={readable:">"},lt={readable:">="},ht={readable:"<"},pt={readable:"<="},dt={readable:"plus days"},wt={readable:"minus days"},mt={readable:"plus months"},vt={readable:"minus months"},gt={readable:"plus years"},yt={readable:"minus years"},bt={readable:"format iso"},Mt={readable:"format day month year"},Ot={readable:"this year"},Dt={readable:"this month"},Tt={readable:"today"},Yt={readable:"tomorrow"},Et={readable:"with day of month"},Pt={readable:"with month"},Nt={readable:"with year"},It={readable:"with first day of next year"},Ct={readable:"with last day of last year"},Ut={readable:"month of"},At={readable:"year of"},Ft={readable:"date of"},jt={readable:"number of months since"},xt={readable:"number of months between"},_t={readable:"contains all"},St={readable:"is empty"},Lt={readable:"is not empty"},Vt={readable:"has size"},Rt={readable:"has not size"},qt={readable:"position of"},zt={readable:"tags of"},Gt=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===D?this.operator.readable+"("+this.metadata.readable+")":this.metadata.readable+" "+this.operator.readable},enumerable:!0,configurable:!0}),e.prototype.children=function(){return[this.metadata]},e}(m),Wt=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}(m),Bt=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}(m),Xt=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 Wt(n),function(){return n})},t.prototype.mapTo=function(t,n,e){var r=this;return new t(new y(this.metadata,N,new g(e||n.toString())),function(t,e){return n(r.get(t,e))})},t.prototype.hasValue=function(){var t=this;return new kt(new Gt(this.metadata,I),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 kt(new Gt(this.metadata,A),function(n,e){return void 0!==t.get(n,e)})},t.prototype.isUndefined=function(){var t=this;return new kt(new Gt(this.metadata,F),function(n,e){return void 0===t.get(n,e)})},t.prototype.isNull=function(){var t=this;return new kt(new Gt(this.metadata,C),function(n,e){return null===t.get(n,e)})},t.prototype.isNotNull=function(){var t=this;return new kt(new Gt(this.metadata,U),function(n,e){return null!==t.get(n,e)})},t.prototype.eq=function(n){var e=this;return n instanceof t?new kt(new y(this.metadata,j,n.metadata),function(t,r){return e.get(t,r)===n.get(t,r)}):new kt(new y(this.metadata,j,new Wt(n)),function(t,r){return e.get(t,r)===n})},t.prototype.notEq=function(n){var e=this;return n instanceof t?new kt(new y(this.metadata,x,n.metadata),function(t,r){return e.get(t,r)!==n.get(t,r)}):new kt(new y(this.metadata,x,new Wt(n)),function(t,r){return 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 Wt(n)});return new kt(new y(this.metadata,_,new Bt(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 Wt(n)});return new kt(new y(this.metadata,S,new Bt(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 Wt(n)});return new kt(new y(this.metadata,L,new Bt(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 Ht(t,n,e,r){return n instanceof Xt?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 kt=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 Gt(this.metadata,D),Ht(this,!1,function(t){return!t},!1))},e.prototype.and=function(t){var n=this;return new e(new y(this.metadata,T,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 Ht(n,t,function(t,n){return t&&n},!1)(e,r)})},e.prototype.or=function(t){var n=this;return new e(new y(this.metadata,Y,t instanceof e?t.metadata:new Wt(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 Ht(n,t,function(t,n){return t||n},!1)(r,a)})},e}(Xt),Jt=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}(m),Kt=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 Wt(t)});return new e(new Jt(r,Q),function(n,e){var r=function(t,n){return t<n?t:n};return t.reduce(function(t,a){if(a instanceof Xt){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 Wt(t)});return new e(new Jt(r,Z),function(n,e){var r=function(t,n){return t>n?t:n};return t.reduce(function(t,a){if(a instanceof Xt){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 Wt(t)});return new e(new Jt(r,$),function(n,e){var r=function(t,n){return t+n};return t.reduce(function(t,a){if(a instanceof Xt){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 kt(new y(this.metadata,tt,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.lesserOrEquals=function(t){var n=function(t,n){return t<=n};return new kt(new y(this.metadata,nt,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.greaterThan=function(t){var n=function(t,n){return t>n};return new kt(new y(this.metadata,et,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.greaterOrEquals=function(t){var n=function(t,n){return t>=n};return new kt(new y(this.metadata,rt,t instanceof e?t.metadata:new Wt(t)),Ht(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 y(this.metadata,at,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,null))},e.prototype.minus=function(t){var n=function(t,n){return t-n};return new e(new y(this.metadata,it,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,null))},e.prototype.times=function(t){var n=function(t,n){return t*n};return new e(t instanceof e?new y(this.metadata,it,t.metadata):new y(this.metadata,ut,new Wt(t)),Ht(this,t,n,null))},e}(Xt),Qt=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 kt(new y(this.metadata,V,t instanceof Xt?t.metadata:new Wt(t)),Ht(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 kt(new y(this.metadata,_t,t instanceof Xt?t.metadata:new Bt(t.map(function(t){return new Wt(t)}))),Ht(this,t,n,!1))},e.prototype.isEmpty=function(){return new kt(new Gt(this.metadata,St),Ht(this,void 0,function(t){return 0===t.length},null))},e.prototype.isNotEmpty=function(){return new kt(new Gt(this.metadata,Lt),Ht(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 kt(new Gt(this.metadata,Vt),Ht(this,t,n,null))},e.prototype.hasNotSize=function(t){var n=function(t,n){return t.length!==n};return new kt(new Gt(this.metadata,Rt),Ht(this,t,n,null))},e.prototype.length=function(){return new Kt(new Gt(this.metadata,G),Ht(this,void 0,function(t){return t.length},null))},e}(Xt),Zt=function(){function t(t){this.get=p.apply(void 0,t.path),this.set=d.apply(void 0,t.path),this.metadata=t}return t.field=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(new v(n))},t.prototype.withPosition=function(n){return new t(new v(this.metadata.path,this.metadata.tags,n))},t.prototype.withTags=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(new v(this.metadata.path,n,this.metadata.position))},t.prototype.position=function(){var t=this;return new Kt(new Gt(this.metadata,qt),function(){return t.metadata.position})},t.prototype.tags=function(){var t=this;return new Qt(new Gt(this.metadata,zt),function(){return t.metadata.tags})},t}(),$t=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 kt(new y(this.metadata,V,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.matches=function(t){var n=function(t,n){return new RegExp(n).test(t)};return new kt(new y(this.metadata,R,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.startsWith=function(t){var n=function(t,n){return t.startsWith(n)};return new kt(new y(this.metadata,q,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.endsWith=function(t){var n=function(t,n){return t.endsWith(n)};return new kt(new y(this.metadata,z,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.length=function(){return new Kt(new Gt(this.metadata,G),Ht(this,void 0,function(t){return t.length},0))},e.prototype.parseInt=function(){return new Kt(new Gt(this.metadata,W),Ht(this,void 0,function(t){return parseInt(t)},null))},e.prototype.trim=function(){return new e(new Gt(this.metadata,B),Ht(this,void 0,function(t){return t.trim()},null))},e.prototype.replaceAll=function(t,n){return new e(new y(this.metadata,J,new y(new Wt(t),T,new Wt(n))),Ht(this,void 0,function(e){return e.replace(t,n)},null))},e.prototype.substring=function(t,n){return new e(new y(this.metadata,K,new y(new Wt(t),T,new Wt(n))),Ht(this,void 0,function(e){return e.substring(t,n)},null))},e.prototype.localeUpperCase=function(){return new e(new Gt(this.metadata,X),Ht(this,void 0,function(t){return t.toLocaleUpperCase()},null))},e.prototype.localeLowerCase=function(){return new e(new Gt(this.metadata,H),Ht(this,void 0,function(t){return t.toLocaleLowerCase()},null))},e.prototype.concat=function(t){return new e(new y(this.metadata,k,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,function(t,n){return t+n},null))},e}(Xt),tn=function(t,n){this.value=t,this.context=n},nn=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}(),en=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}(m),rn=function(){function t(t){this.when=t,this.metadata=new en(t.metadata)}return t.prototype.execute=function(t,n){void 0===t&&(t={});var e=n||new nn;return new tn(this.when.condition.get(t,e),e)},t}(),an=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+" "+E.readable+" "+this.thenMetadata.readable+(null!=this.elseMetadata?" "+P.readable+" "+this.elseMetadata.readable:"")},enumerable:!0,configurable:!0}),e}(m),un=function(){function t(t){this.type="WHEN",this.metadata=t,this.operator=M}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}(),on=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}(m),cn=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 an(new un(t.metadata),new on(r,E))}return t.prototype.execute=function(t,n){var e=n||new nn;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 nn;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 an(this.metadata.whenMetadata,this.metadata.thenMetadata,new on(e,P)),this},t}(),sn=function(){function t(t){this.condition=t,this.metadata=new un(t.metadata)}return t.prototype.validate=function(){return new rn(this)},t.prototype.then=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new(cn.bind.apply(cn,[void 0,this.condition].concat(t)))},t}(),fn=function(t){function e(n,e){var r=t.call(this,b)||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+" "+ot+" "+this.targetMetadata.readable},enumerable:!0,configurable:!0}),e.prototype.children=function(){return[this.sourceMetadata,this.targetMetadata]},e}(m),ln=function(){function t(t,n){this.input=t,this.output=n,this.metadata=new fn(t.metadata,n.metadata)}return t.prototype.execute=function(t,n){var e=n||new nn;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 nn;return this.output.set?this.output.set(n,this.input.get(t,r),r):n},t}(),hn=function(t){function e(n,e){var r=t.call(this,new y(n.metadata,ct,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 ln(this,t)},e}(Xt),pn=function(){function t(t){this.input=t}return t.prototype.to=function(t){return new ln(this.input,t)},t.prototype.using=function(t){return new hn(this.input,t)},t}(),dn=function(){function t(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];this.mappings=n.flatMap(function(n){return n instanceof t?n.mappings:[n]}),this.metadata=new on(this.mappings.map(function(t){return t.metadata}))}return t.prototype.execute=function(t,n){var e=n||new nn;return this.mappings.reduce(function(t,n){return n.execute(t,e)},t)},t.prototype.executeOn=function(t,n,e){var r=e||new nn;return this.mappings.forEach(function(e){n=e.executeOn(t,n,r)}),n},t}(),wn=function(t,n,e){this.type="TYPE_CONVERTER",this.operator=e,this.body=t,this.readable=null!=n?n:t},mn=function(t,n){this.convert=t,this.metadata=new wn(t.toString(),n)},vn=function(t){function e(n,e,r){var a=t.call(this,new y(new y(n.metadata,T,e.metadata),ct,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 hn(this,t)},e.prototype.to=function(t){return new ln(this,t)},e}(Xt),gn=function(){function t(t,n){this.input=t,this.input2=n}return t.prototype.using=function(t){return new vn(this.input,this.input2,t instanceof mn?t:new mn(t))},t}(),yn=function(t,n){this.convert=t,this.metadata=new wn(t.toString(),n)},bn=function(t){function e(n,e){var r=t.call(this,new y(new Jt(n.map(function(t){return t.metadata}),st),ct,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 hn(this,t)},e.prototype.to=function(t){return new ln(this,t)},e}(Xt),Mn=function(){function t(t){this.inputs=t}return t.prototype.using=function(t){return new bn(this.inputs,t instanceof yn?t:new yn(t))},t}();function On(t,n){for(t=String(t),n=n||2;t.length<n;)t="0"+t;return t}function Dn(){return new Date(Date.now())}function Tn(t){return new Date(t.valueOf())}function Yn(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 En(t){var n=Tn(t);return n.getUTCFullYear().toString()+On(n.getUTCMonth()+1,2)+On(n.getUTCDate(),2)}function Pn(t){var n=Tn(t);return On(n.getUTCDate(),2)+On(n.getUTCMonth()+1,2)+n.getUTCFullYear()}function Nn(t){return Yn(Number.parseInt(t.slice(0,4)),Number.parseInt(t.slice(4,6))-1,Number.parseInt(t.slice(6,8)))}function In(t,n){var e=n||Dn(),r=12*(e.getUTCFullYear()-t.getUTCFullYear())+(e.getUTCMonth()-t.getUTCMonth());return e.getUTCDay()-t.getUTCDate()>=0?r:r-1}var Cn=Object.freeze({now:Dn,clone:Tn,newUTCDate:Yn,formatYYYYMMdd:En,formatddMMYYYY:Pn,formatReadable:function(t){var n=Tn(t);return On(n.getUTCDate(),2)+"/"+On(n.getUTCMonth()+1,2)+"/"+n.getUTCFullYear()},formatMMMMYYYY:function(t,n){var e=Tn(t);return new Intl.DateTimeFormat(n,{month:"long"}).format(t)+" "+e.getUTCFullYear()},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+" "+On(e.getUTCDate(),2)+" "+a},formatTime:function(t){var n=Tn(t);return On(t.getHours(),2)+On(n.getMinutes(),2)+On(t.getSeconds(),2)},parse:Nn,numberOfFullMonthsBetween:In}),Un=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),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:Nn(r)},function(n,e,r){return i(e)?t.set?t.set(n,e,r):n:t.set?t.set(n,En(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 Wt(t)});return new e(new Jt(r,Q),function(n,r){var a=function(t,n){return t<n?t:n};return t.reduce(function(t,e){if(e instanceof Xt){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 Wt(t)});return new e(new Jt(r,Z),function(n,r){var a=function(t,n){return t>n?t:n};return t.reduce(function(t,e){if(e instanceof Xt){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 Kt(new g("clone().getFullYear()",void 0,Ot),function(){return Dn().getFullYear()})},e.thisMonth=function(){return new Kt(new g("clone().getMonth() + 1",void 0,Dt),function(){return Dn().getMonth()+1})},e.today=function(){return new e(new g("clone()",void 0,Tt),function(){return Dn()})},e.tomorrow=function(){return new e(new g("date.setDate(date.getDate() + 1)",void 0,Yt),function(){var t=Dn();return t.setDate(t.getDate()+1),t})},e.dateFrom=function(t){return new e(new g("Date{"+t+"}"),function(){return Nn(t)})},e.newDate=function(t,n,r){return new e(new g("Date{ Y:"+t+" M:"+n+" D:"+r+" }"),function(){return Yn(t,n,r)})},e.newLocalDate=function(t,n,r){return new e(new g("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 kt(new y(this.metadata,ht,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.beforeOrEquals=function(t){var n=function(t,n){return t<=n};return new kt(new y(this.metadata,pt,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.after=function(t){var n=function(t,n){return t>n};return new kt(new y(this.metadata,ft,t instanceof e?t.metadata:new Wt(t)),Ht(this,t,n,!1))},e.prototype.afterOrEquals=function(t){var n=function(t,n){return t>=n};return new kt(new y(this.metadata,lt,t instanceof e?t.metadata:new Wt(t)),Ht(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=Tn(t);return e.setDate(t.getDate()+n),e};return new e(new y(this.metadata,dt,t instanceof Kt?t.metadata:new Wt(t)),Ht(this,t,n,null))},e.prototype.minusDays=function(t){var n=function(t,n){var e=Tn(t);return e.setDate(e.getDate()-n),e};return new e(new y(this.metadata,wt,t instanceof Kt?t.metadata:new Wt(t)),Ht(this,t,n,null))},e.prototype.plusMonths=function(t){var n=function(t,n){var e=Tn(t);return e.setMonth(e.getMonth()+n),e};return new e(new y(this.metadata,mt,t instanceof Kt?t.metadata:new Wt(t)),Ht(this,t,n,null))},e.prototype.minusMonths=function(t){var n=function(t,n){var e=Tn(t);return e.setMonth(e.getMonth()-n),e};return new e(new y(this.metadata,vt,t instanceof Kt?t.metadata:new Wt(t)),Ht(this,t,n,null))},e.prototype.plusYears=function(t){var n=function(t,n){var e=Tn(t);return e.setFullYear(e.getFullYear()+n),e};return new e(new y(this.metadata,gt,t instanceof Kt?t.metadata:new Wt(t)),Ht(this,t,n,null))},e.prototype.minusYears=function(t){var n=function(t,n){var e=Tn(t);return e.setFullYear(e.getFullYear()-n),e};return new e(new y(this.metadata,yt,t instanceof Kt?t.metadata:new Wt(t)),Ht(this,t,n,null))},e.prototype.formatISO=function(){return new $t(new Gt(this.metadata,bt),Ht(this,void 0,function(t){return En(t)},null))},e.prototype.dayMonthYear=function(){return new $t(new Gt(this.metadata,Mt),Ht(this,void 0,function(t){return Pn(t)},null))},e.nbFullMonthsSince=function(t){return new Kt(new Gt(t.metadata,jt),Ht(t,void 0,function(t){return In(t)},null))},e.nbFullMonthsBetween=function(t,n){return n instanceof e?new Kt(new y(t.metadata,xt,n.metadata),Ht(t,n,function(t,n){return In(t,n)},null)):new Kt(new y(t.metadata,xt,new Wt(n)),Ht(t,n,In,null))},e.prototype.withDayOfMonth=function(t){return new e(new y(this.metadata,Et,new Wt(t)),Ht(this,t,function(t,n){var e=Tn(t);return e.setDate(n),e},null))},e.prototype.withMonth=function(t){return new e(new y(this.metadata,Pt,new Wt(t)),Ht(this,t,function(t,n){var e=Tn(t);return e.setMonth(n),e},null))},e.prototype.withYear=function(t){return new e(new y(this.metadata,Nt,new Wt(t)),Ht(this,t,function(t,n){var e=Tn(t);return e.setFullYear(n),e},null))},e.prototype.withFirstDayOfNextYear=function(){return new e(new Gt(this.metadata,It),Ht(this,void 0,function(t){var n=Tn(t);return n.setMonth(11),n.setDate(32),n},null))},e.prototype.withLastDayOfLastYear=function(){return new e(new Gt(this.metadata,Ct),Ht(this,void 0,function(t){var n=Tn(t);return n.setMonth(0),n.setDate(0),n},null))},e.prototype.monthOf=function(){return new Kt(new Gt(this.metadata,Ut),Ht(this,void 0,function(t){return t.getMonth()},null))},e.prototype.yearOf=function(){return new Kt(new Gt(this.metadata,At),Ht(this,void 0,function(t){return t.getFullYear()},null))},e.prototype.dateOf=function(){return new Kt(new Gt(this.metadata,Ft),Ht(this,void 0,function(t){return t.getDate()},null))},e.MAX_DATE=new Date(864e13),e.MIN_DATE=new Date(-864e13),e}(Xt),An=function(t,n){this.convert=t,this.metadata=new wn(t.toString(),n)};var Fn=Object.freeze({fieldsOf:function t(n){var e=n;return"FIELD"==e.type?[e.path]:n.children?n.children().flatMap(function(n){return t(n)}):[]}});function jn(t){return Xt.function(t)}function xn(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Zt.field.apply(Zt,t)}function _n(t,n){return Xt.lift(t,n)}function Sn(t){return Qt.iterable(t)}function Ln(t){return kt.boolean(t)}function Vn(t){return $t.string(t)}function Rn(t){return Kt.number(t)}function qn(t){return Un.date(t)}function zn(t){return Un.dateIso(t)}function Gn(t){return new sn(t)}function Wn(t,n){return n?new gn(t instanceof Xt?t:new Xt(new Wt(t),function(n){return t}),n instanceof Xt?n:new Xt(new Wt(n),function(t){return n})):new pn(t instanceof Xt?t:new Xt(new Wt(t),function(n){return t}))}function Bn(t){return new ln(new Xt(new Wt(null),function(t){return null}),t)}function Xn(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new Mn(t)}function Hn(t,n){return new An(t,n)}function kn(t,n){return new mn(t,n)}function Jn(t,n){return new yn(t,n)}function Kn(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new(dn.bind.apply(dn,[void 0].concat(t)))}function Qn(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new kt(new Jt(t.map(function(t){return t.metadata}),L),function(n,e){return t.some(function(t){var r=t.get(n,e);return null!=r&&r})})}function Zn(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new kt(new Jt(t.map(function(t){return t.metadata}),_),function(n,e){return t.every(function(t){var r=t.get(n,e);return null!=r&&r})})}function $n(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new kt(new Jt(t.map(function(t){return t.metadata}),S),function(n,e){return t.every(function(t){var r=t.get(n,e);return null!=r&&!r})})}export{m as AbstractMetadata,y as BinaryMetadata,kt as BooleanFunction,an as ConditionalMappingMetadata,Un as DateFunction,Cn as DateUtils,nn as DefaultContext,Zt as Field,v as FieldMetadata,Xt as Function,g as FunctionMetadata,Qt as IterableFunction,Bt as IterableMetadata,Fn as MetadataUtils,on as MultipleMappingsMetadata,Jt as NaryMetadata,Kt as NumberFunction,w as Paths,fn as SingleMappingMetadata,$t as StringFunction,wn as TypeConverterMetadata,Gt as UnaryMetadata,u as Utils,en as ValidationRuleMetadata,Wt as ValueMetadata,un as WhenMetadata,kn as biConverter,Ln as boolean,Hn as converter,qn as date,zn as dateIso,jn as f,xn as field,Sn as iterable,_n as lift,Wn as map,Xn as mapAll,Bn as mapNull,Kn as mappings,Zn as matchAll,Qn as matchAny,$n as matchNone,Jn as naryConverter,Rn as number,Vn as string,Gn 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}var o=Object.freeze({hasProperty:a,isInteger:i,nullOrUndefined: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,e){var a=r({},e);return a[t]=n,a}function l(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 l(u,n,t)}function d(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=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 n(n,e,r){void 0===e&&(e=[]),void 0===r&&(r=-1);var a=t.call(this)||this;a.type="FIELD",a.readable=c.apply(void 0,n),a.path=n.slice(),a.tags=e;var u=n.filter(function(t){return i(t)});return a.position=-1===r&&u.length>=1?u[u.length-1]:r,a}return e(n,t),n}(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 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}(v),M={readable:"single_mapping"},D={readable:"when"},O={readable:"validate"},N={readable:"not"},P={readable:"and"},Y={readable:"or"},F={readable:"then"},I={readable:"else"},E={readable:"function"},A={readable:"has value"},T={readable:"is null"},j={readable:"is not null"},_={readable:"is defined"},S={readable:"is undefined"},x={readable:"="},C={readable:"!="},L={readable:"match all"},U={readable:"none match"},V={readable:"match any"},R={readable:"contains"},q={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:"<"},et={readable:"<="},rt={readable:">"},at={readable:">="},it={readable:"+"},ut={readable:"-"},ot={readable:"*"},ct="->",st={readable:"using"},ft={readable:"multiple inputs"},lt={readable:">"},ht={readable:">="},dt={readable:"<"},pt={readable:"<="},wt={readable:"plus days"},mt={readable:"minus days"},vt={readable:"plus months"},gt={readable:"minus months"},yt={readable:"plus years"},bt={readable:"minus years"},Mt={readable:"format iso"},Dt={readable:"format day month year"},Ot={readable:"this year"},Nt={readable:"this month"},Pt={readable:"today"},Yt={readable:"tomorrow"},Ft={readable:"with day of month"},It={readable:"with month"},Et={readable:"with year"},At={readable:"with first day of next year"},Tt={readable:"with last day of last year"},jt={readable:"month of"},_t={readable:"year of"},St={readable:"date of"},xt={readable:"number of months since"},Ct={readable:"number of months between"},Lt={readable:"contains all"},Ut={readable:"is empty"},Vt={readable:"is not empty"},Rt={readable:"has size"},qt={readable:"has not size"},zt={readable:"position of"},Gt={readable:"tags of"},Bt=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.metadata.readable+" "+this.operator.readable},enumerable:!0,configurable:!0}),n.prototype.children=function(){return[this.metadata]},n}(v),Wt=function(t){function n(n){var e=t.call(this)||this;return e.type="VALUE",e.readable=String(n),e.value=n,e}return e(n,t),n}(v),Xt=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}(v),Ht=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 Wt(n),function(){return n})},t.prototype.mapTo=function(t,n,e){var r=this;return new t(new b(this.metadata,E,new y(e||n.toString())),function(t,e){return n(r.get(t,e))})},t.prototype.hasValue=function(){var t=this;return new Jt(new Bt(this.metadata,A),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 Jt(new Bt(this.metadata,_),function(n,e){return void 0!==t.get(n,e)})},t.prototype.isUndefined=function(){var t=this;return new Jt(new Bt(this.metadata,S),function(n,e){return void 0===t.get(n,e)})},t.prototype.isNull=function(){var t=this;return new Jt(new Bt(this.metadata,T),function(n,e){return null===t.get(n,e)})},t.prototype.isNotNull=function(){var t=this;return new Jt(new Bt(this.metadata,j),function(n,e){return null!==t.get(n,e)})},t.prototype.eq=function(n){var e=this;return n instanceof t?new Jt(new b(this.metadata,x,n.metadata),function(t,r){return e.get(t,r)===n.get(t,r)}):new Jt(new b(this.metadata,x,new Wt(n)),function(t,r){return e.get(t,r)===n})},t.prototype.notEq=function(n){var e=this;return n instanceof t?new Jt(new b(this.metadata,C,n.metadata),function(t,r){return e.get(t,r)!==n.get(t,r)}):new Jt(new b(this.metadata,C,new Wt(n)),function(t,r){return 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 Wt(n)});return new Jt(new b(this.metadata,L,new Xt(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 Wt(n)});return new Jt(new b(this.metadata,U,new Xt(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 Wt(n)});return new Jt(new b(this.metadata,V,new Xt(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 kt(t,n,e,r){return n instanceof Ht?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 Jt=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 Bt(this.metadata,N),kt(this,!1,function(t){return!t},!1))},n.prototype.and=function(t){var e=this;return new n(new b(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 kt(e,t,function(t,n){return t&&n},!1)(n,r)})},n.prototype.or=function(t){var e=this;return new n(new b(this.metadata,Y,t instanceof n?t.metadata:new Wt(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 kt(e,t,function(t,n){return t||n},!1)(r,a)})},n}(Ht),Kt=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}(v),Qt=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 Wt(t)});return new n(new Kt(r,Z),function(n,e){var r=function(t,n){return t<n?t:n};return t.reduce(function(t,a){if(a instanceof Ht){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 Wt(t)});return new n(new Kt(r,$),function(n,e){var r=function(t,n){return t>n?t:n};return t.reduce(function(t,a){if(a instanceof Ht){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 Wt(t)});return new n(new Kt(r,tt),function(n,e){var r=function(t,n){return t+n};return t.reduce(function(t,a){if(a instanceof Ht){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 Jt(new b(this.metadata,nt,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.lesserOrEquals=function(t){var e=function(t,n){return t<=n};return new Jt(new b(this.metadata,et,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.greaterThan=function(t){var e=function(t,n){return t>n};return new Jt(new b(this.metadata,rt,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.greaterOrEquals=function(t){var e=function(t,n){return t>=n};return new Jt(new b(this.metadata,at,t instanceof n?t.metadata:new Wt(t)),kt(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 b(this.metadata,it,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,null))},n.prototype.minus=function(t){var e=function(t,n){return t-n};return new n(new b(this.metadata,ut,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,null))},n.prototype.times=function(t){var e=function(t,n){return t*n};return new n(t instanceof n?new b(this.metadata,ut,t.metadata):new b(this.metadata,ot,new Wt(t)),kt(this,t,e,null))},n}(Ht),Zt=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 Jt(new b(this.metadata,R,t instanceof Ht?t.metadata:new Wt(t)),kt(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 Jt(new b(this.metadata,Lt,t instanceof Ht?t.metadata:new Xt(t.map(function(t){return new Wt(t)}))),kt(this,t,n,!1))},n.prototype.isEmpty=function(){return new Jt(new Bt(this.metadata,Ut),kt(this,void 0,function(t){return 0===t.length},null))},n.prototype.isNotEmpty=function(){return new Jt(new Bt(this.metadata,Vt),kt(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 Jt(new Bt(this.metadata,Rt),kt(this,t,n,null))},n.prototype.hasNotSize=function(t){var n=function(t,n){return t.length!==n};return new Jt(new Bt(this.metadata,qt),kt(this,t,n,null))},n}(Ht),$t=function(){function t(t){this.get=p.apply(void 0,t.path),this.set=w.apply(void 0,t.path),this.metadata=t}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))},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))},t.prototype.position=function(){var t=this;return new Qt(new Bt(this.metadata,zt),function(){return t.metadata.position})},t.prototype.tags=function(){var t=this;return new Zt(new Bt(this.metadata,Gt),function(){return t.metadata.tags})},t}(),tn=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 Jt(new b(this.metadata,R,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.matches=function(t){var e=function(t,n){var e=t.match(n);return null!=e&&e.length>=1};return new Jt(new b(this.metadata,q,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.startsWith=function(t){var e=function(t,n){return t.startsWith(n)};return new Jt(new b(this.metadata,z,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.endsWith=function(t){var e=function(t,n){return t.endsWith(n)};return new Jt(new b(this.metadata,G,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.length=function(){return new Qt(new Bt(this.metadata,B),kt(this,void 0,function(t){return t.length},0))},n.prototype.parseInt=function(){return new Qt(new Bt(this.metadata,W),kt(this,void 0,function(t){return parseInt(t)},null))},n.prototype.trim=function(){return new n(new Bt(this.metadata,X),kt(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 Wt(t),P,new Wt(e))),kt(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 Wt(t),P,new Wt(e))),kt(this,void 0,function(n){return n.substring(t,e)},null))},n.prototype.localeUpperCase=function(){return new n(new Bt(this.metadata,H),kt(this,void 0,function(t){return t.toLocaleUpperCase()},null))},n.prototype.localeLowerCase=function(){return new n(new Bt(this.metadata,k),kt(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 Wt(t)),kt(this,t,function(t,n){return t+n},null))},n}(Ht),nn=function(t,n){this.value=t,this.context=n},en=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}(),rn=function(t){function n(n){var e=t.call(this,O)||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}(v),an=function(){function t(t){this.when=t,this.metadata=new rn(t.metadata)}return t.prototype.execute=function(t,n){void 0===t&&(t={});var e=n||new en;return new nn(this.when.condition.get(t,e),e)},t}(),un=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+" "+F.readable+" "+this.thenMetadata.readable+(null!=this.elseMetadata?" "+I.readable+" "+this.elseMetadata.readable:"")},enumerable:!0,configurable:!0}),n}(v),on=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}(),cn=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}(v),sn=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 un(new on(t.metadata),new cn(r,F))}return t.prototype.execute=function(t,n){return this.condition.get(t,n)?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.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 un(this.metadata.whenMetadata,this.metadata.thenMetadata,new cn(e,I)),this},t}(),fn=function(){function t(t){this.condition=t,this.metadata=new on(t.metadata)}return t.prototype.validate=function(){return new an(this)},t.prototype.then=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new(sn.bind.apply(sn,[void 0,this.condition].concat(t)))},t}(),ln=function(t){function n(n,e){var r=t.call(this,M)||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+" "+ct+" "+this.targetMetadata.readable},enumerable:!0,configurable:!0}),n.prototype.children=function(){return[this.sourceMetadata,this.targetMetadata]},n}(v),hn=function(){function t(t,n){this.input=t,this.output=n,this.metadata=new ln(t.metadata,n.metadata)}return t.prototype.execute=function(t,n){var e=n||new en;return this.output.set?this.output.set(t,this.input.get(t,e),e):t},t}(),dn=function(t){function n(n,e){var r=t.call(this,new b(n.metadata,st,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 hn(this,t)},n}(Ht),pn=function(){function t(t){this.input=t}return t.prototype.to=function(t){return new hn(this.input,t)},t.prototype.using=function(t){return new dn(this.input,t)},t}(),wn=function(){function t(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];this.mappings=n.flatMap(function(n){return n instanceof t?n.mappings:[n]}),this.metadata=new cn(this.mappings.map(function(t){return t.metadata}))}return t.prototype.execute=function(t,n){return this.mappings.reduce(function(t,e){return e.execute(t,n)},t)},t}(),mn=function(t,n,e){this.type="TYPE_CONVERTER",this.operator=e,this.body=t,this.readable=null!=n?n:t},vn=function(t,n){this.convert=t,this.metadata=new mn(t.toString(),n)},gn=function(t){function n(n,e,r){var a=t.call(this,new b(new b(n.metadata,P,e.metadata),st,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 dn(this,t)},n.prototype.to=function(t){return new hn(this,t)},n}(Ht),yn=function(){function t(t,n){this.input=t,this.input2=n}return t.prototype.using=function(t){return new gn(this.input,this.input2,t instanceof vn?t:new vn(t))},t}(),bn=function(t,n){this.convert=t,this.metadata=new mn(t.toString(),n)},Mn=function(t){function n(n,e){var r=t.call(this,new b(new Kt(n.map(function(t){return t.metadata}),ft),st,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 dn(this,t)},n.prototype.to=function(t){return new hn(this,t)},n}(Ht),Dn=function(){function t(t){this.inputs=t}return t.prototype.using=function(t){return new Mn(this.inputs,t instanceof bn?t:new bn(t))},t}();function On(t,n){for(t=String(t),n=n||2;t.length<n;)t="0"+t;return t}function Nn(){return new Date(Date.now())}function Pn(t){return new Date(t.valueOf())}function Yn(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 Fn(t){var n=Pn(t);return n.getFullYear().toString()+On(n.getMonth()+1,2)+On(n.getDate(),2)}function In(t){var n=Pn(t);return On(n.getDate(),2)+On(n.getMonth()+1,2)+n.getFullYear()}function En(t){return Yn(Number.parseInt(t.slice(0,4)),Number.parseInt(t.slice(4,6))-1,Number.parseInt(t.slice(6,8)))}function An(t,n){var e=n||Nn(),r=12*(e.getFullYear()-t.getFullYear())+(e.getMonth()-t.getMonth());return e.getDay()-t.getDate()>=0?r:r-1}var Tn=Object.freeze({now:Nn,clone:Pn,newUTCDate:Yn,formatYYYYMMdd:Fn,formatddMMYYYY:In,formatReadable:function(t){var n=Pn(t);return On(n.getDate(),2)+"/"+On(n.getMonth()+1,2)+"/"+n.getFullYear()},formatMMMMYYYY:function(t,n){var e=Pn(t);return new Intl.DateTimeFormat(n,{month:"long"}).format(t)+" "+e.getFullYear()},formatEEEEddMMMM:function(t,n){var e=Pn(t),r=new Intl.DateTimeFormat(n,{weekday:"long"}).format(e),a=new Intl.DateTimeFormat(n,{month:"long"}).format(e);return r+" "+On(e.getDate(),2)+" "+a},formatTime:function(t){var n=Pn(t);return On(t.getHours(),2)+On(n.getMinutes(),2)+On(t.getSeconds(),2)},parse:En,numberOfFullMonthsBetween:An}),jn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),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:En(r)},function(n,e,r){return u(e)?t.set?t.set(n,e,r):n:t.set?t.set(n,Fn(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 Wt(t)});return new n(new Kt(r,Z),function(e,r){var a=function(t,n){return t<n?t:n};return t.reduce(function(t,n){if(n instanceof Ht){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 Wt(t)});return new n(new Kt(r,$),function(e,r){var a=function(t,n){return t>n?t:n};return t.reduce(function(t,n){if(n instanceof Ht){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 Qt(new y("clone().getFullYear()",void 0,Ot),function(){return Nn().getFullYear()})},n.thisMonth=function(){return new Qt(new y("clone().getMonth() + 1",void 0,Nt),function(){return Nn().getMonth()+1})},n.today=function(){return new n(new y("clone()",void 0,Pt),function(){return Nn()})},n.tomorrow=function(){return new n(new y("date.setDate(date.getDate() + 1)",void 0,Yt),function(){var t=Nn();return t.setDate(t.getDate()+1),t})},n.dateFrom=function(t){return new n(new y("Date{"+t+"}"),function(){return En(t)})},n.newDate=function(t,e,r){return new n(new y("Date{ Y:"+t+" M:"+e+" D:"+r+" }"),function(){return Yn(t,e,r)})},n.newLocalDate=function(t,e,r){return new n(new y("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 Jt(new b(this.metadata,dt,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.beforeOrEquals=function(t){var e=function(t,n){return t<=n};return new Jt(new b(this.metadata,pt,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.after=function(t){var e=function(t,n){return t>n};return new Jt(new b(this.metadata,lt,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.afterOrEquals=function(t){var e=function(t,n){return t>=n};return new Jt(new b(this.metadata,ht,t instanceof n?t.metadata:new Wt(t)),kt(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=Pn(t);return e.setDate(t.getDate()+n),e};return new n(new b(this.metadata,wt,t instanceof Qt?t.metadata:new Wt(t)),kt(this,t,e,null))},n.prototype.minusDays=function(t){var e=function(t,n){var e=Pn(t);return e.setDate(e.getDate()-n),e};return new n(new b(this.metadata,mt,t instanceof Qt?t.metadata:new Wt(t)),kt(this,t,e,null))},n.prototype.plusMonths=function(t){var e=function(t,n){var e=Pn(t);return e.setMonth(e.getMonth()+n),e};return new n(new b(this.metadata,vt,t instanceof Qt?t.metadata:new Wt(t)),kt(this,t,e,null))},n.prototype.minusMonths=function(t){var e=function(t,n){var e=Pn(t);return e.setMonth(e.getMonth()-n),e};return new n(new b(this.metadata,gt,t instanceof Qt?t.metadata:new Wt(t)),kt(this,t,e,null))},n.prototype.plusYears=function(t){var e=function(t,n){var e=Pn(t);return e.setFullYear(e.getFullYear()+n),e};return new n(new b(this.metadata,yt,t instanceof Qt?t.metadata:new Wt(t)),kt(this,t,e,null))},n.prototype.minusYears=function(t){var e=function(t,n){var e=Pn(t);return e.setFullYear(e.getFullYear()-n),e};return new n(new b(this.metadata,bt,t instanceof Qt?t.metadata:new Wt(t)),kt(this,t,e,null))},n.prototype.formatISO=function(){return new tn(new Bt(this.metadata,Mt),kt(this,void 0,function(t){return Fn(t)},null))},n.prototype.dayMonthYear=function(){return new tn(new Bt(this.metadata,Dt),kt(this,void 0,function(t){return In(t)},null))},n.nbFullMonthsSince=function(t){return new Qt(new Bt(t.metadata,xt),kt(t,void 0,function(t){return An(t)},null))},n.nbFullMonthsBetween=function(t,e){return e instanceof n?new Qt(new b(t.metadata,Ct,e.metadata),kt(t,e,function(t,n){return An(t,n)},null)):new Qt(new b(t.metadata,Ct,new Wt(e)),kt(t,e,An,null))},n.prototype.withDayOfMonth=function(t){return new n(new b(this.metadata,Ft,new Wt(t)),kt(this,t,function(t,n){var e=Pn(t);return e.setDate(n),e},null))},n.prototype.withMonth=function(t){return new n(new b(this.metadata,It,new Wt(t)),kt(this,t,function(t,n){var e=Pn(t);return e.setMonth(n),e},null))},n.prototype.withYear=function(t){return new n(new b(this.metadata,Et,new Wt(t)),kt(this,t,function(t,n){var e=Pn(t);return e.setFullYear(n),e},null))},n.prototype.withFirstDayOfNextYear=function(){return new n(new Bt(this.metadata,At),kt(this,void 0,function(t){var n=Pn(t);return n.setMonth(11),n.setDate(32),n},null))},n.prototype.withLastDayOfLastYear=function(){return new n(new Bt(this.metadata,Tt),kt(this,void 0,function(t){var n=Pn(t);return n.setMonth(0),n.setDate(0),n},null))},n.prototype.monthOf=function(){return new Qt(new Bt(this.metadata,jt),kt(this,void 0,function(t){return t.getMonth()},null))},n.prototype.yearOf=function(){return new Qt(new Bt(this.metadata,_t),kt(this,void 0,function(t){return t.getFullYear()},null))},n.prototype.dateOf=function(){return new Qt(new Bt(this.metadata,St),kt(this,void 0,function(t){return t.getDate()},null))},n.MAX_DATE=new Date(864e13),n.MIN_DATE=new Date(-864e13),n}(Ht),_n=function(t,n){this.convert=t,this.metadata=new mn(t.toString(),n)};var Sn=Object.freeze({fieldsOf:function t(n){var e=n;return"FIELD"==e.type?[e.path]:n.children?n.children().flatMap(function(n){return t(n)}):[]}});t.AbstractMetadata=v,t.BinaryMetadata=b,t.BooleanFunction=Jt,t.ConditionalMappingMetadata=un,t.DateFunction=jn,t.DateUtils=Tn,t.DefaultContext=en,t.Field=$t,t.FieldMetadata=g,t.Function=Ht,t.FunctionMetadata=y,t.IterableFunction=Zt,t.IterableMetadata=Xt,t.MetadataUtils=Sn,t.MultipleMappingsMetadata=cn,t.NaryMetadata=Kt,t.NumberFunction=Qt,t.Paths=m,t.SingleMappingMetadata=ln,t.StringFunction=tn,t.TypeConverterMetadata=mn,t.UnaryMetadata=Bt,t.Utils=o,t.ValidationRuleMetadata=rn,t.ValueMetadata=Wt,t.WhenMetadata=on,t.biConverter=function(t,n){return new vn(t,n)},t.boolean=function(t){return Jt.boolean(t)},t.converter=function(t,n){return new _n(t,n)},t.date=function(t){return jn.date(t)},t.dateIso=function(t){return jn.dateIso(t)},t.f=function(t){return Ht.function(t)},t.field=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return $t.field.apply($t,t)},t.iterable=function(t){return Zt.iterable(t)},t.lift=function(t,n){return Ht.lift(t,n)},t.map=function(t,n){return n?new yn(t instanceof Ht?t:new Ht(new Wt(t),function(n){return t}),n instanceof Ht?n:new Ht(new Wt(n),function(t){return n})):new pn(t instanceof Ht?t:new Ht(new Wt(t),function(n){return t}))},t.mapAll=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new Dn(t)},t.mapNull=function(t){return new hn(new Ht(new Wt(null),function(t){return null}),t)},t.mappings=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new(wn.bind.apply(wn,[void 0].concat(t)))},t.matchAll=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new Jt(new Kt(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 Jt(new Kt(t.map(function(t){return t.metadata}),V),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 Jt(new Kt(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 bn(t,n)},t.number=function(t){return Qt.number(t)},t.string=function(t){return tn.string(t)},t.when=function(t){return new fn(t)},Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!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 o(t){return null==t}var u=Object.freeze({hasProperty:a,isInteger:i,nullOrUndefined:o});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,e){var a=r({},e);return a[t]=n,a}function l(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 o=e[0];if(e.length>1){var u=null!=t&&a(o,t)?t[o]:i(e[1])?[]:{};n=h.apply(void 0,[u,n].concat(Array.prototype.slice.call(e,1)))}return l(o,n,t)}function d(t,n){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];var o=e[0];if(e.length>1){var u=null!=t&&a(o,t)?t[o]:i(e[1])?[]:{};n=d.apply(void 0,[u,n].concat(Array.prototype.slice.call(e,1)))}return f(o,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 n(n,e,r){void 0===e&&(e=[]),void 0===r&&(r=-1);var a=t.call(this)||this;a.type="FIELD",a.readable=c.apply(void 0,n),a.path=n.slice(),a.tags=e;var o=n.filter(function(t){return i(t)});return a.position=-1===r&&o.length>=1?o[o.length-1]:r,a}return e(n,t),n}(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 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}(v),M={readable:"single_mapping"},D={readable:"when"},O={readable:"validate"},T={readable:"not"},N={readable:"and"},P={readable:"or"},Y={readable:"then"},E={readable:"else"},F={readable:"function"},I={readable:"has value"},C={readable:"is null"},U={readable:"is not null"},A={readable:"is defined"},x={readable:"is undefined"},j={readable:"="},_={readable:"!="},S={readable:"match all"},L={readable:"none match"},V={readable:"match any"},R={readable:"contains"},q={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:"<"},et={readable:"<="},rt={readable:">"},at={readable:">="},it={readable:"+"},ot={readable:"-"},ut={readable:"*"},ct="->",st={readable:"using"},ft={readable:"multiple inputs"},lt={readable:">"},ht={readable:">="},dt={readable:"<"},pt={readable:"<="},wt={readable:"plus days"},mt={readable:"minus days"},vt={readable:"plus months"},gt={readable:"minus months"},yt={readable:"plus years"},bt={readable:"minus years"},Mt={readable:"format iso"},Dt={readable:"format day month year"},Ot={readable:"this year"},Tt={readable:"this month"},Nt={readable:"today"},Pt={readable:"tomorrow"},Yt={readable:"with day of month"},Et={readable:"with month"},Ft={readable:"with year"},It={readable:"with first day of next year"},Ct={readable:"with last day of last year"},Ut={readable:"month of"},At={readable:"year of"},xt={readable:"date of"},jt={readable:"number of months since"},_t={readable:"number of months between"},St={readable:"contains all"},Lt={readable:"is empty"},Vt={readable:"is not empty"},Rt={readable:"has size"},qt={readable:"has not size"},zt={readable:"position of"},Gt={readable:"tags of"},Bt=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===T?this.operator.readable+"("+this.metadata.readable+")":this.metadata.readable+" "+this.operator.readable},enumerable:!0,configurable:!0}),n.prototype.children=function(){return[this.metadata]},n}(v),Wt=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}(v),Xt=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}(v),Ht=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 Wt(n),function(){return n})},t.prototype.mapTo=function(t,n,e){var r=this;return new t(new b(this.metadata,F,new y(e||n.toString())),function(t,e){return n(r.get(t,e))})},t.prototype.hasValue=function(){var t=this;return new Jt(new Bt(this.metadata,I),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 Jt(new Bt(this.metadata,A),function(n,e){return void 0!==t.get(n,e)})},t.prototype.isUndefined=function(){var t=this;return new Jt(new Bt(this.metadata,x),function(n,e){return void 0===t.get(n,e)})},t.prototype.isNull=function(){var t=this;return new Jt(new Bt(this.metadata,C),function(n,e){return null===t.get(n,e)})},t.prototype.isNotNull=function(){var t=this;return new Jt(new Bt(this.metadata,U),function(n,e){return null!==t.get(n,e)})},t.prototype.eq=function(n){var e=this;return n instanceof t?new Jt(new b(this.metadata,j,n.metadata),function(t,r){return e.get(t,r)===n.get(t,r)}):new Jt(new b(this.metadata,j,new Wt(n)),function(t,r){return e.get(t,r)===n})},t.prototype.notEq=function(n){var e=this;return n instanceof t?new Jt(new b(this.metadata,_,n.metadata),function(t,r){return e.get(t,r)!==n.get(t,r)}):new Jt(new b(this.metadata,_,new Wt(n)),function(t,r){return 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 Wt(n)});return new Jt(new b(this.metadata,S,new Xt(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 Wt(n)});return new Jt(new b(this.metadata,L,new Xt(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 Wt(n)});return new Jt(new b(this.metadata,V,new Xt(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 kt(t,n,e,r){return n instanceof Ht?function(a,i){var o=t.get(a,i);if(null!=o||null!=o){var u=n.get(a,i);return null!=u||null!=u?e(o,u):r}return r}:function(a,i){var o=t.get(a,i);return null!=o||null!=o?e(o,n):r}}var Jt=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 Bt(this.metadata,T),kt(this,!1,function(t){return!t},!1))},n.prototype.and=function(t){var e=this;return new n(new b(this.metadata,N,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 kt(e,t,function(t,n){return t&&n},!1)(n,r)})},n.prototype.or=function(t){var e=this;return new n(new b(this.metadata,P,t instanceof n?t.metadata:new Wt(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 kt(e,t,function(t,n){return t||n},!1)(r,a)})},n}(Ht),Kt=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}(v),Qt=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 Wt(t)});return new n(new Kt(r,Z),function(n,e){var r=function(t,n){return t<n?t:n};return t.reduce(function(t,a){if(a instanceof Ht){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 Wt(t)});return new n(new Kt(r,$),function(n,e){var r=function(t,n){return t>n?t:n};return t.reduce(function(t,a){if(a instanceof Ht){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 Wt(t)});return new n(new Kt(r,tt),function(n,e){var r=function(t,n){return t+n};return t.reduce(function(t,a){if(a instanceof Ht){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 Jt(new b(this.metadata,nt,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.lesserOrEquals=function(t){var e=function(t,n){return t<=n};return new Jt(new b(this.metadata,et,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.greaterThan=function(t){var e=function(t,n){return t>n};return new Jt(new b(this.metadata,rt,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.greaterOrEquals=function(t){var e=function(t,n){return t>=n};return new Jt(new b(this.metadata,at,t instanceof n?t.metadata:new Wt(t)),kt(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 b(this.metadata,it,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,null))},n.prototype.minus=function(t){var e=function(t,n){return t-n};return new n(new b(this.metadata,ot,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,null))},n.prototype.times=function(t){var e=function(t,n){return t*n};return new n(t instanceof n?new b(this.metadata,ot,t.metadata):new b(this.metadata,ut,new Wt(t)),kt(this,t,e,null))},n}(Ht),Zt=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 Jt(new b(this.metadata,R,t instanceof Ht?t.metadata:new Wt(t)),kt(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 Jt(new b(this.metadata,St,t instanceof Ht?t.metadata:new Xt(t.map(function(t){return new Wt(t)}))),kt(this,t,n,!1))},n.prototype.isEmpty=function(){return new Jt(new Bt(this.metadata,Lt),kt(this,void 0,function(t){return 0===t.length},null))},n.prototype.isNotEmpty=function(){return new Jt(new Bt(this.metadata,Vt),kt(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 Jt(new Bt(this.metadata,Rt),kt(this,t,n,null))},n.prototype.hasNotSize=function(t){var n=function(t,n){return t.length!==n};return new Jt(new Bt(this.metadata,qt),kt(this,t,n,null))},n.prototype.length=function(){return new Qt(new Bt(this.metadata,B),kt(this,void 0,function(t){return t.length},null))},n}(Ht),$t=function(){function t(t){this.get=p.apply(void 0,t.path),this.set=w.apply(void 0,t.path),this.metadata=t}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))},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))},t.prototype.position=function(){var t=this;return new Qt(new Bt(this.metadata,zt),function(){return t.metadata.position})},t.prototype.tags=function(){var t=this;return new Zt(new Bt(this.metadata,Gt),function(){return t.metadata.tags})},t}(),tn=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 Jt(new b(this.metadata,R,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.matches=function(t){var e=function(t,n){return new RegExp(n).test(t)};return new Jt(new b(this.metadata,q,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.startsWith=function(t){var e=function(t,n){return t.startsWith(n)};return new Jt(new b(this.metadata,z,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.endsWith=function(t){var e=function(t,n){return t.endsWith(n)};return new Jt(new b(this.metadata,G,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.length=function(){return new Qt(new Bt(this.metadata,B),kt(this,void 0,function(t){return t.length},0))},n.prototype.parseInt=function(){return new Qt(new Bt(this.metadata,W),kt(this,void 0,function(t){return parseInt(t)},null))},n.prototype.trim=function(){return new n(new Bt(this.metadata,X),kt(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 Wt(t),N,new Wt(e))),kt(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 Wt(t),N,new Wt(e))),kt(this,void 0,function(n){return n.substring(t,e)},null))},n.prototype.localeUpperCase=function(){return new n(new Bt(this.metadata,H),kt(this,void 0,function(t){return t.toLocaleUpperCase()},null))},n.prototype.localeLowerCase=function(){return new n(new Bt(this.metadata,k),kt(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 Wt(t)),kt(this,t,function(t,n){return t+n},null))},n}(Ht),nn=function(t,n){this.value=t,this.context=n},en=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}(),rn=function(t){function n(n){var e=t.call(this,O)||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}(v),an=function(){function t(t){this.when=t,this.metadata=new rn(t.metadata)}return t.prototype.execute=function(t,n){void 0===t&&(t={});var e=n||new en;return new nn(this.when.condition.get(t,e),e)},t}(),on=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+" "+Y.readable+" "+this.thenMetadata.readable+(null!=this.elseMetadata?" "+E.readable+" "+this.elseMetadata.readable:"")},enumerable:!0,configurable:!0}),n}(v),un=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}(),cn=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}(v),sn=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 un(t.metadata),new cn(r,Y))}return t.prototype.execute=function(t,n){var e=n||new en;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 en;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 cn(e,E)),this},t}(),fn=function(){function t(t){this.condition=t,this.metadata=new un(t.metadata)}return t.prototype.validate=function(){return new an(this)},t.prototype.then=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new(sn.bind.apply(sn,[void 0,this.condition].concat(t)))},t}(),ln=function(t){function n(n,e){var r=t.call(this,M)||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+" "+ct+" "+this.targetMetadata.readable},enumerable:!0,configurable:!0}),n.prototype.children=function(){return[this.sourceMetadata,this.targetMetadata]},n}(v),hn=function(){function t(t,n){this.input=t,this.output=n,this.metadata=new ln(t.metadata,n.metadata)}return t.prototype.execute=function(t,n){var e=n||new en;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 en;return this.output.set?this.output.set(n,this.input.get(t,r),r):n},t}(),dn=function(t){function n(n,e){var r=t.call(this,new b(n.metadata,st,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 hn(this,t)},n}(Ht),pn=function(){function t(t){this.input=t}return t.prototype.to=function(t){return new hn(this.input,t)},t.prototype.using=function(t){return new dn(this.input,t)},t}(),wn=function(){function t(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];this.mappings=n.flatMap(function(n){return n instanceof t?n.mappings:[n]}),this.metadata=new cn(this.mappings.map(function(t){return t.metadata}))}return t.prototype.execute=function(t,n){var e=n||new en;return this.mappings.reduce(function(t,n){return n.execute(t,e)},t)},t.prototype.executeOn=function(t,n,e){var r=e||new en;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},vn=function(t,n){this.convert=t,this.metadata=new mn(t.toString(),n)},gn=function(t){function n(n,e,r){var a=t.call(this,new b(new b(n.metadata,N,e.metadata),st,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 dn(this,t)},n.prototype.to=function(t){return new hn(this,t)},n}(Ht),yn=function(){function t(t,n){this.input=t,this.input2=n}return t.prototype.using=function(t){return new gn(this.input,this.input2,t instanceof vn?t:new vn(t))},t}(),bn=function(t,n){this.convert=t,this.metadata=new mn(t.toString(),n)},Mn=function(t){function n(n,e){var r=t.call(this,new b(new Kt(n.map(function(t){return t.metadata}),ft),st,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 dn(this,t)},n.prototype.to=function(t){return new hn(this,t)},n}(Ht),Dn=function(){function t(t){this.inputs=t}return t.prototype.using=function(t){return new Mn(this.inputs,t instanceof bn?t:new bn(t))},t}();function On(t,n){for(t=String(t),n=n||2;t.length<n;)t="0"+t;return t}function Tn(){return new Date(Date.now())}function Nn(t){return new Date(t.valueOf())}function Pn(t,n,e,r,a,i,o){return new Date(Date.UTC(t,n,e||0,r||0,a||0,i||0,o||0))}function Yn(t){var n=Nn(t);return n.getUTCFullYear().toString()+On(n.getUTCMonth()+1,2)+On(n.getUTCDate(),2)}function En(t){var n=Nn(t);return On(n.getUTCDate(),2)+On(n.getUTCMonth()+1,2)+n.getUTCFullYear()}function Fn(t){return Pn(Number.parseInt(t.slice(0,4)),Number.parseInt(t.slice(4,6))-1,Number.parseInt(t.slice(6,8)))}function In(t,n){var e=n||Tn(),r=12*(e.getUTCFullYear()-t.getUTCFullYear())+(e.getUTCMonth()-t.getUTCMonth());return e.getUTCDay()-t.getUTCDate()>=0?r:r-1}var Cn=Object.freeze({now:Tn,clone:Nn,newUTCDate:Pn,formatYYYYMMdd:Yn,formatddMMYYYY:En,formatReadable:function(t){var n=Nn(t);return On(n.getUTCDate(),2)+"/"+On(n.getUTCMonth()+1,2)+"/"+n.getUTCFullYear()},formatMMMMYYYY:function(t,n){var e=Nn(t);return new Intl.DateTimeFormat(n,{month:"long"}).format(t)+" "+e.getUTCFullYear()},formatEEEEddMMMM:function(t,n){var e=Nn(t),r=new Intl.DateTimeFormat(n,{weekday:"long"}).format(e),a=new Intl.DateTimeFormat(n,{month:"long"}).format(e);return r+" "+On(e.getUTCDate(),2)+" "+a},formatTime:function(t){var n=Nn(t);return On(t.getHours(),2)+On(n.getMinutes(),2)+On(t.getSeconds(),2)},parse:Fn,numberOfFullMonthsBetween:In}),Un=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),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 o(r)?r:Fn(r)},function(n,e,r){return o(e)?t.set?t.set(n,e,r):n:t.set?t.set(n,Yn(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 Wt(t)});return new n(new Kt(r,Z),function(e,r){var a=function(t,n){return t<n?t:n};return t.reduce(function(t,n){if(n instanceof Ht){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 Wt(t)});return new n(new Kt(r,$),function(e,r){var a=function(t,n){return t>n?t:n};return t.reduce(function(t,n){if(n instanceof Ht){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 Qt(new y("clone().getFullYear()",void 0,Ot),function(){return Tn().getFullYear()})},n.thisMonth=function(){return new Qt(new y("clone().getMonth() + 1",void 0,Tt),function(){return Tn().getMonth()+1})},n.today=function(){return new n(new y("clone()",void 0,Nt),function(){return Tn()})},n.tomorrow=function(){return new n(new y("date.setDate(date.getDate() + 1)",void 0,Pt),function(){var t=Tn();return t.setDate(t.getDate()+1),t})},n.dateFrom=function(t){return new n(new y("Date{"+t+"}"),function(){return Fn(t)})},n.newDate=function(t,e,r){return new n(new y("Date{ Y:"+t+" M:"+e+" D:"+r+" }"),function(){return Pn(t,e,r)})},n.newLocalDate=function(t,e,r){return new n(new y("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 Jt(new b(this.metadata,dt,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.beforeOrEquals=function(t){var e=function(t,n){return t<=n};return new Jt(new b(this.metadata,pt,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.after=function(t){var e=function(t,n){return t>n};return new Jt(new b(this.metadata,lt,t instanceof n?t.metadata:new Wt(t)),kt(this,t,e,!1))},n.prototype.afterOrEquals=function(t){var e=function(t,n){return t>=n};return new Jt(new b(this.metadata,ht,t instanceof n?t.metadata:new Wt(t)),kt(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=Nn(t);return e.setDate(t.getDate()+n),e};return new n(new b(this.metadata,wt,t instanceof Qt?t.metadata:new Wt(t)),kt(this,t,e,null))},n.prototype.minusDays=function(t){var e=function(t,n){var e=Nn(t);return e.setDate(e.getDate()-n),e};return new n(new b(this.metadata,mt,t instanceof Qt?t.metadata:new Wt(t)),kt(this,t,e,null))},n.prototype.plusMonths=function(t){var e=function(t,n){var e=Nn(t);return e.setMonth(e.getMonth()+n),e};return new n(new b(this.metadata,vt,t instanceof Qt?t.metadata:new Wt(t)),kt(this,t,e,null))},n.prototype.minusMonths=function(t){var e=function(t,n){var e=Nn(t);return e.setMonth(e.getMonth()-n),e};return new n(new b(this.metadata,gt,t instanceof Qt?t.metadata:new Wt(t)),kt(this,t,e,null))},n.prototype.plusYears=function(t){var e=function(t,n){var e=Nn(t);return e.setFullYear(e.getFullYear()+n),e};return new n(new b(this.metadata,yt,t instanceof Qt?t.metadata:new Wt(t)),kt(this,t,e,null))},n.prototype.minusYears=function(t){var e=function(t,n){var e=Nn(t);return e.setFullYear(e.getFullYear()-n),e};return new n(new b(this.metadata,bt,t instanceof Qt?t.metadata:new Wt(t)),kt(this,t,e,null))},n.prototype.formatISO=function(){return new tn(new Bt(this.metadata,Mt),kt(this,void 0,function(t){return Yn(t)},null))},n.prototype.dayMonthYear=function(){return new tn(new Bt(this.metadata,Dt),kt(this,void 0,function(t){return En(t)},null))},n.nbFullMonthsSince=function(t){return new Qt(new Bt(t.metadata,jt),kt(t,void 0,function(t){return In(t)},null))},n.nbFullMonthsBetween=function(t,e){return e instanceof n?new Qt(new b(t.metadata,_t,e.metadata),kt(t,e,function(t,n){return In(t,n)},null)):new Qt(new b(t.metadata,_t,new Wt(e)),kt(t,e,In,null))},n.prototype.withDayOfMonth=function(t){return new n(new b(this.metadata,Yt,new Wt(t)),kt(this,t,function(t,n){var e=Nn(t);return e.setDate(n),e},null))},n.prototype.withMonth=function(t){return new n(new b(this.metadata,Et,new Wt(t)),kt(this,t,function(t,n){var e=Nn(t);return e.setMonth(n),e},null))},n.prototype.withYear=function(t){return new n(new b(this.metadata,Ft,new Wt(t)),kt(this,t,function(t,n){var e=Nn(t);return e.setFullYear(n),e},null))},n.prototype.withFirstDayOfNextYear=function(){return new n(new Bt(this.metadata,It),kt(this,void 0,function(t){var n=Nn(t);return n.setMonth(11),n.setDate(32),n},null))},n.prototype.withLastDayOfLastYear=function(){return new n(new Bt(this.metadata,Ct),kt(this,void 0,function(t){var n=Nn(t);return n.setMonth(0),n.setDate(0),n},null))},n.prototype.monthOf=function(){return new Qt(new Bt(this.metadata,Ut),kt(this,void 0,function(t){return t.getMonth()},null))},n.prototype.yearOf=function(){return new Qt(new Bt(this.metadata,At),kt(this,void 0,function(t){return t.getFullYear()},null))},n.prototype.dateOf=function(){return new Qt(new Bt(this.metadata,xt),kt(this,void 0,function(t){return t.getDate()},null))},n.MAX_DATE=new Date(864e13),n.MIN_DATE=new Date(-864e13),n}(Ht),An=function(t,n){this.convert=t,this.metadata=new mn(t.toString(),n)};var xn=Object.freeze({fieldsOf:function t(n){var e=n;return"FIELD"==e.type?[e.path]:n.children?n.children().flatMap(function(n){return t(n)}):[]}});t.AbstractMetadata=v,t.BinaryMetadata=b,t.BooleanFunction=Jt,t.ConditionalMappingMetadata=on,t.DateFunction=Un,t.DateUtils=Cn,t.DefaultContext=en,t.Field=$t,t.FieldMetadata=g,t.Function=Ht,t.FunctionMetadata=y,t.IterableFunction=Zt,t.IterableMetadata=Xt,t.MetadataUtils=xn,t.MultipleMappingsMetadata=cn,t.NaryMetadata=Kt,t.NumberFunction=Qt,t.Paths=m,t.SingleMappingMetadata=ln,t.StringFunction=tn,t.TypeConverterMetadata=mn,t.UnaryMetadata=Bt,t.Utils=u,t.ValidationRuleMetadata=rn,t.ValueMetadata=Wt,t.WhenMetadata=un,t.biConverter=function(t,n){return new vn(t,n)},t.boolean=function(t){return Jt.boolean(t)},t.converter=function(t,n){return new An(t,n)},t.date=function(t){return Un.date(t)},t.dateIso=function(t){return Un.dateIso(t)},t.f=function(t){return Ht.function(t)},t.field=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return $t.field.apply($t,t)},t.iterable=function(t){return Zt.iterable(t)},t.lift=function(t,n){return Ht.lift(t,n)},t.map=function(t,n){return n?new yn(t instanceof Ht?t:new Ht(new Wt(t),function(n){return t}),n instanceof Ht?n:new Ht(new Wt(n),function(t){return n})):new pn(t instanceof Ht?t:new Ht(new Wt(t),function(n){return t}))},t.mapAll=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new Dn(t)},t.mapNull=function(t){return new hn(new Ht(new Wt(null),function(t){return null}),t)},t.mappings=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new(wn.bind.apply(wn,[void 0].concat(t)))},t.matchAll=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new Jt(new Kt(t.map(function(t){return t.metadata}),S),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 Jt(new Kt(t.map(function(t){return t.metadata}),V),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 Jt(new Kt(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.naryConverter=function(t,n){return new bn(t,n)},t.number=function(t){return Qt.number(t)},t.string=function(t){return tn.string(t)},t.when=function(t){return new fn(t)},Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=doov.js.map |
@@ -21,3 +21,3 @@ import { Field } from './dsl/Field'; | ||
export declare function f<T>(accessor: ContextAccessor<object, Context, T>): Function<T>; | ||
export declare function field<T extends object, V>(...path: (string | number)[]): Field<T, Context, V>; | ||
export declare function field<V, T extends object = object>(...path: (string | number)[]): Field<T, Context, V>; | ||
export declare function lift<U, F extends Function<U>>(constructor: FunctionConstructor<U, F>, value: U | null | undefined): F; | ||
@@ -24,0 +24,0 @@ export declare function iterable<T>(field: ContextAccessor<object, Context, T[]>): IterableFunction<T>; |
@@ -13,3 +13,3 @@ import { ContextAccessor } from './ContextAccessor'; | ||
constructor(metadata: FieldMetadata); | ||
static field<T extends object, V>(...path: (string | number)[]): Field<T, Context, V>; | ||
static field<V, T extends object = object>(...path: (string | number)[]): Field<T, Context, V>; | ||
withPosition(value: number): Field<T, C, V>; | ||
@@ -16,0 +16,0 @@ withTags(...value: string[]): Field<T, C, V>; |
@@ -11,4 +11,5 @@ import { BooleanFunction } from './BooleanFunction'; | ||
constructor(condition: BooleanFunction, ...mappings: MappingRule[]); | ||
execute<M extends object>(model: M, ctx?: Context): M; | ||
execute<M extends object>(input: M, ctx?: Context): M; | ||
executeOn<M extends object, O extends object>(input: M, output: O, ctx?: Context): O; | ||
otherwise(...mappings: MappingRule[]): this; | ||
} |
@@ -5,2 +5,3 @@ import { Function } from './Function'; | ||
import { BooleanFunction } from './BooleanFunction'; | ||
import { NumberFunction } from './NumberFunction'; | ||
export declare class IterableFunction<T> extends Function<T[]> { | ||
@@ -14,2 +15,3 @@ static iterable<T>(accessor: ContextAccessor<object, Context, T[]>): IterableFunction<T>; | ||
hasNotSize(value: number | Function<number>): BooleanFunction; | ||
length(): NumberFunction; | ||
} |
import { DslBuilder } from '../DslBuilder'; | ||
import { Context } from '../Context'; | ||
export interface MappingRule extends DslBuilder { | ||
execute<M extends object>(model: M, ctx?: Context): M; | ||
execute<M extends object>(input: M, ctx?: Context): M; | ||
executeOn<M extends object, O extends object>(input: M, output: O, ctx?: Context): O; | ||
} |
@@ -8,3 +8,4 @@ import { MappingRule } from './MappingRule'; | ||
constructor(...mappings: (Mappings | MappingRule)[]); | ||
execute<M extends object>(model: M, ctx?: Context): M; | ||
execute<M extends object>(input: M, ctx?: Context): M; | ||
executeOn<M extends object, O extends object>(input: M, output: O, ctx?: Context): O; | ||
} |
@@ -10,3 +10,4 @@ import { Function } from './Function'; | ||
constructor(input: Function<T>, output: Function<T>); | ||
execute<M extends object>(model: M, ctx?: Context): M; | ||
execute<M extends object>(input: M, ctx?: Context): M; | ||
executeOn<M extends object, O extends object>(input: M, output: O, ctx?: Context): O; | ||
} |
{ | ||
"name": "doov", | ||
"version": "0.9.1", | ||
"version": "0.10.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
372031
1034