@documenso/embed-webcomponent 0.2.0 → 0.2.1-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var T,p,ve,E,oe,ye,z,Y,J,G,S={},ge=[],Me=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Z=Array.isArray;function $(e,t){for(var _ in t)e[_]=t[_];return e}function be(e){var t=e.parentNode;t&&t.removeChild(e)}function D(e,t,_){var r,n,o,l={};for(o in t)o=="key"?r=t[o]:o=="ref"?n=t[o]:l[o]=t[o];if(arguments.length>2&&(l.children=arguments.length>3?T.call(arguments,2):_),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)l[o]===void 0&&(l[o]=e.defaultProps[o]);return N(e,l,r,n,null)}function N(e,t,_,r,n){var o={type:e,props:t,key:_,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++ve,__i:-1,__u:0};return n==null&&p.vnode!=null&&p.vnode(o),o}function W(e){return e.children}function F(e,t){this.props=e,this.context=t}function x(e,t){if(t==null)return e.__?x(e.__,e.__i+1):null;for(var _;t<e.__k.length;t++)if((_=e.__k[t])!=null&&_.__e!=null)return _.__e;return typeof e.type=="function"?x(e):null}function ke(e){var t,_;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((_=e.__k[t])!=null&&_.__e!=null){e.__e=e.__c.base=_.__e;break}return ke(e)}}function re(e){(!e.__d&&(e.__d=!0)&&E.push(e)&&!R.__r++||oe!==p.debounceRendering)&&((oe=p.debounceRendering)||ye)(R)}function R(){var e,t,_,r,n,o,l,c;for(E.sort(z);e=E.shift();)e.__d&&(t=E.length,r=void 0,o=(n=(_=e).__v).__e,l=[],c=[],_.__P&&((r=$({},n)).__v=n.__v+1,p.vnode&&p.vnode(r),ee(_.__P,r,n,_.__n,_.__P.namespaceURI,32&n.__u?[o]:null,l,o??x(n),!!(32&n.__u),c),r.__v=n.__v,r.__.__k[r.__i]=r,Ce(l,r,c),r.__e!=o&&ke(r)),E.length>t&&E.sort(z));R.__r=0}function we(e,t,_,r,n,o,l,c,a,s,f){var i,g,u,v,k,y=r&&r.__k||ge,d=t.length;for(_.__d=a,Ue(_,t,y),a=_.__d,i=0;i<d;i++)(u=_.__k[i])!=null&&typeof u!="boolean"&&typeof u!="function"&&(g=u.__i===-1?S:y[u.__i]||S,u.__i=i,ee(e,u,g,n,o,l,c,a,s,f),v=u.__e,u.ref&&g.ref!=u.ref&&(g.ref&&te(g.ref,null,u),f.push(u.ref,u.__c||v,u)),k==null&&v!=null&&(k=v),65536&u.__u||g.__k===u.__k?a=$e(u,a,e):typeof u.type=="function"&&u.__d!==void 0?a=u.__d:v&&(a=v.nextSibling),u.__d=void 0,u.__u&=-196609);_.__d=a,_.__e=k}function Ue(e,t,_){var r,n,o,l,c,a=t.length,s=_.length,f=s,i=0;for(e.__k=[],r=0;r<a;r++)l=r+i,(n=e.__k[r]=(n=t[r])==null||typeof n=="boolean"||typeof n=="function"?null:typeof n=="string"||typeof n=="number"||typeof n=="bigint"||n.constructor==String?N(null,n,null,null,null):Z(n)?N(W,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?N(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=e,n.__b=e.__b+1,c=Ae(n,_,l,f),n.__i=c,o=null,c!==-1&&(f--,(o=_[c])&&(o.__u|=131072)),o==null||o.__v===null?(c==-1&&i--,typeof n.type!="function"&&(n.__u|=65536)):c!==l&&(c==l-1?i--:c==l+1?i++:c>l?f>a-l?i+=c-l:i--:c<l&&(c==l-i?i-=c-l:i++),c!==r+i&&(n.__u|=65536))):(o=_[l])&&o.key==null&&o.__e&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=x(o)),K(o,o,!1),_[l]=null,f--);if(f)for(r=0;r<s;r++)(o=_[r])!=null&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=x(o)),K(o,o))}function $e(e,t,_){var r,n;if(typeof e.type=="function"){for(r=e.__k,n=0;r&&n<r.length;n++)r[n]&&(r[n].__=e,t=$e(r[n],t,_));return t}e.__e!=t&&(t&&e.type&&!_.contains(t)&&(t=x(e)),_.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function Ae(e,t,_,r){var n=e.key,o=e.type,l=_-1,c=_+1,a=t[_];if(a===null||a&&n==a.key&&o===a.type&&!(131072&a.__u))return _;if(r>(a!=null&&!(131072&a.__u)?1:0))for(;l>=0||c<t.length;){if(l>=0){if((a=t[l])&&!(131072&a.__u)&&n==a.key&&o===a.type)return l;l--}if(c<t.length){if((a=t[c])&&!(131072&a.__u)&&n==a.key&&o===a.type)return c;c++}}return-1}function ie(e,t,_){t[0]==="-"?e.setProperty(t,_??""):e[t]=_==null?"":typeof _!="number"||Me.test(t)?_:_+"px"}function A(e,t,_,r,n){var o;e:if(t==="style")if(typeof _=="string")e.style.cssText=_;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)_&&t in _||ie(e.style,t,"");if(_)for(t in _)r&&_[t]===r[t]||ie(e.style,t,_[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=_,_?r?_.u=r.u:(_.u=Y,e.addEventListener(t,o?G:J,o)):e.removeEventListener(t,o?G:J,o);else{if(n=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=_??"";break e}catch{}typeof _=="function"||(_==null||_===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&_==1?"":_))}}function le(e){return function(t){if(this.l){var _=this.l[t.type+e];if(t.t==null)t.t=Y++;else if(t.t<_.u)return;return _(p.event?p.event(t):t)}}}function ee(e,t,_,r,n,o,l,c,a,s){var f,i,g,u,v,k,y,d,h,H,C,L,P,ne,M,q,w=t.type;if(t.constructor!==void 0)return null;128&_.__u&&(a=!!(32&_.__u),o=[c=t.__e=_.__e]),(f=p.__b)&&f(t);e:if(typeof w=="function")try{if(d=t.props,h="prototype"in w&&w.prototype.render,H=(f=w.contextType)&&r[f.__c],C=f?H?H.props.value:f.__:r,_.__c?y=(i=t.__c=_.__c).__=i.__E:(h?t.__c=i=new w(d,C):(t.__c=i=new F(d,C),i.constructor=w,i.render=Oe),H&&H.sub(i),i.props=d,i.state||(i.state={}),i.context=C,i.__n=r,g=i.__d=!0,i.__h=[],i._sb=[]),h&&i.__s==null&&(i.__s=i.state),h&&w.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=$({},i.__s)),$(i.__s,w.getDerivedStateFromProps(d,i.__s))),u=i.props,v=i.state,i.__v=t,g)h&&w.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),h&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(h&&w.getDerivedStateFromProps==null&&d!==u&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(d,C),!i.__e&&(i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(d,i.__s,C)===!1||t.__v===_.__v)){for(t.__v!==_.__v&&(i.props=d,i.state=i.__s,i.__d=!1),t.__e=_.__e,t.__k=_.__k,t.__k.forEach(function(U){U&&(U.__=t)}),L=0;L<i._sb.length;L++)i.__h.push(i._sb[L]);i._sb=[],i.__h.length&&l.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(d,i.__s,C),h&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(u,v,k)})}if(i.context=C,i.props=d,i.__P=e,i.__e=!1,P=p.__r,ne=0,h){for(i.state=i.__s,i.__d=!1,P&&P(t),f=i.render(i.props,i.state,i.context),M=0;M<i._sb.length;M++)i.__h.push(i._sb[M]);i._sb=[]}else do i.__d=!1,P&&P(t),f=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++ne<25);i.state=i.__s,i.getChildContext!=null&&(r=$($({},r),i.getChildContext())),h&&!g&&i.getSnapshotBeforeUpdate!=null&&(k=i.getSnapshotBeforeUpdate(u,v)),we(e,Z(q=f!=null&&f.type===W&&f.key==null?f.props.children:f)?q:[q],t,_,r,n,o,l,c,a,s),i.base=t.__e,t.__u&=-161,i.__h.length&&l.push(i),y&&(i.__E=i.__=null)}catch(U){if(t.__v=null,a||o!=null){for(t.__u|=a?160:32;c&&c.nodeType===8&&c.nextSibling;)c=c.nextSibling;o[o.indexOf(c)]=null,t.__e=c}else t.__e=_.__e,t.__k=_.__k;p.__e(U,t,_)}else o==null&&t.__v===_.__v?(t.__k=_.__k,t.__e=_.__e):t.__e=Fe(_.__e,t,_,r,n,o,l,a,s);(f=p.diffed)&&f(t)}function Ce(e,t,_){t.__d=void 0;for(var r=0;r<_.length;r++)te(_[r],_[++r],_[++r]);p.__c&&p.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(o){o.call(n)})}catch(o){p.__e(o,n.__v)}})}function Fe(e,t,_,r,n,o,l,c,a){var s,f,i,g,u,v,k,y=_.props,d=t.props,h=t.type;if(h==="svg"?n="http://www.w3.org/2000/svg":h==="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),o!=null){for(s=0;s<o.length;s++)if((u=o[s])&&"setAttribute"in u==!!h&&(h?u.localName===h:u.nodeType===3)){e=u,o[s]=null;break}}if(e==null){if(h===null)return document.createTextNode(d);e=document.createElementNS(n,h,d.is&&d),o=null,c=!1}if(h===null)y===d||c&&e.data===d||(e.data=d);else{if(o=o&&T.call(e.childNodes),y=_.props||S,!c&&o!=null)for(y={},s=0;s<e.attributes.length;s++)y[(u=e.attributes[s]).name]=u.value;for(s in y)if(u=y[s],s!="children"){if(s=="dangerouslySetInnerHTML")i=u;else if(s!=="key"&&!(s in d)){if(s=="value"&&"defaultValue"in d||s=="checked"&&"defaultChecked"in d)continue;A(e,s,null,u,n)}}for(s in d)u=d[s],s=="children"?g=u:s=="dangerouslySetInnerHTML"?f=u:s=="value"?v=u:s=="checked"?k=u:s==="key"||c&&typeof u!="function"||y[s]===u||A(e,s,u,y[s],n);if(f)c||i&&(f.__html===i.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(i&&(e.innerHTML=""),we(e,Z(g)?g:[g],t,_,r,h==="foreignObject"?"http://www.w3.org/1999/xhtml":n,o,l,o?o[0]:_.__k&&x(_,0),c,a),o!=null)for(s=o.length;s--;)o[s]!=null&&be(o[s]);c||(s="value",v!==void 0&&(v!==e[s]||h==="progress"&&!v||h==="option"&&v!==y[s])&&A(e,s,v,y[s],n),s="checked",k!==void 0&&k!==e[s]&&A(e,s,k,y[s],n))}return e}function te(e,t,_){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(n){p.__e(n,_)}}function K(e,t,_){var r,n;if(p.unmount&&p.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||te(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){p.__e(o,t)}r.base=r.__P=null}if(r=e.__k)for(n=0;n<r.length;n++)r[n]&&K(r[n],t,_||typeof e.type!="function");_||e.__e==null||be(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function Oe(e,t,_){return this.constructor(e,_)}function V(e,t,_){var r,n,o,l;p.__&&p.__(e,t),n=(r=typeof _=="function")?null:_&&_.__k||t.__k,o=[],l=[],ee(t,e=(!r&&_||t).__k=D(W,null,[e]),n||S,S,t.namespaceURI,!r&&_?[_]:n?null:t.firstChild?T.call(t.childNodes):null,o,!r&&_?_:n?n.__e:t.firstChild,r,l),Ce(o,e,l)}function Ee(e,t){V(e,t,Ee)}function xe(e,t,_){var r,n,o,l,c=$({},e.props);for(o in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)o=="key"?r=t[o]:o=="ref"?n=t[o]:c[o]=t[o]===void 0&&l!==void 0?l[o]:t[o];return arguments.length>2&&(c.children=arguments.length>3?T.call(arguments,2):_),N(e.type,c,r||e.key,n||e.ref,null)}T=ge.slice,p={__e:function(e,t,_,r){for(var n,o,l;t=t.__;)if((n=t.__c)&&!n.__)try{if((o=n.constructor)&&o.getDerivedStateFromError!=null&&(n.setState(o.getDerivedStateFromError(e)),l=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,r||{}),l=n.__d),l)return n.__E=n}catch(c){e=c}throw e}},ve=0,F.prototype.setState=function(e,t){var _;_=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=$({},this.state),typeof e=="function"&&(e=e($({},_),this.props)),e&&$(_,e),e!=null&&this.__v&&(t&&this._sb.push(t),re(this))},F.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),re(this))},F.prototype.render=W,E=[],ye=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,z=function(e,t){return e.__v.__b-t.__v.__b},R.__r=0,Y=0,J=le(!1),G=le(!0);function _e(){return(_e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var _=arguments[t];for(var r in _)Object.prototype.hasOwnProperty.call(_,r)&&(e[r]=_[r])}return e}).apply(this,arguments)}var Re=["context","children"];function Ie(e){this.getChildContext=function(){return e.context};var t=e.children,_=function(r,n){if(r==null)return{};var o,l,c={},a=Object.keys(r);for(l=0;l<a.length;l++)n.indexOf(o=a[l])>=0||(c[o]=r[o]);return c}(e,Re);return xe(t,_)}function je(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=D(Ie,_e({},this._props,{context:e.detail.context}),function t(_,r){if(_.nodeType===3)return _.data;if(_.nodeType!==1)return null;var n=[],o={},l=0,c=_.attributes,a=_.childNodes;for(l=c.length;l--;)c[l].name!=="slot"&&(o[c[l].name]=c[l].value,o[De(c[l].name)]=c[l].value);for(l=a.length;l--;){var s=t(a[l],null),f=a[l].slot;f?o[f]=D(ce,{name:f},s):n[l]=s}var i=r?D(ce,null,n):n;return D(r||_.nodeName.toLowerCase(),o,i)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Ee:V)(this._vdom,this._root)}function De(e){return e.replace(/-(\w)/g,function(t,_){return _?_.toUpperCase():""})}function We(e,t,_){if(this._vdom){var r={};r[e]=_=_??void 0,r[De(e)]=_,this._vdom=xe(this._vdom,r),V(this._vdom,this._root)}}function Ve(){V(this._vdom=null,this._root)}function ce(e,t){var _=this;return D("slot",_e({},e,{ref:function(r){r?(_.ref=r,_._listener||(_._listener=function(n){n.stopPropagation(),n.detail.context=t},r.addEventListener("_preact",_._listener))):_.ref.removeEventListener("_preact",_._listener)}}))}function He(e,t,_,r){function n(){var o=Reflect.construct(HTMLElement,[],n);return o._vdomComponent=e,o._root=o,o}return(n.prototype=Object.create(HTMLElement.prototype)).constructor=n,n.prototype.connectedCallback=je,n.prototype.attributeChangedCallback=We,n.prototype.disconnectedCallback=Ve,_=_||e.observedAttributes||Object.keys(e.propTypes||{}),n.observedAttributes=_,_.forEach(function(o){Object.defineProperty(n.prototype,o,{get:function(){return this._vdom.props[o]},set:function(l){this._vdom?this.attributeChangedCallback(o,null,l):(this._props||(this._props={}),this._props[o]=l,this.connectedCallback());var c=typeof l;l!=null&&c!=="string"&&c!=="boolean"&&c!=="number"||this.setAttribute(o,l)}})}),customElements.define(t||e.tagName||e.displayName||e.name,n)}var I,b,B,se,Q=0,Pe=[],m=p,ae=m.__b,ue=m.__r,fe=m.diffed,de=m.__c,pe=m.unmount,he=m.__;function Ne(e,t){m.__h&&m.__h(b,e,Q||t),Q=0;var _=b.__H||(b.__H={__:[],__h:[]});return e>=_.__.length&&_.__.push({}),_.__[e]}function j(e,t){var _=Ne(I++,3);!m.__s&&Te(_.__H,t)&&(_.__=e,_.i=t,b.__H.__h.push(_))}function Se(e){return Q=5,qe(function(){return{current:e}},[])}function qe(e,t){var _=Ne(I++,7);return Te(_.__H,t)&&(_.__=e(),_.__H=t,_.__h=e),_.__}function Be(){for(var e;e=Pe.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(O),e.__H.__h.forEach(X),e.__H.__h=[]}catch(t){e.__H.__h=[],m.__e(t,e.__v)}}m.__b=function(e){b=null,ae&&ae(e)},m.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),he&&he(e,t)},m.__r=function(e){ue&&ue(e),I=0;var t=(b=e.__c).__H;t&&(B===b?(t.__h=[],b.__h=[],t.__.forEach(function(_){_.__N&&(_.__=_.__N),_.i=_.__N=void 0})):(t.__h.forEach(O),t.__h.forEach(X),t.__h=[],I=0)),B=b},m.diffed=function(e){fe&&fe(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Pe.push(t)!==1&&se===m.requestAnimationFrame||((se=m.requestAnimationFrame)||ze)(Be)),t.__H.__.forEach(function(_){_.i&&(_.__H=_.i),_.i=void 0})),B=b=null},m.__c=function(e,t){t.some(function(_){try{_.__h.forEach(O),_.__h=_.__h.filter(function(r){return!r.__||X(r)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],m.__e(r,_.__v)}}),de&&de(e,t)},m.unmount=function(e){pe&&pe(e);var t,_=e.__c;_&&_.__H&&(_.__H.__.forEach(function(r){try{O(r)}catch(n){t=n}}),_.__H=void 0,t&&m.__e(t,_.__v))};var me=typeof requestAnimationFrame=="function";function ze(e){var t,_=function(){clearTimeout(r),me&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(_,100);me&&(t=requestAnimationFrame(_))}function O(e){var t=b,_=e.__c;typeof _=="function"&&(e.__c=void 0,_()),b=t}function X(e){var t=b;e.__c=e.__(),b=t}function Te(e,t){return!e||e.length!==t.length||t.some(function(_,r){return _!==e[r]})}var Je=0;function Le(e,t,_,r,n,o){t||(t={});var l,c,a=t;if("ref"in a)for(c in a={},t)c=="ref"?l=t[c]:a[c]=t[c];var s={type:e,props:a,key:_,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Je,__i:-1,__u:0,__source:n,__self:o};return p.vnode&&p.vnode(s),s}function Ge(e){const t=Se(null);function _(){const n=e.host||"https://app.documenso.com",o=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,email:e.email,lockEmail:e.lockEmail,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled}))),l=new URL(`/embed/direct/${e.token}`,n);return e.externalId&&l.searchParams.set("externalId",e.externalId),`${l}#${o}`}function r(n){var o,l,c,a,s,f;if(((o=t.current)==null?void 0:o.contentWindow)===n.source)switch(n.data.action){case"document-ready":(l=e.onDocumentReady)==null||l.call(e);break;case"document-completed":(c=e.onDocumentCompleted)==null||c.call(e,n.data.data);break;case"document-error":(a=e.onDocumentError)==null||a.call(e,n.data.data);break;case"field-signed":(s=e.onFieldSigned)==null||s.call(e);break;case"field-unsigned":(f=e.onFieldUnsigned)==null||f.call(e);break}}return j(()=>{window.addEventListener("message",r)},[]),j(()=>()=>{window.removeEventListener("message",r)},[]),Le("iframe",{ref:t,className:e.className,src:_()})}function Ke(e){const t=Se(null);function _(){const n=e.host||"https://app.documenso.com",o=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled})));return`${new URL(`/embed/sign/${e.token}`,n)}#${o}`}function r(n){var o,l,c,a;if(((o=t.current)==null?void 0:o.contentWindow)===n.source)switch(n.data.action){case"document-ready":(l=e.onDocumentReady)==null||l.call(e);break;case"document-completed":(c=e.onDocumentCompleted)==null||c.call(e,n.data.data);break;case"document-error":(a=e.onDocumentError)==null||a.call(e,n.data.data);break}}return j(()=>{window.addEventListener("message",r)},[]),j(()=>()=>{window.removeEventListener("message",r)},[]),Le("iframe",{ref:t,className:e.className,src:_()})}He(Ge,"documenso-embed-direct-template",["token","host","externalId","css","email","lockEmail","name","lockName","onDocumentReady","onDocumentCompleted","onDocumentError"]);He(Ke,"documenso-embed-sign-document",["token","host","css","name","lockName","onDocumentReady","onDocumentCompleted","onDocumentError"]);
1
+ "use strict";var T,p,ve,E,oe,ye,z,Y,J,G,S={},ge=[],Me=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Z=Array.isArray;function $(e,t){for(var _ in t)e[_]=t[_];return e}function be(e){var t=e.parentNode;t&&t.removeChild(e)}function D(e,t,_){var r,n,o,l={};for(o in t)o=="key"?r=t[o]:o=="ref"?n=t[o]:l[o]=t[o];if(arguments.length>2&&(l.children=arguments.length>3?T.call(arguments,2):_),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)l[o]===void 0&&(l[o]=e.defaultProps[o]);return N(e,l,r,n,null)}function N(e,t,_,r,n){var o={type:e,props:t,key:_,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++ve,__i:-1,__u:0};return n==null&&p.vnode!=null&&p.vnode(o),o}function W(e){return e.children}function A(e,t){this.props=e,this.context=t}function x(e,t){if(t==null)return e.__?x(e.__,e.__i+1):null;for(var _;t<e.__k.length;t++)if((_=e.__k[t])!=null&&_.__e!=null)return _.__e;return typeof e.type=="function"?x(e):null}function ke(e){var t,_;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((_=e.__k[t])!=null&&_.__e!=null){e.__e=e.__c.base=_.__e;break}return ke(e)}}function re(e){(!e.__d&&(e.__d=!0)&&E.push(e)&&!O.__r++||oe!==p.debounceRendering)&&((oe=p.debounceRendering)||ye)(O)}function O(){var e,t,_,r,n,o,l,c;for(E.sort(z);e=E.shift();)e.__d&&(t=E.length,r=void 0,o=(n=(_=e).__v).__e,l=[],c=[],_.__P&&((r=$({},n)).__v=n.__v+1,p.vnode&&p.vnode(r),ee(_.__P,r,n,_.__n,_.__P.namespaceURI,32&n.__u?[o]:null,l,o??x(n),!!(32&n.__u),c),r.__v=n.__v,r.__.__k[r.__i]=r,Ce(l,r,c),r.__e!=o&&ke(r)),E.length>t&&E.sort(z));O.__r=0}function we(e,t,_,r,n,o,l,c,a,s,f){var i,g,u,v,k,y=r&&r.__k||ge,d=t.length;for(_.__d=a,Ue(_,t,y),a=_.__d,i=0;i<d;i++)(u=_.__k[i])!=null&&typeof u!="boolean"&&typeof u!="function"&&(g=u.__i===-1?S:y[u.__i]||S,u.__i=i,ee(e,u,g,n,o,l,c,a,s,f),v=u.__e,u.ref&&g.ref!=u.ref&&(g.ref&&te(g.ref,null,u),f.push(u.ref,u.__c||v,u)),k==null&&v!=null&&(k=v),65536&u.__u||g.__k===u.__k?a=$e(u,a,e):typeof u.type=="function"&&u.__d!==void 0?a=u.__d:v&&(a=v.nextSibling),u.__d=void 0,u.__u&=-196609);_.__d=a,_.__e=k}function Ue(e,t,_){var r,n,o,l,c,a=t.length,s=_.length,f=s,i=0;for(e.__k=[],r=0;r<a;r++)l=r+i,(n=e.__k[r]=(n=t[r])==null||typeof n=="boolean"||typeof n=="function"?null:typeof n=="string"||typeof n=="number"||typeof n=="bigint"||n.constructor==String?N(null,n,null,null,null):Z(n)?N(W,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?N(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=e,n.__b=e.__b+1,c=Re(n,_,l,f),n.__i=c,o=null,c!==-1&&(f--,(o=_[c])&&(o.__u|=131072)),o==null||o.__v===null?(c==-1&&i--,typeof n.type!="function"&&(n.__u|=65536)):c!==l&&(c==l-1?i--:c==l+1?i++:c>l?f>a-l?i+=c-l:i--:c<l&&(c==l-i?i-=c-l:i++),c!==r+i&&(n.__u|=65536))):(o=_[l])&&o.key==null&&o.__e&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=x(o)),K(o,o,!1),_[l]=null,f--);if(f)for(r=0;r<s;r++)(o=_[r])!=null&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=x(o)),K(o,o))}function $e(e,t,_){var r,n;if(typeof e.type=="function"){for(r=e.__k,n=0;r&&n<r.length;n++)r[n]&&(r[n].__=e,t=$e(r[n],t,_));return t}e.__e!=t&&(t&&e.type&&!_.contains(t)&&(t=x(e)),_.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function Re(e,t,_,r){var n=e.key,o=e.type,l=_-1,c=_+1,a=t[_];if(a===null||a&&n==a.key&&o===a.type&&!(131072&a.__u))return _;if(r>(a!=null&&!(131072&a.__u)?1:0))for(;l>=0||c<t.length;){if(l>=0){if((a=t[l])&&!(131072&a.__u)&&n==a.key&&o===a.type)return l;l--}if(c<t.length){if((a=t[c])&&!(131072&a.__u)&&n==a.key&&o===a.type)return c;c++}}return-1}function ie(e,t,_){t[0]==="-"?e.setProperty(t,_??""):e[t]=_==null?"":typeof _!="number"||Me.test(t)?_:_+"px"}function R(e,t,_,r,n){var o;e:if(t==="style")if(typeof _=="string")e.style.cssText=_;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)_&&t in _||ie(e.style,t,"");if(_)for(t in _)r&&_[t]===r[t]||ie(e.style,t,_[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=_,_?r?_.u=r.u:(_.u=Y,e.addEventListener(t,o?G:J,o)):e.removeEventListener(t,o?G:J,o);else{if(n=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=_??"";break e}catch{}typeof _=="function"||(_==null||_===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&_==1?"":_))}}function le(e){return function(t){if(this.l){var _=this.l[t.type+e];if(t.t==null)t.t=Y++;else if(t.t<_.u)return;return _(p.event?p.event(t):t)}}}function ee(e,t,_,r,n,o,l,c,a,s){var f,i,g,u,v,k,y,d,h,P,C,L,H,ne,M,q,w=t.type;if(t.constructor!==void 0)return null;128&_.__u&&(a=!!(32&_.__u),o=[c=t.__e=_.__e]),(f=p.__b)&&f(t);e:if(typeof w=="function")try{if(d=t.props,h="prototype"in w&&w.prototype.render,P=(f=w.contextType)&&r[f.__c],C=f?P?P.props.value:f.__:r,_.__c?y=(i=t.__c=_.__c).__=i.__E:(h?t.__c=i=new w(d,C):(t.__c=i=new A(d,C),i.constructor=w,i.render=Fe),P&&P.sub(i),i.props=d,i.state||(i.state={}),i.context=C,i.__n=r,g=i.__d=!0,i.__h=[],i._sb=[]),h&&i.__s==null&&(i.__s=i.state),h&&w.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=$({},i.__s)),$(i.__s,w.getDerivedStateFromProps(d,i.__s))),u=i.props,v=i.state,i.__v=t,g)h&&w.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),h&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(h&&w.getDerivedStateFromProps==null&&d!==u&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(d,C),!i.__e&&(i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(d,i.__s,C)===!1||t.__v===_.__v)){for(t.__v!==_.__v&&(i.props=d,i.state=i.__s,i.__d=!1),t.__e=_.__e,t.__k=_.__k,t.__k.forEach(function(U){U&&(U.__=t)}),L=0;L<i._sb.length;L++)i.__h.push(i._sb[L]);i._sb=[],i.__h.length&&l.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(d,i.__s,C),h&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(u,v,k)})}if(i.context=C,i.props=d,i.__P=e,i.__e=!1,H=p.__r,ne=0,h){for(i.state=i.__s,i.__d=!1,H&&H(t),f=i.render(i.props,i.state,i.context),M=0;M<i._sb.length;M++)i.__h.push(i._sb[M]);i._sb=[]}else do i.__d=!1,H&&H(t),f=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++ne<25);i.state=i.__s,i.getChildContext!=null&&(r=$($({},r),i.getChildContext())),h&&!g&&i.getSnapshotBeforeUpdate!=null&&(k=i.getSnapshotBeforeUpdate(u,v)),we(e,Z(q=f!=null&&f.type===W&&f.key==null?f.props.children:f)?q:[q],t,_,r,n,o,l,c,a,s),i.base=t.__e,t.__u&=-161,i.__h.length&&l.push(i),y&&(i.__E=i.__=null)}catch(U){if(t.__v=null,a||o!=null){for(t.__u|=a?160:32;c&&c.nodeType===8&&c.nextSibling;)c=c.nextSibling;o[o.indexOf(c)]=null,t.__e=c}else t.__e=_.__e,t.__k=_.__k;p.__e(U,t,_)}else o==null&&t.__v===_.__v?(t.__k=_.__k,t.__e=_.__e):t.__e=Ae(_.__e,t,_,r,n,o,l,a,s);(f=p.diffed)&&f(t)}function Ce(e,t,_){t.__d=void 0;for(var r=0;r<_.length;r++)te(_[r],_[++r],_[++r]);p.__c&&p.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(o){o.call(n)})}catch(o){p.__e(o,n.__v)}})}function Ae(e,t,_,r,n,o,l,c,a){var s,f,i,g,u,v,k,y=_.props,d=t.props,h=t.type;if(h==="svg"?n="http://www.w3.org/2000/svg":h==="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),o!=null){for(s=0;s<o.length;s++)if((u=o[s])&&"setAttribute"in u==!!h&&(h?u.localName===h:u.nodeType===3)){e=u,o[s]=null;break}}if(e==null){if(h===null)return document.createTextNode(d);e=document.createElementNS(n,h,d.is&&d),o=null,c=!1}if(h===null)y===d||c&&e.data===d||(e.data=d);else{if(o=o&&T.call(e.childNodes),y=_.props||S,!c&&o!=null)for(y={},s=0;s<e.attributes.length;s++)y[(u=e.attributes[s]).name]=u.value;for(s in y)if(u=y[s],s!="children"){if(s=="dangerouslySetInnerHTML")i=u;else if(s!=="key"&&!(s in d)){if(s=="value"&&"defaultValue"in d||s=="checked"&&"defaultChecked"in d)continue;R(e,s,null,u,n)}}for(s in d)u=d[s],s=="children"?g=u:s=="dangerouslySetInnerHTML"?f=u:s=="value"?v=u:s=="checked"?k=u:s==="key"||c&&typeof u!="function"||y[s]===u||R(e,s,u,y[s],n);if(f)c||i&&(f.__html===i.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(i&&(e.innerHTML=""),we(e,Z(g)?g:[g],t,_,r,h==="foreignObject"?"http://www.w3.org/1999/xhtml":n,o,l,o?o[0]:_.__k&&x(_,0),c,a),o!=null)for(s=o.length;s--;)o[s]!=null&&be(o[s]);c||(s="value",v!==void 0&&(v!==e[s]||h==="progress"&&!v||h==="option"&&v!==y[s])&&R(e,s,v,y[s],n),s="checked",k!==void 0&&k!==e[s]&&R(e,s,k,y[s],n))}return e}function te(e,t,_){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(n){p.__e(n,_)}}function K(e,t,_){var r,n;if(p.unmount&&p.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||te(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){p.__e(o,t)}r.base=r.__P=null}if(r=e.__k)for(n=0;n<r.length;n++)r[n]&&K(r[n],t,_||typeof e.type!="function");_||e.__e==null||be(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function Fe(e,t,_){return this.constructor(e,_)}function V(e,t,_){var r,n,o,l;p.__&&p.__(e,t),n=(r=typeof _=="function")?null:_&&_.__k||t.__k,o=[],l=[],ee(t,e=(!r&&_||t).__k=D(W,null,[e]),n||S,S,t.namespaceURI,!r&&_?[_]:n?null:t.firstChild?T.call(t.childNodes):null,o,!r&&_?_:n?n.__e:t.firstChild,r,l),Ce(o,e,l)}function Ee(e,t){V(e,t,Ee)}function xe(e,t,_){var r,n,o,l,c=$({},e.props);for(o in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)o=="key"?r=t[o]:o=="ref"?n=t[o]:c[o]=t[o]===void 0&&l!==void 0?l[o]:t[o];return arguments.length>2&&(c.children=arguments.length>3?T.call(arguments,2):_),N(e.type,c,r||e.key,n||e.ref,null)}T=ge.slice,p={__e:function(e,t,_,r){for(var n,o,l;t=t.__;)if((n=t.__c)&&!n.__)try{if((o=n.constructor)&&o.getDerivedStateFromError!=null&&(n.setState(o.getDerivedStateFromError(e)),l=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,r||{}),l=n.__d),l)return n.__E=n}catch(c){e=c}throw e}},ve=0,A.prototype.setState=function(e,t){var _;_=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=$({},this.state),typeof e=="function"&&(e=e($({},_),this.props)),e&&$(_,e),e!=null&&this.__v&&(t&&this._sb.push(t),re(this))},A.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),re(this))},A.prototype.render=W,E=[],ye=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,z=function(e,t){return e.__v.__b-t.__v.__b},O.__r=0,Y=0,J=le(!1),G=le(!0);function _e(){return(_e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var _=arguments[t];for(var r in _)Object.prototype.hasOwnProperty.call(_,r)&&(e[r]=_[r])}return e}).apply(this,arguments)}var Oe=["context","children"];function je(e){this.getChildContext=function(){return e.context};var t=e.children,_=function(r,n){if(r==null)return{};var o,l,c={},a=Object.keys(r);for(l=0;l<a.length;l++)n.indexOf(o=a[l])>=0||(c[o]=r[o]);return c}(e,Oe);return xe(t,_)}function Ie(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=D(je,_e({},this._props,{context:e.detail.context}),function t(_,r){if(_.nodeType===3)return _.data;if(_.nodeType!==1)return null;var n=[],o={},l=0,c=_.attributes,a=_.childNodes;for(l=c.length;l--;)c[l].name!=="slot"&&(o[c[l].name]=c[l].value,o[De(c[l].name)]=c[l].value);for(l=a.length;l--;){var s=t(a[l],null),f=a[l].slot;f?o[f]=D(ce,{name:f},s):n[l]=s}var i=r?D(ce,null,n):n;return D(r||_.nodeName.toLowerCase(),o,i)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Ee:V)(this._vdom,this._root)}function De(e){return e.replace(/-(\w)/g,function(t,_){return _?_.toUpperCase():""})}function We(e,t,_){if(this._vdom){var r={};r[e]=_=_??void 0,r[De(e)]=_,this._vdom=xe(this._vdom,r),V(this._vdom,this._root)}}function Ve(){V(this._vdom=null,this._root)}function ce(e,t){var _=this;return D("slot",_e({},e,{ref:function(r){r?(_.ref=r,_._listener||(_._listener=function(n){n.stopPropagation(),n.detail.context=t},r.addEventListener("_preact",_._listener))):_.ref.removeEventListener("_preact",_._listener)}}))}function Pe(e,t,_,r){function n(){var o=Reflect.construct(HTMLElement,[],n);return o._vdomComponent=e,o._root=o,o}return(n.prototype=Object.create(HTMLElement.prototype)).constructor=n,n.prototype.connectedCallback=Ie,n.prototype.attributeChangedCallback=We,n.prototype.disconnectedCallback=Ve,_=_||e.observedAttributes||Object.keys(e.propTypes||{}),n.observedAttributes=_,_.forEach(function(o){Object.defineProperty(n.prototype,o,{get:function(){return this._vdom.props[o]},set:function(l){this._vdom?this.attributeChangedCallback(o,null,l):(this._props||(this._props={}),this._props[o]=l,this.connectedCallback());var c=typeof l;l!=null&&c!=="string"&&c!=="boolean"&&c!=="number"||this.setAttribute(o,l)}})}),customElements.define(t||e.tagName||e.displayName||e.name,n)}var j,b,B,se,Q=0,He=[],m=p,ae=m.__b,ue=m.__r,fe=m.diffed,de=m.__c,pe=m.unmount,he=m.__;function Ne(e,t){m.__h&&m.__h(b,e,Q||t),Q=0;var _=b.__H||(b.__H={__:[],__h:[]});return e>=_.__.length&&_.__.push({}),_.__[e]}function I(e,t){var _=Ne(j++,3);!m.__s&&Te(_.__H,t)&&(_.__=e,_.i=t,b.__H.__h.push(_))}function Se(e){return Q=5,qe(function(){return{current:e}},[])}function qe(e,t){var _=Ne(j++,7);return Te(_.__H,t)&&(_.__=e(),_.__H=t,_.__h=e),_.__}function Be(){for(var e;e=He.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(F),e.__H.__h.forEach(X),e.__H.__h=[]}catch(t){e.__H.__h=[],m.__e(t,e.__v)}}m.__b=function(e){b=null,ae&&ae(e)},m.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),he&&he(e,t)},m.__r=function(e){ue&&ue(e),j=0;var t=(b=e.__c).__H;t&&(B===b?(t.__h=[],b.__h=[],t.__.forEach(function(_){_.__N&&(_.__=_.__N),_.i=_.__N=void 0})):(t.__h.forEach(F),t.__h.forEach(X),t.__h=[],j=0)),B=b},m.diffed=function(e){fe&&fe(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(He.push(t)!==1&&se===m.requestAnimationFrame||((se=m.requestAnimationFrame)||ze)(Be)),t.__H.__.forEach(function(_){_.i&&(_.__H=_.i),_.i=void 0})),B=b=null},m.__c=function(e,t){t.some(function(_){try{_.__h.forEach(F),_.__h=_.__h.filter(function(r){return!r.__||X(r)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],m.__e(r,_.__v)}}),de&&de(e,t)},m.unmount=function(e){pe&&pe(e);var t,_=e.__c;_&&_.__H&&(_.__H.__.forEach(function(r){try{F(r)}catch(n){t=n}}),_.__H=void 0,t&&m.__e(t,_.__v))};var me=typeof requestAnimationFrame=="function";function ze(e){var t,_=function(){clearTimeout(r),me&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(_,100);me&&(t=requestAnimationFrame(_))}function F(e){var t=b,_=e.__c;typeof _=="function"&&(e.__c=void 0,_()),b=t}function X(e){var t=b;e.__c=e.__(),b=t}function Te(e,t){return!e||e.length!==t.length||t.some(function(_,r){return _!==e[r]})}var Je=0;function Le(e,t,_,r,n,o){t||(t={});var l,c,a=t;if("ref"in a)for(c in a={},t)c=="ref"?l=t[c]:a[c]=t[c];var s={type:e,props:a,key:_,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Je,__i:-1,__u:0,__source:n,__self:o};return p.vnode&&p.vnode(s),s}function Ge(e){const t=Se(null);function _(){const n=e.host||"https://app.documenso.com",o=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,email:e.email,lockEmail:e.lockEmail,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,...e.additionalProps}))),l=new URL(`/embed/direct/${e.token}`,n);return e.externalId&&l.searchParams.set("externalId",e.externalId),`${l}#${o}`}function r(n){var o,l,c,a,s,f;if(((o=t.current)==null?void 0:o.contentWindow)===n.source)switch(n.data.action){case"document-ready":(l=e.onDocumentReady)==null||l.call(e);break;case"document-completed":(c=e.onDocumentCompleted)==null||c.call(e,n.data.data);break;case"document-error":(a=e.onDocumentError)==null||a.call(e,n.data.data);break;case"field-signed":(s=e.onFieldSigned)==null||s.call(e);break;case"field-unsigned":(f=e.onFieldUnsigned)==null||f.call(e);break}}return I(()=>{window.addEventListener("message",r)},[]),I(()=>()=>{window.removeEventListener("message",r)},[]),Le("iframe",{ref:t,className:e.className,src:_()})}function Ke(e){const t=Se(null);function _(){const n=e.host||"https://app.documenso.com",o=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,allowDocumentRejection:e.allowDocumentRejection,...e.additionalProps})));return`${new URL(`/embed/sign/${e.token}`,n)}#${o}`}function r(n){var o,l,c,a,s;if(((o=t.current)==null?void 0:o.contentWindow)===n.source)switch(n.data.action){case"document-ready":(l=e.onDocumentReady)==null||l.call(e);break;case"document-completed":(c=e.onDocumentCompleted)==null||c.call(e,n.data.data);break;case"document-error":(a=e.onDocumentError)==null||a.call(e,n.data.data);break;case"document-rejected":(s=e.onDocumentRejected)==null||s.call(e,n.data.data);break}}return I(()=>{window.addEventListener("message",r)},[]),I(()=>()=>{window.removeEventListener("message",r)},[]),Le("iframe",{ref:t,className:e.className,src:_()})}Pe(Ge,"documenso-embed-direct-template",["token","host","externalId","css","email","lockEmail","name","lockName","onDocumentReady","onDocumentCompleted","onDocumentError"]);Pe(Ke,"documenso-embed-sign-document",["token","host","css","name","lockName","onDocumentReady","onDocumentCompleted","onDocumentError"]);
package/dist/index.mjs CHANGED
@@ -20,7 +20,7 @@ function N(e, t, _, r, n) {
20
20
  function W(e) {
21
21
  return e.children;
22
22
  }
23
- function F(e, t) {
23
+ function A(e, t) {
24
24
  this.props = e, this.context = t;
25
25
  }
26
26
  function x(e, t) {
@@ -39,12 +39,12 @@ function ke(e) {
39
39
  }
40
40
  }
41
41
  function re(e) {
42
- (!e.__d && (e.__d = !0) && E.push(e) && !R.__r++ || oe !== p.debounceRendering) && ((oe = p.debounceRendering) || ye)(R);
42
+ (!e.__d && (e.__d = !0) && E.push(e) && !O.__r++ || oe !== p.debounceRendering) && ((oe = p.debounceRendering) || ye)(O);
43
43
  }
44
- function R() {
44
+ function O() {
45
45
  var e, t, _, r, n, o, l, c;
46
46
  for (E.sort(z); e = E.shift(); ) e.__d && (t = E.length, r = void 0, o = (n = (_ = e).__v).__e, l = [], c = [], _.__P && ((r = $({}, n)).__v = n.__v + 1, p.vnode && p.vnode(r), ee(_.__P, r, n, _.__n, _.__P.namespaceURI, 32 & n.__u ? [o] : null, l, o ?? x(n), !!(32 & n.__u), c), r.__v = n.__v, r.__.__k[r.__i] = r, Ce(l, r, c), r.__e != o && ke(r)), E.length > t && E.sort(z));
47
- R.__r = 0;
47
+ O.__r = 0;
48
48
  }
49
49
  function we(e, t, _, r, n, o, l, c, a, s, f) {
50
50
  var i, g, u, v, k, y = r && r.__k || ge, d = t.length;
@@ -53,7 +53,7 @@ function we(e, t, _, r, n, o, l, c, a, s, f) {
53
53
  }
54
54
  function Ue(e, t, _) {
55
55
  var r, n, o, l, c, a = t.length, s = _.length, f = s, i = 0;
56
- for (e.__k = [], r = 0; r < a; r++) l = r + i, (n = e.__k[r] = (n = t[r]) == null || typeof n == "boolean" || typeof n == "function" ? null : typeof n == "string" || typeof n == "number" || typeof n == "bigint" || n.constructor == String ? N(null, n, null, null, null) : Z(n) ? N(W, { children: n }, null, null, null) : n.constructor === void 0 && n.__b > 0 ? N(n.type, n.props, n.key, n.ref ? n.ref : null, n.__v) : n) != null ? (n.__ = e, n.__b = e.__b + 1, c = Ae(n, _, l, f), n.__i = c, o = null, c !== -1 && (f--, (o = _[c]) && (o.__u |= 131072)), o == null || o.__v === null ? (c == -1 && i--, typeof n.type != "function" && (n.__u |= 65536)) : c !== l && (c == l - 1 ? i-- : c == l + 1 ? i++ : c > l ? f > a - l ? i += c - l : i-- : c < l && (c == l - i ? i -= c - l : i++), c !== r + i && (n.__u |= 65536))) : (o = _[l]) && o.key == null && o.__e && !(131072 & o.__u) && (o.__e == e.__d && (e.__d = x(o)), K(o, o, !1), _[l] = null, f--);
56
+ for (e.__k = [], r = 0; r < a; r++) l = r + i, (n = e.__k[r] = (n = t[r]) == null || typeof n == "boolean" || typeof n == "function" ? null : typeof n == "string" || typeof n == "number" || typeof n == "bigint" || n.constructor == String ? N(null, n, null, null, null) : Z(n) ? N(W, { children: n }, null, null, null) : n.constructor === void 0 && n.__b > 0 ? N(n.type, n.props, n.key, n.ref ? n.ref : null, n.__v) : n) != null ? (n.__ = e, n.__b = e.__b + 1, c = Re(n, _, l, f), n.__i = c, o = null, c !== -1 && (f--, (o = _[c]) && (o.__u |= 131072)), o == null || o.__v === null ? (c == -1 && i--, typeof n.type != "function" && (n.__u |= 65536)) : c !== l && (c == l - 1 ? i-- : c == l + 1 ? i++ : c > l ? f > a - l ? i += c - l : i-- : c < l && (c == l - i ? i -= c - l : i++), c !== r + i && (n.__u |= 65536))) : (o = _[l]) && o.key == null && o.__e && !(131072 & o.__u) && (o.__e == e.__d && (e.__d = x(o)), K(o, o, !1), _[l] = null, f--);
57
57
  if (f) for (r = 0; r < s; r++) (o = _[r]) != null && !(131072 & o.__u) && (o.__e == e.__d && (e.__d = x(o)), K(o, o));
58
58
  }
59
59
  function $e(e, t, _) {
@@ -68,7 +68,7 @@ function $e(e, t, _) {
68
68
  while (t != null && t.nodeType === 8);
69
69
  return t;
70
70
  }
71
- function Ae(e, t, _, r) {
71
+ function Re(e, t, _, r) {
72
72
  var n = e.key, o = e.type, l = _ - 1, c = _ + 1, a = t[_];
73
73
  if (a === null || a && n == a.key && o === a.type && !(131072 & a.__u)) return _;
74
74
  if (r > (a != null && !(131072 & a.__u) ? 1 : 0)) for (; l >= 0 || c < t.length; ) {
@@ -86,7 +86,7 @@ function Ae(e, t, _, r) {
86
86
  function ie(e, t, _) {
87
87
  t[0] === "-" ? e.setProperty(t, _ ?? "") : e[t] = _ == null ? "" : typeof _ != "number" || Me.test(t) ? _ : _ + "px";
88
88
  }
89
- function A(e, t, _, r, n) {
89
+ function R(e, t, _, r, n) {
90
90
  var o;
91
91
  e: if (t === "style") if (typeof _ == "string") e.style.cssText = _;
92
92
  else {
@@ -115,11 +115,11 @@ function le(e) {
115
115
  };
116
116
  }
117
117
  function ee(e, t, _, r, n, o, l, c, a, s) {
118
- var f, i, g, u, v, k, y, d, h, H, C, L, P, ne, M, q, w = t.type;
118
+ var f, i, g, u, v, k, y, d, h, P, C, L, H, ne, M, q, w = t.type;
119
119
  if (t.constructor !== void 0) return null;
120
120
  128 & _.__u && (a = !!(32 & _.__u), o = [c = t.__e = _.__e]), (f = p.__b) && f(t);
121
121
  e: if (typeof w == "function") try {
122
- if (d = t.props, h = "prototype" in w && w.prototype.render, H = (f = w.contextType) && r[f.__c], C = f ? H ? H.props.value : f.__ : r, _.__c ? y = (i = t.__c = _.__c).__ = i.__E : (h ? t.__c = i = new w(d, C) : (t.__c = i = new F(d, C), i.constructor = w, i.render = Oe), H && H.sub(i), i.props = d, i.state || (i.state = {}), i.context = C, i.__n = r, g = i.__d = !0, i.__h = [], i._sb = []), h && i.__s == null && (i.__s = i.state), h && w.getDerivedStateFromProps != null && (i.__s == i.state && (i.__s = $({}, i.__s)), $(i.__s, w.getDerivedStateFromProps(d, i.__s))), u = i.props, v = i.state, i.__v = t, g) h && w.getDerivedStateFromProps == null && i.componentWillMount != null && i.componentWillMount(), h && i.componentDidMount != null && i.__h.push(i.componentDidMount);
122
+ if (d = t.props, h = "prototype" in w && w.prototype.render, P = (f = w.contextType) && r[f.__c], C = f ? P ? P.props.value : f.__ : r, _.__c ? y = (i = t.__c = _.__c).__ = i.__E : (h ? t.__c = i = new w(d, C) : (t.__c = i = new A(d, C), i.constructor = w, i.render = Fe), P && P.sub(i), i.props = d, i.state || (i.state = {}), i.context = C, i.__n = r, g = i.__d = !0, i.__h = [], i._sb = []), h && i.__s == null && (i.__s = i.state), h && w.getDerivedStateFromProps != null && (i.__s == i.state && (i.__s = $({}, i.__s)), $(i.__s, w.getDerivedStateFromProps(d, i.__s))), u = i.props, v = i.state, i.__v = t, g) h && w.getDerivedStateFromProps == null && i.componentWillMount != null && i.componentWillMount(), h && i.componentDidMount != null && i.__h.push(i.componentDidMount);
123
123
  else {
124
124
  if (h && w.getDerivedStateFromProps == null && d !== u && i.componentWillReceiveProps != null && i.componentWillReceiveProps(d, C), !i.__e && (i.shouldComponentUpdate != null && i.shouldComponentUpdate(d, i.__s, C) === !1 || t.__v === _.__v)) {
125
125
  for (t.__v !== _.__v && (i.props = d, i.state = i.__s, i.__d = !1), t.__e = _.__e, t.__k = _.__k, t.__k.forEach(function(U) {
@@ -132,11 +132,11 @@ function ee(e, t, _, r, n, o, l, c, a, s) {
132
132
  i.componentDidUpdate(u, v, k);
133
133
  });
134
134
  }
135
- if (i.context = C, i.props = d, i.__P = e, i.__e = !1, P = p.__r, ne = 0, h) {
136
- for (i.state = i.__s, i.__d = !1, P && P(t), f = i.render(i.props, i.state, i.context), M = 0; M < i._sb.length; M++) i.__h.push(i._sb[M]);
135
+ if (i.context = C, i.props = d, i.__P = e, i.__e = !1, H = p.__r, ne = 0, h) {
136
+ for (i.state = i.__s, i.__d = !1, H && H(t), f = i.render(i.props, i.state, i.context), M = 0; M < i._sb.length; M++) i.__h.push(i._sb[M]);
137
137
  i._sb = [];
138
138
  } else do
139
- i.__d = !1, P && P(t), f = i.render(i.props, i.state, i.context), i.state = i.__s;
139
+ i.__d = !1, H && H(t), f = i.render(i.props, i.state, i.context), i.state = i.__s;
140
140
  while (i.__d && ++ne < 25);
141
141
  i.state = i.__s, i.getChildContext != null && (r = $($({}, r), i.getChildContext())), h && !g && i.getSnapshotBeforeUpdate != null && (k = i.getSnapshotBeforeUpdate(u, v)), we(e, Z(q = f != null && f.type === W && f.key == null ? f.props.children : f) ? q : [q], t, _, r, n, o, l, c, a, s), i.base = t.__e, t.__u &= -161, i.__h.length && l.push(i), y && (i.__E = i.__ = null);
142
142
  } catch (U) {
@@ -146,7 +146,7 @@ function ee(e, t, _, r, n, o, l, c, a, s) {
146
146
  } else t.__e = _.__e, t.__k = _.__k;
147
147
  p.__e(U, t, _);
148
148
  }
149
- else o == null && t.__v === _.__v ? (t.__k = _.__k, t.__e = _.__e) : t.__e = Fe(_.__e, t, _, r, n, o, l, a, s);
149
+ else o == null && t.__v === _.__v ? (t.__k = _.__k, t.__e = _.__e) : t.__e = Ae(_.__e, t, _, r, n, o, l, a, s);
150
150
  (f = p.diffed) && f(t);
151
151
  }
152
152
  function Ce(e, t, _) {
@@ -162,7 +162,7 @@ function Ce(e, t, _) {
162
162
  }
163
163
  });
164
164
  }
165
- function Fe(e, t, _, r, n, o, l, c, a) {
165
+ function Ae(e, t, _, r, n, o, l, c, a) {
166
166
  var s, f, i, g, u, v, k, y = _.props, d = t.props, h = t.type;
167
167
  if (h === "svg" ? n = "http://www.w3.org/2000/svg" : h === "math" ? n = "http://www.w3.org/1998/Math/MathML" : n || (n = "http://www.w3.org/1999/xhtml"), o != null) {
168
168
  for (s = 0; s < o.length; s++) if ((u = o[s]) && "setAttribute" in u == !!h && (h ? u.localName === h : u.nodeType === 3)) {
@@ -181,13 +181,13 @@ function Fe(e, t, _, r, n, o, l, c, a) {
181
181
  if (s == "dangerouslySetInnerHTML") i = u;
182
182
  else if (s !== "key" && !(s in d)) {
183
183
  if (s == "value" && "defaultValue" in d || s == "checked" && "defaultChecked" in d) continue;
184
- A(e, s, null, u, n);
184
+ R(e, s, null, u, n);
185
185
  }
186
186
  }
187
- for (s in d) u = d[s], s == "children" ? g = u : s == "dangerouslySetInnerHTML" ? f = u : s == "value" ? v = u : s == "checked" ? k = u : s === "key" || c && typeof u != "function" || y[s] === u || A(e, s, u, y[s], n);
187
+ for (s in d) u = d[s], s == "children" ? g = u : s == "dangerouslySetInnerHTML" ? f = u : s == "value" ? v = u : s == "checked" ? k = u : s === "key" || c && typeof u != "function" || y[s] === u || R(e, s, u, y[s], n);
188
188
  if (f) c || i && (f.__html === i.__html || f.__html === e.innerHTML) || (e.innerHTML = f.__html), t.__k = [];
189
189
  else if (i && (e.innerHTML = ""), we(e, Z(g) ? g : [g], t, _, r, h === "foreignObject" ? "http://www.w3.org/1999/xhtml" : n, o, l, o ? o[0] : _.__k && x(_, 0), c, a), o != null) for (s = o.length; s--; ) o[s] != null && be(o[s]);
190
- c || (s = "value", v !== void 0 && (v !== e[s] || h === "progress" && !v || h === "option" && v !== y[s]) && A(e, s, v, y[s], n), s = "checked", k !== void 0 && k !== e[s] && A(e, s, k, y[s], n));
190
+ c || (s = "value", v !== void 0 && (v !== e[s] || h === "progress" && !v || h === "option" && v !== y[s]) && R(e, s, v, y[s], n), s = "checked", k !== void 0 && k !== e[s] && R(e, s, k, y[s], n));
191
191
  }
192
192
  return e;
193
193
  }
@@ -214,7 +214,7 @@ function K(e, t, _) {
214
214
  if (r = e.__k) for (n = 0; n < r.length; n++) r[n] && K(r[n], t, _ || typeof e.type != "function");
215
215
  _ || e.__e == null || be(e.__e), e.__c = e.__ = e.__e = e.__d = void 0;
216
216
  }
217
- function Oe(e, t, _) {
217
+ function Fe(e, t, _) {
218
218
  return this.constructor(e, _);
219
219
  }
220
220
  function V(e, t, _) {
@@ -236,14 +236,14 @@ T = ge.slice, p = { __e: function(e, t, _, r) {
236
236
  e = c;
237
237
  }
238
238
  throw e;
239
- } }, ve = 0, F.prototype.setState = function(e, t) {
239
+ } }, ve = 0, A.prototype.setState = function(e, t) {
240
240
  var _;
241
241
  _ = this.__s != null && this.__s !== this.state ? this.__s : this.__s = $({}, this.state), typeof e == "function" && (e = e($({}, _), this.props)), e && $(_, e), e != null && this.__v && (t && this._sb.push(t), re(this));
242
- }, F.prototype.forceUpdate = function(e) {
242
+ }, A.prototype.forceUpdate = function(e) {
243
243
  this.__v && (this.__e = !0, e && this.__h.push(e), re(this));
244
- }, F.prototype.render = W, E = [], ye = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, z = function(e, t) {
244
+ }, A.prototype.render = W, E = [], ye = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, z = function(e, t) {
245
245
  return e.__v.__b - t.__v.__b;
246
- }, R.__r = 0, Y = 0, J = le(!1), G = le(!0);
246
+ }, O.__r = 0, Y = 0, J = le(!1), G = le(!0);
247
247
  function _e() {
248
248
  return (_e = Object.assign ? Object.assign.bind() : function(e) {
249
249
  for (var t = 1; t < arguments.length; t++) {
@@ -253,8 +253,8 @@ function _e() {
253
253
  return e;
254
254
  }).apply(this, arguments);
255
255
  }
256
- var Re = ["context", "children"];
257
- function Ie(e) {
256
+ var Oe = ["context", "children"];
257
+ function je(e) {
258
258
  this.getChildContext = function() {
259
259
  return e.context;
260
260
  };
@@ -263,12 +263,12 @@ function Ie(e) {
263
263
  var o, l, c = {}, a = Object.keys(r);
264
264
  for (l = 0; l < a.length; l++) n.indexOf(o = a[l]) >= 0 || (c[o] = r[o]);
265
265
  return c;
266
- }(e, Re);
266
+ }(e, Oe);
267
267
  return xe(t, _);
268
268
  }
269
- function je() {
269
+ function Ie() {
270
270
  var e = new CustomEvent("_preact", { detail: {}, bubbles: !0, cancelable: !0 });
271
- this.dispatchEvent(e), this._vdom = D(Ie, _e({}, this._props, { context: e.detail.context }), function t(_, r) {
271
+ this.dispatchEvent(e), this._vdom = D(je, _e({}, this._props, { context: e.detail.context }), function t(_, r) {
272
272
  if (_.nodeType === 3) return _.data;
273
273
  if (_.nodeType !== 1) return null;
274
274
  var n = [], o = {}, l = 0, c = _.attributes, a = _.childNodes;
@@ -303,12 +303,12 @@ function ce(e, t) {
303
303
  }, r.addEventListener("_preact", _._listener))) : _.ref.removeEventListener("_preact", _._listener);
304
304
  } }));
305
305
  }
306
- function He(e, t, _, r) {
306
+ function Pe(e, t, _, r) {
307
307
  function n() {
308
308
  var o = Reflect.construct(HTMLElement, [], n);
309
309
  return o._vdomComponent = e, o._root = o, o;
310
310
  }
311
- return (n.prototype = Object.create(HTMLElement.prototype)).constructor = n, n.prototype.connectedCallback = je, n.prototype.attributeChangedCallback = We, n.prototype.disconnectedCallback = Ve, _ = _ || e.observedAttributes || Object.keys(e.propTypes || {}), n.observedAttributes = _, _.forEach(function(o) {
311
+ return (n.prototype = Object.create(HTMLElement.prototype)).constructor = n, n.prototype.connectedCallback = Ie, n.prototype.attributeChangedCallback = We, n.prototype.disconnectedCallback = Ve, _ = _ || e.observedAttributes || Object.keys(e.propTypes || {}), n.observedAttributes = _, _.forEach(function(o) {
312
312
  Object.defineProperty(n.prototype, o, { get: function() {
313
313
  return this._vdom.props[o];
314
314
  }, set: function(l) {
@@ -318,14 +318,14 @@ function He(e, t, _, r) {
318
318
  } });
319
319
  }), customElements.define(t || e.tagName || e.displayName || e.name, n);
320
320
  }
321
- var I, b, B, se, Q = 0, Pe = [], m = p, ae = m.__b, ue = m.__r, fe = m.diffed, de = m.__c, pe = m.unmount, he = m.__;
321
+ var j, b, B, se, Q = 0, He = [], m = p, ae = m.__b, ue = m.__r, fe = m.diffed, de = m.__c, pe = m.unmount, he = m.__;
322
322
  function Ne(e, t) {
323
323
  m.__h && m.__h(b, e, Q || t), Q = 0;
324
324
  var _ = b.__H || (b.__H = { __: [], __h: [] });
325
325
  return e >= _.__.length && _.__.push({}), _.__[e];
326
326
  }
327
- function j(e, t) {
328
- var _ = Ne(I++, 3);
327
+ function I(e, t) {
328
+ var _ = Ne(j++, 3);
329
329
  !m.__s && Te(_.__H, t) && (_.__ = e, _.i = t, b.__H.__h.push(_));
330
330
  }
331
331
  function Se(e) {
@@ -334,12 +334,12 @@ function Se(e) {
334
334
  }, []);
335
335
  }
336
336
  function qe(e, t) {
337
- var _ = Ne(I++, 7);
337
+ var _ = Ne(j++, 7);
338
338
  return Te(_.__H, t) && (_.__ = e(), _.__H = t, _.__h = e), _.__;
339
339
  }
340
340
  function Be() {
341
- for (var e; e = Pe.shift(); ) if (e.__P && e.__H) try {
342
- e.__H.__h.forEach(O), e.__H.__h.forEach(X), e.__H.__h = [];
341
+ for (var e; e = He.shift(); ) if (e.__P && e.__H) try {
342
+ e.__H.__h.forEach(F), e.__H.__h.forEach(X), e.__H.__h = [];
343
343
  } catch (t) {
344
344
  e.__H.__h = [], m.__e(t, e.__v);
345
345
  }
@@ -349,21 +349,21 @@ m.__b = function(e) {
349
349
  }, m.__ = function(e, t) {
350
350
  e && t.__k && t.__k.__m && (e.__m = t.__k.__m), he && he(e, t);
351
351
  }, m.__r = function(e) {
352
- ue && ue(e), I = 0;
352
+ ue && ue(e), j = 0;
353
353
  var t = (b = e.__c).__H;
354
354
  t && (B === b ? (t.__h = [], b.__h = [], t.__.forEach(function(_) {
355
355
  _.__N && (_.__ = _.__N), _.i = _.__N = void 0;
356
- })) : (t.__h.forEach(O), t.__h.forEach(X), t.__h = [], I = 0)), B = b;
356
+ })) : (t.__h.forEach(F), t.__h.forEach(X), t.__h = [], j = 0)), B = b;
357
357
  }, m.diffed = function(e) {
358
358
  fe && fe(e);
359
359
  var t = e.__c;
360
- t && t.__H && (t.__H.__h.length && (Pe.push(t) !== 1 && se === m.requestAnimationFrame || ((se = m.requestAnimationFrame) || ze)(Be)), t.__H.__.forEach(function(_) {
360
+ t && t.__H && (t.__H.__h.length && (He.push(t) !== 1 && se === m.requestAnimationFrame || ((se = m.requestAnimationFrame) || ze)(Be)), t.__H.__.forEach(function(_) {
361
361
  _.i && (_.__H = _.i), _.i = void 0;
362
362
  })), B = b = null;
363
363
  }, m.__c = function(e, t) {
364
364
  t.some(function(_) {
365
365
  try {
366
- _.__h.forEach(O), _.__h = _.__h.filter(function(r) {
366
+ _.__h.forEach(F), _.__h = _.__h.filter(function(r) {
367
367
  return !r.__ || X(r);
368
368
  });
369
369
  } catch (r) {
@@ -377,7 +377,7 @@ m.__b = function(e) {
377
377
  var t, _ = e.__c;
378
378
  _ && _.__H && (_.__H.__.forEach(function(r) {
379
379
  try {
380
- O(r);
380
+ F(r);
381
381
  } catch (n) {
382
382
  t = n;
383
383
  }
@@ -390,7 +390,7 @@ function ze(e) {
390
390
  }, r = setTimeout(_, 100);
391
391
  me && (t = requestAnimationFrame(_));
392
392
  }
393
- function O(e) {
393
+ function F(e) {
394
394
  var t = b, _ = e.__c;
395
395
  typeof _ == "function" && (e.__c = void 0, _()), b = t;
396
396
  }
@@ -423,7 +423,8 @@ function Ge(e) {
423
423
  lockEmail: e.lockEmail,
424
424
  css: e.css,
425
425
  cssVars: e.cssVars,
426
- darkModeDisabled: e.darkModeDisabled
426
+ darkModeDisabled: e.darkModeDisabled,
427
+ ...e.additionalProps
427
428
  })
428
429
  )
429
430
  ), l = new URL(`/embed/direct/${e.token}`, n);
@@ -450,9 +451,9 @@ function Ge(e) {
450
451
  break;
451
452
  }
452
453
  }
453
- return j(() => {
454
+ return I(() => {
454
455
  window.addEventListener("message", r);
455
- }, []), j(() => () => {
456
+ }, []), I(() => () => {
456
457
  window.removeEventListener("message", r);
457
458
  }, []), /* @__PURE__ */ Le("iframe", { ref: t, className: e.className, src: _() });
458
459
  }
@@ -466,14 +467,16 @@ function Ke(e) {
466
467
  lockName: e.lockName,
467
468
  css: e.css,
468
469
  cssVars: e.cssVars,
469
- darkModeDisabled: e.darkModeDisabled
470
+ darkModeDisabled: e.darkModeDisabled,
471
+ allowDocumentRejection: e.allowDocumentRejection,
472
+ ...e.additionalProps
470
473
  })
471
474
  )
472
475
  );
473
476
  return `${new URL(`/embed/sign/${e.token}`, n)}#${o}`;
474
477
  }
475
478
  function r(n) {
476
- var o, l, c, a;
479
+ var o, l, c, a, s;
477
480
  if (((o = t.current) == null ? void 0 : o.contentWindow) === n.source)
478
481
  switch (n.data.action) {
479
482
  case "document-ready":
@@ -485,15 +488,18 @@ function Ke(e) {
485
488
  case "document-error":
486
489
  (a = e.onDocumentError) == null || a.call(e, n.data.data);
487
490
  break;
491
+ case "document-rejected":
492
+ (s = e.onDocumentRejected) == null || s.call(e, n.data.data);
493
+ break;
488
494
  }
489
495
  }
490
- return j(() => {
496
+ return I(() => {
491
497
  window.addEventListener("message", r);
492
- }, []), j(() => () => {
498
+ }, []), I(() => () => {
493
499
  window.removeEventListener("message", r);
494
500
  }, []), /* @__PURE__ */ Le("iframe", { ref: t, className: e.className, src: _() });
495
501
  }
496
- He(Ge, "documenso-embed-direct-template", [
502
+ Pe(Ge, "documenso-embed-direct-template", [
497
503
  "token",
498
504
  "host",
499
505
  "externalId",
@@ -506,7 +512,7 @@ He(Ge, "documenso-embed-direct-template", [
506
512
  "onDocumentCompleted",
507
513
  "onDocumentError"
508
514
  ]);
509
- He(Ke, "documenso-embed-sign-document", [
515
+ Pe(Ke, "documenso-embed-sign-document", [
510
516
  "token",
511
517
  "host",
512
518
  "css",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@documenso/embed-webcomponent",
3
- "version": "0.2.0",
3
+ "version": "0.2.1-rc.0",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist"