@documenso/embed-webcomponent 0.1.0 → 0.2.0-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,C,oe,ye,J,Y,V,G,S={},ge=[],Ue=/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 H(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 D(e,l,r,n,null)}function D(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 M(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)&&C.push(e)&&!R.__r++||oe!==p.debounceRendering)&&((oe=p.debounceRendering)||ye)(R)}function R(){var e,t,_,r,n,o,l,c;for(C.sort(J);e=C.shift();)e.__d&&(t=C.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,Ee(l,r,c),r.__e!=o&&ke(r)),C.length>t&&C.sort(J));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,Ae(_,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 Ae(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?D(null,n,null,null,null):Z(n)?D(W,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?D(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=e,n.__b=e.__b+1,c=Fe(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 Fe(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"||Ue.test(t)?_:_+"px"}function F(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:V,o)):e.removeEventListener(t,o?G:V,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,E,L,N,ne,U,B,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],E=f?P?P.props.value:f.__:r,_.__c?y=(i=t.__c=_.__c).__=i.__E:(h?t.__c=i=new w(d,E):(t.__c=i=new M(d,E),i.constructor=w,i.render=Oe),P&&P.sub(i),i.props=d,i.state||(i.state={}),i.context=E,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,E),!i.__e&&(i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(d,i.__s,E)===!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(A){A&&(A.__=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,E),h&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(u,v,k)})}if(i.context=E,i.props=d,i.__P=e,i.__e=!1,N=p.__r,ne=0,h){for(i.state=i.__s,i.__d=!1,N&&N(t),f=i.render(i.props,i.state,i.context),U=0;U<i._sb.length;U++)i.__h.push(i._sb[U]);i._sb=[]}else do i.__d=!1,N&&N(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(B=f!=null&&f.type===W&&f.key==null?f.props.children:f)?B:[B],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(A){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(A,t,_)}else o==null&&t.__v===_.__v?(t.__k=_.__k,t.__e=_.__e):t.__e=Me(_.__e,t,_,r,n,o,l,a,s);(f=p.diffed)&&f(t)}function Ee(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 Me(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;F(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||F(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])&&F(e,s,v,y[s],n),s="checked",k!==void 0&&k!==e[s]&&F(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 q(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=H(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),Ee(o,e,l)}function Ce(e,t){q(e,t,Ce)}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):_),D(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,M.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))},M.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),re(this))},M.prototype.render=W,C=[],ye=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,J=function(e,t){return e.__v.__b-t.__v.__b},R.__r=0,Y=0,V=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=H(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[He(c[l].name)]=c[l].value);for(l=a.length;l--;){var s=t(a[l],null),f=a[l].slot;f?o[f]=H(ce,{name:f},s):n[l]=s}var i=r?H(ce,null,n):n;return H(r||_.nodeName.toLowerCase(),o,i)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Ce:q)(this._vdom,this._root)}function He(e){return e.replace(/-(\w)/g,function(t,_){return _?_.toUpperCase():""})}function We(e,t,_){if(this._vdom){var r={};r[e]=_=_??void 0,r[He(e)]=_,this._vdom=xe(this._vdom,r),q(this._vdom,this._root)}}function qe(){q(this._vdom=null,this._root)}function ce(e,t){var _=this;return H("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=je,n.prototype.attributeChangedCallback=We,n.prototype.disconnectedCallback=qe,_=_||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,z,se,Q=0,Ne=[],m=p,ae=m.__b,ue=m.__r,fe=m.diffed,de=m.__c,pe=m.unmount,he=m.__;function De(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 _=De(I++,3);!m.__s&&Te(_.__H,t)&&(_.__=e,_.i=t,b.__H.__h.push(_))}function Se(e){return Q=5,Be(function(){return{current:e}},[])}function Be(e,t){var _=De(I++,7);return Te(_.__H,t)&&(_.__=e(),_.__H=t,_.__h=e),_.__}function ze(){for(var e;e=Ne.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&&(z===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)),z=b},m.diffed=function(e){fe&&fe(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ne.push(t)!==1&&se===m.requestAnimationFrame||((se=m.requestAnimationFrame)||Je)(ze)),t.__H.__.forEach(function(_){_.i&&(_.__H=_.i),_.i=void 0})),z=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 Je(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 Ve=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:--Ve,__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(JSON.stringify({name:e.name,lockName:e.lockName,email:e.email,lockEmail:e.lockEmail,css:e.css})),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(JSON.stringify({name:e.name,lockName:e.lockName,css:e.css}));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:_()})}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"]);
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(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(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"]);
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var T, p, ve, C, oe, ye, J, Y, V, G, S = {}, ge = [], Ue = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Z = Array.isArray;
1
+ 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;
2
2
  function $(e, t) {
3
3
  for (var _ in t) e[_] = t[_];
4
4
  return e;
@@ -7,20 +7,20 @@ function be(e) {
7
7
  var t = e.parentNode;
8
8
  t && t.removeChild(e);
9
9
  }
10
- function H(e, t, _) {
10
+ function D(e, t, _) {
11
11
  var r, n, o, l = {};
12
12
  for (o in t) o == "key" ? r = t[o] : o == "ref" ? n = t[o] : l[o] = t[o];
13
13
  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]);
14
- return D(e, l, r, n, null);
14
+ return N(e, l, r, n, null);
15
15
  }
16
- function D(e, t, _, r, n) {
16
+ function N(e, t, _, r, n) {
17
17
  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 };
18
18
  return n == null && p.vnode != null && p.vnode(o), o;
19
19
  }
20
20
  function W(e) {
21
21
  return e.children;
22
22
  }
23
- function M(e, t) {
23
+ function F(e, t) {
24
24
  this.props = e, this.context = t;
25
25
  }
26
26
  function x(e, t) {
@@ -39,21 +39,21 @@ function ke(e) {
39
39
  }
40
40
  }
41
41
  function re(e) {
42
- (!e.__d && (e.__d = !0) && C.push(e) && !R.__r++ || oe !== p.debounceRendering) && ((oe = p.debounceRendering) || ye)(R);
42
+ (!e.__d && (e.__d = !0) && E.push(e) && !R.__r++ || oe !== p.debounceRendering) && ((oe = p.debounceRendering) || ye)(R);
43
43
  }
44
44
  function R() {
45
45
  var e, t, _, r, n, o, l, c;
46
- for (C.sort(J); e = C.shift(); ) e.__d && (t = C.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, Ee(l, r, c), r.__e != o && ke(r)), C.length > t && C.sort(J));
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
47
  R.__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;
51
- for (_.__d = a, Ae(_, 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);
51
+ 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);
52
52
  _.__d = a, _.__e = k;
53
53
  }
54
- function Ae(e, t, _) {
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 ? D(null, n, null, null, null) : Z(n) ? D(W, { children: n }, null, null, null) : n.constructor === void 0 && n.__b > 0 ? D(n.type, n.props, n.key, n.ref ? n.ref : null, n.__v) : n) != null ? (n.__ = e, n.__b = e.__b + 1, c = Fe(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 = 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--);
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 Fe(e, t, _, r) {
71
+ function Ae(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; ) {
@@ -84,16 +84,16 @@ function Fe(e, t, _, r) {
84
84
  return -1;
85
85
  }
86
86
  function ie(e, t, _) {
87
- t[0] === "-" ? e.setProperty(t, _ ?? "") : e[t] = _ == null ? "" : typeof _ != "number" || Ue.test(t) ? _ : _ + "px";
87
+ t[0] === "-" ? e.setProperty(t, _ ?? "") : e[t] = _ == null ? "" : typeof _ != "number" || Me.test(t) ? _ : _ + "px";
88
88
  }
89
- function F(e, t, _, r, n) {
89
+ function A(e, t, _, r, n) {
90
90
  var o;
91
91
  e: if (t === "style") if (typeof _ == "string") e.style.cssText = _;
92
92
  else {
93
93
  if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) _ && t in _ || ie(e.style, t, "");
94
94
  if (_) for (t in _) r && _[t] === r[t] || ie(e.style, t, _[t]);
95
95
  }
96
- 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 : V, o)) : e.removeEventListener(t, o ? G : V, o);
96
+ 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);
97
97
  else {
98
98
  if (n == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
99
99
  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 {
@@ -115,41 +115,41 @@ 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, P, E, L, N, ne, U, B, w = t.type;
118
+ var f, i, g, u, v, k, y, d, h, H, C, L, P, 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, P = (f = w.contextType) && r[f.__c], E = f ? P ? P.props.value : f.__ : r, _.__c ? y = (i = t.__c = _.__c).__ = i.__E : (h ? t.__c = i = new w(d, E) : (t.__c = i = new M(d, E), i.constructor = w, i.render = Oe), P && P.sub(i), i.props = d, i.state || (i.state = {}), i.context = E, 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, 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);
123
123
  else {
124
- if (h && w.getDerivedStateFromProps == null && d !== u && i.componentWillReceiveProps != null && i.componentWillReceiveProps(d, E), !i.__e && (i.shouldComponentUpdate != null && i.shouldComponentUpdate(d, i.__s, E) === !1 || t.__v === _.__v)) {
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(A) {
126
- A && (A.__ = t);
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
+ 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) {
126
+ U && (U.__ = t);
127
127
  }), L = 0; L < i._sb.length; L++) i.__h.push(i._sb[L]);
128
128
  i._sb = [], i.__h.length && l.push(i);
129
129
  break e;
130
130
  }
131
- i.componentWillUpdate != null && i.componentWillUpdate(d, i.__s, E), h && i.componentDidUpdate != null && i.__h.push(function() {
131
+ i.componentWillUpdate != null && i.componentWillUpdate(d, i.__s, C), h && i.componentDidUpdate != null && i.__h.push(function() {
132
132
  i.componentDidUpdate(u, v, k);
133
133
  });
134
134
  }
135
- if (i.context = E, i.props = d, i.__P = e, i.__e = !1, N = p.__r, ne = 0, h) {
136
- for (i.state = i.__s, i.__d = !1, N && N(t), f = i.render(i.props, i.state, i.context), U = 0; U < i._sb.length; U++) i.__h.push(i._sb[U]);
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]);
137
137
  i._sb = [];
138
138
  } else do
139
- i.__d = !1, N && N(t), f = i.render(i.props, i.state, i.context), i.state = i.__s;
139
+ i.__d = !1, P && P(t), f = i.render(i.props, i.state, i.context), i.state = i.__s;
140
140
  while (i.__d && ++ne < 25);
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(B = f != null && f.type === W && f.key == null ? f.props.children : f) ? B : [B], 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
- } catch (A) {
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
+ } catch (U) {
143
143
  if (t.__v = null, a || o != null) {
144
144
  for (t.__u |= a ? 160 : 32; c && c.nodeType === 8 && c.nextSibling; ) c = c.nextSibling;
145
145
  o[o.indexOf(c)] = null, t.__e = c;
146
146
  } else t.__e = _.__e, t.__k = _.__k;
147
- p.__e(A, t, _);
147
+ p.__e(U, t, _);
148
148
  }
149
- else o == null && t.__v === _.__v ? (t.__k = _.__k, t.__e = _.__e) : t.__e = Me(_.__e, t, _, r, n, o, l, a, s);
149
+ else o == null && t.__v === _.__v ? (t.__k = _.__k, t.__e = _.__e) : t.__e = Fe(_.__e, t, _, r, n, o, l, a, s);
150
150
  (f = p.diffed) && f(t);
151
151
  }
152
- function Ee(e, t, _) {
152
+ function Ce(e, t, _) {
153
153
  t.__d = void 0;
154
154
  for (var r = 0; r < _.length; r++) te(_[r], _[++r], _[++r]);
155
155
  p.__c && p.__c(t, e), e.some(function(n) {
@@ -162,7 +162,7 @@ function Ee(e, t, _) {
162
162
  }
163
163
  });
164
164
  }
165
- function Me(e, t, _, r, n, o, l, c, a) {
165
+ function Fe(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 Me(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
- F(e, s, null, u, n);
184
+ A(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 || F(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 || A(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]) && F(e, s, v, y[s], n), s = "checked", k !== void 0 && k !== e[s] && F(e, s, k, y[s], n));
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));
191
191
  }
192
192
  return e;
193
193
  }
@@ -217,17 +217,17 @@ function K(e, t, _) {
217
217
  function Oe(e, t, _) {
218
218
  return this.constructor(e, _);
219
219
  }
220
- function q(e, t, _) {
220
+ function V(e, t, _) {
221
221
  var r, n, o, l;
222
- p.__ && p.__(e, t), n = (r = typeof _ == "function") ? null : _ && _.__k || t.__k, o = [], l = [], ee(t, e = (!r && _ || t).__k = H(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), Ee(o, e, l);
222
+ 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);
223
223
  }
224
- function Ce(e, t) {
225
- q(e, t, Ce);
224
+ function Ee(e, t) {
225
+ V(e, t, Ee);
226
226
  }
227
227
  function xe(e, t, _) {
228
228
  var r, n, o, l, c = $({}, e.props);
229
229
  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];
230
- return arguments.length > 2 && (c.children = arguments.length > 3 ? T.call(arguments, 2) : _), D(e.type, c, r || e.key, n || e.ref, null);
230
+ return arguments.length > 2 && (c.children = arguments.length > 3 ? T.call(arguments, 2) : _), N(e.type, c, r || e.key, n || e.ref, null);
231
231
  }
232
232
  T = ge.slice, p = { __e: function(e, t, _, r) {
233
233
  for (var n, o, l; t = t.__; ) if ((n = t.__c) && !n.__) try {
@@ -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, M.prototype.setState = function(e, t) {
239
+ } }, ve = 0, F.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
- }, M.prototype.forceUpdate = function(e) {
242
+ }, F.prototype.forceUpdate = function(e) {
243
243
  this.__v && (this.__e = !0, e && this.__h.push(e), re(this));
244
- }, M.prototype.render = W, C = [], ye = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, J = function(e, t) {
244
+ }, F.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, V = le(!1), G = le(!0);
246
+ }, R.__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++) {
@@ -268,20 +268,20 @@ function Ie(e) {
268
268
  }
269
269
  function je() {
270
270
  var e = new CustomEvent("_preact", { detail: {}, bubbles: !0, cancelable: !0 });
271
- this.dispatchEvent(e), this._vdom = H(Ie, _e({}, this._props, { context: e.detail.context }), function t(_, r) {
271
+ this.dispatchEvent(e), this._vdom = D(Ie, _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;
275
- for (l = c.length; l--; ) c[l].name !== "slot" && (o[c[l].name] = c[l].value, o[He(c[l].name)] = c[l].value);
275
+ for (l = c.length; l--; ) c[l].name !== "slot" && (o[c[l].name] = c[l].value, o[De(c[l].name)] = c[l].value);
276
276
  for (l = a.length; l--; ) {
277
277
  var s = t(a[l], null), f = a[l].slot;
278
- f ? o[f] = H(ce, { name: f }, s) : n[l] = s;
278
+ f ? o[f] = D(ce, { name: f }, s) : n[l] = s;
279
279
  }
280
- var i = r ? H(ce, null, n) : n;
281
- return H(r || _.nodeName.toLowerCase(), o, i);
282
- }(this, this._vdomComponent)), (this.hasAttribute("hydrate") ? Ce : q)(this._vdom, this._root);
280
+ var i = r ? D(ce, null, n) : n;
281
+ return D(r || _.nodeName.toLowerCase(), o, i);
282
+ }(this, this._vdomComponent)), (this.hasAttribute("hydrate") ? Ee : V)(this._vdom, this._root);
283
283
  }
284
- function He(e) {
284
+ function De(e) {
285
285
  return e.replace(/-(\w)/g, function(t, _) {
286
286
  return _ ? _.toUpperCase() : "";
287
287
  });
@@ -289,26 +289,26 @@ function He(e) {
289
289
  function We(e, t, _) {
290
290
  if (this._vdom) {
291
291
  var r = {};
292
- r[e] = _ = _ ?? void 0, r[He(e)] = _, this._vdom = xe(this._vdom, r), q(this._vdom, this._root);
292
+ r[e] = _ = _ ?? void 0, r[De(e)] = _, this._vdom = xe(this._vdom, r), V(this._vdom, this._root);
293
293
  }
294
294
  }
295
- function qe() {
296
- q(this._vdom = null, this._root);
295
+ function Ve() {
296
+ V(this._vdom = null, this._root);
297
297
  }
298
298
  function ce(e, t) {
299
299
  var _ = this;
300
- return H("slot", _e({}, e, { ref: function(r) {
300
+ return D("slot", _e({}, e, { ref: function(r) {
301
301
  r ? (_.ref = r, _._listener || (_._listener = function(n) {
302
302
  n.stopPropagation(), n.detail.context = t;
303
303
  }, r.addEventListener("_preact", _._listener))) : _.ref.removeEventListener("_preact", _._listener);
304
304
  } }));
305
305
  }
306
- function Pe(e, t, _, r) {
306
+ function He(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 = qe, _ = _ || e.observedAttributes || Object.keys(e.propTypes || {}), n.observedAttributes = _, _.forEach(function(o) {
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) {
312
312
  Object.defineProperty(n.prototype, o, { get: function() {
313
313
  return this._vdom.props[o];
314
314
  }, set: function(l) {
@@ -318,27 +318,27 @@ function Pe(e, t, _, r) {
318
318
  } });
319
319
  }), customElements.define(t || e.tagName || e.displayName || e.name, n);
320
320
  }
321
- var I, b, z, se, Q = 0, Ne = [], m = p, ae = m.__b, ue = m.__r, fe = m.diffed, de = m.__c, pe = m.unmount, he = m.__;
322
- function De(e, t) {
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.__;
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
327
  function j(e, t) {
328
- var _ = De(I++, 3);
328
+ var _ = Ne(I++, 3);
329
329
  !m.__s && Te(_.__H, t) && (_.__ = e, _.i = t, b.__H.__h.push(_));
330
330
  }
331
331
  function Se(e) {
332
- return Q = 5, Be(function() {
332
+ return Q = 5, qe(function() {
333
333
  return { current: e };
334
334
  }, []);
335
335
  }
336
- function Be(e, t) {
337
- var _ = De(I++, 7);
336
+ function qe(e, t) {
337
+ var _ = Ne(I++, 7);
338
338
  return Te(_.__H, t) && (_.__ = e(), _.__H = t, _.__h = e), _.__;
339
339
  }
340
- function ze() {
341
- for (var e; e = Ne.shift(); ) if (e.__P && e.__H) try {
340
+ function Be() {
341
+ for (var e; e = Pe.shift(); ) if (e.__P && e.__H) try {
342
342
  e.__H.__h.forEach(O), e.__H.__h.forEach(X), e.__H.__h = [];
343
343
  } catch (t) {
344
344
  e.__H.__h = [], m.__e(t, e.__v);
@@ -351,15 +351,15 @@ m.__b = function(e) {
351
351
  }, m.__r = function(e) {
352
352
  ue && ue(e), I = 0;
353
353
  var t = (b = e.__c).__H;
354
- t && (z === b ? (t.__h = [], b.__h = [], t.__.forEach(function(_) {
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)), z = b;
356
+ })) : (t.__h.forEach(O), t.__h.forEach(X), t.__h = [], I = 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 && (Ne.push(t) !== 1 && se === m.requestAnimationFrame || ((se = m.requestAnimationFrame) || Je)(ze)), t.__H.__.forEach(function(_) {
360
+ t && t.__H && (t.__H.__h.length && (Pe.push(t) !== 1 && se === m.requestAnimationFrame || ((se = m.requestAnimationFrame) || ze)(Be)), t.__H.__.forEach(function(_) {
361
361
  _.i && (_.__H = _.i), _.i = void 0;
362
- })), z = b = null;
362
+ })), B = b = null;
363
363
  }, m.__c = function(e, t) {
364
364
  t.some(function(_) {
365
365
  try {
@@ -384,7 +384,7 @@ m.__b = function(e) {
384
384
  }), _.__H = void 0, t && m.__e(t, _.__v));
385
385
  };
386
386
  var me = typeof requestAnimationFrame == "function";
387
- function Je(e) {
387
+ function ze(e) {
388
388
  var t, _ = function() {
389
389
  clearTimeout(r), me && cancelAnimationFrame(t), setTimeout(e);
390
390
  }, r = setTimeout(_, 100);
@@ -403,12 +403,12 @@ function Te(e, t) {
403
403
  return _ !== e[r];
404
404
  });
405
405
  }
406
- var Ve = 0;
406
+ var Je = 0;
407
407
  function Le(e, t, _, r, n, o) {
408
408
  t || (t = {});
409
409
  var l, c, a = t;
410
410
  if ("ref" in a) for (c in a = {}, t) c == "ref" ? l = t[c] : a[c] = t[c];
411
- 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: --Ve, __i: -1, __u: 0, __source: n, __self: o };
411
+ 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 };
412
412
  return p.vnode && p.vnode(s), s;
413
413
  }
414
414
  function Ge(e) {
@@ -420,7 +420,9 @@ function Ge(e) {
420
420
  lockName: e.lockName,
421
421
  email: e.email,
422
422
  lockEmail: e.lockEmail,
423
- css: e.css
423
+ css: e.css,
424
+ cssVars: e.cssVars,
425
+ darkModeDisabled: e.darkModeDisabled
424
426
  })
425
427
  ), l = new URL(`/embed/direct/${e.token}`, n);
426
428
  return e.externalId && l.searchParams.set("externalId", e.externalId), `${l}#${o}`;
@@ -459,7 +461,9 @@ function Ke(e) {
459
461
  JSON.stringify({
460
462
  name: e.name,
461
463
  lockName: e.lockName,
462
- css: e.css
464
+ css: e.css,
465
+ cssVars: e.cssVars,
466
+ darkModeDisabled: e.darkModeDisabled
463
467
  })
464
468
  );
465
469
  return `${new URL(`/embed/sign/${e.token}`, n)}#${o}`;
@@ -485,7 +489,7 @@ function Ke(e) {
485
489
  window.removeEventListener("message", r);
486
490
  }, []), /* @__PURE__ */ Le("iframe", { ref: t, className: e.className, src: _() });
487
491
  }
488
- Pe(Ge, "documenso-embed-direct-template", [
492
+ He(Ge, "documenso-embed-direct-template", [
489
493
  "token",
490
494
  "host",
491
495
  "externalId",
@@ -498,7 +502,7 @@ Pe(Ge, "documenso-embed-direct-template", [
498
502
  "onDocumentCompleted",
499
503
  "onDocumentError"
500
504
  ]);
501
- Pe(Ke, "documenso-embed-sign-document", [
505
+ He(Ke, "documenso-embed-sign-document", [
502
506
  "token",
503
507
  "host",
504
508
  "css",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@documenso/embed-webcomponent",
3
- "version": "0.1.0",
3
+ "version": "0.2.0-rc.0",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist"