New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@placetopay/pinpad-sdk

Package Overview
Dependencies
Maintainers
0
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@placetopay/pinpad-sdk - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

dist/animate-presence-tB_Kk0Lp.js

20

dist/pinpad-sdk.js
const c = {
modal: {
"../components/number-pad/number-pad": () => import("./number-pad-DhfwNqEv.js"),
"../components/panel-pad/panel-pad": () => import("./panel-pad-BYr3LGt4.js"),
"../components/pinpad-modal/pinpad-modal": () => import("./pinpad-modal-paNH5sbg.js")
"../components/number-pad/number-pad": () => import("./number-pad-BdVRuVPs.js"),
"../components/panel-pad/panel-pad": () => import("./panel-pad-CN3H1U57.js"),
"../components/pinpad-modal/pinpad-modal": () => import("./pinpad-modal-DTc9RHjl.js")
},
static: {
"../components/number-pad/number-pad": () => import("./number-pad-DhfwNqEv.js"),
"../components/pinpad-static/pinpad-static": () => import("./pinpad-static-BZXdVvut.js")
"../components/number-pad/number-pad": () => import("./number-pad-BdVRuVPs.js"),
"../components/pinpad-static/pinpad-static": () => import("./pinpad-static-CZj_xf9y.js")
},
float: {
"../components/number-pad/number-pad": () => import("./number-pad-DhfwNqEv.js"),
"../components/pinpad-static/pinpad-static": () => import("./pinpad-static-BZXdVvut.js"),
"../components/pinpad-float/pinpad-float": () => import("./pinpad-float-Cl6wLZb6.js")
"../components/number-pad/number-pad": () => import("./number-pad-BdVRuVPs.js"),
"../components/pinpad-static/pinpad-static": () => import("./pinpad-static-CZj_xf9y.js"),
"../components/pinpad-float/pinpad-float": () => import("./pinpad-float-DbhOZPG8.js")
}

@@ -30,6 +30,6 @@ };

}), i = c[this.#t], a = [
import("./app-eZHbc6oa.js").then((n) => {
import("./app-Uqm_n6mt.js").then((n) => {
n.define();
}),
import("./pinpad-DscBDwiu.js").then((n) => {
import("./pinpad-CKjTUogv.js").then((n) => {
n.define();

@@ -36,0 +36,0 @@ })

@@ -1,1 +0,1 @@

(function(_,A){typeof exports=="object"&&typeof module<"u"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(_=typeof globalThis<"u"?globalThis:_||self,A(_.PinPadSDK={}))})(this,function(_){"use strict";const A={modal:{"../components/number-pad/number-pad":()=>Promise.resolve().then(()=>ee),"../components/panel-pad/panel-pad":()=>Promise.resolve().then(()=>Tt),"../components/pinpad-modal/pinpad-modal":()=>Promise.resolve().then(()=>Nt)},static:{"../components/number-pad/number-pad":()=>Promise.resolve().then(()=>ee),"../components/pinpad-static/pinpad-static":()=>Promise.resolve().then(()=>Re)},float:{"../components/number-pad/number-pad":()=>Promise.resolve().then(()=>ee),"../components/pinpad-static/pinpad-static":()=>Promise.resolve().then(()=>Re),"../components/pinpad-float/pinpad-float":()=>Promise.resolve().then(()=>xt)}};class U{#e;constructor(e){this.#e=e}static make(e){return new U(e)}define(){let e;const n=new Promise(s=>{e=s}),o=A[this.#e],r=[Promise.resolve().then(()=>Lt).then(s=>{s.define()}),Promise.resolve().then(()=>Ot).then(s=>{s.define()})];for(let s in o)r.push(o[s]().then(i=>{i.define()}));return Promise.all(r).then(()=>{e()}),n}}class Je{#e;constructor(e){this.#e={locale:document.documentElement.lang,mask:!0,mode:"modal",pinLength:4,theming:null,...e}}get mask(){return typeof this.#e.mask=="string"?this.#e.mask??"*":this.#e.mask?"*":""}async render(e,n,o=()=>{},r=()=>{}){const s=document.querySelector(e);if(!s)return null;await U.make(this.#e.mode).define(),this._render(s,n,r)}_setAttributes(e,n){e.setAttribute("locale",this.#e.locale),e.setAttribute("mask",this.mask),e.setAttribute("length",this.#e.pinLength.toString()),e.setAttribute("positions",n),this.#e.theming&&e.setAttribute("theming",JSON.stringify(this.#e.theming))}_renderModal(){return document.createElement("ptp-pinpad-modal")}_renderStatic(e){const n=document.createElement("ptp-pinpad-static");return n.addEventListener("Delete",e),n}_renderFloat(e){const n=document.createElement("ptp-pinpad-float");return n.addEventListener("Delete",e),n}_render(e,n,o=()=>{}){const r=document.createElement("ptp-pinpad-context");this._setAttributes(r,n);const s=document.createElement("ptp-pinpad");this.#e.pin&&s.setAttribute("pin",this.#e.pin),s.setAttribute("mode",this.#e.mode),r.appendChild(s);let i;this.#e.mode==="modal"?i=this._renderModal():this.#e.mode==="static"?i=this._renderStatic(o):i=this._renderFloat(o),s.append(i),e.appendChild(r)}}class pe{static async createTransaction(e,n){const o=await fetch(`${e}/api/transaction`,{method:"POST",headers:{Authorization:"Bearer "+n}});if(!o.ok)throw new Error("Failed to create transaction");return{data:await o.json(),status:o.status,statusText:o.statusText,headers:o.headers}}static async encryptPin(e){const n=await fetch(`${e.url}/api/pinblock-generator/${e.transactionId}`,{method:"POST",headers:{Authorization:"Bearer "+e.token,"Accept-Language":e.locale},body:JSON.stringify(e)});if(!n.ok)throw new Error("Failed to generate pinblock");return{data:await n.json(),status:n.status,statusText:n.statusText,headers:n.headers}}}class qe{apiUrl;authToken;constructor(e,n){this.apiUrl=e,this.authToken=n}createTransaction(){return pe.createTransaction(this.apiUrl,this.authToken)}generatePinBlock(e){const n={url:this.apiUrl,token:this.authToken,...e};return pe.encryptPin(n)}}class Qe{#e;#t=new Set;constructor(e){this.#e=e}get current(){return this.#e}set current(e){this.#e!=e&&(this.#e=e,this.#t.forEach(n=>n(e)))}on(e){return this.#t.add(e),()=>this.#t.delete(e)}}const fe=t=>new Qe(t),H=Symbol.for("atomico.hooks");globalThis[H]=globalThis[H]||{};let x=globalThis[H];const Xe=Symbol.for("Atomico.suspense"),me=Symbol.for("Atomico.effect"),Ge=Symbol.for("Atomico.layoutEffect"),he=Symbol.for("Atomico.insertionEffect"),L=(t,e,n)=>{const{i:o,hooks:r}=x.c,s=r[o]=r[o]||{};return s.value=t(s.value),s.effect=e,s.tag=n,x.c.i++,r[o].value},S=t=>L((e=fe(t))=>e),M=()=>L((t=fe(x.c.host))=>t),be=()=>x.c.update,Ze=(t,e,n=0)=>{let o={},r=!1;const s=()=>r,i=(c,l)=>{for(const f in o){const a=o[f];a.effect&&a.tag===c&&(a.value=a.effect(a.value,l))}};return{load:c=>{x.c={host:e,hooks:o,update:t,i:0,id:n};let l;try{r=!1,l=c()}catch(f){if(f!==Xe)throw f;r=!0}finally{x.c=null}return l},cleanEffects:c=>(i(he,c),()=>(i(Ge,c),()=>{i(me,c)})),isSuspense:s}},O=Symbol.for;function ge(t,e){const n=t.length;if(n!==e.length)return!1;for(let o=0;o<n;o++){let r=t[o],s=e[o];if(r!==s)return!1}return!0}const v=t=>typeof t=="function",j=t=>typeof t=="object",{isArray:We}=Array,Y=(t,e)=>(e?t instanceof HTMLStyleElement:!0)&&"hydrate"in(t?.dataset||{});function ye(t,e){let n;const o=r=>{let{length:s}=r;for(let i=0;i<s;i++){const u=r[i];if(u&&Array.isArray(u))o(u);else{const d=typeof u;if(u==null||d==="function"||d==="boolean")continue;d==="string"||d==="number"?(n==null&&(n=""),n+=u):(n!=null&&(e(n),n=null),e(u))}}};o(t),n!=null&&e(n)}const Ee=(t,e,n)=>(t.addEventListener(e,n),()=>t.removeEventListener(e,n));let we=class{constructor(e,n,o){this.message=n,this.target=e,this.value=o}};class Ve extends we{}class et extends we{}const D="Custom",tt=null,nt={true:1,"":1,1:1};function ot(t,e,n,o,r){const{type:s,reflect:i,event:u,value:d,attr:c=rt(e)}=n?.name!=D&&j(n)&&n!=tt?n:{type:n},l=s?.name===D&&s.map,f=d!=null?s==Function||!v(d)?()=>d:d:null;Object.defineProperty(t,e,{configurable:!0,set(a){const m=this[e];f&&s!=Boolean&&a==null&&(a=f());const{error:y,value:b}=(l?ct:lt)(s,a);if(y&&b!=null)throw new Ve(this,`The value defined for prop '${e}' must be of type '${s.name}'`,b);m!=b&&(this._props[e]=b??void 0,this.update(),u&&ve(this,u),this.updated.then(()=>{i&&(this._ignoreAttr=c,st(this,s,c,this[e]),this._ignoreAttr=null)}))},get(){return this._props[e]}}),f&&(r[e]=f()),o[c]={prop:e,type:s}}const ve=(t,{type:e,base:n=CustomEvent,...o})=>t.dispatchEvent(new n(e,o)),rt=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase(),st=(t,e,n,o)=>o==null||e==Boolean&&!o?t.removeAttribute(n):t.setAttribute(n,e?.name===D&&e?.serialize?e?.serialize(o):j(o)?JSON.stringify(o):e==Boolean?"":o),it=(t,e)=>t==Boolean?!!nt[e]:t==Number?Number(e):t==String?e:t==Array||t==Object?JSON.parse(e):t.name==D?e:new t(e),ct=({map:t},e)=>{try{return{value:t(e),error:!1}}catch{return{value:e,error:!0}}},lt=(t,e)=>t==null||e==null?{value:e,error:!1}:t!=String&&e===""?{value:void 0,error:!1}:t==Object||t==Array||t==Symbol?{value:e,error:{}.toString.call(e)!==`[object ${t.name}]`}:e instanceof t?{value:e,error:t==Number&&Number.isNaN(e.valueOf())}:t==String||t==Number||t==Boolean?{value:e,error:t==Number?typeof e!="number"?!0:Number.isNaN(e):t==String?typeof e!="string":typeof e!="boolean"}:{value:e,error:!0};let at=0;const dt=t=>{const e=(t?.dataset||{})?.hydrate||"";return e||"c"+at++},P=(t,e=HTMLElement)=>{const n={},o={},r="prototype"in e&&e.prototype instanceof Element,s=r?e:"base"in e?e.base:HTMLElement,{props:i,styles:u}=r?t:e;class d extends s{constructor(){super(),this._setup(),this._render=()=>t({...this._props});for(const l in o)this[l]=o[l]}static get styles(){return[super.styles,u]}async _setup(){if(this._props)return;this._props={};let l,f;this.mounted=new Promise(h=>this.mount=()=>{h(),l!=this.parentNode&&(f!=l?this.unmounted.then(this.update):this.update()),l=this.parentNode}),this.unmounted=new Promise(h=>this.unmount=()=>{h(),(l!=this.parentNode||!this.isConnected)&&(a.cleanEffects(!0)()(),f=this.parentNode,l=null)}),this.symbolId=this.symbolId||Symbol(),this.symbolIdParent=Symbol();const a=Ze(()=>this.update(),this,dt(this));let m,y=!0;const b=Y(this);this.update=()=>(m||(m=!0,this.updated=(this.updated||this.mounted).then(()=>{try{const h=a.load(this._render),g=a.cleanEffects();return h&&h.render(this,this.symbolId,b),m=!1,y&&!a.isSuspense()&&(y=!1,!b&&ut(this)),g()}finally{m=!1}}).then(h=>{h&&h()})),this.updated),this.update()}connectedCallback(){this.mount(),super.connectedCallback&&super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),this.unmount()}attributeChangedCallback(l,f,a){if(n[l]){if(l===this._ignoreAttr||f===a)return;const{prop:m,type:y}=n[l];try{this[m]=it(y,a)}catch{throw new et(this,`The value defined as attr '${l}' cannot be parsed by type '${y.name}'`,a)}}else super.attributeChangedCallback(l,f,a)}static get props(){return{...super.props,...i}}static get observedAttributes(){const l=super.observedAttributes||[];for(const f in i)ot(this.prototype,f,i[f],n,o);return Object.keys(n).concat(l)}}return d};function ut(t){const{styles:e}=t.constructor,{shadowRoot:n}=t;if(n&&e.length){const o=[];ye(e,r=>{r&&(r instanceof Element?n.appendChild(r.cloneNode(!0)):o.push(r))}),o.length&&(n.adoptedStyleSheets=o)}}const Pe=t=>(e,n)=>{L(([o,r]=[])=>((r||!r)&&(r&&ge(r,n)?o=o||!0:(v(o)&&o(),o=null)),[o,n]),([o,r],s)=>s?(v(o)&&o(),[]):[o||e(),r],t)},w=Pe(me),Ce=Pe(he);class pt extends Array{constructor(e,n){let o=!0;const r=s=>{try{n(s,this,o)}finally{o=!1}};super(void 0,r,n),r(e)}}const k=t=>{const e=be();return L((n=new pt(t,(o,r,s)=>{o=v(o)?o(r[0]):o,o!==r[0]&&(r[0]=o,s||e())}))=>n)},Se=(t,e)=>{const[n]=L(([o,r,s=0]=[])=>((!r||r&&!ge(r,e))&&(o=t()),[o,e,s]));return n},ke=(t,e)=>Se(()=>t,e),E=(t,e={})=>{const n=M();return n[t]||(n[t]=(o=e.detail)=>ve(n.current,{type:t,...e,detail:o})),n[t]},K=O("atomico/options");globalThis[K]=globalThis[K]||{sheet:!!document.adoptedStyleSheets};const I=globalThis[K],ft=new Promise(t=>{I.ssr||(document.readyState==="loading"?Ee(document,"DOMContentLoaded",t):t())}),mt={checked:1,value:1,selected:1},ht={list:1,type:1,size:1,form:1,width:1,height:1,src:1,href:1,slot:1},bt={shadowDom:1,staticNode:1,cloneNode:1,children:1,key:1},z={},J=[];class B extends Text{}const gt=O("atomico/id"),$=O("atomico/type"),q=O("atomico/ref"),Te=O("atomico/vnode"),yt=()=>{};function Et(t,e,n){return Ne(this,t,e,n)}const _e=(t,e,...n)=>{const o=e||z;let{children:r}=o;if(r=r??(n.length?n:J),t===yt)return r;const s=t?t instanceof Node?1:t.prototype instanceof HTMLElement&&2:0;if(s===!1&&t instanceof Function)return t(r!=J?{children:r,...o}:o);const i=I.render||Et;return{[$]:Te,type:t,props:o,children:r,key:o.key,shadow:o.shadowDom,static:o.staticNode,raw:s,is:o.is,clone:o.cloneNode,render:i}};function Ne(t,e,n=gt,o,r){let s;if(e&&e[n]&&e[n].vnode==t||t[$]!=Te)return e;(t||!e)&&(r=r||t.type=="svg",s=t.type!="host"&&(t.raw==1?(e&&t.clone?e[q]:e)!=t.type:t.raw==2?!(e instanceof t.type):e?e[q]||e.localName!=t.type:!e),s&&t.type!=null&&(t.raw==1&&t.clone?(o=!0,e=t.type.cloneNode(!0),e[q]=t.type):e=t.raw==1?t.type:t.raw==2?new t.type:r?document.createElementNS("http://www.w3.org/2000/svg",t.type):document.createElement(t.type,t.is?{is:t.is}:void 0)));const i=e[n]?e[n]:z,{vnode:u=z,cycle:d=0}=i;let{fragment:c,handlers:l}=i;const{children:f=J,props:a=z}=u;if(l=s?{}:l||{},t.static&&!s)return e;if(t.shadow&&!e.shadowRoot&&e.attachShadow({mode:"open",...t.shadow}),t.props!=a&&Pt(e,a,t.props,l,r),t.children!==f){const m=t.shadow?e.shadowRoot:e;c=vt(t.children,c,m,n,!d&&o,r&&t.type=="foreignObject"?!1:r)}return e[n]={vnode:t,handlers:l,fragment:c,cycle:d+1},e}function wt(t,e){const n=new B(""),o=new B("");let r;if(t[e?"prepend":"append"](n),e){let{lastElementChild:s}=t;for(;s;){const{previousElementSibling:i}=s;if(Y(s,!0)&&!Y(i,!0)){r=s;break}s=i}}return r?r.before(o):t.append(o),{markStart:n,markEnd:o}}function vt(t,e,n,o,r,s){t=t==null?null:We(t)?t:[t];const i=e||wt(n,r),{markStart:u,markEnd:d,keyes:c}=i;let l;const f=c&&new Set;let a=u;if(t&&ye(t,m=>{if(typeof m=="object"&&!m[$])return;const y=m[$]&&m.key,b=c&&y!=null&&c.get(y);a!=d&&a===b?f.delete(a):a=a==d?d:a.nextSibling;const h=c?b:a;let g=h;if(m[$])g=Ne(m,h,o,r,s);else{const ue=m+"";!(g instanceof Text)||g instanceof B?g=new Text(ue):g.data!=ue&&(g.data=ue)}g!=a&&(c&&f.delete(g),!h||c?(n.insertBefore(g,a),c&&a!=d&&f.add(a)):h==d?n.insertBefore(g,d):(n.replaceChild(g,h),a=g)),y!=null&&(l=l||new Map,l.set(y,g))}),a=a==d?d:a.nextSibling,e&&a!=d)for(;a!=d;){const m=a;a=a.nextSibling,m.remove()}return f&&f.forEach(m=>m.remove()),i.keyes=l,i}function Pt(t,e,n,o,r){for(const s in e)!(s in n)&&xe(t,s,e[s],null,r,o);for(const s in n)xe(t,s,e[s],n[s],r,o)}function xe(t,e,n,o,r,s){if(e=e=="class"&&!r?"className":e,n=n??null,o=o??null,e in t&&mt[e]&&(n=t[e]),!(o===n||bt[e]||e[0]=="_"))if(t.localName==="slot"&&e==="assignNode"&&"assign"in t)t.assign(o);else if(e[0]=="o"&&e[1]=="n"&&(v(o)||v(n)))Ct(t,e.slice(2),o,s);else if(e=="ref")o&&(v(o)?o(t):o.current=t);else if(e=="style"){const{style:i}=t;n=n||"",o=o||"";const u=j(n),d=j(o);if(u)for(const c in n)if(d)!(c in o)&&Ae(i,c,null);else break;if(d)for(const c in o){const l=o[c];u&&n[c]===l||Ae(i,c,l)}else i.cssText=o}else{const i=e[0]=="$"?e.slice(1):e;i===e&&(!r&&!ht[e]&&e in t||v(o)||v(n))?t[e]=o??"":o==null?t.removeAttribute(i):t.setAttribute(i,j(o)?JSON.stringify(o):o)}}function Ct(t,e,n,o){if(o.handleEvent||(o.handleEvent=r=>o[r.type].call(t,r)),n){if(!o[e]){const r=n.capture||n.once||n.passive?Object.assign({},n):null;t.addEventListener(e,o,r)}o[e]=n}else o[e]&&(t.removeEventListener(e,o),delete o[e])}function Ae(t,e,n){let o="setProperty";n==null&&(o="removeProperty",n=null),~e.indexOf("-")?t[o](e,n):t[e]=n}const St=_e("host",{style:"display: contents"}),Le="value",Q=(t,e)=>{const n=M(),o=S();Ce(()=>Ee(n.current,"ConnectContext",r=>{r.composedPath().at(0)!==r.currentTarget&&t===r.detail.id&&(r.stopPropagation(),r.detail.connect(o))}),[t]),o.current=e},Oe=t=>{const e=E("ConnectContext",{bubbles:!0,composed:!0}),[n,o]=k(()=>{if(I.ssr)return;let s;return e({id:t,connect(i){s=i}}),s}),r=be();return w(()=>{ft.then(()=>e({id:t,connect:o}))},[t]),w(()=>{if(n)return n.on(r)},[n]),n?.current||t[Le]},X=t=>{const e=P(({value:n})=>(Q(e,n),St),{props:{value:{type:Object,value:()=>t}}});return e[Le]=t,e};X({dispatch(t,e){}});const je=(t,e)=>{const n=M();Ce(()=>{let o=!1,r,s=()=>{r&&r(),r=null};const i=async()=>{o||(o=!0,await n.current.updated,s(),o=!1,r=t())},u=e.map(d=>d?.on(i));return n.once||(n.once=!0,i()),()=>{u.map(d=>d&&d()),s()}},e)},$e={};function T(t,...e){const n=(t.raw||t).reduce((o,r,s)=>o+r+(e[s]||""),"");return $e[n]=$e[n]||kt(n)}function kt(t){if(I.sheet){const e=new CSSStyleSheet;return e.replaceSync(t),e}else{const e=document.createElement("style");return e.textContent=t,e}}const p=(t,e,n)=>(e==null?e={key:n}:e.key=n,_e(t,e)),C=p,N=(...t)=>t.filter(Boolean).join(" "),G=X({locale:"es",trans:t=>t});customElements.define("ptp-lang-context",G);const Z=()=>{const{trans:t}=Oe(G);return t},Me=X({positions:[],mask:"*",length:4,theming:null}),W=()=>Oe(Me);function V({mode:t,disabled:e,resettable:n,hideHelpText:o=!1}){const[r,s]=k(!1),[i,u]=k(!0),{mask:d,positions:c}=W(),l=Z(),f=E("Pressed"),a=E("Confirm"),m=E("Delete"),y=Se(()=>!r&&i&&d?d.repeat(10).split(""):c,[r,i,d,c]),b=h=>{s(!h.matches)};return w(()=>{if(!("matchMedia"in window)||typeof window.matchMedia!="function")return;const h=window.matchMedia("(min-width: 768px)");return"addEventListener"in h?h.addEventListener("change",b):h.addListener(b),s(!h.matches),()=>{"removeEventListener"in h?h.removeEventListener("change",b):h.removeListener(b)}},[]),p("host",{shadowDom:!0,children:C("div",{role:"none",class:N("container",t),onmouseenter:()=>u(!1),onmouseleave:()=>u(!0),children:[y.map((h,g)=>p("button",{type:"button",onclick:()=>f({value:g}),class:N("number-pad",g===0&&"top-left",g===2&&"top-right",g===9?"pad-9":"-pad-9",g!==2&&g!==5&&g!==8&&"pad-right",t),disabled:e,children:h})),C("button",{type:"button",disabled:!e,class:N("icon-pad confirm",t),onclick:a,children:[C("svg",{class:"icon confirm",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[p("path",{fill:"currentColor",d:"M11.68 15.37c-.19 0-.38-.07-.53-.22a.754.754 0 0 1 0-1.06l2.03-2.03-2.03-2.03a.754.754 0 0 1 0-1.06c.29-.29.77-.29 1.06 0l2.56 2.56c.29.29.29.77 0 1.06l-2.56 2.56c-.14.15-.34.22-.53.22"}),p("path",{fill:"currentColor",d:"M14.17 12.81H4c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h10.17c.41 0 .75.34.75.75s-.34.75-.75.75"}),p("path",{fill:"currentColor",d:"M12 20.75c-.41 0-.75-.34-.75-.75s.34-.75.75-.75c4.27 0 7.25-2.98 7.25-7.25S16.27 4.75 12 4.75c-.41 0-.75-.34-.75-.75s.34-.75.75-.75c5.15 0 8.75 3.6 8.75 8.75s-3.6 8.75-8.75 8.75"})]}),p("span",{class:o&&"sr-only",children:l("panel.number.buttons.confirm")})]}),C("button",{type:"button",disabled:!n,class:N("icon-pad cancel",t),onclick:m,children:[C("svg",{class:"icon cancel",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[p("path",{fill:"currentColor",d:"M17 21h-6.72c-1.62 0-3.17-.69-4.25-1.88L2.5 15.24a4.783 4.783 0 0 1 0-6.47l3.53-3.88A5.73 5.73 0 0 1 10.28 3H17c3.17 0 5.75 2.58 5.75 5.75v6.5c0 3.17-2.58 5.75-5.75 5.75M10.28 4.5c-1.19 0-2.34.51-3.14 1.39L3.6 9.78a3.3 3.3 0 0 0 0 4.45l3.53 3.88c.8.88 1.95 1.39 3.14 1.39H17a4.26 4.26 0 0 0 4.25-4.25v-6.5A4.26 4.26 0 0 0 17 4.5z"}),p("path",{fill:"currentColor",d:"M16 15.22c-.19 0-.38-.07-.53-.22l-4.94-4.95a.755.755 0 0 1 0-1.06c.29-.29.77-.29 1.06 0l4.94 4.95c.29.29.29.77 0 1.06-.15.15-.34.22-.53.22"}),p("path",{fill:"currentColor",d:"M11.06 15.22c-.19 0-.38-.07-.53-.22a.754.754 0 0 1 0-1.06L15.47 9c.29-.29.77-.29 1.06 0s.29.77 0 1.06L11.59 15c-.15.15-.34.22-.53.22"})]}),p("span",{class:o&&"sr-only",children:l("panel.number.buttons.delete")})]})]})})}V.props={mode:{type:String,value:"fit",reflect:!0},resettable:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},hideHelpText:{type:Boolean}},V.styles=T`:host{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";display:block}.container{display:grid;overflow-x:auto;grid-template-columns:repeat(3,minmax(0,1fr));font-size:1.25rem;line-height:1.75rem;color:#111827;background-color:#fff}.container.full{width:100%}.container.fit{min-width:fit-content}button{cursor:pointer}button:disabled{cursor:not-allowed;pointer-events:none}.number-pad{font-size:1.25rem;line-height:1.75rem;vertical-align:middle;padding:1.5rem;border-width:0;border-color:#e5e7eb;border-style:inset;text-align:center;background-color:#fff;transition-property:color,background-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.45s}.number-pad:hover{background-color:#f3f4f6}.number-pad.fit{padding:1.1rem}.number-pad.top-left{border-top-left-radius:.25rem}.number-pad.top-right{border-top-right-radius:.25rem}.pad-right{border-right-width:1px}.-pad-9{border-bottom-width:1px}.pad-9{z-index:10;grid-column-start:2;border-left-width:1px;margin-left:-1px;border-left-style:outset}.icon-pad{display:flex;flex-direction:column;gap:.25rem;justify-content:center;align-items:center;border-style:none;background-color:#fff;transition-property:color,background-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.icon-pad:hover{background-color:#f3f4f6}.icon-pad.full{padding:.75rem}.icon-pad.fit{padding:.5rem 1.5rem}.icon-pad.confirm{color:#10b981;border-bottom-right-radius:.25rem}.icon-pad.confirm:hover{border-bottom-right-radius:.25rem}.icon-pad.cancel{color:#dc2626;grid-column-start:1;grid-row-start:4}.icon-pad.cancel:hover{border-right-width:1px;border-bottom-left-radius:.25rem}.icon-pad:disabled{color:#9ca3af;cursor:not-allowed;pointer-events:none}svg.icon{width:2rem;height:2rem}svg.icon.confirm{margin-right:-.125rem}svg.icon.cancel{margin-left:-.25rem}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}@media (min-width: 768px){.container{max-width:20rem}}`;const R=P(V),ee=Object.freeze(Object.defineProperty({__proto__:null,NumberPad:R,define:()=>{customElements.get("ptpi-number-pad")||customElements.define("ptpi-number-pad",R)}},Symbol.toStringTag,{value:"Module"}));function te(){const[t,e]=k(""),{length:n}=W(),o=Z(),r=E("Confirm"),s=E("Cancel"),i=c=>{t.length>=n||e(l=>l+c)},u=()=>{t.length<n||r({pin:t})},d=()=>{e(c=>c.slice(0,-1))};return p("host",{shadowDom:!0,children:C("div",{class:"container",children:[p("h3",{class:"title",children:o("panel.modal.title")}),C("div",{role:"button",type:"button",class:"icon-close",onclick:s,children:[p("span",{class:"sr-only",children:o("panel.modal.close")}),p("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon",children:p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"})})]}),p("div",{class:"container-display",children:Array.from({length:n}).map((c,l)=>p("div",{class:"display",children:p("span",{class:l<t.length?"filled":"unfilled",children:"•"})}))}),p("div",{class:"container-pad",children:p(R,{mode:"full",resettable:!!t.length,disabled:t.length===n,onPressed:c=>i(c.detail.value),onConfirm:u,onDelete:d})})]})})}te.props={},te.styles=T`:host{display:block;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}ptpi-number-pad{width:100%}.container-pad{display:flex;padding:.75rem;justify-content:center;align-items:center}.icon-close{position:absolute;top:1rem;right:1rem;cursor:pointer}.icon-close svg{width:1.5rem;height:1.5rem;color:#6b7280}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}h3.title{padding:1.5rem;padding-bottom:0;font-size:1rem;line-height:1.5rem;font-weight:500;text-align:center;margin:0}.container{position:relative;width:100%;background-color:#fff}.container-display{display:flex;padding:.75rem;padding-bottom:0;gap:2.5rem;justify-content:center;align-items:center}.container-display>div{padding:10px}.container-display>div>span{font-size:1.875rem;line-height:2.25rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.container-display span.filled{color:#111827}.container-display span.unfilled{color:#e5e7eb}@media (min-width: 768px){.container-display{gap:1rem}}`;const ne=P(te),Tt=Object.freeze(Object.defineProperty({__proto__:null,PanelPad:ne,define:()=>{customElements.get("ptpi-panel-pad")||customElements.define("ptpi-panel-pad",ne)}},Symbol.toStringTag,{value:"Module"}));function _t(t){const e=S();return e.current=t,e}function oe(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n)}function De(t,e,n){const o=_t(n);je(()=>{const{current:r}=t;if(!r)return;const s=new Set,i=()=>{if(e.length==s.size&&[...s].every((l,f)=>l==e[f]))return!0},u=oe(r,"keydown",c=>{s.add(c.code),i()&&o.current(c)}),d=oe(r,"keyup",c=>{i()&&o.current(c),s.delete(c.code)});return()=>{u(),d()}},[t])}function Ie(t,e){const[n,o]=k([]);return je(()=>{const{current:r}=t;if(!r)return;const s=()=>o(r.assignedNodes().filter(i=>!(i instanceof B)&&!0));return s(),oe(r,"slotchange",s)},[t]),n}const ze=(t,e,n,o)=>{const r=t.animate([e,n],{duration:300,fill:"forwards",delay:o});return new Promise(s=>{r.onfinish=s})};function re({open:t,from:e,to:n,startDelay:o,endDelay:r}){const s=S(!1),i=S(),[u]=Ie(i),d=E("Leave"),c=()=>{ze(u,e,n,o).then(()=>{s.current=!0})},l=()=>{s.current&&ze(u,n,e,r).then(()=>{s.current=!1,d()})};return w(()=>{u&&(t?c():l())},[u,t]),p("host",{shadowDom:!0,children:p("slot",{ref:i})})}re.props={open:Boolean,from:Object,to:Object,startDelay:Number,endDelay:Number},re.styles=T`:host{display:block}`;const F=P(re);customElements.define("animate-presence",F);function se({open:t=!1}){const e=S(document.documentElement),[n,o]=k(!1),r=E("Confirm"),s=E("Close");return w(()=>{t&&o(!0)},[t]),De(e,["Escape"],i=>{i.type==="keydown"||!t||s()}),C("host",{shadowDom:!0,style:{display:n?"block":"none",position:"fixed",zIndex:50},children:[p(F,{from:{opacity:0},to:{opacity:.75},open:t,endDelay:300,onLeave:()=>{o(!1)},children:p("div",{class:"backdrop",onclick:s})}),p(F,{from:{opacity:0},to:{opacity:1},open:t,children:p("div",{class:"container",children:p("div",{class:"modal",children:p(ne,{onCancel:s,onConfirm:i=>r({pin:i.detail.pin})})})})})]})}se.props={open:Boolean},se.styles=T`:host{display:block}*,*:before,*:after{box-sizing:border-box}.backdrop{position:fixed;inset:0;z-index:999;height:100vh;background-color:#6b7280;opacity:.75}.container{overflow-y:auto;position:fixed;inset:0;z-index:999}.modal{overflow:hidden;position:absolute;z-index:999;border-top-left-radius:.75rem;border-top-right-radius:.75rem;width:100%;bottom:0}@media (min-width: 768px){.modal{border-bottom-right-radius:.75rem;border-bottom-left-radius:.75rem;max-width:20rem;bottom:auto;top:50%;left:50%;transform:translateY(-50%) translate(-50%)}}`;const Be=P(se),Nt=Object.freeze(Object.defineProperty({__proto__:null,PinpadModal:Be,define:()=>{customElements.get("ptp-pinpad-modal")||customElements.define("ptp-pinpad-modal",Be)}},Symbol.toStringTag,{value:"Module"}));function ie({resettable:t,disabled:e,open:n=!0}){const o=E("Pressed"),r=E("Confirm"),s=E("Delete");return p("host",{shadowDom:!0,children:p("div",{class:N("grid-animation",n?"open":"close"),children:p("div",{style:"overflow-y: hidden;",children:p("div",{class:"container",children:p(R,{resettable:t,disabled:e,hideHelpText:!0,onPressed:i=>o({value:i.detail.value}),onConfirm:r,onDelete:s})})})})})}ie.props={open:Boolean,resettable:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}},ie.styles=T`:host{display:block;--margin-top: .5rem}*,*:before,*:after{box-sizing:border-box}.grid-animation{display:grid;transition-property:grid-template-rows;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.grid-animation.open{grid-template-rows:1fr}.grid-animation.close{grid-template-rows:0fr}.container{background-color:#fff;padding:.5rem;border-radius:.75rem;border:1px;border-style:solid;border-color:#0000000d;margin-top:var(--margin-top)}`;const ce=P(ie),Re=Object.freeze(Object.defineProperty({__proto__:null,PinpadStatic:ce,define:()=>{customElements.get("ptp-pinpad-static")||customElements.define("ptp-pinpad-static",ce)}},Symbol.toStringTag,{value:"Module"}));function le({resettable:t,disabled:e,open:n=!1}){const o=M(),r=S(!1),[s,i]=k(!1),u=E("Pressed"),d=E("Confirm"),c=E("Delete"),l=E("Close"),f=ke(m=>{if(!o.current)return;if(m.target!==o.current&&!m.composedPath().includes(o.current)&&r.current){l(),r.current=!1;return}r.current=!0},[o,s]),a=()=>{d(),r.current=!1};return w(()=>{n&&i(!0)},[n]),w(()=>{if(n)return document.addEventListener("click",f),()=>{document.removeEventListener("click",f)}},[n,f]),p("host",{shadowDom:!0,style:{display:s?"block":"none"},children:p(F,{open:n,from:{opacity:0},to:{opacity:1},onLeave:()=>{i(!1)},children:p("div",{class:"container",children:p(ce,{open:!0,resettable:t,disabled:e,onPressed:m=>u({value:m.detail.value}),onConfirm:a,onDelete:c})})})})}le.props={open:Boolean,resettable:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}},le.styles=T`:host{display:block;position:relative}*,*:before,*:after{box-sizing:border-box}.container{position:absolute;width:15rem;z-index:50}`;const Fe=P(le),xt=Object.freeze(Object.defineProperty({__proto__:null,PinpadFloat:Fe,define:()=>{customElements.get("ptp-pinpad-float")||customElements.define("ptp-pinpad-float",Fe)}},Symbol.toStringTag,{value:"Module"})),Ue={es:{input:{placeholder:"Ingresa el Pin"},panel:{modal:{title:"Ingresa tu Pin",close:"Cerrar"},number:{buttons:{confirm:"Confirmar",delete:"Borrar"}}}},en:{input:{placeholder:"Enter the Pin"},panel:{modal:{title:"Enter your Pin",close:"Close"},number:{buttons:{confirm:"Confirm",delete:"Delete"}}}},pt:{input:{placeholder:"Insira o Pin"},panel:{modal:{title:"Insira seu Pin",close:"Fechar"},number:{buttons:{confirm:"Confirmar",delete:"Apagar"}}}},it:{input:{placeholder:"Inserisci il Pin"},panel:{modal:{title:"Inserisci il tuo Pin",close:"Chiudi"},number:{buttons:{confirm:"Conferma",delete:"Cancella"}}}}},At=t=>e=>{const n=Ue[t.slice(0,2)]??Ue.en,o=e.split(".");let r=n[o[0]];return r===void 0?e:(o.slice(1).forEach(s=>{if(r[s]===void 0)return r=e;r=r[s]}),r)};function ae({locale:t="es",positions:e,length:n,mask:o,theming:r={}}){return Q(G,{locale:t,trans:At(t)}),Q(Me,{positions:e.split(",").map(Number),length:n,mask:o,theming:r}),p("host",{shadowDom:!0,children:p("slot",{})})}ae.props={locale:String,positions:String,length:Number,mask:String,theming:Object},ae.styles=T`:host{display:block}`;const He=P(ae),Lt=Object.freeze(Object.defineProperty({__proto__:null,App:He,define:()=>{customElements.get("ptp-pinpad-context")||customElements.define("ptp-pinpad-context",He)}},Symbol.toStringTag,{value:"Module"})),Ye=(t,e)=>e?`${t}: ${e};`:!1;function de({pin:t="",mode:e}){const n=S(),o=S(),[r]=Ie(o),[s,i]=k(t),{length:u,theming:d}=W(),c=Z(),l=b=>{i(h=>h.length>=u?h:h+b.detail.value)},f=ke(b=>{e!=="modal"&&s.length<u||(e==="modal"&&b.detail.pin.length===u&&i(b.detail.pin),y())},[r,s,u,e]),a=()=>{i(b=>b.slice(0,-1))},m=()=>{r.setAttribute("open",!0)},y=()=>{r.setAttribute("open",!1)};return w(()=>{if(r&&e!=="modal")return r.addEventListener("Pressed",l),r.addEventListener("Delete",a),()=>{r.removeEventListener("Pressed",l),r.removeEventListener("Delete",a)}},[r,e]),w(()=>{if(r&&!(e!=="modal"&&e!=="float"))return r.addEventListener("Close",y),()=>{r.removeEventListener("Close",y)}},[r,e]),w(()=>{if(r)return r.addEventListener("Confirm",f),()=>{r.removeEventListener("Confirm",f)}},[r,f]),w(()=>{!r||e==="modal"||(r.setAttribute("disabled",s.length===u),r.setAttribute("resettable",!!s.length))},[s,e,r]),De(n,["Space"],b=>{b.type==="keyup"&&m()}),p("host",{shadowDom:!0,style:N(Ye("--input-border-color-focus",d?.inputBorderColorFocus),Ye("--input-border-color-focus-shadow",d?.inputOutlineColorFocus)),children:C("div",{class:"container",children:[p("div",{class:"input-container",onclick:m,children:p("input",{ref:n,id:"pin",name:"pin",type:"password",value:s,maxLength:u,minLength:u,class:N("input",e),readOnly:!0,placeholder:c("input.placeholder")})}),p("slot",{ref:o})]})})}de.props={pin:String,mode:String},de.styles=T`:host{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";display:block;--input-border-color-focus: rgba(17, 24, 39, 1);--input-border-color-focus-shadow: rgba(209, 213, 219, 1)}*,*:before,*:after{box-sizing:border-box}.container{max-width:300px}.input-container{cursor:text}.input{width:100%;padding:.5rem .75rem;border-radius:8px;border:1px rgba(209,213,219,1) solid;font-size:1rem;line-height:1.5rem;font-weight:400;background-color:#fff}.input:focus,.input:focus-visible,.input:focus-within{outline:none;border-color:var(--input-border-color-focus);box-shadow:0 0 0 3px var(--input-border-color-focus-shadow)}.input:invalid{border-color:#ef4444;box-shadow:0 0 0 3px #ffd4d4}.input:disabled{color:#f9fafb;background-color:#d1d5db}.input.static{pointer-events:none}`;const Ke=P(de),Ot=Object.freeze(Object.defineProperty({__proto__:null,Pinpad:Ke,define:()=>{customElements.get("ptp-pinpad")||customElements.define("ptp-pinpad",Ke)}},Symbol.toStringTag,{value:"Module"}));_.PinPad=Je,_.PinPadClient=qe,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
(function(_,L){typeof exports=="object"&&typeof module<"u"?L(exports):typeof define=="function"&&define.amd?define(["exports"],L):(_=typeof globalThis<"u"?globalThis:_||self,L(_.PinPadSDK={}))})(this,function(_){"use strict";const L={modal:{"../components/number-pad/number-pad":()=>Promise.resolve().then(()=>ie),"../components/panel-pad/panel-pad":()=>Promise.resolve().then(()=>Nt),"../components/pinpad-modal/pinpad-modal":()=>Promise.resolve().then(()=>It)},static:{"../components/number-pad/number-pad":()=>Promise.resolve().then(()=>ie),"../components/pinpad-static/pinpad-static":()=>Promise.resolve().then(()=>Fe)},float:{"../components/number-pad/number-pad":()=>Promise.resolve().then(()=>ie),"../components/pinpad-static/pinpad-static":()=>Promise.resolve().then(()=>Fe),"../components/pinpad-float/pinpad-float":()=>Promise.resolve().then(()=>zt)}};class Y{#e;constructor(e){this.#e=e}static make(e){return new Y(e)}define(){let e;const n=new Promise(s=>{e=s}),o=L[this.#e],r=[Promise.resolve().then(()=>Rt).then(s=>{s.define()}),Promise.resolve().then(()=>Ft).then(s=>{s.define()})];for(let s in o)r.push(o[s]().then(i=>{i.define()}));return Promise.all(r).then(()=>{e()}),n}}class Qe{#e;constructor(e){this.#e={locale:document.documentElement.lang,mask:!0,mode:"modal",pinLength:4,theming:null,...e}}get mask(){return typeof this.#e.mask=="string"?this.#e.mask??"*":this.#e.mask?"*":""}async render(e,n,o=()=>{},r=()=>{}){const s=document.querySelector(e);if(!s)return null;await Y.make(this.#e.mode).define(),this._render(s,n,r)}_setAttributes(e,n){e.setAttribute("locale",this.#e.locale),e.setAttribute("mask",this.mask),e.setAttribute("length",this.#e.pinLength.toString()),e.setAttribute("positions",n),this.#e.theming&&e.setAttribute("theming",JSON.stringify(this.#e.theming))}_renderModal(){return document.createElement("ptp-pinpad-modal")}_renderStatic(e){const n=document.createElement("ptp-pinpad-static");return n.addEventListener("Delete",e),n}_renderFloat(e){const n=document.createElement("ptp-pinpad-float");return n.addEventListener("Delete",e),n}_render(e,n,o=()=>{}){const r=document.createElement("ptp-pinpad-context");this._setAttributes(r,n);const s=document.createElement("ptp-pinpad");this.#e.pin&&s.setAttribute("pin",this.#e.pin),s.setAttribute("mode",this.#e.mode),r.appendChild(s);let i;this.#e.mode==="modal"?i=this._renderModal():this.#e.mode==="static"?i=this._renderStatic(o):i=this._renderFloat(o),s.append(i),e.appendChild(r)}}class ge{static async createTransaction(e,n){const o=await fetch(`${e}/api/transaction`,{method:"POST",headers:{Authorization:"Bearer "+n}});if(!o.ok)throw new Error("Failed to create transaction");return{data:await o.json(),status:o.status,statusText:o.statusText,headers:o.headers}}static async encryptPin(e){const n=await fetch(`${e.url}/api/pinblock-generator/${e.transactionId}`,{method:"POST",headers:{Authorization:"Bearer "+e.token,"Accept-Language":e.locale},body:JSON.stringify(e)});if(!n.ok)throw new Error("Failed to generate pinblock");return{data:await n.json(),status:n.status,statusText:n.statusText,headers:n.headers}}}class Xe{apiUrl;authToken;constructor(e,n){this.apiUrl=e,this.authToken=n}createTransaction(){return ge.createTransaction(this.apiUrl,this.authToken)}generatePinBlock(e){const n={url:this.apiUrl,token:this.authToken,...e};return ge.encryptPin(n)}}class Ge{#e;#t=new Set;constructor(e){this.#e=e}get current(){return this.#e}set current(e){this.#e!=e&&(this.#e=e,this.#t.forEach(n=>n(e)))}on(e){return this.#t.add(e),()=>this.#t.delete(e)}}const K=t=>new Ge(t),J=Symbol.for("atomico.hooks");globalThis[J]=globalThis[J]||{};let x=globalThis[J];const Ze=Symbol.for("Atomico.suspense"),ye=Symbol.for("Atomico.effect"),We=Symbol.for("Atomico.layoutEffect"),Ee=Symbol.for("Atomico.insertionEffect"),O=(t,e,n)=>{const{i:o,hooks:r}=x.c,s=r[o]=r[o]||{};return s.value=t(s.value),s.effect=e,s.tag=n,x.c.i++,r[o].value},k=t=>O((e=K(t))=>e),A=()=>O((t=K(x.c.host))=>t),we=()=>x.c.update,Ve=(t,e,n=0)=>{let o={},r=!1;const s=()=>r,i=(c,l)=>{for(const p in o){const a=o[p];a.effect&&a.tag===c&&(a.value=a.effect(a.value,l))}};return{load:c=>{x.c={host:e,hooks:o,update:t,i:0,id:n};let l;try{r=!1,l=c()}catch(p){if(p!==Ze)throw p;r=!0}finally{x.c=null}return l},cleanEffects:c=>(i(Ee,c),()=>(i(We,c),()=>{i(ye,c)})),isSuspense:s}},j=Symbol.for;function Pe(t,e){const n=t.length;if(n!==e.length)return!1;for(let o=0;o<n;o++){let r=t[o],s=e[o];if(r!==s)return!1}return!0}const P=t=>typeof t=="function",M=t=>typeof t=="object",{isArray:et}=Array,q=(t,e)=>(e?t instanceof HTMLStyleElement:!0)&&"hydrate"in(t?.dataset||{});function Ce(t,e){let n;const o=r=>{let{length:s}=r;for(let i=0;i<s;i++){const f=r[i];if(f&&Array.isArray(f))o(f);else{const d=typeof f;if(f==null||d==="function"||d==="boolean")continue;d==="string"||d==="number"?(n==null&&(n=""),n+=f):(n!=null&&(e(n),n=null),e(f))}}};o(t),n!=null&&e(n)}const ve=(t,e,n)=>(t.addEventListener(e,n),()=>t.removeEventListener(e,n));let Se=class{constructor(e,n,o){this.message=n,this.target=e,this.value=o}};class tt extends Se{}class nt extends Se{}const D="Custom",ot=null,rt={true:1,"":1,1:1};function st(t,e,n,o,r){const{type:s,reflect:i,event:f,value:d,attr:c=it(e)}=n?.name!=D&&M(n)&&n!=ot?n:{type:n},l=s?.name===D&&s.map,p=d!=null?s==Function||!P(d)?()=>d:d:null;Object.defineProperty(t,e,{configurable:!0,set(a){const m=this[e];p&&s!=Boolean&&a==null&&(a=p());const{error:y,value:b}=(l?at:dt)(s,a);if(y&&b!=null)throw new tt(this,`The value defined for prop '${e}' must be of type '${s.name}'`,b);m!=b&&(this._props[e]=b??void 0,this.update(),f&&ke(this,f),this.updated.then(()=>{i&&(this._ignoreAttr=c,ct(this,s,c,this[e]),this._ignoreAttr=null)}))},get(){return this._props[e]}}),p&&(r[e]=p()),o[c]={prop:e,type:s}}const ke=(t,{type:e,base:n=CustomEvent,...o})=>t.dispatchEvent(new n(e,o)),it=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase(),ct=(t,e,n,o)=>o==null||e==Boolean&&!o?t.removeAttribute(n):t.setAttribute(n,e?.name===D&&e?.serialize?e?.serialize(o):M(o)?JSON.stringify(o):e==Boolean?"":o),lt=(t,e)=>t==Boolean?!!rt[e]:t==Number?Number(e):t==String?e:t==Array||t==Object?JSON.parse(e):t.name==D?e:new t(e),at=({map:t},e)=>{try{return{value:t(e),error:!1}}catch{return{value:e,error:!0}}},dt=(t,e)=>t==null||e==null?{value:e,error:!1}:t!=String&&e===""?{value:void 0,error:!1}:t==Object||t==Array||t==Symbol?{value:e,error:{}.toString.call(e)!==`[object ${t.name}]`}:e instanceof t?{value:e,error:t==Number&&Number.isNaN(e.valueOf())}:t==String||t==Number||t==Boolean?{value:e,error:t==Number?typeof e!="number"?!0:Number.isNaN(e):t==String?typeof e!="string":typeof e!="boolean"}:{value:e,error:!0};let ut=0;const ft=t=>{const e=(t?.dataset||{})?.hydrate||"";return e||"c"+ut++},C=(t,e=HTMLElement)=>{const n={},o={},r="prototype"in e&&e.prototype instanceof Element,s=r?e:"base"in e?e.base:HTMLElement,{props:i,styles:f}=r?t:e;class d extends s{constructor(){super(),this._setup(),this._render=()=>t({...this._props});for(const l in o)this[l]=o[l]}static get styles(){return[super.styles,f]}async _setup(){if(this._props)return;this._props={};let l,p;this.mounted=new Promise(h=>this.mount=()=>{h(),l!=this.parentNode&&(p!=l?this.unmounted.then(this.update):this.update()),l=this.parentNode}),this.unmounted=new Promise(h=>this.unmount=()=>{h(),(l!=this.parentNode||!this.isConnected)&&(a.cleanEffects(!0)()(),p=this.parentNode,l=null)}),this.symbolId=this.symbolId||Symbol(),this.symbolIdParent=Symbol();const a=Ve(()=>this.update(),this,ft(this));let m,y=!0;const b=q(this);this.update=()=>(m||(m=!0,this.updated=(this.updated||this.mounted).then(()=>{try{const h=a.load(this._render),g=a.cleanEffects();return h&&h.render(this,this.symbolId,b),m=!1,y&&!a.isSuspense()&&(y=!1,!b&&pt(this)),g()}finally{m=!1}}).then(h=>{h&&h()})),this.updated),this.update()}connectedCallback(){this.mount(),super.connectedCallback&&super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),this.unmount()}attributeChangedCallback(l,p,a){if(n[l]){if(l===this._ignoreAttr||p===a)return;const{prop:m,type:y}=n[l];try{this[m]=lt(y,a)}catch{throw new nt(this,`The value defined as attr '${l}' cannot be parsed by type '${y.name}'`,a)}}else super.attributeChangedCallback(l,p,a)}static get props(){return{...super.props,...i}}static get observedAttributes(){const l=super.observedAttributes||[];for(const p in i)st(this.prototype,p,i[p],n,o);return Object.keys(n).concat(l)}}return d};function pt(t){const{styles:e}=t.constructor,{shadowRoot:n}=t;if(n&&e.length){const o=[];Ce(e,r=>{r&&(r instanceof Element?n.appendChild(r.cloneNode(!0)):o.push(r))}),o.length&&(n.adoptedStyleSheets=o)}}const Te=t=>(e,n)=>{O(([o,r]=[])=>((r||!r)&&(r&&Pe(r,n)?o=o||!0:(P(o)&&o(),o=null)),[o,n]),([o,r],s)=>s?(P(o)&&o(),[]):[o||e(),r],t)},w=Te(ye),Q=Te(Ee);class mt extends Array{constructor(e,n){let o=!0;const r=s=>{try{n(s,this,o)}finally{o=!1}};super(void 0,r,n),r(e)}}const v=t=>{const e=we();return O((n=new mt(t,(o,r,s)=>{o=P(o)?o(r[0]):o,o!==r[0]&&(r[0]=o,s||e())}))=>n)},I=(t,e)=>{const[n]=O(([o,r,s=0]=[])=>((!r||r&&!Pe(r,e))&&(o=t()),[o,e,s]));return n},_e=(t,e)=>I(()=>t,e),E=(t,e={})=>{const n=A();return n[t]||(n[t]=(o=e.detail)=>ke(n.current,{type:t,...e,detail:o})),n[t]},X=j("atomico/options");globalThis[X]=globalThis[X]||{sheet:!!document.adoptedStyleSheets};const z=globalThis[X],ht=new Promise(t=>{z.ssr||(document.readyState==="loading"?ve(document,"DOMContentLoaded",t):t())}),bt={checked:1,value:1,selected:1},gt={list:1,type:1,size:1,form:1,width:1,height:1,src:1,href:1,slot:1},yt={shadowDom:1,staticNode:1,cloneNode:1,children:1,key:1},B={},G=[];class R extends Text{}const Et=j("atomico/id"),$=j("atomico/type"),Z=j("atomico/ref"),Ne=j("atomico/vnode"),wt=()=>{};function Pt(t,e,n){return W(this,t,e,n)}const xe=(t,e,...n)=>{const o=e||B;let{children:r}=o;if(r=r??(n.length?n:G),t===wt)return r;const s=t?t instanceof Node?1:t.prototype instanceof HTMLElement&&2:0;if(s===!1&&t instanceof Function)return t(r!=G?{children:r,...o}:o);const i=z.render||Pt;return{[$]:Ne,type:t,props:o,children:r,key:o.key,shadow:o.shadowDom,static:o.staticNode,raw:s,is:o.is,clone:o.cloneNode,render:i}};function W(t,e,n=Et,o,r){let s;if(e&&e[n]&&e[n].vnode==t||t[$]!=Ne)return e;(t||!e)&&(r=r||t.type=="svg",s=t.type!="host"&&(t.raw==1?(e&&t.clone?e[Z]:e)!=t.type:t.raw==2?!(e instanceof t.type):e?e[Z]||e.localName!=t.type:!e),s&&t.type!=null&&(t.raw==1&&t.clone?(o=!0,e=t.type.cloneNode(!0),e[Z]=t.type):e=t.raw==1?t.type:t.raw==2?new t.type:r?document.createElementNS("http://www.w3.org/2000/svg",t.type):document.createElement(t.type,t.is?{is:t.is}:void 0)));const i=e[n]?e[n]:B,{vnode:f=B,cycle:d=0}=i;let{fragment:c,handlers:l}=i;const{children:p=G,props:a=B}=f;if(l=s?{}:l||{},t.static&&!s)return e;if(t.shadow&&!e.shadowRoot&&e.attachShadow({mode:"open",...t.shadow}),t.props!=a&&St(e,a,t.props,l,r),t.children!==p){const m=t.shadow?e.shadowRoot:e;c=vt(t.children,c,m,n,!d&&o,r&&t.type=="foreignObject"?!1:r)}return e[n]={vnode:t,handlers:l,fragment:c,cycle:d+1},e}function Ct(t,e){const n=new R(""),o=new R("");let r;if(t[e?"prepend":"append"](n),e){let{lastElementChild:s}=t;for(;s;){const{previousElementSibling:i}=s;if(q(s,!0)&&!q(i,!0)){r=s;break}s=i}}return r?r.before(o):t.append(o),{markStart:n,markEnd:o}}function vt(t,e,n,o,r,s){t=t==null?null:et(t)?t:[t];const i=e||Ct(n,r),{markStart:f,markEnd:d,keyes:c}=i;let l;const p=c&&new Set;let a=f;if(t&&Ce(t,m=>{if(typeof m=="object"&&!m[$])return;const y=m[$]&&m.key,b=c&&y!=null&&c.get(y);a!=d&&a===b?p.delete(a):a=a==d?d:a.nextSibling;const h=c?b:a;let g=h;if(m[$])g=W(m,h,o,r,s);else{const be=m+"";!(g instanceof Text)||g instanceof R?g=new Text(be):g.data!=be&&(g.data=be)}g!=a&&(c&&p.delete(g),!h||c?(n.insertBefore(g,a),c&&a!=d&&p.add(a)):h==d?n.insertBefore(g,d):(n.replaceChild(g,h),a=g)),y!=null&&(l=l||new Map,l.set(y,g))}),a=a==d?d:a.nextSibling,e&&a!=d)for(;a!=d;){const m=a;a=a.nextSibling,m.remove()}return p&&p.forEach(m=>m.remove()),i.keyes=l,i}function St(t,e,n,o,r){for(const s in e)!(s in n)&&Ae(t,s,e[s],null,r,o);for(const s in n)Ae(t,s,e[s],n[s],r,o)}function Ae(t,e,n,o,r,s){if(e=e=="class"&&!r?"className":e,n=n??null,o=o??null,e in t&&bt[e]&&(n=t[e]),!(o===n||yt[e]||e[0]=="_"))if(t.localName==="slot"&&e==="assignNode"&&"assign"in t)t.assign(o);else if(e[0]=="o"&&e[1]=="n"&&(P(o)||P(n)))kt(t,e.slice(2),o,s);else if(e=="ref")o&&(P(o)?o(t):o.current=t);else if(e=="style"){const{style:i}=t;n=n||"",o=o||"";const f=M(n),d=M(o);if(f)for(const c in n)if(d)!(c in o)&&Le(i,c,null);else break;if(d)for(const c in o){const l=o[c];f&&n[c]===l||Le(i,c,l)}else i.cssText=o}else{const i=e[0]=="$"?e.slice(1):e;i===e&&(!r&&!gt[e]&&e in t||P(o)||P(n))?t[e]=o??"":o==null?t.removeAttribute(i):t.setAttribute(i,M(o)?JSON.stringify(o):o)}}function kt(t,e,n,o){if(o.handleEvent||(o.handleEvent=r=>o[r.type].call(t,r)),n){if(!o[e]){const r=n.capture||n.once||n.passive?Object.assign({},n):null;t.addEventListener(e,o,r)}o[e]=n}else o[e]&&(t.removeEventListener(e,o),delete o[e])}function Le(t,e,n){let o="setProperty";n==null&&(o="removeProperty",n=null),~e.indexOf("-")?t[o](e,n):t[e]=n}const Tt=xe("host",{style:"display: contents"}),Oe="value",V=(t,e)=>{const n=A(),o=k();Q(()=>ve(n.current,"ConnectContext",r=>{r.composedPath().at(0)!==r.currentTarget&&t===r.detail.id&&(r.stopPropagation(),r.detail.connect(o))}),[t]),o.current=e},je=t=>{const e=E("ConnectContext",{bubbles:!0,composed:!0}),[n,o]=v(()=>{if(z.ssr)return;let s;return e({id:t,connect(i){s=i}}),s}),r=we();return w(()=>{ht.then(()=>e({id:t,connect:o}))},[t]),w(()=>{if(n)return n.on(r)},[n]),n?.current||t[Oe]},ee=t=>{const e=C(({value:n})=>(V(e,n),Tt),{props:{value:{type:Object,value:()=>t}}});return e[Oe]=t,e};ee({dispatch(t,e){}});const te=(t,e)=>{const n=A();Q(()=>{let o=!1,r,s=()=>{r&&r(),r=null};const i=async()=>{o||(o=!0,await n.current.updated,s(),o=!1,r=t())},f=e.map(d=>d?.on(i));return n.once||(n.once=!0,i()),()=>{f.map(d=>d&&d()),s()}},e)},Me={};function T(t,...e){const n=(t.raw||t).reduce((o,r,s)=>o+r+(e[s]||""),"");return Me[n]=Me[n]||_t(n)}function _t(t){if(z.sheet){const e=new CSSStyleSheet;return e.replaceSync(t),e}else{const e=document.createElement("style");return e.textContent=t,e}}const u=(t,e,n)=>(e==null?e={key:n}:e.key=n,xe(t,e)),S=u,N=(...t)=>t.filter(Boolean).join(" "),ne=ee({locale:"es",trans:t=>t});customElements.define("ptp-lang-context",ne);const oe=()=>{const{trans:t}=je(ne);return t},$e=ee({positions:[],mask:"*",length:4,theming:null}),re=()=>je($e);function se({mode:t,disabled:e,resettable:n,hideHelpText:o=!1}){const[r,s]=v(!1),[i,f]=v(!0),{mask:d,positions:c}=re(),l=oe(),p=E("Pressed"),a=E("Confirm"),m=E("Delete"),y=I(()=>!r&&i&&d?d.repeat(10).split(""):c,[r,i,d,c]),b=h=>{s(!h.matches)};return w(()=>{if(!("matchMedia"in window)||typeof window.matchMedia!="function")return;const h=window.matchMedia("(min-width: 768px)");return"addEventListener"in h?h.addEventListener("change",b):h.addListener(b),s(!h.matches),()=>{"removeEventListener"in h?h.removeEventListener("change",b):h.removeListener(b)}},[]),u("host",{shadowDom:!0,children:S("div",{role:"none",class:N("container",t),onmouseenter:()=>f(!1),onmouseleave:()=>f(!0),children:[y.map((h,g)=>u("button",{type:"button",onclick:()=>p({value:g}),class:N("number-pad",g===0&&"top-left",g===2&&"top-right",g===9?"pad-9":"-pad-9",g!==2&&g!==5&&g!==8&&"pad-right",t),disabled:e,children:h})),S("button",{type:"button",disabled:!e,class:N("icon-pad confirm",t),onclick:a,children:[S("svg",{class:"icon confirm",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[u("path",{fill:"currentColor",d:"M11.68 15.37c-.19 0-.38-.07-.53-.22a.754.754 0 0 1 0-1.06l2.03-2.03-2.03-2.03a.754.754 0 0 1 0-1.06c.29-.29.77-.29 1.06 0l2.56 2.56c.29.29.29.77 0 1.06l-2.56 2.56c-.14.15-.34.22-.53.22"}),u("path",{fill:"currentColor",d:"M14.17 12.81H4c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h10.17c.41 0 .75.34.75.75s-.34.75-.75.75"}),u("path",{fill:"currentColor",d:"M12 20.75c-.41 0-.75-.34-.75-.75s.34-.75.75-.75c4.27 0 7.25-2.98 7.25-7.25S16.27 4.75 12 4.75c-.41 0-.75-.34-.75-.75s.34-.75.75-.75c5.15 0 8.75 3.6 8.75 8.75s-3.6 8.75-8.75 8.75"})]}),u("span",{class:o&&"sr-only",children:l("panel.number.buttons.confirm")})]}),S("button",{type:"button",disabled:!n,class:N("icon-pad cancel",t),onclick:m,children:[S("svg",{class:"icon cancel",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[u("path",{fill:"currentColor",d:"M17 21h-6.72c-1.62 0-3.17-.69-4.25-1.88L2.5 15.24a4.783 4.783 0 0 1 0-6.47l3.53-3.88A5.73 5.73 0 0 1 10.28 3H17c3.17 0 5.75 2.58 5.75 5.75v6.5c0 3.17-2.58 5.75-5.75 5.75M10.28 4.5c-1.19 0-2.34.51-3.14 1.39L3.6 9.78a3.3 3.3 0 0 0 0 4.45l3.53 3.88c.8.88 1.95 1.39 3.14 1.39H17a4.26 4.26 0 0 0 4.25-4.25v-6.5A4.26 4.26 0 0 0 17 4.5z"}),u("path",{fill:"currentColor",d:"M16 15.22c-.19 0-.38-.07-.53-.22l-4.94-4.95a.755.755 0 0 1 0-1.06c.29-.29.77-.29 1.06 0l4.94 4.95c.29.29.29.77 0 1.06-.15.15-.34.22-.53.22"}),u("path",{fill:"currentColor",d:"M11.06 15.22c-.19 0-.38-.07-.53-.22a.754.754 0 0 1 0-1.06L15.47 9c.29-.29.77-.29 1.06 0s.29.77 0 1.06L11.59 15c-.15.15-.34.22-.53.22"})]}),u("span",{class:o&&"sr-only",children:l("panel.number.buttons.delete")})]})]})})}se.props={mode:{type:String,value:"fit",reflect:!0},resettable:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},hideHelpText:{type:Boolean}},se.styles=T`:host{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";display:block}.container{display:grid;overflow-x:auto;grid-template-columns:repeat(3,minmax(0,1fr));font-size:1.25rem;line-height:1.75rem;color:#111827;background-color:#fff}.container.full{width:100%}.container.fit{min-width:fit-content}button{cursor:pointer}button:disabled{cursor:not-allowed;pointer-events:none}.number-pad{font-size:1.25rem;line-height:1.75rem;vertical-align:middle;padding:1.5rem;border-width:0;border-color:#e5e7eb;border-style:inset;text-align:center;background-color:#fff;transition-property:color,background-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.45s}.number-pad:hover{background-color:#f3f4f6}.number-pad.fit{padding:1.1rem}.number-pad.top-left{border-top-left-radius:.25rem}.number-pad.top-right{border-top-right-radius:.25rem}.pad-right{border-right-width:1px}.-pad-9{border-bottom-width:1px}.pad-9{z-index:10;grid-column-start:2;border-left-width:1px;margin-left:-1px;border-left-style:outset}.icon-pad{display:flex;flex-direction:column;gap:.25rem;justify-content:center;align-items:center;border-style:none;background-color:#fff;transition-property:color,background-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.icon-pad:hover{background-color:#f3f4f6}.icon-pad.full{padding:.75rem}.icon-pad.fit{padding:.5rem 1.5rem}.icon-pad.confirm{color:#10b981;border-bottom-right-radius:.25rem}.icon-pad.confirm:hover{border-bottom-right-radius:.25rem}.icon-pad.cancel{color:#dc2626;grid-column-start:1;grid-row-start:4}.icon-pad.cancel:hover{border-right-width:1px;border-bottom-left-radius:.25rem}.icon-pad:disabled{color:#9ca3af;cursor:not-allowed;pointer-events:none}svg.icon{width:2rem;height:2rem}svg.icon.confirm{margin-right:-.125rem}svg.icon.cancel{margin-left:-.25rem}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}@media (min-width: 768px){.container{max-width:20rem}}`;const F=C(se),ie=Object.freeze(Object.defineProperty({__proto__:null,NumberPad:F,define:()=>{customElements.get("ptpi-number-pad")||customElements.define("ptpi-number-pad",F)}},Symbol.toStringTag,{value:"Module"}));function ce(){const[t,e]=v(""),{length:n}=re(),o=oe(),r=E("Confirm"),s=E("Cancel"),i=c=>{t.length>=n||e(l=>l+c)},f=()=>{t.length<n||r({pin:t})},d=()=>{e(c=>c.slice(0,-1))};return u("host",{shadowDom:!0,children:S("div",{class:"container",children:[u("h3",{class:"title",children:o("panel.modal.title")}),S("div",{role:"button",type:"button",class:"icon-close",onclick:s,children:[u("span",{class:"sr-only",children:o("panel.modal.close")}),u("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon",children:u("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"})})]}),u("div",{class:"container-display",children:Array.from({length:n}).map((c,l)=>u("div",{class:"display",children:u("span",{class:l<t.length?"filled":"unfilled",children:"•"})}))}),u("div",{class:"container-pad",children:u(F,{mode:"full",resettable:!!t.length,disabled:t.length===n,onPressed:c=>i(c.detail.value),onConfirm:f,onDelete:d})})]})})}ce.props={},ce.styles=T`:host{display:block;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}ptpi-number-pad{width:100%}.container-pad{display:flex;padding:.75rem;justify-content:center;align-items:center}.icon-close{position:absolute;top:1rem;right:1rem;cursor:pointer}.icon-close svg{width:1.5rem;height:1.5rem;color:#6b7280}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}h3.title{padding:1.5rem;padding-bottom:0;font-size:1rem;line-height:1.5rem;font-weight:500;text-align:center;margin:0}.container{position:relative;width:100%;background-color:#fff}.container-display{display:flex;padding:.75rem;padding-bottom:0;gap:2.5rem;justify-content:center;align-items:center}.container-display>div{padding:10px}.container-display>div>span{font-size:1.875rem;line-height:2.25rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.container-display span.filled{color:#111827}.container-display span.unfilled{color:#e5e7eb}@media (min-width: 768px){.container-display{gap:1rem}}`;const le=C(ce),Nt=Object.freeze(Object.defineProperty({__proto__:null,PanelPad:le,define:()=>{customElements.get("ptpi-panel-pad")||customElements.define("ptpi-panel-pad",le)}},Symbol.toStringTag,{value:"Module"}));function De(t){const e=k();return e.current=t,e}function xt(t,e,n,o){const r=De(n);te(()=>{const{current:s}=t;if(s)return U(s,e,i=>r.current(i),o)},[t])}function U(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n)}function At(t,e){const n=Lt(e);return I(()=>K(n.find(o=>o?.matches?.(t))),[t])}function Lt(t){const e=A();return I(()=>{const n=[];let{current:o}=e;for(;o=o.parentNode||t;)n.push(o);return n},[t])}const Ot=t=>t&&t.type==="host"?t:u("host",{children:t});function jt(t,e){const n=A();n.id=n.id||Symbol(),Q(()=>{W(Ot(typeof t=="function"?t():t),n.current,n.id)},e)}function Mt(){return At("form")}function $t(t,e,n){xt(Mt(),t,e,n)}function Dt(t,e){const[n]=v(Math.random);jt(()=>u("input",{type:"hidden",value:e,name:t,slot:`${n}`}),[t,e])}function Ie(t,e,n){const o=De(n);te(()=>{const{current:r}=t;if(!r)return;const s=new Set,i=()=>{if(e.length==s.size&&[...s].every((l,p)=>l==e[p]))return!0},f=U(r,"keydown",c=>{s.add(c.code),i()&&o.current(c)}),d=U(r,"keyup",c=>{i()&&o.current(c),s.delete(c.code)});return()=>{f(),d()}},[t])}function ze(t,e){const[n,o]=v([]);return te(()=>{const{current:r}=t;if(!r)return;const s=()=>o(r.assignedNodes().filter(i=>!(i instanceof R)&&!0));return s(),U(r,"slotchange",s)},[t]),n}const Be=(t,e,n,o)=>{const r=t.animate([e,n],{duration:300,fill:"forwards",delay:o});return new Promise(s=>{r.onfinish=s})};function ae({open:t,from:e,to:n,startDelay:o,endDelay:r}){const s=k(!1),i=k(),[f]=ze(i),d=E("Leave"),c=()=>{Be(f,e,n,o).then(()=>{s.current=!0})},l=()=>{s.current&&Be(f,n,e,r).then(()=>{s.current=!1,d()})};return w(()=>{f&&(t?c():l())},[f,t]),u("host",{shadowDom:!0,children:u("slot",{ref:i})})}ae.props={open:Boolean,from:Object,to:Object,startDelay:Number,endDelay:Number},ae.styles=T`:host{display:block}`;const H=C(ae);customElements.define("animate-presence",H);function de({open:t=!1}){const e=k(document.documentElement),[n,o]=v(!1),r=E("Confirm"),s=E("Close");return w(()=>{t&&o(!0)},[t]),Ie(e,["Escape"],i=>{i.type==="keydown"||!t||s()}),S("host",{shadowDom:!0,style:{display:n?"block":"none",position:"fixed",zIndex:50},children:[u(H,{from:{opacity:0},to:{opacity:.75},open:t,endDelay:300,onLeave:()=>{o(!1)},children:u("div",{class:"backdrop",onclick:s})}),u(H,{from:{opacity:0},to:{opacity:1},open:t,children:u("div",{class:"container",children:u("div",{class:"modal",children:u(le,{onCancel:s,onConfirm:i=>r({pin:i.detail.pin})})})})})]})}de.props={open:Boolean},de.styles=T`:host{display:block}*,*:before,*:after{box-sizing:border-box}.backdrop{position:fixed;inset:0;z-index:999;height:100vh;background-color:#6b7280;opacity:.75}.container{overflow-y:auto;position:fixed;inset:0;z-index:999}.modal{overflow:hidden;position:absolute;z-index:999;border-top-left-radius:.75rem;border-top-right-radius:.75rem;width:100%;bottom:0}@media (min-width: 768px){.modal{border-bottom-right-radius:.75rem;border-bottom-left-radius:.75rem;max-width:20rem;bottom:auto;top:50%;left:50%;transform:translateY(-50%) translate(-50%)}}`;const Re=C(de),It=Object.freeze(Object.defineProperty({__proto__:null,PinpadModal:Re,define:()=>{customElements.get("ptp-pinpad-modal")||customElements.define("ptp-pinpad-modal",Re)}},Symbol.toStringTag,{value:"Module"}));function ue({resettable:t,disabled:e,open:n=!0}){const o=E("Pressed"),r=E("Confirm"),s=E("Delete");return u("host",{shadowDom:!0,children:u("div",{class:N("grid-animation",n?"open":"close"),children:u("div",{style:"overflow-y: hidden;",children:u("div",{class:"container",children:u(F,{resettable:t,disabled:e,hideHelpText:!0,onPressed:i=>o({value:i.detail.value}),onConfirm:r,onDelete:s})})})})})}ue.props={open:Boolean,resettable:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}},ue.styles=T`:host{display:block;--margin-top: .5rem}*,*:before,*:after{box-sizing:border-box}.grid-animation{display:grid;transition-property:grid-template-rows;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.grid-animation.open{grid-template-rows:1fr}.grid-animation.close{grid-template-rows:0fr}.container{background-color:#fff;padding:.5rem;border-radius:.75rem;border:1px;border-style:solid;border-color:#0000000d;margin-top:var(--margin-top)}`;const fe=C(ue),Fe=Object.freeze(Object.defineProperty({__proto__:null,PinpadStatic:fe,define:()=>{customElements.get("ptp-pinpad-static")||customElements.define("ptp-pinpad-static",fe)}},Symbol.toStringTag,{value:"Module"}));function pe({resettable:t,disabled:e,open:n=!1}){const o=A(),r=k(!1),[s,i]=v(!1),f=E("Pressed"),d=E("Confirm"),c=E("Delete"),l=E("Close"),p=_e(m=>{if(!o.current)return;if(m.target!==o.current&&!m.composedPath().includes(o.current)&&r.current){l(),r.current=!1;return}r.current=!0},[o,s]),a=()=>{d(),r.current=!1};return w(()=>{n&&i(!0)},[n]),w(()=>{if(n)return document.addEventListener("click",p),()=>{document.removeEventListener("click",p)}},[n,p]),u("host",{shadowDom:!0,style:{display:s?"block":"none"},children:u(H,{open:n,from:{opacity:0},to:{opacity:1},onLeave:()=>{i(!1)},children:u("div",{class:"container",children:u(fe,{open:!0,resettable:t,disabled:e,onPressed:m=>f({value:m.detail.value}),onConfirm:a,onDelete:c})})})})}pe.props={open:Boolean,resettable:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}},pe.styles=T`:host{display:block;position:relative}*,*:before,*:after{box-sizing:border-box}.container{position:absolute;width:15rem;z-index:50}`;const Ue=C(pe),zt=Object.freeze(Object.defineProperty({__proto__:null,PinpadFloat:Ue,define:()=>{customElements.get("ptp-pinpad-float")||customElements.define("ptp-pinpad-float",Ue)}},Symbol.toStringTag,{value:"Module"})),He={es:{input:{placeholder:"Ingresa el Pin"},panel:{modal:{title:"Ingresa tu Pin",close:"Cerrar"},number:{buttons:{confirm:"Confirmar",delete:"Borrar"}}}},en:{input:{placeholder:"Enter the Pin"},panel:{modal:{title:"Enter your Pin",close:"Close"},number:{buttons:{confirm:"Confirm",delete:"Delete"}}}},pt:{input:{placeholder:"Insira o Pin"},panel:{modal:{title:"Insira seu Pin",close:"Fechar"},number:{buttons:{confirm:"Confirmar",delete:"Apagar"}}}},it:{input:{placeholder:"Inserisci il Pin"},panel:{modal:{title:"Inserisci il tuo Pin",close:"Chiudi"},number:{buttons:{confirm:"Conferma",delete:"Cancella"}}}}},Bt=t=>e=>{const n=He[t.slice(0,2)]??He.en,o=e.split(".");let r=n[o[0]];return r===void 0?e:(o.slice(1).forEach(s=>{if(r[s]===void 0)return r=e;r=r[s]}),r)};function me({locale:t="es",positions:e,length:n,mask:o,theming:r={}}){return V(ne,{locale:t,trans:Bt(t)}),V($e,{positions:e.split(",").map(Number),length:n,mask:o,theming:r}),u("host",{shadowDom:!0,children:u("slot",{})})}me.props={locale:String,positions:String,length:Number,mask:String,theming:Object},me.styles=T`:host{display:block}`;const Ye=C(me),Rt=Object.freeze(Object.defineProperty({__proto__:null,App:Ye,define:()=>{customElements.get("ptp-pinpad-context")||customElements.define("ptp-pinpad-context",Ye)}},Symbol.toStringTag,{value:"Module"})),Ke=(t,e)=>e?`${t}: ${e};`:!1,Je="pin";function he({pin:t="",mode:e}){const n=k(),o=k(),[r]=ze(o),[s,i]=v(t);Dt(Je,s),$t("reset",()=>i(""));const{length:f,theming:d}=re(),c=oe(),l=b=>{i(h=>h.length>=f?h:h+b.detail.value)},p=_e(b=>{e!=="modal"&&s.length<f||(e==="modal"&&b.detail.pin.length===f&&i(b.detail.pin),y())},[r,s,f,e]),a=()=>{i(b=>b.slice(0,-1))},m=()=>{r.setAttribute("open",!0)},y=()=>{r.setAttribute("open",!1)};return w(()=>{if(r&&e!=="modal")return r.addEventListener("Pressed",l),r.addEventListener("Delete",a),()=>{r.removeEventListener("Pressed",l),r.removeEventListener("Delete",a)}},[r,e]),w(()=>{if(r&&!(e!=="modal"&&e!=="float"))return r.addEventListener("Close",y),()=>{r.removeEventListener("Close",y)}},[r,e]),w(()=>{if(r)return r.addEventListener("Confirm",p),()=>{r.removeEventListener("Confirm",p)}},[r,p]),w(()=>{!r||e==="modal"||(r.setAttribute("disabled",s.length===f),r.setAttribute("resettable",!!s.length))},[s,e,r]),Ie(n,["Space"],b=>{b.type==="keyup"&&m()}),u("host",{shadowDom:!0,style:N(Ke("--input-border-color-focus",d?.inputBorderColorFocus),Ke("--input-border-color-focus-shadow",d?.inputOutlineColorFocus)),children:S("div",{class:"container",children:[u("div",{class:"input-container",onclick:m,children:u("input",{ref:n,id:"pin",name:Je,type:"password",value:s,maxLength:f,minLength:f,class:N("input",e),readOnly:!0,placeholder:c("input.placeholder")})}),u("slot",{ref:o})]})})}he.props={pin:String,mode:String},he.styles=T`:host{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";display:block;--input-border-color-focus: rgba(17, 24, 39, 1);--input-border-color-focus-shadow: rgba(209, 213, 219, 1)}*,*:before,*:after{box-sizing:border-box}.container{max-width:300px}.input-container{cursor:text}.input{width:100%;padding:.5rem .75rem;border-radius:8px;border:1px rgba(209,213,219,1) solid;font-size:1rem;line-height:1.5rem;font-weight:400;background-color:#fff}.input:focus,.input:focus-visible,.input:focus-within{outline:none;border-color:var(--input-border-color-focus);box-shadow:0 0 0 3px var(--input-border-color-focus-shadow)}.input:invalid{border-color:#ef4444;box-shadow:0 0 0 3px #ffd4d4}.input:disabled{color:#f9fafb;background-color:#d1d5db}.input.static{pointer-events:none}`;const qe=C(he),Ft=Object.freeze(Object.defineProperty({__proto__:null,Pinpad:qe,define:()=>{customElements.get("ptp-pinpad")||customElements.define("ptp-pinpad",qe)}},Symbol.toStringTag,{value:"Module"}));_.PinPad=Qe,_.PinPadClient=Xe,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
{
"name": "@placetopay/pinpad-sdk",
"version": "2.0.3",
"version": "2.0.4",
"description": "This API provides a PinPad Javascrypt SDK to conect with PinPad service of Placetopay.",

@@ -5,0 +5,0 @@ "type": "module",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc