@justifi/webcomponents 5.3.1 → 5.3.2

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 (91) hide show
  1. package/dist/cjs/bank-account-form_9.cjs.entry.js +2 -2
  2. package/dist/cjs/billing-form_3.cjs.entry.js +2 -2
  3. package/dist/cjs/{business-additional-questions-schema-2f66f025.js → business-additional-questions-schema-2cc0c6f7.js} +1 -1
  4. package/dist/cjs/{business-identity-schema-be495474.js → business-identity-schema-7d462eb3.js} +1 -1
  5. package/dist/cjs/{check-pkg-version-526a9ce5.js → check-pkg-version-fe4c6467.js} +1 -1
  6. package/dist/cjs/justifi-additional-questions-form-step-core_6.cjs.entry.js +3 -3
  7. package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
  8. package/dist/cjs/justifi-business-form.cjs.entry.js +5 -5
  9. package/dist/cjs/justifi-checkout.cjs.entry.js +2 -2
  10. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +2 -2
  11. package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
  12. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
  13. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
  14. package/dist/cjs/justifi-owner-form_3.cjs.entry.js +2 -2
  15. package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
  16. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
  17. package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
  18. package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
  19. package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
  20. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
  21. package/dist/cjs/justifi-terminals-list.cjs.entry.js +2 -2
  22. package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +18 -10
  23. package/dist/cjs/{package-45874555.js → package-8b04bef0.js} +1 -1
  24. package/dist/cjs/{schema-validations-cc4e6071.js → schema-validations-f948158d.js} +1 -1
  25. package/dist/collection/components/business-forms/schemas/schema-validations.js +1 -1
  26. package/dist/collection/components/checkout/bank-account-form/bank-account-form.js +1 -1
  27. package/dist/collection/components/checkout/card-form/card-form.js +1 -1
  28. package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +24 -18
  29. package/dist/docs.json +23 -18
  30. package/dist/esm/bank-account-form_9.entry.js +2 -2
  31. package/dist/esm/billing-form_3.entry.js +2 -2
  32. package/dist/esm/{business-additional-questions-schema-212a96ed.js → business-additional-questions-schema-60e9b76a.js} +1 -1
  33. package/dist/esm/{business-identity-schema-05bd2a5f.js → business-identity-schema-191d85c2.js} +1 -1
  34. package/dist/esm/{check-pkg-version-f91ed31f.js → check-pkg-version-e2273f4f.js} +1 -1
  35. package/dist/esm/justifi-additional-questions-form-step-core_6.entry.js +3 -3
  36. package/dist/esm/justifi-business-details.entry.js +2 -2
  37. package/dist/esm/justifi-business-form.entry.js +5 -5
  38. package/dist/esm/justifi-checkout.entry.js +2 -2
  39. package/dist/esm/justifi-checkouts-list.entry.js +2 -2
  40. package/dist/esm/justifi-dispute-management.entry.js +2 -2
  41. package/dist/esm/justifi-dispute-notification_3.entry.js +2 -2
  42. package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
  43. package/dist/esm/justifi-owner-form_3.entry.js +2 -2
  44. package/dist/esm/justifi-payment-details.entry.js +2 -2
  45. package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
  46. package/dist/esm/justifi-payments-list.entry.js +2 -2
  47. package/dist/esm/justifi-payout-details.entry.js +2 -2
  48. package/dist/esm/justifi-payouts-list.entry.js +2 -2
  49. package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
  50. package/dist/esm/justifi-terminals-list.entry.js +2 -2
  51. package/dist/esm/justifi-tokenize-payment-method.entry.js +18 -10
  52. package/dist/esm/{package-2b7c7bc0.js → package-a8e8f775.js} +1 -1
  53. package/dist/esm/{schema-validations-ccea6a06.js → schema-validations-38e8bc7b.js} +1 -1
  54. package/dist/module/bank-account-form2.js +1 -1
  55. package/dist/module/card-form2.js +1 -1
  56. package/dist/module/justifi-tokenize-payment-method.js +14 -8
  57. package/dist/module/package.js +1 -1
  58. package/dist/module/schema-validations.js +1 -1
  59. package/dist/types/components/tokenize-payment-method/tokenize-payment-method.d.ts +4 -3
  60. package/dist/types/components.d.ts +10 -12
  61. package/dist/webcomponents/p-02d36485.entry.js +1 -0
  62. package/dist/webcomponents/{p-d07c45e6.entry.js → p-1882d7d6.entry.js} +1 -1
  63. package/dist/webcomponents/{p-47a3003c.entry.js → p-25c9c88c.entry.js} +1 -1
  64. package/dist/webcomponents/{p-7542ebd6.entry.js → p-2710884e.entry.js} +1 -1
  65. package/dist/webcomponents/{p-de13f23c.js → p-27c8ffa2.js} +1 -1
  66. package/dist/webcomponents/{p-f28ddbe8.entry.js → p-39696abd.entry.js} +1 -1
  67. package/dist/webcomponents/{p-eae512f0.entry.js → p-40eabfca.entry.js} +1 -1
  68. package/dist/webcomponents/p-4810f227.entry.js +1 -0
  69. package/dist/webcomponents/{p-415deed1.entry.js → p-485814d8.entry.js} +1 -1
  70. package/dist/webcomponents/p-57206dc4.entry.js +1 -0
  71. package/dist/webcomponents/{p-ca361ef6.entry.js → p-63a8b08f.entry.js} +1 -1
  72. package/dist/webcomponents/{p-991df3a1.entry.js → p-67b75e01.entry.js} +1 -1
  73. package/dist/webcomponents/{p-8815bf82.entry.js → p-68bf1a1d.entry.js} +1 -1
  74. package/dist/webcomponents/{p-0277c1b2.js → p-849c68e5.js} +1 -1
  75. package/dist/webcomponents/{p-d91c46dc.js → p-933537ca.js} +1 -1
  76. package/dist/webcomponents/{p-189affee.entry.js → p-a47c14cb.entry.js} +1 -1
  77. package/dist/webcomponents/p-b01405ab.entry.js +1 -0
  78. package/dist/webcomponents/{p-c5c03d88.js → p-b0b40bcd.js} +1 -1
  79. package/dist/webcomponents/{p-4c820f81.js → p-b2edb944.js} +1 -1
  80. package/dist/webcomponents/{p-74014392.entry.js → p-c75481bf.entry.js} +1 -1
  81. package/dist/webcomponents/{p-ab254da1.entry.js → p-e22df884.entry.js} +1 -1
  82. package/dist/webcomponents/{p-31cbc05a.entry.js → p-e8d0f978.entry.js} +1 -1
  83. package/dist/webcomponents/p-fbe16023.entry.js +1 -0
  84. package/dist/webcomponents/{p-72ff0d5f.entry.js → p-ff955a18.entry.js} +1 -1
  85. package/dist/webcomponents/webcomponents.esm.js +1 -1
  86. package/package.json +1 -1
  87. package/dist/webcomponents/p-00c32bb9.entry.js +0 -1
  88. package/dist/webcomponents/p-778e9dd0.entry.js +0 -1
  89. package/dist/webcomponents/p-85b5eeb6.entry.js +0 -1
  90. package/dist/webcomponents/p-af66f580.entry.js +0 -1
  91. package/dist/webcomponents/p-ccd91d8a.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as e,h as n,H as t,g as i}from"./p-2783e363.js";import{c as o,F as a}from"./p-5844a0f0.js";import{u as r,l as s,k as c,m as d,n as f,q as l}from"./p-de13f23c.js";import{S as u}from"./p-6078a370.js";import{n as h}from"./p-e3c22aa9.js";import{F as m}from"./p-40e23b13.js";import{p as b}from"./p-4c820f81.js";import{a as w}from"./p-4cc3c7f9.js";import{i as p,b as g,a as y,c as v,l as k}from"./p-d8c04275.js";import"./p-0ea387a2.js";import"./p-275f2154.js";import"./p-1ff8810b.js";import"./p-61f0a2ce.js";import"./p-f20b6ce1.js";const x=o({name:r.required("Enter full name"),address_line1:s.required("Enter street address"),address_line2:c.nullable(),address_city:d.required("Enter city"),address_state:f.required("Select state"),address_postal_code:l.required("Enter postal code")}),j=o({address_postal_code:l.required("Enter postal code")}),I=class{constructor(n){e(this,n),this.inputHandler=(e,n)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:n}))},this.legend=void 0,this.formController=void 0,this.billingInfo=void 0,this.errors={}}componentWillLoad(){this.formController=new a(x)}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate()}}render(){const e=this.formController.getInitialValues();return n(t,{key:"2763b7ac25e51e9d206d6a0bc6ed28ec13f54cc3"},n("form",{key:"758b52530cc945e9c3ce5a2ee11838a3776abc6b"},n("fieldset",{key:"2ab7312e043d3cbc03993f11ac5692692319af4b"},this.legend&&n("legend",{key:"8e324a5bb2fabc975742e866341a3434e1950a3c"},this.legend),n("div",{key:"fafd0d9fa2784341dc80fea8c53d081d2c84af5d",class:"row gy-3"},n("div",{key:"3aa18a756f3ea6ff9dcfa061cd845c714cab3540",class:"col-12"},n("form-control-text",{key:"4b75c876eef667f3d353c802376774e7c1af1b84",name:"name",label:"Full Name",defaultValue:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),n("div",{key:"dddc81024aef4757c18b31db84204fc9e70f9ab1",class:"col-12"},n("form-control-text",{key:"d9d63301e3d87885de9414164c820df2013cb6ae",name:"address_line1",label:"Street Address",defaultValue:e.address_line1,errorText:this.errors.address_line1,inputHandler:this.inputHandler})),n("div",{key:"f96675211a63fc785b9e759aef44f4dd4b22e0a3",class:"col-12"},n("form-control-text",{key:"f2c6a24150d640f9efbfa1748f577e32550b3507",name:"address_line2",label:"Apartment, Suite, etc. (optional)",defaultValue:e.address_line2,errorText:this.errors.address_line2,inputHandler:this.inputHandler})),n("div",{key:"83cf74afae2c4e899151cc5461a06632fef3c756",class:"col-12"},n("form-control-text",{key:"cbbf7dfac17eb69b2c9e80534051822cd4f94afd",name:"address_city",label:"City",defaultValue:e.address_city,errorText:this.errors.address_city,inputHandler:this.inputHandler})),n("div",{key:"9331b691855dc4f9a60b746089552228a5b12942",class:"col-12"},n("form-control-select",{key:"f0f726fe2633ab45754691726a0008c4e50f41ac",name:"address_state",label:"State",options:u,defaultValue:e.address_state,errorText:this.errors.address_state,inputHandler:this.inputHandler})),n("div",{key:"0d1d00ca86d09a370330cd9f3807783a8cd981a4",class:"col-12"},n("form-control-text",{key:"0e43cfe70ca05a3d795d82f554453d12562b2ec9",name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:h}))))))}};var z,O={exports:{}};z=O,console.info("\nIFRAME-RESIZER\n\nIframe-Resizer 5 is now available via the following two packages:\n\n * @iframe-resizer/parent\n * @iframe-resizer/child\n\nAdditionally their are also new versions of iframe-resizer for React, Vue, and jQuery.\n\nVersion 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n"),function(e){if("undefined"!=typeof window){var n,t,i=0,o=!1,a=!1,r=7,s="[iFrameSizer]",c=s.length,d=null,f=window.requestAnimationFrame,l=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},h=null,m=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){x("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),b={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,t){C(t,e)})).end()}):k("","Unable to bind to jQuery, it is not fully loaded.")),"function"==typeof e&&e.amd?e([],P):z.exports=P(),window.iFrameResize=window.iFrameResize||P()}function w(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function p(e,n,t){e.addEventListener(n,t,!1)}function g(e,n,t){e.removeEventListener(n,t,!1)}function y(e){return u[e]?u[e].log:o}function v(e,n){j("log",e,n,y(e))}function k(e,n){j("info",e,n,y(e))}function x(e,n){j("warn",e,n,!0)}function j(e,n,t,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return s+"["+function(e){var n="Host page: "+e;return window.top!==window.self&&(n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),n}(e)+"]"}(n),t)}function I(e){function n(){t("Height"),t("Width"),N((function(){H(_),S(W),m("onResized",_)}),_,"init")}function t(e){var n=Number(u[W]["max"+e]),t=Number(u[W]["min"+e]),i=e.toLowerCase(),o=Number(_[i]);v(W,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,v(W,"Set "+i+" to min value")),o>n&&(o=n,v(W,"Set "+i+" to max value")),_[i]=""+o}function i(e){return C.slice(C.indexOf(":")+r+e)}function o(e,n){var t,i;t=function(){var t,i;V("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=_.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-t.top,10),offsetLeft:parseInt(i.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,n)},b[i=n]||(b[i]=setTimeout((function(){b[i]=null,t()}),32))}function a(e){var n=e.getBoundingClientRect();return T(W),{x:Math.floor(Number(n.left)+Number(d.x)),y:Math.floor(Number(n.top)+Number(d.y))}}function f(e){var n=e?a(_.iframe):{x:0,y:0},t={x:Number(_.width)+n.x,y:Number(_.height)+n.y};v(W,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(d=t,l(),v(W,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):x(W,"Unable to scroll to requested position, window.parentIFrame not found")}function l(){!1===m("onScroll",d)?R():S(W)}function h(e){var n={};if(0===Number(_.width)&&0===Number(_.height)){var t=i(9).split(":");n={x:t[1],y:t[0]}}else n={x:_.width,y:_.height};m(e,{iframe:_.iframe,screenX:Number(n.x),screenY:Number(n.y),type:_.type})}function m(e,n){return O(W,e,n)}var w,y,j,I,z,M,C=e.data,_={},W=null;"[iFrameResizerChild]Ready"===C?function(){for(var e in u)V("iFrame requested init",L(e),u[e].iframe,e)}():s===(""+C).slice(0,c)&&C.slice(c).split(":")[0]in u?(I=(j=C.slice(c).split(":"))[1]?parseInt(j[1],10):0,z=u[j[0]]&&u[j[0]].iframe,M=getComputedStyle(z),_={iframe:z,id:j[0],height:I+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(M)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(M),width:j[2],type:j[3]},u[W=_.id]&&(u[W].loaded=!0),(y=_.type in{true:1,false:1,undefined:1})&&v(W,"Ignoring init message from meta parent page"),!y&&function(e){var n=!0;return u[e]||(n=!1,x(_.type+" No settings for "+e+". Message was: "+C)),n}(W)&&(v(W,"Received: "+C),w=!0,null===_.iframe&&(x(W,"IFrame ("+_.id+") not found"),w=!1),w&&function(){var n,t=e.origin,i=u[W]&&u[W].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(v(W,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(v(W,"Checking connection is from: "+(n=u[W]&&u[W].remoteHost)),t===n)))throw new Error("Unexpected message received from: "+t+" for "+_.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[W]&&u[W].firstRun&&u[W]&&(u[W].firstRun=!1),_.type){case"close":F(_.iframe);break;case"message":c=i(6),v(W,"onMessage passed: {iframe: "+_.iframe.id+", message: "+c+"}"),m("onMessage",{iframe:_.iframe,message:JSON.parse(c)}),v(W,"--");break;case"mouseenter":h("onMouseEnter");break;case"mouseleave":h("onMouseLeave");break;case"autoResize":u[W].autoResize=JSON.parse(i(9));break;case"scrollTo":f(!1);break;case"scrollToOffset":f(!0);break;case"pageInfo":o(u[W]&&u[W].iframe,W),function(){function e(e,i){function a(){u[t]?o(u[t].iframe,t):n()}["scroll","resize"].forEach((function(n){v(t,e+n+" listener for sendPageInfo"),i(window,n,a)}))}function n(){e("Remove ",g)}var t=W;e("Add ",p),u[t]&&(u[t].stopPageInfo=n)}();break;case"pageInfoStop":u[W]&&u[W].stopPageInfo&&(u[W].stopPageInfo(),delete u[W].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",r=decodeURIComponent(t),(s=document.getElementById(r)||document.getElementsByName(r)[0])?(e=a(s),v(W,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),d={x:e.x,y:e.y},l(),v(W,"--")):window.top===window.self?v(W,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):v(W,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":E(_);break;case"init":n(),m("onInit",_.iframe);break;default:0===Number(_.width)&&0===Number(_.height)?x("Unsupported message received ("+_.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):n()}var e,t,r,s,c}())):k(W,"Ignored: "+C)}function O(e,n,t){var i=null,o=null;if(u[e]){if("function"!=typeof(i=u[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=i(t)}return o}function M(e){delete u[e.id]}function F(e){var t=e.id;if(!1!==O(t,"onClose",t)){v(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){x(e)}O(t,"onClosed",t),v(t,"--"),M(e),n&&(n.disconnect(),n=null)}else v(t,"Close iframe cancelled by onClose event")}function T(n){null===d&&v(n,"Get page position: "+(d={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+d.y)}function S(e){null!==d&&(window.scrollTo(d.x,d.y),v(e,"Set page position: "+d.x+","+d.y),R())}function R(){d=null}function E(e){v(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),T(e.id),N((function(){H(e),V("reset","reset",e.iframe,e.id)}),e,"reset")}function H(e){function n(n){a||"0"!==e[n]||(a=!0,v(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function n(n){return"0px"===(u[e]&&u[e].iframe.style[n])}u[e]&&null!==u[e].iframe.offsetParent&&(n("height")||n("width"))&&V("Visibility change","resize",u[e].iframe,e)}(e)}))}function n(n){v("window","Mutation observed: "+n[0].target+" "+n[0].type),_(e,16)}var t,i=w();i&&(t=document.querySelector("body"),new i(n).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function t(t){!function(n){e.id?(e.iframe.style[n]=e[n]+"px",v(e.id,"IFrame ("+i+") "+n+" set to "+e[n]+"px")):v("undefined","messageData id not set")}(t),n(t)}var i=e.iframe.id;u[i]&&(u[i].sizeHeight&&t("height"),u[i].sizeWidth&&t("width"))}function N(e,n,t){t!==n.type&&f&&!window.jasmine?(v(n.id,"Requesting animation frame"),f(e)):e()}function V(e,n,t,i,o){var a,r=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(v(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+(a=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(s+n,a)):x(i,"["+e+"] IFrame("+i+") not found"),o&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||r||(r=!0,x(i,"IFrame has not responded within "+u[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[i].warningTimeout)))}function L(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod+":"+u[e].mouseEvents}function C(t,a){function r(e){var n=e.split("Callback");if(2===n.length){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e],delete this[e],x(d,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var s,c,d=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var n;return""===e&&(t.id=(n=a&&a.id||m.id+i++,null!==document.getElementById(n)&&(n+=i++),e=n),o=(a||{}).log,v(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);d in u&&"iFrameResizer"in t?x(d,"Ignored iFrame, already setup."):(function(e){var n;e=e||{},u[d]=Object.create(null),u[d].iframe=t,u[d].firstRun=!0,u[d].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(r,e),function(e){for(var n in m)Object.prototype.hasOwnProperty.call(m,n)&&(u[d][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:m[n])}(e),u[d]&&(u[d].targetOrigin=!0===u[d].checkOrigin?""===(n=u[d].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(a),function(){switch(v(d,"IFrame scrolling "+(u[d]&&u[d].scrolling?"enabled":"disabled")+" for "+d),t.style.overflow=!1===(u[d]&&u[d].scrolling)?"hidden":"auto",u[d]&&u[d].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[d]?u[d].scrolling:"no"}}(),function(){function e(e){var n=u[d][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,v(d,"Set "+e+" = "+t.style[e]))}function n(e){if(u[d]["min"+e]>u[d]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}n("Height"),n("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(u[d]&&u[d].bodyMargin)&&"0"!==(u[d]&&u[d].bodyMargin)||(u[d].bodyMarginV1=u[d].bodyMargin,u[d].bodyMargin=u[d].bodyMargin+"px"),s=L(d),(c=w())&&(n=function(e){if(!t.parentNode)return null;var n=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&F(t)}))}))}));return n.observe(t.parentNode,{childList:!0}),n}(c)),p(t,"load",(function(){V("iFrame.onload",s,t,e,!0),(!u[d]||!u[d].firstRun)&&u[d]&&u[d].heightCalculationMethod in l&&E({iframe:t,height:0,width:0,type:"init"})})),V("init",s,t,e,!0),u[d]&&(u[d].iframe.iFrameResizer={close:F.bind(null,u[d].iframe),removeListeners:M.bind(null,u[d].iframe),resize:V.bind(null,"Window resize","resize",u[d].iframe),moveToAnchor:function(e){V("Move to anchor","moveToAnchor:"+e,u[d].iframe,d)},sendMessage:function(e){V("Send Message","message:"+(e=JSON.stringify(e)),u[d].iframe,d)}}))}function _(e,n){null===h&&(h=setTimeout((function(){h=null,e()}),n))}function W(){"hidden"!==document.visibilityState&&(v("document","Trigger event: Visibility change"),_((function(){A("Tab Visible","resize")}),16))}function A(e,n){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&V(e,n,u[t].iframe,t)}))}function P(){function n(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),C(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!f;e+=1)f=window[n[e]+"RequestAnimationFrame"];f?f=f.bind(window):v("setup","RequestAnimationFrame not supported")}(),p(window,"message",I),p(window,"resize",(function(){v("window","Trigger event: resize"),_((function(){A("Window resize","resize")}),16)})),p(document,"visibilitychange",W),p(document,"-webkit-visibilitychange",W),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&x("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),n.bind(e,i));break;case"object":n(i,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}return t}}}();const M=O.exports;class F{constructor(e,n){this.iframe=e,this.iframeOrigin=n}postMessage(e,n){const t=Object.assign({eventType:e},n);this.iframe.contentWindow.postMessage(t,this.iframeOrigin)}addMessageListener(e){window.addEventListener("message",e)}removeMessageListener(e){window.removeEventListener("message",e)}postMessageWithResponseListener(e,n){return new Promise((t=>{const i=n=>{n.data.eventType===e&&(window.removeEventListener("message",i),t(n.data.data))};window.addEventListener("message",i),this.postMessage(e,n)}))}}const T=class{constructor(n){e(this,n),this.dispatchMessageEvent=e=>{const{eventType:n,data:t}=e.data;(null==t?void 0:t.id)===this.inputId&&("focused"===n&&(this.isFocused=!0),"blurred"===n&&(this.isFocused=!1))},this.isFocused=!1,this.isValid=!0,this.errorText=void 0,this.iframeLoaded=!1,this.inputId=void 0,this.label=void 0,this.iframeOrigin=void 0}disconnectedCallback(){this.frameService.removeMessageListener(this.dispatchMessageEvent)}async validate(){const e=await this.frameService.postMessageWithResponseListener("validate");return this.isValid=e.isValid,this.errorText=e.error.message,e}async tokenize(e,n,t){return this.frameService.postMessageWithResponseListener("tokenize",{clientId:e,paymentMethodMetadata:n,account:t,componentVersion:b.version})}initializeFrameCommunicationService(){var e;this.frameService=new F(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}get part(){return this.isFocused&&!this.isValid?p:this.isValid?this.isFocused?y:v:g}get style(){return this.isFocused?this.isValid?w.focused:w.focusedAndInvalid:null}get urlParams(){const e=Object.fromEntries(Object.entries(w.fontStyles).map((([e,n])=>[e,btoa(String(n))])));return new URLSearchParams(e).toString()}render(){return n(t,{key:"00956724f4d6e72b09c2c469613a6362a3c7cdec",class:"form-group d-flex flex-column"},n("div",{key:"e6605bd5ef7356c21701b0856a133758720a36d6",style:{visibility:this.iframeLoaded?"visible":"hidden",height:this.iframeLoaded?"auto":"0"}},n("label",{key:"f52a782a9f1bbca4a8a6e36da1948611ab834e54",class:"form-label",htmlFor:"",part:k},this.label||""),n("div",{key:"b88199f3de1b52a0aed4d61c0448c293964a7279",class:"p-0 d-flex form-control "+(this.isValid?"":"is-invalid"),part:this.part,style:Object.assign(Object.assign({},this.style),{overflow:"hidden"})},n("iframe",{key:"218aa6d48b12c1fc78f04a1556f0a32738c20df4",id:this.inputId,name:this.inputId,src:`${this.iframeOrigin}?${this.urlParams}`,ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},width:"100%",onLoad:()=>{M({log:!1,onResized:()=>{this.iframeLoaded=!0}},this.iframeElement)}})),n(m,{key:"f6e57608fc771ca78e39618455dfe57cd40a655a",errorText:this.errorText,name:this.inputId})))}get el(){return i(this)}},S=class{constructor(n){e(this,n),this.inputHandler=(e,n)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:n}))},this.legend=void 0,this.formController=void 0,this.billingInfo=void 0,this.errors={}}componentWillLoad(){this.formController=new a(j)}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate()}}render(){const e=this.formController.getInitialValues();return n(t,{key:"e798e67c159b53a995e4a60246c6f6d6e872f1ec"},n("form",{key:"24d6980de772a360c0218e9ab50550dcee5786d5"},n("fieldset",{key:"9e990836becccdf5d12a9e15e2eb7f4078f74b08"},this.legend&&n("legend",{key:"12d445b392cf03114dbd2a37391ecc1b87304868"},this.legend),n("div",{key:"2d2fed9cf30b3869633b80b39b7684dfde66f6b7",class:"row gy-3"},n("div",{key:"8ec042863e646d5daffeb3fbb5395336406adcde",class:"col-12"},n("form-control-text",{key:"82a2c18c2a7eef7ba7ac46e53dfc9c975c8d28b7",name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:h}))))))}};export{I as billing_form,T as iframe_input,S as postal_form}
1
+ import{r as e,h as n,H as t,g as i}from"./p-2783e363.js";import{c as o,F as a}from"./p-5844a0f0.js";import{u as r,l as s,k as c,m as d,n as f,q as l}from"./p-27c8ffa2.js";import{S as u}from"./p-6078a370.js";import{n as h}from"./p-e3c22aa9.js";import{F as m}from"./p-40e23b13.js";import{p as b}from"./p-b2edb944.js";import{a as w}from"./p-4cc3c7f9.js";import{i as p,b as g,a as y,c as v,l as k}from"./p-d8c04275.js";import"./p-0ea387a2.js";import"./p-275f2154.js";import"./p-1ff8810b.js";import"./p-61f0a2ce.js";import"./p-f20b6ce1.js";const x=o({name:r.required("Enter full name"),address_line1:s.required("Enter street address"),address_line2:c.nullable(),address_city:d.required("Enter city"),address_state:f.required("Select state"),address_postal_code:l.required("Enter postal code")}),j=o({address_postal_code:l.required("Enter postal code")}),I=class{constructor(n){e(this,n),this.inputHandler=(e,n)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:n}))},this.legend=void 0,this.formController=void 0,this.billingInfo=void 0,this.errors={}}componentWillLoad(){this.formController=new a(x)}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate()}}render(){const e=this.formController.getInitialValues();return n(t,{key:"2763b7ac25e51e9d206d6a0bc6ed28ec13f54cc3"},n("form",{key:"758b52530cc945e9c3ce5a2ee11838a3776abc6b"},n("fieldset",{key:"2ab7312e043d3cbc03993f11ac5692692319af4b"},this.legend&&n("legend",{key:"8e324a5bb2fabc975742e866341a3434e1950a3c"},this.legend),n("div",{key:"fafd0d9fa2784341dc80fea8c53d081d2c84af5d",class:"row gy-3"},n("div",{key:"3aa18a756f3ea6ff9dcfa061cd845c714cab3540",class:"col-12"},n("form-control-text",{key:"4b75c876eef667f3d353c802376774e7c1af1b84",name:"name",label:"Full Name",defaultValue:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),n("div",{key:"dddc81024aef4757c18b31db84204fc9e70f9ab1",class:"col-12"},n("form-control-text",{key:"d9d63301e3d87885de9414164c820df2013cb6ae",name:"address_line1",label:"Street Address",defaultValue:e.address_line1,errorText:this.errors.address_line1,inputHandler:this.inputHandler})),n("div",{key:"f96675211a63fc785b9e759aef44f4dd4b22e0a3",class:"col-12"},n("form-control-text",{key:"f2c6a24150d640f9efbfa1748f577e32550b3507",name:"address_line2",label:"Apartment, Suite, etc. (optional)",defaultValue:e.address_line2,errorText:this.errors.address_line2,inputHandler:this.inputHandler})),n("div",{key:"83cf74afae2c4e899151cc5461a06632fef3c756",class:"col-12"},n("form-control-text",{key:"cbbf7dfac17eb69b2c9e80534051822cd4f94afd",name:"address_city",label:"City",defaultValue:e.address_city,errorText:this.errors.address_city,inputHandler:this.inputHandler})),n("div",{key:"9331b691855dc4f9a60b746089552228a5b12942",class:"col-12"},n("form-control-select",{key:"f0f726fe2633ab45754691726a0008c4e50f41ac",name:"address_state",label:"State",options:u,defaultValue:e.address_state,errorText:this.errors.address_state,inputHandler:this.inputHandler})),n("div",{key:"0d1d00ca86d09a370330cd9f3807783a8cd981a4",class:"col-12"},n("form-control-text",{key:"0e43cfe70ca05a3d795d82f554453d12562b2ec9",name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:h}))))))}};var z,O={exports:{}};z=O,console.info("\nIFRAME-RESIZER\n\nIframe-Resizer 5 is now available via the following two packages:\n\n * @iframe-resizer/parent\n * @iframe-resizer/child\n\nAdditionally their are also new versions of iframe-resizer for React, Vue, and jQuery.\n\nVersion 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n"),function(e){if("undefined"!=typeof window){var n,t,i=0,o=!1,a=!1,r=7,s="[iFrameSizer]",c=s.length,d=null,f=window.requestAnimationFrame,l=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},h=null,m=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){x("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),b={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,t){C(t,e)})).end()}):k("","Unable to bind to jQuery, it is not fully loaded.")),"function"==typeof e&&e.amd?e([],P):z.exports=P(),window.iFrameResize=window.iFrameResize||P()}function w(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function p(e,n,t){e.addEventListener(n,t,!1)}function g(e,n,t){e.removeEventListener(n,t,!1)}function y(e){return u[e]?u[e].log:o}function v(e,n){j("log",e,n,y(e))}function k(e,n){j("info",e,n,y(e))}function x(e,n){j("warn",e,n,!0)}function j(e,n,t,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return s+"["+function(e){var n="Host page: "+e;return window.top!==window.self&&(n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),n}(e)+"]"}(n),t)}function I(e){function n(){t("Height"),t("Width"),N((function(){H(_),S(W),m("onResized",_)}),_,"init")}function t(e){var n=Number(u[W]["max"+e]),t=Number(u[W]["min"+e]),i=e.toLowerCase(),o=Number(_[i]);v(W,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,v(W,"Set "+i+" to min value")),o>n&&(o=n,v(W,"Set "+i+" to max value")),_[i]=""+o}function i(e){return C.slice(C.indexOf(":")+r+e)}function o(e,n){var t,i;t=function(){var t,i;V("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=_.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-t.top,10),offsetLeft:parseInt(i.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,n)},b[i=n]||(b[i]=setTimeout((function(){b[i]=null,t()}),32))}function a(e){var n=e.getBoundingClientRect();return T(W),{x:Math.floor(Number(n.left)+Number(d.x)),y:Math.floor(Number(n.top)+Number(d.y))}}function f(e){var n=e?a(_.iframe):{x:0,y:0},t={x:Number(_.width)+n.x,y:Number(_.height)+n.y};v(W,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(d=t,l(),v(W,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):x(W,"Unable to scroll to requested position, window.parentIFrame not found")}function l(){!1===m("onScroll",d)?R():S(W)}function h(e){var n={};if(0===Number(_.width)&&0===Number(_.height)){var t=i(9).split(":");n={x:t[1],y:t[0]}}else n={x:_.width,y:_.height};m(e,{iframe:_.iframe,screenX:Number(n.x),screenY:Number(n.y),type:_.type})}function m(e,n){return O(W,e,n)}var w,y,j,I,z,M,C=e.data,_={},W=null;"[iFrameResizerChild]Ready"===C?function(){for(var e in u)V("iFrame requested init",L(e),u[e].iframe,e)}():s===(""+C).slice(0,c)&&C.slice(c).split(":")[0]in u?(I=(j=C.slice(c).split(":"))[1]?parseInt(j[1],10):0,z=u[j[0]]&&u[j[0]].iframe,M=getComputedStyle(z),_={iframe:z,id:j[0],height:I+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(M)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(M),width:j[2],type:j[3]},u[W=_.id]&&(u[W].loaded=!0),(y=_.type in{true:1,false:1,undefined:1})&&v(W,"Ignoring init message from meta parent page"),!y&&function(e){var n=!0;return u[e]||(n=!1,x(_.type+" No settings for "+e+". Message was: "+C)),n}(W)&&(v(W,"Received: "+C),w=!0,null===_.iframe&&(x(W,"IFrame ("+_.id+") not found"),w=!1),w&&function(){var n,t=e.origin,i=u[W]&&u[W].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(v(W,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(v(W,"Checking connection is from: "+(n=u[W]&&u[W].remoteHost)),t===n)))throw new Error("Unexpected message received from: "+t+" for "+_.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[W]&&u[W].firstRun&&u[W]&&(u[W].firstRun=!1),_.type){case"close":F(_.iframe);break;case"message":c=i(6),v(W,"onMessage passed: {iframe: "+_.iframe.id+", message: "+c+"}"),m("onMessage",{iframe:_.iframe,message:JSON.parse(c)}),v(W,"--");break;case"mouseenter":h("onMouseEnter");break;case"mouseleave":h("onMouseLeave");break;case"autoResize":u[W].autoResize=JSON.parse(i(9));break;case"scrollTo":f(!1);break;case"scrollToOffset":f(!0);break;case"pageInfo":o(u[W]&&u[W].iframe,W),function(){function e(e,i){function a(){u[t]?o(u[t].iframe,t):n()}["scroll","resize"].forEach((function(n){v(t,e+n+" listener for sendPageInfo"),i(window,n,a)}))}function n(){e("Remove ",g)}var t=W;e("Add ",p),u[t]&&(u[t].stopPageInfo=n)}();break;case"pageInfoStop":u[W]&&u[W].stopPageInfo&&(u[W].stopPageInfo(),delete u[W].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",r=decodeURIComponent(t),(s=document.getElementById(r)||document.getElementsByName(r)[0])?(e=a(s),v(W,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),d={x:e.x,y:e.y},l(),v(W,"--")):window.top===window.self?v(W,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):v(W,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":E(_);break;case"init":n(),m("onInit",_.iframe);break;default:0===Number(_.width)&&0===Number(_.height)?x("Unsupported message received ("+_.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):n()}var e,t,r,s,c}())):k(W,"Ignored: "+C)}function O(e,n,t){var i=null,o=null;if(u[e]){if("function"!=typeof(i=u[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=i(t)}return o}function M(e){delete u[e.id]}function F(e){var t=e.id;if(!1!==O(t,"onClose",t)){v(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){x(e)}O(t,"onClosed",t),v(t,"--"),M(e),n&&(n.disconnect(),n=null)}else v(t,"Close iframe cancelled by onClose event")}function T(n){null===d&&v(n,"Get page position: "+(d={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+d.y)}function S(e){null!==d&&(window.scrollTo(d.x,d.y),v(e,"Set page position: "+d.x+","+d.y),R())}function R(){d=null}function E(e){v(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),T(e.id),N((function(){H(e),V("reset","reset",e.iframe,e.id)}),e,"reset")}function H(e){function n(n){a||"0"!==e[n]||(a=!0,v(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function n(n){return"0px"===(u[e]&&u[e].iframe.style[n])}u[e]&&null!==u[e].iframe.offsetParent&&(n("height")||n("width"))&&V("Visibility change","resize",u[e].iframe,e)}(e)}))}function n(n){v("window","Mutation observed: "+n[0].target+" "+n[0].type),_(e,16)}var t,i=w();i&&(t=document.querySelector("body"),new i(n).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function t(t){!function(n){e.id?(e.iframe.style[n]=e[n]+"px",v(e.id,"IFrame ("+i+") "+n+" set to "+e[n]+"px")):v("undefined","messageData id not set")}(t),n(t)}var i=e.iframe.id;u[i]&&(u[i].sizeHeight&&t("height"),u[i].sizeWidth&&t("width"))}function N(e,n,t){t!==n.type&&f&&!window.jasmine?(v(n.id,"Requesting animation frame"),f(e)):e()}function V(e,n,t,i,o){var a,r=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(v(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+(a=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(s+n,a)):x(i,"["+e+"] IFrame("+i+") not found"),o&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||r||(r=!0,x(i,"IFrame has not responded within "+u[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[i].warningTimeout)))}function L(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod+":"+u[e].mouseEvents}function C(t,a){function r(e){var n=e.split("Callback");if(2===n.length){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e],delete this[e],x(d,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var s,c,d=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var n;return""===e&&(t.id=(n=a&&a.id||m.id+i++,null!==document.getElementById(n)&&(n+=i++),e=n),o=(a||{}).log,v(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);d in u&&"iFrameResizer"in t?x(d,"Ignored iFrame, already setup."):(function(e){var n;e=e||{},u[d]=Object.create(null),u[d].iframe=t,u[d].firstRun=!0,u[d].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(r,e),function(e){for(var n in m)Object.prototype.hasOwnProperty.call(m,n)&&(u[d][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:m[n])}(e),u[d]&&(u[d].targetOrigin=!0===u[d].checkOrigin?""===(n=u[d].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(a),function(){switch(v(d,"IFrame scrolling "+(u[d]&&u[d].scrolling?"enabled":"disabled")+" for "+d),t.style.overflow=!1===(u[d]&&u[d].scrolling)?"hidden":"auto",u[d]&&u[d].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[d]?u[d].scrolling:"no"}}(),function(){function e(e){var n=u[d][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,v(d,"Set "+e+" = "+t.style[e]))}function n(e){if(u[d]["min"+e]>u[d]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}n("Height"),n("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(u[d]&&u[d].bodyMargin)&&"0"!==(u[d]&&u[d].bodyMargin)||(u[d].bodyMarginV1=u[d].bodyMargin,u[d].bodyMargin=u[d].bodyMargin+"px"),s=L(d),(c=w())&&(n=function(e){if(!t.parentNode)return null;var n=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&F(t)}))}))}));return n.observe(t.parentNode,{childList:!0}),n}(c)),p(t,"load",(function(){V("iFrame.onload",s,t,e,!0),(!u[d]||!u[d].firstRun)&&u[d]&&u[d].heightCalculationMethod in l&&E({iframe:t,height:0,width:0,type:"init"})})),V("init",s,t,e,!0),u[d]&&(u[d].iframe.iFrameResizer={close:F.bind(null,u[d].iframe),removeListeners:M.bind(null,u[d].iframe),resize:V.bind(null,"Window resize","resize",u[d].iframe),moveToAnchor:function(e){V("Move to anchor","moveToAnchor:"+e,u[d].iframe,d)},sendMessage:function(e){V("Send Message","message:"+(e=JSON.stringify(e)),u[d].iframe,d)}}))}function _(e,n){null===h&&(h=setTimeout((function(){h=null,e()}),n))}function W(){"hidden"!==document.visibilityState&&(v("document","Trigger event: Visibility change"),_((function(){A("Tab Visible","resize")}),16))}function A(e,n){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&V(e,n,u[t].iframe,t)}))}function P(){function n(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),C(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!f;e+=1)f=window[n[e]+"RequestAnimationFrame"];f?f=f.bind(window):v("setup","RequestAnimationFrame not supported")}(),p(window,"message",I),p(window,"resize",(function(){v("window","Trigger event: resize"),_((function(){A("Window resize","resize")}),16)})),p(document,"visibilitychange",W),p(document,"-webkit-visibilitychange",W),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&x("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),n.bind(e,i));break;case"object":n(i,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}return t}}}();const M=O.exports;class F{constructor(e,n){this.iframe=e,this.iframeOrigin=n}postMessage(e,n){const t=Object.assign({eventType:e},n);this.iframe.contentWindow.postMessage(t,this.iframeOrigin)}addMessageListener(e){window.addEventListener("message",e)}removeMessageListener(e){window.removeEventListener("message",e)}postMessageWithResponseListener(e,n){return new Promise((t=>{const i=n=>{n.data.eventType===e&&(window.removeEventListener("message",i),t(n.data.data))};window.addEventListener("message",i),this.postMessage(e,n)}))}}const T=class{constructor(n){e(this,n),this.dispatchMessageEvent=e=>{const{eventType:n,data:t}=e.data;(null==t?void 0:t.id)===this.inputId&&("focused"===n&&(this.isFocused=!0),"blurred"===n&&(this.isFocused=!1))},this.isFocused=!1,this.isValid=!0,this.errorText=void 0,this.iframeLoaded=!1,this.inputId=void 0,this.label=void 0,this.iframeOrigin=void 0}disconnectedCallback(){this.frameService.removeMessageListener(this.dispatchMessageEvent)}async validate(){const e=await this.frameService.postMessageWithResponseListener("validate");return this.isValid=e.isValid,this.errorText=e.error.message,e}async tokenize(e,n,t){return this.frameService.postMessageWithResponseListener("tokenize",{clientId:e,paymentMethodMetadata:n,account:t,componentVersion:b.version})}initializeFrameCommunicationService(){var e;this.frameService=new F(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}get part(){return this.isFocused&&!this.isValid?p:this.isValid?this.isFocused?y:v:g}get style(){return this.isFocused?this.isValid?w.focused:w.focusedAndInvalid:null}get urlParams(){const e=Object.fromEntries(Object.entries(w.fontStyles).map((([e,n])=>[e,btoa(String(n))])));return new URLSearchParams(e).toString()}render(){return n(t,{key:"00956724f4d6e72b09c2c469613a6362a3c7cdec",class:"form-group d-flex flex-column"},n("div",{key:"e6605bd5ef7356c21701b0856a133758720a36d6",style:{visibility:this.iframeLoaded?"visible":"hidden",height:this.iframeLoaded?"auto":"0"}},n("label",{key:"f52a782a9f1bbca4a8a6e36da1948611ab834e54",class:"form-label",htmlFor:"",part:k},this.label||""),n("div",{key:"b88199f3de1b52a0aed4d61c0448c293964a7279",class:"p-0 d-flex form-control "+(this.isValid?"":"is-invalid"),part:this.part,style:Object.assign(Object.assign({},this.style),{overflow:"hidden"})},n("iframe",{key:"218aa6d48b12c1fc78f04a1556f0a32738c20df4",id:this.inputId,name:this.inputId,src:`${this.iframeOrigin}?${this.urlParams}`,ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},width:"100%",onLoad:()=>{M({log:!1,onResized:()=>{this.iframeLoaded=!0}},this.iframeElement)}})),n(m,{key:"f6e57608fc771ca78e39618455dfe57cd40a655a",errorText:this.errorText,name:this.inputId})))}get el(){return i(this)}},S=class{constructor(n){e(this,n),this.inputHandler=(e,n)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:n}))},this.legend=void 0,this.formController=void 0,this.billingInfo=void 0,this.errors={}}componentWillLoad(){this.formController=new a(j)}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate()}}render(){const e=this.formController.getInitialValues();return n(t,{key:"e798e67c159b53a995e4a60246c6f6d6e872f1ec"},n("form",{key:"24d6980de772a360c0218e9ab50550dcee5786d5"},n("fieldset",{key:"9e990836becccdf5d12a9e15e2eb7f4078f74b08"},this.legend&&n("legend",{key:"12d445b392cf03114dbd2a37391ecc1b87304868"},this.legend),n("div",{key:"2d2fed9cf30b3869633b80b39b7684dfde66f6b7",class:"row gy-3"},n("div",{key:"8ec042863e646d5daffeb3fbb5395336406adcde",class:"col-12"},n("form-control-text",{key:"82a2c18c2a7eef7ba7ac46e53dfc9c975c8d28b7",name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:h}))))))}};export{I as billing_form,T as iframe_input,S as postal_form}
@@ -0,0 +1 @@
1
+ import{r as s,c as i,h as t,H as r}from"./p-2783e363.js";import{E as e}from"./p-8f25f016.js";import{B as o}from"./p-35b00a0d.js";import{B as a}from"./p-275f2154.js";import{C as n,a as d}from"./p-14c91ffd.js";import{g as h,a as p}from"./p-8115b2f4.js";import{c,J as m}from"./p-933537ca.js";import"./p-d8c04275.js";import"./p-4bad3621.js";import"./p-1ff8810b.js";import"./p-6078a370.js";import"./p-b2edb944.js";const u=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.businessId=void 0,this.authToken=void 0,this.errorMessage=void 0,this.getBusiness=void 0}componentWillLoad(){c(),this.analytics=new m(this),this.initializeGetBusiness()}disconnectedCallback(){this.analytics.cleanup()}initializeGetBusiness(){if(!this.businessId||!this.authToken)return this.errorMessage="Invalid business id or auth token",void this.errorEvent.emit({errorCode:d.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR});this.getBusiness=(({id:s,authToken:i,service:t})=>async({onSuccess:r,onError:e})=>{var o;try{const d=await t.fetchBusiness(s,i);if(d.error)return e({error:h(d.error),code:p(null===(o=d.error)||void 0===o?void 0:o.code),severity:n.ERROR});r({business:new a(d.data)})}catch(s){const i=p(null==s?void 0:s.code);return e({error:s.message||s,code:i,severity:n.ERROR})}})({id:this.businessId,authToken:this.authToken,service:new o})}render(){return t(r,null,this.errorMessage?e(this.errorMessage):t("business-details-core",{getBusiness:this.getBusiness}))}};export{u as justifi_business_details}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-2783e363.js";import{C as e,a as o}from"./p-14c91ffd.js";import{c as a,J as r}from"./p-d91c46dc.js";import{c as n}from"./p-4bad3621.js";import{m as p,P as c}from"./p-dd867d1f.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import{P as d}from"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as h,a as l}from"./p-8115b2f4.js";import{m,S as b}from"./p-a2076a0e.js";import{S as u}from"./p-bfe9748b.js";import{d as f}from"./p-21431a04.js";import"./p-4c820f81.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-3e716e03.js";import"./p-938993c7.js";import"./p-d8c04275.js";const j=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.handleOnError=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.getPayouts=void 0,this.getPayoutCSV=void 0,this.getSubAccounts=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin=n.proxyApiOrigin,this.columns=f}componentWillLoad(){a(),this.analytics=new r(this),this.initializeGetData()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializePayoutsServices(),this.initializeGetSubAccounts()}initializePayoutsServices(){if(this.accountId&&this.authToken){const t={id:this.accountId,authToken:this.authToken,service:new c,apiOrigin:this.apiOrigin};this.getPayouts=(({id:t,authToken:s,service:i,apiOrigin:o})=>async({params:a,onSuccess:r,onError:n})=>{var p,c;try{const m=await i.fetchPayouts(t,s,a,o);if(m.error)return n({error:h(m.error),code:l(null===(c=m.error)||void 0===c?void 0:c.code),severity:e.ERROR});{const t=Object.assign({},m.page_info);r({payouts:(null===(p=m.data)||void 0===p?void 0:p.map((t=>new d(t))))||[],pagingInfo:t})}}catch(t){const s=l(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:e.ERROR})}})(t),this.getPayoutCSV=p(t)}else this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR})}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new b,apiOrigin:this.apiOrigin}))}render(){return i(u,{key:"7e8c3bf1df6c6cdffdc7205f84d4b451b331f6db",exportedparts:"\ntable-head,table-head-row,table-head-cell,table-body,table-row,table-row-even,\ntable-row-odd,table-cell,loading-state-cell,loading-state-spinner,error-state,\nempty-state,pagination-bar,page-arrow,page-button,page-button-disabled,page-button-text\n"},i("payouts-list-core",{key:"9ba8af8a562107b8fdc5bece521187ab70b90669",getPayouts:this.getPayouts,getPayoutCSV:this.getPayoutCSV,getSubAccounts:this.getSubAccounts,"onError-event":this.handleOnError,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{j as justifi_payouts_list}
1
+ import{r as t,c as s,h as i}from"./p-2783e363.js";import{C as e,a as o}from"./p-14c91ffd.js";import{c as a,J as r}from"./p-933537ca.js";import{c as n}from"./p-4bad3621.js";import{m as p,P as c}from"./p-dd867d1f.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import{P as h}from"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as d,a as l}from"./p-8115b2f4.js";import{m,S as b}from"./p-a2076a0e.js";import{S as u}from"./p-bfe9748b.js";import{d as f}from"./p-21431a04.js";import"./p-b2edb944.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-3e716e03.js";import"./p-938993c7.js";import"./p-d8c04275.js";const j=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.handleOnError=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.getPayouts=void 0,this.getPayoutCSV=void 0,this.getSubAccounts=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin=n.proxyApiOrigin,this.columns=f}componentWillLoad(){a(),this.analytics=new r(this),this.initializeGetData()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializePayoutsServices(),this.initializeGetSubAccounts()}initializePayoutsServices(){if(this.accountId&&this.authToken){const t={id:this.accountId,authToken:this.authToken,service:new c,apiOrigin:this.apiOrigin};this.getPayouts=(({id:t,authToken:s,service:i,apiOrigin:o})=>async({params:a,onSuccess:r,onError:n})=>{var p,c;try{const m=await i.fetchPayouts(t,s,a,o);if(m.error)return n({error:d(m.error),code:l(null===(c=m.error)||void 0===c?void 0:c.code),severity:e.ERROR});{const t=Object.assign({},m.page_info);r({payouts:(null===(p=m.data)||void 0===p?void 0:p.map((t=>new h(t))))||[],pagingInfo:t})}}catch(t){const s=l(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:e.ERROR})}})(t),this.getPayoutCSV=p(t)}else this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR})}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new b,apiOrigin:this.apiOrigin}))}render(){return i(u,{key:"7e8c3bf1df6c6cdffdc7205f84d4b451b331f6db",exportedparts:"\ntable-head,table-head-row,table-head-cell,table-body,table-row,table-row-even,\ntable-row-odd,table-cell,loading-state-cell,loading-state-spinner,error-state,\nempty-state,pagination-bar,page-arrow,page-button,page-button-disabled,page-button-text\n"},i("payouts-list-core",{key:"9ba8af8a562107b8fdc5bece521187ab70b90669",getPayouts:this.getPayouts,getPayoutCSV:this.getPayoutCSV,getSubAccounts:this.getSubAccounts,"onError-event":this.handleOnError,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{j as justifi_payouts_list}
@@ -0,0 +1 @@
1
+ import{r as t,h as i,H as e,c as s}from"./p-2783e363.js";import{i as a}from"./p-4cc3c7f9.js";import{i as n,b as o,a as d,c as r,N as h,O as c}from"./p-d8c04275.js";import{H as l}from"./p-d0bde1cb.js";import{a as f}from"./p-9894484a.js";import{j as m,f as u}from"./p-2ca5b5e4.js";import"./p-f20b6ce1.js";import"./p-abdbcd8e.js";const b=class{constructor(i){t(this,i),this.iframeOrigin=void 0}async validate(){const t=await this.accountNumberIframeElement.validate(),i=await this.routingNumberIframeElement.validate();return t&&i}async tokenize(t,i,e){return this.accountNumberIframeElement.tokenize(t,i,e)}render(){return i(e,{key:"e2aa1322935463d5e0c32154ed8af52baad6b241"},i("div",{key:"bf528ad389d4a34762c164440cb946b727ddbfdd",class:"container-fluid p-0"},i("div",{key:"f2004a7223ebb0f2e54ea8c87a813461acb5449a",class:"row mb-3"},i("iframe-input",{key:"27390ec2ac66557c2a12a38f1bc88dab0415fe57",inputId:"accountNumber",ref:t=>this.accountNumberIframeElement=t,label:"Account Number",iframeOrigin:`${this.iframeOrigin}/v2/accountNumber`})),i("div",{key:"59063a5784405bba8800d1595aecd2748ea9a058",class:"row"},i("iframe-input",{key:"fcad3cd545486450882258b86398c2bf84afca74",inputId:"routingNumber",ref:t=>this.routingNumberIframeElement=t,label:"Routing Number",iframeOrigin:`${this.iframeOrigin}/v2/routingNumber`}))))}},p=class{constructor(i){t(this,i),this.iframeOrigin=void 0}async validate(){const t=await this.cardNumberIframeElement.validate(),i=await this.expirationMonthIframeElement.validate(),e=await this.expirationYearIframeElement.validate(),s=await this.cvvIframeElement.validate();return t&&i&&e&&s}async tokenize(t,i,e){return this.cardNumberIframeElement.tokenize(t,i,e)}render(){return i(e,{key:"5dfd2c79d7691744614af89d0919e58db17434b3",class:"container-fluid p-0"},i("div",{key:"307e9a7acd80285a59369e813bb0172627395cf6",class:"mb-3"},i("iframe-input",{key:"42de95d9e8f6b785e0dfd7a9b79b23e8c1aab4ee",inputId:"cardNumber",ref:t=>this.cardNumberIframeElement=t,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber`})),i("div",{key:"9ab568a45c652478daa2fdd936cb49258b8bdd18",class:"row"},i("div",{key:"ee106aa794d4fb0bbcab36f6daada68740bb4262",class:"col-4 align-content-end"},i("iframe-input",{key:"c2edb5592c479763a47d399d4d0428d5468f6be5",inputId:"expirationMonth",ref:t=>this.expirationMonthIframeElement=t,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth`})),i("div",{key:"e9577f47e9d3fea9be62fbbde95dc890091c47e0",class:"col-4 align-content-end"},i("iframe-input",{key:"2f623e190959ed454c3016637f90f38c531d9062",inputId:"expirationYear",ref:t=>this.expirationYearIframeElement=t,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear`})),i("div",{key:"4522288e5e0f1b41dc89a690830bb78063ea4df0",class:"col-4 align-content-end"},i("iframe-input",{key:"9036d997bcd4f8c73e63daa3997111803bc99a36",inputId:"CVV",ref:t=>this.cvvIframeElement=t,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV`}))))}},v=class{constructor(i){t(this,i),this.isFocused=!1,this.errorText=""}async componentDidLoad(){const t=await this.getBaseFontStyles();a("fontStyles",t);const i=await this.getFocusedStyles();a("focused",i);const e=await this.getFocusedAndInvalidStyles();a("focusedAndInvalid",e)}async getBaseFontStyles(){return new Promise((t=>{setTimeout((()=>{const i=getComputedStyle(this.hiddenInput);t({fontFamily:i.fontFamily,fontSize:i.fontSize,fontWeight:i.fontWeight,lineHeight:i.lineHeight,margin:i.margin,padding:i.padding,color:i.color})}),500)}))}async getFocusedStyles(){return new Promise((t=>{this.hiddenInput.focus(),setTimeout((()=>{this.hiddenInput.blur();let i=getComputedStyle(this.hiddenInput);t({boxShadow:i.boxShadow,border:i.border})}),500)}))}async getFocusedAndInvalidStyles(){return new Promise((t=>{this.hiddenInput.focus(),this.errorText="Error",setTimeout((()=>{const i=getComputedStyle(this.hiddenInput),e={boxShadow:i.boxShadow,border:i.border};this.hiddenInput.blur(),t(e)}),500)}))}get part(){return this.isFocused&&this.errorText?n:this.errorText?o:this.isFocused?d:r}render(){return i(e,{key:"21c26d386f4e23af0e0ef069ad0263e252c8c15b"},i("input",{key:"70bb1f6c7c5e94a96fddfe82d1831df12771f0af",ref:t=>this.hiddenInput=t,type:"text",class:this.errorText?"form-control is-invalid":"form-control",onFocus:()=>this.isFocused=!0,onBlur:()=>this.isFocused=!1,part:this.part,tabindex:"-1",style:{height:"0",opacity:"0",pointerEvents:"none",animation:"none"}}))}},y=class{constructor(i){t(this,i),this.legend=void 0,this.hideCardBillingForm=void 0,this.paymentMethodType=void 0}get hideFullBillingForm(){return this.hideCardBillingForm&&"card"===this.paymentMethodType}async fill(t){this.hideFullBillingForm?this.postalFormRef.fill(t):this.billingFormRef.fill(t)}async getValues(){return this.hideFullBillingForm?this.postalFormRef.getValues():this.billingFormRef.getValues()}async validate(){return this.hideFullBillingForm?this.postalFormRef.validate():this.billingFormRef.validate()}get renderedForm(){return this.hideFullBillingForm?i("postal-form",{ref:t=>this.postalFormRef=t}):i("div",null,i(l,{text:"Billing address",class:"fs-6 fw-bold lh-lg mb-4"}),i("billing-form",{ref:t=>this.billingFormRef=t}))}render(){return i(e,{key:"585ffd5fea9537675f0df77e1e4697a53dacf56f"},i("div",{key:"fb7cf4c2f763d64512b6f905aa29aded8060374c",part:h},this.renderedForm))}},k={bankAccount:"New bank account",card:"New credit or debit card"},g=class{constructor(i){t(this,i),this.paymentMethodOptionSelected=s(this,"paymentMethodOptionSelected",7),this.onPaymentMethodOptionClick=t=>{t.preventDefault(),this.paymentMethodOptionSelected.emit(this.paymentMethodOption)},this.authToken=void 0,this.accountId=void 0,this.paymentMethodOption=void 0,this.paymentMethodGroupId=void 0,this.isSelected=void 0,this.hideCardBillingForm=void 0,this.iframeOrigin=void 0,this.saveNewPaymentMethodChecked=!1}handleCheckboxChanged(t){this.saveNewPaymentMethodChecked=t.detail}async fillBillingForm(t){this.billingFormWrapperRef.fill(t)}async resolvePaymentMethod(t){var i,e;if(this.paymentMethodFormRef&&this.billingFormWrapperRef)try{if(!await this.validate()||!t.isValid)return{validationError:!0};const s=await this.tokenize();if(s.error)return{error:s.error};{const t=s.data;return{token:(null===(i=t.card)||void 0===i?void 0:i.token)||(null===(e=t.bank_account)||void 0===e?void 0:e.token),data:t}}}catch(t){return{error:t}}}async validate(){const t=await this.billingFormWrapperRef.validate(),i=await this.paymentMethodFormRef.validate();return t.isValid&&i.isValid}async tokenize(){try{const t=await this.billingFormWrapperRef.getValues();let i;i=this.saveNewPaymentMethodChecked?Object.assign(Object.assign({},t),{payment_method_group_id:this.paymentMethodGroupId}):Object.assign({},t);const e=this.authToken;return await this.paymentMethodFormRef.tokenize(e,i,this.accountId)}catch(t){return t}}showNewPaymentMethodForm(){var t;const e=null===(t=this.paymentMethodOption)||void 0===t?void 0:t.id;return i("div",{class:"mt-4 pb-4"},i("hidden-input",null),i("div",{class:"mb-4"},i("card"===e?"card-form":"bank-account-form",{ref:t=>this.paymentMethodFormRef=t,iframeOrigin:this.iframeOrigin})),i("justifi-billing-form-wrapper",{ref:t=>this.billingFormWrapperRef=t,hideCardBillingForm:this.hideCardBillingForm,paymentMethodType:e}),i("justifi-save-new-payment-method",{hidden:!this.paymentMethodGroupId}))}render(){var t,s;return i(e,{key:"17b922ca3b03d458a0e139be895db31b33c255ed",class:"payment-method"},i("div",{key:"5d1bb3a05e7fc0516d29ade315f13c2f64d3afaf",class:"radio-list-item p-3",part:c,onClick:this.onPaymentMethodOptionClick},i("form-control-radio",{key:"165fd1b54a6d387be307f05ab67078e0d703f0b1",name:"paymentMethodType",value:null===(t=this.paymentMethodOption)||void 0===t?void 0:t.id,checked:this.isSelected,label:k[null===(s=this.paymentMethodOption)||void 0===s?void 0:s.id]})),this.isSelected?this.showNewPaymentMethodForm():null)}};class w{constructor(t){this.id=t.id,this.brand=t.brand,this.acct_last_four=t.acct_last_four,this.type=m(t.type)}}var _;!function(t){t.american_express="American Express",t.diners_club="Diners Club",t.discover="Discover",t.jcb="JCB",t.mastercard="Mastercard",t.china_unionpay="UnionPay",t.visa="Visa",t.unknown="Unknown"}(_||(_={}));const C=class{constructor(i){t(this,i),this.showCard=void 0,this.showAch=void 0,this.showBnpl=void 0,this.showSavedPaymentMethods=void 0,this.paymentMethodGroupId=void 0,this.bnpl=void 0,this.insuranceToggled=void 0,this.authToken=void 0,this.accountId=void 0,this.savedPaymentMethods=[],this.paymentAmount=void 0,this.hideCardBillingForm=void 0,this.iframeOrigin=void 0,this.selectedPaymentMethodId=void 0,this.paymentMethodOptions=[]}async fillBillingForm(t){const i=this.selectedPaymentMethodOptionRef;i.fillBillingForm&&i.fillBillingForm(t)}connectedCallback(){this.paymentMethodsChanged()}paymentMethodsChanged(){var t,i;this.paymentMethodOptions=this.savedPaymentMethods.map((t=>new w(t))).filter((t=>(this.showCard||t.type!==f.card)&&(this.showAch||t.type!==f.bankAccount))),this.showBnpl&&"sezzle"===(null===(t=this.bnpl)||void 0===t?void 0:t.provider)&&!this.insuranceToggled&&this.paymentMethodOptions.push(new w({id:f.sezzle})),this.showCard&&this.paymentMethodOptions.push(new w({id:f.card})),this.showAch&&this.paymentMethodOptions.push(new w({id:f.bankAccount})),this.selectedPaymentMethodId||(this.selectedPaymentMethodId=null===(i=this.paymentMethodOptions[0])||void 0===i?void 0:i.id)}paymentMethodOptionSelected(t){this.selectedPaymentMethodId=t.detail.id}async resolvePaymentMethod(t){var i;return await(null===(i=this.selectedPaymentMethodOptionRef)||void 0===i?void 0:i.resolvePaymentMethod(t))}render(){var t;return i(e,{key:"24e7d418958eb61f9582317e615502e77b4090d0"},null===(t=this.paymentMethodOptions)||void 0===t?void 0:t.map((t=>{const e=this.selectedPaymentMethodId===t.id,s=t.id===f.sezzle;return t.id===f.card||t.id===f.bankAccount?i("justifi-new-payment-method",{paymentMethodOption:t,authToken:this.authToken,"account-id":this.accountId,"is-selected":e,paymentMethodGroupId:this.paymentMethodGroupId,hideCardBillingForm:this.hideCardBillingForm,iframeOrigin:this.iframeOrigin,ref:t=>{e&&(this.selectedPaymentMethodOptionRef=t)}}):s?i("justifi-sezzle-payment-method",{paymentMethodOption:t,"is-selected":e,paymentAmount:this.paymentAmount,bnpl:this.bnpl,ref:t=>{e&&(this.selectedPaymentMethodOptionRef=t)}}):this.showSavedPaymentMethods?i("justifi-saved-payment-method",{paymentMethodOption:t,"is-selected":e,ref:t=>{e&&(this.selectedPaymentMethodOptionRef=t)}}):void 0})))}static get watchers(){return{savedPaymentMethods:["paymentMethodsChanged"]}}},M=class{constructor(i){t(this,i),this.checkboxChanged=s(this,"checkboxChanged",7),this.isChecked=!1}handleCheckboxChange(t,i){this.isChecked=i,this.checkboxChanged.emit(this.isChecked)}render(){return i("div",{key:"86520e5820d9e6ef19946566b31912c5b1050bf6",class:"mt-4 form-check"},i("form-control-checkbox",{key:"cc87b708b88aaf4b1f1a93f6b6ebfdd030f87bc0",label:"Save new payment method",name:"saveNewPaymentMethod",checked:this.isChecked,inputHandler:this.handleCheckboxChange.bind(this)}))}},j=class{constructor(i){t(this,i),this.paymentMethodOptionSelected=s(this,"paymentMethodOptionSelected",7),this.onPaymentMethodOptionClick=t=>{t.preventDefault(),this.paymentMethodOptionSelected.emit(this.paymentMethodOption)},this.paymentMethodOption=void 0,this.isSelected=void 0}async resolvePaymentMethod(t){var i;return t.isValid?{token:null===(i=this.paymentMethodOption)||void 0===i?void 0:i.id}:{validationError:!0}}render(){var t,s,a;return i(e,{key:"34d26fc514053e2fe028a4a3ba0cbdeb8aa835f1",class:"payment-method"},i("div",{key:"da373a524b97bb91a0bc0849f0670c440f5cf5a8",class:"radio-list-item p-3",part:c,onClick:this.onPaymentMethodOptionClick},i("form-control-radio",{key:"824ebc566a018e342dd7f128c69fca873bbded45",name:"paymentMethodType",value:null===(t=this.paymentMethodOption)||void 0===t?void 0:t.id,checked:this.isSelected,label:`${_[null===(s=this.paymentMethodOption)||void 0===s?void 0:s.brand]||""} *${null===(a=this.paymentMethodOption)||void 0===a?void 0:a.acct_last_four}`})))}},z=i("img",{class:"sezzle-smart-button-logo-img",src:"https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg",alt:"Sezzle",style:{display:"inline",width:"80px",marginLeft:"5px",marginTop:"-5px"}}),x=class{constructor(i){t(this,i),this.paymentMethodOptionSelected=s(this,"paymentMethodOptionSelected",7),this.onPaymentMethodOptionClick=t=>{t.preventDefault(),this.paymentMethodOptionSelected.emit(this.paymentMethodOption)},this.initializeSezzleCheckout=()=>{let t;this.sezzlePromise=new Promise((i=>{t=i}));const i=this.bnpl,e=+this.paymentAmount,s=new(0,window.Checkout)({mode:"popup",publicKey:i.provider_client_id,apiMode:i.provider_mode,apiVersion:i.provider_api_version});s.sezzleButtonElement=this.sezzleButtonRef,s.init({onClick:function(t){t.preventDefault(),s.startCheckout({checkout_url:i.provider_checkout_url})},onComplete:i=>t({bnpl:i.data}),onCancel:i=>t({bnpl:i.data}),onFailure:i=>t({bnpl:i.data})}),this.sezzleCheckout=s,this.installmentPlan=this.sezzleCheckout.getInstallmentPlan(e)},this.bnpl=void 0,this.clientId=void 0,this.accountId=void 0,this.paymentMethodOption=void 0,this.isSelected=void 0,this.paymentAmount=void 0,this.installmentPlan=void 0,this.sezzleCheckout=void 0,this.sezzlePromise=void 0}componentDidRender(){this.scriptRef.onload=()=>{this.sezzleButtonRef=document.createElement("button"),this.initializeSezzleCheckout()}}async resolvePaymentMethod(t){return t.isValid?(this.sezzleButtonRef.click(),this.sezzlePromise):{validationError:!0}}render(){var t,s,a;return i(e,{key:"696051d9a48f0127013dcc84a25053f85ad92145",class:"payment-method"},i("script",{key:"0dec4821a85dbef872494885c32c26719423b761",src:"https://checkout-sdk.sezzle.com/checkout.min.js",async:!0,ref:t=>this.scriptRef=t}),i("div",{key:"fb9812691532a49f5c8093a989f6277d4755e531",class:"radio-list-item p-3",part:c,onClick:this.onPaymentMethodOptionClick},i("form-control-radio",{key:"3ae4c03b30a32b860231789d2f541fbfbea37bef",name:"paymentMethodType",value:null===(t=this.paymentMethodOption)||void 0===t?void 0:t.id,checked:this.isSelected,label:i("div",null,i("div",null,"Buy now, pay later with ",z),this.installmentPlan&&i("small",null,i("span",null,null===(s=this.installmentPlan)||void 0===s?void 0:s.installments.length)," ",i("span",null,this.installmentPlan.schedule," payments of")," ",i("span",{class:"fw-bold"},u(null===(a=this.installmentPlan)||void 0===a?void 0:a.installments[0].amountInCents))))})))}};export{b as bank_account_form,p as card_form,v as hidden_input,y as justifi_billing_form_wrapper,g as justifi_new_payment_method,C as justifi_payment_method_options,M as justifi_save_new_payment_method,j as justifi_saved_payment_method,x as justifi_sezzle_payment_method}
@@ -1 +1 @@
1
- import{r as e,c as t,h as s}from"./p-2783e363.js";import{f as i}from"./p-2ca5b5e4.js";import{t as a,M as d}from"./p-d8c04275.js";import{B as r}from"./p-298e290e.js";import{S as c}from"./p-bfe9748b.js";import{S as o}from"./p-aa02cf71.js";import{C as n,a as h}from"./p-14c91ffd.js";import{g as p,a as f}from"./p-8115b2f4.js";import{D as l}from"./p-960a8ec2.js";import{D as u}from"./p-667ebd79.js";import{c as b,J as y}from"./p-d91c46dc.js";import{c as v}from"./p-4bad3621.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-abdbcd8e.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import"./p-4c820f81.js";const m=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=(()=>{})})=>{var c;try{const r=await s.submitDisputeResponse(t,e,i);if(r.error){return d({error:p(r.error),code:f(null===(c=r.error)||void 0===c?void 0:c.code),severity:n.ERROR})}a(r)}catch(e){const t=f(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:n.ERROR})}finally{return r()}},k=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.submitEvent=t(this,"submit-event",7),this.dispute=void 0,this.authToken=void 0,this.isLoading=void 0}acceptDispute(){m({disputeId:this.dispute.id,authToken:this.authToken,service:new l})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:u.respondToDispute})}render(){var e,t,n,h,p,f,l;return s(c,{key:"90d2506d5bde2ea478fa3575fc162bb356b67fac"},this.isLoading&&s("div",{key:"4877ae22d3d8e312640b122c9107b6bdd8f924cb",style:{marginBottom:"8px"}},s(o,{key:"31fa0717949bbc6aa49db1c6ae0e324099ae1de2",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(o,{key:"ac5179232cb9ee33d3f3e16d9f93536ecfbf46a5",height:"18px",styles:{marginBottom:"8px"}}),s(o,{key:"c22a5e3b257d01f92de7f6188fa0758861abc747",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&s("div",{key:"be331b1a5e2fa0baf46bc593ef7ce4f5872abcff",part:a},s("h1",{key:"8094c16d3b375f28ffe314613f21ae25b63e59ef",class:"h4",part:d},"This payment is disputed"),s("p",{key:"d89ae665e1f9bd99c9338e2132c1dc56e5386696"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"2786733eac76628019993e13473d1f43c0c395ed",class:"h5"},"Dispute details"),s("div",{key:"663c28c46136bd56889b6ad0b9bfce9e5adbb590",class:"d-table gap-2"},s("div",{key:"dc688fad875d1591dcb7f31d423b61a3df2ff954",class:"d-table-row gap-2"},s("span",{key:"442db7a6e95524ca6b092794c7a4a4d987c9866e",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"0a31de8692c9b00f43fcf3c0508e4d00a221d096",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(t=this.dispute)||void 0===t?void 0:t.amount))),s("div",{key:"9fe0c1a3d3350c36fca190ae748dafe24d41b5fc",class:"d-table-row gap-2"},s("span",{key:"12165cb6671519130a5f2e0d8938aaa55e7e3ead",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"4a37ca8a7d64b97142997bb50ec11d737ac6a882",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(n=this.dispute)||void 0===n?void 0:n.reason)),s("div",{key:"4d9cf74a8ed26dd84e4ce7325d4b8703352362a4",class:"d-table-row gap-2"},s("span",{key:"8c0eaa24ebec7703eb18384b0b1f2eae8a684b55",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Dispute ID"),s("span",{key:"238813abf2ea0848e1fe817d5798b9b0d0b78ffc",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.id))),s("div",{key:"d156a7e9bf0e7214ff2164fc09b12c0b8f1d2b36",class:"d-flex gap-2 mt-4 justify-content-end"},s(r,{key:"7822fd12dfc39bd2aced043956d012fd34cc1b01",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(r,{key:"05132b3a6d1fc3d136dc227008ea1999330cdb96",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(p=this.dispute)||void 0===p?void 0:p.underReview)&&s("div",{key:"b04dd0c34f608b75ea3997a9c28ce948fa9dba5c"},s("h1",{key:"ac2a13373315703e86247b6707097af7cf2e6757",class:"h4"},"This payment is disputed and under review"),s("p",{key:"203aed553e01bbaebe44bb370a1d088c149cda06"},"The cardholder is disputing this payment. A counter dispute has been submitEvent and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"68411e62bb5c8048e995906a5f30ef1001a0bc5b"},s("h1",{key:"565feeac6e7aca35a0b72c9128c1edcb0d6a85b6",class:"h4"},"This payment was disputed"),s("p",{key:"68371d393c1f4053f19827c6e46978b3d73d2873"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(l=this.dispute)||void 0===l?void 0:l.lost)&&s("div",{key:"99d10bf25e730dda4f4596efa100b4cff7ddc0c8"},s("h1",{key:"d5c6252c4236f2e5b93925db8c9a40bab6c0253a",class:"h4"},"This payment was disputed"),s("p",{key:"773d083786d795fee7f7818f34414a7d1459925c"},"The cardholder disputed this payment and the card issuer has settled it their favor.")))}},w=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=e=>{this.errorMessage=e.detail.message,this.errorEvent.emit(e.detail)},this.updateDisputeResponse=void 0,this.submitDisputeResponse=void 0,this.createDisputeEvidence=void 0,this.errorMessage=null,this.authToken=void 0,this.disputeId=void 0,this.disputeResponse=void 0,this.apiOrigin=v.proxyApiOrigin}componentWillLoad(){b(),this.analytics=new y(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=(()=>{})})=>{var c;try{const r=await s.updateDisputeResponse(t,e,i);if(r.error)return d({error:p(r.error),code:f(null===(c=r.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(r)}catch(e){const t=f(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:n.ERROR})}finally{return r()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=(()=>{})})=>{var c;try{const r=await s.createDisputeEvidence(t,e,i);if(r.error)return d({error:p(r.error),code:f(null===(c=r.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(r)}catch(e){const t=f(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:n.ERROR})}finally{return r()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.submitDisputeResponse=m({disputeId:this.disputeId,authToken:this.authToken,service:new l})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:h.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return s(c,{key:"f45d96fd372763ebc3f786c1d2f7e06e25185afc"},s("justifi-dispute-response-core",{key:"8b551f97d8cb40f3f9e702a35b221faa8873e642","onError-event":this.handleErrorEvent,"dispute-id":this.disputeId,disputeResponse:this.disputeResponse,createDisputeEvidence:this.createDisputeEvidence,updateDisputeResponse:this.updateDisputeResponse,submitDisputeResponse:this.submitDisputeResponse}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}},j=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.submitEvent=t(this,"submit-event",7),this.componentStepMapping=[()=>s("justifi-product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url,this.isLoading=!1},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s}),this.isLoading=!1}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.onCancel=()=>{this.clickEvent.emit({name:u.cancelDispute})},this.handleSubmit=async(e,t,s)=>{this.isLoading=!0,t.length&&(this.documentList=t,await this.initializeMakePresignedURLs(),await this.initializeFileUploads()),await this.saveData(e,s),this.isLoading=!1},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))},this.updateDisputeResponse=void 0,this.submitDisputeResponse=void 0,this.createDisputeEvidence=void 0,this.disputeResponse={},this.isLoading=!1,this.documentList=[],this.currentStep=0,this.currentStepComponentRef=void 0}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"672d92a8ac0fb7f28ab9f412ae4f3516a29824dc",class:"row gy-3"},s("div",{key:"32113215c9eb6393d8d816f88715390fb5d9d604",class:"col-12"},s("h1",{key:"f224caa363ebd00d678485fd4cd2d1c646d6d8f5",class:"h4",part:d},"Counter dispute")),s("div",{key:"49e6046f57a9b30e6746f28512cf311f1999bcc3",class:"col-12"},this.currentStepComponent),s("div",{key:"6d843d19c9bf7ee026981bdc2ffd5108c25c741a",class:"col-12"},s("div",{key:"dd52a249cc37b3cfc912e04502caf96218cade78",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(r,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(r,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(r,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(r,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next"))))}};export{k as justifi_dispute_notification,w as justifi_dispute_response,j as justifi_dispute_response_core}
1
+ import{r as e,c as t,h as s}from"./p-2783e363.js";import{f as i}from"./p-2ca5b5e4.js";import{t as a,M as d}from"./p-d8c04275.js";import{B as r}from"./p-298e290e.js";import{S as c}from"./p-bfe9748b.js";import{S as o}from"./p-aa02cf71.js";import{C as n,a as h}from"./p-14c91ffd.js";import{g as p,a as f}from"./p-8115b2f4.js";import{D as l}from"./p-960a8ec2.js";import{D as u}from"./p-667ebd79.js";import{c as b,J as y}from"./p-933537ca.js";import{c as v}from"./p-4bad3621.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-abdbcd8e.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import"./p-b2edb944.js";const m=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=(()=>{})})=>{var c;try{const r=await s.submitDisputeResponse(t,e,i);if(r.error){return d({error:p(r.error),code:f(null===(c=r.error)||void 0===c?void 0:c.code),severity:n.ERROR})}a(r)}catch(e){const t=f(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:n.ERROR})}finally{return r()}},k=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.submitEvent=t(this,"submit-event",7),this.dispute=void 0,this.authToken=void 0,this.isLoading=void 0}acceptDispute(){m({disputeId:this.dispute.id,authToken:this.authToken,service:new l})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:u.respondToDispute})}render(){var e,t,n,h,p,f,l;return s(c,{key:"90d2506d5bde2ea478fa3575fc162bb356b67fac"},this.isLoading&&s("div",{key:"4877ae22d3d8e312640b122c9107b6bdd8f924cb",style:{marginBottom:"8px"}},s(o,{key:"31fa0717949bbc6aa49db1c6ae0e324099ae1de2",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(o,{key:"ac5179232cb9ee33d3f3e16d9f93536ecfbf46a5",height:"18px",styles:{marginBottom:"8px"}}),s(o,{key:"c22a5e3b257d01f92de7f6188fa0758861abc747",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&s("div",{key:"be331b1a5e2fa0baf46bc593ef7ce4f5872abcff",part:a},s("h1",{key:"8094c16d3b375f28ffe314613f21ae25b63e59ef",class:"h4",part:d},"This payment is disputed"),s("p",{key:"d89ae665e1f9bd99c9338e2132c1dc56e5386696"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"2786733eac76628019993e13473d1f43c0c395ed",class:"h5"},"Dispute details"),s("div",{key:"663c28c46136bd56889b6ad0b9bfce9e5adbb590",class:"d-table gap-2"},s("div",{key:"dc688fad875d1591dcb7f31d423b61a3df2ff954",class:"d-table-row gap-2"},s("span",{key:"442db7a6e95524ca6b092794c7a4a4d987c9866e",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"0a31de8692c9b00f43fcf3c0508e4d00a221d096",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(t=this.dispute)||void 0===t?void 0:t.amount))),s("div",{key:"9fe0c1a3d3350c36fca190ae748dafe24d41b5fc",class:"d-table-row gap-2"},s("span",{key:"12165cb6671519130a5f2e0d8938aaa55e7e3ead",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"4a37ca8a7d64b97142997bb50ec11d737ac6a882",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(n=this.dispute)||void 0===n?void 0:n.reason)),s("div",{key:"4d9cf74a8ed26dd84e4ce7325d4b8703352362a4",class:"d-table-row gap-2"},s("span",{key:"8c0eaa24ebec7703eb18384b0b1f2eae8a684b55",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Dispute ID"),s("span",{key:"238813abf2ea0848e1fe817d5798b9b0d0b78ffc",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.id))),s("div",{key:"d156a7e9bf0e7214ff2164fc09b12c0b8f1d2b36",class:"d-flex gap-2 mt-4 justify-content-end"},s(r,{key:"7822fd12dfc39bd2aced043956d012fd34cc1b01",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(r,{key:"05132b3a6d1fc3d136dc227008ea1999330cdb96",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(p=this.dispute)||void 0===p?void 0:p.underReview)&&s("div",{key:"b04dd0c34f608b75ea3997a9c28ce948fa9dba5c"},s("h1",{key:"ac2a13373315703e86247b6707097af7cf2e6757",class:"h4"},"This payment is disputed and under review"),s("p",{key:"203aed553e01bbaebe44bb370a1d088c149cda06"},"The cardholder is disputing this payment. A counter dispute has been submitEvent and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"68411e62bb5c8048e995906a5f30ef1001a0bc5b"},s("h1",{key:"565feeac6e7aca35a0b72c9128c1edcb0d6a85b6",class:"h4"},"This payment was disputed"),s("p",{key:"68371d393c1f4053f19827c6e46978b3d73d2873"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(l=this.dispute)||void 0===l?void 0:l.lost)&&s("div",{key:"99d10bf25e730dda4f4596efa100b4cff7ddc0c8"},s("h1",{key:"d5c6252c4236f2e5b93925db8c9a40bab6c0253a",class:"h4"},"This payment was disputed"),s("p",{key:"773d083786d795fee7f7818f34414a7d1459925c"},"The cardholder disputed this payment and the card issuer has settled it their favor.")))}},w=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=e=>{this.errorMessage=e.detail.message,this.errorEvent.emit(e.detail)},this.updateDisputeResponse=void 0,this.submitDisputeResponse=void 0,this.createDisputeEvidence=void 0,this.errorMessage=null,this.authToken=void 0,this.disputeId=void 0,this.disputeResponse=void 0,this.apiOrigin=v.proxyApiOrigin}componentWillLoad(){b(),this.analytics=new y(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=(()=>{})})=>{var c;try{const r=await s.updateDisputeResponse(t,e,i);if(r.error)return d({error:p(r.error),code:f(null===(c=r.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(r)}catch(e){const t=f(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:n.ERROR})}finally{return r()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:d,final:r=(()=>{})})=>{var c;try{const r=await s.createDisputeEvidence(t,e,i);if(r.error)return d({error:p(r.error),code:f(null===(c=r.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(r)}catch(e){const t=f(null==e?void 0:e.code);return d({error:e.message||e,code:t,severity:n.ERROR})}finally{return r()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.submitDisputeResponse=m({disputeId:this.disputeId,authToken:this.authToken,service:new l})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:h.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return s(c,{key:"f45d96fd372763ebc3f786c1d2f7e06e25185afc"},s("justifi-dispute-response-core",{key:"8b551f97d8cb40f3f9e702a35b221faa8873e642","onError-event":this.handleErrorEvent,"dispute-id":this.disputeId,disputeResponse:this.disputeResponse,createDisputeEvidence:this.createDisputeEvidence,updateDisputeResponse:this.updateDisputeResponse,submitDisputeResponse:this.submitDisputeResponse}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}},j=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.submitEvent=t(this,"submit-event",7),this.componentStepMapping=[()=>s("justifi-product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse}),()=>s("justifi-additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url,this.isLoading=!1},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s}),this.isLoading=!1}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.onCancel=()=>{this.clickEvent.emit({name:u.cancelDispute})},this.handleSubmit=async(e,t,s)=>{this.isLoading=!0,t.length&&(this.documentList=t,await this.initializeMakePresignedURLs(),await this.initializeFileUploads()),await this.saveData(e,s),this.isLoading=!1},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))},this.updateDisputeResponse=void 0,this.submitDisputeResponse=void 0,this.createDisputeEvidence=void 0,this.disputeResponse={},this.isLoading=!1,this.documentList=[],this.currentStep=0,this.currentStepComponentRef=void 0}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"672d92a8ac0fb7f28ab9f412ae4f3516a29824dc",class:"row gy-3"},s("div",{key:"32113215c9eb6393d8d816f88715390fb5d9d604",class:"col-12"},s("h1",{key:"f224caa363ebd00d678485fd4cd2d1c646d6d8f5",class:"h4",part:d},"Counter dispute")),s("div",{key:"49e6046f57a9b30e6746f28512cf311f1999bcc3",class:"col-12"},this.currentStepComponent),s("div",{key:"6d843d19c9bf7ee026981bdc2ffd5108c25c741a",class:"col-12"},s("div",{key:"dd52a249cc37b3cfc912e04502caf96218cade78",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(r,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(r,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(r,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(r,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next"))))}};export{k as justifi_dispute_notification,w as justifi_dispute_response,j as justifi_dispute_response_core}
@@ -1 +1 @@
1
- import{r as s,c as i,h as t}from"./p-2783e363.js";import{c as e,J as o}from"./p-d91c46dc.js";import{a as r,C as n}from"./p-14c91ffd.js";import{m as a,a as h}from"./p-f2f2e20e.js";import{B as p}from"./p-35b00a0d.js";import{A as d,c}from"./p-4bad3621.js";import"./p-4c820f81.js";import"./p-8115b2f4.js";class u{async postProvisioning(s,i,t){const e={business_id:i,product_category:t};return d({authToken:s,apiOrigin:c.proxyApiOrigin}).post("entities/provisioning",e)}}const m=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.postProvisioning=void 0,this.getBusiness=void 0,this.businessId=void 0,this.authToken=void 0,this.allowOptionalFields=!1,this.formTitle="Business Information"}propChanged(){this.initializeApi()}componentWillLoad(){e(),this.analytics=new o(this),this.initializeApi()}disconnectedCallback(){this.analytics.cleanup()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new p}),this.postProvisioning=h({authToken:this.authToken,businessId:this.businessId,product:"payment",service:new u})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:r.MISSING_PROPS,severity:n.ERROR})}render(){return t("justifi-payment-provisioning-core",{key:"ca4b13afe923312bd51d477eae50099876991599",businessId:this.businessId,authToken:this.authToken,allowOptionalFields:this.allowOptionalFields,formTitle:this.formTitle,getBusiness:this.getBusiness,postProvisioning:this.postProvisioning})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}};export{m as justifi_payment_provisioning}
1
+ import{r as s,c as i,h as t}from"./p-2783e363.js";import{c as e,J as o}from"./p-933537ca.js";import{a as r,C as n}from"./p-14c91ffd.js";import{m as a,a as h}from"./p-f2f2e20e.js";import{B as p}from"./p-35b00a0d.js";import{A as d,c}from"./p-4bad3621.js";import"./p-b2edb944.js";import"./p-8115b2f4.js";class u{async postProvisioning(s,i,t){const e={business_id:i,product_category:t};return d({authToken:s,apiOrigin:c.proxyApiOrigin}).post("entities/provisioning",e)}}const m=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.postProvisioning=void 0,this.getBusiness=void 0,this.businessId=void 0,this.authToken=void 0,this.allowOptionalFields=!1,this.formTitle="Business Information"}propChanged(){this.initializeApi()}componentWillLoad(){e(),this.analytics=new o(this),this.initializeApi()}disconnectedCallback(){this.analytics.cleanup()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new p}),this.postProvisioning=h({authToken:this.authToken,businessId:this.businessId,product:"payment",service:new u})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:r.MISSING_PROPS,severity:n.ERROR})}render(){return t("justifi-payment-provisioning-core",{key:"ca4b13afe923312bd51d477eae50099876991599",businessId:this.businessId,authToken:this.authToken,allowOptionalFields:this.allowOptionalFields,formTitle:this.formTitle,getBusiness:this.getBusiness,postProvisioning:this.postProvisioning})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}};export{m as justifi_payment_provisioning}
@@ -1 +1 @@
1
- import{r as t,c as i,h as s}from"./p-2783e363.js";import{C as e,a as r}from"./p-14c91ffd.js";import{c as o,J as a}from"./p-d91c46dc.js";import{a as p}from"./p-abdbcd8e.js";import{g as c,a as n}from"./p-8115b2f4.js";import{D as h}from"./p-960a8ec2.js";import{c as d}from"./p-4bad3621.js";import"./p-4c820f81.js";import"./p-7c31ec70.js";import"./p-2ca5b5e4.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";const m=class{constructor(s){t(this,s),this.errorEvent=i(this,"error-event",7),this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.disputeId=void 0,this.authToken=void 0,this.apiOrigin=d.proxyApiOrigin,this.getDispute=void 0,this.errorMessage=null}componentWillLoad(){o(),this.analytics=new a(this),this.initializeGetDispute()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetDispute()}initializeGetDispute(){this.disputeId&&this.authToken?this.getDispute=(({id:t,authToken:i,service:s,apiOrigin:r})=>async({onSuccess:o,onError:a})=>{var h;try{const d=await s.fetchDispute(t,i,r);if(d.error)return a({error:c(d.error),code:n(null===(h=d.error)||void 0===h?void 0:h.code),severity:e.ERROR});{const t=Object.assign({},d.page_info);o({dispute:new p(d.data),pagingInfo:t})}}catch(t){const i=n(null==t?void 0:t.code);return a({error:t.message||t,code:i,severity:e.ERROR})}})({id:this.disputeId,authToken:this.authToken,service:new h,apiOrigin:this.apiOrigin}):(this.errorMessage="Dispute ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:r.MISSING_PROPS,severity:e.ERROR}))}render(){return s("justifi-dispute-management-core",{key:"ac225c68cd03070f60bf00bef92ddcc8d5fe4e47",getDispute:this.getDispute,disputeId:this.disputeId,authToken:this.authToken,"onError-event":this.handleErrorEvent})}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_dispute_management}
1
+ import{r as t,c as i,h as s}from"./p-2783e363.js";import{C as e,a as r}from"./p-14c91ffd.js";import{c as o,J as a}from"./p-933537ca.js";import{a as p}from"./p-abdbcd8e.js";import{g as n,a as c}from"./p-8115b2f4.js";import{D as h}from"./p-960a8ec2.js";import{c as d}from"./p-4bad3621.js";import"./p-b2edb944.js";import"./p-7c31ec70.js";import"./p-2ca5b5e4.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";const m=class{constructor(s){t(this,s),this.errorEvent=i(this,"error-event",7),this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.disputeId=void 0,this.authToken=void 0,this.apiOrigin=d.proxyApiOrigin,this.getDispute=void 0,this.errorMessage=null}componentWillLoad(){o(),this.analytics=new a(this),this.initializeGetDispute()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetDispute()}initializeGetDispute(){this.disputeId&&this.authToken?this.getDispute=(({id:t,authToken:i,service:s,apiOrigin:r})=>async({onSuccess:o,onError:a})=>{var h;try{const d=await s.fetchDispute(t,i,r);if(d.error)return a({error:n(d.error),code:c(null===(h=d.error)||void 0===h?void 0:h.code),severity:e.ERROR});{const t=Object.assign({},d.page_info);o({dispute:new p(d.data),pagingInfo:t})}}catch(t){const i=c(null==t?void 0:t.code);return a({error:t.message||t,code:i,severity:e.ERROR})}})({id:this.disputeId,authToken:this.authToken,service:new h,apiOrigin:this.apiOrigin}):(this.errorMessage="Dispute ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:r.MISSING_PROPS,severity:e.ERROR}))}render(){return s("justifi-dispute-management-core",{key:"ac225c68cd03070f60bf00bef92ddcc8d5fe4e47",getDispute:this.getDispute,disputeId:this.disputeId,authToken:this.authToken,"onError-event":this.handleErrorEvent})}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_dispute_management}
@@ -1 +1 @@
1
- import{c as e,a as t}from"./p-5844a0f0.js";import{l as a,k as n,m as s,n as r,q as o,u as i,v as l,e as c,p as d,x as m,y as p}from"./p-de13f23c.js";const u=i=>{const l=e({line1:a.required("Enter street address"),line2:n.nullable(),city:s.required("Enter city"),state:r.required("Select state"),postal_code:o.required("Enter postal code"),country:t().required("Select country")}),c=e({line1:a.nullable(),line2:n.nullable(),city:s.nullable(),state:r.nullable(),postal_code:o.nullable(),country:t().required("Select country")});return i?c:l},f=(a,n)=>{const s=e({name:i.required(`Enter ${a} name`),title:l.required(`Enter ${a} title`),email:c.required(`Enter ${a} email`),phone:d.required("Enter phone number"),dob_full:m(a).required("Enter date of birth"),ssn_last4:t().nullable(),identification_number:p,address:u(n)}),r=e({name:i.required(`Enter ${a} name`),title:l.nullable(),email:c.nullable(),phone:d.nullable(),dob_full:m(a).nullable(),ssn_last4:t().nullable(),identification_number:p.nullable(),address:u(n)});return n?r:s};export{u as a,f as i}
1
+ import{c as e,a as t}from"./p-5844a0f0.js";import{l as a,k as n,m as s,n as r,q as o,u as i,v as l,e as c,p as m,x as d,y as p}from"./p-27c8ffa2.js";const u=i=>{const l=e({line1:a.required("Enter street address"),line2:n.nullable(),city:s.required("Enter city"),state:r.required("Select state"),postal_code:o.required("Enter postal code"),country:t().required("Select country")}),c=e({line1:a.nullable(),line2:n.nullable(),city:s.nullable(),state:r.nullable(),postal_code:o.nullable(),country:t().required("Select country")});return i?c:l},f=(a,n)=>{const s=e({name:i.required(`Enter ${a} name`),title:l.required(`Enter ${a} title`),email:c.required(`Enter ${a} email`),phone:m.required("Enter phone number"),dob_full:d(a).required("Enter date of birth"),ssn_last4:t().nullable(),identification_number:p,address:u(n)}),r=e({name:i.required(`Enter ${a} name`),title:l.nullable(),email:c.nullable(),phone:m.nullable(),dob_full:d(a).nullable(),ssn_last4:t().nullable(),identification_number:p.nullable(),address:u(n)});return n?r:s};export{u as a,f as i}
@@ -1 +1 @@
1
- import{p as t}from"./p-4c820f81.js";import{A as s,c as i}from"./p-4bad3621.js";class e{async record(t){return s({apiOrigin:i.proxyApiOrigin}).post("analytics",t)}}class a{constructor(t){this.handleCustomEvent=async t=>{await this.service.record(t)},this.service=new e,this.componentInstance=t,this.setUpBasicData(),this.setupLifecycleTracking(),this.trackCustomEvents()}get resourceId(){return this.componentInstance.accountId||this.componentInstance.businessId||this.componentInstance.paymentId||this.componentInstance.payoutId||this.componentInstance.checkoutId}setUpBasicData(){this.basicData={component_name:this.componentInstance.tagName,component_version:t.version,client_user_agent:navigator.userAgent,client_platform:navigator.userAgent,client_origin:window.location.origin,resource_id:this.resourceId}}trackCustomEvents(){this.eventEmitters=["submit-event","error-event"],this.eventEmitters.forEach((t=>{"function"==typeof this.componentInstance.addEventListener&&this.componentInstance.addEventListener(t,(s=>this.handleCustomEvent({event_type:t,data:Object.assign(Object.assign({},this.basicData),{error:s.detail})})))}))}setupLifecycleTracking(){const t=this.componentInstance.componentDidLoad;this.componentInstance.componentDidLoad=()=>{if(this.service.record({event_type:"init",data:this.basicData}),t)return t.apply(this.componentInstance)}}cleanup(){this.eventEmitters.forEach((t=>{this.componentInstance.removeEventListener(t,this.handleCustomEvent)}))}}const n=async()=>{const s=t.version,i=t.name,e=await(async t=>{const s=await fetch("https://registry.npmjs.org/"+t+"/latest");return(await s.json()).version})(i),a=e.replace(/-rc.*/,""),n=s.split("."),r=e.split(".");n[0]!==r[0]&&console.warn(`The package ${i} is out of date. The latest version is ${a}. Please update.`)};export{a as J,n as c}
1
+ import{p as t}from"./p-b2edb944.js";import{A as s,c as i}from"./p-4bad3621.js";class e{async record(t){return s({apiOrigin:i.proxyApiOrigin}).post("analytics",t)}}class a{constructor(t){this.handleCustomEvent=async t=>{await this.service.record(t)},this.service=new e,this.componentInstance=t,this.setUpBasicData(),this.setupLifecycleTracking(),this.trackCustomEvents()}get resourceId(){return this.componentInstance.accountId||this.componentInstance.businessId||this.componentInstance.paymentId||this.componentInstance.payoutId||this.componentInstance.checkoutId}setUpBasicData(){this.basicData={component_name:this.componentInstance.tagName,component_version:t.version,client_user_agent:navigator.userAgent,client_platform:navigator.userAgent,client_origin:window.location.origin,resource_id:this.resourceId}}trackCustomEvents(){this.eventEmitters=["submit-event","error-event"],this.eventEmitters.forEach((t=>{"function"==typeof this.componentInstance.addEventListener&&this.componentInstance.addEventListener(t,(s=>this.handleCustomEvent({event_type:t,data:Object.assign(Object.assign({},this.basicData),{error:s.detail})})))}))}setupLifecycleTracking(){const t=this.componentInstance.componentDidLoad;this.componentInstance.componentDidLoad=()=>{if(this.service.record({event_type:"init",data:this.basicData}),t)return t.apply(this.componentInstance)}}cleanup(){this.eventEmitters.forEach((t=>{this.componentInstance.removeEventListener(t,this.handleCustomEvent)}))}}const n=async()=>{const s=t.version,i=t.name,e=await(async t=>{const s=await fetch("https://registry.npmjs.org/"+t+"/latest");return(await s.json()).version})(i),a=e.replace(/-rc.*/,""),n=s.split("."),r=e.split(".");n[0]!==r[0]&&console.warn(`The package ${i} is out of date. The latest version is ${a}. Please update.`)};export{a as J,n as c}
@@ -1 +1 @@
1
- import{r as t,c as e,h as i}from"./p-2783e363.js";import{C as s,a as o}from"./p-14c91ffd.js";import{g as r,a as c}from"./p-8115b2f4.js";import{C as a}from"./p-fdbcd486.js";import{c as h,J as d}from"./p-d91c46dc.js";import{c as n}from"./p-4bad3621.js";import"./p-7c31ec70.js";import"./p-2ca5b5e4.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-abdbcd8e.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import"./p-4c820f81.js";const p=class{constructor(i){t(this,i),this.errorEvent=e(this,"error-event",7),this.loadedEvent=e(this,"loaded",7),this.authToken=void 0,this.checkoutId=void 0,this.disableCreditCard=void 0,this.disableBankAccount=void 0,this.disableBnpl=void 0,this.disablePaymentMethodGroup=void 0,this.hideCardBillingForm=void 0,this.iframeOrigin=n.iFrameOrigin,this.getCheckout=void 0,this.complete=void 0,this.errorMessage=""}componentWillLoad(){h(),this.analytics=new d(this),this.initializeGetCheckout()}disconnectedCallback(){this.analytics.cleanup()}initializeGetCheckout(){this.authToken&&this.checkoutId?(this.getCheckout=(({authToken:t,checkoutId:e,service:i})=>async({onSuccess:o,onError:a})=>{var h;try{const d=await i.fetchCheckout(t,e);if(d.error)return a({error:r(d.error),code:c(null===(h=d.error)||void 0===h?void 0:h.code),severity:s.ERROR});o({checkout:d.data})}catch(t){const e=c(null==t?void 0:t.code);return a({error:t.message||t,code:e,severity:s.ERROR})}})({authToken:this.authToken,checkoutId:this.checkoutId,service:new a}),this.complete=(({authToken:t,checkoutId:e,service:i})=>async({payment:o,onSuccess:a,onError:h})=>{var d;try{const n=await i.complete(t,e,o);if(n.error)return h({error:r(n.error),code:c(null===(d=n.error)||void 0===d?void 0:d.code),severity:s.ERROR});a(n)}catch(t){const e=c(null==t?void 0:t.code);return h({error:t.message||t,code:e,severity:s.ERROR})}})({authToken:this.authToken,checkoutId:this.checkoutId,service:new a})):this.errorEvent.emit({message:"auth-token and checkout-id are required",errorCode:o.MISSING_PROPS,severity:s.ERROR})}propChanged(){this.initializeGetCheckout()}async fillBillingForm(t){this.checkoutCoreRef.fillBillingForm(t)}render(){return i("justifi-checkout-core",{key:"911e807dc0be670c6bfe59e497cacd5399481981",getCheckout:this.getCheckout,authToken:this.authToken,complete:this.complete,disableCreditCard:this.disableCreditCard,disableBankAccount:this.disableBankAccount,disableBnpl:this.disableBnpl,disablePaymentMethodGroup:this.disablePaymentMethodGroup,hideCardBillingForm:this.hideCardBillingForm,iframeOrigin:this.iframeOrigin,ref:t=>{t&&(this.checkoutCoreRef=t)}},i("div",{key:"29bcfd776e4dac5a7686a03488d0f8dad2d01a03",slot:"insurance"},i("slot",{key:"993b8872e8a40dd5111ccaeb586686a396eab2ff",name:"insurance"})))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"]}}};export{p as justifi_checkout}
1
+ import{r as t,c as e,h as i}from"./p-2783e363.js";import{C as s,a as o}from"./p-14c91ffd.js";import{g as r,a as c}from"./p-8115b2f4.js";import{C as a}from"./p-fdbcd486.js";import{c as h,J as d}from"./p-933537ca.js";import{c as n}from"./p-4bad3621.js";import"./p-7c31ec70.js";import"./p-2ca5b5e4.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-abdbcd8e.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import"./p-b2edb944.js";const p=class{constructor(i){t(this,i),this.errorEvent=e(this,"error-event",7),this.loadedEvent=e(this,"loaded",7),this.authToken=void 0,this.checkoutId=void 0,this.disableCreditCard=void 0,this.disableBankAccount=void 0,this.disableBnpl=void 0,this.disablePaymentMethodGroup=void 0,this.hideCardBillingForm=void 0,this.iframeOrigin=n.iFrameOrigin,this.getCheckout=void 0,this.complete=void 0,this.errorMessage=""}componentWillLoad(){h(),this.analytics=new d(this),this.initializeGetCheckout()}disconnectedCallback(){this.analytics.cleanup()}initializeGetCheckout(){this.authToken&&this.checkoutId?(this.getCheckout=(({authToken:t,checkoutId:e,service:i})=>async({onSuccess:o,onError:a})=>{var h;try{const d=await i.fetchCheckout(t,e);if(d.error)return a({error:r(d.error),code:c(null===(h=d.error)||void 0===h?void 0:h.code),severity:s.ERROR});o({checkout:d.data})}catch(t){const e=c(null==t?void 0:t.code);return a({error:t.message||t,code:e,severity:s.ERROR})}})({authToken:this.authToken,checkoutId:this.checkoutId,service:new a}),this.complete=(({authToken:t,checkoutId:e,service:i})=>async({payment:o,onSuccess:a,onError:h})=>{var d;try{const n=await i.complete(t,e,o);if(n.error)return h({error:r(n.error),code:c(null===(d=n.error)||void 0===d?void 0:d.code),severity:s.ERROR});a(n)}catch(t){const e=c(null==t?void 0:t.code);return h({error:t.message||t,code:e,severity:s.ERROR})}})({authToken:this.authToken,checkoutId:this.checkoutId,service:new a})):this.errorEvent.emit({message:"auth-token and checkout-id are required",errorCode:o.MISSING_PROPS,severity:s.ERROR})}propChanged(){this.initializeGetCheckout()}async fillBillingForm(t){this.checkoutCoreRef.fillBillingForm(t)}render(){return i("justifi-checkout-core",{key:"911e807dc0be670c6bfe59e497cacd5399481981",getCheckout:this.getCheckout,authToken:this.authToken,complete:this.complete,disableCreditCard:this.disableCreditCard,disableBankAccount:this.disableBankAccount,disableBnpl:this.disableBnpl,disablePaymentMethodGroup:this.disablePaymentMethodGroup,hideCardBillingForm:this.hideCardBillingForm,iframeOrigin:this.iframeOrigin,ref:t=>{t&&(this.checkoutCoreRef=t)}},i("div",{key:"29bcfd776e4dac5a7686a03488d0f8dad2d01a03",slot:"insurance"},i("slot",{key:"993b8872e8a40dd5111ccaeb586686a396eab2ff",name:"insurance"})))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"]}}};export{p as justifi_checkout}
@@ -0,0 +1 @@
1
+ import{r as i,c as s,h as t}from"./p-2783e363.js";import{B as e}from"./p-298e290e.js";import{S as a}from"./p-bfe9748b.js";import{c as o,J as r}from"./p-933537ca.js";import{c as d}from"./p-4bad3621.js";import{C as c,a as h}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import"./p-d8c04275.js";import"./p-b2edb944.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";const f=class{constructor(t){i(this,t),this.errorEvent=s(this,"error-event",7),this.submitEvent=s(this,"submit-event",7),this.authToken=void 0,this.accountId=void 0,this.paymentMethodGroupId=void 0,this.submitButtonText=void 0,this.disableCreditCard=void 0,this.disableBankAccount=void 0,this.hideSubmitButton=void 0,this.hideCardBillingForm=void 0,this.iframeOrigin=d.iFrameOrigin,this.isLoading=!1}componentWillLoad(){o(),this.analytics=new r(this)}async tokenizePaymentMethod(i){let s;i&&i.preventDefault(),this.isLoading=!0;try{s=await this.paymentMethodOptionsRef.resolvePaymentMethod({isValid:!0}),s.error&&this.errorEvent.emit({errorCode:s.error.code,message:s.error.message,severity:c.ERROR})}catch(i){this.errorEvent.emit({errorCode:h.TOKENIZE_ERROR,message:i.message,severity:c.ERROR})}finally{return this.submitEvent.emit({response:s}),this.isLoading=!1,s}}async fillBillingForm(i){this.paymentMethodOptionsRef.fillBillingForm(i)}render(){return t(a,{key:"f0efb2ab8f051b0b5dafcb608c9c1b561f6f21bc"},t("form",{key:"b511a1af4e15175d7bec45c66dc030e693820563"},t("fieldset",{key:"53b78e28371b6ed69140774b6b47afcee3cb7edd"},t("div",{key:"e37c7cb04912fac8bf24bae88cfd06fb00d22325",class:"row gy-3"},t("div",{key:"103ef1da7228ab3d74065ca64ea070e1520799ff",class:"col-12"},t("justifi-payment-method-options",{key:"58d614390f0dce90d1ca85b88ce888b841457753",ref:i=>this.paymentMethodOptionsRef=i,"show-card":!this.disableCreditCard,"show-ach":!this.disableBankAccount,"show-bnpl":!1,paymentMethodGroupId:this.paymentMethodGroupId,"show-saved-payment-methods":!1,hideCardBillingForm:this.hideCardBillingForm,authToken:this.authToken,"account-id":this.accountId,iframeOrigin:this.iframeOrigin})),t("div",{key:"727317ff2fafaace929f6667934a649994fe037d",class:"col-12"},t(e,{key:"999ec3e29e37ce5027f6d1c4d75bae31beba6ab1",variant:"primary",type:"submit",onClick:i=>this.tokenizePaymentMethod(i),isLoading:this.isLoading,"data-testid":"submit-button",hidden:this.hideSubmitButton},this.submitButtonText||"Submit"))))))}};export{f as justifi_tokenize_payment_method}
@@ -1 +1 @@
1
- import{c as e}from"./p-5844a0f0.js";import{b as s,w as n,e as a,p as i,d as r,a as t,i as _,t as u,c as o,r as c,f as b,g as l,h as m,j as p,s as d,o as g}from"./p-de13f23c.js";const y=c=>{const b=e({legal_name:s.required("Enter legal name"),website_url:n.required("Enter business website url"),email:a.required("Enter business email"),phone:i.required("Enter phone number"),doing_business_as:r.nullable(),classification:t.required("Select business classification"),industry:_.required("Enter a business industry"),tax_id:u.required("Enter tax id, SSN, or EIN"),date_of_incorporation:o.required("Enter date of incorporation")}),l=e({legal_name:s.required("Enter legal name"),website_url:n.nullable(),email:a.nullable(),phone:i.nullable(),doing_business_as:r.nullable(),classification:t.nullable(),industry:_.nullable(),tax_id:u.nullable(),date_of_incorporation:o.nullable()});return c?l:b},v=s=>{const n=e({business_revenue:c.required("Enter business revenue"),business_payment_volume:b.required("Enter business payment volume"),business_when_service_received:l.required("Select when service is received"),business_recurring_payments:m.required("Select recurring payments"),business_recurring_payments_percentage:p,business_seasonal:d.required("Select business seasonal"),business_other_payment_details:g.nullable()}),a=e({business_revenue:c.nullable(),business_payment_volume:b.nullable(),business_when_service_received:l.nullable(),business_recurring_payments:m.nullable(),business_recurring_payments_percentage:p,business_seasonal:d.nullable(),business_other_payment_details:g.nullable()});return s?a:n};export{v as a,y as b}
1
+ import{c as e}from"./p-5844a0f0.js";import{b as s,w as n,e as a,p as i,d as r,a as t,i as _,t as u,c as o,r as c,f as b,g as l,h as m,j as p,s as d,o as g}from"./p-27c8ffa2.js";const y=c=>{const b=e({legal_name:s.required("Enter legal name"),website_url:n.required("Enter business website url"),email:a.required("Enter business email"),phone:i.required("Enter phone number"),doing_business_as:r.nullable(),classification:t.required("Select business classification"),industry:_.required("Enter a business industry"),tax_id:u.required("Enter tax id, SSN, or EIN"),date_of_incorporation:o.required("Enter date of incorporation")}),l=e({legal_name:s.required("Enter legal name"),website_url:n.nullable(),email:a.nullable(),phone:i.nullable(),doing_business_as:r.nullable(),classification:t.nullable(),industry:_.nullable(),tax_id:u.nullable(),date_of_incorporation:o.nullable()});return c?l:b},f=s=>{const n=e({business_revenue:c.required("Enter business revenue"),business_payment_volume:b.required("Enter business payment volume"),business_when_service_received:l.required("Select when service is received"),business_recurring_payments:m.required("Select recurring payments"),business_recurring_payments_percentage:p,business_seasonal:d.required("Select business seasonal"),business_other_payment_details:g.nullable()}),a=e({business_revenue:c.nullable(),business_payment_volume:b.nullable(),business_when_service_received:l.nullable(),business_recurring_payments:m.nullable(),business_recurring_payments_percentage:p,business_seasonal:d.nullable(),business_other_payment_details:g.nullable()});return s?a:n};export{f as a,y as b}
@@ -1 +1 @@
1
- const e={name:"@justifi/webcomponents",version:"5.3.1",description:"JustiFi Web Components",collection:"dist/collection/collection-manifest.json",main:"dist/index.cjs.js",module:"dist/module/index.js",types:"dist/module/index.d.ts",repository:{type:"git",url:"git+https://github.com/justifi-tech/web-component-library.git"},homepage:"https://storybook.justifi.ai/?path=/docs/introduction--docs",publishConfig:{registry:"https://registry.npmjs.org"},files:["dist/"],scripts:{build:"stencil build --docs",dev:"stencil build --watch",lint:"eslint . --max-warnings 0",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",generate:"stencil generate",test:"TZ=utc stencil test --spec","test:watch":"TZ=utc stencil test --spec --watchAll","test:file":"stencil test --spec --watch --"},dependencies:{"@popperjs/core":"^2.11.8","@stencil/core":"^4.0.5","@stencil/store":"^2.0.8",bootstrap:"^5.2.3","chart.js":"^4.4.1","date-fns":"^2.30.0","dinero.js":"^1.9.1","iframe-resizer":"^4.3.7",imask:"^7.6.0",lodash:"^4.17.21",rxjs:"^7.8.1","ts-dedent":"^2.2.0",uuid:"^9.0.0",yup:"^1.0.0"},devDependencies:{"@babel/preset-env":"^7.21.5","@babel/preset-react":"^7.18.6","@babel/preset-typescript":"^7.21.5","@rollup/plugin-replace":"^6.0.1","@stencil/sass":"^3.0.1","@types/jest":"27.0.3","@types/react":"^18.0.37","@types/react-dom":"^18.0.11",dotenv:"^16.3.1",jest:"^29.7.0","jest-cli":"^29.7.0","jest-environment-node":"^29.7.0","ts-jest":"^29.1.2"},license:"MIT",gitHead:"507bac1d941eae6e1f56e185ecd9bc9d22637783"};export{e as p}
1
+ const e={name:"@justifi/webcomponents",version:"5.3.2",description:"JustiFi Web Components",collection:"dist/collection/collection-manifest.json",main:"dist/index.cjs.js",module:"dist/module/index.js",types:"dist/module/index.d.ts",repository:{type:"git",url:"git+https://github.com/justifi-tech/web-component-library.git"},homepage:"https://storybook.justifi.ai/?path=/docs/introduction--docs",publishConfig:{registry:"https://registry.npmjs.org"},files:["dist/"],scripts:{build:"stencil build --docs",dev:"stencil build --watch",lint:"eslint . --max-warnings 0",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",generate:"stencil generate",test:"TZ=utc stencil test --spec","test:watch":"TZ=utc stencil test --spec --watchAll","test:file":"stencil test --spec --watch --"},dependencies:{"@popperjs/core":"^2.11.8","@stencil/core":"^4.0.5","@stencil/store":"^2.0.8",bootstrap:"^5.2.3","chart.js":"^4.4.1","date-fns":"^2.30.0","dinero.js":"^1.9.1","iframe-resizer":"^4.3.7",imask:"^7.6.0",lodash:"^4.17.21",rxjs:"^7.8.1","ts-dedent":"^2.2.0",uuid:"^9.0.0",yup:"^1.0.0"},devDependencies:{"@babel/preset-env":"^7.21.5","@babel/preset-react":"^7.18.6","@babel/preset-typescript":"^7.21.5","@rollup/plugin-replace":"^6.0.1","@stencil/sass":"^3.0.1","@types/jest":"27.0.3","@types/react":"^18.0.37","@types/react-dom":"^18.0.11",dotenv:"^16.3.1",jest:"^29.7.0","jest-cli":"^29.7.0","jest-environment-node":"^29.7.0","ts-jest":"^29.1.2"},license:"MIT",gitHead:"507bac1d941eae6e1f56e185ecd9bc9d22637783"};export{e as p}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-2783e363.js";import{C as e,a as o}from"./p-14c91ffd.js";import{C as r}from"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as a,a as c}from"./p-8115b2f4.js";import{c as h,J as n}from"./p-d91c46dc.js";import{c as p}from"./p-4bad3621.js";import{C as d}from"./p-fdbcd486.js";import{m,S as u}from"./p-a2076a0e.js";import{S as f}from"./p-bfe9748b.js";import{d as j}from"./p-e63fdbca.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-4c820f81.js";import"./p-938993c7.js";import"./p-d8c04275.js";const l=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.getCheckouts=void 0,this.getSubAccounts=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin=p.proxyApiOrigin,this.columns=j}componentWillLoad(){h(),this.analytics=new n(this),this.initializeGetData()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){this.accountId&&this.authToken?this.getCheckouts=(({accountId:t,authToken:s,service:i,apiOrigin:o})=>async({params:h,onSuccess:n,onError:p})=>{var d,m;try{const u=await i.fetchCheckouts(t,s,h,o);if(u.error)return p({error:a(u.error),code:c(null===(m=u.error)||void 0===m?void 0:m.code),severity:e.ERROR});{const t=Object.assign({},u.page_info);n({checkouts:(null===(d=u.data)||void 0===d?void 0:d.map((t=>new r(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return p({error:t.message||t,code:s,severity:e.ERROR})}})({accountId:this.accountId,authToken:this.authToken,service:new d,apiOrigin:this.apiOrigin}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new u,apiOrigin:this.apiOrigin}))}render(){return i(f,{key:"aae56ec9ac20a6ed740a5180bfedf664d7d1e0ca"},i("checkouts-list-core",{key:"933b8b41aa468c1515b64a8fb6570609454ee361",getCheckouts:this.getCheckouts,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{l as justifi_checkouts_list}
1
+ import{r as t,c as s,h as i}from"./p-2783e363.js";import{C as e,a as o}from"./p-14c91ffd.js";import{C as r}from"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as a,a as c}from"./p-8115b2f4.js";import{c as h,J as n}from"./p-933537ca.js";import{c as p}from"./p-4bad3621.js";import{C as d}from"./p-fdbcd486.js";import{m,S as u}from"./p-a2076a0e.js";import{S as f}from"./p-bfe9748b.js";import{d as j}from"./p-e63fdbca.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-b2edb944.js";import"./p-938993c7.js";import"./p-d8c04275.js";const b=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.getCheckouts=void 0,this.getSubAccounts=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin=p.proxyApiOrigin,this.columns=j}componentWillLoad(){h(),this.analytics=new n(this),this.initializeGetData()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){this.accountId&&this.authToken?this.getCheckouts=(({accountId:t,authToken:s,service:i,apiOrigin:o})=>async({params:h,onSuccess:n,onError:p})=>{var d,m;try{const u=await i.fetchCheckouts(t,s,h,o);if(u.error)return p({error:a(u.error),code:c(null===(m=u.error)||void 0===m?void 0:m.code),severity:e.ERROR});{const t=Object.assign({},u.page_info);n({checkouts:(null===(d=u.data)||void 0===d?void 0:d.map((t=>new r(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return p({error:t.message||t,code:s,severity:e.ERROR})}})({accountId:this.accountId,authToken:this.authToken,service:new d,apiOrigin:this.apiOrigin}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new u,apiOrigin:this.apiOrigin}))}render(){return i(f,{key:"aae56ec9ac20a6ed740a5180bfedf664d7d1e0ca"},i("checkouts-list-core",{key:"933b8b41aa468c1515b64a8fb6570609454ee361",getCheckouts:this.getCheckouts,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{b as justifi_checkouts_list}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-2783e363.js";import{P as e}from"./p-b15ad5df.js";import{C as r,a as o}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import{P as a}from"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as p,a as n}from"./p-8115b2f4.js";import{E as h}from"./p-8f25f016.js";import{c,J as d}from"./p-d91c46dc.js";import"./p-4bad3621.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-d8c04275.js";import"./p-4c820f81.js";const m=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.paymentService=new e,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.paymentId=void 0,this.authToken=void 0,this.getPaymentDetails=void 0,this.errorMessage=null}componentWillLoad(){c(),this.analytics=new d(this),this.initializeGetPaymentDetails()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetPaymentDetails()}initializeGetPaymentDetails(){this.paymentId&&this.authToken?this.getPaymentDetails=(({id:t,authToken:s,service:i})=>async({onSuccess:e,onError:o})=>{var h;try{const c=await i.fetchPayment(t,s);c.error?o({error:p(c.error),code:n(null===(h=c.error)||void 0===h?void 0:h.code),severity:r.ERROR}):e({payment:new a(c.data)})}catch(t){const s=n(null==t?void 0:t.code);o({error:p(t),code:s,severity:r.ERROR})}})({id:this.paymentId,authToken:this.authToken,service:new e}):(this.errorMessage="Payment ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:o.MISSING_PROPS,severity:r.ERROR}))}render(){return this.errorMessage?h(this.errorMessage):i("payment-details-core",{getPaymentDetails:this.getPaymentDetails,"onError-event":this.handleErrorEvent})}static get watchers(){return{paymentId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_payment_details}
1
+ import{r as t,c as s,h as i}from"./p-2783e363.js";import{P as e}from"./p-b15ad5df.js";import{C as r,a as o}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import{P as a}from"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as p,a as n}from"./p-8115b2f4.js";import{E as h}from"./p-8f25f016.js";import{c,J as d}from"./p-933537ca.js";import"./p-4bad3621.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-d8c04275.js";import"./p-b2edb944.js";const m=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.paymentService=new e,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.paymentId=void 0,this.authToken=void 0,this.getPaymentDetails=void 0,this.errorMessage=null}componentWillLoad(){c(),this.analytics=new d(this),this.initializeGetPaymentDetails()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetPaymentDetails()}initializeGetPaymentDetails(){this.paymentId&&this.authToken?this.getPaymentDetails=(({id:t,authToken:s,service:i})=>async({onSuccess:e,onError:o})=>{var h;try{const c=await i.fetchPayment(t,s);c.error?o({error:p(c.error),code:n(null===(h=c.error)||void 0===h?void 0:h.code),severity:r.ERROR}):e({payment:new a(c.data)})}catch(t){const s=n(null==t?void 0:t.code);o({error:p(t),code:s,severity:r.ERROR})}})({id:this.paymentId,authToken:this.authToken,service:new e}):(this.errorMessage="Payment ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:o.MISSING_PROPS,severity:r.ERROR}))}render(){return this.errorMessage?h(this.errorMessage):i("payment-details-core",{getPaymentDetails:this.getPaymentDetails,"onError-event":this.handleErrorEvent})}static get watchers(){return{paymentId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_payment_details}
@@ -1 +1 @@
1
- import{r as s,c as t,h as i}from"./p-2783e363.js";import{P as r}from"./p-b15ad5df.js";import{C as e,a as o}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import{P as a}from"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as p,a as n}from"./p-8115b2f4.js";import{c,J as d}from"./p-d91c46dc.js";import{c as h}from"./p-4bad3621.js";import{S as m}from"./p-bfe9748b.js";import{d as f}from"./p-f19f9f61.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-4c820f81.js";import"./p-94eba309.js";import"./p-938993c7.js";import"./p-d8c04275.js";const j=class{constructor(i){s(this,i),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)},this.getPayments=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin=h.proxyApiOrigin,this.columns=f}componentWillLoad(){c(),this.analytics=new d(this),this.initializeGetPayments()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetPayments()}initializeGetPayments(){this.accountId&&this.authToken?this.getPayments=(({id:s,authToken:t,service:i,apiOrigin:r})=>async({params:o,onSuccess:c,onError:d,final:h})=>{var m,f;try{const h=await i.fetchPayments(s,t,o,r);if(h.error)return d({error:p(h.error),code:n(null===(f=h.error)||void 0===f?void 0:f.code),severity:e.ERROR});{const s=Object.assign({},h.page_info);c({payments:(null===(m=h.data)||void 0===m?void 0:m.map((s=>new a(s))))||[],pagingInfo:s})}}catch(s){const t=n(null==s?void 0:s.code);return d({error:s.message||s,code:t,severity:e.ERROR})}finally{return h()}})({id:this.accountId,authToken:this.authToken,service:new r,apiOrigin:this.apiOrigin}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR}))}render(){return i(m,{key:"17c610d9339435e5aa7dc6735a0b4cde7e64753a"},i("payments-list-core",{key:"be8ddb8088e17c8966f32705f27c48a7f58fd3f1",getPayments:this.getPayments,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{j as justifi_payments_list}
1
+ import{r as s,c as t,h as i}from"./p-2783e363.js";import{P as r}from"./p-b15ad5df.js";import{C as e,a as o}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import{P as a}from"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as p,a as n}from"./p-8115b2f4.js";import{c,J as d}from"./p-933537ca.js";import{c as h}from"./p-4bad3621.js";import{S as m}from"./p-bfe9748b.js";import{d as f}from"./p-f19f9f61.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-b2edb944.js";import"./p-94eba309.js";import"./p-938993c7.js";import"./p-d8c04275.js";const j=class{constructor(i){s(this,i),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)},this.getPayments=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin=h.proxyApiOrigin,this.columns=f}componentWillLoad(){c(),this.analytics=new d(this),this.initializeGetPayments()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetPayments()}initializeGetPayments(){this.accountId&&this.authToken?this.getPayments=(({id:s,authToken:t,service:i,apiOrigin:r})=>async({params:o,onSuccess:c,onError:d,final:h})=>{var m,f;try{const h=await i.fetchPayments(s,t,o,r);if(h.error)return d({error:p(h.error),code:n(null===(f=h.error)||void 0===f?void 0:f.code),severity:e.ERROR});{const s=Object.assign({},h.page_info);c({payments:(null===(m=h.data)||void 0===m?void 0:m.map((s=>new a(s))))||[],pagingInfo:s})}}catch(s){const t=n(null==s?void 0:s.code);return d({error:s.message||s,code:t,severity:e.ERROR})}finally{return h()}})({id:this.accountId,authToken:this.authToken,service:new r,apiOrigin:this.apiOrigin}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR}))}render(){return i(m,{key:"17c610d9339435e5aa7dc6735a0b4cde7e64753a"},i("payments-list-core",{key:"be8ddb8088e17c8966f32705f27c48a7f58fd3f1",getPayments:this.getPayments,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{j as justifi_payments_list}
@@ -0,0 +1 @@
1
+ import{r as i,c as t,h as s}from"./p-2783e363.js";import{C as e,a as r}from"./p-14c91ffd.js";import{c as o,J as a}from"./p-933537ca.js";import{A as n,c}from"./p-4bad3621.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import{T as h}from"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as p,a as m}from"./p-8115b2f4.js";import{m as d,S as l}from"./p-a2076a0e.js";import{S as u}from"./p-bfe9748b.js";import{d as b}from"./p-5b72bab7.js";import"./p-b2edb944.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-938993c7.js";import"./p-d8c04275.js";class f{async fetchTerminals(i,t,s,e){e||(e=c.proxyApiOrigin);const r={Account:i};return n({authToken:t,apiOrigin:e}).get("terminals",s,null,r)}async fetchTerminal(i,t,s){s||(s=c.proxyApiOrigin);const e=`terminals/${i}`;return n({authToken:t,apiOrigin:s}).get(e)}}const j=class{constructor(s){i(this,s),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=i=>{this.errorMessage=i.detail.message,this.errorEvent.emit(i.detail)},this.getTerminals=void 0,this.getSubAccounts=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin=c.proxyApiOrigin,this.columns=b}componentWillLoad(){o(),this.analytics=new a(this),this.initializeGetData()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetTerminals(),this.initializeGetSubAccounts()}initializeGetTerminals(){this.accountId&&this.authToken?this.getTerminals=(({id:i,authToken:t,service:s,apiOrigin:r})=>async({params:o,onSuccess:a,onError:n})=>{var c,d;try{const l=await s.fetchTerminals(i,t,o,r);if(l.error)return n({error:p(l.error),code:m(null===(d=l.error)||void 0===d?void 0:d.code),severity:e.ERROR});{const i=Object.assign({},l.page_info);a({terminals:(null===(c=l.data)||void 0===c?void 0:c.map((i=>new h(i))))||[],pagingInfo:i})}}catch(i){const t=m(null==i?void 0:i.code);return n({error:i.message||i,code:t,severity:e.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new f,apiOrigin:this.apiOrigin}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=d({accountId:this.accountId,authToken:this.authToken,service:new l,apiOrigin:this.apiOrigin}))}render(){return s(u,{key:"79168b27873e1b6e7d6bfded80b646d2a95292e0"},s("terminals-list-core",{key:"2dfbc1d923cb83cc10039b4344629db17f754fbc",getTerminals:this.getTerminals,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{j as justifi_terminals_list}
@@ -1 +1 @@
1
- import{r as t,c as i,h as e}from"./p-2783e363.js";import{A as s,c as r}from"./p-4bad3621.js";import{C as o,a}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as n,a as c}from"./p-8115b2f4.js";import{c as d,J as h}from"./p-d91c46dc.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-4c820f81.js";class p{async fetchQuote(t,i){return s({authToken:t,apiOrigin:r.proxyApiOrigin}).post("insurance/quotes",i)}async toggleCoverage(t,i,e){const o=`insurance/quotes/${i}/toggle`;return s({authToken:t,apiOrigin:r.proxyApiOrigin}).post(o,e)}}const u=class{constructor(e){t(this,e),this.errorEvent=i(this,"error-event",7),this.authToken=void 0,this.checkoutId=void 0,this.primaryIdentityFirstName=void 0,this.primaryIdentityLastName=void 0,this.primaryIdentityState=void 0,this.primaryIdentityPostalCode=void 0,this.primaryIdentityCountry=void 0,this.primaryIdentityEmailAddress=void 0,this.policyAttributesInsurableAmount=void 0,this.policyAttributesStartDate=void 0,this.policyAttributesEndDate=void 0,this.coveredIdentityFirstName=void 0,this.coveredIdentityLastName=void 0,this.getQuote=void 0,this.toggleCoverage=void 0,this.quote=void 0}async validate(){return this.seasonInterruptionCoreRef.validate()}componentWillLoad(){d(),this.analytics=new h(this),this.initializeServiceMethods()}disconnectedCallback(){this.analytics&&this.analytics.cleanup()}initializeServiceMethods(){this.authToken?(this.getQuote=(({authToken:t,service:i})=>async({payload:e,onSuccess:s,onError:r})=>{var a;try{const d=await i.fetchQuote(t,e);if(d.error)return r({error:n(d.error),code:c(null===(a=d.error)||void 0===a?void 0:a.code),severity:o.ERROR});s({quote:d.data})}catch(t){const i=c(null==t?void 0:t.code);return r({error:t.message||t,code:i,severity:o.ERROR})}})({authToken:this.authToken,service:new p}),this.toggleCoverage=(({authToken:t,service:i})=>async({quoteId:e,payload:s,onSuccess:r,onError:a})=>{var d;try{const h=await i.toggleCoverage(t,e,s);if(h.error)return a({error:n(h.error),code:c(null===(d=h.error)||void 0===d?void 0:d.code),severity:o.ERROR});r({quote:h.data})}catch(t){const i=c(null==t?void 0:t.code);return a({error:t.message||t,code:i,severity:o.ERROR})}})({authToken:this.authToken,service:new p})):this.errorEvent.emit({errorCode:a.MISSING_PROPS,message:"Missing authToken",severity:o.ERROR})}render(){return e("justifi-season-interruption-insurance-core",{key:"50413e347b808cbf350573602701d5e6e7d4def5",ref:t=>this.seasonInterruptionCoreRef=t,"checkout-id":this.checkoutId,getQuote:this.getQuote,toggleCoverage:this.toggleCoverage,"primary-identity-first-name":this.primaryIdentityFirstName,"primary-identity-last-name":this.primaryIdentityLastName,"primary-identity-state":this.primaryIdentityState,"primary-identity-postal-code":this.primaryIdentityPostalCode,"primary-identity-country":this.primaryIdentityCountry,"primary-identity-email-address":this.primaryIdentityEmailAddress,"policy-attributes-insurable-amount":this.policyAttributesInsurableAmount,"policy-attributes-start-date":this.policyAttributesStartDate,"policy-attributes-end-date":this.policyAttributesEndDate,"covered-identity-first-name":this.coveredIdentityFirstName,"covered-identity-last-name":this.coveredIdentityLastName})}};export{u as justifi_season_interruption_insurance}
1
+ import{r as t,c as i,h as e}from"./p-2783e363.js";import{A as s,c as r}from"./p-4bad3621.js";import{C as o,a}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as n,a as c}from"./p-8115b2f4.js";import{c as d,J as h}from"./p-933537ca.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-b2edb944.js";class p{async fetchQuote(t,i){return s({authToken:t,apiOrigin:r.proxyApiOrigin}).post("insurance/quotes",i)}async toggleCoverage(t,i,e){const o=`insurance/quotes/${i}/toggle`;return s({authToken:t,apiOrigin:r.proxyApiOrigin}).post(o,e)}}const u=class{constructor(e){t(this,e),this.errorEvent=i(this,"error-event",7),this.authToken=void 0,this.checkoutId=void 0,this.primaryIdentityFirstName=void 0,this.primaryIdentityLastName=void 0,this.primaryIdentityState=void 0,this.primaryIdentityPostalCode=void 0,this.primaryIdentityCountry=void 0,this.primaryIdentityEmailAddress=void 0,this.policyAttributesInsurableAmount=void 0,this.policyAttributesStartDate=void 0,this.policyAttributesEndDate=void 0,this.coveredIdentityFirstName=void 0,this.coveredIdentityLastName=void 0,this.getQuote=void 0,this.toggleCoverage=void 0,this.quote=void 0}async validate(){return this.seasonInterruptionCoreRef.validate()}componentWillLoad(){d(),this.analytics=new h(this),this.initializeServiceMethods()}disconnectedCallback(){this.analytics&&this.analytics.cleanup()}initializeServiceMethods(){this.authToken?(this.getQuote=(({authToken:t,service:i})=>async({payload:e,onSuccess:s,onError:r})=>{var a;try{const d=await i.fetchQuote(t,e);if(d.error)return r({error:n(d.error),code:c(null===(a=d.error)||void 0===a?void 0:a.code),severity:o.ERROR});s({quote:d.data})}catch(t){const i=c(null==t?void 0:t.code);return r({error:t.message||t,code:i,severity:o.ERROR})}})({authToken:this.authToken,service:new p}),this.toggleCoverage=(({authToken:t,service:i})=>async({quoteId:e,payload:s,onSuccess:r,onError:a})=>{var d;try{const h=await i.toggleCoverage(t,e,s);if(h.error)return a({error:n(h.error),code:c(null===(d=h.error)||void 0===d?void 0:d.code),severity:o.ERROR});r({quote:h.data})}catch(t){const i=c(null==t?void 0:t.code);return a({error:t.message||t,code:i,severity:o.ERROR})}})({authToken:this.authToken,service:new p})):this.errorEvent.emit({errorCode:a.MISSING_PROPS,message:"Missing authToken",severity:o.ERROR})}render(){return e("justifi-season-interruption-insurance-core",{key:"50413e347b808cbf350573602701d5e6e7d4def5",ref:t=>this.seasonInterruptionCoreRef=t,"checkout-id":this.checkoutId,getQuote:this.getQuote,toggleCoverage:this.toggleCoverage,"primary-identity-first-name":this.primaryIdentityFirstName,"primary-identity-last-name":this.primaryIdentityLastName,"primary-identity-state":this.primaryIdentityState,"primary-identity-postal-code":this.primaryIdentityPostalCode,"primary-identity-country":this.primaryIdentityCountry,"primary-identity-email-address":this.primaryIdentityEmailAddress,"policy-attributes-insurable-amount":this.policyAttributesInsurableAmount,"policy-attributes-start-date":this.policyAttributesStartDate,"policy-attributes-end-date":this.policyAttributesEndDate,"covered-identity-first-name":this.coveredIdentityFirstName,"covered-identity-last-name":this.coveredIdentityLastName})}};export{u as justifi_season_interruption_insurance}