@documenso/embed-webcomponent 0.0.2-rc.0 → 0.1.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,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)&&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(J);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(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,C,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],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 M(d,C),i.constructor=w,i.render=Oe),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(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,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,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 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 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),Ce(o,e,l)}function Ee(e,t){q(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):_),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,E=[],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")?Ee: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,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"]);
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var T, p, ve, E, 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, 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;
2
2
  function $(e, t) {
3
3
  for (var _ in t) e[_] = t[_];
4
4
  return e;
@@ -39,11 +39,11 @@ 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) && C.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 (E.sort(J); 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(J));
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));
47
47
  R.__r = 0;
48
48
  }
49
49
  function we(e, t, _, r, n, o, l, c, a, s, f) {
@@ -115,24 +115,24 @@ 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, C, L, N, ne, U, B, w = t.type;
118
+ var f, i, g, u, v, k, y, d, h, P, E, L, N, ne, U, B, 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], 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 M(d, C), i.constructor = w, i.render = Oe), 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);
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);
123
123
  else {
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)) {
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
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
126
  A && (A.__ = 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, C), h && i.componentDidUpdate != null && i.__h.push(function() {
131
+ i.componentWillUpdate != null && i.componentWillUpdate(d, i.__s, E), h && i.componentDidUpdate != null && i.__h.push(function() {
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, N = p.__r, ne = 0, h) {
135
+ if (i.context = E, i.props = d, i.__P = e, i.__e = !1, N = p.__r, ne = 0, h) {
136
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]);
137
137
  i._sb = [];
138
138
  } else do
@@ -149,7 +149,7 @@ function ee(e, t, _, r, n, o, l, c, a, s) {
149
149
  else o == null && t.__v === _.__v ? (t.__k = _.__k, t.__e = _.__e) : t.__e = Me(_.__e, t, _, r, n, o, l, a, s);
150
150
  (f = p.diffed) && f(t);
151
151
  }
152
- function Ce(e, t, _) {
152
+ function Ee(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) {
@@ -219,10 +219,10 @@ function Oe(e, t, _) {
219
219
  }
220
220
  function q(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), Ce(o, e, 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);
223
223
  }
224
- function Ee(e, t) {
225
- q(e, t, Ee);
224
+ function Ce(e, t) {
225
+ q(e, t, Ce);
226
226
  }
227
227
  function xe(e, t, _) {
228
228
  var r, n, o, l, c = $({}, e.props);
@@ -241,7 +241,7 @@ T = ge.slice, p = { __e: function(e, t, _, r) {
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
242
  }, M.prototype.forceUpdate = function(e) {
243
243
  this.__v && (this.__e = !0, e && this.__h.push(e), re(this));
244
- }, M.prototype.render = W, E = [], ye = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, J = function(e, t) {
244
+ }, M.prototype.render = W, C = [], ye = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, J = function(e, t) {
245
245
  return e.__v.__b - t.__v.__b;
246
246
  }, R.__r = 0, Y = 0, V = le(!1), G = le(!0);
247
247
  function _e() {
@@ -279,7 +279,7 @@ function je() {
279
279
  }
280
280
  var i = r ? H(ce, null, n) : n;
281
281
  return H(r || _.nodeName.toLowerCase(), o, i);
282
- }(this, this._vdomComponent)), (this.hasAttribute("hydrate") ? Ee : q)(this._vdom, this._root);
282
+ }(this, this._vdomComponent)), (this.hasAttribute("hydrate") ? Ce : q)(this._vdom, this._root);
283
283
  }
284
284
  function He(e) {
285
285
  return e.replace(/-(\w)/g, function(t, _) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@documenso/embed-webcomponent",
3
- "version": "0.0.2-rc.0",
3
+ "version": "0.1.0",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist"