@ancon/wildcat-utils 1.46.3 → 1.46.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{_baseIsEqual-12d01a44.mjs → _baseIsEqual-5e6adb07.mjs} +2 -2
- package/_baseIsEqual-ad544573.js +1 -0
- package/_baseIteratee-ae97e42e.js +1 -0
- package/{_baseIteratee-4c4d0995.mjs → _baseIteratee-db1f278d.mjs} +4 -4
- package/_getTag-d4cd1660.js +1 -0
- package/{_getTag-4e44633b.mjs → _getTag-fcc5160b.mjs} +116 -116
- package/check/getOrganizedCheckItemModifications.d.ts +10 -0
- package/check/getOrganizedCheckItemModifications.js +1 -0
- package/check/getOrganizedCheckItemModifications.mjs +194 -0
- package/check/getUniqueCheckItemModificationId.d.ts +8 -0
- package/check/getUniqueCheckItemModificationId.js +1 -0
- package/check/getUniqueCheckItemModificationId.mjs +18 -0
- package/check/index.d.ts +3 -0
- package/check/index.js +1 -0
- package/check/index.mjs +13 -0
- package/check/types.d.ts +13 -0
- package/check/types.js +1 -0
- package/check/types.mjs +1 -0
- package/checkout/getCheckoutOrderStatusTexts.js +1 -1
- package/checkout/getCheckoutOrderStatusTexts.mjs +6 -6
- package/checkout/index.js +1 -1
- package/checkout/index.mjs +6 -6
- package/checkout/isCheckoutItemsAreEqual.js +1 -1
- package/checkout/isCheckoutItemsAreEqual.mjs +3 -3
- package/identity-2a048185.js +1 -0
- package/{identity-6eafe87b.mjs → identity-cf449299.mjs} +3 -3
- package/index.js +1 -1
- package/index.mjs +6 -6
- package/isObjectLike-54341556.mjs +38 -0
- package/isObjectLike-963267e9.js +1 -0
- package/logger/index.js +1 -1
- package/logger/index.mjs +2 -2
- package/logger/pascalCaseFormatter.js +1 -1
- package/logger/pascalCaseFormatter.mjs +2 -2
- package/order/getCheckOrderItemsMappedByTicketItemStatus.js +1 -1
- package/order/getCheckOrderItemsMappedByTicketItemStatus.mjs +6 -6
- package/order/getCheckOrderMinimumStatusTicketItem.js +1 -1
- package/order/getCheckOrderMinimumStatusTicketItem.mjs +6 -6
- package/order/index.js +1 -1
- package/order/index.mjs +6 -6
- package/outlet/getOutletCurrentClosingTimeText.js +1 -1
- package/outlet/getOutletCurrentClosingTimeText.mjs +6 -6
- package/outlet/getOutletTodayOpeningTimes.js +1 -1
- package/outlet/getOutletTodayOpeningTimes.mjs +6 -6
- package/outlet/index.js +1 -1
- package/outlet/index.mjs +6 -6
- package/outlet/serviceDateTimesFromOpeningHours.js +1 -1
- package/outlet/serviceDateTimesFromOpeningHours.mjs +4 -4
- package/package.json +21 -1
- package/toString-b771abdf.js +1 -0
- package/{toString-3b91b335.mjs → toString-ce418705.mjs} +10 -10
- package/_baseIsEqual-bcac9024.js +0 -1
- package/_baseIteratee-075c204c.js +0 -1
- package/_getTag-b8923c48.js +0 -1
- package/identity-1bae7cf8.js +0 -1
- package/isArray-0d9c7aaa.mjs +0 -38
- package/isArray-640f9811.js +0 -1
- package/toString-9eae9442.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as q, e as K, U as M, g as x, a as I, i as $, b as R, c } from "./_getTag-
|
|
2
|
-
import { S as G, a as B, i as C } from "./
|
|
1
|
+
import { M as q, e as K, U as M, g as x, a as I, i as $, b as R, c } from "./_getTag-fcc5160b.mjs";
|
|
2
|
+
import { S as G, a as B, i as C } from "./isObjectLike-54341556.mjs";
|
|
3
3
|
var J = "__lodash_hash_undefined__";
|
|
4
4
|
function Q(n) {
|
|
5
5
|
return this.__data__.set(n, J), this;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("./_getTag-d4cd1660.js"),L=require("./isObjectLike-963267e9.js");var H="__lodash_hash_undefined__";function N(e){return this.__data__.set(e,H),this}function U(e){return this.__data__.has(e)}function P(e){var n=-1,a=e==null?0:e.length;for(this.__data__=new l.MapCache;++n<a;)this.add(e[n])}P.prototype.add=P.prototype.push=N;P.prototype.has=U;function q(e,n){for(var a=-1,f=e==null?0:e.length;++a<f;)if(n(e[a],a,e))return!0;return!1}function C(e,n){return e.has(n)}var F=1,K=2;function G(e,n,a,f,u,r){var s=a&F,g=e.length,t=n.length;if(g!=t&&!(s&&t>g))return!1;var A=r.get(e),T=r.get(n);if(A&&T)return A==n&&T==e;var _=-1,i=!0,p=a&K?new P:void 0;for(r.set(e,n),r.set(n,e);++_<g;){var d=e[_],v=n[_];if(f)var y=s?f(v,d,_,n,e,r):f(d,v,_,e,n,r);if(y!==void 0){if(y)continue;i=!1;break}if(p){if(!q(n,function(O,w){if(!C(p,w)&&(d===O||u(d,O,a,f,r)))return p.push(w)})){i=!1;break}}else if(!(d===v||u(d,v,a,f,r))){i=!1;break}}return r.delete(e),r.delete(n),i}function J(e){var n=-1,a=Array(e.size);return e.forEach(function(f,u){a[++n]=[u,f]}),a}function $(e){var n=-1,a=Array(e.size);return e.forEach(function(f){a[++n]=f}),a}var Q=1,X=2,Y="[object Boolean]",Z="[object Date]",W="[object Error]",h="[object Map]",m="[object Number]",z="[object RegExp]",j="[object Set]",V="[object String]",o="[object Symbol]",k="[object ArrayBuffer]",ee="[object DataView]",c=L.Symbol?L.Symbol.prototype:void 0,D=c?c.valueOf:void 0;function ne(e,n,a,f,u,r,s){switch(a){case ee:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case k:return!(e.byteLength!=n.byteLength||!r(new l.Uint8Array(e),new l.Uint8Array(n)));case Y:case Z:case m:return l.eq(+e,+n);case W:return e.name==n.name&&e.message==n.message;case z:case V:return e==n+"";case h:var g=J;case j:var t=f&Q;if(g||(g=$),e.size!=n.size&&!t)return!1;var A=s.get(e);if(A)return A==n;f|=X,s.set(e,n);var T=G(g(e),g(n),f,u,r,s);return s.delete(e),T;case o:if(D)return D.call(e)==D.call(n)}return!1}var re=1,ae=Object.prototype,fe=ae.hasOwnProperty;function ie(e,n,a,f,u,r){var s=a&re,g=l.getAllKeys(e),t=g.length,A=l.getAllKeys(n),T=A.length;if(t!=T&&!s)return!1;for(var _=t;_--;){var i=g[_];if(!(s?i in n:fe.call(n,i)))return!1}var p=r.get(e),d=r.get(n);if(p&&d)return p==n&&d==e;var v=!0;r.set(e,n),r.set(n,e);for(var y=s;++_<t;){i=g[_];var O=e[i],w=n[i];if(f)var I=s?f(w,O,i,n,e,r):f(O,w,i,e,n,r);if(!(I===void 0?O===w||u(O,w,a,f,r):I)){v=!1;break}y||(y=i=="constructor")}if(v&&!y){var E=e.constructor,S=n.constructor;E!=S&&"constructor"in e&&"constructor"in n&&!(typeof E=="function"&&E instanceof E&&typeof S=="function"&&S instanceof S)&&(v=!1)}return r.delete(e),r.delete(n),v}var se=1,M="[object Arguments]",x="[object Array]",R="[object Object]",ue=Object.prototype,B=ue.hasOwnProperty;function te(e,n,a,f,u,r){var s=L.isArray(e),g=L.isArray(n),t=s?x:l.getTag(e),A=g?x:l.getTag(n);t=t==M?R:t,A=A==M?R:A;var T=t==R,_=A==R,i=t==A;if(i&&l.isBuffer(e)){if(!l.isBuffer(n))return!1;s=!0,T=!1}if(i&&!T)return r||(r=new l.Stack),s||l.isTypedArray(e)?G(e,n,a,f,u,r):ne(e,n,t,a,f,u,r);if(!(a&se)){var p=T&&B.call(e,"__wrapped__"),d=_&&B.call(n,"__wrapped__");if(p||d){var v=p?e.value():e,y=d?n.value():n;return r||(r=new l.Stack),u(v,y,a,f,r)}}return i?(r||(r=new l.Stack),ie(e,n,a,f,u,r)):!1}function b(e,n,a,f,u){return e===n?!0:e==null||n==null||!L.isObjectLike(e)&&!L.isObjectLike(n)?e!==e&&n!==n:te(e,n,a,f,b,u)}exports.SetCache=P;exports.baseIsEqual=b;exports.cacheHas=C;exports.setToArray=$;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("./_getTag-d4cd1660.js"),I=require("./_baseIsEqual-ad544573.js"),u=require("./identity-2a048185.js"),O=require("./isObjectLike-963267e9.js");var R=1,_=2;function o(n,r,e,i){var t=e.length,s=t,l=!i;if(n==null)return!s;for(n=Object(n);t--;){var f=e[t];if(l&&f[2]?f[1]!==n[f[0]]:!(f[0]in n))return!1}for(;++t<s;){f=e[t];var A=f[0],g=n[A],h=f[1];if(l&&f[2]){if(g===void 0&&!(A in n))return!1}else{var d=new a.Stack;if(i)var E=i(g,h,A,n,r,d);if(!(E===void 0?I.baseIsEqual(h,g,R|_,i,d):E))return!1}}return!0}function P(n){return n===n&&!a.isObject(n)}function L(n){for(var r=a.keys(n),e=r.length;e--;){var i=r[e],t=n[i];r[e]=[i,t,P(t)]}return r}function y(n,r){return function(e){return e==null?!1:e[n]===r&&(r!==void 0||n in Object(e))}}function M(n){var r=L(n);return r.length==1&&r[0][2]?y(r[0][0],r[0][1]):function(e){return e===n||o(e,n,r)}}function q(n,r,e){var i=n==null?void 0:u.baseGet(n,r);return i===void 0?e:i}function C(n,r){return n!=null&&r in Object(n)}function G(n,r,e){r=u.castPath(r,n);for(var i=-1,t=r.length,s=!1;++i<t;){var l=u.toKey(r[i]);if(!(s=n!=null&&e(n,l)))break;n=n[l]}return s||++i!=t?s:(t=n==null?0:n.length,!!t&&a.isLength(t)&&a.isIndex(l,t)&&(O.isArray(n)||a.isArguments(n)))}function w(n,r){return n!=null&&G(n,r,C)}var D=1,K=2;function c(n,r){return u.isKey(n)&&P(r)?y(u.toKey(n),r):function(e){var i=q(e,n);return i===void 0&&i===r?w(e,n):I.baseIsEqual(r,i,D|K)}}function F(n){return function(r){return r==null?void 0:r[n]}}function v(n){return function(r){return u.baseGet(r,n)}}function x(n){return u.isKey(n)?F(u.toKey(n)):v(n)}function S(n){return typeof n=="function"?n:n==null?u.identity:typeof n=="object"?O.isArray(n)?c(n[0],n[1]):M(n):x(n)}exports.baseIteratee=S;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { b as I, d as M, k as _, f as p, h as C, j as L } from "./_getTag-
|
|
2
|
-
import { b as o } from "./_baseIsEqual-
|
|
3
|
-
import { b as P, c as w, t as h, a as O, i as y } from "./identity-
|
|
4
|
-
import { a as R } from "./
|
|
1
|
+
import { b as I, d as M, k as _, f as p, h as C, j as L } from "./_getTag-fcc5160b.mjs";
|
|
2
|
+
import { b as o } from "./_baseIsEqual-5e6adb07.mjs";
|
|
3
|
+
import { b as P, c as w, t as h, a as O, i as y } from "./identity-cf449299.mjs";
|
|
4
|
+
import { a as R } from "./isObjectLike-54341556.mjs";
|
|
5
5
|
var D = 1, G = 2;
|
|
6
6
|
function x(n, r, i, e) {
|
|
7
7
|
var t = i.length, u = t, s = !e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("./isObjectLike-963267e9.js");function x(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var ut="[object AsyncFunction]",pt="[object Function]",ft="[object GeneratorFunction]",ht="[object Proxy]";function H(t){if(!x(t))return!1;var e=o.baseGetTag(t);return e==pt||e==ft||e==ut||e==ht}var lt=o.root["__core-js_shared__"];const m=lt;var E=function(){var t=/[^.]+$/.exec(m&&m.keys&&m.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function gt(t){return!!E&&E in t}var yt=Function.prototype,_t=yt.toString;function f(t){if(t!=null){try{return _t.call(t)}catch{}try{return t+""}catch{}}return""}var dt=/[\\^$.*+?()[\]{}|]/g,bt=/^\[object .+?Constructor\]$/,vt=Function.prototype,jt=Object.prototype,Tt=vt.toString,At=jt.hasOwnProperty,$t=RegExp("^"+Tt.call(At).replace(dt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function mt(t){if(!x(t)||gt(t))return!1;var e=H(t)?$t:bt;return e.test(f(t))}function wt(t,e){return t==null?void 0:t[e]}function h(t,e){var r=wt(t,e);return mt(r)?r:void 0}var Ot=h(Object,"create");const b=Ot;function St(){this.__data__=b?b(null):{},this.size=0}function Pt(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Ct="__lodash_hash_undefined__",xt=Object.prototype,It=xt.hasOwnProperty;function Et(t){var e=this.__data__;if(b){var r=e[t];return r===Ct?void 0:r}return It.call(e,t)?e[t]:void 0}var zt=Object.prototype,Mt=zt.hasOwnProperty;function Dt(t){var e=this.__data__;return b?e[t]!==void 0:Mt.call(e,t)}var Gt="__lodash_hash_undefined__";function Ut(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=b&&e===void 0?Gt:e,this}function p(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}p.prototype.clear=St;p.prototype.delete=Pt;p.prototype.get=Et;p.prototype.has=Dt;p.prototype.set=Ut;function Ft(){this.__data__=[],this.size=0}function k(t,e){return t===e||t!==t&&e!==e}function T(t,e){for(var r=t.length;r--;)if(k(t[r][0],e))return r;return-1}var Lt=Array.prototype,Bt=Lt.splice;function Kt(t){var e=this.__data__,r=T(e,t);if(r<0)return!1;var a=e.length-1;return r==a?e.pop():Bt.call(e,r,1),--this.size,!0}function Nt(t){var e=this.__data__,r=T(e,t);return r<0?void 0:e[r][1]}function Ht(t){return T(this.__data__,t)>-1}function kt(t,e){var r=this.__data__,a=T(r,t);return a<0?(++this.size,r.push([t,e])):r[a][1]=e,this}function i(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}i.prototype.clear=Ft;i.prototype.delete=Kt;i.prototype.get=Nt;i.prototype.has=Ht;i.prototype.set=kt;var Rt=h(o.root,"Map");const v=Rt;function Vt(){this.size=0,this.__data__={hash:new p,map:new(v||i),string:new p}}function qt(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function A(t,e){var r=t.__data__;return qt(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Wt(t){var e=A(this,t).delete(t);return this.size-=e?1:0,e}function Jt(t){return A(this,t).get(t)}function Xt(t){return A(this,t).has(t)}function Yt(t,e){var r=A(this,t),a=r.size;return r.set(t,e),this.size+=r.size==a?0:1,this}function l(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}l.prototype.clear=Vt;l.prototype.delete=Wt;l.prototype.get=Jt;l.prototype.has=Xt;l.prototype.set=Yt;function Zt(){this.__data__=new i,this.size=0}function Qt(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function te(t){return this.__data__.get(t)}function ee(t){return this.__data__.has(t)}var re=200;function ae(t,e){var r=this.__data__;if(r instanceof i){var a=r.__data__;if(!v||a.length<re-1)return a.push([t,e]),this.size=++r.size,this;r=this.__data__=new l(a)}return r.set(t,e),this.size=r.size,this}function g(t){var e=this.__data__=new i(t);this.size=e.size}g.prototype.clear=Zt;g.prototype.delete=Qt;g.prototype.get=te;g.prototype.has=ee;g.prototype.set=ae;var ne=o.root.Uint8Array;const oe=ne;function R(t,e){for(var r=-1,a=e.length,c=t.length;++r<a;)t[c+r]=e[r];return t}function V(t,e,r){var a=e(t);return o.isArray(t)?a:R(a,r(t))}function se(t,e){for(var r=-1,a=t==null?0:t.length,c=0,y=[];++r<a;){var _=t[r];e(_,r,t)&&(y[c++]=_)}return y}function q(){return[]}var ie=Object.prototype,ce=ie.propertyIsEnumerable,z=Object.getOwnPropertySymbols,ue=z?function(t){return t==null?[]:(t=Object(t),se(z(t),function(e){return ce.call(t,e)}))}:q;const W=ue;function pe(t,e){for(var r=-1,a=Array(t);++r<t;)a[r]=e(r);return a}var fe="[object Arguments]";function M(t){return o.isObjectLike(t)&&o.baseGetTag(t)==fe}var J=Object.prototype,he=J.hasOwnProperty,le=J.propertyIsEnumerable,ge=M(function(){return arguments}())?M:function(t){return o.isObjectLike(t)&&he.call(t,"callee")&&!le.call(t,"callee")};const X=ge;function ye(){return!1}var Y=typeof exports=="object"&&exports&&!exports.nodeType&&exports,D=Y&&typeof module=="object"&&module&&!module.nodeType&&module,_e=D&&D.exports===Y,G=_e?o.root.Buffer:void 0,de=G?G.isBuffer:void 0,be=de||ye;const Z=be;var ve=9007199254740991,je=/^(?:0|[1-9]\d*)$/;function Q(t,e){var r=typeof t;return e=e??ve,!!e&&(r=="number"||r!="symbol"&&je.test(t))&&t>-1&&t%1==0&&t<e}var Te=9007199254740991;function I(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Te}var Ae="[object Arguments]",$e="[object Array]",me="[object Boolean]",we="[object Date]",Oe="[object Error]",Se="[object Function]",Pe="[object Map]",Ce="[object Number]",xe="[object Object]",Ie="[object RegExp]",Ee="[object Set]",ze="[object String]",Me="[object WeakMap]",De="[object ArrayBuffer]",Ge="[object DataView]",Ue="[object Float32Array]",Fe="[object Float64Array]",Le="[object Int8Array]",Be="[object Int16Array]",Ke="[object Int32Array]",Ne="[object Uint8Array]",He="[object Uint8ClampedArray]",ke="[object Uint16Array]",Re="[object Uint32Array]",n={};n[Ue]=n[Fe]=n[Le]=n[Be]=n[Ke]=n[Ne]=n[He]=n[ke]=n[Re]=!0;n[Ae]=n[$e]=n[De]=n[me]=n[Ge]=n[we]=n[Oe]=n[Se]=n[Pe]=n[Ce]=n[xe]=n[Ie]=n[Ee]=n[ze]=n[Me]=!1;function Ve(t){return o.isObjectLike(t)&&I(t.length)&&!!n[o.baseGetTag(t)]}function tt(t){return function(e){return t(e)}}var et=typeof exports=="object"&&exports&&!exports.nodeType&&exports,d=et&&typeof module=="object"&&module&&!module.nodeType&&module,qe=d&&d.exports===et,w=qe&&o.freeGlobal.process,We=function(){try{var t=d&&d.require&&d.require("util").types;return t||w&&w.binding&&w.binding("util")}catch{}}();const O=We;var U=O&&O.isTypedArray,Je=U?tt(U):Ve;const rt=Je;var Xe=Object.prototype,Ye=Xe.hasOwnProperty;function at(t,e){var r=o.isArray(t),a=!r&&X(t),c=!r&&!a&&Z(t),y=!r&&!a&&!c&&rt(t),_=r||a||c||y,$=_?pe(t.length,String):[],ct=$.length;for(var s in t)(e||Ye.call(t,s))&&!(_&&(s=="length"||c&&(s=="offset"||s=="parent")||y&&(s=="buffer"||s=="byteLength"||s=="byteOffset")||Q(s,ct)))&&$.push(s);return $}var Ze=Object.prototype;function nt(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Ze;return t===r}function ot(t,e){return function(r){return t(e(r))}}var Qe=ot(Object.keys,Object);const tr=Qe;var er=Object.prototype,rr=er.hasOwnProperty;function ar(t){if(!nt(t))return tr(t);var e=[];for(var r in Object(t))rr.call(t,r)&&r!="constructor"&&e.push(r);return e}function st(t){return t!=null&&I(t.length)&&!H(t)}function it(t){return st(t)?at(t):ar(t)}function nr(t){return V(t,it,W)}var or=h(o.root,"DataView");const S=or;var sr=h(o.root,"Promise");const P=sr;var ir=h(o.root,"Set");const j=ir;var cr=h(o.root,"WeakMap");const C=cr;var F="[object Map]",ur="[object Object]",L="[object Promise]",B="[object Set]",K="[object WeakMap]",N="[object DataView]",pr=f(S),fr=f(v),hr=f(P),lr=f(j),gr=f(C),u=o.baseGetTag;(S&&u(new S(new ArrayBuffer(1)))!=N||v&&u(new v)!=F||P&&u(P.resolve())!=L||j&&u(new j)!=B||C&&u(new C)!=K)&&(u=function(t){var e=o.baseGetTag(t),r=e==ur?t.constructor:void 0,a=r?f(r):"";if(a)switch(a){case pr:return N;case fr:return F;case hr:return L;case lr:return B;case gr:return K}return e});const yr=u;exports.MapCache=l;exports.Set=j;exports.Stack=g;exports.Uint8Array=oe;exports.arrayLikeKeys=at;exports.arrayPush=R;exports.baseGetAllKeys=V;exports.baseUnary=tt;exports.eq=k;exports.getAllKeys=nr;exports.getNative=h;exports.getSymbols=W;exports.getTag=yr;exports.isArguments=X;exports.isArrayLike=st;exports.isBuffer=Z;exports.isIndex=Q;exports.isLength=I;exports.isObject=x;exports.isPrototype=nt;exports.isTypedArray=rt;exports.keys=it;exports.nodeUtil=O;exports.overArg=ot;exports.stubArray=q;
|
|
@@ -1,85 +1,29 @@
|
|
|
1
|
-
import { b as v, r as i, a as V, i as C, f as Y } from "./
|
|
2
|
-
function Z() {
|
|
3
|
-
this.__data__ = [], this.size = 0;
|
|
4
|
-
}
|
|
5
|
-
function Q(t, e) {
|
|
6
|
-
return t === e || t !== t && e !== e;
|
|
7
|
-
}
|
|
8
|
-
function m(t, e) {
|
|
9
|
-
for (var r = t.length; r--; )
|
|
10
|
-
if (Q(t[r][0], e))
|
|
11
|
-
return r;
|
|
12
|
-
return -1;
|
|
13
|
-
}
|
|
14
|
-
var tt = Array.prototype, et = tt.splice;
|
|
15
|
-
function rt(t) {
|
|
16
|
-
var e = this.__data__, r = m(e, t);
|
|
17
|
-
if (r < 0)
|
|
18
|
-
return !1;
|
|
19
|
-
var a = e.length - 1;
|
|
20
|
-
return r == a ? e.pop() : et.call(e, r, 1), --this.size, !0;
|
|
21
|
-
}
|
|
22
|
-
function at(t) {
|
|
23
|
-
var e = this.__data__, r = m(e, t);
|
|
24
|
-
return r < 0 ? void 0 : e[r][1];
|
|
25
|
-
}
|
|
26
|
-
function nt(t) {
|
|
27
|
-
return m(this.__data__, t) > -1;
|
|
28
|
-
}
|
|
29
|
-
function ot(t, e) {
|
|
30
|
-
var r = this.__data__, a = m(r, t);
|
|
31
|
-
return a < 0 ? (++this.size, r.push([t, e])) : r[a][1] = e, this;
|
|
32
|
-
}
|
|
33
|
-
function s(t) {
|
|
34
|
-
var e = -1, r = t == null ? 0 : t.length;
|
|
35
|
-
for (this.clear(); ++e < r; ) {
|
|
36
|
-
var a = t[e];
|
|
37
|
-
this.set(a[0], a[1]);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
s.prototype.clear = Z;
|
|
41
|
-
s.prototype.delete = rt;
|
|
42
|
-
s.prototype.get = at;
|
|
43
|
-
s.prototype.has = nt;
|
|
44
|
-
s.prototype.set = ot;
|
|
45
|
-
function st() {
|
|
46
|
-
this.__data__ = new s(), this.size = 0;
|
|
47
|
-
}
|
|
48
|
-
function it(t) {
|
|
49
|
-
var e = this.__data__, r = e.delete(t);
|
|
50
|
-
return this.size = e.size, r;
|
|
51
|
-
}
|
|
52
|
-
function ct(t) {
|
|
53
|
-
return this.__data__.get(t);
|
|
54
|
-
}
|
|
55
|
-
function ut(t) {
|
|
56
|
-
return this.__data__.has(t);
|
|
57
|
-
}
|
|
1
|
+
import { b as v, r as i, a as V, i as C, f as Y } from "./isObjectLike-54341556.mjs";
|
|
58
2
|
function K(t) {
|
|
59
3
|
var e = typeof t;
|
|
60
4
|
return t != null && (e == "object" || e == "function");
|
|
61
5
|
}
|
|
62
|
-
var
|
|
6
|
+
var Z = "[object AsyncFunction]", Q = "[object Function]", tt = "[object GeneratorFunction]", et = "[object Proxy]";
|
|
63
7
|
function L(t) {
|
|
64
8
|
if (!K(t))
|
|
65
9
|
return !1;
|
|
66
10
|
var e = v(t);
|
|
67
|
-
return e ==
|
|
11
|
+
return e == Q || e == tt || e == Z || e == et;
|
|
68
12
|
}
|
|
69
|
-
var
|
|
70
|
-
const A =
|
|
13
|
+
var rt = i["__core-js_shared__"];
|
|
14
|
+
const A = rt;
|
|
71
15
|
var I = function() {
|
|
72
16
|
var t = /[^.]+$/.exec(A && A.keys && A.keys.IE_PROTO || "");
|
|
73
17
|
return t ? "Symbol(src)_1." + t : "";
|
|
74
18
|
}();
|
|
75
|
-
function
|
|
19
|
+
function at(t) {
|
|
76
20
|
return !!I && I in t;
|
|
77
21
|
}
|
|
78
|
-
var
|
|
22
|
+
var nt = Function.prototype, ot = nt.toString;
|
|
79
23
|
function f(t) {
|
|
80
24
|
if (t != null) {
|
|
81
25
|
try {
|
|
82
|
-
return
|
|
26
|
+
return ot.call(t);
|
|
83
27
|
} catch {
|
|
84
28
|
}
|
|
85
29
|
try {
|
|
@@ -89,51 +33,49 @@ function f(t) {
|
|
|
89
33
|
}
|
|
90
34
|
return "";
|
|
91
35
|
}
|
|
92
|
-
var
|
|
93
|
-
"^" +
|
|
36
|
+
var st = /[\\^$.*+?()[\]{}|]/g, it = /^\[object .+?Constructor\]$/, ct = Function.prototype, ut = Object.prototype, pt = ct.toString, ft = ut.hasOwnProperty, ht = RegExp(
|
|
37
|
+
"^" + pt.call(ft).replace(st, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
94
38
|
);
|
|
95
|
-
function
|
|
96
|
-
if (!K(t) ||
|
|
39
|
+
function lt(t) {
|
|
40
|
+
if (!K(t) || at(t))
|
|
97
41
|
return !1;
|
|
98
|
-
var e = L(t) ?
|
|
42
|
+
var e = L(t) ? ht : it;
|
|
99
43
|
return e.test(f(t));
|
|
100
44
|
}
|
|
101
|
-
function
|
|
45
|
+
function dt(t, e) {
|
|
102
46
|
return t == null ? void 0 : t[e];
|
|
103
47
|
}
|
|
104
48
|
function h(t, e) {
|
|
105
|
-
var r =
|
|
106
|
-
return
|
|
49
|
+
var r = dt(t, e);
|
|
50
|
+
return lt(r) ? r : void 0;
|
|
107
51
|
}
|
|
108
|
-
var
|
|
109
|
-
const y =
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
function Pt() {
|
|
113
|
-
this.__data__ = b ? b(null) : {}, this.size = 0;
|
|
52
|
+
var gt = h(Object, "create");
|
|
53
|
+
const y = gt;
|
|
54
|
+
function _t() {
|
|
55
|
+
this.__data__ = y ? y(null) : {}, this.size = 0;
|
|
114
56
|
}
|
|
115
|
-
function
|
|
57
|
+
function yt(t) {
|
|
116
58
|
var e = this.has(t) && delete this.__data__[t];
|
|
117
59
|
return this.size -= e ? 1 : 0, e;
|
|
118
60
|
}
|
|
119
|
-
var
|
|
120
|
-
function
|
|
61
|
+
var bt = "__lodash_hash_undefined__", vt = Object.prototype, jt = vt.hasOwnProperty;
|
|
62
|
+
function mt(t) {
|
|
121
63
|
var e = this.__data__;
|
|
122
|
-
if (
|
|
64
|
+
if (y) {
|
|
123
65
|
var r = e[t];
|
|
124
|
-
return r ===
|
|
66
|
+
return r === bt ? void 0 : r;
|
|
125
67
|
}
|
|
126
|
-
return
|
|
68
|
+
return jt.call(e, t) ? e[t] : void 0;
|
|
127
69
|
}
|
|
128
|
-
var
|
|
129
|
-
function
|
|
70
|
+
var Tt = Object.prototype, $t = Tt.hasOwnProperty;
|
|
71
|
+
function At(t) {
|
|
130
72
|
var e = this.__data__;
|
|
131
|
-
return
|
|
73
|
+
return y ? e[t] !== void 0 : $t.call(e, t);
|
|
132
74
|
}
|
|
133
|
-
var
|
|
134
|
-
function
|
|
75
|
+
var wt = "__lodash_hash_undefined__";
|
|
76
|
+
function xt(t, e) {
|
|
135
77
|
var r = this.__data__;
|
|
136
|
-
return this.size += this.has(t) ? 0 : 1, r[t] =
|
|
78
|
+
return this.size += this.has(t) ? 0 : 1, r[t] = y && e === void 0 ? wt : e, this;
|
|
137
79
|
}
|
|
138
80
|
function p(t) {
|
|
139
81
|
var e = -1, r = t == null ? 0 : t.length;
|
|
@@ -142,37 +84,82 @@ function p(t) {
|
|
|
142
84
|
this.set(a[0], a[1]);
|
|
143
85
|
}
|
|
144
86
|
}
|
|
145
|
-
p.prototype.clear =
|
|
146
|
-
p.prototype.delete =
|
|
147
|
-
p.prototype.get =
|
|
148
|
-
p.prototype.has =
|
|
149
|
-
p.prototype.set =
|
|
150
|
-
function
|
|
87
|
+
p.prototype.clear = _t;
|
|
88
|
+
p.prototype.delete = yt;
|
|
89
|
+
p.prototype.get = mt;
|
|
90
|
+
p.prototype.has = At;
|
|
91
|
+
p.prototype.set = xt;
|
|
92
|
+
function Ot() {
|
|
93
|
+
this.__data__ = [], this.size = 0;
|
|
94
|
+
}
|
|
95
|
+
function St(t, e) {
|
|
96
|
+
return t === e || t !== t && e !== e;
|
|
97
|
+
}
|
|
98
|
+
function m(t, e) {
|
|
99
|
+
for (var r = t.length; r--; )
|
|
100
|
+
if (St(t[r][0], e))
|
|
101
|
+
return r;
|
|
102
|
+
return -1;
|
|
103
|
+
}
|
|
104
|
+
var Pt = Array.prototype, Ct = Pt.splice;
|
|
105
|
+
function It(t) {
|
|
106
|
+
var e = this.__data__, r = m(e, t);
|
|
107
|
+
if (r < 0)
|
|
108
|
+
return !1;
|
|
109
|
+
var a = e.length - 1;
|
|
110
|
+
return r == a ? e.pop() : Ct.call(e, r, 1), --this.size, !0;
|
|
111
|
+
}
|
|
112
|
+
function Et(t) {
|
|
113
|
+
var e = this.__data__, r = m(e, t);
|
|
114
|
+
return r < 0 ? void 0 : e[r][1];
|
|
115
|
+
}
|
|
116
|
+
function zt(t) {
|
|
117
|
+
return m(this.__data__, t) > -1;
|
|
118
|
+
}
|
|
119
|
+
function Mt(t, e) {
|
|
120
|
+
var r = this.__data__, a = m(r, t);
|
|
121
|
+
return a < 0 ? (++this.size, r.push([t, e])) : r[a][1] = e, this;
|
|
122
|
+
}
|
|
123
|
+
function s(t) {
|
|
124
|
+
var e = -1, r = t == null ? 0 : t.length;
|
|
125
|
+
for (this.clear(); ++e < r; ) {
|
|
126
|
+
var a = t[e];
|
|
127
|
+
this.set(a[0], a[1]);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
s.prototype.clear = Ot;
|
|
131
|
+
s.prototype.delete = It;
|
|
132
|
+
s.prototype.get = Et;
|
|
133
|
+
s.prototype.has = zt;
|
|
134
|
+
s.prototype.set = Mt;
|
|
135
|
+
var Dt = h(i, "Map");
|
|
136
|
+
const b = Dt;
|
|
137
|
+
function Ft() {
|
|
151
138
|
this.size = 0, this.__data__ = {
|
|
152
139
|
hash: new p(),
|
|
153
|
-
map: new (
|
|
140
|
+
map: new (b || s)(),
|
|
154
141
|
string: new p()
|
|
155
142
|
};
|
|
156
143
|
}
|
|
157
|
-
function
|
|
144
|
+
function Ut(t) {
|
|
158
145
|
var e = typeof t;
|
|
159
146
|
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
|
|
160
147
|
}
|
|
161
148
|
function T(t, e) {
|
|
162
149
|
var r = t.__data__;
|
|
163
|
-
return
|
|
150
|
+
return Ut(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
|
|
164
151
|
}
|
|
165
|
-
function
|
|
152
|
+
function Gt(t) {
|
|
166
153
|
var e = T(this, t).delete(t);
|
|
167
154
|
return this.size -= e ? 1 : 0, e;
|
|
168
155
|
}
|
|
169
|
-
function
|
|
156
|
+
function Bt(t) {
|
|
170
157
|
return T(this, t).get(t);
|
|
171
158
|
}
|
|
172
|
-
function
|
|
159
|
+
function Ht(t) {
|
|
173
160
|
return T(this, t).has(t);
|
|
174
161
|
}
|
|
175
|
-
function
|
|
162
|
+
function Nt(t, e) {
|
|
176
163
|
var r = T(this, t), a = r.size;
|
|
177
164
|
return r.set(t, e), this.size += r.size == a ? 0 : 1, this;
|
|
178
165
|
}
|
|
@@ -183,17 +170,30 @@ function l(t) {
|
|
|
183
170
|
this.set(a[0], a[1]);
|
|
184
171
|
}
|
|
185
172
|
}
|
|
186
|
-
l.prototype.clear =
|
|
187
|
-
l.prototype.delete =
|
|
188
|
-
l.prototype.get =
|
|
189
|
-
l.prototype.has =
|
|
190
|
-
l.prototype.set =
|
|
173
|
+
l.prototype.clear = Ft;
|
|
174
|
+
l.prototype.delete = Gt;
|
|
175
|
+
l.prototype.get = Bt;
|
|
176
|
+
l.prototype.has = Ht;
|
|
177
|
+
l.prototype.set = Nt;
|
|
178
|
+
function Rt() {
|
|
179
|
+
this.__data__ = new s(), this.size = 0;
|
|
180
|
+
}
|
|
181
|
+
function Vt(t) {
|
|
182
|
+
var e = this.__data__, r = e.delete(t);
|
|
183
|
+
return this.size = e.size, r;
|
|
184
|
+
}
|
|
185
|
+
function Kt(t) {
|
|
186
|
+
return this.__data__.get(t);
|
|
187
|
+
}
|
|
188
|
+
function Lt(t) {
|
|
189
|
+
return this.__data__.has(t);
|
|
190
|
+
}
|
|
191
191
|
var Wt = 200;
|
|
192
192
|
function qt(t, e) {
|
|
193
193
|
var r = this.__data__;
|
|
194
194
|
if (r instanceof s) {
|
|
195
195
|
var a = r.__data__;
|
|
196
|
-
if (!
|
|
196
|
+
if (!b || a.length < Wt - 1)
|
|
197
197
|
return a.push([t, e]), this.size = ++r.size, this;
|
|
198
198
|
r = this.__data__ = new l(a);
|
|
199
199
|
}
|
|
@@ -203,10 +203,10 @@ function j(t) {
|
|
|
203
203
|
var e = this.__data__ = new s(t);
|
|
204
204
|
this.size = e.size;
|
|
205
205
|
}
|
|
206
|
-
j.prototype.clear =
|
|
207
|
-
j.prototype.delete =
|
|
208
|
-
j.prototype.get =
|
|
209
|
-
j.prototype.has =
|
|
206
|
+
j.prototype.clear = Rt;
|
|
207
|
+
j.prototype.delete = Vt;
|
|
208
|
+
j.prototype.get = Kt;
|
|
209
|
+
j.prototype.has = Lt;
|
|
210
210
|
j.prototype.set = qt;
|
|
211
211
|
var kt = i.Uint8Array;
|
|
212
212
|
const br = kt;
|
|
@@ -334,8 +334,8 @@ var ur = h(i, "Set");
|
|
|
334
334
|
const S = ur;
|
|
335
335
|
var pr = h(i, "WeakMap");
|
|
336
336
|
const P = pr;
|
|
337
|
-
var G = "[object Map]", fr = "[object Object]", B = "[object Promise]", H = "[object Set]", N = "[object WeakMap]", R = "[object DataView]", hr = f(x), lr = f(
|
|
338
|
-
(x && u(new x(new ArrayBuffer(1))) != R ||
|
|
337
|
+
var G = "[object Map]", fr = "[object Object]", B = "[object Promise]", H = "[object Set]", N = "[object WeakMap]", R = "[object DataView]", hr = f(x), lr = f(b), dr = f(O), gr = f(S), _r = f(P), u = v;
|
|
338
|
+
(x && u(new x(new ArrayBuffer(1))) != R || b && u(new b()) != G || O && u(O.resolve()) != B || S && u(new S()) != H || P && u(new P()) != N) && (u = function(t) {
|
|
339
339
|
var e = v(t), r = e == fr ? t.constructor : void 0, a = r ? f(r) : "";
|
|
340
340
|
if (a)
|
|
341
341
|
switch (a) {
|
|
@@ -361,7 +361,7 @@ export {
|
|
|
361
361
|
j as b,
|
|
362
362
|
qe as c,
|
|
363
363
|
K as d,
|
|
364
|
-
|
|
364
|
+
St as e,
|
|
365
365
|
k as f,
|
|
366
366
|
vr as g,
|
|
367
367
|
_e as h,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CheckItem } from '@ancon/wildcat-types';
|
|
2
|
+
import { OrganizedCheckItemModification } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Organizes all check item modifications including addon products into a array for easier visual representation.
|
|
5
|
+
* @param currency - The currency for the modifications.
|
|
6
|
+
* @param modifications - The list of check item modifications.
|
|
7
|
+
* @param addOnProducts - The list of check item add-on products.
|
|
8
|
+
* @returns An array where the modifications are sorted by their modification kind and positions.
|
|
9
|
+
*/
|
|
10
|
+
export default function getOrganizedCheckItemModifications(currency: string, modifications: CheckItem['modifications'], addOnProducts: CheckItem['addOnProducts']): OrganizedCheckItemModification[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const h=require("@ancon/wildcat-types"),M=require("../toString-b771abdf.js"),P=require("../identity-2a048185.js"),x=require("../_baseIteratee-ae97e42e.js"),k=require("../_getTag-d4cd1660.js"),$=require("../isObjectLike-963267e9.js"),O=require("./getUniqueCheckItemModificationId.js");require("../_baseIsEqual-ad544573.js");function L(n){return function(i,t,e){for(var d=-1,r=Object(i),o=e(i),c=o.length;c--;){var a=o[n?c:++d];if(t(r[a],a,r)===!1)break}return i}}var E=L();const _=E;function G(n,i){return n&&_(n,i,k.keys)}function Q(n,i){return function(t,e){if(t==null)return t;if(!k.isArrayLike(t))return n(t,e);for(var d=t.length,r=i?d:-1,o=Object(t);(i?r--:++r<d)&&e(o[r],r,o)!==!1;);return t}}var U=Q(G);const Z=U;function z(n,i){var t=-1,e=k.isArrayLike(n)?Array(n.length):[];return Z(n,function(d,r,o){e[++t]=i(d,r,o)}),e}function V(n,i){var t=n.length;for(n.sort(i);t--;)n[t]=n[t].value;return n}function j(n,i){if(n!==i){var t=n!==void 0,e=n===null,d=n===n,r=M.isSymbol(n),o=i!==void 0,c=i===null,a=i===i,u=M.isSymbol(i);if(!c&&!u&&!r&&n>i||r&&o&&a&&!c&&!u||e&&o&&a||!t&&a||!d)return 1;if(!e&&!r&&!u&&n<i||u&&t&&d&&!e&&!r||c&&t&&d||!o&&d||!a)return-1}return 0}function H(n,i,t){for(var e=-1,d=n.criteria,r=i.criteria,o=d.length,c=t.length;++e<o;){var a=j(d[e],r[e]);if(a){if(e>=c)return a;var u=t[e];return a*(u=="desc"?-1:1)}}return n.index-i.index}function J(n,i,t){i.length?i=M.arrayMap(i,function(r){return $.isArray(r)?function(o){return P.baseGet(o,r.length===1?r[0]:r)}:r}):i=[P.identity];var e=-1;i=M.arrayMap(i,k.baseUnary(x.baseIteratee));var d=z(n,function(r,o,c){var a=M.arrayMap(i,function(u){return u(r)});return{criteria:a,index:++e,value:r}});return V(d,function(r,o){return H(r,o,t)})}function C(n,i,t,e){return n==null?[]:($.isArray(i)||(i=i==null?[]:[i]),t=e?void 0:t,$.isArray(t)||(t=t==null?[]:[t]),J(n,i,t))}function K(n,i,t){const{add:e,replace:d,remove:r}=i.reduce((a,u)=>{const{modification:A,position:s,freeAmount:f,name:y,quantity:p,cost:g,replacementName:T}=u,m=g===0;if(u.modification===h.ModificationType.Add){(f>0||m)&&a.add.push({id:O(u,"-free"),modificationType:A,name:y,freeAmount:m?p:f,quantity:m?p:f,currency:n,position:s,cost:0});const q=p-f;q>0&&!m&&a.add.push({id:O(u),modificationType:A,name:y,quantity:q,freeAmount:0,currency:n,position:s,cost:g*q})}return u.modification===h.ModificationType.Replace&&a.replace.push({id:O(u),modificationType:A,name:y,replacementName:T,freeAmount:f,quantity:p,currency:n,position:s,cost:g}),u.modification===h.ModificationType.Remove&&a.remove.push({id:O(u),modificationType:A,name:y,freeAmount:f,quantity:p,currency:n,position:s,cost:g}),a},{add:[],replace:[],remove:[]}),o=(t||[]).reduce((a,u)=>{const{product:A,addOnFreeAmount:s,quantity:f,addOnPosition:y,addOnGroupId:p,productPriceInclTax:g}=u,{hasVariants:T,variantName:m,productName:q,productId:B,variantId:F}=A,b=g.unitPrice.amount===0;(s>0||b)&&a.push({id:`${p}-${B}-free`,modificationType:h.ModificationType.Add,name:T?m:q,freeAmount:b?f:s,quantity:b?f:s,currency:n,position:y,cost:0,variantId:F});const w=f-s;return w>0&&!b&&a.push({id:`${p}-${B}`,modificationType:h.ModificationType.Add,name:T?m:q,freeAmount:0,quantity:w,currency:n,position:y,cost:g.unitPrice.amount*w,variantId:F}),a},[]);return[...C([...e,...o],["position"],["asc"]),...C(d,["position"],["asc"]),...C(r,["position"],["asc"])]}module.exports=K;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { ModificationType as y } from "@ancon/wildcat-types";
|
|
2
|
+
import { i as F, a as q } from "../toString-ce418705.mjs";
|
|
3
|
+
import { i as x, b as E } from "../identity-cf449299.mjs";
|
|
4
|
+
import { b as G } from "../_baseIteratee-db1f278d.mjs";
|
|
5
|
+
import { k as L, n as P, v as Q } from "../_getTag-fcc5160b.mjs";
|
|
6
|
+
import { a as $ } from "../isObjectLike-54341556.mjs";
|
|
7
|
+
import T from "./getUniqueCheckItemModificationId.mjs";
|
|
8
|
+
import "../_baseIsEqual-5e6adb07.mjs";
|
|
9
|
+
function U(n) {
|
|
10
|
+
return function(i, t, a) {
|
|
11
|
+
for (var e = -1, r = Object(i), u = a(i), f = u.length; f--; ) {
|
|
12
|
+
var o = u[n ? f : ++e];
|
|
13
|
+
if (t(r[o], o, r) === !1)
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
return i;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
var Z = U();
|
|
20
|
+
const z = Z;
|
|
21
|
+
function V(n, i) {
|
|
22
|
+
return n && z(n, i, L);
|
|
23
|
+
}
|
|
24
|
+
function v(n, i) {
|
|
25
|
+
return function(t, a) {
|
|
26
|
+
if (t == null)
|
|
27
|
+
return t;
|
|
28
|
+
if (!P(t))
|
|
29
|
+
return n(t, a);
|
|
30
|
+
for (var e = t.length, r = i ? e : -1, u = Object(t); (i ? r-- : ++r < e) && a(u[r], r, u) !== !1; )
|
|
31
|
+
;
|
|
32
|
+
return t;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
var H = v(V);
|
|
36
|
+
const J = H;
|
|
37
|
+
function K(n, i) {
|
|
38
|
+
var t = -1, a = P(n) ? Array(n.length) : [];
|
|
39
|
+
return J(n, function(e, r, u) {
|
|
40
|
+
a[++t] = i(e, r, u);
|
|
41
|
+
}), a;
|
|
42
|
+
}
|
|
43
|
+
function W(n, i) {
|
|
44
|
+
var t = n.length;
|
|
45
|
+
for (n.sort(i); t--; )
|
|
46
|
+
n[t] = n[t].value;
|
|
47
|
+
return n;
|
|
48
|
+
}
|
|
49
|
+
function X(n, i) {
|
|
50
|
+
if (n !== i) {
|
|
51
|
+
var t = n !== void 0, a = n === null, e = n === n, r = F(n), u = i !== void 0, f = i === null, o = i === i, d = F(i);
|
|
52
|
+
if (!f && !d && !r && n > i || r && u && o && !f && !d || a && u && o || !t && o || !e)
|
|
53
|
+
return 1;
|
|
54
|
+
if (!a && !r && !d && n < i || d && t && e && !a && !r || f && t && e || !u && e || !o)
|
|
55
|
+
return -1;
|
|
56
|
+
}
|
|
57
|
+
return 0;
|
|
58
|
+
}
|
|
59
|
+
function Y(n, i, t) {
|
|
60
|
+
for (var a = -1, e = n.criteria, r = i.criteria, u = e.length, f = t.length; ++a < u; ) {
|
|
61
|
+
var o = X(e[a], r[a]);
|
|
62
|
+
if (o) {
|
|
63
|
+
if (a >= f)
|
|
64
|
+
return o;
|
|
65
|
+
var d = t[a];
|
|
66
|
+
return o * (d == "desc" ? -1 : 1);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return n.index - i.index;
|
|
70
|
+
}
|
|
71
|
+
function _(n, i, t) {
|
|
72
|
+
i.length ? i = q(i, function(r) {
|
|
73
|
+
return $(r) ? function(u) {
|
|
74
|
+
return E(u, r.length === 1 ? r[0] : r);
|
|
75
|
+
} : r;
|
|
76
|
+
}) : i = [x];
|
|
77
|
+
var a = -1;
|
|
78
|
+
i = q(i, Q(G));
|
|
79
|
+
var e = K(n, function(r, u, f) {
|
|
80
|
+
var o = q(i, function(d) {
|
|
81
|
+
return d(r);
|
|
82
|
+
});
|
|
83
|
+
return { criteria: o, index: ++a, value: r };
|
|
84
|
+
});
|
|
85
|
+
return W(e, function(r, u) {
|
|
86
|
+
return Y(r, u, t);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function C(n, i, t, a) {
|
|
90
|
+
return n == null ? [] : ($(i) || (i = i == null ? [] : [i]), t = a ? void 0 : t, $(t) || (t = t == null ? [] : [t]), _(n, i, t));
|
|
91
|
+
}
|
|
92
|
+
function tn(n, i, t) {
|
|
93
|
+
const { add: a, replace: e, remove: r } = i.reduce(
|
|
94
|
+
(o, d) => {
|
|
95
|
+
const {
|
|
96
|
+
modification: h,
|
|
97
|
+
position: p,
|
|
98
|
+
freeAmount: c,
|
|
99
|
+
name: m,
|
|
100
|
+
quantity: s,
|
|
101
|
+
cost: g,
|
|
102
|
+
replacementName: O
|
|
103
|
+
} = d, A = g === 0;
|
|
104
|
+
if (d.modification === y.Add) {
|
|
105
|
+
(c > 0 || A) && o.add.push({
|
|
106
|
+
id: T(d, "-free"),
|
|
107
|
+
modificationType: h,
|
|
108
|
+
name: m,
|
|
109
|
+
freeAmount: A ? s : c,
|
|
110
|
+
quantity: A ? s : c,
|
|
111
|
+
currency: n,
|
|
112
|
+
position: p,
|
|
113
|
+
cost: 0
|
|
114
|
+
});
|
|
115
|
+
const b = s - c;
|
|
116
|
+
b > 0 && !A && o.add.push({
|
|
117
|
+
id: T(d),
|
|
118
|
+
modificationType: h,
|
|
119
|
+
name: m,
|
|
120
|
+
quantity: b,
|
|
121
|
+
freeAmount: 0,
|
|
122
|
+
currency: n,
|
|
123
|
+
position: p,
|
|
124
|
+
cost: g * b
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
return d.modification === y.Replace && o.replace.push({
|
|
128
|
+
id: T(d),
|
|
129
|
+
modificationType: h,
|
|
130
|
+
name: m,
|
|
131
|
+
replacementName: O,
|
|
132
|
+
freeAmount: c,
|
|
133
|
+
quantity: s,
|
|
134
|
+
currency: n,
|
|
135
|
+
position: p,
|
|
136
|
+
cost: g
|
|
137
|
+
}), d.modification === y.Remove && o.remove.push({
|
|
138
|
+
id: T(d),
|
|
139
|
+
modificationType: h,
|
|
140
|
+
name: m,
|
|
141
|
+
freeAmount: c,
|
|
142
|
+
quantity: s,
|
|
143
|
+
currency: n,
|
|
144
|
+
position: p,
|
|
145
|
+
cost: g
|
|
146
|
+
}), o;
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
add: [],
|
|
150
|
+
replace: [],
|
|
151
|
+
remove: []
|
|
152
|
+
}
|
|
153
|
+
), u = (t || []).reduce((o, d) => {
|
|
154
|
+
const {
|
|
155
|
+
product: h,
|
|
156
|
+
addOnFreeAmount: p,
|
|
157
|
+
quantity: c,
|
|
158
|
+
addOnPosition: m,
|
|
159
|
+
addOnGroupId: s,
|
|
160
|
+
productPriceInclTax: g
|
|
161
|
+
} = d, { hasVariants: O, variantName: A, productName: b, productId: w, variantId: B } = h, M = g.unitPrice.amount === 0;
|
|
162
|
+
(p > 0 || M) && o.push({
|
|
163
|
+
id: `${s}-${w}-free`,
|
|
164
|
+
modificationType: y.Add,
|
|
165
|
+
name: O ? A : b,
|
|
166
|
+
freeAmount: M ? c : p,
|
|
167
|
+
quantity: M ? c : p,
|
|
168
|
+
currency: n,
|
|
169
|
+
position: m,
|
|
170
|
+
cost: 0,
|
|
171
|
+
variantId: B
|
|
172
|
+
});
|
|
173
|
+
const k = c - p;
|
|
174
|
+
return k > 0 && !M && o.push({
|
|
175
|
+
id: `${s}-${w}`,
|
|
176
|
+
modificationType: y.Add,
|
|
177
|
+
name: O ? A : b,
|
|
178
|
+
freeAmount: 0,
|
|
179
|
+
quantity: k,
|
|
180
|
+
currency: n,
|
|
181
|
+
position: m,
|
|
182
|
+
cost: g.unitPrice.amount * k,
|
|
183
|
+
variantId: B
|
|
184
|
+
}), o;
|
|
185
|
+
}, []);
|
|
186
|
+
return [
|
|
187
|
+
...C([...a, ...u], ["position"], ["asc"]),
|
|
188
|
+
...C(e, ["position"], ["asc"]),
|
|
189
|
+
...C(r, ["position"], ["asc"])
|
|
190
|
+
];
|
|
191
|
+
}
|
|
192
|
+
export {
|
|
193
|
+
tn as default
|
|
194
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CheckItemModification } from '@ancon/wildcat-types';
|
|
2
|
+
/**
|
|
3
|
+
* Generate a unique ID for a Check Item Modification
|
|
4
|
+
* @param modification - Check Item Modification
|
|
5
|
+
* @param suffix - Optional suffix to append to the ID
|
|
6
|
+
* @returns Unique ID string
|
|
7
|
+
*/
|
|
8
|
+
export default function getUniqueCheckItemModificationId(modification: CheckItemModification, suffix?: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function u(i,e){const{modification:n,ingredientId:o,replaceId:$,addOnGroupId:c,quantity:d,cost:a,freeAmount:r,name:t,replacementName:m,position:p}=i;return`modification-${n}-${o}-${$??0}-${c}-${d}-${a}-${r}-${t}-${m??t}-${p}${e?`-${e}`:""}`}module.exports=u;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function u(n, e) {
|
|
2
|
+
const {
|
|
3
|
+
modification: i,
|
|
4
|
+
ingredientId: o,
|
|
5
|
+
replaceId: $,
|
|
6
|
+
addOnGroupId: a,
|
|
7
|
+
quantity: d,
|
|
8
|
+
cost: c,
|
|
9
|
+
freeAmount: r,
|
|
10
|
+
name: t,
|
|
11
|
+
replacementName: m,
|
|
12
|
+
position: p
|
|
13
|
+
} = n;
|
|
14
|
+
return `modification-${i}-${o}-${$ ?? 0}-${a}-${d}-${c}-${r}-${t}-${m ?? t}-${p}${e ? `-${e}` : ""}`;
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
u as default
|
|
18
|
+
};
|
package/check/index.d.ts
ADDED
package/check/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getOrganizedCheckItemModifications.js"),i=require("./getUniqueCheckItemModificationId.js");require("@ancon/wildcat-types");require("../toString-b771abdf.js");require("../isObjectLike-963267e9.js");require("../identity-2a048185.js");require("../_getTag-d4cd1660.js");require("../_baseIteratee-ae97e42e.js");require("../_baseIsEqual-ad544573.js");exports.getOrganizedCheckItemModifications=e;exports.getUniqueCheckItemModificationId=i;
|
package/check/index.mjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as f } from "./getOrganizedCheckItemModifications.mjs";
|
|
2
|
+
import { default as n } from "./getUniqueCheckItemModificationId.mjs";
|
|
3
|
+
import "@ancon/wildcat-types";
|
|
4
|
+
import "../toString-ce418705.mjs";
|
|
5
|
+
import "../isObjectLike-54341556.mjs";
|
|
6
|
+
import "../identity-cf449299.mjs";
|
|
7
|
+
import "../_getTag-fcc5160b.mjs";
|
|
8
|
+
import "../_baseIteratee-db1f278d.mjs";
|
|
9
|
+
import "../_baseIsEqual-5e6adb07.mjs";
|
|
10
|
+
export {
|
|
11
|
+
f as getOrganizedCheckItemModifications,
|
|
12
|
+
n as getUniqueCheckItemModificationId
|
|
13
|
+
};
|