@justifi/webcomponents 0.0.11 → 0.0.12

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.
Files changed (35) hide show
  1. package/dist/cjs/{index-68222998.js → index-4f753ffd.js} +32 -1
  2. package/dist/cjs/justifi-bank-account-form_4.cjs.entry.js +69 -61
  3. package/dist/cjs/loader.cjs.js +4 -3
  4. package/dist/cjs/webcomponents.cjs.js +7 -3
  5. package/dist/collection/collection-manifest.json +2 -2
  6. package/dist/collection/components/bank-account-form/bank-account-form.js +43 -45
  7. package/dist/collection/components/card-form/card-form.js +43 -55
  8. package/dist/collection/components/payment-method-form/message-event-types.js +12 -0
  9. package/dist/collection/components/payment-method-form/payment-method-form.js +68 -73
  10. package/dist/components/index.d.ts +9 -0
  11. package/dist/components/index.js +1 -1
  12. package/dist/components/justifi-bank-account-form.js +16 -13
  13. package/dist/components/justifi-card-form.js +16 -16
  14. package/dist/components/payment-method-form.js +48 -39
  15. package/dist/esm/{index-e279d85e.js → index-3d88d85c.js} +32 -2
  16. package/dist/esm/justifi-bank-account-form_4.entry.js +69 -61
  17. package/dist/esm/loader.js +4 -3
  18. package/dist/esm/polyfills/css-shim.js +1 -1
  19. package/dist/esm/webcomponents.js +4 -3
  20. package/dist/types/api/Api.d.ts +1 -1
  21. package/dist/types/api/Payment.d.ts +1 -1
  22. package/dist/types/components/bank-account-form/bank-account-form.d.ts +10 -5
  23. package/dist/types/components/card-form/card-form.d.ts +10 -5
  24. package/dist/types/components/payment-method-form/message-event-types.d.ts +12 -0
  25. package/dist/types/components/payment-method-form/payment-method-form.d.ts +5 -4
  26. package/dist/types/components.d.ts +13 -12
  27. package/dist/types/stencil-public-runtime.d.ts +48 -3
  28. package/dist/webcomponents/p-8ad58e9a.entry.js +1 -0
  29. package/dist/webcomponents/p-de108437.js +2 -0
  30. package/dist/webcomponents/webcomponents.esm.js +1 -1
  31. package/loader/index.d.ts +9 -0
  32. package/package.json +1 -1
  33. package/dist/collection/components/card-form/card-form.css +0 -3
  34. package/dist/webcomponents/p-146348d6.js +0 -2
  35. package/dist/webcomponents/p-a967d55b.entry.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as t,c as n,h as e,H as r}from"./p-de108437.js";const i=class{constructor(e){t(this,e),this.bankAccountFormReady=n(this,"bankAccountFormReady",7),this.bankAccountFormTokenize=n(this,"bankAccountFormTokenize",7),this.bankAccountFormValidate=n(this,"bankAccountFormValidate",7),this.validationStrategy=void 0}readyHandler(t){this.bankAccountFormReady.emit(t)}tokenizeHandler(t){this.bankAccountFormTokenize.emit(t)}validateHandler(t){this.bankAccountFormValidate.emit(t)}async tokenize(...t){if(!this.childRef)throw new Error("Cannot call tokenize");return this.childRef.tokenize(...t)}async validate(){if(!this.childRef)throw new Error("Cannot call validate");return this.childRef.validate()}render(){return e("justifi-payment-method-form",{ref:t=>{t&&(this.childRef=t)},"payment-method-form-type":"bankAccount","payment-method-form-ready":this.bankAccountFormReady,"payment-method-form-tokenize":this.bankAccountFormTokenize,"payment-method-form-validation-strategy":this.validationStrategy||"onSubmit"})}},o=class{constructor(e){t(this,e),this.cardFormReady=n(this,"cardFormReady",7),this.cardFormTokenize=n(this,"cardFormTokenize",7),this.cardFormValidate=n(this,"cardFormValidate",7),this.validationStrategy=void 0}readyHandler(t){this.cardFormReady.emit(t)}tokenizeHandler(t){this.cardFormTokenize.emit(t)}validateHandler(t){this.cardFormValidate.emit(t)}async tokenize(...t){if(!this.childRef)throw new Error("Cannot call tokenize");return this.childRef.tokenize(...t)}async validate(){if(!this.childRef)throw new Error("Cannot call validate");return this.childRef.validate()}render(){return e("justifi-payment-method-form",{ref:t=>{t&&(this.childRef=t)},"payment-method-form-type":"card","payment-method-form-ready":this.cardFormReady,"payment-method-form-tokenize":this.cardFormTokenize,"payment-method-form-validation-strategy":this.validationStrategy||"onSubmit"})}},a={card:{ready:"justifi.card.ready",tokenize:"justifi.card.tokenize",validate:"justifi.card.validate"},bankAccount:{ready:"justifi.bank_account.ready",tokenize:"justifi.bank_account.tokenize",validate:"justifi.bank_account.validate"}},u=class{constructor(e){t(this,e),this.paymentMethodFormReady=n(this,"paymentMethodFormReady",7),this.paymentMethodFormTokenize=n(this,"paymentMethodFormTokenize",7),this.paymentMethodFormType=void 0,this.paymentMethodFormValidationStrategy=void 0}connectedCallback(){window.addEventListener("message",this.dispatchMessageEvent.bind(this))}disconnectedCallback(){window.removeEventListener("message",this.dispatchMessageEvent.bind(this))}dispatchMessageEvent(t){const n=t.data;n.eventType===a[this.paymentMethodFormType].ready&&this.paymentMethodFormReady.emit(n.data)}async postMessageWithResponseListener(t,n){return new Promise((e=>{const r=n=>{n.data.eventType===t&&(window.removeEventListener("message",r),e(n.data.data))};window.addEventListener("message",r),this.iframeElement.contentWindow.postMessage(Object.assign({eventType:t},n),"*")}))}async tokenize(t,n,e){return this.postMessageWithResponseListener(a[this.paymentMethodFormType].tokenize,{clientKey:t,paymentMethodMetadata:n,account:e})}async validate(){return this.postMessageWithResponseListener(a[this.paymentMethodFormType].validate)}getIframeSrc(){let t=`https://js.justifi.ai/v2/${this.paymentMethodFormType}`;return this.paymentMethodFormValidationStrategy&&(t+=`?validationStrategy=${this.paymentMethodFormValidationStrategy}`),t}render(){return e(r,null,e("iframe",{id:`justifi-payment-method-form-${this.paymentMethodFormType}`,src:this.getIframeSrc(),ref:t=>this.iframeElement=t}))}};let s;u.style=":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}";const c=new Uint8Array(16);function d(){if(!s&&(s="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!s))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return s(c)}const h=[];for(let t=0;t<256;++t)h.push((t+256).toString(16).slice(1));const f={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function l(t,n,e){if(f.randomUUID&&!n&&!t)return f.randomUUID();const r=(t=t||{}).random||(t.rng||d)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,n){e=e||0;for(let t=0;t<16;++t)n[e+t]=r[t];return n}return function(t,n=0){return(h[t[n+0]]+h[t[n+1]]+h[t[n+2]]+h[t[n+3]]+"-"+h[t[n+4]]+h[t[n+5]]+"-"+h[t[n+6]]+h[t[n+7]]+"-"+h[t[n+8]]+h[t[n+9]]+"-"+h[t[n+10]]+h[t[n+11]]+h[t[n+12]]+h[t[n+13]]+h[t[n+14]]+h[t[n+15]]).toLowerCase()}(r)}var m,v,y,w;!function(t){t.automatic="automatic",t.manual="manual"}(m||(m={})),function(t){t.card="card",t.bankAccount="bank_account"}(v||(v={})),function(t){t.pending="pending",t.authorized="authorized",t.succeeded="succeeded",t.failed="failed",t.disputed="disputed",t.fully_refunded="fully_refunded",t.partially_refunded="partially_refunded"}(y||(y={})),function(t){t.lost="lost",t.open="open"}(w||(w={}));class g{constructor(t){this.id=t.id,this.account_id=t.account_id,this.amount=t.amount,this.amount_disputed=t.amount_disputed,this.amount_refundable=t.amount_refundable,this.amount_refunded=t.amount_refunded,this.balance=t.balance,this.captured=t.captured,this.capture_strategy=t.capture_strategy,this.currency=t.currency,this.description=t.description,this.disputed=t.disputed,this.disputes=t.disputes,this.error_code=t.error_code,this.error_description=t.error_description,this.fee_amount=t.fee_amount,this.is_test=t.is_test,this.metadata=t.metadata,this.payment_method=t.payment_method,this.payment_intent_id=t.payment_intent_id,this.refunded=t.refunded,this.status=t.status,this.created_at=t.created_at,this.updated_at=t.updated_at}get disputedStatus(){const t=this.disputes.some((t=>t.status===w.lost));return this.disputed?t?w.lost:w.open:null}}function b(t){if(null===t||!0===t||!1===t)return NaN;var n=Number(t);return isNaN(n)?n:n<0?Math.ceil(n):Math.floor(n)}function p(t,n){if(n.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+n.length+" present")}function M(t){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(t)}function S(t){p(1,arguments);var n=Object.prototype.toString.call(t);return t instanceof Date||"object"===M(t)&&"[object Date]"===n?new Date(t.getTime()):"number"==typeof t||"[object Number]"===n?new Date(t):("string"!=typeof t&&"[object String]"!==n||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function E(t,n){p(2,arguments);var e=S(t).getTime(),r=b(n);return new Date(e+r)}var k={};function D(){return k}function j(t){var n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),t.getTime()-n.getTime()}function x(t){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x(t)}function P(t){return p(1,arguments),t instanceof Date||"object"===x(t)&&"[object Date]"===Object.prototype.toString.call(t)}function A(t){if(p(1,arguments),!P(t)&&"number"!=typeof t)return!1;var n=S(t);return!isNaN(Number(n))}function O(t,n){p(2,arguments);var e=b(n);return E(t,-e)}var T=864e5;function W(t){p(1,arguments);var n=1,e=S(t),r=e.getUTCDay(),i=(r<n?7:0)+r-n;return e.setUTCDate(e.getUTCDate()-i),e.setUTCHours(0,0,0,0),e}function F(t){p(1,arguments);var n=S(t),e=n.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(e+1,0,4),r.setUTCHours(0,0,0,0);var i=W(r),o=new Date(0);o.setUTCFullYear(e,0,4),o.setUTCHours(0,0,0,0);var a=W(o);return n.getTime()>=i.getTime()?e+1:n.getTime()>=a.getTime()?e:e-1}function z(t){p(1,arguments);var n=F(t),e=new Date(0);e.setUTCFullYear(n,0,4),e.setUTCHours(0,0,0,0);var r=W(e);return r}var Y=6048e5;function R(t,n){var e,r,i,o,a,u,s,c;p(1,arguments);var d=D(),h=b(null!==(e=null!==(r=null!==(i=null!==(o=null==n?void 0:n.weekStartsOn)&&void 0!==o?o:null==n||null===(a=n.locale)||void 0===a||null===(u=a.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==i?i:d.weekStartsOn)&&void 0!==r?r:null===(s=d.locale)||void 0===s||null===(c=s.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==e?e:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=S(t),l=f.getUTCDay(),m=(l<h?7:0)+l-h;return f.setUTCDate(f.getUTCDate()-m),f.setUTCHours(0,0,0,0),f}function q(t,n){var e,r,i,o,a,u,s,c;p(1,arguments);var d=S(t),h=d.getUTCFullYear(),f=D(),l=b(null!==(e=null!==(r=null!==(i=null!==(o=null==n?void 0:n.firstWeekContainsDate)&&void 0!==o?o:null==n||null===(a=n.locale)||void 0===a||null===(u=a.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==i?i:f.firstWeekContainsDate)&&void 0!==r?r:null===(s=f.locale)||void 0===s||null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==e?e:1);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(h+1,0,l),m.setUTCHours(0,0,0,0);var v=R(m,n),y=new Date(0);y.setUTCFullYear(h,0,l),y.setUTCHours(0,0,0,0);var w=R(y,n);return d.getTime()>=v.getTime()?h+1:d.getTime()>=w.getTime()?h:h-1}function L(t,n){var e,r,i,o,a,u,s,c;p(1,arguments);var d=D(),h=b(null!==(e=null!==(r=null!==(i=null!==(o=null==n?void 0:n.firstWeekContainsDate)&&void 0!==o?o:null==n||null===(a=n.locale)||void 0===a||null===(u=a.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==i?i:d.firstWeekContainsDate)&&void 0!==r?r:null===(s=d.locale)||void 0===s||null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==e?e:1),f=q(t,n),l=new Date(0);l.setUTCFullYear(f,0,h),l.setUTCHours(0,0,0,0);var m=R(l,n);return m}var N=6048e5;function _(t,n){for(var e=t<0?"-":"",r=Math.abs(t).toString();r.length<n;)r="0"+r;return e+r}var C={G:function(t,n,e){var r=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return e.era(r,{width:"abbreviated"});case"GGGGG":return e.era(r,{width:"narrow"});default:return e.era(r,{width:"wide"})}},y:function(t,n,e){if("yo"===n){var r=t.getUTCFullYear();return e.ordinalNumber(r>0?r:1-r,{unit:"year"})}return function(t,n){var e=t.getUTCFullYear(),r=e>0?e:1-e;return _("yy"===n?r%100:r,n.length)}(t,n)},Y:function(t,n,e,r){var i=q(t,r),o=i>0?i:1-i;return"YY"===n?_(o%100,2):"Yo"===n?e.ordinalNumber(o,{unit:"year"}):_(o,n.length)},R:function(t,n){return _(F(t),n.length)},u:function(t,n){return _(t.getUTCFullYear(),n.length)},Q:function(t,n,e){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return _(r,2);case"Qo":return e.ordinalNumber(r,{unit:"quarter"});case"QQQ":return e.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(r,{width:"narrow",context:"formatting"});default:return e.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,n,e){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return _(r,2);case"qo":return e.ordinalNumber(r,{unit:"quarter"});case"qqq":return e.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(r,{width:"narrow",context:"standalone"});default:return e.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,n,e){var r=t.getUTCMonth();switch(n){case"M":case"MM":return function(t,n){var e=t.getUTCMonth();return"M"===n?String(e+1):_(e+1,2)}(t,n);case"Mo":return e.ordinalNumber(r+1,{unit:"month"});case"MMM":return e.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(r,{width:"narrow",context:"formatting"});default:return e.month(r,{width:"wide",context:"formatting"})}},L:function(t,n,e){var r=t.getUTCMonth();switch(n){case"L":return String(r+1);case"LL":return _(r+1,2);case"Lo":return e.ordinalNumber(r+1,{unit:"month"});case"LLL":return e.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(r,{width:"narrow",context:"standalone"});default:return e.month(r,{width:"wide",context:"standalone"})}},w:function(t,n,e,r){var i=function(t,n){p(1,arguments);var e=S(t),r=R(e,n).getTime()-L(e,n).getTime();return Math.round(r/N)+1}(t,r);return"wo"===n?e.ordinalNumber(i,{unit:"week"}):_(i,n.length)},I:function(t,n,e){var r=function(t){p(1,arguments);var n=S(t),e=W(n).getTime()-z(n).getTime();return Math.round(e/Y)+1}(t);return"Io"===n?e.ordinalNumber(r,{unit:"week"}):_(r,n.length)},d:function(t,n,e){return"do"===n?e.ordinalNumber(t.getUTCDate(),{unit:"date"}):function(t,n){return _(t.getUTCDate(),n.length)}(t,n)},D:function(t,n,e){var r=function(t){p(1,arguments);var n=S(t),e=n.getTime();n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0);var r=n.getTime();return Math.floor((e-r)/T)+1}(t);return"Do"===n?e.ordinalNumber(r,{unit:"dayOfYear"}):_(r,n.length)},E:function(t,n,e){var r=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return e.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},e:function(t,n,e,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return _(o,2);case"eo":return e.ordinalNumber(o,{unit:"day"});case"eee":return e.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,e,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return _(o,n.length);case"co":return e.ordinalNumber(o,{unit:"day"});case"ccc":return e.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(i,{width:"narrow",context:"standalone"});case"cccccc":return e.day(i,{width:"short",context:"standalone"});default:return e.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,e){var r=t.getUTCDay(),i=0===r?7:r;switch(n){case"i":return String(i);case"ii":return _(i,n.length);case"io":return e.ordinalNumber(i,{unit:"day"});case"iii":return e.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},a:function(t,n,e){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,n,e){var r,i=t.getUTCHours();switch(r=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",n){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,n,e){var r,i=t.getUTCHours();switch(r=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",n){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,n,e){if("ho"===n){var r=t.getUTCHours()%12;return 0===r&&(r=12),e.ordinalNumber(r,{unit:"hour"})}return function(t,n){return _(t.getUTCHours()%12||12,n.length)}(t,n)},H:function(t,n,e){return"Ho"===n?e.ordinalNumber(t.getUTCHours(),{unit:"hour"}):function(t,n){return _(t.getUTCHours(),n.length)}(t,n)},K:function(t,n,e){var r=t.getUTCHours()%12;return"Ko"===n?e.ordinalNumber(r,{unit:"hour"}):_(r,n.length)},k:function(t,n,e){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===n?e.ordinalNumber(r,{unit:"hour"}):_(r,n.length)},m:function(t,n,e){return"mo"===n?e.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):function(t,n){return _(t.getUTCMinutes(),n.length)}(t,n)},s:function(t,n,e){return"so"===n?e.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):function(t,n){return _(t.getUTCSeconds(),n.length)}(t,n)},S:function(t,n){return function(t,n){var e=n.length,r=t.getUTCMilliseconds();return _(Math.floor(r*Math.pow(10,e-3)),n.length)}(t,n)},X:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(n){case"X":return G(i);case"XXXX":case"XX":return U(i);default:return U(i,":")}},x:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();switch(n){case"x":return G(i);case"xxxx":case"xx":return U(i);default:return U(i,":")}},O:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+H(i,":");default:return"GMT"+U(i,":")}},z:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+H(i,":");default:return"GMT"+U(i,":")}},t:function(t,n,e,r){return _(Math.floor((r._originalDate||t).getTime()/1e3),n.length)},T:function(t,n,e,r){return _((r._originalDate||t).getTime(),n.length)}};function H(t,n){var e=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),o=r%60;if(0===o)return e+String(i);var a=n||"";return e+String(i)+a+_(o,2)}function G(t,n){return t%60==0?(t>0?"-":"+")+_(Math.abs(t)/60,2):U(t,n)}function U(t,n){var e=n||"",r=t>0?"-":"+",i=Math.abs(t);return r+_(Math.floor(i/60),2)+e+_(i%60,2)}var $=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});default:return n.date({width:"full"})}},Q=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});default:return n.time({width:"full"})}},B={p:Q,P:function(t,n){var e,r=t.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return $(t,n);switch(i){case"P":e=n.dateTime({width:"short"});break;case"PP":e=n.dateTime({width:"medium"});break;case"PPP":e=n.dateTime({width:"long"});break;default:e=n.dateTime({width:"full"})}return e.replace("{{date}}",$(i,n)).replace("{{time}}",Q(o,n))}},X=["D","DD"],I=["YY","YYYY"];function J(t){return-1!==X.indexOf(t)}function V(t){return-1!==I.indexOf(t)}function Z(t,n,e){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(n,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(n,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(n,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(n,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var K={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function tt(t){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=n.width?String(n.width):t.defaultWidth,r=t.formats[e]||t.formats[t.defaultWidth];return r}}var nt={date:tt({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:tt({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:tt({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},et={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function rt(t){return function(n,e){var r;if("formatting"===(null!=e&&e.context?String(e.context):"standalone")&&t.formattingValues){var i=t.defaultFormattingWidth||t.defaultWidth,o=null!=e&&e.width?String(e.width):i;r=t.formattingValues[o]||t.formattingValues[i]}else{var a=t.defaultWidth,u=null!=e&&e.width?String(e.width):t.defaultWidth;r=t.values[u]||t.values[a]}return r[t.argumentCallback?t.argumentCallback(n):n]}}function it(t){return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=n.match(i);if(!o)return null;var a,u=o[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(s)?at(s,(function(t){return t.test(u)})):ot(s,(function(t){return t.test(u)}));a=t.valueCallback?t.valueCallback(c):c,a=e.valueCallback?e.valueCallback(a):a;var d=n.slice(u.length);return{value:a,rest:d}}}function ot(t,n){for(var e in t)if(t.hasOwnProperty(e)&&n(t[e]))return e}function at(t,n){for(var e=0;e<t.length;e++)if(n(t[e]))return e}var ut,st={code:"en-US",formatDistance:function(t,n,e){var r,i=K[t];return r="string"==typeof i?i:1===n?i.one:i.other.replace("{{count}}",n.toString()),null!=e&&e.addSuffix?e.comparison&&e.comparison>0?"in "+r:r+" ago":r},formatLong:nt,formatRelative:function(t){return et[t]},localize:{ordinalNumber:function(t){var n=Number(t),e=n%100;if(e>20||e<10)switch(e%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:rt({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:rt({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:rt({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:rt({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:rt({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(ut={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.match(ut.matchPattern);if(!e)return null;var r=e[0],i=t.match(ut.parsePattern);if(!i)return null;var o=ut.valueCallback?ut.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;var a=t.slice(r.length);return{value:o,rest:a}}),era:it({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:it({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:it({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:it({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:it({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},ct=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ht=/^'([^]*?)'?$/,ft=/''/g,lt=/[a-zA-Z]/;function mt(t,n,e){var r,i,o,a,u,s,c,d,h,f,l,m,v,y,w,g,M,E;p(2,arguments);var k=String(n),x=D(),P=null!==(r=null!==(i=null==e?void 0:e.locale)&&void 0!==i?i:x.locale)&&void 0!==r?r:st,T=b(null!==(o=null!==(a=null!==(u=null!==(s=null==e?void 0:e.firstWeekContainsDate)&&void 0!==s?s:null==e||null===(c=e.locale)||void 0===c||null===(d=c.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==u?u:x.firstWeekContainsDate)&&void 0!==a?a:null===(h=x.locale)||void 0===h||null===(f=h.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==o?o:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var W=b(null!==(l=null!==(m=null!==(v=null!==(y=null==e?void 0:e.weekStartsOn)&&void 0!==y?y:null==e||null===(w=e.locale)||void 0===w||null===(g=w.options)||void 0===g?void 0:g.weekStartsOn)&&void 0!==v?v:x.weekStartsOn)&&void 0!==m?m:null===(M=x.locale)||void 0===M||null===(E=M.options)||void 0===E?void 0:E.weekStartsOn)&&void 0!==l?l:0);if(!(W>=0&&W<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!P.localize)throw new RangeError("locale must contain localize property");if(!P.formatLong)throw new RangeError("locale must contain formatLong property");var F=S(t);if(!A(F))throw new RangeError("Invalid time value");var z=j(F),Y=O(F,z),R={firstWeekContainsDate:T,weekStartsOn:W,locale:P,_originalDate:F},q=k.match(dt).map((function(t){var n=t[0];return"p"===n||"P"===n?(0,B[n])(t,P.formatLong):t})).join("").match(ct).map((function(r){if("''"===r)return"'";var i=r[0];if("'"===i)return vt(r);var o=C[i];if(o)return null!=e&&e.useAdditionalWeekYearTokens||!V(r)||Z(r,n,String(t)),null!=e&&e.useAdditionalDayOfYearTokens||!J(r)||Z(r,n,String(t)),o(Y,r,P.localize,R);if(i.match(lt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");return r})).join("");return q}function vt(t){var n=t.match(ht);return n?n[1].replace(ft,"'"):t}function yt(t){return yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yt(t)}function wt(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return gt(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?gt(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gt(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}var bt={normalizePrecision:function(t){var n=t.reduce((function(t,n){return Math.max(t.getPrecision(),n.getPrecision())}));return t.map((function(t){return t.getPrecision()!==n?t.convertPrecision(n):t}))},minimum:function(t){var n=wt(t),e=n[0],r=n.slice(1),i=e;return r.forEach((function(t){i=i.lessThan(t)?i:t})),i},maximum:function(t){var n=wt(t),e=n[0],r=n.slice(1),i=e;return r.forEach((function(t){i=i.greaterThan(t)?i:t})),i}};function pt(t){return!isNaN(parseInt(t))&&isFinite(t)}function Mt(t){return t%2==0}function St(t){return pt(t)&&!Number.isInteger(t)}function Et(t){return Math.abs(t)%1==.5}function kt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var e in n)t.setRequestHeader(e,n[e]);return t}function Dt(t){return void 0===t}function jt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",e={};return Object.entries(t).forEach((function(t){if("object"===yt(t[1])){var r=jt(t[1]);Object.entries(r).forEach((function(r){e[t[0]+n+r[0]]=r[1]}))}else e[t[0]]=t[1]})),e}function xt(){var t={HALF_ODD:function(t){var n=Math.round(t);return Et(t)&&Mt(n)?n-1:n},HALF_EVEN:function(t){var n=Math.round(t);return Et(t)?Mt(n)?n:n-1:n},HALF_UP:function(t){return Math.round(t)},HALF_DOWN:function(t){return Et(t)?Math.floor(t):Math.round(t)},HALF_TOWARDS_ZERO:function(t){return Et(t)?Math.sign(t)*Math.floor(Math.abs(t)):Math.round(t)},HALF_AWAY_FROM_ZERO:function(t){return Et(t)?Math.sign(t)*Math.ceil(Math.abs(t)):Math.round(t)},DOWN:function(t){return Math.floor(t)}};return{add:function(t,n){return t+n},subtract:function(t,n){return t-n},multiply:function(t,n){return St(t)||St(n)?function(t,n){var e=function(t){return Math.pow(10,function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0).toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var n=t.split(".")[1];return n?n.length:0}(t))},r=Math.max(e(t),e(n));return Math.round(t*r)*Math.round(n*r)/(r*r)}(t,n):t*n},divide:function(t,n){return t/n},modulo:function(t,n){return t%n},round:function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HALF_EVEN";return t[e](n)}}}var Pt=xt();function At(t){var n=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(t);return{getMatches:function(){return null!==n?n.slice(1).filter((function(t){return!Dt(t)})):[]},getMinimumFractionDigits:function(){var t=function(t){return"."===t};return Dt(this.getMatches().find(t))?0:this.getMatches()[Pt.add(this.getMatches().findIndex(t),1)].split("").length},getCurrencyDisplay:function(){return{USD:"code",dollar:"name",$:"symbol"}[this.getMatches().find((function(t){return"USD"===t||"dollar"===t||"$"===t}))]},getStyle:function(){return Dt(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Dt(this.getMatches().find((function(t){return","===t})))}}}function Ot(t){var n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;for(var e in n)t=t.replace("{{".concat(e,"}}"),n[e]);return t};return{getExchangeRate:function(e,r){return(i=t.endpoint,!Boolean(i)||"object"!==yt(i)&&"function"!=typeof i||"function"!=typeof i.then?function(e,r){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(e,r){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===i.readyState&&(i.status>=200&&i.status<400?e(JSON.parse(i.responseText)):r(new Error(i.statusText)))},onerror:function(){r(new Error("Network error"))}});i.open("GET",t,!0),kt(i,n.headers),i.send()}))}(n(t.endpoint,{from:e,to:r}),{headers:t.headers})}(e,r):t.endpoint).then((function(i){return jt(i)[n(t.propertyPath,{from:e,to:r})]}));var i}}}function Tt(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!t)throw new e(n)}function Wt(t){Tt(function(t){return pt(t)&&t<=100&&t>=0}(t),"You must provide a numeric value between 0 and 100.",RangeError)}function Ft(t){Tt(Number.isInteger(t),"You must provide an integer.",TypeError)}var zt=xt(),Yt=Object.assign((function t(n){var e=Object.assign({},{amount:t.defaultAmount,currency:t.defaultCurrency,precision:t.defaultPrecision},n),r=e.amount,i=e.currency,o=e.precision;Ft(r),Ft(o);var a=t.globalLocale,u=t.globalFormat,s=t.globalRoundingMode,c=t.globalFormatRoundingMode,d=Object.assign({},t.globalExchangeRatesApi),h=function(n){var e=Object.assign({},Object.assign({},{amount:r,currency:i,precision:o},n),Object.assign({},{locale:this.locale},n));return Object.assign(t({amount:e.amount,currency:e.currency,precision:e.precision}),{locale:e.locale})},f=function(t){Tt(this.hasSameCurrency(t),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return i},getLocale:function(){return this.locale||a},setLocale:function(t){return h.call(this,{locale:t})},getPrecision:function(){return o},convertPrecision:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;Ft(t);var e=this.getPrecision(),r=t>e,i=r?zt.multiply:zt.divide,o=r?[t,e]:[e,t],a=Math.pow(10,zt.subtract.apply(zt,o));return h.call(this,{amount:zt.round(i(this.getAmount(),a),n),precision:t})},add:function(n){f.call(this,n);var e=t.normalizePrecision([this,n]);return h.call(this,{amount:zt.add(e[0].getAmount(),e[1].getAmount()),precision:e[0].getPrecision()})},subtract:function(n){f.call(this,n);var e=t.normalizePrecision([this,n]);return h.call(this,{amount:zt.subtract(e[0].getAmount(),e[1].getAmount()),precision:e[0].getPrecision()})},multiply:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return h.call(this,{amount:zt.round(zt.multiply(this.getAmount(),t),n)})},divide:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return h.call(this,{amount:zt.round(zt.divide(this.getAmount(),t),n)})},percentage:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return Wt(t),this.multiply(zt.divide(t,100),n)},allocate:function(t){var n=this;!function(t){Tt(function(t){return t.length>0&&t.every((function(t){return t>=0}))&&t.some((function(t){return t>0}))}(t),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}(t);for(var e=t.reduce((function(t,n){return zt.add(t,n)})),r=this.getAmount(),i=t.map((function(t){var i=Math.floor(zt.divide(zt.multiply(n.getAmount(),t),e));return r=zt.subtract(r,i),h.call(n,{amount:i})})),o=0;r>0;)t[o]>0&&(i[o]=i[o].add(h.call(this,{amount:1})),r=zt.subtract(r,1)),o+=1;return i},convert:function(t){var n=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.endpoint,i=void 0===r?d.endpoint:r,o=e.propertyPath,a=void 0===o?d.propertyPath||"rates.{{to}}":o,u=e.headers,c=void 0===u?d.headers:u,f=e.roundingMode,l=void 0===f?s:f,m=Object.assign({},{endpoint:i,propertyPath:a,headers:c,roundingMode:l});return Ot(m).getExchangeRate(this.getCurrency(),t).then((function(e){return Tt(!Dt(e),'No rate was found for the destination currency "'.concat(t,'".'),TypeError),h.call(n,{amount:zt.round(zt.multiply(n.getAmount(),parseFloat(e)),m.roundingMode),currency:t})}))},equalsTo:function(t){return this.hasSameAmount(t)&&this.hasSameCurrency(t)},lessThan:function(n){f.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()<e[1].getAmount()},lessThanOrEqual:function(n){f.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()<=e[1].getAmount()},greaterThan:function(n){f.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()>e[1].getAmount()},greaterThanOrEqual:function(n){f.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()>=e[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return 0!==zt.modulo(this.getAmount(),Math.pow(10,o))},hasCents:function(){return 0!==zt.modulo(this.getAmount(),Math.pow(10,o))},hasSameCurrency:function(t){return this.getCurrency()===t.getCurrency()},hasSameAmount:function(n){var e=t.normalizePrecision([this,n]);return e[0].getAmount()===e[1].getAmount()},toFormat:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,e=At(t);return this.toRoundedUnit(e.getMinimumFractionDigits(),n).toLocaleString(this.getLocale(),{currencyDisplay:e.getCurrencyDisplay(),useGrouping:e.getUseGrouping(),minimumFractionDigits:e.getMinimumFractionDigits(),style:e.getStyle(),currency:this.getCurrency()})},toUnit:function(){return zt.divide(this.getAmount(),Math.pow(10,o))},toRoundedUnit:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,e=Math.pow(10,t);return zt.divide(zt.round(zt.multiply(this.toUnit(),e),n),e)},toObject:function(){return{amount:r,currency:i,precision:o}},toJSON:function(){return this.toObject()}}}),{defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},{globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}},bt);const Rt=class{constructor(n){t(this,n),this.accountId=void 0,this.auth={},this.payments=[]}requestPropsChanged(){this.fetchData()}fetchData(){const t=`account/${this.accountId}/payments`;(t=>{async function n(){return{Authorization:`Bearer ${t}`,"Idempotency-Key":l(),"Content-Type":"application/json"}}async function e(t,e,r,i,o){const a=`http://localhost:3000/v1/${t}`,u=r?`${a}?${new URLSearchParams(r)}`:a,s=await fetch(u,{method:e,headers:await n(),body:i,signal:o});if(s)return 204===s.status?{}:s.json();!function(t){console.error(`Error fetching from ${t}`)}(u)}return{get:async function(t,n,r){return e(t,"GET",n,null,r)},post:async function(t,n,r,i){return e(t,"POST",r,n,i)},patch:async function(t,n,r,i){return e(t,"PATCH",r,n,i)},destroy:async function(t,n,r){return e(t,"DELETE",n,null,r)}}})(this.auth.token).get(t).then((t=>{const n=t.data.map((t=>new g(t)));this.payments=n}))}render(){return e(r,null,e("table",{class:"justifi-table"},e("thead",null,e("tr",null,e("th",{scope:"col",title:"The date and time each payment was made"},"Made on"),e("th",{scope:"col",title:"The dollar amount of each payment"},"Amount"),e("th",{scope:"col"},"Account"),e("th",{scope:"col"},"Description"),e("th",{scope:"col"},"Payment ID"),e("th",{scope:"col"},"Cardholder"),e("th",{scope:"col"},"Payment Method"),e("th",{scope:"col"},"Status"))),e("tbody",null,this.payments.map((t=>{var n,r,i,o,a;e("tr",null,e("td",null,e("div",null,(a=t.created_at)?mt(new Date(a),"MMM d, yyyy"):""),e("div",null,function(t){return t?mt(new Date(t),"h:mmaaa"):""}(t.created_at))),e("td",null,function(t,n=!0){function e(t){const e=n?"$0,0.00":"0,0.00";return Yt({amount:t,currency:"USD"}).toFormat(e)}return t||(t=0),t<0?`(${e(-t)})`:e(t)}(t.amount)),e("td",null,t.account_id),e("td",null,t.description),e("td",null,t.id),e("td",null,null===(r=null===(n=t.payment_method)||void 0===n?void 0:n.card)||void 0===r?void 0:r.name),e("td",null,null===(o=null===(i=t.payment_method)||void 0===i?void 0:i.card)||void 0===o?void 0:o.acct_last_four),e("td",null,t.status))})))))}static get watchers(){return{accountId:["requestPropsChanged"],auth:["requestPropsChanged"]}}};Rt.style=":host{display:block}";export{i as justifi_bank_account_form,o as justifi_card_form,u as justifi_payment_method_form,Rt as justifi_payments_list}
