tt-pdf-generator 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,14 +1,47 @@
|
|
|
1
|
-
"use strict";var PolicyPdfGenerator=(()=>{var On=Object.create;var ge=Object.defineProperty;var Dn=Object.getOwnPropertyDescriptor;var _n=Object.getOwnPropertyNames;var $n=Object.getPrototypeOf,Un=Object.prototype.hasOwnProperty;var P=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var p=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),qn=(t,e)=>{for(var r in e)ge(t,r,{get:e[r],enumerable:!0})},Mt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of _n(e))!Un.call(t,o)&&o!==r&&ge(t,o,{get:()=>e[o],enumerable:!(n=Dn(e,o))||n.enumerable});return t};var M=(t,e,r)=>(r=t!=null?On($n(t)):{},Mt(e||!t||!t.__esModule?ge(r,"default",{value:t,enumerable:!0}):r,t)),Vn=t=>Mt(ge({},"__esModule",{value:!0}),t);var Ot=p((di,Ft)=>{function zn(t){this.value=t,this.match=function(e){return this.value>=e.height}}function Hn(t){this.value=t,this.match=function(e){return this.value<e.height}}function Wn(t){this.value=t,this.match=function(e){return this.value>=e.width}}function Jn(t){this.value=t,this.match=function(e){return this.value<e.width}}function Gn(t){this.value=t,this.match=function(e){return this.value===e.orientation}}Ft.exports=function(e,r){switch(e){case"max-height":return new zn(r);case"min-height":return new Hn(r);case"max-width":return new Wn(r);case"min-width":return new Jn(r);case"orientation":return new Gn(r);default:throw new Error(r)}}});var _t=p((fi,Dt)=>{function Yn(t,e){this.left=t,this.right=e,this.match=function(r){return t.match(r)&&e.match(r)}}function Kn(t,e){this.left=t,this.right=e,this.match=function(r){return t.match(r)||e.match(r)}}Dt.exports=function(e,r,n){switch(e){case"and":return new Yn(r,n);case",":return new Kn(r,n);default:throw new Error(value)}}});var Vt=p((hi,qt)=>{var Qn=Ot(),Xn=_t(),$t=/[0-9]/,Ve=/[a-z|\-]/i,Zn=/\s/,Ut=/:/,eo=/,/,to=/and$/,ro=/@/;function no(t){for(var e=0,r=[];e<t.length;){var n=t[e];if(ro.test(n))for(n=t[++e];Ve.test(n)&&n!==void 0;)n=t[++e];if(Zn.test(n)||n===")"||n==="("){e++;continue}if(Ut.test(n)||eo.test(n)){e++,r.push({type:"operator",value:n});continue}if($t.test(n)){for(var o="";$t.test(n);)o+=n,n=t[++e];r.push({type:"number",value:o});continue}if(Ve.test(n)){for(var o="";Ve.test(n)&&n!==void 0;)o+=n,n=t[++e];to.test(o)?r.push({type:"operator",value:o}):r.push({type:"literal",value:o});continue}throw new TypeError("Tokenizer: I dont know what this character is: "+n)}return r}function oo(t){for(var e=[],r=[];t.length>0;){var n=t.shift();if(n.type==="number"||n.type==="literal"){e.push(n);continue}if(n.type==="operator"){if(Ut.test(n.value)){n={type:"query",key:e.pop(),value:t.shift()},e.push(n);continue}for(;r.length>0;)e.unshift(r.pop());r.push(n)}}for(;r.length>0;)e.unshift(r.pop());function o(){var i=e.shift();if(i.type==="number")return parseInt(i.value);if(i.type==="literal")return i.value;if(i.type==="operator"){var s=o(),a=o();return Xn(i.value,s,a)}if(i.type==="query"){var s=i.key.value,a=i.value.value;return Qn(s,a)}}return o()}qt.exports={parse:function(t){var e=no(t),r=oo(e);return r}}});var zt=p((pi,jt)=>{var so=Vt();jt.exports=function(t,e){var r={};return Object.keys(t).forEach(function(n){so.parse(n).match(e)&&Object.assign(r,t[n])}),r}});var Wt=p((gi,Ht)=>{var io=function(t,e,r){if(t==null)return[0,0,0];var n=(1-Math.abs(2*r-1))*e,o=t/60,i=n*(1-Math.abs(o%2-1));o=Math.floor(o);var s,a,l;o===0?(s=n,a=i,l=0):o===1?(s=i,a=n,l=0):o===2?(s=0,a=n,l=i):o===3?(s=0,a=i,l=n):o===4?(s=i,a=0,l=n):o===5&&(s=n,a=0,l=i);var u=r-n/2;return s+=u,a+=u,l+=u,[Math.abs(Math.round(s*255)),Math.abs(Math.round(a*255)),Math.abs(Math.round(l*255))]};Ht.exports=io});var Gt=p((mi,Jt)=>{var ao=Wt();function je(t,e){return t>e?e:t}function ze(t,e){return t<e?e:t}function lo(t){for(t=je(t,1e7),t=ze(t,-1e7);t<0;)t+=360;for(;t>359;)t-=360;return t}function co(t,e,r){t=lo(t),e=ze(je(e,100),0),r=ze(je(r,100),0),e/=100,r/=100;var n=ao(t,e,r);return"#"+n.map(function(o){return(256+o).toString(16).substr(-2)}).join("")}Jt.exports=co});var Kt=p((yi,Yt)=>{"use strict";Yt.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Xt=p((bi,Qt)=>{Qt.exports=function(e){return!e||typeof e=="string"?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!=="String")}});var tr=p((wi,er)=>{"use strict";var uo=Xt(),fo=Array.prototype.concat,ho=Array.prototype.slice,Zt=er.exports=function(e){for(var r=[],n=0,o=e.length;n<o;n++){var i=e[n];uo(i)?r=fo.call(r,ho.call(i)):r.push(i)}return r};Zt.wrap=function(t){return function(){return t(Zt(arguments))}}});var sr=p((Ci,or)=>{var se=Kt(),ie=tr(),rr=Object.hasOwnProperty,nr=Object.create(null);for(ye in se)rr.call(se,ye)&&(nr[se[ye]]=ye);var ye,v=or.exports={to:{},get:{}};v.get=function(t){var e=t.substring(0,3).toLowerCase(),r,n;switch(e){case"hsl":r=v.get.hsl(t),n="hsl";break;case"hwb":r=v.get.hwb(t),n="hwb";break;default:r=v.get.rgb(t),n="rgb";break}return r?{model:n,value:r}:null};v.get.rgb=function(t){if(!t)return null;var e=/^#([a-f0-9]{3,4})$/i,r=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,n=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^(\w+)$/,s=[0,0,0,1],a,l,u;if(a=t.match(r)){for(u=a[2],a=a[1],l=0;l<3;l++){var d=l*2;s[l]=parseInt(a.slice(d,d+2),16)}u&&(s[3]=parseInt(u,16)/255)}else if(a=t.match(e)){for(a=a[1],u=a[3],l=0;l<3;l++)s[l]=parseInt(a[l]+a[l],16);u&&(s[3]=parseInt(u+u,16)/255)}else if(a=t.match(n)){for(l=0;l<3;l++)s[l]=parseInt(a[l+1],0);a[4]&&(a[5]?s[3]=parseFloat(a[4])*.01:s[3]=parseFloat(a[4]))}else if(a=t.match(o)){for(l=0;l<3;l++)s[l]=Math.round(parseFloat(a[l+1])*2.55);a[4]&&(a[5]?s[3]=parseFloat(a[4])*.01:s[3]=parseFloat(a[4]))}else return(a=t.match(i))?a[1]==="transparent"?[0,0,0,0]:rr.call(se,a[1])?(s=se[a[1]],s[3]=1,s):null:null;for(l=0;l<3;l++)s[l]=D(s[l],0,255);return s[3]=D(s[3],0,1),s};v.get.hsl=function(t){if(!t)return null;var e=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,r=t.match(e);if(r){var n=parseFloat(r[4]),o=(parseFloat(r[1])%360+360)%360,i=D(parseFloat(r[2]),0,100),s=D(parseFloat(r[3]),0,100),a=D(isNaN(n)?1:n,0,1);return[o,i,s,a]}return null};v.get.hwb=function(t){if(!t)return null;var e=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,r=t.match(e);if(r){var n=parseFloat(r[4]),o=(parseFloat(r[1])%360+360)%360,i=D(parseFloat(r[2]),0,100),s=D(parseFloat(r[3]),0,100),a=D(isNaN(n)?1:n,0,1);return[o,i,s,a]}return null};v.to.hex=function(){var t=ie(arguments);return"#"+be(t[0])+be(t[1])+be(t[2])+(t[3]<1?be(Math.round(t[3]*255)):"")};v.to.rgb=function(){var t=ie(arguments);return t.length<4||t[3]===1?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"};v.to.rgb.percent=function(){var t=ie(arguments),e=Math.round(t[0]/255*100),r=Math.round(t[1]/255*100),n=Math.round(t[2]/255*100);return t.length<4||t[3]===1?"rgb("+e+"%, "+r+"%, "+n+"%)":"rgba("+e+"%, "+r+"%, "+n+"%, "+t[3]+")"};v.to.hsl=function(){var t=ie(arguments);return t.length<4||t[3]===1?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};v.to.hwb=function(){var t=ie(arguments),e="";return t.length>=4&&t[3]!==1&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"};v.to.keyword=function(t){return nr[t.slice(0,3)]};function D(t,e,r){return Math.min(Math.max(e,t),r)}function be(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}});var ar=p((Ei,ir)=>{var He=40,We=41,we=39,Je=34,Ge=92,Q=47,Ye=44,Ke=58,Ce=42,po=117,go=85,mo=43,yo=/^[a-f0-9?-]+$/i;ir.exports=function(t){for(var e=[],r=t,n,o,i,s,a,l,u,d,c=0,f=r.charCodeAt(c),m=r.length,y=[{nodes:e}],g=0,h,S="",I="",B="";c<m;)if(f<=32){n=c;do n+=1,f=r.charCodeAt(n);while(f<=32);s=r.slice(c,n),i=e[e.length-1],f===We&&g?B=s:i&&i.type==="div"?(i.after=s,i.sourceEndIndex+=s.length):f===Ye||f===Ke||f===Q&&r.charCodeAt(n+1)!==Ce&&(!h||h&&h.type==="function"&&h.value!=="calc")?I=s:e.push({type:"space",sourceIndex:c,sourceEndIndex:n,value:s}),c=n}else if(f===we||f===Je){n=c,o=f===we?"'":'"',s={type:"string",sourceIndex:c,quote:o};do if(a=!1,n=r.indexOf(o,n+1),~n)for(l=n;r.charCodeAt(l-1)===Ge;)l-=1,a=!a;else r+=o,n=r.length-1,s.unclosed=!0;while(a);s.value=r.slice(c+1,n),s.sourceEndIndex=s.unclosed?n:n+1,e.push(s),c=n+1,f=r.charCodeAt(c)}else if(f===Q&&r.charCodeAt(c+1)===Ce)n=r.indexOf("*/",c),s={type:"comment",sourceIndex:c,sourceEndIndex:n+2},n===-1&&(s.unclosed=!0,n=r.length,s.sourceEndIndex=n),s.value=r.slice(c+2,n),e.push(s),c=n+2,f=r.charCodeAt(c);else if((f===Q||f===Ce)&&h&&h.type==="function"&&h.value==="calc")s=r[c],e.push({type:"word",sourceIndex:c-I.length,sourceEndIndex:c+s.length,value:s}),c+=1,f=r.charCodeAt(c);else if(f===Q||f===Ye||f===Ke)s=r[c],e.push({type:"div",sourceIndex:c-I.length,sourceEndIndex:c+s.length,value:s,before:I,after:""}),I="",c+=1,f=r.charCodeAt(c);else if(He===f){n=c;do n+=1,f=r.charCodeAt(n);while(f<=32);if(d=c,s={type:"function",sourceIndex:c-S.length,value:S,before:r.slice(d+1,n)},c=n,S==="url"&&f!==we&&f!==Je){n-=1;do if(a=!1,n=r.indexOf(")",n+1),~n)for(l=n;r.charCodeAt(l-1)===Ge;)l-=1,a=!a;else r+=")",n=r.length-1,s.unclosed=!0;while(a);u=n;do u-=1,f=r.charCodeAt(u);while(f<=32);d<u?(c!==u+1?s.nodes=[{type:"word",sourceIndex:c,sourceEndIndex:u+1,value:r.slice(c,u+1)}]:s.nodes=[],s.unclosed&&u+1!==n?(s.after="",s.nodes.push({type:"space",sourceIndex:u+1,sourceEndIndex:n,value:r.slice(u+1,n)})):(s.after=r.slice(u+1,n),s.sourceEndIndex=n)):(s.after="",s.nodes=[]),c=n+1,s.sourceEndIndex=s.unclosed?n:c,f=r.charCodeAt(c),e.push(s)}else g+=1,s.after="",s.sourceEndIndex=c+1,e.push(s),y.push(s),e=s.nodes=[],h=s;S=""}else if(We===f&&g)c+=1,f=r.charCodeAt(c),h.after=B,h.sourceEndIndex+=B.length,B="",g-=1,y[y.length-1].sourceEndIndex=c,y.pop(),h=y[g],e=h.nodes;else{n=c;do f===Ge&&(n+=1),n+=1,f=r.charCodeAt(n);while(n<m&&!(f<=32||f===we||f===Je||f===Ye||f===Ke||f===Q||f===He||f===Ce&&h&&h.type==="function"&&h.value==="calc"||f===Q&&h.type==="function"&&h.value==="calc"||f===We&&g));s=r.slice(c,n),He===f?S=s:(po===s.charCodeAt(0)||go===s.charCodeAt(0))&&mo===s.charCodeAt(1)&&yo.test(s.slice(2))?e.push({type:"unicode-range",sourceIndex:c,sourceEndIndex:n,value:s}):e.push({type:"word",sourceIndex:c,sourceEndIndex:n,value:s}),c=n}for(c=y.length-1;c;c-=1)y[c].unclosed=!0,y[c].sourceEndIndex=r.length;return y[0].nodes}});var cr=p((Ai,lr)=>{var Ee=45,Ae=43,Qe=46,bo=101,wo=69;function Co(t){var e=t.charCodeAt(0),r;if(e===Ae||e===Ee){if(r=t.charCodeAt(1),r>=48&&r<=57)return!0;var n=t.charCodeAt(2);return r===Qe&&n>=48&&n<=57}return e===Qe?(r=t.charCodeAt(1),r>=48&&r<=57):e>=48&&e<=57}lr.exports=function(t){var e=0,r=t.length,n,o,i;if(r===0||!Co(t))return!1;for(n=t.charCodeAt(e),(n===Ae||n===Ee)&&e++;e<r&&(n=t.charCodeAt(e),!(n<48||n>57));)e+=1;if(n=t.charCodeAt(e),o=t.charCodeAt(e+1),n===Qe&&o>=48&&o<=57)for(e+=2;e<r&&(n=t.charCodeAt(e),!(n<48||n>57));)e+=1;if(n=t.charCodeAt(e),o=t.charCodeAt(e+1),i=t.charCodeAt(e+2),(n===bo||n===wo)&&(o>=48&&o<=57||(o===Ae||o===Ee)&&i>=48&&i<=57))for(e+=o===Ae||o===Ee?3:2;e<r&&(n=t.charCodeAt(e),!(n<48||n>57));)e+=1;return{number:t.slice(0,e),unit:t.slice(e)}}});var Ar=p((Ri,Er)=>{Er.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var U=p(H=>{var ot,hs=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];H.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};H.getSymbolTotalCodewords=function(e){return hs[e]};H.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};H.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');ot=e};H.isKanjiModeEnabled=function(){return typeof ot<"u"};H.toSJIS=function(e){return ot(e)}});var Re=p(R=>{R.L={bit:1};R.M={bit:0};R.Q={bit:3};R.H={bit:2};function ps(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return R.L;case"m":case"medium":return R.M;case"q":case"quartile":return R.Q;case"h":case"high":return R.H;default:throw new Error("Unknown EC Level: "+t)}}R.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4};R.from=function(e,r){if(R.isValid(e))return e;try{return ps(e)}catch{return r}}});var Sr=p((Mi,Tr)=>{function xr(){this.buffer=[],this.length=0}xr.prototype={get:function(t){let e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};Tr.exports=xr});var vr=p((Ni,Pr)=>{function ae(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}ae.prototype.set=function(t,e,r,n){let o=t*this.size+e;this.data[o]=r,n&&(this.reservedBit[o]=!0)};ae.prototype.get=function(t,e){return this.data[t*this.size+e]};ae.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};ae.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};Pr.exports=ae});var Rr=p(Ie=>{var gs=U().getSymbolSize;Ie.getRowColCoords=function(e){if(e===1)return[];let r=Math.floor(e/7)+2,n=gs(e),o=n===145?26:Math.ceil((n-13)/(2*r-2))*2,i=[n-7];for(let s=1;s<r-1;s++)i[s]=i[s-1]-o;return i.push(6),i.reverse()};Ie.getPositions=function(e){let r=[],n=Ie.getRowColCoords(e),o=n.length;for(let i=0;i<o;i++)for(let s=0;s<o;s++)i===0&&s===0||i===0&&s===o-1||i===o-1&&s===0||r.push([n[i],n[s]]);return r}});var Mr=p(Br=>{var ms=U().getSymbolSize,Ir=7;Br.getPositions=function(e){let r=ms(e);return[[0,0],[r-Ir,0],[0,r-Ir]]}});var Nr=p(E=>{E.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var W={N1:3,N2:3,N3:40,N4:10};E.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7};E.from=function(e){return E.isValid(e)?parseInt(e,10):void 0};E.getPenaltyN1=function(e){let r=e.size,n=0,o=0,i=0,s=null,a=null;for(let l=0;l<r;l++){o=i=0,s=a=null;for(let u=0;u<r;u++){let d=e.get(l,u);d===s?o++:(o>=5&&(n+=W.N1+(o-5)),s=d,o=1),d=e.get(u,l),d===a?i++:(i>=5&&(n+=W.N1+(i-5)),a=d,i=1)}o>=5&&(n+=W.N1+(o-5)),i>=5&&(n+=W.N1+(i-5))}return n};E.getPenaltyN2=function(e){let r=e.size,n=0;for(let o=0;o<r-1;o++)for(let i=0;i<r-1;i++){let s=e.get(o,i)+e.get(o,i+1)+e.get(o+1,i)+e.get(o+1,i+1);(s===4||s===0)&&n++}return n*W.N2};E.getPenaltyN3=function(e){let r=e.size,n=0,o=0,i=0;for(let s=0;s<r;s++){o=i=0;for(let a=0;a<r;a++)o=o<<1&2047|e.get(s,a),a>=10&&(o===1488||o===93)&&n++,i=i<<1&2047|e.get(a,s),a>=10&&(i===1488||i===93)&&n++}return n*W.N3};E.getPenaltyN4=function(e){let r=0,n=e.data.length;for(let i=0;i<n;i++)r+=e.data[i];return Math.abs(Math.ceil(r*100/n/5)-10)*W.N4};function ys(t,e,r){switch(t){case E.Patterns.PATTERN000:return(e+r)%2===0;case E.Patterns.PATTERN001:return e%2===0;case E.Patterns.PATTERN010:return r%3===0;case E.Patterns.PATTERN011:return(e+r)%3===0;case E.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2===0;case E.Patterns.PATTERN101:return e*r%2+e*r%3===0;case E.Patterns.PATTERN110:return(e*r%2+e*r%3)%2===0;case E.Patterns.PATTERN111:return(e*r%3+(e+r)%2)%2===0;default:throw new Error("bad maskPattern:"+t)}}E.applyMask=function(e,r){let n=r.size;for(let o=0;o<n;o++)for(let i=0;i<n;i++)r.isReserved(i,o)||r.xor(i,o,ys(e,i,o))};E.getBestMask=function(e,r){let n=Object.keys(E.Patterns).length,o=0,i=1/0;for(let s=0;s<n;s++){r(s),E.applyMask(s,e);let a=E.getPenaltyN1(e)+E.getPenaltyN2(e)+E.getPenaltyN3(e)+E.getPenaltyN4(e);E.applyMask(s,e),a<i&&(i=a,o=s)}return o}});var it=p(st=>{var q=Re(),Be=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Me=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];st.getBlocksCount=function(e,r){switch(r){case q.L:return Be[(e-1)*4+0];case q.M:return Be[(e-1)*4+1];case q.Q:return Be[(e-1)*4+2];case q.H:return Be[(e-1)*4+3];default:return}};st.getTotalCodewordsCount=function(e,r){switch(r){case q.L:return Me[(e-1)*4+0];case q.M:return Me[(e-1)*4+1];case q.Q:return Me[(e-1)*4+2];case q.H:return Me[(e-1)*4+3];default:return}}});var kr=p(ke=>{var le=new Uint8Array(512),Ne=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)le[r]=e,Ne[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)le[r]=le[r-255]})();ke.log=function(e){if(e<1)throw new Error("log("+e+")");return Ne[e]};ke.exp=function(e){return le[e]};ke.mul=function(e,r){return e===0||r===0?0:le[Ne[e]+Ne[r]]}});var Lr=p(ce=>{var at=kr();ce.mul=function(e,r){let n=new Uint8Array(e.length+r.length-1);for(let o=0;o<e.length;o++)for(let i=0;i<r.length;i++)n[o+i]^=at.mul(e[o],r[i]);return n};ce.mod=function(e,r){let n=new Uint8Array(e);for(;n.length-r.length>=0;){let o=n[0];for(let s=0;s<r.length;s++)n[s]^=at.mul(r[s],o);let i=0;for(;i<n.length&&n[i]===0;)i++;n=n.slice(i)}return n};ce.generateECPolynomial=function(e){let r=new Uint8Array([1]);for(let n=0;n<e;n++)r=ce.mul(r,new Uint8Array([1,at.exp(n)]));return r}});var Dr=p(($i,Or)=>{var Fr=Lr();function lt(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}lt.prototype.initialize=function(e){this.degree=e,this.genPoly=Fr.generateECPolynomial(this.degree)};lt.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let r=new Uint8Array(e.length+this.degree);r.set(e);let n=Fr.mod(r,this.genPoly),o=this.degree-n.length;if(o>0){let i=new Uint8Array(this.degree);return i.set(n,o),i}return n};Or.exports=lt});var ct=p(_r=>{_r.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}});var ut=p(O=>{var $r="[0-9]+",bs="[A-Z $%*+\\-./:]+",ue="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ue=ue.replace(/u/g,"\\u");var ws="(?:(?![A-Z0-9 $%*+\\-./:]|"+ue+`)(?:.|[\r
|
|
2
|
-
]))+`;
|
|
3
|
-
Make sure your charset is UTF-8`);
|
|
4
|
-
Suggested mode is: `+
|
|
1
|
+
"use strict";var PolicyPdfGenerator=(()=>{var lu=Object.create;var Ht=Object.defineProperty;var cu=Object.getOwnPropertyDescriptor;var fu=Object.getOwnPropertyNames;var hu=Object.getPrototypeOf,pu=Object.prototype.hasOwnProperty;var ne=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var B=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Si=(e,t)=>{for(var n in t)Ht(e,n,{get:t[n],enumerable:!0})},Ei=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fu(t))!pu.call(e,i)&&i!==n&&Ht(e,i,{get:()=>t[i],enumerable:!(r=cu(t,i))||r.enumerable});return e};var de=(e,t,n)=>(n=e!=null?lu(hu(e)):{},Ei(t||!e||!e.__esModule?Ht(n,"default",{value:e,enumerable:!0}):n,e)),du=e=>Ei(Ht({},"__esModule",{value:!0}),e);var Bi=B((Kh,Pi)=>{function gu(e){this.value=e,this.match=function(t){return this.value>=t.height}}function xu(e){this.value=e,this.match=function(t){return this.value<t.height}}function yu(e){this.value=e,this.match=function(t){return this.value>=t.width}}function wu(e){this.value=e,this.match=function(t){return this.value<t.width}}function bu(e){this.value=e,this.match=function(t){return this.value===t.orientation}}Pi.exports=function(t,n){switch(t){case"max-height":return new gu(n);case"min-height":return new xu(n);case"max-width":return new yu(n);case"min-width":return new wu(n);case"orientation":return new bu(n);default:throw new Error(n)}}});var Li=B((Xh,Ri)=>{function ku(e,t){this.left=e,this.right=t,this.match=function(n){return e.match(n)&&t.match(n)}}function Cu(e,t){this.left=e,this.right=t,this.match=function(n){return e.match(n)||t.match(n)}}Ri.exports=function(t,n,r){switch(t){case"and":return new ku(n,r);case",":return new Cu(n,r);default:throw new Error(value)}}});var Mi=B((Zh,_i)=>{var Su=Bi(),Eu=Li(),Fi=/[0-9]/,Vn=/[a-z|\-]/i,Iu=/\s/,zi=/:/,Au=/,/,Tu=/and$/,Pu=/@/;function Bu(e){for(var t=0,n=[];t<e.length;){var r=e[t];if(Pu.test(r))for(r=e[++t];Vn.test(r)&&r!==void 0;)r=e[++t];if(Iu.test(r)||r===")"||r==="("){t++;continue}if(zi.test(r)||Au.test(r)){t++,n.push({type:"operator",value:r});continue}if(Fi.test(r)){for(var i="";Fi.test(r);)i+=r,r=e[++t];n.push({type:"number",value:i});continue}if(Vn.test(r)){for(var i="";Vn.test(r)&&r!==void 0;)i+=r,r=e[++t];Tu.test(i)?n.push({type:"operator",value:i}):n.push({type:"literal",value:i});continue}throw new TypeError("Tokenizer: I dont know what this character is: "+r)}return n}function Ru(e){for(var t=[],n=[];e.length>0;){var r=e.shift();if(r.type==="number"||r.type==="literal"){t.push(r);continue}if(r.type==="operator"){if(zi.test(r.value)){r={type:"query",key:t.pop(),value:e.shift()},t.push(r);continue}for(;n.length>0;)t.unshift(n.pop());n.push(r)}}for(;n.length>0;)t.unshift(n.pop());function i(){var o=t.shift();if(o.type==="number")return parseInt(o.value);if(o.type==="literal")return o.value;if(o.type==="operator"){var s=i(),a=i();return Eu(o.value,s,a)}if(o.type==="query"){var s=o.key.value,a=o.value.value;return Su(s,a)}}return i()}_i.exports={parse:function(e){var t=Bu(e),n=Ru(t);return n}}});var Ni=B((ep,vi)=>{var Lu=Mi();vi.exports=function(e,t){var n={};return Object.keys(e).forEach(function(r){Lu.parse(r).match(t)&&Object.assign(n,e[r])}),n}});var Di=B((tp,Oi)=>{var Fu=function(e,t,n){if(e==null)return[0,0,0];var r=(1-Math.abs(2*n-1))*t,i=e/60,o=r*(1-Math.abs(i%2-1));i=Math.floor(i);var s,a,u;i===0?(s=r,a=o,u=0):i===1?(s=o,a=r,u=0):i===2?(s=0,a=r,u=o):i===3?(s=0,a=o,u=r):i===4?(s=o,a=0,u=r):i===5&&(s=r,a=0,u=o);var l=n-r/2;return s+=l,a+=l,u+=l,[Math.abs(Math.round(s*255)),Math.abs(Math.round(a*255)),Math.abs(Math.round(u*255))]};Oi.exports=Fu});var Vi=B((np,qi)=>{var zu=Di();function Un(e,t){return e>t?t:e}function jn(e,t){return e<t?t:e}function _u(e){for(e=Un(e,1e7),e=jn(e,-1e7);e<0;)e+=360;for(;e>359;)e-=360;return e}function Mu(e,t,n){e=_u(e),t=jn(Un(t,100),0),n=jn(Un(n,100),0),t/=100,n/=100;var r=zu(e,t,n);return"#"+r.map(function(i){return(256+i).toString(16).substr(-2)}).join("")}qi.exports=Mu});var ji=B((rp,Ui)=>{"use strict";Ui.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var $i=B((ip,Hi)=>{Hi.exports=function(t){return!t||typeof t=="string"?!1:t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&t.constructor.name!=="String")}});var Yi=B((op,Qi)=>{"use strict";var vu=$i(),Nu=Array.prototype.concat,Ou=Array.prototype.slice,Wi=Qi.exports=function(t){for(var n=[],r=0,i=t.length;r<i;r++){var o=t[r];vu(o)?n=Nu.call(n,Ou.call(o)):n.push(o)}return n};Wi.wrap=function(e){return function(){return e(Wi(arguments))}}});var Xi=B((sp,Ki)=>{var St=ji(),Et=Yi(),Gi=Object.hasOwnProperty,Ji=Object.create(null);for(Wt in St)Gi.call(St,Wt)&&(Ji[St[Wt]]=Wt);var Wt,le=Ki.exports={to:{},get:{}};le.get=function(e){var t=e.substring(0,3).toLowerCase(),n,r;switch(t){case"hsl":n=le.get.hsl(e),r="hsl";break;case"hwb":n=le.get.hwb(e),r="hwb";break;default:n=le.get.rgb(e),r="rgb";break}return n?{model:r,value:n}:null};le.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,n=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,r=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^(\w+)$/,s=[0,0,0,1],a,u,l;if(a=e.match(n)){for(l=a[2],a=a[1],u=0;u<3;u++){var c=u*2;s[u]=parseInt(a.slice(c,c+2),16)}l&&(s[3]=parseInt(l,16)/255)}else if(a=e.match(t)){for(a=a[1],l=a[3],u=0;u<3;u++)s[u]=parseInt(a[u]+a[u],16);l&&(s[3]=parseInt(l+l,16)/255)}else if(a=e.match(r)){for(u=0;u<3;u++)s[u]=parseInt(a[u+1],0);a[4]&&(a[5]?s[3]=parseFloat(a[4])*.01:s[3]=parseFloat(a[4]))}else if(a=e.match(i)){for(u=0;u<3;u++)s[u]=Math.round(parseFloat(a[u+1])*2.55);a[4]&&(a[5]?s[3]=parseFloat(a[4])*.01:s[3]=parseFloat(a[4]))}else return(a=e.match(o))?a[1]==="transparent"?[0,0,0,0]:Gi.call(St,a[1])?(s=St[a[1]],s[3]=1,s):null:null;for(u=0;u<3;u++)s[u]=Be(s[u],0,255);return s[3]=Be(s[3],0,1),s};le.get.hsl=function(e){if(!e)return null;var t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var r=parseFloat(n[4]),i=(parseFloat(n[1])%360+360)%360,o=Be(parseFloat(n[2]),0,100),s=Be(parseFloat(n[3]),0,100),a=Be(isNaN(r)?1:r,0,1);return[i,o,s,a]}return null};le.get.hwb=function(e){if(!e)return null;var t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var r=parseFloat(n[4]),i=(parseFloat(n[1])%360+360)%360,o=Be(parseFloat(n[2]),0,100),s=Be(parseFloat(n[3]),0,100),a=Be(isNaN(r)?1:r,0,1);return[i,o,s,a]}return null};le.to.hex=function(){var e=Et(arguments);return"#"+Qt(e[0])+Qt(e[1])+Qt(e[2])+(e[3]<1?Qt(Math.round(e[3]*255)):"")};le.to.rgb=function(){var e=Et(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};le.to.rgb.percent=function(){var e=Et(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"};le.to.hsl=function(){var e=Et(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};le.to.hwb=function(){var e=Et(arguments),t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};le.to.keyword=function(e){return Ji[e.slice(0,3)]};function Be(e,t,n){return Math.min(Math.max(t,e),n)}function Qt(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}});var eo=B((ap,Zi)=>{var Hn=40,$n=41,Yt=39,Wn=34,Qn=92,rt=47,Yn=44,Gn=58,Gt=42,Du=117,qu=85,Vu=43,Uu=/^[a-f0-9?-]+$/i;Zi.exports=function(e){for(var t=[],n=e,r,i,o,s,a,u,l,c,f=0,h=n.charCodeAt(f),p=n.length,y=[{nodes:t}],b=0,C,w="",F="",S="";f<p;)if(h<=32){r=f;do r+=1,h=n.charCodeAt(r);while(h<=32);s=n.slice(f,r),o=t[t.length-1],h===$n&&b?S=s:o&&o.type==="div"?(o.after=s,o.sourceEndIndex+=s.length):h===Yn||h===Gn||h===rt&&n.charCodeAt(r+1)!==Gt&&(!C||C&&C.type==="function"&&C.value!=="calc")?F=s:t.push({type:"space",sourceIndex:f,sourceEndIndex:r,value:s}),f=r}else if(h===Yt||h===Wn){r=f,i=h===Yt?"'":'"',s={type:"string",sourceIndex:f,quote:i};do if(a=!1,r=n.indexOf(i,r+1),~r)for(u=r;n.charCodeAt(u-1)===Qn;)u-=1,a=!a;else n+=i,r=n.length-1,s.unclosed=!0;while(a);s.value=n.slice(f+1,r),s.sourceEndIndex=s.unclosed?r:r+1,t.push(s),f=r+1,h=n.charCodeAt(f)}else if(h===rt&&n.charCodeAt(f+1)===Gt)r=n.indexOf("*/",f),s={type:"comment",sourceIndex:f,sourceEndIndex:r+2},r===-1&&(s.unclosed=!0,r=n.length,s.sourceEndIndex=r),s.value=n.slice(f+2,r),t.push(s),f=r+2,h=n.charCodeAt(f);else if((h===rt||h===Gt)&&C&&C.type==="function"&&C.value==="calc")s=n[f],t.push({type:"word",sourceIndex:f-F.length,sourceEndIndex:f+s.length,value:s}),f+=1,h=n.charCodeAt(f);else if(h===rt||h===Yn||h===Gn)s=n[f],t.push({type:"div",sourceIndex:f-F.length,sourceEndIndex:f+s.length,value:s,before:F,after:""}),F="",f+=1,h=n.charCodeAt(f);else if(Hn===h){r=f;do r+=1,h=n.charCodeAt(r);while(h<=32);if(c=f,s={type:"function",sourceIndex:f-w.length,value:w,before:n.slice(c+1,r)},f=r,w==="url"&&h!==Yt&&h!==Wn){r-=1;do if(a=!1,r=n.indexOf(")",r+1),~r)for(u=r;n.charCodeAt(u-1)===Qn;)u-=1,a=!a;else n+=")",r=n.length-1,s.unclosed=!0;while(a);l=r;do l-=1,h=n.charCodeAt(l);while(h<=32);c<l?(f!==l+1?s.nodes=[{type:"word",sourceIndex:f,sourceEndIndex:l+1,value:n.slice(f,l+1)}]:s.nodes=[],s.unclosed&&l+1!==r?(s.after="",s.nodes.push({type:"space",sourceIndex:l+1,sourceEndIndex:r,value:n.slice(l+1,r)})):(s.after=n.slice(l+1,r),s.sourceEndIndex=r)):(s.after="",s.nodes=[]),f=r+1,s.sourceEndIndex=s.unclosed?r:f,h=n.charCodeAt(f),t.push(s)}else b+=1,s.after="",s.sourceEndIndex=f+1,t.push(s),y.push(s),t=s.nodes=[],C=s;w=""}else if($n===h&&b)f+=1,h=n.charCodeAt(f),C.after=S,C.sourceEndIndex+=S.length,S="",b-=1,y[y.length-1].sourceEndIndex=f,y.pop(),C=y[b],t=C.nodes;else{r=f;do h===Qn&&(r+=1),r+=1,h=n.charCodeAt(r);while(r<p&&!(h<=32||h===Yt||h===Wn||h===Yn||h===Gn||h===rt||h===Hn||h===Gt&&C&&C.type==="function"&&C.value==="calc"||h===rt&&C.type==="function"&&C.value==="calc"||h===$n&&b));s=n.slice(f,r),Hn===h?w=s:(Du===s.charCodeAt(0)||qu===s.charCodeAt(0))&&Vu===s.charCodeAt(1)&&Uu.test(s.slice(2))?t.push({type:"unicode-range",sourceIndex:f,sourceEndIndex:r,value:s}):t.push({type:"word",sourceIndex:f,sourceEndIndex:r,value:s}),f=r}for(f=y.length-1;f;f-=1)y[f].unclosed=!0,y[f].sourceEndIndex=n.length;return y[0].nodes}});var no=B((up,to)=>{var Jt=45,Kt=43,Jn=46,ju=101,Hu=69;function $u(e){var t=e.charCodeAt(0),n;if(t===Kt||t===Jt){if(n=e.charCodeAt(1),n>=48&&n<=57)return!0;var r=e.charCodeAt(2);return n===Jn&&r>=48&&r<=57}return t===Jn?(n=e.charCodeAt(1),n>=48&&n<=57):t>=48&&t<=57}to.exports=function(e){var t=0,n=e.length,r,i,o;if(n===0||!$u(e))return!1;for(r=e.charCodeAt(t),(r===Kt||r===Jt)&&t++;t<n&&(r=e.charCodeAt(t),!(r<48||r>57));)t+=1;if(r=e.charCodeAt(t),i=e.charCodeAt(t+1),r===Jn&&i>=48&&i<=57)for(t+=2;t<n&&(r=e.charCodeAt(t),!(r<48||r>57));)t+=1;if(r=e.charCodeAt(t),i=e.charCodeAt(t+1),o=e.charCodeAt(t+2),(r===ju||r===Hu)&&(i>=48&&i<=57||(i===Kt||i===Jt)&&o>=48&&o<=57))for(t+=i===Kt||i===Jt?3:2;t<n&&(r=e.charCodeAt(t),!(r<48||r>57));)t+=1;return{number:e.slice(0,t),unit:e.slice(t)}}});var go=B((dp,mo)=>{mo.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var Fe=B(He=>{var rr,Ol=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];He.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};He.getSymbolTotalCodewords=function(t){return Ol[t]};He.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};He.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');rr=t};He.isKanjiModeEnabled=function(){return typeof rr<"u"};He.toSJIS=function(t){return rr(t)}});var rn=B(me=>{me.L={bit:1};me.M={bit:0};me.Q={bit:3};me.H={bit:2};function Dl(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return me.L;case"m":case"medium":return me.M;case"q":case"quartile":return me.Q;case"h":case"high":return me.H;default:throw new Error("Unknown EC Level: "+e)}}me.isValid=function(t){return t&&typeof t.bit<"u"&&t.bit>=0&&t.bit<4};me.from=function(t,n){if(me.isValid(t))return t;try{return Dl(t)}catch{return n}}});var wo=B((xp,yo)=>{function xo(){this.buffer=[],this.length=0}xo.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};yo.exports=xo});var ko=B((yp,bo)=>{function It(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}It.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)};It.prototype.get=function(e,t){return this.data[e*this.size+t]};It.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n};It.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};bo.exports=It});var Co=B(on=>{var ql=Fe().getSymbolSize;on.getRowColCoords=function(t){if(t===1)return[];let n=Math.floor(t/7)+2,r=ql(t),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,o=[r-7];for(let s=1;s<n-1;s++)o[s]=o[s-1]-i;return o.push(6),o.reverse()};on.getPositions=function(t){let n=[],r=on.getRowColCoords(t),i=r.length;for(let o=0;o<i;o++)for(let s=0;s<i;s++)o===0&&s===0||o===0&&s===i-1||o===i-1&&s===0||n.push([r[o],r[s]]);return n}});var Io=B(Eo=>{var Vl=Fe().getSymbolSize,So=7;Eo.getPositions=function(t){let n=Vl(t);return[[0,0],[n-So,0],[0,n-So]]}});var Ao=B(j=>{j.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var $e={N1:3,N2:3,N3:40,N4:10};j.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7};j.from=function(t){return j.isValid(t)?parseInt(t,10):void 0};j.getPenaltyN1=function(t){let n=t.size,r=0,i=0,o=0,s=null,a=null;for(let u=0;u<n;u++){i=o=0,s=a=null;for(let l=0;l<n;l++){let c=t.get(u,l);c===s?i++:(i>=5&&(r+=$e.N1+(i-5)),s=c,i=1),c=t.get(l,u),c===a?o++:(o>=5&&(r+=$e.N1+(o-5)),a=c,o=1)}i>=5&&(r+=$e.N1+(i-5)),o>=5&&(r+=$e.N1+(o-5))}return r};j.getPenaltyN2=function(t){let n=t.size,r=0;for(let i=0;i<n-1;i++)for(let o=0;o<n-1;o++){let s=t.get(i,o)+t.get(i,o+1)+t.get(i+1,o)+t.get(i+1,o+1);(s===4||s===0)&&r++}return r*$e.N2};j.getPenaltyN3=function(t){let n=t.size,r=0,i=0,o=0;for(let s=0;s<n;s++){i=o=0;for(let a=0;a<n;a++)i=i<<1&2047|t.get(s,a),a>=10&&(i===1488||i===93)&&r++,o=o<<1&2047|t.get(a,s),a>=10&&(o===1488||o===93)&&r++}return r*$e.N3};j.getPenaltyN4=function(t){let n=0,r=t.data.length;for(let o=0;o<r;o++)n+=t.data[o];return Math.abs(Math.ceil(n*100/r/5)-10)*$e.N4};function Ul(e,t,n){switch(e){case j.Patterns.PATTERN000:return(t+n)%2===0;case j.Patterns.PATTERN001:return t%2===0;case j.Patterns.PATTERN010:return n%3===0;case j.Patterns.PATTERN011:return(t+n)%3===0;case j.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(n/3))%2===0;case j.Patterns.PATTERN101:return t*n%2+t*n%3===0;case j.Patterns.PATTERN110:return(t*n%2+t*n%3)%2===0;case j.Patterns.PATTERN111:return(t*n%3+(t+n)%2)%2===0;default:throw new Error("bad maskPattern:"+e)}}j.applyMask=function(t,n){let r=n.size;for(let i=0;i<r;i++)for(let o=0;o<r;o++)n.isReserved(o,i)||n.xor(o,i,Ul(t,o,i))};j.getBestMask=function(t,n){let r=Object.keys(j.Patterns).length,i=0,o=1/0;for(let s=0;s<r;s++){n(s),j.applyMask(s,t);let a=j.getPenaltyN1(t)+j.getPenaltyN2(t)+j.getPenaltyN3(t)+j.getPenaltyN4(t);j.applyMask(s,t),a<o&&(o=a,i=s)}return i}});var or=B(ir=>{var ze=rn(),sn=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],an=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];ir.getBlocksCount=function(t,n){switch(n){case ze.L:return sn[(t-1)*4+0];case ze.M:return sn[(t-1)*4+1];case ze.Q:return sn[(t-1)*4+2];case ze.H:return sn[(t-1)*4+3];default:return}};ir.getTotalCodewordsCount=function(t,n){switch(n){case ze.L:return an[(t-1)*4+0];case ze.M:return an[(t-1)*4+1];case ze.Q:return an[(t-1)*4+2];case ze.H:return an[(t-1)*4+3];default:return}}});var To=B(ln=>{var At=new Uint8Array(512),un=new Uint8Array(256);(function(){let t=1;for(let n=0;n<255;n++)At[n]=t,un[t]=n,t<<=1,t&256&&(t^=285);for(let n=255;n<512;n++)At[n]=At[n-255]})();ln.log=function(t){if(t<1)throw new Error("log("+t+")");return un[t]};ln.exp=function(t){return At[t]};ln.mul=function(t,n){return t===0||n===0?0:At[un[t]+un[n]]}});var Po=B(Tt=>{var sr=To();Tt.mul=function(t,n){let r=new Uint8Array(t.length+n.length-1);for(let i=0;i<t.length;i++)for(let o=0;o<n.length;o++)r[i+o]^=sr.mul(t[i],n[o]);return r};Tt.mod=function(t,n){let r=new Uint8Array(t);for(;r.length-n.length>=0;){let i=r[0];for(let s=0;s<n.length;s++)r[s]^=sr.mul(n[s],i);let o=0;for(;o<r.length&&r[o]===0;)o++;r=r.slice(o)}return r};Tt.generateECPolynomial=function(t){let n=new Uint8Array([1]);for(let r=0;r<t;r++)n=Tt.mul(n,new Uint8Array([1,sr.exp(r)]));return n}});var Lo=B((Ip,Ro)=>{var Bo=Po();function ar(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}ar.prototype.initialize=function(t){this.degree=t,this.genPoly=Bo.generateECPolynomial(this.degree)};ar.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");let n=new Uint8Array(t.length+this.degree);n.set(t);let r=Bo.mod(n,this.genPoly),i=this.degree-r.length;if(i>0){let o=new Uint8Array(this.degree);return o.set(r,i),o}return r};Ro.exports=ar});var ur=B(Fo=>{Fo.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}});var lr=B(Te=>{var zo="[0-9]+",jl="[A-Z $%*+\\-./:]+",Pt="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Pt=Pt.replace(/u/g,"\\u");var Hl="(?:(?![A-Z0-9 $%*+\\-./:]|"+Pt+`)(?:.|[\r
|
|
2
|
+
]))+`;Te.KANJI=new RegExp(Pt,"g");Te.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Te.BYTE=new RegExp(Hl,"g");Te.NUMERIC=new RegExp(zo,"g");Te.ALPHANUMERIC=new RegExp(jl,"g");var $l=new RegExp("^"+Pt+"$"),Wl=new RegExp("^"+zo+"$"),Ql=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Te.testKanji=function(t){return $l.test(t)};Te.testNumeric=function(t){return Wl.test(t)};Te.testAlphanumeric=function(t){return Ql.test(t)}});var _e=B(J=>{var Yl=ur(),cr=lr();J.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};J.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};J.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};J.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};J.MIXED={bit:-1};J.getCharCountIndicator=function(t,n){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!Yl.isValid(n))throw new Error("Invalid version: "+n);return n>=1&&n<10?t.ccBits[0]:n<27?t.ccBits[1]:t.ccBits[2]};J.getBestModeForData=function(t){return cr.testNumeric(t)?J.NUMERIC:cr.testAlphanumeric(t)?J.ALPHANUMERIC:cr.testKanji(t)?J.KANJI:J.BYTE};J.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")};J.isValid=function(t){return t&&t.bit&&t.ccBits};function Gl(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return J.NUMERIC;case"alphanumeric":return J.ALPHANUMERIC;case"kanji":return J.KANJI;case"byte":return J.BYTE;default:throw new Error("Unknown mode: "+e)}}J.from=function(t,n){if(J.isValid(t))return t;try{return Gl(t)}catch{return n}}});var Oo=B(We=>{var cn=Fe(),Jl=or(),_o=rn(),Me=_e(),fr=ur(),vo=7973,Mo=cn.getBCHDigit(vo);function Kl(e,t,n){for(let r=1;r<=40;r++)if(t<=We.getCapacity(r,n,e))return r}function No(e,t){return Me.getCharCountIndicator(e,t)+4}function Xl(e,t){let n=0;return e.forEach(function(r){let i=No(r.mode,t);n+=i+r.getBitsLength()}),n}function Zl(e,t){for(let n=1;n<=40;n++)if(Xl(e,n)<=We.getCapacity(n,t,Me.MIXED))return n}We.from=function(t,n){return fr.isValid(t)?parseInt(t,10):n};We.getCapacity=function(t,n,r){if(!fr.isValid(t))throw new Error("Invalid QR Code version");typeof r>"u"&&(r=Me.BYTE);let i=cn.getSymbolTotalCodewords(t),o=Jl.getTotalCodewordsCount(t,n),s=(i-o)*8;if(r===Me.MIXED)return s;let a=s-No(r,t);switch(r){case Me.NUMERIC:return Math.floor(a/10*3);case Me.ALPHANUMERIC:return Math.floor(a/11*2);case Me.KANJI:return Math.floor(a/13);case Me.BYTE:default:return Math.floor(a/8)}};We.getBestVersionForData=function(t,n){let r,i=_o.from(n,_o.M);if(Array.isArray(t)){if(t.length>1)return Zl(t,i);if(t.length===0)return 1;r=t[0]}else r=t;return Kl(r.mode,r.getLength(),i)};We.getEncodedBits=function(t){if(!fr.isValid(t)||t<7)throw new Error("Invalid QR Code version");let n=t<<12;for(;cn.getBCHDigit(n)-Mo>=0;)n^=vo<<cn.getBCHDigit(n)-Mo;return t<<12|n}});var Uo=B(Vo=>{var hr=Fe(),qo=1335,ec=21522,Do=hr.getBCHDigit(qo);Vo.getEncodedBits=function(t,n){let r=t.bit<<3|n,i=r<<10;for(;hr.getBCHDigit(i)-Do>=0;)i^=qo<<hr.getBCHDigit(i)-Do;return(r<<10|i)^ec}});var Ho=B((Lp,jo)=>{var tc=_e();function st(e){this.mode=tc.NUMERIC,this.data=e.toString()}st.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};st.prototype.getLength=function(){return this.data.length};st.prototype.getBitsLength=function(){return st.getBitsLength(this.data.length)};st.prototype.write=function(t){let n,r,i;for(n=0;n+3<=this.data.length;n+=3)r=this.data.substr(n,3),i=parseInt(r,10),t.put(i,10);let o=this.data.length-n;o>0&&(r=this.data.substr(n),i=parseInt(r,10),t.put(i,o*3+1))};jo.exports=st});var Wo=B((Fp,$o)=>{var nc=_e(),pr=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function at(e){this.mode=nc.ALPHANUMERIC,this.data=e}at.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};at.prototype.getLength=function(){return this.data.length};at.prototype.getBitsLength=function(){return at.getBitsLength(this.data.length)};at.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let r=pr.indexOf(this.data[n])*45;r+=pr.indexOf(this.data[n+1]),t.put(r,11)}this.data.length%2&&t.put(pr.indexOf(this.data[n]),6)};$o.exports=at});var Yo=B((zp,Qo)=>{var rc=_e();function ut(e){this.mode=rc.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}ut.getBitsLength=function(t){return t*8};ut.prototype.getLength=function(){return this.data.length};ut.prototype.getBitsLength=function(){return ut.getBitsLength(this.data.length)};ut.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)};Qo.exports=ut});var Jo=B((_p,Go)=>{var ic=_e(),oc=Fe();function lt(e){this.mode=ic.KANJI,this.data=e}lt.getBitsLength=function(t){return t*13};lt.prototype.getLength=function(){return this.data.length};lt.prototype.getBitsLength=function(){return lt.getBitsLength(this.data.length)};lt.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=oc.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
|
|
3
|
+
Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}};Go.exports=lt});var Ko=B((Mp,dr)=>{"use strict";var Bt={single_source_shortest_paths:function(e,t,n){var r={},i={};i[t]=0;var o=Bt.PriorityQueue.make();o.push(t,0);for(var s,a,u,l,c,f,h,p,y;!o.empty();){s=o.pop(),a=s.value,l=s.cost,c=e[a]||{};for(u in c)c.hasOwnProperty(u)&&(f=c[u],h=l+f,p=i[u],y=typeof i[u]>"u",(y||p>h)&&(i[u]=h,o.push(u,h),r[u]=a))}if(typeof n<"u"&&typeof i[n]>"u"){var b=["Could not find a path from ",t," to ",n,"."].join("");throw new Error(b)}return r},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t,i;r;)n.push(r),i=e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,n){var r=Bt.single_source_shortest_paths(e,t,n);return Bt.extract_shortest_path_from_predecessor_list(r,n)},PriorityQueue:{make:function(e){var t=Bt.PriorityQueue,n={},r;e=e||{};for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n.queue=[],n.sorter=e.sorter||t.default_sorter,n},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof dr<"u"&&(dr.exports=Bt)});var os=B(ct=>{var O=_e(),es=Ho(),ts=Wo(),ns=Yo(),rs=Jo(),Rt=lr(),fn=Fe(),sc=Ko();function Xo(e){return unescape(encodeURIComponent(e)).length}function Lt(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function is(e){let t=Lt(Rt.NUMERIC,O.NUMERIC,e),n=Lt(Rt.ALPHANUMERIC,O.ALPHANUMERIC,e),r,i;return fn.isKanjiModeEnabled()?(r=Lt(Rt.BYTE,O.BYTE,e),i=Lt(Rt.KANJI,O.KANJI,e)):(r=Lt(Rt.BYTE_KANJI,O.BYTE,e),i=[]),t.concat(n,r,i).sort(function(s,a){return s.index-a.index}).map(function(s){return{data:s.data,mode:s.mode,length:s.length}})}function mr(e,t){switch(t){case O.NUMERIC:return es.getBitsLength(e);case O.ALPHANUMERIC:return ts.getBitsLength(e);case O.KANJI:return rs.getBitsLength(e);case O.BYTE:return ns.getBitsLength(e)}}function ac(e){return e.reduce(function(t,n){let r=t.length-1>=0?t[t.length-1]:null;return r&&r.mode===n.mode?(t[t.length-1].data+=n.data,t):(t.push(n),t)},[])}function uc(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];switch(r.mode){case O.NUMERIC:t.push([r,{data:r.data,mode:O.ALPHANUMERIC,length:r.length},{data:r.data,mode:O.BYTE,length:r.length}]);break;case O.ALPHANUMERIC:t.push([r,{data:r.data,mode:O.BYTE,length:r.length}]);break;case O.KANJI:t.push([r,{data:r.data,mode:O.BYTE,length:Xo(r.data)}]);break;case O.BYTE:t.push([{data:r.data,mode:O.BYTE,length:Xo(r.data)}])}}return t}function lc(e,t){let n={},r={start:{}},i=["start"];for(let o=0;o<e.length;o++){let s=e[o],a=[];for(let u=0;u<s.length;u++){let l=s[u],c=""+o+u;a.push(c),n[c]={node:l,lastCount:0},r[c]={};for(let f=0;f<i.length;f++){let h=i[f];n[h]&&n[h].node.mode===l.mode?(r[h][c]=mr(n[h].lastCount+l.length,l.mode)-mr(n[h].lastCount,l.mode),n[h].lastCount+=l.length):(n[h]&&(n[h].lastCount=l.length),r[h][c]=mr(l.length,l.mode)+4+O.getCharCountIndicator(l.mode,t))}}i=a}for(let o=0;o<i.length;o++)r[i[o]].end=0;return{map:r,table:n}}function Zo(e,t){let n,r=O.getBestModeForData(e);if(n=O.from(t,r),n!==O.BYTE&&n.bit<r.bit)throw new Error('"'+e+'" cannot be encoded with mode '+O.toString(n)+`.
|
|
4
|
+
Suggested mode is: `+O.toString(r));switch(n===O.KANJI&&!fn.isKanjiModeEnabled()&&(n=O.BYTE),n){case O.NUMERIC:return new es(e);case O.ALPHANUMERIC:return new ts(e);case O.KANJI:return new rs(e);case O.BYTE:return new ns(e)}}ct.fromArray=function(t){return t.reduce(function(n,r){return typeof r=="string"?n.push(Zo(r,null)):r.data&&n.push(Zo(r.data,r.mode)),n},[])};ct.fromString=function(t,n){let r=is(t,fn.isKanjiModeEnabled()),i=uc(r),o=lc(i,n),s=sc.find_path(o.map,"start","end"),a=[];for(let u=1;u<s.length-1;u++)a.push(o.table[s[u]].node);return ct.fromArray(ac(a))};ct.rawSplit=function(t){return ct.fromArray(is(t,fn.isKanjiModeEnabled()))}});var as=B(ss=>{var pn=Fe(),gr=rn(),cc=wo(),fc=ko(),hc=Co(),pc=Io(),wr=Ao(),br=or(),dc=Lo(),hn=Oo(),mc=Uo(),gc=_e(),xr=os();function xc(e,t){let n=e.size,r=pc.getPositions(t);for(let i=0;i<r.length;i++){let o=r[i][0],s=r[i][1];for(let a=-1;a<=7;a++)if(!(o+a<=-1||n<=o+a))for(let u=-1;u<=7;u++)s+u<=-1||n<=s+u||(a>=0&&a<=6&&(u===0||u===6)||u>=0&&u<=6&&(a===0||a===6)||a>=2&&a<=4&&u>=2&&u<=4?e.set(o+a,s+u,!0,!0):e.set(o+a,s+u,!1,!0))}}function yc(e){let t=e.size;for(let n=8;n<t-8;n++){let r=n%2===0;e.set(n,6,r,!0),e.set(6,n,r,!0)}}function wc(e,t){let n=hc.getPositions(t);for(let r=0;r<n.length;r++){let i=n[r][0],o=n[r][1];for(let s=-2;s<=2;s++)for(let a=-2;a<=2;a++)s===-2||s===2||a===-2||a===2||s===0&&a===0?e.set(i+s,o+a,!0,!0):e.set(i+s,o+a,!1,!0)}}function bc(e,t){let n=e.size,r=hn.getEncodedBits(t),i,o,s;for(let a=0;a<18;a++)i=Math.floor(a/3),o=a%3+n-8-3,s=(r>>a&1)===1,e.set(i,o,s,!0),e.set(o,i,s,!0)}function yr(e,t,n){let r=e.size,i=mc.getEncodedBits(t,n),o,s;for(o=0;o<15;o++)s=(i>>o&1)===1,o<6?e.set(o,8,s,!0):o<8?e.set(o+1,8,s,!0):e.set(r-15+o,8,s,!0),o<8?e.set(8,r-o-1,s,!0):o<9?e.set(8,15-o-1+1,s,!0):e.set(8,15-o-1,s,!0);e.set(r-8,8,1,!0)}function kc(e,t){let n=e.size,r=-1,i=n-1,o=7,s=0;for(let a=n-1;a>0;a-=2)for(a===6&&a--;;){for(let u=0;u<2;u++)if(!e.isReserved(i,a-u)){let l=!1;s<t.length&&(l=(t[s]>>>o&1)===1),e.set(i,a-u,l),o--,o===-1&&(s++,o=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function Cc(e,t,n){let r=new cc;n.forEach(function(u){r.put(u.mode.bit,4),r.put(u.getLength(),gc.getCharCountIndicator(u.mode,e)),u.write(r)});let i=pn.getSymbolTotalCodewords(e),o=br.getTotalCodewordsCount(e,t),s=(i-o)*8;for(r.getLengthInBits()+4<=s&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);let a=(s-r.getLengthInBits())/8;for(let u=0;u<a;u++)r.put(u%2?17:236,8);return Sc(r,e,t)}function Sc(e,t,n){let r=pn.getSymbolTotalCodewords(t),i=br.getTotalCodewordsCount(t,n),o=r-i,s=br.getBlocksCount(t,n),a=r%s,u=s-a,l=Math.floor(r/s),c=Math.floor(o/s),f=c+1,h=l-c,p=new dc(h),y=0,b=new Array(s),C=new Array(s),w=0,F=new Uint8Array(e.buffer);for(let v=0;v<s;v++){let H=v<u?c:f;b[v]=F.slice(y,y+H),C[v]=p.encode(b[v]),y+=H,w=Math.max(w,H)}let S=new Uint8Array(r),q=0,M,x;for(M=0;M<w;M++)for(x=0;x<s;x++)M<b[x].length&&(S[q++]=b[x][M]);for(M=0;M<h;M++)for(x=0;x<s;x++)S[q++]=C[x][M];return S}function Ec(e,t,n,r){let i;if(Array.isArray(e))i=xr.fromArray(e);else if(typeof e=="string"){let l=t;if(!l){let c=xr.rawSplit(e);l=hn.getBestVersionForData(c,n)}i=xr.fromString(e,l||40)}else throw new Error("Invalid data");let o=hn.getBestVersionForData(i,n);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=o;else if(t<o)throw new Error(`
|
|
5
5
|
The chosen QR Code version cannot contain this amount of data.
|
|
6
|
-
Minimum version required to store current data is: `+
|
|
7
|
-
`);let s=
|
|
8
|
-
`;return typeof
|
|
6
|
+
Minimum version required to store current data is: `+o+`.
|
|
7
|
+
`);let s=Cc(t,n,i),a=pn.getSymbolSize(t),u=new fc(a);return xc(u,t),yc(u),wc(u,t),yr(u,n,0),t>=7&&bc(u,t),kc(u,s),isNaN(r)&&(r=wr.getBestMask(u,yr.bind(null,u,n))),wr.applyMask(r,u),yr(u,n,r),{modules:u,version:t,errorCorrectionLevel:n,maskPattern:r,segments:i}}ss.create=function(t,n){if(typeof t>"u"||t==="")throw new Error("No input text");let r=gr.M,i,o;return typeof n<"u"&&(r=gr.from(n.errorCorrectionLevel,gr.M),i=hn.from(n.version),o=wr.from(n.maskPattern),n.toSJISFunc&&pn.setToSJISFunction(n.toSJISFunc)),Ec(t,i,r,o)}});var kr=B(Qe=>{function us(e){if(typeof e=="number"&&(e=e.toString()),typeof e!="string")throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||t.length===5||t.length>8)throw new Error("Invalid hex color: "+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(r){return[r,r]}))),t.length===6&&t.push("F","F");let n=parseInt(t.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+t.slice(0,6).join("")}}Qe.getOptions=function(t){t||(t={}),t.color||(t.color={});let n=typeof t.margin>"u"||t.margin===null||t.margin<0?4:t.margin,r=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:us(t.color.dark||"#000000ff"),light:us(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}};Qe.getScale=function(t,n){return n.width&&n.width>=t+n.margin*2?n.width/(t+n.margin*2):n.scale};Qe.getImageWidth=function(t,n){let r=Qe.getScale(t,n);return Math.floor((t+n.margin*2)*r)};Qe.qrToImageData=function(t,n,r){let i=n.modules.size,o=n.modules.data,s=Qe.getScale(i,r),a=Math.floor((i+r.margin*2)*s),u=r.margin*s,l=[r.color.light,r.color.dark];for(let c=0;c<a;c++)for(let f=0;f<a;f++){let h=(c*a+f)*4,p=r.color.light;if(c>=u&&f>=u&&c<a-u&&f<a-u){let y=Math.floor((c-u)/s),b=Math.floor((f-u)/s);p=l[o[y*i+b]?1:0]}t[h++]=p.r,t[h++]=p.g,t[h++]=p.b,t[h]=p.a}}});var ls=B(dn=>{var Cr=kr();function Ic(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=n,t.width=n,t.style.height=n+"px",t.style.width=n+"px"}function Ac(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}dn.render=function(t,n,r){let i=r,o=n;typeof i>"u"&&(!n||!n.getContext)&&(i=n,n=void 0),n||(o=Ac()),i=Cr.getOptions(i);let s=Cr.getImageWidth(t.modules.size,i),a=o.getContext("2d"),u=a.createImageData(s,s);return Cr.qrToImageData(u.data,t,i),Ic(a,o,s),a.putImageData(u,0,0),o};dn.renderToDataURL=function(t,n,r){let i=r;typeof i>"u"&&(!n||!n.getContext)&&(i=n,n=void 0),i||(i={});let o=dn.render(t,n,i),s=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(s,a.quality)}});var hs=B(fs=>{var Tc=kr();function cs(e,t){let n=e.a/255,r=t+'="'+e.hex+'"';return n<1?r+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function Sr(e,t,n){let r=e+t;return typeof n<"u"&&(r+=" "+n),r}function Pc(e,t,n){let r="",i=0,o=!1,s=0;for(let a=0;a<e.length;a++){let u=Math.floor(a%t),l=Math.floor(a/t);!u&&!o&&(o=!0),e[a]?(s++,a>0&&u>0&&e[a-1]||(r+=o?Sr("M",u+n,.5+l+n):Sr("m",i,0),i=0,o=!1),u+1<t&&e[a+1]||(r+=Sr("h",s),s=0)):i++}return r}fs.render=function(t,n,r){let i=Tc.getOptions(n),o=t.modules.size,s=t.modules.data,a=o+i.margin*2,u=i.color.light.a?"<path "+cs(i.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",l="<path "+cs(i.color.dark,"stroke")+' d="'+Pc(s,o,i.margin)+'"/>',c='viewBox="0 0 '+a+" "+a+'"',h='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+c+' shape-rendering="crispEdges">'+u+l+`</svg>
|
|
8
|
+
`;return typeof r=="function"&&r(null,h),h}});var ds=B(Ft=>{var Bc=go(),Er=as(),ps=ls(),Rc=hs();function Ir(e,t,n,r,i){let o=[].slice.call(arguments,1),s=o.length,a=typeof o[s-1]=="function";if(!a&&!Bc())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(i=n,n=t,t=r=void 0):s===3&&(t.getContext&&typeof i>"u"?(i=r,r=void 0):(i=r,r=n,n=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(n=t,t=r=void 0):s===2&&!t.getContext&&(r=n,n=t,t=void 0),new Promise(function(u,l){try{let c=Er.create(n,r);u(e(c,t,r))}catch(c){l(c)}})}try{let u=Er.create(n,r);i(null,e(u,t,r))}catch(u){i(u)}}Ft.create=Er.create;Ft.toCanvas=Ir.bind(null,ps.render);Ft.toDataURL=Ir.bind(null,ps.renderToDataURL);Ft.toString=Ir.bind(null,function(e,t,n){return Rc.render(e,n)})});var Ua=B((Yx,Va)=>{"use strict";var Mn=Object.prototype.hasOwnProperty,qa=Object.prototype.toString,_a=Object.defineProperty,Ma=Object.getOwnPropertyDescriptor,va=function(t){return typeof Array.isArray=="function"?Array.isArray(t):qa.call(t)==="[object Array]"},Na=function(t){if(!t||qa.call(t)!=="[object Object]")return!1;var n=Mn.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Mn.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Mn.call(t,i)},Oa=function(t,n){_a&&n.name==="__proto__"?_a(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Da=function(t,n){if(n==="__proto__")if(Mn.call(t,n)){if(Ma)return Ma(t,n).value}else return;return t[n]};Va.exports=function e(){var t,n,r,i,o,s,a=arguments[0],u=1,l=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});u<l;++u)if(t=arguments[u],t!=null)for(n in t)r=Da(a,n),i=Da(t,n),a!==i&&(c&&i&&(Na(i)||(o=va(i)))?(o?(o=!1,s=r&&va(r)?r:[]):s=r&&Na(r)?r:{},Oa(a,{name:n,newValue:e(c,s,i)})):typeof i<"u"&&Oa(a,{name:n,newValue:i}));return a}});var Yh={};Si(Yh,{generatePdf:()=>Qh});var eu=ne("@react-pdf/renderer"),tu=de(ne("react"));var On=ne("@react-pdf/renderer");var ot=ne("@react-pdf/renderer");var Ii=e=>Array.isArray(e)?e:[e],Ai=(...e)=>(t,...n)=>{let r=t,i=e.slice().reverse();for(let o=0;o<i.length;o+=1){let s=i[o];r=s(r,...n)}return r};var mu=e=>/((-)?\d+\.?\d*)%/g.exec(`${e}`),Ti=e=>{let t=mu(e);if(t){let n=parseFloat(t[1]);return{percent:n/100,value:n}}return null};var $t=e=>typeof e=="string"?Number.parseFloat(e):e;var Wu=de(Ni(),1),ao=de(Vi(),1),tn=de(Xi(),1),uo=de(eo(),1),lo=de(no(),1),Qu=e=>e.filter(Boolean),Yu=e=>e.reduce((t,n)=>{let r=Array.isArray(n)?er(n):n;return Object.keys(r).forEach(i=>{r[i]!==null&&r[i]!==void 0&&(t[i]=r[i])}),t},{}),er=Ai(Yu,Qu,Ii);var Gu=e=>/rgba?/g.test(e),Ju=e=>/hsla?/g.test(e),Ku=e=>{let t=tn.default.get.rgb(e);return tn.default.to.hex(t)},Xu=e=>{let t=tn.default.get.hsl(e).map(Math.round);return(0,ao.default)(...t).toUpperCase()},co=e=>Gu(e)?Ku(e):Ju(e)?Xu(e):e,Zu=e=>{if(typeof e=="number")return{value:e,unit:void 0};let t=/^(-?\d*\.?\d+)(in|mm|cm|pt|vh|vw|px|rem)?$/g.exec(e);return t?{value:parseFloat(t[1]),unit:t[2]||"pt"}:{value:e,unit:void 0}},Z=(e,t)=>{let n=Zu(t),r=72,i=e.dpi||72,o=1/25.4*r,s=1/2.54*r;if(typeof n.value!="number")return n.value;switch(n.unit){case"rem":return n.value*(e.remBase||18);case"in":return n.value*r;case"mm":return n.value*o;case"cm":return n.value*s;case"vh":return n.value*(e.height/100);case"vw":return n.value*(e.width/100);case"px":return Math.round(n.value*(r/i));default:return n.value}},Re=(e,t)=>({[e]:$t(t)}),W=(e,t,n)=>({[e]:Z(n,t)}),Ae=(e,t)=>({[e]:co(t)}),_=(e,t)=>({[e]:t}),el=/(-?\d+(\.\d+)?(in|mm|cm|pt|vw|vh|px|rem)?)\s(\S+)\s(.+)/,tl=e=>e.match(el)||[],Ie=(e,t,n)=>{let r=tl(`${t}`);if(r){let i=r[1]||t,o=r[4]||t,s=r[5]||t,a=o,u=s?co(s):void 0,l=i?Z(n,i):void 0;if(e.match(/(Top|Right|Bottom|Left)$/))return{[`${e}Color`]:u,[`${e}Style`]:a,[`${e}Width`]:l};if(e.match(/Color$/))return{borderTopColor:u,borderRightColor:u,borderBottomColor:u,borderLeftColor:u};if(e.match(/Style$/)){if(typeof a=="number")throw new Error(`Invalid border style: ${a}`);return{borderTopStyle:a,borderRightStyle:a,borderBottomStyle:a,borderLeftStyle:a}}if(e.match(/Width$/)){if(typeof l!="number")throw new Error(`Invalid border width: ${l}`);return{borderTopWidth:l,borderRightWidth:l,borderBottomWidth:l,borderLeftWidth:l}}if(e.match(/Radius$/)){let c=t?Z(n,t):void 0;if(typeof c!="number")throw new Error(`Invalid border radius: ${c}`);return{borderTopLeftRadius:c,borderTopRightRadius:c,borderBottomRightRadius:c,borderBottomLeftRadius:c}}if(typeof l!="number")throw new Error(`Invalid border width: ${l}`);if(typeof a=="number")throw new Error(`Invalid border style: ${a}`);return{borderTopColor:u,borderTopStyle:a,borderTopWidth:l,borderRightColor:u,borderRightStyle:a,borderRightWidth:l,borderBottomColor:u,borderBottomStyle:a,borderBottomWidth:l,borderLeftColor:u,borderLeftStyle:a,borderLeftWidth:l}}return{[e]:t}},nl={border:Ie,borderBottom:Ie,borderBottomColor:Ae,borderBottomLeftRadius:W,borderBottomRightRadius:W,borderBottomStyle:_,borderBottomWidth:W,borderColor:Ie,borderLeft:Ie,borderLeftColor:Ae,borderLeftStyle:_,borderLeftWidth:W,borderRadius:Ie,borderRight:Ie,borderRightColor:Ae,borderRightStyle:_,borderRightWidth:W,borderStyle:Ie,borderTop:Ie,borderTopColor:Ae,borderTopLeftRadius:W,borderTopRightRadius:W,borderTopStyle:_,borderTopWidth:W,borderWidth:Ie},rl={backgroundColor:Ae,color:Ae,opacity:Re},il={height:W,maxHeight:W,maxWidth:W,minHeight:W,minWidth:W,width:W},ol=[1,1,0],sl=[1,1,"auto"],al=(e,t,n)=>{let r=ol,i=[];t==="auto"?r=sl:i=`${t}`.split(" ");let o=$t(i[0]||r[0]),s=$t(i[1]||r[1]),a=Z(n,i[2]||r[2]);return{flexGrow:o,flexShrink:s,flexBasis:a}},ul={alignContent:_,alignItems:_,alignSelf:_,flex:al,flexBasis:W,flexDirection:_,flexFlow:_,flexGrow:Re,flexShrink:Re,flexWrap:_,justifyContent:_,justifySelf:_},ll=(e,t,n)=>{let r=`${t}`.split(" "),i=Z(n,r?.[0]||t),o=Z(n,r?.[1]||t);return{rowGap:i,columnGap:o}},cl={gap:ll,columnGap:W,rowGap:W},fl={aspectRatio:Re,bottom:W,display:_,left:W,position:_,right:W,top:W,overflow:_,zIndex:Re},hl="px,in,mm,cm,pt,%,vw,vh",Kn=(e,t)=>{let n=e.toString();console.error(`
|
|
9
9
|
@react-pdf/stylesheet parsing error:
|
|
10
|
-
${
|
|
11
|
-
${" ".repeat(
|
|
12
|
-
Unsupported ${
|
|
13
|
-
`)},$=({expandsTo:t,maxValues:e=1,autoSupported:r=!1}={})=>(n,o,i)=>{let s=(0,gr.default)(`${o}`),a=[];for(let u=0;u<s.length;u++){let d=s[u];if(d.type==="function"||d.type==="string"||d.type==="div")return Xe(n,o),{};if(d.type==="word")if(d.value==="auto"&&r)a.push(d.value);else{let c=(0,mr.default)(d.value);if(c&&qo.includes(c.unit))a.push(d.value);else return Xe(n,o),{}}}if(a.length>e)return Xe(n,o),{};let l=T(i,a[0]);if(t){let u=T(i,a[1]||a[0]),d=T(i,a[2]||a[0]),c=T(i,a[3]||a[1]||a[0]);return t({first:l,second:u,third:d,fourth:c})}return{[n]:l}},Vo=$({expandsTo:({first:t,second:e,third:r,fourth:n})=>({marginTop:t,marginRight:e,marginBottom:r,marginLeft:n}),maxValues:4,autoSupported:!0}),jo=$({expandsTo:({first:t,second:e})=>({marginTop:t,marginBottom:e}),maxValues:2,autoSupported:!0}),zo=$({expandsTo:({first:t,second:e})=>({marginRight:t,marginLeft:e}),maxValues:2,autoSupported:!0}),xe=$({autoSupported:!0}),Ho={margin:Vo,marginBottom:xe,marginHorizontal:zo,marginLeft:xe,marginRight:xe,marginTop:xe,marginVertical:jo},Wo=$({expandsTo:({first:t,second:e,third:r,fourth:n})=>({paddingTop:t,paddingRight:e,paddingBottom:r,paddingLeft:n}),maxValues:4}),Jo=$({expandsTo:({first:t,second:e})=>({paddingTop:t,paddingBottom:e}),maxValues:2}),Go=$({expandsTo:({first:t,second:e})=>({paddingRight:t,paddingLeft:e}),maxValues:2}),Te=$(),Yo={padding:Wo,paddingBottom:Te,paddingHorizontal:Go,paddingLeft:Te,paddingRight:Te,paddingTop:Te,paddingVertical:Jo},X=t=>{switch(t){case"top":case"left":return"0%";case"right":case"bottom":return"100%";case"center":return"50%";default:return t}},Ko=(t,e,r)=>{let n=`${e}`.split(" "),o=X(T(r,n?.[0]||e)),i=X(T(r,n?.[1]||e));return{objectPositionX:o,objectPositionY:i}},ur=(t,e,r)=>({[t]:X(T(r,e))}),Qo={objectPosition:Ko,objectPositionX:ur,objectPositionY:ur,objectFit:b},Xo=t=>typeof t=="number"?t:parseInt(t,10),Ze={thin:100,hairline:100,ultralight:200,extralight:200,light:300,normal:400,medium:500,semibold:600,demibold:600,bold:700,ultrabold:800,extrabold:800,heavy:900,black:900},Zo=t=>{if(!t)return Ze.normal;if(typeof t=="number")return t;let e=t.toLowerCase();return Ze[e]?Ze[e]:Xo(t)},es=(t,e)=>({[t]:Zo(e)}),ts=(t,e,r)=>{if(t==="")return t;let n=T(r,e.fontSize||18),o=T(r,t),{percent:i}=Lt(o)||{};return i?i*n:isNaN(t)?o:o*n},rs=(t,e,r,n)=>({[t]:ts(e,n,r)}),ns={direction:b,fontFamily:b,fontSize:A,fontStyle:b,fontWeight:es,letterSpacing:A,lineHeight:rs,maxLines:_,textAlign:b,textDecoration:b,textDecorationColor:F,textDecorationStyle:b,textIndent:b,textOverflow:b,textTransform:b,verticalAlign:b},os=t=>typeof t=="string"&&/^-?\d*\.?\d*$/.test(t),et=t=>typeof t!="string"?t:os(t)?parseFloat(t):t,ss=t=>{let e=t.trim().split(/\)[ ,]|\)/);if(e.length===1)return[[e[0],!0]];let r=[];for(let n=0;n<e.length;n+=1){let o=e[n];if(o){let[i,s]=o.split("("),a=s.indexOf(",")>=0?",":" ",l=s.split(a).map(u=>u.trim());r.push({operation:i.trim(),value:l})}}return r},Se=t=>{let e=/(-?\d*\.?\d*)(\w*)?/i,[,r,n]=e.exec(t),o=Number.parseFloat(r);return n==="rad"?o*180/Math.PI:o},is=({operation:t,value:e})=>{switch(t){case"scale":{let[r,n=r]=e.map(o=>Number.parseFloat(o));return{operation:"scale",value:[r,n]}}case"scaleX":return{operation:"scale",value:[Number.parseFloat(e),1]};case"scaleY":return{operation:"scale",value:[1,Number.parseFloat(e)]};case"rotate":return{operation:"rotate",value:[Se(e)]};case"translate":return{operation:"translate",value:e.map(r=>Number.parseFloat(r))};case"translateX":return{operation:"translate",value:[Number.parseFloat(e),0]};case"translateY":return{operation:"translate",value:[0,Number.parseFloat(e)]};case"skew":return{operation:"skew",value:e.map(Se)};case"skewX":return{operation:"skew",value:[Se(e),0]};case"skewY":return{operation:"skew",value:[0,Se(e)]};default:return{operation:t,value:e.map(r=>Number.parseFloat(r))}}},as=t=>t.map(e=>is(e)),dr=(t,e)=>typeof e!="string"?{[t]:e}:{[t]:as(ss(e))},fr={top:!0,bottom:!0},ls=(t,e)=>fr[t]?1:fr[e]?-1:0,cs=t=>!t||t.length===0?["center","center"]:(t.length===1?[t[0],"center"]:t).sort(ls),us=(t,e,r)=>{let n=`${e}`.split(" "),o=cs(n),i=T(r,o[0]),s=T(r,o[1]);return{transformOriginX:X(i)||et(i),transformOriginY:X(s)||et(s)}},hr=(t,e,r)=>{let n=T(r,e);return{[t]:X(n)||et(n)}},ds={transform:dr,gradientTransform:dr,transformOrigin:us,transformOriginX:hr,transformOriginY:hr},fs={fill:F,stroke:F,strokeDasharray:b,strokeWidth:A,fillOpacity:_,strokeOpacity:_,fillRule:b,textAnchor:b,strokeLinecap:b,strokeLinejoin:b,visibility:b,clipPath:b,dominantBaseline:b},Ti={...Mo,...No,...ko,...Do,...$o,...Uo,...Ho,...Yo,...Qo,...ns,...ds,...fs};var w=M(P("react"),1);function ve(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}var rt=w.default.createContext({style:{borderWidth:1}});function br(t){var{children:e,weightings:r,style:n,tdStyle:o,trStyle:i}=t,s=ve(t,["children","weightings","style","tdStyle","trStyle"]);let a=(0,w.useMemo)(()=>{let c=tt([{borderColor:"#000000",borderWidth:"1px",borderStyle:"solid"},...Array.isArray(n)?n:[n]]);if(typeof c.border=="string"){let[f,m,y]=c.border.split(/\s+/);c.borderWidth=Number.parseFloat(f),c.borderStyle=m,c.borderColor=y}else typeof c.border=="number"&&(c.borderWidth=c.border);return typeof c.borderWidth=="string"&&(c.borderWidth=Number.parseFloat(c.borderWidth)),c},[n]),l=(0,w.useMemo)(()=>{let c=[],f=m=>{w.default.Children.forEach(m,y=>{w.default.isValidElement(y)&&(y.type===w.default.Fragment?f(y.props.children):c.push(y))})};return f(e),c.map((m,y)=>w.default.cloneElement(m,{key:`table_row_${y}`,_firstRow:y===0,_lastRow:y===c.length-1}))},[e]),u=(0,w.useMemo)(()=>[{width:"100%"},...Array.isArray(n)?n:[n],a.borderStyle==="solid"?{border:"0px"}:void 0].filter(Boolean),[n]),d=(0,w.useMemo)(()=>({style:a,weightings:r,tdStyle:o,trStyle:i}),[a,r,o,i]);return w.default.createElement(rt.Provider,{value:d},w.default.createElement(Z.View,Object.assign({},s,{style:u}),l))}function nt(t){var{children:e,style:r,_firstRow:n,_lastRow:o}=t,i=ve(t,["children","style","_firstRow","_lastRow"]);let{trStyle:s,weightings:a}=(0,w.useContext)(rt),l=(0,w.useMemo)(()=>{var u,d;let c=[],f=g=>{w.default.Children.forEach(g,h=>{w.default.isValidElement(h)&&(h.type===w.default.Fragment?f(h.props.children):c.push(h))})};f(e);let m=[];for(let[g,h]of c.entries())!((u=h.props)===null||u===void 0)&&u.weighting?m.push((d=h.props)===null||d===void 0?void 0:d.weighting):m.push(a?.[g]);let y=(1-m.reduce((g,h)=>g+(h||0),0))/(c.length-m.filter(g=>typeof g=="number").length);return m=m.map(g=>g===void 0?y:g),c.map((g,h)=>w.default.cloneElement(g,{weighting:m[h],key:`table_col_${h}_cell`,_firstColumn:h===0,_lastColumn:h===c.length-1,_firstRow:n,_lastRow:o}))},[e,a,n,o]);return w.default.createElement(Z.View,Object.assign({},i,{style:[{display:"flex",flexDirection:"row"},...Array.isArray(s)?s:[s],...Array.isArray(r)?r:[r]]}),l)}function wr(t){var{children:e,style:r}=t,n=ve(t,["children","style"]);return w.default.createElement(nt,Object.assign({},n,{style:[{fontWeight:"bold"},...Array.isArray(r)?r:[r]]}),e)}function Cr(t){var{children:e,weighting:r,_firstColumn:n,_lastColumn:o,_firstRow:i,_lastRow:s}=t,a=ve(t,["children","weighting","_firstColumn","_lastColumn","_firstRow","_lastRow"]);let l=(0,w.useMemo)(()=>{let m=[],y=g=>{w.default.Children.forEach(g,h=>{w.default.isValidElement(h)&&h?.type===w.default.Fragment?y(h.props.children):m.push(h)})};return y(e),m.map((g,h)=>{let S=`table_cell_${h}_content`;return typeof g=="string"||typeof g=="number"?w.default.createElement(Z.Text,{key:S},g):g})},[e]),{tdStyle:u,style:d}=(0,w.useContext)(rt),c=-1*(d.borderWidth||0)+"px",f=(0,w.useMemo)(()=>d.borderStyle==="solid"?{borderTop:`${d.borderWidth||0}px ${d.borderStyle} ${d.borderColor}`,borderRight:`${d.borderWidth||0}px ${d.borderStyle} ${d.borderColor}`,borderBottom:`${d.borderWidth||0}px ${d.borderStyle} ${d.borderColor}`,borderLeft:`${d.borderWidth||0}px ${d.borderStyle} ${d.borderColor}`,margin:`${c} ${o?c:"0"} ${s?c:0} ${c}`}:{borderTop:i?void 0:`${d.borderWidth||0}px ${d.borderStyle} ${d.borderColor}`,borderLeft:n?void 0:`${d.borderWidth||0}px ${d.borderStyle} ${d.borderColor}`},[d,n,o,i,i]);return w.default.createElement(Z.View,Object.assign({wrap:!0},a,{style:[Object.assign(Object.assign({},f),{flex:r??1,display:"flex",flexDirection:"row",alignItems:"center"}),...Array.isArray(u)?u:[u],...Array.isArray(a.style)?a.style:[a.style]]}),l)}var z=P("@react-pdf/renderer");var xn=M(En()),Rt=M(P("react")),Tn=async t=>{let e={margin:0,width:300,color:{dark:"#000",light:"#fff"}};return xn.default.toDataURL(t,e)};function Y(t){let{componentData:e,components:r,data:n,allProps:o={},images:i={}}=t;if(o.key&&delete o.key,o.styles&&delete o.styles,o.index&&delete o.index,o.className&&delete o.className,o.children&&delete o.children,Array.isArray(e)&&e.length>0)return e.map((s,a)=>Y({componentData:{...s,props:{...s.props,index:a}},components:r,data:n,allProps:{},images:i}));if(typeof e=="object"&&e!==null&&"type"in e&&Object.keys(r).includes(e.type)){let{type:s,props:a={},children:l,visible:u="true"}=e,d={...o,...a},c=r[s];if(!c)return console.warn(`Component type "${s}" not found in components object`),null;let f=null;l!==void 0&&(Array.isArray(l)?f=l.map((I,B)=>Y({componentData:I,components:r,data:n,allProps:d,images:i})):typeof l=="object"&&l!==null&&"type"in l?f=Y({componentData:l,components:r,data:n,allProps:d,images:i}):f=l);let m={...d,key:crypto.randomUUID()};s==="Map"&&(m.data=n,m.images=i);let{mappedChild:y,mappedIsVisible:g,...h}=Sn({...m,mappedChild:f,mappedIsVisible:u},n,i);return Pn(g)?Rt.default.createElement(c,h,y):null}return e}function vt(t){let{componentData:e,components:r,data:n,allProps:o={},images:i={}}=t;if(o.key&&delete o.key,o.styles&&delete o.styles,o.index&&delete o.index,o.className&&delete o.className,o.children&&delete o.children,Array.isArray(e)&&e.length>0)return e.map((s,a)=>vt({componentData:{...s,props:{...s.props,index:a}},components:r,data:n,allProps:{},images:i}));if(typeof e=="object"&&e!==null&&"type"in e&&Object.keys(r).includes(e.type)){let{type:s,props:a={},children:l,visible:u="true"}=e,d={...o,...a},c=r[s];if(!c)return console.warn(`Component type "${s}" not found in components object`),null;let f=null;l!==void 0&&(Array.isArray(l)?f=l.map((I,B)=>vt({componentData:I,components:r,data:n,allProps:d,images:i})):typeof l=="object"&&l!==null&&"type"in l?f=vt({componentData:l,components:r,data:n,allProps:d,images:i}):f=l);let m={...d,key:crypto.randomUUID()};s==="Map"&&(m.data=n,m.images=i);let{mappedChild:y,mappedIsVisible:g,...h}=Sn({...m,mappedChild:f,mappedIsVisible:u},n,i);return Pn(g)?Rt.default.createElement(c,h,y):null}return e}var Sn=(t,e,r)=>{let n={$data:e,$props:t,$images:r},o=/\{\{([^}]+)\}\}/g,i=s=>{let a=Array.from(s.matchAll(o));if(a.length===0)return s;if(a.length===1&&a[0][0]===s){let l=a[0][1].trim(),u=An({obj:n,path:l});return u!==void 0?u:s}return a.reduce((l,u)=>{let d=u[1].trim(),c=An({obj:n,path:d}),f=c!==void 0?String(c):u[0];return l.replace(u[0],f)},s)};return Object.fromEntries(Object.entries(t).map(([s,a])=>[s,typeof a=="string"?i(a):a]))},It=t=>{try{return JSON.parse(t)}catch{return null}};function An({obj:t,path:e}){let r=e.split(".").filter(o=>o.length>0),n=t;for(let o of r){if(n==null||!(o in n))return;n=n[o]}return typeof n=="object"?JSON.stringify(n):n}function Pn(code){try{let result=eval(code);return typeof result=="boolean"?result:!1}catch(t){return console.error(`Error evaluating code "${code}":`,t),!1}}function na(t){return new Promise((e,r)=>{let n=new FileReader;n.onload=function(o){let i=o.target?.result;typeof i=="string"?e(i):r(new Error("File content is not a string"))},n.onerror=function(o){r(o)},n.readAsDataURL(t)})}var vn=({items:t,component:e,data:r={},images:n={},itemKeyWord:o="item"})=>{let i=JSON.parse(t);if(!Array.isArray(i))return null;let s=i.map((a,l)=>({...e,props:{...e.props,[o]:a,[`${o}Index`]:l}}));return Y({componentData:s,components:$e,data:r,allProps:{},images:n})};var Rn=P("@react-pdf/renderer"),In=M(P("react"));var Mn=P("react/jsx-runtime"),ii=t=>{let{qrCodeText:e,...r}=t,n=In.default.useMemo(async()=>await Tn(e),[e]);return(0,Mn.jsx)(Rn.Image,{src:n,...r})},Bn=ii;var $e={Page:z.Page,View:z.View,Text:z.Text,Image:z.Image,Table:br,TH:wr,TR:nt,TD:Cr,QrCode:Bn,Map:vn};var kn=P("react/jsx-runtime"),Nn=({data:t,template:e})=>{let r=It(e),n=It(t);(r?.fonts||[]).forEach(l=>{Ue.Font.register(l)});let i=r?.components||[],s=r?.images||{},a=Y({componentData:i,components:$e,data:n||{},allProps:{},images:s});return(0,kn.jsx)(Ue.Document,{children:a})};var ai=async(t,e)=>{try{if(!t||!e)throw new Error("Template and data are required");let r;try{if(r=JSON.parse(t),!r.components||!Array.isArray(r.components))throw new Error("Invalid template structure: missing or invalid components array")}catch(s){throw new Error(`Invalid template JSON: ${s instanceof Error?s.message:"Unknown parsing error"}`)}let n;try{if(n=JSON.parse(e),typeof n!="object"||n===null)throw new Error("Data must be a valid JSON object")}catch(s){throw new Error(`Invalid data JSON: ${s instanceof Error?s.message:"Unknown parsing error"}`)}let o=Fn.default.createElement(Nn,{data:e,template:t});return await(0,Ln.pdf)(o).toBlob()}catch(r){let n=new Error(`PDF generation failed: ${r instanceof Error?r.message:"Unknown error"}`);throw n.originalError=r instanceof Error?r:void 0,n.template=t,n.data=e,n}};return Vn(li);})();
|
|
10
|
+
${n}: ${t},
|
|
11
|
+
${" ".repeat(n.length+2)}^
|
|
12
|
+
Unsupported ${n} value format
|
|
13
|
+
`)},Le=({expandsTo:e,maxValues:t=1,autoSupported:n=!1}={})=>(r,i,o)=>{let s=(0,uo.default)(`${i}`),a=[];for(let l=0;l<s.length;l++){let c=s[l];if(c.type==="function"||c.type==="string"||c.type==="div")return Kn(r,i),{};if(c.type==="word")if(c.value==="auto"&&n)a.push(c.value);else{let f=(0,lo.default)(c.value);if(f&&hl.includes(f.unit))a.push(c.value);else return Kn(r,i),{}}}if(a.length>t)return Kn(r,i),{};let u=Z(o,a[0]);if(e){let l=Z(o,a[1]||a[0]),c=Z(o,a[2]||a[0]),f=Z(o,a[3]||a[1]||a[0]);return e({first:u,second:l,third:c,fourth:f})}return{[r]:u}},pl=Le({expandsTo:({first:e,second:t,third:n,fourth:r})=>({marginTop:e,marginRight:t,marginBottom:n,marginLeft:r}),maxValues:4,autoSupported:!0}),dl=Le({expandsTo:({first:e,second:t})=>({marginTop:e,marginBottom:t}),maxValues:2,autoSupported:!0}),ml=Le({expandsTo:({first:e,second:t})=>({marginRight:e,marginLeft:t}),maxValues:2,autoSupported:!0}),Xt=Le({autoSupported:!0}),gl={margin:pl,marginBottom:Xt,marginHorizontal:ml,marginLeft:Xt,marginRight:Xt,marginTop:Xt,marginVertical:dl},xl=Le({expandsTo:({first:e,second:t,third:n,fourth:r})=>({paddingTop:e,paddingRight:t,paddingBottom:n,paddingLeft:r}),maxValues:4}),yl=Le({expandsTo:({first:e,second:t})=>({paddingTop:e,paddingBottom:t}),maxValues:2}),wl=Le({expandsTo:({first:e,second:t})=>({paddingRight:e,paddingLeft:t}),maxValues:2}),Zt=Le(),bl={padding:xl,paddingBottom:Zt,paddingHorizontal:wl,paddingLeft:Zt,paddingRight:Zt,paddingTop:Zt,paddingVertical:yl},it=e=>{switch(e){case"top":case"left":return"0%";case"right":case"bottom":return"100%";case"center":return"50%";default:return e}},kl=(e,t,n)=>{let r=`${t}`.split(" "),i=it(Z(n,r?.[0]||t)),o=it(Z(n,r?.[1]||t));return{objectPositionX:i,objectPositionY:o}},ro=(e,t,n)=>({[e]:it(Z(n,t))}),Cl={objectPosition:kl,objectPositionX:ro,objectPositionY:ro,objectFit:_},Sl=e=>typeof e=="number"?e:parseInt(e,10),Xn={thin:100,hairline:100,ultralight:200,extralight:200,light:300,normal:400,medium:500,semibold:600,demibold:600,bold:700,ultrabold:800,extrabold:800,heavy:900,black:900},El=e=>{if(!e)return Xn.normal;if(typeof e=="number")return e;let t=e.toLowerCase();return Xn[t]?Xn[t]:Sl(e)},Il=(e,t)=>({[e]:El(t)}),Al=(e,t,n)=>{if(e==="")return e;let r=Z(n,t.fontSize||18),i=Z(n,e),{percent:o}=Ti(i)||{};return o?o*r:isNaN(e)?i:i*r},Tl=(e,t,n,r)=>({[e]:Al(t,r,n)}),Pl={direction:_,fontFamily:_,fontSize:W,fontStyle:_,fontWeight:Il,letterSpacing:W,lineHeight:Tl,maxLines:Re,textAlign:_,textDecoration:_,textDecorationColor:Ae,textDecorationStyle:_,textIndent:_,textOverflow:_,textTransform:_,verticalAlign:_},Bl=e=>typeof e=="string"&&/^-?\d*\.?\d*$/.test(e),Zn=e=>typeof e!="string"?e:Bl(e)?parseFloat(e):e,Rl=e=>{let t=e.trim().split(/\)[ ,]|\)/);if(t.length===1)return[[t[0],!0]];let n=[];for(let r=0;r<t.length;r+=1){let i=t[r];if(i){let[o,s]=i.split("("),a=s.indexOf(",")>=0?",":" ",u=s.split(a).map(l=>l.trim());n.push({operation:o.trim(),value:u})}}return n},en=e=>{let t=/(-?\d*\.?\d*)(\w*)?/i,[,n,r]=t.exec(e),i=Number.parseFloat(n);return r==="rad"?i*180/Math.PI:i},Ll=({operation:e,value:t})=>{switch(e){case"scale":{let[n,r=n]=t.map(i=>Number.parseFloat(i));return{operation:"scale",value:[n,r]}}case"scaleX":return{operation:"scale",value:[Number.parseFloat(t),1]};case"scaleY":return{operation:"scale",value:[1,Number.parseFloat(t)]};case"rotate":return{operation:"rotate",value:[en(t)]};case"translate":return{operation:"translate",value:t.map(n=>Number.parseFloat(n))};case"translateX":return{operation:"translate",value:[Number.parseFloat(t),0]};case"translateY":return{operation:"translate",value:[0,Number.parseFloat(t)]};case"skew":return{operation:"skew",value:t.map(en)};case"skewX":return{operation:"skew",value:[en(t),0]};case"skewY":return{operation:"skew",value:[0,en(t)]};default:return{operation:e,value:t.map(n=>Number.parseFloat(n))}}},Fl=e=>e.map(t=>Ll(t)),io=(e,t)=>typeof t!="string"?{[e]:t}:{[e]:Fl(Rl(t))},oo={top:!0,bottom:!0},zl=(e,t)=>oo[e]?1:oo[t]?-1:0,_l=e=>!e||e.length===0?["center","center"]:(e.length===1?[e[0],"center"]:e).sort(zl),Ml=(e,t,n)=>{let r=`${t}`.split(" "),i=_l(r),o=Z(n,i[0]),s=Z(n,i[1]);return{transformOriginX:it(o)||Zn(o),transformOriginY:it(s)||Zn(s)}},so=(e,t,n)=>{let r=Z(n,t);return{[e]:it(r)||Zn(r)}},vl={transform:io,gradientTransform:io,transformOrigin:Ml,transformOriginX:so,transformOriginY:so},Nl={fill:Ae,stroke:Ae,strokeDasharray:_,strokeWidth:W,fillOpacity:Re,strokeOpacity:Re,fillRule:_,textAnchor:_,strokeLinecap:_,strokeLinejoin:_,visibility:_,clipPath:_,dominantBaseline:_},cp={...nl,...rl,...il,...ul,...cl,...fl,...gl,...bl,...Cl,...Pl,...vl,...Nl};var N=de(ne("react"),1);function nn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}var tr=N.default.createContext({style:{borderWidth:1}});function fo(e){var{children:t,weightings:n,style:r,tdStyle:i,trStyle:o}=e,s=nn(e,["children","weightings","style","tdStyle","trStyle"]);let a=(0,N.useMemo)(()=>{let f=er([{borderColor:"#000000",borderWidth:"1px",borderStyle:"solid"},...Array.isArray(r)?r:[r]]);if(typeof f.border=="string"){let[h,p,y]=f.border.split(/\s+/);f.borderWidth=Number.parseFloat(h),f.borderStyle=p,f.borderColor=y}else typeof f.border=="number"&&(f.borderWidth=f.border);return typeof f.borderWidth=="string"&&(f.borderWidth=Number.parseFloat(f.borderWidth)),f},[r]),u=(0,N.useMemo)(()=>{let f=[],h=p=>{N.default.Children.forEach(p,y=>{N.default.isValidElement(y)&&(y.type===N.default.Fragment?h(y.props.children):f.push(y))})};return h(t),f.map((p,y)=>N.default.cloneElement(p,{key:`table_row_${y}`,_firstRow:y===0,_lastRow:y===f.length-1}))},[t]),l=(0,N.useMemo)(()=>[{width:"100%"},...Array.isArray(r)?r:[r],a.borderStyle==="solid"?{border:"0px"}:void 0].filter(Boolean),[r]),c=(0,N.useMemo)(()=>({style:a,weightings:n,tdStyle:i,trStyle:o}),[a,n,i,o]);return N.default.createElement(tr.Provider,{value:c},N.default.createElement(ot.View,Object.assign({},s,{style:l}),u))}function nr(e){var{children:t,style:n,_firstRow:r,_lastRow:i}=e,o=nn(e,["children","style","_firstRow","_lastRow"]);let{trStyle:s,weightings:a}=(0,N.useContext)(tr),u=(0,N.useMemo)(()=>{var l,c;let f=[],h=b=>{N.default.Children.forEach(b,C=>{N.default.isValidElement(C)&&(C.type===N.default.Fragment?h(C.props.children):f.push(C))})};h(t);let p=[];for(let[b,C]of f.entries())!((l=C.props)===null||l===void 0)&&l.weighting?p.push((c=C.props)===null||c===void 0?void 0:c.weighting):p.push(a?.[b]);let y=(1-p.reduce((b,C)=>b+(C||0),0))/(f.length-p.filter(b=>typeof b=="number").length);return p=p.map(b=>b===void 0?y:b),f.map((b,C)=>N.default.cloneElement(b,{weighting:p[C],key:`table_col_${C}_cell`,_firstColumn:C===0,_lastColumn:C===f.length-1,_firstRow:r,_lastRow:i}))},[t,a,r,i]);return N.default.createElement(ot.View,Object.assign({},o,{style:[{display:"flex",flexDirection:"row"},...Array.isArray(s)?s:[s],...Array.isArray(n)?n:[n]]}),u)}function ho(e){var{children:t,style:n}=e,r=nn(e,["children","style"]);return N.default.createElement(nr,Object.assign({},r,{style:[{fontWeight:"bold"},...Array.isArray(n)?n:[n]]}),t)}function po(e){var{children:t,weighting:n,_firstColumn:r,_lastColumn:i,_firstRow:o,_lastRow:s}=e,a=nn(e,["children","weighting","_firstColumn","_lastColumn","_firstRow","_lastRow"]);let u=(0,N.useMemo)(()=>{let p=[],y=b=>{N.default.Children.forEach(b,C=>{N.default.isValidElement(C)&&C?.type===N.default.Fragment?y(C.props.children):p.push(C)})};return y(t),p.map((b,C)=>{let w=`table_cell_${C}_content`;return typeof b=="string"||typeof b=="number"?N.default.createElement(ot.Text,{key:w},b):b})},[t]),{tdStyle:l,style:c}=(0,N.useContext)(tr),f=-1*(c.borderWidth||0)+"px",h=(0,N.useMemo)(()=>c.borderStyle==="solid"?{borderTop:`${c.borderWidth||0}px ${c.borderStyle} ${c.borderColor}`,borderRight:`${c.borderWidth||0}px ${c.borderStyle} ${c.borderColor}`,borderBottom:`${c.borderWidth||0}px ${c.borderStyle} ${c.borderColor}`,borderLeft:`${c.borderWidth||0}px ${c.borderStyle} ${c.borderColor}`,margin:`${f} ${i?f:"0"} ${s?f:0} ${f}`}:{borderTop:o?void 0:`${c.borderWidth||0}px ${c.borderStyle} ${c.borderColor}`,borderLeft:r?void 0:`${c.borderWidth||0}px ${c.borderStyle} ${c.borderColor}`},[c,r,i,o,o]);return N.default.createElement(ot.View,Object.assign({wrap:!0},a,{style:[Object.assign(Object.assign({},h),{flex:n??1,display:"flex",flexDirection:"row",alignItems:"center"}),...Array.isArray(l)?l:[l],...Array.isArray(a.style)?a.style:[a.style]]}),u)}var qe=ne("@react-pdf/renderer");var gs=de(ds()),Tr=de(ne("react")),xs=async e=>{let t={margin:0,width:300,color:{dark:"#000",light:"#fff"}};return gs.default.toDataURL(e,t)};function Ye(e){let{componentData:t,components:n,data:r,allProps:i={},images:o={}}=e;if(i.key&&delete i.key,i.styles&&delete i.styles,i.index&&delete i.index,i.className&&delete i.className,i.children&&delete i.children,Array.isArray(t)&&t.length>0)return t.map((s,a)=>Ye({componentData:{...s,props:{...s.props,index:a}},components:n,data:r,allProps:{},images:o}));if(typeof t=="object"&&t!==null&&"type"in t&&Object.keys(n).includes(t.type)){let{type:s,props:a={},children:u,visible:l="true"}=t,c={...i,...a},f=n[s];if(!f)return console.warn(`Component type "${s}" not found in components object`),null;let h=null;u!==void 0&&(Array.isArray(u)?h=u.map((F,S)=>Ye({componentData:F,components:n,data:r,allProps:c,images:o})):typeof u=="object"&&u!==null&&"type"in u?h=Ye({componentData:u,components:n,data:r,allProps:c,images:o}):h=u);let p={...c,key:crypto.randomUUID()};s==="Map"&&(p.data=r,p.images=o);let{mappedChild:y,mappedIsVisible:b,...C}=ys({...p,mappedChild:h,mappedIsVisible:l},r,o);return ws(b)?Tr.default.createElement(f,C,y):null}return t}function Ar(e){let{componentData:t,components:n,data:r,allProps:i={},images:o={}}=e;if(i.key&&delete i.key,i.styles&&delete i.styles,i.index&&delete i.index,i.className&&delete i.className,i.children&&delete i.children,Array.isArray(t)&&t.length>0)return t.map((s,a)=>Ar({componentData:{...s,props:{...s.props,index:a}},components:n,data:r,allProps:{},images:o}));if(typeof t=="object"&&t!==null&&"type"in t&&Object.keys(n).includes(t.type)){let{type:s,props:a={},children:u,visible:l="true"}=t,c={...i,...a},f=n[s];if(!f)return console.warn(`Component type "${s}" not found in components object`),null;let h=null;u!==void 0&&(Array.isArray(u)?h=u.map((F,S)=>Ar({componentData:F,components:n,data:r,allProps:c,images:o})):typeof u=="object"&&u!==null&&"type"in u?h=Ar({componentData:u,components:n,data:r,allProps:c,images:o}):h=u);let p={...c,key:crypto.randomUUID()};s==="Map"&&(p.data=r,p.images=o);let{mappedChild:y,mappedIsVisible:b,...C}=ys({...p,mappedChild:h,mappedIsVisible:l},r,o);return ws(b)?Tr.default.createElement(f,C,y):null}return t}var ys=(e,t,n)=>{let r={$data:t,$props:e,$images:n},i=/\{\{([^}]+)\}\}/g,o=s=>{let a=Array.from(s.matchAll(i));if(a.length===0)return s;if(a.length===1&&a[0][0]===s){let u=a[0][1].trim(),l=ms({obj:r,path:u});return l!==void 0?l:s}return a.reduce((u,l)=>{let c=l[1].trim(),f=ms({obj:r,path:c}),h=f!==void 0?String(f):l[0];return u.replace(l[0],h)},s)};return Object.fromEntries(Object.entries(e).map(([s,a])=>[s,typeof a=="string"?o(a):a]))},Pr=e=>{try{return JSON.parse(e)}catch{return null}};function ms({obj:e,path:t}){let n=t.split(".").filter(i=>i.length>0),r=e;for(let i of n){if(r==null||!(i in r))return;r=r[i]}return typeof r=="object"?JSON.stringify(r):r}function ws(code){try{let result=eval(code);return typeof result=="boolean"?result:!1}catch(e){return console.error(`Error evaluating code "${code}":`,e),!1}}function jp(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=function(i){let o=i.target?.result;typeof o=="string"?t(o):n(new Error("File content is not a string"))},r.onerror=function(i){n(i)},r.readAsDataURL(e)})}var bs=({items:e,component:t,data:n={},images:r={},itemKeyWord:i="item"})=>{let o=JSON.parse(e);if(!Array.isArray(o))return null;let s=o.map((a,u)=>({...t,props:{...t.props,[i]:a,[`${i}Index`]:u}}));return Ye({componentData:s,components:mn,data:n,allProps:{},images:r})};var ks=ne("@react-pdf/renderer"),Cs=de(ne("react"));var Es=ne("react/jsx-runtime"),Lc=e=>{let{qrCodeText:t,...n}=e,r=Cs.default.useMemo(async()=>await xs(t),[t]);return(0,Es.jsx)(ks.Image,{src:r,...n})},Ss=Lc;var xi=de(ne("react")),K=ne("@react-pdf/renderer");var Fc={};function Ge(e,t){let n=t||Fc,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return As(e,r,i)}function As(e,t,n){if(zc(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Is(e.children,t,n)}return Array.isArray(e)?Is(e,t,n):""}function Is(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=As(e[i],t,n);return r.join("")}function zc(e){return!!(e&&typeof e=="object")}var Ts=document.createElement("i");function ft(e){let t="&"+e+";";Ts.innerHTML=t;let n=Ts.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function re(e,t,n,r){let i=e.length,o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function oe(e,t){return e.length>0?(re(e,e.length,0,t),e):t}var Ps={}.hasOwnProperty;function Bs(e){let t={},n=-1;for(;++n<e.length;)_c(t,e[n]);return t}function _c(e,t){let n;for(n in t){let i=(Ps.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n],s;if(o)for(s in o){Ps.call(i,s)||(i[s]=[]);let a=o[s];Mc(i[s],Array.isArray(a)?a:a?[a]:[])}}}function Mc(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);re(e,0,0,r)}function gn(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"\uFFFD":String.fromCodePoint(n)}function Pe(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var ce=ve(/[A-Za-z]/),se=ve(/[\dA-Za-z]/),Rs=ve(/[#-'*+\--9=?A-Z^-~]/);function zt(e){return e!==null&&(e<32||e===127)}var _t=ve(/\d/),Ls=ve(/[\dA-Fa-f]/),Fs=ve(/[!-/:-@[-`{-~]/);function E(e){return e!==null&&e<-2}function G(e){return e!==null&&(e<0||e===32)}function A(e){return e===-2||e===-1||e===32}var zs=ve(/\p{P}|\p{S}/u),_s=ve(/\s/);function ve(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function P(e,t,n,r){let i=r?r-1:Number.POSITIVE_INFINITY,o=0;return s;function s(u){return A(u)?(e.enter(n),a(u)):t(u)}function a(u){return A(u)&&o++<i?(e.consume(u),a):(e.exit(n),t(u))}}var Ms={tokenize:vc};function vc(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),P(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){let u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return E(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}var Ns={tokenize:Nc},vs={tokenize:Oc};function Nc(e){let t=this,n=[],r=0,i,o,s;return a;function a(S){if(r<n.length){let q=n[r];return t.containerState=q[1],e.attempt(q[0].continuation,u,l)(S)}return l(S)}function u(S){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&F();let q=t.events.length,M=q,x;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){x=t.events[M][1].end;break}w(r);let v=q;for(;v<t.events.length;)t.events[v][1].end={...x},v++;return re(t.events,M+1,0,t.events.slice(q)),t.events.length=v,l(S)}return a(S)}function l(S){if(r===n.length){if(!i)return h(S);if(i.currentConstruct&&i.currentConstruct.concrete)return y(S);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(vs,c,f)(S)}function c(S){return i&&F(),w(r),h(S)}function f(S){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,y(S)}function h(S){return t.containerState={},e.attempt(vs,p,y)(S)}function p(S){return r++,n.push([t.currentConstruct,t.containerState]),h(S)}function y(S){if(S===null){i&&F(),w(0),e.consume(S);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),b(S)}function b(S){if(S===null){C(e.exit("chunkFlow"),!0),w(0),e.consume(S);return}return E(S)?(e.consume(S),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(S),b)}function C(S,q){let M=t.sliceStream(S);if(q&&M.push(null),S.previous=o,o&&(o.next=S),o=S,i.defineSkip(S.start),i.write(M),t.parser.lazy[S.start.line]){let x=i.events.length;for(;x--;)if(i.events[x][1].start.offset<s&&(!i.events[x][1].end||i.events[x][1].end.offset>s))return;let v=t.events.length,H=v,D,$;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(D){$=t.events[H][1].end;break}D=!0}for(w(r),x=v;x<t.events.length;)t.events[x][1].end={...$},x++;re(t.events,H+1,0,t.events.slice(v)),t.events.length=x}}function w(S){let q=n.length;for(;q-- >S;){let M=n[q];t.containerState=M[1],M[0].exit.call(t,e)}n.length=S}function F(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Oc(e,t,n){return P(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ht(e){if(e===null||G(e)||_s(e))return 1;if(zs(e))return 2}function pt(e,t,n){let r=[],i=-1;for(;++i<e.length;){let o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}var Mt={name:"attention",resolveAll:Dc,tokenize:qc};function Dc(e,t){let n=-1,r,i,o,s,a,u,l,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let f={...e[r][1].end},h={...e[n][1].start};Os(f,-u),Os(h,u),s={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=oe(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=oe(l,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),l=oe(l,pt(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=oe(l,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,l=oe(l,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,re(e,r-1,n-r+3,l),n=r+l.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function qc(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ht(r),o;return s;function s(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;let l=e.exit("attentionSequence"),c=ht(u),f=!c||c===2&&i||n.includes(u),h=!i||i===2&&c||n.includes(r);return l._open=!!(o===42?f:f&&(i||!h)),l._close=!!(o===42?h:h&&(c||!f)),t(u)}}function Os(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Br={name:"autolink",tokenize:Vc};function Vc(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return ce(p)?(e.consume(p),s):p===64?n(p):l(p)}function s(p){return p===43||p===45||p===46||se(p)?(r=1,a(p)):l(p)}function a(p){return p===58?(e.consume(p),r=0,u):(p===43||p===45||p===46||se(p))&&r++<32?(e.consume(p),a):(r=0,l(p))}function u(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||zt(p)?n(p):(e.consume(p),u)}function l(p){return p===64?(e.consume(p),c):Rs(p)?(e.consume(p),l):n(p)}function c(p){return se(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,c):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||se(p))&&r++<63){let y=p===45?h:f;return e.consume(p),y}return n(p)}}var Ne={partial:!0,tokenize:Uc};function Uc(e,t,n){return r;function r(o){return A(o)?P(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||E(o)?t(o):n(o)}}var xn={continuation:{tokenize:Hc},exit:$c,name:"blockQuote",tokenize:jc};function jc(e,t,n){let r=this;return i;function i(s){if(s===62){let a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return A(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Hc(e,t,n){let r=this;return i;function i(s){return A(s)?P(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(xn,t,n)(s)}}function $c(e){e.exit("blockQuote")}var yn={name:"characterEscape",tokenize:Wc};function Wc(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Fs(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}var wn={name:"characterReference",tokenize:Qc};function Qc(e,t,n){let r=this,i=0,o,s;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),u}function u(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,s=se,c(f))}function l(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=Ls,c):(e.enter("characterReferenceValue"),o=7,s=_t,c(f))}function c(f){if(f===59&&i){let h=e.exit("characterReferenceValue");return s===se&&!ft(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&i++<o?(e.consume(f),c):n(f)}}var Ds={partial:!0,tokenize:Gc},bn={concrete:!0,name:"codeFenced",tokenize:Yc};function Yc(e,t,n){let r=this,i={partial:!0,tokenize:M},o=0,s=0,a;return u;function u(x){return l(x)}function l(x){let v=r.events[r.events.length-1];return o=v&&v[1].type==="linePrefix"?v[2].sliceSerialize(v[1],!0).length:0,a=x,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(x)}function c(x){return x===a?(s++,e.consume(x),c):s<3?n(x):(e.exit("codeFencedFenceSequence"),A(x)?P(e,f,"whitespace")(x):f(x))}function f(x){return x===null||E(x)?(e.exit("codeFencedFence"),r.interrupt?t(x):e.check(Ds,b,q)(x)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===null||E(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(x)):A(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),P(e,p,"whitespace")(x)):x===96&&x===a?n(x):(e.consume(x),h)}function p(x){return x===null||E(x)?f(x):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===null||E(x)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(x)):x===96&&x===a?n(x):(e.consume(x),y)}function b(x){return e.attempt(i,q,C)(x)}function C(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),w}function w(x){return o>0&&A(x)?P(e,F,"linePrefix",o+1)(x):F(x)}function F(x){return x===null||E(x)?e.check(Ds,b,q)(x):(e.enter("codeFlowValue"),S(x))}function S(x){return x===null||E(x)?(e.exit("codeFlowValue"),F(x)):(e.consume(x),S)}function q(x){return e.exit("codeFenced"),t(x)}function M(x,v,H){let D=0;return $;function $(R){return x.enter("lineEnding"),x.consume(R),x.exit("lineEnding"),he}function he(R){return x.enter("codeFencedFence"),A(R)?P(x,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):V(R)}function V(R){return R===a?(x.enter("codeFencedFenceSequence"),I(R)):H(R)}function I(R){return R===a?(D++,x.consume(R),I):D>=s?(x.exit("codeFencedFenceSequence"),A(R)?P(x,L,"whitespace")(R):L(R)):H(R)}function L(R){return R===null||E(R)?(x.exit("codeFencedFence"),v(R)):H(R)}}}function Gc(e,t,n){let r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}var vt={name:"codeIndented",tokenize:Kc},Jc={partial:!0,tokenize:Xc};function Kc(e,t,n){let r=this;return i;function i(l){return e.enter("codeIndented"),P(e,o,"linePrefix",5)(l)}function o(l){let c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(l):n(l)}function s(l){return l===null?u(l):E(l)?e.attempt(Jc,s,u)(l):(e.enter("codeFlowValue"),a(l))}function a(l){return l===null||E(l)?(e.exit("codeFlowValue"),s(l)):(e.consume(l),a)}function u(l){return e.exit("codeIndented"),t(l)}}function Xc(e,t,n){let r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):E(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):P(e,o,"linePrefix",5)(s)}function o(s){let a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):E(s)?i(s):n(s)}}var Rr={name:"codeText",previous:ef,resolve:Zc,tokenize:tf};function Zc(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function ef(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function tf(e,t,n){let r=this,i=0,o,s;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),u(h)}function u(h){return h===96?(e.consume(h),i++,u):(e.exit("codeTextSequence"),l(h))}function l(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),l):h===96?(s=e.enter("codeTextSequence"),o=0,f(h)):E(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||E(h)?(e.exit("codeTextData"),l(h)):(e.consume(h),c)}function f(h){return h===96?(e.consume(h),o++,f):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(s.type="codeTextData",c(h))}}var kn=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){let r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){let i=n||0;this.setCursor(Math.trunc(t));let o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Nt(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Nt(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Nt(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let n=this.left.splice(t,Number.POSITIVE_INFINITY);Nt(this.right,n.reverse())}else{let n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Nt(this.left,n.reverse())}}};function Nt(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Cn(e){let t={},n=-1,r,i,o,s,a,u,l,c=new kn(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,nf(c,n)),n=t[n],l=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=c.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},a=c.slice(i,n),a.unshift(r),c.splice(i,n-i+1,a))}}return re(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function nf(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,o=[],s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let a=s.events,u=[],l={},c,f,h=-1,p=n,y=0,b=0,C=[b];for(;p;){for(;e.get(++i)[1]!==p;);o.push(i),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),f&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(b=h+1,C.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):C.pop(),h=C.length;h--;){let w=a.slice(C[h],C[h+1]),F=o.pop();u.push([F,F+w.length-1]),e.splice(F,2,w)}for(u.reverse(),h=-1;++h<u.length;)l[y+u[h][0]]=y+u[h][1],y+=u[h][1]-u[h][0]-1;return l}var Lr={resolve:of,tokenize:sf},rf={partial:!0,tokenize:af};function of(e){return Cn(e),e}function sf(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):E(a)?e.check(rf,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function af(e,t,n){let r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),P(e,o,"linePrefix")}function o(s){if(s===null||E(s))return n(s);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Sn(e,t,n,r,i,o,s,a,u){let l=u||Number.POSITIVE_INFINITY,c=0;return f;function f(w){return w===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(w),e.exit(o),h):w===null||w===32||w===41||zt(w)?n(w):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(w))}function h(w){return w===62?(e.enter(o),e.consume(w),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===62?(e.exit("chunkString"),e.exit(a),h(w)):w===null||w===60||E(w)?n(w):(e.consume(w),w===92?y:p)}function y(w){return w===60||w===62||w===92?(e.consume(w),p):p(w)}function b(w){return!c&&(w===null||w===41||G(w))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(w)):c<l&&w===40?(e.consume(w),c++,b):w===41?(e.consume(w),c--,b):w===null||w===32||w===40||zt(w)?n(w):(e.consume(w),w===92?C:b)}function C(w){return w===40||w===41||w===92?(e.consume(w),b):b(w)}}function En(e,t,n,r,i,o){let s=this,a=0,u;return l;function l(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),c}function c(p){return a>999||p===null||p===91||p===93&&!u||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):E(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||E(p)||a++>999?(e.exit("chunkString"),c(p)):(e.consume(p),u||(u=!A(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function In(e,t,n,r,i,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,u):n(h)}function u(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),l(h))}function l(h){return h===s?(e.exit(o),u(s)):h===null?n(h):E(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),P(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===s||h===null||E(h)?(e.exit("chunkString"),l(h)):(e.consume(h),h===92?f:c)}function f(h){return h===s||h===92?(e.consume(h),c):c(h)}}function Je(e,t){let n;return r;function r(i){return E(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):A(i)?P(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}var Fr={name:"definition",tokenize:lf},uf={partial:!0,tokenize:cf};function lf(e,t,n){let r=this,i;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return En.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Pe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):n(p)}function u(p){return G(p)?Je(e,l)(p):l(p)}function l(p){return Sn(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(uf,f,f)(p)}function f(p){return A(p)?P(e,h,"whitespace")(p):h(p)}function h(p){return p===null||E(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function cf(e,t,n){return r;function r(a){return G(a)?Je(e,i)(a):n(a)}function i(a){return In(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return A(a)?P(e,s,"whitespace")(a):s(a)}function s(a){return a===null||E(a)?t(a):n(a)}}var zr={name:"hardBreakEscape",tokenize:ff};function ff(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return E(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}var _r={name:"headingAtx",resolve:hf,tokenize:pf};function hf(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},re(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function pf(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(e.consume(c),s):c===null||G(c)?(e.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),u(c)):c===null||E(c)?(e.exit("atxHeading"),t(c)):A(c)?P(e,a,"whitespace")(c):(e.enter("atxHeadingText"),l(c))}function u(c){return c===35?(e.consume(c),u):(e.exit("atxHeadingSequence"),a(c))}function l(c){return c===null||c===35||G(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),l)}}var qs=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Mr=["pre","script","style","textarea"];var vr={concrete:!0,name:"htmlFlow",resolveTo:gf,tokenize:xf},df={partial:!0,tokenize:wf},mf={partial:!0,tokenize:yf};function gf(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function xf(e,t,n){let r=this,i,o,s,a,u;return l;function l(m){return c(m)}function c(m){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(m),f}function f(m){return m===33?(e.consume(m),h):m===47?(e.consume(m),o=!0,b):m===63?(e.consume(m),i=3,r.interrupt?t:d):ce(m)?(e.consume(m),s=String.fromCharCode(m),C):n(m)}function h(m){return m===45?(e.consume(m),i=2,p):m===91?(e.consume(m),i=5,a=0,y):ce(m)?(e.consume(m),i=4,r.interrupt?t:d):n(m)}function p(m){return m===45?(e.consume(m),r.interrupt?t:d):n(m)}function y(m){let ae="CDATA[";return m===ae.charCodeAt(a++)?(e.consume(m),a===ae.length?r.interrupt?t:V:y):n(m)}function b(m){return ce(m)?(e.consume(m),s=String.fromCharCode(m),C):n(m)}function C(m){if(m===null||m===47||m===62||G(m)){let ae=m===47,Ve=s.toLowerCase();return!ae&&!o&&Mr.includes(Ve)?(i=1,r.interrupt?t(m):V(m)):qs.includes(s.toLowerCase())?(i=6,ae?(e.consume(m),w):r.interrupt?t(m):V(m)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(m):o?F(m):S(m))}return m===45||se(m)?(e.consume(m),s+=String.fromCharCode(m),C):n(m)}function w(m){return m===62?(e.consume(m),r.interrupt?t:V):n(m)}function F(m){return A(m)?(e.consume(m),F):$(m)}function S(m){return m===47?(e.consume(m),$):m===58||m===95||ce(m)?(e.consume(m),q):A(m)?(e.consume(m),S):$(m)}function q(m){return m===45||m===46||m===58||m===95||se(m)?(e.consume(m),q):M(m)}function M(m){return m===61?(e.consume(m),x):A(m)?(e.consume(m),M):S(m)}function x(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),u=m,v):A(m)?(e.consume(m),x):H(m)}function v(m){return m===u?(e.consume(m),u=null,D):m===null||E(m)?n(m):(e.consume(m),v)}function H(m){return m===null||m===34||m===39||m===47||m===60||m===61||m===62||m===96||G(m)?M(m):(e.consume(m),H)}function D(m){return m===47||m===62||A(m)?S(m):n(m)}function $(m){return m===62?(e.consume(m),he):n(m)}function he(m){return m===null||E(m)?V(m):A(m)?(e.consume(m),he):n(m)}function V(m){return m===45&&i===2?(e.consume(m),Q):m===60&&i===1?(e.consume(m),X):m===62&&i===4?(e.consume(m),pe):m===63&&i===3?(e.consume(m),d):m===93&&i===5?(e.consume(m),we):E(m)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(df,ke,I)(m)):m===null||E(m)?(e.exit("htmlFlowData"),I(m)):(e.consume(m),V)}function I(m){return e.check(mf,L,ke)(m)}function L(m){return e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),R}function R(m){return m===null||E(m)?I(m):(e.enter("htmlFlowData"),V(m))}function Q(m){return m===45?(e.consume(m),d):V(m)}function X(m){return m===47?(e.consume(m),s="",ge):V(m)}function ge(m){if(m===62){let ae=s.toLowerCase();return Mr.includes(ae)?(e.consume(m),pe):V(m)}return ce(m)&&s.length<8?(e.consume(m),s+=String.fromCharCode(m),ge):V(m)}function we(m){return m===93?(e.consume(m),d):V(m)}function d(m){return m===62?(e.consume(m),pe):m===45&&i===2?(e.consume(m),d):V(m)}function pe(m){return m===null||E(m)?(e.exit("htmlFlowData"),ke(m)):(e.consume(m),pe)}function ke(m){return e.exit("htmlFlow"),t(m)}}function yf(e,t,n){let r=this;return i;function i(s){return E(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function wf(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ne,t,n)}}var Nr={name:"htmlText",tokenize:bf};function bf(e,t,n){let r=this,i,o,s;return a;function a(d){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(d),u}function u(d){return d===33?(e.consume(d),l):d===47?(e.consume(d),M):d===63?(e.consume(d),S):ce(d)?(e.consume(d),H):n(d)}function l(d){return d===45?(e.consume(d),c):d===91?(e.consume(d),o=0,y):ce(d)?(e.consume(d),F):n(d)}function c(d){return d===45?(e.consume(d),p):n(d)}function f(d){return d===null?n(d):d===45?(e.consume(d),h):E(d)?(s=f,X(d)):(e.consume(d),f)}function h(d){return d===45?(e.consume(d),p):f(d)}function p(d){return d===62?Q(d):d===45?h(d):f(d)}function y(d){let pe="CDATA[";return d===pe.charCodeAt(o++)?(e.consume(d),o===pe.length?b:y):n(d)}function b(d){return d===null?n(d):d===93?(e.consume(d),C):E(d)?(s=b,X(d)):(e.consume(d),b)}function C(d){return d===93?(e.consume(d),w):b(d)}function w(d){return d===62?Q(d):d===93?(e.consume(d),w):b(d)}function F(d){return d===null||d===62?Q(d):E(d)?(s=F,X(d)):(e.consume(d),F)}function S(d){return d===null?n(d):d===63?(e.consume(d),q):E(d)?(s=S,X(d)):(e.consume(d),S)}function q(d){return d===62?Q(d):S(d)}function M(d){return ce(d)?(e.consume(d),x):n(d)}function x(d){return d===45||se(d)?(e.consume(d),x):v(d)}function v(d){return E(d)?(s=v,X(d)):A(d)?(e.consume(d),v):Q(d)}function H(d){return d===45||se(d)?(e.consume(d),H):d===47||d===62||G(d)?D(d):n(d)}function D(d){return d===47?(e.consume(d),Q):d===58||d===95||ce(d)?(e.consume(d),$):E(d)?(s=D,X(d)):A(d)?(e.consume(d),D):Q(d)}function $(d){return d===45||d===46||d===58||d===95||se(d)?(e.consume(d),$):he(d)}function he(d){return d===61?(e.consume(d),V):E(d)?(s=he,X(d)):A(d)?(e.consume(d),he):D(d)}function V(d){return d===null||d===60||d===61||d===62||d===96?n(d):d===34||d===39?(e.consume(d),i=d,I):E(d)?(s=V,X(d)):A(d)?(e.consume(d),V):(e.consume(d),L)}function I(d){return d===i?(e.consume(d),i=void 0,R):d===null?n(d):E(d)?(s=I,X(d)):(e.consume(d),I)}function L(d){return d===null||d===34||d===39||d===60||d===61||d===96?n(d):d===47||d===62||G(d)?D(d):(e.consume(d),L)}function R(d){return d===47||d===62||G(d)?D(d):n(d)}function Q(d){return d===62?(e.consume(d),e.exit("htmlTextData"),e.exit("htmlText"),t):n(d)}function X(d){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),ge}function ge(d){return A(d)?P(e,we,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):we(d)}function we(d){return e.enter("htmlTextData"),s(d)}}var Ke={name:"labelEnd",resolveAll:Ef,resolveTo:If,tokenize:Af},kf={tokenize:Tf},Cf={tokenize:Pf},Sf={tokenize:Bf};function Ef(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){let i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&re(e,0,e.length,n),e}function If(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);let u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},c={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",u,t],["enter",l,t]],a=oe(a,e.slice(o+1,o+r+3)),a=oe(a,[["enter",c,t]]),a=oe(a,pt(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=oe(a,[["exit",c,t],e[s-2],e[s-1],["exit",l,t]]),a=oe(a,e.slice(s+1)),a=oe(a,[["exit",u,t]]),re(e,o,e.length,a),e}function Af(e,t,n){let r=this,i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(h){return o?o._inactive?f(h):(s=r.parser.defined.includes(Pe(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),u):n(h)}function u(h){return h===40?e.attempt(kf,c,s?c:f)(h):h===91?e.attempt(Cf,c,s?l:f)(h):s?c(h):f(h)}function l(h){return e.attempt(Sf,c,f)(h)}function c(h){return t(h)}function f(h){return o._balanced=!0,n(h)}}function Tf(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return G(f)?Je(e,o)(f):o(f)}function o(f){return f===41?c(f):Sn(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return G(f)?Je(e,u)(f):c(f)}function a(f){return n(f)}function u(f){return f===34||f===39||f===40?In(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function l(f){return G(f)?Je(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function Pf(e,t,n){let r=this;return i;function i(a){return En.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Pe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Bf(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}var Or={name:"labelStartImage",resolveAll:Ke.resolveAll,tokenize:Rf};function Rf(e,t,n){let r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}var Dr={name:"labelStartLink",resolveAll:Ke.resolveAll,tokenize:Lf};function Lf(e,t,n){let r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}var Ot={name:"lineEnding",tokenize:Ff};function Ff(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),P(e,t,"linePrefix")}}var Xe={name:"thematicBreak",tokenize:zf};function zf(e,t,n){let r=0,i;return o;function o(l){return e.enter("thematicBreak"),s(l)}function s(l){return i=l,a(l)}function a(l){return l===i?(e.enter("thematicBreakSequence"),u(l)):r>=3&&(l===null||E(l))?(e.exit("thematicBreak"),t(l)):n(l)}function u(l){return l===i?(e.consume(l),r++,u):(e.exit("thematicBreakSequence"),A(l)?P(e,a,"whitespace")(l):a(l))}}var ie={continuation:{tokenize:Nf},exit:Df,name:"list",tokenize:vf},_f={partial:!0,tokenize:qf},Mf={partial:!0,tokenize:Of};function vf(e,t,n){let r=this,i=r.events[r.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(p){let y=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:_t(p)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Xe,n,l)(p):l(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return n(p)}function u(p){return _t(p)&&++s<10?(e.consume(p),u):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),l(p)):n(p)}function l(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Ne,r.interrupt?n:c,e.attempt(_f,h,f))}function c(p){return r.containerState.initialBlankLine=!0,o++,h(p)}function f(p){return A(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Nf(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Ne,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,P(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!A(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Mf,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,P(e,e.attempt(ie,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Of(e,t,n){let r=this;return P(e,i,"listItemIndent",r.containerState.size+1);function i(o){let s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function Df(e){e.exit(this.containerState.type)}function qf(e,t,n){let r=this;return P(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){let s=r.events[r.events.length-1];return!A(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}var An={name:"setextUnderline",resolveTo:Vf,tokenize:Uf};function Vf(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);let s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function Uf(e,t,n){let r=this,i;return o;function o(l){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=l,s(l)):n(l)}function s(l){return e.enter("setextHeadingLineSequence"),a(l)}function a(l){return l===i?(e.consume(l),a):(e.exit("setextHeadingLineSequence"),A(l)?P(e,u,"lineSuffix")(l):u(l))}function u(l){return l===null||E(l)?(e.exit("setextHeadingLine"),t(l)):n(l)}}var Vs={tokenize:jf};function jf(e){let t=this,n=e.attempt(Ne,r,e.attempt(this.parser.constructs.flowInitial,i,P(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Lr,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}var Us={resolveAll:Ws()},js=$s("string"),Hs=$s("text");function $s(e){return{resolveAll:Ws(e==="text"?Hf:void 0),tokenize:t};function t(n){let r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(c){return l(c)?o(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),u}function u(c){return l(c)?(n.exit("data"),o(c)):(n.consume(c),u)}function l(c){if(c===null)return!0;let f=i[c],h=-1;if(f)for(;++h<f.length;){let p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function Ws(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Hf(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){let r=e[n-1][1],i=t.sliceStream(r),o=i.length,s=-1,a=0,u;for(;o--;){let l=i[o];if(typeof l=="string"){for(s=l.length;l.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(l===-2)u=!0,a++;else if(l!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){let l={type:n===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...l.start},r.start.offset===r.end.offset?Object.assign(r,l):(e.splice(n,0,["enter",l,t],["exit",l,t]),n+=2)}n++}return e}var qr={};Si(qr,{attentionMarkers:()=>Xf,contentInitial:()=>Wf,disable:()=>Zf,document:()=>$f,flow:()=>Yf,flowInitial:()=>Qf,insideSpan:()=>Kf,string:()=>Gf,text:()=>Jf});var $f={42:ie,43:ie,45:ie,48:ie,49:ie,50:ie,51:ie,52:ie,53:ie,54:ie,55:ie,56:ie,57:ie,62:xn},Wf={91:Fr},Qf={[-2]:vt,[-1]:vt,32:vt},Yf={35:_r,42:Xe,45:[An,Xe],60:vr,61:An,95:Xe,96:bn,126:bn},Gf={38:wn,92:yn},Jf={[-5]:Ot,[-4]:Ot,[-3]:Ot,33:Or,38:wn,42:Mt,60:[Br,Nr],91:Dr,92:[zr,yn],93:Ke,95:Mt,96:Rr},Kf={null:[Mt,Us]},Xf={null:[42,95]},Zf={null:[]};function Qs(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},o=[],s=[],a=[],u=!0,l={attempt:D(v),check:D(H),consume:q,enter:M,exit:x,interrupt:D(H,{interrupt:!0})},c={code:null,containerState:{},defineSkip:w,events:[],now:C,parser:e,previous:null,sliceSerialize:y,sliceStream:b,write:p},f=t.tokenize.call(c,l),h;return t.resolveAll&&o.push(t),c;function p(I){return s=oe(s,I),F(),s[s.length-1]!==null?[]:($(t,0),c.events=pt(o,c.events,c),c.events)}function y(I,L){return th(b(I),L)}function b(I){return eh(s,I)}function C(){let{_bufferIndex:I,_index:L,line:R,column:Q,offset:X}=r;return{_bufferIndex:I,_index:L,line:R,column:Q,offset:X}}function w(I){i[I.line]=I.column,V()}function F(){let I;for(;r._index<s.length;){let L=s[r._index];if(typeof L=="string")for(I=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===I&&r._bufferIndex<L.length;)S(L.charCodeAt(r._bufferIndex));else S(L)}}function S(I){u=void 0,h=I,f=f(I)}function q(I){E(I)?(r.line++,r.column=1,r.offset+=I===-3?2:1,V()):I!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=I,u=!0}function M(I,L){let R=L||{};return R.type=I,R.start=C(),c.events.push(["enter",R,c]),a.push(R),R}function x(I){let L=a.pop();return L.end=C(),c.events.push(["exit",L,c]),L}function v(I,L){$(I,L.from)}function H(I,L){L.restore()}function D(I,L){return R;function R(Q,X,ge){let we,d,pe,ke;return Array.isArray(Q)?ae(Q):"tokenize"in Q?ae([Q]):m(Q);function m(te){return bt;function bt(Ce){let Ue=Ce!==null&&te[Ce],tt=Ce!==null&&te.null,qn=[...Array.isArray(Ue)?Ue:Ue?[Ue]:[],...Array.isArray(tt)?tt:tt?[tt]:[]];return ae(qn)(Ce)}}function ae(te){return we=te,d=0,te.length===0?ge:Ve(te[d])}function Ve(te){return bt;function bt(Ce){return ke=he(),pe=te,te.partial||(c.currentConstruct=te),te.name&&c.parser.constructs.disable.null.includes(te.name)?jt(Ce):te.tokenize.call(L?Object.assign(Object.create(c),L):c,l,Dn,jt)(Ce)}}function Dn(te){return u=!0,I(pe,ke),X}function jt(te){return u=!0,ke.restore(),++d<we.length?Ve(we[d]):ge}}}function $(I,L){I.resolveAll&&!o.includes(I)&&o.push(I),I.resolve&&re(c.events,L,c.events.length-L,I.resolve(c.events.slice(L),c)),I.resolveTo&&(c.events=I.resolveTo(c.events,c))}function he(){let I=C(),L=c.previous,R=c.currentConstruct,Q=c.events.length,X=Array.from(a);return{from:Q,restore:ge};function ge(){r=I,c.previous=L,c.currentConstruct=R,c.events.length=Q,a=X,V()}}function V(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function eh(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex,s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){let a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function th(e,t){let n=-1,r=[],i;for(;++n<e.length;){let o=e[n],s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
14
|
+
`;break}case-3:{s=`\r
|
|
15
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function Vr(e){let r={constructs:Bs([qr,...(e||{}).extensions||[]]),content:i(Ms),defined:[],document:i(Ns),flow:i(Vs),lazy:{},string:i(js),text:i(Hs)};return r;function i(o){return s;function s(a){return Qs(r,o,a)}}}function Ur(e){for(;!Cn(e););return e}var Ys=/[\0\t\n\r]/g;function jr(){let e=1,t="",n=!0,r;return i;function i(o,s,a){let u=[],l,c,f,h,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),f=0,t="",n&&(o.charCodeAt(0)===65279&&f++,n=void 0);f<o.length;){if(Ys.lastIndex=f,l=Ys.exec(o),h=l&&l.index!==void 0?l.index:o.length,p=o.charCodeAt(h),!l){t=o.slice(f);break}if(p===10&&f===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),f<h&&(u.push(o.slice(f,h)),e+=h-f),p){case 0:{u.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,u.push(-2);e++<c;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return a&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}var nh=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Tn(e){return e.replace(nh,rh)}function rh(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let i=n.charCodeAt(1),o=i===120||i===88;return gn(n.slice(o?2:1),o?16:10)}return ft(n)||e}function Oe(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Gs(e.position):"start"in e||"end"in e?Gs(e):"line"in e||"column"in e?Hr(e):""}function Hr(e){return Js(e&&e.line)+":"+Js(e&&e.column)}function Gs(e){return Hr(e&&e.start)+"-"+Hr(e&&e.end)}function Js(e){return e&&typeof e=="number"?e:1}var Xs={}.hasOwnProperty;function $r(e,t,n){return typeof t!="string"&&(n=t,t=void 0),ih(n)(Ur(Vr(n).document().write(jr()(e,t,!0))))}function ih(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ki),autolinkProtocol:D,autolinkEmail:D,atxHeading:o(yi),blockQuote:o(Ce),characterEscape:D,characterReference:D,codeFenced:o(Ue),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(Ue,s),codeText:o(tt,s),codeTextData:D,data:D,codeFlowValue:D,definition:o(qn),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(nu),hardBreakEscape:o(wi),hardBreakTrailing:o(wi),htmlFlow:o(bi,s),htmlFlowData:D,htmlText:o(bi,s),htmlTextData:D,image:o(ru),label:s,link:o(ki),listItem:o(iu),listItemValue:h,listOrdered:o(Ci,f),listUnordered:o(Ci),paragraph:o(ou),reference:m,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(yi),strong:o(su),thematicBreak:o(uu)},exit:{atxHeading:u(),atxHeadingSequence:M,autolink:u(),autolinkEmail:bt,autolinkProtocol:te,blockQuote:u(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:Ve,characterReferenceMarkerNumeric:Ve,characterReferenceValue:Dn,characterReference:jt,codeFenced:u(C),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:y,codeFlowValue:$,codeIndented:u(w),codeText:u(R),codeTextData:$,data:$,definition:u(),definitionDestinationString:q,definitionLabelString:F,definitionTitleString:S,emphasis:u(),hardBreakEscape:u(V),hardBreakTrailing:u(V),htmlFlow:u(I),htmlFlowData:$,htmlText:u(L),htmlTextData:$,image:u(X),label:we,labelText:ge,lineEnding:he,link:u(Q),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ae,resourceDestinationString:d,resourceTitleString:pe,resource:ke,setextHeading:u(H),setextHeadingLineSequence:v,setextHeadingText:x,strong:u(),thematicBreak:u()}};Zs(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(g){let k={type:"root",children:[]},T={stack:[k],tokenStack:[],config:t,enter:a,exit:l,buffer:s,resume:c,data:n},z=[],U=-1;for(;++U<g.length;)if(g[U][1].type==="listOrdered"||g[U][1].type==="listUnordered")if(g[U][0]==="enter")z.push(U);else{let xe=z.pop();U=i(g,xe,U)}for(U=-1;++U<g.length;){let xe=t[g[U][0]];Xs.call(xe,g[U][1].type)&&xe[g[U][1].type].call(Object.assign({sliceSerialize:g[U][2].sliceSerialize},T),g[U][1])}if(T.tokenStack.length>0){let xe=T.tokenStack[T.tokenStack.length-1];(xe[1]||Ks).call(T,void 0,xe[0])}for(k.position={start:De(g.length>0?g[0][1].start:{line:1,column:1,offset:0}),end:De(g.length>0?g[g.length-2][1].end:{line:1,column:1,offset:0})},U=-1;++U<t.transforms.length;)k=t.transforms[U](k)||k;return k}function i(g,k,T){let z=k-1,U=-1,xe=!1,je,Se,kt,Ct;for(;++z<=T;){let ue=g[z];switch(ue[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ue[0]==="enter"?U++:U--,Ct=void 0;break}case"lineEndingBlank":{ue[0]==="enter"&&(je&&!Ct&&!U&&!kt&&(kt=z),Ct=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ct=void 0}if(!U&&ue[0]==="enter"&&ue[1].type==="listItemPrefix"||U===-1&&ue[0]==="exit"&&(ue[1].type==="listUnordered"||ue[1].type==="listOrdered")){if(je){let nt=z;for(Se=void 0;nt--;){let Ee=g[nt];if(Ee[1].type==="lineEnding"||Ee[1].type==="lineEndingBlank"){if(Ee[0]==="exit")continue;Se&&(g[Se][1].type="lineEndingBlank",xe=!0),Ee[1].type="lineEnding",Se=nt}else if(!(Ee[1].type==="linePrefix"||Ee[1].type==="blockQuotePrefix"||Ee[1].type==="blockQuotePrefixWhitespace"||Ee[1].type==="blockQuoteMarker"||Ee[1].type==="listItemIndent"))break}kt&&(!Se||kt<Se)&&(je._spread=!0),je.end=Object.assign({},Se?g[Se][1].start:ue[1].end),g.splice(Se||z,0,["exit",je,ue[2]]),z++,T++}if(ue[1].type==="listItemPrefix"){let nt={type:"listItem",_spread:!1,start:Object.assign({},ue[1].start),end:void 0};je=nt,g.splice(z,0,["enter",nt,ue[2]]),z++,T++,kt=void 0,Ct=!0}}}return g[k][1]._spread=xe,T}function o(g,k){return T;function T(z){a.call(this,g(z),z),k&&k.call(this,z)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(g,k,T){this.stack[this.stack.length-1].children.push(g),this.stack.push(g),this.tokenStack.push([k,T||void 0]),g.position={start:De(k.start),end:void 0}}function u(g){return k;function k(T){g&&g.call(this,T),l.call(this,T)}}function l(g,k){let T=this.stack.pop(),z=this.tokenStack.pop();if(z)z[0].type!==g.type&&(k?k.call(this,g,z[0]):(z[1]||Ks).call(this,g,z[0]));else throw new Error("Cannot close `"+g.type+"` ("+Oe({start:g.start,end:g.end})+"): it\u2019s not open");T.position.end=De(g.end)}function c(){return Ge(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(g){if(this.data.expectingFirstListItemValue){let k=this.stack[this.stack.length-2];k.start=Number.parseInt(this.sliceSerialize(g),10),this.data.expectingFirstListItemValue=void 0}}function p(){let g=this.resume(),k=this.stack[this.stack.length-1];k.lang=g}function y(){let g=this.resume(),k=this.stack[this.stack.length-1];k.meta=g}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){let g=this.resume(),k=this.stack[this.stack.length-1];k.value=g.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){let g=this.resume(),k=this.stack[this.stack.length-1];k.value=g.replace(/(\r?\n|\r)$/g,"")}function F(g){let k=this.resume(),T=this.stack[this.stack.length-1];T.label=k,T.identifier=Pe(this.sliceSerialize(g)).toLowerCase()}function S(){let g=this.resume(),k=this.stack[this.stack.length-1];k.title=g}function q(){let g=this.resume(),k=this.stack[this.stack.length-1];k.url=g}function M(g){let k=this.stack[this.stack.length-1];if(!k.depth){let T=this.sliceSerialize(g).length;k.depth=T}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function v(g){let k=this.stack[this.stack.length-1];k.depth=this.sliceSerialize(g).codePointAt(0)===61?1:2}function H(){this.data.setextHeadingSlurpLineEnding=void 0}function D(g){let T=this.stack[this.stack.length-1].children,z=T[T.length-1];(!z||z.type!=="text")&&(z=au(),z.position={start:De(g.start),end:void 0},T.push(z)),this.stack.push(z)}function $(g){let k=this.stack.pop();k.value+=this.sliceSerialize(g),k.position.end=De(g.end)}function he(g){let k=this.stack[this.stack.length-1];if(this.data.atHardBreak){let T=k.children[k.children.length-1];T.position.end=De(g.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(k.type)&&(D.call(this,g),$.call(this,g))}function V(){this.data.atHardBreak=!0}function I(){let g=this.resume(),k=this.stack[this.stack.length-1];k.value=g}function L(){let g=this.resume(),k=this.stack[this.stack.length-1];k.value=g}function R(){let g=this.resume(),k=this.stack[this.stack.length-1];k.value=g}function Q(){let g=this.stack[this.stack.length-1];if(this.data.inReference){let k=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=k,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function X(){let g=this.stack[this.stack.length-1];if(this.data.inReference){let k=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=k,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function ge(g){let k=this.sliceSerialize(g),T=this.stack[this.stack.length-2];T.label=Tn(k),T.identifier=Pe(k).toLowerCase()}function we(){let g=this.stack[this.stack.length-1],k=this.resume(),T=this.stack[this.stack.length-1];if(this.data.inReference=!0,T.type==="link"){let z=g.children;T.children=z}else T.alt=k}function d(){let g=this.resume(),k=this.stack[this.stack.length-1];k.url=g}function pe(){let g=this.resume(),k=this.stack[this.stack.length-1];k.title=g}function ke(){this.data.inReference=void 0}function m(){this.data.referenceType="collapsed"}function ae(g){let k=this.resume(),T=this.stack[this.stack.length-1];T.label=k,T.identifier=Pe(this.sliceSerialize(g)).toLowerCase(),this.data.referenceType="full"}function Ve(g){this.data.characterReferenceType=g.type}function Dn(g){let k=this.sliceSerialize(g),T=this.data.characterReferenceType,z;T?(z=gn(k,T==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):z=ft(k);let U=this.stack[this.stack.length-1];U.value+=z}function jt(g){let k=this.stack.pop();k.position.end=De(g.end)}function te(g){$.call(this,g);let k=this.stack[this.stack.length-1];k.url=this.sliceSerialize(g)}function bt(g){$.call(this,g);let k=this.stack[this.stack.length-1];k.url="mailto:"+this.sliceSerialize(g)}function Ce(){return{type:"blockquote",children:[]}}function Ue(){return{type:"code",lang:null,meta:null,value:""}}function tt(){return{type:"inlineCode",value:""}}function qn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function nu(){return{type:"emphasis",children:[]}}function yi(){return{type:"heading",depth:0,children:[]}}function wi(){return{type:"break"}}function bi(){return{type:"html",value:""}}function ru(){return{type:"image",title:null,url:"",alt:null}}function ki(){return{type:"link",title:null,url:"",children:[]}}function Ci(g){return{type:"list",ordered:g.type==="listOrdered",start:null,spread:g._spread,children:[]}}function iu(g){return{type:"listItem",spread:g._spread,checked:null,children:[]}}function ou(){return{type:"paragraph",children:[]}}function su(){return{type:"strong",children:[]}}function au(){return{type:"text",value:""}}function uu(){return{type:"thematicBreak"}}}function De(e){return{line:e.line,column:e.column,offset:e.offset}}function Zs(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Zs(e,r):oh(e,r)}}function oh(e,t){let n;for(n in t)if(Xs.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r);break}}}function Ks(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Oe({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Oe({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Oe({start:t.start,end:t.end})+") is still open")}function dt(e){let t=this;t.parser=n;function n(r){return $r(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var ea={}.hasOwnProperty;function ta(e,t){let n=t||{};function r(i,...o){let s=r.invalid,a=r.handlers;if(i&&ea.call(i,e)){let u=String(i[e]);s=ea.call(a,u)?a[u]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var sh={}.hasOwnProperty;function Wr(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)Wr(e,t.extensions[n]);for(r in t)if(sh.call(t,r))switch(r){case"extensions":break;case"unsafe":{na(e[r],t[r]);break}case"join":{na(e[r],t[r]);break}case"handlers":{ah(e[r],t[r]);break}default:e.options[r]=t[r]}return e}function na(e,t){t&&e.push(...t)}function ah(e,t){t&&Object.assign(e,t)}function ra(e,t,n,r){let i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);let s=n.indentLines(n.containerFlow(e,o.current()),uh);return i(),s}function uh(e,t,n){return">"+(n?"":" ")+e}function Pn(e,t){return ia(e,t.inConstruct,!0)&&!ia(e,t.notInConstruct,!1)}function ia(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Qr(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
16
|
+
`&&Pn(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
17
|
+
`}function oa(e,t){let n=String(e),r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function Dt(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function sa(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function aa(e,t,n,r){let i=sa(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(Dt(e,n)){let f=n.enter("codeIndented"),h=n.indentLines(o,lh);return f(),h}let a=n.createTracker(r),u=i.repeat(Math.max(oa(o,i)+1,3)),l=n.enter("codeFenced"),c=a.move(u);if(e.lang){let f=n.enter(`codeFencedLang${s}`);c+=a.move(n.safe(e.lang,{before:c,after:" ",encode:["`"],...a.current()})),f()}if(e.lang&&e.meta){let f=n.enter(`codeFencedMeta${s}`);c+=a.move(" "),c+=a.move(n.safe(e.meta,{before:c,after:`
|
|
18
|
+
`,encode:["`"],...a.current()})),f()}return c+=a.move(`
|
|
19
|
+
`),o&&(c+=a.move(o+`
|
|
20
|
+
`)),c+=a.move(u),l(),c}function lh(e,t,n){return(n?"":" ")+e}function mt(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function ua(e,t,n,r){let i=mt(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition"),a=n.enter("label"),u=n.createTracker(r),l=u.move("[");return l+=u.move(n.safe(n.associationId(e),{before:l,after:"]",...u.current()})),l+=u.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(n.safe(e.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(a=n.enter("destinationRaw"),l+=u.move(n.safe(e.url,{before:l,after:e.title?" ":`
|
|
21
|
+
`,...u.current()}))),a(),e.title&&(a=n.enter(`title${o}`),l+=u.move(" "+i),l+=u.move(n.safe(e.title,{before:l,after:i,...u.current()})),l+=u.move(i),a()),s(),l}function la(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function fe(e){return"&#x"+e.toString(16).toUpperCase()+";"}function gt(e,t,n){let r=ht(e),i=ht(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Yr.peek=ch;function Yr(e,t,n,r){let i=la(n),o=n.enter("emphasis"),s=n.createTracker(r),a=s.move(i),u=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()})),l=u.charCodeAt(0),c=gt(r.before.charCodeAt(r.before.length-1),l,i);c.inside&&(u=fe(l)+u.slice(1));let f=u.charCodeAt(u.length-1),h=gt(r.after.charCodeAt(0),f,i);h.inside&&(u=u.slice(0,-1)+fe(f));let p=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:c.outside},a+u+p}function ch(e,t,n){return n.options.emphasis||"*"}var xt=function(e){if(e==null)return dh;if(typeof e=="function")return Bn(e);if(typeof e=="object")return Array.isArray(e)?fh(e):hh(e);if(typeof e=="string")return ph(e);throw new Error("Expected function, string, or object as test")};function fh(e){let t=[],n=-1;for(;++n<e.length;)t[n]=xt(e[n]);return Bn(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function hh(e){let t=e;return Bn(n);function n(r){let i=r,o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function ph(e){return Bn(t);function t(n){return n&&n.type===e}}function Bn(e){return t;function t(n,r,i){return!!(mh(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function dh(){return!0}function mh(e){return e!==null&&typeof e=="object"&&"type"in e}var ca=[],Rn=!0,Ze=!1,Ln="skip";function Gr(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;let o=xt(i),s=r?-1:1;a(e,void 0,[])();function a(u,l,c){let f=u&&typeof u=="object"?u:{};if(typeof f.type=="string"){let p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(u.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=ca,y,b,C;if((!t||o(u,l,c[c.length-1]||void 0))&&(p=gh(n(u,c)),p[0]===Ze))return p;if("children"in u&&u.children){let w=u;if(w.children&&p[0]!==Ln)for(b=(r?w.children.length:-1)+s,C=c.concat(w);b>-1&&b<w.children.length;){let F=w.children[b];if(y=a(F,b,C)(),y[0]===Ze)return y;b=typeof y[1]=="number"?y[1]:b+s}}return p}}}function gh(e){return Array.isArray(e)?e:typeof e=="number"?[Rn,e]:e==null?ca:[e]}function Jr(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),Gr(e,o,a,i);function a(u,l){let c=l[l.length-1],f=c?c.children.indexOf(u):void 0;return s(u,f,c)}}function Fn(e,t){let n=!1;return Jr(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ze}),!!((!e.depth||e.depth<3)&&Ge(e)&&(t.options.setext||n))}function fa(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(Fn(e,n)){let c=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...o.current(),before:`
|
|
22
|
+
`,after:`
|
|
23
|
+
`});return f(),c(),h+`
|
|
24
|
+
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
25
|
+
`))+1))}let s="#".repeat(i),a=n.enter("headingAtx"),u=n.enter("phrasing");o.move(s+" ");let l=n.containerPhrasing(e,{before:"# ",after:`
|
|
26
|
+
`,...o.current()});return/^[\t ]/.test(l)&&(l=fe(l.charCodeAt(0))+l.slice(1)),l=l?s+" "+l:s,n.options.closeAtx&&(l+=" "+s),u(),a(),l}Kr.peek=xh;function Kr(e){return e.value||""}function xh(){return"<"}Xr.peek=yh;function Xr(e,t,n,r){let i=mt(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image"),a=n.enter("label"),u=n.createTracker(r),l=u.move("![");return l+=u.move(n.safe(e.alt,{before:l,after:"]",...u.current()})),l+=u.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(n.safe(e.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(a=n.enter("destinationRaw"),l+=u.move(n.safe(e.url,{before:l,after:e.title?" ":")",...u.current()}))),a(),e.title&&(a=n.enter(`title${o}`),l+=u.move(" "+i),l+=u.move(n.safe(e.title,{before:l,after:i,...u.current()})),l+=u.move(i),a()),l+=u.move(")"),s(),l}function yh(){return"!"}Zr.peek=wh;function Zr(e,t,n,r){let i=e.referenceType,o=n.enter("imageReference"),s=n.enter("label"),a=n.createTracker(r),u=a.move("!["),l=n.safe(e.alt,{before:u,after:"]",...a.current()});u+=a.move(l+"]["),s();let c=n.stack;n.stack=[],s=n.enter("reference");let f=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return s(),n.stack=c,o(),i==="full"||!l||l!==f?u+=a.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function wh(){return"!"}ei.peek=bh;function ei(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){let s=n.unsafe[o],a=n.compilePattern(s),u;if(s.atBreak)for(;u=a.exec(r);){let l=u.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(u.index+1)}}return i+r+i}function bh(){return"`"}function ti(e,t){let n=Ge(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}ni.peek=kh;function ni(e,t,n,r){let i=mt(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r),a,u;if(ti(e,n)){let c=n.stack;n.stack=[],a=n.enter("autolink");let f=s.move("<");return f+=s.move(n.containerPhrasing(e,{before:f,after:">",...s.current()})),f+=s.move(">"),a(),n.stack=c,f}a=n.enter("link"),u=n.enter("label");let l=s.move("[");return l+=s.move(n.containerPhrasing(e,{before:l,after:"](",...s.current()})),l+=s.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),l+=s.move("<"),l+=s.move(n.safe(e.url,{before:l,after:">",...s.current()})),l+=s.move(">")):(u=n.enter("destinationRaw"),l+=s.move(n.safe(e.url,{before:l,after:e.title?" ":")",...s.current()}))),u(),e.title&&(u=n.enter(`title${o}`),l+=s.move(" "+i),l+=s.move(n.safe(e.title,{before:l,after:i,...s.current()})),l+=s.move(i),u()),l+=s.move(")"),a(),l}function kh(e,t,n){return ti(e,n)?"<":"["}ri.peek=Ch;function ri(e,t,n,r){let i=e.referenceType,o=n.enter("linkReference"),s=n.enter("label"),a=n.createTracker(r),u=a.move("["),l=n.containerPhrasing(e,{before:u,after:"]",...a.current()});u+=a.move(l+"]["),s();let c=n.stack;n.stack=[],s=n.enter("reference");let f=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return s(),n.stack=c,o(),i==="full"||!l||l!==f?u+=a.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function Ch(){return"["}function yt(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function ha(e){let t=yt(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function pa(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function zn(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function da(e,t,n,r){let i=n.enter("list"),o=n.bulletCurrent,s=e.ordered?pa(n):yt(n),a=e.ordered?s==="."?")":".":ha(n),u=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){let c=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&c&&(!c.children||!c.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),zn(n)===s&&c){let f=-1;for(;++f<e.children.length;){let h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=a),n.bulletCurrent=s;let l=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),l}function ma(e){let t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function ga(e,t,n,r){let i=ma(n),o=n.bulletCurrent||yt(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);let a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);let u=n.enter("listItem"),l=n.indentLines(n.containerFlow(e,a.current()),c);return u(),l;function c(f,h,p){return h?(p?"":" ".repeat(s))+f:(p?o:o+" ".repeat(s-o.length))+f}}function xa(e,t,n,r){let i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}var ii=xt(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ya(e,t,n,r){return(e.children.some(function(s){return ii(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function wa(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}oi.peek=Sh;function oi(e,t,n,r){let i=wa(n),o=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i),u=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()})),l=u.charCodeAt(0),c=gt(r.before.charCodeAt(r.before.length-1),l,i);c.inside&&(u=fe(l)+u.slice(1));let f=u.charCodeAt(u.length-1),h=gt(r.after.charCodeAt(0),f,i);h.inside&&(u=u.slice(0,-1)+fe(f));let p=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:c.outside},a+u+p}function Sh(e,t,n){return n.options.strong||"*"}function ba(e,t,n,r){return n.safe(e.value,r)}function ka(e){let t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Ca(e,t,n){let r=(zn(n)+(n.options.ruleSpaces?" ":"")).repeat(ka(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Sa={blockquote:ra,break:Qr,code:aa,definition:ua,emphasis:Yr,hardBreak:Qr,heading:fa,html:Kr,image:Xr,imageReference:Zr,inlineCode:ei,link:ni,linkReference:ri,list:da,listItem:ga,paragraph:xa,root:ya,strong:oi,text:ba,thematicBreak:Ca};var Ea=[Eh];function Eh(e,t,n,r){if(t.type==="code"&&Dt(t,r)&&(e.type==="list"||e.type===t.type&&Dt(e,r)))return!1;if("spread"in n&&typeof n.spread=="boolean")return e.type==="paragraph"&&(e.type===t.type||t.type==="definition"||t.type==="heading"&&Fn(t,r))?void 0:n.spread?1:0}var et=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],Ia=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
|
|
27
|
+
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:et},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
|
|
28
|
+
]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:et},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
|
|
29
|
+
*])`},{character:"*",inConstruct:"phrasing",notInConstruct:et},{atBreak:!0,character:"+",after:`(?:[ \r
|
|
30
|
+
])`},{atBreak:!0,character:"-",after:`(?:[ \r
|
|
31
|
+
-])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
|
|
32
|
+
]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:et},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:et},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:et},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:et},{atBreak:!0,character:"~"}];function Aa(e){return e.label||!e.identifier?e.label||"":Tn(e.identifier)}function Ta(e){if(!e._compiled){let t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function Pa(e,t,n){let r=t.indexStack,i=e.children||[],o=[],s=-1,a=n.before,u;r.push(-1);let l=t.createTracker(n);for(;++s<i.length;){let c=i[s],f;if(r[r.length-1]=s,s+1<i.length){let y=t.handle.handlers[i[s+1].type];y&&y.peek&&(y=y.peek),f=y?y(i[s+1],e,t,{before:"",after:"",...l.current()}).charAt(0):""}else f=n.after;o.length>0&&(a==="\r"||a===`
|
|
33
|
+
`)&&c.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),a=" ",l=t.createTracker(n),l.move(o.join("")));let h=t.handle(c,e,t,{...l.current(),after:f,before:a});u&&u===h.slice(0,1)&&(h=fe(u.charCodeAt(0))+h.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,u=void 0,p&&(o.length>0&&p.before&&a===o[o.length-1].slice(-1)&&(o[o.length-1]=o[o.length-1].slice(0,-1)+fe(a.charCodeAt(0))),p.after&&(u=f)),l.move(h),o.push(h),a=h.slice(-1)}return r.pop(),o.join("")}function Ba(e,t,n){let r=t.indexStack,i=e.children||[],o=t.createTracker(n),s=[],a=-1;for(r.push(-1);++a<i.length;){let u=i[a];r[r.length-1]=a,s.push(o.move(t.handle(u,e,t,{before:`
|
|
34
|
+
`,after:`
|
|
35
|
+
`,...o.current()}))),u.type!=="list"&&(t.bulletLastUsed=void 0),a<i.length-1&&s.push(o.move(Ih(u,i[a+1],e,t)))}return r.pop(),s.join("")}function Ih(e,t,n,r){let i=r.join.length;for(;i--;){let o=r.join[i](e,t,n,r);if(o===!0||o===1)break;if(typeof o=="number")return`
|
|
36
|
+
`.repeat(1+o);if(o===!1)return`
|
|
37
|
+
|
|
38
|
+
<!---->
|
|
39
|
+
|
|
40
|
+
`}return`
|
|
41
|
+
|
|
42
|
+
`}var Ah=/\r?\n|\r/g;function Ra(e,t){let n=[],r=0,i=0,o;for(;o=Ah.exec(e);)s(e.slice(r,o.index)),n.push(o[0]),r=o.index+o[0].length,i++;return s(e.slice(r)),n.join("");function s(a){n.push(t(a,i,!a))}}function Fa(e,t,n){let r=(n.before||"")+(t||"")+(n.after||""),i=[],o=[],s={},a=-1;for(;++a<e.unsafe.length;){let c=e.unsafe[a];if(!Pn(e.stack,c))continue;let f=e.compilePattern(c),h;for(;h=f.exec(r);){let p="before"in c||!!c.atBreak,y="after"in c,b=h.index+(p?h[1].length:0);i.includes(b)?(s[b].before&&!p&&(s[b].before=!1),s[b].after&&!y&&(s[b].after=!1)):(i.push(b),s[b]={before:p,after:y})}}i.sort(Th);let u=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(a=-1;++a<i.length;){let c=i[a];c<u||c>=l||c+1<l&&i[a+1]===c+1&&s[c].after&&!s[c+1].before&&!s[c+1].after||i[a-1]===c-1&&s[c].before&&!s[c-1].before&&!s[c-1].after||(u!==c&&o.push(La(r.slice(u,c),"\\")),u=c,/[!-/:-@[-`{-~]/.test(r.charAt(c))&&(!n.encode||!n.encode.includes(r.charAt(c)))?o.push("\\"):(o.push(fe(r.charCodeAt(c))),u++))}return o.push(La(r.slice(u,l),n.after)),o.join("")}function Th(e,t){return e-t}function La(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],o=e+t,s=-1,a=0,u;for(;u=n.exec(o);)r.push(u.index);for(;++s<r.length;)a!==r[s]&&i.push(e.slice(a,r[s])),i.push("\\"),a=r[s];return i.push(e.slice(a)),i.join("")}function za(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,o=n.column||1;return{move:u,current:s,shift:a};function s(){return{now:{line:i,column:o},lineShift:r}}function a(l){r+=l}function u(l){let c=l||"",f=c.split(/\r?\n|\r/g),h=f[f.length-1];return i+=f.length-1,o=f.length===1?o+h.length:1+h.length+r,c}}function si(e,t){let n=t||{},r={associationId:Aa,containerPhrasing:Lh,containerFlow:Fh,createTracker:za,compilePattern:Ta,enter:o,handlers:{...Sa},handle:void 0,indentLines:Ra,indexStack:[],join:[...Ea],options:{},safe:zh,stack:[],unsafe:[...Ia]};Wr(r,n),r.options.tightDefinitions&&r.join.push(Rh),r.handle=ta("type",{invalid:Ph,unknown:Bh,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
|
|
43
|
+
`,after:`
|
|
44
|
+
`,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
|
|
45
|
+
`),i;function o(s){return r.stack.push(s),a;function a(){r.stack.pop()}}}function Ph(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function Bh(e){let t=e;throw new Error("Cannot handle unknown node `"+t.type+"`")}function Rh(e,t){if(e.type==="definition"&&e.type===t.type)return 0}function Lh(e,t){return Pa(e,this,t)}function Fh(e,t){return Ba(e,this,t)}function zh(e,t){return Fa(this,e,t)}function _n(e){let t=this;t.compiler=n;function n(r){return si(r,{...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]})}}function ai(e){if(e)throw e}var Nn=de(Ua(),1);function qt(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function ui(){let e=[],t={run:n,use:r};return t;function n(...i){let o=-1,s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(u,...l){let c=e[++o],f=-1;if(u){s(u);return}for(;++f<i.length;)(l[f]===null||l[f]===void 0)&&(l[f]=i[f]);i=l,c?ja(c,a)(...l):s(null,...l)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function ja(e,t){let n;return r;function r(...s){let a=e.length>s.length,u;a&&s.push(i);try{u=e.apply(this,s)}catch(l){let c=l;if(a&&n)throw c;return i(c)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}var ee=class extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){let u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){let u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}let a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Oe(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};ee.prototype.file="";ee.prototype.name="";ee.prototype.reason="";ee.prototype.message="";ee.prototype.stack="";ee.prototype.column=void 0;ee.prototype.line=void 0;ee.prototype.ancestors=void 0;ee.prototype.cause=void 0;ee.prototype.fatal=void 0;ee.prototype.place=void 0;ee.prototype.ruleId=void 0;ee.prototype.source=void 0;var ye={basename:_h,dirname:Mh,extname:vh,join:Nh,sep:"/"};function _h(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Vt(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Mh(e){if(Vt(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function vh(e){Vt(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){let a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Nh(...e){let t=-1,n;for(;++t<e.length;)Vt(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Oh(n)}function Oh(e){Vt(e);let t=e.codePointAt(0)===47,n=Dh(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Dh(e,t){let n="",r=0,i=-1,o=0,s=-1,a,u;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function Vt(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var Ha={cwd:qh};function qh(){return"/"}function wt(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function $a(e){if(typeof e=="string")e=new URL(e);else if(!wt(e)){let t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Vh(e)}function Vh(e){if(e.hostname!==""){let r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let r=t.codePointAt(n+2);if(r===70||r===102){let i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}var li=["history","path","basename","stem","extname","dirname"],Ut=class{constructor(t){let n;t?wt(t)?n={path:t}:typeof t=="string"||Uh(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Ha.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<li.length;){let o=li[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)li.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?ye.basename(this.path):void 0}set basename(t){fi(t,"basename"),ci(t,"basename"),this.path=ye.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ye.dirname(this.path):void 0}set dirname(t){Wa(this.basename,"dirname"),this.path=ye.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ye.extname(this.path):void 0}set extname(t){if(ci(t,"extname"),Wa(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ye.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){wt(t)&&(t=$a(t)),fi(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ye.basename(this.path,this.extname):void 0}set stem(t){fi(t,"stem"),ci(t,"stem"),this.path=ye.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){let i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){let i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){let i=new ee(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}};function ci(e,t){if(e&&e.includes(ye.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ye.sep+"`")}function fi(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Wa(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Uh(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Qa=function(e){let r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o};var jh={}.hasOwnProperty,mi=class e extends Qa{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=ui()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let r=this.attachers[n];t.use(...r)}return t.data((0,Nn.default)(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(di("data",this.frozen),this.namespace[t]=n,this):jh.call(this.namespace,t)&&this.namespace[t]||void 0:t?(di("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;let t=this;for(;++this.freezeIndex<this.attachers.length;){let[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);let i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();let n=vn(t),r=this.parser||this.Parser;return hi("parse",r),r(String(n),n)}process(t,n){let r=this;return this.freeze(),hi("process",this.parser||this.Parser),pi("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){let a=vn(t),u=r.parse(a);r.run(u,a,function(c,f,h){if(c||!f||!h)return l(c);let p=f,y=r.stringify(p,h);$h(y)?h.value=y:h.result=y,l(c,h)});function l(c,f){c||!f?s(c):o?o(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),hi("processSync",this.parser||this.Parser),pi("processSync",this.compiler||this.Compiler),this.process(t,i),Ga("processSync","process",n),r;function i(o,s){n=!0,ai(o),r=s}}run(t,n,r){Ya(t),this.freeze();let i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){let u=vn(n);i.run(t,u,l);function l(c,f,h){let p=f||t;c?a(c):s?s(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),Ga("runSync","run",r),i;function o(s,a){ai(s),i=a,r=!0}}stringify(t,n){this.freeze();let r=vn(n),i=this.compiler||this.Compiler;return pi("stringify",i),Ya(t),i(t,r)}use(t,...n){let r=this.attachers,i=this.namespace;if(di("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(l){if(typeof l=="function")u(l,[]);else if(typeof l=="object")if(Array.isArray(l)){let[c,...f]=l;u(c,f)}else s(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function s(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(l.plugins),l.settings&&(i.settings=(0,Nn.default)(!0,i.settings,l.settings))}function a(l){let c=-1;if(l!=null)if(Array.isArray(l))for(;++c<l.length;){let f=l[c];o(f)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function u(l,c){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===l){h=f;break}if(h===-1)r.push([l,...c]);else if(c.length>0){let[p,...y]=c,b=r[h][1];qt(b)&&qt(p)&&(p=(0,Nn.default)(!0,b,p)),r[h]=[l,p,...y]}}}},gi=new mi().freeze();function hi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function pi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function di(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ya(e){if(!qt(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ga(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function vn(e){return Hh(e)?e:new Ut(e)}function Hh(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function $h(e){return typeof e=="string"||Wh(e)}function Wh(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Ja=gi().use(dt).use(_n).freeze();var Y=ne("react/jsx-runtime"),be=(e,t=0)=>{if(!e)return null;switch(e.type){case"heading":{let n=e.depth===1?24:e.depth===2?20:e.depth===3?18:16,r=e.depth<=2?"bold":"normal";return(0,Y.jsx)(K.View,{style:{marginBottom:8,marginTop:e.depth===1?0:4},children:(0,Y.jsx)(K.Text,{style:{fontSize:n,fontWeight:r},children:e.children.map((i,o)=>be(i,o))})},t)}case"paragraph":return(0,Y.jsx)(K.View,{style:{marginBottom:6},children:(0,Y.jsx)(K.Text,{children:e.children.map((n,r)=>be(n,r))})},t);case"text":return e.value;case"strong":return(0,Y.jsx)(K.Text,{style:{fontWeight:"bold"},children:e.children.map((n,r)=>be(n,r))},t);case"emphasis":return(0,Y.jsx)(K.Text,{style:{fontStyle:"italic"},children:e.children.map((n,r)=>be(n,r))},t);case"list":return(0,Y.jsx)(K.View,{style:{marginBottom:8,marginLeft:0},children:e.children.map((n,r)=>(0,Y.jsxs)(K.View,{style:{flexDirection:"row",marginBottom:4},children:[(0,Y.jsx)(K.Text,{style:{marginRight:8,width:20},children:e.ordered?`${r+1}.`:"\u2022"}),(0,Y.jsx)(K.View,{style:{flex:1},children:n.children.map((i,o)=>be(i,o))})]},r))},t);case"listItem":return(0,Y.jsx)(xi.default.Fragment,{children:e.children.map((n,r)=>be(n,r))},t);case"link":return(0,Y.jsx)(K.Text,{style:{color:"#0066cc"},children:e.children.map((n,r)=>be(n,r))},t);case"code":return(0,Y.jsx)(K.Text,{style:{fontFamily:"Courier",backgroundColor:"#f5f5f5",padding:4},children:e.value},t);case"inlineCode":return(0,Y.jsx)(K.Text,{style:{fontFamily:"Courier",backgroundColor:"#f5f5f5"},children:e.value},t);case"blockquote":return(0,Y.jsx)(K.View,{style:{marginLeft:20,marginBottom:8,borderLeft:"2px solid #ccc",paddingLeft:10},children:e.children.map((n,r)=>be(n,r))},t);case"break":return`
|
|
46
|
+
`;case"thematicBreak":return(0,Y.jsx)(K.View,{style:{borderBottom:"1px solid #ccc",marginVertical:12}},t);default:return"children"in e&&Array.isArray(e.children)?(0,Y.jsx)(xi.default.Fragment,{children:e.children.map((n,r)=>be(n,r))},t):null}},Ka=({children:e,text:t,markdown:n,style:r,...i})=>{let o=n||t||(typeof e=="string"?e:null);if(!o||typeof o!="string")return null;try{let a=Ja().use(dt).parse(o);return(0,Y.jsx)(K.View,{style:r,...i,children:a.children.map((u,l)=>be(u,l))})}catch(s){return console.error("Error parsing markdown:",s),(0,Y.jsx)(K.View,{style:r,...i,children:(0,Y.jsx)(K.Text,{children:o})})}};var mn={Page:qe.Page,View:qe.View,Text:qe.Text,Image:qe.Image,Table:fo,TH:ho,TR:nr,TD:po,QrCode:Ss,Map:bs,Markdown:Ka};var Za=ne("react/jsx-runtime"),Xa=({data:e,template:t})=>{let n=Pr(t),r=Pr(e);(n?.fonts||[]).forEach(u=>{On.Font.register(u)});let o=n?.components||[],s=n?.images||{},a=Ye({componentData:o,components:mn,data:r||{},allProps:{},images:s});return(0,Za.jsx)(On.Document,{children:a})};var Qh=async(e,t)=>{try{if(!e||!t)throw new Error("Template and data are required");let n;try{if(n=JSON.parse(e),!n.components||!Array.isArray(n.components))throw new Error("Invalid template structure: missing or invalid components array")}catch(s){throw new Error(`Invalid template JSON: ${s instanceof Error?s.message:"Unknown parsing error"}`)}let r;try{if(r=JSON.parse(t),typeof r!="object"||r===null)throw new Error("Data must be a valid JSON object")}catch(s){throw new Error(`Invalid data JSON: ${s instanceof Error?s.message:"Unknown parsing error"}`)}let i=tu.default.createElement(Xa,{data:t,template:e});return await(0,eu.pdf)(i).toBlob()}catch(n){let r=new Error(`PDF generation failed: ${n instanceof Error?n.message:"Unknown error"}`);throw r.originalError=n instanceof Error?n:void 0,r.template=e,r.data=t,r}};return du(Yh);})();
|
|
14
47
|
//# sourceMappingURL=pdf-generator.browser.js.map
|