@data_wise/hyper-markdown 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hyper-markdown.es.js +22 -15
- package/dist/hyper-markdown.umd.js +1 -1
- package/package.json +1 -1
|
@@ -166580,21 +166580,28 @@ class Ntr {
|
|
|
166580
166580
|
const r = e.querySelector("svg");
|
|
166581
166581
|
if (!r)
|
|
166582
166582
|
return console.warn("未找到 Mermaid SVG 元素"), null;
|
|
166583
|
-
const n = r.getBoundingClientRect(), i = n.width, a = n.height, s =
|
|
166584
|
-
|
|
166585
|
-
|
|
166586
|
-
|
|
166587
|
-
|
|
166588
|
-
|
|
166589
|
-
|
|
166590
|
-
|
|
166591
|
-
|
|
166592
|
-
|
|
166593
|
-
|
|
166594
|
-
|
|
166595
|
-
|
|
166596
|
-
|
|
166597
|
-
|
|
166583
|
+
const n = r.getBoundingClientRect(), i = n.width, a = n.height, s = e.querySelector(".mermaid-controls");
|
|
166584
|
+
let o = null;
|
|
166585
|
+
s && (o = s.style.display, s.style.display = "none");
|
|
166586
|
+
try {
|
|
166587
|
+
const l = await DV(e, {
|
|
166588
|
+
backgroundColor: "#ffffff",
|
|
166589
|
+
scale: 2,
|
|
166590
|
+
logging: !1,
|
|
166591
|
+
useCORS: !0,
|
|
166592
|
+
allowTaint: !0,
|
|
166593
|
+
foreignObjectRendering: !1
|
|
166594
|
+
}), u = await this.canvasToBlob(l), h = await this.blobToArrayBuffer(u);
|
|
166595
|
+
return {
|
|
166596
|
+
data: new Uint8Array(h),
|
|
166597
|
+
width: l.width,
|
|
166598
|
+
height: l.height,
|
|
166599
|
+
displayWidth: i,
|
|
166600
|
+
displayHeight: a
|
|
166601
|
+
};
|
|
166602
|
+
} finally {
|
|
166603
|
+
s && o !== null && (s.style.display = o);
|
|
166604
|
+
}
|
|
166598
166605
|
} catch (r) {
|
|
166599
166606
|
return console.error("捕获 Mermaid 图表失败:", r), null;
|
|
166600
166607
|
}
|
|
@@ -898,7 +898,7 @@ Actual: `+Y.attribValue);else{var K=Y.tag,j=Y.tags[Y.tags.length-1]||Y;K.ns===j.
|
|
|
898
898
|
content: "" !important;
|
|
899
899
|
display: none !important;
|
|
900
900
|
}`,dJt=function(t){fJt(t,"."+sJ+uJt+J6e+`
|
|
901
|
-
.`+oJ+hJt+J6e)},fJt=function(t,e){var r=t.ownerDocument;if(r){var n=r.createElement("style");n.textContent=e,t.appendChild(n)}},eFe=function(){function t(){}return t.getOrigin=function(e){var r=t._link;return r?(r.href=e,r.href=r.href,r.protocol+r.hostname+r.port):"about:blank"},t.isSameOrigin=function(e){return t.getOrigin(e)===t._origin},t.setContext=function(e){t._link=e.document.createElement("a"),t._origin=t.getOrigin(e.location.href)},t._origin="about:blank",t}(),pJt=function(){function t(e,r){this.context=e,this._options=r,this._cache={}}return t.prototype.addImage=function(e){var r=Promise.resolve();return this.has(e)||(cJ(e)||vJt(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),r},t.prototype.match=function(e){return this._cache[e]},t.prototype.loadImage=function(e){return ll(this,void 0,void 0,function(){var r,n,i,a,s=this;return To(this,function(o){switch(o.label){case 0:return r=eFe.isSameOrigin(e),n=!lJ(e)&&this._options.useCORS===!0&&qs.SUPPORT_CORS_IMAGES&&!r,i=!lJ(e)&&!r&&!cJ(e)&&typeof this._options.proxy=="string"&&qs.SUPPORT_CORS_XHR&&!n,!r&&this._options.allowTaint===!1&&!lJ(e)&&!cJ(e)&&!i&&!n?[2]:(a=e,i?[4,this.proxy(a)]:[3,2]);case 1:a=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(l,u){var h=new Image;h.onload=function(){return l(h)},h.onerror=u,(yJt(a)||n)&&(h.crossOrigin="anonymous"),h.src=a,h.complete===!0&&setTimeout(function(){return l(h)},500),s._options.imageTimeout>0&&setTimeout(function(){return u("Timed out ("+s._options.imageTimeout+"ms) loading image")},s._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},t.prototype.has=function(e){return typeof this._cache[e]<"u"},t.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},t.prototype.proxy=function(e){var r=this,n=this._options.proxy;if(!n)throw new Error("No proxy defined");var i=e.substring(0,256);return new Promise(function(a,s){var o=qs.SUPPORT_RESPONSE_TYPE?"blob":"text",l=new XMLHttpRequest;l.onload=function(){if(l.status===200)if(o==="text")a(l.response);else{var d=new FileReader;d.addEventListener("load",function(){return a(d.result)},!1),d.addEventListener("error",function(f){return s(f)},!1),d.readAsDataURL(l.response)}else s("Failed to proxy resource "+i+" with status code "+l.status)},l.onerror=s;var u=n.indexOf("?")>-1?"&":"?";if(l.open("GET",""+n+u+"url="+encodeURIComponent(e)+"&responseType="+o),o!=="text"&&l instanceof XMLHttpRequest&&(l.responseType=o),r._options.imageTimeout){var h=r._options.imageTimeout;l.timeout=h,l.ontimeout=function(){return s("Timed out ("+h+"ms) proxying "+i)}}l.send()})},t}(),gJt=/^data:image\/svg\+xml/i,AJt=/^data:image\/.*;base64,/i,mJt=/^data:image\/.*/i,vJt=function(t){return qs.SUPPORT_SVG_DRAWING||!_Jt(t)},lJ=function(t){return mJt.test(t)},yJt=function(t){return AJt.test(t)},cJ=function(t){return t.substr(0,4)==="blob"},_Jt=function(t){return t.substr(-3).toLowerCase()==="svg"||gJt.test(t)},jt=function(){function t(e,r){this.type=0,this.x=e,this.y=r}return t.prototype.add=function(e,r){return new t(this.x+e,this.y+r)},t}(),gb=function(t,e,r){return new jt(t.x+(e.x-t.x)*r,t.y+(e.y-t.y)*r)},R5=function(){function t(e,r,n,i){this.type=1,this.start=e,this.startControl=r,this.endControl=n,this.end=i}return t.prototype.subdivide=function(e,r){var n=gb(this.start,this.startControl,e),i=gb(this.startControl,this.endControl,e),a=gb(this.endControl,this.end,e),s=gb(n,i,e),o=gb(i,a,e),l=gb(s,o,e);return r?new t(this.start,n,s,l):new t(l,o,a,this.end)},t.prototype.add=function(e,r){return new t(this.start.add(e,r),this.startControl.add(e,r),this.endControl.add(e,r),this.end.add(e,r))},t.prototype.reverse=function(){return new t(this.end,this.endControl,this.startControl,this.start)},t}(),lu=function(t){return t.type===1},bJt=function(){function t(e){var r=e.styles,n=e.bounds,i=o2(r.borderTopLeftRadius,n.width,n.height),a=i[0],s=i[1],o=o2(r.borderTopRightRadius,n.width,n.height),l=o[0],u=o[1],h=o2(r.borderBottomRightRadius,n.width,n.height),d=h[0],f=h[1],p=o2(r.borderBottomLeftRadius,n.width,n.height),g=p[0],A=p[1],m=[];m.push((a+l)/n.width),m.push((g+d)/n.width),m.push((s+A)/n.height),m.push((u+f)/n.height);var v=Math.max.apply(Math,m);v>1&&(a/=v,s/=v,l/=v,u/=v,d/=v,f/=v,g/=v,A/=v);var y=n.width-l,_=n.height-f,b=n.width-d,S=n.height-A,E=r.borderTopWidth,w=r.borderRightWidth,O=r.borderBottomWidth,x=r.borderLeftWidth,R=Ei(r.paddingTop,e.bounds.width),C=Ei(r.paddingRight,e.bounds.width),I=Ei(r.paddingBottom,e.bounds.width),N=Ei(r.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=a>0||s>0?Ui(n.left+x/3,n.top+E/3,a-x/3,s-E/3,Wn.TOP_LEFT):new jt(n.left+x/3,n.top+E/3),this.topRightBorderDoubleOuterBox=a>0||s>0?Ui(n.left+y,n.top+E/3,l-w/3,u-E/3,Wn.TOP_RIGHT):new jt(n.left+n.width-w/3,n.top+E/3),this.bottomRightBorderDoubleOuterBox=d>0||f>0?Ui(n.left+b,n.top+_,d-w/3,f-O/3,Wn.BOTTOM_RIGHT):new jt(n.left+n.width-w/3,n.top+n.height-O/3),this.bottomLeftBorderDoubleOuterBox=g>0||A>0?Ui(n.left+x/3,n.top+S,g-x/3,A-O/3,Wn.BOTTOM_LEFT):new jt(n.left+x/3,n.top+n.height-O/3),this.topLeftBorderDoubleInnerBox=a>0||s>0?Ui(n.left+x*2/3,n.top+E*2/3,a-x*2/3,s-E*2/3,Wn.TOP_LEFT):new jt(n.left+x*2/3,n.top+E*2/3),this.topRightBorderDoubleInnerBox=a>0||s>0?Ui(n.left+y,n.top+E*2/3,l-w*2/3,u-E*2/3,Wn.TOP_RIGHT):new jt(n.left+n.width-w*2/3,n.top+E*2/3),this.bottomRightBorderDoubleInnerBox=d>0||f>0?Ui(n.left+b,n.top+_,d-w*2/3,f-O*2/3,Wn.BOTTOM_RIGHT):new jt(n.left+n.width-w*2/3,n.top+n.height-O*2/3),this.bottomLeftBorderDoubleInnerBox=g>0||A>0?Ui(n.left+x*2/3,n.top+S,g-x*2/3,A-O*2/3,Wn.BOTTOM_LEFT):new jt(n.left+x*2/3,n.top+n.height-O*2/3),this.topLeftBorderStroke=a>0||s>0?Ui(n.left+x/2,n.top+E/2,a-x/2,s-E/2,Wn.TOP_LEFT):new jt(n.left+x/2,n.top+E/2),this.topRightBorderStroke=a>0||s>0?Ui(n.left+y,n.top+E/2,l-w/2,u-E/2,Wn.TOP_RIGHT):new jt(n.left+n.width-w/2,n.top+E/2),this.bottomRightBorderStroke=d>0||f>0?Ui(n.left+b,n.top+_,d-w/2,f-O/2,Wn.BOTTOM_RIGHT):new jt(n.left+n.width-w/2,n.top+n.height-O/2),this.bottomLeftBorderStroke=g>0||A>0?Ui(n.left+x/2,n.top+S,g-x/2,A-O/2,Wn.BOTTOM_LEFT):new jt(n.left+x/2,n.top+n.height-O/2),this.topLeftBorderBox=a>0||s>0?Ui(n.left,n.top,a,s,Wn.TOP_LEFT):new jt(n.left,n.top),this.topRightBorderBox=l>0||u>0?Ui(n.left+y,n.top,l,u,Wn.TOP_RIGHT):new jt(n.left+n.width,n.top),this.bottomRightBorderBox=d>0||f>0?Ui(n.left+b,n.top+_,d,f,Wn.BOTTOM_RIGHT):new jt(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=g>0||A>0?Ui(n.left,n.top+S,g,A,Wn.BOTTOM_LEFT):new jt(n.left,n.top+n.height),this.topLeftPaddingBox=a>0||s>0?Ui(n.left+x,n.top+E,Math.max(0,a-x),Math.max(0,s-E),Wn.TOP_LEFT):new jt(n.left+x,n.top+E),this.topRightPaddingBox=l>0||u>0?Ui(n.left+Math.min(y,n.width-w),n.top+E,y>n.width+w?0:Math.max(0,l-w),Math.max(0,u-E),Wn.TOP_RIGHT):new jt(n.left+n.width-w,n.top+E),this.bottomRightPaddingBox=d>0||f>0?Ui(n.left+Math.min(b,n.width-x),n.top+Math.min(_,n.height-O),Math.max(0,d-w),Math.max(0,f-O),Wn.BOTTOM_RIGHT):new jt(n.left+n.width-w,n.top+n.height-O),this.bottomLeftPaddingBox=g>0||A>0?Ui(n.left+x,n.top+Math.min(S,n.height-O),Math.max(0,g-x),Math.max(0,A-O),Wn.BOTTOM_LEFT):new jt(n.left+x,n.top+n.height-O),this.topLeftContentBox=a>0||s>0?Ui(n.left+x+N,n.top+E+R,Math.max(0,a-(x+N)),Math.max(0,s-(E+R)),Wn.TOP_LEFT):new jt(n.left+x+N,n.top+E+R),this.topRightContentBox=l>0||u>0?Ui(n.left+Math.min(y,n.width+x+N),n.top+E+R,y>n.width+x+N?0:l-x+N,u-(E+R),Wn.TOP_RIGHT):new jt(n.left+n.width-(w+C),n.top+E+R),this.bottomRightContentBox=d>0||f>0?Ui(n.left+Math.min(b,n.width-(x+N)),n.top+Math.min(_,n.height+E+R),Math.max(0,d-(w+C)),f-(O+I),Wn.BOTTOM_RIGHT):new jt(n.left+n.width-(w+C),n.top+n.height-(O+I)),this.bottomLeftContentBox=g>0||A>0?Ui(n.left+x+N,n.top+S,Math.max(0,g-(x+N)),A-(O+I),Wn.BOTTOM_LEFT):new jt(n.left+x+N,n.top+n.height-(O+I))}return t}(),Wn;(function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=1]="TOP_RIGHT",t[t.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",t[t.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(Wn||(Wn={}));var Ui=function(t,e,r,n,i){var a=4*((Math.sqrt(2)-1)/3),s=r*a,o=n*a,l=t+r,u=e+n;switch(i){case Wn.TOP_LEFT:return new R5(new jt(t,u),new jt(t,u-o),new jt(l-s,e),new jt(l,e));case Wn.TOP_RIGHT:return new R5(new jt(t,e),new jt(t+s,e),new jt(l,u-o),new jt(l,u));case Wn.BOTTOM_RIGHT:return new R5(new jt(l,e),new jt(l,e+o),new jt(t+s,u),new jt(t,u));case Wn.BOTTOM_LEFT:default:return new R5(new jt(l,u),new jt(l-s,u),new jt(t,e+o),new jt(t,e))}},k5=function(t){return[t.topLeftBorderBox,t.topRightBorderBox,t.bottomRightBorderBox,t.bottomLeftBorderBox]},SJt=function(t){return[t.topLeftContentBox,t.topRightContentBox,t.bottomRightContentBox,t.bottomLeftContentBox]},I5=function(t){return[t.topLeftPaddingBox,t.topRightPaddingBox,t.bottomRightPaddingBox,t.bottomLeftPaddingBox]},EJt=function(){function t(e,r,n){this.offsetX=e,this.offsetY=r,this.matrix=n,this.type=0,this.target=6}return t}(),N5=function(){function t(e,r){this.path=e,this.target=r,this.type=1}return t}(),wJt=function(){function t(e){this.opacity=e,this.type=2,this.target=6}return t}(),xJt=function(t){return t.type===0},tFe=function(t){return t.type===1},TJt=function(t){return t.type===2},rFe=function(t,e){return t.length===e.length?t.some(function(r,n){return r===e[n]}):!1},OJt=function(t,e,r,n,i){return t.map(function(a,s){switch(s){case 0:return a.add(e,r);case 1:return a.add(e+n,r);case 2:return a.add(e+n,r+i);case 3:return a.add(e,r+i)}return a})},nFe=function(){function t(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return t}(),iFe=function(){function t(e,r){if(this.container=e,this.parent=r,this.effects=[],this.curves=new bJt(this.container),this.container.styles.opacity<1&&this.effects.push(new wJt(this.container.styles.opacity)),this.container.styles.transform!==null){var n=this.container.bounds.left+this.container.styles.transformOrigin[0].number,i=this.container.bounds.top+this.container.styles.transformOrigin[1].number,a=this.container.styles.transform;this.effects.push(new EJt(n,i,a))}if(this.container.styles.overflowX!==0){var s=k5(this.curves),o=I5(this.curves);rFe(s,o)?this.effects.push(new N5(s,6)):(this.effects.push(new N5(s,2)),this.effects.push(new N5(o,4)))}}return t.prototype.getEffects=function(e){for(var r=[2,3].indexOf(this.container.styles.position)===-1,n=this.parent,i=this.effects.slice(0);n;){var a=n.effects.filter(function(l){return!tFe(l)});if(r||n.container.styles.position!==0||!n.parent){if(i.unshift.apply(i,a),r=[2,3].indexOf(n.container.styles.position)===-1,n.container.styles.overflowX!==0){var s=k5(n.curves),o=I5(n.curves);rFe(s,o)||i.unshift(new N5(o,6))}}else i.unshift.apply(i,a);n=n.parent}return i.filter(function(l){return ns(l.target,e)})},t}(),uJ=function(t,e,r,n){t.container.elements.forEach(function(i){var a=ns(i.flags,4),s=ns(i.flags,2),o=new iFe(i,t);ns(i.styles.display,2048)&&n.push(o);var l=ns(i.flags,8)?[]:n;if(a||s){var u=a||i.styles.isPositioned()?r:e,h=new nFe(o);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var d=i.styles.zIndex.order;if(d<0){var f=0;u.negativeZIndex.some(function(g,A){return d>g.element.container.styles.zIndex.order?(f=A,!1):f>0}),u.negativeZIndex.splice(f,0,h)}else if(d>0){var p=0;u.positiveZIndex.some(function(g,A){return d>=g.element.container.styles.zIndex.order?(p=A+1,!1):p>0}),u.positiveZIndex.splice(p,0,h)}else u.zeroOrAutoZIndexOrTransformedOrOpacity.push(h)}else i.styles.isFloating()?u.nonPositionedFloats.push(h):u.nonPositionedInlineLevel.push(h);uJ(o,h,a?h:r,l)}else i.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),uJ(o,e,r,l);ns(i.flags,8)&&aFe(i,l)})},aFe=function(t,e){for(var r=t instanceof Jj?t.start:1,n=t instanceof Jj?t.reversed:!1,i=0;i<e.length;i++){var a=e[i];a.container instanceof k6e&&typeof a.container.value=="number"&&a.container.value!==0&&(r=a.container.value),a.listValue=f2(r,a.container.styles.listStyleType,!0),r+=n?-1:1}},CJt=function(t){var e=new iFe(t,null),r=new nFe(e),n=[];return uJ(e,r,r,n),aFe(e.container,n),r},sFe=function(t,e){switch(e){case 0:return cu(t.topLeftBorderBox,t.topLeftPaddingBox,t.topRightBorderBox,t.topRightPaddingBox);case 1:return cu(t.topRightBorderBox,t.topRightPaddingBox,t.bottomRightBorderBox,t.bottomRightPaddingBox);case 2:return cu(t.bottomRightBorderBox,t.bottomRightPaddingBox,t.bottomLeftBorderBox,t.bottomLeftPaddingBox);case 3:default:return cu(t.bottomLeftBorderBox,t.bottomLeftPaddingBox,t.topLeftBorderBox,t.topLeftPaddingBox)}},RJt=function(t,e){switch(e){case 0:return cu(t.topLeftBorderBox,t.topLeftBorderDoubleOuterBox,t.topRightBorderBox,t.topRightBorderDoubleOuterBox);case 1:return cu(t.topRightBorderBox,t.topRightBorderDoubleOuterBox,t.bottomRightBorderBox,t.bottomRightBorderDoubleOuterBox);case 2:return cu(t.bottomRightBorderBox,t.bottomRightBorderDoubleOuterBox,t.bottomLeftBorderBox,t.bottomLeftBorderDoubleOuterBox);case 3:default:return cu(t.bottomLeftBorderBox,t.bottomLeftBorderDoubleOuterBox,t.topLeftBorderBox,t.topLeftBorderDoubleOuterBox)}},kJt=function(t,e){switch(e){case 0:return cu(t.topLeftBorderDoubleInnerBox,t.topLeftPaddingBox,t.topRightBorderDoubleInnerBox,t.topRightPaddingBox);case 1:return cu(t.topRightBorderDoubleInnerBox,t.topRightPaddingBox,t.bottomRightBorderDoubleInnerBox,t.bottomRightPaddingBox);case 2:return cu(t.bottomRightBorderDoubleInnerBox,t.bottomRightPaddingBox,t.bottomLeftBorderDoubleInnerBox,t.bottomLeftPaddingBox);case 3:default:return cu(t.bottomLeftBorderDoubleInnerBox,t.bottomLeftPaddingBox,t.topLeftBorderDoubleInnerBox,t.topLeftPaddingBox)}},IJt=function(t,e){switch(e){case 0:return D5(t.topLeftBorderStroke,t.topRightBorderStroke);case 1:return D5(t.topRightBorderStroke,t.bottomRightBorderStroke);case 2:return D5(t.bottomRightBorderStroke,t.bottomLeftBorderStroke);case 3:default:return D5(t.bottomLeftBorderStroke,t.topLeftBorderStroke)}},D5=function(t,e){var r=[];return lu(t)?r.push(t.subdivide(.5,!1)):r.push(t),lu(e)?r.push(e.subdivide(.5,!0)):r.push(e),r},cu=function(t,e,r,n){var i=[];return lu(t)?i.push(t.subdivide(.5,!1)):i.push(t),lu(r)?i.push(r.subdivide(.5,!0)):i.push(r),lu(n)?i.push(n.subdivide(.5,!0).reverse()):i.push(n),lu(e)?i.push(e.subdivide(.5,!1).reverse()):i.push(e),i},oFe=function(t){var e=t.bounds,r=t.styles;return e.add(r.borderLeftWidth,r.borderTopWidth,-(r.borderRightWidth+r.borderLeftWidth),-(r.borderTopWidth+r.borderBottomWidth))},L5=function(t){var e=t.styles,r=t.bounds,n=Ei(e.paddingLeft,r.width),i=Ei(e.paddingRight,r.width),a=Ei(e.paddingTop,r.width),s=Ei(e.paddingBottom,r.width);return r.add(n+e.borderLeftWidth,a+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+n+i),-(e.borderTopWidth+e.borderBottomWidth+a+s))},NJt=function(t,e){return t===0?e.bounds:t===2?L5(e):oFe(e)},DJt=function(t,e){return t===0?e.bounds:t===2?L5(e):oFe(e)},hJ=function(t,e,r){var n=NJt(mb(t.styles.backgroundOrigin,e),t),i=DJt(mb(t.styles.backgroundClip,e),t),a=LJt(mb(t.styles.backgroundSize,e),r,n),s=a[0],o=a[1],l=o2(mb(t.styles.backgroundPosition,e),n.width-s,n.height-o),u=MJt(mb(t.styles.backgroundRepeat,e),l,a,n,i),h=Math.round(n.left+l[0]),d=Math.round(n.top+l[1]);return[u,h,d,s,o]},Ab=function(t){return di(t)&&t.value===hb.AUTO},M5=function(t){return typeof t=="number"},LJt=function(t,e,r){var n=e[0],i=e[1],a=e[2],s=t[0],o=t[1];if(!s)return[0,0];if(Fa(s)&&o&&Fa(o))return[Ei(s,r.width),Ei(o,r.height)];var l=M5(a);if(di(s)&&(s.value===hb.CONTAIN||s.value===hb.COVER)){if(M5(a)){var u=r.width/r.height;return u<a!=(s.value===hb.COVER)?[r.width,r.width/a]:[r.height*a,r.height]}return[r.width,r.height]}var h=M5(n),d=M5(i),f=h||d;if(Ab(s)&&(!o||Ab(o))){if(h&&d)return[n,i];if(!l&&!f)return[r.width,r.height];if(f&&l){var p=h?n:i*a,g=d?i:n/a;return[p,g]}var A=h?n:r.width,m=d?i:r.height;return[A,m]}if(l){var v=0,y=0;return Fa(s)?v=Ei(s,r.width):Fa(o)&&(y=Ei(o,r.height)),Ab(s)?v=y*a:(!o||Ab(o))&&(y=v/a),[v,y]}var _=null,b=null;if(Fa(s)?_=Ei(s,r.width):o&&Fa(o)&&(b=Ei(o,r.height)),_!==null&&(!o||Ab(o))&&(b=h&&d?_/n*i:r.height),b!==null&&Ab(s)&&(_=h&&d?b/i*n:r.width),_!==null&&b!==null)return[_,b];throw new Error("Unable to calculate background-size for element")},mb=function(t,e){var r=t[e];return typeof r>"u"?t[0]:r},MJt=function(t,e,r,n,i){var a=e[0],s=e[1],o=r[0],l=r[1];switch(t){case 2:return[new jt(Math.round(n.left),Math.round(n.top+s)),new jt(Math.round(n.left+n.width),Math.round(n.top+s)),new jt(Math.round(n.left+n.width),Math.round(l+n.top+s)),new jt(Math.round(n.left),Math.round(l+n.top+s))];case 3:return[new jt(Math.round(n.left+a),Math.round(n.top)),new jt(Math.round(n.left+a+o),Math.round(n.top)),new jt(Math.round(n.left+a+o),Math.round(n.height+n.top)),new jt(Math.round(n.left+a),Math.round(n.height+n.top))];case 1:return[new jt(Math.round(n.left+a),Math.round(n.top+s)),new jt(Math.round(n.left+a+o),Math.round(n.top+s)),new jt(Math.round(n.left+a+o),Math.round(n.top+s+l)),new jt(Math.round(n.left+a),Math.round(n.top+s+l))];default:return[new jt(Math.round(i.left),Math.round(i.top)),new jt(Math.round(i.left+i.width),Math.round(i.top)),new jt(Math.round(i.left+i.width),Math.round(i.height+i.top)),new jt(Math.round(i.left),Math.round(i.height+i.top))]}},BJt="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",lFe="Hidden Text",PJt=function(){function t(e){this._data={},this._document=e}return t.prototype.parseMetrics=function(e,r){var n=this._document.createElement("div"),i=this._document.createElement("img"),a=this._document.createElement("span"),s=this._document.body;n.style.visibility="hidden",n.style.fontFamily=e,n.style.fontSize=r,n.style.margin="0",n.style.padding="0",n.style.whiteSpace="nowrap",s.appendChild(n),i.src=BJt,i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",a.style.fontFamily=e,a.style.fontSize=r,a.style.margin="0",a.style.padding="0",a.appendChild(this._document.createTextNode(lFe)),n.appendChild(a),n.appendChild(i);var o=i.offsetTop-a.offsetTop+2;n.removeChild(a),n.appendChild(this._document.createTextNode(lFe)),n.style.lineHeight="normal",i.style.verticalAlign="super";var l=i.offsetTop-n.offsetTop+2;return s.removeChild(n),{baseline:o,middle:l}},t.prototype.getMetrics=function(e,r){var n=e+" "+r;return typeof this._data[n]>"u"&&(this._data[n]=this.parseMetrics(e,r)),this._data[n]},t}(),cFe=function(){function t(e,r){this.context=e,this.options=r}return t}(),FJt=1e4,UJt=function(t){th(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i._activeEffects=[],i.canvas=n.canvas?n.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),n.canvas||(i.canvas.width=Math.floor(n.width*n.scale),i.canvas.height=Math.floor(n.height*n.scale),i.canvas.style.width=n.width+"px",i.canvas.style.height=n.height+"px"),i.fontMetrics=new PJt(document),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-n.x,-n.y),i.ctx.textBaseline="bottom",i._activeEffects=[],i.context.logger.debug("Canvas renderer initialized ("+n.width+"x"+n.height+") with scale "+n.scale),i}return e.prototype.applyEffects=function(r){for(var n=this;this._activeEffects.length;)this.popEffect();r.forEach(function(i){return n.applyEffect(i)})},e.prototype.applyEffect=function(r){this.ctx.save(),TJt(r)&&(this.ctx.globalAlpha=r.opacity),xJt(r)&&(this.ctx.translate(r.offsetX,r.offsetY),this.ctx.transform(r.matrix[0],r.matrix[1],r.matrix[2],r.matrix[3],r.matrix[4],r.matrix[5]),this.ctx.translate(-r.offsetX,-r.offsetY)),tFe(r)&&(this.path(r.path),this.ctx.clip()),this._activeEffects.push(r)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(r){return ll(this,void 0,void 0,function(){var n;return To(this,function(i){switch(i.label){case 0:return n=r.element.container.styles,n.isVisible()?[4,this.renderStackContent(r)]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(r){return ll(this,void 0,void 0,function(){return To(this,function(n){switch(n.label){case 0:if(ns(r.container.flags,16))debugger;return r.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(r)]:[3,3];case 1:return n.sent(),[4,this.renderNodeContent(r)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(r,n,i){var a=this;if(n===0)this.ctx.fillText(r.text,r.bounds.left,r.bounds.top+i);else{var s=jj(r.text);s.reduce(function(o,l){return a.ctx.fillText(l,o,r.bounds.top+i),o+a.ctx.measureText(l).width},r.bounds.left)}},e.prototype.createFontStyle=function(r){var n=r.fontVariant.filter(function(s){return s==="normal"||s==="small-caps"}).join(""),i=VJt(r.fontFamily).join(", "),a=s2(r.fontSize)?""+r.fontSize.number+r.fontSize.unit:r.fontSize.number+"px";return[[r.fontStyle,n,r.fontWeight,a,i].join(" "),i,a]},e.prototype.renderTextNode=function(r,n){return ll(this,void 0,void 0,function(){var i,a,s,o,l,u,h,d,f=this;return To(this,function(p){return i=this.createFontStyle(n),a=i[0],s=i[1],o=i[2],this.ctx.font=a,this.ctx.direction=n.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",l=this.fontMetrics.getMetrics(s,o),u=l.baseline,h=l.middle,d=n.paintOrder,r.textBounds.forEach(function(g){d.forEach(function(A){switch(A){case 0:f.ctx.fillStyle=Ts(n.color),f.renderTextWithLetterSpacing(g,n.letterSpacing,u);var m=n.textShadow;m.length&&g.text.trim().length&&(m.slice(0).reverse().forEach(function(v){f.ctx.shadowColor=Ts(v.color),f.ctx.shadowOffsetX=v.offsetX.number*f.options.scale,f.ctx.shadowOffsetY=v.offsetY.number*f.options.scale,f.ctx.shadowBlur=v.blur.number,f.renderTextWithLetterSpacing(g,n.letterSpacing,u)}),f.ctx.shadowColor="",f.ctx.shadowOffsetX=0,f.ctx.shadowOffsetY=0,f.ctx.shadowBlur=0),n.textDecorationLine.length&&(f.ctx.fillStyle=Ts(n.textDecorationColor||n.color),n.textDecorationLine.forEach(function(v){switch(v){case 1:f.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top+u),g.bounds.width,1);break;case 2:f.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top),g.bounds.width,1);break;case 3:f.ctx.fillRect(g.bounds.left,Math.ceil(g.bounds.top+h),g.bounds.width,1);break}}));break;case 1:n.webkitTextStrokeWidth&&g.text.trim().length&&(f.ctx.strokeStyle=Ts(n.webkitTextStrokeColor),f.ctx.lineWidth=n.webkitTextStrokeWidth,f.ctx.lineJoin=window.chrome?"miter":"round",f.ctx.strokeText(g.text,g.bounds.left,g.bounds.top+u)),f.ctx.strokeStyle="",f.ctx.lineWidth=0,f.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(r,n,i){if(i&&r.intrinsicWidth>0&&r.intrinsicHeight>0){var a=L5(r),s=I5(n);this.path(s),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(i,0,0,r.intrinsicWidth,r.intrinsicHeight,a.left,a.top,a.width,a.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(r){return ll(this,void 0,void 0,function(){var n,i,a,s,o,l,y,y,u,h,d,f,b,p,g,S,A,m,v,y,_,b,S;return To(this,function(E){switch(E.label){case 0:this.applyEffects(r.getEffects(4)),n=r.container,i=r.curves,a=n.styles,s=0,o=n.textNodes,E.label=1;case 1:return s<o.length?(l=o[s],[4,this.renderTextNode(l,a)]):[3,4];case 2:E.sent(),E.label=3;case 3:return s++,[3,1];case 4:if(!(n instanceof O6e))return[3,8];E.label=5;case 5:return E.trys.push([5,7,,8]),[4,this.context.cache.match(n.src)];case 6:return y=E.sent(),this.renderReplacedElement(n,i,y),[3,8];case 7:return E.sent(),this.context.logger.error("Error loading image "+n.src),[3,8];case 8:if(n instanceof C6e&&this.renderReplacedElement(n,i,n.canvas),!(n instanceof R6e))return[3,12];E.label=9;case 9:return E.trys.push([9,11,,12]),[4,this.context.cache.match(n.svg)];case 10:return y=E.sent(),this.renderReplacedElement(n,i,y),[3,12];case 11:return E.sent(),this.context.logger.error("Error loading svg "+n.svg.substring(0,255)),[3,12];case 12:return n instanceof L6e&&n.tree?(u=new e(this.context,{scale:this.options.scale,backgroundColor:n.backgroundColor,x:0,y:0,width:n.width,height:n.height}),[4,u.render(n.tree)]):[3,14];case 13:h=E.sent(),n.width&&n.height&&this.ctx.drawImage(h,0,0,n.width,n.height,n.bounds.left,n.bounds.top,n.bounds.width,n.bounds.height),E.label=14;case 14:if(n instanceof eJ&&(d=Math.min(n.bounds.width,n.bounds.height),n.type===E5?n.checked&&(this.ctx.save(),this.path([new jt(n.bounds.left+d*.39363,n.bounds.top+d*.79),new jt(n.bounds.left+d*.16,n.bounds.top+d*.5549),new jt(n.bounds.left+d*.27347,n.bounds.top+d*.44071),new jt(n.bounds.left+d*.39694,n.bounds.top+d*.5649),new jt(n.bounds.left+d*.72983,n.bounds.top+d*.23),new jt(n.bounds.left+d*.84,n.bounds.top+d*.34085),new jt(n.bounds.left+d*.39363,n.bounds.top+d*.79)]),this.ctx.fillStyle=Ts(I6e),this.ctx.fill(),this.ctx.restore()):n.type===w5&&n.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.bounds.left+d/2,n.bounds.top+d/2,d/4,0,Math.PI*2,!0),this.ctx.fillStyle=Ts(I6e),this.ctx.fill(),this.ctx.restore())),QJt(n)&&n.value.length){switch(f=this.createFontStyle(a),b=f[0],p=f[1],g=this.fontMetrics.getMetrics(b,p).baseline,this.ctx.font=b,this.ctx.fillStyle=Ts(a.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=GJt(n.styles.textAlign),S=L5(n),A=0,n.styles.textAlign){case 1:A+=S.width/2;break;case 2:A+=S.width;break}m=S.add(A,0,0,-S.height/2+1),this.ctx.save(),this.path([new jt(S.left,S.top),new jt(S.left+S.width,S.top),new jt(S.left+S.width,S.top+S.height),new jt(S.left,S.top+S.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new h2(n.value,m),a.letterSpacing,g),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!ns(n.styles.display,2048))return[3,20];if(n.styles.listStyleImage===null)return[3,19];if(v=n.styles.listStyleImage,v.type!==0)return[3,18];y=void 0,_=v.url,E.label=15;case 15:return E.trys.push([15,17,,18]),[4,this.context.cache.match(_)];case 16:return y=E.sent(),this.ctx.drawImage(y,n.bounds.left-(y.width+10),n.bounds.top),[3,18];case 17:return E.sent(),this.context.logger.error("Error loading list-style-image "+_),[3,18];case 18:return[3,20];case 19:r.listValue&&n.styles.listStyleType!==-1&&(b=this.createFontStyle(a)[0],this.ctx.font=b,this.ctx.fillStyle=Ts(a.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",S=new lp(n.bounds.left,n.bounds.top+Ei(n.styles.paddingTop,n.bounds.width),n.bounds.width,l6e(a.lineHeight,a.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new h2(r.listValue,S),a.letterSpacing,l6e(a.lineHeight,a.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),E.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(r){return ll(this,void 0,void 0,function(){var n,i,v,a,s,v,o,l,v,u,h,v,d,f,v,p,g,v,A,m,v;return To(this,function(y){switch(y.label){case 0:if(ns(r.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(r.element)];case 1:y.sent(),n=0,i=r.negativeZIndex,y.label=2;case 2:return n<i.length?(v=i[n],[4,this.renderStack(v)]):[3,5];case 3:y.sent(),y.label=4;case 4:return n++,[3,2];case 5:return[4,this.renderNodeContent(r.element)];case 6:y.sent(),a=0,s=r.nonInlineLevel,y.label=7;case 7:return a<s.length?(v=s[a],[4,this.renderNode(v)]):[3,10];case 8:y.sent(),y.label=9;case 9:return a++,[3,7];case 10:o=0,l=r.nonPositionedFloats,y.label=11;case 11:return o<l.length?(v=l[o],[4,this.renderStack(v)]):[3,14];case 12:y.sent(),y.label=13;case 13:return o++,[3,11];case 14:u=0,h=r.nonPositionedInlineLevel,y.label=15;case 15:return u<h.length?(v=h[u],[4,this.renderStack(v)]):[3,18];case 16:y.sent(),y.label=17;case 17:return u++,[3,15];case 18:d=0,f=r.inlineLevel,y.label=19;case 19:return d<f.length?(v=f[d],[4,this.renderNode(v)]):[3,22];case 20:y.sent(),y.label=21;case 21:return d++,[3,19];case 22:p=0,g=r.zeroOrAutoZIndexOrTransformedOrOpacity,y.label=23;case 23:return p<g.length?(v=g[p],[4,this.renderStack(v)]):[3,26];case 24:y.sent(),y.label=25;case 25:return p++,[3,23];case 26:A=0,m=r.positiveZIndex,y.label=27;case 27:return A<m.length?(v=m[A],[4,this.renderStack(v)]):[3,30];case 28:y.sent(),y.label=29;case 29:return A++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(r){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(r.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(r){this.ctx.beginPath(),this.formatPath(r),this.ctx.closePath()},e.prototype.formatPath=function(r){var n=this;r.forEach(function(i,a){var s=lu(i)?i.start:i;a===0?n.ctx.moveTo(s.x,s.y):n.ctx.lineTo(s.x,s.y),lu(i)&&n.ctx.bezierCurveTo(i.startControl.x,i.startControl.y,i.endControl.x,i.endControl.y,i.end.x,i.end.y)})},e.prototype.renderRepeat=function(r,n,i,a){this.path(r),this.ctx.fillStyle=n,this.ctx.translate(i,a),this.ctx.fill(),this.ctx.translate(-i,-a)},e.prototype.resizeImage=function(r,n,i){var a;if(r.width===n&&r.height===i)return r;var s=(a=this.canvas.ownerDocument)!==null&&a!==void 0?a:document,o=s.createElement("canvas");o.width=Math.max(1,n),o.height=Math.max(1,i);var l=o.getContext("2d");return l.drawImage(r,0,0,r.width,r.height,0,0,n,i),o},e.prototype.renderBackgroundImage=function(r){return ll(this,void 0,void 0,function(){var n,i,a,s,o,l;return To(this,function(u){switch(u.label){case 0:n=r.styles.backgroundImage.length-1,i=function(h){var d,f,p,R,M,B,N,T,O,g,R,M,B,N,T,A,m,v,y,_,b,S,E,w,O,x,R,C,I,N,T,D,M,B,F,$,z,G,V,ee,se,ie;return To(this,function(le){switch(le.label){case 0:if(h.type!==0)return[3,5];d=void 0,f=h.url,le.label=1;case 1:return le.trys.push([1,3,,4]),[4,a.context.cache.match(f)];case 2:return d=le.sent(),[3,4];case 3:return le.sent(),a.context.logger.error("Error loading background-image "+f),[3,4];case 4:return d&&(p=hJ(r,n,[d.width,d.height,d.width/d.height]),R=p[0],M=p[1],B=p[2],N=p[3],T=p[4],O=a.ctx.createPattern(a.resizeImage(d,N,T),"repeat"),a.renderRepeat(R,O,M,B)),[3,6];case 5:xKt(h)?(g=hJ(r,n,[null,null,null]),R=g[0],M=g[1],B=g[2],N=g[3],T=g[4],A=_Kt(h.angle,N,T),m=A[0],v=A[1],y=A[2],_=A[3],b=A[4],S=document.createElement("canvas"),S.width=N,S.height=T,E=S.getContext("2d"),w=E.createLinearGradient(v,_,y,b),ZPe(h.stops,m).forEach(function(Y){return w.addColorStop(Y.stop,Ts(Y.color))}),E.fillStyle=w,E.fillRect(0,0,N,T),N>0&&T>0&&(O=a.ctx.createPattern(S,"repeat"),a.renderRepeat(R,O,M,B))):TKt(h)&&(x=hJ(r,n,[null,null,null]),R=x[0],C=x[1],I=x[2],N=x[3],T=x[4],D=h.position.length===0?[Pj]:h.position,M=Ei(D[0],N),B=Ei(D[D.length-1],T),F=bKt(h,M,B,N,T),$=F[0],z=F[1],$>0&&z>0&&(G=a.ctx.createRadialGradient(C+M,I+B,0,C+M,I+B,$),ZPe(h.stops,$*2).forEach(function(Y){return G.addColorStop(Y.stop,Ts(Y.color))}),a.path(R),a.ctx.fillStyle=G,$!==z?(V=r.bounds.left+.5*r.bounds.width,ee=r.bounds.top+.5*r.bounds.height,se=z/$,ie=1/se,a.ctx.save(),a.ctx.translate(V,ee),a.ctx.transform(1,0,0,se,0,0),a.ctx.translate(-V,-ee),a.ctx.fillRect(C,ie*(I-ee)+ee,N,T*ie),a.ctx.restore()):a.ctx.fill())),le.label=6;case 6:return n--,[2]}})},a=this,s=0,o=r.styles.backgroundImage.slice(0).reverse(),u.label=1;case 1:return s<o.length?(l=o[s],[5,i(l)]):[3,4];case 2:u.sent(),u.label=3;case 3:return s++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(r,n,i){return ll(this,void 0,void 0,function(){return To(this,function(a){return this.path(sFe(i,n)),this.ctx.fillStyle=Ts(r),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(r,n,i,a){return ll(this,void 0,void 0,function(){var s,o;return To(this,function(l){switch(l.label){case 0:return n<3?[4,this.renderSolidBorder(r,i,a)]:[3,2];case 1:return l.sent(),[2];case 2:return s=RJt(a,i),this.path(s),this.ctx.fillStyle=Ts(r),this.ctx.fill(),o=kJt(a,i),this.path(o),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(r){return ll(this,void 0,void 0,function(){var n,i,a,s,o,l,u,h,d=this;return To(this,function(f){switch(f.label){case 0:return this.applyEffects(r.getEffects(2)),n=r.container.styles,i=!u0(n.backgroundColor)||n.backgroundImage.length,a=[{style:n.borderTopStyle,color:n.borderTopColor,width:n.borderTopWidth},{style:n.borderRightStyle,color:n.borderRightColor,width:n.borderRightWidth},{style:n.borderBottomStyle,color:n.borderBottomColor,width:n.borderBottomWidth},{style:n.borderLeftStyle,color:n.borderLeftColor,width:n.borderLeftWidth}],s=$Jt(mb(n.backgroundClip,0),r.curves),i||n.boxShadow.length?(this.ctx.save(),this.path(s),this.ctx.clip(),u0(n.backgroundColor)||(this.ctx.fillStyle=Ts(n.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(r.container)]):[3,2];case 1:f.sent(),this.ctx.restore(),n.boxShadow.slice(0).reverse().forEach(function(p){d.ctx.save();var g=k5(r.curves),A=p.inset?0:FJt,m=OJt(g,-A+(p.inset?1:-1)*p.spread.number,(p.inset?1:-1)*p.spread.number,p.spread.number*(p.inset?-2:2),p.spread.number*(p.inset?-2:2));p.inset?(d.path(g),d.ctx.clip(),d.mask(m)):(d.mask(g),d.ctx.clip(),d.path(m)),d.ctx.shadowOffsetX=p.offsetX.number+A,d.ctx.shadowOffsetY=p.offsetY.number,d.ctx.shadowColor=Ts(p.color),d.ctx.shadowBlur=p.blur.number,d.ctx.fillStyle=p.inset?Ts(p.color):"rgba(0,0,0,1)",d.ctx.fill(),d.ctx.restore()}),f.label=2;case 2:o=0,l=0,u=a,f.label=3;case 3:return l<u.length?(h=u[l],h.style!==0&&!u0(h.color)&&h.width>0?h.style!==2?[3,5]:[4,this.renderDashedDottedBorder(h.color,h.width,o,r.curves,2)]:[3,11]):[3,13];case 4:return f.sent(),[3,11];case 5:return h.style!==3?[3,7]:[4,this.renderDashedDottedBorder(h.color,h.width,o,r.curves,3)];case 6:return f.sent(),[3,11];case 7:return h.style!==4?[3,9]:[4,this.renderDoubleBorder(h.color,h.width,o,r.curves)];case 8:return f.sent(),[3,11];case 9:return[4,this.renderSolidBorder(h.color,o,r.curves)];case 10:f.sent(),f.label=11;case 11:o++,f.label=12;case 12:return l++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(r,n,i,a,s){return ll(this,void 0,void 0,function(){var o,l,u,h,d,f,p,g,A,m,v,y,_,b,S,E,S,E;return To(this,function(w){return this.ctx.save(),o=IJt(a,i),l=sFe(a,i),s===2&&(this.path(l),this.ctx.clip()),lu(l[0])?(u=l[0].start.x,h=l[0].start.y):(u=l[0].x,h=l[0].y),lu(l[1])?(d=l[1].end.x,f=l[1].end.y):(d=l[1].x,f=l[1].y),i===0||i===2?p=Math.abs(u-d):p=Math.abs(h-f),this.ctx.beginPath(),s===3?this.formatPath(o):this.formatPath(l.slice(0,2)),g=n<3?n*3:n*2,A=n<3?n*2:n,s===3&&(g=n,A=n),m=!0,p<=g*2?m=!1:p<=g*2+A?(v=p/(2*g+A),g*=v,A*=v):(y=Math.floor((p+A)/(g+A)),_=(p-y*g)/(y-1),b=(p-(y+1)*g)/y,A=b<=0||Math.abs(A-_)<Math.abs(A-b)?_:b),m&&(s===3?this.ctx.setLineDash([0,g+A]):this.ctx.setLineDash([g,A])),s===3?(this.ctx.lineCap="round",this.ctx.lineWidth=n):this.ctx.lineWidth=n*2+1.1,this.ctx.strokeStyle=Ts(r),this.ctx.stroke(),this.ctx.setLineDash([]),s===2&&(lu(l[0])&&(S=l[3],E=l[0],this.ctx.beginPath(),this.formatPath([new jt(S.end.x,S.end.y),new jt(E.start.x,E.start.y)]),this.ctx.stroke()),lu(l[1])&&(S=l[1],E=l[2],this.ctx.beginPath(),this.formatPath([new jt(S.end.x,S.end.y),new jt(E.start.x,E.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(r){return ll(this,void 0,void 0,function(){var n;return To(this,function(i){switch(i.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=Ts(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),n=CJt(r),[4,this.renderStack(n)];case 1:return i.sent(),this.applyEffects([]),[2,this.canvas]}})})},e}(cFe),QJt=function(t){return t instanceof D6e||t instanceof N6e?!0:t instanceof eJ&&t.type!==w5&&t.type!==E5},$Jt=function(t,e){switch(t){case 0:return k5(e);case 2:return SJt(e);case 1:default:return I5(e)}},GJt=function(t){switch(t){case 1:return"center";case 2:return"right";case 0:default:return"left"}},zJt=["-apple-system","system-ui"],VJt=function(t){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?t.filter(function(e){return zJt.indexOf(e)===-1}):t},HJt=function(t){th(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.canvas=n.canvas?n.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),i.options=n,i.canvas.width=Math.floor(n.width*n.scale),i.canvas.height=Math.floor(n.height*n.scale),i.canvas.style.width=n.width+"px",i.canvas.style.height=n.height+"px",i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-n.x,-n.y),i.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+n.width+"x"+n.height+" at "+n.x+","+n.y+") with scale "+n.scale),i}return e.prototype.render=function(r){return ll(this,void 0,void 0,function(){var n,i;return To(this,function(a){switch(a.label){case 0:return n=Zj(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,r),[4,qJt(n)];case 1:return i=a.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=Ts(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(i,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e}(cFe),qJt=function(t){return new Promise(function(e,r){var n=new Image;n.onload=function(){e(n)},n.onerror=r,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(t))})},YJt=function(){function t(e){var r=e.id,n=e.enabled;this.id=r,this.enabled=n,this.start=Date.now()}return t.prototype.debug=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,zL([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},t.prototype.getTime=function(){return Date.now()-this.start},t.prototype.info=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,zL([this.id,this.getTime()+"ms"],e))},t.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,zL([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},t.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,zL([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},t.instances={},t}(),WJt=function(){function t(e,r){var n;this.windowBounds=r,this.instanceName="#"+t.instanceCount++,this.logger=new YJt({id:this.instanceName,enabled:e.logging}),this.cache=(n=e.cache)!==null&&n!==void 0?n:new pJt(this,e)}return t.instanceCount=1,t}(),dJ=function(t,e){return e===void 0&&(e={}),XJt(t,e)};typeof window<"u"&&eFe.setContext(window);var XJt=function(t,e){return ll(void 0,void 0,void 0,function(){var r,n,i,a,s,o,l,u,h,d,f,p,g,A,m,v,y,_,b,S,w,E,w,O,x,R,C,I,N,T,D,M,B,F,$,z,G,V,ee,se;return To(this,function(ie){switch(ie.label){case 0:if(!t||typeof t!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(r=t.ownerDocument,!r)throw new Error("Element is not attached to a Document");if(n=r.defaultView,!n)throw new Error("Document is not attached to a Window");return i={allowTaint:(O=e.allowTaint)!==null&&O!==void 0?O:!1,imageTimeout:(x=e.imageTimeout)!==null&&x!==void 0?x:15e3,proxy:e.proxy,useCORS:(R=e.useCORS)!==null&&R!==void 0?R:!1},a=Aj({logging:(C=e.logging)!==null&&C!==void 0?C:!0,cache:e.cache},i),s={windowWidth:(I=e.windowWidth)!==null&&I!==void 0?I:n.innerWidth,windowHeight:(N=e.windowHeight)!==null&&N!==void 0?N:n.innerHeight,scrollX:(T=e.scrollX)!==null&&T!==void 0?T:n.pageXOffset,scrollY:(D=e.scrollY)!==null&&D!==void 0?D:n.pageYOffset},o=new lp(s.scrollX,s.scrollY,s.windowWidth,s.windowHeight),l=new WJt(a,o),u=(M=e.foreignObjectRendering)!==null&&M!==void 0?M:!1,h={allowTaint:(B=e.allowTaint)!==null&&B!==void 0?B:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:u,copyStyles:u},l.logger.debug("Starting document clone with size "+o.width+"x"+o.height+" scrolled to "+-o.left+","+-o.top),d=new j6e(l,t,h),f=d.clonedReferenceElement,f?[4,d.toIFrame(r,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return p=ie.sent(),g=rJ(f)||Zjt(f)?OWt(f.ownerDocument):VL(l,f),A=g.width,m=g.height,v=g.left,y=g.top,_=KJt(l,f,e.backgroundColor),b={canvas:e.canvas,backgroundColor:_,scale:($=(F=e.scale)!==null&&F!==void 0?F:n.devicePixelRatio)!==null&&$!==void 0?$:1,x:((z=e.x)!==null&&z!==void 0?z:0)+v,y:((G=e.y)!==null&&G!==void 0?G:0)+y,width:(V=e.width)!==null&&V!==void 0?V:Math.ceil(A),height:(ee=e.height)!==null&&ee!==void 0?ee:Math.ceil(m)},u?(l.logger.debug("Document cloned, using foreign object rendering"),w=new HJt(l,b),[4,w.render(f)]):[3,3];case 2:return S=ie.sent(),[3,5];case 3:return l.logger.debug("Document cloned, element located at "+v+","+y+" with size "+A+"x"+m+" using computed rendering"),l.logger.debug("Starting DOM parsing"),E=B6e(l,f),_===E.styles.backgroundColor&&(E.styles.backgroundColor=up.TRANSPARENT),l.logger.debug("Starting renderer for element at "+b.x+","+b.y+" with size "+b.width+"x"+b.height),w=new UJt(l,b),[4,w.render(E)];case 4:S=ie.sent(),ie.label=5;case 5:return(!((se=e.removeContainer)!==null&&se!==void 0)||se)&&(j6e.destroy(p)||l.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),l.logger.debug("Finished rendering"),[2,S]}})})},KJt=function(t,e,r){var n=e.ownerDocument,i=n.documentElement?l2(t,getComputedStyle(n.documentElement).backgroundColor):up.TRANSPARENT,a=n.body?l2(t,getComputedStyle(n.body).backgroundColor):up.TRANSPARENT,s=typeof r=="string"?l2(t,r):r===null?up.TRANSPARENT:4294967295;return e===n.documentElement?u0(i)?u0(a)?s:a:i:s};class ZJt{constructor(){this.imageCache=new Map,this.defaultChartHeight=189,this.defaultChartWidth=567}canvasToBlob(e){return new Promise((r,n)=>{e.toBlob(i=>{i?(i.type!=="image/png"&&console.warn("Blob type 不是 image/png:",i.type),r(i)):n(new Error("Canvas to Blob 转换失败"))},"image/png",1)})}async captureEChartsAsImage(e){try{const r=await dJ(e,{backgroundColor:"#ffffff",scale:2,logging:!1,useCORS:!0}),n=r.width,i=r.height,a=await this.canvasToBlob(r),s=await this.blobToArrayBuffer(a);return{data:new Uint8Array(s),width:n,height:i}}catch(r){return console.error("捕获 ECharts 图表失败:",r),null}}async captureMermaidAsImage(e){try{const r=e.querySelector("svg");if(!r)return console.warn("未找到 Mermaid SVG 元素"),null;const n=r.getBoundingClientRect(),i=n.width,a=n.height,s=await dJ(e,{backgroundColor:"#ffffff",scale:2,logging:!1,useCORS:!0,allowTaint:!0,foreignObjectRendering:!1}),o=await this.canvasToBlob(s),l=await this.blobToArrayBuffer(o);return{data:new Uint8Array(l),width:s.width,height:s.height,displayWidth:i,displayHeight:a}}catch(r){return console.error("捕获 Mermaid 图表失败:",r),null}}async captureMathAsImage(e){try{const r=e.getBoundingClientRect(),n=r.width,i=r.height,a=await dJ(e,{backgroundColor:"#ffffff",scale:3,logging:!1,useCORS:!0,allowTaint:!0}),s=await this.canvasToBlob(a),o=await this.blobToArrayBuffer(s);return{data:new Uint8Array(o),width:a.width,height:a.height,displayWidth:n,displayHeight:i}}catch(r){return console.error("捕获数学公式失败:",r),null}}async base64ToBlob(e){try{return await(await fetch(e)).blob()}catch(r){throw console.error("base64 转 Blob 失败:",r),r}}async blobToArrayBuffer(e){return new Promise((r,n)=>{const i=new FileReader;i.onload=()=>r(i.result),i.onerror=n,i.readAsArrayBuffer(e)})}base64ToUint8Array(e){try{const r=e.split(",")[1];if(!r)throw new Error("无效的 base64 数据");const n=atob(r),i=new Uint8Array(n.length);for(let a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return i}catch(r){throw console.error("base64 转换失败:",r),r}}validateImageData(e){return e.length<8?!1:e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71}parseMarkdown(e,r){return e.parse(r,{})}getDefaultTextStyle(){return{font:"宋体",size:20}}getDefaultSpacing(){return{before:120,after:0,line:288,lineRule:"auto"}}async convertTokensToDocx(e,r){const n=[];let i=0,a={},s=null,o=0,l=0,u=!1,h=[],d=0,f=[];for(let p=0;p<e.length;p++){const g=e[p];if(!(g.type==="fence"&&g.info.startsWith("dataset"))){if(g.type==="container_info_open"){s="info";continue}if(g.type==="container_warning_open"){s="warning";continue}if(g.type==="container_danger_open"){s="danger";continue}if(g.type==="container_success_open"){s="success";continue}if(g.type==="container_cell_open"){const A=g.info.match(/cell\s+(\d+)/);d=A?parseInt(A[1]):12,u=!0,h=[];continue}if(g.type==="container_cell_close"){if(f.push({width:d,contents:h}),f.reduce((m,v)=>m+v.width,0)>=12){const m=this.createGridTable(f);m&&n.push(m),f=[]}u=!1,h=[],d=0;continue}if(g.type==="container_info_close"||g.type==="container_warning_close"||g.type==="container_danger_close"||g.type==="container_success_close"){s=null,u||n.push(new wa({text:"",spacing:{before:100,after:100}}));continue}if(g.type==="fence"&&g.info==="echarts"){const A=r.querySelectorAll('.echarts-container[data-processed="true"]');if(A[o]){try{const m=await this.captureEChartsAsImage(A[o]);if(m&&m.data)if(this.validateImageData(m.data)){let v,y;u?(v=Math.round(d/12*567*.9),y=300):(v=567,y=378);const _=m.width/m.height;let b=v,S=Math.round(b/_);S>y&&(S=y,b=Math.round(S*_));const E=new wa({children:[new DBe({data:m.data,transformation:{width:b,height:S},type:"png",ext:"png",extension:"png"})],spacing:{before:200,after:200}});u?h.push(E):n.push(E)}else{console.warn("ECharts 图片数据无效");const v=new wa({text:"[ECharts 图表]",spacing:{before:200,after:200}});u?h.push(v):n.push(v)}}catch(m){console.error("ECharts 图表转换失败:",m);const v=new wa({text:"[ECharts 图表]",spacing:{before:200,after:200}});u?h.push(v):n.push(v)}o++}continue}if(g.type==="fence"&&g.info==="mermaid"){const A=r.querySelectorAll('.mermaid[data-processed="true"]');if(A[l]){try{await new Promise(v=>setTimeout(v,100));const m=await this.captureMermaidAsImage(A[l]);if(m&&m.data)if(this.validateImageData(m.data)){let v,y;if(u){const b=Math.round(d/12*567*.9),S=300,E=m.displayWidth/m.displayHeight;y=b,v=Math.round(y/E),v>S&&(v=S,y=Math.round(v*E))}else{v=this.defaultChartHeight;const b=m.displayWidth/m.displayHeight;y=Math.round(v*b)}const _=new wa({children:[new DBe({data:m.data,transformation:{width:y,height:v},type:"png",ext:"png",extension:"png"})],spacing:{before:200,after:200}});u?h.push(_):n.push(_)}else{console.warn("Mermaid 图片数据无效");const v=new wa({text:"[Mermaid 流程图]",spacing:{before:200,after:200}});u?h.push(v):n.push(v)}else{const v=new wa({text:"[Mermaid 流程图]",spacing:{before:200,after:200}});u?h.push(v):n.push(v)}}catch(m){console.error("Mermaid 图表转换失败:",m);const v=new wa({text:"[Mermaid 流程图]",spacing:{before:200,after:200}});u?h.push(v):n.push(v)}l++}continue}if(g.type==="heading_open"){parseInt(g.tag.substring(1));const A=e[p+1];if(A&&A.type==="inline"){const m=this.getDefaultTextStyle(),v=this.getDefaultSpacing(),y=new wa({children:[new xo({text:A.content,font:m.font,size:m.size,bold:!0})],spacing:v});u?h.push(y):n.push(y)}p+=2;continue}if(g.type==="paragraph_open"){const A=e[p+1];if(A&&A.type==="inline"){const m=this.parseInlineContent(A);if(m.length>0){const v=this.getDefaultSpacing(),y={children:m,spacing:v};if(s){const b=this.getContainerStyle(s);y.shading={fill:b.background},y.border={left:{color:b.borderColor,space:1,style:ol.SINGLE,size:24}}}const _=new wa(y);u?h.push(_):n.push(_)}}p+=2;continue}if(g.type==="bullet_list_open"||g.type==="ordered_list_open"){const A=g.type==="ordered_list_open";i++,A&&(a[i]=1);continue}if(g.type==="bullet_list_close"||g.type==="ordered_list_close"){g.type==="ordered_list_close"&&delete a[i],i--;continue}if(g.type==="list_item_open"){const A=e[p+1];if(A&&A.type==="paragraph_open"){const m=e[p+2];if(m&&m.type==="inline"){const v=this.parseInlineContent(m),y=a[i]!==void 0,_=this.getDefaultTextStyle(),b=this.getDefaultSpacing(),S=y?`${a[i]}. `:"• ",E=new wa({children:[new xo({text:S,bold:!0,font:_.font,size:_.size}),...v],spacing:b,indent:{left:720*i}});u?h.push(E):n.push(E),y&&a[i]++}p+=3}continue}if(g.type==="math_block"||g.type==="math_block_end"){const A=this.getDefaultTextStyle(),m=this.getDefaultSpacing(),v=new wa({children:[new xo({text:g.content,font:"Cambria Math",size:A.size,italics:!0})],spacing:m,alignment:Ju.CENTER});u?h.push(v):n.push(v);continue}if(g.type==="fence"&&g.info!=="echarts"&&g.info!=="mermaid"&&!g.info.startsWith("dataset")){const A=g.content.split(`
|
|
901
|
+
.`+oJ+hJt+J6e)},fJt=function(t,e){var r=t.ownerDocument;if(r){var n=r.createElement("style");n.textContent=e,t.appendChild(n)}},eFe=function(){function t(){}return t.getOrigin=function(e){var r=t._link;return r?(r.href=e,r.href=r.href,r.protocol+r.hostname+r.port):"about:blank"},t.isSameOrigin=function(e){return t.getOrigin(e)===t._origin},t.setContext=function(e){t._link=e.document.createElement("a"),t._origin=t.getOrigin(e.location.href)},t._origin="about:blank",t}(),pJt=function(){function t(e,r){this.context=e,this._options=r,this._cache={}}return t.prototype.addImage=function(e){var r=Promise.resolve();return this.has(e)||(cJ(e)||vJt(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),r},t.prototype.match=function(e){return this._cache[e]},t.prototype.loadImage=function(e){return ll(this,void 0,void 0,function(){var r,n,i,a,s=this;return To(this,function(o){switch(o.label){case 0:return r=eFe.isSameOrigin(e),n=!lJ(e)&&this._options.useCORS===!0&&qs.SUPPORT_CORS_IMAGES&&!r,i=!lJ(e)&&!r&&!cJ(e)&&typeof this._options.proxy=="string"&&qs.SUPPORT_CORS_XHR&&!n,!r&&this._options.allowTaint===!1&&!lJ(e)&&!cJ(e)&&!i&&!n?[2]:(a=e,i?[4,this.proxy(a)]:[3,2]);case 1:a=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(l,u){var h=new Image;h.onload=function(){return l(h)},h.onerror=u,(yJt(a)||n)&&(h.crossOrigin="anonymous"),h.src=a,h.complete===!0&&setTimeout(function(){return l(h)},500),s._options.imageTimeout>0&&setTimeout(function(){return u("Timed out ("+s._options.imageTimeout+"ms) loading image")},s._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},t.prototype.has=function(e){return typeof this._cache[e]<"u"},t.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},t.prototype.proxy=function(e){var r=this,n=this._options.proxy;if(!n)throw new Error("No proxy defined");var i=e.substring(0,256);return new Promise(function(a,s){var o=qs.SUPPORT_RESPONSE_TYPE?"blob":"text",l=new XMLHttpRequest;l.onload=function(){if(l.status===200)if(o==="text")a(l.response);else{var d=new FileReader;d.addEventListener("load",function(){return a(d.result)},!1),d.addEventListener("error",function(f){return s(f)},!1),d.readAsDataURL(l.response)}else s("Failed to proxy resource "+i+" with status code "+l.status)},l.onerror=s;var u=n.indexOf("?")>-1?"&":"?";if(l.open("GET",""+n+u+"url="+encodeURIComponent(e)+"&responseType="+o),o!=="text"&&l instanceof XMLHttpRequest&&(l.responseType=o),r._options.imageTimeout){var h=r._options.imageTimeout;l.timeout=h,l.ontimeout=function(){return s("Timed out ("+h+"ms) proxying "+i)}}l.send()})},t}(),gJt=/^data:image\/svg\+xml/i,AJt=/^data:image\/.*;base64,/i,mJt=/^data:image\/.*/i,vJt=function(t){return qs.SUPPORT_SVG_DRAWING||!_Jt(t)},lJ=function(t){return mJt.test(t)},yJt=function(t){return AJt.test(t)},cJ=function(t){return t.substr(0,4)==="blob"},_Jt=function(t){return t.substr(-3).toLowerCase()==="svg"||gJt.test(t)},jt=function(){function t(e,r){this.type=0,this.x=e,this.y=r}return t.prototype.add=function(e,r){return new t(this.x+e,this.y+r)},t}(),gb=function(t,e,r){return new jt(t.x+(e.x-t.x)*r,t.y+(e.y-t.y)*r)},R5=function(){function t(e,r,n,i){this.type=1,this.start=e,this.startControl=r,this.endControl=n,this.end=i}return t.prototype.subdivide=function(e,r){var n=gb(this.start,this.startControl,e),i=gb(this.startControl,this.endControl,e),a=gb(this.endControl,this.end,e),s=gb(n,i,e),o=gb(i,a,e),l=gb(s,o,e);return r?new t(this.start,n,s,l):new t(l,o,a,this.end)},t.prototype.add=function(e,r){return new t(this.start.add(e,r),this.startControl.add(e,r),this.endControl.add(e,r),this.end.add(e,r))},t.prototype.reverse=function(){return new t(this.end,this.endControl,this.startControl,this.start)},t}(),lu=function(t){return t.type===1},bJt=function(){function t(e){var r=e.styles,n=e.bounds,i=o2(r.borderTopLeftRadius,n.width,n.height),a=i[0],s=i[1],o=o2(r.borderTopRightRadius,n.width,n.height),l=o[0],u=o[1],h=o2(r.borderBottomRightRadius,n.width,n.height),d=h[0],f=h[1],p=o2(r.borderBottomLeftRadius,n.width,n.height),g=p[0],A=p[1],m=[];m.push((a+l)/n.width),m.push((g+d)/n.width),m.push((s+A)/n.height),m.push((u+f)/n.height);var v=Math.max.apply(Math,m);v>1&&(a/=v,s/=v,l/=v,u/=v,d/=v,f/=v,g/=v,A/=v);var y=n.width-l,_=n.height-f,b=n.width-d,S=n.height-A,E=r.borderTopWidth,w=r.borderRightWidth,O=r.borderBottomWidth,x=r.borderLeftWidth,R=Ei(r.paddingTop,e.bounds.width),C=Ei(r.paddingRight,e.bounds.width),I=Ei(r.paddingBottom,e.bounds.width),N=Ei(r.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=a>0||s>0?Ui(n.left+x/3,n.top+E/3,a-x/3,s-E/3,Wn.TOP_LEFT):new jt(n.left+x/3,n.top+E/3),this.topRightBorderDoubleOuterBox=a>0||s>0?Ui(n.left+y,n.top+E/3,l-w/3,u-E/3,Wn.TOP_RIGHT):new jt(n.left+n.width-w/3,n.top+E/3),this.bottomRightBorderDoubleOuterBox=d>0||f>0?Ui(n.left+b,n.top+_,d-w/3,f-O/3,Wn.BOTTOM_RIGHT):new jt(n.left+n.width-w/3,n.top+n.height-O/3),this.bottomLeftBorderDoubleOuterBox=g>0||A>0?Ui(n.left+x/3,n.top+S,g-x/3,A-O/3,Wn.BOTTOM_LEFT):new jt(n.left+x/3,n.top+n.height-O/3),this.topLeftBorderDoubleInnerBox=a>0||s>0?Ui(n.left+x*2/3,n.top+E*2/3,a-x*2/3,s-E*2/3,Wn.TOP_LEFT):new jt(n.left+x*2/3,n.top+E*2/3),this.topRightBorderDoubleInnerBox=a>0||s>0?Ui(n.left+y,n.top+E*2/3,l-w*2/3,u-E*2/3,Wn.TOP_RIGHT):new jt(n.left+n.width-w*2/3,n.top+E*2/3),this.bottomRightBorderDoubleInnerBox=d>0||f>0?Ui(n.left+b,n.top+_,d-w*2/3,f-O*2/3,Wn.BOTTOM_RIGHT):new jt(n.left+n.width-w*2/3,n.top+n.height-O*2/3),this.bottomLeftBorderDoubleInnerBox=g>0||A>0?Ui(n.left+x*2/3,n.top+S,g-x*2/3,A-O*2/3,Wn.BOTTOM_LEFT):new jt(n.left+x*2/3,n.top+n.height-O*2/3),this.topLeftBorderStroke=a>0||s>0?Ui(n.left+x/2,n.top+E/2,a-x/2,s-E/2,Wn.TOP_LEFT):new jt(n.left+x/2,n.top+E/2),this.topRightBorderStroke=a>0||s>0?Ui(n.left+y,n.top+E/2,l-w/2,u-E/2,Wn.TOP_RIGHT):new jt(n.left+n.width-w/2,n.top+E/2),this.bottomRightBorderStroke=d>0||f>0?Ui(n.left+b,n.top+_,d-w/2,f-O/2,Wn.BOTTOM_RIGHT):new jt(n.left+n.width-w/2,n.top+n.height-O/2),this.bottomLeftBorderStroke=g>0||A>0?Ui(n.left+x/2,n.top+S,g-x/2,A-O/2,Wn.BOTTOM_LEFT):new jt(n.left+x/2,n.top+n.height-O/2),this.topLeftBorderBox=a>0||s>0?Ui(n.left,n.top,a,s,Wn.TOP_LEFT):new jt(n.left,n.top),this.topRightBorderBox=l>0||u>0?Ui(n.left+y,n.top,l,u,Wn.TOP_RIGHT):new jt(n.left+n.width,n.top),this.bottomRightBorderBox=d>0||f>0?Ui(n.left+b,n.top+_,d,f,Wn.BOTTOM_RIGHT):new jt(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=g>0||A>0?Ui(n.left,n.top+S,g,A,Wn.BOTTOM_LEFT):new jt(n.left,n.top+n.height),this.topLeftPaddingBox=a>0||s>0?Ui(n.left+x,n.top+E,Math.max(0,a-x),Math.max(0,s-E),Wn.TOP_LEFT):new jt(n.left+x,n.top+E),this.topRightPaddingBox=l>0||u>0?Ui(n.left+Math.min(y,n.width-w),n.top+E,y>n.width+w?0:Math.max(0,l-w),Math.max(0,u-E),Wn.TOP_RIGHT):new jt(n.left+n.width-w,n.top+E),this.bottomRightPaddingBox=d>0||f>0?Ui(n.left+Math.min(b,n.width-x),n.top+Math.min(_,n.height-O),Math.max(0,d-w),Math.max(0,f-O),Wn.BOTTOM_RIGHT):new jt(n.left+n.width-w,n.top+n.height-O),this.bottomLeftPaddingBox=g>0||A>0?Ui(n.left+x,n.top+Math.min(S,n.height-O),Math.max(0,g-x),Math.max(0,A-O),Wn.BOTTOM_LEFT):new jt(n.left+x,n.top+n.height-O),this.topLeftContentBox=a>0||s>0?Ui(n.left+x+N,n.top+E+R,Math.max(0,a-(x+N)),Math.max(0,s-(E+R)),Wn.TOP_LEFT):new jt(n.left+x+N,n.top+E+R),this.topRightContentBox=l>0||u>0?Ui(n.left+Math.min(y,n.width+x+N),n.top+E+R,y>n.width+x+N?0:l-x+N,u-(E+R),Wn.TOP_RIGHT):new jt(n.left+n.width-(w+C),n.top+E+R),this.bottomRightContentBox=d>0||f>0?Ui(n.left+Math.min(b,n.width-(x+N)),n.top+Math.min(_,n.height+E+R),Math.max(0,d-(w+C)),f-(O+I),Wn.BOTTOM_RIGHT):new jt(n.left+n.width-(w+C),n.top+n.height-(O+I)),this.bottomLeftContentBox=g>0||A>0?Ui(n.left+x+N,n.top+S,Math.max(0,g-(x+N)),A-(O+I),Wn.BOTTOM_LEFT):new jt(n.left+x+N,n.top+n.height-(O+I))}return t}(),Wn;(function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=1]="TOP_RIGHT",t[t.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",t[t.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(Wn||(Wn={}));var Ui=function(t,e,r,n,i){var a=4*((Math.sqrt(2)-1)/3),s=r*a,o=n*a,l=t+r,u=e+n;switch(i){case Wn.TOP_LEFT:return new R5(new jt(t,u),new jt(t,u-o),new jt(l-s,e),new jt(l,e));case Wn.TOP_RIGHT:return new R5(new jt(t,e),new jt(t+s,e),new jt(l,u-o),new jt(l,u));case Wn.BOTTOM_RIGHT:return new R5(new jt(l,e),new jt(l,e+o),new jt(t+s,u),new jt(t,u));case Wn.BOTTOM_LEFT:default:return new R5(new jt(l,u),new jt(l-s,u),new jt(t,e+o),new jt(t,e))}},k5=function(t){return[t.topLeftBorderBox,t.topRightBorderBox,t.bottomRightBorderBox,t.bottomLeftBorderBox]},SJt=function(t){return[t.topLeftContentBox,t.topRightContentBox,t.bottomRightContentBox,t.bottomLeftContentBox]},I5=function(t){return[t.topLeftPaddingBox,t.topRightPaddingBox,t.bottomRightPaddingBox,t.bottomLeftPaddingBox]},EJt=function(){function t(e,r,n){this.offsetX=e,this.offsetY=r,this.matrix=n,this.type=0,this.target=6}return t}(),N5=function(){function t(e,r){this.path=e,this.target=r,this.type=1}return t}(),wJt=function(){function t(e){this.opacity=e,this.type=2,this.target=6}return t}(),xJt=function(t){return t.type===0},tFe=function(t){return t.type===1},TJt=function(t){return t.type===2},rFe=function(t,e){return t.length===e.length?t.some(function(r,n){return r===e[n]}):!1},OJt=function(t,e,r,n,i){return t.map(function(a,s){switch(s){case 0:return a.add(e,r);case 1:return a.add(e+n,r);case 2:return a.add(e+n,r+i);case 3:return a.add(e,r+i)}return a})},nFe=function(){function t(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return t}(),iFe=function(){function t(e,r){if(this.container=e,this.parent=r,this.effects=[],this.curves=new bJt(this.container),this.container.styles.opacity<1&&this.effects.push(new wJt(this.container.styles.opacity)),this.container.styles.transform!==null){var n=this.container.bounds.left+this.container.styles.transformOrigin[0].number,i=this.container.bounds.top+this.container.styles.transformOrigin[1].number,a=this.container.styles.transform;this.effects.push(new EJt(n,i,a))}if(this.container.styles.overflowX!==0){var s=k5(this.curves),o=I5(this.curves);rFe(s,o)?this.effects.push(new N5(s,6)):(this.effects.push(new N5(s,2)),this.effects.push(new N5(o,4)))}}return t.prototype.getEffects=function(e){for(var r=[2,3].indexOf(this.container.styles.position)===-1,n=this.parent,i=this.effects.slice(0);n;){var a=n.effects.filter(function(l){return!tFe(l)});if(r||n.container.styles.position!==0||!n.parent){if(i.unshift.apply(i,a),r=[2,3].indexOf(n.container.styles.position)===-1,n.container.styles.overflowX!==0){var s=k5(n.curves),o=I5(n.curves);rFe(s,o)||i.unshift(new N5(o,6))}}else i.unshift.apply(i,a);n=n.parent}return i.filter(function(l){return ns(l.target,e)})},t}(),uJ=function(t,e,r,n){t.container.elements.forEach(function(i){var a=ns(i.flags,4),s=ns(i.flags,2),o=new iFe(i,t);ns(i.styles.display,2048)&&n.push(o);var l=ns(i.flags,8)?[]:n;if(a||s){var u=a||i.styles.isPositioned()?r:e,h=new nFe(o);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var d=i.styles.zIndex.order;if(d<0){var f=0;u.negativeZIndex.some(function(g,A){return d>g.element.container.styles.zIndex.order?(f=A,!1):f>0}),u.negativeZIndex.splice(f,0,h)}else if(d>0){var p=0;u.positiveZIndex.some(function(g,A){return d>=g.element.container.styles.zIndex.order?(p=A+1,!1):p>0}),u.positiveZIndex.splice(p,0,h)}else u.zeroOrAutoZIndexOrTransformedOrOpacity.push(h)}else i.styles.isFloating()?u.nonPositionedFloats.push(h):u.nonPositionedInlineLevel.push(h);uJ(o,h,a?h:r,l)}else i.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),uJ(o,e,r,l);ns(i.flags,8)&&aFe(i,l)})},aFe=function(t,e){for(var r=t instanceof Jj?t.start:1,n=t instanceof Jj?t.reversed:!1,i=0;i<e.length;i++){var a=e[i];a.container instanceof k6e&&typeof a.container.value=="number"&&a.container.value!==0&&(r=a.container.value),a.listValue=f2(r,a.container.styles.listStyleType,!0),r+=n?-1:1}},CJt=function(t){var e=new iFe(t,null),r=new nFe(e),n=[];return uJ(e,r,r,n),aFe(e.container,n),r},sFe=function(t,e){switch(e){case 0:return cu(t.topLeftBorderBox,t.topLeftPaddingBox,t.topRightBorderBox,t.topRightPaddingBox);case 1:return cu(t.topRightBorderBox,t.topRightPaddingBox,t.bottomRightBorderBox,t.bottomRightPaddingBox);case 2:return cu(t.bottomRightBorderBox,t.bottomRightPaddingBox,t.bottomLeftBorderBox,t.bottomLeftPaddingBox);case 3:default:return cu(t.bottomLeftBorderBox,t.bottomLeftPaddingBox,t.topLeftBorderBox,t.topLeftPaddingBox)}},RJt=function(t,e){switch(e){case 0:return cu(t.topLeftBorderBox,t.topLeftBorderDoubleOuterBox,t.topRightBorderBox,t.topRightBorderDoubleOuterBox);case 1:return cu(t.topRightBorderBox,t.topRightBorderDoubleOuterBox,t.bottomRightBorderBox,t.bottomRightBorderDoubleOuterBox);case 2:return cu(t.bottomRightBorderBox,t.bottomRightBorderDoubleOuterBox,t.bottomLeftBorderBox,t.bottomLeftBorderDoubleOuterBox);case 3:default:return cu(t.bottomLeftBorderBox,t.bottomLeftBorderDoubleOuterBox,t.topLeftBorderBox,t.topLeftBorderDoubleOuterBox)}},kJt=function(t,e){switch(e){case 0:return cu(t.topLeftBorderDoubleInnerBox,t.topLeftPaddingBox,t.topRightBorderDoubleInnerBox,t.topRightPaddingBox);case 1:return cu(t.topRightBorderDoubleInnerBox,t.topRightPaddingBox,t.bottomRightBorderDoubleInnerBox,t.bottomRightPaddingBox);case 2:return cu(t.bottomRightBorderDoubleInnerBox,t.bottomRightPaddingBox,t.bottomLeftBorderDoubleInnerBox,t.bottomLeftPaddingBox);case 3:default:return cu(t.bottomLeftBorderDoubleInnerBox,t.bottomLeftPaddingBox,t.topLeftBorderDoubleInnerBox,t.topLeftPaddingBox)}},IJt=function(t,e){switch(e){case 0:return D5(t.topLeftBorderStroke,t.topRightBorderStroke);case 1:return D5(t.topRightBorderStroke,t.bottomRightBorderStroke);case 2:return D5(t.bottomRightBorderStroke,t.bottomLeftBorderStroke);case 3:default:return D5(t.bottomLeftBorderStroke,t.topLeftBorderStroke)}},D5=function(t,e){var r=[];return lu(t)?r.push(t.subdivide(.5,!1)):r.push(t),lu(e)?r.push(e.subdivide(.5,!0)):r.push(e),r},cu=function(t,e,r,n){var i=[];return lu(t)?i.push(t.subdivide(.5,!1)):i.push(t),lu(r)?i.push(r.subdivide(.5,!0)):i.push(r),lu(n)?i.push(n.subdivide(.5,!0).reverse()):i.push(n),lu(e)?i.push(e.subdivide(.5,!1).reverse()):i.push(e),i},oFe=function(t){var e=t.bounds,r=t.styles;return e.add(r.borderLeftWidth,r.borderTopWidth,-(r.borderRightWidth+r.borderLeftWidth),-(r.borderTopWidth+r.borderBottomWidth))},L5=function(t){var e=t.styles,r=t.bounds,n=Ei(e.paddingLeft,r.width),i=Ei(e.paddingRight,r.width),a=Ei(e.paddingTop,r.width),s=Ei(e.paddingBottom,r.width);return r.add(n+e.borderLeftWidth,a+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+n+i),-(e.borderTopWidth+e.borderBottomWidth+a+s))},NJt=function(t,e){return t===0?e.bounds:t===2?L5(e):oFe(e)},DJt=function(t,e){return t===0?e.bounds:t===2?L5(e):oFe(e)},hJ=function(t,e,r){var n=NJt(mb(t.styles.backgroundOrigin,e),t),i=DJt(mb(t.styles.backgroundClip,e),t),a=LJt(mb(t.styles.backgroundSize,e),r,n),s=a[0],o=a[1],l=o2(mb(t.styles.backgroundPosition,e),n.width-s,n.height-o),u=MJt(mb(t.styles.backgroundRepeat,e),l,a,n,i),h=Math.round(n.left+l[0]),d=Math.round(n.top+l[1]);return[u,h,d,s,o]},Ab=function(t){return di(t)&&t.value===hb.AUTO},M5=function(t){return typeof t=="number"},LJt=function(t,e,r){var n=e[0],i=e[1],a=e[2],s=t[0],o=t[1];if(!s)return[0,0];if(Fa(s)&&o&&Fa(o))return[Ei(s,r.width),Ei(o,r.height)];var l=M5(a);if(di(s)&&(s.value===hb.CONTAIN||s.value===hb.COVER)){if(M5(a)){var u=r.width/r.height;return u<a!=(s.value===hb.COVER)?[r.width,r.width/a]:[r.height*a,r.height]}return[r.width,r.height]}var h=M5(n),d=M5(i),f=h||d;if(Ab(s)&&(!o||Ab(o))){if(h&&d)return[n,i];if(!l&&!f)return[r.width,r.height];if(f&&l){var p=h?n:i*a,g=d?i:n/a;return[p,g]}var A=h?n:r.width,m=d?i:r.height;return[A,m]}if(l){var v=0,y=0;return Fa(s)?v=Ei(s,r.width):Fa(o)&&(y=Ei(o,r.height)),Ab(s)?v=y*a:(!o||Ab(o))&&(y=v/a),[v,y]}var _=null,b=null;if(Fa(s)?_=Ei(s,r.width):o&&Fa(o)&&(b=Ei(o,r.height)),_!==null&&(!o||Ab(o))&&(b=h&&d?_/n*i:r.height),b!==null&&Ab(s)&&(_=h&&d?b/i*n:r.width),_!==null&&b!==null)return[_,b];throw new Error("Unable to calculate background-size for element")},mb=function(t,e){var r=t[e];return typeof r>"u"?t[0]:r},MJt=function(t,e,r,n,i){var a=e[0],s=e[1],o=r[0],l=r[1];switch(t){case 2:return[new jt(Math.round(n.left),Math.round(n.top+s)),new jt(Math.round(n.left+n.width),Math.round(n.top+s)),new jt(Math.round(n.left+n.width),Math.round(l+n.top+s)),new jt(Math.round(n.left),Math.round(l+n.top+s))];case 3:return[new jt(Math.round(n.left+a),Math.round(n.top)),new jt(Math.round(n.left+a+o),Math.round(n.top)),new jt(Math.round(n.left+a+o),Math.round(n.height+n.top)),new jt(Math.round(n.left+a),Math.round(n.height+n.top))];case 1:return[new jt(Math.round(n.left+a),Math.round(n.top+s)),new jt(Math.round(n.left+a+o),Math.round(n.top+s)),new jt(Math.round(n.left+a+o),Math.round(n.top+s+l)),new jt(Math.round(n.left+a),Math.round(n.top+s+l))];default:return[new jt(Math.round(i.left),Math.round(i.top)),new jt(Math.round(i.left+i.width),Math.round(i.top)),new jt(Math.round(i.left+i.width),Math.round(i.height+i.top)),new jt(Math.round(i.left),Math.round(i.height+i.top))]}},BJt="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",lFe="Hidden Text",PJt=function(){function t(e){this._data={},this._document=e}return t.prototype.parseMetrics=function(e,r){var n=this._document.createElement("div"),i=this._document.createElement("img"),a=this._document.createElement("span"),s=this._document.body;n.style.visibility="hidden",n.style.fontFamily=e,n.style.fontSize=r,n.style.margin="0",n.style.padding="0",n.style.whiteSpace="nowrap",s.appendChild(n),i.src=BJt,i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",a.style.fontFamily=e,a.style.fontSize=r,a.style.margin="0",a.style.padding="0",a.appendChild(this._document.createTextNode(lFe)),n.appendChild(a),n.appendChild(i);var o=i.offsetTop-a.offsetTop+2;n.removeChild(a),n.appendChild(this._document.createTextNode(lFe)),n.style.lineHeight="normal",i.style.verticalAlign="super";var l=i.offsetTop-n.offsetTop+2;return s.removeChild(n),{baseline:o,middle:l}},t.prototype.getMetrics=function(e,r){var n=e+" "+r;return typeof this._data[n]>"u"&&(this._data[n]=this.parseMetrics(e,r)),this._data[n]},t}(),cFe=function(){function t(e,r){this.context=e,this.options=r}return t}(),FJt=1e4,UJt=function(t){th(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i._activeEffects=[],i.canvas=n.canvas?n.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),n.canvas||(i.canvas.width=Math.floor(n.width*n.scale),i.canvas.height=Math.floor(n.height*n.scale),i.canvas.style.width=n.width+"px",i.canvas.style.height=n.height+"px"),i.fontMetrics=new PJt(document),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-n.x,-n.y),i.ctx.textBaseline="bottom",i._activeEffects=[],i.context.logger.debug("Canvas renderer initialized ("+n.width+"x"+n.height+") with scale "+n.scale),i}return e.prototype.applyEffects=function(r){for(var n=this;this._activeEffects.length;)this.popEffect();r.forEach(function(i){return n.applyEffect(i)})},e.prototype.applyEffect=function(r){this.ctx.save(),TJt(r)&&(this.ctx.globalAlpha=r.opacity),xJt(r)&&(this.ctx.translate(r.offsetX,r.offsetY),this.ctx.transform(r.matrix[0],r.matrix[1],r.matrix[2],r.matrix[3],r.matrix[4],r.matrix[5]),this.ctx.translate(-r.offsetX,-r.offsetY)),tFe(r)&&(this.path(r.path),this.ctx.clip()),this._activeEffects.push(r)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(r){return ll(this,void 0,void 0,function(){var n;return To(this,function(i){switch(i.label){case 0:return n=r.element.container.styles,n.isVisible()?[4,this.renderStackContent(r)]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(r){return ll(this,void 0,void 0,function(){return To(this,function(n){switch(n.label){case 0:if(ns(r.container.flags,16))debugger;return r.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(r)]:[3,3];case 1:return n.sent(),[4,this.renderNodeContent(r)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(r,n,i){var a=this;if(n===0)this.ctx.fillText(r.text,r.bounds.left,r.bounds.top+i);else{var s=jj(r.text);s.reduce(function(o,l){return a.ctx.fillText(l,o,r.bounds.top+i),o+a.ctx.measureText(l).width},r.bounds.left)}},e.prototype.createFontStyle=function(r){var n=r.fontVariant.filter(function(s){return s==="normal"||s==="small-caps"}).join(""),i=VJt(r.fontFamily).join(", "),a=s2(r.fontSize)?""+r.fontSize.number+r.fontSize.unit:r.fontSize.number+"px";return[[r.fontStyle,n,r.fontWeight,a,i].join(" "),i,a]},e.prototype.renderTextNode=function(r,n){return ll(this,void 0,void 0,function(){var i,a,s,o,l,u,h,d,f=this;return To(this,function(p){return i=this.createFontStyle(n),a=i[0],s=i[1],o=i[2],this.ctx.font=a,this.ctx.direction=n.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",l=this.fontMetrics.getMetrics(s,o),u=l.baseline,h=l.middle,d=n.paintOrder,r.textBounds.forEach(function(g){d.forEach(function(A){switch(A){case 0:f.ctx.fillStyle=Ts(n.color),f.renderTextWithLetterSpacing(g,n.letterSpacing,u);var m=n.textShadow;m.length&&g.text.trim().length&&(m.slice(0).reverse().forEach(function(v){f.ctx.shadowColor=Ts(v.color),f.ctx.shadowOffsetX=v.offsetX.number*f.options.scale,f.ctx.shadowOffsetY=v.offsetY.number*f.options.scale,f.ctx.shadowBlur=v.blur.number,f.renderTextWithLetterSpacing(g,n.letterSpacing,u)}),f.ctx.shadowColor="",f.ctx.shadowOffsetX=0,f.ctx.shadowOffsetY=0,f.ctx.shadowBlur=0),n.textDecorationLine.length&&(f.ctx.fillStyle=Ts(n.textDecorationColor||n.color),n.textDecorationLine.forEach(function(v){switch(v){case 1:f.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top+u),g.bounds.width,1);break;case 2:f.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top),g.bounds.width,1);break;case 3:f.ctx.fillRect(g.bounds.left,Math.ceil(g.bounds.top+h),g.bounds.width,1);break}}));break;case 1:n.webkitTextStrokeWidth&&g.text.trim().length&&(f.ctx.strokeStyle=Ts(n.webkitTextStrokeColor),f.ctx.lineWidth=n.webkitTextStrokeWidth,f.ctx.lineJoin=window.chrome?"miter":"round",f.ctx.strokeText(g.text,g.bounds.left,g.bounds.top+u)),f.ctx.strokeStyle="",f.ctx.lineWidth=0,f.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(r,n,i){if(i&&r.intrinsicWidth>0&&r.intrinsicHeight>0){var a=L5(r),s=I5(n);this.path(s),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(i,0,0,r.intrinsicWidth,r.intrinsicHeight,a.left,a.top,a.width,a.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(r){return ll(this,void 0,void 0,function(){var n,i,a,s,o,l,y,y,u,h,d,f,b,p,g,S,A,m,v,y,_,b,S;return To(this,function(E){switch(E.label){case 0:this.applyEffects(r.getEffects(4)),n=r.container,i=r.curves,a=n.styles,s=0,o=n.textNodes,E.label=1;case 1:return s<o.length?(l=o[s],[4,this.renderTextNode(l,a)]):[3,4];case 2:E.sent(),E.label=3;case 3:return s++,[3,1];case 4:if(!(n instanceof O6e))return[3,8];E.label=5;case 5:return E.trys.push([5,7,,8]),[4,this.context.cache.match(n.src)];case 6:return y=E.sent(),this.renderReplacedElement(n,i,y),[3,8];case 7:return E.sent(),this.context.logger.error("Error loading image "+n.src),[3,8];case 8:if(n instanceof C6e&&this.renderReplacedElement(n,i,n.canvas),!(n instanceof R6e))return[3,12];E.label=9;case 9:return E.trys.push([9,11,,12]),[4,this.context.cache.match(n.svg)];case 10:return y=E.sent(),this.renderReplacedElement(n,i,y),[3,12];case 11:return E.sent(),this.context.logger.error("Error loading svg "+n.svg.substring(0,255)),[3,12];case 12:return n instanceof L6e&&n.tree?(u=new e(this.context,{scale:this.options.scale,backgroundColor:n.backgroundColor,x:0,y:0,width:n.width,height:n.height}),[4,u.render(n.tree)]):[3,14];case 13:h=E.sent(),n.width&&n.height&&this.ctx.drawImage(h,0,0,n.width,n.height,n.bounds.left,n.bounds.top,n.bounds.width,n.bounds.height),E.label=14;case 14:if(n instanceof eJ&&(d=Math.min(n.bounds.width,n.bounds.height),n.type===E5?n.checked&&(this.ctx.save(),this.path([new jt(n.bounds.left+d*.39363,n.bounds.top+d*.79),new jt(n.bounds.left+d*.16,n.bounds.top+d*.5549),new jt(n.bounds.left+d*.27347,n.bounds.top+d*.44071),new jt(n.bounds.left+d*.39694,n.bounds.top+d*.5649),new jt(n.bounds.left+d*.72983,n.bounds.top+d*.23),new jt(n.bounds.left+d*.84,n.bounds.top+d*.34085),new jt(n.bounds.left+d*.39363,n.bounds.top+d*.79)]),this.ctx.fillStyle=Ts(I6e),this.ctx.fill(),this.ctx.restore()):n.type===w5&&n.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.bounds.left+d/2,n.bounds.top+d/2,d/4,0,Math.PI*2,!0),this.ctx.fillStyle=Ts(I6e),this.ctx.fill(),this.ctx.restore())),QJt(n)&&n.value.length){switch(f=this.createFontStyle(a),b=f[0],p=f[1],g=this.fontMetrics.getMetrics(b,p).baseline,this.ctx.font=b,this.ctx.fillStyle=Ts(a.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=GJt(n.styles.textAlign),S=L5(n),A=0,n.styles.textAlign){case 1:A+=S.width/2;break;case 2:A+=S.width;break}m=S.add(A,0,0,-S.height/2+1),this.ctx.save(),this.path([new jt(S.left,S.top),new jt(S.left+S.width,S.top),new jt(S.left+S.width,S.top+S.height),new jt(S.left,S.top+S.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new h2(n.value,m),a.letterSpacing,g),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!ns(n.styles.display,2048))return[3,20];if(n.styles.listStyleImage===null)return[3,19];if(v=n.styles.listStyleImage,v.type!==0)return[3,18];y=void 0,_=v.url,E.label=15;case 15:return E.trys.push([15,17,,18]),[4,this.context.cache.match(_)];case 16:return y=E.sent(),this.ctx.drawImage(y,n.bounds.left-(y.width+10),n.bounds.top),[3,18];case 17:return E.sent(),this.context.logger.error("Error loading list-style-image "+_),[3,18];case 18:return[3,20];case 19:r.listValue&&n.styles.listStyleType!==-1&&(b=this.createFontStyle(a)[0],this.ctx.font=b,this.ctx.fillStyle=Ts(a.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",S=new lp(n.bounds.left,n.bounds.top+Ei(n.styles.paddingTop,n.bounds.width),n.bounds.width,l6e(a.lineHeight,a.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new h2(r.listValue,S),a.letterSpacing,l6e(a.lineHeight,a.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),E.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(r){return ll(this,void 0,void 0,function(){var n,i,v,a,s,v,o,l,v,u,h,v,d,f,v,p,g,v,A,m,v;return To(this,function(y){switch(y.label){case 0:if(ns(r.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(r.element)];case 1:y.sent(),n=0,i=r.negativeZIndex,y.label=2;case 2:return n<i.length?(v=i[n],[4,this.renderStack(v)]):[3,5];case 3:y.sent(),y.label=4;case 4:return n++,[3,2];case 5:return[4,this.renderNodeContent(r.element)];case 6:y.sent(),a=0,s=r.nonInlineLevel,y.label=7;case 7:return a<s.length?(v=s[a],[4,this.renderNode(v)]):[3,10];case 8:y.sent(),y.label=9;case 9:return a++,[3,7];case 10:o=0,l=r.nonPositionedFloats,y.label=11;case 11:return o<l.length?(v=l[o],[4,this.renderStack(v)]):[3,14];case 12:y.sent(),y.label=13;case 13:return o++,[3,11];case 14:u=0,h=r.nonPositionedInlineLevel,y.label=15;case 15:return u<h.length?(v=h[u],[4,this.renderStack(v)]):[3,18];case 16:y.sent(),y.label=17;case 17:return u++,[3,15];case 18:d=0,f=r.inlineLevel,y.label=19;case 19:return d<f.length?(v=f[d],[4,this.renderNode(v)]):[3,22];case 20:y.sent(),y.label=21;case 21:return d++,[3,19];case 22:p=0,g=r.zeroOrAutoZIndexOrTransformedOrOpacity,y.label=23;case 23:return p<g.length?(v=g[p],[4,this.renderStack(v)]):[3,26];case 24:y.sent(),y.label=25;case 25:return p++,[3,23];case 26:A=0,m=r.positiveZIndex,y.label=27;case 27:return A<m.length?(v=m[A],[4,this.renderStack(v)]):[3,30];case 28:y.sent(),y.label=29;case 29:return A++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(r){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(r.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(r){this.ctx.beginPath(),this.formatPath(r),this.ctx.closePath()},e.prototype.formatPath=function(r){var n=this;r.forEach(function(i,a){var s=lu(i)?i.start:i;a===0?n.ctx.moveTo(s.x,s.y):n.ctx.lineTo(s.x,s.y),lu(i)&&n.ctx.bezierCurveTo(i.startControl.x,i.startControl.y,i.endControl.x,i.endControl.y,i.end.x,i.end.y)})},e.prototype.renderRepeat=function(r,n,i,a){this.path(r),this.ctx.fillStyle=n,this.ctx.translate(i,a),this.ctx.fill(),this.ctx.translate(-i,-a)},e.prototype.resizeImage=function(r,n,i){var a;if(r.width===n&&r.height===i)return r;var s=(a=this.canvas.ownerDocument)!==null&&a!==void 0?a:document,o=s.createElement("canvas");o.width=Math.max(1,n),o.height=Math.max(1,i);var l=o.getContext("2d");return l.drawImage(r,0,0,r.width,r.height,0,0,n,i),o},e.prototype.renderBackgroundImage=function(r){return ll(this,void 0,void 0,function(){var n,i,a,s,o,l;return To(this,function(u){switch(u.label){case 0:n=r.styles.backgroundImage.length-1,i=function(h){var d,f,p,R,M,B,N,T,O,g,R,M,B,N,T,A,m,v,y,_,b,S,E,w,O,x,R,C,I,N,T,D,M,B,F,$,z,G,V,ee,se,ie;return To(this,function(le){switch(le.label){case 0:if(h.type!==0)return[3,5];d=void 0,f=h.url,le.label=1;case 1:return le.trys.push([1,3,,4]),[4,a.context.cache.match(f)];case 2:return d=le.sent(),[3,4];case 3:return le.sent(),a.context.logger.error("Error loading background-image "+f),[3,4];case 4:return d&&(p=hJ(r,n,[d.width,d.height,d.width/d.height]),R=p[0],M=p[1],B=p[2],N=p[3],T=p[4],O=a.ctx.createPattern(a.resizeImage(d,N,T),"repeat"),a.renderRepeat(R,O,M,B)),[3,6];case 5:xKt(h)?(g=hJ(r,n,[null,null,null]),R=g[0],M=g[1],B=g[2],N=g[3],T=g[4],A=_Kt(h.angle,N,T),m=A[0],v=A[1],y=A[2],_=A[3],b=A[4],S=document.createElement("canvas"),S.width=N,S.height=T,E=S.getContext("2d"),w=E.createLinearGradient(v,_,y,b),ZPe(h.stops,m).forEach(function(Y){return w.addColorStop(Y.stop,Ts(Y.color))}),E.fillStyle=w,E.fillRect(0,0,N,T),N>0&&T>0&&(O=a.ctx.createPattern(S,"repeat"),a.renderRepeat(R,O,M,B))):TKt(h)&&(x=hJ(r,n,[null,null,null]),R=x[0],C=x[1],I=x[2],N=x[3],T=x[4],D=h.position.length===0?[Pj]:h.position,M=Ei(D[0],N),B=Ei(D[D.length-1],T),F=bKt(h,M,B,N,T),$=F[0],z=F[1],$>0&&z>0&&(G=a.ctx.createRadialGradient(C+M,I+B,0,C+M,I+B,$),ZPe(h.stops,$*2).forEach(function(Y){return G.addColorStop(Y.stop,Ts(Y.color))}),a.path(R),a.ctx.fillStyle=G,$!==z?(V=r.bounds.left+.5*r.bounds.width,ee=r.bounds.top+.5*r.bounds.height,se=z/$,ie=1/se,a.ctx.save(),a.ctx.translate(V,ee),a.ctx.transform(1,0,0,se,0,0),a.ctx.translate(-V,-ee),a.ctx.fillRect(C,ie*(I-ee)+ee,N,T*ie),a.ctx.restore()):a.ctx.fill())),le.label=6;case 6:return n--,[2]}})},a=this,s=0,o=r.styles.backgroundImage.slice(0).reverse(),u.label=1;case 1:return s<o.length?(l=o[s],[5,i(l)]):[3,4];case 2:u.sent(),u.label=3;case 3:return s++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(r,n,i){return ll(this,void 0,void 0,function(){return To(this,function(a){return this.path(sFe(i,n)),this.ctx.fillStyle=Ts(r),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(r,n,i,a){return ll(this,void 0,void 0,function(){var s,o;return To(this,function(l){switch(l.label){case 0:return n<3?[4,this.renderSolidBorder(r,i,a)]:[3,2];case 1:return l.sent(),[2];case 2:return s=RJt(a,i),this.path(s),this.ctx.fillStyle=Ts(r),this.ctx.fill(),o=kJt(a,i),this.path(o),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(r){return ll(this,void 0,void 0,function(){var n,i,a,s,o,l,u,h,d=this;return To(this,function(f){switch(f.label){case 0:return this.applyEffects(r.getEffects(2)),n=r.container.styles,i=!u0(n.backgroundColor)||n.backgroundImage.length,a=[{style:n.borderTopStyle,color:n.borderTopColor,width:n.borderTopWidth},{style:n.borderRightStyle,color:n.borderRightColor,width:n.borderRightWidth},{style:n.borderBottomStyle,color:n.borderBottomColor,width:n.borderBottomWidth},{style:n.borderLeftStyle,color:n.borderLeftColor,width:n.borderLeftWidth}],s=$Jt(mb(n.backgroundClip,0),r.curves),i||n.boxShadow.length?(this.ctx.save(),this.path(s),this.ctx.clip(),u0(n.backgroundColor)||(this.ctx.fillStyle=Ts(n.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(r.container)]):[3,2];case 1:f.sent(),this.ctx.restore(),n.boxShadow.slice(0).reverse().forEach(function(p){d.ctx.save();var g=k5(r.curves),A=p.inset?0:FJt,m=OJt(g,-A+(p.inset?1:-1)*p.spread.number,(p.inset?1:-1)*p.spread.number,p.spread.number*(p.inset?-2:2),p.spread.number*(p.inset?-2:2));p.inset?(d.path(g),d.ctx.clip(),d.mask(m)):(d.mask(g),d.ctx.clip(),d.path(m)),d.ctx.shadowOffsetX=p.offsetX.number+A,d.ctx.shadowOffsetY=p.offsetY.number,d.ctx.shadowColor=Ts(p.color),d.ctx.shadowBlur=p.blur.number,d.ctx.fillStyle=p.inset?Ts(p.color):"rgba(0,0,0,1)",d.ctx.fill(),d.ctx.restore()}),f.label=2;case 2:o=0,l=0,u=a,f.label=3;case 3:return l<u.length?(h=u[l],h.style!==0&&!u0(h.color)&&h.width>0?h.style!==2?[3,5]:[4,this.renderDashedDottedBorder(h.color,h.width,o,r.curves,2)]:[3,11]):[3,13];case 4:return f.sent(),[3,11];case 5:return h.style!==3?[3,7]:[4,this.renderDashedDottedBorder(h.color,h.width,o,r.curves,3)];case 6:return f.sent(),[3,11];case 7:return h.style!==4?[3,9]:[4,this.renderDoubleBorder(h.color,h.width,o,r.curves)];case 8:return f.sent(),[3,11];case 9:return[4,this.renderSolidBorder(h.color,o,r.curves)];case 10:f.sent(),f.label=11;case 11:o++,f.label=12;case 12:return l++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(r,n,i,a,s){return ll(this,void 0,void 0,function(){var o,l,u,h,d,f,p,g,A,m,v,y,_,b,S,E,S,E;return To(this,function(w){return this.ctx.save(),o=IJt(a,i),l=sFe(a,i),s===2&&(this.path(l),this.ctx.clip()),lu(l[0])?(u=l[0].start.x,h=l[0].start.y):(u=l[0].x,h=l[0].y),lu(l[1])?(d=l[1].end.x,f=l[1].end.y):(d=l[1].x,f=l[1].y),i===0||i===2?p=Math.abs(u-d):p=Math.abs(h-f),this.ctx.beginPath(),s===3?this.formatPath(o):this.formatPath(l.slice(0,2)),g=n<3?n*3:n*2,A=n<3?n*2:n,s===3&&(g=n,A=n),m=!0,p<=g*2?m=!1:p<=g*2+A?(v=p/(2*g+A),g*=v,A*=v):(y=Math.floor((p+A)/(g+A)),_=(p-y*g)/(y-1),b=(p-(y+1)*g)/y,A=b<=0||Math.abs(A-_)<Math.abs(A-b)?_:b),m&&(s===3?this.ctx.setLineDash([0,g+A]):this.ctx.setLineDash([g,A])),s===3?(this.ctx.lineCap="round",this.ctx.lineWidth=n):this.ctx.lineWidth=n*2+1.1,this.ctx.strokeStyle=Ts(r),this.ctx.stroke(),this.ctx.setLineDash([]),s===2&&(lu(l[0])&&(S=l[3],E=l[0],this.ctx.beginPath(),this.formatPath([new jt(S.end.x,S.end.y),new jt(E.start.x,E.start.y)]),this.ctx.stroke()),lu(l[1])&&(S=l[1],E=l[2],this.ctx.beginPath(),this.formatPath([new jt(S.end.x,S.end.y),new jt(E.start.x,E.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(r){return ll(this,void 0,void 0,function(){var n;return To(this,function(i){switch(i.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=Ts(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),n=CJt(r),[4,this.renderStack(n)];case 1:return i.sent(),this.applyEffects([]),[2,this.canvas]}})})},e}(cFe),QJt=function(t){return t instanceof D6e||t instanceof N6e?!0:t instanceof eJ&&t.type!==w5&&t.type!==E5},$Jt=function(t,e){switch(t){case 0:return k5(e);case 2:return SJt(e);case 1:default:return I5(e)}},GJt=function(t){switch(t){case 1:return"center";case 2:return"right";case 0:default:return"left"}},zJt=["-apple-system","system-ui"],VJt=function(t){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?t.filter(function(e){return zJt.indexOf(e)===-1}):t},HJt=function(t){th(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.canvas=n.canvas?n.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),i.options=n,i.canvas.width=Math.floor(n.width*n.scale),i.canvas.height=Math.floor(n.height*n.scale),i.canvas.style.width=n.width+"px",i.canvas.style.height=n.height+"px",i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-n.x,-n.y),i.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+n.width+"x"+n.height+" at "+n.x+","+n.y+") with scale "+n.scale),i}return e.prototype.render=function(r){return ll(this,void 0,void 0,function(){var n,i;return To(this,function(a){switch(a.label){case 0:return n=Zj(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,r),[4,qJt(n)];case 1:return i=a.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=Ts(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(i,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e}(cFe),qJt=function(t){return new Promise(function(e,r){var n=new Image;n.onload=function(){e(n)},n.onerror=r,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(t))})},YJt=function(){function t(e){var r=e.id,n=e.enabled;this.id=r,this.enabled=n,this.start=Date.now()}return t.prototype.debug=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,zL([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},t.prototype.getTime=function(){return Date.now()-this.start},t.prototype.info=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,zL([this.id,this.getTime()+"ms"],e))},t.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,zL([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},t.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,zL([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},t.instances={},t}(),WJt=function(){function t(e,r){var n;this.windowBounds=r,this.instanceName="#"+t.instanceCount++,this.logger=new YJt({id:this.instanceName,enabled:e.logging}),this.cache=(n=e.cache)!==null&&n!==void 0?n:new pJt(this,e)}return t.instanceCount=1,t}(),dJ=function(t,e){return e===void 0&&(e={}),XJt(t,e)};typeof window<"u"&&eFe.setContext(window);var XJt=function(t,e){return ll(void 0,void 0,void 0,function(){var r,n,i,a,s,o,l,u,h,d,f,p,g,A,m,v,y,_,b,S,w,E,w,O,x,R,C,I,N,T,D,M,B,F,$,z,G,V,ee,se;return To(this,function(ie){switch(ie.label){case 0:if(!t||typeof t!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(r=t.ownerDocument,!r)throw new Error("Element is not attached to a Document");if(n=r.defaultView,!n)throw new Error("Document is not attached to a Window");return i={allowTaint:(O=e.allowTaint)!==null&&O!==void 0?O:!1,imageTimeout:(x=e.imageTimeout)!==null&&x!==void 0?x:15e3,proxy:e.proxy,useCORS:(R=e.useCORS)!==null&&R!==void 0?R:!1},a=Aj({logging:(C=e.logging)!==null&&C!==void 0?C:!0,cache:e.cache},i),s={windowWidth:(I=e.windowWidth)!==null&&I!==void 0?I:n.innerWidth,windowHeight:(N=e.windowHeight)!==null&&N!==void 0?N:n.innerHeight,scrollX:(T=e.scrollX)!==null&&T!==void 0?T:n.pageXOffset,scrollY:(D=e.scrollY)!==null&&D!==void 0?D:n.pageYOffset},o=new lp(s.scrollX,s.scrollY,s.windowWidth,s.windowHeight),l=new WJt(a,o),u=(M=e.foreignObjectRendering)!==null&&M!==void 0?M:!1,h={allowTaint:(B=e.allowTaint)!==null&&B!==void 0?B:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:u,copyStyles:u},l.logger.debug("Starting document clone with size "+o.width+"x"+o.height+" scrolled to "+-o.left+","+-o.top),d=new j6e(l,t,h),f=d.clonedReferenceElement,f?[4,d.toIFrame(r,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return p=ie.sent(),g=rJ(f)||Zjt(f)?OWt(f.ownerDocument):VL(l,f),A=g.width,m=g.height,v=g.left,y=g.top,_=KJt(l,f,e.backgroundColor),b={canvas:e.canvas,backgroundColor:_,scale:($=(F=e.scale)!==null&&F!==void 0?F:n.devicePixelRatio)!==null&&$!==void 0?$:1,x:((z=e.x)!==null&&z!==void 0?z:0)+v,y:((G=e.y)!==null&&G!==void 0?G:0)+y,width:(V=e.width)!==null&&V!==void 0?V:Math.ceil(A),height:(ee=e.height)!==null&&ee!==void 0?ee:Math.ceil(m)},u?(l.logger.debug("Document cloned, using foreign object rendering"),w=new HJt(l,b),[4,w.render(f)]):[3,3];case 2:return S=ie.sent(),[3,5];case 3:return l.logger.debug("Document cloned, element located at "+v+","+y+" with size "+A+"x"+m+" using computed rendering"),l.logger.debug("Starting DOM parsing"),E=B6e(l,f),_===E.styles.backgroundColor&&(E.styles.backgroundColor=up.TRANSPARENT),l.logger.debug("Starting renderer for element at "+b.x+","+b.y+" with size "+b.width+"x"+b.height),w=new UJt(l,b),[4,w.render(E)];case 4:S=ie.sent(),ie.label=5;case 5:return(!((se=e.removeContainer)!==null&&se!==void 0)||se)&&(j6e.destroy(p)||l.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),l.logger.debug("Finished rendering"),[2,S]}})})},KJt=function(t,e,r){var n=e.ownerDocument,i=n.documentElement?l2(t,getComputedStyle(n.documentElement).backgroundColor):up.TRANSPARENT,a=n.body?l2(t,getComputedStyle(n.body).backgroundColor):up.TRANSPARENT,s=typeof r=="string"?l2(t,r):r===null?up.TRANSPARENT:4294967295;return e===n.documentElement?u0(i)?u0(a)?s:a:i:s};class ZJt{constructor(){this.imageCache=new Map,this.defaultChartHeight=189,this.defaultChartWidth=567}canvasToBlob(e){return new Promise((r,n)=>{e.toBlob(i=>{i?(i.type!=="image/png"&&console.warn("Blob type 不是 image/png:",i.type),r(i)):n(new Error("Canvas to Blob 转换失败"))},"image/png",1)})}async captureEChartsAsImage(e){try{const r=await dJ(e,{backgroundColor:"#ffffff",scale:2,logging:!1,useCORS:!0}),n=r.width,i=r.height,a=await this.canvasToBlob(r),s=await this.blobToArrayBuffer(a);return{data:new Uint8Array(s),width:n,height:i}}catch(r){return console.error("捕获 ECharts 图表失败:",r),null}}async captureMermaidAsImage(e){try{const r=e.querySelector("svg");if(!r)return console.warn("未找到 Mermaid SVG 元素"),null;const n=r.getBoundingClientRect(),i=n.width,a=n.height,s=e.querySelector(".mermaid-controls");let o=null;s&&(o=s.style.display,s.style.display="none");try{const l=await dJ(e,{backgroundColor:"#ffffff",scale:2,logging:!1,useCORS:!0,allowTaint:!0,foreignObjectRendering:!1}),u=await this.canvasToBlob(l),h=await this.blobToArrayBuffer(u);return{data:new Uint8Array(h),width:l.width,height:l.height,displayWidth:i,displayHeight:a}}finally{s&&o!==null&&(s.style.display=o)}}catch(r){return console.error("捕获 Mermaid 图表失败:",r),null}}async captureMathAsImage(e){try{const r=e.getBoundingClientRect(),n=r.width,i=r.height,a=await dJ(e,{backgroundColor:"#ffffff",scale:3,logging:!1,useCORS:!0,allowTaint:!0}),s=await this.canvasToBlob(a),o=await this.blobToArrayBuffer(s);return{data:new Uint8Array(o),width:a.width,height:a.height,displayWidth:n,displayHeight:i}}catch(r){return console.error("捕获数学公式失败:",r),null}}async base64ToBlob(e){try{return await(await fetch(e)).blob()}catch(r){throw console.error("base64 转 Blob 失败:",r),r}}async blobToArrayBuffer(e){return new Promise((r,n)=>{const i=new FileReader;i.onload=()=>r(i.result),i.onerror=n,i.readAsArrayBuffer(e)})}base64ToUint8Array(e){try{const r=e.split(",")[1];if(!r)throw new Error("无效的 base64 数据");const n=atob(r),i=new Uint8Array(n.length);for(let a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return i}catch(r){throw console.error("base64 转换失败:",r),r}}validateImageData(e){return e.length<8?!1:e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71}parseMarkdown(e,r){return e.parse(r,{})}getDefaultTextStyle(){return{font:"宋体",size:20}}getDefaultSpacing(){return{before:120,after:0,line:288,lineRule:"auto"}}async convertTokensToDocx(e,r){const n=[];let i=0,a={},s=null,o=0,l=0,u=!1,h=[],d=0,f=[];for(let p=0;p<e.length;p++){const g=e[p];if(!(g.type==="fence"&&g.info.startsWith("dataset"))){if(g.type==="container_info_open"){s="info";continue}if(g.type==="container_warning_open"){s="warning";continue}if(g.type==="container_danger_open"){s="danger";continue}if(g.type==="container_success_open"){s="success";continue}if(g.type==="container_cell_open"){const A=g.info.match(/cell\s+(\d+)/);d=A?parseInt(A[1]):12,u=!0,h=[];continue}if(g.type==="container_cell_close"){if(f.push({width:d,contents:h}),f.reduce((m,v)=>m+v.width,0)>=12){const m=this.createGridTable(f);m&&n.push(m),f=[]}u=!1,h=[],d=0;continue}if(g.type==="container_info_close"||g.type==="container_warning_close"||g.type==="container_danger_close"||g.type==="container_success_close"){s=null,u||n.push(new wa({text:"",spacing:{before:100,after:100}}));continue}if(g.type==="fence"&&g.info==="echarts"){const A=r.querySelectorAll('.echarts-container[data-processed="true"]');if(A[o]){try{const m=await this.captureEChartsAsImage(A[o]);if(m&&m.data)if(this.validateImageData(m.data)){let v,y;u?(v=Math.round(d/12*567*.9),y=300):(v=567,y=378);const _=m.width/m.height;let b=v,S=Math.round(b/_);S>y&&(S=y,b=Math.round(S*_));const E=new wa({children:[new DBe({data:m.data,transformation:{width:b,height:S},type:"png",ext:"png",extension:"png"})],spacing:{before:200,after:200}});u?h.push(E):n.push(E)}else{console.warn("ECharts 图片数据无效");const v=new wa({text:"[ECharts 图表]",spacing:{before:200,after:200}});u?h.push(v):n.push(v)}}catch(m){console.error("ECharts 图表转换失败:",m);const v=new wa({text:"[ECharts 图表]",spacing:{before:200,after:200}});u?h.push(v):n.push(v)}o++}continue}if(g.type==="fence"&&g.info==="mermaid"){const A=r.querySelectorAll('.mermaid[data-processed="true"]');if(A[l]){try{await new Promise(v=>setTimeout(v,100));const m=await this.captureMermaidAsImage(A[l]);if(m&&m.data)if(this.validateImageData(m.data)){let v,y;if(u){const b=Math.round(d/12*567*.9),S=300,E=m.displayWidth/m.displayHeight;y=b,v=Math.round(y/E),v>S&&(v=S,y=Math.round(v*E))}else{v=this.defaultChartHeight;const b=m.displayWidth/m.displayHeight;y=Math.round(v*b)}const _=new wa({children:[new DBe({data:m.data,transformation:{width:y,height:v},type:"png",ext:"png",extension:"png"})],spacing:{before:200,after:200}});u?h.push(_):n.push(_)}else{console.warn("Mermaid 图片数据无效");const v=new wa({text:"[Mermaid 流程图]",spacing:{before:200,after:200}});u?h.push(v):n.push(v)}else{const v=new wa({text:"[Mermaid 流程图]",spacing:{before:200,after:200}});u?h.push(v):n.push(v)}}catch(m){console.error("Mermaid 图表转换失败:",m);const v=new wa({text:"[Mermaid 流程图]",spacing:{before:200,after:200}});u?h.push(v):n.push(v)}l++}continue}if(g.type==="heading_open"){parseInt(g.tag.substring(1));const A=e[p+1];if(A&&A.type==="inline"){const m=this.getDefaultTextStyle(),v=this.getDefaultSpacing(),y=new wa({children:[new xo({text:A.content,font:m.font,size:m.size,bold:!0})],spacing:v});u?h.push(y):n.push(y)}p+=2;continue}if(g.type==="paragraph_open"){const A=e[p+1];if(A&&A.type==="inline"){const m=this.parseInlineContent(A);if(m.length>0){const v=this.getDefaultSpacing(),y={children:m,spacing:v};if(s){const b=this.getContainerStyle(s);y.shading={fill:b.background},y.border={left:{color:b.borderColor,space:1,style:ol.SINGLE,size:24}}}const _=new wa(y);u?h.push(_):n.push(_)}}p+=2;continue}if(g.type==="bullet_list_open"||g.type==="ordered_list_open"){const A=g.type==="ordered_list_open";i++,A&&(a[i]=1);continue}if(g.type==="bullet_list_close"||g.type==="ordered_list_close"){g.type==="ordered_list_close"&&delete a[i],i--;continue}if(g.type==="list_item_open"){const A=e[p+1];if(A&&A.type==="paragraph_open"){const m=e[p+2];if(m&&m.type==="inline"){const v=this.parseInlineContent(m),y=a[i]!==void 0,_=this.getDefaultTextStyle(),b=this.getDefaultSpacing(),S=y?`${a[i]}. `:"• ",E=new wa({children:[new xo({text:S,bold:!0,font:_.font,size:_.size}),...v],spacing:b,indent:{left:720*i}});u?h.push(E):n.push(E),y&&a[i]++}p+=3}continue}if(g.type==="math_block"||g.type==="math_block_end"){const A=this.getDefaultTextStyle(),m=this.getDefaultSpacing(),v=new wa({children:[new xo({text:g.content,font:"Cambria Math",size:A.size,italics:!0})],spacing:m,alignment:Ju.CENTER});u?h.push(v):n.push(v);continue}if(g.type==="fence"&&g.info!=="echarts"&&g.info!=="mermaid"&&!g.info.startsWith("dataset")){const A=g.content.split(`
|
|
902
902
|
`).filter(y=>y.trim()),m=this.getDefaultTextStyle(),v=this.getDefaultSpacing();A.forEach(y=>{const _=new wa({children:[new xo({text:y,font:"Consolas",size:m.size})],spacing:v,shading:{fill:"F5F5F5"}});u?h.push(_):n.push(_)});continue}if(g.type==="table_open"){const A=this.parseTable(e,p);if(A){const m=this.createTable(A);u?h.push(m):n.push(m),p=A.endIndex}continue}if(g.type==="hr"){const A=new wa({text:"",border:{bottom:{color:"CCCCCC",space:1,style:ol.SINGLE,size:6}},spacing:{before:200,after:200}});u?h.push(A):n.push(A);continue}}}if(f.length>0){const p=this.createGridTable(f);p&&n.push(p)}return n}parseInlineContent(e){const r=this.getDefaultTextStyle(),n=[];if(!e.children||e.children.length===0)return[new xo({text:e.content||"",font:r.font,size:r.size})];e.children.forEach(s=>{s.type==="text"?n.push(new xo({text:s.content,font:r.font,size:r.size})):s.type==="strong_open"||s.type==="strong_close"||s.type==="em_open"||s.type==="em_close"||(s.type==="code_inline"?n.push(new xo({text:s.content,font:"Consolas",size:r.size,shading:{fill:"F5F5F5"}})):s.type==="math_inline"||s.type==="katex_inline"?n.push(new xo({text:s.content,font:"Cambria Math",size:r.size,italics:!0})):s.type==="link_open"||s.type)});const i=[];let a=0;for(;a<e.children.length;){const s=e.children[a];if(s.type==="strong_open"&&a+2<e.children.length){const o=e.children[a+1];i.push(new xo({text:o.content,bold:!0,font:r.font,size:r.size})),a+=3}else if(s.type==="em_open"&&a+2<e.children.length){const o=e.children[a+1];i.push(new xo({text:o.content,italics:!0,font:r.font,size:r.size})),a+=3}else s.type==="text"?(i.push(new xo({text:s.content,font:r.font,size:r.size})),a++):s.type==="code_inline"?(i.push(new xo({text:s.content,font:"Consolas",size:r.size,shading:{fill:"F5F5F5"}})),a++):((s.type==="math_inline"||s.type==="katex_inline")&&i.push(new xo({text:s.content,font:"Cambria Math",size:r.size,italics:!0})),a++)}return i.length>0?i:n}parseTable(e,r){const n=[];let i=r+1,a=!0;for(;i<e.length&&e[i].type!=="table_close";){if(e[i].type==="thead_open"||e[i].type==="tbody_open"){i++;continue}if(e[i].type==="thead_close"){a=!1,i++;continue}if(e[i].type==="tbody_close"){i++;continue}if(e[i].type==="tr_open"){const s=[];for(i++;i<e.length&&e[i].type!=="tr_close";)e[i].type==="th_open"||e[i].type==="td_open"?(i++,e[i]&&e[i].type==="inline"&&s.push({text:e[i].content,isHeader:a}),i+=2):i++;s.length>0&&n.push(s),i++}else i++}return n.length>0?{rows:n,endIndex:i}:null}createGridTable(e){if(!e||e.length===0)return null;const r=e.map(n=>new FL({children:n.contents.length>0?n.contents:[new wa({text:""})],width:{size:n.width/12*100,type:nb.PERCENTAGE},borders:{top:{style:ol.NONE,size:0,color:"FFFFFF"},bottom:{style:ol.NONE,size:0,color:"FFFFFF"},left:{style:ol.NONE,size:0,color:"FFFFFF"},right:{style:ol.NONE,size:0,color:"FFFFFF"}},margins:{top:100,bottom:100,left:100,right:100}}));return new YBe({rows:[new WBe({children:r})],width:{size:100,type:nb.PERCENTAGE},borders:{top:{style:ol.NONE,size:0,color:"FFFFFF"},bottom:{style:ol.NONE,size:0,color:"FFFFFF"},left:{style:ol.NONE,size:0,color:"FFFFFF"},right:{style:ol.NONE,size:0,color:"FFFFFF"},insideHorizontal:{style:ol.NONE,size:0,color:"FFFFFF"},insideVertical:{style:ol.NONE,size:0,color:"FFFFFF"}}})}createTable(e){const r=this.getDefaultTextStyle(),n=e.rows.map(i=>new WBe({children:i.map(a=>new FL({children:[new wa({children:[new xo({text:a.text,bold:a.isHeader,font:r.font,size:r.size})],spacing:{before:0,after:0,line:288,lineRule:"auto"}})],shading:a.isHeader?{fill:"F0F0F0"}:void 0}))}));return new YBe({rows:n,width:{size:100,type:nb.PERCENTAGE}})}getContainerStyle(e){const r={info:{background:"E3F2FD",borderColor:"2196F3"},warning:{background:"FFF3E0",borderColor:"FF9800"},danger:{background:"FFEBEE",borderColor:"F44336"},success:{background:"E8F5E9",borderColor:"4CAF50"}};return r[e]||r.info}getHeadingLevel(e){return{1:xv.HEADING_1,2:xv.HEADING_2,3:xv.HEADING_3,4:xv.HEADING_4,5:xv.HEADING_5,6:xv.HEADING_6}[e]||xv.HEADING_1}async exportToWord(e,r,n,i="document.docx"){try{const a=this.parseMarkdown(e,r),s=await this.convertTokensToDocx(a,n),o=new uWt({sections:[{properties:{},children:s}]}),l=await xWt.toBlob(o);return TWt.saveAs(l,i),{success:!0,message:"导出成功"}}catch(a){return console.error("导出 Word 文档失败:",a),{success:!1,message:a.message}}}}const jJt={name:"MarkdownEditor",components:{EditModal:IGt},props:{content:{type:String,default:""},editable:{type:Boolean,default:!1},defaultShowEditor:{type:Boolean,default:!0},datasource:{type:Object,required:!1,validator:t=>["getDataSource","getDataSourceList","clearDataSourceCache","testDataSourceConnection"].every(r=>typeof t[r]=="function")},dark:{type:[Boolean,String],default:"auto",validator:t=>t==="auto"||typeof t=="boolean"},theme:{type:Object,default:()=>({})}},emits:["update:content","errors"],data(){return{showEditor:this.defaultShowEditor,md:null,chartRenderer:null,datasetRenderer:null,mermaidRenderer:null,renderTimeout:null,editModalVisible:!1,currentEditContent:"",currentComponentType:"",currentComponentId:"",currentTokenStart:0,currentTokenEnd:0,isResizing:!1,editorWidth:500,minEditorWidth:300,maxEditorWidth:800,renderErrors:[],_isMounted:!1,_isRendering:!1}},watch:{content:{handler(){this._isMounted&&!this._isRendering&&(this.renderTimeout&&clearTimeout(this.renderTimeout),this.renderTimeout=setTimeout(()=>{this.$nextTick(()=>{this.renderWithQueue()})},150))},immediate:!0},showEditor:{handler(){this.$nextTick(()=>{var t;return(t=this.chartRenderer)==null?void 0:t.processEChartsElements()})}}},created(){this.md=tIe(this.editable),this.chartRenderer=new qEt,this.datasetRenderer=new Hnt,this.mermaidRenderer=new zBt,this.wordExporter=new ZJt,this.datasetRenderer.setDataSourceFunctions(this.datasource),this.chartRenderer.setDataset(this.datasetRenderer.getDataset()),this.updateMermaidTheme()},computed:{contentModel:{get(){return this.content},set(t){this.$emit("update:content",t)}},renderedContent(){return this.md?this.md.render(this.content):""},isDarkMode(){return this.dark==="auto"?typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)").matches:!1:this.dark===!0},themeVars(){const t=this.isDarkMode?"dark":"light",e=NGt[t],r=this.theme[t]||{};return{...e,...r}}},watch:{localContent:{handler(t,e){t!==e&&this._isMounted&&this.$emit("update:content",t),this._isMounted&&!this._isRendering&&(this.renderTimeout&&clearTimeout(this.renderTimeout),this.renderTimeout=setTimeout(()=>{this.$nextTick(()=>{this.renderWithQueue()})},150))}},isDarkMode:{handler(){if(this._isMounted){this.updateMermaidTheme();const t=this.isDarkMode?"dark":"light";this.chartRenderer.setTheme(t),this.$nextTick(()=>{this.clearProcessedMarks(),this.renderWithQueue()})}}}},mounted(){var e;this._isMounted=!0,this.content&&this.localContent!==this.content&&(this.localContent=this.content,console.log("MarkdownEditor mounted: 强制设置 localContent,长度:",((e=this.localContent)==null?void 0:e.length)||0)),this.dark==="auto"&&typeof window<"u"&&window.matchMedia&&(this._themeMediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this._handleThemeChange=()=>{this.$forceUpdate()},this._themeMediaQuery.addEventListener("change",this._handleThemeChange));const t=this.$el.querySelector(".preview-container");t&&(this._handleEditClick=r=>{const n=r.target.closest('[data-editable="true"]');if(!n)return;r.stopPropagation(),r.preventDefault();const i=n.getBoundingClientRect(),a={left:i.right-20,top:i.top,right:i.right,bottom:i.top+20};if(!(r.clientX>=a.left&&r.clientX<=a.right&&r.clientY>=a.top&&r.clientY<=a.bottom))return;const o=n.getAttribute("data-component-id"),l=n.getAttribute("data-component-type"),u=n.getAttribute("data-position");if(o&&l&&u){const[h,d]=u.split(",").map(Number),f=this.content.substring(h,d);this.currentComponentId=o,this.currentComponentType=l,this.currentEditContent=f,this.currentTokenStart=h,this.currentTokenEnd=d,this.editModalVisible=!0}},t.addEventListener("click",this._handleEditClick)),this.$nextTick(()=>{const r=this.isDarkMode?"dark":"light",n=this.isDarkMode?"dark":"default";this.chartRenderer.setTheme(r),this.mermaidRenderer.initialize(n),this.renderWithQueue(),this.chartRenderer.observeDOM(".preview-container"),this.datasetRenderer.observeDOM(".preview-container"),this.mermaidRenderer.observeDOM(".preview-container")})},beforeUnmount(){var e,r,n,i;this._isMounted=!1,this.renderTimeout&&(clearTimeout(this.renderTimeout),this.renderTimeout=null),this._themeMediaQuery&&this._handleThemeChange&&(this._themeMediaQuery.removeEventListener("change",this._handleThemeChange),this._themeMediaQuery=null,this._handleThemeChange=null);const t=(e=this.$el)==null?void 0:e.querySelector(".preview-container");t&&this._handleEditClick&&(t.removeEventListener("click",this._handleEditClick),this._handleEditClick=null),(r=this.chartRenderer)==null||r.cleanup(),(n=this.datasetRenderer)==null||n.cleanup(),(i=this.mermaidRenderer)==null||i.cleanup()},methods:{clearProcessedMarks(){const t=this.$el.querySelector(".preview-container");if(!t)return;t.querySelectorAll('.mermaid[data-processed="true"]').forEach(i=>{i.removeAttribute("data-processed"),i.dataset.originalCode&&(i.textContent=i.dataset.originalCode)}),t.querySelectorAll('.echarts-container[data-processed="true"]').forEach(i=>{i.removeAttribute("data-processed")}),t.querySelectorAll('.dataset-container[data-processed="true"]').forEach(i=>{i.removeAttribute("data-processed")})},updateMermaidTheme(){const t=this.isDarkMode?"dark":"default";this.mermaidRenderer&&this.mermaidRenderer.setTheme(t)},handleResizerMouseDown(t){this.$emit("update:content",this.content)},async renderWithQueue(){if(!this._isRendering){this._isRendering=!0;try{this.chartRenderer.clearErrors(),this.datasetRenderer.clearErrors(),this.mermaidRenderer.clearErrors(),tD.clearErrors(),await this.datasetRenderer.renderDatasets(),await this.$nextTick(),this.chartRenderer.processEChartsElements(),this.mermaidRenderer.renderMermaidCharts(),setTimeout(()=>{this.collectRenderErrors()},300)}catch(t){console.warn("渲染过程中发生错误:",t),setTimeout(()=>{this.collectRenderErrors()},300)}finally{this._isRendering=!1}}},getErrors(){return[...this.renderErrors]},collectRenderErrors(){const t=[],e=this.content.split(`
|
|
903
903
|
`);[...this.chartRenderer.getErrors(),...this.datasetRenderer.getErrors(),...this.mermaidRenderer.getErrors(),...tD.getErrors()].forEach(n=>{const i=this.findErrorLocation(n.message,e,n.type,n.code);i&&t.push(i)}),this.renderErrors=t,this.$emit("errors",t)},findErrorLocation(t,e,r=null,n=null){let i=-1,a=r||"Unknown",s=t;r||(t.includes("ECharts")?a="ECharts":t.includes("数据集")||t.includes("dataset")?a="Dataset":t.includes("Mermaid")&&(a="Mermaid"));let o=-1;for(let l=0;l<e.length;l++){const u=e[l];a==="ECharts"&&u.includes("```echarts")||(a==="Dataset"&&u.includes("```dataset")?n&&n.includes(u.trim())&&(o=l+1):a==="Mermaid"&&u.includes("```mermaid")||a==="Container"&&u.includes("::: cell"))}if(o>0&&(i=o),i>0){const l=Math.max(0,i-1);let u=l+1;if(a==="Container"){for(let f=l+1;f<e.length;f++)if(e[f].trim()===":::"){u=f+1;break}}else for(let f=l+1;f<e.length;f++)if(e[f].trim()==="```"){u=f+1;break}u=Math.min(e.length,u);const h=e.slice(l,u).join(`
|
|
904
904
|
`);let d=s.replace(/^(ECharts|数据集|Mermaid|Container)(渲染|配置处理)?错误:\s*/i,"").replace(/\s*at\s+.*$/gm,"").split(`
|
package/package.json
CHANGED