@spscommerce/utils 8.0.1 → 8.1.1

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/lib/index.js CHANGED
@@ -15,7 +15,7 @@ function D(e, n, a) {
15
15
  const t = function(...i) {
16
16
  return new Promise((o, s) => {
17
17
  t.reset && t.reset(), t.pending = !0;
18
- const f = () => {
18
+ const p = () => {
19
19
  (async () => {
20
20
  try {
21
21
  let c = e.apply(a || this, i);
@@ -27,7 +27,7 @@ function D(e, n, a) {
27
27
  }
28
28
  })();
29
29
  };
30
- t.id = window.setTimeout(f, n);
30
+ t.id = window.setTimeout(p, n);
31
31
  });
32
32
  };
33
33
  return t.reset = w.bind(t), t;
@@ -47,7 +47,7 @@ function G(e, n) {
47
47
  const a = n ? e.bind(n) : e;
48
48
  setTimeout(a, 0);
49
49
  }
50
- const S = {
50
+ const C = {
51
51
  // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
52
52
  add: (e, n) => e + n,
53
53
  and: (e, n) => e && n,
@@ -88,7 +88,7 @@ function W(e, n) {
88
88
  throw new Error("start must be an integer");
89
89
  if (!Number.isInteger(n))
90
90
  throw new Error("end must be an integer");
91
- return new Array(Math.abs(n - e) + 1).fill(e).map(e > n ? S.sub : S.add);
91
+ return new Array(Math.abs(n - e) + 1).fill(e).map(e > n ? C.sub : C.add);
92
92
  }
93
93
  class z {
94
94
  constructor(n, a = {}) {
@@ -460,19 +460,19 @@ function Q(e, n, a) {
460
460
  function X(e, n, a, t, r) {
461
461
  const i = r, o = i.get, { value: s } = i;
462
462
  return i.get = function() {
463
- const c = this, R = s ?? o?.call(this);
463
+ const c = this, h = s ?? o?.call(this);
464
464
  let d;
465
- if (typeof R == "function")
466
- d = R.bind(this);
465
+ if (typeof h == "function")
466
+ d = h.bind(this);
467
467
  else
468
468
  throw new Error("The value is not a function");
469
469
  const y = { ...n, ...e };
470
470
  for (const l of Object.keys(n))
471
471
  typeof e[l] == "function" ? Object.defineProperty(d, l, {
472
472
  get() {
473
- const h = y[l];
474
- if (typeof h == "function")
475
- return h(c);
473
+ const S = y[l];
474
+ if (typeof S == "function")
475
+ return S(c);
476
476
  throw new Error(`Property ${l} is not a function`);
477
477
  }
478
478
  }) : d[l] = y[l];
@@ -504,14 +504,14 @@ function N(e, n = 0) {
504
504
  r = +`${Math.round(+`${r}e${i}`)}e-${i}`;
505
505
  return r;
506
506
  }
507
- const L = 5, C = 1024;
507
+ const L = 5, A = 1024;
508
508
  function Z(e, n = 2) {
509
509
  if (e > Number.MAX_SAFE_INTEGER)
510
510
  throw new Error(
511
511
  "Number is greater than MAX_SAFE_INTEGER; toFileSizeString does not support orders of magnitude higher than petabytes for this reason until BigInt achieves broad browser support."
512
512
  );
513
513
  const a = Math.min(
514
- Math.floor(Math.log(e) / Math.log(C)),
514
+ Math.floor(Math.log(e) / Math.log(A)),
515
515
  L
516
516
  ), t = [
517
517
  "B",
@@ -521,11 +521,11 @@ function Z(e, n = 2) {
521
521
  "TB",
522
522
  "PB"
523
523
  ][a], r = a ? n : 0;
524
- return N(e / C ** a, r).toFixed(
524
+ return N(e / A ** a, r).toFixed(
525
525
  r
526
526
  ) + t;
527
527
  }
528
- function g(e) {
528
+ function R(e) {
529
529
  return typeof e == "string" ? e.match(/[^.[\]]+/g) ?? [] : Array.isArray(e) ? Array.from(e) : [e];
530
530
  }
531
531
  function ee(e, n, a) {
@@ -538,14 +538,14 @@ function u(e) {
538
538
  const n = Object.getPrototypeOf(e);
539
539
  return (n === null || n === Object.prototype || Object.getPrototypeOf(n) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
540
540
  }
541
- function k(e) {
541
+ function B(e) {
542
542
  Object.freeze(e);
543
543
  for (const n of Object.keys(e)) {
544
544
  const a = e[n];
545
- (u(a) || Array.isArray(a)) && k(a);
545
+ (u(a) || Array.isArray(a)) && B(a);
546
546
  }
547
547
  }
548
- var B = /* @__PURE__ */ ((e) => (e[e.ADDITION = 0] = "ADDITION", e[e.DELETION = 1] = "DELETION", e[e.ALTERATION = 2] = "ALTERATION", e))(B || {});
548
+ var k = /* @__PURE__ */ ((e) => (e[e.ADDITION = 0] = "ADDITION", e[e.DELETION = 1] = "DELETION", e[e.ALTERATION = 2] = "ALTERATION", e))(k || {});
549
549
  function q(e, n, a = []) {
550
550
  let t = [];
551
551
  for (const r of /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(n)])) {
@@ -594,14 +594,14 @@ function _(e, n, a = []) {
594
594
  function v(e) {
595
595
  return e == null ? !0 : typeof e == "object" ? Array.isArray(e) ? e.length === 0 : e instanceof Map || e instanceof Set ? e.size === 0 : Object.keys(e).length === 0 : !1;
596
596
  }
597
- function A(e) {
597
+ function I(e) {
598
598
  return e == null;
599
599
  }
600
- function I(e, n, a, t = !1) {
600
+ function b(e, n, a, t = !1) {
601
601
  if (v(n))
602
602
  return e;
603
603
  let r = e;
604
- for (const i of g(n)) {
604
+ for (const i of R(n)) {
605
605
  let o = i, s;
606
606
  if (typeof i == "string") {
607
607
  const c = /^([^?]+)(\?)?$/.exec(i);
@@ -611,10 +611,10 @@ function I(e, n, a, t = !1) {
611
611
  s
612
612
  ] = c);
613
613
  }
614
- if (r = r[o], A(r) && (s || t))
614
+ if (r = r[o], I(r) && (s || t))
615
615
  return a;
616
616
  }
617
- return A(r) ? a : r;
617
+ return I(r) ? a : r;
618
618
  }
619
619
  function ne(e, ...n) {
620
620
  const a = new Set(n), t = {};
@@ -627,7 +627,7 @@ function te(e, n, a) {
627
627
  throw new Error("object is required");
628
628
  if (v(n))
629
629
  throw new Error("path is required");
630
- const t = g(n), r = t.splice(t.length - 1, 1)[0];
630
+ const t = R(n), r = t.splice(t.length - 1, 1)[0];
631
631
  let i = e;
632
632
  for (const o of t)
633
633
  if (i = i[o], typeof i != "object")
@@ -637,20 +637,20 @@ function te(e, n, a) {
637
637
  function* ae(e, n) {
638
638
  yield e;
639
639
  let a = e;
640
- for (const t of g(n))
640
+ for (const t of R(n))
641
641
  a = a[t], yield a;
642
642
  }
643
- function b(...e) {
643
+ function O(...e) {
644
644
  const n = {};
645
645
  for (const a of e)
646
646
  for (const t of Object.keys(a))
647
- Object.hasOwn(n, t) && Object.getOwnPropertyDescriptor(n, t)?.writable !== void 0 && u(n[t]) ? n[t] = b(
647
+ Object.hasOwn(n, t) && Object.getOwnPropertyDescriptor(n, t)?.writable !== void 0 && u(n[t]) ? n[t] = O(
648
648
  n[t],
649
649
  a[t]
650
- ) : u(a[t]) ? n[t] = b({}, a[t]) : n[t] = a[t];
650
+ ) : u(a[t]) ? n[t] = O({}, a[t]) : n[t] = a[t];
651
651
  return n;
652
652
  }
653
- const O = (e) => {
653
+ const f = (e) => {
654
654
  if (typeof e == "object" && e !== null) {
655
655
  if (typeof Object.getPrototypeOf == "function") {
656
656
  const n = Object.getPrototypeOf(e);
@@ -660,21 +660,23 @@ const O = (e) => {
660
660
  }
661
661
  return !1;
662
662
  }, m = (...e) => e.reduce((n, a) => {
663
+ if (a === void 0)
664
+ return n;
663
665
  if (Array.isArray(a))
664
666
  throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
665
667
  return Object.keys(a).forEach((t) => {
666
- ["__proto__", "constructor", "prototype"].includes(t) || (Array.isArray(n[t]) && Array.isArray(a[t]) ? n[t] = m.options.mergeArrays ? m.options.uniqueArrayItems ? Array.from(new Set(n[t].concat(a[t]))) : [...n[t], ...a[t]] : a[t] : O(n[t]) && O(a[t]) ? n[t] = m(n[t], a[t]) : n[t] = a[t] === void 0 ? m.options.allowUndefinedOverrides ? a[t] : n[t] : a[t]);
668
+ ["__proto__", "constructor", "prototype"].includes(t) || (Array.isArray(n[t]) && Array.isArray(a[t]) ? n[t] = m.options.mergeArrays ? m.options.uniqueArrayItems ? Array.from(new Set(n[t].concat(a[t]))) : [...n[t], ...a[t]] : a[t] : f(n[t]) && f(a[t]) ? n[t] = m(n[t], a[t]) : !f(n[t]) && f(a[t]) ? n[t] = m(a[t], void 0) : n[t] = a[t] === void 0 ? m.options.allowUndefinedOverrides ? a[t] : n[t] : a[t]);
667
669
  }), n;
668
- }, {}), p = {
670
+ }, {}), g = {
669
671
  allowUndefinedOverrides: !0,
670
672
  mergeArrays: !0,
671
673
  uniqueArrayItems: !0
672
674
  };
673
- m.options = p;
675
+ m.options = g;
674
676
  m.withOptions = (e, ...n) => {
675
- m.options = Object.assign(Object.assign({}, p), e);
677
+ m.options = Object.assign(Object.assign({}, g), e);
676
678
  const a = m(...n);
677
- return m.options = p, a;
679
+ return m.options = g, a;
678
680
  };
679
681
  function re(e) {
680
682
  const n = [];
@@ -715,7 +717,7 @@ function oe(e) {
715
717
  }
716
718
  const P = /(<%=|{{)(.+?)(%>|}})/g, E = /<%\?(.+?)%>(.+?)<\/%>/g, T = Symbol("sps.utils.templateSrc");
717
719
  function se(e) {
718
- const n = (a) => e.replace(E, (t, r, i) => I(a, r.trim()) ? i : "").replace(P, (t, r, i) => I(a, i.trim(), ""));
720
+ const n = (a) => e.replace(E, (t, r, i) => b(a, r.trim()) ? i : "").replace(P, (t, r, i) => b(a, i.trim(), ""));
719
721
  return n[T] = e, n;
720
722
  }
721
723
  function ce(e) {
@@ -726,29 +728,29 @@ function me(e) {
726
728
  }
727
729
  export {
728
730
  z as CustomEvent,
729
- B as DiffChange,
731
+ k as DiffChange,
730
732
  H as EDI_DOCUMENT_TYPE,
731
- S as Op,
733
+ C as Op,
732
734
  $ as castToNumber,
733
735
  ie as code,
734
736
  J as constrain,
735
737
  ee as copyProperty,
736
- g as crumblePath,
738
+ R as crumblePath,
737
739
  D as debounce,
738
740
  K as debounced,
739
741
  N as decimalRound,
740
- k as deepFreeze,
742
+ B as deepFreeze,
741
743
  q as diff,
742
744
  M as flatten,
743
745
  V as forEachEntryDeep,
744
746
  _ as forEachNestedObject,
745
- I as getPath,
747
+ b as getPath,
746
748
  U as isSubset,
747
749
  ce as isTemplate,
748
750
  me as isTemplateFn,
749
751
  j as lockToAnimationFrames,
750
752
  Q as lockedToAnimationFrames,
751
- b as mergeDeep,
753
+ O as mergeDeep,
752
754
  m as mergePropertiesDeep,
753
755
  ne as omit,
754
756
  G as onNextTick,
package/lib/index.umd.cjs CHANGED
@@ -1 +1 @@
1
- (function(o,d){typeof exports=="object"&&typeof module<"u"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(o=typeof globalThis<"u"?globalThis:o||self,d(o.Utils={}))})(this,(function(o){"use strict";function d(e){return Array.isArray(e)?e.reduce((n,a)=>n.concat(d(a)),[]):e}function _(e,n){const a=new Set(n);for(const t of e)if(!a.has(t))return!1;return!0}function U(){return this.pending=!1,typeof this.id<"u"?(clearTimeout(this.id),delete this.id,!0):!1}function A(e,n,a){const t=function(...i){return new Promise((c,s)=>{t.reset&&t.reset(),t.pending=!0;const C=()=>{(async()=>{try{let m=e.apply(a||this,i);m instanceof Promise&&(m=await m),c(m)}catch(m){s(m)}finally{t.reset&&t.reset()}})()};t.id=window.setTimeout(C,n)})};return t.reset=U.bind(t),t}function V(){return this.pending=!1,typeof this.id=="number"?(window.cancelAnimationFrame(this.id),delete this.id,!0):!1}function I(e,n){const a=function(...r){a.pending===!0&&a.reset&&a.reset(),a.id=window.requestAnimationFrame(()=>{e.apply(!!n||this,r),a.reset&&a.reset()}),a.pending=!0};return a.pending=!1,a.reset=V.bind(a),a}function G(e,n){const a=n?e.bind(n):e;setTimeout(a,0)}const R={add:(e,n)=>e+n,and:(e,n)=>e&&n,band:(e,n)=>e&n,bor:(e,n)=>e|n,bxor:(e,n)=>e^n,bnot:e=>~e,decr:e=>e-1,div:(e,n)=>e/n,eq:(e,n)=>e===n,exp:(e,n)=>e**n,gt:(e,n)=>e>n,gte:(e,n)=>e>=n,incr:e=>e+1,lshift:(e,n)=>e<<n,lt:(e,n)=>e<n,lte:(e,n)=>e<=n,mul:(e,n)=>e*n,neg:e=>-e,neq:(e,n)=>e!==n,not:e=>!e,or:(e,n)=>e||n,rem:(e,n)=>e%n,rshift:(e,n)=>e>>n,rshift_zf:(e,n)=>e>>>n,sub:(e,n)=>e-n,xor:(e,n)=>!!((e||n)&&!(e&&n))};function z(e,n){if(!Number.isInteger(e))throw new Error("start must be an integer");if(!Number.isInteger(n))throw new Error("end must be an integer");return new Array(Math.abs(n-e)+1).fill(e).map(e>n?R.sub:R.add)}class W{constructor(n,a={}){let t;if(typeof Event=="function")t=new Event(n,a);else{t=document.createEvent("Event"),t.initEvent(n,a.bubbles,a.cancelable);for(const i of Object.keys(a))i!=="bubbles"&&i!=="cancelable"&&(t[i]=a[i])}Object.setPrototypeOf(this,t);const r=Object.getOwnPropertyDescriptors(Event.prototype);for(const i of Object.keys(r)){const c=r[i];for(const s of Object.keys(c))typeof c[s]=="function"&&(c[s]=c[s].bind(t))}Object.defineProperties(this,r)}}const H=Object.freeze({100:{name:"Insurance Plan Description"},101:{name:"Name and Address Lists"},104:{name:"Air Shipment Information"},106:{name:"Motor Carrier Rate Proposal"},107:{name:"Request for Motor Carrier Rate Proposal"},108:{name:"Response to a Motor Carrier Rate Proposal"},109:{name:"Vessel Content Details"},110:{name:"Air Freight Details and Invoice"},112:{name:"Property Damage Report"},120:{name:"Vehicle Shipping Order"},121:{name:"Vehicle Service"},124:{name:"Vehicle Damage"},125:{name:"Multilevel Railcar Load Details"},126:{name:"Vehicle Application Advice"},127:{name:"Vehicle Baying Order"},128:{name:"Dealer Information"},129:{name:"Vehicle Carrier Rate Update"},130:{name:"Student Educational Record (Transcript)"},131:{name:"Student Educational Record (Transcript) Acknowledgment"},135:{name:"Student Loan Application"},138:{name:"Testing Results Request and Report"},139:{name:"Student Loan Guarantee Result"},140:{name:"Product Registration"},141:{name:"Product Service Claim Response"},142:{name:"Product Service Claim"},143:{name:"Product Service Notification"},144:{name:"Student Loan Transfer and Status Verification"},146:{name:"Request for Student Educational Record (Transcript)"},147:{name:"Response to Request for Student Educational Record (Transcript)"},148:{name:"Report of Injury, Illness or Incident"},149:{name:"Notice of Tax Adjustment or Assessment"},150:{name:"Tax Rate Notification"},151:{name:"Electronic Filing of Tax Return Data Acknowledgment"},152:{name:"Statistical Government Information"},153:{name:"Unemployment Insurance Tax Claim or Charge Information"},154:{name:"Uniform Commercial Code Filing"},155:{name:"Business Credit Report"},157:{name:"Notice of Power of Attorney"},159:{name:"Motion Picture Booking Confirmation"},160:{name:"Transportation Automatic Equipment Identification"},161:{name:"Train Sheet"},169:{name:"Transportation Appointment Schedule Information"},170:{name:"Revenue Receipts Statement"},175:{name:"Court and Law Enforcement Notice"},176:{name:"Court Submission TYPE"},180:{name:"Return Merchandise Authorization and Notification"},185:{name:"Royalty Regulatory Report"},186:{name:"Insurance Underwriting Requirements Reporting"},188:{name:"Educational Course Inventory"},189:{name:"Application for Admission to Educational Institutions"},190:{name:"Student Enrollment Verification"},191:{name:"Student Loan Pre-Claims and Claims"},194:{name:"Grant or Assistance Application"},195:{name:"Federal Communications Commission (FCC) License Application"},196:{name:"Contractor Cost Data Reporting"},197:{name:"Real Estate Title Evidence"},198:{name:"Loan Verification Information"},199:{name:"Real Estate Settlement Information"},200:{name:"Mortgage Credit Report"},201:{name:"Residential Loan Application"},202:{name:"Secondary Mortgage Market Loan Delivery"},203:{name:"Secondary Mortgage Market Investor Report"},204:{name:"Motor Carrier Load Tender"},205:{name:"Mortgage Note"},206:{name:"Real Estate Inspection"},210:{name:"Motor Carrier Freight Details and Invoice"},211:{name:"Motor Carrier Bill of Lading",edifactId:"IFTMCE"},212:{name:"Motor Carrier Delivery Trailer Manifest"},213:{name:"Motor Carrier Shipment Status Inquiry"},214:{name:"Transportation Carrier Shipment Status Message"},215:{name:"Motor Carrier Pick-up Manifest"},216:{name:"Motor Carrier Shipment Pick-up Notification"},217:{name:"Motor Carrier Loading and Route Guide"},218:{name:"Motor Carrier Tariff Information"},219:{name:"Logistics Service Request"},220:{name:"Logistics Service Response"},222:{name:"Cartage Work Assignment"},223:{name:"Consolidators Freight Bill and Invoice"},224:{name:"Motor Carrier Summary Freight Bill Manifest"},225:{name:"Response to a Cartage Work Assignment"},240:{name:"Motor Carrier Package Status"},242:{name:"Data Status Tracking"},244:{name:"Product Source Information"},248:{name:"Account Assignment/Inquiry and Service/Status"},249:{name:"Animal Toxicological Data"},250:{name:"Purchase Order Shipment Management Document"},251:{name:"Pricing Support"},252:{name:"Insurance Producer Administration"},255:{name:"Underwriting Information Services"},256:{name:"Periodic Compensation"},260:{name:"Application for Mortgage Insurance Benefits"},261:{name:"Real Estate Information Request"},262:{name:"Real Estate Information Report"},263:{name:"Residential Mortgage Insurance Application Response"},264:{name:"Mortgage Loan Default Status"},265:{name:"Real Estate Title Insurance Services Order"},266:{name:"Mortgage or Property Record Change Notification"},267:{name:"Individual Life, Annuity and Disability Application"},268:{name:"Annuity Activity"},270:{name:"Eligibility, Coverage or Benefit Inquiry"},271:{name:"Eligibility, Coverage or Benefit Information"},272:{name:"Property and Casualty Loss Notification"},273:{name:"Insurance/Annuity Application Status"},274:{name:"Health Care Provider Information"},275:{name:"Patient Information"},276:{name:"Health Care Claim Status Request"},277:{name:"Health Care Claim Status Notification"},278:{name:"Health Care Services Insurance/Benefit Review Information"},280:{name:"Voter Registration Information"},285:{name:"Commercial Vehicle Safety and Credentials Information Exchange"},286:{name:"Commercial Vehicle Credentials"},288:{name:"Wage Determination"},290:{name:"Cooperative Advertising Agreements"},300:{name:"Reservation (Booking Request) (Ocean)"},301:{name:"Confirmation (Ocean)",edifactId:"IFTMBC"},303:{name:"Booking Cancellation (Ocean)"},304:{name:"Shipping Instructions"},309:{name:"U.S. Customs Manifest"},310:{name:"Freight Receipt and Invoice (Ocean)"},311:{name:"Canadian Customs Information"},312:{name:"Arrival Notice (Ocean)"},313:{name:"Shipment Status Inquiry (Ocean)"},315:{name:"Status Details (Ocean)"},317:{name:"Delivery/Pickup Order"},319:{name:"Terminal Information"},322:{name:"Terminal Operations and Intermodal Ramp Activity"},323:{name:"Vessel Schedule and Itinerary (Ocean)"},324:{name:"Vessel Stow Plan (Ocean)"},325:{name:"Consolidation of Goods In Container"},326:{name:"Consignment Summary List"},350:{name:"U.S. Customs Status Information"},352:{name:"U.S. Customs Carrier General Order Status"},353:{name:"U.S. Customs Events Advisory Details"},354:{name:"U.S. Customs Automated Manifest Archive Status"},355:{name:"U.S. Customs Acceptance/Rejection"},356:{name:"U.S. Customs Permit to Transfer Request"},357:{name:"U.S. Customs In-Bond Information"},358:{name:"U.S. Customs Consist Information"},361:{name:"Carrier Interchange Agreement (Ocean)"},362:{name:"Cargo Insurance Advice of Shipment"},404:{name:"Rail Carrier Shipment Information"},410:{name:"Rail Carrier Freight Details and Invoice"},411:{name:"Rail Carrier Freight Details and Invoice Summary"},412:{name:"Trailer or Container Repair Billing"},414:{name:"Rail Carhire Settlements"},417:{name:"Rail Carrier Waybill Interchange"},418:{name:"Rail Advance Interchange Consist"},419:{name:"Advance Car Disposition"},420:{name:"Car Handling Information"},421:{name:"Estimated Time of Arrival and Car Scheduling"},422:{name:"Shipper's Car Order"},423:{name:"Rail Industrial Switch List"},424:{name:"Rail Carrier Services Settlement"},425:{name:"Rail Waybill Request"},426:{name:"Rail Revenue Waybill"},427:{name:"Rail Waybill Response"},429:{name:"Railroad Retirement Activity"},431:{name:"Railroad Station Master File"},432:{name:"Rail Deprescription"},433:{name:"Railroad Reciprocal Switch File"},434:{name:"Railroad Mark Register Update Activity"},435:{name:"Standard Transportation Commodity Code (STCC) Master"},436:{name:"Locomotive Information"},437:{name:"Railroad Junctions and Interchanges Activity"},440:{name:"Shipment Weights"},451:{name:"Railroad Event Report"},452:{name:"Railroad Problem Log Inquiry or Advice"},453:{name:"Railroad Service Commitment Advice"},455:{name:"Railroad Parameter Trace Registration"},456:{name:"Railroad Equipment Inquiry or Advice"},460:{name:"Railroad Price Distribution Request or Response"},463:{name:"Rail Rate Reply"},466:{name:"Rate Request"},468:{name:"Rate Docket Journal Log"},470:{name:"Railroad Clearance"},475:{name:"Rail Route File Maintenance"},485:{name:"Ratemaking Action"},486:{name:"Rate Docket Expiration"},490:{name:"Rate Group Definition"},492:{name:"Miscellaneous Rates"},494:{name:"Rail Scale Rates"},500:{name:"Medical Event Reporting"},501:{name:"Vendor Performance Review"},503:{name:"Pricing History"},504:{name:"Clauses and Provisions"},511:{name:"Requisition"},517:{name:"Material Obligation Validation"},521:{name:"Income or Asset Offset"},527:{name:"Material Due-In and Receipt"},536:{name:"Logistics Reassignment"},540:{name:"Notice of Employment Status"},561:{name:"Contract Abstract"},567:{name:"Contract Completion Status"},568:{name:"Contract Payment Management Report"},601:{name:"U.S. Customs Export Shipment Information"},602:{name:"Transportation Services Tender"},620:{name:"Excavation Communication"},625:{name:"Well Information"},650:{name:"Maintenance Service Order"},715:{name:"Intermodal Group Loading Plan"},805:{name:"Contract Pricing Proposal"},806:{name:"Project Schedule Reporting"},810:{name:"Invoice",edifactId:"INVOIC"},811:{name:"Consolidated Service Invoice/Statement"},812:{name:"Credit/Debit Adjustment"},813:{name:"Electronic Filing of Tax Return Data"},814:{name:"General Request, Response or Confirmation"},815:{name:"Cryptographic Service Message"},816:{name:"Organizational Relationships"},818:{name:"Commission Sales Report"},819:{name:"Operating Expense Statement"},820:{name:"Payment Order/Remittance Advice",edifactId:"REMADV"},821:{name:"Financial Information Reporting"},822:{name:"Account Analysis"},823:{name:"Lockbox"},824:{name:"Application Advice",edifactId:"APERAK"},826:{name:"Tax Information Exchange"},827:{name:"Financial Return Notice"},828:{name:"Debit Authorization"},829:{name:"Payment Cancellation Request"},830:{name:"Planning Schedule with Release Capability",edifactId:"DELFOR"},831:{name:"Application Control Totals"},832:{name:"Price/Sales Catalog",edifactId:"PRICAT"},833:{name:"Mortgage Credit Report Order"},834:{name:"Benefit Enrollment and Maintenance"},835:{name:"Health Care Claim Payment/Advice"},836:{name:"Procurement Notices"},837:{name:"Health Care Claim"},838:{name:"Trading Partner Profile"},839:{name:"Project Cost Reporting"},840:{name:"Request for Quotation",edifactId:"REQUOTE"},841:{name:"Specifications/Technical Information"},842:{name:"Nonconformance Report"},843:{name:"Response to Request for Quotation",edifactId:"QUOTES"},844:{name:"Product Transfer Account Adjustment",edifactId:"SSDCLM"},845:{name:"Price Authorization Acknowledgment/Status",edifactId:"ATHSTS"},846:{name:"Inventory Inquiry/Advice",edifactId:"INVRPT"},847:{name:"Material Claim"},848:{name:"Material Safety Data Sheet"},849:{name:"Response to Product Transfer Account Adjustment"},850:{name:"Purchase Order",edifactId:"ORDERS"},851:{name:"Asset Schedule"},852:{name:"Product Activity Data",edifactId:"SLSRPT"},853:{name:"Routing and Carrier Instruction"},854:{name:"Shipment Delivery Discrepancy Information"},855:{name:"Purchase Order Acknowledgment",edifactId:"ORDRSP"},856:{name:"Advance Ship Notice/Manifest",edifactId:"DESADV"},857:{name:"Shipment and Billing Notice"},858:{name:"Shipment Information"},859:{name:"Freight Invoice"},860:{name:"Purchase Order Change",edifactId:"ORDCHG"},861:{name:"Receiving Advice/Acceptance Certificate",edifactId:"RECADV"},862:{name:"Shipping Schedule",edifactId:"DELJIT"},863:{name:"Report of Test Results"},864:{name:"Text Message"},865:{name:"Purchase Order Change",edifactId:"ORDRSP"},866:{name:"Production Sequence"},867:{name:"Product Transfer and Resale Report",edifactId:"SLSRPT"},868:{name:"Electronic Form Structure"},869:{name:"Order Status Inquiry",edifactId:"ORSSTA"},870:{name:"Order Status Report",edifactId:"ORDREP"},871:{name:"Component Parts Content"},872:{name:"Residential Mortgage Insurance Application"},875:{name:"Grocery Products Purchase Order"},876:{name:"Grocery Products Purchase Order Change"},877:{name:"Manufacturer Coupon Family Code Structure"},878:{name:"Product Authorization/De-authorization"},879:{name:"Price Information"},880:{name:"Grocery Products Invoice"},881:{name:"Manufacturer Coupon Redemption Detail"},882:{name:"Direct Store Delivery Summary Information"},883:{name:"Market Development Fund Allocation"},884:{name:"Market Development Fund Settlement"},885:{name:"Retail Account Characteristics"},886:{name:"Customer Call Reporting"},887:{name:"Coupon Notification"},888:{name:"Item Maintenance"},889:{name:"Promotion Announcement"},891:{name:"Deduction Research Report"},893:{name:"Item Information Request"},894:{name:"Delivery/Return Base Record"},895:{name:"Delivery/Return Acknowledgment or Adjustment"},896:{name:"Product Dimension Maintenance"},920:{name:"Loss or Damage Claim - General Commodities"},924:{name:"Loss or Damage Claim - Motor Vehicle"},925:{name:"Claim Tracer"},926:{name:"Claim Status Report and Tracer Reply"},928:{name:"Automotive Inspection Detail"},940:{name:"Warehouse Shipping Order"},943:{name:"Warehouse Stock Transfer Shipment Advice"},944:{name:"Warehouse Stock Transfer Receipt Advice"},945:{name:"Warehouse Shipping Advice"},947:{name:"Warehouse Inventory Adjustment Advice"},980:{name:"Functional Group Totals"},990:{name:"Response to a Load Tender"},996:{name:"File Transfer"},997:{name:"Functional Acknowledgment",edifactId:"CONTROL"},998:{name:"Set Cancellation"},999:{name:"Implementation Acknowledgment"}});function $(){return(e,n)=>{const a=`_${String(n)}`;Object.defineProperties(e,{[a]:{enumerable:!1,configurable:!0,writable:!0,value:void 0},[n]:{enumerable:!0,configurable:!0,get(){return Number(this[a])},set(t){this[a]=Number(t)}}})}}function K(e){return(n,a,t)=>{const r={...t};return r.get=function(){const c={...r};return c.value=A(r.value,e,this),Object.defineProperty(this,a,c),c.value},r.configurable=!0,delete r.writable,delete r.value,r}}function Y(e,n,a){const t={...a};return a.get=function(){const i={...t};return i.value=I(t.value,this),Object.defineProperty(this,n,i),i.value},a.configurable=!0,delete a.writable,delete a.value,a}function Q(e,n,a,t,r){const i=r,c=i.get,{value:s}=i;return i.get=function(){const m=this,L=s??c?.call(this);let p;if(typeof L=="function")p=L.bind(this);else throw new Error("The value is not a function");const B={...n,...e};for(const f of Object.keys(n))typeof e[f]=="function"?Object.defineProperty(p,f,{get(){const q=B[f];if(typeof q=="function")return q(m);throw new Error(`Property ${f} is not a function`)}}):p[f]=B[f];return Object.defineProperty(this,t,{writable:!0,configurable:!0,enumerable:i.enumerable,value:p}),p},delete i.value,delete i.writable,i}function X(e,n,a){const t={...a};return t.get=function(){const i={...t};if(!t.value)return t.value;const c=t.value.bind(this);return i.value=()=>setTimeout(c,0),Object.defineProperty(this,n,i),i.value},t.configurable=!0,delete t.writable,delete t.value,t}function J(e,n){return!e||e<n[0]?n[0]:e>n[1]?n[1]:e}function b(e,n=0){const a=String(e).split("."),t=a.length>1?a[1].length:0;let r=e;for(let i=t-1;i>=n;i-=1)r=+`${Math.round(+`${r}e${i}`)}e-${i}`;return r}const Z=5,O=1024;function x(e,n=2){if(e>Number.MAX_SAFE_INTEGER)throw new Error("Number is greater than MAX_SAFE_INTEGER; toFileSizeString does not support orders of magnitude higher than petabytes for this reason until BigInt achieves broad browser support.");const a=Math.min(Math.floor(Math.log(e)/Math.log(O)),Z),t=["B","KB","MB","GB","TB","PB"][a],r=a?n:0;return b(e/O**a,r).toFixed(r)+t}function g(e){return typeof e=="string"?e.match(/[^.[\]]+/g)??[]:Array.isArray(e)?Array.from(e):[e]}function ee(e,n,a){const t=Object.getOwnPropertyDescriptor(n,e);t&&Object.defineProperty(a,e,t)}function l(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function v(e){Object.freeze(e);for(const n of Object.keys(e)){const a=e[n];(l(a)||Array.isArray(a))&&v(a)}}var P=(e=>(e[e.ADDITION=0]="ADDITION",e[e.DELETION=1]="DELETION",e[e.ALTERATION=2]="ALTERATION",e))(P||{});function E(e,n,a=[]){let t=[];for(const r of new Set([...Object.keys(e),...Object.keys(n)])){const i=Object.hasOwn(e,r),c=Object.hasOwn(n,r);i&&!c?t.push({type:1,key:r,parentPath:a,objects:[e,n]}):!i&&c?t.push({type:0,key:r,parentPath:a,objects:[e,n]}):l(e[r])&&l(n[r])||Array.isArray(e[r])&&Array.isArray(n[r])?t=t.concat(E(e[r],n[r],[...a,r])):e[r]!==n[r]&&t.push({type:2,key:r,parentPath:a,objects:[e,n]})}return t}function T(e,n){for(const a of Object.keys(e)){const t=e[a];l(t)||Array.isArray(t)?T(t,n):n(a,t,e)}}function D(e,n,a=[]){n(a,e);for(const t of Object.keys(e)){const r=e[t];if(l(r)||Array.isArray(r)){const i=a.concat(t);D(r,n,i)}}}function M(e){return e==null?!0:typeof e=="object"?Array.isArray(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:Object.keys(e).length===0:!1}function w(e){return e==null}function y(e,n,a,t=!1){if(M(n))return e;let r=e;for(const i of g(n)){let c=i,s;if(typeof i=="string"){const m=/^([^?]+)(\?)?$/.exec(i);m&&([,c,s]=m)}if(r=r[c],w(r)&&(s||t))return a}return w(r)?a:r}function ne(e,...n){const a=new Set(n),t={};for(const r of Object.keys(e))a.has(r)||(t[r]=e[r]);return t}function te(e,n,a){if(typeof e!="object")throw new Error("object is required");if(M(n))throw new Error("path is required");const t=g(n),r=t.splice(t.length-1,1)[0];let i=e;for(const c of t)if(i=i[c],typeof i!="object")throw new Error(`Cannot set value at given path: Path deadends at ${String(c)}`);i[r]=a}function*ae(e,n){yield e;let a=e;for(const t of g(n))a=a[t],yield a}function h(...e){const n={};for(const a of e)for(const t of Object.keys(a))Object.hasOwn(n,t)&&Object.getOwnPropertyDescriptor(n,t)?.writable!==void 0&&l(n[t])?n[t]=h(n[t],a[t]):l(a[t])?n[t]=h({},a[t]):n[t]=a[t];return n}const F=e=>{if(typeof e=="object"&&e!==null){if(typeof Object.getPrototypeOf=="function"){const n=Object.getPrototypeOf(e);return n===Object.prototype||n===null}return Object.prototype.toString.call(e)==="[object Object]"}return!1},u=(...e)=>e.reduce((n,a)=>{if(Array.isArray(a))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(a).forEach(t=>{["__proto__","constructor","prototype"].includes(t)||(Array.isArray(n[t])&&Array.isArray(a[t])?n[t]=u.options.mergeArrays?u.options.uniqueArrayItems?Array.from(new Set(n[t].concat(a[t]))):[...n[t],...a[t]]:a[t]:F(n[t])&&F(a[t])?n[t]=u(n[t],a[t]):n[t]=a[t]===void 0?u.options.allowUndefinedOverrides?a[t]:n[t]:a[t])}),n},{}),S={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};u.options=S,u.withOptions=(e,...n)=>{u.options=Object.assign(Object.assign({},S),e);const a=u(...n);return u.options=S,a};function re(e){const n=[];for(const a of Object.keys(e))n.push(e[a]);return n}function ie(e,...n){const a=e.reduce((r,i,c)=>`${r}${c<=n.length?String(n[c-1]):""}${i}`),t=Math.min(...a.split(/[\r\n]/).filter(r=>!!r.trim()).map(r=>{const i=/^ */.exec(r);return i?i[0].length:0}));return a.replace(new RegExp(`^ {${t}}`,"gm"),"").trim()}const oe=1024;function ce(e){const n=/[A-Z]?B$/.exec(e);if(!n)throw new Error(`Input to parseFileSize ("${e}") doesn't seem like a file size; cannot identify a unit (e.g. KB, GB)`);const[a]=n,t=Number(e.replace(a,""));if(Number.isNaN(t))throw new Error(`Could not parse a number out of input to parseFileSize ("${e}")`);const r=["B","KB","MB","GB","TB","PB"].indexOf(a);if(r===-1)throw new Error("parseFileSize does not support units above PB");return Math.ceil(t*oe**r)}const j=/(<%=|{{)(.+?)(%>|}})/g,N=/<%\?(.+?)%>(.+?)<\/%>/g,k=Symbol("sps.utils.templateSrc");function se(e){const n=a=>e.replace(N,(t,r,i)=>y(a,r.trim())?i:"").replace(j,(t,r,i)=>y(a,i.trim(),""));return n[k]=e,n}function me(e){return typeof e=="string"&&(j.test(e)||N.test(e))}function ue(e){return typeof e=="function"&&Object.hasOwn(e,k)}o.CustomEvent=W,o.DiffChange=P,o.EDI_DOCUMENT_TYPE=H,o.Op=R,o.castToNumber=$,o.code=ie,o.constrain=J,o.copyProperty=ee,o.crumblePath=g,o.debounce=A,o.debounced=K,o.decimalRound=b,o.deepFreeze=v,o.diff=E,o.flatten=d,o.forEachEntryDeep=T,o.forEachNestedObject=D,o.getPath=y,o.isSubset=_,o.isTemplate=me,o.isTemplateFn=ue,o.lockToAnimationFrames=I,o.lockedToAnimationFrames=Y,o.mergeDeep=h,o.mergePropertiesDeep=u,o.omit=ne,o.onNextTick=G,o.parseFileSize=ce,o.range=z,o.setPath=te,o.simpleMetadataDecoratorApplicator=Q,o.template=se,o.tickDelay=X,o.toFileSizeString=x,o.traversePath=ae,o.values=re,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(o,d){typeof exports=="object"&&typeof module<"u"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(o=typeof globalThis<"u"?globalThis:o||self,d(o.Utils={}))})(this,(function(o){"use strict";function d(e){return Array.isArray(e)?e.reduce((n,a)=>n.concat(d(a)),[]):e}function _(e,n){const a=new Set(n);for(const t of e)if(!a.has(t))return!1;return!0}function U(){return this.pending=!1,typeof this.id<"u"?(clearTimeout(this.id),delete this.id,!0):!1}function I(e,n,a){const t=function(...i){return new Promise((c,m)=>{t.reset&&t.reset(),t.pending=!0;const A=()=>{(async()=>{try{let u=e.apply(a||this,i);u instanceof Promise&&(u=await u),c(u)}catch(u){m(u)}finally{t.reset&&t.reset()}})()};t.id=window.setTimeout(A,n)})};return t.reset=U.bind(t),t}function V(){return this.pending=!1,typeof this.id=="number"?(window.cancelAnimationFrame(this.id),delete this.id,!0):!1}function b(e,n){const a=function(...r){a.pending===!0&&a.reset&&a.reset(),a.id=window.requestAnimationFrame(()=>{e.apply(!!n||this,r),a.reset&&a.reset()}),a.pending=!0};return a.pending=!1,a.reset=V.bind(a),a}function G(e,n){const a=n?e.bind(n):e;setTimeout(a,0)}const h={add:(e,n)=>e+n,and:(e,n)=>e&&n,band:(e,n)=>e&n,bor:(e,n)=>e|n,bxor:(e,n)=>e^n,bnot:e=>~e,decr:e=>e-1,div:(e,n)=>e/n,eq:(e,n)=>e===n,exp:(e,n)=>e**n,gt:(e,n)=>e>n,gte:(e,n)=>e>=n,incr:e=>e+1,lshift:(e,n)=>e<<n,lt:(e,n)=>e<n,lte:(e,n)=>e<=n,mul:(e,n)=>e*n,neg:e=>-e,neq:(e,n)=>e!==n,not:e=>!e,or:(e,n)=>e||n,rem:(e,n)=>e%n,rshift:(e,n)=>e>>n,rshift_zf:(e,n)=>e>>>n,sub:(e,n)=>e-n,xor:(e,n)=>!!((e||n)&&!(e&&n))};function z(e,n){if(!Number.isInteger(e))throw new Error("start must be an integer");if(!Number.isInteger(n))throw new Error("end must be an integer");return new Array(Math.abs(n-e)+1).fill(e).map(e>n?h.sub:h.add)}class W{constructor(n,a={}){let t;if(typeof Event=="function")t=new Event(n,a);else{t=document.createEvent("Event"),t.initEvent(n,a.bubbles,a.cancelable);for(const i of Object.keys(a))i!=="bubbles"&&i!=="cancelable"&&(t[i]=a[i])}Object.setPrototypeOf(this,t);const r=Object.getOwnPropertyDescriptors(Event.prototype);for(const i of Object.keys(r)){const c=r[i];for(const m of Object.keys(c))typeof c[m]=="function"&&(c[m]=c[m].bind(t))}Object.defineProperties(this,r)}}const H=Object.freeze({100:{name:"Insurance Plan Description"},101:{name:"Name and Address Lists"},104:{name:"Air Shipment Information"},106:{name:"Motor Carrier Rate Proposal"},107:{name:"Request for Motor Carrier Rate Proposal"},108:{name:"Response to a Motor Carrier Rate Proposal"},109:{name:"Vessel Content Details"},110:{name:"Air Freight Details and Invoice"},112:{name:"Property Damage Report"},120:{name:"Vehicle Shipping Order"},121:{name:"Vehicle Service"},124:{name:"Vehicle Damage"},125:{name:"Multilevel Railcar Load Details"},126:{name:"Vehicle Application Advice"},127:{name:"Vehicle Baying Order"},128:{name:"Dealer Information"},129:{name:"Vehicle Carrier Rate Update"},130:{name:"Student Educational Record (Transcript)"},131:{name:"Student Educational Record (Transcript) Acknowledgment"},135:{name:"Student Loan Application"},138:{name:"Testing Results Request and Report"},139:{name:"Student Loan Guarantee Result"},140:{name:"Product Registration"},141:{name:"Product Service Claim Response"},142:{name:"Product Service Claim"},143:{name:"Product Service Notification"},144:{name:"Student Loan Transfer and Status Verification"},146:{name:"Request for Student Educational Record (Transcript)"},147:{name:"Response to Request for Student Educational Record (Transcript)"},148:{name:"Report of Injury, Illness or Incident"},149:{name:"Notice of Tax Adjustment or Assessment"},150:{name:"Tax Rate Notification"},151:{name:"Electronic Filing of Tax Return Data Acknowledgment"},152:{name:"Statistical Government Information"},153:{name:"Unemployment Insurance Tax Claim or Charge Information"},154:{name:"Uniform Commercial Code Filing"},155:{name:"Business Credit Report"},157:{name:"Notice of Power of Attorney"},159:{name:"Motion Picture Booking Confirmation"},160:{name:"Transportation Automatic Equipment Identification"},161:{name:"Train Sheet"},169:{name:"Transportation Appointment Schedule Information"},170:{name:"Revenue Receipts Statement"},175:{name:"Court and Law Enforcement Notice"},176:{name:"Court Submission TYPE"},180:{name:"Return Merchandise Authorization and Notification"},185:{name:"Royalty Regulatory Report"},186:{name:"Insurance Underwriting Requirements Reporting"},188:{name:"Educational Course Inventory"},189:{name:"Application for Admission to Educational Institutions"},190:{name:"Student Enrollment Verification"},191:{name:"Student Loan Pre-Claims and Claims"},194:{name:"Grant or Assistance Application"},195:{name:"Federal Communications Commission (FCC) License Application"},196:{name:"Contractor Cost Data Reporting"},197:{name:"Real Estate Title Evidence"},198:{name:"Loan Verification Information"},199:{name:"Real Estate Settlement Information"},200:{name:"Mortgage Credit Report"},201:{name:"Residential Loan Application"},202:{name:"Secondary Mortgage Market Loan Delivery"},203:{name:"Secondary Mortgage Market Investor Report"},204:{name:"Motor Carrier Load Tender"},205:{name:"Mortgage Note"},206:{name:"Real Estate Inspection"},210:{name:"Motor Carrier Freight Details and Invoice"},211:{name:"Motor Carrier Bill of Lading",edifactId:"IFTMCE"},212:{name:"Motor Carrier Delivery Trailer Manifest"},213:{name:"Motor Carrier Shipment Status Inquiry"},214:{name:"Transportation Carrier Shipment Status Message"},215:{name:"Motor Carrier Pick-up Manifest"},216:{name:"Motor Carrier Shipment Pick-up Notification"},217:{name:"Motor Carrier Loading and Route Guide"},218:{name:"Motor Carrier Tariff Information"},219:{name:"Logistics Service Request"},220:{name:"Logistics Service Response"},222:{name:"Cartage Work Assignment"},223:{name:"Consolidators Freight Bill and Invoice"},224:{name:"Motor Carrier Summary Freight Bill Manifest"},225:{name:"Response to a Cartage Work Assignment"},240:{name:"Motor Carrier Package Status"},242:{name:"Data Status Tracking"},244:{name:"Product Source Information"},248:{name:"Account Assignment/Inquiry and Service/Status"},249:{name:"Animal Toxicological Data"},250:{name:"Purchase Order Shipment Management Document"},251:{name:"Pricing Support"},252:{name:"Insurance Producer Administration"},255:{name:"Underwriting Information Services"},256:{name:"Periodic Compensation"},260:{name:"Application for Mortgage Insurance Benefits"},261:{name:"Real Estate Information Request"},262:{name:"Real Estate Information Report"},263:{name:"Residential Mortgage Insurance Application Response"},264:{name:"Mortgage Loan Default Status"},265:{name:"Real Estate Title Insurance Services Order"},266:{name:"Mortgage or Property Record Change Notification"},267:{name:"Individual Life, Annuity and Disability Application"},268:{name:"Annuity Activity"},270:{name:"Eligibility, Coverage or Benefit Inquiry"},271:{name:"Eligibility, Coverage or Benefit Information"},272:{name:"Property and Casualty Loss Notification"},273:{name:"Insurance/Annuity Application Status"},274:{name:"Health Care Provider Information"},275:{name:"Patient Information"},276:{name:"Health Care Claim Status Request"},277:{name:"Health Care Claim Status Notification"},278:{name:"Health Care Services Insurance/Benefit Review Information"},280:{name:"Voter Registration Information"},285:{name:"Commercial Vehicle Safety and Credentials Information Exchange"},286:{name:"Commercial Vehicle Credentials"},288:{name:"Wage Determination"},290:{name:"Cooperative Advertising Agreements"},300:{name:"Reservation (Booking Request) (Ocean)"},301:{name:"Confirmation (Ocean)",edifactId:"IFTMBC"},303:{name:"Booking Cancellation (Ocean)"},304:{name:"Shipping Instructions"},309:{name:"U.S. Customs Manifest"},310:{name:"Freight Receipt and Invoice (Ocean)"},311:{name:"Canadian Customs Information"},312:{name:"Arrival Notice (Ocean)"},313:{name:"Shipment Status Inquiry (Ocean)"},315:{name:"Status Details (Ocean)"},317:{name:"Delivery/Pickup Order"},319:{name:"Terminal Information"},322:{name:"Terminal Operations and Intermodal Ramp Activity"},323:{name:"Vessel Schedule and Itinerary (Ocean)"},324:{name:"Vessel Stow Plan (Ocean)"},325:{name:"Consolidation of Goods In Container"},326:{name:"Consignment Summary List"},350:{name:"U.S. Customs Status Information"},352:{name:"U.S. Customs Carrier General Order Status"},353:{name:"U.S. Customs Events Advisory Details"},354:{name:"U.S. Customs Automated Manifest Archive Status"},355:{name:"U.S. Customs Acceptance/Rejection"},356:{name:"U.S. Customs Permit to Transfer Request"},357:{name:"U.S. Customs In-Bond Information"},358:{name:"U.S. Customs Consist Information"},361:{name:"Carrier Interchange Agreement (Ocean)"},362:{name:"Cargo Insurance Advice of Shipment"},404:{name:"Rail Carrier Shipment Information"},410:{name:"Rail Carrier Freight Details and Invoice"},411:{name:"Rail Carrier Freight Details and Invoice Summary"},412:{name:"Trailer or Container Repair Billing"},414:{name:"Rail Carhire Settlements"},417:{name:"Rail Carrier Waybill Interchange"},418:{name:"Rail Advance Interchange Consist"},419:{name:"Advance Car Disposition"},420:{name:"Car Handling Information"},421:{name:"Estimated Time of Arrival and Car Scheduling"},422:{name:"Shipper's Car Order"},423:{name:"Rail Industrial Switch List"},424:{name:"Rail Carrier Services Settlement"},425:{name:"Rail Waybill Request"},426:{name:"Rail Revenue Waybill"},427:{name:"Rail Waybill Response"},429:{name:"Railroad Retirement Activity"},431:{name:"Railroad Station Master File"},432:{name:"Rail Deprescription"},433:{name:"Railroad Reciprocal Switch File"},434:{name:"Railroad Mark Register Update Activity"},435:{name:"Standard Transportation Commodity Code (STCC) Master"},436:{name:"Locomotive Information"},437:{name:"Railroad Junctions and Interchanges Activity"},440:{name:"Shipment Weights"},451:{name:"Railroad Event Report"},452:{name:"Railroad Problem Log Inquiry or Advice"},453:{name:"Railroad Service Commitment Advice"},455:{name:"Railroad Parameter Trace Registration"},456:{name:"Railroad Equipment Inquiry or Advice"},460:{name:"Railroad Price Distribution Request or Response"},463:{name:"Rail Rate Reply"},466:{name:"Rate Request"},468:{name:"Rate Docket Journal Log"},470:{name:"Railroad Clearance"},475:{name:"Rail Route File Maintenance"},485:{name:"Ratemaking Action"},486:{name:"Rate Docket Expiration"},490:{name:"Rate Group Definition"},492:{name:"Miscellaneous Rates"},494:{name:"Rail Scale Rates"},500:{name:"Medical Event Reporting"},501:{name:"Vendor Performance Review"},503:{name:"Pricing History"},504:{name:"Clauses and Provisions"},511:{name:"Requisition"},517:{name:"Material Obligation Validation"},521:{name:"Income or Asset Offset"},527:{name:"Material Due-In and Receipt"},536:{name:"Logistics Reassignment"},540:{name:"Notice of Employment Status"},561:{name:"Contract Abstract"},567:{name:"Contract Completion Status"},568:{name:"Contract Payment Management Report"},601:{name:"U.S. Customs Export Shipment Information"},602:{name:"Transportation Services Tender"},620:{name:"Excavation Communication"},625:{name:"Well Information"},650:{name:"Maintenance Service Order"},715:{name:"Intermodal Group Loading Plan"},805:{name:"Contract Pricing Proposal"},806:{name:"Project Schedule Reporting"},810:{name:"Invoice",edifactId:"INVOIC"},811:{name:"Consolidated Service Invoice/Statement"},812:{name:"Credit/Debit Adjustment"},813:{name:"Electronic Filing of Tax Return Data"},814:{name:"General Request, Response or Confirmation"},815:{name:"Cryptographic Service Message"},816:{name:"Organizational Relationships"},818:{name:"Commission Sales Report"},819:{name:"Operating Expense Statement"},820:{name:"Payment Order/Remittance Advice",edifactId:"REMADV"},821:{name:"Financial Information Reporting"},822:{name:"Account Analysis"},823:{name:"Lockbox"},824:{name:"Application Advice",edifactId:"APERAK"},826:{name:"Tax Information Exchange"},827:{name:"Financial Return Notice"},828:{name:"Debit Authorization"},829:{name:"Payment Cancellation Request"},830:{name:"Planning Schedule with Release Capability",edifactId:"DELFOR"},831:{name:"Application Control Totals"},832:{name:"Price/Sales Catalog",edifactId:"PRICAT"},833:{name:"Mortgage Credit Report Order"},834:{name:"Benefit Enrollment and Maintenance"},835:{name:"Health Care Claim Payment/Advice"},836:{name:"Procurement Notices"},837:{name:"Health Care Claim"},838:{name:"Trading Partner Profile"},839:{name:"Project Cost Reporting"},840:{name:"Request for Quotation",edifactId:"REQUOTE"},841:{name:"Specifications/Technical Information"},842:{name:"Nonconformance Report"},843:{name:"Response to Request for Quotation",edifactId:"QUOTES"},844:{name:"Product Transfer Account Adjustment",edifactId:"SSDCLM"},845:{name:"Price Authorization Acknowledgment/Status",edifactId:"ATHSTS"},846:{name:"Inventory Inquiry/Advice",edifactId:"INVRPT"},847:{name:"Material Claim"},848:{name:"Material Safety Data Sheet"},849:{name:"Response to Product Transfer Account Adjustment"},850:{name:"Purchase Order",edifactId:"ORDERS"},851:{name:"Asset Schedule"},852:{name:"Product Activity Data",edifactId:"SLSRPT"},853:{name:"Routing and Carrier Instruction"},854:{name:"Shipment Delivery Discrepancy Information"},855:{name:"Purchase Order Acknowledgment",edifactId:"ORDRSP"},856:{name:"Advance Ship Notice/Manifest",edifactId:"DESADV"},857:{name:"Shipment and Billing Notice"},858:{name:"Shipment Information"},859:{name:"Freight Invoice"},860:{name:"Purchase Order Change",edifactId:"ORDCHG"},861:{name:"Receiving Advice/Acceptance Certificate",edifactId:"RECADV"},862:{name:"Shipping Schedule",edifactId:"DELJIT"},863:{name:"Report of Test Results"},864:{name:"Text Message"},865:{name:"Purchase Order Change",edifactId:"ORDRSP"},866:{name:"Production Sequence"},867:{name:"Product Transfer and Resale Report",edifactId:"SLSRPT"},868:{name:"Electronic Form Structure"},869:{name:"Order Status Inquiry",edifactId:"ORSSTA"},870:{name:"Order Status Report",edifactId:"ORDREP"},871:{name:"Component Parts Content"},872:{name:"Residential Mortgage Insurance Application"},875:{name:"Grocery Products Purchase Order"},876:{name:"Grocery Products Purchase Order Change"},877:{name:"Manufacturer Coupon Family Code Structure"},878:{name:"Product Authorization/De-authorization"},879:{name:"Price Information"},880:{name:"Grocery Products Invoice"},881:{name:"Manufacturer Coupon Redemption Detail"},882:{name:"Direct Store Delivery Summary Information"},883:{name:"Market Development Fund Allocation"},884:{name:"Market Development Fund Settlement"},885:{name:"Retail Account Characteristics"},886:{name:"Customer Call Reporting"},887:{name:"Coupon Notification"},888:{name:"Item Maintenance"},889:{name:"Promotion Announcement"},891:{name:"Deduction Research Report"},893:{name:"Item Information Request"},894:{name:"Delivery/Return Base Record"},895:{name:"Delivery/Return Acknowledgment or Adjustment"},896:{name:"Product Dimension Maintenance"},920:{name:"Loss or Damage Claim - General Commodities"},924:{name:"Loss or Damage Claim - Motor Vehicle"},925:{name:"Claim Tracer"},926:{name:"Claim Status Report and Tracer Reply"},928:{name:"Automotive Inspection Detail"},940:{name:"Warehouse Shipping Order"},943:{name:"Warehouse Stock Transfer Shipment Advice"},944:{name:"Warehouse Stock Transfer Receipt Advice"},945:{name:"Warehouse Shipping Advice"},947:{name:"Warehouse Inventory Adjustment Advice"},980:{name:"Functional Group Totals"},990:{name:"Response to a Load Tender"},996:{name:"File Transfer"},997:{name:"Functional Acknowledgment",edifactId:"CONTROL"},998:{name:"Set Cancellation"},999:{name:"Implementation Acknowledgment"}});function $(){return(e,n)=>{const a=`_${String(n)}`;Object.defineProperties(e,{[a]:{enumerable:!1,configurable:!0,writable:!0,value:void 0},[n]:{enumerable:!0,configurable:!0,get(){return Number(this[a])},set(t){this[a]=Number(t)}}})}}function K(e){return(n,a,t)=>{const r={...t};return r.get=function(){const c={...r};return c.value=I(r.value,e,this),Object.defineProperty(this,a,c),c.value},r.configurable=!0,delete r.writable,delete r.value,r}}function Y(e,n,a){const t={...a};return a.get=function(){const i={...t};return i.value=b(t.value,this),Object.defineProperty(this,n,i),i.value},a.configurable=!0,delete a.writable,delete a.value,a}function Q(e,n,a,t,r){const i=r,c=i.get,{value:m}=i;return i.get=function(){const u=this,k=m??c?.call(this);let p;if(typeof k=="function")p=k.bind(this);else throw new Error("The value is not a function");const B={...n,...e};for(const f of Object.keys(n))typeof e[f]=="function"?Object.defineProperty(p,f,{get(){const q=B[f];if(typeof q=="function")return q(u);throw new Error(`Property ${f} is not a function`)}}):p[f]=B[f];return Object.defineProperty(this,t,{writable:!0,configurable:!0,enumerable:i.enumerable,value:p}),p},delete i.value,delete i.writable,i}function X(e,n,a){const t={...a};return t.get=function(){const i={...t};if(!t.value)return t.value;const c=t.value.bind(this);return i.value=()=>setTimeout(c,0),Object.defineProperty(this,n,i),i.value},t.configurable=!0,delete t.writable,delete t.value,t}function J(e,n){return!e||e<n[0]?n[0]:e>n[1]?n[1]:e}function O(e,n=0){const a=String(e).split("."),t=a.length>1?a[1].length:0;let r=e;for(let i=t-1;i>=n;i-=1)r=+`${Math.round(+`${r}e${i}`)}e-${i}`;return r}const Z=5,v=1024;function x(e,n=2){if(e>Number.MAX_SAFE_INTEGER)throw new Error("Number is greater than MAX_SAFE_INTEGER; toFileSizeString does not support orders of magnitude higher than petabytes for this reason until BigInt achieves broad browser support.");const a=Math.min(Math.floor(Math.log(e)/Math.log(v)),Z),t=["B","KB","MB","GB","TB","PB"][a],r=a?n:0;return O(e/v**a,r).toFixed(r)+t}function g(e){return typeof e=="string"?e.match(/[^.[\]]+/g)??[]:Array.isArray(e)?Array.from(e):[e]}function ee(e,n,a){const t=Object.getOwnPropertyDescriptor(n,e);t&&Object.defineProperty(a,e,t)}function l(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function P(e){Object.freeze(e);for(const n of Object.keys(e)){const a=e[n];(l(a)||Array.isArray(a))&&P(a)}}var E=(e=>(e[e.ADDITION=0]="ADDITION",e[e.DELETION=1]="DELETION",e[e.ALTERATION=2]="ALTERATION",e))(E||{});function T(e,n,a=[]){let t=[];for(const r of new Set([...Object.keys(e),...Object.keys(n)])){const i=Object.hasOwn(e,r),c=Object.hasOwn(n,r);i&&!c?t.push({type:1,key:r,parentPath:a,objects:[e,n]}):!i&&c?t.push({type:0,key:r,parentPath:a,objects:[e,n]}):l(e[r])&&l(n[r])||Array.isArray(e[r])&&Array.isArray(n[r])?t=t.concat(T(e[r],n[r],[...a,r])):e[r]!==n[r]&&t.push({type:2,key:r,parentPath:a,objects:[e,n]})}return t}function D(e,n){for(const a of Object.keys(e)){const t=e[a];l(t)||Array.isArray(t)?D(t,n):n(a,t,e)}}function M(e,n,a=[]){n(a,e);for(const t of Object.keys(e)){const r=e[t];if(l(r)||Array.isArray(r)){const i=a.concat(t);M(r,n,i)}}}function w(e){return e==null?!0:typeof e=="object"?Array.isArray(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:Object.keys(e).length===0:!1}function F(e){return e==null}function y(e,n,a,t=!1){if(w(n))return e;let r=e;for(const i of g(n)){let c=i,m;if(typeof i=="string"){const u=/^([^?]+)(\?)?$/.exec(i);u&&([,c,m]=u)}if(r=r[c],F(r)&&(m||t))return a}return F(r)?a:r}function ne(e,...n){const a=new Set(n),t={};for(const r of Object.keys(e))a.has(r)||(t[r]=e[r]);return t}function te(e,n,a){if(typeof e!="object")throw new Error("object is required");if(w(n))throw new Error("path is required");const t=g(n),r=t.splice(t.length-1,1)[0];let i=e;for(const c of t)if(i=i[c],typeof i!="object")throw new Error(`Cannot set value at given path: Path deadends at ${String(c)}`);i[r]=a}function*ae(e,n){yield e;let a=e;for(const t of g(n))a=a[t],yield a}function S(...e){const n={};for(const a of e)for(const t of Object.keys(a))Object.hasOwn(n,t)&&Object.getOwnPropertyDescriptor(n,t)?.writable!==void 0&&l(n[t])?n[t]=S(n[t],a[t]):l(a[t])?n[t]=S({},a[t]):n[t]=a[t];return n}const R=e=>{if(typeof e=="object"&&e!==null){if(typeof Object.getPrototypeOf=="function"){const n=Object.getPrototypeOf(e);return n===Object.prototype||n===null}return Object.prototype.toString.call(e)==="[object Object]"}return!1},s=(...e)=>e.reduce((n,a)=>{if(a===void 0)return n;if(Array.isArray(a))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(a).forEach(t=>{["__proto__","constructor","prototype"].includes(t)||(Array.isArray(n[t])&&Array.isArray(a[t])?n[t]=s.options.mergeArrays?s.options.uniqueArrayItems?Array.from(new Set(n[t].concat(a[t]))):[...n[t],...a[t]]:a[t]:R(n[t])&&R(a[t])?n[t]=s(n[t],a[t]):!R(n[t])&&R(a[t])?n[t]=s(a[t],void 0):n[t]=a[t]===void 0?s.options.allowUndefinedOverrides?a[t]:n[t]:a[t])}),n},{}),C={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};s.options=C,s.withOptions=(e,...n)=>{s.options=Object.assign(Object.assign({},C),e);const a=s(...n);return s.options=C,a};function re(e){const n=[];for(const a of Object.keys(e))n.push(e[a]);return n}function ie(e,...n){const a=e.reduce((r,i,c)=>`${r}${c<=n.length?String(n[c-1]):""}${i}`),t=Math.min(...a.split(/[\r\n]/).filter(r=>!!r.trim()).map(r=>{const i=/^ */.exec(r);return i?i[0].length:0}));return a.replace(new RegExp(`^ {${t}}`,"gm"),"").trim()}const oe=1024;function ce(e){const n=/[A-Z]?B$/.exec(e);if(!n)throw new Error(`Input to parseFileSize ("${e}") doesn't seem like a file size; cannot identify a unit (e.g. KB, GB)`);const[a]=n,t=Number(e.replace(a,""));if(Number.isNaN(t))throw new Error(`Could not parse a number out of input to parseFileSize ("${e}")`);const r=["B","KB","MB","GB","TB","PB"].indexOf(a);if(r===-1)throw new Error("parseFileSize does not support units above PB");return Math.ceil(t*oe**r)}const j=/(<%=|{{)(.+?)(%>|}})/g,N=/<%\?(.+?)%>(.+?)<\/%>/g,L=Symbol("sps.utils.templateSrc");function se(e){const n=a=>e.replace(N,(t,r,i)=>y(a,r.trim())?i:"").replace(j,(t,r,i)=>y(a,i.trim(),""));return n[L]=e,n}function me(e){return typeof e=="string"&&(j.test(e)||N.test(e))}function ue(e){return typeof e=="function"&&Object.hasOwn(e,L)}o.CustomEvent=W,o.DiffChange=E,o.EDI_DOCUMENT_TYPE=H,o.Op=h,o.castToNumber=$,o.code=ie,o.constrain=J,o.copyProperty=ee,o.crumblePath=g,o.debounce=I,o.debounced=K,o.decimalRound=O,o.deepFreeze=P,o.diff=T,o.flatten=d,o.forEachEntryDeep=D,o.forEachNestedObject=M,o.getPath=y,o.isSubset=_,o.isTemplate=me,o.isTemplateFn=ue,o.lockToAnimationFrames=b,o.lockedToAnimationFrames=Y,o.mergeDeep=S,o.mergePropertiesDeep=s,o.omit=ne,o.onNextTick=G,o.parseFileSize=ce,o.range=z,o.setPath=te,o.simpleMetadataDecoratorApplicator=Q,o.template=se,o.tickDelay=X,o.toFileSizeString=x,o.traversePath=ae,o.values=re,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spscommerce/utils",
3
3
  "description": "Utility items for frontend projects.",
4
- "version": "8.0.1",
4
+ "version": "8.1.1",
5
5
  "author": "SPS Commerce",
6
6
  "license": "UNLICENSED",
7
7
  "repository": "https://github.com/spscommerce/design-system/tree/main/packages/@spscommerce/utils",
@@ -11,19 +11,19 @@
11
11
  "module": "./lib/index.js",
12
12
  "types": "./lib/index.d.ts",
13
13
  "exports": {
14
+ "types": "./lib/index.d.ts",
14
15
  "require": "./lib/index.umd.cjs",
15
16
  "import": "./lib/index.js",
16
- "default": "./lib/index.js",
17
- "types": "./lib/index.d.ts"
17
+ "default": "./lib/index.js"
18
18
  },
19
19
  "publishConfig": {
20
20
  "access": "public"
21
21
  },
22
22
  "devDependencies": {
23
- "raf-stub": "^2.0.2"
23
+ "raf-stub": "^3.0.0"
24
24
  },
25
25
  "dependencies": {
26
- "ts-deepmerge": "^7.0.2"
26
+ "ts-deepmerge": "^7.0.3"
27
27
  },
28
28
  "scripts": {
29
29
  "build": "pnpm run build:js && pnpm run build:types",