@@ -0,0 +1,2 @@
1
+ let e,n,t=!1;const l={},o=e=>"object"==(e=typeof e)||"function"===e;function s(e){var n,t,l;return null!==(l=null===(t=null===(n=e.head)||void 0===n?void 0:n.querySelector('meta[name="csp-nonce"]'))||void 0===t?void 0:t.getAttribute("content"))&&void 0!==l?l:void 0}const c=(e,n,...t)=>{let l=null,s=!1,c=!1;const r=[],u=n=>{for(let t=0;t<n.length;t++)l=n[t],Array.isArray(l)?u(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!o(l))&&(l+=""),s&&c?r[r.length-1].t+=l:r.push(s?i(null,l):l),c=s)};if(u(t),n){const e=n.className||n.class;e&&(n.class="object"!=typeof e?e:Object.keys(e).filter((n=>e[n])).join(" "))}const a=i(e,null);return a.l=n,r.length>0&&(a.o=r),a},i=(e,n)=>({i:0,u:e,t:n,h:null,o:null,l:null}),r={},u=(e,n,t)=>{const l=(e=>V(e).m)(e);return{emit:e=>a(l,n,{bubbles:!!(4&t),composed:!!(2&t),cancelable:!!(1&t),detail:e})}},a=(e,n,t)=>{const l=X.ce(n,t);return e.dispatchEvent(l),l},f=new WeakMap,d=e=>"sc-"+e.$,h=(e,n,t,l,s,c)=>{if(t!==l){let i=B(e,n);if(n.toLowerCase(),"class"===n){const n=e.classList,o=y(t),s=y(l);n.remove(...o.filter((e=>e&&!s.includes(e)))),n.add(...s.filter((e=>e&&!o.includes(e))))}else if("ref"===n)l&&l(e);else{const r=o(l);if((i||r&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[n]=l;else{const o=null==l?"":l;"list"===n?i=!1:null!=t&&e[n]==o||(e[n]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(n)||e.removeAttribute(n):(!i||4&c||s)&&!r&&e.setAttribute(n,l=!0===l?"":l)}}},m=/\s/,y=e=>e?e.split(m):[],$=(e,n,t,o)=>{const s=11===n.h.nodeType&&n.h.host?n.h.host:n.h,c=e&&e.l||l,i=n.l||l;for(o in c)o in i||h(s,o,c[o],void 0,t,n.i);for(o in i)h(s,o,c[o],i[o],t,n.i)},p=(n,t,l)=>{const o=t.o[l];let s,c,i=0;if(null!==o.t)s=o.h=Q.createTextNode(o.t);else if(s=o.h=Q.createElement(o.u),$(null,o,!1),null!=e&&s["s-si"]!==e&&s.classList.add(s["s-si"]=e),o.o)for(i=0;i<o.o.length;++i)c=p(n,o,i),c&&s.appendChild(c);return s},b=(e,t,l,o,s,c)=>{let i,r=e;for(r.shadowRoot&&r.tagName===n&&(r=r.shadowRoot);s<=c;++s)o[s]&&(i=p(null,l,s),i&&(o[s].h=i,r.insertBefore(i,t)))},w=(e,n,t,l,o)=>{for(;n<=t;++n)(l=e[n])&&(o=l.h,g(l),o.remove())},v=(e,n)=>e.u===n.u,S=(e,n)=>{const t=n.h=e.h,l=e.o,o=n.o,s=n.t;null===s?($(e,n,!1),null!==l&&null!==o?((e,n,t,l)=>{let o,s=0,c=0,i=n.length-1,r=n[0],u=n[i],a=l.length-1,f=l[0],d=l[a];for(;s<=i&&c<=a;)null==r?r=n[++s]:null==u?u=n[--i]:null==f?f=l[++c]:null==d?d=l[--a]:v(r,f)?(S(r,f),r=n[++s],f=l[++c]):v(u,d)?(S(u,d),u=n[--i],d=l[--a]):v(r,d)?(S(r,d),e.insertBefore(r.h,u.h.nextSibling),r=n[++s],d=l[--a]):v(u,f)?(S(u,f),e.insertBefore(u.h,r.h),u=n[--i],f=l[++c]):(o=p(n&&n[c],t,c),f=l[++c],o&&r.h.parentNode.insertBefore(o,r.h));s>i?b(e,null==l[a+1]?null:l[a+1].h,t,l,c,a):c>a&&w(n,s,i)})(t,l,n,o):null!==o?(null!==e.t&&(t.textContent=""),b(t,null,n,o,0,o.length-1)):null!==l&&w(l,0,l.length-1)):e.t!==s&&(t.data=s)},g=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(g)},j=(e,n)=>{n&&!e.p&&n["s-p"]&&n["s-p"].push(new Promise((n=>e.p=n)))},k=(e,n)=>{if(e.i|=16,!(4&e.i))return j(e,e.v),ce((()=>C(e,n)));e.i|=512},C=(e,n)=>{const t=e.S;return n&&(e.i|=256,e.g&&(e.g.map((([e,n])=>E(t,e,n))),e.g=null)),N(void 0,(()=>M(e,t,n)))},M=async(e,n,t)=>{const l=e.m,o=l["s-rc"];t&&(e=>{const n=e.j,t=e.m,l=n.i,o=((e,n)=>{var t;let l=d(n);const o=J.get(l);if(e=11===e.nodeType?e:Q,o)if("string"==typeof o){let n,c=f.get(e=e.head||e);if(c||f.set(e,c=new Set),!c.has(l)){{n=Q.createElement("style"),n.innerHTML=o;const l=null!==(t=X.k)&&void 0!==t?t:s(Q);null!=l&&n.setAttribute("nonce",l),e.insertBefore(n,e.querySelector("link"))}c&&c.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(t.shadowRoot?t.shadowRoot:t.getRootNode(),n);10&l&&(t["s-sc"]=o,t.classList.add(o+"-h"))})(e);O(e,n),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const n=l["s-p"],t=()=>P(e);0===n.length?t():(Promise.all(n).then(t),e.i|=4,n.length=0)}},O=(t,l)=>{try{l=l.render(),t.i&=-17,t.i|=2,((t,l)=>{const o=t.m,s=t.C||i(null,null),u=(e=>e&&e.u===r)(l)?l:c(null,null,l);n=o.tagName,u.u=null,u.i|=4,t.C=u,u.h=s.h=o.shadowRoot||o,e=o["s-sc"],S(s,u)})(t,l)}catch(e){D(e,t.m)}return null},P=e=>{const n=e.m,t=e.v;64&e.i||(e.i|=64,T(n),e.M(n),t||x()),e.O(n),e.p&&(e.p(),e.p=void 0),512&e.i&&se((()=>k(e,!1))),e.i&=-517},x=()=>{T(Q.documentElement),se((()=>a(K,"appload",{detail:{namespace:"webcomponents"}})))},E=(e,n,t)=>{if(e&&e[n])try{return e[n](t)}catch(e){D(e)}},N=(e,n)=>e&&e.then?e.then(n):n(),T=e=>e.classList.add("hydrated"),A=(e,n,t)=>{if(n.P){e.watchers&&(n.N=e.watchers);const l=Object.entries(n.P),s=e.prototype;if(l.map((([e,[l]])=>{31&l||2&t&&32&l?Object.defineProperty(s,e,{get(){return((e,n)=>V(this).T.get(n))(0,e)},set(t){((e,n,t,l)=>{const s=V(e),c=s.m,i=s.T.get(n),r=s.i,u=s.S;if(t=((e,n)=>null==e||o(e)?e:1&n?e+"":e)(t,l.P[n][0]),(!(8&r)||void 0===i)&&t!==i&&(!Number.isNaN(i)||!Number.isNaN(t))&&(s.T.set(n,t),u)){if(l.N&&128&r){const e=l.N[n];e&&e.map((e=>{try{u[e](t,i,n)}catch(e){D(e,c)}}))}2==(18&r)&&k(s,!1)}})(this,e,t,n)},configurable:!0,enumerable:!0}):1&t&&64&l&&Object.defineProperty(s,e,{value(...n){const t=V(this);return t.A.then((()=>t.S[e](...n)))}})})),1&t){const n=new Map;s.attributeChangedCallback=function(e,t,l){X.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,n])=>15&n[0])).map((([e,t])=>{const l=t[1]||e;return n.set(l,e),l}))}}return e},H=e=>{E(e,"connectedCallback")},L=(e,n={})=>{var t;const l=[],o=n.exclude||[],c=K.customElements,i=Q.head,r=i.querySelector("meta[charset]"),u=Q.createElement("style"),a=[];let f,h=!0;Object.assign(X,n),X.H=new URL(n.resourcesUrl||"./",Q.baseURI).href,e.map((e=>{e[1].map((n=>{const t={i:n[0],$:n[1],P:n[2],L:n[3]};t.P=n[2],t.L=n[3],t.N={};const s=t.$,i=class extends HTMLElement{constructor(e){super(e),z(e=this,t),1&t.i&&e.attachShadow({mode:"open"})}connectedCallback(){f&&(clearTimeout(f),f=null),h?a.push(this):X.jmp((()=>(e=>{if(0==(1&X.i)){const n=V(e),t=n.j,l=()=>{};if(1&n.i)R(e,n,t.L),H(n.S);else{n.i|=1;{let t=e;for(;t=t.parentNode||t.host;)if(t["s-p"]){j(n,n.v=t);break}}t.P&&Object.entries(t.P).map((([n,[t]])=>{if(31&t&&e.hasOwnProperty(n)){const t=e[n];delete e[n],e[n]=t}})),(async(e,n,t,l,o)=>{if(0==(32&n.i)){{if(n.i|=32,(o=I(t)).then){const e=()=>{};o=await o,e()}o.isProxied||(t.N=o.watchers,A(o,t,2),o.isProxied=!0);const e=()=>{};n.i|=8;try{new o(n)}catch(e){D(e)}n.i&=-9,n.i|=128,e(),H(n.S)}if(o.style){let e=o.style;const n=d(t);if(!J.has(n)){const l=()=>{};((e,n,t)=>{let l=J.get(e);Z&&t?(l=l||new CSSStyleSheet,"string"==typeof l?l=n:l.replaceSync(n)):l=n,J.set(e,l)})(n,e,!!(1&t.i)),l()}}}const s=n.v,c=()=>k(n,!0);s&&s["s-rc"]?s["s-rc"].push(c):c()})(0,n,t)}l()}})(this)))}disconnectedCallback(){X.jmp((()=>(()=>{if(0==(1&X.i)){const e=V(this),n=e.S;e.R&&(e.R.map((e=>e())),e.R=void 0),E(n,"disconnectedCallback")}})()))}componentOnReady(){return V(this).U}};t.W=e[0],o.includes(s)||c.get(s)||(l.push(s),c.define(s,A(i,t,1)))}))}));{u.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",u.setAttribute("data-styles","");const e=null!==(t=X.k)&&void 0!==t?t:s(Q);null!=e&&u.setAttribute("nonce",e),i.insertBefore(u,r?r.nextSibling:i.firstChild)}h=!1,a.length?a.map((e=>e.connectedCallback())):X.jmp((()=>f=setTimeout(x,30)))},R=(e,n,t)=>{t&&t.map((([t,l,o])=>{const s=e,c=U(n,o),i=W(t);X.ael(s,l,c,i),(n.R=n.R||[]).push((()=>X.rel(s,l,c,i)))}))},U=(e,n)=>t=>{try{256&e.i?e.S[n](t):(e.g=e.g||[]).push([n,t])}catch(e){D(e)}},W=e=>0!=(2&e),q=e=>X.k=e,F=new WeakMap,V=e=>F.get(e),_=(e,n)=>F.set(n.S=e,n),z=(e,n)=>{const t={i:0,m:e,j:n,T:new Map};return t.A=new Promise((e=>t.O=e)),t.U=new Promise((e=>t.M=e)),e["s-p"]=[],e["s-rc"]=[],R(e,t,n.L),F.set(e,t)},B=(e,n)=>n in e,D=(e,n)=>(0,console.error)(e,n),G=new Map,I=e=>{const n=e.$.replace(/-/g,"_"),t=e.W,l=G.get(t);return l?l[n]:import(`./${t}.entry.js`).then((e=>(G.set(t,e),e[n])),D)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},J=new Map,K="undefined"!=typeof window?window:{},Q=K.document||{head:{}},X={i:0,H:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,n,t,l)=>e.addEventListener(n,t,l),rel:(e,n,t,l)=>e.removeEventListener(n,t,l),ce:(e,n)=>new CustomEvent(e,n)},Y=e=>Promise.resolve(e),Z=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),ee=[],ne=[],te=(e,n)=>l=>{e.push(l),t||(t=!0,n&&4&X.i?se(oe):X.raf(oe))},le=e=>{for(let n=0;n<e.length;n++)try{e[n](performance.now())}catch(e){D(e)}e.length=0},oe=()=>{le(ee),le(ne),(t=ee.length>0)&&X.raf(oe)},se=e=>Y().then(e),ce=te(ne,!0);export{r as H,L as b,u as c,c as h,Y as p,_ as r,q as s}
@@ -1 +1 @@
1
- import{p as e,b as n}from"./p-146348d6.js";(()=>{const n=import.meta.url,r={};return""!==n&&(r.resourcesUrl=new URL(".",n).href),e(r)})().then((e=>n([["p-a967d55b",[[0,"justifi-bank-account-form",{iframeOrigin:[1,"iframe-origin"],tokenize:[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormChange","changeHandler"],[0,"paymentMethodFormBlur","blurHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"]]],[0,"justifi-card-form",{iframeOrigin:[1,"iframe-origin"],tokenize:[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormChange","changeHandler"],[0,"paymentMethodFormBlur","blurHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"]]],[1,"justifi-payments-list",{accountId:[1,"account-id"],auth:[16],payments:[32]}],[0,"justifi-payment-method-form",{iframeOrigin:[1,"iframe-origin"],tokenize:[64]}]]]],e)));
1
+ import{p as e,b as t}from"./p-de108437.js";export{s as setNonce}from"./p-de108437.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t([["p-8ad58e9a",[[0,"justifi-bank-account-form",{validationStrategy:[1,"validation-strategy"],tokenize:[64],validate:[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]],[0,"justifi-card-form",{validationStrategy:[1,"validation-strategy"],tokenize:[64],validate:[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]],[1,"justifi-payments-list",{accountId:[1,"account-id"],auth:[16],payments:[32]}],[0,"justifi-payment-method-form",{paymentMethodFormType:[1,"payment-method-form-type"],paymentMethodFormValidationStrategy:[1,"payment-method-form-validation-strategy"],tokenize:[64],validate:[64]}]]]],e)));
package/loader/index.d.ts CHANGED
@@ -10,3 +10,12 @@ export interface CustomElementsDefineOptions {
10
10
  }
11
11
  export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): Promise<void>;
12
12
  export declare function applyPolyfills(): Promise<void>;
13
+
14
+ /**
15
+ * Used to specify a nonce value that corresponds with an application's CSP.
16
+ * When set, the nonce will be added to all dynamically created script and style tags at runtime.
17
+ * Alternatively, the nonce value can be set on a meta tag in the DOM head
18
+ * (<meta name="csp-nonce" content="{ nonce value here }" />) which
19
+ * will result in the same behavior.
20
+ */
21
+ export declare function setNonce(nonce: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justifi/webcomponents",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "JustiFi Web Components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1,3 +0,0 @@
1
- justifi-card-form iframe {
2
- height: 55px;
3
- }
@@ -1,2 +0,0 @@
1
- let e,t,n=!1;const l={},s=e=>"object"==(e=typeof e)||"function"===e,o=(e,t,...n)=>{let l=null,o=!1,r=!1;const i=[],u=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?u(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!s(l))&&(l+=""),o&&r?i[i.length-1].t+=l:i.push(o?c(null,l):l),r=o)};if(u(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const a=c(e,null);return a.l=t,i.length>0&&(a.o=i),a},c=(e,t)=>({i:0,u:e,t,h:null,o:null,l:null}),r={},i=(e,t,n)=>{const l=(e=>q(e).$)(e);return{emit:e=>u(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},u=(e,t,n)=>{const l=K.ce(t,n);return e.dispatchEvent(l),l},a=new WeakMap,f=e=>"sc-"+e.m,h=(e,t,n,l,o,c)=>{if(n!==l){let r=_(e,t);if(t.toLowerCase(),"class"===t){const t=e.classList,s=y(n),o=y(l);t.remove(...s.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!s.includes(e))))}else if("ref"===t)l&&l(e);else{const i=s(l);if((r||i&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const s=null==l?"":l;"list"===t?r=!1:null!=n&&e[t]==s||(e[t]=s)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!r||4&c||o)&&!i&&e.setAttribute(t,l=!0===l?"":l)}}},d=/\s/,y=e=>e?e.split(d):[],$=(e,t,n,s)=>{const o=11===t.h.nodeType&&t.h.host?t.h.host:t.h,c=e&&e.l||l,r=t.l||l;for(s in c)s in r||h(o,s,c[s],void 0,n,t.i);for(s in r)h(o,s,c[s],r[s],n,t.i)},m=(t,n,l)=>{const s=n.o[l];let o,c,r=0;if(null!==s.t)o=s.h=J.createTextNode(s.t);else if(o=s.h=J.createElement(s.u),$(null,s,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),s.o)for(r=0;r<s.o.length;++r)c=m(t,s,r),c&&o.appendChild(c);return o},p=(e,n,l,s,o,c)=>{let r,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);o<=c;++o)s[o]&&(r=m(null,l,o),r&&(s[o].h=r,i.insertBefore(r,n)))},b=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.h,g(l),s.remove())},w=(e,t)=>e.u===t.u,S=(e,t)=>{const n=t.h=e.h,l=e.o,s=t.o,o=t.t;null===o?($(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,c=0,r=t.length-1,i=t[0],u=t[r],a=l.length-1,f=l[0],h=l[a];for(;o<=r&&c<=a;)null==i?i=t[++o]:null==u?u=t[--r]:null==f?f=l[++c]:null==h?h=l[--a]:w(i,f)?(S(i,f),i=t[++o],f=l[++c]):w(u,h)?(S(u,h),u=t[--r],h=l[--a]):w(i,h)?(S(i,h),e.insertBefore(i.h,u.h.nextSibling),i=t[++o],h=l[--a]):w(u,f)?(S(u,f),e.insertBefore(u.h,i.h),u=t[--r],f=l[++c]):(s=m(t&&t[c],n,c),f=l[++c],s&&i.h.parentNode.insertBefore(s,i.h));o>r?p(e,null==l[a+1]?null:l[a+1].h,n,l,c,a):c>a&&b(t,o,r)})(n,l,t,s):null!==s?(null!==e.t&&(n.textContent=""),p(n,null,t,s,0,s.length-1)):null!==l&&b(l,0,l.length-1)):e.t!==o&&(n.data=o)},g=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(g)},j=(e,t)=>{t&&!e.p&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.p=t)))},v=(e,t)=>{if(e.i|=16,!(4&e.i))return j(e,e.S),se((()=>k(e,t)));e.i|=512},k=(e,t)=>{const n=e.g;return t&&(e.i|=256,e.j&&(e.j.map((([e,t])=>x(n,e,t))),e.j=null)),E(void 0,(()=>C(e,n,t)))},C=async(e,t,n)=>{const l=e.$,s=l["s-rc"];n&&(e=>{const t=e.v,n=e.$,l=t.i,s=((e,t)=>{let n=f(t);const l=G.get(n);if(e=11===e.nodeType?e:J,l)if("string"==typeof l){let t,s=a.get(e=e.head||e);s||a.set(e,s=new Set),s.has(n)||(t=J.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),s&&s.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(e);M(e,t),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>O(e);0===t.length?n():(Promise.all(t).then(n),e.i|=4,t.length=0)}},M=(n,l)=>{try{l=l.render(),n.i&=-17,n.i|=2,((n,l)=>{const s=n.$,i=n.k||c(null,null),u=(e=>e&&e.u===r)(l)?l:o(null,null,l);t=s.tagName,u.u=null,u.i|=4,n.k=u,u.h=i.h=s.shadowRoot||s,e=s["s-sc"],S(i,u)})(n,l)}catch(e){z(e,n.$)}return null},O=e=>{const t=e.$,n=e.S;64&e.i||(e.i|=64,N(t),e.C(t),n||P()),e.M(t),e.p&&(e.p(),e.p=void 0),512&e.i&&le((()=>v(e,!1))),e.i&=-517},P=()=>{N(J.documentElement),le((()=>u(I,"appload",{detail:{namespace:"webcomponents"}})))},x=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){z(e)}},E=(e,t)=>e&&e.then?e.then(t):t(),N=e=>e.classList.add("hydrated"),T=(e,t,n)=>{if(t.O){e.watchers&&(t.P=e.watchers);const l=Object.entries(t.O),o=e.prototype;if(l.map((([e,[l]])=>{31&l||2&n&&32&l?Object.defineProperty(o,e,{get(){return((e,t)=>q(this).N.get(t))(0,e)},set(n){((e,t,n,l)=>{const o=q(e),c=o.$,r=o.N.get(t),i=o.i,u=o.g;if(n=((e,t)=>null==e||s(e)?e:1&t?e+"":e)(n,l.O[t][0]),(!(8&i)||void 0===r)&&n!==r&&(!Number.isNaN(r)||!Number.isNaN(n))&&(o.N.set(t,n),u)){if(l.P&&128&i){const e=l.P[t];e&&e.map((e=>{try{u[e](n,r,t)}catch(e){z(e,c)}}))}2==(18&i)&&v(o,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0}):1&n&&64&l&&Object.defineProperty(o,e,{value(...t){const n=q(this);return n.T.then((()=>n.g[e](...t)))}})})),1&n){const t=new Map;o.attributeChangedCallback=function(e,n,l){K.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(o.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))}}return e},A=e=>{x(e,"connectedCallback")},H=(e,t={})=>{const n=[],l=t.exclude||[],s=I.customElements,o=J.head,c=o.querySelector("meta[charset]"),r=J.createElement("style"),i=[];let u,a=!0;Object.assign(K,t),K.A=new URL(t.resourcesUrl||"./",J.baseURI).href,e.map((e=>{e[1].map((t=>{const o={i:t[0],m:t[1],O:t[2],H:t[3]};o.O=t[2],o.H=t[3],o.P={};const c=o.m,r=class extends HTMLElement{constructor(e){super(e),V(e=this,o),1&o.i&&e.attachShadow({mode:"open"})}connectedCallback(){u&&(clearTimeout(u),u=null),a?i.push(this):K.jmp((()=>(e=>{if(0==(1&K.i)){const t=q(e),n=t.v,l=()=>{};if(1&t.i)L(e,t,n.H),A(t.g);else{t.i|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){j(t,t.S=n);break}}n.O&&Object.entries(n.O).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.i)){{if(t.i|=32,(s=D(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(n.P=s.watchers,T(s,n,2),s.isProxied=!0);const e=()=>{};t.i|=8;try{new s(t)}catch(e){z(e)}t.i&=-9,t.i|=128,e(),A(t.g)}if(s.style){let e=s.style;const t=f(n);if(!G.has(t)){const l=()=>{};((e,t,n)=>{let l=G.get(e);X&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,G.set(e,l)})(t,e,!!(1&n.i)),l()}}}const o=t.S,c=()=>v(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(0,t,n)}l()}})(this)))}disconnectedCallback(){K.jmp((()=>(()=>{if(0==(1&K.i)){const e=q(this),t=e.g;e.L&&(e.L.map((e=>e())),e.L=void 0),x(t,"disconnectedCallback")}})()))}componentOnReady(){return q(this).R}};o.U=e[0],l.includes(c)||s.get(c)||(n.push(c),s.define(c,T(r,o,1)))}))})),r.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",r.setAttribute("data-styles",""),o.insertBefore(r,c?c.nextSibling:o.firstChild),a=!1,i.length?i.map((e=>e.connectedCallback())):K.jmp((()=>u=setTimeout(P,30)))},L=(e,t,n)=>{n&&n.map((([n,l,s])=>{const o=e,c=R(t,s),r=U(n);K.ael(o,l,c,r),(t.L=t.L||[]).push((()=>K.rel(o,l,c,r)))}))},R=(e,t)=>n=>{try{256&e.i?e.g[t](n):(e.j=e.j||[]).push([t,n])}catch(e){z(e)}},U=e=>0!=(2&e),W=new WeakMap,q=e=>W.get(e),F=(e,t)=>W.set(t.g=e,t),V=(e,t)=>{const n={i:0,$:e,v:t,N:new Map};return n.T=new Promise((e=>n.M=e)),n.R=new Promise((e=>n.C=e)),e["s-p"]=[],e["s-rc"]=[],L(e,n,t.H),W.set(e,n)},_=(e,t)=>t in e,z=(e,t)=>(0,console.error)(e,t),B=new Map,D=e=>{const t=e.m.replace(/-/g,"_"),n=e.U,l=B.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(B.set(n,e),e[t])),z)
2
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},G=new Map,I="undefined"!=typeof window?window:{},J=I.document||{head:{}},K={i:0,A:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},Q=e=>Promise.resolve(e),X=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),Y=[],Z=[],ee=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&K.i?le(ne):K.raf(ne))},te=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){z(e)}e.length=0},ne=()=>{te(Y),te(Z),(n=Y.length>0)&&K.raf(ne)},le=e=>Q().then(e),se=ee(Z,!0);export{r as H,H as b,i as c,o as h,Q as p,F as r}
@@ -1 +0,0 @@
1
- import{r as t,c as n,h as e,H as r}from"./p-146348d6.js";const i=class{constructor(e){t(this,e),this.bankAccountFormReady=n(this,"bankAccountFormReady",7),this.bankAccountFormChange=n(this,"bankAccountFormChange",7),this.bankAccountFormBlur=n(this,"bankAccountFormBlur",7),this.bankAccountFormTokenize=n(this,"bankAccountFormTokenize",7),this.iframeOrigin=void 0}readyHandler(t){this.bankAccountFormReady.emit(t)}changeHandler(t){this.bankAccountFormChange.emit(t)}blurHandler(t){this.bankAccountFormBlur.emit(t)}tokenizeHandler(t){this.bankAccountFormTokenize.emit(t)}async tokenize(...t){if(!this.childRef)throw new Error("Cannot call tokenize");return this.childRef.tokenize(...t)}render(){return e("justifi-payment-method-form",{ref:t=>{t&&(this.childRef=t)},"iframe-origin":this.iframeOrigin||"https://js.justifi.ai/bank-account","payment-method-form-ready":this.bankAccountFormReady,"payment-method-form-change":this.bankAccountFormChange,"payment-method-form-blur":this.bankAccountFormBlur,"payment-method-form-tokenize":this.bankAccountFormTokenize})}},o=class{constructor(e){t(this,e),this.cardFormReady=n(this,"cardFormReady",7),this.cardFormChange=n(this,"cardFormChange",7),this.cardFormBlur=n(this,"cardFormBlur",7),this.cardFormTokenize=n(this,"cardFormTokenize",7),this.iframeOrigin=void 0}readyHandler(t){this.cardFormReady.emit(t)}changeHandler(t){this.cardFormChange.emit(t)}blurHandler(t){this.cardFormBlur.emit(t)}tokenizeHandler(t){this.cardFormTokenize.emit(t)}async tokenize(...t){if(!this.childRef)throw new Error("Cannot call tokenize");return this.childRef.tokenize(...t)}render(){return e("justifi-payment-method-form",{ref:t=>{t&&(this.childRef=t)},"iframe-origin":this.iframeOrigin||"https://js.justifi.ai/card","payment-method-form-ready":this.cardFormReady,"payment-method-form-change":this.cardFormChange,"payment-method-form-blur":this.cardFormBlur,"payment-method-form-tokenize":this.cardFormTokenize})}};var a;o.style="justifi-card-form iframe{height:55px}",function(t){t.blur="blur",t.change="change",t.ready="ready",t.tokenize="tokenize"}(a||(a={}));const u=class{constructor(e){t(this,e),this.paymentMethodFormReady=n(this,"paymentMethodFormReady",7),this.paymentMethodFormChange=n(this,"paymentMethodFormChange",7),this.paymentMethodFormBlur=n(this,"paymentMethodFormBlur",7),this.paymentMethodFormTokenize=n(this,"paymentMethodFormTokenize",7),this.iframeOrigin=void 0}connectedCallback(){window.addEventListener("message",this.dispatchMessageEvent.bind(this))}disconnectedCallback(){window.removeEventListener("message",this.dispatchMessageEvent.bind(this))}dispatchMessageEvent(t){const n=t.data,e=n.data;switch(n.eventType){case a.ready:this.paymentMethodFormReady.emit(e);break;case a.change:this.paymentMethodFormChange.emit(e);break;case a.blur:this.paymentMethodFormBlur.emit(e)}}triggerTokenization(t,n,e){this.iframeElement&&this.iframeElement.contentWindow&&this.iframeElement.contentWindow.postMessage({eventType:a.tokenize,clientKey:t,paymentMethodMetadata:n,account:e},"*")}async tokenize(t,n,e){return new Promise((r=>{const i=t=>{t.data.eventType===a.tokenize&&(window.removeEventListener("message",i),r(t.data.data))};window.addEventListener("message",i),this.triggerTokenization(t,n,e)}))}render(){return e(r,null,e("iframe",{id:"justifi-payment-method-form",src:this.iframeOrigin,ref:t=>this.iframeElement=t}))}};let s;u.style=":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}";const c=new Uint8Array(16);function d(){if(!s&&(s="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!s))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return s(c)}const h=[];for(let t=0;t<256;++t)h.push((t+256).toString(16).slice(1));const f={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function l(t,n,e){if(f.randomUUID&&!n&&!t)return f.randomUUID();const r=(t=t||{}).random||(t.rng||d)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,n){e=e||0;for(let t=0;t<16;++t)n[e+t]=r[t];return n}return function(t,n=0){return(h[t[n+0]]+h[t[n+1]]+h[t[n+2]]+h[t[n+3]]+"-"+h[t[n+4]]+h[t[n+5]]+"-"+h[t[n+6]]+h[t[n+7]]+"-"+h[t[n+8]]+h[t[n+9]]+"-"+h[t[n+10]]+h[t[n+11]]+h[t[n+12]]+h[t[n+13]]+h[t[n+14]]+h[t[n+15]]).toLowerCase()}(r)}var m,v,y,w;!function(t){t.automatic="automatic",t.manual="manual"}(m||(m={})),function(t){t.card="card",t.bankAccount="bank_account"}(v||(v={})),function(t){t.pending="pending",t.authorized="authorized",t.succeeded="succeeded",t.failed="failed",t.disputed="disputed",t.fully_refunded="fully_refunded",t.partially_refunded="partially_refunded"}(y||(y={})),function(t){t.lost="lost",t.open="open"}(w||(w={}));class g{constructor(t){this.id=t.id,this.account_id=t.account_id,this.amount=t.amount,this.amount_disputed=t.amount_disputed,this.amount_refundable=t.amount_refundable,this.amount_refunded=t.amount_refunded,this.balance=t.balance,this.captured=t.captured,this.capture_strategy=t.capture_strategy,this.currency=t.currency,this.description=t.description,this.disputed=t.disputed,this.disputes=t.disputes,this.error_code=t.error_code,this.error_description=t.error_description,this.fee_amount=t.fee_amount,this.is_test=t.is_test,this.metadata=t.metadata,this.payment_method=t.payment_method,this.payment_intent_id=t.payment_intent_id,this.refunded=t.refunded,this.status=t.status,this.created_at=t.created_at,this.updated_at=t.updated_at}get disputedStatus(){const t=this.disputes.some((t=>t.status===w.lost));return this.disputed?t?w.lost:w.open:null}}function b(t){if(null===t||!0===t||!1===t)return NaN;var n=Number(t);return isNaN(n)?n:n<0?Math.ceil(n):Math.floor(n)}function p(t,n){if(n.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+n.length+" present")}function M(t){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function S(t){p(1,arguments);var n=Object.prototype.toString.call(t);return t instanceof Date||"object"===M(t)&&"[object Date]"===n?new Date(t.getTime()):"number"==typeof t||"[object Number]"===n?new Date(t):("string"!=typeof t&&"[object String]"!==n||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function E(t,n){p(2,arguments);var e=S(t).getTime(),r=b(n);return new Date(e+r)}var x={};function P(){return x}function D(t){var n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),t.getTime()-n.getTime()}function k(t){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function j(t){return p(1,arguments),t instanceof Date||"object"===k(t)&&"[object Date]"===Object.prototype.toString.call(t)}function O(t){if(p(1,arguments),!j(t)&&"number"!=typeof t)return!1;var n=S(t);return!isNaN(Number(n))}function A(t,n){p(2,arguments);var e=b(n);return E(t,-e)}function T(t){p(1,arguments);var n=1,e=S(t),r=e.getUTCDay(),i=(r<n?7:0)+r-n;return e.setUTCDate(e.getUTCDate()-i),e.setUTCHours(0,0,0,0),e}function F(t){p(1,arguments);var n=S(t),e=n.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(e+1,0,4),r.setUTCHours(0,0,0,0);var i=T(r),o=new Date(0);o.setUTCFullYear(e,0,4),o.setUTCHours(0,0,0,0);var a=T(o);return n.getTime()>=i.getTime()?e+1:n.getTime()>=a.getTime()?e:e-1}function q(t){p(1,arguments);var n=F(t),e=new Date(0);e.setUTCFullYear(n,0,4),e.setUTCHours(0,0,0,0);var r=T(e);return r}function z(t,n){var e,r,i,o,a,u,s,c;p(1,arguments);var d=P(),h=b(null!==(e=null!==(r=null!==(i=null!==(o=null==n?void 0:n.weekStartsOn)&&void 0!==o?o:null==n||null===(a=n.locale)||void 0===a||null===(u=a.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==i?i:d.weekStartsOn)&&void 0!==r?r:null===(s=d.locale)||void 0===s||null===(c=s.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==e?e:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=S(t),l=f.getUTCDay(),m=(l<h?7:0)+l-h;return f.setUTCDate(f.getUTCDate()-m),f.setUTCHours(0,0,0,0),f}function W(t,n){var e,r,i,o,a,u,s,c;p(1,arguments);var d=S(t),h=d.getUTCFullYear(),f=P(),l=b(null!==(e=null!==(r=null!==(i=null!==(o=null==n?void 0:n.firstWeekContainsDate)&&void 0!==o?o:null==n||null===(a=n.locale)||void 0===a||null===(u=a.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==i?i:f.firstWeekContainsDate)&&void 0!==r?r:null===(s=f.locale)||void 0===s||null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==e?e:1);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(h+1,0,l),m.setUTCHours(0,0,0,0);var v=z(m,n),y=new Date(0);y.setUTCFullYear(h,0,l),y.setUTCHours(0,0,0,0);var w=z(y,n);return d.getTime()>=v.getTime()?h+1:d.getTime()>=w.getTime()?h:h-1}function L(t,n){var e,r,i,o,a,u,s,c;p(1,arguments);var d=P(),h=b(null!==(e=null!==(r=null!==(i=null!==(o=null==n?void 0:n.firstWeekContainsDate)&&void 0!==o?o:null==n||null===(a=n.locale)||void 0===a||null===(u=a.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==i?i:d.firstWeekContainsDate)&&void 0!==r?r:null===(s=d.locale)||void 0===s||null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==e?e:1),f=W(t,n),l=new Date(0);l.setUTCFullYear(f,0,h),l.setUTCHours(0,0,0,0);var m=z(l,n);return m}function Y(t,n){for(var e=t<0?"-":"",r=Math.abs(t).toString();r.length<n;)r="0"+r;return e+r}var R={G:function(t,n,e){var r=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return e.era(r,{width:"abbreviated"});case"GGGGG":return e.era(r,{width:"narrow"});case"GGGG":default:return e.era(r,{width:"wide"})}},y:function(t,n,e){if("yo"===n){var r=t.getUTCFullYear();return e.ordinalNumber(r>0?r:1-r,{unit:"year"})}return function(t,n){var e=t.getUTCFullYear(),r=e>0?e:1-e;return Y("yy"===n?r%100:r,n.length)}(t,n)},Y:function(t,n,e,r){var i=W(t,r),o=i>0?i:1-i;return"YY"===n?Y(o%100,2):"Yo"===n?e.ordinalNumber(o,{unit:"year"}):Y(o,n.length)},R:function(t,n){return Y(F(t),n.length)},u:function(t,n){return Y(t.getUTCFullYear(),n.length)},Q:function(t,n,e){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return Y(r,2);case"Qo":return e.ordinalNumber(r,{unit:"quarter"});case"QQQ":return e.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,n,e){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return Y(r,2);case"qo":return e.ordinalNumber(r,{unit:"quarter"});case"qqq":return e.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,n,e){var r=t.getUTCMonth();switch(n){case"M":case"MM":return function(t,n){var e=t.getUTCMonth();return"M"===n?String(e+1):Y(e+1,2)}(t,n);case"Mo":return e.ordinalNumber(r+1,{unit:"month"});case"MMM":return e.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(r,{width:"wide",context:"formatting"})}},L:function(t,n,e){var r=t.getUTCMonth();switch(n){case"L":return String(r+1);case"LL":return Y(r+1,2);case"Lo":return e.ordinalNumber(r+1,{unit:"month"});case"LLL":return e.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(r,{width:"wide",context:"standalone"})}},w:function(t,n,e,r){var i=function(t,n){p(1,arguments);var e=S(t),r=z(e,n).getTime()-L(e,n).getTime();return Math.round(r/6048e5)+1}(t,r);return"wo"===n?e.ordinalNumber(i,{unit:"week"}):Y(i,n.length)},I:function(t,n,e){var r=function(t){p(1,arguments);var n=S(t),e=T(n).getTime()-q(n).getTime();return Math.round(e/6048e5)+1}(t);return"Io"===n?e.ordinalNumber(r,{unit:"week"}):Y(r,n.length)},d:function(t,n,e){return"do"===n?e.ordinalNumber(t.getUTCDate(),{unit:"date"}):function(t,n){return Y(t.getUTCDate(),n.length)}(t,n)},D:function(t,n,e){var r=function(t){p(1,arguments);var n=S(t),e=n.getTime();n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0);var r=n.getTime();return Math.floor((e-r)/864e5)+1}(t);return"Do"===n?e.ordinalNumber(r,{unit:"dayOfYear"}):Y(r,n.length)},E:function(t,n,e){var r=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return e.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(r,{width:"short",context:"formatting"});case"EEEE":default:return e.day(r,{width:"wide",context:"formatting"})}},e:function(t,n,e,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return Y(o,2);case"eo":return e.ordinalNumber(o,{unit:"day"});case"eee":return e.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(i,{width:"short",context:"formatting"});case"eeee":default:return e.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,e,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return Y(o,n.length);case"co":return e.ordinalNumber(o,{unit:"day"});case"ccc":return e.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(i,{width:"narrow",context:"standalone"});case"cccccc":return e.day(i,{width:"short",context:"standalone"});case"cccc":default:return e.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,e){var r=t.getUTCDay(),i=0===r?7:r;switch(n){case"i":return String(i);case"ii":return Y(i,n.length);case"io":return e.ordinalNumber(i,{unit:"day"});case"iii":return e.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(r,{width:"short",context:"formatting"});case"iiii":default:return e.day(r,{width:"wide",context:"formatting"})}},a:function(t,n,e){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,n,e){var r,i=t.getUTCHours();switch(r=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",n){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,n,e){var r,i=t.getUTCHours();switch(r=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",n){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,n,e){if("ho"===n){var r=t.getUTCHours()%12;return 0===r&&(r=12),e.ordinalNumber(r,{unit:"hour"})}return function(t,n){return Y(t.getUTCHours()%12||12,n.length)}(t,n)},H:function(t,n,e){return"Ho"===n?e.ordinalNumber(t.getUTCHours(),{unit:"hour"}):function(t,n){return Y(t.getUTCHours(),n.length)}(t,n)},K:function(t,n,e){var r=t.getUTCHours()%12;return"Ko"===n?e.ordinalNumber(r,{unit:"hour"}):Y(r,n.length)},k:function(t,n,e){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===n?e.ordinalNumber(r,{unit:"hour"}):Y(r,n.length)},m:function(t,n,e){return"mo"===n?e.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):function(t,n){return Y(t.getUTCMinutes(),n.length)}(t,n)},s:function(t,n,e){return"so"===n?e.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):function(t,n){return Y(t.getUTCSeconds(),n.length)}(t,n)},S:function(t,n){return function(t,n){var e=n.length,r=t.getUTCMilliseconds();return Y(Math.floor(r*Math.pow(10,e-3)),n.length)}(t,n)},X:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(n){case"X":return C(i);case"XXXX":case"XX":return _(i);case"XXXXX":case"XXX":default:return _(i,":")}},x:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();switch(n){case"x":return C(i);case"xxxx":case"xx":return _(i);case"xxxxx":case"xxx":default:return _(i,":")}},O:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+N(i,":");case"OOOO":default:return"GMT"+_(i,":")}},z:function(t,n,e,r){var i=(r._originalDate||t).getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+N(i,":");case"zzzz":default:return"GMT"+_(i,":")}},t:function(t,n,e,r){return Y(Math.floor((r._originalDate||t).getTime()/1e3),n.length)},T:function(t,n,e,r){return Y((r._originalDate||t).getTime(),n.length)}};function N(t,n){var e=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),o=r%60;if(0===o)return e+String(i);var a=n||"";return e+String(i)+a+Y(o,2)}function C(t,n){return t%60==0?(t>0?"-":"+")+Y(Math.abs(t)/60,2):_(t,n)}function _(t,n){var e=n||"",r=t>0?"-":"+",i=Math.abs(t);return r+Y(Math.floor(i/60),2)+e+Y(i%60,2)}var G=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},H=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},X={p:H,P:function(t,n){var e,r=t.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return G(t,n);switch(i){case"P":e=n.dateTime({width:"short"});break;case"PP":e=n.dateTime({width:"medium"});break;case"PPP":e=n.dateTime({width:"long"});break;case"PPPP":default:e=n.dateTime({width:"full"})}return e.replace("{{date}}",G(i,n)).replace("{{time}}",H(o,n))}},B=["D","DD"],Q=["YY","YYYY"];function U(t){return-1!==B.indexOf(t)}function $(t){return-1!==Q.indexOf(t)}function I(t,n,e){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(n,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(n,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(n,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(n,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var J={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Z(t){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=n.width?String(n.width):t.defaultWidth,r=t.formats[e]||t.formats[t.defaultWidth];return r}}var K={date:Z({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Z({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Z({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},V={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function tt(t){return function(n,e){var r;if("formatting"===(null!=e&&e.context?String(e.context):"standalone")&&t.formattingValues){var i=t.defaultFormattingWidth||t.defaultWidth,o=null!=e&&e.width?String(e.width):i;r=t.formattingValues[o]||t.formattingValues[i]}else{var a=t.defaultWidth,u=null!=e&&e.width?String(e.width):t.defaultWidth;r=t.values[u]||t.values[a]}return r[t.argumentCallback?t.argumentCallback(n):n]}}function nt(t){return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=n.match(i);if(!o)return null;var a,u=o[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(s)?rt(s,(function(t){return t.test(u)})):et(s,(function(t){return t.test(u)}));a=t.valueCallback?t.valueCallback(c):c,a=e.valueCallback?e.valueCallback(a):a;var d=n.slice(u.length);return{value:a,rest:d}}}function et(t,n){for(var e in t)if(t.hasOwnProperty(e)&&n(t[e]))return e}function rt(t,n){for(var e=0;e<t.length;e++)if(n(t[e]))return e}var it,ot={code:"en-US",formatDistance:function(t,n,e){var r,i=J[t];return r="string"==typeof i?i:1===n?i.one:i.other.replace("{{count}}",n.toString()),null!=e&&e.addSuffix?e.comparison&&e.comparison>0?"in "+r:r+" ago":r},formatLong:K,formatRelative:function(t){return V[t]},localize:{ordinalNumber:function(t){var n=Number(t),e=n%100;if(e>20||e<10)switch(e%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:tt({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:tt({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:tt({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:tt({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:tt({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(it={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.match(it.matchPattern);if(!e)return null;var r=e[0],i=t.match(it.parsePattern);if(!i)return null;var o=it.valueCallback?it.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;var a=t.slice(r.length);return{value:o,rest:a}}),era:nt({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:nt({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:nt({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:nt({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:nt({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},at=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ut=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,st=/^'([^]*?)'?$/,ct=/''/g,dt=/[a-zA-Z]/;function ht(t,n,e){var r,i,o,a,u,s,c,d,h,f,l,m,v,y,w,g,M,E;p(2,arguments);var x=String(n),k=P(),j=null!==(r=null!==(i=null==e?void 0:e.locale)&&void 0!==i?i:k.locale)&&void 0!==r?r:ot,T=b(null!==(o=null!==(a=null!==(u=null!==(s=null==e?void 0:e.firstWeekContainsDate)&&void 0!==s?s:null==e||null===(c=e.locale)||void 0===c||null===(d=c.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==u?u:k.firstWeekContainsDate)&&void 0!==a?a:null===(h=k.locale)||void 0===h||null===(f=h.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==o?o:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var F=b(null!==(l=null!==(m=null!==(v=null!==(y=null==e?void 0:e.weekStartsOn)&&void 0!==y?y:null==e||null===(w=e.locale)||void 0===w||null===(g=w.options)||void 0===g?void 0:g.weekStartsOn)&&void 0!==v?v:k.weekStartsOn)&&void 0!==m?m:null===(M=k.locale)||void 0===M||null===(E=M.options)||void 0===E?void 0:E.weekStartsOn)&&void 0!==l?l:0);if(!(F>=0&&F<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!j.localize)throw new RangeError("locale must contain localize property");if(!j.formatLong)throw new RangeError("locale must contain formatLong property");var q=S(t);if(!O(q))throw new RangeError("Invalid time value");var z=D(q),W=A(q,z),L={firstWeekContainsDate:T,weekStartsOn:F,locale:j,_originalDate:q},Y=x.match(ut).map((function(t){var n=t[0];return"p"===n||"P"===n?(0,X[n])(t,j.formatLong):t})).join("").match(at).map((function(r){if("''"===r)return"'";var i=r[0];if("'"===i)return ft(r);var o=R[i];if(o)return null!=e&&e.useAdditionalWeekYearTokens||!$(r)||I(r,n,String(t)),null!=e&&e.useAdditionalDayOfYearTokens||!U(r)||I(r,n,String(t)),o(W,r,j.localize,L);if(i.match(dt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");return r})).join("");return Y}function ft(t){var n=t.match(st);return n?n[1].replace(ct,"'"):t}function lt(t){return(lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mt(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return vt(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?vt(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vt(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}var yt={normalizePrecision:function(t){var n=t.reduce((function(t,n){return Math.max(t.getPrecision(),n.getPrecision())}));return t.map((function(t){return t.getPrecision()!==n?t.convertPrecision(n):t}))},minimum:function(t){var n=mt(t),e=n[0],r=n.slice(1),i=e;return r.forEach((function(t){i=i.lessThan(t)?i:t})),i},maximum:function(t){var n=mt(t),e=n[0],r=n.slice(1),i=e;return r.forEach((function(t){i=i.greaterThan(t)?i:t})),i}};function wt(t){return!isNaN(parseInt(t))&&isFinite(t)}function gt(t){return t%2==0}function bt(t){return wt(t)&&!Number.isInteger(t)}function pt(t){return Math.abs(t)%1==.5}function Mt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var e in n)t.setRequestHeader(e,n[e]);return t}function St(t){return void 0===t}function Et(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",e={};return Object.entries(t).forEach((function(t){if("object"===lt(t[1])){var r=Et(t[1]);Object.entries(r).forEach((function(r){e[t[0]+n+r[0]]=r[1]}))}else e[t[0]]=t[1]})),e}function xt(){var t={HALF_ODD:function(t){var n=Math.round(t);return pt(t)&&gt(n)?n-1:n},HALF_EVEN:function(t){var n=Math.round(t);return pt(t)?gt(n)?n:n-1:n},HALF_UP:function(t){return Math.round(t)},HALF_DOWN:function(t){return pt(t)?Math.floor(t):Math.round(t)},HALF_TOWARDS_ZERO:function(t){return pt(t)?Math.sign(t)*Math.floor(Math.abs(t)):Math.round(t)},HALF_AWAY_FROM_ZERO:function(t){return pt(t)?Math.sign(t)*Math.ceil(Math.abs(t)):Math.round(t)},DOWN:function(t){return Math.floor(t)}};return{add:function(t,n){return t+n},subtract:function(t,n){return t-n},multiply:function(t,n){return bt(t)||bt(n)?function(t,n){var e=function(t){return Math.pow(10,function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0).toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var n=t.split(".")[1];return n?n.length:0}(t))},r=Math.max(e(t),e(n));return Math.round(t*r)*Math.round(n*r)/(r*r)}(t,n):t*n},divide:function(t,n){return t/n},modulo:function(t,n){return t%n},round:function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HALF_EVEN";return t[e](n)}}}var Pt=xt();function Dt(t){var n=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(t);return{getMatches:function(){return null!==n?n.slice(1).filter((function(t){return!St(t)})):[]},getMinimumFractionDigits:function(){var t=function(t){return"."===t};return St(this.getMatches().find(t))?0:this.getMatches()[Pt.add(this.getMatches().findIndex(t),1)].split("").length},getCurrencyDisplay:function(){return{USD:"code",dollar:"name",$:"symbol"}[this.getMatches().find((function(t){return"USD"===t||"dollar"===t||"$"===t}))]},getStyle:function(){return St(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!St(this.getMatches().find((function(t){return","===t})))}}}function kt(t){var n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;for(var e in n)t=t.replace("{{".concat(e,"}}"),n[e]);return t};return{getExchangeRate:function(e,r){return(i=t.endpoint,!Boolean(i)||"object"!==lt(i)&&"function"!=typeof i||"function"!=typeof i.then?function(e,r){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(e,r){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===i.readyState&&(i.status>=200&&i.status<400?e(JSON.parse(i.responseText)):r(new Error(i.statusText)))},onerror:function(){r(new Error("Network error"))}});i.open("GET",t,!0),Mt(i,n.headers),i.send()}))}(n(t.endpoint,{from:e,to:r}),{headers:t.headers})}(e,r):t.endpoint).then((function(i){return Et(i)[n(t.propertyPath,{from:e,to:r})]}));var i}}}function jt(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!t)throw new e(n)}function Ot(t){jt(function(t){return wt(t)&&t<=100&&t>=0}(t),"You must provide a numeric value between 0 and 100.",RangeError)}function At(t){jt(Number.isInteger(t),"You must provide an integer.",TypeError)}var Tt=xt(),Ft=Object.assign((function t(n){var e=Object.assign({},{amount:t.defaultAmount,currency:t.defaultCurrency,precision:t.defaultPrecision},n),r=e.amount,i=e.currency,o=e.precision;At(r),At(o);var a=t.globalLocale,u=t.globalFormat,s=t.globalRoundingMode,c=t.globalFormatRoundingMode,d=Object.assign({},t.globalExchangeRatesApi),h=function(n){var e=Object.assign({},Object.assign({},{amount:r,currency:i,precision:o},n),Object.assign({},{locale:this.locale},n));return Object.assign(t({amount:e.amount,currency:e.currency,precision:e.precision}),{locale:e.locale})},f=function(t){jt(this.hasSameCurrency(t),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return i},getLocale:function(){return this.locale||a},setLocale:function(t){return h.call(this,{locale:t})},getPrecision:function(){return o},convertPrecision:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;At(t);var e=this.getPrecision(),r=t>e,i=r?Tt.multiply:Tt.divide,o=r?[t,e]:[e,t],a=Math.pow(10,Tt.subtract.apply(Tt,o));return h.call(this,{amount:Tt.round(i(this.getAmount(),a),n),precision:t})},add:function(n){f.call(this,n);var e=t.normalizePrecision([this,n]);return h.call(this,{amount:Tt.add(e[0].getAmount(),e[1].getAmount()),precision:e[0].getPrecision()})},subtract:function(n){f.call(this,n);var e=t.normalizePrecision([this,n]);return h.call(this,{amount:Tt.subtract(e[0].getAmount(),e[1].getAmount()),precision:e[0].getPrecision()})},multiply:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return h.call(this,{amount:Tt.round(Tt.multiply(this.getAmount(),t),n)})},divide:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return h.call(this,{amount:Tt.round(Tt.divide(this.getAmount(),t),n)})},percentage:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return Ot(t),this.multiply(Tt.divide(t,100),n)},allocate:function(t){var n=this;!function(t){jt(function(t){return t.length>0&&t.every((function(t){return t>=0}))&&t.some((function(t){return t>0}))}(t),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}(t);for(var e=t.reduce((function(t,n){return Tt.add(t,n)})),r=this.getAmount(),i=t.map((function(t){var i=Math.floor(Tt.divide(Tt.multiply(n.getAmount(),t),e));return r=Tt.subtract(r,i),h.call(n,{amount:i})})),o=0;r>0;)t[o]>0&&(i[o]=i[o].add(h.call(this,{amount:1})),r=Tt.subtract(r,1)),o+=1;return i},convert:function(t){var n=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.endpoint,i=void 0===r?d.endpoint:r,o=e.propertyPath,a=void 0===o?d.propertyPath||"rates.{{to}}":o,u=e.headers,c=void 0===u?d.headers:u,f=e.roundingMode,l=void 0===f?s:f,m=Object.assign({},{endpoint:i,propertyPath:a,headers:c,roundingMode:l});return kt(m).getExchangeRate(this.getCurrency(),t).then((function(e){return jt(!St(e),'No rate was found for the destination currency "'.concat(t,'".'),TypeError),h.call(n,{amount:Tt.round(Tt.multiply(n.getAmount(),parseFloat(e)),m.roundingMode),currency:t})}))},equalsTo:function(t){return this.hasSameAmount(t)&&this.hasSameCurrency(t)},lessThan:function(n){f.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()<e[1].getAmount()},lessThanOrEqual:function(n){f.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()<=e[1].getAmount()},greaterThan:function(n){f.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()>e[1].getAmount()},greaterThanOrEqual:function(n){f.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()>=e[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return 0!==Tt.modulo(this.getAmount(),Math.pow(10,o))},hasCents:function(){return 0!==Tt.modulo(this.getAmount(),Math.pow(10,o))},hasSameCurrency:function(t){return this.getCurrency()===t.getCurrency()},hasSameAmount:function(n){var e=t.normalizePrecision([this,n]);return e[0].getAmount()===e[1].getAmount()},toFormat:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,e=Dt(t);return this.toRoundedUnit(e.getMinimumFractionDigits(),n).toLocaleString(this.getLocale(),{currencyDisplay:e.getCurrencyDisplay(),useGrouping:e.getUseGrouping(),minimumFractionDigits:e.getMinimumFractionDigits(),style:e.getStyle(),currency:this.getCurrency()})},toUnit:function(){return Tt.divide(this.getAmount(),Math.pow(10,o))},toRoundedUnit:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,e=Math.pow(10,t);return Tt.divide(Tt.round(Tt.multiply(this.toUnit(),e),n),e)},toObject:function(){return{amount:r,currency:i,precision:o}},toJSON:function(){return this.toObject()}}}),{defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},{globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}},yt);const qt=class{constructor(n){t(this,n),this.accountId=void 0,this.auth={},this.payments=[]}requestPropsChanged(){this.fetchData()}fetchData(){const t=`account/${this.accountId}/payments`;(t=>{async function n(){return{Authorization:`Bearer ${t}`,"Idempotency-Key":l(),"Content-Type":"application/json"}}async function e(t,e,r,i,o){const a=`http://localhost:3000/v1/${t}`,u=r?`${a}?${new URLSearchParams(r)}`:a,s=await fetch(u,{method:e,headers:await n(),body:i,signal:o});if(s)return 204===s.status?{}:s.json();!function(t){console.error(`Error fetching from ${t}`)}(u)}return{get:async function(t,n,r){return e(t,"GET",n,null,r)},post:async function(t,n,r,i){return e(t,"POST",r,n,i)},patch:async function(t,n,r,i){return e(t,"PATCH",r,n,i)},destroy:async function(t,n,r){return e(t,"DELETE",n,null,r)}}})(this.auth.token).get(t).then((t=>{const n=t.data.map((t=>new g(t)));this.payments=n}))}render(){return e(r,null,e("table",{class:"justifi-table"},e("thead",null,e("tr",null,e("th",{scope:"col",title:"The date and time each payment was made"},"Made on"),e("th",{scope:"col",title:"The dollar amount of each payment"},"Amount"),e("th",{scope:"col"},"Account"),e("th",{scope:"col"},"Description"),e("th",{scope:"col"},"Payment ID"),e("th",{scope:"col"},"Cardholder"),e("th",{scope:"col"},"Payment Method"),e("th",{scope:"col"},"Status"))),e("tbody",null,this.payments.map((t=>{var n,r,i,o,a;e("tr",null,e("td",null,e("div",null,(a=t.created_at)?ht(new Date(a),"MMM d, yyyy"):""),e("div",null,function(t){return t?ht(new Date(t),"h:mmaaa"):""}(t.created_at))),e("td",null,function(t,n=!0){function e(t){const e=n?"$0,0.00":"0,0.00";return Ft({amount:t,currency:"USD"}).toFormat(e)}return t||(t=0),t<0?`(${e(-t)})`:e(t)}(t.amount)),e("td",null,t.account_id),e("td",null,t.description),e("td",null,t.id),e("td",null,null===(r=null===(n=t.payment_method)||void 0===n?void 0:n.card)||void 0===r?void 0:r.name),e("td",null,null===(o=null===(i=t.payment_method)||void 0===i?void 0:i.card)||void 0===o?void 0:o.acct_last_four),e("td",null,t.status))})))))}static get watchers(){return{accountId:["requestPropsChanged"],auth:["requestPropsChanged"]}}};qt.style=":host{display:block}";export{i as justifi_bank_account_form,o as justifi_card_form,u as justifi_payment_method_form,qt as justifi_payments_list}