@onefootprint/footprint-js
Advanced tools
Comparing version 3.7.1 to 3.8.0-beta.1
@@ -165,4 +165,4 @@ import * as CSS from 'csstype'; | ||
type Component = { | ||
destroy: () => void; | ||
render: () => Promise<void>; | ||
destroy: () => void; | ||
}; | ||
@@ -173,18 +173,19 @@ type SupportedLocale = 'en-US' | 'es-MX'; | ||
}; | ||
type Props = FormProps | VerifyProps | VerifyButtonProps | RenderProps; | ||
type Variant = 'modal' | 'drawer' | 'inline'; | ||
type Props = AuthProps | FormProps | RenderProps | VerifyButtonProps | VerifyProps; | ||
declare enum ComponentKind { | ||
Verify = "verify", | ||
Auth = "auth", | ||
Form = "form", | ||
Render = "render", | ||
Verify = "verify", | ||
VerifyButton = "verify-button" | ||
} | ||
type Variant = 'modal' | 'drawer' | 'inline'; | ||
type PropsBase = { | ||
kind: ComponentKind; | ||
appearance?: Appearance; | ||
variant?: Variant; | ||
containerId?: string; | ||
kind: ComponentKind; | ||
l10n?: L10n; | ||
variant?: Variant; | ||
}; | ||
type VerifyOptions = { | ||
type Options = { | ||
showCompletionPage?: boolean; | ||
@@ -202,7 +203,8 @@ showLogo?: boolean; | ||
type VerifySharedProps = (VerifyAuthToken | VerifyPublicKey) & { | ||
userData?: FootprintUserData; | ||
options?: VerifyOptions; | ||
onComplete?: (validationToken: string) => void; | ||
onCancel?: () => void; | ||
onClose?: () => void; | ||
onComplete?: (validationToken: string) => void; | ||
options?: Options; | ||
publicKey: string; | ||
userData?: FootprintUserData; | ||
}; | ||
@@ -214,23 +216,23 @@ type VerifyProps = PropsBase & VerifySharedProps & { | ||
type VerifyButtonProps = PropsBase & Partial<VerifySharedProps> & { | ||
kind: ComponentKind.VerifyButton; | ||
variant: 'inline'; | ||
containerId: string; | ||
dialogVariant?: 'modal' | 'drawer'; | ||
kind: ComponentKind.VerifyButton; | ||
label?: string; | ||
onClick?: () => void; | ||
label?: string; | ||
variant: 'inline'; | ||
}; | ||
type RenderProps = PropsBase & { | ||
kind: ComponentKind.Render; | ||
authToken: string; | ||
canCopy?: boolean; | ||
containerId: string; | ||
defaultHidden?: boolean; | ||
id: string; | ||
kind: ComponentKind.Render; | ||
label?: string; | ||
canCopy?: boolean; | ||
showHiddenToggle?: boolean; | ||
defaultHidden?: boolean; | ||
variant: 'inline'; | ||
containerId: string; | ||
}; | ||
type FormOptions = { | ||
hideButtons?: boolean; | ||
hideFootprintLogo?: boolean; | ||
hideButtons?: boolean; | ||
}; | ||
@@ -241,12 +243,22 @@ type FormRef = { | ||
type FormProps = PropsBase & { | ||
kind: ComponentKind.Form; | ||
authToken: string; | ||
title?: string; | ||
containerId?: string; | ||
variant?: Variant; | ||
options?: FormOptions; | ||
getRef?: (ref: FormRef) => void; | ||
kind: ComponentKind.Form; | ||
onCancel?: () => void; | ||
onClose?: () => void; | ||
onComplete?: () => void; | ||
options?: FormOptions; | ||
title?: string; | ||
variant?: Variant; | ||
}; | ||
type AuthProps = PropsBase & { | ||
kind: ComponentKind.Auth; | ||
onCancel?: () => void; | ||
onClose?: () => void; | ||
onComplete?: (validationToken: string) => void; | ||
options?: Options; | ||
publicKey: string; | ||
userData?: Pick<FootprintUserData, 'id.email' | 'id.phone_number'>; | ||
variant?: 'modal' | 'drawer'; | ||
}; | ||
@@ -257,12 +269,12 @@ | ||
declare enum PublicEvent { | ||
canceled = "canceled", | ||
clicked = "clicked", | ||
closed = "closed", | ||
canceled = "canceled", | ||
completed = "completed", | ||
clicked = "clicked" | ||
completed = "completed" | ||
} | ||
declare enum PrivateEvent { | ||
formSaveComplete = "formSaveComplete", | ||
formSaved = "formSaved", | ||
propsReceived = "propsReceived", | ||
started = "started", | ||
formSaved = "formSaved", | ||
formSaveComplete = "formSaveComplete" | ||
started = "started" | ||
} | ||
@@ -280,2 +292,2 @@ | ||
export { Footprint, Appearance as FootprintAppearance, AppearanceRules as FootprintAppearanceRules, AppearanceTheme as FootprintAppearanceTheme, AppearanceVariables as FootprintAppearanceVariables, Component as FootprintComponent, ComponentKind as FootprintComponentKind, FormOptions as FootprintFormOptions, FormProps as FootprintFormProps, FormRef as FootprintFormRef, IdentifyRequest as FootprintIdentifyRequest, PrivateEvent as FootprintPrivateEvent, Props as FootprintProps, PropsBase as FootprintPropsBase, PublicEvent as FootprintPublicEvent, RenderProps as FootprintRenderProps, FootprintUserData, Variant as FootprintVariant, VerifyAuthToken as FootprintVerifyAuthToken, VerifyButtonProps as FootprintVerifyButtonProps, VerifyOptions as FootprintVerifyOptions, VerifyProps as FootprintVerifyProps, VerifyPublicKey as FootprintVerifyPublicKey, L10n, SupportedLocale, footprint as default, identifyUser as identifyFootprintUser }; | ||
export { Footprint, Appearance as FootprintAppearance, AppearanceRules as FootprintAppearanceRules, AppearanceTheme as FootprintAppearanceTheme, AppearanceVariables as FootprintAppearanceVariables, AuthProps as FootprintAuthProps, Component as FootprintComponent, ComponentKind as FootprintComponentKind, FormOptions as FootprintFormOptions, FormProps as FootprintFormProps, FormRef as FootprintFormRef, IdentifyRequest as FootprintIdentifyRequest, Options as FootprintOptions, PrivateEvent as FootprintPrivateEvent, Props as FootprintProps, PropsBase as FootprintPropsBase, PublicEvent as FootprintPublicEvent, RenderProps as FootprintRenderProps, FootprintUserData, Variant as FootprintVariant, VerifyAuthToken as FootprintVerifyAuthToken, VerifyButtonProps as FootprintVerifyButtonProps, VerifyProps as FootprintVerifyProps, VerifyPublicKey as FootprintVerifyPublicKey, L10n, SupportedLocale, footprint as default, identifyUser as identifyFootprintUser }; |
@@ -1,5 +0,5 @@ | ||
import Fe from '@onefootprint/postmate'; | ||
import Oe from '@onefootprint/postmate'; | ||
var me=Object.defineProperty,fe=Object.defineProperties;var ye=Object.getOwnPropertyDescriptors;var V=Object.getOwnPropertySymbols;var U=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var N=(e,t,r)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,b=(e,t)=>{for(var r in t||(t={}))U.call(t,r)&&N(e,r,t[r]);if(V)for(var r of V(t))$.call(t,r)&&N(e,r,t[r]);return e},k=(e,t)=>fe(e,ye(t));var S=(e,t)=>{var r={};for(var o in e)U.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&V)for(var o of V(e))t.indexOf(o)<0&&$.call(e,o)&&(r[o]=e[o]);return r};var m=(e,t,r)=>new Promise((o,n)=>{var a=i=>{try{s(r.next(i));}catch(c){n(c);}},p=i=>{try{s(r.throw(i));}catch(c){n(c);}},s=i=>i.done?o(i.value):Promise.resolve(i.value).then(a,p);s((r=r.apply(e,t)).next());});var w=(n=>(n.Verify="verify",n.Form="form",n.Render="render",n.VerifyButton="verify-button",n))(w||{});var E=(n=>(n.closed="closed",n.canceled="canceled",n.completed="completed",n.clicked="clicked",n))(E||{}),D=(n=>(n.propsReceived="propsReceived",n.started="started",n.formSaved="formSaved",n.formSaveComplete="formSaveComplete",n))(D||{});var j="footprint-inline-container",M="footprint-body-locked",q="footprint-overlay",H="footprint-overlay-container",z=j,J=q,X="footprint-loading-indicator",u=(e,t)=>`${e}-${t}`,Y=e=>m(void 0,null,function*(){x(e),ge(e),yield ue(e);}),G=e=>{let t=u(H,e),r=document.getElementById(t);if(r)return r;let o=document.createElement("div");return o.setAttribute("id",t),document.body.appendChild(o),o},ue=e=>m(void 0,null,function*(){let t=u(H,e),r=document.getElementById(t);if(!r)return;let o=r.querySelector("iframe.footprint-drawer");o&&(o==null||o.classList.add("footprint-drawer-closing"),yield new Promise(s=>{setTimeout(s,300);}));let n=r.querySelector("iframe.footprint-modal");n&&(n==null||n.classList.add("footprint-modal-closing"),yield new Promise(s=>{setTimeout(s,100);}));let a=u(J,e),p=document.getElementById(a);p&&(p.classList.add("footprint-overlay-fading"),yield new Promise(s=>{setTimeout(s,200);}),r.remove(),p.remove(),document.body.classList.remove(M));}),Z=(e,t)=>{let r=u(z,e),o=document.createElement("div");return o.classList.add(j),o.setAttribute("id",r),t.appendChild(o),o},ge=e=>{let t=u(z,e),r=document.getElementById(t);r&&r.remove();},x=e=>{let t=u(X,e),r=document.getElementById(t);r&&r.remove();},O=(e,t)=>{let r=u(X,t),o=ve(r);e.appendChild(o);},Q=(e,t)=>{document.body.classList.add(M);let r=document.createElement("div"),o=u(J,t);return r.setAttribute("id",o),r.classList.add(q),e.appendChild(r),r},ve=e=>{let t=document.createElement("div");t.setAttribute("id",e),t.classList.add("footprint-loading-indicator");let r=document.createElement("div");r.classList.add("footprint-loading-spin");let o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width","24px"),o.setAttribute("height","24px"),o.setAttribute("fill","none"),o.setAttribute("aria-hidden","true");let n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d","M12 2a10 10 0 0 1 10 10h-2a7.999 7.999 0 0 0-8-8V2Z"),o.appendChild(n),r.appendChild(o),t.appendChild(r),t};var Pe=()=>`${Math.floor(Math.random()*1e3)}`,R=Pe;var L={["form"]:{["closed"]:"onClose",["canceled"]:"onCancel",["completed"]:"onComplete"},["verify"]:{["closed"]:"onClose",["canceled"]:"onCancel",["completed"]:"onComplete"},["verify-button"]:{["clicked"]:"onClick",["closed"]:"onClose",["canceled"]:"onCancel",["completed"]:"onComplete"},["render"]:{}},W={["form"]:[],["verify"]:[],["render"]:[],["verify-button"]:[]};var Ce={["form"]:["getRef"],["verify"]:[],["verify-button"]:[],["render"]:[]},ee=Ce;var te={["verify"]:["modal","drawer"],["verify-button"]:["inline"],["form"]:["inline","modal","drawer"],["render"]:["inline"]},A=(e,t)=>{var n;if(!t)return;let r=(n=te[e])!=null?n:[];if(!r.includes(t))throw new Error(`Invalid variant: ${JSON.stringify(t)}. Valid variants for ${e} are ${r.join(", ")}`)},I=e=>{var r;let t=(r=te[e])!=null?r:[];if(!t.length)throw new Error(`Invalid kind: ${e}`);return t[0]},K=e=>{if(!e)throw new Error("Kind is required");if(!Object.values(w).includes(e))throw new Error(`Invalid kind: ${e}. Valid kinds are: ${Object.values(w).join(", ")}}`)},be=(e,t)=>{if(e==="inline"&&!t)throw new Error(`Inline component requires a containerId. Received ${t}`)},Ie=e=>{let{kind:t}=e;if(t==="verify-button"){let r=e,{kind:o,appearance:n,variant:a,dialogVariant:p,onClick:s,label:i,containerId:c}=r,d=S(r,["kind","appearance","variant","dialogVariant","onClick","label","containerId"]);return k(b({},d),{variant:p,kind:"verify"})}},we=e=>{var o;let{kind:t}=e;return (o=ee[t])!=null?o:[]},re=(e,t,r)=>{var p;let{kind:o}=e,n=(p=L[o])!=null?p:{},a={};return Object.entries(n).forEach(([s,i])=>{let c=s;if(!Object.values(E).includes(c))return;let d=e[i];(!d||typeof d!="function")&&(d=()=>{});let y=c==="closed"||c==="canceled",v=o==="verify-button"&&c==="clicked";a[c]=P=>{d(P),y&&(t==null||t());let C=Ie(e);v&&C&&(r==null||r(C));};}),a},oe=e=>{var y;let d=e,{kind:t,appearance:r,containerId:o}=d,n=S(d,["kind","appearance","containerId"]),a=(y=L[t])!=null?y:{},p=Object.values(a),s=we(e),i=Object.values(s);return Object.fromEntries(Object.entries(n).filter(([v])=>!p.includes(v)&&!i.includes(v)))},F=e=>{let{kind:t,variant:r,containerId:o}=e;K(t),A(t,r);let n=r||I(t);return be(n,o),k(b({},e),{variant:n})};var he=e=>typeof e=="object"&&!!e,B=({fontSrc:e,variables:t={},rules:r={},variant:o}={})=>{let n=()=>Object.keys(t).length?encodeURIComponent(JSON.stringify(t)):void 0,a=()=>Object.keys(r).length?encodeURIComponent(JSON.stringify(r)):void 0;return {fontSrc:e,variables:n(),rules:a(),variant:o}},ne=()=>{let e=window.footprintAppearance;return !e||!he(e)?{}:{fontSrc:e.fontSrc,rules:e.rules,theme:e.theme,variables:e.variables}};var Ve=e=>{let{kind:t}=e;return t==="verify"?Ee(e):Re(e)},Ee=e=>{let{appearance:t,variant:r,kind:o}=e,{fontSrc:n,rules:a,variables:p}=B(t),s="https://id.onefootprint.com",i=new URLSearchParams;"publicKey"in e&&e.publicKey&&i.append("public_key",e.publicKey),p&&i.append("variables",p),a&&i.append("rules",a),n&&i.append("font_src",n),i.append("variant",r!=null?r:I(o));let c=i.toString();return `${s}?${c}`},Re=e=>{let{appearance:t,kind:r,variant:o}=e,{fontSrc:n,rules:a,variables:p}=B(t),s="https://components.onefootprint.com",i=new URLSearchParams;p&&i.append("variables",p),a&&i.append("rules",a),n&&i.append("font_src",n),i.append("variant",o!=null?o:I(r));let c=i.toString();return `${s}/${r}?${c}`},ie=Ve;var ke=e=>{let t=null,r=!1,o=F(e),{variant:n,containerId:a}=o,p=n==="modal"||n==="drawer",s,i,c=R(),d=()=>{if(!t)throw new Error("Footprint should be initialized in order to listen events");let l=re(o,s,i);Object.entries(l).forEach(([f,h])=>{t==null||t.on(f,h);});},y=()=>{if(!t)throw new Error("Footprint should be initialized in order to set up refs");let{kind:l}=o;if(l!=="form")return;let{getRef:f}=o;if(!f)return;f({save:()=>{if(!t)throw new Error("Footprint should be initialized to call ref methods");return new Promise(le=>{t==null||t.call("formSaved"),t==null||t.on("formSaveComplete",()=>{le();});})}});},v=()=>{if(!t)throw new Error("Footprint should be initialized in order to receive props");let l=oe(o);t.call("propsReceived",l);},P=()=>{if(p)return G(c);if(!a)throw new Error("containerId is required when rendering inline");let l=document.getElementById(a);if(!l)throw new Error(`Could not find container with id ${a} while rendering footprint`);return Z(c,l)},C=(l,f)=>{if(!f){x(c),t==null||t.frame.classList.remove(`footprint-${n}-loading`),t==null||t.frame.classList.add(`footprint-${n}-loaded`);return}if(p){let h=Q(l,c);O(h,c);}else O(l,c);};return {props:o,isRendered:r,render:()=>m(void 0,null,function*(){if(r)return;let l=P();if(!l)return;l.hasChildNodes()&&(l.innerHTML="");let f=ie(o);r=!0,C(l,!0),t=yield new Fe({classListArray:[`footprint-${n}`,`footprint-${n}-loading`],container:l,name:`footprint-iframe-${c}`,url:f,allow:"otp-credentials; publickey-credentials-get *; camera *; clipboard-write;"}),C(l,!1),d(),t.on("started",()=>{v(),y();});}),destroy:()=>m(void 0,null,function*(){r&&(r=!1,yield Y(c),t&&(t.destroy(),t=null));}),registerEvent:(l,f)=>{l==="renderSecondary"?i=f:l==="destroy"&&(s=f);}}},T=ke;var g=e=>{let t=F(e);return JSON.stringify(t)},Se=()=>{let e={};return {getOrCreate:a=>{let p=g(a.props),s=Object.values(e).find(i=>g(i.iframe.props)===p);return s?s.iframe:(e[p]={iframe:a,secondaryIframes:{}},a)},remove:a=>{let p=g(a.props),s=e[p];s&&(Object.keys(s.secondaryIframes).forEach(i=>{s.secondaryIframes[i].destroy();}),delete e[p]);},getOrCreateSecondary:(a,p)=>{let s=g(a.props),i=g(p.props);if(!e[s])throw new Error("iframe manager: primary iframe does not exist while adding secondary");let{secondaryIframes:c}=e[s],d=Object.values(c).find(y=>g(y.props)===i);return d||(c[i]=p,p)},removeSecondary:(a,p)=>{let s=g(a.props),i=g(p.props);if(!e[s])throw new Error("iframe manager: primary iframe does not exist while removing secondary");let{secondaryIframes:c}=e[s],d=c[i];d&&(d.destroy(),delete c[i]);}}},ae=Se;var xe=()=>{let e=ae();return {init:r=>{let o=T(r),n=()=>m(void 0,null,function*(){e.remove(o),yield o.destroy();}),a=i=>m(void 0,null,function*(){e.removeSecondary(o,i),yield i.destroy();}),p=i=>m(void 0,null,function*(){let c=T(i);c=e.getOrCreateSecondary(o,c),c.registerEvent("destroy",()=>{a(c);}),c.render();});return {render:()=>m(void 0,null,function*(){o=e.getOrCreate(o),o.registerEvent("destroy",n),o.registerEvent("renderSecondary",p),yield o.render();}),destroy:n}}}},Oe=xe(),_=Oe;var Le=e=>{window.setTimeout(e,0);},se=e=>typeof e=="object"&&!!e,Ae=e=>{if(typeof window=="undefined")return;let t=n=>{var s;let a=(s=window.footprintCallbacks)!=null?s:{};if(!se(a))throw Error("`window.footprintCallbacks` must be a valid mapping from callback names to functions.");return W[n].forEach(i=>{if(!a[i])throw Error(`Callback '${i}' must be defined in window.footprintCallbacks`)}),a},r=n=>{var P;let a=n.getAttribute("data-kind");K(a);let p=(P=n.getAttribute("data-variant"))!=null?P:I(a);A(a,p);let s=ne(),i=t(a),c=n.getAttribute("data-props")||"",d;try{d=JSON.parse(c);}catch(C){throw Error("Could not parse `data-props` for footprint.")}if(!se(d))throw Error("`data-props` on the footprint element has to be a valid JSON object stringified.");let y=R();n.setAttribute("id",y),e.init(b(b({kind:a,variant:p,appearance:s,containerId:n.id},i),d)).render();},o=()=>{let n=document.querySelectorAll("[data-footprint]");n.length&&n.forEach(a=>{r(a);});};document.addEventListener("DOMContentLoaded",()=>Le(o));},pe=Ae;var ce=e=>m(void 0,null,function*(){let t=yield fetch("https://api.onefootprint.com/hosted/identify",{method:"POST",body:JSON.stringify(e)});if(!t.ok)throw Error(t.statusText);return (yield t.json()).user_found}),Ke=e=>m(void 0,null,function*(){if(!e)throw new Error("User data must be passed in order to identify an user");let t=e["id.email"],r=e["id.phone_number"];return t&&(yield ce({identifier:{email:t}}))?!0:r?yield ce({identifier:{phone_number:r}}):!1}),de=Ke;var xt=_;pe(_); | ||
var de=Object.defineProperty,ce=Object.defineProperties;var le=Object.getOwnPropertyDescriptors;var C=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var B=(e,t,r)=>t in e?de(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v=(e,t)=>{for(var r in t||(t={}))T.call(t,r)&&B(e,r,t[r]);if(C)for(var r of C(t))_.call(t,r)&&B(e,r,t[r]);return e},h=(e,t)=>ce(e,le(t));var V=(e,t)=>{var r={};for(var o in e)T.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&C)for(var o of C(e))t.indexOf(o)<0&&_.call(e,o)&&(r[o]=e[o]);return r};var m=(e,t,r)=>new Promise((o,n)=>{var a=i=>{try{s(r.next(i));}catch(d){n(d);}},p=i=>{try{s(r.throw(i));}catch(d){n(d);}},s=i=>i.done?o(i.value):Promise.resolve(i.value).then(a,p);s((r=r.apply(e,t)).next());});var b=(a=>(a.Auth="auth",a.Form="form",a.Render="render",a.Verify="verify",a.VerifyButton="verify-button",a))(b||{});var w=(n=>(n.canceled="canceled",n.clicked="clicked",n.closed="closed",n.completed="completed",n))(w||{}),U=(n=>(n.formSaveComplete="formSaveComplete",n.formSaved="formSaved",n.propsReceived="propsReceived",n.started="started",n))(U||{});var N="footprint-inline-container",D="footprint-body-locked",$="footprint-overlay",M="footprint-overlay-container",j=N,q=$,H="footprint-loading-indicator",y=(e,t)=>`${e}-${t}`,z=e=>m(void 0,null,function*(){R(e),fe(e),yield me(e);}),J=e=>{let t=y(M,e),r=document.getElementById(t);if(r)return r;let o=document.createElement("div");return o.setAttribute("id",t),document.body.appendChild(o),o},me=e=>m(void 0,null,function*(){let t=y(M,e),r=document.getElementById(t);if(!r)return;let o=r.querySelector("iframe.footprint-drawer");o&&(o==null||o.classList.add("footprint-drawer-closing"),yield new Promise(s=>{setTimeout(s,300);}));let n=r.querySelector("iframe.footprint-modal");n&&(n==null||n.classList.add("footprint-modal-closing"),yield new Promise(s=>{setTimeout(s,100);}));let a=y(q,e),p=document.getElementById(a);p&&(p.classList.add("footprint-overlay-fading"),yield new Promise(s=>{setTimeout(s,200);}),r.remove(),p.remove(),document.body.classList.remove(D));}),X=(e,t)=>{let r=y(j,e),o=document.createElement("div");return o.classList.add(N),o.setAttribute("id",r),t.appendChild(o),o},fe=e=>{let t=y(j,e),r=document.getElementById(t);r&&r.remove();},R=e=>{let t=y(H,e),r=document.getElementById(t);r&&r.remove();},O=(e,t)=>{let r=y(H,t),o=ye(r);e.appendChild(o);},Y=(e,t)=>{document.body.classList.add(D);let r=document.createElement("div"),o=y(q,t);return r.setAttribute("id",o),r.classList.add($),e.appendChild(r),r},ye=e=>{let t=document.createElement("div");t.setAttribute("id",e),t.classList.add("footprint-loading-indicator");let r=document.createElement("div");r.classList.add("footprint-loading-spin");let o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width","24px"),o.setAttribute("height","24px"),o.setAttribute("fill","none"),o.setAttribute("aria-hidden","true");let n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d","M12 2a10 10 0 0 1 10 10h-2a7.999 7.999 0 0 0-8-8V2Z"),o.appendChild(n),r.appendChild(o),t.appendChild(r),t};var ue=()=>`${Math.floor(Math.random()*1e3)}`,I=ue;var F={["auth"]:{["canceled"]:"onCancel",["closed"]:"onClose",["completed"]:"onComplete"},["form"]:{["canceled"]:"onCancel",["closed"]:"onClose",["completed"]:"onComplete"},["verify"]:{["canceled"]:"onCancel",["closed"]:"onClose",["completed"]:"onComplete"},["verify-button"]:{["canceled"]:"onCancel",["clicked"]:"onClick",["closed"]:"onClose",["completed"]:"onComplete"},["render"]:{}},G={["auth"]:[],["form"]:[],["render"]:[],["verify"]:[],["verify-button"]:[]};var ve={["auth"]:[],["form"]:["getRef"],["render"]:[],["verify"]:[],["verify-button"]:[]},Z=ve;var Q={["auth"]:["modal","drawer"],["form"]:["inline","modal","drawer"],["render"]:["inline"],["verify"]:["modal","drawer"],["verify-button"]:["inline"]},ge=Object.values(w),Pe=(...e)=>{},Ce=(e,t)=>{if(e==="inline"&&!t)throw new Error(`Inline component requires a containerId. Received ${t}`)},x=(e,t)=>{var n;if(!t)return;let r=(n=Q[e])!=null?n:[];if(!r.includes(t))throw new Error(`Invalid variant: ${JSON.stringify(t)}. Valid variants for ${e} are ${r.join(", ")}`)},g=e=>{var r;let t=(r=Q[e])!=null?r:[];if(!t.length)throw new Error(`Invalid kind: ${e}`);return t[0]},k=e=>{if(!e)throw new Error("Kind is required");let t=Object.values(b);if(!t.includes(e))throw new Error(`Invalid kind: ${e}. Valid kinds are: ${t.join(", ")}`)},be=e=>{if(e.kind==="verify-button"){let t=e,{kind:r,appearance:o,variant:n,dialogVariant:a,onClick:p,label:s,containerId:i}=t,d=V(t,["kind","appearance","variant","dialogVariant","onClick","label","containerId"]);return h(v({},d),{variant:a,kind:"verify"})}},we=({kind:e})=>{var t;return (t=Z[e])!=null?t:[]},Ie=(e,t)=>(Object.prototype.hasOwnProperty.call(e,t)&&typeof e[t]=="function"?e[t]:void 0)||Pe,W=(e,t,r)=>{var s;let{kind:o}=e,n=(s=F[o])!=null?s:{},a={},p=be(e);return Object.entries(n).forEach(([i,d])=>{let c=i;if(!ge.includes(c))return;let l=Ie(e,d),f=c==="closed"||c==="canceled",P=o==="verify-button"&&c==="clicked";a[c]=K=>{l(K),f&&(t==null||t()),P&&p&&(r==null||r(p));};}),a},ee=e=>{var c;let d=e,{kind:t,appearance:r,containerId:o}=d,n=V(d,["kind","appearance","containerId"]),a=(c=F[t])!=null?c:{},p=Object.values(a),s=we(e),i=Object.values(s);return Object.fromEntries(Object.entries(n).filter(([l])=>!p.includes(l)&&!i.includes(l)))},E=e=>{let{kind:t,variant:r,containerId:o}=e,n=r||g(t);return k(t),x(t,r),Ce(n,o),h(v({},e),{variant:n})};var Ee=e=>typeof e=="object"&&!!e,A=({fontSrc:e,variables:t={},rules:r={},variant:o}={})=>{let n=()=>Object.keys(t).length?encodeURIComponent(JSON.stringify(t)):void 0,a=()=>Object.keys(r).length?encodeURIComponent(JSON.stringify(r)):void 0;return {fontSrc:e,variables:n(),rules:a(),variant:o}},te=()=>{let e=window.footprintAppearance;return !e||!Ee(e)?{}:{fontSrc:e.fontSrc,rules:e.rules,theme:e.theme,variables:e.variables}};var he=e=>{let{kind:t}=e;return t==="verify"?Ve(e):Re(e)},Ve=e=>{let{appearance:t,variant:r,kind:o}=e,{fontSrc:n,rules:a,variables:p}=A(t),s="https://id.onefootprint.com",i=new URLSearchParams;"publicKey"in e&&e.publicKey&&i.append("public_key",e.publicKey),p&&i.append("variables",p),a&&i.append("rules",a),n&&i.append("font_src",n),i.append("variant",r!=null?r:g(o));let d=i.toString();return `${s}?${d}`},Re=e=>{let{appearance:t,kind:r,variant:o}=e,{fontSrc:n,rules:a,variables:p}=A(t),s="https://components.onefootprint.com",i=new URLSearchParams;p&&i.append("variables",p),a&&i.append("rules",a),n&&i.append("font_src",n),i.append("variant",o!=null?o:g(r));let d=i.toString();return `${s}/${r}?${d}`},re=he;var Fe=(e,t,r,o)=>{if(!e)throw new Error("Footprint should be initialized in order to listen events");let n=W(t,r,o);return Object.entries(n).forEach(([a,p])=>{e==null||e.on(a,p);}),e},xe=(e,t)=>{if(!e)throw new Error("Footprint should be initialized in order to set up refs");let{kind:r}=t;if(r!=="form")return;let{getRef:o}=t;if(!o)return;o({save:()=>{if(!e)throw new Error("Footprint should be initialized to call ref methods");return new Promise(a=>{e==null||e.call("formSaved"),e==null||e.on("formSaveComplete",()=>{a();});})}});},ke=(e,t)=>{if(!e)throw new Error("Footprint should be initialized in order to receive props");let r=ee(t);e.call("propsReceived",r);},Ae=({variant:e,containerId:t},r)=>{if(e==="modal"||e==="drawer")return J(r);if(!t)throw new Error("containerId is required when rendering inline");let n=document.getElementById(t);if(!n)throw new Error(`Could not find container with id ${t} while rendering footprint`);return X(r,n)},oe=(e,{variant:t},r,o,n)=>{let a=t==="modal"||t==="drawer";if(!n){R(r),e==null||e.frame.classList.remove(`footprint-${t}-loading`),e==null||e.frame.classList.add(`footprint-${t}-loaded`);return}if(a){let p=Y(o,r);O(p,r);}else O(o,r);},Se=e=>{let t=null,r=!1,o,n,a=E(e),{variant:p}=a,s=I();return {props:a,isRendered:r,render:()=>m(void 0,null,function*(){if(r)return;let l=Ae(a,s);if(!l)return;l.hasChildNodes()&&(l.innerHTML="");let f=re(a);r=!0,oe(t,a,s,l,!0),t=yield new Oe({classListArray:[`footprint-${p}`,`footprint-${p}-loading`],container:l,name:`footprint-iframe-${s}`,url:f,allow:"otp-credentials; publickey-credentials-get *; camera *; clipboard-write;"}),oe(t,a,s,l,!1),t=Fe(t,a,o,n),t.on("started",()=>{ke(t,a),xe(t,a);});}),destroy:()=>m(void 0,null,function*(){r&&(r=!1,yield z(s),t&&(t.destroy(),t=null));}),registerEvent:(l,f)=>{!f||typeof f!="function"||(l==="renderSecondary"?n=f:l==="destroy"&&(o=f));}}},S=Se;var u=e=>{let t=E(e);return JSON.stringify(t)},Le=()=>{let e=Object.create(null);return {getOrCreate:a=>{let p=u(a.props),s=Object.values(e).find(i=>u(i.iframe.props)===p);return s?s.iframe:(e[p]={iframe:a,secondaryIframes:{}},a)},getOrCreateSecondary:(a,p)=>{let s=u(a.props),i=u(p.props);if(!e[s])throw new Error("iframe manager: primary iframe does not exist while adding secondary");let{secondaryIframes:d}=e[s],c=Object.values(d).find(l=>u(l.props)===i);return c||(d[i]=p,p)},remove:a=>{let p=u(a.props),s=e[p];s&&(Object.keys(s.secondaryIframes).forEach(i=>{s.secondaryIframes[i].destroy();}),delete e[p]);},removeSecondary:(a,p)=>{let s=u(a.props),i=u(p.props);if(!e[s])throw new Error("iframe manager: primary iframe does not exist while removing secondary");let{secondaryIframes:d}=e[s],c=d[i];c&&(c.destroy(),delete d[i]);}}},ne=Le;var Ke=()=>{let e=ne();return {init:r=>{let o=S(r),n=()=>m(void 0,null,function*(){e.remove(o),yield o.destroy();}),a=i=>m(void 0,null,function*(){e.removeSecondary(o,i),yield i.destroy();}),p=i=>m(void 0,null,function*(){let d=S(i);d=e.getOrCreateSecondary(o,d),d.registerEvent("destroy",()=>{a(d);}),d.render();});return {render:()=>m(void 0,null,function*(){o=e.getOrCreate(o),o.registerEvent("destroy",n),o.registerEvent("renderSecondary",p),yield o.render();}),destroy:n}}}},Be=Ke(),L=Be;var Te=e=>{window.setTimeout(e,0);},ae=e=>typeof e=="object"&&!!e,_e=e=>{if(typeof window=="undefined")return;let t=n=>{var s;let a=(s=window.footprintCallbacks)!=null?s:{};if(!ae(a))throw Error("`window.footprintCallbacks` must be a valid mapping from callback names to functions.");return G[n].forEach(i=>{if(!a[i])throw Error(`Callback '${i}' must be defined in window.footprintCallbacks`)}),a},r=n=>{var P;let a=n.getAttribute("data-kind");k(a);let p=(P=n.getAttribute("data-variant"))!=null?P:g(a);x(a,p);let s=te(),i=t(a),d=n.getAttribute("data-props")||"",c;try{c=JSON.parse(d);}catch(K){throw Error("Could not parse `data-props` for footprint.")}if(!ae(c))throw Error("`data-props` on the footprint element has to be a valid JSON object stringified.");let l=I();n.setAttribute("id",l),e.init(v(v({kind:a,variant:p,appearance:s,containerId:n.id},i),c)).render();},o=()=>{let n=document.querySelectorAll("[data-footprint]");n.length&&n.forEach(a=>{r(a);});};document.addEventListener("DOMContentLoaded",()=>Te(o));},ie=_e;var se=e=>m(void 0,null,function*(){let t=yield fetch("https://api.onefootprint.com/hosted/identify",{method:"POST",body:JSON.stringify(e)});if(!t.ok)throw Error(t.statusText);return (yield t.json()).user_found}),Ue=e=>m(void 0,null,function*(){if(!e)throw new Error("User data must be passed in order to identify an user");let t=e["id.email"],r=e["id.phone_number"];return t&&(yield se({identifier:{email:t}}))?!0:r?yield se({identifier:{phone_number:r}}):!1}),pe=Ue;var At=L;ie(L); | ||
export { w as FootprintComponentKind, D as FootprintPrivateEvent, E as FootprintPublicEvent, xt as default, de as identifyFootprintUser }; | ||
export { b as FootprintComponentKind, U as FootprintPrivateEvent, w as FootprintPublicEvent, At as default, pe as identifyFootprintUser }; |
(function (exports) { | ||
'use strict'; | ||
var ve=Object.defineProperty,ge=Object.defineProperties;var he=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var U=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var $=(e,t,r)=>t in e?ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,w=(e,t)=>{for(var r in t||(t={}))U.call(t,r)&&$(e,r,t[r]);if(O)for(var r of O(t))j.call(t,r)&&$(e,r,t[r]);return e},S=(e,t)=>ge(e,he(t));var L=(e,t)=>{var r={};for(var n in e)U.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&O)for(var n of O(e))t.indexOf(n)<0&&j.call(e,n)&&(r[n]=e[n]);return r};var f=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{d(r.next(a));}catch(p){o(p);}},s=a=>{try{d(r.throw(a));}catch(p){o(p);}},d=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,s);d((r=r.apply(e,t)).next());});var E="application/x-postmate-v1+json",Pe=5,Ee=0,Ce=function(){return ++Ee};var we=function(t){var r=document.createElement("a");r.href=t;var n=r.protocol.length>4?r.protocol:window.location.protocol,o=r.host.length?r.port==="80"||r.port==="443"?r.hostname:r.host:window.location.host;return r.origin||n+"//"+o},Ie={handshake:1,"handshake-reply":1,call:1,emit:1,reply:1,request:1},x=function(t,r){return !(typeof r=="string"&&t.origin!==r||!t.data||typeof t.data=="object"&&!("postmate"in t.data)||t.data.type!==E||!Ie[t.data.postmate])},be=function(t,r){var n=typeof t[r]=="function"?t[r]():t[r];return C.Promise.resolve(n)},Ve=function(){function e(r){var n=this;this.parent=r.parent,this.frame=r.frame,this.child=r.child,this.childOrigin=r.childOrigin,this.events={},this.listener=function(o){if(!x(o,n.childOrigin))return !1;var i=((o||{}).data||{}).value||{},s=i.data,d=i.name;o.data.postmate==="emit"&&d in n.events&&n.events[d].forEach(function(a){a.call(n,s);});},this.parent.addEventListener("message",this.listener,!1);}var t=e.prototype;return t.get=function(n){var o=this;return new C.Promise(function(i){var s=Ce(),d=function a(p){p.data.uid===s&&p.data.postmate==="reply"&&(o.parent.removeEventListener("message",a,!1),i(p.data.value));};o.parent.addEventListener("message",d,!1),o.child.postMessage({postmate:"request",type:E,property:n,uid:s},o.childOrigin);})},t.call=function(n,o){this.child.postMessage({postmate:"call",type:E,property:n,data:o},this.childOrigin);},t.on=function(n,o){this.events[n]||(this.events[n]=[]),this.events[n].push(o);},t.destroy=function(){window.removeEventListener("message",this.listener,!1),this.frame.parentNode.removeChild(this.frame);},e}(),Oe=function(){function e(r){var n=this;this.model=r.model,this.parent=r.parent,this.parentOrigin=r.parentOrigin,this.child=r.child,this.child.addEventListener("message",function(o){if(x(o,n.parentOrigin)){var i=o.data,s=i.property,d=i.uid,a=i.data;if(o.data.postmate==="call"){s in n.model&&typeof n.model[s]=="function"&&n.model[s](a);return}be(n.model,s).then(function(p){return o.source.postMessage({property:s,postmate:"reply",type:E,uid:d,value:p},o.origin)});}});}var t=e.prototype;return t.emit=function(n,o){this.parent.postMessage({postmate:"emit",type:E,value:{name:n,data:o}},this.parentOrigin);},e}(),C=function(){function e(r){var n=r.container,o=n===void 0?typeof o!="undefined"?o:document.body:n,i=r.model,s=r.url,d=r.name,a=d===void 0?"":d,p=r.allow,c=r.classListArray,m=c===void 0?[]:c;return this.parent=window,this.frame=document.createElement("iframe"),this.frame.name=a||"",this.frame.classList.add.apply(this.frame.classList,m),p&&(this.frame.allow=p),o.appendChild(this.frame),this.child=this.frame.contentWindow||this.frame.contentDocument.parentWindow,this.model=i||{},this.sendHandshake(s)}var t=e.prototype;return t.sendHandshake=function(n){var o=this,i=we(n),s=0,d;return new e.Promise(function(a,p){var c=function v(g){return x(g,i)?g.data.postmate==="handshake-reply"?(clearInterval(d),o.parent.removeEventListener("message",v,!1),o.childOrigin=g.origin,a(new Ve(o))):p("Failed handshake"):!1};o.parent.addEventListener("message",c,!1);var m=function(){s++,o.child.postMessage({postmate:"handshake",type:E,model:o.model},i),s===Pe&&clearInterval(d);},y=function(){m(),d=setInterval(m,500);};o.frame.attachEvent?o.frame.attachEvent("onload",y):o.frame.addEventListener("load",y),o.frame.src=n;})},e}();C.debug=!1;C.Promise=function(){try{return window?window.Promise:Promise}catch(e){return null}}();C.Model=function(){function e(r){return this.child=window,this.model=r,this.parent=this.child.parent,this.sendHandshakeReply()}var t=e.prototype;return t.sendHandshakeReply=function(){var n=this;return new C.Promise(function(o,i){var s=function d(a){if(a.data.postmate){if(a.data.postmate==="handshake"){n.child.removeEventListener("message",d,!1),a.source.postMessage({postmate:"handshake-reply",type:E},a.origin),n.parentOrigin=a.origin;var p=a.data.model;return p&&Object.keys(p).forEach(function(c){n.model[c]=p[c];}),o(new Oe(n))}return i("Handshake Reply Failed")}};n.child.addEventListener("message",s,!1);})},e}();var q=C;var b=(o=>(o.Verify="verify",o.Form="form",o.Render="render",o.VerifyButton="verify-button",o))(b||{});var k=(o=>(o.closed="closed",o.canceled="canceled",o.completed="completed",o.clicked="clicked",o))(k||{}),H=(o=>(o.propsReceived="propsReceived",o.started="started",o.formSaved="formSaved",o.formSaveComplete="formSaveComplete",o))(H||{});var z="footprint-inline-container",J="footprint-body-locked",X="footprint-overlay",Y="footprint-overlay-container",W=z,G=X,Z="footprint-loading-indicator",h=(e,t)=>`${e}-${t}`,Q=e=>f(void 0,null,function*(){A(e),Re(e),yield ke(e);}),ee=e=>{let t=h(Y,e),r=document.getElementById(t);if(r)return r;let n=document.createElement("div");return n.setAttribute("id",t),document.body.appendChild(n),n},ke=e=>f(void 0,null,function*(){let t=h(Y,e),r=document.getElementById(t);if(!r)return;let n=r.querySelector("iframe.footprint-drawer");n&&(n==null||n.classList.add("footprint-drawer-closing"),yield new Promise(d=>{setTimeout(d,300);}));let o=r.querySelector("iframe.footprint-modal");o&&(o==null||o.classList.add("footprint-modal-closing"),yield new Promise(d=>{setTimeout(d,100);}));let i=h(G,e),s=document.getElementById(i);s&&(s.classList.add("footprint-overlay-fading"),yield new Promise(d=>{setTimeout(d,200);}),r.remove(),s.remove(),document.body.classList.remove(J));}),te=(e,t)=>{let r=h(W,e),n=document.createElement("div");return n.classList.add(z),n.setAttribute("id",r),t.appendChild(n),n},Re=e=>{let t=h(W,e),r=document.getElementById(t);r&&r.remove();},A=e=>{let t=h(Z,e),r=document.getElementById(t);r&&r.remove();},N=(e,t)=>{let r=h(Z,t),n=Fe(r);e.appendChild(n);},re=(e,t)=>{document.body.classList.add(J);let r=document.createElement("div"),n=h(G,t);return r.setAttribute("id",n),r.classList.add(X),e.appendChild(r),r},Fe=e=>{let t=document.createElement("div");t.setAttribute("id",e),t.classList.add("footprint-loading-indicator");let r=document.createElement("div");r.classList.add("footprint-loading-spin");let n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("width","24px"),n.setAttribute("height","24px"),n.setAttribute("fill","none"),n.setAttribute("aria-hidden","true");let o=document.createElementNS("http://www.w3.org/2000/svg","path");return o.setAttribute("d","M12 2a10 10 0 0 1 10 10h-2a7.999 7.999 0 0 0-8-8V2Z"),n.appendChild(o),r.appendChild(n),t.appendChild(r),t};var Se=()=>`${Math.floor(Math.random()*1e3)}`,R=Se;var _={["form"]:{["closed"]:"onClose",["canceled"]:"onCancel",["completed"]:"onComplete"},["verify"]:{["closed"]:"onClose",["canceled"]:"onCancel",["completed"]:"onComplete"},["verify-button"]:{["clicked"]:"onClick",["closed"]:"onClose",["canceled"]:"onCancel",["completed"]:"onComplete"},["render"]:{}},ne={["form"]:[],["verify"]:[],["render"]:[],["verify-button"]:[]};var Le={["form"]:["getRef"],["verify"]:[],["verify-button"]:[],["render"]:[]},oe=Le;var ae={["verify"]:["modal","drawer"],["verify-button"]:["inline"],["form"]:["inline","modal","drawer"],["render"]:["inline"]},K=(e,t)=>{var o;if(!t)return;let r=(o=ae[e])!=null?o:[];if(!r.includes(t))throw new Error(`Invalid variant: ${JSON.stringify(t)}. Valid variants for ${e} are ${r.join(", ")}`)},I=e=>{var r;let t=(r=ae[e])!=null?r:[];if(!t.length)throw new Error(`Invalid kind: ${e}`);return t[0]},D=e=>{if(!e)throw new Error("Kind is required");if(!Object.values(b).includes(e))throw new Error(`Invalid kind: ${e}. Valid kinds are: ${Object.values(b).join(", ")}}`)},xe=(e,t)=>{if(e==="inline"&&!t)throw new Error(`Inline component requires a containerId. Received ${t}`)},Ae=e=>{let{kind:t}=e;if(t==="verify-button"){let r=e,{kind:n,appearance:o,variant:i,dialogVariant:s,onClick:d,label:a,containerId:p}=r,c=L(r,["kind","appearance","variant","dialogVariant","onClick","label","containerId"]);return S(w({},c),{variant:s,kind:"verify"})}},Ne=e=>{var n;let{kind:t}=e;return (n=oe[t])!=null?n:[]},ie=(e,t,r)=>{var s;let{kind:n}=e,o=(s=_[n])!=null?s:{},i={};return Object.entries(o).forEach(([d,a])=>{let p=d;if(!Object.values(k).includes(p))return;let c=e[a];(!c||typeof c!="function")&&(c=()=>{});let m=p==="closed"||p==="canceled",y=n==="verify-button"&&p==="clicked";i[p]=v=>{c(v),m&&(t==null||t());let g=Ae(e);y&&g&&(r==null||r(g));};}),i},se=e=>{var m;let c=e,{kind:t,appearance:r,containerId:n}=c,o=L(c,["kind","appearance","containerId"]),i=(m=_[t])!=null?m:{},s=Object.values(i),d=Ne(e),a=Object.values(d);return Object.fromEntries(Object.entries(o).filter(([y])=>!s.includes(y)&&!a.includes(y)))},F=e=>{let{kind:t,variant:r,containerId:n}=e;D(t),K(t,r);let o=r||I(t);return xe(o,n),S(w({},e),{variant:o})};var _e=e=>typeof e=="object"&&!!e,B=({fontSrc:e,variables:t={},rules:r={},variant:n}={})=>{let o=()=>Object.keys(t).length?encodeURIComponent(JSON.stringify(t)):void 0,i=()=>Object.keys(r).length?encodeURIComponent(JSON.stringify(r)):void 0;return {fontSrc:e,variables:o(),rules:i(),variant:n}},de=()=>{let e=window.footprintAppearance;return !e||!_e(e)?{}:{fontSrc:e.fontSrc,rules:e.rules,theme:e.theme,variables:e.variables}};var Ke=e=>{let{kind:t}=e;return t==="verify"?De(e):Be(e)},De=e=>{let{appearance:t,variant:r,kind:n}=e,{fontSrc:o,rules:i,variables:s}=B(t),d="https://id.onefootprint.com",a=new URLSearchParams;"publicKey"in e&&e.publicKey&&a.append("public_key",e.publicKey),s&&a.append("variables",s),i&&a.append("rules",i),o&&a.append("font_src",o),a.append("variant",r!=null?r:I(n));let p=a.toString();return `${d}?${p}`},Be=e=>{let{appearance:t,kind:r,variant:n}=e,{fontSrc:o,rules:i,variables:s}=B(t),d="https://components.onefootprint.com",a=new URLSearchParams;s&&a.append("variables",s),i&&a.append("rules",i),o&&a.append("font_src",o),a.append("variant",n!=null?n:I(r));let p=a.toString();return `${d}/${r}?${p}`},pe=Ke;var Te=e=>{let t=null,r=!1,n=F(e),{variant:o,containerId:i}=n,s=o==="modal"||o==="drawer",d,a,p=R(),c=()=>{if(!t)throw new Error("Footprint should be initialized in order to listen events");let l=ie(n,d,a);Object.entries(l).forEach(([u,V])=>{t==null||t.on(u,V);});},m=()=>{if(!t)throw new Error("Footprint should be initialized in order to set up refs");let{kind:l}=n;if(l!=="form")return;let{getRef:u}=n;if(!u)return;u({save:()=>{if(!t)throw new Error("Footprint should be initialized to call ref methods");return new Promise(ye=>{t==null||t.call("formSaved"),t==null||t.on("formSaveComplete",()=>{ye();});})}});},y=()=>{if(!t)throw new Error("Footprint should be initialized in order to receive props");let l=se(n);t.call("propsReceived",l);},v=()=>{if(s)return ee(p);if(!i)throw new Error("containerId is required when rendering inline");let l=document.getElementById(i);if(!l)throw new Error(`Could not find container with id ${i} while rendering footprint`);return te(p,l)},g=(l,u)=>{if(!u){A(p),t==null||t.frame.classList.remove(`footprint-${o}-loading`),t==null||t.frame.classList.add(`footprint-${o}-loaded`);return}if(s){let V=re(l,p);N(V,p);}else N(l,p);};return {props:n,isRendered:r,render:()=>f(void 0,null,function*(){if(r)return;let l=v();if(!l)return;l.hasChildNodes()&&(l.innerHTML="");let u=pe(n);r=!0,g(l,!0),t=yield new q({classListArray:[`footprint-${o}`,`footprint-${o}-loading`],container:l,name:`footprint-iframe-${p}`,url:u,allow:"otp-credentials; publickey-credentials-get *; camera *; clipboard-write;"}),g(l,!1),c(),t.on("started",()=>{y(),m();});}),destroy:()=>f(void 0,null,function*(){r&&(r=!1,yield Q(p),t&&(t.destroy(),t=null));}),registerEvent:(l,u)=>{l==="renderSecondary"?a=u:l==="destroy"&&(d=u);}}},T=Te;var P=e=>{let t=F(e);return JSON.stringify(t)},Me=()=>{let e={};return {getOrCreate:i=>{let s=P(i.props),d=Object.values(e).find(a=>P(a.iframe.props)===s);return d?d.iframe:(e[s]={iframe:i,secondaryIframes:{}},i)},remove:i=>{let s=P(i.props),d=e[s];d&&(Object.keys(d.secondaryIframes).forEach(a=>{d.secondaryIframes[a].destroy();}),delete e[s]);},getOrCreateSecondary:(i,s)=>{let d=P(i.props),a=P(s.props);if(!e[d])throw new Error("iframe manager: primary iframe does not exist while adding secondary");let{secondaryIframes:p}=e[d],c=Object.values(p).find(m=>P(m.props)===a);return c||(p[a]=s,s)},removeSecondary:(i,s)=>{let d=P(i.props),a=P(s.props);if(!e[d])throw new Error("iframe manager: primary iframe does not exist while removing secondary");let{secondaryIframes:p}=e[d],c=p[a];c&&(c.destroy(),delete p[a]);}}},ce=Me;var $e=()=>{let e=ce();return {init:r=>{let n=T(r),o=()=>f(void 0,null,function*(){e.remove(n),yield n.destroy();}),i=a=>f(void 0,null,function*(){e.removeSecondary(n,a),yield a.destroy();}),s=a=>f(void 0,null,function*(){let p=T(a);p=e.getOrCreateSecondary(n,p),p.registerEvent("destroy",()=>{i(p);}),p.render();});return {render:()=>f(void 0,null,function*(){n=e.getOrCreate(n),n.registerEvent("destroy",o),n.registerEvent("renderSecondary",s),yield n.render();}),destroy:o}}}},Ue=$e(),M=Ue;var je=e=>{window.setTimeout(e,0);},le=e=>typeof e=="object"&&!!e,qe=e=>{if(typeof window=="undefined")return;let t=o=>{var d;let i=(d=window.footprintCallbacks)!=null?d:{};if(!le(i))throw Error("`window.footprintCallbacks` must be a valid mapping from callback names to functions.");return ne[o].forEach(a=>{if(!i[a])throw Error(`Callback '${a}' must be defined in window.footprintCallbacks`)}),i},r=o=>{var v;let i=o.getAttribute("data-kind");D(i);let s=(v=o.getAttribute("data-variant"))!=null?v:I(i);K(i,s);let d=de(),a=t(i),p=o.getAttribute("data-props")||"",c;try{c=JSON.parse(p);}catch(g){throw Error("Could not parse `data-props` for footprint.")}if(!le(c))throw Error("`data-props` on the footprint element has to be a valid JSON object stringified.");let m=R();o.setAttribute("id",m),e.init(w(w({kind:i,variant:s,appearance:d,containerId:o.id},a),c)).render();},n=()=>{let o=document.querySelectorAll("[data-footprint]");o.length&&o.forEach(i=>{r(i);});};document.addEventListener("DOMContentLoaded",()=>je(n));},me=qe;var fe=e=>f(void 0,null,function*(){let t=yield fetch("https://api.onefootprint.com/hosted/identify",{method:"POST",body:JSON.stringify(e)});if(!t.ok)throw Error(t.statusText);return (yield t.json()).user_found}),He=e=>f(void 0,null,function*(){if(!e)throw new Error("User data must be passed in order to identify an user");let t=e["id.email"],r=e["id.phone_number"];return t&&(yield fe({identifier:{email:t}}))?!0:r?yield fe({identifier:{phone_number:r}}):!1}),ue=He;var Ut=M;me(M);/*! Bundled license information: | ||
var fe=Object.defineProperty,ue=Object.defineProperties;var ye=Object.getOwnPropertyDescriptors;var b=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var B=(e,t,r)=>t in e?fe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,C=(e,t)=>{for(var r in t||(t={}))T.call(t,r)&&B(e,r,t[r]);if(b)for(var r of b(t))M.call(t,r)&&B(e,r,t[r]);return e},k=(e,t)=>ue(e,ye(t));var R=(e,t)=>{var r={};for(var n in e)T.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&b)for(var n of b(e))t.indexOf(n)<0&&M.call(e,n)&&(r[n]=e[n]);return r};var m=(e,t,r)=>new Promise((n,o)=>{var a=i=>{try{p(r.next(i));}catch(d){o(d);}},s=i=>{try{p(r.throw(i));}catch(d){o(d);}},p=i=>i.done?n(i.value):Promise.resolve(i.value).then(a,s);p((r=r.apply(e,t)).next());});var g="application/x-postmate-v1+json",ve=5,ge=0,he=function(){return ++ge};var Pe=function(t){var r=document.createElement("a");r.href=t;var n=r.protocol.length>4?r.protocol:window.location.protocol,o=r.host.length?r.port==="80"||r.port==="443"?r.hostname:r.host:window.location.host;return r.origin||n+"//"+o},Ce={handshake:1,"handshake-reply":1,call:1,emit:1,reply:1,request:1},x=function(t,r){return !(typeof r=="string"&&t.origin!==r||!t.data||typeof t.data=="object"&&!("postmate"in t.data)||t.data.type!==g||!Ce[t.data.postmate])},Ee=function(t,r){var n=typeof t[r]=="function"?t[r]():t[r];return h.Promise.resolve(n)},be=function(){function e(r){var n=this;this.parent=r.parent,this.frame=r.frame,this.child=r.child,this.childOrigin=r.childOrigin,this.events={},this.listener=function(o){if(!x(o,n.childOrigin))return !1;var a=((o||{}).data||{}).value||{},s=a.data,p=a.name;o.data.postmate==="emit"&&p in n.events&&n.events[p].forEach(function(i){i.call(n,s);});},this.parent.addEventListener("message",this.listener,!1);}var t=e.prototype;return t.get=function(n){var o=this;return new h.Promise(function(a){var s=he(),p=function i(d){d.data.uid===s&&d.data.postmate==="reply"&&(o.parent.removeEventListener("message",i,!1),a(d.data.value));};o.parent.addEventListener("message",p,!1),o.child.postMessage({postmate:"request",type:g,property:n,uid:s},o.childOrigin);})},t.call=function(n,o){this.child.postMessage({postmate:"call",type:g,property:n,data:o},this.childOrigin);},t.on=function(n,o){this.events[n]||(this.events[n]=[]),this.events[n].push(o);},t.destroy=function(){window.removeEventListener("message",this.listener,!1),this.frame.parentNode.removeChild(this.frame);},e}(),we=function(){function e(r){var n=this;this.model=r.model,this.parent=r.parent,this.parentOrigin=r.parentOrigin,this.child=r.child,this.child.addEventListener("message",function(o){if(x(o,n.parentOrigin)){var a=o.data,s=a.property,p=a.uid,i=a.data;if(o.data.postmate==="call"){s in n.model&&typeof n.model[s]=="function"&&n.model[s](i);return}Ee(n.model,s).then(function(d){return o.source.postMessage({property:s,postmate:"reply",type:g,uid:p,value:d},o.origin)});}});}var t=e.prototype;return t.emit=function(n,o){this.parent.postMessage({postmate:"emit",type:g,value:{name:n,data:o}},this.parentOrigin);},e}(),h=function(){function e(r){var n=r.container,o=n===void 0?typeof o!="undefined"?o:document.body:n,a=r.model,s=r.url,p=r.name,i=p===void 0?"":p,d=r.allow,c=r.classListArray,l=c===void 0?[]:c;return this.parent=window,this.frame=document.createElement("iframe"),this.frame.name=i||"",this.frame.classList.add.apply(this.frame.classList,l),d&&(this.frame.allow=d),o.appendChild(this.frame),this.child=this.frame.contentWindow||this.frame.contentDocument.parentWindow,this.model=a||{},this.sendHandshake(s)}var t=e.prototype;return t.sendHandshake=function(n){var o=this,a=Pe(n),s=0,p;return new e.Promise(function(i,d){var c=function u(P){return x(P,a)?P.data.postmate==="handshake-reply"?(clearInterval(p),o.parent.removeEventListener("message",u,!1),o.childOrigin=P.origin,i(new be(o))):d("Failed handshake"):!1};o.parent.addEventListener("message",c,!1);var l=function(){s++,o.child.postMessage({postmate:"handshake",type:g,model:o.model},a),s===ve&&clearInterval(p);},f=function(){l(),p=setInterval(l,500);};o.frame.attachEvent?o.frame.attachEvent("onload",f):o.frame.addEventListener("load",f),o.frame.src=n;})},e}();h.debug=!1;h.Promise=function(){try{return window?window.Promise:Promise}catch(e){return null}}();h.Model=function(){function e(r){return this.child=window,this.model=r,this.parent=this.child.parent,this.sendHandshakeReply()}var t=e.prototype;return t.sendHandshakeReply=function(){var n=this;return new h.Promise(function(o,a){var s=function p(i){if(i.data.postmate){if(i.data.postmate==="handshake"){n.child.removeEventListener("message",p,!1),i.source.postMessage({postmate:"handshake-reply",type:g},i.origin),n.parentOrigin=i.origin;var d=i.data.model;return d&&Object.keys(d).forEach(function(c){n.model[c]=d[c];}),o(new we(n))}return a("Handshake Reply Failed")}};n.child.addEventListener("message",s,!1);})},e}();var $=h;var w=(a=>(a.Auth="auth",a.Form="form",a.Render="render",a.Verify="verify",a.VerifyButton="verify-button",a))(w||{});var O=(o=>(o.canceled="canceled",o.clicked="clicked",o.closed="closed",o.completed="completed",o))(O||{}),U=(o=>(o.formSaveComplete="formSaveComplete",o.formSaved="formSaved",o.propsReceived="propsReceived",o.started="started",o))(U||{});var j="footprint-inline-container",q="footprint-body-locked",H="footprint-overlay",z="footprint-overlay-container",J=j,X=H,Y="footprint-loading-indicator",y=(e,t)=>`${e}-${t}`,W=e=>m(void 0,null,function*(){A(e),Ie(e),yield Oe(e);}),G=e=>{let t=y(z,e),r=document.getElementById(t);if(r)return r;let n=document.createElement("div");return n.setAttribute("id",t),document.body.appendChild(n),n},Oe=e=>m(void 0,null,function*(){let t=y(z,e),r=document.getElementById(t);if(!r)return;let n=r.querySelector("iframe.footprint-drawer");n&&(n==null||n.classList.add("footprint-drawer-closing"),yield new Promise(p=>{setTimeout(p,300);}));let o=r.querySelector("iframe.footprint-modal");o&&(o==null||o.classList.add("footprint-modal-closing"),yield new Promise(p=>{setTimeout(p,100);}));let a=y(X,e),s=document.getElementById(a);s&&(s.classList.add("footprint-overlay-fading"),yield new Promise(p=>{setTimeout(p,200);}),r.remove(),s.remove(),document.body.classList.remove(q));}),Z=(e,t)=>{let r=y(J,e),n=document.createElement("div");return n.classList.add(j),n.setAttribute("id",r),t.appendChild(n),n},Ie=e=>{let t=y(J,e),r=document.getElementById(t);r&&r.remove();},A=e=>{let t=y(Y,e),r=document.getElementById(t);r&&r.remove();},F=(e,t)=>{let r=y(Y,t),n=Ve(r);e.appendChild(n);},Q=(e,t)=>{document.body.classList.add(q);let r=document.createElement("div"),n=y(X,t);return r.setAttribute("id",n),r.classList.add(H),e.appendChild(r),r},Ve=e=>{let t=document.createElement("div");t.setAttribute("id",e),t.classList.add("footprint-loading-indicator");let r=document.createElement("div");r.classList.add("footprint-loading-spin");let n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("width","24px"),n.setAttribute("height","24px"),n.setAttribute("fill","none"),n.setAttribute("aria-hidden","true");let o=document.createElementNS("http://www.w3.org/2000/svg","path");return o.setAttribute("d","M12 2a10 10 0 0 1 10 10h-2a7.999 7.999 0 0 0-8-8V2Z"),n.appendChild(o),r.appendChild(n),t.appendChild(r),t};var ke=()=>`${Math.floor(Math.random()*1e3)}`,I=ke;var L={["auth"]:{["canceled"]:"onCancel",["closed"]:"onClose",["completed"]:"onComplete"},["form"]:{["canceled"]:"onCancel",["closed"]:"onClose",["completed"]:"onComplete"},["verify"]:{["canceled"]:"onCancel",["closed"]:"onClose",["completed"]:"onComplete"},["verify-button"]:{["canceled"]:"onCancel",["clicked"]:"onClick",["closed"]:"onClose",["completed"]:"onComplete"},["render"]:{}},ee={["auth"]:[],["form"]:[],["render"]:[],["verify"]:[],["verify-button"]:[]};var Re={["auth"]:[],["form"]:["getRef"],["render"]:[],["verify"]:[],["verify-button"]:[]},te=Re;var re={["auth"]:["modal","drawer"],["form"]:["inline","modal","drawer"],["render"]:["inline"],["verify"]:["modal","drawer"],["verify-button"]:["inline"]},xe=Object.values(O),Ae=(...e)=>{},Fe=(e,t)=>{if(e==="inline"&&!t)throw new Error(`Inline component requires a containerId. Received ${t}`)},S=(e,t)=>{var o;if(!t)return;let r=(o=re[e])!=null?o:[];if(!r.includes(t))throw new Error(`Invalid variant: ${JSON.stringify(t)}. Valid variants for ${e} are ${r.join(", ")}`)},E=e=>{var r;let t=(r=re[e])!=null?r:[];if(!t.length)throw new Error(`Invalid kind: ${e}`);return t[0]},N=e=>{if(!e)throw new Error("Kind is required");let t=Object.values(w);if(!t.includes(e))throw new Error(`Invalid kind: ${e}. Valid kinds are: ${t.join(", ")}`)},Le=e=>{if(e.kind==="verify-button"){let t=e,{kind:r,appearance:n,variant:o,dialogVariant:a,onClick:s,label:p,containerId:i}=t,d=R(t,["kind","appearance","variant","dialogVariant","onClick","label","containerId"]);return k(C({},d),{variant:a,kind:"verify"})}},Se=({kind:e})=>{var t;return (t=te[e])!=null?t:[]},Ne=(e,t)=>(Object.prototype.hasOwnProperty.call(e,t)&&typeof e[t]=="function"?e[t]:void 0)||Ae,ne=(e,t,r)=>{var p;let{kind:n}=e,o=(p=L[n])!=null?p:{},a={},s=Le(e);return Object.entries(o).forEach(([i,d])=>{let c=i;if(!xe.includes(c))return;let l=Ne(e,d),f=c==="closed"||c==="canceled",u=n==="verify-button"&&c==="clicked";a[c]=P=>{l(P),f&&(t==null||t()),u&&s&&(r==null||r(s));};}),a},oe=e=>{var c;let d=e,{kind:t,appearance:r,containerId:n}=d,o=R(d,["kind","appearance","containerId"]),a=(c=L[t])!=null?c:{},s=Object.values(a),p=Se(e),i=Object.values(p);return Object.fromEntries(Object.entries(o).filter(([l])=>!s.includes(l)&&!i.includes(l)))},V=e=>{let{kind:t,variant:r,containerId:n}=e,o=r||E(t);return N(t),S(t,r),Fe(o,n),k(C({},e),{variant:o})};var _e=e=>typeof e=="object"&&!!e,_=({fontSrc:e,variables:t={},rules:r={},variant:n}={})=>{let o=()=>Object.keys(t).length?encodeURIComponent(JSON.stringify(t)):void 0,a=()=>Object.keys(r).length?encodeURIComponent(JSON.stringify(r)):void 0;return {fontSrc:e,variables:o(),rules:a(),variant:n}},ae=()=>{let e=window.footprintAppearance;return !e||!_e(e)?{}:{fontSrc:e.fontSrc,rules:e.rules,theme:e.theme,variables:e.variables}};var Ke=e=>{let{kind:t}=e;return t==="verify"?De(e):Be(e)},De=e=>{let{appearance:t,variant:r,kind:n}=e,{fontSrc:o,rules:a,variables:s}=_(t),p="https://id.onefootprint.com",i=new URLSearchParams;"publicKey"in e&&e.publicKey&&i.append("public_key",e.publicKey),s&&i.append("variables",s),a&&i.append("rules",a),o&&i.append("font_src",o),i.append("variant",r!=null?r:E(n));let d=i.toString();return `${p}?${d}`},Be=e=>{let{appearance:t,kind:r,variant:n}=e,{fontSrc:o,rules:a,variables:s}=_(t),p="https://components.onefootprint.com",i=new URLSearchParams;s&&i.append("variables",s),a&&i.append("rules",a),o&&i.append("font_src",o),i.append("variant",n!=null?n:E(r));let d=i.toString();return `${p}/${r}?${d}`},ie=Ke;var Te=(e,t,r,n)=>{if(!e)throw new Error("Footprint should be initialized in order to listen events");let o=ne(t,r,n);return Object.entries(o).forEach(([a,s])=>{e==null||e.on(a,s);}),e},Me=(e,t)=>{if(!e)throw new Error("Footprint should be initialized in order to set up refs");let{kind:r}=t;if(r!=="form")return;let{getRef:n}=t;if(!n)return;n({save:()=>{if(!e)throw new Error("Footprint should be initialized to call ref methods");return new Promise(a=>{e==null||e.call("formSaved"),e==null||e.on("formSaveComplete",()=>{a();});})}});},$e=(e,t)=>{if(!e)throw new Error("Footprint should be initialized in order to receive props");let r=oe(t);e.call("propsReceived",r);},Ue=({variant:e,containerId:t},r)=>{if(e==="modal"||e==="drawer")return G(r);if(!t)throw new Error("containerId is required when rendering inline");let o=document.getElementById(t);if(!o)throw new Error(`Could not find container with id ${t} while rendering footprint`);return Z(r,o)},se=(e,{variant:t},r,n,o)=>{let a=t==="modal"||t==="drawer";if(!o){A(r),e==null||e.frame.classList.remove(`footprint-${t}-loading`),e==null||e.frame.classList.add(`footprint-${t}-loaded`);return}if(a){let s=Q(n,r);F(s,r);}else F(n,r);},je=e=>{let t=null,r=!1,n,o,a=V(e),{variant:s}=a,p=I();return {props:a,isRendered:r,render:()=>m(void 0,null,function*(){if(r)return;let l=Ue(a,p);if(!l)return;l.hasChildNodes()&&(l.innerHTML="");let f=ie(a);r=!0,se(t,a,p,l,!0),t=yield new $({classListArray:[`footprint-${s}`,`footprint-${s}-loading`],container:l,name:`footprint-iframe-${p}`,url:f,allow:"otp-credentials; publickey-credentials-get *; camera *; clipboard-write;"}),se(t,a,p,l,!1),t=Te(t,a,n,o),t.on("started",()=>{$e(t,a),Me(t,a);});}),destroy:()=>m(void 0,null,function*(){r&&(r=!1,yield W(p),t&&(t.destroy(),t=null));}),registerEvent:(l,f)=>{!f||typeof f!="function"||(l==="renderSecondary"?o=f:l==="destroy"&&(n=f));}}},K=je;var v=e=>{let t=V(e);return JSON.stringify(t)},qe=()=>{let e=Object.create(null);return {getOrCreate:a=>{let s=v(a.props),p=Object.values(e).find(i=>v(i.iframe.props)===s);return p?p.iframe:(e[s]={iframe:a,secondaryIframes:{}},a)},getOrCreateSecondary:(a,s)=>{let p=v(a.props),i=v(s.props);if(!e[p])throw new Error("iframe manager: primary iframe does not exist while adding secondary");let{secondaryIframes:d}=e[p],c=Object.values(d).find(l=>v(l.props)===i);return c||(d[i]=s,s)},remove:a=>{let s=v(a.props),p=e[s];p&&(Object.keys(p.secondaryIframes).forEach(i=>{p.secondaryIframes[i].destroy();}),delete e[s]);},removeSecondary:(a,s)=>{let p=v(a.props),i=v(s.props);if(!e[p])throw new Error("iframe manager: primary iframe does not exist while removing secondary");let{secondaryIframes:d}=e[p],c=d[i];c&&(c.destroy(),delete d[i]);}}},pe=qe;var He=()=>{let e=pe();return {init:r=>{let n=K(r),o=()=>m(void 0,null,function*(){e.remove(n),yield n.destroy();}),a=i=>m(void 0,null,function*(){e.removeSecondary(n,i),yield i.destroy();}),s=i=>m(void 0,null,function*(){let d=K(i);d=e.getOrCreateSecondary(n,d),d.registerEvent("destroy",()=>{a(d);}),d.render();});return {render:()=>m(void 0,null,function*(){n=e.getOrCreate(n),n.registerEvent("destroy",o),n.registerEvent("renderSecondary",s),yield n.render();}),destroy:o}}}},ze=He(),D=ze;var Je=e=>{window.setTimeout(e,0);},de=e=>typeof e=="object"&&!!e,Xe=e=>{if(typeof window=="undefined")return;let t=o=>{var p;let a=(p=window.footprintCallbacks)!=null?p:{};if(!de(a))throw Error("`window.footprintCallbacks` must be a valid mapping from callback names to functions.");return ee[o].forEach(i=>{if(!a[i])throw Error(`Callback '${i}' must be defined in window.footprintCallbacks`)}),a},r=o=>{var u;let a=o.getAttribute("data-kind");N(a);let s=(u=o.getAttribute("data-variant"))!=null?u:E(a);S(a,s);let p=ae(),i=t(a),d=o.getAttribute("data-props")||"",c;try{c=JSON.parse(d);}catch(P){throw Error("Could not parse `data-props` for footprint.")}if(!de(c))throw Error("`data-props` on the footprint element has to be a valid JSON object stringified.");let l=I();o.setAttribute("id",l),e.init(C(C({kind:a,variant:s,appearance:p,containerId:o.id},i),c)).render();},n=()=>{let o=document.querySelectorAll("[data-footprint]");o.length&&o.forEach(a=>{r(a);});};document.addEventListener("DOMContentLoaded",()=>Je(n));},ce=Xe;var le=e=>m(void 0,null,function*(){let t=yield fetch("https://api.onefootprint.com/hosted/identify",{method:"POST",body:JSON.stringify(e)});if(!t.ok)throw Error(t.statusText);return (yield t.json()).user_found}),Ye=e=>m(void 0,null,function*(){if(!e)throw new Error("User data must be passed in order to identify an user");let t=e["id.email"],r=e["id.phone_number"];return t&&(yield le({identifier:{email:t}}))?!0:r?yield le({identifier:{phone_number:r}}):!1}),me=Ye;var jt=D;ce(D);/*! Bundled license information: | ||
@@ -16,7 +16,7 @@ @onefootprint/postmate/build/postmate.es.js: | ||
exports.FootprintComponentKind = b; | ||
exports.FootprintPrivateEvent = H; | ||
exports.FootprintPublicEvent = k; | ||
exports.default = Ut; | ||
exports.identifyFootprintUser = ue; | ||
exports.FootprintComponentKind = w; | ||
exports.FootprintPrivateEvent = U; | ||
exports.FootprintPublicEvent = O; | ||
exports.default = jt; | ||
exports.identifyFootprintUser = me; | ||
@@ -23,0 +23,0 @@ Object.defineProperty(exports, '__esModule', { value: true }); |
@@ -5,3 +5,3 @@ { | ||
"type": "module", | ||
"version": "3.7.1", | ||
"version": "3.8.0-beta.1", | ||
"main": "./dist/footprint-js.cjs", | ||
@@ -8,0 +8,0 @@ "module": "./dist/footprint-js.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54373
471
3