@justifi/webcomponents 4.6.2 → 4.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Api-35180a85.js → Api-f76b337f.js} +2 -2
- package/dist/cjs/Api-f76b337f.js.map +1 -0
- package/dist/cjs/justifi-business-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-business-list.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-details.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payments-list.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payout-details.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +1 -1
- package/dist/cjs/justifi-proceeds-list.cjs.entry.js +1 -1
- package/dist/collection/api/Api.js +1 -1
- package/dist/collection/api/Api.js.map +1 -1
- package/dist/components/Api.js +1 -1
- package/dist/components/Api.js.map +1 -1
- package/dist/components/payment-method-form.js +1 -1
- package/dist/esm/{Api-60524edb.js → Api-cca120a8.js} +2 -2
- package/dist/esm/Api-cca120a8.js.map +1 -0
- package/dist/esm/justifi-business-form.entry.js +1 -1
- package/dist/esm/justifi-business-list.entry.js +1 -1
- package/dist/esm/justifi-payment-details.entry.js +1 -1
- package/dist/esm/justifi-payment-method-form.entry.js +1 -1
- package/dist/esm/justifi-payments-list.entry.js +1 -1
- package/dist/esm/justifi-payout-details.entry.js +1 -1
- package/dist/esm/justifi-payouts-list.entry.js +1 -1
- package/dist/esm/justifi-proceeds-list.entry.js +1 -1
- package/dist/webcomponents/{p-ecc820e5.entry.js → p-26392ae3.entry.js} +2 -2
- package/dist/webcomponents/p-523cbe04.js +2 -0
- package/dist/webcomponents/{p-c44e1415.js.map → p-523cbe04.js.map} +1 -1
- package/dist/webcomponents/{p-84c72d6d.entry.js → p-69a1bec2.entry.js} +2 -2
- package/dist/webcomponents/{p-659ee5b4.entry.js → p-6a0c8dec.entry.js} +2 -2
- package/dist/webcomponents/{p-9c9cb767.entry.js → p-87410719.entry.js} +2 -2
- package/dist/webcomponents/{p-084f3fb5.entry.js → p-881edb4d.entry.js} +2 -2
- package/dist/webcomponents/{p-01c1b41e.entry.js → p-9d1c7e6a.entry.js} +2 -2
- package/dist/webcomponents/{p-74685901.entry.js → p-dabeb3df.entry.js} +2 -2
- package/dist/webcomponents/{p-9db1c296.entry.js → p-e41fb562.entry.js} +2 -2
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +2 -2
- package/dist/cjs/Api-35180a85.js.map +0 -1
- package/dist/esm/Api-60524edb.js.map +0 -1
- package/dist/webcomponents/p-c44e1415.js +0 -2
- /package/dist/webcomponents/{p-ecc820e5.entry.js.map → p-26392ae3.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-84c72d6d.entry.js.map → p-69a1bec2.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-659ee5b4.entry.js.map → p-6a0c8dec.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-9c9cb767.entry.js.map → p-87410719.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-084f3fb5.entry.js.map → p-881edb4d.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-01c1b41e.entry.js.map → p-9d1c7e6a.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-74685901.entry.js.map → p-dabeb3df.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-9db1c296.entry.js.map → p-e41fb562.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as n,h as t,H as o}from"./p-e70b2a21.js";function i(e,n,t){return t={path:n,exports:{},require:function(e,n){return r()}},e(t,t.exports),t.exports}function r(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var s=i((function(e){(function(n){if(typeof window==="undefined")return;var t=0,o=false,i=false,r="message",s=r.length,a="[iFrameSizer]",c=a.length,f=null,u=window.requestAnimationFrame,d=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),l={},m=null,h=Object.freeze({autoResize:true,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:true,inPageLinks:false,enablePublicMethods:true,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:false,maxHeight:Infinity,maxWidth:Infinity,minHeight:0,minWidth:0,mouseEvents:true,resizeFrom:"parent",scrolling:false,sizeHeight:true,sizeWidth:false,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return true},onClosed:function(){},onInit:function(){},onMessage:function(){z("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return true}});function b(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function g(e,n,t){e.addEventListener(n,t,false)}function w(e,n,t){e.removeEventListener(n,t,false)}function p(){var e=["moz","webkit","o","ms"];var n;for(n=0;n<e.length&&!u;n+=1){u=window[e[n]+"RequestAnimationFrame"]}if(u){u=u.bind(window)}else{k("setup","RequestAnimationFrame not supported")}}function y(e){var n="Host page: "+e;if(window.top!==window.self){n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e}return n}function v(e){return a+"["+y(e)+"]"}function j(e){return l[e]?l[e].log:o}function k(e,n){M("log",e,n,j(e))}function x(e,n){M("info",e,n,j(e))}function z(e,n){M("warn",e,n,true)}function M(e,n,t,o){if(true===o&&"object"===typeof window.console){console[e](v(n),t)}}function F(e){function n(){function e(){W(G);N(Q);q("onResized",G)}r("Height");r("Width");R(e,G,"init")}function t(){var e=B.slice(c).split(":");var n=e[1]?parseInt(e[1],10):0;var t=l[e[0]]&&l[e[0]].iframe;var r=getComputedStyle(t);return{iframe:t,id:e[0],height:n+o(r)+i(r),width:e[2],type:e[3]}}function o(e){if(e.boxSizing!=="border-box"){return 0}var n=e.paddingTop?parseInt(e.paddingTop,10):0;var t=e.paddingBottom?parseInt(e.paddingBottom,10):0;return n+t}function i(e){if(e.boxSizing!=="border-box"){return 0}var n=e.borderTopWidth?parseInt(e.borderTopWidth,10):0;var t=e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0;return n+t}function r(e){var n=Number(l[Q]["max"+e]),t=Number(l[Q]["min"+e]),o=e.toLowerCase(),i=Number(G[o]);k(Q,"Checking "+o+" is in range "+t+"-"+n);if(i<t){i=t;k(Q,"Set "+o+" to min value")}if(i>n){i=n;k(Q,"Set "+o+" to max value")}G[o]=""+i}function u(){function n(){function e(){var e=0,n=false;k(Q,"Checking connection is from allowed list of origins: "+o);for(;e<o.length;e++){if(o[e]===t){n=true;break}}return n}function n(){var e=l[Q]&&l[Q].remoteHost;k(Q,"Checking connection is from: "+e);return t===e}return o.constructor===Array?e():n()}var t=e.origin,o=l[Q]&&l[Q].checkOrigin;if(o&&""+t!=="null"&&!n()){throw new Error("Unexpected message received from: "+t+" for "+G.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 true}function d(){return a===(""+B).slice(0,c)&&B.slice(c).split(":")[0]in l}function m(){var e=G.type in{true:1,false:1,undefined:1};if(e){k(Q,"Ignoring init message from meta parent page")}return e}function h(e){return B.slice(B.indexOf(":")+s+e)}function b(e){k(Q,"onMessage passed: {iframe: "+G.iframe.id+", message: "+e+"}");q("onMessage",{iframe:G.iframe,message:JSON.parse(e)});k(Q,"--")}function p(){var e=document.body.getBoundingClientRect(),n=G.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:n.height,iframeWidth:n.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(n.top-e.top,10),offsetLeft:parseInt(n.left-e.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function y(e,n){function t(){A("Send Page Info","pageInfo:"+p(),e,n)}P(t,32,n)}function v(){function e(e,t){function i(){if(l[o]){y(l[o].iframe,o)}else{n()}}["scroll","resize"].forEach((function(n){k(o,e+n+" listener for sendPageInfo");t(window,n,i)}))}function n(){e("Remove ",w)}function t(){e("Add ",g)}var o=Q;t();if(l[o]){l[o].stopPageInfo=n}}function j(){if(l[Q]&&l[Q].stopPageInfo){l[Q].stopPageInfo();delete l[Q].stopPageInfo}}function M(){var e=true;if(null===G.iframe){z(Q,"IFrame ("+G.id+") not found");e=false}return e}function F(e){var n=e.getBoundingClientRect();E(Q);return{x:Math.floor(Number(n.left)+Number(f.x)),y:Math.floor(Number(n.top)+Number(f.y))}}function O(e){function n(){f=r;L();k(Q,"--")}function t(){return{x:Number(G.width)+i.x,y:Number(G.height)+i.y}}function o(){if(window.parentIFrame){window.parentIFrame["scrollTo"+(e?"Offset":"")](r.x,r.y)}else{z(Q,"Unable to scroll to requested position, window.parentIFrame not found")}}var i=e?F(G.iframe):{x:0,y:0},r=t();k(Q,"Reposition requested from iFrame (offset x:"+i.x+" y:"+i.y+")");if(window.top===window.self){n()}else{o()}}function L(){if(false===q("onScroll",f)){C()}else{N(Q)}}function V(e){function n(){var e=F(r);k(Q,"Moving to in page link (#"+o+") at x: "+e.x+" y: "+e.y);f={x:e.x,y:e.y};L();k(Q,"--")}function t(){if(window.parentIFrame){window.parentIFrame.moveToAnchor(o)}else{k(Q,"In page link #"+o+" not found and window.parentIFrame not found")}}var o=e.split("#")[1]||"",i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];if(r){n()}else if(window.top===window.self){k(Q,"In page link #"+o+" not found")}else{t()}}function D(e){var n={};if(Number(G.width)===0&&Number(G.height)===0){var t=h(9).split(":");n={x:t[1],y:t[0]}}else{n={x:G.width,y:G.height}}q(e,{iframe:G.iframe,screenX:Number(n.x),screenY:Number(n.y),type:G.type})}function q(e,n){return I(Q,e,n)}function _(){if(l[Q]&&l[Q].firstRun)J();switch(G.type){case"close":{S(G.iframe);break}case"message":{b(h(6));break}case"mouseenter":{D("onMouseEnter");break}case"mouseleave":{D("onMouseLeave");break}case"autoResize":{l[Q].autoResize=JSON.parse(h(9));break}case"scrollTo":{O(false);break}case"scrollToOffset":{O(true);break}case"pageInfo":{y(l[Q]&&l[Q].iframe,Q);v();break}case"pageInfoStop":{j();break}case"inPageLink":{V(h(9));break}case"reset":{T(G);break}case"init":{n();q("onInit",G.iframe);break}default:{if(Number(G.width)===0&&Number(G.height)===0){z("Unsupported message received ("+G.type+"), this is likely due to the iframe containing a later "+"version of iframe-resizer than the parent page")}else{n()}}}}function $(e){var n=true;if(!l[e]){n=false;z(G.type+" No settings for "+e+". Message was: "+B)}return n}function U(){for(var e in l){A("iFrame requested init",H(e),l[e].iframe,e)}}function J(){if(l[Q]){l[Q].firstRun=false}}var B=e.data,G={},Q=null;if("[iFrameResizerChild]Ready"===B){U()}else if(d()){G=t();Q=G.id;if(l[Q]){l[Q].loaded=true}if(!m()&&$(Q)){k(Q,"Received: "+B);if(M()&&u()){_()}}}else{x(Q,"Ignored: "+B)}}function I(e,n,t){var o=null,i=null;if(l[e]){o=l[e][n];if("function"===typeof o){i=o(t)}else{throw new TypeError(n+" on iFrame["+e+"] is not a function")}}return i}function O(e){var n=e.id;delete l[n]}function S(e){var n=e.id;if(I(n,"onClose",n)===false){k(n,"Close iframe cancelled by onClose event");return}k(n,"Removing iFrame: "+n);try{if(e.parentNode){e.parentNode.removeChild(e)}}catch(e){z(e)}I(n,"onClosed",n);k(n,"--");O(e)}function E(e){if(null===f){f={x:window.pageXOffset===n?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===n?document.documentElement.scrollTop:window.pageYOffset};k(e,"Get page position: "+f.x+","+f.y)}}function N(e){if(null!==f){window.scrollTo(f.x,f.y);k(e,"Set page position: "+f.x+","+f.y);C()}}function C(){f=null}function T(e){function n(){W(e);A("reset","reset",e.iframe,e.id)}k(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame"));E(e.id);R(n,e,"reset")}function W(e){function n(n){if(!e.id){k("undefined","messageData id not set");return}e.iframe.style[n]=e[n]+"px";k(e.id,"IFrame ("+r+") "+n+" set to "+e[n]+"px")}function t(n){if(!i&&"0"===e[n]){i=true;k(r,"Hidden iFrame detected, creating visibility listener");_()}}function o(e){n(e);t(e)}var r=e.iframe.id;if(l[r]){if(l[r].sizeHeight){o("height")}if(l[r].sizeWidth){o("width")}}}function R(e,n,t){if(t!==n.type&&u&&!window.jasmine){k(n.id,"Requesting animation frame");u(e)}else{e()}}function A(e,n,t,o,i){function r(){var i=l[o]&&l[o].targetOrigin;k(o,"["+e+"] Sending msg to iframe["+o+"] ("+n+") targetOrigin: "+i);t.contentWindow.postMessage(a+n,i)}function s(){z(o,"["+e+"] IFrame("+o+") not found")}function c(){if(t&&"contentWindow"in t&&null!==t.contentWindow){r()}else{s()}}function f(){function e(){if(l[o]&&!l[o].loaded&&!u){u=true;z(o,"IFrame has not responded within "+l[o].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.")}}if(!!i&&l[o]&&!!l[o].warningTimeout){l[o].msgTimeout=setTimeout(e,l[o].warningTimeout)}}var u=false;o=o||t.id;if(l[o]){c();f()}}function H(e){return e+":"+l[e].bodyMarginV1+":"+l[e].sizeWidth+":"+l[e].log+":"+l[e].interval+":"+l[e].enablePublicMethods+":"+l[e].autoResize+":"+l[e].bodyMargin+":"+l[e].heightCalculationMethod+":"+l[e].bodyBackground+":"+l[e].bodyPadding+":"+l[e].tolerance+":"+l[e].inPageLinks+":"+l[e].resizeFrom+":"+l[e].widthCalculationMethod+":"+l[e].mouseEvents}function L(e){return typeof e==="number"}function V(e,i){function r(){function n(n){var t=l[F][n];if(Infinity!==t&&0!==t){e.style[n]=L(t)?t+"px":t;k(F,"Set "+n+" = "+e.style[n])}}function t(e){if(l[F]["min"+e]>l[F]["max"+e]){throw new Error("Value for min"+e+" can not be greater than max"+e)}}t("Height");t("Width");n("maxHeight");n("minHeight");n("maxWidth");n("minWidth")}function s(){var e=i&&i.id||h.id+t++;if(null!==document.getElementById(e)){e+=t++}return e}function a(n){if(typeof n!=="string"){throw new TypeError("Invaild id for iFrame. Expected String")}if(""===n){e.id=n=s();o=(i||{}).log;k(n,"Added missing iframe ID: "+n+" ("+e.src+")")}return n}function c(){k(F,"IFrame scrolling "+(l[F]&&l[F].scrolling?"enabled":"disabled")+" for "+F);e.style.overflow=false===(l[F]&&l[F].scrolling)?"hidden":"auto";switch(l[F]&&l[F].scrolling){case"omit":{break}case true:{e.scrolling="yes";break}case false:{e.scrolling="no";break}default:{e.scrolling=l[F]?l[F].scrolling:"no"}}}function f(){if("number"===typeof(l[F]&&l[F].bodyMargin)||"0"===(l[F]&&l[F].bodyMargin)){l[F].bodyMarginV1=l[F].bodyMargin;l[F].bodyMargin=""+l[F].bodyMargin+"px"}}function u(){var n=l[F]&&l[F].firstRun,t=l[F]&&l[F].heightCalculationMethod in d;if(!n&&t){T({iframe:e,height:0,width:0,type:"init"})}}function m(){if(l[F]){l[F].iframe.iFrameResizer={close:S.bind(null,l[F].iframe),removeListeners:O.bind(null,l[F].iframe),resize:A.bind(null,"Window resize","resize",l[F].iframe),moveToAnchor:function(e){A("Move to anchor","moveToAnchor:"+e,l[F].iframe,F)},sendMessage:function(e){e=JSON.stringify(e);A("Send Message","message:"+e,l[F].iframe,F)}}}}function w(t){function o(){A("iFrame.onload",t,e,n,true);u()}function i(n){if(!e.parentNode){return}var t=new n((function(n){n.forEach((function(n){var t=Array.prototype.slice.call(n.removedNodes);t.forEach((function(n){if(n===e){S(e)}}))}))}));t.observe(e.parentNode,{childList:true})}var r=b();if(r){i(r)}g(e,"load",o);A("init",t,e,n,true)}function p(e){if("object"!==typeof e){throw new TypeError("Options is not an object")}}function y(e){for(var n in h){if(Object.prototype.hasOwnProperty.call(h,n)){l[F][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:h[n]}}}function v(e){return""===e||null!==e.match(/^(about:blank|javascript:|file:\/\/)/)?"*":e}function j(e){var n=e.split("Callback");if(n.length===2){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e];delete this[e];z(F,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}function x(n){n=n||{};l[F]=Object.create(null);l[F].iframe=e;l[F].firstRun=true;l[F].remoteHost=e.src&&e.src.split("/").slice(0,3).join("/");p(n);Object.keys(n).forEach(j,n);y(n);if(l[F]){l[F].targetOrigin=true===l[F].checkOrigin?v(l[F].remoteHost):"*"}}function M(){return F in l&&"iFrameResizer"in e}var F=a(e.id);if(M()){z(F,"Ignored iFrame, already setup.")}else{x(i);c();r();f();w(H(F));m()}}function D(e,n){if(null===m){m=setTimeout((function(){m=null;e()}),n)}}var q={};function P(e,n,t){if(!q[t]){q[t]=setTimeout((function(){q[t]=null;e()}),n)}}function _(){function e(){function e(e){function n(n){return"0px"===(l[e]&&l[e].iframe.style[n])}function t(e){return null!==e.offsetParent}if(l[e]&&t(l[e].iframe)&&(n("height")||n("width"))){A("Visibility change","resize",l[e].iframe,e)}}Object.keys(l).forEach((function(n){e(n)}))}function n(n){k("window","Mutation observed: "+n[0].target+" "+n[0].type);D(e,16)}function t(){var e=document.querySelector("body"),t={attributes:true,attributeOldValue:false,characterData:true,characterDataOldValue:false,childList:true,subtree:true},i=new o(n);i.observe(e,t)}var o=b();if(o){t()}}function $(e){function n(){J("Window "+e,"resize")}k("window","Trigger event: "+e);D(n,16)}function U(){function e(){J("Tab Visible","resize")}if("hidden"!==document.visibilityState){k("document","Trigger event: Visibility change");D(e,16)}}function J(e,n){function t(e){return l[e]&&"parent"===l[e].resizeFrom&&l[e].autoResize&&!l[e].firstRun}Object.keys(l).forEach((function(o){if(t(o)){A(e,n,l[o].iframe,o)}}))}function B(){g(window,"message",F);g(window,"resize",(function(){$("resize")}));g(document,"visibilitychange",U);g(document,"-webkit-visibilitychange",U)}function G(){function e(e,n){function t(){if(!n.tagName){throw new TypeError("Object is not a valid DOM element")}else if("IFRAME"!==n.tagName.toUpperCase()){throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}}if(n){t();V(n,e);o.push(n)}}function t(e){if(e&&e.enablePublicMethods){z("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}}var o;p();B();return function i(r,s){o=[];t(r);switch(typeof s){case"undefined":case"string":{Array.prototype.forEach.call(document.querySelectorAll(s||"iframe"),e.bind(n,r));break}case"object":{e(r,s);break}default:{throw new TypeError("Unexpected data type ("+typeof s+")")}}return o}}function Q(e){if(!e.fn){x("","Unable to bind to jQuery, it is not fully loaded.")}else if(!e.fn.iFrameResize){e.fn.iFrameResize=function e(n){function t(e,t){V(t,n)}return this.filter("iframe").each(t).end()}}}if(window.jQuery!==n){Q(window.jQuery)}if(typeof n==="function"&&n.amd){n([],G)}else{e.exports=G()}window.iFrameResize=window.iFrameResize||G()})()}));const a={card:{ready:"justifi.card.ready",tokenize:"justifi.card.tokenize",validate:"justifi.card.validate",resize:"justifi.card.resize",styleOverrides:"justifi.card.styleOverrides"},bankAccount:{ready:"justifi.bankAccount.ready",tokenize:"justifi.bankAccount.tokenize",validate:"justifi.bankAccount.validate",resize:"justifi.bankAccount.resize",styleOverrides:"justifi.bankAccount.styleOverrides"}};const c="@justifi/webcomponents";const f="4.6.2";const u="JustiFi Web Components";const d="dist/index.cjs.js";const l="dist/components/index.js";const m="dist/esm/index.mjs";const h="dist/esm/index.mjs";const b="dist/types/index.d.ts";const g="dist/collection/collection-manifest.json";const w={type:"git",url:"git+https://github.com/justifi-tech/web-component-library.git"};const p={registry:"https://registry.npmjs.org"};const y=["dist/","loader/"];const v={build:"npm run build:prod","build:dev":"NODE_ENV=dev stencil build --docs","build:staging":"NODE_ENV=staging stencil build --docs","build:prod":"NODE_ENV=prod stencil build --docs",start:'concurrently --restart-tries 3 -c "bgBlue.bold,bgMagenta.bold,bgGreen.bold" "npm run start-stencil" "npm run storybook"',"start-stencil":"NODE_ENV=dev stencil build --watch --serve --no-open",test:"stencil test --spec","test:watch":"stencil test --spec --watchAll","test:e2e":"stencil test --e2e",generate:"stencil generate",storybook:"NODE_ENV=dev storybook dev -p 6006 --quiet","build-storybook":"storybook build -o ../docs"};const j={"@stencil/core":"^4.0.5",bootstrap:"^5.2.3","date-fns":"^2.29.3","dinero.js":"^1.9.1","iframe-resizer":"^4.3.7",imask:"^7.1.3",rxjs:"^7.8.1","ts-dedent":"^2.2.0",uuid:"^9.0.0",yup:"^1.0.0"};const k={"@babel/preset-env":"^7.21.5","@babel/preset-react":"^7.18.6","@babel/preset-typescript":"^7.21.5","@pxtrn/storybook-addon-docs-stencil":"^6.4.1","@stencil/angular-output-target":"^0.7.1","@stencil/react-output-target":"^0.5.3","@stencil/sass":"^3.0.1","@stencil/store":"^2.0.8","@stencil/vue-output-target":"^0.8.6","@storybook/addon-actions":"^7.0.4","@storybook/addon-essentials":"^7.0.4","@storybook/addon-interactions":"^7.0.4","@storybook/addon-links":"^7.0.4","@storybook/html":"^7.0.4","@storybook/html-webpack5":"^7.0.4","@storybook/jest":"^0.1.0","@storybook/testing-library":"^0.1.0","@types/jest":"27.0.3","@types/node":"^20.1.4","@types/react":"^18.0.37","@types/react-dom":"^18.0.11",concurrently:"^7.6.0",dotenv:"^16.3.1",jest:"^27.4.5","jest-cli":"^27.4.5",puppeteer:"^10.0.0",react:"^18.2.0","react-dom":"^18.2.0","rollup-plugin-replace":"^2.2.0",storybook:"^7.0.4"};const x="MIT";const z="507bac1d941eae6e1f56e185ecd9bc9d22637783";const M={name:c,version:f,description:u,main:d,module:l,es2015:m,es2017:h,types:b,collection:g,"collection:main":"dist/collection/index.js",repository:w,publishConfig:p,files:y,scripts:v,dependencies:j,devDependencies:k,license:x,gitHead:z};const F=()=>{const e=getComputedStyle(document.body);const n={loadGoogleFont:e.getPropertyValue("--jfi-load-google-font"),layout:{fontFamily:e.getPropertyValue("--jfi-layout-font-family"),padding:e.getPropertyValue("--jfi-layout-padding"),formControlSpacingHorizontal:e.getPropertyValue("--jfi-layout-form-control-spacing-x"),formControlSpacingVertical:e.getPropertyValue("--jfi-layout-form-control-spacing-y")},formControl:{backgroundColor:e.getPropertyValue("--jfi-form-control-background-color"),borderColor:e.getPropertyValue("--jfi-form-control-border-color"),borderColorFocus:e.getPropertyValue("--jfi-form-control-border-color-focus"),borderColorError:e.getPropertyValue("--jfi-form-control-border-color-error"),borderWidth:e.getPropertyValue("--jfi-form-control-border-width"),borderBottomWidth:e.getPropertyValue("--jfi-form-control-border-bottom-width"),borderLeftWidth:e.getPropertyValue("--jfi-form-control-border-left-width"),borderRightWidth:e.getPropertyValue("--jfi-form-control-border-right-width"),borderTopWidth:e.getPropertyValue("--jfi-form-control-border-top-width"),borderRadius:e.getPropertyValue("--jfi-form-control-border-radius"),borderStyle:e.getPropertyValue("--jfi-form-control-border-style"),boxShadow:e.getPropertyValue("--jfi-form-control-box-shadow"),boxShadowError:e.getPropertyValue("--jfi-form-control-box-shadow-error"),boxShadowErrorFocus:e.getPropertyValue("--jfi-form-control-box-shadow-error-focus"),boxShadowFocus:e.getPropertyValue("--jfi-form-control-box-shadow-focus"),color:e.getPropertyValue("--jfi-form-control-color"),colorFocus:e.getPropertyValue("--jfi-form-control-color-focus"),fontSize:e.getPropertyValue("--jfi-form-control-font-size"),fontWeight:e.getPropertyValue("--jfi-form-control-font-weight"),lineHeight:e.getPropertyValue("--jfi-form-control-line-height"),margin:e.getPropertyValue("--jfi-form-control-margin"),padding:e.getPropertyValue("--jfi-form-control-padding")},formLabel:{color:e.getPropertyValue("--jfi-form-label-color"),fontFamily:e.getPropertyValue("--jfi-form-label-font-family"),fontSize:e.getPropertyValue("--jfi-form-label-font-size"),fontWeight:e.getPropertyValue("--jfi-form-label-font-weight"),margin:e.getPropertyValue("--jfi-form-label-margin")},errorMessage:{color:e.getPropertyValue("--jfi-error-message-color"),margin:e.getPropertyValue("--jfi-error-message-margin"),fontSize:e.getPropertyValue("--jfi-error-message-font-size")}};return n};const I=":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}iframe{width:1px;min-width:100%}";const O=class{constructor(t){e(this,t);this.paymentMethodFormReady=n(this,"paymentMethodFormReady",7);this.paymentMethodFormTokenize=n(this,"paymentMethodFormTokenize",7);this.computedTheme=F();this.paymentMethodFormType=undefined;this.paymentMethodFormValidationMode=undefined;this.iframeOrigin=undefined;this.singleLine=undefined}connectedCallback(){window.addEventListener("message",this.dispatchMessageEvent.bind(this))}disconnectedCallback(){window.removeEventListener("message",this.dispatchMessageEvent.bind(this))}sendStyleOverrides(){if(this.computedTheme){this.postMessage(a[this.paymentMethodFormType].styleOverrides,{styleOverrides:this.computedTheme})}}dispatchMessageEvent(e){const n=e.data;const t=n.eventType;const o=n.data;if(t===a[this.paymentMethodFormType].ready){this.paymentMethodFormReady.emit(o)}}postMessage(e,n){var t,o;(o=(t=this.iframeElement)===null||t===void 0?void 0:t.contentWindow)===null||o===void 0?void 0:o.postMessage(Object.assign({eventType:e},n),this.iframeOrigin||""||"*")}async resize(){this.postMessage(a[this.paymentMethodFormType].resize)}async postMessageWithResponseListener(e,n){return new Promise((t=>{const o=n=>{if(n.data.eventType!==e)return;window.removeEventListener("message",o);t(n.data.data)};window.addEventListener("message",o);this.postMessage(e,n)}))}async tokenize(e,n,t){const o=a[this.paymentMethodFormType].tokenize;const i={clientId:e,componentVersion:M.version,paymentMethodMetadata:n,account:t};return this.postMessageWithResponseListener(o,i)}async validate(){return this.postMessageWithResponseListener(a[this.paymentMethodFormType].validate)}composeQueryParams(e){const n=e.map((n=>{if(n===e[0]){return n=`?${n}`}else{return n=`&${n}`}}));return n.join("")}getIframeSrc(){const e=this.iframeOrigin||""||"https://js.justifi.ai/v2";let n=`${e}/${this.paymentMethodFormType}`;let t=[];if(this.paymentMethodFormValidationMode){t.push(`validationMode=${this.paymentMethodFormValidationMode}`)}if(this.singleLine){t.push(`singleLine=${this.singleLine}`)}return n.concat(this.composeQueryParams(t))}render(){return t(o,null,t("iframe",{id:`justifi-payment-method-form-${this.paymentMethodFormType}`,src:this.getIframeSrc(),ref:e=>{this.iframeElement=e},onLoad:()=>{s({log:true},this.iframeElement);this.sendStyleOverrides()}}))}};O.style=I;export{O as justifi_payment_method_form};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as n,h as t,H as o}from"./p-e70b2a21.js";function i(e,n,t){return t={path:n,exports:{},require:function(e,n){return r()}},e(t,t.exports),t.exports}function r(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var s=i((function(e){(function(n){if(typeof window==="undefined")return;var t=0,o=false,i=false,r="message",s=r.length,a="[iFrameSizer]",c=a.length,f=null,u=window.requestAnimationFrame,d=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),l={},m=null,h=Object.freeze({autoResize:true,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:true,inPageLinks:false,enablePublicMethods:true,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:false,maxHeight:Infinity,maxWidth:Infinity,minHeight:0,minWidth:0,mouseEvents:true,resizeFrom:"parent",scrolling:false,sizeHeight:true,sizeWidth:false,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return true},onClosed:function(){},onInit:function(){},onMessage:function(){z("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return true}});function b(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function g(e,n,t){e.addEventListener(n,t,false)}function w(e,n,t){e.removeEventListener(n,t,false)}function p(){var e=["moz","webkit","o","ms"];var n;for(n=0;n<e.length&&!u;n+=1){u=window[e[n]+"RequestAnimationFrame"]}if(u){u=u.bind(window)}else{k("setup","RequestAnimationFrame not supported")}}function y(e){var n="Host page: "+e;if(window.top!==window.self){n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e}return n}function v(e){return a+"["+y(e)+"]"}function j(e){return l[e]?l[e].log:o}function k(e,n){M("log",e,n,j(e))}function x(e,n){M("info",e,n,j(e))}function z(e,n){M("warn",e,n,true)}function M(e,n,t,o){if(true===o&&"object"===typeof window.console){console[e](v(n),t)}}function F(e){function n(){function e(){W(G);N(Q);q("onResized",G)}r("Height");r("Width");R(e,G,"init")}function t(){var e=B.slice(c).split(":");var n=e[1]?parseInt(e[1],10):0;var t=l[e[0]]&&l[e[0]].iframe;var r=getComputedStyle(t);return{iframe:t,id:e[0],height:n+o(r)+i(r),width:e[2],type:e[3]}}function o(e){if(e.boxSizing!=="border-box"){return 0}var n=e.paddingTop?parseInt(e.paddingTop,10):0;var t=e.paddingBottom?parseInt(e.paddingBottom,10):0;return n+t}function i(e){if(e.boxSizing!=="border-box"){return 0}var n=e.borderTopWidth?parseInt(e.borderTopWidth,10):0;var t=e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0;return n+t}function r(e){var n=Number(l[Q]["max"+e]),t=Number(l[Q]["min"+e]),o=e.toLowerCase(),i=Number(G[o]);k(Q,"Checking "+o+" is in range "+t+"-"+n);if(i<t){i=t;k(Q,"Set "+o+" to min value")}if(i>n){i=n;k(Q,"Set "+o+" to max value")}G[o]=""+i}function u(){function n(){function e(){var e=0,n=false;k(Q,"Checking connection is from allowed list of origins: "+o);for(;e<o.length;e++){if(o[e]===t){n=true;break}}return n}function n(){var e=l[Q]&&l[Q].remoteHost;k(Q,"Checking connection is from: "+e);return t===e}return o.constructor===Array?e():n()}var t=e.origin,o=l[Q]&&l[Q].checkOrigin;if(o&&""+t!=="null"&&!n()){throw new Error("Unexpected message received from: "+t+" for "+G.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 true}function d(){return a===(""+B).slice(0,c)&&B.slice(c).split(":")[0]in l}function m(){var e=G.type in{true:1,false:1,undefined:1};if(e){k(Q,"Ignoring init message from meta parent page")}return e}function h(e){return B.slice(B.indexOf(":")+s+e)}function b(e){k(Q,"onMessage passed: {iframe: "+G.iframe.id+", message: "+e+"}");q("onMessage",{iframe:G.iframe,message:JSON.parse(e)});k(Q,"--")}function p(){var e=document.body.getBoundingClientRect(),n=G.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:n.height,iframeWidth:n.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(n.top-e.top,10),offsetLeft:parseInt(n.left-e.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function y(e,n){function t(){A("Send Page Info","pageInfo:"+p(),e,n)}P(t,32,n)}function v(){function e(e,t){function i(){if(l[o]){y(l[o].iframe,o)}else{n()}}["scroll","resize"].forEach((function(n){k(o,e+n+" listener for sendPageInfo");t(window,n,i)}))}function n(){e("Remove ",w)}function t(){e("Add ",g)}var o=Q;t();if(l[o]){l[o].stopPageInfo=n}}function j(){if(l[Q]&&l[Q].stopPageInfo){l[Q].stopPageInfo();delete l[Q].stopPageInfo}}function M(){var e=true;if(null===G.iframe){z(Q,"IFrame ("+G.id+") not found");e=false}return e}function F(e){var n=e.getBoundingClientRect();E(Q);return{x:Math.floor(Number(n.left)+Number(f.x)),y:Math.floor(Number(n.top)+Number(f.y))}}function O(e){function n(){f=r;L();k(Q,"--")}function t(){return{x:Number(G.width)+i.x,y:Number(G.height)+i.y}}function o(){if(window.parentIFrame){window.parentIFrame["scrollTo"+(e?"Offset":"")](r.x,r.y)}else{z(Q,"Unable to scroll to requested position, window.parentIFrame not found")}}var i=e?F(G.iframe):{x:0,y:0},r=t();k(Q,"Reposition requested from iFrame (offset x:"+i.x+" y:"+i.y+")");if(window.top===window.self){n()}else{o()}}function L(){if(false===q("onScroll",f)){C()}else{N(Q)}}function V(e){function n(){var e=F(r);k(Q,"Moving to in page link (#"+o+") at x: "+e.x+" y: "+e.y);f={x:e.x,y:e.y};L();k(Q,"--")}function t(){if(window.parentIFrame){window.parentIFrame.moveToAnchor(o)}else{k(Q,"In page link #"+o+" not found and window.parentIFrame not found")}}var o=e.split("#")[1]||"",i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];if(r){n()}else if(window.top===window.self){k(Q,"In page link #"+o+" not found")}else{t()}}function D(e){var n={};if(Number(G.width)===0&&Number(G.height)===0){var t=h(9).split(":");n={x:t[1],y:t[0]}}else{n={x:G.width,y:G.height}}q(e,{iframe:G.iframe,screenX:Number(n.x),screenY:Number(n.y),type:G.type})}function q(e,n){return I(Q,e,n)}function _(){if(l[Q]&&l[Q].firstRun)J();switch(G.type){case"close":{S(G.iframe);break}case"message":{b(h(6));break}case"mouseenter":{D("onMouseEnter");break}case"mouseleave":{D("onMouseLeave");break}case"autoResize":{l[Q].autoResize=JSON.parse(h(9));break}case"scrollTo":{O(false);break}case"scrollToOffset":{O(true);break}case"pageInfo":{y(l[Q]&&l[Q].iframe,Q);v();break}case"pageInfoStop":{j();break}case"inPageLink":{V(h(9));break}case"reset":{T(G);break}case"init":{n();q("onInit",G.iframe);break}default:{if(Number(G.width)===0&&Number(G.height)===0){z("Unsupported message received ("+G.type+"), this is likely due to the iframe containing a later "+"version of iframe-resizer than the parent page")}else{n()}}}}function $(e){var n=true;if(!l[e]){n=false;z(G.type+" No settings for "+e+". Message was: "+B)}return n}function U(){for(var e in l){A("iFrame requested init",H(e),l[e].iframe,e)}}function J(){if(l[Q]){l[Q].firstRun=false}}var B=e.data,G={},Q=null;if("[iFrameResizerChild]Ready"===B){U()}else if(d()){G=t();Q=G.id;if(l[Q]){l[Q].loaded=true}if(!m()&&$(Q)){k(Q,"Received: "+B);if(M()&&u()){_()}}}else{x(Q,"Ignored: "+B)}}function I(e,n,t){var o=null,i=null;if(l[e]){o=l[e][n];if("function"===typeof o){i=o(t)}else{throw new TypeError(n+" on iFrame["+e+"] is not a function")}}return i}function O(e){var n=e.id;delete l[n]}function S(e){var n=e.id;if(I(n,"onClose",n)===false){k(n,"Close iframe cancelled by onClose event");return}k(n,"Removing iFrame: "+n);try{if(e.parentNode){e.parentNode.removeChild(e)}}catch(e){z(e)}I(n,"onClosed",n);k(n,"--");O(e)}function E(e){if(null===f){f={x:window.pageXOffset===n?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===n?document.documentElement.scrollTop:window.pageYOffset};k(e,"Get page position: "+f.x+","+f.y)}}function N(e){if(null!==f){window.scrollTo(f.x,f.y);k(e,"Set page position: "+f.x+","+f.y);C()}}function C(){f=null}function T(e){function n(){W(e);A("reset","reset",e.iframe,e.id)}k(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame"));E(e.id);R(n,e,"reset")}function W(e){function n(n){if(!e.id){k("undefined","messageData id not set");return}e.iframe.style[n]=e[n]+"px";k(e.id,"IFrame ("+r+") "+n+" set to "+e[n]+"px")}function t(n){if(!i&&"0"===e[n]){i=true;k(r,"Hidden iFrame detected, creating visibility listener");_()}}function o(e){n(e);t(e)}var r=e.iframe.id;if(l[r]){if(l[r].sizeHeight){o("height")}if(l[r].sizeWidth){o("width")}}}function R(e,n,t){if(t!==n.type&&u&&!window.jasmine){k(n.id,"Requesting animation frame");u(e)}else{e()}}function A(e,n,t,o,i){function r(){var i=l[o]&&l[o].targetOrigin;k(o,"["+e+"] Sending msg to iframe["+o+"] ("+n+") targetOrigin: "+i);t.contentWindow.postMessage(a+n,i)}function s(){z(o,"["+e+"] IFrame("+o+") not found")}function c(){if(t&&"contentWindow"in t&&null!==t.contentWindow){r()}else{s()}}function f(){function e(){if(l[o]&&!l[o].loaded&&!u){u=true;z(o,"IFrame has not responded within "+l[o].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.")}}if(!!i&&l[o]&&!!l[o].warningTimeout){l[o].msgTimeout=setTimeout(e,l[o].warningTimeout)}}var u=false;o=o||t.id;if(l[o]){c();f()}}function H(e){return e+":"+l[e].bodyMarginV1+":"+l[e].sizeWidth+":"+l[e].log+":"+l[e].interval+":"+l[e].enablePublicMethods+":"+l[e].autoResize+":"+l[e].bodyMargin+":"+l[e].heightCalculationMethod+":"+l[e].bodyBackground+":"+l[e].bodyPadding+":"+l[e].tolerance+":"+l[e].inPageLinks+":"+l[e].resizeFrom+":"+l[e].widthCalculationMethod+":"+l[e].mouseEvents}function L(e){return typeof e==="number"}function V(e,i){function r(){function n(n){var t=l[F][n];if(Infinity!==t&&0!==t){e.style[n]=L(t)?t+"px":t;k(F,"Set "+n+" = "+e.style[n])}}function t(e){if(l[F]["min"+e]>l[F]["max"+e]){throw new Error("Value for min"+e+" can not be greater than max"+e)}}t("Height");t("Width");n("maxHeight");n("minHeight");n("maxWidth");n("minWidth")}function s(){var e=i&&i.id||h.id+t++;if(null!==document.getElementById(e)){e+=t++}return e}function a(n){if(typeof n!=="string"){throw new TypeError("Invaild id for iFrame. Expected String")}if(""===n){e.id=n=s();o=(i||{}).log;k(n,"Added missing iframe ID: "+n+" ("+e.src+")")}return n}function c(){k(F,"IFrame scrolling "+(l[F]&&l[F].scrolling?"enabled":"disabled")+" for "+F);e.style.overflow=false===(l[F]&&l[F].scrolling)?"hidden":"auto";switch(l[F]&&l[F].scrolling){case"omit":{break}case true:{e.scrolling="yes";break}case false:{e.scrolling="no";break}default:{e.scrolling=l[F]?l[F].scrolling:"no"}}}function f(){if("number"===typeof(l[F]&&l[F].bodyMargin)||"0"===(l[F]&&l[F].bodyMargin)){l[F].bodyMarginV1=l[F].bodyMargin;l[F].bodyMargin=""+l[F].bodyMargin+"px"}}function u(){var n=l[F]&&l[F].firstRun,t=l[F]&&l[F].heightCalculationMethod in d;if(!n&&t){T({iframe:e,height:0,width:0,type:"init"})}}function m(){if(l[F]){l[F].iframe.iFrameResizer={close:S.bind(null,l[F].iframe),removeListeners:O.bind(null,l[F].iframe),resize:A.bind(null,"Window resize","resize",l[F].iframe),moveToAnchor:function(e){A("Move to anchor","moveToAnchor:"+e,l[F].iframe,F)},sendMessage:function(e){e=JSON.stringify(e);A("Send Message","message:"+e,l[F].iframe,F)}}}}function w(t){function o(){A("iFrame.onload",t,e,n,true);u()}function i(n){if(!e.parentNode){return}var t=new n((function(n){n.forEach((function(n){var t=Array.prototype.slice.call(n.removedNodes);t.forEach((function(n){if(n===e){S(e)}}))}))}));t.observe(e.parentNode,{childList:true})}var r=b();if(r){i(r)}g(e,"load",o);A("init",t,e,n,true)}function p(e){if("object"!==typeof e){throw new TypeError("Options is not an object")}}function y(e){for(var n in h){if(Object.prototype.hasOwnProperty.call(h,n)){l[F][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:h[n]}}}function v(e){return""===e||null!==e.match(/^(about:blank|javascript:|file:\/\/)/)?"*":e}function j(e){var n=e.split("Callback");if(n.length===2){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e];delete this[e];z(F,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}function x(n){n=n||{};l[F]=Object.create(null);l[F].iframe=e;l[F].firstRun=true;l[F].remoteHost=e.src&&e.src.split("/").slice(0,3).join("/");p(n);Object.keys(n).forEach(j,n);y(n);if(l[F]){l[F].targetOrigin=true===l[F].checkOrigin?v(l[F].remoteHost):"*"}}function M(){return F in l&&"iFrameResizer"in e}var F=a(e.id);if(M()){z(F,"Ignored iFrame, already setup.")}else{x(i);c();r();f();w(H(F));m()}}function D(e,n){if(null===m){m=setTimeout((function(){m=null;e()}),n)}}var q={};function P(e,n,t){if(!q[t]){q[t]=setTimeout((function(){q[t]=null;e()}),n)}}function _(){function e(){function e(e){function n(n){return"0px"===(l[e]&&l[e].iframe.style[n])}function t(e){return null!==e.offsetParent}if(l[e]&&t(l[e].iframe)&&(n("height")||n("width"))){A("Visibility change","resize",l[e].iframe,e)}}Object.keys(l).forEach((function(n){e(n)}))}function n(n){k("window","Mutation observed: "+n[0].target+" "+n[0].type);D(e,16)}function t(){var e=document.querySelector("body"),t={attributes:true,attributeOldValue:false,characterData:true,characterDataOldValue:false,childList:true,subtree:true},i=new o(n);i.observe(e,t)}var o=b();if(o){t()}}function $(e){function n(){J("Window "+e,"resize")}k("window","Trigger event: "+e);D(n,16)}function U(){function e(){J("Tab Visible","resize")}if("hidden"!==document.visibilityState){k("document","Trigger event: Visibility change");D(e,16)}}function J(e,n){function t(e){return l[e]&&"parent"===l[e].resizeFrom&&l[e].autoResize&&!l[e].firstRun}Object.keys(l).forEach((function(o){if(t(o)){A(e,n,l[o].iframe,o)}}))}function B(){g(window,"message",F);g(window,"resize",(function(){$("resize")}));g(document,"visibilitychange",U);g(document,"-webkit-visibilitychange",U)}function G(){function e(e,n){function t(){if(!n.tagName){throw new TypeError("Object is not a valid DOM element")}else if("IFRAME"!==n.tagName.toUpperCase()){throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}}if(n){t();V(n,e);o.push(n)}}function t(e){if(e&&e.enablePublicMethods){z("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}}var o;p();B();return function i(r,s){o=[];t(r);switch(typeof s){case"undefined":case"string":{Array.prototype.forEach.call(document.querySelectorAll(s||"iframe"),e.bind(n,r));break}case"object":{e(r,s);break}default:{throw new TypeError("Unexpected data type ("+typeof s+")")}}return o}}function Q(e){if(!e.fn){x("","Unable to bind to jQuery, it is not fully loaded.")}else if(!e.fn.iFrameResize){e.fn.iFrameResize=function e(n){function t(e,t){V(t,n)}return this.filter("iframe").each(t).end()}}}if(window.jQuery!==n){Q(window.jQuery)}if(typeof n==="function"&&n.amd){n([],G)}else{e.exports=G()}window.iFrameResize=window.iFrameResize||G()})()}));const a={card:{ready:"justifi.card.ready",tokenize:"justifi.card.tokenize",validate:"justifi.card.validate",resize:"justifi.card.resize",styleOverrides:"justifi.card.styleOverrides"},bankAccount:{ready:"justifi.bankAccount.ready",tokenize:"justifi.bankAccount.tokenize",validate:"justifi.bankAccount.validate",resize:"justifi.bankAccount.resize",styleOverrides:"justifi.bankAccount.styleOverrides"}};const c="@justifi/webcomponents";const f="4.6.4";const u="JustiFi Web Components";const d="dist/index.cjs.js";const l="dist/components/index.js";const m="dist/esm/index.mjs";const h="dist/esm/index.mjs";const b="dist/types/index.d.ts";const g="dist/collection/collection-manifest.json";const w={type:"git",url:"git+https://github.com/justifi-tech/web-component-library.git"};const p={registry:"https://registry.npmjs.org"};const y=["dist/","loader/"];const v={build:"npm run build:prod","build:dev":"NODE_ENV=dev stencil build --docs","build:staging":"NODE_ENV=staging stencil build --docs","build:prod":"NODE_ENV=prod stencil build --docs",start:'concurrently --restart-tries 3 -c "bgBlue.bold,bgMagenta.bold,bgGreen.bold" "npm run start-stencil" "npm run storybook"',"start-stencil":"NODE_ENV=dev stencil build --watch --serve --no-open",test:"stencil test --spec","test:watch":"stencil test --spec --watchAll","test:e2e":"stencil test --e2e",generate:"stencil generate",storybook:"NODE_ENV=dev storybook dev -p 6006 --quiet","build-storybook":"storybook build -o ../docs"};const j={"@stencil/core":"^4.0.5",bootstrap:"^5.2.3","date-fns":"^2.29.3","dinero.js":"^1.9.1","iframe-resizer":"^4.3.7",imask:"^7.1.3",rxjs:"^7.8.1","ts-dedent":"^2.2.0",uuid:"^9.0.0",yup:"^1.0.0"};const k={"@babel/preset-env":"^7.21.5","@babel/preset-react":"^7.18.6","@babel/preset-typescript":"^7.21.5","@pxtrn/storybook-addon-docs-stencil":"^6.4.1","@stencil/angular-output-target":"^0.7.1","@stencil/react-output-target":"^0.5.3","@stencil/sass":"^3.0.1","@stencil/store":"^2.0.8","@stencil/vue-output-target":"^0.8.6","@storybook/addon-actions":"^7.0.4","@storybook/addon-essentials":"^7.0.4","@storybook/addon-interactions":"^7.0.4","@storybook/addon-links":"^7.0.4","@storybook/html":"^7.0.4","@storybook/html-webpack5":"^7.0.4","@storybook/jest":"^0.1.0","@storybook/testing-library":"^0.1.0","@types/jest":"27.0.3","@types/node":"^20.1.4","@types/react":"^18.0.37","@types/react-dom":"^18.0.11",concurrently:"^7.6.0",dotenv:"^16.3.1",jest:"^27.4.5","jest-cli":"^27.4.5",puppeteer:"^10.0.0",react:"^18.2.0","react-dom":"^18.2.0","rollup-plugin-replace":"^2.2.0",storybook:"^7.0.4"};const x="MIT";const z="507bac1d941eae6e1f56e185ecd9bc9d22637783";const M={name:c,version:f,description:u,main:d,module:l,es2015:m,es2017:h,types:b,collection:g,"collection:main":"dist/collection/index.js",repository:w,publishConfig:p,files:y,scripts:v,dependencies:j,devDependencies:k,license:x,gitHead:z};const F=()=>{const e=getComputedStyle(document.body);const n={loadGoogleFont:e.getPropertyValue("--jfi-load-google-font"),layout:{fontFamily:e.getPropertyValue("--jfi-layout-font-family"),padding:e.getPropertyValue("--jfi-layout-padding"),formControlSpacingHorizontal:e.getPropertyValue("--jfi-layout-form-control-spacing-x"),formControlSpacingVertical:e.getPropertyValue("--jfi-layout-form-control-spacing-y")},formControl:{backgroundColor:e.getPropertyValue("--jfi-form-control-background-color"),borderColor:e.getPropertyValue("--jfi-form-control-border-color"),borderColorFocus:e.getPropertyValue("--jfi-form-control-border-color-focus"),borderColorError:e.getPropertyValue("--jfi-form-control-border-color-error"),borderWidth:e.getPropertyValue("--jfi-form-control-border-width"),borderBottomWidth:e.getPropertyValue("--jfi-form-control-border-bottom-width"),borderLeftWidth:e.getPropertyValue("--jfi-form-control-border-left-width"),borderRightWidth:e.getPropertyValue("--jfi-form-control-border-right-width"),borderTopWidth:e.getPropertyValue("--jfi-form-control-border-top-width"),borderRadius:e.getPropertyValue("--jfi-form-control-border-radius"),borderStyle:e.getPropertyValue("--jfi-form-control-border-style"),boxShadow:e.getPropertyValue("--jfi-form-control-box-shadow"),boxShadowError:e.getPropertyValue("--jfi-form-control-box-shadow-error"),boxShadowErrorFocus:e.getPropertyValue("--jfi-form-control-box-shadow-error-focus"),boxShadowFocus:e.getPropertyValue("--jfi-form-control-box-shadow-focus"),color:e.getPropertyValue("--jfi-form-control-color"),colorFocus:e.getPropertyValue("--jfi-form-control-color-focus"),fontSize:e.getPropertyValue("--jfi-form-control-font-size"),fontWeight:e.getPropertyValue("--jfi-form-control-font-weight"),lineHeight:e.getPropertyValue("--jfi-form-control-line-height"),margin:e.getPropertyValue("--jfi-form-control-margin"),padding:e.getPropertyValue("--jfi-form-control-padding")},formLabel:{color:e.getPropertyValue("--jfi-form-label-color"),fontFamily:e.getPropertyValue("--jfi-form-label-font-family"),fontSize:e.getPropertyValue("--jfi-form-label-font-size"),fontWeight:e.getPropertyValue("--jfi-form-label-font-weight"),margin:e.getPropertyValue("--jfi-form-label-margin")},errorMessage:{color:e.getPropertyValue("--jfi-error-message-color"),margin:e.getPropertyValue("--jfi-error-message-margin"),fontSize:e.getPropertyValue("--jfi-error-message-font-size")}};return n};const I=":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}iframe{width:1px;min-width:100%}";const O=class{constructor(t){e(this,t);this.paymentMethodFormReady=n(this,"paymentMethodFormReady",7);this.paymentMethodFormTokenize=n(this,"paymentMethodFormTokenize",7);this.computedTheme=F();this.paymentMethodFormType=undefined;this.paymentMethodFormValidationMode=undefined;this.iframeOrigin=undefined;this.singleLine=undefined}connectedCallback(){window.addEventListener("message",this.dispatchMessageEvent.bind(this))}disconnectedCallback(){window.removeEventListener("message",this.dispatchMessageEvent.bind(this))}sendStyleOverrides(){if(this.computedTheme){this.postMessage(a[this.paymentMethodFormType].styleOverrides,{styleOverrides:this.computedTheme})}}dispatchMessageEvent(e){const n=e.data;const t=n.eventType;const o=n.data;if(t===a[this.paymentMethodFormType].ready){this.paymentMethodFormReady.emit(o)}}postMessage(e,n){var t,o;(o=(t=this.iframeElement)===null||t===void 0?void 0:t.contentWindow)===null||o===void 0?void 0:o.postMessage(Object.assign({eventType:e},n),this.iframeOrigin||""||"*")}async resize(){this.postMessage(a[this.paymentMethodFormType].resize)}async postMessageWithResponseListener(e,n){return new Promise((t=>{const o=n=>{if(n.data.eventType!==e)return;window.removeEventListener("message",o);t(n.data.data)};window.addEventListener("message",o);this.postMessage(e,n)}))}async tokenize(e,n,t){const o=a[this.paymentMethodFormType].tokenize;const i={clientId:e,componentVersion:M.version,paymentMethodMetadata:n,account:t};return this.postMessageWithResponseListener(o,i)}async validate(){return this.postMessageWithResponseListener(a[this.paymentMethodFormType].validate)}composeQueryParams(e){const n=e.map((n=>{if(n===e[0]){return n=`?${n}`}else{return n=`&${n}`}}));return n.join("")}getIframeSrc(){const e=this.iframeOrigin||""||"https://js.justifi.ai/v2";let n=`${e}/${this.paymentMethodFormType}`;let t=[];if(this.paymentMethodFormValidationMode){t.push(`validationMode=${this.paymentMethodFormValidationMode}`)}if(this.singleLine){t.push(`singleLine=${this.singleLine}`)}return n.concat(this.composeQueryParams(t))}render(){return t(o,null,t("iframe",{id:`justifi-payment-method-form-${this.paymentMethodFormType}`,src:this.getIframeSrc(),ref:e=>{this.iframeElement=e},onLoad:()=>{s({log:true},this.iframeElement);this.sendStyleOverrides()}}))}};O.style=I;export{O as justifi_payment_method_form};
|
|
2
|
+
//# sourceMappingURL=p-9d1c7e6a.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r,c as o,h as i,H as t}from"./p-e70b2a21.js";import{A as e}from"./p-c44e1415.js";import{a as s}from"./p-ab0756ff.js";import{f as a,b as n,a as b,M as c}from"./p-9346ae33.js";import{p as l}from"./p-ccb0e1c5.js";const d=':root,[data-bs-theme=light]{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-black:#000;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-gray-100:#f8f9fa;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#6c757d;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:#0d6efd;--bs-secondary:#6c757d;--bs-success:#198754;--bs-info:#0dcaf0;--bs-warning:#ffc107;--bs-danger:#dc3545;--bs-light:#f8f9fa;--bs-dark:#212529;--bs-primary-rgb:13, 110, 253;--bs-secondary-rgb:108, 117, 125;--bs-success-rgb:25, 135, 84;--bs-info-rgb:13, 202, 240;--bs-warning-rgb:255, 193, 7;--bs-danger-rgb:220, 53, 69;--bs-light-rgb:248, 249, 250;--bs-dark-rgb:33, 37, 41;--bs-primary-text-emphasis:#052c65;--bs-secondary-text-emphasis:#2b2f32;--bs-success-text-emphasis:#0a3622;--bs-info-text-emphasis:#055160;--bs-warning-text-emphasis:#664d03;--bs-danger-text-emphasis:#58151c;--bs-light-text-emphasis:#495057;--bs-dark-text-emphasis:#495057;--bs-primary-bg-subtle:#cfe2ff;--bs-secondary-bg-subtle:#e2e3e5;--bs-success-bg-subtle:#d1e7dd;--bs-info-bg-subtle:#cff4fc;--bs-warning-bg-subtle:#fff3cd;--bs-danger-bg-subtle:#f8d7da;--bs-light-bg-subtle:#fcfcfd;--bs-dark-bg-subtle:#ced4da;--bs-primary-border-subtle:#9ec5fe;--bs-secondary-border-subtle:#c4c8cb;--bs-success-border-subtle:#a3cfbb;--bs-info-border-subtle:#9eeaf9;--bs-warning-border-subtle:#ffe69c;--bs-danger-border-subtle:#f1aeb5;--bs-light-border-subtle:#e9ecef;--bs-dark-border-subtle:#adb5bd;--bs-white-rgb:255, 255, 255;--bs-black-rgb:0, 0, 0;--bs-font-sans-serif:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-font-monospace:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));--bs-body-font-family:var(--bs-font-sans-serif);--bs-body-font-size:1rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#212529;--bs-body-color-rgb:33, 37, 41;--bs-body-bg:#fff;--bs-body-bg-rgb:255, 255, 255;--bs-emphasis-color:#000;--bs-emphasis-color-rgb:0, 0, 0;--bs-secondary-color:rgba(33, 37, 41, 0.75);--bs-secondary-color-rgb:33, 37, 41;--bs-secondary-bg:#e9ecef;--bs-secondary-bg-rgb:233, 236, 239;--bs-tertiary-color:rgba(33, 37, 41, 0.5);--bs-tertiary-color-rgb:33, 37, 41;--bs-tertiary-bg:#f8f9fa;--bs-tertiary-bg-rgb:248, 249, 250;--bs-heading-color:inherit;--bs-link-color:#0d6efd;--bs-link-color-rgb:13, 110, 253;--bs-link-decoration:underline;--bs-link-hover-color:#0a58ca;--bs-link-hover-color-rgb:10, 88, 202;--bs-code-color:#d63384;--bs-highlight-bg:#fff3cd;--bs-border-width:1px;--bs-border-style:solid;--bs-border-color:#dee2e6;--bs-border-color-translucent:rgba(0, 0, 0, 0.175);--bs-border-radius:0.375rem;--bs-border-radius-sm:0.25rem;--bs-border-radius-lg:0.5rem;--bs-border-radius-xl:1rem;--bs-border-radius-xxl:2rem;--bs-border-radius-2xl:var(--bs-border-radius-xxl);--bs-border-radius-pill:50rem;--bs-box-shadow:0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-box-shadow-sm:0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);--bs-box-shadow-lg:0 1rem 3rem rgba(0, 0, 0, 0.175);--bs-box-shadow-inset:inset 0 1px 2px rgba(0, 0, 0, 0.075);--bs-focus-ring-width:0.25rem;--bs-focus-ring-opacity:0.25;--bs-focus-ring-color:rgba(13, 110, 253, 0.25);--bs-form-valid-color:#198754;--bs-form-valid-border-color:#198754;--bs-form-invalid-color:#dc3545;--bs-form-invalid-border-color:#dc3545}[data-bs-theme=dark]{color-scheme:dark;--bs-body-color:#dee2e6;--bs-body-color-rgb:222, 226, 230;--bs-body-bg:#212529;--bs-body-bg-rgb:33, 37, 41;--bs-emphasis-color:#fff;--bs-emphasis-color-rgb:255, 255, 255;--bs-secondary-color:rgba(222, 226, 230, 0.75);--bs-secondary-color-rgb:222, 226, 230;--bs-secondary-bg:#343a40;--bs-secondary-bg-rgb:52, 58, 64;--bs-tertiary-color:rgba(222, 226, 230, 0.5);--bs-tertiary-color-rgb:222, 226, 230;--bs-tertiary-bg:#2b3035;--bs-tertiary-bg-rgb:43, 48, 53;--bs-primary-text-emphasis:#6ea8fe;--bs-secondary-text-emphasis:#a7acb1;--bs-success-text-emphasis:#75b798;--bs-info-text-emphasis:#6edff6;--bs-warning-text-emphasis:#ffda6a;--bs-danger-text-emphasis:#ea868f;--bs-light-text-emphasis:#f8f9fa;--bs-dark-text-emphasis:#dee2e6;--bs-primary-bg-subtle:#031633;--bs-secondary-bg-subtle:#161719;--bs-success-bg-subtle:#051b11;--bs-info-bg-subtle:#032830;--bs-warning-bg-subtle:#332701;--bs-danger-bg-subtle:#2c0b0e;--bs-light-bg-subtle:#343a40;--bs-dark-bg-subtle:#1a1d20;--bs-primary-border-subtle:#084298;--bs-secondary-border-subtle:#41464b;--bs-success-border-subtle:#0f5132;--bs-info-border-subtle:#087990;--bs-warning-border-subtle:#997404;--bs-danger-border-subtle:#842029;--bs-light-border-subtle:#495057;--bs-dark-border-subtle:#343a40;--bs-heading-color:inherit;--bs-link-color:#6ea8fe;--bs-link-hover-color:#8bb9fe;--bs-link-color-rgb:110, 168, 254;--bs-link-hover-color-rgb:139, 185, 254;--bs-code-color:#e685b5;--bs-border-color:#495057;--bs-border-color-translucent:rgba(255, 255, 255, 0.15);--bs-form-valid-color:#75b798;--bs-form-valid-border-color:#75b798;--bs-form-invalid-color:#ea868f;--bs-form-invalid-border-color:#ea868f}.spinner-grow,.spinner-border{display:inline-block;width:var(--bs-spinner-width);height:var(--bs-spinner-height);vertical-align:var(--bs-spinner-vertical-align);border-radius:50%;animation:var(--bs-spinner-animation-speed) linear infinite var(--bs-spinner-animation-name)}@keyframes spinner-border{to{transform:rotate(360deg) }}.spinner-border{--bs-spinner-width:2rem;--bs-spinner-height:2rem;--bs-spinner-vertical-align:-0.125em;--bs-spinner-border-width:0.25em;--bs-spinner-animation-speed:0.75s;--bs-spinner-animation-name:spinner-border;border:var(--bs-spinner-border-width) solid currentcolor;border-right-color:transparent}.spinner-border-sm{--bs-spinner-width:1rem;--bs-spinner-height:1rem;--bs-spinner-border-width:0.2em}@keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1;transform:none}}.spinner-grow{--bs-spinner-width:2rem;--bs-spinner-height:2rem;--bs-spinner-vertical-align:-0.125em;--bs-spinner-animation-speed:0.75s;--bs-spinner-animation-name:spinner-grow;background-color:currentcolor;opacity:0}.spinner-grow-sm{--bs-spinner-width:1rem;--bs-spinner-height:1rem}@media (prefers-reduced-motion: reduce){.spinner-border,.spinner-grow{--bs-spinner-animation-speed:1.5s}}.clearfix::after{display:block;clear:both;content:""}.text-bg-primary{color:#fff !important;background-color:RGBA(var(--bs-primary-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-secondary{color:#fff !important;background-color:RGBA(var(--bs-secondary-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-success{color:#fff !important;background-color:RGBA(var(--bs-success-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-info{color:#000 !important;background-color:RGBA(var(--bs-info-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-warning{color:#000 !important;background-color:RGBA(var(--bs-warning-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-danger{color:#fff !important;background-color:RGBA(var(--bs-danger-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-light{color:#000 !important;background-color:RGBA(var(--bs-light-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-dark{color:#fff !important;background-color:RGBA(var(--bs-dark-rgb), var(--bs-bg-opacity, 1)) !important}.link-primary{color:RGBA(var(--bs-primary-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-primary-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-primary:hover,.link-primary:focus{color:RGBA(10, 88, 202, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(10, 88, 202, var(--bs-link-underline-opacity, 1)) !important}.link-secondary{color:RGBA(var(--bs-secondary-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-secondary-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-secondary:hover,.link-secondary:focus{color:RGBA(86, 94, 100, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(86, 94, 100, var(--bs-link-underline-opacity, 1)) !important}.link-success{color:RGBA(var(--bs-success-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-success-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-success:hover,.link-success:focus{color:RGBA(20, 108, 67, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(20, 108, 67, var(--bs-link-underline-opacity, 1)) !important}.link-info{color:RGBA(var(--bs-info-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-info-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-info:hover,.link-info:focus{color:RGBA(61, 213, 243, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(61, 213, 243, var(--bs-link-underline-opacity, 1)) !important}.link-warning{color:RGBA(var(--bs-warning-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-warning-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-warning:hover,.link-warning:focus{color:RGBA(255, 205, 57, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(255, 205, 57, var(--bs-link-underline-opacity, 1)) !important}.link-danger{color:RGBA(var(--bs-danger-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-danger-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-danger:hover,.link-danger:focus{color:RGBA(176, 42, 55, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(176, 42, 55, var(--bs-link-underline-opacity, 1)) !important}.link-light{color:RGBA(var(--bs-light-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-light-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-light:hover,.link-light:focus{color:RGBA(249, 250, 251, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(249, 250, 251, var(--bs-link-underline-opacity, 1)) !important}.link-dark{color:RGBA(var(--bs-dark-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-dark-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-dark:hover,.link-dark:focus{color:RGBA(26, 30, 33, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(26, 30, 33, var(--bs-link-underline-opacity, 1)) !important}.link-body-emphasis{color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-body-emphasis:hover,.link-body-emphasis:focus{color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-opacity, 0.75)) !important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-underline-opacity, 0.75)) !important}.focus-ring:focus{outline:0;box-shadow:var(--bs-focus-ring-x, 0) var(--bs-focus-ring-y, 0) var(--bs-focus-ring-blur, 0) var(--bs-focus-ring-width) var(--bs-focus-ring-color)}.icon-link{display:inline-flex;gap:0.375rem;align-items:center;text-decoration-color:rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 0.5));text-underline-offset:0.25em;backface-visibility:hidden}.icon-link>.bi{flex-shrink:0;width:1em;height:1em;fill:currentcolor;transition:0.2s ease-in-out transform}@media (prefers-reduced-motion: reduce){.icon-link>.bi{transition:none}}.icon-link-hover:hover>.bi,.icon-link-hover:focus-visible>.bi{transform:var(--bs-icon-link-transform, translate3d(0.25em, 0, 0))}.ratio{position:relative;width:100%}.ratio::before{display:block;padding-top:var(--bs-aspect-ratio);content:""}.ratio>*{position:absolute;top:0;left:0;width:100%;height:100%}.ratio-1x1{--bs-aspect-ratio:100%}.ratio-4x3{--bs-aspect-ratio:75%}.ratio-16x9{--bs-aspect-ratio:56.25%}.ratio-21x9{--bs-aspect-ratio:42.8571428571%}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}.sticky-top{position:sticky;top:0;z-index:1020}.sticky-bottom{position:sticky;bottom:0;z-index:1020}@media (min-width: 576px){.sticky-sm-top{position:sticky;top:0;z-index:1020}.sticky-sm-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 768px){.sticky-md-top{position:sticky;top:0;z-index:1020}.sticky-md-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 992px){.sticky-lg-top{position:sticky;top:0;z-index:1020}.sticky-lg-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 1200px){.sticky-xl-top{position:sticky;top:0;z-index:1020}.sticky-xl-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 1400px){.sticky-xxl-top{position:sticky;top:0;z-index:1020}.sticky-xxl-bottom{position:sticky;bottom:0;z-index:1020}}.hstack{display:flex;flex-direction:row;align-items:center;align-self:stretch}.vstack{display:flex;flex:1 1 auto;flex-direction:column;align-self:stretch}.visually-hidden,.visually-hidden-focusable:not(:focus):not(:focus-within){width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.visually-hidden:not(caption),.visually-hidden-focusable:not(:focus):not(:focus-within):not(caption){position:absolute !important}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;content:""}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vr{display:inline-block;align-self:stretch;width:var(--bs-border-width);min-height:1em;background-color:currentcolor;opacity:0.25}:host{font-family:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529}';const p=class{constructor(i){r(this,i);this.rowClicked=o(this,"payment-row-clicked",7);this.onPageChange=r=>()=>{this.fetchData(r)};this.accountId=undefined;this.authToken=undefined;this.payments=[];this.loading=true;this.errorMessage=undefined;this.paging=l}updateOnPropChange(){this.fetchData()}connectedCallback(){this.fetchData()}async fetchData(r){var o;if(!this.accountId||!this.authToken){this.errorMessage="Can not fetch any data without an AccountID and an AuthToken";this.loading=false;return}this.loading=true;const i=`account/${this.accountId}/payments`;const t=await e(this.authToken).get(i,{paging:this.paging,direction:r});if(!t.error){this.paging=Object.assign(Object.assign({},this.paging),t.page_info);const r=(o=t===null||t===void 0?void 0:t.data)===null||o===void 0?void 0:o.map((r=>new s(r)));this.payments=r}else{this.errorMessage=typeof t.error==="string"?t.error:t.error.message}this.loading=false}getPaymentMethod(r){return r.card||r.bank_account}render(){return i(t,null,i("justifi-table",{rowClickHandler:r=>{const o=r.target.closest("tr").dataset.rowEntityId;if(!o){return}this.rowClicked.emit(this.payments.find((r=>r.id===o)))},entityId:this.payments.map((r=>r.id)),columnData:[["Made On","The date and time each payment was made"],["Amount","The dollar amount of each payment"],["Description","The payment description, if you provided one"],["Cardholder","The name associated with the payment method"],["Payment Method","The brand and last 4 digits of the payment method"],["Status","The current status of each payment"],["Payment ID","The unique identifier of each payment"]],rowData:this.payments.map((r=>[{type:"head",value:`\n <div>${a(r.created_at)}</div>\n <div>${n(r.created_at)}</div>\n `},b(r.amount),r.description,this.getPaymentMethod(r.payment_method).name,this.getPaymentMethod(r.payment_method).acct_last_four,{type:"inner",value:c(r.status)},r.id])),loading:this.loading,"error-message":this.errorMessage,paging:Object.assign(Object.assign({},this.paging),{onPrev:this.onPageChange("prev"),onNext:this.onPageChange("next")})}))}static get watchers(){return{accountId:["updateOnPropChange"],authToken:["updateOnPropChange"]}}};p.style=d;export{p as justifi_payments_list};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r,c as o,h as i,H as t}from"./p-e70b2a21.js";import{A as e}from"./p-523cbe04.js";import{a as s}from"./p-ab0756ff.js";import{f as a,b as n,a as b,M as c}from"./p-9346ae33.js";import{p as l}from"./p-ccb0e1c5.js";const d=':root,[data-bs-theme=light]{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-black:#000;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-gray-100:#f8f9fa;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#6c757d;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:#0d6efd;--bs-secondary:#6c757d;--bs-success:#198754;--bs-info:#0dcaf0;--bs-warning:#ffc107;--bs-danger:#dc3545;--bs-light:#f8f9fa;--bs-dark:#212529;--bs-primary-rgb:13, 110, 253;--bs-secondary-rgb:108, 117, 125;--bs-success-rgb:25, 135, 84;--bs-info-rgb:13, 202, 240;--bs-warning-rgb:255, 193, 7;--bs-danger-rgb:220, 53, 69;--bs-light-rgb:248, 249, 250;--bs-dark-rgb:33, 37, 41;--bs-primary-text-emphasis:#052c65;--bs-secondary-text-emphasis:#2b2f32;--bs-success-text-emphasis:#0a3622;--bs-info-text-emphasis:#055160;--bs-warning-text-emphasis:#664d03;--bs-danger-text-emphasis:#58151c;--bs-light-text-emphasis:#495057;--bs-dark-text-emphasis:#495057;--bs-primary-bg-subtle:#cfe2ff;--bs-secondary-bg-subtle:#e2e3e5;--bs-success-bg-subtle:#d1e7dd;--bs-info-bg-subtle:#cff4fc;--bs-warning-bg-subtle:#fff3cd;--bs-danger-bg-subtle:#f8d7da;--bs-light-bg-subtle:#fcfcfd;--bs-dark-bg-subtle:#ced4da;--bs-primary-border-subtle:#9ec5fe;--bs-secondary-border-subtle:#c4c8cb;--bs-success-border-subtle:#a3cfbb;--bs-info-border-subtle:#9eeaf9;--bs-warning-border-subtle:#ffe69c;--bs-danger-border-subtle:#f1aeb5;--bs-light-border-subtle:#e9ecef;--bs-dark-border-subtle:#adb5bd;--bs-white-rgb:255, 255, 255;--bs-black-rgb:0, 0, 0;--bs-font-sans-serif:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-font-monospace:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));--bs-body-font-family:var(--bs-font-sans-serif);--bs-body-font-size:1rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#212529;--bs-body-color-rgb:33, 37, 41;--bs-body-bg:#fff;--bs-body-bg-rgb:255, 255, 255;--bs-emphasis-color:#000;--bs-emphasis-color-rgb:0, 0, 0;--bs-secondary-color:rgba(33, 37, 41, 0.75);--bs-secondary-color-rgb:33, 37, 41;--bs-secondary-bg:#e9ecef;--bs-secondary-bg-rgb:233, 236, 239;--bs-tertiary-color:rgba(33, 37, 41, 0.5);--bs-tertiary-color-rgb:33, 37, 41;--bs-tertiary-bg:#f8f9fa;--bs-tertiary-bg-rgb:248, 249, 250;--bs-heading-color:inherit;--bs-link-color:#0d6efd;--bs-link-color-rgb:13, 110, 253;--bs-link-decoration:underline;--bs-link-hover-color:#0a58ca;--bs-link-hover-color-rgb:10, 88, 202;--bs-code-color:#d63384;--bs-highlight-bg:#fff3cd;--bs-border-width:1px;--bs-border-style:solid;--bs-border-color:#dee2e6;--bs-border-color-translucent:rgba(0, 0, 0, 0.175);--bs-border-radius:0.375rem;--bs-border-radius-sm:0.25rem;--bs-border-radius-lg:0.5rem;--bs-border-radius-xl:1rem;--bs-border-radius-xxl:2rem;--bs-border-radius-2xl:var(--bs-border-radius-xxl);--bs-border-radius-pill:50rem;--bs-box-shadow:0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-box-shadow-sm:0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);--bs-box-shadow-lg:0 1rem 3rem rgba(0, 0, 0, 0.175);--bs-box-shadow-inset:inset 0 1px 2px rgba(0, 0, 0, 0.075);--bs-focus-ring-width:0.25rem;--bs-focus-ring-opacity:0.25;--bs-focus-ring-color:rgba(13, 110, 253, 0.25);--bs-form-valid-color:#198754;--bs-form-valid-border-color:#198754;--bs-form-invalid-color:#dc3545;--bs-form-invalid-border-color:#dc3545}[data-bs-theme=dark]{color-scheme:dark;--bs-body-color:#dee2e6;--bs-body-color-rgb:222, 226, 230;--bs-body-bg:#212529;--bs-body-bg-rgb:33, 37, 41;--bs-emphasis-color:#fff;--bs-emphasis-color-rgb:255, 255, 255;--bs-secondary-color:rgba(222, 226, 230, 0.75);--bs-secondary-color-rgb:222, 226, 230;--bs-secondary-bg:#343a40;--bs-secondary-bg-rgb:52, 58, 64;--bs-tertiary-color:rgba(222, 226, 230, 0.5);--bs-tertiary-color-rgb:222, 226, 230;--bs-tertiary-bg:#2b3035;--bs-tertiary-bg-rgb:43, 48, 53;--bs-primary-text-emphasis:#6ea8fe;--bs-secondary-text-emphasis:#a7acb1;--bs-success-text-emphasis:#75b798;--bs-info-text-emphasis:#6edff6;--bs-warning-text-emphasis:#ffda6a;--bs-danger-text-emphasis:#ea868f;--bs-light-text-emphasis:#f8f9fa;--bs-dark-text-emphasis:#dee2e6;--bs-primary-bg-subtle:#031633;--bs-secondary-bg-subtle:#161719;--bs-success-bg-subtle:#051b11;--bs-info-bg-subtle:#032830;--bs-warning-bg-subtle:#332701;--bs-danger-bg-subtle:#2c0b0e;--bs-light-bg-subtle:#343a40;--bs-dark-bg-subtle:#1a1d20;--bs-primary-border-subtle:#084298;--bs-secondary-border-subtle:#41464b;--bs-success-border-subtle:#0f5132;--bs-info-border-subtle:#087990;--bs-warning-border-subtle:#997404;--bs-danger-border-subtle:#842029;--bs-light-border-subtle:#495057;--bs-dark-border-subtle:#343a40;--bs-heading-color:inherit;--bs-link-color:#6ea8fe;--bs-link-hover-color:#8bb9fe;--bs-link-color-rgb:110, 168, 254;--bs-link-hover-color-rgb:139, 185, 254;--bs-code-color:#e685b5;--bs-border-color:#495057;--bs-border-color-translucent:rgba(255, 255, 255, 0.15);--bs-form-valid-color:#75b798;--bs-form-valid-border-color:#75b798;--bs-form-invalid-color:#ea868f;--bs-form-invalid-border-color:#ea868f}.spinner-grow,.spinner-border{display:inline-block;width:var(--bs-spinner-width);height:var(--bs-spinner-height);vertical-align:var(--bs-spinner-vertical-align);border-radius:50%;animation:var(--bs-spinner-animation-speed) linear infinite var(--bs-spinner-animation-name)}@keyframes spinner-border{to{transform:rotate(360deg) }}.spinner-border{--bs-spinner-width:2rem;--bs-spinner-height:2rem;--bs-spinner-vertical-align:-0.125em;--bs-spinner-border-width:0.25em;--bs-spinner-animation-speed:0.75s;--bs-spinner-animation-name:spinner-border;border:var(--bs-spinner-border-width) solid currentcolor;border-right-color:transparent}.spinner-border-sm{--bs-spinner-width:1rem;--bs-spinner-height:1rem;--bs-spinner-border-width:0.2em}@keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1;transform:none}}.spinner-grow{--bs-spinner-width:2rem;--bs-spinner-height:2rem;--bs-spinner-vertical-align:-0.125em;--bs-spinner-animation-speed:0.75s;--bs-spinner-animation-name:spinner-grow;background-color:currentcolor;opacity:0}.spinner-grow-sm{--bs-spinner-width:1rem;--bs-spinner-height:1rem}@media (prefers-reduced-motion: reduce){.spinner-border,.spinner-grow{--bs-spinner-animation-speed:1.5s}}.clearfix::after{display:block;clear:both;content:""}.text-bg-primary{color:#fff !important;background-color:RGBA(var(--bs-primary-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-secondary{color:#fff !important;background-color:RGBA(var(--bs-secondary-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-success{color:#fff !important;background-color:RGBA(var(--bs-success-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-info{color:#000 !important;background-color:RGBA(var(--bs-info-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-warning{color:#000 !important;background-color:RGBA(var(--bs-warning-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-danger{color:#fff !important;background-color:RGBA(var(--bs-danger-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-light{color:#000 !important;background-color:RGBA(var(--bs-light-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-dark{color:#fff !important;background-color:RGBA(var(--bs-dark-rgb), var(--bs-bg-opacity, 1)) !important}.link-primary{color:RGBA(var(--bs-primary-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-primary-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-primary:hover,.link-primary:focus{color:RGBA(10, 88, 202, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(10, 88, 202, var(--bs-link-underline-opacity, 1)) !important}.link-secondary{color:RGBA(var(--bs-secondary-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-secondary-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-secondary:hover,.link-secondary:focus{color:RGBA(86, 94, 100, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(86, 94, 100, var(--bs-link-underline-opacity, 1)) !important}.link-success{color:RGBA(var(--bs-success-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-success-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-success:hover,.link-success:focus{color:RGBA(20, 108, 67, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(20, 108, 67, var(--bs-link-underline-opacity, 1)) !important}.link-info{color:RGBA(var(--bs-info-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-info-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-info:hover,.link-info:focus{color:RGBA(61, 213, 243, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(61, 213, 243, var(--bs-link-underline-opacity, 1)) !important}.link-warning{color:RGBA(var(--bs-warning-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-warning-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-warning:hover,.link-warning:focus{color:RGBA(255, 205, 57, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(255, 205, 57, var(--bs-link-underline-opacity, 1)) !important}.link-danger{color:RGBA(var(--bs-danger-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-danger-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-danger:hover,.link-danger:focus{color:RGBA(176, 42, 55, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(176, 42, 55, var(--bs-link-underline-opacity, 1)) !important}.link-light{color:RGBA(var(--bs-light-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-light-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-light:hover,.link-light:focus{color:RGBA(249, 250, 251, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(249, 250, 251, var(--bs-link-underline-opacity, 1)) !important}.link-dark{color:RGBA(var(--bs-dark-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-dark-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-dark:hover,.link-dark:focus{color:RGBA(26, 30, 33, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(26, 30, 33, var(--bs-link-underline-opacity, 1)) !important}.link-body-emphasis{color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-body-emphasis:hover,.link-body-emphasis:focus{color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-opacity, 0.75)) !important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-underline-opacity, 0.75)) !important}.focus-ring:focus{outline:0;box-shadow:var(--bs-focus-ring-x, 0) var(--bs-focus-ring-y, 0) var(--bs-focus-ring-blur, 0) var(--bs-focus-ring-width) var(--bs-focus-ring-color)}.icon-link{display:inline-flex;gap:0.375rem;align-items:center;text-decoration-color:rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 0.5));text-underline-offset:0.25em;backface-visibility:hidden}.icon-link>.bi{flex-shrink:0;width:1em;height:1em;fill:currentcolor;transition:0.2s ease-in-out transform}@media (prefers-reduced-motion: reduce){.icon-link>.bi{transition:none}}.icon-link-hover:hover>.bi,.icon-link-hover:focus-visible>.bi{transform:var(--bs-icon-link-transform, translate3d(0.25em, 0, 0))}.ratio{position:relative;width:100%}.ratio::before{display:block;padding-top:var(--bs-aspect-ratio);content:""}.ratio>*{position:absolute;top:0;left:0;width:100%;height:100%}.ratio-1x1{--bs-aspect-ratio:100%}.ratio-4x3{--bs-aspect-ratio:75%}.ratio-16x9{--bs-aspect-ratio:56.25%}.ratio-21x9{--bs-aspect-ratio:42.8571428571%}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}.sticky-top{position:sticky;top:0;z-index:1020}.sticky-bottom{position:sticky;bottom:0;z-index:1020}@media (min-width: 576px){.sticky-sm-top{position:sticky;top:0;z-index:1020}.sticky-sm-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 768px){.sticky-md-top{position:sticky;top:0;z-index:1020}.sticky-md-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 992px){.sticky-lg-top{position:sticky;top:0;z-index:1020}.sticky-lg-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 1200px){.sticky-xl-top{position:sticky;top:0;z-index:1020}.sticky-xl-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 1400px){.sticky-xxl-top{position:sticky;top:0;z-index:1020}.sticky-xxl-bottom{position:sticky;bottom:0;z-index:1020}}.hstack{display:flex;flex-direction:row;align-items:center;align-self:stretch}.vstack{display:flex;flex:1 1 auto;flex-direction:column;align-self:stretch}.visually-hidden,.visually-hidden-focusable:not(:focus):not(:focus-within){width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.visually-hidden:not(caption),.visually-hidden-focusable:not(:focus):not(:focus-within):not(caption){position:absolute !important}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;content:""}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vr{display:inline-block;align-self:stretch;width:var(--bs-border-width);min-height:1em;background-color:currentcolor;opacity:0.25}:host{font-family:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529}';const p=class{constructor(i){r(this,i);this.rowClicked=o(this,"payment-row-clicked",7);this.onPageChange=r=>()=>{this.fetchData(r)};this.accountId=undefined;this.authToken=undefined;this.payments=[];this.loading=true;this.errorMessage=undefined;this.paging=l}updateOnPropChange(){this.fetchData()}connectedCallback(){this.fetchData()}async fetchData(r){var o;if(!this.accountId||!this.authToken){this.errorMessage="Can not fetch any data without an AccountID and an AuthToken";this.loading=false;return}this.loading=true;const i=`account/${this.accountId}/payments`;const t=await e(this.authToken).get(i,{paging:this.paging,direction:r});if(!t.error){this.paging=Object.assign(Object.assign({},this.paging),t.page_info);const r=(o=t===null||t===void 0?void 0:t.data)===null||o===void 0?void 0:o.map((r=>new s(r)));this.payments=r}else{this.errorMessage=typeof t.error==="string"?t.error:t.error.message}this.loading=false}getPaymentMethod(r){return r.card||r.bank_account}render(){return i(t,null,i("justifi-table",{rowClickHandler:r=>{const o=r.target.closest("tr").dataset.rowEntityId;if(!o){return}this.rowClicked.emit(this.payments.find((r=>r.id===o)))},entityId:this.payments.map((r=>r.id)),columnData:[["Made On","The date and time each payment was made"],["Amount","The dollar amount of each payment"],["Description","The payment description, if you provided one"],["Cardholder","The name associated with the payment method"],["Payment Method","The brand and last 4 digits of the payment method"],["Status","The current status of each payment"],["Payment ID","The unique identifier of each payment"]],rowData:this.payments.map((r=>[{type:"head",value:`\n <div>${a(r.created_at)}</div>\n <div>${n(r.created_at)}</div>\n `},b(r.amount),r.description,this.getPaymentMethod(r.payment_method).name,this.getPaymentMethod(r.payment_method).acct_last_four,{type:"inner",value:c(r.status)},r.id])),loading:this.loading,"error-message":this.errorMessage,paging:Object.assign(Object.assign({},this.paging),{onPrev:this.onPageChange("prev"),onNext:this.onPageChange("next")})}))}static get watchers(){return{accountId:["updateOnPropChange"],authToken:["updateOnPropChange"]}}};p.style=d;export{p as justifi_payments_list};
|
|
2
|
+
//# sourceMappingURL=p-dabeb3df.entry.js.map
|