@signosoft/signpad-js 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1281,7 +1281,7 @@ var XI = (() => {
1281
1281
  typeof __filename < "u" ? Q = __filename : D && (Q = self.location.href);
1282
1282
  var s = "", t, J;
1283
1283
  if (S) {
1284
- var e = require("node:fs");
1284
+ var e = {};
1285
1285
  s = __dirname + "/", J = (B) => (B = z(B) ? new URL(B) : B, e.readFileSync(B)), t = async (B) => (B = z(B) ? new URL(B) : B, e.readFileSync(B, void 0)), process.argv.slice(2);
1286
1286
  } else if (E || D) {
1287
1287
  try {
@@ -1,4 +1,4 @@
1
- (function(d,L){typeof exports=="object"&&typeof module<"u"?L(exports,require("lit")):typeof define=="function"&&define.amd?define(["exports","lit"],L):(d=typeof globalThis<"u"?globalThis:d||self,L(d.SignosoftSignpad={},d.lit))})(this,(function(d,L){"use strict";const Sg=E=>(A,I)=>{I!==void 0?I.addInitializer(()=>{customElements.define(E,A)}):customElements.define(E,A)};const JA=globalThis,XA=JA.ShadowRoot&&(JA.ShadyCSS===void 0||JA.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,hI=Symbol(),GI=new WeakMap;let wg=class{constructor(A,I,g){if(this._$cssResult$=!0,g!==hI)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=A,this.t=I}get styleSheet(){let A=this.o;const I=this.t;if(XA&&A===void 0){const g=I!==void 0&&I.length===1;g&&(A=GI.get(I)),A===void 0&&((this.o=A=new CSSStyleSheet).replaceSync(this.cssText),g&&GI.set(I,A))}return A}toString(){return this.cssText}};const sg=E=>new wg(typeof E=="string"?E:E+"",void 0,hI),ag=(E,A)=>{if(XA)E.adoptedStyleSheets=A.map(I=>I instanceof CSSStyleSheet?I:I.styleSheet);else for(const I of A){const g=document.createElement("style"),Q=JA.litNonce;Q!==void 0&&g.setAttribute("nonce",Q),g.textContent=I.cssText,E.appendChild(g)}},yI=XA?E=>E:E=>E instanceof CSSStyleSheet?(A=>{let I="";for(const g of A.cssRules)I+=g.cssText;return sg(I)})(E):E;const{is:hg,defineProperty:Gg,getOwnPropertyDescriptor:yg,getOwnPropertyNames:tg,getOwnPropertySymbols:Kg,getPrototypeOf:Rg}=Object,FA=globalThis,tI=FA.trustedTypes,Ng=tI?tI.emptyScript:"",Mg=FA.reactiveElementPolyfillSupport,oA=(E,A)=>E,UA={toAttribute(E,A){switch(A){case Boolean:E=E?Ng:null;break;case Object:case Array:E=E==null?E:JSON.stringify(E)}return E},fromAttribute(E,A){let I=E;switch(A){case Boolean:I=E!==null;break;case Number:I=E===null?null:Number(E);break;case Object:case Array:try{I=JSON.parse(E)}catch{I=null}}return I}},VA=(E,A)=>!hg(E,A),KI={attribute:!0,type:String,converter:UA,reflect:!1,useDefault:!1,hasChanged:VA};Symbol.metadata??=Symbol("metadata"),FA.litPropertyMetadata??=new WeakMap;class DA extends HTMLElement{static addInitializer(A){this._$Ei(),(this.l??=[]).push(A)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(A,I=KI){if(I.state&&(I.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(A)&&((I=Object.create(I)).wrapped=!0),this.elementProperties.set(A,I),!I.noAccessor){const g=Symbol(),Q=this.getPropertyDescriptor(A,g,I);Q!==void 0&&Gg(this.prototype,A,Q)}}static getPropertyDescriptor(A,I,g){const{get:Q,set:D}=yg(this.prototype,A)??{get(){return this[I]},set(S){this[I]=S}};return{get:Q,set(S){const s=Q?.call(this);D?.call(this,S),this.requestUpdate(A,s,g)},configurable:!0,enumerable:!0}}static getPropertyOptions(A){return this.elementProperties.get(A)??KI}static _$Ei(){if(this.hasOwnProperty(oA("elementProperties")))return;const A=Rg(this);A.finalize(),A.l!==void 0&&(this.l=[...A.l]),this.elementProperties=new Map(A.elementProperties)}static finalize(){if(this.hasOwnProperty(oA("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(oA("properties"))){const I=this.properties,g=[...tg(I),...Kg(I)];for(const Q of g)this.createProperty(Q,I[Q])}const A=this[Symbol.metadata];if(A!==null){const I=litPropertyMetadata.get(A);if(I!==void 0)for(const[g,Q]of I)this.elementProperties.set(g,Q)}this._$Eh=new Map;for(const[I,g]of this.elementProperties){const Q=this._$Eu(I,g);Q!==void 0&&this._$Eh.set(Q,I)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(A){const I=[];if(Array.isArray(A)){const g=new Set(A.flat(1/0).reverse());for(const Q of g)I.unshift(yI(Q))}else A!==void 0&&I.push(yI(A));return I}static _$Eu(A,I){const g=I.attribute;return g===!1?void 0:typeof g=="string"?g:typeof A=="string"?A.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(A=>this.enableUpdating=A),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(A=>A(this))}addController(A){(this._$EO??=new Set).add(A),this.renderRoot!==void 0&&this.isConnected&&A.hostConnected?.()}removeController(A){this._$EO?.delete(A)}_$E_(){const A=new Map,I=this.constructor.elementProperties;for(const g of I.keys())this.hasOwnProperty(g)&&(A.set(g,this[g]),delete this[g]);A.size>0&&(this._$Ep=A)}createRenderRoot(){const A=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ag(A,this.constructor.elementStyles),A}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(A=>A.hostConnected?.())}enableUpdating(A){}disconnectedCallback(){this._$EO?.forEach(A=>A.hostDisconnected?.())}attributeChangedCallback(A,I,g){this._$AK(A,g)}_$ET(A,I){const g=this.constructor.elementProperties.get(A),Q=this.constructor._$Eu(A,g);if(Q!==void 0&&g.reflect===!0){const D=(g.converter?.toAttribute!==void 0?g.converter:UA).toAttribute(I,g.type);this._$Em=A,D==null?this.removeAttribute(Q):this.setAttribute(Q,D),this._$Em=null}}_$AK(A,I){const g=this.constructor,Q=g._$Eh.get(A);if(Q!==void 0&&this._$Em!==Q){const D=g.getPropertyOptions(Q),S=typeof D.converter=="function"?{fromAttribute:D.converter}:D.converter?.fromAttribute!==void 0?D.converter:UA;this._$Em=Q;const s=S.fromAttribute(I,D.type);this[Q]=s??this._$Ej?.get(Q)??s,this._$Em=null}}requestUpdate(A,I,g,Q=!1,D){if(A!==void 0){const S=this.constructor;if(Q===!1&&(D=this[A]),g??=S.getPropertyOptions(A),!((g.hasChanged??VA)(D,I)||g.useDefault&&g.reflect&&D===this._$Ej?.get(A)&&!this.hasAttribute(S._$Eu(A,g))))return;this.C(A,I,g)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(A,I,{useDefault:g,reflect:Q,wrapped:D},S){g&&!(this._$Ej??=new Map).has(A)&&(this._$Ej.set(A,S??I??this[A]),D!==!0||S!==void 0)||(this._$AL.has(A)||(this.hasUpdated||g||(I=void 0),this._$AL.set(A,I)),Q===!0&&this._$Em!==A&&(this._$Eq??=new Set).add(A))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(I){Promise.reject(I)}const A=this.scheduleUpdate();return A!=null&&await A,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[Q,D]of this._$Ep)this[Q]=D;this._$Ep=void 0}const g=this.constructor.elementProperties;if(g.size>0)for(const[Q,D]of g){const{wrapped:S}=D,s=this[Q];S!==!0||this._$AL.has(Q)||s===void 0||this.C(Q,void 0,D,s)}}let A=!1;const I=this._$AL;try{A=this.shouldUpdate(I),A?(this.willUpdate(I),this._$EO?.forEach(g=>g.hostUpdate?.()),this.update(I)):this._$EM()}catch(g){throw A=!1,this._$EM(),g}A&&this._$AE(I)}willUpdate(A){}_$AE(A){this._$EO?.forEach(I=>I.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(A)),this.updated(A)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(A){return!0}update(A){this._$Eq&&=this._$Eq.forEach(I=>this._$ET(I,this[I])),this._$EM()}updated(A){}firstUpdated(A){}}DA.elementStyles=[],DA.shadowRootOptions={mode:"open"},DA[oA("elementProperties")]=new Map,DA[oA("finalized")]=new Map,Mg?.({ReactiveElement:DA}),(FA.reactiveElementVersions??=[]).push("2.1.2");const Jg={attribute:!0,type:String,converter:UA,reflect:!1,hasChanged:VA},Fg=(E=Jg,A,I)=>{const{kind:g,metadata:Q}=I;let D=globalThis.litPropertyMetadata.get(Q);if(D===void 0&&globalThis.litPropertyMetadata.set(Q,D=new Map),g==="setter"&&((E=Object.create(E)).wrapped=!0),D.set(I.name,E),g==="accessor"){const{name:S}=I;return{set(s){const t=A.get.call(this);A.set.call(this,s),this.requestUpdate(S,t,E,!0,s)},init(s){return s!==void 0&&this.C(S,void 0,E,s),s}}}if(g==="setter"){const{name:S}=I;return function(s){const t=this[S];A.call(this,s),this.requestUpdate(S,t,E,!0,s)}}throw Error("Unsupported decorator location: "+g)};function Ug(E){return(A,I)=>typeof I=="object"?Fg(E,A,I):((g,Q,D)=>{const S=Q.hasOwnProperty(D);return Q.constructor.createProperty(D,g),S?Object.getOwnPropertyDescriptor(Q,D):void 0})(E,A,I)}const kg=(E,A,I)=>(I.configurable=!0,I.enumerable=!0,Reflect.decorate&&typeof A!="object"&&Object.defineProperty(E,A,I),I);function cg(E,A){return(I,g,Q)=>{const D=S=>S.renderRoot?.querySelector(E)??null;return kg(I,g,{get(){return D(this)}})}}var y=(E=>(E.INITIAL="initial",E.DISCONNECTED="disconnected",E.CONNECTING="connecting",E.WAITING_FOR_DEVICE_SELECTION="waiting_for_device_selection",E.CONNECTED_PHYSICAL="connected_physical",E.CONNECTED_MOUSE_FALLBACK="connected_mouse_fallback",E.SIGNING_ACTIVE="signing_active",E.PROCESSING_OK="processing_ok",E.PROCESSING_CLEAR="processing_clear",E.PROCESSING_CANCEL="processing_cancel",E.DISCONNECTING="disconnecting",E.ERROR="error",E))(y||{}),Y=(E=>(E.SIGN_PEN="sign-pen",E.SIGN_OK="sign-ok",E.SIGN_CLEAR="sign-clear",E.SIGN_CANCEL="sign-cancel",E.SIGN_ERROR="sign-error",E.SIGN_CONNECT="sign-connect",E.SIGN_DISCONNECT="sign-disconnect",E.SIGN_CONNECTING="sign-connecting",E))(Y||{}),RI=(E=>(E.OK="OK",E.CLEAR="CLEAR",E.CANCEL="CANCEL",E.CLEAR_SIGNATURE="CLEAR_SIGNATURE",E.DISCONNECT="DISCONNECT",E.CONNECT_SIGNPAD="CONNECT_SIGNPAD",E))(RI||{}),F=(E=>(E.AUTO_CONNECTING="AUTO_CONNECTING",E.CONNECTING_TO_DEVICE="CONNECTING_TO_DEVICE",E.REVERTING_TO_DEFAULT="REVERTING_TO_DEFAULT",E.DISCONNECTING_DEVICE="DISCONNECTING_DEVICE",E.COMPONENT_INITIALIZED="COMPONENT_INITIALIZED",E.TEXT_START_SIGNING="TEXT_START_SIGNING",E.TEXT_SIGN_WITH_PHYSICAL="TEXT_SIGN_WITH_PHYSICAL",E.TEXT_SIGN_WITH_MOUSE="TEXT_SIGN_WITH_MOUSE",E.TEXT_SIGN_GENERIC="TEXT_SIGN_GENERIC",E.TEXT_SIGNING_WITH_DEVICE="TEXT_SIGNING_WITH_DEVICE",E.NO_DEVICE_FOUND="NO_DEVICE_FOUND",E.CONNECTION_ERROR="CONNECTION_ERROR",E.ERROR_DISCONNECTION="ERROR_DISCONNECTION",E.ERROR_INSTANTIATING_DRIVER="ERROR_INSTANTIATING_DRIVER",E.SIGNPAD_DISCONNECTED="SIGNPAD_DISCONNECTED",E.INVALID_LICENSE_KEY="INVALID_LICENSE_KEY",E.READY_TO_CONNECT="READY_TO_CONNECT",E.SIGNPAD_DETECTED="SIGNPAD_DETECTED",E.READY_TO_SIGN_MOUSE="READY_TO_SIGN_MOUSE",E.READY_TO_SIGN_PHYSICAL="READY_TO_SIGN_PHYSICAL",E))(F||{}),m=(E=>(E.MOUSE="MOUSE",E.CONNECTED_UNKNOWN="CONNECTED_UNKNOWN_DEVICE",E))(m||{});class Lg{constructor(A){this.component=A}async handleClear(){await this.executeAction(y.PROCESSING_CLEAR,async()=>{await this.component.connectionManager.clearSignature(),await this.component.config.actionHandlers?.handleClear?.(),this.component.dispatch(Y.SIGN_CLEAR)})}async handleOk(){return await this.executeAction(y.PROCESSING_OK,async()=>{const A=await this.component.connectionManager.stopSigning();return await this.component.config.actionHandlers?.handleOk?.(A),this.component.dispatch(Y.SIGN_OK,A),A})}async handleCancel(){await this.executeAction(y.PROCESSING_CANCEL,async()=>{await this.component.connectionManager.stopSigning(),await this.component.config.actionHandlers?.handleCancel?.(),this.component.dispatch(Y.SIGN_CANCEL)})}async startSigning(A){const I=this.component.connectionManager,g=this.component.canvasRef;if(!I.hasSignatureLayer()||!g){this.handleStartSigningError();return}this.component.stateManager.transitionTo(y.CONNECTING,"Preparing session...");try{this.component.resetDrawingState(),await I.startSigning(g,A);const Q=await this.getReadyState(),D=Q===y.CONNECTED_MOUSE_FALLBACK?"READY_TO_SIGN_MOUSE":"READY_TO_SIGN_PHYSICAL";this.component.stateManager.transitionTo(Q,D)}catch(Q){this.handleError("Error starting signing session",Q)}}async stopSigning(){return this.component.connectionManager.stopSigning()}async executeAction(A,I){this.component.stateManager.transitionTo(A,"Processing...");try{const g=await I();this.component.resetDrawingState();const Q=await this.getReadyState();return this.component.stateManager.transitionTo(Q),g}catch(g){throw this.handleError("Error during action processing",g),g}}async getReadyState(){const A=this.component.connectionManager.isDeviceConnected(),I=await this.component.connectionManager.getDeviceInfo();return this.component.connectionManager.isFallback(I,A,!0)?y.CONNECTED_MOUSE_FALLBACK:y.CONNECTED_PHYSICAL}handleStartSigningError(){this.component.currentState===y.CONNECTED_MOUSE_FALLBACK&&(this.component.resetDrawingState(),this.component.mouseManager?.addListeners(),this.component.stateManager.transitionTo(y.CONNECTED_MOUSE_FALLBACK))}handleError(A,I){console.error(`Signosoft Signpad: ${A}`,I),this.component.stateManager.transitionTo(y.ERROR,A,I)}}class eg{constructor(A,I={minWidth:2,maxWidth:4,color:"#000000"}){this.canvas=A;const g=A.getContext("2d");if(!g)throw new Error("Could not get 2D rendering context for canvas.");this.ctx=g,this.currentDrawingOptions=I,this.configureCanvasForDPI(),this.applyDrawingStyles(this.currentDrawingOptions)}get drawingOptions(){return{...this.currentDrawingOptions}}updateDrawingOptions(A){this.currentDrawingOptions=A,this.applyDrawingStyles(this.currentDrawingOptions)}drawSegment(A){}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)}configureCanvasForDPI(){const A=window.devicePixelRatio||1,I=this.canvas.getBoundingClientRect(),g=I.width||this.canvas.clientWidth||0,Q=I.height||this.canvas.clientHeight||0;if(g<=0||Q<=0)return;const D=Math.round(g*A),S=Math.round(Q*A);this.canvas.width===D&&this.canvas.height===S||(this.canvas.width=D,this.canvas.height=S,this.applyDrawingStyles(this.currentDrawingOptions))}applyDrawingStyles(A){this.ctx.strokeStyle=A.color??"#000000",this.ctx.fillStyle=A.color??"#000000",this.ctx.lineCap="round",this.ctx.lineJoin="round",this.ctx.globalCompositeOperation="source-over"}}const qA=class qA{constructor(A){this.sigLayer=null,this.debugCallbackRegistrationCount=0,this.cachedDeviceInfo=null,this.lastPenDispatchTime=0,this.penDataToDispatch=null,this.throttleDelayMs=16,this.component=A}async connect(A=!1,I=!1){this.component.stateManager.transitionTo(y.CONNECTING,A?F.AUTO_CONNECTING:F.CONNECTING_TO_DEVICE);try{const g=await this.runDriverConnectAttempt(A),Q=this.resolveConnectionTarget(g,I);return Q?(await this.prepareSigningSession(),this.component.stateManager.transitionTo(Q.targetState,Q.statusMessageKey),this.component.dispatch(Y.SIGN_CONNECT,{deviceInfo:g.deviceInfo}),!0):(this.component.stateManager.transitionTo(y.DISCONNECTED,F.NO_DEVICE_FOUND),!1)}catch(g){return console.error("Signosoft Signpad: Error in connect method:",g),this.component.stateManager.transitionTo(y.ERROR,F.CONNECTION_ERROR,g),!1}}async disconnect(){this.component.stateManager.transitionTo(y.DISCONNECTING,F.DISCONNECTING_DEVICE);try{if(!this.sigLayer)return;if(!this.sigLayer.isConnected()){this.sigLayer=null,this.cachedDeviceInfo=null;return}await this.sigLayer.disconnect(),this.sigLayer=null,this.cachedDeviceInfo=null}catch(A){console.error("Signosoft Signpad: Error during disconnect",A),this.component.stateManager.transitionTo(y.ERROR,F.ERROR_DISCONNECTION,A)}}hasSignatureLayer(){return this.sigLayer!==null}async getDeviceInfo(){if(this.cachedDeviceInfo)return this.cachedDeviceInfo;const A=this.normalizeDeviceInfo(await this.sigLayer?.getDeviceInfo());return this.cachedDeviceInfo=A??null,A}isDeviceConnected(){return this.sigLayer?.isConnected()??!1}isSigningActive(){return this.sigLayer?.isInSigningMode?.()??!1}async startSigning(A,I){if(!this.sigLayer)return!1;const g=I??this.component.configManager.getDrawingOptions();return this.sigLayer.isInSigningMode?.()&&await this.sigLayer.stopSigning(),await this.sigLayer.startSigning(A,!0,g),!0}async stopSigning(){try{if(this.sigLayer)return await this.sigLayer.stopSigning()}catch(A){console.warn("Signosoft Signpad: SigLayer stop failed, continuing cleanup",A)}finally{this.component.mouseManager?.removeListeners(),this.component.resetDrawingState(),console.log("[ConnectionManager] Signing stopped and mouse listeners removed.")}}async clearSignature(){this.sigLayer?.isInSigningMode?.()&&await this.sigLayer.clearSignature()}async ensureSignatureLayer(){if(!this.sigLayer)try{this.sigLayer=new SignatureLayer,this.setupCallbacks()}catch(A){throw console.error("Signosoft Signpad: Error instantiating driver",A),this.component.stateManager.transitionTo(y.ERROR,F.ERROR_INSTANTIATING_DRIVER,A),A}}setupCallbacks(){this.sigLayer&&(this.debugCallbackRegistrationCount+=1,console.log(`[Signpad Debug] SignatureLayer callbacks registered (${this.debugCallbackRegistrationCount})`),this.sigLayer.onOK(()=>this.component.buttonManager.handleOk()),this.sigLayer.onClear(()=>this.component.buttonManager.handleClear()),this.sigLayer.onCancel(()=>this.component.buttonManager.handleCancel()),this.sigLayer.onPen(A=>{A.inContact&&!this.component.hasStartedDrawing&&this.component.stateManager.setDrawingStarted(!0),this.runThrottledPenDispatch(A)}),this.sigLayer.onUnexpectedDisconnect(()=>{const A=this.component.currentState;A!==y.DISCONNECTING&&A!==y.INITIAL&&A!==y.DISCONNECTED&&A!==y.ERROR&&this.component.recoverToMouseFallback(F.REVERTING_TO_DEFAULT,1e3)}))}runThrottledPenDispatch(A){if(this.component.stateManager.isBusy||this.component.stateManager.isError)return;this.penDataToDispatch=A;const I=performance.now();I-this.lastPenDispatchTime>this.throttleDelayMs&&(this.component.dispatch(Y.SIGN_PEN,this.penDataToDispatch),this.lastPenDispatchTime=I,this.penDataToDispatch=null)}async initWithLease(A){await this.ensureSignatureLayer(),this.sigLayer&&await this.sigLayer.initialize(A)}isFallback(A,I,g){const D=(A?.deviceName??A?.name??null)==="Pointer Input (Fallback Mode)",S=this.component.currentState===y.CONNECTED_MOUSE_FALLBACK,s=this.component.deviceStatusText===m.MOUSE;return D||S||s||g&&!I}normalizeDeviceInfo(A){return A?!A.deviceName&&A.name?{...A,deviceName:A.name}:A:null}async runDriverConnectAttempt(A){const I=await this.sigLayer?.connect(A),g=this.sigLayer?.isConnected()??!1,Q=!!(I&&g),D=Q?this.normalizeDeviceInfo(await this.sigLayer?.getDeviceInfo()):null;this.cachedDeviceInfo=D??null;const S=D?.deviceName??D?.name??null,s=Q&&S===qA.POINTER_FALLBACK_DEVICE_NAME;return{connected:Q,deviceInfo:D,isPointerFallback:s}}resolveConnectionTarget(A,I){if(A.connected&&!A.isPointerFallback){const g=A.deviceInfo?.deviceName??A.deviceInfo?.name??m.CONNECTED_UNKNOWN;return this.component.setDeviceStatusText(g),this.component.mouseManager?.areListenersAttached()&&this.component.mouseManager?.removeListeners(),{targetState:y.CONNECTED_PHYSICAL,statusMessageKey:F.TEXT_SIGN_WITH_PHYSICAL}}return A.connected&&A.isPointerFallback||!A.connected&&I?(this.component.setDeviceStatusText(m.MOUSE),{targetState:y.CONNECTED_MOUSE_FALLBACK,statusMessageKey:F.TEXT_SIGN_WITH_MOUSE}):null}async prepareSigningSession(){const A=this.component.canvasRef,I=this.component.configManager.getDrawingOptions();this.sigLayer?.isInSigningMode?.()&&await this.sigLayer.stopSigning(),await this.sigLayer?.startSigning(A,!0,I)}};qA.POINTER_FALLBACK_DEVICE_NAME="Pointer Input (Fallback Mode)";let zA=qA;class Yg{constructor(A){this.component=A}get deviceStatusKey(){return this.component.currentState===y.CONNECTED_MOUSE_FALLBACK?m.MOUSE:this.isConnected?this.component.deviceStatusText||m.CONNECTED_UNKNOWN:m.MOUSE}get statusMessageKey(){return this.component.statusMessage||""}get additionalTextKey(){const A=y,I=F,g=this.component.statusMessage;switch(this.component.currentState){case A.INITIAL:case A.ERROR:return I.TEXT_START_SIGNING;case A.DISCONNECTED:return g===I.READY_TO_CONNECT||g===I.SIGNPAD_DETECTED||g===I.COMPONENT_INITIALIZED?I.TEXT_START_SIGNING:I.TEXT_SIGN_GENERIC;case A.CONNECTED_PHYSICAL:return I.TEXT_SIGN_WITH_PHYSICAL;case A.CONNECTED_MOUSE_FALLBACK:return I.TEXT_SIGN_WITH_MOUSE;case A.SIGNING_ACTIVE:return I.TEXT_SIGNING_WITH_DEVICE;default:return I.TEXT_SIGN_GENERIC}}get isConnected(){const A=this.component.currentState;return A===y.CONNECTED_PHYSICAL||A===y.CONNECTED_MOUSE_FALLBACK||A===y.SIGNING_ACTIVE||A===y.PROCESSING_OK||A===y.PROCESSING_CLEAR||A===y.PROCESSING_CANCEL}get isPhysicalConnected(){const A=this.component.currentState;return A===y.CONNECTED_PHYSICAL||A===y.SIGNING_ACTIVE||A===y.PROCESSING_OK||A===y.PROCESSING_CLEAR||A===y.PROCESSING_CANCEL}get isBusy(){const A=this.component.currentState;return A===y.CONNECTING||A===y.WAITING_FOR_DEVICE_SELECTION||A===y.PROCESSING_OK||A===y.PROCESSING_CLEAR||A===y.PROCESSING_CANCEL||A===y.DISCONNECTING}get isError(){return this.component.currentState===y.ERROR}get actionButtonsDisabled(){return!this.isConnected||!this.component.hasStartedDrawing||this.isBusy}get connectButtonDisabled(){return this.isBusy||this.isPhysicalConnected}get disconnectButtonDisabled(){const A=this.component.currentState;return A===y.DISCONNECTED||A===y.INITIAL||this.isBusy}transitionTo(A,I="",g){const Q=this.component.currentState;Q===A&&this.component.statusMessage===I&&!g||(this.component.setCurrentState(A),this.component.setStatusMessage(I),this.handleSideEffects(A,Q),A===y.CONNECTING&&this.component.dispatch(Y.SIGN_CONNECTING),g&&this.component.dispatch(Y.SIGN_ERROR,g))}setDrawingStarted(A){this.component.hasStartedDrawing!==A&&this.component.setHasStartedDrawing(A)}handleSideEffects(A,I){const g=Q=>Q===y.INITIAL||Q===y.DISCONNECTED||Q===y.ERROR;g(A)?(this.component.setDeviceStatusText(m.MOUSE),this.component.setCanvasPointerInputEnabled(!0),g(I)||(this.component.resetDrawingState(),this.component.mouseManager?.removeListeners())):(A===y.CONNECTED_PHYSICAL||A===y.CONNECTED_MOUSE_FALLBACK)&&(A===y.CONNECTED_MOUSE_FALLBACK?I===y.PROCESSING_OK||I===y.PROCESSING_CANCEL?(this.component.mouseManager?.removeListeners(),this.component.setCanvasPointerInputEnabled(!1)):(this.component.mouseManager?.addListeners(),this.component.setCanvasPointerInputEnabled(!0)):(this.component.mouseManager?.removeListeners(),this.component.setCanvasPointerInputEnabled(!1)))}}class ng{constructor(A,I){this.isDrawing=!1,this.sequenceCounter=0,this.sessionStartTime=null,this.debugListenerRegistrationCount=0,this.listenersAttached=!1,this.canvas=A,this.onPenData=I,this.boundHandleMouseDown=this.handleMouseDown.bind(this),this.boundHandleMouseMove=this.handleMouseMove.bind(this),this.boundHandleMouseUp=this.handleMouseUp.bind(this),this.boundHandleMouseLeave=this.handleMouseLeave.bind(this)}get isCurrentlyDrawing(){return this.isDrawing}addListeners(){if(this.listenersAttached){console.log("[Signpad Debug] Mouse listeners already registered");return}this.listenersAttached=!0,this.debugListenerRegistrationCount+=1,console.log(`[Signpad Debug] Mouse listeners registered (${this.debugListenerRegistrationCount})`),this.canvas.addEventListener("mousedown",this.boundHandleMouseDown),this.canvas.addEventListener("mousemove",this.boundHandleMouseMove),this.canvas.addEventListener("mouseup",this.boundHandleMouseUp),this.canvas.addEventListener("mouseleave",this.boundHandleMouseLeave)}removeListeners(){if(!this.listenersAttached){console.log("[Signpad Debug] Mouse listeners already removed");return}this.listenersAttached=!1,console.log("[Signpad Debug] Mouse listeners removed"),this.canvas.removeEventListener("mousedown",this.boundHandleMouseDown),this.canvas.removeEventListener("mousemove",this.boundHandleMouseMove),this.canvas.removeEventListener("mouseup",this.boundHandleMouseUp),this.canvas.removeEventListener("mouseleave",this.boundHandleMouseLeave),this.isDrawing=!1,this.sequenceCounter=0}areListenersAttached(){return this.listenersAttached}resetSession(){this.isDrawing=!1,this.sequenceCounter=0,this.sessionStartTime=null}handleMouseDown(A){this.isDrawing=!0,this.sequenceCounter=0,this.sessionStartTime===null&&(this.sessionStartTime=Date.now()),this.processMouseEvent(A,!0)}handleMouseMove(A){this.isDrawing&&(this.sequenceCounter++,this.processMouseEvent(A,!0))}handleMouseUp(A){this.isDrawing&&(this.isDrawing=!1,this.processMouseEvent(A,!1),this.sequenceCounter=0)}handleMouseLeave(A){this.isDrawing&&(this.isDrawing=!1,this.processMouseEvent(A,!1),this.sequenceCounter=0)}processMouseEvent(A,I){const{x:g,y:Q}=this.getNormalizedCoordinates(A),D={relativeX:g,relativeY:Q,pressure:I?.5:0,inContact:I,timestamp:this.timestampToSeconds()};this.onPenData(D)}getNormalizedCoordinates(A){const I=this.canvas.getBoundingClientRect(),g=(A.clientX-I.left)/I.width,Q=(A.clientY-I.top)/I.height;return{x:g,y:Q}}timestampToSeconds(){this.sessionStartTime===null&&(this.sessionStartTime=Date.now());const I=(Date.now()-this.sessionStartTime)/1e3;return Number(I.toFixed(3))}}const kA={en:{OK:"OK",CLEAR:"Clear",CANCEL:"Cancel",CLEAR_SIGNATURE:"Clear signature",DISCONNECT:"Disconnect",CONNECT_SIGNPAD:"Connect Signpad",MOUSE:"Mouse",CONNECTED_UNKNOWN_DEVICE:"Connected (Unknown Device)",AUTO_CONNECTING:"Auto-connecting to device...",CONNECTING_TO_DEVICE:"Connecting to your device...",REVERTING_TO_DEFAULT:"Reverting to default input...",DISCONNECTING_DEVICE:"Disconnecting device...",COMPONENT_INITIALIZED:"Component initialized.",TEXT_START_SIGNING:"Connect your device.",TEXT_SIGN_WITH_PHYSICAL:"Please sign using the device pen.",TEXT_SIGN_WITH_MOUSE:"Please sign using your mouse.",TEXT_SIGN_GENERIC:"Sign in the area above using mouse or pen.",TEXT_SIGNING_WITH_DEVICE:"Signing with {device}",NO_DEVICE_FOUND:"No device found.",CONNECTION_ERROR:"Connection error.",ERROR_DISCONNECTION:"Error during disconnection.",ERROR_INSTANTIATING_DRIVER:"Error instantiating driver.",SIGNPAD_DISCONNECTED:"Signpad disconnected.",INVALID_LICENSE_KEY:"Invalid license key.",READY_TO_CONNECT:"Ready to connect.",SIGNPAD_DETECTED:"Signpad detected. Click 'Connect Signpad' to begin.",READY_TO_SIGN_MOUSE:"Ready to sign. Use your mouse.",READY_TO_SIGN_PHYSICAL:"Ready to sign. Use the device pen."},cs:{OK:"OK",CLEAR:"Smazat",CANCEL:"Zrušit",CLEAR_SIGNATURE:"Smazat podpis",DISCONNECT:"Odpojit",CONNECT_SIGNPAD:"Připojit Signpad",MOUSE:"Myš",CONNECTED_UNKNOWN_DEVICE:"Připojeno (neznámé zařízení)",AUTO_CONNECTING:"Automatické připojování k zařízení...",CONNECTING_TO_DEVICE:"Připojování k vašemu zařízení...",REVERTING_TO_DEFAULT:"Přepínání na výchozí vstup...",DISCONNECTING_DEVICE:"Odpojování zařízení...",COMPONENT_INITIALIZED:"Komponenta byla inicializována.",TEXT_START_SIGNING:"Připojte své zařízení.",TEXT_SIGN_WITH_PHYSICAL:"Podepište se perem zařízení.",TEXT_SIGN_WITH_MOUSE:"Podepište se pomocí myši.",TEXT_SIGN_GENERIC:"Podepište se v oblasti výše pomocí myši nebo pera.",TEXT_SIGNING_WITH_DEVICE:"Podepisování pomocí: {device}",NO_DEVICE_FOUND:"Zařízení nebylo nalezeno.",CONNECTION_ERROR:"Chyba připojení.",ERROR_DISCONNECTION:"Chyba při odpojování.",ERROR_INSTANTIATING_DRIVER:"Chyba při inicializaci ovladače.",SIGNPAD_DISCONNECTED:"Signpad byl odpojen.",INVALID_LICENSE_KEY:"Neplatný licenční klíč.",READY_TO_CONNECT:"Připraveno k připojení.",SIGNPAD_DETECTED:"Signpad byl nalezen. Klikněte na 'Připojit Signpad' pro spuštění.",READY_TO_SIGN_MOUSE:"Připraveno k podpisu. Použijte myš.",READY_TO_SIGN_PHYSICAL:"Připraveno k podpisu. Použijte pero zařízení."}};class Hg{constructor(A){this.translations=kA.en,this.currentLang="",this.currentPath=void 0,this.component=A}t(A,I={}){let g=this.translations[A]||A;for(const[Q,D]of Object.entries(I))g=g.replace(new RegExp(`{${Q}}`,"g"),D);return g}async loadLanguage(A,I,g){const Q=I?.trim();if(A===this.currentLang&&Q===this.currentPath)return;let D=this.getBaselineTranslations(A);const S=this.resolveInlineTranslations(A,g);if(S){this.translations={...D,...S},this.currentLang=A,this.currentPath=Q,this.component.requestUpdate();return}if(!Q){this.translations=D,this.currentLang=A,this.currentPath=Q,this.component.requestUpdate();return}const s=this.constructUrl(A,Q);try{const t=await fetch(s);if(t.ok){const M=await t.json();D={...D,...M},console.log(`signosoft-signpad: External translations loaded from ${s}`)}else I&&console.info(`signosoft-signpad: Custom path provided, but file not found at ${s}`)}catch(t){console.warn(`signosoft-signpad: Failed to load external translations from ${s}. Using built-in defaults.`,t)}this.translations=D,this.currentLang=A,this.currentPath=Q,this.component.requestUpdate()}getBaselineTranslations(A){const I=kA.en;return A!=="en"&&kA.hasOwnProperty(A)?{...I,...kA[A]}:{...I}}resolveInlineTranslations(A,I){return I?typeof Object.values(I)[0]=="string"?I:I[A]:void 0}constructUrl(A,I){const g=I.trim();let Q="";return g.endsWith(".json")?Q=g:Q=`${g.replace(/\/+$/,"")}/${A}.json`,Q}}class rg{constructor(A){this.configEventHandlers={},this.customEventListenerCache=new WeakMap,this.component=A}apply(A){const I=this.component.config;if(!I){this.clearConfigEventHandlers();return}this.applyLocalization(A,I),this.applyDrawingOptions(A,I),this.syncConfigEventHandlers(I)}getUiVisibilityOptions(){const A=this.component.config.uiVisibilityOptions;return{topBarVisible:A?.topBarVisible??!0,topBarClearButtonVisible:A?.topBarClearButtonVisible??!1,topBarConnectButtonVisible:A?.topBarConnectButtonVisible??!0,bottomBarVisible:A?.bottomBarVisible??!0,okButtonVisible:A?.okButtonVisible??!0,clearButtonVisible:A?.clearButtonVisible??!0,cancelButtonVisible:A?.cancelButtonVisible??!0,canvasLineVisible:A?.canvasLineVisible??!0,deviceStatusTextVisible:A?.deviceStatusTextVisible??!0,additionalTextVisible:A?.additionalTextVisible??!0}}getDrawingOptions(){const A=this.component.config.canvasAndDrawingOptions;return{minWidth:A?.minWidth??1,maxWidth:A?.maxWidth??3,color:A?.color??"#000000"}}applyLocalization(A,I){const g=A?.languageOptions,Q=I.languageOptions;(!A||g?.lang!==Q?.lang||g?.langPath!==Q?.langPath||g?.translations!==Q?.translations)&&this.component.localizationManager.loadLanguage(Q?.lang??"en",Q?.langPath,Q?.translations)}applyDrawingOptions(A,I){const g=A?.canvasAndDrawingOptions,Q=I.canvasAndDrawingOptions;this.component.canvasManager&&(!A||g?.minWidth!==Q?.minWidth||g?.maxWidth!==Q?.maxWidth||g?.color!==Q?.color)&&this.component.canvasManager.updateDrawingOptions(this.getDrawingOptions())}syncConfigEventHandlers(A){const I=S=>{if(!S)return;const s=this.customEventListenerCache.get(S);if(s)return s;const t=M=>{S(M)};return this.customEventListenerCache.set(S,t),t},g=A.eventCallbacks,Q={[Y.SIGN_CONNECT]:I(g?.onConnect),[Y.SIGN_CONNECTING]:I(g?.onConnecting),[Y.SIGN_DISCONNECT]:I(g?.onDisconnect),[Y.SIGN_PEN]:I(g?.onPen),[Y.SIGN_OK]:I(g?.onOk),[Y.SIGN_CLEAR]:I(g?.onClear),[Y.SIGN_CANCEL]:I(g?.onCancel),[Y.SIGN_ERROR]:I(g?.onError)},D=new Set([...Object.keys(this.configEventHandlers),...Object.keys(Q)]);for(const S of D){const s=this.configEventHandlers[S],t=Q[S];s&&s!==t&&this.component.removeEventListener(S,s),t&&s!==t&&this.component.addEventListener(S,t),t?this.configEventHandlers[S]=t:delete this.configEventHandlers[S]}}clearConfigEventHandlers(){for(const[A,I]of Object.entries(this.configEventHandlers))I&&this.component.removeEventListener(A,I);this.configEventHandlers={}}}const qg=":host{--primary-color-0: #4e56ea;--primary-color-10: #7178ee;--background-color-0: #f1f2fd;--background-color-10: #e3e4fc;--text-color-0: #333e4a;--white-color: #ffffff;--grey-color: #b5b9be;--min-height: 3rem;--spacing-constraints: 1rem 1.5rem;--sign-font-family: Arial, Helvetica, sans-serif;--sign-common-border-radius: .5rem;--sign-top-bar-bg-base: var(--background-color-10);--sign-top-bar-text-base: var(--primary-color-0);--sign-top-bar-padding: var(--spacing-constraints);--sign-top-bar-min-height: var(--min-height);--sign-top-bar-border-top-left-radius: var(--sign-common-border-radius);--sign-top-bar-border-top-right-radius: var(--sign-common-border-radius);--sign-top-bar-border-bottom-left-radius: 0;--sign-top-bar-border-bottom-right-radius: 0;--sign-canvas-bg-base: var(--background-color-0);--sign-canvas-wrapper-border-top-left-radius: 0;--sign-canvas-wrapper-border-top-right-radius: 0;--sign-canvas-wrapper-border-bottom-left-radius: 0;--sign-canvas-wrapper-border-bottom-right-radius: 0;--sign-line-height: 1.375rem;--sign-line-margin-bottom: 1rem;--sign-line-border-base: var(--primary-color-10);--sign-line-additional-text-color: var(--text-color-0);--sign-line-margin: 0rem 1.5rem var(--sign-line-margin-bottom) 1.5rem;--sign-canvas-line-text-font-size: .75rem;--sign-canvas-height-offset: var(--sign-line-height);--sign-bottom-bar-bg-base: var(--background-color-10);--sign-bottom-bar-padding: var(--spacing-constraints);--sign-bottom-bar-min-height: var(--min-height);--sign-bottom-bar-gap: .75rem;--sign-bottom-bar-border-top-left-radius: 0;--sign-bottom-bar-border-top-right-radius: 0;--sign-bottom-bar-border-bottom-left-radius: var(--sign-common-border-radius);--sign-bottom-bar-border-bottom-right-radius: var( --sign-common-border-radius );--sign-button-font-size: 1rem;--sign-button-padding: .875rem 1rem;--sign-button-min-height: var(--min-height);--sign-button-border-radius: var(--sign-common-border-radius);--sign-button-font-weight: 500;--sign-button-primary-bg-base: var(--primary-color-0);--sign-button-primary-bg-hover: var(--primary-color-10);--sign-button-primary-bg-disabled: var(--grey-color);--sign-button-primary-text-base: var(--white-color);--sign-button-primary-text-hover: var(--white-color);--sign-button-primary-text-disabled: var(--white-color);--sign-button-primary-border-base: .0625rem solid var(--primary-color-0);--sign-button-primary-border-hover: .0625rem solid var(--primary-color-10);--sign-button-primary-border-disabled: .0625rem solid var(--grey-color);--sign-button-link-bg-base: transparent;--sign-button-link-bg-hover: var(--background-color-10);--sign-button-link-bg-disabled: transparent;--sign-button-link-text-base: var(--primary-color-0);--sign-button-link-text-hover: var(--primary-color-10);--sign-button-link-text-disabled: var(--grey-color);--sign-button-link-border-base: .0625rem solid var(--primary-color-0);--sign-button-link-border-hover: .0625rem solid var(--primary-color-10);--sign-button-link-border-disabled: .0625rem solid var(--grey-color);--sign-device-state-text-color-connected: green;--sign-device-state-text-color-disconnected: red;--sign-loading-overlay-bg-color: rgba(255, 255, 255, .8);--sign-loading-overlay-text-color: var(--text-color-0);--sign-loading-overlay-spinner-color: var(--primary-color-0);--sign-loading-overlay-spinner-border-color: rgba(78, 86, 234, .1);--sign-loading-overlay-spinner-size: 1.875rem}html{font-family:var(--sign-font-family)!important}.signpad-canvas-container{display:flex;flex-direction:column;width:100%;height:100%}.signpad-top-bar{display:flex;justify-content:space-between;padding:var(--sign-top-bar-padding);min-height:var(--sign-top-bar-min-height);background-color:var(--sign-top-bar-bg-base);color:var(--sign-top-bar-text-base);align-items:center;border-top-left-radius:var(--sign-top-bar-border-top-left-radius);border-top-right-radius:var(--sign-top-bar-border-top-right-radius);border-bottom-left-radius:var(--sign-top-bar-border-bottom-left-radius);border-bottom-right-radius:var(--sign-top-bar-border-bottom-right-radius)}.signpad-top-left-actions,.signpad-top-right-actions{display:flex;gap:var(--sign-bottom-bar-gap)}.signpad-top-left-actions{justify-content:flex-start}.signpad-top-right-actions{justify-content:flex-end}.signpad-canvas-wrapper{position:relative;width:100%;padding-top:1rem;padding-bottom:56.25%;height:0;background-color:var(--sign-canvas-bg-base);box-sizing:border-box;overflow:hidden;border-top-left-radius:var(--sign-canvas-wrapper-border-top-left-radius);border-top-right-radius:var(--sign-canvas-wrapper-border-top-right-radius);border-bottom-left-radius:var( --sign-canvas-wrapper-border-bottom-left-radius );border-bottom-right-radius:var( --sign-canvas-wrapper-border-bottom-right-radius )}.signpad-canvas-container>.signpad-canvas-wrapper:first-child{--sign-canvas-wrapper-border-top-left-radius: var( --sign-common-border-radius );--sign-canvas-wrapper-border-top-right-radius: var( --sign-common-border-radius )}.signpad-canvas-container>.signpad-canvas-wrapper:last-child{--sign-canvas-wrapper-border-bottom-left-radius: var( --sign-common-border-radius );--sign-canvas-wrapper-border-bottom-right-radius: var( --sign-common-border-radius )}.signpad-canvas{position:absolute;width:100%;height:calc(100% - (var(--sign-canvas-height-offset) + var(--sign-line-margin-bottom)));left:0;top:0}.signpad-canvas-line-container{position:absolute;bottom:0;left:0;right:0;display:flex;justify-content:space-between;align-items:center;height:var(--sign-line-height);padding-top:0;border-top:.125rem solid var(--sign-line-border-base);box-sizing:border-box;padding-top:.375rem;margin:var(--sign-line-margin)}.signpad-canvas-line-additional-text,.signpad-canvas-line-state,.signpad-canvas-line-state.connected{font-family:var(--sign-font-family);font-size:var(--sign-canvas-line-text-font-size)}.signpad-canvas-line-additional-text{color:var(--sign-line-additional-text-color);margin:0}.signpad-canvas-line-state{color:var(--sign-device-state-text-color-disconnected);margin:0}.signpad-canvas-line-state.connected{color:var(--sign-device-state-text-color-connected)}.signpad-bottom-bar{display:flex;flex-direction:row;gap:var(--sign-bottom-bar-gap);padding:var(--sign-bottom-bar-padding);min-height:var(--sign-bottom-bar-min-height);background-color:var(--sign-bottom-bar-bg-base);border-top-left-radius:var(--sign-bottom-bar-border-top-left-radius);border-top-right-radius:var(--sign-bottom-bar-border-top-right-radius);border-bottom-left-radius:var(--sign-bottom-bar-border-bottom-left-radius);border-bottom-right-radius:var(--sign-bottom-bar-border-bottom-right-radius)}.btn{font-family:var(--sign-font-family);min-height:var(--sign-button-min-height);padding:var(--sign-button-padding);margin:0;font-weight:var(--sign-button-font-weight);width:100%;font-size:var(--sign-button-font-size);border-radius:var(--sign-button-border-radius);transition:background-color .3s ease,color .3s ease,transform .1s ease}.btn:hover:not(:disabled){cursor:pointer}.btn:focus:not(:disabled){outline:none}.btn-primary{background-color:var(--sign-button-primary-bg-base);color:var(--sign-button-primary-text-base);border:var(--sign-button-primary-border-base)}.btn-primary:hover:not(:disabled){background-color:var(--sign-button-primary-bg-hover);color:var(--sign-button-primary-text-hover);border:var(--sign-button-primary-border-hover)}.btn-primary:disabled{background-color:var(--sign-button-primary-bg-disabled);color:var(--sign-button-primary-text-disabled);border:var(--sign-button-primary-border-disabled)}.btn-link{background-color:var(--sign-button-link-bg-base);color:var(--sign-button-link-text-base);border:var(--sign-button-link-border-base)}.btn-link:hover:not(:disabled){background-color:var(--sign-button-link-bg-hover);color:var(--sign-button-link-text-hover);border:var(--sign-button-link-border-hover)}.btn-link:disabled{background-color:var(--sign-button-link-bg-disabled);color:var(--sign-button-link-text-disabled);border:var(--sign-button-link-border-disabled)}.signpad-loading-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--sign-loading-overlay-bg-color);display:flex;flex-direction:column;justify-content:center;align-items:center;z-index:10;text-align:center;gap:.625rem}.signpad-loading-overlay .spinner{border:.25rem solid var(--sign-loading-overlay-spinner-border-color);border-left-color:var(--sign-loading-overlay-spinner-color);border-radius:50%;width:var(--sign-loading-overlay-spinner-size);height:var(--sign-loading-overlay-spinner-size);animation:spin 1s linear infinite}.signpad-loading-overlay-text{font-family:var(--sign-font-family);color:var(--sign-loading-overlay-text-color);font-size:.875rem;margin:1rem 0 0}@keyframes spin{to{transform:rotate(360deg)}}";let NI=class{constructor(){this._device=null,this._isWasmInitialized=!1,this._module=null,this._disconnectHandler=null,this._eventCallbacks=new Map,this._callbackToHandle=new Map,this._masterCallback=null,this._penAspectCorrector=null,this._unexpectedDisconnectCallbacks=new Set}get device(){return this._device}get isWasmInitialized(){return this._isWasmInitialized}get Module(){return this._module}};typeof NI<"u"&&(window.TabletDriver=NI);var MI=(()=>{var E=globalThis.document?.currentScript?.src;return async function(A={}){var I,g=A,Q=!!globalThis.window,D=!!globalThis.WorkerGlobalScope,S=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";typeof __filename<"u"?E=__filename:D&&(E=self.location.href);var s="",t,M;if(S){var n=require("node:fs");s=__dirname+"/",M=B=>(B=_(B)?new URL(B):B,n.readFileSync(B)),t=async B=>(B=_(B)?new URL(B):B,n.readFileSync(B,void 0)),process.argv.slice(2)}else if(Q||D){try{s=new URL(".",E).href}catch{}D&&(M=B=>{var C=new XMLHttpRequest;return C.open("GET",B,!1),C.responseType="arraybuffer",C.send(null),new Uint8Array(C.response)}),t=async B=>{if(_(B))return new Promise((i,o)=>{var w=new XMLHttpRequest;w.open("GET",B,!0),w.responseType="arraybuffer",w.onload=()=>{w.status==200||w.status==0&&w.response?i(w.response):o(w.status)},w.onerror=o,w.send(null)});var C=await fetch(B,{credentials:"same-origin"});if(C.ok)return C.arrayBuffer();throw Error(C.status+" : "+C.url)}}console.log.bind(console);var f=console.error.bind(console),O,IA=!1,_=B=>B.startsWith("file://"),lA,dA,fA=!1;function OA(){var B=uA.buffer;hA=new Int8Array(B),aA=new Int16Array(B),g.HEAPU8=V=new Uint8Array(B),QA=new Uint16Array(B),BA=new Int32Array(B),r=new Uint32Array(B),qI=new Float32Array(B),lI=new Float64Array(B),II=new BigInt64Array(B),dI=new BigUint64Array(B)}function wA(B){throw g.onAbort?.(B),B=`Aborted(${B})`,f(B),IA=!0,B=new WebAssembly.RuntimeError(B+". Build with -sASSERTIONS for more info."),dA?.(B),B}var sA;async function rI(B){if(!O)try{var C=await t(B);return new Uint8Array(C)}catch{}if(B==sA&&O)B=new Uint8Array(O);else if(M)B=M(B);else throw"both async and sync fetching of the wasm failed";return B}async function AI(B,C){try{var i=await rI(B);return await WebAssembly.instantiate(i,C)}catch(o){f(`failed to asynchronously prepare wasm: ${o}`),wA(o)}}async function fg(B){var C=sA;if(!O&&!_(C)&&!S)try{var i=fetch(C,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(i,B)}catch(o){f(`wasm streaming compile failed: ${o}`),f("falling back to ArrayBuffer instantiation")}return AI(C,B)}var aA,BA,II,hA,qI,lI,QA,r,dI,V,fI=B=>{for(;0<B.length;)B.shift()(g)},OI=[],pI=[],Og=()=>{var B=g.preRun.shift();pI.push(B)};class pg{constructor(C){this.W=C-24}}var pA={},gI=B=>{for(;B.length;){var C=B.pop();B.pop()(C)}};function GA(B){return this.X(r[B>>2])}var EA={},gA={},TA={},xA=class extends Error{constructor(B){super(B),this.name="InternalError"}},yA=(B,C,i)=>{function o(G){if(G=i(G),G.length!==B.length)throw new xA("Mismatched type converter count");for(var R=0;R<B.length;++R)T(B[R],G[R])}B.forEach(G=>TA[G]=C);var w=Array(C.length),a=[],h=0;for(let[G,R]of C.entries())gA.hasOwnProperty(R)?w[G]=gA[R]:(a.push(R),EA.hasOwnProperty(R)||(EA[R]=[]),EA[R].push(()=>{w[G]=gA[R],++h,h===a.length&&o(w)}));a.length===0&&o(w)},q=B=>{for(var C="";;){var i=V[B++];if(!i)return C;C+=String.fromCharCode(i)}},J=class extends Error{constructor(B){super(B),this.name="BindingError"}},Tg=B=>{throw new J(B)};function xg(B,C,i={}){var o=C.name;if(!B)throw new J(`type "${o}" must have a positive integer typeid pointer`);if(gA.hasOwnProperty(B)){if(i.Ja)return;throw new J(`Cannot register type '${o}' twice`)}gA[B]=C,delete TA[B],EA.hasOwnProperty(B)&&(C=EA[B],delete EA[B],C.forEach(w=>w()))}function T(B,C,i={}){return xg(B,C,i)}var TI=(B,C,i)=>{switch(C){case 1:return i?o=>hA[o]:o=>V[o];case 2:return i?o=>aA[o>>1]:o=>QA[o>>1];case 4:return i?o=>BA[o>>2]:o=>r[o>>2];case 8:return i?o=>II[o>>3]:o=>dI[o>>3];default:throw new TypeError(`invalid integer width (${C}): ${B}`)}},CI=B=>{throw new J(B.V.Z.Y.name+" instance already deleted")},BI=!1,xI=()=>{},tA=B=>globalThis.FinalizationRegistry?(BI=new FinalizationRegistry(C=>{C=C.V,--C.count.value,C.count.value===0&&(C.da?C.ga.ha(C.da):C.Z.Y.ha(C.W))}),tA=C=>{var i=C.V;return i.da&&BI.register(C,{V:i},C),C},xI=C=>{BI.unregister(C)},tA(B)):(tA=C=>C,B);function jA(){}var bA=(B,C)=>Object.defineProperty(C,"name",{value:B}),jI={},bI=(B,C,i)=>{if(B[C].ba===void 0){var o=B[C];B[C]=function(...w){if(!B[C].ba.hasOwnProperty(w.length))throw new J(`Function '${i}' called with an invalid number of arguments (${w.length}) - expects one of (${B[C].ba})!`);return B[C].ba[w.length].apply(this,w)},B[C].ba=[],B[C].ba[o.ja]=o}},KA=(B,C,i)=>{if(g.hasOwnProperty(B)){if(i===void 0||g[B].ba!==void 0&&g[B].ba[i]!==void 0)throw new J(`Cannot register public name '${B}' twice`);if(bI(g,B,B),g[B].ba.hasOwnProperty(i))throw new J(`Cannot register multiple overloads of a function with the same number of arguments (${i})!`);g[B].ba[i]=C}else g[B]=C,g[B].ja=i},jg=B=>{B=B.replace(/[^a-zA-Z0-9_]/g,"$");var C=B.charCodeAt(0);return 48<=C&&57>=C?`_${B}`:B};function bg(B,C,i,o,w,a,h,G){this.name=B,this.constructor=C,this.ka=i,this.ha=o,this.ea=w,this.Ea=a,this.na=h,this.Ca=G,this.La=[]}var QI=(B,C,i)=>{for(;C!==i;){if(!C.na)throw new J(`Expected null or instance of ${i.name}, got an instance of ${C.name}`);B=C.na(B),C=C.ea}return B},EI=B=>{if(B===null)return"null";var C=typeof B;return C==="object"||C==="array"||C==="function"?B.toString():""+B};function mg(B,C){if(C===null){if(this.qa)throw new J(`null is not a valid ${this.name}`);return 0}if(!C.V)throw new J(`Cannot pass "${EI(C)}" as a ${this.name}`);if(!C.V.W)throw new J(`Cannot pass deleted object as a pointer of type ${this.name}`);return QI(C.V.W,C.V.Z.Y,this.Y)}function Wg(B,C){if(C===null){if(this.qa)throw new J(`null is not a valid ${this.name}`);if(this.pa){var i=this.sa();return B!==null&&B.push(this.ha,i),i}return 0}if(!C||!C.V)throw new J(`Cannot pass "${EI(C)}" as a ${this.name}`);if(!C.V.W)throw new J(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.oa&&C.V.Z.oa)throw new J(`Cannot convert argument of type ${C.V.ga?C.V.ga.name:C.V.Z.name} to parameter type ${this.name}`);if(i=QI(C.V.W,C.V.Z.Y,this.Y),this.pa){if(C.V.da===void 0)throw new J("Passing raw pointer to smart pointer is illegal");switch(this.Qa){case 0:if(C.V.ga===this)i=C.V.da;else throw new J(`Cannot convert argument of type ${C.V.ga?C.V.ga.name:C.V.Z.name} to parameter type ${this.name}`);break;case 1:i=C.V.da;break;case 2:if(C.V.ga===this)i=C.V.da;else{var o=C.clone();i=this.Ma(i,X(()=>o.delete())),B!==null&&B.push(this.ha,i)}break;default:throw new J("Unsupported sharing policy")}}return i}function Zg(B,C){if(C===null){if(this.qa)throw new J(`null is not a valid ${this.name}`);return 0}if(!C.V)throw new J(`Cannot pass "${EI(C)}" as a ${this.name}`);if(!C.V.W)throw new J(`Cannot pass deleted object as a pointer of type ${this.name}`);if(C.V.Z.oa)throw new J(`Cannot convert argument of type ${C.V.Z.name} to parameter type ${this.name}`);return QI(C.V.W,C.V.Z.Y,this.Y)}var mI=(B,C,i)=>C===i?B:i.ea===void 0?null:(B=mI(B,C,i.ea),B===null?null:i.Ca(B)),ug={},Pg=(B,C)=>{if(C===void 0)throw new J("ptr should not be undefined");for(;B.ea;)C=B.na(C),B=B.ea;return ug[C]},mA=(B,C)=>{if(!C.Z||!C.W)throw new xA("makeClassHandle requires ptr and ptrType");if(!!C.ga!=!!C.da)throw new xA("Both smartPtrType and smartPtr must be specified");return C.count={value:1},tA(Object.create(B,{V:{value:C,writable:!0}}))};function WA(B,C,i,o,w,a,h,G,R,N,K){this.name=B,this.Y=C,this.qa=i,this.oa=o,this.pa=w,this.Ka=a,this.Qa=h,this.ya=G,this.sa=R,this.Ma=N,this.ha=K,w||C.ea!==void 0?this.$=Wg:(this.$=o?mg:Zg,this.aa=null)}var WI=(B,C,i)=>{if(!g.hasOwnProperty(B))throw new xA("Replacing nonexistent public symbol");g[B].ba!==void 0&&i!==void 0?g[B].ba[i]=C:(g[B]=C,g[B].ja=i)},ZI=[],u=(B,C)=>{B=q(B);var i;if((i=ZI[C])||(ZI[C]=i=Eg.get(C)),typeof i!="function")throw new J(`unknown function pointer with signature ${B}: ${C}`);return i};class Xg extends Error{}var uI=B=>{B=Cg(B);var C=q(B);return $(B),C},iI=(B,C)=>{function i(a){w[a]||gA[a]||(TA[a]?TA[a].forEach(i):(o.push(a),w[a]=!0))}var o=[],w={};throw C.forEach(i),new Xg(`${B}: `+o.map(uI).join([", "]))};function PI(B){for(var C=1;C<B.length;++C)if(B[C]!==null&&B[C].aa===void 0)return!0;return!1}function XI(B,C,i,o,w,a){var h=C.length;if(2>h)throw new J("argTypes array size mismatch! Must at least get return value and 'this' types!");var G=C[1]!==null&&i!==null,R=PI(C);i=!C[0].xa;var N=C[0],K=C[1];for(o=[B,Tg,o,w,gI,N.X.bind(N),K?.$.bind(K)],w=2;w<h;++w)N=C[w],o.push(N.$.bind(N));if(!R)for(w=G?1:2;w<C.length;++w)C[w].aa!==null&&o.push(C[w].aa);for(R=PI(C),w=C.length-2,K=[],N=["fn"],G&&N.push("thisWired"),h=0;h<w;++h)K.push(`arg${h}`),N.push(`arg${h}Wired`);K=K.join(","),N=N.join(","),K=`return function (${K}) {
1
+ (function(d,L){typeof exports=="object"&&typeof module<"u"?L(exports,require("lit")):typeof define=="function"&&define.amd?define(["exports","lit"],L):(d=typeof globalThis<"u"?globalThis:d||self,L(d.SignosoftSignpad={},d.lit))})(this,(function(d,L){"use strict";const Sg=E=>(A,I)=>{I!==void 0?I.addInitializer(()=>{customElements.define(E,A)}):customElements.define(E,A)};const JA=globalThis,XA=JA.ShadowRoot&&(JA.ShadyCSS===void 0||JA.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,hI=Symbol(),GI=new WeakMap;let wg=class{constructor(A,I,g){if(this._$cssResult$=!0,g!==hI)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=A,this.t=I}get styleSheet(){let A=this.o;const I=this.t;if(XA&&A===void 0){const g=I!==void 0&&I.length===1;g&&(A=GI.get(I)),A===void 0&&((this.o=A=new CSSStyleSheet).replaceSync(this.cssText),g&&GI.set(I,A))}return A}toString(){return this.cssText}};const sg=E=>new wg(typeof E=="string"?E:E+"",void 0,hI),ag=(E,A)=>{if(XA)E.adoptedStyleSheets=A.map(I=>I instanceof CSSStyleSheet?I:I.styleSheet);else for(const I of A){const g=document.createElement("style"),Q=JA.litNonce;Q!==void 0&&g.setAttribute("nonce",Q),g.textContent=I.cssText,E.appendChild(g)}},yI=XA?E=>E:E=>E instanceof CSSStyleSheet?(A=>{let I="";for(const g of A.cssRules)I+=g.cssText;return sg(I)})(E):E;const{is:hg,defineProperty:Gg,getOwnPropertyDescriptor:yg,getOwnPropertyNames:tg,getOwnPropertySymbols:Kg,getPrototypeOf:Rg}=Object,FA=globalThis,tI=FA.trustedTypes,Ng=tI?tI.emptyScript:"",Mg=FA.reactiveElementPolyfillSupport,oA=(E,A)=>E,UA={toAttribute(E,A){switch(A){case Boolean:E=E?Ng:null;break;case Object:case Array:E=E==null?E:JSON.stringify(E)}return E},fromAttribute(E,A){let I=E;switch(A){case Boolean:I=E!==null;break;case Number:I=E===null?null:Number(E);break;case Object:case Array:try{I=JSON.parse(E)}catch{I=null}}return I}},VA=(E,A)=>!hg(E,A),KI={attribute:!0,type:String,converter:UA,reflect:!1,useDefault:!1,hasChanged:VA};Symbol.metadata??=Symbol("metadata"),FA.litPropertyMetadata??=new WeakMap;class DA extends HTMLElement{static addInitializer(A){this._$Ei(),(this.l??=[]).push(A)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(A,I=KI){if(I.state&&(I.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(A)&&((I=Object.create(I)).wrapped=!0),this.elementProperties.set(A,I),!I.noAccessor){const g=Symbol(),Q=this.getPropertyDescriptor(A,g,I);Q!==void 0&&Gg(this.prototype,A,Q)}}static getPropertyDescriptor(A,I,g){const{get:Q,set:D}=yg(this.prototype,A)??{get(){return this[I]},set(S){this[I]=S}};return{get:Q,set(S){const s=Q?.call(this);D?.call(this,S),this.requestUpdate(A,s,g)},configurable:!0,enumerable:!0}}static getPropertyOptions(A){return this.elementProperties.get(A)??KI}static _$Ei(){if(this.hasOwnProperty(oA("elementProperties")))return;const A=Rg(this);A.finalize(),A.l!==void 0&&(this.l=[...A.l]),this.elementProperties=new Map(A.elementProperties)}static finalize(){if(this.hasOwnProperty(oA("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(oA("properties"))){const I=this.properties,g=[...tg(I),...Kg(I)];for(const Q of g)this.createProperty(Q,I[Q])}const A=this[Symbol.metadata];if(A!==null){const I=litPropertyMetadata.get(A);if(I!==void 0)for(const[g,Q]of I)this.elementProperties.set(g,Q)}this._$Eh=new Map;for(const[I,g]of this.elementProperties){const Q=this._$Eu(I,g);Q!==void 0&&this._$Eh.set(Q,I)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(A){const I=[];if(Array.isArray(A)){const g=new Set(A.flat(1/0).reverse());for(const Q of g)I.unshift(yI(Q))}else A!==void 0&&I.push(yI(A));return I}static _$Eu(A,I){const g=I.attribute;return g===!1?void 0:typeof g=="string"?g:typeof A=="string"?A.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(A=>this.enableUpdating=A),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(A=>A(this))}addController(A){(this._$EO??=new Set).add(A),this.renderRoot!==void 0&&this.isConnected&&A.hostConnected?.()}removeController(A){this._$EO?.delete(A)}_$E_(){const A=new Map,I=this.constructor.elementProperties;for(const g of I.keys())this.hasOwnProperty(g)&&(A.set(g,this[g]),delete this[g]);A.size>0&&(this._$Ep=A)}createRenderRoot(){const A=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ag(A,this.constructor.elementStyles),A}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(A=>A.hostConnected?.())}enableUpdating(A){}disconnectedCallback(){this._$EO?.forEach(A=>A.hostDisconnected?.())}attributeChangedCallback(A,I,g){this._$AK(A,g)}_$ET(A,I){const g=this.constructor.elementProperties.get(A),Q=this.constructor._$Eu(A,g);if(Q!==void 0&&g.reflect===!0){const D=(g.converter?.toAttribute!==void 0?g.converter:UA).toAttribute(I,g.type);this._$Em=A,D==null?this.removeAttribute(Q):this.setAttribute(Q,D),this._$Em=null}}_$AK(A,I){const g=this.constructor,Q=g._$Eh.get(A);if(Q!==void 0&&this._$Em!==Q){const D=g.getPropertyOptions(Q),S=typeof D.converter=="function"?{fromAttribute:D.converter}:D.converter?.fromAttribute!==void 0?D.converter:UA;this._$Em=Q;const s=S.fromAttribute(I,D.type);this[Q]=s??this._$Ej?.get(Q)??s,this._$Em=null}}requestUpdate(A,I,g,Q=!1,D){if(A!==void 0){const S=this.constructor;if(Q===!1&&(D=this[A]),g??=S.getPropertyOptions(A),!((g.hasChanged??VA)(D,I)||g.useDefault&&g.reflect&&D===this._$Ej?.get(A)&&!this.hasAttribute(S._$Eu(A,g))))return;this.C(A,I,g)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(A,I,{useDefault:g,reflect:Q,wrapped:D},S){g&&!(this._$Ej??=new Map).has(A)&&(this._$Ej.set(A,S??I??this[A]),D!==!0||S!==void 0)||(this._$AL.has(A)||(this.hasUpdated||g||(I=void 0),this._$AL.set(A,I)),Q===!0&&this._$Em!==A&&(this._$Eq??=new Set).add(A))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(I){Promise.reject(I)}const A=this.scheduleUpdate();return A!=null&&await A,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[Q,D]of this._$Ep)this[Q]=D;this._$Ep=void 0}const g=this.constructor.elementProperties;if(g.size>0)for(const[Q,D]of g){const{wrapped:S}=D,s=this[Q];S!==!0||this._$AL.has(Q)||s===void 0||this.C(Q,void 0,D,s)}}let A=!1;const I=this._$AL;try{A=this.shouldUpdate(I),A?(this.willUpdate(I),this._$EO?.forEach(g=>g.hostUpdate?.()),this.update(I)):this._$EM()}catch(g){throw A=!1,this._$EM(),g}A&&this._$AE(I)}willUpdate(A){}_$AE(A){this._$EO?.forEach(I=>I.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(A)),this.updated(A)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(A){return!0}update(A){this._$Eq&&=this._$Eq.forEach(I=>this._$ET(I,this[I])),this._$EM()}updated(A){}firstUpdated(A){}}DA.elementStyles=[],DA.shadowRootOptions={mode:"open"},DA[oA("elementProperties")]=new Map,DA[oA("finalized")]=new Map,Mg?.({ReactiveElement:DA}),(FA.reactiveElementVersions??=[]).push("2.1.2");const Jg={attribute:!0,type:String,converter:UA,reflect:!1,hasChanged:VA},Fg=(E=Jg,A,I)=>{const{kind:g,metadata:Q}=I;let D=globalThis.litPropertyMetadata.get(Q);if(D===void 0&&globalThis.litPropertyMetadata.set(Q,D=new Map),g==="setter"&&((E=Object.create(E)).wrapped=!0),D.set(I.name,E),g==="accessor"){const{name:S}=I;return{set(s){const t=A.get.call(this);A.set.call(this,s),this.requestUpdate(S,t,E,!0,s)},init(s){return s!==void 0&&this.C(S,void 0,E,s),s}}}if(g==="setter"){const{name:S}=I;return function(s){const t=this[S];A.call(this,s),this.requestUpdate(S,t,E,!0,s)}}throw Error("Unsupported decorator location: "+g)};function Ug(E){return(A,I)=>typeof I=="object"?Fg(E,A,I):((g,Q,D)=>{const S=Q.hasOwnProperty(D);return Q.constructor.createProperty(D,g),S?Object.getOwnPropertyDescriptor(Q,D):void 0})(E,A,I)}const kg=(E,A,I)=>(I.configurable=!0,I.enumerable=!0,Reflect.decorate&&typeof A!="object"&&Object.defineProperty(E,A,I),I);function cg(E,A){return(I,g,Q)=>{const D=S=>S.renderRoot?.querySelector(E)??null;return kg(I,g,{get(){return D(this)}})}}var y=(E=>(E.INITIAL="initial",E.DISCONNECTED="disconnected",E.CONNECTING="connecting",E.WAITING_FOR_DEVICE_SELECTION="waiting_for_device_selection",E.CONNECTED_PHYSICAL="connected_physical",E.CONNECTED_MOUSE_FALLBACK="connected_mouse_fallback",E.SIGNING_ACTIVE="signing_active",E.PROCESSING_OK="processing_ok",E.PROCESSING_CLEAR="processing_clear",E.PROCESSING_CANCEL="processing_cancel",E.DISCONNECTING="disconnecting",E.ERROR="error",E))(y||{}),Y=(E=>(E.SIGN_PEN="sign-pen",E.SIGN_OK="sign-ok",E.SIGN_CLEAR="sign-clear",E.SIGN_CANCEL="sign-cancel",E.SIGN_ERROR="sign-error",E.SIGN_CONNECT="sign-connect",E.SIGN_DISCONNECT="sign-disconnect",E.SIGN_CONNECTING="sign-connecting",E))(Y||{}),RI=(E=>(E.OK="OK",E.CLEAR="CLEAR",E.CANCEL="CANCEL",E.CLEAR_SIGNATURE="CLEAR_SIGNATURE",E.DISCONNECT="DISCONNECT",E.CONNECT_SIGNPAD="CONNECT_SIGNPAD",E))(RI||{}),F=(E=>(E.AUTO_CONNECTING="AUTO_CONNECTING",E.CONNECTING_TO_DEVICE="CONNECTING_TO_DEVICE",E.REVERTING_TO_DEFAULT="REVERTING_TO_DEFAULT",E.DISCONNECTING_DEVICE="DISCONNECTING_DEVICE",E.COMPONENT_INITIALIZED="COMPONENT_INITIALIZED",E.TEXT_START_SIGNING="TEXT_START_SIGNING",E.TEXT_SIGN_WITH_PHYSICAL="TEXT_SIGN_WITH_PHYSICAL",E.TEXT_SIGN_WITH_MOUSE="TEXT_SIGN_WITH_MOUSE",E.TEXT_SIGN_GENERIC="TEXT_SIGN_GENERIC",E.TEXT_SIGNING_WITH_DEVICE="TEXT_SIGNING_WITH_DEVICE",E.NO_DEVICE_FOUND="NO_DEVICE_FOUND",E.CONNECTION_ERROR="CONNECTION_ERROR",E.ERROR_DISCONNECTION="ERROR_DISCONNECTION",E.ERROR_INSTANTIATING_DRIVER="ERROR_INSTANTIATING_DRIVER",E.SIGNPAD_DISCONNECTED="SIGNPAD_DISCONNECTED",E.INVALID_LICENSE_KEY="INVALID_LICENSE_KEY",E.READY_TO_CONNECT="READY_TO_CONNECT",E.SIGNPAD_DETECTED="SIGNPAD_DETECTED",E.READY_TO_SIGN_MOUSE="READY_TO_SIGN_MOUSE",E.READY_TO_SIGN_PHYSICAL="READY_TO_SIGN_PHYSICAL",E))(F||{}),m=(E=>(E.MOUSE="MOUSE",E.CONNECTED_UNKNOWN="CONNECTED_UNKNOWN_DEVICE",E))(m||{});class Lg{constructor(A){this.component=A}async handleClear(){await this.executeAction(y.PROCESSING_CLEAR,async()=>{await this.component.connectionManager.clearSignature(),await this.component.config.actionHandlers?.handleClear?.(),this.component.dispatch(Y.SIGN_CLEAR)})}async handleOk(){return await this.executeAction(y.PROCESSING_OK,async()=>{const A=await this.component.connectionManager.stopSigning();return await this.component.config.actionHandlers?.handleOk?.(A),this.component.dispatch(Y.SIGN_OK,A),A})}async handleCancel(){await this.executeAction(y.PROCESSING_CANCEL,async()=>{await this.component.connectionManager.stopSigning(),await this.component.config.actionHandlers?.handleCancel?.(),this.component.dispatch(Y.SIGN_CANCEL)})}async startSigning(A){const I=this.component.connectionManager,g=this.component.canvasRef;if(!I.hasSignatureLayer()||!g){this.handleStartSigningError();return}this.component.stateManager.transitionTo(y.CONNECTING,"Preparing session...");try{this.component.resetDrawingState(),await I.startSigning(g,A);const Q=await this.getReadyState(),D=Q===y.CONNECTED_MOUSE_FALLBACK?"READY_TO_SIGN_MOUSE":"READY_TO_SIGN_PHYSICAL";this.component.stateManager.transitionTo(Q,D)}catch(Q){this.handleError("Error starting signing session",Q)}}async stopSigning(){return this.component.connectionManager.stopSigning()}async executeAction(A,I){this.component.stateManager.transitionTo(A,"Processing...");try{const g=await I();this.component.resetDrawingState();const Q=await this.getReadyState();return this.component.stateManager.transitionTo(Q),g}catch(g){throw this.handleError("Error during action processing",g),g}}async getReadyState(){const A=this.component.connectionManager.isDeviceConnected(),I=await this.component.connectionManager.getDeviceInfo();return this.component.connectionManager.isFallback(I,A,!0)?y.CONNECTED_MOUSE_FALLBACK:y.CONNECTED_PHYSICAL}handleStartSigningError(){this.component.currentState===y.CONNECTED_MOUSE_FALLBACK&&(this.component.resetDrawingState(),this.component.mouseManager?.addListeners(),this.component.stateManager.transitionTo(y.CONNECTED_MOUSE_FALLBACK))}handleError(A,I){console.error(`Signosoft Signpad: ${A}`,I),this.component.stateManager.transitionTo(y.ERROR,A,I)}}class eg{constructor(A,I={minWidth:2,maxWidth:4,color:"#000000"}){this.canvas=A;const g=A.getContext("2d");if(!g)throw new Error("Could not get 2D rendering context for canvas.");this.ctx=g,this.currentDrawingOptions=I,this.configureCanvasForDPI(),this.applyDrawingStyles(this.currentDrawingOptions)}get drawingOptions(){return{...this.currentDrawingOptions}}updateDrawingOptions(A){this.currentDrawingOptions=A,this.applyDrawingStyles(this.currentDrawingOptions)}drawSegment(A){}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)}configureCanvasForDPI(){const A=window.devicePixelRatio||1,I=this.canvas.getBoundingClientRect(),g=I.width||this.canvas.clientWidth||0,Q=I.height||this.canvas.clientHeight||0;if(g<=0||Q<=0)return;const D=Math.round(g*A),S=Math.round(Q*A);this.canvas.width===D&&this.canvas.height===S||(this.canvas.width=D,this.canvas.height=S,this.applyDrawingStyles(this.currentDrawingOptions))}applyDrawingStyles(A){this.ctx.strokeStyle=A.color??"#000000",this.ctx.fillStyle=A.color??"#000000",this.ctx.lineCap="round",this.ctx.lineJoin="round",this.ctx.globalCompositeOperation="source-over"}}const qA=class qA{constructor(A){this.sigLayer=null,this.debugCallbackRegistrationCount=0,this.cachedDeviceInfo=null,this.lastPenDispatchTime=0,this.penDataToDispatch=null,this.throttleDelayMs=16,this.component=A}async connect(A=!1,I=!1){this.component.stateManager.transitionTo(y.CONNECTING,A?F.AUTO_CONNECTING:F.CONNECTING_TO_DEVICE);try{const g=await this.runDriverConnectAttempt(A),Q=this.resolveConnectionTarget(g,I);return Q?(await this.prepareSigningSession(),this.component.stateManager.transitionTo(Q.targetState,Q.statusMessageKey),this.component.dispatch(Y.SIGN_CONNECT,{deviceInfo:g.deviceInfo}),!0):(this.component.stateManager.transitionTo(y.DISCONNECTED,F.NO_DEVICE_FOUND),!1)}catch(g){return console.error("Signosoft Signpad: Error in connect method:",g),this.component.stateManager.transitionTo(y.ERROR,F.CONNECTION_ERROR,g),!1}}async disconnect(){this.component.stateManager.transitionTo(y.DISCONNECTING,F.DISCONNECTING_DEVICE);try{if(!this.sigLayer)return;if(!this.sigLayer.isConnected()){this.sigLayer=null,this.cachedDeviceInfo=null;return}await this.sigLayer.disconnect(),this.sigLayer=null,this.cachedDeviceInfo=null}catch(A){console.error("Signosoft Signpad: Error during disconnect",A),this.component.stateManager.transitionTo(y.ERROR,F.ERROR_DISCONNECTION,A)}}hasSignatureLayer(){return this.sigLayer!==null}async getDeviceInfo(){if(this.cachedDeviceInfo)return this.cachedDeviceInfo;const A=this.normalizeDeviceInfo(await this.sigLayer?.getDeviceInfo());return this.cachedDeviceInfo=A??null,A}isDeviceConnected(){return this.sigLayer?.isConnected()??!1}isSigningActive(){return this.sigLayer?.isInSigningMode?.()??!1}async startSigning(A,I){if(!this.sigLayer)return!1;const g=I??this.component.configManager.getDrawingOptions();return this.sigLayer.isInSigningMode?.()&&await this.sigLayer.stopSigning(),await this.sigLayer.startSigning(A,!0,g),!0}async stopSigning(){try{if(this.sigLayer)return await this.sigLayer.stopSigning()}catch(A){console.warn("Signosoft Signpad: SigLayer stop failed, continuing cleanup",A)}finally{this.component.mouseManager?.removeListeners(),this.component.resetDrawingState(),console.log("[ConnectionManager] Signing stopped and mouse listeners removed.")}}async clearSignature(){this.sigLayer?.isInSigningMode?.()&&await this.sigLayer.clearSignature()}async ensureSignatureLayer(){if(!this.sigLayer)try{this.sigLayer=new SignatureLayer,this.setupCallbacks()}catch(A){throw console.error("Signosoft Signpad: Error instantiating driver",A),this.component.stateManager.transitionTo(y.ERROR,F.ERROR_INSTANTIATING_DRIVER,A),A}}setupCallbacks(){this.sigLayer&&(this.debugCallbackRegistrationCount+=1,console.log(`[Signpad Debug] SignatureLayer callbacks registered (${this.debugCallbackRegistrationCount})`),this.sigLayer.onOK(()=>this.component.buttonManager.handleOk()),this.sigLayer.onClear(()=>this.component.buttonManager.handleClear()),this.sigLayer.onCancel(()=>this.component.buttonManager.handleCancel()),this.sigLayer.onPen(A=>{A.inContact&&!this.component.hasStartedDrawing&&this.component.stateManager.setDrawingStarted(!0),this.runThrottledPenDispatch(A)}),this.sigLayer.onUnexpectedDisconnect(()=>{const A=this.component.currentState;A!==y.DISCONNECTING&&A!==y.INITIAL&&A!==y.DISCONNECTED&&A!==y.ERROR&&this.component.recoverToMouseFallback(F.REVERTING_TO_DEFAULT,1e3)}))}runThrottledPenDispatch(A){if(this.component.stateManager.isBusy||this.component.stateManager.isError)return;this.penDataToDispatch=A;const I=performance.now();I-this.lastPenDispatchTime>this.throttleDelayMs&&(this.component.dispatch(Y.SIGN_PEN,this.penDataToDispatch),this.lastPenDispatchTime=I,this.penDataToDispatch=null)}async initWithLease(A){await this.ensureSignatureLayer(),this.sigLayer&&await this.sigLayer.initialize(A)}isFallback(A,I,g){const D=(A?.deviceName??A?.name??null)==="Pointer Input (Fallback Mode)",S=this.component.currentState===y.CONNECTED_MOUSE_FALLBACK,s=this.component.deviceStatusText===m.MOUSE;return D||S||s||g&&!I}normalizeDeviceInfo(A){return A?!A.deviceName&&A.name?{...A,deviceName:A.name}:A:null}async runDriverConnectAttempt(A){const I=await this.sigLayer?.connect(A),g=this.sigLayer?.isConnected()??!1,Q=!!(I&&g),D=Q?this.normalizeDeviceInfo(await this.sigLayer?.getDeviceInfo()):null;this.cachedDeviceInfo=D??null;const S=D?.deviceName??D?.name??null,s=Q&&S===qA.POINTER_FALLBACK_DEVICE_NAME;return{connected:Q,deviceInfo:D,isPointerFallback:s}}resolveConnectionTarget(A,I){if(A.connected&&!A.isPointerFallback){const g=A.deviceInfo?.deviceName??A.deviceInfo?.name??m.CONNECTED_UNKNOWN;return this.component.setDeviceStatusText(g),this.component.mouseManager?.areListenersAttached()&&this.component.mouseManager?.removeListeners(),{targetState:y.CONNECTED_PHYSICAL,statusMessageKey:F.TEXT_SIGN_WITH_PHYSICAL}}return A.connected&&A.isPointerFallback||!A.connected&&I?(this.component.setDeviceStatusText(m.MOUSE),{targetState:y.CONNECTED_MOUSE_FALLBACK,statusMessageKey:F.TEXT_SIGN_WITH_MOUSE}):null}async prepareSigningSession(){const A=this.component.canvasRef,I=this.component.configManager.getDrawingOptions();this.sigLayer?.isInSigningMode?.()&&await this.sigLayer.stopSigning(),await this.sigLayer?.startSigning(A,!0,I)}};qA.POINTER_FALLBACK_DEVICE_NAME="Pointer Input (Fallback Mode)";let zA=qA;class Yg{constructor(A){this.component=A}get deviceStatusKey(){return this.component.currentState===y.CONNECTED_MOUSE_FALLBACK?m.MOUSE:this.isConnected?this.component.deviceStatusText||m.CONNECTED_UNKNOWN:m.MOUSE}get statusMessageKey(){return this.component.statusMessage||""}get additionalTextKey(){const A=y,I=F,g=this.component.statusMessage;switch(this.component.currentState){case A.INITIAL:case A.ERROR:return I.TEXT_START_SIGNING;case A.DISCONNECTED:return g===I.READY_TO_CONNECT||g===I.SIGNPAD_DETECTED||g===I.COMPONENT_INITIALIZED?I.TEXT_START_SIGNING:I.TEXT_SIGN_GENERIC;case A.CONNECTED_PHYSICAL:return I.TEXT_SIGN_WITH_PHYSICAL;case A.CONNECTED_MOUSE_FALLBACK:return I.TEXT_SIGN_WITH_MOUSE;case A.SIGNING_ACTIVE:return I.TEXT_SIGNING_WITH_DEVICE;default:return I.TEXT_SIGN_GENERIC}}get isConnected(){const A=this.component.currentState;return A===y.CONNECTED_PHYSICAL||A===y.CONNECTED_MOUSE_FALLBACK||A===y.SIGNING_ACTIVE||A===y.PROCESSING_OK||A===y.PROCESSING_CLEAR||A===y.PROCESSING_CANCEL}get isPhysicalConnected(){const A=this.component.currentState;return A===y.CONNECTED_PHYSICAL||A===y.SIGNING_ACTIVE||A===y.PROCESSING_OK||A===y.PROCESSING_CLEAR||A===y.PROCESSING_CANCEL}get isBusy(){const A=this.component.currentState;return A===y.CONNECTING||A===y.WAITING_FOR_DEVICE_SELECTION||A===y.PROCESSING_OK||A===y.PROCESSING_CLEAR||A===y.PROCESSING_CANCEL||A===y.DISCONNECTING}get isError(){return this.component.currentState===y.ERROR}get actionButtonsDisabled(){return!this.isConnected||!this.component.hasStartedDrawing||this.isBusy}get connectButtonDisabled(){return this.isBusy||this.isPhysicalConnected}get disconnectButtonDisabled(){const A=this.component.currentState;return A===y.DISCONNECTED||A===y.INITIAL||this.isBusy}transitionTo(A,I="",g){const Q=this.component.currentState;Q===A&&this.component.statusMessage===I&&!g||(this.component.setCurrentState(A),this.component.setStatusMessage(I),this.handleSideEffects(A,Q),A===y.CONNECTING&&this.component.dispatch(Y.SIGN_CONNECTING),g&&this.component.dispatch(Y.SIGN_ERROR,g))}setDrawingStarted(A){this.component.hasStartedDrawing!==A&&this.component.setHasStartedDrawing(A)}handleSideEffects(A,I){const g=Q=>Q===y.INITIAL||Q===y.DISCONNECTED||Q===y.ERROR;g(A)?(this.component.setDeviceStatusText(m.MOUSE),this.component.setCanvasPointerInputEnabled(!0),g(I)||(this.component.resetDrawingState(),this.component.mouseManager?.removeListeners())):(A===y.CONNECTED_PHYSICAL||A===y.CONNECTED_MOUSE_FALLBACK)&&(A===y.CONNECTED_MOUSE_FALLBACK?I===y.PROCESSING_OK||I===y.PROCESSING_CANCEL?(this.component.mouseManager?.removeListeners(),this.component.setCanvasPointerInputEnabled(!1)):(this.component.mouseManager?.addListeners(),this.component.setCanvasPointerInputEnabled(!0)):(this.component.mouseManager?.removeListeners(),this.component.setCanvasPointerInputEnabled(!1)))}}class ng{constructor(A,I){this.isDrawing=!1,this.sequenceCounter=0,this.sessionStartTime=null,this.debugListenerRegistrationCount=0,this.listenersAttached=!1,this.canvas=A,this.onPenData=I,this.boundHandleMouseDown=this.handleMouseDown.bind(this),this.boundHandleMouseMove=this.handleMouseMove.bind(this),this.boundHandleMouseUp=this.handleMouseUp.bind(this),this.boundHandleMouseLeave=this.handleMouseLeave.bind(this)}get isCurrentlyDrawing(){return this.isDrawing}addListeners(){if(this.listenersAttached){console.log("[Signpad Debug] Mouse listeners already registered");return}this.listenersAttached=!0,this.debugListenerRegistrationCount+=1,console.log(`[Signpad Debug] Mouse listeners registered (${this.debugListenerRegistrationCount})`),this.canvas.addEventListener("mousedown",this.boundHandleMouseDown),this.canvas.addEventListener("mousemove",this.boundHandleMouseMove),this.canvas.addEventListener("mouseup",this.boundHandleMouseUp),this.canvas.addEventListener("mouseleave",this.boundHandleMouseLeave)}removeListeners(){if(!this.listenersAttached){console.log("[Signpad Debug] Mouse listeners already removed");return}this.listenersAttached=!1,console.log("[Signpad Debug] Mouse listeners removed"),this.canvas.removeEventListener("mousedown",this.boundHandleMouseDown),this.canvas.removeEventListener("mousemove",this.boundHandleMouseMove),this.canvas.removeEventListener("mouseup",this.boundHandleMouseUp),this.canvas.removeEventListener("mouseleave",this.boundHandleMouseLeave),this.isDrawing=!1,this.sequenceCounter=0}areListenersAttached(){return this.listenersAttached}resetSession(){this.isDrawing=!1,this.sequenceCounter=0,this.sessionStartTime=null}handleMouseDown(A){this.isDrawing=!0,this.sequenceCounter=0,this.sessionStartTime===null&&(this.sessionStartTime=Date.now()),this.processMouseEvent(A,!0)}handleMouseMove(A){this.isDrawing&&(this.sequenceCounter++,this.processMouseEvent(A,!0))}handleMouseUp(A){this.isDrawing&&(this.isDrawing=!1,this.processMouseEvent(A,!1),this.sequenceCounter=0)}handleMouseLeave(A){this.isDrawing&&(this.isDrawing=!1,this.processMouseEvent(A,!1),this.sequenceCounter=0)}processMouseEvent(A,I){const{x:g,y:Q}=this.getNormalizedCoordinates(A),D={relativeX:g,relativeY:Q,pressure:I?.5:0,inContact:I,timestamp:this.timestampToSeconds()};this.onPenData(D)}getNormalizedCoordinates(A){const I=this.canvas.getBoundingClientRect(),g=(A.clientX-I.left)/I.width,Q=(A.clientY-I.top)/I.height;return{x:g,y:Q}}timestampToSeconds(){this.sessionStartTime===null&&(this.sessionStartTime=Date.now());const I=(Date.now()-this.sessionStartTime)/1e3;return Number(I.toFixed(3))}}const kA={en:{OK:"OK",CLEAR:"Clear",CANCEL:"Cancel",CLEAR_SIGNATURE:"Clear signature",DISCONNECT:"Disconnect",CONNECT_SIGNPAD:"Connect Signpad",MOUSE:"Mouse",CONNECTED_UNKNOWN_DEVICE:"Connected (Unknown Device)",AUTO_CONNECTING:"Auto-connecting to device...",CONNECTING_TO_DEVICE:"Connecting to your device...",REVERTING_TO_DEFAULT:"Reverting to default input...",DISCONNECTING_DEVICE:"Disconnecting device...",COMPONENT_INITIALIZED:"Component initialized.",TEXT_START_SIGNING:"Connect your device.",TEXT_SIGN_WITH_PHYSICAL:"Please sign using the device pen.",TEXT_SIGN_WITH_MOUSE:"Please sign using your mouse.",TEXT_SIGN_GENERIC:"Sign in the area above using mouse or pen.",TEXT_SIGNING_WITH_DEVICE:"Signing with {device}",NO_DEVICE_FOUND:"No device found.",CONNECTION_ERROR:"Connection error.",ERROR_DISCONNECTION:"Error during disconnection.",ERROR_INSTANTIATING_DRIVER:"Error instantiating driver.",SIGNPAD_DISCONNECTED:"Signpad disconnected.",INVALID_LICENSE_KEY:"Invalid license key.",READY_TO_CONNECT:"Ready to connect.",SIGNPAD_DETECTED:"Signpad detected. Click 'Connect Signpad' to begin.",READY_TO_SIGN_MOUSE:"Ready to sign. Use your mouse.",READY_TO_SIGN_PHYSICAL:"Ready to sign. Use the device pen."},cs:{OK:"OK",CLEAR:"Smazat",CANCEL:"Zrušit",CLEAR_SIGNATURE:"Smazat podpis",DISCONNECT:"Odpojit",CONNECT_SIGNPAD:"Připojit Signpad",MOUSE:"Myš",CONNECTED_UNKNOWN_DEVICE:"Připojeno (neznámé zařízení)",AUTO_CONNECTING:"Automatické připojování k zařízení...",CONNECTING_TO_DEVICE:"Připojování k vašemu zařízení...",REVERTING_TO_DEFAULT:"Přepínání na výchozí vstup...",DISCONNECTING_DEVICE:"Odpojování zařízení...",COMPONENT_INITIALIZED:"Komponenta byla inicializována.",TEXT_START_SIGNING:"Připojte své zařízení.",TEXT_SIGN_WITH_PHYSICAL:"Podepište se perem zařízení.",TEXT_SIGN_WITH_MOUSE:"Podepište se pomocí myši.",TEXT_SIGN_GENERIC:"Podepište se v oblasti výše pomocí myši nebo pera.",TEXT_SIGNING_WITH_DEVICE:"Podepisování pomocí: {device}",NO_DEVICE_FOUND:"Zařízení nebylo nalezeno.",CONNECTION_ERROR:"Chyba připojení.",ERROR_DISCONNECTION:"Chyba při odpojování.",ERROR_INSTANTIATING_DRIVER:"Chyba při inicializaci ovladače.",SIGNPAD_DISCONNECTED:"Signpad byl odpojen.",INVALID_LICENSE_KEY:"Neplatný licenční klíč.",READY_TO_CONNECT:"Připraveno k připojení.",SIGNPAD_DETECTED:"Signpad byl nalezen. Klikněte na 'Připojit Signpad' pro spuštění.",READY_TO_SIGN_MOUSE:"Připraveno k podpisu. Použijte myš.",READY_TO_SIGN_PHYSICAL:"Připraveno k podpisu. Použijte pero zařízení."}};class Hg{constructor(A){this.translations=kA.en,this.currentLang="",this.currentPath=void 0,this.component=A}t(A,I={}){let g=this.translations[A]||A;for(const[Q,D]of Object.entries(I))g=g.replace(new RegExp(`{${Q}}`,"g"),D);return g}async loadLanguage(A,I,g){const Q=I?.trim();if(A===this.currentLang&&Q===this.currentPath)return;let D=this.getBaselineTranslations(A);const S=this.resolveInlineTranslations(A,g);if(S){this.translations={...D,...S},this.currentLang=A,this.currentPath=Q,this.component.requestUpdate();return}if(!Q){this.translations=D,this.currentLang=A,this.currentPath=Q,this.component.requestUpdate();return}const s=this.constructUrl(A,Q);try{const t=await fetch(s);if(t.ok){const M=await t.json();D={...D,...M},console.log(`signosoft-signpad: External translations loaded from ${s}`)}else I&&console.info(`signosoft-signpad: Custom path provided, but file not found at ${s}`)}catch(t){console.warn(`signosoft-signpad: Failed to load external translations from ${s}. Using built-in defaults.`,t)}this.translations=D,this.currentLang=A,this.currentPath=Q,this.component.requestUpdate()}getBaselineTranslations(A){const I=kA.en;return A!=="en"&&kA.hasOwnProperty(A)?{...I,...kA[A]}:{...I}}resolveInlineTranslations(A,I){return I?typeof Object.values(I)[0]=="string"?I:I[A]:void 0}constructUrl(A,I){const g=I.trim();let Q="";return g.endsWith(".json")?Q=g:Q=`${g.replace(/\/+$/,"")}/${A}.json`,Q}}class rg{constructor(A){this.configEventHandlers={},this.customEventListenerCache=new WeakMap,this.component=A}apply(A){const I=this.component.config;if(!I){this.clearConfigEventHandlers();return}this.applyLocalization(A,I),this.applyDrawingOptions(A,I),this.syncConfigEventHandlers(I)}getUiVisibilityOptions(){const A=this.component.config.uiVisibilityOptions;return{topBarVisible:A?.topBarVisible??!0,topBarClearButtonVisible:A?.topBarClearButtonVisible??!1,topBarConnectButtonVisible:A?.topBarConnectButtonVisible??!0,bottomBarVisible:A?.bottomBarVisible??!0,okButtonVisible:A?.okButtonVisible??!0,clearButtonVisible:A?.clearButtonVisible??!0,cancelButtonVisible:A?.cancelButtonVisible??!0,canvasLineVisible:A?.canvasLineVisible??!0,deviceStatusTextVisible:A?.deviceStatusTextVisible??!0,additionalTextVisible:A?.additionalTextVisible??!0}}getDrawingOptions(){const A=this.component.config.canvasAndDrawingOptions;return{minWidth:A?.minWidth??1,maxWidth:A?.maxWidth??3,color:A?.color??"#000000"}}applyLocalization(A,I){const g=A?.languageOptions,Q=I.languageOptions;(!A||g?.lang!==Q?.lang||g?.langPath!==Q?.langPath||g?.translations!==Q?.translations)&&this.component.localizationManager.loadLanguage(Q?.lang??"en",Q?.langPath,Q?.translations)}applyDrawingOptions(A,I){const g=A?.canvasAndDrawingOptions,Q=I.canvasAndDrawingOptions;this.component.canvasManager&&(!A||g?.minWidth!==Q?.minWidth||g?.maxWidth!==Q?.maxWidth||g?.color!==Q?.color)&&this.component.canvasManager.updateDrawingOptions(this.getDrawingOptions())}syncConfigEventHandlers(A){const I=S=>{if(!S)return;const s=this.customEventListenerCache.get(S);if(s)return s;const t=M=>{S(M)};return this.customEventListenerCache.set(S,t),t},g=A.eventCallbacks,Q={[Y.SIGN_CONNECT]:I(g?.onConnect),[Y.SIGN_CONNECTING]:I(g?.onConnecting),[Y.SIGN_DISCONNECT]:I(g?.onDisconnect),[Y.SIGN_PEN]:I(g?.onPen),[Y.SIGN_OK]:I(g?.onOk),[Y.SIGN_CLEAR]:I(g?.onClear),[Y.SIGN_CANCEL]:I(g?.onCancel),[Y.SIGN_ERROR]:I(g?.onError)},D=new Set([...Object.keys(this.configEventHandlers),...Object.keys(Q)]);for(const S of D){const s=this.configEventHandlers[S],t=Q[S];s&&s!==t&&this.component.removeEventListener(S,s),t&&s!==t&&this.component.addEventListener(S,t),t?this.configEventHandlers[S]=t:delete this.configEventHandlers[S]}}clearConfigEventHandlers(){for(const[A,I]of Object.entries(this.configEventHandlers))I&&this.component.removeEventListener(A,I);this.configEventHandlers={}}}const qg=":host{--primary-color-0: #4e56ea;--primary-color-10: #7178ee;--background-color-0: #f1f2fd;--background-color-10: #e3e4fc;--text-color-0: #333e4a;--white-color: #ffffff;--grey-color: #b5b9be;--min-height: 3rem;--spacing-constraints: 1rem 1.5rem;--sign-font-family: Arial, Helvetica, sans-serif;--sign-common-border-radius: .5rem;--sign-top-bar-bg-base: var(--background-color-10);--sign-top-bar-text-base: var(--primary-color-0);--sign-top-bar-padding: var(--spacing-constraints);--sign-top-bar-min-height: var(--min-height);--sign-top-bar-border-top-left-radius: var(--sign-common-border-radius);--sign-top-bar-border-top-right-radius: var(--sign-common-border-radius);--sign-top-bar-border-bottom-left-radius: 0;--sign-top-bar-border-bottom-right-radius: 0;--sign-canvas-bg-base: var(--background-color-0);--sign-canvas-wrapper-border-top-left-radius: 0;--sign-canvas-wrapper-border-top-right-radius: 0;--sign-canvas-wrapper-border-bottom-left-radius: 0;--sign-canvas-wrapper-border-bottom-right-radius: 0;--sign-line-height: 1.375rem;--sign-line-margin-bottom: 1rem;--sign-line-border-base: var(--primary-color-10);--sign-line-additional-text-color: var(--text-color-0);--sign-line-margin: 0rem 1.5rem var(--sign-line-margin-bottom) 1.5rem;--sign-canvas-line-text-font-size: .75rem;--sign-canvas-height-offset: var(--sign-line-height);--sign-bottom-bar-bg-base: var(--background-color-10);--sign-bottom-bar-padding: var(--spacing-constraints);--sign-bottom-bar-min-height: var(--min-height);--sign-bottom-bar-gap: .75rem;--sign-bottom-bar-border-top-left-radius: 0;--sign-bottom-bar-border-top-right-radius: 0;--sign-bottom-bar-border-bottom-left-radius: var(--sign-common-border-radius);--sign-bottom-bar-border-bottom-right-radius: var( --sign-common-border-radius );--sign-button-font-size: 1rem;--sign-button-padding: .875rem 1rem;--sign-button-min-height: var(--min-height);--sign-button-border-radius: var(--sign-common-border-radius);--sign-button-font-weight: 500;--sign-button-primary-bg-base: var(--primary-color-0);--sign-button-primary-bg-hover: var(--primary-color-10);--sign-button-primary-bg-disabled: var(--grey-color);--sign-button-primary-text-base: var(--white-color);--sign-button-primary-text-hover: var(--white-color);--sign-button-primary-text-disabled: var(--white-color);--sign-button-primary-border-base: .0625rem solid var(--primary-color-0);--sign-button-primary-border-hover: .0625rem solid var(--primary-color-10);--sign-button-primary-border-disabled: .0625rem solid var(--grey-color);--sign-button-link-bg-base: transparent;--sign-button-link-bg-hover: var(--background-color-10);--sign-button-link-bg-disabled: transparent;--sign-button-link-text-base: var(--primary-color-0);--sign-button-link-text-hover: var(--primary-color-10);--sign-button-link-text-disabled: var(--grey-color);--sign-button-link-border-base: .0625rem solid var(--primary-color-0);--sign-button-link-border-hover: .0625rem solid var(--primary-color-10);--sign-button-link-border-disabled: .0625rem solid var(--grey-color);--sign-device-state-text-color-connected: green;--sign-device-state-text-color-disconnected: red;--sign-loading-overlay-bg-color: rgba(255, 255, 255, .8);--sign-loading-overlay-text-color: var(--text-color-0);--sign-loading-overlay-spinner-color: var(--primary-color-0);--sign-loading-overlay-spinner-border-color: rgba(78, 86, 234, .1);--sign-loading-overlay-spinner-size: 1.875rem}html{font-family:var(--sign-font-family)!important}.signpad-canvas-container{display:flex;flex-direction:column;width:100%;height:100%}.signpad-top-bar{display:flex;justify-content:space-between;padding:var(--sign-top-bar-padding);min-height:var(--sign-top-bar-min-height);background-color:var(--sign-top-bar-bg-base);color:var(--sign-top-bar-text-base);align-items:center;border-top-left-radius:var(--sign-top-bar-border-top-left-radius);border-top-right-radius:var(--sign-top-bar-border-top-right-radius);border-bottom-left-radius:var(--sign-top-bar-border-bottom-left-radius);border-bottom-right-radius:var(--sign-top-bar-border-bottom-right-radius)}.signpad-top-left-actions,.signpad-top-right-actions{display:flex;gap:var(--sign-bottom-bar-gap)}.signpad-top-left-actions{justify-content:flex-start}.signpad-top-right-actions{justify-content:flex-end}.signpad-canvas-wrapper{position:relative;width:100%;padding-top:1rem;padding-bottom:56.25%;height:0;background-color:var(--sign-canvas-bg-base);box-sizing:border-box;overflow:hidden;border-top-left-radius:var(--sign-canvas-wrapper-border-top-left-radius);border-top-right-radius:var(--sign-canvas-wrapper-border-top-right-radius);border-bottom-left-radius:var( --sign-canvas-wrapper-border-bottom-left-radius );border-bottom-right-radius:var( --sign-canvas-wrapper-border-bottom-right-radius )}.signpad-canvas-container>.signpad-canvas-wrapper:first-child{--sign-canvas-wrapper-border-top-left-radius: var( --sign-common-border-radius );--sign-canvas-wrapper-border-top-right-radius: var( --sign-common-border-radius )}.signpad-canvas-container>.signpad-canvas-wrapper:last-child{--sign-canvas-wrapper-border-bottom-left-radius: var( --sign-common-border-radius );--sign-canvas-wrapper-border-bottom-right-radius: var( --sign-common-border-radius )}.signpad-canvas{position:absolute;width:100%;height:calc(100% - (var(--sign-canvas-height-offset) + var(--sign-line-margin-bottom)));left:0;top:0}.signpad-canvas-line-container{position:absolute;bottom:0;left:0;right:0;display:flex;justify-content:space-between;align-items:center;height:var(--sign-line-height);padding-top:0;border-top:.125rem solid var(--sign-line-border-base);box-sizing:border-box;padding-top:.375rem;margin:var(--sign-line-margin)}.signpad-canvas-line-additional-text,.signpad-canvas-line-state,.signpad-canvas-line-state.connected{font-family:var(--sign-font-family);font-size:var(--sign-canvas-line-text-font-size)}.signpad-canvas-line-additional-text{color:var(--sign-line-additional-text-color);margin:0}.signpad-canvas-line-state{color:var(--sign-device-state-text-color-disconnected);margin:0}.signpad-canvas-line-state.connected{color:var(--sign-device-state-text-color-connected)}.signpad-bottom-bar{display:flex;flex-direction:row;gap:var(--sign-bottom-bar-gap);padding:var(--sign-bottom-bar-padding);min-height:var(--sign-bottom-bar-min-height);background-color:var(--sign-bottom-bar-bg-base);border-top-left-radius:var(--sign-bottom-bar-border-top-left-radius);border-top-right-radius:var(--sign-bottom-bar-border-top-right-radius);border-bottom-left-radius:var(--sign-bottom-bar-border-bottom-left-radius);border-bottom-right-radius:var(--sign-bottom-bar-border-bottom-right-radius)}.btn{font-family:var(--sign-font-family);min-height:var(--sign-button-min-height);padding:var(--sign-button-padding);margin:0;font-weight:var(--sign-button-font-weight);width:100%;font-size:var(--sign-button-font-size);border-radius:var(--sign-button-border-radius);transition:background-color .3s ease,color .3s ease,transform .1s ease}.btn:hover:not(:disabled){cursor:pointer}.btn:focus:not(:disabled){outline:none}.btn-primary{background-color:var(--sign-button-primary-bg-base);color:var(--sign-button-primary-text-base);border:var(--sign-button-primary-border-base)}.btn-primary:hover:not(:disabled){background-color:var(--sign-button-primary-bg-hover);color:var(--sign-button-primary-text-hover);border:var(--sign-button-primary-border-hover)}.btn-primary:disabled{background-color:var(--sign-button-primary-bg-disabled);color:var(--sign-button-primary-text-disabled);border:var(--sign-button-primary-border-disabled)}.btn-link{background-color:var(--sign-button-link-bg-base);color:var(--sign-button-link-text-base);border:var(--sign-button-link-border-base)}.btn-link:hover:not(:disabled){background-color:var(--sign-button-link-bg-hover);color:var(--sign-button-link-text-hover);border:var(--sign-button-link-border-hover)}.btn-link:disabled{background-color:var(--sign-button-link-bg-disabled);color:var(--sign-button-link-text-disabled);border:var(--sign-button-link-border-disabled)}.signpad-loading-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--sign-loading-overlay-bg-color);display:flex;flex-direction:column;justify-content:center;align-items:center;z-index:10;text-align:center;gap:.625rem}.signpad-loading-overlay .spinner{border:.25rem solid var(--sign-loading-overlay-spinner-border-color);border-left-color:var(--sign-loading-overlay-spinner-color);border-radius:50%;width:var(--sign-loading-overlay-spinner-size);height:var(--sign-loading-overlay-spinner-size);animation:spin 1s linear infinite}.signpad-loading-overlay-text{font-family:var(--sign-font-family);color:var(--sign-loading-overlay-text-color);font-size:.875rem;margin:1rem 0 0}@keyframes spin{to{transform:rotate(360deg)}}";let NI=class{constructor(){this._device=null,this._isWasmInitialized=!1,this._module=null,this._disconnectHandler=null,this._eventCallbacks=new Map,this._callbackToHandle=new Map,this._masterCallback=null,this._penAspectCorrector=null,this._unexpectedDisconnectCallbacks=new Set}get device(){return this._device}get isWasmInitialized(){return this._isWasmInitialized}get Module(){return this._module}};typeof NI<"u"&&(window.TabletDriver=NI);var MI=(()=>{var E=globalThis.document?.currentScript?.src;return async function(A={}){var I,g=A,Q=!!globalThis.window,D=!!globalThis.WorkerGlobalScope,S=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";typeof __filename<"u"?E=__filename:D&&(E=self.location.href);var s="",t,M;if(S){var n={};s=__dirname+"/",M=B=>(B=_(B)?new URL(B):B,n.readFileSync(B)),t=async B=>(B=_(B)?new URL(B):B,n.readFileSync(B,void 0)),process.argv.slice(2)}else if(Q||D){try{s=new URL(".",E).href}catch{}D&&(M=B=>{var C=new XMLHttpRequest;return C.open("GET",B,!1),C.responseType="arraybuffer",C.send(null),new Uint8Array(C.response)}),t=async B=>{if(_(B))return new Promise((i,o)=>{var w=new XMLHttpRequest;w.open("GET",B,!0),w.responseType="arraybuffer",w.onload=()=>{w.status==200||w.status==0&&w.response?i(w.response):o(w.status)},w.onerror=o,w.send(null)});var C=await fetch(B,{credentials:"same-origin"});if(C.ok)return C.arrayBuffer();throw Error(C.status+" : "+C.url)}}console.log.bind(console);var f=console.error.bind(console),O,IA=!1,_=B=>B.startsWith("file://"),lA,dA,fA=!1;function OA(){var B=uA.buffer;hA=new Int8Array(B),aA=new Int16Array(B),g.HEAPU8=V=new Uint8Array(B),QA=new Uint16Array(B),BA=new Int32Array(B),r=new Uint32Array(B),qI=new Float32Array(B),lI=new Float64Array(B),II=new BigInt64Array(B),dI=new BigUint64Array(B)}function wA(B){throw g.onAbort?.(B),B=`Aborted(${B})`,f(B),IA=!0,B=new WebAssembly.RuntimeError(B+". Build with -sASSERTIONS for more info."),dA?.(B),B}var sA;async function rI(B){if(!O)try{var C=await t(B);return new Uint8Array(C)}catch{}if(B==sA&&O)B=new Uint8Array(O);else if(M)B=M(B);else throw"both async and sync fetching of the wasm failed";return B}async function AI(B,C){try{var i=await rI(B);return await WebAssembly.instantiate(i,C)}catch(o){f(`failed to asynchronously prepare wasm: ${o}`),wA(o)}}async function fg(B){var C=sA;if(!O&&!_(C)&&!S)try{var i=fetch(C,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(i,B)}catch(o){f(`wasm streaming compile failed: ${o}`),f("falling back to ArrayBuffer instantiation")}return AI(C,B)}var aA,BA,II,hA,qI,lI,QA,r,dI,V,fI=B=>{for(;0<B.length;)B.shift()(g)},OI=[],pI=[],Og=()=>{var B=g.preRun.shift();pI.push(B)};class pg{constructor(C){this.W=C-24}}var pA={},gI=B=>{for(;B.length;){var C=B.pop();B.pop()(C)}};function GA(B){return this.X(r[B>>2])}var EA={},gA={},TA={},xA=class extends Error{constructor(B){super(B),this.name="InternalError"}},yA=(B,C,i)=>{function o(G){if(G=i(G),G.length!==B.length)throw new xA("Mismatched type converter count");for(var R=0;R<B.length;++R)T(B[R],G[R])}B.forEach(G=>TA[G]=C);var w=Array(C.length),a=[],h=0;for(let[G,R]of C.entries())gA.hasOwnProperty(R)?w[G]=gA[R]:(a.push(R),EA.hasOwnProperty(R)||(EA[R]=[]),EA[R].push(()=>{w[G]=gA[R],++h,h===a.length&&o(w)}));a.length===0&&o(w)},q=B=>{for(var C="";;){var i=V[B++];if(!i)return C;C+=String.fromCharCode(i)}},J=class extends Error{constructor(B){super(B),this.name="BindingError"}},Tg=B=>{throw new J(B)};function xg(B,C,i={}){var o=C.name;if(!B)throw new J(`type "${o}" must have a positive integer typeid pointer`);if(gA.hasOwnProperty(B)){if(i.Ja)return;throw new J(`Cannot register type '${o}' twice`)}gA[B]=C,delete TA[B],EA.hasOwnProperty(B)&&(C=EA[B],delete EA[B],C.forEach(w=>w()))}function T(B,C,i={}){return xg(B,C,i)}var TI=(B,C,i)=>{switch(C){case 1:return i?o=>hA[o]:o=>V[o];case 2:return i?o=>aA[o>>1]:o=>QA[o>>1];case 4:return i?o=>BA[o>>2]:o=>r[o>>2];case 8:return i?o=>II[o>>3]:o=>dI[o>>3];default:throw new TypeError(`invalid integer width (${C}): ${B}`)}},CI=B=>{throw new J(B.V.Z.Y.name+" instance already deleted")},BI=!1,xI=()=>{},tA=B=>globalThis.FinalizationRegistry?(BI=new FinalizationRegistry(C=>{C=C.V,--C.count.value,C.count.value===0&&(C.da?C.ga.ha(C.da):C.Z.Y.ha(C.W))}),tA=C=>{var i=C.V;return i.da&&BI.register(C,{V:i},C),C},xI=C=>{BI.unregister(C)},tA(B)):(tA=C=>C,B);function jA(){}var bA=(B,C)=>Object.defineProperty(C,"name",{value:B}),jI={},bI=(B,C,i)=>{if(B[C].ba===void 0){var o=B[C];B[C]=function(...w){if(!B[C].ba.hasOwnProperty(w.length))throw new J(`Function '${i}' called with an invalid number of arguments (${w.length}) - expects one of (${B[C].ba})!`);return B[C].ba[w.length].apply(this,w)},B[C].ba=[],B[C].ba[o.ja]=o}},KA=(B,C,i)=>{if(g.hasOwnProperty(B)){if(i===void 0||g[B].ba!==void 0&&g[B].ba[i]!==void 0)throw new J(`Cannot register public name '${B}' twice`);if(bI(g,B,B),g[B].ba.hasOwnProperty(i))throw new J(`Cannot register multiple overloads of a function with the same number of arguments (${i})!`);g[B].ba[i]=C}else g[B]=C,g[B].ja=i},jg=B=>{B=B.replace(/[^a-zA-Z0-9_]/g,"$");var C=B.charCodeAt(0);return 48<=C&&57>=C?`_${B}`:B};function bg(B,C,i,o,w,a,h,G){this.name=B,this.constructor=C,this.ka=i,this.ha=o,this.ea=w,this.Ea=a,this.na=h,this.Ca=G,this.La=[]}var QI=(B,C,i)=>{for(;C!==i;){if(!C.na)throw new J(`Expected null or instance of ${i.name}, got an instance of ${C.name}`);B=C.na(B),C=C.ea}return B},EI=B=>{if(B===null)return"null";var C=typeof B;return C==="object"||C==="array"||C==="function"?B.toString():""+B};function mg(B,C){if(C===null){if(this.qa)throw new J(`null is not a valid ${this.name}`);return 0}if(!C.V)throw new J(`Cannot pass "${EI(C)}" as a ${this.name}`);if(!C.V.W)throw new J(`Cannot pass deleted object as a pointer of type ${this.name}`);return QI(C.V.W,C.V.Z.Y,this.Y)}function Wg(B,C){if(C===null){if(this.qa)throw new J(`null is not a valid ${this.name}`);if(this.pa){var i=this.sa();return B!==null&&B.push(this.ha,i),i}return 0}if(!C||!C.V)throw new J(`Cannot pass "${EI(C)}" as a ${this.name}`);if(!C.V.W)throw new J(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.oa&&C.V.Z.oa)throw new J(`Cannot convert argument of type ${C.V.ga?C.V.ga.name:C.V.Z.name} to parameter type ${this.name}`);if(i=QI(C.V.W,C.V.Z.Y,this.Y),this.pa){if(C.V.da===void 0)throw new J("Passing raw pointer to smart pointer is illegal");switch(this.Qa){case 0:if(C.V.ga===this)i=C.V.da;else throw new J(`Cannot convert argument of type ${C.V.ga?C.V.ga.name:C.V.Z.name} to parameter type ${this.name}`);break;case 1:i=C.V.da;break;case 2:if(C.V.ga===this)i=C.V.da;else{var o=C.clone();i=this.Ma(i,X(()=>o.delete())),B!==null&&B.push(this.ha,i)}break;default:throw new J("Unsupported sharing policy")}}return i}function Zg(B,C){if(C===null){if(this.qa)throw new J(`null is not a valid ${this.name}`);return 0}if(!C.V)throw new J(`Cannot pass "${EI(C)}" as a ${this.name}`);if(!C.V.W)throw new J(`Cannot pass deleted object as a pointer of type ${this.name}`);if(C.V.Z.oa)throw new J(`Cannot convert argument of type ${C.V.Z.name} to parameter type ${this.name}`);return QI(C.V.W,C.V.Z.Y,this.Y)}var mI=(B,C,i)=>C===i?B:i.ea===void 0?null:(B=mI(B,C,i.ea),B===null?null:i.Ca(B)),ug={},Pg=(B,C)=>{if(C===void 0)throw new J("ptr should not be undefined");for(;B.ea;)C=B.na(C),B=B.ea;return ug[C]},mA=(B,C)=>{if(!C.Z||!C.W)throw new xA("makeClassHandle requires ptr and ptrType");if(!!C.ga!=!!C.da)throw new xA("Both smartPtrType and smartPtr must be specified");return C.count={value:1},tA(Object.create(B,{V:{value:C,writable:!0}}))};function WA(B,C,i,o,w,a,h,G,R,N,K){this.name=B,this.Y=C,this.qa=i,this.oa=o,this.pa=w,this.Ka=a,this.Qa=h,this.ya=G,this.sa=R,this.Ma=N,this.ha=K,w||C.ea!==void 0?this.$=Wg:(this.$=o?mg:Zg,this.aa=null)}var WI=(B,C,i)=>{if(!g.hasOwnProperty(B))throw new xA("Replacing nonexistent public symbol");g[B].ba!==void 0&&i!==void 0?g[B].ba[i]=C:(g[B]=C,g[B].ja=i)},ZI=[],u=(B,C)=>{B=q(B);var i;if((i=ZI[C])||(ZI[C]=i=Eg.get(C)),typeof i!="function")throw new J(`unknown function pointer with signature ${B}: ${C}`);return i};class Xg extends Error{}var uI=B=>{B=Cg(B);var C=q(B);return $(B),C},iI=(B,C)=>{function i(a){w[a]||gA[a]||(TA[a]?TA[a].forEach(i):(o.push(a),w[a]=!0))}var o=[],w={};throw C.forEach(i),new Xg(`${B}: `+o.map(uI).join([", "]))};function PI(B){for(var C=1;C<B.length;++C)if(B[C]!==null&&B[C].aa===void 0)return!0;return!1}function XI(B,C,i,o,w,a){var h=C.length;if(2>h)throw new J("argTypes array size mismatch! Must at least get return value and 'this' types!");var G=C[1]!==null&&i!==null,R=PI(C);i=!C[0].xa;var N=C[0],K=C[1];for(o=[B,Tg,o,w,gI,N.X.bind(N),K?.$.bind(K)],w=2;w<h;++w)N=C[w],o.push(N.$.bind(N));if(!R)for(w=G?1:2;w<C.length;++w)C[w].aa!==null&&o.push(C[w].aa);for(R=PI(C),w=C.length-2,K=[],N=["fn"],G&&N.push("thisWired"),h=0;h<w;++h)K.push(`arg${h}`),N.push(`arg${h}Wired`);K=K.join(","),N=N.join(","),K=`return function (${K}) {
2
2
  `,R&&(K+=`var destructors = [];
3
3
  `);var c=R?"destructors":"null",U="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(G&&(K+=`var thisWired = toClassParamWire(${c}, this);
4
4
  `),h=0;h<w;++h){var e=`toArg${h}Wire`;K+=`var arg${h}Wired = ${e}(${c}, arg${h});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@signosoft/signpad-js",
3
3
  "private": false,
4
- "version": "0.4.1",
4
+ "version": "0.4.2",
5
5
  "browser": {
6
6
  "fs": false
7
7
  },