@documenso/embed-webcomponent 0.2.0-rc.0 → 0.2.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 +1 -1
- package/dist/index.mjs +20 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var T,p,ve,E,oe,ye,z,Y,J,G,S={},ge=[],Me=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Z=Array.isArray;function $(e,t){for(var _ in t)e[_]=t[_];return e}function be(e){var t=e.parentNode;t&&t.removeChild(e)}function D(e,t,_){var r,n,o,l={};for(o in t)o=="key"?r=t[o]:o=="ref"?n=t[o]:l[o]=t[o];if(arguments.length>2&&(l.children=arguments.length>3?T.call(arguments,2):_),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)l[o]===void 0&&(l[o]=e.defaultProps[o]);return N(e,l,r,n,null)}function N(e,t,_,r,n){var o={type:e,props:t,key:_,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++ve,__i:-1,__u:0};return n==null&&p.vnode!=null&&p.vnode(o),o}function W(e){return e.children}function F(e,t){this.props=e,this.context=t}function x(e,t){if(t==null)return e.__?x(e.__,e.__i+1):null;for(var _;t<e.__k.length;t++)if((_=e.__k[t])!=null&&_.__e!=null)return _.__e;return typeof e.type=="function"?x(e):null}function ke(e){var t,_;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((_=e.__k[t])!=null&&_.__e!=null){e.__e=e.__c.base=_.__e;break}return ke(e)}}function re(e){(!e.__d&&(e.__d=!0)&&E.push(e)&&!R.__r++||oe!==p.debounceRendering)&&((oe=p.debounceRendering)||ye)(R)}function R(){var e,t,_,r,n,o,l,c;for(E.sort(z);e=E.shift();)e.__d&&(t=E.length,r=void 0,o=(n=(_=e).__v).__e,l=[],c=[],_.__P&&((r=$({},n)).__v=n.__v+1,p.vnode&&p.vnode(r),ee(_.__P,r,n,_.__n,_.__P.namespaceURI,32&n.__u?[o]:null,l,o??x(n),!!(32&n.__u),c),r.__v=n.__v,r.__.__k[r.__i]=r,Ce(l,r,c),r.__e!=o&&ke(r)),E.length>t&&E.sort(z));R.__r=0}function we(e,t,_,r,n,o,l,c,a,s,f){var i,g,u,v,k,y=r&&r.__k||ge,d=t.length;for(_.__d=a,Ue(_,t,y),a=_.__d,i=0;i<d;i++)(u=_.__k[i])!=null&&typeof u!="boolean"&&typeof u!="function"&&(g=u.__i===-1?S:y[u.__i]||S,u.__i=i,ee(e,u,g,n,o,l,c,a,s,f),v=u.__e,u.ref&&g.ref!=u.ref&&(g.ref&&te(g.ref,null,u),f.push(u.ref,u.__c||v,u)),k==null&&v!=null&&(k=v),65536&u.__u||g.__k===u.__k?a=$e(u,a,e):typeof u.type=="function"&&u.__d!==void 0?a=u.__d:v&&(a=v.nextSibling),u.__d=void 0,u.__u&=-196609);_.__d=a,_.__e=k}function Ue(e,t,_){var r,n,o,l,c,a=t.length,s=_.length,f=s,i=0;for(e.__k=[],r=0;r<a;r++)l=r+i,(n=e.__k[r]=(n=t[r])==null||typeof n=="boolean"||typeof n=="function"?null:typeof n=="string"||typeof n=="number"||typeof n=="bigint"||n.constructor==String?N(null,n,null,null,null):Z(n)?N(W,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?N(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=e,n.__b=e.__b+1,c=Ae(n,_,l,f),n.__i=c,o=null,c!==-1&&(f--,(o=_[c])&&(o.__u|=131072)),o==null||o.__v===null?(c==-1&&i--,typeof n.type!="function"&&(n.__u|=65536)):c!==l&&(c==l-1?i--:c==l+1?i++:c>l?f>a-l?i+=c-l:i--:c<l&&(c==l-i?i-=c-l:i++),c!==r+i&&(n.__u|=65536))):(o=_[l])&&o.key==null&&o.__e&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=x(o)),K(o,o,!1),_[l]=null,f--);if(f)for(r=0;r<s;r++)(o=_[r])!=null&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=x(o)),K(o,o))}function $e(e,t,_){var r,n;if(typeof e.type=="function"){for(r=e.__k,n=0;r&&n<r.length;n++)r[n]&&(r[n].__=e,t=$e(r[n],t,_));return t}e.__e!=t&&(t&&e.type&&!_.contains(t)&&(t=x(e)),_.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function Ae(e,t,_,r){var n=e.key,o=e.type,l=_-1,c=_+1,a=t[_];if(a===null||a&&n==a.key&&o===a.type&&!(131072&a.__u))return _;if(r>(a!=null&&!(131072&a.__u)?1:0))for(;l>=0||c<t.length;){if(l>=0){if((a=t[l])&&!(131072&a.__u)&&n==a.key&&o===a.type)return l;l--}if(c<t.length){if((a=t[c])&&!(131072&a.__u)&&n==a.key&&o===a.type)return c;c++}}return-1}function ie(e,t,_){t[0]==="-"?e.setProperty(t,_??""):e[t]=_==null?"":typeof _!="number"||Me.test(t)?_:_+"px"}function A(e,t,_,r,n){var o;e:if(t==="style")if(typeof _=="string")e.style.cssText=_;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)_&&t in _||ie(e.style,t,"");if(_)for(t in _)r&&_[t]===r[t]||ie(e.style,t,_[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=_,_?r?_.u=r.u:(_.u=Y,e.addEventListener(t,o?G:J,o)):e.removeEventListener(t,o?G:J,o);else{if(n=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=_??"";break e}catch{}typeof _=="function"||(_==null||_===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&_==1?"":_))}}function le(e){return function(t){if(this.l){var _=this.l[t.type+e];if(t.t==null)t.t=Y++;else if(t.t<_.u)return;return _(p.event?p.event(t):t)}}}function ee(e,t,_,r,n,o,l,c,a,s){var f,i,g,u,v,k,y,d,h,H,C,L,P,ne,M,q,w=t.type;if(t.constructor!==void 0)return null;128&_.__u&&(a=!!(32&_.__u),o=[c=t.__e=_.__e]),(f=p.__b)&&f(t);e:if(typeof w=="function")try{if(d=t.props,h="prototype"in w&&w.prototype.render,H=(f=w.contextType)&&r[f.__c],C=f?H?H.props.value:f.__:r,_.__c?y=(i=t.__c=_.__c).__=i.__E:(h?t.__c=i=new w(d,C):(t.__c=i=new F(d,C),i.constructor=w,i.render=Oe),H&&H.sub(i),i.props=d,i.state||(i.state={}),i.context=C,i.__n=r,g=i.__d=!0,i.__h=[],i._sb=[]),h&&i.__s==null&&(i.__s=i.state),h&&w.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=$({},i.__s)),$(i.__s,w.getDerivedStateFromProps(d,i.__s))),u=i.props,v=i.state,i.__v=t,g)h&&w.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),h&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(h&&w.getDerivedStateFromProps==null&&d!==u&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(d,C),!i.__e&&(i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(d,i.__s,C)===!1||t.__v===_.__v)){for(t.__v!==_.__v&&(i.props=d,i.state=i.__s,i.__d=!1),t.__e=_.__e,t.__k=_.__k,t.__k.forEach(function(U){U&&(U.__=t)}),L=0;L<i._sb.length;L++)i.__h.push(i._sb[L]);i._sb=[],i.__h.length&&l.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(d,i.__s,C),h&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(u,v,k)})}if(i.context=C,i.props=d,i.__P=e,i.__e=!1,P=p.__r,ne=0,h){for(i.state=i.__s,i.__d=!1,P&&P(t),f=i.render(i.props,i.state,i.context),M=0;M<i._sb.length;M++)i.__h.push(i._sb[M]);i._sb=[]}else do i.__d=!1,P&&P(t),f=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++ne<25);i.state=i.__s,i.getChildContext!=null&&(r=$($({},r),i.getChildContext())),h&&!g&&i.getSnapshotBeforeUpdate!=null&&(k=i.getSnapshotBeforeUpdate(u,v)),we(e,Z(q=f!=null&&f.type===W&&f.key==null?f.props.children:f)?q:[q],t,_,r,n,o,l,c,a,s),i.base=t.__e,t.__u&=-161,i.__h.length&&l.push(i),y&&(i.__E=i.__=null)}catch(U){if(t.__v=null,a||o!=null){for(t.__u|=a?160:32;c&&c.nodeType===8&&c.nextSibling;)c=c.nextSibling;o[o.indexOf(c)]=null,t.__e=c}else t.__e=_.__e,t.__k=_.__k;p.__e(U,t,_)}else o==null&&t.__v===_.__v?(t.__k=_.__k,t.__e=_.__e):t.__e=Fe(_.__e,t,_,r,n,o,l,a,s);(f=p.diffed)&&f(t)}function Ce(e,t,_){t.__d=void 0;for(var r=0;r<_.length;r++)te(_[r],_[++r],_[++r]);p.__c&&p.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(o){o.call(n)})}catch(o){p.__e(o,n.__v)}})}function Fe(e,t,_,r,n,o,l,c,a){var s,f,i,g,u,v,k,y=_.props,d=t.props,h=t.type;if(h==="svg"?n="http://www.w3.org/2000/svg":h==="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),o!=null){for(s=0;s<o.length;s++)if((u=o[s])&&"setAttribute"in u==!!h&&(h?u.localName===h:u.nodeType===3)){e=u,o[s]=null;break}}if(e==null){if(h===null)return document.createTextNode(d);e=document.createElementNS(n,h,d.is&&d),o=null,c=!1}if(h===null)y===d||c&&e.data===d||(e.data=d);else{if(o=o&&T.call(e.childNodes),y=_.props||S,!c&&o!=null)for(y={},s=0;s<e.attributes.length;s++)y[(u=e.attributes[s]).name]=u.value;for(s in y)if(u=y[s],s!="children"){if(s=="dangerouslySetInnerHTML")i=u;else if(s!=="key"&&!(s in d)){if(s=="value"&&"defaultValue"in d||s=="checked"&&"defaultChecked"in d)continue;A(e,s,null,u,n)}}for(s in d)u=d[s],s=="children"?g=u:s=="dangerouslySetInnerHTML"?f=u:s=="value"?v=u:s=="checked"?k=u:s==="key"||c&&typeof u!="function"||y[s]===u||A(e,s,u,y[s],n);if(f)c||i&&(f.__html===i.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(i&&(e.innerHTML=""),we(e,Z(g)?g:[g],t,_,r,h==="foreignObject"?"http://www.w3.org/1999/xhtml":n,o,l,o?o[0]:_.__k&&x(_,0),c,a),o!=null)for(s=o.length;s--;)o[s]!=null&&be(o[s]);c||(s="value",v!==void 0&&(v!==e[s]||h==="progress"&&!v||h==="option"&&v!==y[s])&&A(e,s,v,y[s],n),s="checked",k!==void 0&&k!==e[s]&&A(e,s,k,y[s],n))}return e}function te(e,t,_){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(n){p.__e(n,_)}}function K(e,t,_){var r,n;if(p.unmount&&p.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||te(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){p.__e(o,t)}r.base=r.__P=null}if(r=e.__k)for(n=0;n<r.length;n++)r[n]&&K(r[n],t,_||typeof e.type!="function");_||e.__e==null||be(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function Oe(e,t,_){return this.constructor(e,_)}function V(e,t,_){var r,n,o,l;p.__&&p.__(e,t),n=(r=typeof _=="function")?null:_&&_.__k||t.__k,o=[],l=[],ee(t,e=(!r&&_||t).__k=D(W,null,[e]),n||S,S,t.namespaceURI,!r&&_?[_]:n?null:t.firstChild?T.call(t.childNodes):null,o,!r&&_?_:n?n.__e:t.firstChild,r,l),Ce(o,e,l)}function Ee(e,t){V(e,t,Ee)}function xe(e,t,_){var r,n,o,l,c=$({},e.props);for(o in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)o=="key"?r=t[o]:o=="ref"?n=t[o]:c[o]=t[o]===void 0&&l!==void 0?l[o]:t[o];return arguments.length>2&&(c.children=arguments.length>3?T.call(arguments,2):_),N(e.type,c,r||e.key,n||e.ref,null)}T=ge.slice,p={__e:function(e,t,_,r){for(var n,o,l;t=t.__;)if((n=t.__c)&&!n.__)try{if((o=n.constructor)&&o.getDerivedStateFromError!=null&&(n.setState(o.getDerivedStateFromError(e)),l=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,r||{}),l=n.__d),l)return n.__E=n}catch(c){e=c}throw e}},ve=0,F.prototype.setState=function(e,t){var _;_=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=$({},this.state),typeof e=="function"&&(e=e($({},_),this.props)),e&&$(_,e),e!=null&&this.__v&&(t&&this._sb.push(t),re(this))},F.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),re(this))},F.prototype.render=W,E=[],ye=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,z=function(e,t){return e.__v.__b-t.__v.__b},R.__r=0,Y=0,J=le(!1),G=le(!0);function _e(){return(_e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var _=arguments[t];for(var r in _)Object.prototype.hasOwnProperty.call(_,r)&&(e[r]=_[r])}return e}).apply(this,arguments)}var Re=["context","children"];function Ie(e){this.getChildContext=function(){return e.context};var t=e.children,_=function(r,n){if(r==null)return{};var o,l,c={},a=Object.keys(r);for(l=0;l<a.length;l++)n.indexOf(o=a[l])>=0||(c[o]=r[o]);return c}(e,Re);return xe(t,_)}function je(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=D(Ie,_e({},this._props,{context:e.detail.context}),function t(_,r){if(_.nodeType===3)return _.data;if(_.nodeType!==1)return null;var n=[],o={},l=0,c=_.attributes,a=_.childNodes;for(l=c.length;l--;)c[l].name!=="slot"&&(o[c[l].name]=c[l].value,o[De(c[l].name)]=c[l].value);for(l=a.length;l--;){var s=t(a[l],null),f=a[l].slot;f?o[f]=D(ce,{name:f},s):n[l]=s}var i=r?D(ce,null,n):n;return D(r||_.nodeName.toLowerCase(),o,i)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Ee:V)(this._vdom,this._root)}function De(e){return e.replace(/-(\w)/g,function(t,_){return _?_.toUpperCase():""})}function We(e,t,_){if(this._vdom){var r={};r[e]=_=_??void 0,r[De(e)]=_,this._vdom=xe(this._vdom,r),V(this._vdom,this._root)}}function Ve(){V(this._vdom=null,this._root)}function ce(e,t){var _=this;return D("slot",_e({},e,{ref:function(r){r?(_.ref=r,_._listener||(_._listener=function(n){n.stopPropagation(),n.detail.context=t},r.addEventListener("_preact",_._listener))):_.ref.removeEventListener("_preact",_._listener)}}))}function He(e,t,_,r){function n(){var o=Reflect.construct(HTMLElement,[],n);return o._vdomComponent=e,o._root=o,o}return(n.prototype=Object.create(HTMLElement.prototype)).constructor=n,n.prototype.connectedCallback=je,n.prototype.attributeChangedCallback=We,n.prototype.disconnectedCallback=Ve,_=_||e.observedAttributes||Object.keys(e.propTypes||{}),n.observedAttributes=_,_.forEach(function(o){Object.defineProperty(n.prototype,o,{get:function(){return this._vdom.props[o]},set:function(l){this._vdom?this.attributeChangedCallback(o,null,l):(this._props||(this._props={}),this._props[o]=l,this.connectedCallback());var c=typeof l;l!=null&&c!=="string"&&c!=="boolean"&&c!=="number"||this.setAttribute(o,l)}})}),customElements.define(t||e.tagName||e.displayName||e.name,n)}var I,b,B,se,Q=0,Pe=[],m=p,ae=m.__b,ue=m.__r,fe=m.diffed,de=m.__c,pe=m.unmount,he=m.__;function Ne(e,t){m.__h&&m.__h(b,e,Q||t),Q=0;var _=b.__H||(b.__H={__:[],__h:[]});return e>=_.__.length&&_.__.push({}),_.__[e]}function j(e,t){var _=Ne(I++,3);!m.__s&&Te(_.__H,t)&&(_.__=e,_.i=t,b.__H.__h.push(_))}function Se(e){return Q=5,qe(function(){return{current:e}},[])}function qe(e,t){var _=Ne(I++,7);return Te(_.__H,t)&&(_.__=e(),_.__H=t,_.__h=e),_.__}function Be(){for(var e;e=Pe.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(O),e.__H.__h.forEach(X),e.__H.__h=[]}catch(t){e.__H.__h=[],m.__e(t,e.__v)}}m.__b=function(e){b=null,ae&&ae(e)},m.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),he&&he(e,t)},m.__r=function(e){ue&&ue(e),I=0;var t=(b=e.__c).__H;t&&(B===b?(t.__h=[],b.__h=[],t.__.forEach(function(_){_.__N&&(_.__=_.__N),_.i=_.__N=void 0})):(t.__h.forEach(O),t.__h.forEach(X),t.__h=[],I=0)),B=b},m.diffed=function(e){fe&&fe(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Pe.push(t)!==1&&se===m.requestAnimationFrame||((se=m.requestAnimationFrame)||ze)(Be)),t.__H.__.forEach(function(_){_.i&&(_.__H=_.i),_.i=void 0})),B=b=null},m.__c=function(e,t){t.some(function(_){try{_.__h.forEach(O),_.__h=_.__h.filter(function(r){return!r.__||X(r)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],m.__e(r,_.__v)}}),de&&de(e,t)},m.unmount=function(e){pe&&pe(e);var t,_=e.__c;_&&_.__H&&(_.__H.__.forEach(function(r){try{O(r)}catch(n){t=n}}),_.__H=void 0,t&&m.__e(t,_.__v))};var me=typeof requestAnimationFrame=="function";function ze(e){var t,_=function(){clearTimeout(r),me&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(_,100);me&&(t=requestAnimationFrame(_))}function O(e){var t=b,_=e.__c;typeof _=="function"&&(e.__c=void 0,_()),b=t}function X(e){var t=b;e.__c=e.__(),b=t}function Te(e,t){return!e||e.length!==t.length||t.some(function(_,r){return _!==e[r]})}var Je=0;function Le(e,t,_,r,n,o){t||(t={});var l,c,a=t;if("ref"in a)for(c in a={},t)c=="ref"?l=t[c]:a[c]=t[c];var s={type:e,props:a,key:_,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Je,__i:-1,__u:0,__source:n,__self:o};return p.vnode&&p.vnode(s),s}function Ge(e){const t=Se(null);function _(){const n=e.host||"https://app.documenso.com",o=btoa(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"]);
|
|
1
|
+
"use strict";var T,p,ve,E,oe,ye,z,Y,J,G,S={},ge=[],Me=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Z=Array.isArray;function $(e,t){for(var _ in t)e[_]=t[_];return e}function be(e){var t=e.parentNode;t&&t.removeChild(e)}function D(e,t,_){var r,n,o,l={};for(o in t)o=="key"?r=t[o]:o=="ref"?n=t[o]:l[o]=t[o];if(arguments.length>2&&(l.children=arguments.length>3?T.call(arguments,2):_),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)l[o]===void 0&&(l[o]=e.defaultProps[o]);return N(e,l,r,n,null)}function N(e,t,_,r,n){var o={type:e,props:t,key:_,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++ve,__i:-1,__u:0};return n==null&&p.vnode!=null&&p.vnode(o),o}function W(e){return e.children}function F(e,t){this.props=e,this.context=t}function x(e,t){if(t==null)return e.__?x(e.__,e.__i+1):null;for(var _;t<e.__k.length;t++)if((_=e.__k[t])!=null&&_.__e!=null)return _.__e;return typeof e.type=="function"?x(e):null}function ke(e){var t,_;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((_=e.__k[t])!=null&&_.__e!=null){e.__e=e.__c.base=_.__e;break}return ke(e)}}function re(e){(!e.__d&&(e.__d=!0)&&E.push(e)&&!R.__r++||oe!==p.debounceRendering)&&((oe=p.debounceRendering)||ye)(R)}function R(){var e,t,_,r,n,o,l,c;for(E.sort(z);e=E.shift();)e.__d&&(t=E.length,r=void 0,o=(n=(_=e).__v).__e,l=[],c=[],_.__P&&((r=$({},n)).__v=n.__v+1,p.vnode&&p.vnode(r),ee(_.__P,r,n,_.__n,_.__P.namespaceURI,32&n.__u?[o]:null,l,o??x(n),!!(32&n.__u),c),r.__v=n.__v,r.__.__k[r.__i]=r,Ce(l,r,c),r.__e!=o&&ke(r)),E.length>t&&E.sort(z));R.__r=0}function we(e,t,_,r,n,o,l,c,a,s,f){var i,g,u,v,k,y=r&&r.__k||ge,d=t.length;for(_.__d=a,Ue(_,t,y),a=_.__d,i=0;i<d;i++)(u=_.__k[i])!=null&&typeof u!="boolean"&&typeof u!="function"&&(g=u.__i===-1?S:y[u.__i]||S,u.__i=i,ee(e,u,g,n,o,l,c,a,s,f),v=u.__e,u.ref&&g.ref!=u.ref&&(g.ref&&te(g.ref,null,u),f.push(u.ref,u.__c||v,u)),k==null&&v!=null&&(k=v),65536&u.__u||g.__k===u.__k?a=$e(u,a,e):typeof u.type=="function"&&u.__d!==void 0?a=u.__d:v&&(a=v.nextSibling),u.__d=void 0,u.__u&=-196609);_.__d=a,_.__e=k}function Ue(e,t,_){var r,n,o,l,c,a=t.length,s=_.length,f=s,i=0;for(e.__k=[],r=0;r<a;r++)l=r+i,(n=e.__k[r]=(n=t[r])==null||typeof n=="boolean"||typeof n=="function"?null:typeof n=="string"||typeof n=="number"||typeof n=="bigint"||n.constructor==String?N(null,n,null,null,null):Z(n)?N(W,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?N(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=e,n.__b=e.__b+1,c=Ae(n,_,l,f),n.__i=c,o=null,c!==-1&&(f--,(o=_[c])&&(o.__u|=131072)),o==null||o.__v===null?(c==-1&&i--,typeof n.type!="function"&&(n.__u|=65536)):c!==l&&(c==l-1?i--:c==l+1?i++:c>l?f>a-l?i+=c-l:i--:c<l&&(c==l-i?i-=c-l:i++),c!==r+i&&(n.__u|=65536))):(o=_[l])&&o.key==null&&o.__e&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=x(o)),K(o,o,!1),_[l]=null,f--);if(f)for(r=0;r<s;r++)(o=_[r])!=null&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=x(o)),K(o,o))}function $e(e,t,_){var r,n;if(typeof e.type=="function"){for(r=e.__k,n=0;r&&n<r.length;n++)r[n]&&(r[n].__=e,t=$e(r[n],t,_));return t}e.__e!=t&&(t&&e.type&&!_.contains(t)&&(t=x(e)),_.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function Ae(e,t,_,r){var n=e.key,o=e.type,l=_-1,c=_+1,a=t[_];if(a===null||a&&n==a.key&&o===a.type&&!(131072&a.__u))return _;if(r>(a!=null&&!(131072&a.__u)?1:0))for(;l>=0||c<t.length;){if(l>=0){if((a=t[l])&&!(131072&a.__u)&&n==a.key&&o===a.type)return l;l--}if(c<t.length){if((a=t[c])&&!(131072&a.__u)&&n==a.key&&o===a.type)return c;c++}}return-1}function ie(e,t,_){t[0]==="-"?e.setProperty(t,_??""):e[t]=_==null?"":typeof _!="number"||Me.test(t)?_:_+"px"}function A(e,t,_,r,n){var o;e:if(t==="style")if(typeof _=="string")e.style.cssText=_;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)_&&t in _||ie(e.style,t,"");if(_)for(t in _)r&&_[t]===r[t]||ie(e.style,t,_[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=_,_?r?_.u=r.u:(_.u=Y,e.addEventListener(t,o?G:J,o)):e.removeEventListener(t,o?G:J,o);else{if(n=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=_??"";break e}catch{}typeof _=="function"||(_==null||_===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&_==1?"":_))}}function le(e){return function(t){if(this.l){var _=this.l[t.type+e];if(t.t==null)t.t=Y++;else if(t.t<_.u)return;return _(p.event?p.event(t):t)}}}function ee(e,t,_,r,n,o,l,c,a,s){var f,i,g,u,v,k,y,d,h,H,C,L,P,ne,M,q,w=t.type;if(t.constructor!==void 0)return null;128&_.__u&&(a=!!(32&_.__u),o=[c=t.__e=_.__e]),(f=p.__b)&&f(t);e:if(typeof w=="function")try{if(d=t.props,h="prototype"in w&&w.prototype.render,H=(f=w.contextType)&&r[f.__c],C=f?H?H.props.value:f.__:r,_.__c?y=(i=t.__c=_.__c).__=i.__E:(h?t.__c=i=new w(d,C):(t.__c=i=new F(d,C),i.constructor=w,i.render=Oe),H&&H.sub(i),i.props=d,i.state||(i.state={}),i.context=C,i.__n=r,g=i.__d=!0,i.__h=[],i._sb=[]),h&&i.__s==null&&(i.__s=i.state),h&&w.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=$({},i.__s)),$(i.__s,w.getDerivedStateFromProps(d,i.__s))),u=i.props,v=i.state,i.__v=t,g)h&&w.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),h&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(h&&w.getDerivedStateFromProps==null&&d!==u&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(d,C),!i.__e&&(i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(d,i.__s,C)===!1||t.__v===_.__v)){for(t.__v!==_.__v&&(i.props=d,i.state=i.__s,i.__d=!1),t.__e=_.__e,t.__k=_.__k,t.__k.forEach(function(U){U&&(U.__=t)}),L=0;L<i._sb.length;L++)i.__h.push(i._sb[L]);i._sb=[],i.__h.length&&l.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(d,i.__s,C),h&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(u,v,k)})}if(i.context=C,i.props=d,i.__P=e,i.__e=!1,P=p.__r,ne=0,h){for(i.state=i.__s,i.__d=!1,P&&P(t),f=i.render(i.props,i.state,i.context),M=0;M<i._sb.length;M++)i.__h.push(i._sb[M]);i._sb=[]}else do i.__d=!1,P&&P(t),f=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++ne<25);i.state=i.__s,i.getChildContext!=null&&(r=$($({},r),i.getChildContext())),h&&!g&&i.getSnapshotBeforeUpdate!=null&&(k=i.getSnapshotBeforeUpdate(u,v)),we(e,Z(q=f!=null&&f.type===W&&f.key==null?f.props.children:f)?q:[q],t,_,r,n,o,l,c,a,s),i.base=t.__e,t.__u&=-161,i.__h.length&&l.push(i),y&&(i.__E=i.__=null)}catch(U){if(t.__v=null,a||o!=null){for(t.__u|=a?160:32;c&&c.nodeType===8&&c.nextSibling;)c=c.nextSibling;o[o.indexOf(c)]=null,t.__e=c}else t.__e=_.__e,t.__k=_.__k;p.__e(U,t,_)}else o==null&&t.__v===_.__v?(t.__k=_.__k,t.__e=_.__e):t.__e=Fe(_.__e,t,_,r,n,o,l,a,s);(f=p.diffed)&&f(t)}function Ce(e,t,_){t.__d=void 0;for(var r=0;r<_.length;r++)te(_[r],_[++r],_[++r]);p.__c&&p.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(o){o.call(n)})}catch(o){p.__e(o,n.__v)}})}function Fe(e,t,_,r,n,o,l,c,a){var s,f,i,g,u,v,k,y=_.props,d=t.props,h=t.type;if(h==="svg"?n="http://www.w3.org/2000/svg":h==="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),o!=null){for(s=0;s<o.length;s++)if((u=o[s])&&"setAttribute"in u==!!h&&(h?u.localName===h:u.nodeType===3)){e=u,o[s]=null;break}}if(e==null){if(h===null)return document.createTextNode(d);e=document.createElementNS(n,h,d.is&&d),o=null,c=!1}if(h===null)y===d||c&&e.data===d||(e.data=d);else{if(o=o&&T.call(e.childNodes),y=_.props||S,!c&&o!=null)for(y={},s=0;s<e.attributes.length;s++)y[(u=e.attributes[s]).name]=u.value;for(s in y)if(u=y[s],s!="children"){if(s=="dangerouslySetInnerHTML")i=u;else if(s!=="key"&&!(s in d)){if(s=="value"&&"defaultValue"in d||s=="checked"&&"defaultChecked"in d)continue;A(e,s,null,u,n)}}for(s in d)u=d[s],s=="children"?g=u:s=="dangerouslySetInnerHTML"?f=u:s=="value"?v=u:s=="checked"?k=u:s==="key"||c&&typeof u!="function"||y[s]===u||A(e,s,u,y[s],n);if(f)c||i&&(f.__html===i.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(i&&(e.innerHTML=""),we(e,Z(g)?g:[g],t,_,r,h==="foreignObject"?"http://www.w3.org/1999/xhtml":n,o,l,o?o[0]:_.__k&&x(_,0),c,a),o!=null)for(s=o.length;s--;)o[s]!=null&&be(o[s]);c||(s="value",v!==void 0&&(v!==e[s]||h==="progress"&&!v||h==="option"&&v!==y[s])&&A(e,s,v,y[s],n),s="checked",k!==void 0&&k!==e[s]&&A(e,s,k,y[s],n))}return e}function te(e,t,_){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(n){p.__e(n,_)}}function K(e,t,_){var r,n;if(p.unmount&&p.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||te(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){p.__e(o,t)}r.base=r.__P=null}if(r=e.__k)for(n=0;n<r.length;n++)r[n]&&K(r[n],t,_||typeof e.type!="function");_||e.__e==null||be(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function Oe(e,t,_){return this.constructor(e,_)}function V(e,t,_){var r,n,o,l;p.__&&p.__(e,t),n=(r=typeof _=="function")?null:_&&_.__k||t.__k,o=[],l=[],ee(t,e=(!r&&_||t).__k=D(W,null,[e]),n||S,S,t.namespaceURI,!r&&_?[_]:n?null:t.firstChild?T.call(t.childNodes):null,o,!r&&_?_:n?n.__e:t.firstChild,r,l),Ce(o,e,l)}function Ee(e,t){V(e,t,Ee)}function xe(e,t,_){var r,n,o,l,c=$({},e.props);for(o in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)o=="key"?r=t[o]:o=="ref"?n=t[o]:c[o]=t[o]===void 0&&l!==void 0?l[o]:t[o];return arguments.length>2&&(c.children=arguments.length>3?T.call(arguments,2):_),N(e.type,c,r||e.key,n||e.ref,null)}T=ge.slice,p={__e:function(e,t,_,r){for(var n,o,l;t=t.__;)if((n=t.__c)&&!n.__)try{if((o=n.constructor)&&o.getDerivedStateFromError!=null&&(n.setState(o.getDerivedStateFromError(e)),l=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,r||{}),l=n.__d),l)return n.__E=n}catch(c){e=c}throw e}},ve=0,F.prototype.setState=function(e,t){var _;_=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=$({},this.state),typeof e=="function"&&(e=e($({},_),this.props)),e&&$(_,e),e!=null&&this.__v&&(t&&this._sb.push(t),re(this))},F.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),re(this))},F.prototype.render=W,E=[],ye=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,z=function(e,t){return e.__v.__b-t.__v.__b},R.__r=0,Y=0,J=le(!1),G=le(!0);function _e(){return(_e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var _=arguments[t];for(var r in _)Object.prototype.hasOwnProperty.call(_,r)&&(e[r]=_[r])}return e}).apply(this,arguments)}var Re=["context","children"];function Ie(e){this.getChildContext=function(){return e.context};var t=e.children,_=function(r,n){if(r==null)return{};var o,l,c={},a=Object.keys(r);for(l=0;l<a.length;l++)n.indexOf(o=a[l])>=0||(c[o]=r[o]);return c}(e,Re);return xe(t,_)}function je(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=D(Ie,_e({},this._props,{context:e.detail.context}),function t(_,r){if(_.nodeType===3)return _.data;if(_.nodeType!==1)return null;var n=[],o={},l=0,c=_.attributes,a=_.childNodes;for(l=c.length;l--;)c[l].name!=="slot"&&(o[c[l].name]=c[l].value,o[De(c[l].name)]=c[l].value);for(l=a.length;l--;){var s=t(a[l],null),f=a[l].slot;f?o[f]=D(ce,{name:f},s):n[l]=s}var i=r?D(ce,null,n):n;return D(r||_.nodeName.toLowerCase(),o,i)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Ee:V)(this._vdom,this._root)}function De(e){return e.replace(/-(\w)/g,function(t,_){return _?_.toUpperCase():""})}function We(e,t,_){if(this._vdom){var r={};r[e]=_=_??void 0,r[De(e)]=_,this._vdom=xe(this._vdom,r),V(this._vdom,this._root)}}function Ve(){V(this._vdom=null,this._root)}function ce(e,t){var _=this;return D("slot",_e({},e,{ref:function(r){r?(_.ref=r,_._listener||(_._listener=function(n){n.stopPropagation(),n.detail.context=t},r.addEventListener("_preact",_._listener))):_.ref.removeEventListener("_preact",_._listener)}}))}function He(e,t,_,r){function n(){var o=Reflect.construct(HTMLElement,[],n);return o._vdomComponent=e,o._root=o,o}return(n.prototype=Object.create(HTMLElement.prototype)).constructor=n,n.prototype.connectedCallback=je,n.prototype.attributeChangedCallback=We,n.prototype.disconnectedCallback=Ve,_=_||e.observedAttributes||Object.keys(e.propTypes||{}),n.observedAttributes=_,_.forEach(function(o){Object.defineProperty(n.prototype,o,{get:function(){return this._vdom.props[o]},set:function(l){this._vdom?this.attributeChangedCallback(o,null,l):(this._props||(this._props={}),this._props[o]=l,this.connectedCallback());var c=typeof l;l!=null&&c!=="string"&&c!=="boolean"&&c!=="number"||this.setAttribute(o,l)}})}),customElements.define(t||e.tagName||e.displayName||e.name,n)}var I,b,B,se,Q=0,Pe=[],m=p,ae=m.__b,ue=m.__r,fe=m.diffed,de=m.__c,pe=m.unmount,he=m.__;function Ne(e,t){m.__h&&m.__h(b,e,Q||t),Q=0;var _=b.__H||(b.__H={__:[],__h:[]});return e>=_.__.length&&_.__.push({}),_.__[e]}function j(e,t){var _=Ne(I++,3);!m.__s&&Te(_.__H,t)&&(_.__=e,_.i=t,b.__H.__h.push(_))}function Se(e){return Q=5,qe(function(){return{current:e}},[])}function qe(e,t){var _=Ne(I++,7);return Te(_.__H,t)&&(_.__=e(),_.__H=t,_.__h=e),_.__}function Be(){for(var e;e=Pe.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(O),e.__H.__h.forEach(X),e.__H.__h=[]}catch(t){e.__H.__h=[],m.__e(t,e.__v)}}m.__b=function(e){b=null,ae&&ae(e)},m.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),he&&he(e,t)},m.__r=function(e){ue&&ue(e),I=0;var t=(b=e.__c).__H;t&&(B===b?(t.__h=[],b.__h=[],t.__.forEach(function(_){_.__N&&(_.__=_.__N),_.i=_.__N=void 0})):(t.__h.forEach(O),t.__h.forEach(X),t.__h=[],I=0)),B=b},m.diffed=function(e){fe&&fe(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Pe.push(t)!==1&&se===m.requestAnimationFrame||((se=m.requestAnimationFrame)||ze)(Be)),t.__H.__.forEach(function(_){_.i&&(_.__H=_.i),_.i=void 0})),B=b=null},m.__c=function(e,t){t.some(function(_){try{_.__h.forEach(O),_.__h=_.__h.filter(function(r){return!r.__||X(r)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],m.__e(r,_.__v)}}),de&&de(e,t)},m.unmount=function(e){pe&&pe(e);var t,_=e.__c;_&&_.__H&&(_.__H.__.forEach(function(r){try{O(r)}catch(n){t=n}}),_.__H=void 0,t&&m.__e(t,_.__v))};var me=typeof requestAnimationFrame=="function";function ze(e){var t,_=function(){clearTimeout(r),me&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(_,100);me&&(t=requestAnimationFrame(_))}function O(e){var t=b,_=e.__c;typeof _=="function"&&(e.__c=void 0,_()),b=t}function X(e){var t=b;e.__c=e.__(),b=t}function Te(e,t){return!e||e.length!==t.length||t.some(function(_,r){return _!==e[r]})}var Je=0;function Le(e,t,_,r,n,o){t||(t={});var l,c,a=t;if("ref"in a)for(c in a={},t)c=="ref"?l=t[c]:a[c]=t[c];var s={type:e,props:a,key:_,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Je,__i:-1,__u:0,__source:n,__self:o};return p.vnode&&p.vnode(s),s}function Ge(e){const t=Se(null);function _(){const n=e.host||"https://app.documenso.com",o=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,email:e.email,lockEmail:e.lockEmail,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled}))),l=new URL(`/embed/direct/${e.token}`,n);return e.externalId&&l.searchParams.set("externalId",e.externalId),`${l}#${o}`}function r(n){var o,l,c,a,s,f;if(((o=t.current)==null?void 0:o.contentWindow)===n.source)switch(n.data.action){case"document-ready":(l=e.onDocumentReady)==null||l.call(e);break;case"document-completed":(c=e.onDocumentCompleted)==null||c.call(e,n.data.data);break;case"document-error":(a=e.onDocumentError)==null||a.call(e,n.data.data);break;case"field-signed":(s=e.onFieldSigned)==null||s.call(e);break;case"field-unsigned":(f=e.onFieldUnsigned)==null||f.call(e);break}}return j(()=>{window.addEventListener("message",r)},[]),j(()=>()=>{window.removeEventListener("message",r)},[]),Le("iframe",{ref:t,className:e.className,src:_()})}function Ke(e){const t=Se(null);function _(){const n=e.host||"https://app.documenso.com",o=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled})));return`${new URL(`/embed/sign/${e.token}`,n)}#${o}`}function r(n){var o,l,c,a;if(((o=t.current)==null?void 0:o.contentWindow)===n.source)switch(n.data.action){case"document-ready":(l=e.onDocumentReady)==null||l.call(e);break;case"document-completed":(c=e.onDocumentCompleted)==null||c.call(e,n.data.data);break;case"document-error":(a=e.onDocumentError)==null||a.call(e,n.data.data);break}}return j(()=>{window.addEventListener("message",r)},[]),j(()=>()=>{window.removeEventListener("message",r)},[]),Le("iframe",{ref:t,className:e.className,src:_()})}He(Ge,"documenso-embed-direct-template",["token","host","externalId","css","email","lockEmail","name","lockName","onDocumentReady","onDocumentCompleted","onDocumentError"]);He(Ke,"documenso-embed-sign-document",["token","host","css","name","lockName","onDocumentReady","onDocumentCompleted","onDocumentError"]);
|
package/dist/index.mjs
CHANGED
|
@@ -415,15 +415,17 @@ function Ge(e) {
|
|
|
415
415
|
const t = Se(null);
|
|
416
416
|
function _() {
|
|
417
417
|
const n = e.host || "https://app.documenso.com", o = btoa(
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
418
|
+
encodeURIComponent(
|
|
419
|
+
JSON.stringify({
|
|
420
|
+
name: e.name,
|
|
421
|
+
lockName: e.lockName,
|
|
422
|
+
email: e.email,
|
|
423
|
+
lockEmail: e.lockEmail,
|
|
424
|
+
css: e.css,
|
|
425
|
+
cssVars: e.cssVars,
|
|
426
|
+
darkModeDisabled: e.darkModeDisabled
|
|
427
|
+
})
|
|
428
|
+
)
|
|
427
429
|
), l = new URL(`/embed/direct/${e.token}`, n);
|
|
428
430
|
return e.externalId && l.searchParams.set("externalId", e.externalId), `${l}#${o}`;
|
|
429
431
|
}
|
|
@@ -458,13 +460,15 @@ function Ke(e) {
|
|
|
458
460
|
const t = Se(null);
|
|
459
461
|
function _() {
|
|
460
462
|
const n = e.host || "https://app.documenso.com", o = btoa(
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
463
|
+
encodeURIComponent(
|
|
464
|
+
JSON.stringify({
|
|
465
|
+
name: e.name,
|
|
466
|
+
lockName: e.lockName,
|
|
467
|
+
css: e.css,
|
|
468
|
+
cssVars: e.cssVars,
|
|
469
|
+
darkModeDisabled: e.darkModeDisabled
|
|
470
|
+
})
|
|
471
|
+
)
|
|
468
472
|
);
|
|
469
473
|
return `${new URL(`/embed/sign/${e.token}`, n)}#${o}`;
|
|
470
474
|
}
|