@documenso/embed-webcomponent 0.4.0 → 0.5.1
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 +300 -295
- package/package.json +3 -3
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 o,n,r,s={};for(r in t)r=="key"?o=t[r]:r=="ref"?n=t[r]:s[r]=t[r];if(arguments.length>2&&(s.children=arguments.length>3?T.call(arguments,2):_),typeof e=="function"&&e.defaultProps!=null)for(r in e.defaultProps)s[r]===void 0&&(s[r]=e.defaultProps[r]);return N(e,s,o,n,null)}function N(e,t,_,o,n){var r={type:e,props:t,key:_,ref:o,__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(r),r}function W(e){return e.children}function A(e,t){this.props=e,this.context=t}function x(e,t){if(t==null)return e.__?x(e.__,e.__i+1):null;for(var _;t<e.__k.length;t++)if((_=e.__k[t])!=null&&_.__e!=null)return _.__e;return typeof e.type=="function"?x(e):null}function ke(e){var t,_;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((_=e.__k[t])!=null&&_.__e!=null){e.__e=e.__c.base=_.__e;break}return ke(e)}}function re(e){(!e.__d&&(e.__d=!0)&&E.push(e)&&!O.__r++||oe!==p.debounceRendering)&&((oe=p.debounceRendering)||ye)(O)}function O(){var e,t,_,o,n,r,s,c;for(E.sort(z);e=E.shift();)e.__d&&(t=E.length,o=void 0,r=(n=(_=e).__v).__e,s=[],c=[],_.__P&&((o=$({},n)).__v=n.__v+1,p.vnode&&p.vnode(o),ee(_.__P,o,n,_.__n,_.__P.namespaceURI,32&n.__u?[r]:null,s,r??x(n),!!(32&n.__u),c),o.__v=n.__v,o.__.__k[o.__i]=o,Ce(s,o,c),o.__e!=r&&ke(o)),E.length>t&&E.sort(z));O.__r=0}function we(e,t,_,o,n,r,s,c,l,a,f){var i,g,u,v,k,y=o&&o.__k||ge,d=t.length;for(_.__d=l,Ue(_,t,y),l=_.__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,r,s,c,l,a,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?l=$e(u,l,e):typeof u.type=="function"&&u.__d!==void 0?l=u.__d:v&&(l=v.nextSibling),u.__d=void 0,u.__u&=-196609);_.__d=l,_.__e=k}function Ue(e,t,_){var o,n,r,s,c,l=t.length,a=_.length,f=a,i=0;for(e.__k=[],o=0;o<l;o++)s=o+i,(n=e.__k[o]=(n=t[o])==null||typeof n=="boolean"||typeof n=="function"?null:typeof n=="string"||typeof n=="number"||typeof n=="bigint"||n.constructor==String?N(null,n,null,null,null):Z(n)?N(W,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?N(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=e,n.__b=e.__b+1,c=Re(n,_,s,f),n.__i=c,r=null,c!==-1&&(f--,(r=_[c])&&(r.__u|=131072)),r==null||r.__v===null?(c==-1&&i--,typeof n.type!="function"&&(n.__u|=65536)):c!==s&&(c==s-1?i--:c==s+1?i++:c>s?f>l-s?i+=c-s:i--:c<s&&(c==s-i?i-=c-s:i++),c!==o+i&&(n.__u|=65536))):(r=_[s])&&r.key==null&&r.__e&&(131072&r.__u)==0&&(r.__e==e.__d&&(e.__d=x(r)),K(r,r,!1),_[s]=null,f--);if(f)for(o=0;o<a;o++)(r=_[o])!=null&&(131072&r.__u)==0&&(r.__e==e.__d&&(e.__d=x(r)),K(r,r))}function $e(e,t,_){var o,n;if(typeof e.type=="function"){for(o=e.__k,n=0;o&&n<o.length;n++)o[n]&&(o[n].__=e,t=$e(o[n],t,_));return t}e.__e!=t&&(t&&e.type&&!_.contains(t)&&(t=x(e)),_.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function Re(e,t,_,o){var n=e.key,r=e.type,s=_-1,c=_+1,l=t[_];if(l===null||l&&n==l.key&&r===l.type&&(131072&l.__u)==0)return _;if(o>(l!=null&&(131072&l.__u)==0?1:0))for(;s>=0||c<t.length;){if(s>=0){if((l=t[s])&&(131072&l.__u)==0&&n==l.key&&r===l.type)return s;s--}if(c<t.length){if((l=t[c])&&(131072&l.__u)==0&&n==l.key&&r===l.type)return c;c++}}return-1}function ie(e,t,_){t[0]==="-"?e.setProperty(t,_??""):e[t]=_==null?"":typeof _!="number"||Me.test(t)?_:_+"px"}function R(e,t,_,o,n){var r;e:if(t==="style")if(typeof _=="string")e.style.cssText=_;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)_&&t in _||ie(e.style,t,"");if(_)for(t in _)o&&_[t]===o[t]||ie(e.style,t,_[t])}else if(t[0]==="o"&&t[1]==="n")r=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+r]=_,_?o?_.u=o.u:(_.u=Y,e.addEventListener(t,r?G:J,r)):e.removeEventListener(t,r?G:J,r);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 se(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,_,o,n,r,s,c,l,a){var f,i,g,u,v,k,y,d,h,P,C,L,H,ne,M,q,w=t.type;if(t.constructor!==void 0)return null;128&_.__u&&(l=!!(32&_.__u),r=[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)&&o[f.__c],C=f?P?P.props.value:f.__:o,_.__c?y=(i=t.__c=_.__c).__=i.__E:(h?t.__c=i=new w(d,C):(t.__c=i=new A(d,C),i.constructor=w,i.render=Fe),P&&P.sub(i),i.props=d,i.state||(i.state={}),i.context=C,i.__n=o,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&&s.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(d,i.__s,C),h&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(u,v,k)})}if(i.context=C,i.props=d,i.__P=e,i.__e=!1,H=p.__r,ne=0,h){for(i.state=i.__s,i.__d=!1,H&&H(t),f=i.render(i.props,i.state,i.context),M=0;M<i._sb.length;M++)i.__h.push(i._sb[M]);i._sb=[]}else do i.__d=!1,H&&H(t),f=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++ne<25);i.state=i.__s,i.getChildContext!=null&&(o=$($({},o),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,_,o,n,r,s,c,l,a),i.base=t.__e,t.__u&=-161,i.__h.length&&s.push(i),y&&(i.__E=i.__=null)}catch(U){if(t.__v=null,l||r!=null){for(t.__u|=l?160:32;c&&c.nodeType===8&&c.nextSibling;)c=c.nextSibling;r[r.indexOf(c)]=null,t.__e=c}else t.__e=_.__e,t.__k=_.__k;p.__e(U,t,_)}else r==null&&t.__v===_.__v?(t.__k=_.__k,t.__e=_.__e):t.__e=Ae(_.__e,t,_,o,n,r,s,l,a);(f=p.diffed)&&f(t)}function Ce(e,t,_){t.__d=void 0;for(var o=0;o<_.length;o++)te(_[o],_[++o],_[++o]);p.__c&&p.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(r){r.call(n)})}catch(r){p.__e(r,n.__v)}})}function Ae(e,t,_,o,n,r,s,c,l){var a,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"),r!=null){for(a=0;a<r.length;a++)if((u=r[a])&&"setAttribute"in u==!!h&&(h?u.localName===h:u.nodeType===3)){e=u,r[a]=null;break}}if(e==null){if(h===null)return document.createTextNode(d);e=document.createElementNS(n,h,d.is&&d),r=null,c=!1}if(h===null)y===d||c&&e.data===d||(e.data=d);else{if(r=r&&T.call(e.childNodes),y=_.props||S,!c&&r!=null)for(y={},a=0;a<e.attributes.length;a++)y[(u=e.attributes[a]).name]=u.value;for(a in y)if(u=y[a],a!="children"){if(a=="dangerouslySetInnerHTML")i=u;else if(a!=="key"&&!(a in d)){if(a=="value"&&"defaultValue"in d||a=="checked"&&"defaultChecked"in d)continue;R(e,a,null,u,n)}}for(a in d)u=d[a],a=="children"?g=u:a=="dangerouslySetInnerHTML"?f=u:a=="value"?v=u:a=="checked"?k=u:a==="key"||c&&typeof u!="function"||y[a]===u||R(e,a,u,y[a],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,_,o,h==="foreignObject"?"http://www.w3.org/1999/xhtml":n,r,s,r?r[0]:_.__k&&x(_,0),c,l),r!=null)for(a=r.length;a--;)r[a]!=null&&be(r[a]);c||(a="value",v!==void 0&&(v!==e[a]||h==="progress"&&!v||h==="option"&&v!==y[a])&&R(e,a,v,y[a],n),a="checked",k!==void 0&&k!==e[a]&&R(e,a,k,y[a],n))}return e}function te(e,t,_){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(n){p.__e(n,_)}}function K(e,t,_){var o,n;if(p.unmount&&p.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||te(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(r){p.__e(r,t)}o.base=o.__P=null}if(o=e.__k)for(n=0;n<o.length;n++)o[n]&&K(o[n],t,_||typeof e.type!="function");_||e.__e==null||be(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function Fe(e,t,_){return this.constructor(e,_)}function V(e,t,_){var o,n,r,s;p.__&&p.__(e,t),n=(o=typeof _=="function")?null:_&&_.__k||t.__k,r=[],s=[],ee(t,e=(!o&&_||t).__k=D(W,null,[e]),n||S,S,t.namespaceURI,!o&&_?[_]:n?null:t.firstChild?T.call(t.childNodes):null,r,!o&&_?_:n?n.__e:t.firstChild,o,s),Ce(r,e,s)}function Ee(e,t){V(e,t,Ee)}function xe(e,t,_){var o,n,r,s,c=$({},e.props);for(r in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)r=="key"?o=t[r]:r=="ref"?n=t[r]:c[r]=t[r]===void 0&&s!==void 0?s[r]:t[r];return arguments.length>2&&(c.children=arguments.length>3?T.call(arguments,2):_),N(e.type,c,o||e.key,n||e.ref,null)}T=ge.slice,p={__e:function(e,t,_,o){for(var n,r,s;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&r.getDerivedStateFromError!=null&&(n.setState(r.getDerivedStateFromError(e)),s=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,o||{}),s=n.__d),s)return n.__E=n}catch(c){e=c}throw e}},ve=0,A.prototype.setState=function(e,t){var _;_=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=$({},this.state),typeof e=="function"&&(e=e($({},_),this.props)),e&&$(_,e),e!=null&&this.__v&&(t&&this._sb.push(t),re(this))},A.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),re(this))},A.prototype.render=W,E=[],ye=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,z=function(e,t){return e.__v.__b-t.__v.__b},O.__r=0,Y=0,J=se(!1),G=se(!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 o in _)Object.prototype.hasOwnProperty.call(_,o)&&(e[o]=_[o])}return e}).apply(this,arguments)}var Oe=["context","children"];function je(e){this.getChildContext=function(){return e.context};var t=e.children,_=(function(o,n){if(o==null)return{};var r,s,c={},l=Object.keys(o);for(s=0;s<l.length;s++)n.indexOf(r=l[s])>=0||(c[r]=o[r]);return c})(e,Oe);return xe(t,_)}function Ie(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=D(je,_e({},this._props,{context:e.detail.context}),(function t(_,o){if(_.nodeType===3)return _.data;if(_.nodeType!==1)return null;var n=[],r={},s=0,c=_.attributes,l=_.childNodes;for(s=c.length;s--;)c[s].name!=="slot"&&(r[c[s].name]=c[s].value,r[De(c[s].name)]=c[s].value);for(s=l.length;s--;){var a=t(l[s],null),f=l[s].slot;f?r[f]=D(ce,{name:f},a):n[s]=a}var i=o?D(ce,null,n):n;return D(o||_.nodeName.toLowerCase(),r,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 o={};o[e]=_=_??void 0,o[De(e)]=_,this._vdom=xe(this._vdom,o),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(o){o?(_.ref=o,_._listener||(_._listener=function(n){n.stopPropagation(),n.detail.context=t},o.addEventListener("_preact",_._listener))):_.ref.removeEventListener("_preact",_._listener)}}))}function Pe(e,t,_,o){function n(){var r=Reflect.construct(HTMLElement,[],n);return r._vdomComponent=e,r._root=r,r}return(n.prototype=Object.create(HTMLElement.prototype)).constructor=n,n.prototype.connectedCallback=Ie,n.prototype.attributeChangedCallback=We,n.prototype.disconnectedCallback=Ve,_=_||e.observedAttributes||Object.keys(e.propTypes||{}),n.observedAttributes=_,_.forEach(function(r){Object.defineProperty(n.prototype,r,{get:function(){return this._vdom.props[r]},set:function(s){this._vdom?this.attributeChangedCallback(r,null,s):(this._props||(this._props={}),this._props[r]=s,this.connectedCallback());var c=typeof s;s!=null&&c!=="string"&&c!=="boolean"&&c!=="number"||this.setAttribute(r,s)}})}),customElements.define(t||e.tagName||e.displayName||e.name,n)}var j,b,B,ae,Q=0,He=[],m=p,le=m.__b,ue=m.__r,fe=m.diffed,de=m.__c,pe=m.unmount,he=m.__;function Ne(e,t){m.__h&&m.__h(b,e,Q||t),Q=0;var _=b.__H||(b.__H={__:[],__h:[]});return e>=_.__.length&&_.__.push({}),_.__[e]}function I(e,t){var _=Ne(j++,3);!m.__s&&Te(_.__H,t)&&(_.__=e,_.i=t,b.__H.__h.push(_))}function Se(e){return Q=5,qe(function(){return{current:e}},[])}function qe(e,t){var _=Ne(j++,7);return Te(_.__H,t)&&(_.__=e(),_.__H=t,_.__h=e),_.__}function Be(){for(var e;e=He.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(F),e.__H.__h.forEach(X),e.__H.__h=[]}catch(t){e.__H.__h=[],m.__e(t,e.__v)}}m.__b=function(e){b=null,le&&le(e)},m.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),he&&he(e,t)},m.__r=function(e){ue&&ue(e),j=0;var t=(b=e.__c).__H;t&&(B===b?(t.__h=[],b.__h=[],t.__.forEach(function(_){_.__N&&(_.__=_.__N),_.i=_.__N=void 0})):(t.__h.forEach(F),t.__h.forEach(X),t.__h=[],j=0)),B=b},m.diffed=function(e){fe&&fe(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(He.push(t)!==1&&ae===m.requestAnimationFrame||((ae=m.requestAnimationFrame)||ze)(Be)),t.__H.__.forEach(function(_){_.i&&(_.__H=_.i),_.i=void 0})),B=b=null},m.__c=function(e,t){t.some(function(_){try{_.__h.forEach(F),_.__h=_.__h.filter(function(o){return!o.__||X(o)})}catch(o){t.some(function(n){n.__h&&(n.__h=[])}),t=[],m.__e(o,_.__v)}}),de&&de(e,t)},m.unmount=function(e){pe&&pe(e);var t,_=e.__c;_&&_.__H&&(_.__H.__.forEach(function(o){try{F(o)}catch(n){t=n}}),_.__H=void 0,t&&m.__e(t,_.__v))};var me=typeof requestAnimationFrame=="function";function ze(e){var t,_=function(){clearTimeout(o),me&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(_,100);me&&(t=requestAnimationFrame(_))}function F(e){var t=b,_=e.__c;typeof _=="function"&&(e.__c=void 0,_()),b=t}function X(e){var t=b;e.__c=e.__(),b=t}function Te(e,t){return!e||e.length!==t.length||t.some(function(_,o){return _!==e[o]})}var Je=0;function Le(e,t,_,o,n,r){t||(t={});var s,c,l=t;if("ref"in l)for(c in l={},t)c=="ref"?s=t[c]:l[c]=t[c];var a={type:e,props:l,key:_,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Je,__i:-1,__u:0,__source:n,__self:r};return p.vnode&&p.vnode(a),a}function Ge(e){const t=Se(null);function _(){const n=e.host||"https://app.documenso.com",r=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,email:e.email,lockEmail:e.lockEmail,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,...e.additionalProps}))),s=new URL(`/embed/direct/${e.token}`,n);return e.externalId&&s.searchParams.set("externalId",e.externalId),`${s}#${r}`}function o(n){if(t.current?.contentWindow===n.source)switch(n.data.action){case"document-ready":e.onDocumentReady?.();break;case"document-completed":e.onDocumentCompleted?.(n.data.data);break;case"document-error":e.onDocumentError?.(n.data.data);break;case"field-signed":e.onFieldSigned?.();break;case"field-unsigned":e.onFieldUnsigned?.();break}}return I(()=>{window.addEventListener("message",o)},[]),I(()=>()=>{window.removeEventListener("message",o)},[]),Le("iframe",{ref:t,className:e.className,src:_()})}function Ke(e){const t=Se(null);function _(){const n=e.host||"https://app.documenso.com",r=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,allowDocumentRejection:e.allowDocumentRejection,...e.additionalProps})));return`${new URL(`/embed/sign/${e.token}`,n)}#${r}`}function o(n){if(t.current?.contentWindow===n.source)switch(n.data.action){case"document-ready":e.onDocumentReady?.();break;case"document-completed":e.onDocumentCompleted?.(n.data.data);break;case"document-error":e.onDocumentError?.(n.data.data);break;case"document-rejected":e.onDocumentRejected?.(n.data.data);break}}return I(()=>{window.addEventListener("message",o)},[]),I(()=>()=>{window.removeEventListener("message",o)},[]),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 A,d,ye,x,re,ge,be,ke,ee,K,Q,L={},we=[],Oe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,B=Array.isArray;function $(e,t){for(var _ in t)e[_]=t[_];return e}function te(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function P(e,t,_){var r,o,n,s={};for(n in t)n=="key"?r=t[n]:n=="ref"?o=t[n]:s[n]=t[n];if(arguments.length>2&&(s.children=arguments.length>3?A.call(arguments,2):_),typeof e=="function"&&e.defaultProps!=null)for(n in e.defaultProps)s[n]===void 0&&(s[n]=e.defaultProps[n]);return T(e,s,r,o,null)}function T(e,t,_,r,o){var n={type:e,props:t,key:_,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++ye,__i:-1,__u:0};return o==null&&d.vnode!=null&&d.vnode(n),n}function M(e){return e.children}function j(e,t){this.props=e,this.context=t}function H(e,t){if(t==null)return e.__?H(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"?H(e):null}function $e(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 $e(e)}}function ie(e){(!e.__d&&(e.__d=!0)&&x.push(e)&&!I.__r++||re!=d.debounceRendering)&&((re=d.debounceRendering)||ge)(I)}function I(){for(var e,t,_,r,o,n,s,c=1;x.length;)x.length>c&&x.sort(be),e=x.shift(),c=x.length,e.__d&&(_=void 0,r=void 0,o=(r=(t=e).__v).__e,n=[],s=[],t.__P&&((_=$({},r)).__v=r.__v+1,d.vnode&&d.vnode(_),_e(t.__P,_,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,n,o??H(r),!!(32&r.__u),s),_.__v=r.__v,_.__.__k[_.__i]=_,xe(n,_,s),r.__e=r.__=null,_.__e!=o&&$e(_)));I.__r=0}function Ee(e,t,_,r,o,n,s,c,f,l,u){var i,m,a,y,k,g,h,p=r&&r.__k||we,E=t.length;for(f=Ie(_,t,p,f,E),i=0;i<E;i++)(a=_.__k[i])!=null&&(m=a.__i==-1?L:p[a.__i]||L,a.__i=i,g=_e(e,a,m,o,n,s,c,f,l,u),y=a.__e,a.ref&&m.ref!=a.ref&&(m.ref&&ne(m.ref,null,a),u.push(a.ref,a.__c||y,a)),k==null&&y!=null&&(k=y),(h=!!(4&a.__u))||m.__k===a.__k?f=Ce(a,f,e,h):typeof a.type=="function"&&g!==void 0?f=g:y&&(f=y.nextSibling),a.__u&=-7);return _.__e=k,f}function Ie(e,t,_,r,o){var n,s,c,f,l,u=_.length,i=u,m=0;for(e.__k=new Array(o),n=0;n<o;n++)(s=t[n])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[n]=T(null,s,null,null,null):B(s)?s=e.__k[n]=T(M,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[n]=T(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[n]=s,f=n+m,s.__=e,s.__b=e.__b+1,c=null,(l=s.__i=We(s,_,f,i))!=-1&&(i--,(c=_[l])&&(c.__u|=2)),c==null||c.__v==null?(l==-1&&(o>u?m--:o<u&&m++),typeof s.type!="function"&&(s.__u|=4)):l!=f&&(l==f-1?m--:l==f+1?m++:(l>f?m--:m++,s.__u|=4))):e.__k[n]=null;if(i)for(n=0;n<u;n++)(c=_[n])!=null&&(2&c.__u)==0&&(c.__e==r&&(r=H(c)),Pe(c,c));return r}function Ce(e,t,_,r){var o,n;if(typeof e.type=="function"){for(o=e.__k,n=0;o&&n<o.length;n++)o[n]&&(o[n].__=e,t=Ce(o[n],t,_,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=H(e)),_.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function We(e,t,_,r){var o,n,s,c=e.key,f=e.type,l=t[_],u=l!=null&&(2&l.__u)==0;if(l===null&&c==null||u&&c==l.key&&f==l.type)return _;if(r>(u?1:0)){for(o=_-1,n=_+1;o>=0||n<t.length;)if((l=t[s=o>=0?o--:n++])!=null&&(2&l.__u)==0&&c==l.key&&f==l.type)return s}return-1}function se(e,t,_){t[0]=="-"?e.setProperty(t,_??""):e[t]=_==null?"":typeof _!="number"||Oe.test(t)?_:_+"px"}function R(e,t,_,r,o){var n,s;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 _||se(e.style,t,"");if(_)for(t in _)r&&_[t]==r[t]||se(e.style,t,_[t])}else if(t[0]=="o"&&t[1]=="n")n=t!=(t=t.replace(ke,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+n]=_,_?r?_.u=r.u:(_.u=ee,e.addEventListener(t,n?Q:K,n)):e.removeEventListener(t,n?Q:K,n);else{if(o=="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=ee++;else if(t.t<_.u)return;return _(d.event?d.event(t):t)}}}function _e(e,t,_,r,o,n,s,c,f,l){var u,i,m,a,y,k,g,h,p,E,C,F,N,oe,U,S,J,w=t.type;if(t.constructor!==void 0)return null;128&_.__u&&(f=!!(32&_.__u),n=[c=t.__e=_.__e]),(u=d.__b)&&u(t);e:if(typeof w=="function")try{if(h=t.props,p="prototype"in w&&w.prototype.render,E=(u=w.contextType)&&r[u.__c],C=u?E?E.props.value:u.__:r,_.__c?g=(i=t.__c=_.__c).__=i.__E:(p?t.__c=i=new w(h,C):(t.__c=i=new j(h,C),i.constructor=w,i.render=qe),E&&E.sub(i),i.state||(i.state={}),i.__n=r,m=i.__d=!0,i.__h=[],i._sb=[]),p&&i.__s==null&&(i.__s=i.state),p&&w.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=$({},i.__s)),$(i.__s,w.getDerivedStateFromProps(h,i.__s))),a=i.props,y=i.state,i.__v=t,m)p&&w.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),p&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(p&&w.getDerivedStateFromProps==null&&h!==a&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(h,C),t.__v==_.__v||!i.__e&&i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(h,i.__s,C)===!1){for(t.__v!=_.__v&&(i.props=h,i.state=i.__s,i.__d=!1),t.__e=_.__e,t.__k=_.__k,t.__k.some(function(D){D&&(D.__=t)}),F=0;F<i._sb.length;F++)i.__h.push(i._sb[F]);i._sb=[],i.__h.length&&s.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(h,i.__s,C),p&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(a,y,k)})}if(i.context=C,i.props=h,i.__P=e,i.__e=!1,N=d.__r,oe=0,p){for(i.state=i.__s,i.__d=!1,N&&N(t),u=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),u=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++oe<25);i.state=i.__s,i.getChildContext!=null&&(r=$($({},r),i.getChildContext())),p&&!m&&i.getSnapshotBeforeUpdate!=null&&(k=i.getSnapshotBeforeUpdate(a,y)),S=u,u!=null&&u.type===M&&u.key==null&&(S=De(u.props.children)),c=Ee(e,B(S)?S:[S],t,_,r,o,n,s,c,f,l),i.base=t.__e,t.__u&=-161,i.__h.length&&s.push(i),g&&(i.__E=i.__=null)}catch(D){if(t.__v=null,f||n!=null)if(D.then){for(t.__u|=f?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;n[n.indexOf(c)]=null,t.__e=c}else{for(J=n.length;J--;)te(n[J]);X(t)}else t.__e=_.__e,t.__k=_.__k,D.then||X(t);d.__e(D,t,_)}else n==null&&t.__v==_.__v?(t.__k=_.__k,t.__e=_.__e):c=t.__e=Ve(_.__e,t,_,r,o,n,s,f,l);return(u=d.diffed)&&u(t),128&t.__u?void 0:c}function X(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(X)}function xe(e,t,_){for(var r=0;r<_.length;r++)ne(_[r],_[++r],_[++r]);d.__c&&d.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(n){n.call(o)})}catch(n){d.__e(n,o.__v)}})}function De(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:B(e)?e.map(De):$({},e)}function Ve(e,t,_,r,o,n,s,c,f){var l,u,i,m,a,y,k,g=_.props||L,h=t.props,p=t.type;if(p=="svg"?o="http://www.w3.org/2000/svg":p=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),n!=null){for(l=0;l<n.length;l++)if((a=n[l])&&"setAttribute"in a==!!p&&(p?a.localName==p:a.nodeType==3)){e=a,n[l]=null;break}}if(e==null){if(p==null)return document.createTextNode(h);e=document.createElementNS(o,p,h.is&&h),c&&(d.__m&&d.__m(t,n),c=!1),n=null}if(p==null)g===h||c&&e.data==h||(e.data=h);else{if(n=n&&A.call(e.childNodes),!c&&n!=null)for(g={},l=0;l<e.attributes.length;l++)g[(a=e.attributes[l]).name]=a.value;for(l in g)if(a=g[l],l!="children"){if(l=="dangerouslySetInnerHTML")i=a;else if(!(l in h)){if(l=="value"&&"defaultValue"in h||l=="checked"&&"defaultChecked"in h)continue;R(e,l,null,a,o)}}for(l in h)a=h[l],l=="children"?m=a:l=="dangerouslySetInnerHTML"?u=a:l=="value"?y=a:l=="checked"?k=a:c&&typeof a!="function"||g[l]===a||R(e,l,a,g[l],o);if(u)c||i&&(u.__html==i.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(i&&(e.innerHTML=""),Ee(t.type=="template"?e.content:e,B(m)?m:[m],t,_,r,p=="foreignObject"?"http://www.w3.org/1999/xhtml":o,n,s,n?n[0]:_.__k&&H(_,0),c,f),n!=null)for(l=n.length;l--;)te(n[l]);c||(l="value",p=="progress"&&y==null?e.removeAttribute("value"):y!=null&&(y!==e[l]||p=="progress"&&!y||p=="option"&&y!=g[l])&&R(e,l,y,g[l],o),l="checked",k!=null&&k!=e[l]&&R(e,l,k,g[l],o))}return e}function ne(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(o){d.__e(o,_)}}function Pe(e,t,_){var r,o;if(d.unmount&&d.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||ne(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(n){d.__e(n,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Pe(r[o],t,_||typeof e.type!="function");_||te(e.__e),e.__c=e.__=e.__e=void 0}function qe(e,t,_){return this.constructor(e,_)}function z(e,t,_){var r,o,n,s;t==document&&(t=document.documentElement),d.__&&d.__(e,t),o=(r=typeof _=="function")?null:_&&_.__k||t.__k,n=[],s=[],_e(t,e=(!r&&_||t).__k=P(M,null,[e]),o||L,L,t.namespaceURI,!r&&_?[_]:o?null:t.firstChild?A.call(t.childNodes):null,n,!r&&_?_:o?o.__e:t.firstChild,r,s),xe(n,e,s)}function He(e,t){z(e,t,He)}function Ne(e,t,_){var r,o,n,s,c=$({},e.props);for(n in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)n=="key"?r=t[n]:n=="ref"?o=t[n]:c[n]=t[n]===void 0&&s!=null?s[n]:t[n];return arguments.length>2&&(c.children=arguments.length>3?A.call(arguments,2):_),T(e.type,c,r||e.key,o||e.ref,null)}A=we.slice,d={__e:function(e,t,_,r){for(var o,n,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((n=o.constructor)&&n.getDerivedStateFromError!=null&&(o.setState(n.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(c){e=c}throw e}},ye=0,j.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),ie(this))},j.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ie(this))},j.prototype.render=M,x=[],ge=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,be=function(e,t){return e.__v.__b-t.__v.__b},I.__r=0,ke=/(PointerCapture)$|Capture$/i,ee=0,K=le(!1),Q=le(!0);function W(){return W=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},W.apply(this,arguments)}function Se(e,t){if(e==null)return{};var _,r,o={},n=Object.keys(e);for(r=0;r<n.length;r++)t.indexOf(_=n[r])>=0||(o[_]=e[_]);return o}var Be=["context","children"],ze=["useFragment"];function Te(e,t,_,r){function o(){var n=Reflect.construct(HTMLElement,[],o);return n._vdomComponent=e,n._root=n,n}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=function(){Ge.call(this,r)},o.prototype.attributeChangedCallback=Ke,o.prototype.disconnectedCallback=Qe,_=_||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=_,e.formAssociated&&(o.formAssociated=!0),_.forEach(function(n){Object.defineProperty(o.prototype,n,{get:function(){return this._vdom?this._vdom.props[n]:this._props[n]},set:function(s){this._vdom?this.attributeChangedCallback(n,null,s):(this._props||(this._props={}),this._props[n]=s);var c=typeof s;s!=null&&c!=="string"&&c!=="boolean"&&c!=="number"||this.setAttribute(n,s)}})}),customElements.define(t||e.tagName||e.displayName||e.name,o),o}function Je(e){this.getChildContext=function(){return e.context};var t=e.children,_=Se(e,Be);return Ne(t,_)}function Ge(e){var t=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=P(Je,W({},this._props,{context:t.detail.context}),Ae(this,this._vdomComponent,e)),(this.hasAttribute("hydrate")?He:z)(this._vdom,this._root)}function Le(e){return e.replace(/-(\w)/g,function(t,_){return _?_.toUpperCase():""})}function Ke(e,t,_){if(this._vdom){var r={};r[e]=_=_??void 0,r[Le(e)]=_,this._vdom=Ne(this._vdom,r),z(this._vdom,this._root)}}function Qe(){z(this._vdom=null,this._root)}function ce(e,t){var _=this,r=e.useFragment,o=Se(e,ze);return P(r?M:"slot",W({},o,{ref:function(n){n?(_.ref=n,_._listener||(_._listener=function(s){s.stopPropagation(),s.detail.context=t},n.addEventListener("_preact",_._listener))):_.ref.removeEventListener("_preact",_._listener)}}))}function Ae(e,t,_){if(e.nodeType===3)return e.data;if(e.nodeType!==1)return null;var r=[],o={},n=0,s=e.attributes,c=e.childNodes;for(n=s.length;n--;)s[n].name!=="slot"&&(o[s[n].name]=s[n].value,o[Le(s[n].name)]=s[n].value);for(n=c.length;n--;){var f=Ae(c[n],null,_),l=c[n].slot;l?o[l]=P(ce,{name:l},f):r[n]=f}var u=!(!_||!_.shadow),i=t?P(ce,{useFragment:!u},r):r;return!u&&t&&(e.innerHTML=""),P(t||e.nodeName.toLowerCase(),o,i)}var V,b,G,ae,Y=0,Me=[],v=d,ue=v.__b,fe=v.__r,de=v.diffed,pe=v.__c,he=v.unmount,me=v.__;function Fe(e,t){v.__h&&v.__h(b,e,Y||t),Y=0;var _=b.__H||(b.__H={__:[],__h:[]});return e>=_.__.length&&_.__.push({}),_.__[e]}function q(e,t){var _=Fe(V++,3);!v.__s&&Re(_.__H,t)&&(_.__=e,_.u=t,b.__H.__h.push(_))}function Ue(e){return Y=5,Xe(function(){return{current:e}},[])}function Xe(e,t){var _=Fe(V++,7);return Re(_.__H,t)&&(_.__=e(),_.__H=t,_.__h=e),_.__}function Ye(){for(var e;e=Me.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(O),e.__H.__h.forEach(Z),e.__H.__h=[]}catch(t){e.__H.__h=[],v.__e(t,e.__v)}}v.__b=function(e){b=null,ue&&ue(e)},v.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),me&&me(e,t)},v.__r=function(e){fe&&fe(e),V=0;var t=(b=e.__c).__H;t&&(G===b?(t.__h=[],b.__h=[],t.__.forEach(function(_){_.__N&&(_.__=_.__N),_.u=_.__N=void 0})):(t.__h.forEach(O),t.__h.forEach(Z),t.__h=[],V=0)),G=b},v.diffed=function(e){de&&de(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Me.push(t)!==1&&ae===v.requestAnimationFrame||((ae=v.requestAnimationFrame)||Ze)(Ye)),t.__H.__.forEach(function(_){_.u&&(_.__H=_.u),_.u=void 0})),G=b=null},v.__c=function(e,t){t.some(function(_){try{_.__h.forEach(O),_.__h=_.__h.filter(function(r){return!r.__||Z(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],v.__e(r,_.__v)}}),pe&&pe(e,t)},v.unmount=function(e){he&&he(e);var t,_=e.__c;_&&_.__H&&(_.__H.__.forEach(function(r){try{O(r)}catch(o){t=o}}),_.__H=void 0,t&&v.__e(t,_.__v))};var ve=typeof requestAnimationFrame=="function";function Ze(e){var t,_=function(){clearTimeout(r),ve&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(_,35);ve&&(t=requestAnimationFrame(_))}function O(e){var t=b,_=e.__c;typeof _=="function"&&(e.__c=void 0,_()),b=t}function Z(e){var t=b;e.__c=e.__(),b=t}function Re(e,t){return!e||e.length!==t.length||t.some(function(_,r){return _!==e[r]})}var et=0;function je(e,t,_,r,o,n){t||(t={});var s,c,f=t;if("ref"in f)for(c in f={},t)c=="ref"?s=t[c]:f[c]=t[c];var l={type:e,props:f,key:_,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--et,__i:-1,__u:0,__source:o,__self:n};return d.vnode&&d.vnode(l),l}function tt(e){const t=Ue(null);function _(){const o=e.host||"https://app.documenso.com",n=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,email:e.email,lockEmail:e.lockEmail,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,...e.additionalProps}))),s=new URL(`/embed/direct/${e.token}`,o);return e.externalId&&s.searchParams.set("externalId",e.externalId),`${s}#${n}`}function r(o){if(t.current?.contentWindow===o.source)switch(o.data.action){case"document-ready":e.onDocumentReady?.();break;case"document-completed":e.onDocumentCompleted?.(o.data.data);break;case"document-error":e.onDocumentError?.(o.data.data);break;case"field-signed":e.onFieldSigned?.();break;case"field-unsigned":e.onFieldUnsigned?.();break}}return q(()=>{window.addEventListener("message",r)},[]),q(()=>()=>{window.removeEventListener("message",r)},[]),je("iframe",{ref:t,className:e.className,src:_()})}function _t(e){const t=Ue(null);function _(){const o=e.host||"https://app.documenso.com",n=btoa(encodeURIComponent(JSON.stringify({name:e.name,lockName:e.lockName,css:e.css,cssVars:e.cssVars,darkModeDisabled:e.darkModeDisabled,allowDocumentRejection:e.allowDocumentRejection,...e.additionalProps})));return`${new URL(`/embed/sign/${e.token}`,o)}#${n}`}function r(o){if(t.current?.contentWindow===o.source)switch(o.data.action){case"document-ready":e.onDocumentReady?.();break;case"document-completed":e.onDocumentCompleted?.(o.data.data);break;case"document-error":e.onDocumentError?.(o.data.data);break;case"document-rejected":e.onDocumentRejected?.(o.data.data);break}}return q(()=>{window.addEventListener("message",r)},[]),q(()=>()=>{window.removeEventListener("message",r)},[]),je("iframe",{ref:t,className:e.className,src:_()})}Te(tt,"documenso-embed-direct-template",["token","host","externalId","css","email","lockEmail","name","lockName","onDocumentReady","onDocumentCompleted","onDocumentError"]);Te(_t,"documenso-embed-sign-document",["token","host","css","name","lockName","onDocumentReady","onDocumentCompleted","onDocumentError"]);
|
package/dist/index.mjs
CHANGED
|
@@ -1,420 +1,425 @@
|
|
|
1
|
-
var
|
|
1
|
+
var A, d, ye, x, re, ge, be, ke, ee, K, Q, L = {}, we = [], Oe = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, B = Array.isArray;
|
|
2
2
|
function $(e, t) {
|
|
3
3
|
for (var _ in t) e[_] = t[_];
|
|
4
4
|
return e;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
t && t.removeChild(e);
|
|
6
|
+
function te(e) {
|
|
7
|
+
e && e.parentNode && e.parentNode.removeChild(e);
|
|
9
8
|
}
|
|
10
|
-
function
|
|
11
|
-
var o, n,
|
|
12
|
-
for (
|
|
13
|
-
if (arguments.length > 2 && (
|
|
14
|
-
return
|
|
9
|
+
function P(e, t, _) {
|
|
10
|
+
var r, o, n, l = {};
|
|
11
|
+
for (n in t) n == "key" ? r = t[n] : n == "ref" ? o = t[n] : l[n] = t[n];
|
|
12
|
+
if (arguments.length > 2 && (l.children = arguments.length > 3 ? A.call(arguments, 2) : _), typeof e == "function" && e.defaultProps != null) for (n in e.defaultProps) l[n] === void 0 && (l[n] = e.defaultProps[n]);
|
|
13
|
+
return T(e, l, r, o, null);
|
|
15
14
|
}
|
|
16
|
-
function
|
|
17
|
-
var
|
|
18
|
-
return
|
|
15
|
+
function T(e, t, _, r, o) {
|
|
16
|
+
var n = { type: e, props: t, key: _, ref: r, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: o ?? ++ye, __i: -1, __u: 0 };
|
|
17
|
+
return o == null && d.vnode != null && d.vnode(n), n;
|
|
19
18
|
}
|
|
20
|
-
function
|
|
19
|
+
function M(e) {
|
|
21
20
|
return e.children;
|
|
22
21
|
}
|
|
23
|
-
function
|
|
22
|
+
function j(e, t) {
|
|
24
23
|
this.props = e, this.context = t;
|
|
25
24
|
}
|
|
26
|
-
function
|
|
27
|
-
if (t == null) return e.__ ?
|
|
25
|
+
function H(e, t) {
|
|
26
|
+
if (t == null) return e.__ ? H(e.__, e.__i + 1) : null;
|
|
28
27
|
for (var _; t < e.__k.length; t++) if ((_ = e.__k[t]) != null && _.__e != null) return _.__e;
|
|
29
|
-
return typeof e.type == "function" ?
|
|
28
|
+
return typeof e.type == "function" ? H(e) : null;
|
|
30
29
|
}
|
|
31
|
-
function
|
|
30
|
+
function $e(e) {
|
|
32
31
|
var t, _;
|
|
33
32
|
if ((e = e.__) != null && e.__c != null) {
|
|
34
33
|
for (e.__e = e.__c.base = null, t = 0; t < e.__k.length; t++) if ((_ = e.__k[t]) != null && _.__e != null) {
|
|
35
34
|
e.__e = e.__c.base = _.__e;
|
|
36
35
|
break;
|
|
37
36
|
}
|
|
38
|
-
return
|
|
37
|
+
return $e(e);
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
|
-
function
|
|
42
|
-
(!e.__d && (e.__d = !0) &&
|
|
40
|
+
function ie(e) {
|
|
41
|
+
(!e.__d && (e.__d = !0) && x.push(e) && !I.__r++ || re != d.debounceRendering) && ((re = d.debounceRendering) || ge)(I);
|
|
43
42
|
}
|
|
44
|
-
function
|
|
45
|
-
var e, t, _, o, n,
|
|
46
|
-
|
|
47
|
-
O.__r = 0;
|
|
43
|
+
function I() {
|
|
44
|
+
for (var e, t, _, r, o, n, l, c = 1; x.length; ) x.length > c && x.sort(be), e = x.shift(), c = x.length, e.__d && (_ = void 0, r = void 0, o = (r = (t = e).__v).__e, n = [], l = [], t.__P && ((_ = $({}, r)).__v = r.__v + 1, d.vnode && d.vnode(_), _e(t.__P, _, r, t.__n, t.__P.namespaceURI, 32 & r.__u ? [o] : null, n, o ?? H(r), !!(32 & r.__u), l), _.__v = r.__v, _.__.__k[_.__i] = _, xe(n, _, l), r.__e = r.__ = null, _.__e != o && $e(_)));
|
|
45
|
+
I.__r = 0;
|
|
48
46
|
}
|
|
49
|
-
function
|
|
50
|
-
var i,
|
|
51
|
-
for (
|
|
52
|
-
|
|
47
|
+
function Ee(e, t, _, r, o, n, l, c, f, s, u) {
|
|
48
|
+
var i, m, a, y, k, g, h, p = r && r.__k || we, E = t.length;
|
|
49
|
+
for (f = Ie(_, t, p, f, E), i = 0; i < E; i++) (a = _.__k[i]) != null && (m = a.__i == -1 ? L : p[a.__i] || L, a.__i = i, g = _e(e, a, m, o, n, l, c, f, s, u), y = a.__e, a.ref && m.ref != a.ref && (m.ref && ne(m.ref, null, a), u.push(a.ref, a.__c || y, a)), k == null && y != null && (k = y), (h = !!(4 & a.__u)) || m.__k === a.__k ? f = Ce(a, f, e, h) : typeof a.type == "function" && g !== void 0 ? f = g : y && (f = y.nextSibling), a.__u &= -7);
|
|
50
|
+
return _.__e = k, f;
|
|
53
51
|
}
|
|
54
|
-
function
|
|
55
|
-
var
|
|
56
|
-
for (e.__k =
|
|
57
|
-
if (
|
|
52
|
+
function Ie(e, t, _, r, o) {
|
|
53
|
+
var n, l, c, f, s, u = _.length, i = u, m = 0;
|
|
54
|
+
for (e.__k = new Array(o), n = 0; n < o; n++) (l = t[n]) != null && typeof l != "boolean" && typeof l != "function" ? (typeof l == "string" || typeof l == "number" || typeof l == "bigint" || l.constructor == String ? l = e.__k[n] = T(null, l, null, null, null) : B(l) ? l = e.__k[n] = T(M, { children: l }, null, null, null) : l.constructor === void 0 && l.__b > 0 ? l = e.__k[n] = T(l.type, l.props, l.key, l.ref ? l.ref : null, l.__v) : e.__k[n] = l, f = n + m, l.__ = e, l.__b = e.__b + 1, c = null, (s = l.__i = We(l, _, f, i)) != -1 && (i--, (c = _[s]) && (c.__u |= 2)), c == null || c.__v == null ? (s == -1 && (o > u ? m-- : o < u && m++), typeof l.type != "function" && (l.__u |= 4)) : s != f && (s == f - 1 ? m-- : s == f + 1 ? m++ : (s > f ? m-- : m++, l.__u |= 4))) : e.__k[n] = null;
|
|
55
|
+
if (i) for (n = 0; n < u; n++) (c = _[n]) != null && (2 & c.__u) == 0 && (c.__e == r && (r = H(c)), Pe(c, c));
|
|
56
|
+
return r;
|
|
58
57
|
}
|
|
59
|
-
function
|
|
58
|
+
function Ce(e, t, _, r) {
|
|
60
59
|
var o, n;
|
|
61
60
|
if (typeof e.type == "function") {
|
|
62
|
-
for (o = e.__k, n = 0; o && n < o.length; n++) o[n] && (o[n].__ = e, t =
|
|
61
|
+
for (o = e.__k, n = 0; o && n < o.length; n++) o[n] && (o[n].__ = e, t = Ce(o[n], t, _, r));
|
|
63
62
|
return t;
|
|
64
63
|
}
|
|
65
|
-
e.__e != t && (t && e.type && !
|
|
64
|
+
e.__e != t && (r && (t && e.type && !t.parentNode && (t = H(e)), _.insertBefore(e.__e, t || null)), t = e.__e);
|
|
66
65
|
do
|
|
67
66
|
t = t && t.nextSibling;
|
|
68
|
-
while (t != null && t.nodeType
|
|
67
|
+
while (t != null && t.nodeType == 8);
|
|
69
68
|
return t;
|
|
70
69
|
}
|
|
71
|
-
function
|
|
72
|
-
var n = e.key,
|
|
73
|
-
if (
|
|
74
|
-
if (
|
|
75
|
-
if (
|
|
76
|
-
if ((l = t[c]) && (131072 & l.__u) == 0 && n == l.key && r === l.type) return c;
|
|
77
|
-
c--;
|
|
78
|
-
}
|
|
79
|
-
if (s < t.length) {
|
|
80
|
-
if ((l = t[s]) && (131072 & l.__u) == 0 && n == l.key && r === l.type) return s;
|
|
81
|
-
s++;
|
|
82
|
-
}
|
|
70
|
+
function We(e, t, _, r) {
|
|
71
|
+
var o, n, l, c = e.key, f = e.type, s = t[_], u = s != null && (2 & s.__u) == 0;
|
|
72
|
+
if (s === null && c == null || u && c == s.key && f == s.type) return _;
|
|
73
|
+
if (r > (u ? 1 : 0)) {
|
|
74
|
+
for (o = _ - 1, n = _ + 1; o >= 0 || n < t.length; ) if ((s = t[l = o >= 0 ? o-- : n++]) != null && (2 & s.__u) == 0 && c == s.key && f == s.type) return l;
|
|
83
75
|
}
|
|
84
76
|
return -1;
|
|
85
77
|
}
|
|
86
|
-
function
|
|
87
|
-
t[0]
|
|
78
|
+
function le(e, t, _) {
|
|
79
|
+
t[0] == "-" ? e.setProperty(t, _ ?? "") : e[t] = _ == null ? "" : typeof _ != "number" || Oe.test(t) ? _ : _ + "px";
|
|
88
80
|
}
|
|
89
|
-
function R(e, t, _,
|
|
90
|
-
var
|
|
91
|
-
e: if (t
|
|
81
|
+
function R(e, t, _, r, o) {
|
|
82
|
+
var n, l;
|
|
83
|
+
e: if (t == "style") if (typeof _ == "string") e.style.cssText = _;
|
|
92
84
|
else {
|
|
93
|
-
if (typeof
|
|
94
|
-
if (_) for (t in _)
|
|
85
|
+
if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) _ && t in _ || le(e.style, t, "");
|
|
86
|
+
if (_) for (t in _) r && _[t] == r[t] || le(e.style, t, _[t]);
|
|
95
87
|
}
|
|
96
|
-
else if (t[0]
|
|
88
|
+
else if (t[0] == "o" && t[1] == "n") n = t != (t = t.replace(ke, "$1")), l = t.toLowerCase(), t = l in e || t == "onFocusOut" || t == "onFocusIn" ? l.slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + n] = _, _ ? r ? _.u = r.u : (_.u = ee, e.addEventListener(t, n ? Q : K, n)) : e.removeEventListener(t, n ? Q : K, n);
|
|
97
89
|
else {
|
|
98
|
-
if (
|
|
90
|
+
if (o == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
99
91
|
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 {
|
|
100
92
|
e[t] = _ ?? "";
|
|
101
93
|
break e;
|
|
102
94
|
} catch {
|
|
103
95
|
}
|
|
104
|
-
typeof _ == "function" || (_ == null || _ === !1 && t[4]
|
|
96
|
+
typeof _ == "function" || (_ == null || _ === !1 && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && _ == 1 ? "" : _));
|
|
105
97
|
}
|
|
106
98
|
}
|
|
107
|
-
function
|
|
99
|
+
function se(e) {
|
|
108
100
|
return function(t) {
|
|
109
101
|
if (this.l) {
|
|
110
102
|
var _ = this.l[t.type + e];
|
|
111
|
-
if (t.t == null) t.t =
|
|
103
|
+
if (t.t == null) t.t = ee++;
|
|
112
104
|
else if (t.t < _.u) return;
|
|
113
|
-
return _(
|
|
105
|
+
return _(d.event ? d.event(t) : t);
|
|
114
106
|
}
|
|
115
107
|
};
|
|
116
108
|
}
|
|
117
|
-
function
|
|
118
|
-
var
|
|
109
|
+
function _e(e, t, _, r, o, n, l, c, f, s) {
|
|
110
|
+
var u, i, m, a, y, k, g, h, p, E, C, F, N, oe, U, S, J, w = t.type;
|
|
119
111
|
if (t.constructor !== void 0) return null;
|
|
120
|
-
128 & _.__u && (
|
|
112
|
+
128 & _.__u && (f = !!(32 & _.__u), n = [c = t.__e = _.__e]), (u = d.__b) && u(t);
|
|
121
113
|
e: if (typeof w == "function") try {
|
|
122
|
-
if (
|
|
114
|
+
if (h = t.props, p = "prototype" in w && w.prototype.render, E = (u = w.contextType) && r[u.__c], C = u ? E ? E.props.value : u.__ : r, _.__c ? g = (i = t.__c = _.__c).__ = i.__E : (p ? t.__c = i = new w(h, C) : (t.__c = i = new j(h, C), i.constructor = w, i.render = qe), E && E.sub(i), i.state || (i.state = {}), i.__n = r, m = i.__d = !0, i.__h = [], i._sb = []), p && i.__s == null && (i.__s = i.state), p && w.getDerivedStateFromProps != null && (i.__s == i.state && (i.__s = $({}, i.__s)), $(i.__s, w.getDerivedStateFromProps(h, i.__s))), a = i.props, y = i.state, i.__v = t, m) p && w.getDerivedStateFromProps == null && i.componentWillMount != null && i.componentWillMount(), p && i.componentDidMount != null && i.__h.push(i.componentDidMount);
|
|
123
115
|
else {
|
|
124
|
-
if (
|
|
125
|
-
for (t.__v
|
|
126
|
-
|
|
127
|
-
}),
|
|
128
|
-
i._sb = [], i.__h.length &&
|
|
116
|
+
if (p && w.getDerivedStateFromProps == null && h !== a && i.componentWillReceiveProps != null && i.componentWillReceiveProps(h, C), t.__v == _.__v || !i.__e && i.shouldComponentUpdate != null && i.shouldComponentUpdate(h, i.__s, C) === !1) {
|
|
117
|
+
for (t.__v != _.__v && (i.props = h, i.state = i.__s, i.__d = !1), t.__e = _.__e, t.__k = _.__k, t.__k.some(function(D) {
|
|
118
|
+
D && (D.__ = t);
|
|
119
|
+
}), F = 0; F < i._sb.length; F++) i.__h.push(i._sb[F]);
|
|
120
|
+
i._sb = [], i.__h.length && l.push(i);
|
|
129
121
|
break e;
|
|
130
122
|
}
|
|
131
|
-
i.componentWillUpdate != null && i.componentWillUpdate(
|
|
132
|
-
i.componentDidUpdate(
|
|
123
|
+
i.componentWillUpdate != null && i.componentWillUpdate(h, i.__s, C), p && i.componentDidUpdate != null && i.__h.push(function() {
|
|
124
|
+
i.componentDidUpdate(a, y, k);
|
|
133
125
|
});
|
|
134
126
|
}
|
|
135
|
-
if (i.context = C, i.props =
|
|
136
|
-
for (i.state = i.__s, i.__d = !1,
|
|
127
|
+
if (i.context = C, i.props = h, i.__P = e, i.__e = !1, N = d.__r, oe = 0, p) {
|
|
128
|
+
for (i.state = i.__s, i.__d = !1, N && N(t), u = i.render(i.props, i.state, i.context), U = 0; U < i._sb.length; U++) i.__h.push(i._sb[U]);
|
|
137
129
|
i._sb = [];
|
|
138
130
|
} else do
|
|
139
|
-
i.__d = !1,
|
|
140
|
-
while (i.__d && ++
|
|
141
|
-
i.state = i.__s, i.getChildContext != null && (
|
|
142
|
-
} catch (
|
|
143
|
-
if (t.__v = null,
|
|
144
|
-
for (t.__u |=
|
|
145
|
-
|
|
146
|
-
} else
|
|
147
|
-
|
|
131
|
+
i.__d = !1, N && N(t), u = i.render(i.props, i.state, i.context), i.state = i.__s;
|
|
132
|
+
while (i.__d && ++oe < 25);
|
|
133
|
+
i.state = i.__s, i.getChildContext != null && (r = $($({}, r), i.getChildContext())), p && !m && i.getSnapshotBeforeUpdate != null && (k = i.getSnapshotBeforeUpdate(a, y)), S = u, u != null && u.type === M && u.key == null && (S = De(u.props.children)), c = Ee(e, B(S) ? S : [S], t, _, r, o, n, l, c, f, s), i.base = t.__e, t.__u &= -161, i.__h.length && l.push(i), g && (i.__E = i.__ = null);
|
|
134
|
+
} catch (D) {
|
|
135
|
+
if (t.__v = null, f || n != null) if (D.then) {
|
|
136
|
+
for (t.__u |= f ? 160 : 128; c && c.nodeType == 8 && c.nextSibling; ) c = c.nextSibling;
|
|
137
|
+
n[n.indexOf(c)] = null, t.__e = c;
|
|
138
|
+
} else {
|
|
139
|
+
for (J = n.length; J--; ) te(n[J]);
|
|
140
|
+
X(t);
|
|
141
|
+
}
|
|
142
|
+
else t.__e = _.__e, t.__k = _.__k, D.then || X(t);
|
|
143
|
+
d.__e(D, t, _);
|
|
148
144
|
}
|
|
149
|
-
else
|
|
150
|
-
(
|
|
145
|
+
else n == null && t.__v == _.__v ? (t.__k = _.__k, t.__e = _.__e) : c = t.__e = Ve(_.__e, t, _, r, o, n, l, f, s);
|
|
146
|
+
return (u = d.diffed) && u(t), 128 & t.__u ? void 0 : c;
|
|
151
147
|
}
|
|
152
|
-
function
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
148
|
+
function X(e) {
|
|
149
|
+
e && e.__c && (e.__c.__e = !0), e && e.__k && e.__k.forEach(X);
|
|
150
|
+
}
|
|
151
|
+
function xe(e, t, _) {
|
|
152
|
+
for (var r = 0; r < _.length; r++) ne(_[r], _[++r], _[++r]);
|
|
153
|
+
d.__c && d.__c(t, e), e.some(function(o) {
|
|
156
154
|
try {
|
|
157
|
-
e =
|
|
158
|
-
|
|
155
|
+
e = o.__h, o.__h = [], e.some(function(n) {
|
|
156
|
+
n.call(o);
|
|
159
157
|
});
|
|
160
|
-
} catch (
|
|
161
|
-
|
|
158
|
+
} catch (n) {
|
|
159
|
+
d.__e(n, o.__v);
|
|
162
160
|
}
|
|
163
161
|
});
|
|
164
162
|
}
|
|
165
|
-
function
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
163
|
+
function De(e) {
|
|
164
|
+
return typeof e != "object" || e == null || e.__b && e.__b > 0 ? e : B(e) ? e.map(De) : $({}, e);
|
|
165
|
+
}
|
|
166
|
+
function Ve(e, t, _, r, o, n, l, c, f) {
|
|
167
|
+
var s, u, i, m, a, y, k, g = _.props || L, h = t.props, p = t.type;
|
|
168
|
+
if (p == "svg" ? o = "http://www.w3.org/2000/svg" : p == "math" ? o = "http://www.w3.org/1998/Math/MathML" : o || (o = "http://www.w3.org/1999/xhtml"), n != null) {
|
|
169
|
+
for (s = 0; s < n.length; s++) if ((a = n[s]) && "setAttribute" in a == !!p && (p ? a.localName == p : a.nodeType == 3)) {
|
|
170
|
+
e = a, n[s] = null;
|
|
170
171
|
break;
|
|
171
172
|
}
|
|
172
173
|
}
|
|
173
174
|
if (e == null) {
|
|
174
|
-
if (
|
|
175
|
-
e = document.createElementNS(
|
|
175
|
+
if (p == null) return document.createTextNode(h);
|
|
176
|
+
e = document.createElementNS(o, p, h.is && h), c && (d.__m && d.__m(t, n), c = !1), n = null;
|
|
176
177
|
}
|
|
177
|
-
if (
|
|
178
|
+
if (p == null) g === h || c && e.data == h || (e.data = h);
|
|
178
179
|
else {
|
|
179
|
-
if (
|
|
180
|
-
for (
|
|
181
|
-
if (
|
|
182
|
-
else if (
|
|
183
|
-
if (
|
|
184
|
-
R(e,
|
|
180
|
+
if (n = n && A.call(e.childNodes), !c && n != null) for (g = {}, s = 0; s < e.attributes.length; s++) g[(a = e.attributes[s]).name] = a.value;
|
|
181
|
+
for (s in g) if (a = g[s], s != "children") {
|
|
182
|
+
if (s == "dangerouslySetInnerHTML") i = a;
|
|
183
|
+
else if (!(s in h)) {
|
|
184
|
+
if (s == "value" && "defaultValue" in h || s == "checked" && "defaultChecked" in h) continue;
|
|
185
|
+
R(e, s, null, a, o);
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
|
-
for (
|
|
188
|
-
if (
|
|
189
|
-
else if (i && (e.innerHTML = ""),
|
|
190
|
-
|
|
188
|
+
for (s in h) a = h[s], s == "children" ? m = a : s == "dangerouslySetInnerHTML" ? u = a : s == "value" ? y = a : s == "checked" ? k = a : c && typeof a != "function" || g[s] === a || R(e, s, a, g[s], o);
|
|
189
|
+
if (u) c || i && (u.__html == i.__html || u.__html == e.innerHTML) || (e.innerHTML = u.__html), t.__k = [];
|
|
190
|
+
else if (i && (e.innerHTML = ""), Ee(t.type == "template" ? e.content : e, B(m) ? m : [m], t, _, r, p == "foreignObject" ? "http://www.w3.org/1999/xhtml" : o, n, l, n ? n[0] : _.__k && H(_, 0), c, f), n != null) for (s = n.length; s--; ) te(n[s]);
|
|
191
|
+
c || (s = "value", p == "progress" && y == null ? e.removeAttribute("value") : y != null && (y !== e[s] || p == "progress" && !y || p == "option" && y != g[s]) && R(e, s, y, g[s], o), s = "checked", k != null && k != e[s] && R(e, s, k, g[s], o));
|
|
191
192
|
}
|
|
192
193
|
return e;
|
|
193
194
|
}
|
|
194
|
-
function
|
|
195
|
+
function ne(e, t, _) {
|
|
195
196
|
try {
|
|
196
197
|
if (typeof e == "function") {
|
|
197
|
-
var
|
|
198
|
-
|
|
198
|
+
var r = typeof e.__u == "function";
|
|
199
|
+
r && e.__u(), r && t == null || (e.__u = e(t));
|
|
199
200
|
} else e.current = t;
|
|
200
|
-
} catch (
|
|
201
|
-
|
|
201
|
+
} catch (o) {
|
|
202
|
+
d.__e(o, _);
|
|
202
203
|
}
|
|
203
204
|
}
|
|
204
|
-
function
|
|
205
|
-
var
|
|
206
|
-
if (
|
|
207
|
-
if (
|
|
208
|
-
|
|
209
|
-
} catch (
|
|
210
|
-
|
|
205
|
+
function Pe(e, t, _) {
|
|
206
|
+
var r, o;
|
|
207
|
+
if (d.unmount && d.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || ne(r, null, t)), (r = e.__c) != null) {
|
|
208
|
+
if (r.componentWillUnmount) try {
|
|
209
|
+
r.componentWillUnmount();
|
|
210
|
+
} catch (n) {
|
|
211
|
+
d.__e(n, t);
|
|
211
212
|
}
|
|
212
|
-
|
|
213
|
+
r.base = r.__P = null;
|
|
213
214
|
}
|
|
214
|
-
if (
|
|
215
|
-
_ ||
|
|
215
|
+
if (r = e.__k) for (o = 0; o < r.length; o++) r[o] && Pe(r[o], t, _ || typeof e.type != "function");
|
|
216
|
+
_ || te(e.__e), e.__c = e.__ = e.__e = void 0;
|
|
216
217
|
}
|
|
217
|
-
function
|
|
218
|
+
function qe(e, t, _) {
|
|
218
219
|
return this.constructor(e, _);
|
|
219
220
|
}
|
|
220
|
-
function
|
|
221
|
-
var o, n,
|
|
222
|
-
|
|
221
|
+
function z(e, t, _) {
|
|
222
|
+
var r, o, n, l;
|
|
223
|
+
t == document && (t = document.documentElement), d.__ && d.__(e, t), o = (r = typeof _ == "function") ? null : _ && _.__k || t.__k, n = [], l = [], _e(t, e = (!r && _ || t).__k = P(M, null, [e]), o || L, L, t.namespaceURI, !r && _ ? [_] : o ? null : t.firstChild ? A.call(t.childNodes) : null, n, !r && _ ? _ : o ? o.__e : t.firstChild, r, l), xe(n, e, l);
|
|
223
224
|
}
|
|
224
|
-
function
|
|
225
|
-
|
|
225
|
+
function He(e, t) {
|
|
226
|
+
z(e, t, He);
|
|
226
227
|
}
|
|
227
|
-
function
|
|
228
|
-
var o, n,
|
|
229
|
-
for (
|
|
230
|
-
return arguments.length > 2 && (
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
for (var
|
|
234
|
-
if ((
|
|
235
|
-
} catch (
|
|
236
|
-
e =
|
|
228
|
+
function Ne(e, t, _) {
|
|
229
|
+
var r, o, n, l, c = $({}, e.props);
|
|
230
|
+
for (n in e.type && e.type.defaultProps && (l = e.type.defaultProps), t) n == "key" ? r = t[n] : n == "ref" ? o = t[n] : c[n] = t[n] === void 0 && l != null ? l[n] : t[n];
|
|
231
|
+
return arguments.length > 2 && (c.children = arguments.length > 3 ? A.call(arguments, 2) : _), T(e.type, c, r || e.key, o || e.ref, null);
|
|
232
|
+
}
|
|
233
|
+
A = we.slice, d = { __e: function(e, t, _, r) {
|
|
234
|
+
for (var o, n, l; t = t.__; ) if ((o = t.__c) && !o.__) try {
|
|
235
|
+
if ((n = o.constructor) && n.getDerivedStateFromError != null && (o.setState(n.getDerivedStateFromError(e)), l = o.__d), o.componentDidCatch != null && (o.componentDidCatch(e, r || {}), l = o.__d), l) return o.__E = o;
|
|
236
|
+
} catch (c) {
|
|
237
|
+
e = c;
|
|
237
238
|
}
|
|
238
239
|
throw e;
|
|
239
|
-
} },
|
|
240
|
+
} }, ye = 0, j.prototype.setState = function(e, t) {
|
|
240
241
|
var _;
|
|
241
|
-
_ = this.__s != null && this.__s
|
|
242
|
-
},
|
|
243
|
-
this.__v && (this.__e = !0, e && this.__h.push(e),
|
|
244
|
-
},
|
|
242
|
+
_ = 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), ie(this));
|
|
243
|
+
}, j.prototype.forceUpdate = function(e) {
|
|
244
|
+
this.__v && (this.__e = !0, e && this.__h.push(e), ie(this));
|
|
245
|
+
}, j.prototype.render = M, x = [], ge = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, be = function(e, t) {
|
|
245
246
|
return e.__v.__b - t.__v.__b;
|
|
246
|
-
},
|
|
247
|
-
function
|
|
248
|
-
return
|
|
247
|
+
}, I.__r = 0, ke = /(PointerCapture)$|Capture$/i, ee = 0, K = se(!1), Q = se(!0);
|
|
248
|
+
function W() {
|
|
249
|
+
return W = Object.assign ? Object.assign.bind() : function(e) {
|
|
249
250
|
for (var t = 1; t < arguments.length; t++) {
|
|
250
251
|
var _ = arguments[t];
|
|
251
|
-
for (var
|
|
252
|
+
for (var r in _) Object.prototype.hasOwnProperty.call(_, r) && (e[r] = _[r]);
|
|
252
253
|
}
|
|
253
254
|
return e;
|
|
254
|
-
}
|
|
255
|
+
}, W.apply(this, arguments);
|
|
256
|
+
}
|
|
257
|
+
function Se(e, t) {
|
|
258
|
+
if (e == null) return {};
|
|
259
|
+
var _, r, o = {}, n = Object.keys(e);
|
|
260
|
+
for (r = 0; r < n.length; r++) t.indexOf(_ = n[r]) >= 0 || (o[_] = e[_]);
|
|
261
|
+
return o;
|
|
262
|
+
}
|
|
263
|
+
var Be = ["context", "children"], ze = ["useFragment"];
|
|
264
|
+
function Te(e, t, _, r) {
|
|
265
|
+
function o() {
|
|
266
|
+
var n = Reflect.construct(HTMLElement, [], o);
|
|
267
|
+
return n._vdomComponent = e, n._root = n, n;
|
|
268
|
+
}
|
|
269
|
+
return (o.prototype = Object.create(HTMLElement.prototype)).constructor = o, o.prototype.connectedCallback = function() {
|
|
270
|
+
Ge.call(this, r);
|
|
271
|
+
}, o.prototype.attributeChangedCallback = Ke, o.prototype.disconnectedCallback = Qe, _ = _ || e.observedAttributes || Object.keys(e.propTypes || {}), o.observedAttributes = _, e.formAssociated && (o.formAssociated = !0), _.forEach(function(n) {
|
|
272
|
+
Object.defineProperty(o.prototype, n, { get: function() {
|
|
273
|
+
return this._vdom ? this._vdom.props[n] : this._props[n];
|
|
274
|
+
}, set: function(l) {
|
|
275
|
+
this._vdom ? this.attributeChangedCallback(n, null, l) : (this._props || (this._props = {}), this._props[n] = l);
|
|
276
|
+
var c = typeof l;
|
|
277
|
+
l != null && c !== "string" && c !== "boolean" && c !== "number" || this.setAttribute(n, l);
|
|
278
|
+
} });
|
|
279
|
+
}), customElements.define(t || e.tagName || e.displayName || e.name, o), o;
|
|
255
280
|
}
|
|
256
|
-
|
|
257
|
-
function je(e) {
|
|
281
|
+
function Je(e) {
|
|
258
282
|
this.getChildContext = function() {
|
|
259
283
|
return e.context;
|
|
260
284
|
};
|
|
261
|
-
var t = e.children, _ = (
|
|
262
|
-
|
|
263
|
-
var r, c, s = {}, l = Object.keys(o);
|
|
264
|
-
for (c = 0; c < l.length; c++) n.indexOf(r = l[c]) >= 0 || (s[r] = o[r]);
|
|
265
|
-
return s;
|
|
266
|
-
})(e, Oe);
|
|
267
|
-
return xe(t, _);
|
|
268
|
-
}
|
|
269
|
-
function Ie() {
|
|
270
|
-
var e = new CustomEvent("_preact", { detail: {}, bubbles: !0, cancelable: !0 });
|
|
271
|
-
this.dispatchEvent(e), this._vdom = D(je, _e({}, this._props, { context: e.detail.context }), (function t(_, o) {
|
|
272
|
-
if (_.nodeType === 3) return _.data;
|
|
273
|
-
if (_.nodeType !== 1) return null;
|
|
274
|
-
var n = [], r = {}, c = 0, s = _.attributes, l = _.childNodes;
|
|
275
|
-
for (c = s.length; c--; ) s[c].name !== "slot" && (r[s[c].name] = s[c].value, r[De(s[c].name)] = s[c].value);
|
|
276
|
-
for (c = l.length; c--; ) {
|
|
277
|
-
var a = t(l[c], null), f = l[c].slot;
|
|
278
|
-
f ? r[f] = D(se, { name: f }, a) : n[c] = a;
|
|
279
|
-
}
|
|
280
|
-
var i = o ? D(se, null, n) : n;
|
|
281
|
-
return D(o || _.nodeName.toLowerCase(), r, i);
|
|
282
|
-
})(this, this._vdomComponent)), (this.hasAttribute("hydrate") ? Ee : V)(this._vdom, this._root);
|
|
285
|
+
var t = e.children, _ = Se(e, Be);
|
|
286
|
+
return Ne(t, _);
|
|
283
287
|
}
|
|
284
|
-
function
|
|
288
|
+
function Ge(e) {
|
|
289
|
+
var t = new CustomEvent("_preact", { detail: {}, bubbles: !0, cancelable: !0 });
|
|
290
|
+
this.dispatchEvent(t), this._vdom = P(Je, W({}, this._props, { context: t.detail.context }), Ae(this, this._vdomComponent, e)), (this.hasAttribute("hydrate") ? He : z)(this._vdom, this._root);
|
|
291
|
+
}
|
|
292
|
+
function Le(e) {
|
|
285
293
|
return e.replace(/-(\w)/g, function(t, _) {
|
|
286
294
|
return _ ? _.toUpperCase() : "";
|
|
287
295
|
});
|
|
288
296
|
}
|
|
289
|
-
function
|
|
297
|
+
function Ke(e, t, _) {
|
|
290
298
|
if (this._vdom) {
|
|
291
|
-
var
|
|
292
|
-
|
|
299
|
+
var r = {};
|
|
300
|
+
r[e] = _ = _ ?? void 0, r[Le(e)] = _, this._vdom = Ne(this._vdom, r), z(this._vdom, this._root);
|
|
293
301
|
}
|
|
294
302
|
}
|
|
295
|
-
function
|
|
296
|
-
|
|
303
|
+
function Qe() {
|
|
304
|
+
z(this._vdom = null, this._root);
|
|
297
305
|
}
|
|
298
|
-
function
|
|
299
|
-
var _ = this;
|
|
300
|
-
return
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
},
|
|
306
|
+
function ce(e, t) {
|
|
307
|
+
var _ = this, r = e.useFragment, o = Se(e, ze);
|
|
308
|
+
return P(r ? M : "slot", W({}, o, { ref: function(n) {
|
|
309
|
+
n ? (_.ref = n, _._listener || (_._listener = function(l) {
|
|
310
|
+
l.stopPropagation(), l.detail.context = t;
|
|
311
|
+
}, n.addEventListener("_preact", _._listener))) : _.ref.removeEventListener("_preact", _._listener);
|
|
304
312
|
} }));
|
|
305
313
|
}
|
|
306
|
-
function
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
314
|
+
function Ae(e, t, _) {
|
|
315
|
+
if (e.nodeType === 3) return e.data;
|
|
316
|
+
if (e.nodeType !== 1) return null;
|
|
317
|
+
var r = [], o = {}, n = 0, l = e.attributes, c = e.childNodes;
|
|
318
|
+
for (n = l.length; n--; ) l[n].name !== "slot" && (o[l[n].name] = l[n].value, o[Le(l[n].name)] = l[n].value);
|
|
319
|
+
for (n = c.length; n--; ) {
|
|
320
|
+
var f = Ae(c[n], null, _), s = c[n].slot;
|
|
321
|
+
s ? o[s] = P(ce, { name: s }, f) : r[n] = f;
|
|
310
322
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
return this._vdom.props[r];
|
|
314
|
-
}, set: function(c) {
|
|
315
|
-
this._vdom ? this.attributeChangedCallback(r, null, c) : (this._props || (this._props = {}), this._props[r] = c, this.connectedCallback());
|
|
316
|
-
var s = typeof c;
|
|
317
|
-
c != null && s !== "string" && s !== "boolean" && s !== "number" || this.setAttribute(r, c);
|
|
318
|
-
} });
|
|
319
|
-
}), customElements.define(t || e.tagName || e.displayName || e.name, n);
|
|
323
|
+
var u = !(!_ || !_.shadow), i = t ? P(ce, { useFragment: !u }, r) : r;
|
|
324
|
+
return !u && t && (e.innerHTML = ""), P(t || e.nodeName.toLowerCase(), o, i);
|
|
320
325
|
}
|
|
321
|
-
var
|
|
322
|
-
function
|
|
323
|
-
|
|
326
|
+
var V, b, G, ae, Y = 0, Me = [], v = d, ue = v.__b, fe = v.__r, de = v.diffed, pe = v.__c, he = v.unmount, me = v.__;
|
|
327
|
+
function Fe(e, t) {
|
|
328
|
+
v.__h && v.__h(b, e, Y || t), Y = 0;
|
|
324
329
|
var _ = b.__H || (b.__H = { __: [], __h: [] });
|
|
325
330
|
return e >= _.__.length && _.__.push({}), _.__[e];
|
|
326
331
|
}
|
|
327
|
-
function
|
|
328
|
-
var _ =
|
|
329
|
-
!
|
|
332
|
+
function q(e, t) {
|
|
333
|
+
var _ = Fe(V++, 3);
|
|
334
|
+
!v.__s && Re(_.__H, t) && (_.__ = e, _.u = t, b.__H.__h.push(_));
|
|
330
335
|
}
|
|
331
|
-
function
|
|
332
|
-
return
|
|
336
|
+
function Ue(e) {
|
|
337
|
+
return Y = 5, Xe(function() {
|
|
333
338
|
return { current: e };
|
|
334
339
|
}, []);
|
|
335
340
|
}
|
|
336
|
-
function
|
|
337
|
-
var _ =
|
|
338
|
-
return
|
|
341
|
+
function Xe(e, t) {
|
|
342
|
+
var _ = Fe(V++, 7);
|
|
343
|
+
return Re(_.__H, t) && (_.__ = e(), _.__H = t, _.__h = e), _.__;
|
|
339
344
|
}
|
|
340
|
-
function
|
|
341
|
-
for (var e; e =
|
|
342
|
-
e.__H.__h.forEach(
|
|
345
|
+
function Ye() {
|
|
346
|
+
for (var e; e = Me.shift(); ) if (e.__P && e.__H) try {
|
|
347
|
+
e.__H.__h.forEach(O), e.__H.__h.forEach(Z), e.__H.__h = [];
|
|
343
348
|
} catch (t) {
|
|
344
|
-
e.__H.__h = [],
|
|
349
|
+
e.__H.__h = [], v.__e(t, e.__v);
|
|
345
350
|
}
|
|
346
351
|
}
|
|
347
|
-
|
|
348
|
-
b = null,
|
|
349
|
-
},
|
|
350
|
-
e && t.__k && t.__k.__m && (e.__m = t.__k.__m),
|
|
351
|
-
},
|
|
352
|
-
|
|
352
|
+
v.__b = function(e) {
|
|
353
|
+
b = null, ue && ue(e);
|
|
354
|
+
}, v.__ = function(e, t) {
|
|
355
|
+
e && t.__k && t.__k.__m && (e.__m = t.__k.__m), me && me(e, t);
|
|
356
|
+
}, v.__r = function(e) {
|
|
357
|
+
fe && fe(e), V = 0;
|
|
353
358
|
var t = (b = e.__c).__H;
|
|
354
|
-
t && (
|
|
355
|
-
_.__N && (_.__ = _.__N), _.
|
|
356
|
-
})) : (t.__h.forEach(
|
|
357
|
-
},
|
|
358
|
-
|
|
359
|
+
t && (G === b ? (t.__h = [], b.__h = [], t.__.forEach(function(_) {
|
|
360
|
+
_.__N && (_.__ = _.__N), _.u = _.__N = void 0;
|
|
361
|
+
})) : (t.__h.forEach(O), t.__h.forEach(Z), t.__h = [], V = 0)), G = b;
|
|
362
|
+
}, v.diffed = function(e) {
|
|
363
|
+
de && de(e);
|
|
359
364
|
var t = e.__c;
|
|
360
|
-
t && t.__H && (t.__H.__h.length && (
|
|
361
|
-
_.
|
|
362
|
-
})),
|
|
363
|
-
},
|
|
365
|
+
t && t.__H && (t.__H.__h.length && (Me.push(t) !== 1 && ae === v.requestAnimationFrame || ((ae = v.requestAnimationFrame) || Ze)(Ye)), t.__H.__.forEach(function(_) {
|
|
366
|
+
_.u && (_.__H = _.u), _.u = void 0;
|
|
367
|
+
})), G = b = null;
|
|
368
|
+
}, v.__c = function(e, t) {
|
|
364
369
|
t.some(function(_) {
|
|
365
370
|
try {
|
|
366
|
-
_.__h.forEach(
|
|
367
|
-
return !
|
|
371
|
+
_.__h.forEach(O), _.__h = _.__h.filter(function(r) {
|
|
372
|
+
return !r.__ || Z(r);
|
|
368
373
|
});
|
|
369
|
-
} catch (
|
|
370
|
-
t.some(function(
|
|
371
|
-
|
|
372
|
-
}), t = [],
|
|
374
|
+
} catch (r) {
|
|
375
|
+
t.some(function(o) {
|
|
376
|
+
o.__h && (o.__h = []);
|
|
377
|
+
}), t = [], v.__e(r, _.__v);
|
|
373
378
|
}
|
|
374
|
-
}),
|
|
375
|
-
},
|
|
376
|
-
|
|
379
|
+
}), pe && pe(e, t);
|
|
380
|
+
}, v.unmount = function(e) {
|
|
381
|
+
he && he(e);
|
|
377
382
|
var t, _ = e.__c;
|
|
378
|
-
_ && _.__H && (_.__H.__.forEach(function(
|
|
383
|
+
_ && _.__H && (_.__H.__.forEach(function(r) {
|
|
379
384
|
try {
|
|
380
|
-
|
|
381
|
-
} catch (
|
|
382
|
-
t =
|
|
385
|
+
O(r);
|
|
386
|
+
} catch (o) {
|
|
387
|
+
t = o;
|
|
383
388
|
}
|
|
384
|
-
}), _.__H = void 0, t &&
|
|
389
|
+
}), _.__H = void 0, t && v.__e(t, _.__v));
|
|
385
390
|
};
|
|
386
|
-
var
|
|
387
|
-
function
|
|
391
|
+
var ve = typeof requestAnimationFrame == "function";
|
|
392
|
+
function Ze(e) {
|
|
388
393
|
var t, _ = function() {
|
|
389
|
-
clearTimeout(
|
|
390
|
-
},
|
|
391
|
-
|
|
394
|
+
clearTimeout(r), ve && cancelAnimationFrame(t), setTimeout(e);
|
|
395
|
+
}, r = setTimeout(_, 35);
|
|
396
|
+
ve && (t = requestAnimationFrame(_));
|
|
392
397
|
}
|
|
393
|
-
function
|
|
398
|
+
function O(e) {
|
|
394
399
|
var t = b, _ = e.__c;
|
|
395
400
|
typeof _ == "function" && (e.__c = void 0, _()), b = t;
|
|
396
401
|
}
|
|
397
|
-
function
|
|
402
|
+
function Z(e) {
|
|
398
403
|
var t = b;
|
|
399
404
|
e.__c = e.__(), b = t;
|
|
400
405
|
}
|
|
401
|
-
function
|
|
402
|
-
return !e || e.length !== t.length || t.some(function(_,
|
|
403
|
-
return _ !== e[
|
|
406
|
+
function Re(e, t) {
|
|
407
|
+
return !e || e.length !== t.length || t.some(function(_, r) {
|
|
408
|
+
return _ !== e[r];
|
|
404
409
|
});
|
|
405
410
|
}
|
|
406
|
-
var
|
|
407
|
-
function
|
|
411
|
+
var et = 0;
|
|
412
|
+
function je(e, t, _, r, o, n) {
|
|
408
413
|
t || (t = {});
|
|
409
|
-
var
|
|
410
|
-
if ("ref" in
|
|
411
|
-
var
|
|
412
|
-
return
|
|
414
|
+
var l, c, f = t;
|
|
415
|
+
if ("ref" in f) for (c in f = {}, t) c == "ref" ? l = t[c] : f[c] = t[c];
|
|
416
|
+
var s = { type: e, props: f, key: _, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --et, __i: -1, __u: 0, __source: o, __self: n };
|
|
417
|
+
return d.vnode && d.vnode(s), s;
|
|
413
418
|
}
|
|
414
|
-
function
|
|
415
|
-
const t =
|
|
419
|
+
function tt(e) {
|
|
420
|
+
const t = Ue(null);
|
|
416
421
|
function _() {
|
|
417
|
-
const
|
|
422
|
+
const o = e.host || "https://app.documenso.com", n = btoa(
|
|
418
423
|
encodeURIComponent(
|
|
419
424
|
JSON.stringify({
|
|
420
425
|
name: e.name,
|
|
@@ -427,20 +432,20 @@ function Ge(e) {
|
|
|
427
432
|
...e.additionalProps
|
|
428
433
|
})
|
|
429
434
|
)
|
|
430
|
-
),
|
|
431
|
-
return e.externalId &&
|
|
435
|
+
), l = new URL(`/embed/direct/${e.token}`, o);
|
|
436
|
+
return e.externalId && l.searchParams.set("externalId", e.externalId), `${l}#${n}`;
|
|
432
437
|
}
|
|
433
|
-
function o
|
|
434
|
-
if (t.current?.contentWindow ===
|
|
435
|
-
switch (
|
|
438
|
+
function r(o) {
|
|
439
|
+
if (t.current?.contentWindow === o.source)
|
|
440
|
+
switch (o.data.action) {
|
|
436
441
|
case "document-ready":
|
|
437
442
|
e.onDocumentReady?.();
|
|
438
443
|
break;
|
|
439
444
|
case "document-completed":
|
|
440
|
-
e.onDocumentCompleted?.(
|
|
445
|
+
e.onDocumentCompleted?.(o.data.data);
|
|
441
446
|
break;
|
|
442
447
|
case "document-error":
|
|
443
|
-
e.onDocumentError?.(
|
|
448
|
+
e.onDocumentError?.(o.data.data);
|
|
444
449
|
break;
|
|
445
450
|
case "field-signed":
|
|
446
451
|
e.onFieldSigned?.();
|
|
@@ -450,16 +455,16 @@ function Ge(e) {
|
|
|
450
455
|
break;
|
|
451
456
|
}
|
|
452
457
|
}
|
|
453
|
-
return
|
|
454
|
-
window.addEventListener("message",
|
|
455
|
-
}, []),
|
|
456
|
-
window.removeEventListener("message",
|
|
457
|
-
}, []), /* @__PURE__ */
|
|
458
|
-
}
|
|
459
|
-
function
|
|
460
|
-
const t =
|
|
458
|
+
return q(() => {
|
|
459
|
+
window.addEventListener("message", r);
|
|
460
|
+
}, []), q(() => () => {
|
|
461
|
+
window.removeEventListener("message", r);
|
|
462
|
+
}, []), /* @__PURE__ */ je("iframe", { ref: t, className: e.className, src: _() });
|
|
463
|
+
}
|
|
464
|
+
function _t(e) {
|
|
465
|
+
const t = Ue(null);
|
|
461
466
|
function _() {
|
|
462
|
-
const
|
|
467
|
+
const o = e.host || "https://app.documenso.com", n = btoa(
|
|
463
468
|
encodeURIComponent(
|
|
464
469
|
JSON.stringify({
|
|
465
470
|
name: e.name,
|
|
@@ -472,32 +477,32 @@ function Ke(e) {
|
|
|
472
477
|
})
|
|
473
478
|
)
|
|
474
479
|
);
|
|
475
|
-
return `${new URL(`/embed/sign/${e.token}`,
|
|
480
|
+
return `${new URL(`/embed/sign/${e.token}`, o)}#${n}`;
|
|
476
481
|
}
|
|
477
|
-
function o
|
|
478
|
-
if (t.current?.contentWindow ===
|
|
479
|
-
switch (
|
|
482
|
+
function r(o) {
|
|
483
|
+
if (t.current?.contentWindow === o.source)
|
|
484
|
+
switch (o.data.action) {
|
|
480
485
|
case "document-ready":
|
|
481
486
|
e.onDocumentReady?.();
|
|
482
487
|
break;
|
|
483
488
|
case "document-completed":
|
|
484
|
-
e.onDocumentCompleted?.(
|
|
489
|
+
e.onDocumentCompleted?.(o.data.data);
|
|
485
490
|
break;
|
|
486
491
|
case "document-error":
|
|
487
|
-
e.onDocumentError?.(
|
|
492
|
+
e.onDocumentError?.(o.data.data);
|
|
488
493
|
break;
|
|
489
494
|
case "document-rejected":
|
|
490
|
-
e.onDocumentRejected?.(
|
|
495
|
+
e.onDocumentRejected?.(o.data.data);
|
|
491
496
|
break;
|
|
492
497
|
}
|
|
493
498
|
}
|
|
494
|
-
return
|
|
495
|
-
window.addEventListener("message",
|
|
496
|
-
}, []),
|
|
497
|
-
window.removeEventListener("message",
|
|
498
|
-
}, []), /* @__PURE__ */
|
|
499
|
+
return q(() => {
|
|
500
|
+
window.addEventListener("message", r);
|
|
501
|
+
}, []), q(() => () => {
|
|
502
|
+
window.removeEventListener("message", r);
|
|
503
|
+
}, []), /* @__PURE__ */ je("iframe", { ref: t, className: e.className, src: _() });
|
|
499
504
|
}
|
|
500
|
-
|
|
505
|
+
Te(tt, "documenso-embed-direct-template", [
|
|
501
506
|
"token",
|
|
502
507
|
"host",
|
|
503
508
|
"externalId",
|
|
@@ -510,7 +515,7 @@ Pe(Ge, "documenso-embed-direct-template", [
|
|
|
510
515
|
"onDocumentCompleted",
|
|
511
516
|
"onDocumentError"
|
|
512
517
|
]);
|
|
513
|
-
|
|
518
|
+
Te(_t, "documenso-embed-sign-document", [
|
|
514
519
|
"token",
|
|
515
520
|
"host",
|
|
516
521
|
"css",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@documenso/embed-webcomponent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@documenso/embed": "*",
|
|
43
|
-
"@types/preact-custom-element": "^4.0.
|
|
43
|
+
"@types/preact-custom-element": "^4.0.0",
|
|
44
44
|
"vite": "^7.0.0",
|
|
45
|
-
"vite-plugin-dts": "^4.
|
|
45
|
+
"vite-plugin-dts": "^4.0.0"
|
|
46
46
|
}
|
|
47
47
|
}
|