gp-designer 1.0.84 → 1.0.85

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.
@@ -36,7 +36,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
36
36
  content: "" !important;
37
37
  display: none !important;
38
38
  }`,fb=function(A){hb(A,"."+hi+cb+Pl+`
39
- .`+di+lb+Pl)},hb=function(A,e){var t=A.ownerDocument;if(t){var r=t.createElement("style");r.textContent=e,A.appendChild(r)}},Kl=function(){function A(){}return A.getOrigin=function(e){var t=A._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},A.isSameOrigin=function(e){return A.getOrigin(e)===A._origin},A.setContext=function(e){A._link=e.document.createElement("a"),A._origin=A.getOrigin(e.location.href)},A._origin="about:blank",A}(),db=function(){function A(e,t){this.context=e,this._options=t,this._cache={}}return A.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(gi(e)||pb(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),t},A.prototype.match=function(e){return this._cache[e]},A.prototype.loadImage=function(e){return qA(this,void 0,void 0,function(){var t,r,n,a,s=this;return GA(this,function(u){switch(u.label){case 0:return t=Kl.isSameOrigin(e),r=!Bi(e)&&this._options.useCORS===!0&&PA.SUPPORT_CORS_IMAGES&&!t,n=!Bi(e)&&!t&&!gi(e)&&typeof this._options.proxy=="string"&&PA.SUPPORT_CORS_XHR&&!r,!t&&this._options.allowTaint===!1&&!Bi(e)&&!gi(e)&&!n&&!r?[2]:(a=e,n?[4,this.proxy(a)]:[3,2]);case 1:a=u.sent(),u.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(o,l){var f=new Image;f.onload=function(){return o(f)},f.onerror=l,(mb(a)||r)&&(f.crossOrigin="anonymous"),f.src=a,f.complete===!0&&setTimeout(function(){return o(f)},500),s._options.imageTimeout>0&&setTimeout(function(){return l("Timed out ("+s._options.imageTimeout+"ms) loading image")},s._options.imageTimeout)})];case 3:return[2,u.sent()]}})})},A.prototype.has=function(e){return typeof this._cache[e]<"u"},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(e){var t=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var n=e.substring(0,256);return new Promise(function(a,s){var u=PA.SUPPORT_RESPONSE_TYPE?"blob":"text",o=new XMLHttpRequest;o.onload=function(){if(o.status===200)if(u==="text")a(o.response);else{var h=new FileReader;h.addEventListener("load",function(){return a(h.result)},!1),h.addEventListener("error",function(d){return s(d)},!1),h.readAsDataURL(o.response)}else s("Failed to proxy resource "+n+" with status code "+o.status)},o.onerror=s;var l=r.indexOf("?")>-1?"&":"?";if(o.open("GET",""+r+l+"url="+encodeURIComponent(e)+"&responseType="+u),u!=="text"&&o instanceof XMLHttpRequest&&(o.responseType=u),t._options.imageTimeout){var f=t._options.imageTimeout;o.timeout=f,o.ontimeout=function(){return s("Timed out ("+f+"ms) proxying "+n)}}o.send()})},A}(),Bb=/^data:image\/svg\+xml/i,gb=/^data:image\/.*;base64,/i,Eb=/^data:image\/.*/i,pb=function(A){return PA.SUPPORT_SVG_DRAWING||!Cb(A)},Bi=function(A){return Eb.test(A)},mb=function(A){return gb.test(A)},gi=function(A){return A.substr(0,4)==="blob"},Cb=function(A){return A.substr(-3).toLowerCase()==="svg"||Bb.test(A)},R=function(){function A(e,t){this.type=0,this.x=e,this.y=t}return A.prototype.add=function(e,t){return new A(this.x+e,this.y+t)},A}(),Pt=function(A,e,t){return new R(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)},aa=function(){function A(e,t,r,n){this.type=1,this.start=e,this.startControl=t,this.endControl=r,this.end=n}return A.prototype.subdivide=function(e,t){var r=Pt(this.start,this.startControl,e),n=Pt(this.startControl,this.endControl,e),a=Pt(this.endControl,this.end,e),s=Pt(r,n,e),u=Pt(n,a,e),o=Pt(s,u,e);return t?new A(this.start,r,s,o):new A(o,u,a,this.end)},A.prototype.add=function(e,t){return new A(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A}(),fe=function(A){return A.type===1},wb=function(){function A(e){var t=e.styles,r=e.bounds,n=Nr(t.borderTopLeftRadius,r.width,r.height),a=n[0],s=n[1],u=Nr(t.borderTopRightRadius,r.width,r.height),o=u[0],l=u[1],f=Nr(t.borderBottomRightRadius,r.width,r.height),h=f[0],d=f[1],C=Nr(t.borderBottomLeftRadius,r.width,r.height),m=C[0],T=C[1],U=[];U.push((a+o)/r.width),U.push((m+h)/r.width),U.push((s+T)/r.height),U.push((l+d)/r.height);var N=Math.max.apply(Math,U);N>1&&(a/=N,s/=N,o/=N,l/=N,h/=N,d/=N,m/=N,T/=N);var _=r.width-o,D=r.height-d,P=r.width-h,L=r.height-T,p=t.borderTopWidth,H=t.borderRightWidth,K=t.borderBottomWidth,k=t.borderLeftWidth,tA=dA(t.paddingTop,e.bounds.width),cA=dA(t.paddingRight,e.bounds.width),BA=dA(t.paddingBottom,e.bounds.width),q=dA(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=a>0||s>0?CA(r.left+k/3,r.top+p/3,a-k/3,s-p/3,iA.TOP_LEFT):new R(r.left+k/3,r.top+p/3),this.topRightBorderDoubleOuterBox=a>0||s>0?CA(r.left+_,r.top+p/3,o-H/3,l-p/3,iA.TOP_RIGHT):new R(r.left+r.width-H/3,r.top+p/3),this.bottomRightBorderDoubleOuterBox=h>0||d>0?CA(r.left+P,r.top+D,h-H/3,d-K/3,iA.BOTTOM_RIGHT):new R(r.left+r.width-H/3,r.top+r.height-K/3),this.bottomLeftBorderDoubleOuterBox=m>0||T>0?CA(r.left+k/3,r.top+L,m-k/3,T-K/3,iA.BOTTOM_LEFT):new R(r.left+k/3,r.top+r.height-K/3),this.topLeftBorderDoubleInnerBox=a>0||s>0?CA(r.left+k*2/3,r.top+p*2/3,a-k*2/3,s-p*2/3,iA.TOP_LEFT):new R(r.left+k*2/3,r.top+p*2/3),this.topRightBorderDoubleInnerBox=a>0||s>0?CA(r.left+_,r.top+p*2/3,o-H*2/3,l-p*2/3,iA.TOP_RIGHT):new R(r.left+r.width-H*2/3,r.top+p*2/3),this.bottomRightBorderDoubleInnerBox=h>0||d>0?CA(r.left+P,r.top+D,h-H*2/3,d-K*2/3,iA.BOTTOM_RIGHT):new R(r.left+r.width-H*2/3,r.top+r.height-K*2/3),this.bottomLeftBorderDoubleInnerBox=m>0||T>0?CA(r.left+k*2/3,r.top+L,m-k*2/3,T-K*2/3,iA.BOTTOM_LEFT):new R(r.left+k*2/3,r.top+r.height-K*2/3),this.topLeftBorderStroke=a>0||s>0?CA(r.left+k/2,r.top+p/2,a-k/2,s-p/2,iA.TOP_LEFT):new R(r.left+k/2,r.top+p/2),this.topRightBorderStroke=a>0||s>0?CA(r.left+_,r.top+p/2,o-H/2,l-p/2,iA.TOP_RIGHT):new R(r.left+r.width-H/2,r.top+p/2),this.bottomRightBorderStroke=h>0||d>0?CA(r.left+P,r.top+D,h-H/2,d-K/2,iA.BOTTOM_RIGHT):new R(r.left+r.width-H/2,r.top+r.height-K/2),this.bottomLeftBorderStroke=m>0||T>0?CA(r.left+k/2,r.top+L,m-k/2,T-K/2,iA.BOTTOM_LEFT):new R(r.left+k/2,r.top+r.height-K/2),this.topLeftBorderBox=a>0||s>0?CA(r.left,r.top,a,s,iA.TOP_LEFT):new R(r.left,r.top),this.topRightBorderBox=o>0||l>0?CA(r.left+_,r.top,o,l,iA.TOP_RIGHT):new R(r.left+r.width,r.top),this.bottomRightBorderBox=h>0||d>0?CA(r.left+P,r.top+D,h,d,iA.BOTTOM_RIGHT):new R(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=m>0||T>0?CA(r.left,r.top+L,m,T,iA.BOTTOM_LEFT):new R(r.left,r.top+r.height),this.topLeftPaddingBox=a>0||s>0?CA(r.left+k,r.top+p,Math.max(0,a-k),Math.max(0,s-p),iA.TOP_LEFT):new R(r.left+k,r.top+p),this.topRightPaddingBox=o>0||l>0?CA(r.left+Math.min(_,r.width-H),r.top+p,_>r.width+H?0:Math.max(0,o-H),Math.max(0,l-p),iA.TOP_RIGHT):new R(r.left+r.width-H,r.top+p),this.bottomRightPaddingBox=h>0||d>0?CA(r.left+Math.min(P,r.width-k),r.top+Math.min(D,r.height-K),Math.max(0,h-H),Math.max(0,d-K),iA.BOTTOM_RIGHT):new R(r.left+r.width-H,r.top+r.height-K),this.bottomLeftPaddingBox=m>0||T>0?CA(r.left+k,r.top+Math.min(L,r.height-K),Math.max(0,m-k),Math.max(0,T-K),iA.BOTTOM_LEFT):new R(r.left+k,r.top+r.height-K),this.topLeftContentBox=a>0||s>0?CA(r.left+k+q,r.top+p+tA,Math.max(0,a-(k+q)),Math.max(0,s-(p+tA)),iA.TOP_LEFT):new R(r.left+k+q,r.top+p+tA),this.topRightContentBox=o>0||l>0?CA(r.left+Math.min(_,r.width+k+q),r.top+p+tA,_>r.width+k+q?0:o-k+q,l-(p+tA),iA.TOP_RIGHT):new R(r.left+r.width-(H+cA),r.top+p+tA),this.bottomRightContentBox=h>0||d>0?CA(r.left+Math.min(P,r.width-(k+q)),r.top+Math.min(D,r.height+p+tA),Math.max(0,h-(H+cA)),d-(K+BA),iA.BOTTOM_RIGHT):new R(r.left+r.width-(H+cA),r.top+r.height-(K+BA)),this.bottomLeftContentBox=m>0||T>0?CA(r.left+k+q,r.top+L,Math.max(0,m-(k+q)),T-(K+BA),iA.BOTTOM_LEFT):new R(r.left+k+q,r.top+r.height-(K+BA))}return A}(),iA;(function(A){A[A.TOP_LEFT=0]="TOP_LEFT",A[A.TOP_RIGHT=1]="TOP_RIGHT",A[A.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",A[A.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(iA||(iA={}));var CA=function(A,e,t,r,n){var a=4*((Math.sqrt(2)-1)/3),s=t*a,u=r*a,o=A+t,l=e+r;switch(n){case iA.TOP_LEFT:return new aa(new R(A,l),new R(A,l-u),new R(o-s,e),new R(o,e));case iA.TOP_RIGHT:return new aa(new R(A,e),new R(A+s,e),new R(o,l-u),new R(o,l));case iA.BOTTOM_RIGHT:return new aa(new R(o,e),new R(o,e+u),new R(A+s,l),new R(A,l));case iA.BOTTOM_LEFT:default:return new aa(new R(o,l),new R(o-s,l),new R(A,e+u),new R(A,e))}},sa=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},Tb=function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]},ia=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},bb=function(){function A(e,t,r){this.offsetX=e,this.offsetY=t,this.matrix=r,this.type=0,this.target=6}return A}(),ua=function(){function A(e,t){this.path=e,this.target=t,this.type=1}return A}(),Ub=function(){function A(e){this.opacity=e,this.type=2,this.target=6}return A}(),Qb=function(A){return A.type===0},Vl=function(A){return A.type===1},Fb=function(A){return A.type===2},Gl=function(A,e){return A.length===e.length?A.some(function(t,r){return t===e[r]}):!1},Ib=function(A,e,t,r,n){return A.map(function(a,s){switch(s){case 0:return a.add(e,t);case 1:return a.add(e+r,t);case 2:return a.add(e+r,t+n);case 3:return a.add(e,t+n)}return a})},Yl=function(){function A(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return A}(),Xl=function(){function A(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new wb(this.container),this.container.styles.opacity<1&&this.effects.push(new Ub(this.container.styles.opacity)),this.container.styles.transform!==null){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,a=this.container.styles.transform;this.effects.push(new bb(r,n,a))}if(this.container.styles.overflowX!==0){var s=sa(this.curves),u=ia(this.curves);Gl(s,u)?this.effects.push(new ua(s,6)):(this.effects.push(new ua(s,2)),this.effects.push(new ua(u,4)))}}return A.prototype.getEffects=function(e){for(var t=[2,3].indexOf(this.container.styles.position)===-1,r=this.parent,n=this.effects.slice(0);r;){var a=r.effects.filter(function(o){return!Vl(o)});if(t||r.container.styles.position!==0||!r.parent){if(n.unshift.apply(n,a),t=[2,3].indexOf(r.container.styles.position)===-1,r.container.styles.overflowX!==0){var s=sa(r.curves),u=ia(r.curves);Gl(s,u)||n.unshift(new ua(u,6))}}else n.unshift.apply(n,a);r=r.parent}return n.filter(function(o){return vA(o.target,e)})},A}(),Ei=function(A,e,t,r){A.container.elements.forEach(function(n){var a=vA(n.flags,4),s=vA(n.flags,2),u=new Xl(n,A);vA(n.styles.display,2048)&&r.push(u);var o=vA(n.flags,8)?[]:r;if(a||s){var l=a||n.styles.isPositioned()?t:e,f=new Yl(u);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var h=n.styles.zIndex.order;if(h<0){var d=0;l.negativeZIndex.some(function(m,T){return h>m.element.container.styles.zIndex.order?(d=T,!1):d>0}),l.negativeZIndex.splice(d,0,f)}else if(h>0){var C=0;l.positiveZIndex.some(function(m,T){return h>=m.element.container.styles.zIndex.order?(C=T+1,!1):C>0}),l.positiveZIndex.splice(C,0,f)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(f)}else n.styles.isFloating()?l.nonPositionedFloats.push(f):l.nonPositionedInlineLevel.push(f);Ei(u,f,a?f:t,o)}else n.styles.isInlineLevel()?e.inlineLevel.push(u):e.nonInlineLevel.push(u),Ei(u,e,t,o);vA(n.flags,8)&&Wl(n,o)})},Wl=function(A,e){for(var t=A instanceof si?A.start:1,r=A instanceof si?A.reversed:!1,n=0;n<e.length;n++){var a=e[n];a.container instanceof pl&&typeof a.container.value=="number"&&a.container.value!==0&&(t=a.container.value),a.listValue=Dr(t,a.container.styles.listStyleType,!0),t+=r?-1:1}},_b=function(A){var e=new Xl(A,null),t=new Yl(e),r=[];return Ei(e,t,t,r),Wl(e.container,r),t},Jl=function(A,e){switch(e){case 0:return he(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return he(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return he(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);case 3:default:return he(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},yb=function(A,e){switch(e){case 0:return he(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return he(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return he(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);case 3:default:return he(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}},Nb=function(A,e){switch(e){case 0:return he(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return he(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return he(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);case 3:default:return he(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}},vb=function(A,e){switch(e){case 0:return oa(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return oa(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return oa(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);case 3:default:return oa(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}},oa=function(A,e){var t=[];return fe(A)?t.push(A.subdivide(.5,!1)):t.push(A),fe(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},he=function(A,e,t,r){var n=[];return fe(A)?n.push(A.subdivide(.5,!1)):n.push(A),fe(t)?n.push(t.subdivide(.5,!0)):n.push(t),fe(r)?n.push(r.subdivide(.5,!0).reverse()):n.push(r),fe(e)?n.push(e.subdivide(.5,!1).reverse()):n.push(e),n},ql=function(A){var e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},ca=function(A){var e=A.styles,t=A.bounds,r=dA(e.paddingLeft,t.width),n=dA(e.paddingRight,t.width),a=dA(e.paddingTop,t.width),s=dA(e.paddingBottom,t.width);return t.add(r+e.borderLeftWidth,a+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+r+n),-(e.borderTopWidth+e.borderBottomWidth+a+s))},Sb=function(A,e){return A===0?e.bounds:A===2?ca(e):ql(e)},xb=function(A,e){return A===0?e.bounds:A===2?ca(e):ql(e)},pi=function(A,e,t){var r=Sb(Vt(A.styles.backgroundOrigin,e),A),n=xb(Vt(A.styles.backgroundClip,e),A),a=Lb(Vt(A.styles.backgroundSize,e),t,r),s=a[0],u=a[1],o=Nr(Vt(A.styles.backgroundPosition,e),r.width-s,r.height-u),l=Hb(Vt(A.styles.backgroundRepeat,e),o,a,r,n),f=Math.round(r.left+o[0]),h=Math.round(r.top+o[1]);return[l,f,h,s,u]},Kt=function(A){return oA(A)&&A.value===Ot.AUTO},la=function(A){return typeof A=="number"},Lb=function(A,e,t){var r=e[0],n=e[1],a=e[2],s=A[0],u=A[1];if(!s)return[0,0];if(_A(s)&&u&&_A(u))return[dA(s,t.width),dA(u,t.height)];var o=la(a);if(oA(s)&&(s.value===Ot.CONTAIN||s.value===Ot.COVER)){if(la(a)){var l=t.width/t.height;return l<a!=(s.value===Ot.COVER)?[t.width,t.width/a]:[t.height*a,t.height]}return[t.width,t.height]}var f=la(r),h=la(n),d=f||h;if(Kt(s)&&(!u||Kt(u))){if(f&&h)return[r,n];if(!o&&!d)return[t.width,t.height];if(d&&o){var C=f?r:n*a,m=h?n:r/a;return[C,m]}var T=f?r:t.width,U=h?n:t.height;return[T,U]}if(o){var N=0,_=0;return _A(s)?N=dA(s,t.width):_A(u)&&(_=dA(u,t.height)),Kt(s)?N=_*a:(!u||Kt(u))&&(_=N/a),[N,_]}var D=null,P=null;if(_A(s)?D=dA(s,t.width):u&&_A(u)&&(P=dA(u,t.height)),D!==null&&(!u||Kt(u))&&(P=f&&h?D/r*n:t.height),P!==null&&Kt(s)&&(D=f&&h?P/n*r:t.width),D!==null&&P!==null)return[D,P];throw new Error("Unable to calculate background-size for element")},Vt=function(A,e){var t=A[e];return typeof t>"u"?A[0]:t},Hb=function(A,e,t,r,n){var a=e[0],s=e[1],u=t[0],o=t[1];switch(A){case 2:return[new R(Math.round(r.left),Math.round(r.top+s)),new R(Math.round(r.left+r.width),Math.round(r.top+s)),new R(Math.round(r.left+r.width),Math.round(o+r.top+s)),new R(Math.round(r.left),Math.round(o+r.top+s))];case 3:return[new R(Math.round(r.left+a),Math.round(r.top)),new R(Math.round(r.left+a+u),Math.round(r.top)),new R(Math.round(r.left+a+u),Math.round(r.height+r.top)),new R(Math.round(r.left+a),Math.round(r.height+r.top))];case 1:return[new R(Math.round(r.left+a),Math.round(r.top+s)),new R(Math.round(r.left+a+u),Math.round(r.top+s)),new R(Math.round(r.left+a+u),Math.round(r.top+s+o)),new R(Math.round(r.left+a),Math.round(r.top+s+o))];default:return[new R(Math.round(n.left),Math.round(n.top)),new R(Math.round(n.left+n.width),Math.round(n.top)),new R(Math.round(n.left+n.width),Math.round(n.height+n.top)),new R(Math.round(n.left),Math.round(n.height+n.top))]}},Db="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",jl="Hidden Text",Ob=function(){function A(e){this._data={},this._document=e}return A.prototype.parseMetrics=function(e,t){var r=this._document.createElement("div"),n=this._document.createElement("img"),a=this._document.createElement("span"),s=this._document.body;r.style.visibility="hidden",r.style.fontFamily=e,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",s.appendChild(r),n.src=Db,n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",a.style.fontFamily=e,a.style.fontSize=t,a.style.margin="0",a.style.padding="0",a.appendChild(this._document.createTextNode(jl)),r.appendChild(a),r.appendChild(n);var u=n.offsetTop-a.offsetTop+2;r.removeChild(a),r.appendChild(this._document.createTextNode(jl)),r.style.lineHeight="normal",n.style.verticalAlign="super";var o=n.offsetTop-r.offsetTop+2;return s.removeChild(r),{baseline:u,middle:o}},A.prototype.getMetrics=function(e,t){var r=e+" "+t;return typeof this._data[r]>"u"&&(this._data[r]=this.parseMetrics(e,t)),this._data[r]},A}(),$l=function(){function A(e,t){this.context=e,this.options=t}return A}(),Rb=1e4,Mb=function(A){Ee(e,A);function e(t,r){var n=A.call(this,t,r)||this;return n._activeEffects=[],n.canvas=r.canvas?r.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),r.canvas||(n.canvas.width=Math.floor(r.width*r.scale),n.canvas.height=Math.floor(r.height*r.scale),n.canvas.style.width=r.width+"px",n.canvas.style.height=r.height+"px"),n.fontMetrics=new Ob(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-r.x,-r.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+r.width+"x"+r.height+") with scale "+r.scale),n}return e.prototype.applyEffects=function(t){for(var r=this;this._activeEffects.length;)this.popEffect();t.forEach(function(n){return r.applyEffect(n)})},e.prototype.applyEffect=function(t){this.ctx.save(),Fb(t)&&(this.ctx.globalAlpha=t.opacity),Qb(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),Vl(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(t){return qA(this,void 0,void 0,function(){var r;return GA(this,function(n){switch(n.label){case 0:return r=t.element.container.styles,r.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(t){return qA(this,void 0,void 0,function(){return GA(this,function(r){switch(r.label){case 0:if(vA(t.container.flags,16))debugger;return t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return r.sent(),[4,this.renderNodeContent(t)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(t,r,n){var a=this;if(r===0)this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+n);else{var s=ai(t.text);s.reduce(function(u,o){return a.ctx.fillText(o,u,t.bounds.top+n),u+a.ctx.measureText(o).width},t.bounds.left)}},e.prototype.createFontStyle=function(t){var r=t.fontVariant.filter(function(s){return s==="normal"||s==="small-caps"}).join(""),n=Gb(t.fontFamily).join(", "),a=yr(t.fontSize)?""+t.fontSize.number+t.fontSize.unit:t.fontSize.number+"px";return[[t.fontStyle,r,t.fontWeight,a,n].join(" "),n,a]},e.prototype.renderTextNode=function(t,r){return qA(this,void 0,void 0,function(){var n,a,s,u,o,l,f,h,d=this;return GA(this,function(C){return n=this.createFontStyle(r),a=n[0],s=n[1],u=n[2],this.ctx.font=a,this.ctx.direction=r.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",o=this.fontMetrics.getMetrics(s,u),l=o.baseline,f=o.middle,h=r.paintOrder,t.textBounds.forEach(function(m){h.forEach(function(T){switch(T){case 0:d.ctx.fillStyle=RA(r.color),d.renderTextWithLetterSpacing(m,r.letterSpacing,l);var U=r.textShadow;U.length&&m.text.trim().length&&(U.slice(0).reverse().forEach(function(N){d.ctx.shadowColor=RA(N.color),d.ctx.shadowOffsetX=N.offsetX.number*d.options.scale,d.ctx.shadowOffsetY=N.offsetY.number*d.options.scale,d.ctx.shadowBlur=N.blur.number,d.renderTextWithLetterSpacing(m,r.letterSpacing,l)}),d.ctx.shadowColor="",d.ctx.shadowOffsetX=0,d.ctx.shadowOffsetY=0,d.ctx.shadowBlur=0),r.textDecorationLine.length&&(d.ctx.fillStyle=RA(r.textDecorationColor||r.color),r.textDecorationLine.forEach(function(N){switch(N){case 1:d.ctx.fillRect(m.bounds.left,Math.round(m.bounds.top+l),m.bounds.width,1);break;case 2:d.ctx.fillRect(m.bounds.left,Math.round(m.bounds.top),m.bounds.width,1);break;case 3:d.ctx.fillRect(m.bounds.left,Math.ceil(m.bounds.top+f),m.bounds.width,1);break}}));break;case 1:r.webkitTextStrokeWidth&&m.text.trim().length&&(d.ctx.strokeStyle=RA(r.webkitTextStrokeColor),d.ctx.lineWidth=r.webkitTextStrokeWidth,d.ctx.lineJoin=window.chrome?"miter":"round",d.ctx.strokeText(m.text,m.bounds.left,m.bounds.top+l)),d.ctx.strokeStyle="",d.ctx.lineWidth=0,d.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(t,r,n){if(n&&t.intrinsicWidth>0&&t.intrinsicHeight>0){var a=ca(t),s=ia(r);this.path(s),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,t.intrinsicWidth,t.intrinsicHeight,a.left,a.top,a.width,a.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(t){return qA(this,void 0,void 0,function(){var r,n,a,s,u,o,_,_,l,f,h,d,P,C,m,L,T,U,N,_,D,P,L;return GA(this,function(p){switch(p.label){case 0:this.applyEffects(t.getEffects(4)),r=t.container,n=t.curves,a=r.styles,s=0,u=r.textNodes,p.label=1;case 1:return s<u.length?(o=u[s],[4,this.renderTextNode(o,a)]):[3,4];case 2:p.sent(),p.label=3;case 3:return s++,[3,1];case 4:if(!(r instanceof Bl))return[3,8];p.label=5;case 5:return p.trys.push([5,7,,8]),[4,this.context.cache.match(r.src)];case 6:return _=p.sent(),this.renderReplacedElement(r,n,_),[3,8];case 7:return p.sent(),this.context.logger.error("Error loading image "+r.src),[3,8];case 8:if(r instanceof gl&&this.renderReplacedElement(r,n,r.canvas),!(r instanceof El))return[3,12];p.label=9;case 9:return p.trys.push([9,11,,12]),[4,this.context.cache.match(r.svg)];case 10:return _=p.sent(),this.renderReplacedElement(r,n,_),[3,12];case 11:return p.sent(),this.context.logger.error("Error loading svg "+r.svg.substring(0,255)),[3,12];case 12:return r instanceof Tl&&r.tree?(l=new e(this.context,{scale:this.options.scale,backgroundColor:r.backgroundColor,x:0,y:0,width:r.width,height:r.height}),[4,l.render(r.tree)]):[3,14];case 13:f=p.sent(),r.width&&r.height&&this.ctx.drawImage(f,0,0,r.width,r.height,r.bounds.left,r.bounds.top,r.bounds.width,r.bounds.height),p.label=14;case 14:if(r instanceof ii&&(h=Math.min(r.bounds.width,r.bounds.height),r.type===zn?r.checked&&(this.ctx.save(),this.path([new R(r.bounds.left+h*.39363,r.bounds.top+h*.79),new R(r.bounds.left+h*.16,r.bounds.top+h*.5549),new R(r.bounds.left+h*.27347,r.bounds.top+h*.44071),new R(r.bounds.left+h*.39694,r.bounds.top+h*.5649),new R(r.bounds.left+h*.72983,r.bounds.top+h*.23),new R(r.bounds.left+h*.84,r.bounds.top+h*.34085),new R(r.bounds.left+h*.39363,r.bounds.top+h*.79)]),this.ctx.fillStyle=RA(ml),this.ctx.fill(),this.ctx.restore()):r.type===Aa&&r.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(r.bounds.left+h/2,r.bounds.top+h/2,h/4,0,Math.PI*2,!0),this.ctx.fillStyle=RA(ml),this.ctx.fill(),this.ctx.restore())),kb(r)&&r.value.length){switch(d=this.createFontStyle(a),P=d[0],C=d[1],m=this.fontMetrics.getMetrics(P,C).baseline,this.ctx.font=P,this.ctx.fillStyle=RA(a.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Kb(r.styles.textAlign),L=ca(r),T=0,r.styles.textAlign){case 1:T+=L.width/2;break;case 2:T+=L.width;break}U=L.add(T,0,0,-L.height/2+1),this.ctx.save(),this.path([new R(L.left,L.top),new R(L.left+L.width,L.top),new R(L.left+L.width,L.top+L.height),new R(L.left,L.top+L.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Lr(r.value,U),a.letterSpacing,m),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!vA(r.styles.display,2048))return[3,20];if(r.styles.listStyleImage===null)return[3,19];if(N=r.styles.listStyleImage,N.type!==0)return[3,18];_=void 0,D=N.url,p.label=15;case 15:return p.trys.push([15,17,,18]),[4,this.context.cache.match(D)];case 16:return _=p.sent(),this.ctx.drawImage(_,r.bounds.left-(_.width+10),r.bounds.top),[3,18];case 17:return p.sent(),this.context.logger.error("Error loading list-style-image "+D),[3,18];case 18:return[3,20];case 19:t.listValue&&r.styles.listStyleType!==-1&&(P=this.createFontStyle(a)[0],this.ctx.font=P,this.ctx.fillStyle=RA(a.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",L=new Ne(r.bounds.left,r.bounds.top+dA(r.styles.paddingTop,r.bounds.width),r.bounds.width,jc(a.lineHeight,a.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Lr(t.listValue,L),a.letterSpacing,jc(a.lineHeight,a.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),p.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(t){return qA(this,void 0,void 0,function(){var r,n,N,a,s,N,u,o,N,l,f,N,h,d,N,C,m,N,T,U,N;return GA(this,function(_){switch(_.label){case 0:if(vA(t.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:_.sent(),r=0,n=t.negativeZIndex,_.label=2;case 2:return r<n.length?(N=n[r],[4,this.renderStack(N)]):[3,5];case 3:_.sent(),_.label=4;case 4:return r++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:_.sent(),a=0,s=t.nonInlineLevel,_.label=7;case 7:return a<s.length?(N=s[a],[4,this.renderNode(N)]):[3,10];case 8:_.sent(),_.label=9;case 9:return a++,[3,7];case 10:u=0,o=t.nonPositionedFloats,_.label=11;case 11:return u<o.length?(N=o[u],[4,this.renderStack(N)]):[3,14];case 12:_.sent(),_.label=13;case 13:return u++,[3,11];case 14:l=0,f=t.nonPositionedInlineLevel,_.label=15;case 15:return l<f.length?(N=f[l],[4,this.renderStack(N)]):[3,18];case 16:_.sent(),_.label=17;case 17:return l++,[3,15];case 18:h=0,d=t.inlineLevel,_.label=19;case 19:return h<d.length?(N=d[h],[4,this.renderNode(N)]):[3,22];case 20:_.sent(),_.label=21;case 21:return h++,[3,19];case 22:C=0,m=t.zeroOrAutoZIndexOrTransformedOrOpacity,_.label=23;case 23:return C<m.length?(N=m[C],[4,this.renderStack(N)]):[3,26];case 24:_.sent(),_.label=25;case 25:return C++,[3,23];case 26:T=0,U=t.positiveZIndex,_.label=27;case 27:return T<U.length?(N=U[T],[4,this.renderStack(N)]):[3,30];case 28:_.sent(),_.label=29;case 29:return T++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(t){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(t.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},e.prototype.formatPath=function(t){var r=this;t.forEach(function(n,a){var s=fe(n)?n.start:n;a===0?r.ctx.moveTo(s.x,s.y):r.ctx.lineTo(s.x,s.y),fe(n)&&r.ctx.bezierCurveTo(n.startControl.x,n.startControl.y,n.endControl.x,n.endControl.y,n.end.x,n.end.y)})},e.prototype.renderRepeat=function(t,r,n,a){this.path(t),this.ctx.fillStyle=r,this.ctx.translate(n,a),this.ctx.fill(),this.ctx.translate(-n,-a)},e.prototype.resizeImage=function(t,r,n){var a;if(t.width===r&&t.height===n)return t;var s=(a=this.canvas.ownerDocument)!==null&&a!==void 0?a:document,u=s.createElement("canvas");u.width=Math.max(1,r),u.height=Math.max(1,n);var o=u.getContext("2d");return o.drawImage(t,0,0,t.width,t.height,0,0,r,n),u},e.prototype.renderBackgroundImage=function(t){return qA(this,void 0,void 0,function(){var r,n,a,s,u,o;return GA(this,function(l){switch(l.label){case 0:r=t.styles.backgroundImage.length-1,n=function(f){var h,d,C,tA,gA,bA,q,nA,K,m,tA,gA,bA,q,nA,T,U,N,_,D,P,L,p,H,K,k,tA,cA,BA,q,nA,lA,gA,bA,jA,SA,XA,xA,re,yA,KA,I;return GA(this,function(y){switch(y.label){case 0:if(f.type!==0)return[3,5];h=void 0,d=f.url,y.label=1;case 1:return y.trys.push([1,3,,4]),[4,a.context.cache.match(d)];case 2:return h=y.sent(),[3,4];case 3:return y.sent(),a.context.logger.error("Error loading background-image "+d),[3,4];case 4:return h&&(C=pi(t,r,[h.width,h.height,h.width/h.height]),tA=C[0],gA=C[1],bA=C[2],q=C[3],nA=C[4],K=a.ctx.createPattern(a.resizeImage(h,q,nA),"repeat"),a.renderRepeat(tA,K,gA,bA)),[3,6];case 5:Q1(f)?(m=pi(t,r,[null,null,null]),tA=m[0],gA=m[1],bA=m[2],q=m[3],nA=m[4],T=C1(f.angle,q,nA),U=T[0],N=T[1],_=T[2],D=T[3],P=T[4],L=document.createElement("canvas"),L.width=q,L.height=nA,p=L.getContext("2d"),H=p.createLinearGradient(N,D,_,P),Mc(f.stops,U).forEach(function(aA){return H.addColorStop(aA.stop,RA(aA.color))}),p.fillStyle=H,p.fillRect(0,0,q,nA),q>0&&nA>0&&(K=a.ctx.createPattern(L,"repeat"),a.renderRepeat(tA,K,gA,bA))):F1(f)&&(k=pi(t,r,[null,null,null]),tA=k[0],cA=k[1],BA=k[2],q=k[3],nA=k[4],lA=f.position.length===0?[Gs]:f.position,gA=dA(lA[0],q),bA=dA(lA[lA.length-1],nA),jA=w1(f,gA,bA,q,nA),SA=jA[0],XA=jA[1],SA>0&&XA>0&&(xA=a.ctx.createRadialGradient(cA+gA,BA+bA,0,cA+gA,BA+bA,SA),Mc(f.stops,SA*2).forEach(function(aA){return xA.addColorStop(aA.stop,RA(aA.color))}),a.path(tA),a.ctx.fillStyle=xA,SA!==XA?(re=t.bounds.left+.5*t.bounds.width,yA=t.bounds.top+.5*t.bounds.height,KA=XA/SA,I=1/KA,a.ctx.save(),a.ctx.translate(re,yA),a.ctx.transform(1,0,0,KA,0,0),a.ctx.translate(-re,-yA),a.ctx.fillRect(cA,I*(BA-yA)+yA,q,nA*I),a.ctx.restore()):a.ctx.fill())),y.label=6;case 6:return r--,[2]}})},a=this,s=0,u=t.styles.backgroundImage.slice(0).reverse(),l.label=1;case 1:return s<u.length?(o=u[s],[5,n(o)]):[3,4];case 2:l.sent(),l.label=3;case 3:return s++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(t,r,n){return qA(this,void 0,void 0,function(){return GA(this,function(a){return this.path(Jl(n,r)),this.ctx.fillStyle=RA(t),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(t,r,n,a){return qA(this,void 0,void 0,function(){var s,u;return GA(this,function(o){switch(o.label){case 0:return r<3?[4,this.renderSolidBorder(t,n,a)]:[3,2];case 1:return o.sent(),[2];case 2:return s=yb(a,n),this.path(s),this.ctx.fillStyle=RA(t),this.ctx.fill(),u=Nb(a,n),this.path(u),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(t){return qA(this,void 0,void 0,function(){var r,n,a,s,u,o,l,f,h=this;return GA(this,function(d){switch(d.label){case 0:return this.applyEffects(t.getEffects(2)),r=t.container.styles,n=!je(r.backgroundColor)||r.backgroundImage.length,a=[{style:r.borderTopStyle,color:r.borderTopColor,width:r.borderTopWidth},{style:r.borderRightStyle,color:r.borderRightColor,width:r.borderRightWidth},{style:r.borderBottomStyle,color:r.borderBottomColor,width:r.borderBottomWidth},{style:r.borderLeftStyle,color:r.borderLeftColor,width:r.borderLeftWidth}],s=Pb(Vt(r.backgroundClip,0),t.curves),n||r.boxShadow.length?(this.ctx.save(),this.path(s),this.ctx.clip(),je(r.backgroundColor)||(this.ctx.fillStyle=RA(r.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:d.sent(),this.ctx.restore(),r.boxShadow.slice(0).reverse().forEach(function(C){h.ctx.save();var m=sa(t.curves),T=C.inset?0:Rb,U=Ib(m,-T+(C.inset?1:-1)*C.spread.number,(C.inset?1:-1)*C.spread.number,C.spread.number*(C.inset?-2:2),C.spread.number*(C.inset?-2:2));C.inset?(h.path(m),h.ctx.clip(),h.mask(U)):(h.mask(m),h.ctx.clip(),h.path(U)),h.ctx.shadowOffsetX=C.offsetX.number+T,h.ctx.shadowOffsetY=C.offsetY.number,h.ctx.shadowColor=RA(C.color),h.ctx.shadowBlur=C.blur.number,h.ctx.fillStyle=C.inset?RA(C.color):"rgba(0,0,0,1)",h.ctx.fill(),h.ctx.restore()}),d.label=2;case 2:u=0,o=0,l=a,d.label=3;case 3:return o<l.length?(f=l[o],f.style!==0&&!je(f.color)&&f.width>0?f.style!==2?[3,5]:[4,this.renderDashedDottedBorder(f.color,f.width,u,t.curves,2)]:[3,11]):[3,13];case 4:return d.sent(),[3,11];case 5:return f.style!==3?[3,7]:[4,this.renderDashedDottedBorder(f.color,f.width,u,t.curves,3)];case 6:return d.sent(),[3,11];case 7:return f.style!==4?[3,9]:[4,this.renderDoubleBorder(f.color,f.width,u,t.curves)];case 8:return d.sent(),[3,11];case 9:return[4,this.renderSolidBorder(f.color,u,t.curves)];case 10:d.sent(),d.label=11;case 11:u++,d.label=12;case 12:return o++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(t,r,n,a,s){return qA(this,void 0,void 0,function(){var u,o,l,f,h,d,C,m,T,U,N,_,D,P,L,p,L,p;return GA(this,function(H){return this.ctx.save(),u=vb(a,n),o=Jl(a,n),s===2&&(this.path(o),this.ctx.clip()),fe(o[0])?(l=o[0].start.x,f=o[0].start.y):(l=o[0].x,f=o[0].y),fe(o[1])?(h=o[1].end.x,d=o[1].end.y):(h=o[1].x,d=o[1].y),n===0||n===2?C=Math.abs(l-h):C=Math.abs(f-d),this.ctx.beginPath(),s===3?this.formatPath(u):this.formatPath(o.slice(0,2)),m=r<3?r*3:r*2,T=r<3?r*2:r,s===3&&(m=r,T=r),U=!0,C<=m*2?U=!1:C<=m*2+T?(N=C/(2*m+T),m*=N,T*=N):(_=Math.floor((C+T)/(m+T)),D=(C-_*m)/(_-1),P=(C-(_+1)*m)/_,T=P<=0||Math.abs(T-D)<Math.abs(T-P)?D:P),U&&(s===3?this.ctx.setLineDash([0,m+T]):this.ctx.setLineDash([m,T])),s===3?(this.ctx.lineCap="round",this.ctx.lineWidth=r):this.ctx.lineWidth=r*2+1.1,this.ctx.strokeStyle=RA(t),this.ctx.stroke(),this.ctx.setLineDash([]),s===2&&(fe(o[0])&&(L=o[3],p=o[0],this.ctx.beginPath(),this.formatPath([new R(L.end.x,L.end.y),new R(p.start.x,p.start.y)]),this.ctx.stroke()),fe(o[1])&&(L=o[1],p=o[2],this.ctx.beginPath(),this.formatPath([new R(L.end.x,L.end.y),new R(p.start.x,p.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(t){return qA(this,void 0,void 0,function(){var r;return GA(this,function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=RA(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=_b(t),[4,this.renderStack(r)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}})})},e}($l),kb=function(A){return A instanceof wl||A instanceof Cl?!0:A instanceof ii&&A.type!==Aa&&A.type!==zn},Pb=function(A,e){switch(A){case 0:return sa(e);case 2:return Tb(e);case 1:default:return ia(e)}},Kb=function(A){switch(A){case 1:return"center";case 2:return"right";case 0:default:return"left"}},Vb=["-apple-system","system-ui"],Gb=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter(function(e){return Vb.indexOf(e)===-1}):A},Yb=function(A){Ee(e,A);function e(t,r){var n=A.call(this,t,r)||this;return n.canvas=r.canvas?r.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=r,n.canvas.width=Math.floor(r.width*r.scale),n.canvas.height=Math.floor(r.height*r.scale),n.canvas.style.width=r.width+"px",n.canvas.style.height=r.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-r.x,-r.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+r.width+"x"+r.height+" at "+r.x+","+r.y+") with scale "+r.scale),n}return e.prototype.render=function(t){return qA(this,void 0,void 0,function(){var r,n;return GA(this,function(a){switch(a.label){case 0:return r=ni(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,Xb(r)];case 1:return n=a.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=RA(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e}($l),Xb=function(A){return new Promise(function(e,t){var r=new Image;r.onload=function(){e(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(A))})},Wb=function(){function A(e){var t=e.id,r=e.enabled;this.id=t,this.enabled=r,this.start=Date.now()}return A.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,mn([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.prototype.getTime=function(){return Date.now()-this.start},A.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,mn([this.id,this.getTime()+"ms"],e))},A.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,mn([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,mn([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.instances={},A}(),Jb=function(){function A(e,t){var r;this.windowBounds=t,this.instanceName="#"+A.instanceCount++,this.logger=new Wb({id:this.instanceName,enabled:e.logging}),this.cache=(r=e.cache)!==null&&r!==void 0?r:new db(this,e)}return A.instanceCount=1,A}(),qb=function(A,e){return e===void 0&&(e={}),jb(A,e)};typeof window<"u"&&Kl.setContext(window);var jb=function(A,e){return qA(void 0,void 0,void 0,function(){var t,r,n,a,s,u,o,l,f,h,d,C,m,T,U,N,_,D,P,L,H,p,H,K,k,tA,cA,BA,q,nA,lA,gA,bA,jA,SA,XA,xA,re,yA,KA;return GA(this,function(I){switch(I.label){case 0:if(!A||typeof A!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(t=A.ownerDocument,!t)throw new Error("Element is not attached to a Document");if(r=t.defaultView,!r)throw new Error("Document is not attached to a Window");return n={allowTaint:(K=e.allowTaint)!==null&&K!==void 0?K:!1,imageTimeout:(k=e.imageTimeout)!==null&&k!==void 0?k:15e3,proxy:e.proxy,useCORS:(tA=e.useCORS)!==null&&tA!==void 0?tA:!1},a=bs({logging:(cA=e.logging)!==null&&cA!==void 0?cA:!0,cache:e.cache},n),s={windowWidth:(BA=e.windowWidth)!==null&&BA!==void 0?BA:r.innerWidth,windowHeight:(q=e.windowHeight)!==null&&q!==void 0?q:r.innerHeight,scrollX:(nA=e.scrollX)!==null&&nA!==void 0?nA:r.pageXOffset,scrollY:(lA=e.scrollY)!==null&&lA!==void 0?lA:r.pageYOffset},u=new Ne(s.scrollX,s.scrollY,s.windowWidth,s.windowHeight),o=new Jb(a,u),l=(gA=e.foreignObjectRendering)!==null&&gA!==void 0?gA:!1,f={allowTaint:(bA=e.allowTaint)!==null&&bA!==void 0?bA:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:l,copyStyles:l},o.logger.debug("Starting document clone with size "+u.width+"x"+u.height+" scrolled to "+-u.left+","+-u.top),h=new kl(o,A,f),d=h.clonedReferenceElement,d?[4,h.toIFrame(t,u)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return C=I.sent(),m=oi(d)||$T(d)?Im(d.ownerDocument):Cn(o,d),T=m.width,U=m.height,N=m.left,_=m.top,D=$b(o,d,e.backgroundColor),P={canvas:e.canvas,backgroundColor:D,scale:(SA=(jA=e.scale)!==null&&jA!==void 0?jA:r.devicePixelRatio)!==null&&SA!==void 0?SA:1,x:((XA=e.x)!==null&&XA!==void 0?XA:0)+N,y:((xA=e.y)!==null&&xA!==void 0?xA:0)+_,width:(re=e.width)!==null&&re!==void 0?re:Math.ceil(T),height:(yA=e.height)!==null&&yA!==void 0?yA:Math.ceil(U)},l?(o.logger.debug("Document cloned, using foreign object rendering"),H=new Yb(o,P),[4,H.render(d)]):[3,3];case 2:return L=I.sent(),[3,5];case 3:return o.logger.debug("Document cloned, element located at "+N+","+_+" with size "+T+"x"+U+" using computed rendering"),o.logger.debug("Starting DOM parsing"),p=Ul(o,d),D===p.styles.backgroundColor&&(p.styles.backgroundColor=Se.TRANSPARENT),o.logger.debug("Starting renderer for element at "+P.x+","+P.y+" with size "+P.width+"x"+P.height),H=new Mb(o,P),[4,H.render(p)];case 4:L=I.sent(),I.label=5;case 5:return(!((KA=e.removeContainer)!==null&&KA!==void 0)||KA)&&(kl.destroy(C)||o.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),o.logger.debug("Finished rendering"),[2,L]}})})},$b=function(A,e,t){var r=e.ownerDocument,n=r.documentElement?vr(A,getComputedStyle(r.documentElement).backgroundColor):Se.TRANSPARENT,a=r.body?vr(A,getComputedStyle(r.body).backgroundColor):Se.TRANSPARENT,s=typeof t=="string"?vr(A,t):t===null?Se.TRANSPARENT:4294967295;return e===r.documentElement?je(n)?je(a)?s:a:n:s};const Zb=c.defineComponent({name:"GpIframe",props:{htmlContent:{type:String,required:!0},jsFiles:{type:Array,default:[]},cssFiles:{type:Array,default:[]},iframeStyle:{type:Object,default:()=>({width:"100%",height:"100%",border:"none"})}},setup(A){const e=c.ref(null),t=c.ref(),r=()=>{var C;const a=e.value;if(!a)return;const s=a.contentDocument||((C=a.contentWindow)==null?void 0:C.document);if(!s)return;s.open(),s.write("<!DOCTYPE html><html><head></head><body></body></html>"),s.close();const u=s.head;A.cssFiles.forEach(m=>{const T=s.createElement("link");T.rel="stylesheet",T.href=m,u.appendChild(T)});const o=s.createElement("link");o.rel="stylesheet",o.href="/spa/topic/css/style.css",u.appendChild(o);const l=s.createElement("script");l.src="/spa/topic/js/jquery-3.6.0.min.js",l.async=!1,u.appendChild(l);const f=s.createElement("script");f.src="/spa/topic/js/swiper-bundle.min.js",f.async=!1,u.appendChild(f);const h=s.createElement("script");h.src="/spa/topic/js/index.js",h.async=!1,u.appendChild(h);const d=s.body;d.innerHTML=A.htmlContent,A.jsFiles.forEach(m=>{const T=s.createElement("script");T.src=m,T.async=!1,d.appendChild(T)}),t.value=d,c.nextTick(()=>{})};c.watch(t,a=>{if(!a)return;new MutationObserver(()=>{const u=e.value;u&&(u.style.height=`${a.scrollHeight}px`)}).observe(a,{childList:!0,subtree:!0})});const n=async a=>{var l;const s=e.value;if(!s)return;const u=s.contentDocument||((l=s.contentWindow)==null?void 0:l.document);if(!u)return;const o=u.body;if(o)try{await c.nextTick();const f=await qb(o,{x:0,y:0,scrollX:window.scrollX,scrollY:window.scrollY,useCORS:!0,allowTaint:!0,foreignObjectRendering:!1});a?a(f):f.toBlob(h=>{const d=URL.createObjectURL(h);window.open(d,"_blank")})}catch(f){console.error("截图生成失败:",f)}};return c.watch(()=>[A.htmlContent,A.jsFiles,A.cssFiles],r,{deep:!0}),c.onMounted(()=>{r()}),{iframeRef:e,generateCover:n}}});function zb(A,e,t,r,n,a){return c.openBlock(),c.createElementBlock("div",null,[c.createElementVNode("iframe",{ref:"iframeRef",style:c.normalizeStyle([{"min-height":"600px"},A.iframeStyle])},null,4)])}const Zl=Pe(Zb,[["render",zb],["__scopeId","data-v-e1815181"]]),AU={class:"flex gp-dsigner"},eU={key:0,class:"flex items-center justify-between border-b"},tU={class:"text-lg font-bold p-2"},rU={class:"text-sm font-thin text-gray-500"},nU={class:"flex-1 overflow-auto"},aU={key:0,class:"flex justify-between items-center border-b p-2"},sU={class:"flex items-center"},iU={class:"p-2"},uU={class:"sticky top-0"},oU={key:0,class:"text-lg font-bold border-b p-2"},cU={class:"text-sm font-thin text-gray-500"},lU={class:"p-2"},fU={key:0,class:"max-h-[500px] overflow-hidden w-[640px] h-[360px] bg-light-100"},zl=Pe(c.defineComponent({__name:"Designer",props:{mode:{default:"design"},template:{},css:{},js:{},previewWidth:{default:360},uploadByFile:{},icons:{},rules:{},preview:{type:Boolean,default:!0},showTitle:{type:Boolean,default:!0}},emits:["update:modelValue","update:element"],setup(A,{expose:e,emit:t}){const r=A,n=t,a=c.ref(r.rules||[]),s=c.ref(r.template),u=c.ref();let o=Bo("",{},!1);const l=c.ref("");c.watch(()=>r.template,Q=>{s.value=Q},{immediate:!0}),c.watch(()=>s.value,Q=>{Q&&(u.value=BA(Q))},{immediate:!0}),c.watch(()=>r.css,Q=>{Q.forEach(S=>{if(document.querySelector(`link[href="${S}"]`))return;const O=document.createElement("link");O.rel="stylesheet",O.href=S,document.head.appendChild(O)})},{immediate:!0}),c.watch(()=>r.js,Q=>{!Q||Q.length===0||Q.forEach(S=>{if(document.querySelector(`script[src="${S}"]`))return;const O=document.createElement("script");O.src=S,document.body.appendChild(O)})},{immediate:!0});const f=c.ref(r.mode);c.watch(()=>u.value,Q=>{Q&&n("update:element",Q)},{immediate:!0});const h=c.ref("");c.watch(()=>l.value,Q=>{n("update:modelValue",Q)},{immediate:!0});const d=c.ref(),C=c.ref(),m=c.ref(),T=c.ref(),U=c.ref(),N=c.ref(),_=c.ref(""),D=c.ref(r.mode==="design");c.watch(()=>r.rules,Q=>{a.value=Q,s.value&&(u.value=BA(s.value))},{immediate:!0});function P(Q=void 0){T.value&&T.value.generateCover(Q)}function L(Q){var S,O,V,hA,eA,wA,fA,WA,$,se,JA;U.value=Q,Q.type===Y.Text&&Q.rule.allowWrap&&(et.value=!0,Et.value=(JA=(se=($=(WA=(fA=(wA=(eA=(hA=(V=(O=(S=Q.text)==null?void 0:S.replace(/<br>/g,`
39
+ .`+di+lb+Pl)},hb=function(A,e){var t=A.ownerDocument;if(t){var r=t.createElement("style");r.textContent=e,A.appendChild(r)}},Kl=function(){function A(){}return A.getOrigin=function(e){var t=A._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},A.isSameOrigin=function(e){return A.getOrigin(e)===A._origin},A.setContext=function(e){A._link=e.document.createElement("a"),A._origin=A.getOrigin(e.location.href)},A._origin="about:blank",A}(),db=function(){function A(e,t){this.context=e,this._options=t,this._cache={}}return A.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(gi(e)||pb(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),t},A.prototype.match=function(e){return this._cache[e]},A.prototype.loadImage=function(e){return qA(this,void 0,void 0,function(){var t,r,n,a,s=this;return GA(this,function(u){switch(u.label){case 0:return t=Kl.isSameOrigin(e),r=!Bi(e)&&this._options.useCORS===!0&&PA.SUPPORT_CORS_IMAGES&&!t,n=!Bi(e)&&!t&&!gi(e)&&typeof this._options.proxy=="string"&&PA.SUPPORT_CORS_XHR&&!r,!t&&this._options.allowTaint===!1&&!Bi(e)&&!gi(e)&&!n&&!r?[2]:(a=e,n?[4,this.proxy(a)]:[3,2]);case 1:a=u.sent(),u.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(o,l){var f=new Image;f.onload=function(){return o(f)},f.onerror=l,(mb(a)||r)&&(f.crossOrigin="anonymous"),f.src=a,f.complete===!0&&setTimeout(function(){return o(f)},500),s._options.imageTimeout>0&&setTimeout(function(){return l("Timed out ("+s._options.imageTimeout+"ms) loading image")},s._options.imageTimeout)})];case 3:return[2,u.sent()]}})})},A.prototype.has=function(e){return typeof this._cache[e]<"u"},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(e){var t=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var n=e.substring(0,256);return new Promise(function(a,s){var u=PA.SUPPORT_RESPONSE_TYPE?"blob":"text",o=new XMLHttpRequest;o.onload=function(){if(o.status===200)if(u==="text")a(o.response);else{var h=new FileReader;h.addEventListener("load",function(){return a(h.result)},!1),h.addEventListener("error",function(d){return s(d)},!1),h.readAsDataURL(o.response)}else s("Failed to proxy resource "+n+" with status code "+o.status)},o.onerror=s;var l=r.indexOf("?")>-1?"&":"?";if(o.open("GET",""+r+l+"url="+encodeURIComponent(e)+"&responseType="+u),u!=="text"&&o instanceof XMLHttpRequest&&(o.responseType=u),t._options.imageTimeout){var f=t._options.imageTimeout;o.timeout=f,o.ontimeout=function(){return s("Timed out ("+f+"ms) proxying "+n)}}o.send()})},A}(),Bb=/^data:image\/svg\+xml/i,gb=/^data:image\/.*;base64,/i,Eb=/^data:image\/.*/i,pb=function(A){return PA.SUPPORT_SVG_DRAWING||!Cb(A)},Bi=function(A){return Eb.test(A)},mb=function(A){return gb.test(A)},gi=function(A){return A.substr(0,4)==="blob"},Cb=function(A){return A.substr(-3).toLowerCase()==="svg"||Bb.test(A)},R=function(){function A(e,t){this.type=0,this.x=e,this.y=t}return A.prototype.add=function(e,t){return new A(this.x+e,this.y+t)},A}(),Pt=function(A,e,t){return new R(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)},aa=function(){function A(e,t,r,n){this.type=1,this.start=e,this.startControl=t,this.endControl=r,this.end=n}return A.prototype.subdivide=function(e,t){var r=Pt(this.start,this.startControl,e),n=Pt(this.startControl,this.endControl,e),a=Pt(this.endControl,this.end,e),s=Pt(r,n,e),u=Pt(n,a,e),o=Pt(s,u,e);return t?new A(this.start,r,s,o):new A(o,u,a,this.end)},A.prototype.add=function(e,t){return new A(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A}(),fe=function(A){return A.type===1},wb=function(){function A(e){var t=e.styles,r=e.bounds,n=Nr(t.borderTopLeftRadius,r.width,r.height),a=n[0],s=n[1],u=Nr(t.borderTopRightRadius,r.width,r.height),o=u[0],l=u[1],f=Nr(t.borderBottomRightRadius,r.width,r.height),h=f[0],d=f[1],C=Nr(t.borderBottomLeftRadius,r.width,r.height),m=C[0],T=C[1],U=[];U.push((a+o)/r.width),U.push((m+h)/r.width),U.push((s+T)/r.height),U.push((l+d)/r.height);var N=Math.max.apply(Math,U);N>1&&(a/=N,s/=N,o/=N,l/=N,h/=N,d/=N,m/=N,T/=N);var _=r.width-o,D=r.height-d,P=r.width-h,L=r.height-T,p=t.borderTopWidth,H=t.borderRightWidth,K=t.borderBottomWidth,k=t.borderLeftWidth,tA=dA(t.paddingTop,e.bounds.width),cA=dA(t.paddingRight,e.bounds.width),BA=dA(t.paddingBottom,e.bounds.width),q=dA(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=a>0||s>0?CA(r.left+k/3,r.top+p/3,a-k/3,s-p/3,iA.TOP_LEFT):new R(r.left+k/3,r.top+p/3),this.topRightBorderDoubleOuterBox=a>0||s>0?CA(r.left+_,r.top+p/3,o-H/3,l-p/3,iA.TOP_RIGHT):new R(r.left+r.width-H/3,r.top+p/3),this.bottomRightBorderDoubleOuterBox=h>0||d>0?CA(r.left+P,r.top+D,h-H/3,d-K/3,iA.BOTTOM_RIGHT):new R(r.left+r.width-H/3,r.top+r.height-K/3),this.bottomLeftBorderDoubleOuterBox=m>0||T>0?CA(r.left+k/3,r.top+L,m-k/3,T-K/3,iA.BOTTOM_LEFT):new R(r.left+k/3,r.top+r.height-K/3),this.topLeftBorderDoubleInnerBox=a>0||s>0?CA(r.left+k*2/3,r.top+p*2/3,a-k*2/3,s-p*2/3,iA.TOP_LEFT):new R(r.left+k*2/3,r.top+p*2/3),this.topRightBorderDoubleInnerBox=a>0||s>0?CA(r.left+_,r.top+p*2/3,o-H*2/3,l-p*2/3,iA.TOP_RIGHT):new R(r.left+r.width-H*2/3,r.top+p*2/3),this.bottomRightBorderDoubleInnerBox=h>0||d>0?CA(r.left+P,r.top+D,h-H*2/3,d-K*2/3,iA.BOTTOM_RIGHT):new R(r.left+r.width-H*2/3,r.top+r.height-K*2/3),this.bottomLeftBorderDoubleInnerBox=m>0||T>0?CA(r.left+k*2/3,r.top+L,m-k*2/3,T-K*2/3,iA.BOTTOM_LEFT):new R(r.left+k*2/3,r.top+r.height-K*2/3),this.topLeftBorderStroke=a>0||s>0?CA(r.left+k/2,r.top+p/2,a-k/2,s-p/2,iA.TOP_LEFT):new R(r.left+k/2,r.top+p/2),this.topRightBorderStroke=a>0||s>0?CA(r.left+_,r.top+p/2,o-H/2,l-p/2,iA.TOP_RIGHT):new R(r.left+r.width-H/2,r.top+p/2),this.bottomRightBorderStroke=h>0||d>0?CA(r.left+P,r.top+D,h-H/2,d-K/2,iA.BOTTOM_RIGHT):new R(r.left+r.width-H/2,r.top+r.height-K/2),this.bottomLeftBorderStroke=m>0||T>0?CA(r.left+k/2,r.top+L,m-k/2,T-K/2,iA.BOTTOM_LEFT):new R(r.left+k/2,r.top+r.height-K/2),this.topLeftBorderBox=a>0||s>0?CA(r.left,r.top,a,s,iA.TOP_LEFT):new R(r.left,r.top),this.topRightBorderBox=o>0||l>0?CA(r.left+_,r.top,o,l,iA.TOP_RIGHT):new R(r.left+r.width,r.top),this.bottomRightBorderBox=h>0||d>0?CA(r.left+P,r.top+D,h,d,iA.BOTTOM_RIGHT):new R(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=m>0||T>0?CA(r.left,r.top+L,m,T,iA.BOTTOM_LEFT):new R(r.left,r.top+r.height),this.topLeftPaddingBox=a>0||s>0?CA(r.left+k,r.top+p,Math.max(0,a-k),Math.max(0,s-p),iA.TOP_LEFT):new R(r.left+k,r.top+p),this.topRightPaddingBox=o>0||l>0?CA(r.left+Math.min(_,r.width-H),r.top+p,_>r.width+H?0:Math.max(0,o-H),Math.max(0,l-p),iA.TOP_RIGHT):new R(r.left+r.width-H,r.top+p),this.bottomRightPaddingBox=h>0||d>0?CA(r.left+Math.min(P,r.width-k),r.top+Math.min(D,r.height-K),Math.max(0,h-H),Math.max(0,d-K),iA.BOTTOM_RIGHT):new R(r.left+r.width-H,r.top+r.height-K),this.bottomLeftPaddingBox=m>0||T>0?CA(r.left+k,r.top+Math.min(L,r.height-K),Math.max(0,m-k),Math.max(0,T-K),iA.BOTTOM_LEFT):new R(r.left+k,r.top+r.height-K),this.topLeftContentBox=a>0||s>0?CA(r.left+k+q,r.top+p+tA,Math.max(0,a-(k+q)),Math.max(0,s-(p+tA)),iA.TOP_LEFT):new R(r.left+k+q,r.top+p+tA),this.topRightContentBox=o>0||l>0?CA(r.left+Math.min(_,r.width+k+q),r.top+p+tA,_>r.width+k+q?0:o-k+q,l-(p+tA),iA.TOP_RIGHT):new R(r.left+r.width-(H+cA),r.top+p+tA),this.bottomRightContentBox=h>0||d>0?CA(r.left+Math.min(P,r.width-(k+q)),r.top+Math.min(D,r.height+p+tA),Math.max(0,h-(H+cA)),d-(K+BA),iA.BOTTOM_RIGHT):new R(r.left+r.width-(H+cA),r.top+r.height-(K+BA)),this.bottomLeftContentBox=m>0||T>0?CA(r.left+k+q,r.top+L,Math.max(0,m-(k+q)),T-(K+BA),iA.BOTTOM_LEFT):new R(r.left+k+q,r.top+r.height-(K+BA))}return A}(),iA;(function(A){A[A.TOP_LEFT=0]="TOP_LEFT",A[A.TOP_RIGHT=1]="TOP_RIGHT",A[A.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",A[A.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(iA||(iA={}));var CA=function(A,e,t,r,n){var a=4*((Math.sqrt(2)-1)/3),s=t*a,u=r*a,o=A+t,l=e+r;switch(n){case iA.TOP_LEFT:return new aa(new R(A,l),new R(A,l-u),new R(o-s,e),new R(o,e));case iA.TOP_RIGHT:return new aa(new R(A,e),new R(A+s,e),new R(o,l-u),new R(o,l));case iA.BOTTOM_RIGHT:return new aa(new R(o,e),new R(o,e+u),new R(A+s,l),new R(A,l));case iA.BOTTOM_LEFT:default:return new aa(new R(o,l),new R(o-s,l),new R(A,e+u),new R(A,e))}},sa=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},Tb=function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]},ia=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},bb=function(){function A(e,t,r){this.offsetX=e,this.offsetY=t,this.matrix=r,this.type=0,this.target=6}return A}(),ua=function(){function A(e,t){this.path=e,this.target=t,this.type=1}return A}(),Ub=function(){function A(e){this.opacity=e,this.type=2,this.target=6}return A}(),Qb=function(A){return A.type===0},Vl=function(A){return A.type===1},Fb=function(A){return A.type===2},Gl=function(A,e){return A.length===e.length?A.some(function(t,r){return t===e[r]}):!1},Ib=function(A,e,t,r,n){return A.map(function(a,s){switch(s){case 0:return a.add(e,t);case 1:return a.add(e+r,t);case 2:return a.add(e+r,t+n);case 3:return a.add(e,t+n)}return a})},Yl=function(){function A(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return A}(),Xl=function(){function A(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new wb(this.container),this.container.styles.opacity<1&&this.effects.push(new Ub(this.container.styles.opacity)),this.container.styles.transform!==null){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,a=this.container.styles.transform;this.effects.push(new bb(r,n,a))}if(this.container.styles.overflowX!==0){var s=sa(this.curves),u=ia(this.curves);Gl(s,u)?this.effects.push(new ua(s,6)):(this.effects.push(new ua(s,2)),this.effects.push(new ua(u,4)))}}return A.prototype.getEffects=function(e){for(var t=[2,3].indexOf(this.container.styles.position)===-1,r=this.parent,n=this.effects.slice(0);r;){var a=r.effects.filter(function(o){return!Vl(o)});if(t||r.container.styles.position!==0||!r.parent){if(n.unshift.apply(n,a),t=[2,3].indexOf(r.container.styles.position)===-1,r.container.styles.overflowX!==0){var s=sa(r.curves),u=ia(r.curves);Gl(s,u)||n.unshift(new ua(u,6))}}else n.unshift.apply(n,a);r=r.parent}return n.filter(function(o){return vA(o.target,e)})},A}(),Ei=function(A,e,t,r){A.container.elements.forEach(function(n){var a=vA(n.flags,4),s=vA(n.flags,2),u=new Xl(n,A);vA(n.styles.display,2048)&&r.push(u);var o=vA(n.flags,8)?[]:r;if(a||s){var l=a||n.styles.isPositioned()?t:e,f=new Yl(u);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var h=n.styles.zIndex.order;if(h<0){var d=0;l.negativeZIndex.some(function(m,T){return h>m.element.container.styles.zIndex.order?(d=T,!1):d>0}),l.negativeZIndex.splice(d,0,f)}else if(h>0){var C=0;l.positiveZIndex.some(function(m,T){return h>=m.element.container.styles.zIndex.order?(C=T+1,!1):C>0}),l.positiveZIndex.splice(C,0,f)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(f)}else n.styles.isFloating()?l.nonPositionedFloats.push(f):l.nonPositionedInlineLevel.push(f);Ei(u,f,a?f:t,o)}else n.styles.isInlineLevel()?e.inlineLevel.push(u):e.nonInlineLevel.push(u),Ei(u,e,t,o);vA(n.flags,8)&&Wl(n,o)})},Wl=function(A,e){for(var t=A instanceof si?A.start:1,r=A instanceof si?A.reversed:!1,n=0;n<e.length;n++){var a=e[n];a.container instanceof pl&&typeof a.container.value=="number"&&a.container.value!==0&&(t=a.container.value),a.listValue=Dr(t,a.container.styles.listStyleType,!0),t+=r?-1:1}},_b=function(A){var e=new Xl(A,null),t=new Yl(e),r=[];return Ei(e,t,t,r),Wl(e.container,r),t},Jl=function(A,e){switch(e){case 0:return he(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return he(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return he(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);case 3:default:return he(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},yb=function(A,e){switch(e){case 0:return he(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return he(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return he(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);case 3:default:return he(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}},Nb=function(A,e){switch(e){case 0:return he(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return he(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return he(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);case 3:default:return he(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}},vb=function(A,e){switch(e){case 0:return oa(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return oa(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return oa(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);case 3:default:return oa(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}},oa=function(A,e){var t=[];return fe(A)?t.push(A.subdivide(.5,!1)):t.push(A),fe(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},he=function(A,e,t,r){var n=[];return fe(A)?n.push(A.subdivide(.5,!1)):n.push(A),fe(t)?n.push(t.subdivide(.5,!0)):n.push(t),fe(r)?n.push(r.subdivide(.5,!0).reverse()):n.push(r),fe(e)?n.push(e.subdivide(.5,!1).reverse()):n.push(e),n},ql=function(A){var e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},ca=function(A){var e=A.styles,t=A.bounds,r=dA(e.paddingLeft,t.width),n=dA(e.paddingRight,t.width),a=dA(e.paddingTop,t.width),s=dA(e.paddingBottom,t.width);return t.add(r+e.borderLeftWidth,a+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+r+n),-(e.borderTopWidth+e.borderBottomWidth+a+s))},Sb=function(A,e){return A===0?e.bounds:A===2?ca(e):ql(e)},xb=function(A,e){return A===0?e.bounds:A===2?ca(e):ql(e)},pi=function(A,e,t){var r=Sb(Vt(A.styles.backgroundOrigin,e),A),n=xb(Vt(A.styles.backgroundClip,e),A),a=Lb(Vt(A.styles.backgroundSize,e),t,r),s=a[0],u=a[1],o=Nr(Vt(A.styles.backgroundPosition,e),r.width-s,r.height-u),l=Hb(Vt(A.styles.backgroundRepeat,e),o,a,r,n),f=Math.round(r.left+o[0]),h=Math.round(r.top+o[1]);return[l,f,h,s,u]},Kt=function(A){return oA(A)&&A.value===Ot.AUTO},la=function(A){return typeof A=="number"},Lb=function(A,e,t){var r=e[0],n=e[1],a=e[2],s=A[0],u=A[1];if(!s)return[0,0];if(_A(s)&&u&&_A(u))return[dA(s,t.width),dA(u,t.height)];var o=la(a);if(oA(s)&&(s.value===Ot.CONTAIN||s.value===Ot.COVER)){if(la(a)){var l=t.width/t.height;return l<a!=(s.value===Ot.COVER)?[t.width,t.width/a]:[t.height*a,t.height]}return[t.width,t.height]}var f=la(r),h=la(n),d=f||h;if(Kt(s)&&(!u||Kt(u))){if(f&&h)return[r,n];if(!o&&!d)return[t.width,t.height];if(d&&o){var C=f?r:n*a,m=h?n:r/a;return[C,m]}var T=f?r:t.width,U=h?n:t.height;return[T,U]}if(o){var N=0,_=0;return _A(s)?N=dA(s,t.width):_A(u)&&(_=dA(u,t.height)),Kt(s)?N=_*a:(!u||Kt(u))&&(_=N/a),[N,_]}var D=null,P=null;if(_A(s)?D=dA(s,t.width):u&&_A(u)&&(P=dA(u,t.height)),D!==null&&(!u||Kt(u))&&(P=f&&h?D/r*n:t.height),P!==null&&Kt(s)&&(D=f&&h?P/n*r:t.width),D!==null&&P!==null)return[D,P];throw new Error("Unable to calculate background-size for element")},Vt=function(A,e){var t=A[e];return typeof t>"u"?A[0]:t},Hb=function(A,e,t,r,n){var a=e[0],s=e[1],u=t[0],o=t[1];switch(A){case 2:return[new R(Math.round(r.left),Math.round(r.top+s)),new R(Math.round(r.left+r.width),Math.round(r.top+s)),new R(Math.round(r.left+r.width),Math.round(o+r.top+s)),new R(Math.round(r.left),Math.round(o+r.top+s))];case 3:return[new R(Math.round(r.left+a),Math.round(r.top)),new R(Math.round(r.left+a+u),Math.round(r.top)),new R(Math.round(r.left+a+u),Math.round(r.height+r.top)),new R(Math.round(r.left+a),Math.round(r.height+r.top))];case 1:return[new R(Math.round(r.left+a),Math.round(r.top+s)),new R(Math.round(r.left+a+u),Math.round(r.top+s)),new R(Math.round(r.left+a+u),Math.round(r.top+s+o)),new R(Math.round(r.left+a),Math.round(r.top+s+o))];default:return[new R(Math.round(n.left),Math.round(n.top)),new R(Math.round(n.left+n.width),Math.round(n.top)),new R(Math.round(n.left+n.width),Math.round(n.height+n.top)),new R(Math.round(n.left),Math.round(n.height+n.top))]}},Db="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",jl="Hidden Text",Ob=function(){function A(e){this._data={},this._document=e}return A.prototype.parseMetrics=function(e,t){var r=this._document.createElement("div"),n=this._document.createElement("img"),a=this._document.createElement("span"),s=this._document.body;r.style.visibility="hidden",r.style.fontFamily=e,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",s.appendChild(r),n.src=Db,n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",a.style.fontFamily=e,a.style.fontSize=t,a.style.margin="0",a.style.padding="0",a.appendChild(this._document.createTextNode(jl)),r.appendChild(a),r.appendChild(n);var u=n.offsetTop-a.offsetTop+2;r.removeChild(a),r.appendChild(this._document.createTextNode(jl)),r.style.lineHeight="normal",n.style.verticalAlign="super";var o=n.offsetTop-r.offsetTop+2;return s.removeChild(r),{baseline:u,middle:o}},A.prototype.getMetrics=function(e,t){var r=e+" "+t;return typeof this._data[r]>"u"&&(this._data[r]=this.parseMetrics(e,t)),this._data[r]},A}(),$l=function(){function A(e,t){this.context=e,this.options=t}return A}(),Rb=1e4,Mb=function(A){Ee(e,A);function e(t,r){var n=A.call(this,t,r)||this;return n._activeEffects=[],n.canvas=r.canvas?r.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),r.canvas||(n.canvas.width=Math.floor(r.width*r.scale),n.canvas.height=Math.floor(r.height*r.scale),n.canvas.style.width=r.width+"px",n.canvas.style.height=r.height+"px"),n.fontMetrics=new Ob(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-r.x,-r.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+r.width+"x"+r.height+") with scale "+r.scale),n}return e.prototype.applyEffects=function(t){for(var r=this;this._activeEffects.length;)this.popEffect();t.forEach(function(n){return r.applyEffect(n)})},e.prototype.applyEffect=function(t){this.ctx.save(),Fb(t)&&(this.ctx.globalAlpha=t.opacity),Qb(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),Vl(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(t){return qA(this,void 0,void 0,function(){var r;return GA(this,function(n){switch(n.label){case 0:return r=t.element.container.styles,r.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(t){return qA(this,void 0,void 0,function(){return GA(this,function(r){switch(r.label){case 0:if(vA(t.container.flags,16))debugger;return t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return r.sent(),[4,this.renderNodeContent(t)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(t,r,n){var a=this;if(r===0)this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+n);else{var s=ai(t.text);s.reduce(function(u,o){return a.ctx.fillText(o,u,t.bounds.top+n),u+a.ctx.measureText(o).width},t.bounds.left)}},e.prototype.createFontStyle=function(t){var r=t.fontVariant.filter(function(s){return s==="normal"||s==="small-caps"}).join(""),n=Gb(t.fontFamily).join(", "),a=yr(t.fontSize)?""+t.fontSize.number+t.fontSize.unit:t.fontSize.number+"px";return[[t.fontStyle,r,t.fontWeight,a,n].join(" "),n,a]},e.prototype.renderTextNode=function(t,r){return qA(this,void 0,void 0,function(){var n,a,s,u,o,l,f,h,d=this;return GA(this,function(C){return n=this.createFontStyle(r),a=n[0],s=n[1],u=n[2],this.ctx.font=a,this.ctx.direction=r.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",o=this.fontMetrics.getMetrics(s,u),l=o.baseline,f=o.middle,h=r.paintOrder,t.textBounds.forEach(function(m){h.forEach(function(T){switch(T){case 0:d.ctx.fillStyle=RA(r.color),d.renderTextWithLetterSpacing(m,r.letterSpacing,l);var U=r.textShadow;U.length&&m.text.trim().length&&(U.slice(0).reverse().forEach(function(N){d.ctx.shadowColor=RA(N.color),d.ctx.shadowOffsetX=N.offsetX.number*d.options.scale,d.ctx.shadowOffsetY=N.offsetY.number*d.options.scale,d.ctx.shadowBlur=N.blur.number,d.renderTextWithLetterSpacing(m,r.letterSpacing,l)}),d.ctx.shadowColor="",d.ctx.shadowOffsetX=0,d.ctx.shadowOffsetY=0,d.ctx.shadowBlur=0),r.textDecorationLine.length&&(d.ctx.fillStyle=RA(r.textDecorationColor||r.color),r.textDecorationLine.forEach(function(N){switch(N){case 1:d.ctx.fillRect(m.bounds.left,Math.round(m.bounds.top+l),m.bounds.width,1);break;case 2:d.ctx.fillRect(m.bounds.left,Math.round(m.bounds.top),m.bounds.width,1);break;case 3:d.ctx.fillRect(m.bounds.left,Math.ceil(m.bounds.top+f),m.bounds.width,1);break}}));break;case 1:r.webkitTextStrokeWidth&&m.text.trim().length&&(d.ctx.strokeStyle=RA(r.webkitTextStrokeColor),d.ctx.lineWidth=r.webkitTextStrokeWidth,d.ctx.lineJoin=window.chrome?"miter":"round",d.ctx.strokeText(m.text,m.bounds.left,m.bounds.top+l)),d.ctx.strokeStyle="",d.ctx.lineWidth=0,d.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(t,r,n){if(n&&t.intrinsicWidth>0&&t.intrinsicHeight>0){var a=ca(t),s=ia(r);this.path(s),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,t.intrinsicWidth,t.intrinsicHeight,a.left,a.top,a.width,a.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(t){return qA(this,void 0,void 0,function(){var r,n,a,s,u,o,_,_,l,f,h,d,P,C,m,L,T,U,N,_,D,P,L;return GA(this,function(p){switch(p.label){case 0:this.applyEffects(t.getEffects(4)),r=t.container,n=t.curves,a=r.styles,s=0,u=r.textNodes,p.label=1;case 1:return s<u.length?(o=u[s],[4,this.renderTextNode(o,a)]):[3,4];case 2:p.sent(),p.label=3;case 3:return s++,[3,1];case 4:if(!(r instanceof Bl))return[3,8];p.label=5;case 5:return p.trys.push([5,7,,8]),[4,this.context.cache.match(r.src)];case 6:return _=p.sent(),this.renderReplacedElement(r,n,_),[3,8];case 7:return p.sent(),this.context.logger.error("Error loading image "+r.src),[3,8];case 8:if(r instanceof gl&&this.renderReplacedElement(r,n,r.canvas),!(r instanceof El))return[3,12];p.label=9;case 9:return p.trys.push([9,11,,12]),[4,this.context.cache.match(r.svg)];case 10:return _=p.sent(),this.renderReplacedElement(r,n,_),[3,12];case 11:return p.sent(),this.context.logger.error("Error loading svg "+r.svg.substring(0,255)),[3,12];case 12:return r instanceof Tl&&r.tree?(l=new e(this.context,{scale:this.options.scale,backgroundColor:r.backgroundColor,x:0,y:0,width:r.width,height:r.height}),[4,l.render(r.tree)]):[3,14];case 13:f=p.sent(),r.width&&r.height&&this.ctx.drawImage(f,0,0,r.width,r.height,r.bounds.left,r.bounds.top,r.bounds.width,r.bounds.height),p.label=14;case 14:if(r instanceof ii&&(h=Math.min(r.bounds.width,r.bounds.height),r.type===zn?r.checked&&(this.ctx.save(),this.path([new R(r.bounds.left+h*.39363,r.bounds.top+h*.79),new R(r.bounds.left+h*.16,r.bounds.top+h*.5549),new R(r.bounds.left+h*.27347,r.bounds.top+h*.44071),new R(r.bounds.left+h*.39694,r.bounds.top+h*.5649),new R(r.bounds.left+h*.72983,r.bounds.top+h*.23),new R(r.bounds.left+h*.84,r.bounds.top+h*.34085),new R(r.bounds.left+h*.39363,r.bounds.top+h*.79)]),this.ctx.fillStyle=RA(ml),this.ctx.fill(),this.ctx.restore()):r.type===Aa&&r.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(r.bounds.left+h/2,r.bounds.top+h/2,h/4,0,Math.PI*2,!0),this.ctx.fillStyle=RA(ml),this.ctx.fill(),this.ctx.restore())),kb(r)&&r.value.length){switch(d=this.createFontStyle(a),P=d[0],C=d[1],m=this.fontMetrics.getMetrics(P,C).baseline,this.ctx.font=P,this.ctx.fillStyle=RA(a.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Kb(r.styles.textAlign),L=ca(r),T=0,r.styles.textAlign){case 1:T+=L.width/2;break;case 2:T+=L.width;break}U=L.add(T,0,0,-L.height/2+1),this.ctx.save(),this.path([new R(L.left,L.top),new R(L.left+L.width,L.top),new R(L.left+L.width,L.top+L.height),new R(L.left,L.top+L.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Lr(r.value,U),a.letterSpacing,m),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!vA(r.styles.display,2048))return[3,20];if(r.styles.listStyleImage===null)return[3,19];if(N=r.styles.listStyleImage,N.type!==0)return[3,18];_=void 0,D=N.url,p.label=15;case 15:return p.trys.push([15,17,,18]),[4,this.context.cache.match(D)];case 16:return _=p.sent(),this.ctx.drawImage(_,r.bounds.left-(_.width+10),r.bounds.top),[3,18];case 17:return p.sent(),this.context.logger.error("Error loading list-style-image "+D),[3,18];case 18:return[3,20];case 19:t.listValue&&r.styles.listStyleType!==-1&&(P=this.createFontStyle(a)[0],this.ctx.font=P,this.ctx.fillStyle=RA(a.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",L=new Ne(r.bounds.left,r.bounds.top+dA(r.styles.paddingTop,r.bounds.width),r.bounds.width,jc(a.lineHeight,a.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Lr(t.listValue,L),a.letterSpacing,jc(a.lineHeight,a.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),p.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(t){return qA(this,void 0,void 0,function(){var r,n,N,a,s,N,u,o,N,l,f,N,h,d,N,C,m,N,T,U,N;return GA(this,function(_){switch(_.label){case 0:if(vA(t.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:_.sent(),r=0,n=t.negativeZIndex,_.label=2;case 2:return r<n.length?(N=n[r],[4,this.renderStack(N)]):[3,5];case 3:_.sent(),_.label=4;case 4:return r++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:_.sent(),a=0,s=t.nonInlineLevel,_.label=7;case 7:return a<s.length?(N=s[a],[4,this.renderNode(N)]):[3,10];case 8:_.sent(),_.label=9;case 9:return a++,[3,7];case 10:u=0,o=t.nonPositionedFloats,_.label=11;case 11:return u<o.length?(N=o[u],[4,this.renderStack(N)]):[3,14];case 12:_.sent(),_.label=13;case 13:return u++,[3,11];case 14:l=0,f=t.nonPositionedInlineLevel,_.label=15;case 15:return l<f.length?(N=f[l],[4,this.renderStack(N)]):[3,18];case 16:_.sent(),_.label=17;case 17:return l++,[3,15];case 18:h=0,d=t.inlineLevel,_.label=19;case 19:return h<d.length?(N=d[h],[4,this.renderNode(N)]):[3,22];case 20:_.sent(),_.label=21;case 21:return h++,[3,19];case 22:C=0,m=t.zeroOrAutoZIndexOrTransformedOrOpacity,_.label=23;case 23:return C<m.length?(N=m[C],[4,this.renderStack(N)]):[3,26];case 24:_.sent(),_.label=25;case 25:return C++,[3,23];case 26:T=0,U=t.positiveZIndex,_.label=27;case 27:return T<U.length?(N=U[T],[4,this.renderStack(N)]):[3,30];case 28:_.sent(),_.label=29;case 29:return T++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(t){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(t.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},e.prototype.formatPath=function(t){var r=this;t.forEach(function(n,a){var s=fe(n)?n.start:n;a===0?r.ctx.moveTo(s.x,s.y):r.ctx.lineTo(s.x,s.y),fe(n)&&r.ctx.bezierCurveTo(n.startControl.x,n.startControl.y,n.endControl.x,n.endControl.y,n.end.x,n.end.y)})},e.prototype.renderRepeat=function(t,r,n,a){this.path(t),this.ctx.fillStyle=r,this.ctx.translate(n,a),this.ctx.fill(),this.ctx.translate(-n,-a)},e.prototype.resizeImage=function(t,r,n){var a;if(t.width===r&&t.height===n)return t;var s=(a=this.canvas.ownerDocument)!==null&&a!==void 0?a:document,u=s.createElement("canvas");u.width=Math.max(1,r),u.height=Math.max(1,n);var o=u.getContext("2d");return o.drawImage(t,0,0,t.width,t.height,0,0,r,n),u},e.prototype.renderBackgroundImage=function(t){return qA(this,void 0,void 0,function(){var r,n,a,s,u,o;return GA(this,function(l){switch(l.label){case 0:r=t.styles.backgroundImage.length-1,n=function(f){var h,d,C,tA,gA,bA,q,nA,K,m,tA,gA,bA,q,nA,T,U,N,_,D,P,L,p,H,K,k,tA,cA,BA,q,nA,lA,gA,bA,jA,SA,XA,xA,re,yA,KA,I;return GA(this,function(y){switch(y.label){case 0:if(f.type!==0)return[3,5];h=void 0,d=f.url,y.label=1;case 1:return y.trys.push([1,3,,4]),[4,a.context.cache.match(d)];case 2:return h=y.sent(),[3,4];case 3:return y.sent(),a.context.logger.error("Error loading background-image "+d),[3,4];case 4:return h&&(C=pi(t,r,[h.width,h.height,h.width/h.height]),tA=C[0],gA=C[1],bA=C[2],q=C[3],nA=C[4],K=a.ctx.createPattern(a.resizeImage(h,q,nA),"repeat"),a.renderRepeat(tA,K,gA,bA)),[3,6];case 5:Q1(f)?(m=pi(t,r,[null,null,null]),tA=m[0],gA=m[1],bA=m[2],q=m[3],nA=m[4],T=C1(f.angle,q,nA),U=T[0],N=T[1],_=T[2],D=T[3],P=T[4],L=document.createElement("canvas"),L.width=q,L.height=nA,p=L.getContext("2d"),H=p.createLinearGradient(N,D,_,P),Mc(f.stops,U).forEach(function(aA){return H.addColorStop(aA.stop,RA(aA.color))}),p.fillStyle=H,p.fillRect(0,0,q,nA),q>0&&nA>0&&(K=a.ctx.createPattern(L,"repeat"),a.renderRepeat(tA,K,gA,bA))):F1(f)&&(k=pi(t,r,[null,null,null]),tA=k[0],cA=k[1],BA=k[2],q=k[3],nA=k[4],lA=f.position.length===0?[Gs]:f.position,gA=dA(lA[0],q),bA=dA(lA[lA.length-1],nA),jA=w1(f,gA,bA,q,nA),SA=jA[0],XA=jA[1],SA>0&&XA>0&&(xA=a.ctx.createRadialGradient(cA+gA,BA+bA,0,cA+gA,BA+bA,SA),Mc(f.stops,SA*2).forEach(function(aA){return xA.addColorStop(aA.stop,RA(aA.color))}),a.path(tA),a.ctx.fillStyle=xA,SA!==XA?(re=t.bounds.left+.5*t.bounds.width,yA=t.bounds.top+.5*t.bounds.height,KA=XA/SA,I=1/KA,a.ctx.save(),a.ctx.translate(re,yA),a.ctx.transform(1,0,0,KA,0,0),a.ctx.translate(-re,-yA),a.ctx.fillRect(cA,I*(BA-yA)+yA,q,nA*I),a.ctx.restore()):a.ctx.fill())),y.label=6;case 6:return r--,[2]}})},a=this,s=0,u=t.styles.backgroundImage.slice(0).reverse(),l.label=1;case 1:return s<u.length?(o=u[s],[5,n(o)]):[3,4];case 2:l.sent(),l.label=3;case 3:return s++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(t,r,n){return qA(this,void 0,void 0,function(){return GA(this,function(a){return this.path(Jl(n,r)),this.ctx.fillStyle=RA(t),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(t,r,n,a){return qA(this,void 0,void 0,function(){var s,u;return GA(this,function(o){switch(o.label){case 0:return r<3?[4,this.renderSolidBorder(t,n,a)]:[3,2];case 1:return o.sent(),[2];case 2:return s=yb(a,n),this.path(s),this.ctx.fillStyle=RA(t),this.ctx.fill(),u=Nb(a,n),this.path(u),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(t){return qA(this,void 0,void 0,function(){var r,n,a,s,u,o,l,f,h=this;return GA(this,function(d){switch(d.label){case 0:return this.applyEffects(t.getEffects(2)),r=t.container.styles,n=!je(r.backgroundColor)||r.backgroundImage.length,a=[{style:r.borderTopStyle,color:r.borderTopColor,width:r.borderTopWidth},{style:r.borderRightStyle,color:r.borderRightColor,width:r.borderRightWidth},{style:r.borderBottomStyle,color:r.borderBottomColor,width:r.borderBottomWidth},{style:r.borderLeftStyle,color:r.borderLeftColor,width:r.borderLeftWidth}],s=Pb(Vt(r.backgroundClip,0),t.curves),n||r.boxShadow.length?(this.ctx.save(),this.path(s),this.ctx.clip(),je(r.backgroundColor)||(this.ctx.fillStyle=RA(r.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:d.sent(),this.ctx.restore(),r.boxShadow.slice(0).reverse().forEach(function(C){h.ctx.save();var m=sa(t.curves),T=C.inset?0:Rb,U=Ib(m,-T+(C.inset?1:-1)*C.spread.number,(C.inset?1:-1)*C.spread.number,C.spread.number*(C.inset?-2:2),C.spread.number*(C.inset?-2:2));C.inset?(h.path(m),h.ctx.clip(),h.mask(U)):(h.mask(m),h.ctx.clip(),h.path(U)),h.ctx.shadowOffsetX=C.offsetX.number+T,h.ctx.shadowOffsetY=C.offsetY.number,h.ctx.shadowColor=RA(C.color),h.ctx.shadowBlur=C.blur.number,h.ctx.fillStyle=C.inset?RA(C.color):"rgba(0,0,0,1)",h.ctx.fill(),h.ctx.restore()}),d.label=2;case 2:u=0,o=0,l=a,d.label=3;case 3:return o<l.length?(f=l[o],f.style!==0&&!je(f.color)&&f.width>0?f.style!==2?[3,5]:[4,this.renderDashedDottedBorder(f.color,f.width,u,t.curves,2)]:[3,11]):[3,13];case 4:return d.sent(),[3,11];case 5:return f.style!==3?[3,7]:[4,this.renderDashedDottedBorder(f.color,f.width,u,t.curves,3)];case 6:return d.sent(),[3,11];case 7:return f.style!==4?[3,9]:[4,this.renderDoubleBorder(f.color,f.width,u,t.curves)];case 8:return d.sent(),[3,11];case 9:return[4,this.renderSolidBorder(f.color,u,t.curves)];case 10:d.sent(),d.label=11;case 11:u++,d.label=12;case 12:return o++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(t,r,n,a,s){return qA(this,void 0,void 0,function(){var u,o,l,f,h,d,C,m,T,U,N,_,D,P,L,p,L,p;return GA(this,function(H){return this.ctx.save(),u=vb(a,n),o=Jl(a,n),s===2&&(this.path(o),this.ctx.clip()),fe(o[0])?(l=o[0].start.x,f=o[0].start.y):(l=o[0].x,f=o[0].y),fe(o[1])?(h=o[1].end.x,d=o[1].end.y):(h=o[1].x,d=o[1].y),n===0||n===2?C=Math.abs(l-h):C=Math.abs(f-d),this.ctx.beginPath(),s===3?this.formatPath(u):this.formatPath(o.slice(0,2)),m=r<3?r*3:r*2,T=r<3?r*2:r,s===3&&(m=r,T=r),U=!0,C<=m*2?U=!1:C<=m*2+T?(N=C/(2*m+T),m*=N,T*=N):(_=Math.floor((C+T)/(m+T)),D=(C-_*m)/(_-1),P=(C-(_+1)*m)/_,T=P<=0||Math.abs(T-D)<Math.abs(T-P)?D:P),U&&(s===3?this.ctx.setLineDash([0,m+T]):this.ctx.setLineDash([m,T])),s===3?(this.ctx.lineCap="round",this.ctx.lineWidth=r):this.ctx.lineWidth=r*2+1.1,this.ctx.strokeStyle=RA(t),this.ctx.stroke(),this.ctx.setLineDash([]),s===2&&(fe(o[0])&&(L=o[3],p=o[0],this.ctx.beginPath(),this.formatPath([new R(L.end.x,L.end.y),new R(p.start.x,p.start.y)]),this.ctx.stroke()),fe(o[1])&&(L=o[1],p=o[2],this.ctx.beginPath(),this.formatPath([new R(L.end.x,L.end.y),new R(p.start.x,p.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(t){return qA(this,void 0,void 0,function(){var r;return GA(this,function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=RA(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=_b(t),[4,this.renderStack(r)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}})})},e}($l),kb=function(A){return A instanceof wl||A instanceof Cl?!0:A instanceof ii&&A.type!==Aa&&A.type!==zn},Pb=function(A,e){switch(A){case 0:return sa(e);case 2:return Tb(e);case 1:default:return ia(e)}},Kb=function(A){switch(A){case 1:return"center";case 2:return"right";case 0:default:return"left"}},Vb=["-apple-system","system-ui"],Gb=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter(function(e){return Vb.indexOf(e)===-1}):A},Yb=function(A){Ee(e,A);function e(t,r){var n=A.call(this,t,r)||this;return n.canvas=r.canvas?r.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=r,n.canvas.width=Math.floor(r.width*r.scale),n.canvas.height=Math.floor(r.height*r.scale),n.canvas.style.width=r.width+"px",n.canvas.style.height=r.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-r.x,-r.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+r.width+"x"+r.height+" at "+r.x+","+r.y+") with scale "+r.scale),n}return e.prototype.render=function(t){return qA(this,void 0,void 0,function(){var r,n;return GA(this,function(a){switch(a.label){case 0:return r=ni(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,Xb(r)];case 1:return n=a.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=RA(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e}($l),Xb=function(A){return new Promise(function(e,t){var r=new Image;r.onload=function(){e(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(A))})},Wb=function(){function A(e){var t=e.id,r=e.enabled;this.id=t,this.enabled=r,this.start=Date.now()}return A.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,mn([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.prototype.getTime=function(){return Date.now()-this.start},A.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,mn([this.id,this.getTime()+"ms"],e))},A.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,mn([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,mn([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.instances={},A}(),Jb=function(){function A(e,t){var r;this.windowBounds=t,this.instanceName="#"+A.instanceCount++,this.logger=new Wb({id:this.instanceName,enabled:e.logging}),this.cache=(r=e.cache)!==null&&r!==void 0?r:new db(this,e)}return A.instanceCount=1,A}(),qb=function(A,e){return e===void 0&&(e={}),jb(A,e)};typeof window<"u"&&Kl.setContext(window);var jb=function(A,e){return qA(void 0,void 0,void 0,function(){var t,r,n,a,s,u,o,l,f,h,d,C,m,T,U,N,_,D,P,L,H,p,H,K,k,tA,cA,BA,q,nA,lA,gA,bA,jA,SA,XA,xA,re,yA,KA;return GA(this,function(I){switch(I.label){case 0:if(!A||typeof A!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(t=A.ownerDocument,!t)throw new Error("Element is not attached to a Document");if(r=t.defaultView,!r)throw new Error("Document is not attached to a Window");return n={allowTaint:(K=e.allowTaint)!==null&&K!==void 0?K:!1,imageTimeout:(k=e.imageTimeout)!==null&&k!==void 0?k:15e3,proxy:e.proxy,useCORS:(tA=e.useCORS)!==null&&tA!==void 0?tA:!1},a=bs({logging:(cA=e.logging)!==null&&cA!==void 0?cA:!0,cache:e.cache},n),s={windowWidth:(BA=e.windowWidth)!==null&&BA!==void 0?BA:r.innerWidth,windowHeight:(q=e.windowHeight)!==null&&q!==void 0?q:r.innerHeight,scrollX:(nA=e.scrollX)!==null&&nA!==void 0?nA:r.pageXOffset,scrollY:(lA=e.scrollY)!==null&&lA!==void 0?lA:r.pageYOffset},u=new Ne(s.scrollX,s.scrollY,s.windowWidth,s.windowHeight),o=new Jb(a,u),l=(gA=e.foreignObjectRendering)!==null&&gA!==void 0?gA:!1,f={allowTaint:(bA=e.allowTaint)!==null&&bA!==void 0?bA:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:l,copyStyles:l},o.logger.debug("Starting document clone with size "+u.width+"x"+u.height+" scrolled to "+-u.left+","+-u.top),h=new kl(o,A,f),d=h.clonedReferenceElement,d?[4,h.toIFrame(t,u)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return C=I.sent(),m=oi(d)||$T(d)?Im(d.ownerDocument):Cn(o,d),T=m.width,U=m.height,N=m.left,_=m.top,D=$b(o,d,e.backgroundColor),P={canvas:e.canvas,backgroundColor:D,scale:(SA=(jA=e.scale)!==null&&jA!==void 0?jA:r.devicePixelRatio)!==null&&SA!==void 0?SA:1,x:((XA=e.x)!==null&&XA!==void 0?XA:0)+N,y:((xA=e.y)!==null&&xA!==void 0?xA:0)+_,width:(re=e.width)!==null&&re!==void 0?re:Math.ceil(T),height:(yA=e.height)!==null&&yA!==void 0?yA:Math.ceil(U)},l?(o.logger.debug("Document cloned, using foreign object rendering"),H=new Yb(o,P),[4,H.render(d)]):[3,3];case 2:return L=I.sent(),[3,5];case 3:return o.logger.debug("Document cloned, element located at "+N+","+_+" with size "+T+"x"+U+" using computed rendering"),o.logger.debug("Starting DOM parsing"),p=Ul(o,d),D===p.styles.backgroundColor&&(p.styles.backgroundColor=Se.TRANSPARENT),o.logger.debug("Starting renderer for element at "+P.x+","+P.y+" with size "+P.width+"x"+P.height),H=new Mb(o,P),[4,H.render(p)];case 4:L=I.sent(),I.label=5;case 5:return(!((KA=e.removeContainer)!==null&&KA!==void 0)||KA)&&(kl.destroy(C)||o.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),o.logger.debug("Finished rendering"),[2,L]}})})},$b=function(A,e,t){var r=e.ownerDocument,n=r.documentElement?vr(A,getComputedStyle(r.documentElement).backgroundColor):Se.TRANSPARENT,a=r.body?vr(A,getComputedStyle(r.body).backgroundColor):Se.TRANSPARENT,s=typeof t=="string"?vr(A,t):t===null?Se.TRANSPARENT:4294967295;return e===r.documentElement?je(n)?je(a)?s:a:n:s};const Zb=c.defineComponent({name:"GpIframe",props:{htmlContent:{type:String,required:!0},jsFiles:{type:Array,default:[]},cssFiles:{type:Array,default:[]},iframeStyle:{type:Object,default:()=>({width:"100%",height:"100%",border:"none"})}},setup(A){const e=c.ref(null),t=c.ref(),r=()=>{var C;const a=e.value;if(!a)return;const s=a.contentDocument||((C=a.contentWindow)==null?void 0:C.document);if(!s)return;s.open(),s.write("<!DOCTYPE html><html><head></head><body></body></html>"),s.close();const u=s.head;A.cssFiles.forEach(m=>{const T=s.createElement("link");T.rel="stylesheet",T.href=m+"?t="+new Date().getTime(),u.appendChild(T)});const o=s.createElement("link");o.rel="stylesheet",o.href="/spa/topic/css/style.css?t="+new Date().getTime(),u.appendChild(o);const l=s.createElement("script");l.src="/spa/topic/js/jquery-3.6.0.min.js",l.async=!1,u.appendChild(l);const f=s.createElement("script");f.src="/spa/topic/js/swiper-bundle.min.js",f.async=!1,u.appendChild(f);const h=s.createElement("script");h.src="/spa/topic/js/index.js?t="+new Date().getTime(),h.async=!1,u.appendChild(h);const d=s.body;d.innerHTML=A.htmlContent,A.jsFiles.forEach(m=>{const T=s.createElement("script");T.src=m+"?t="+new Date().getTime(),T.async=!1,d.appendChild(T)}),t.value=d,c.nextTick(()=>{})};c.watch(t,a=>{if(!a)return;new MutationObserver(()=>{const u=e.value;u&&(u.style.height=`${a.scrollHeight}px`)}).observe(a,{childList:!0,subtree:!0})});const n=async a=>{var l;const s=e.value;if(!s)return;const u=s.contentDocument||((l=s.contentWindow)==null?void 0:l.document);if(!u)return;const o=u.body;if(o)try{await c.nextTick();const f=await qb(o,{x:0,y:0,scrollX:window.scrollX,scrollY:window.scrollY,useCORS:!0,allowTaint:!0,foreignObjectRendering:!1});a?a(f):f.toBlob(h=>{const d=URL.createObjectURL(h);window.open(d,"_blank")})}catch(f){console.error("截图生成失败:",f)}};return c.watch(()=>[A.htmlContent,A.jsFiles,A.cssFiles],r,{deep:!0}),c.onMounted(()=>{r()}),{iframeRef:e,generateCover:n}}});function zb(A,e,t,r,n,a){return c.openBlock(),c.createElementBlock("div",null,[c.createElementVNode("iframe",{ref:"iframeRef",style:c.normalizeStyle([{"min-height":"600px"},A.iframeStyle])},null,4)])}const Zl=Pe(Zb,[["render",zb],["__scopeId","data-v-d34cbad1"]]),AU={class:"flex gp-dsigner"},eU={key:0,class:"flex items-center justify-between border-b"},tU={class:"text-lg font-bold p-2"},rU={class:"text-sm font-thin text-gray-500"},nU={class:"flex-1 overflow-auto"},aU={key:0,class:"flex justify-between items-center border-b p-2"},sU={class:"flex items-center"},iU={class:"p-2"},uU={class:"sticky top-0"},oU={key:0,class:"text-lg font-bold border-b p-2"},cU={class:"text-sm font-thin text-gray-500"},lU={class:"p-2"},fU={key:0,class:"max-h-[500px] overflow-hidden w-[640px] h-[360px] bg-light-100"},zl=Pe(c.defineComponent({__name:"Designer",props:{mode:{default:"design"},template:{},css:{},js:{},previewWidth:{default:360},uploadByFile:{},icons:{},rules:{},preview:{type:Boolean,default:!0},showTitle:{type:Boolean,default:!0}},emits:["update:modelValue","update:element"],setup(A,{expose:e,emit:t}){const r=A,n=t,a=c.ref(r.rules||[]),s=c.ref(r.template),u=c.ref();let o=Bo("",{},!1);const l=c.ref("");c.watch(()=>r.template,Q=>{s.value=Q},{immediate:!0}),c.watch(()=>s.value,Q=>{Q&&(u.value=BA(Q))},{immediate:!0}),c.watch(()=>r.css,Q=>{Q.forEach(S=>{if(document.querySelector(`link[href="${S}"]`))return;const O=document.createElement("link");O.rel="stylesheet",O.href=S,document.head.appendChild(O)})},{immediate:!0}),c.watch(()=>r.js,Q=>{!Q||Q.length===0||Q.forEach(S=>{if(document.querySelector(`script[src="${S}"]`))return;const O=document.createElement("script");O.src=S,document.body.appendChild(O)})},{immediate:!0});const f=c.ref(r.mode);c.watch(()=>u.value,Q=>{Q&&n("update:element",Q)},{immediate:!0});const h=c.ref("");c.watch(()=>l.value,Q=>{n("update:modelValue",Q)},{immediate:!0});const d=c.ref(),C=c.ref(),m=c.ref(),T=c.ref(),U=c.ref(),N=c.ref(),_=c.ref(""),D=c.ref(r.mode==="design");c.watch(()=>r.rules,Q=>{a.value=Q,s.value&&(u.value=BA(s.value))},{immediate:!0});function P(Q=void 0){T.value&&T.value.generateCover(Q)}function L(Q){var S,O,V,hA,eA,wA,fA,WA,$,se,JA;U.value=Q,Q.type===Y.Text&&Q.rule.allowWrap&&(et.value=!0,Et.value=(JA=(se=($=(WA=(fA=(wA=(eA=(hA=(V=(O=(S=Q.text)==null?void 0:S.replace(/<br>/g,`
40
40
  `))==null?void 0:O.replace(/<br\/>/g,`
41
41
  `))==null?void 0:V.replace(/<br \/>/g,`
42
42
  `))==null?void 0:hA.replace(/<br \s*\/>/g,`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gp-designer",
3
3
  "private": false,
4
- "version": "1.0.84",
4
+ "version": "1.0.85",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "gp",