@apideck/vault-js
Version:
<img src="https://user-images.githubusercontent.com/8850410/208065819-716c6e02-98c9-4df5-b687-e5acd1e3c4e5.png" width="100%" />
3 lines (2 loc) • 1.54 kB
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0});var e=["onClose","onReady","onConnectionChange","onConnectionDelete"];exports.ApideckVault=function(){var n=null;return{open:function(t){var o=t.onClose,l=t.onReady,a=t.onConnectionChange,s=t.onConnectionDelete,d=function(e,n){if(null==e)return{};var t,o,l={},a=Object.keys(e);for(o=0;o<a.length;o++)n.indexOf(t=a[o])>=0||(l[t]=e[t]);return l}(t,e);n=function(){var e=document.createElement("iframe");return e.style.display="none",e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.border="none",e.style.zIndex="9999",e.src="https://vaultjs.apideck.com",e}(),document.body.appendChild(n),window.addEventListener("message",(function e(t){var i,c,u;if(null!==n&&("on-ready"===t.data&&(n.style.display="block",null==(c=n.contentWindow)||c.postMessage(d,"https://vaultjs.apideck.com"),null==l||l()),"on-close"===t.data&&(window.removeEventListener("message",e),null==o||o(),setTimeout((function(){null!==n&&(document.body.removeChild(n),n=null)}),300)),"object"==typeof t.data&&null!=(i=t.data)&&i.data))switch(null==(u=t.data)?void 0:u.type){case"on-connection-change":null==a||a(t.data.data);break;case"on-connection-delete":null==s||s(t.data.data)}}))},close:function(){var e,t;null==(e=n)||null==(t=e.contentWindow)||t.postMessage({type:"close"},"https://vaultjs.apideck.com"),setTimeout((function(){null!==n&&(document.body.removeChild(n),n=null)}),500)}}}();
//# sourceMappingURL=vault-js.cjs.production.min.js.map