System.register(["./index-legacy-4630884d-1734950731618.js"],(function(A,e){"use strict";var t,r,n,s;return{setters:[A=>{t=A.d,r=A.f,n=A.$,s=A.F}],execute:function(){function o(A){if("string"!=typeof A)throw new TypeError("Path must be a string. Received "+JSON.stringify(A))}function B(A,e){for(var t,r="",n=0,s=-1,o=0,B=0;B<=A.length;++B){if(B2){var i=r.lastIndexOf("/");if(i!==r.length-1){-1===i?(r="",n=0):n=(r=r.slice(0,i)).length-1-r.lastIndexOf("/"),s=B,o=0;continue}}else if(2===r.length||1===r.length){r="",n=0,s=B,o=0;continue}e&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+="/"+A.slice(s+1,B):r=A.slice(s+1,B),n=B-s-1;s=B,o=0}else 46===t&&-1!==o?++o:o=-1}return r}A("a",""+new URL("studentStart-9f3fecce.png",e.meta.url).href),A("s","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGYAAABmCAYAAAA53+RiAAAAAXNSR0IArs4c6QAAC5lJREFUeF7tXWuoZmUVfh66SJKVVDL1pzSoQAqqibRRQ6sx897FKVEhMooG0+lmTYoOOWVNjtZQFAlBSmoXL5WlZkpTOV00IQlqoHL+lGTSxSiyYsVzXPuwfM/e397fvu9zvhc+OOf79nt99rvWetda71rEBIqZPRPAC8Ln+QD03QHJR7N5OPk8CGAvgN9kH5L6btSFYxydmR0C4Bj/HA1gXcvjfADAnQDu0Ifk71puv3FzowHGzF4B4CwAxwN4TuOZzdfAPgA3A/gyyZ/OV7WbpwcFxsyeC+AMAGcCEHkaQxHZuwrA1STvH2pAgwBjZi8DsBXAqQCqjOGfkUf433rLU36idUz5jnZf5E/6e/8KC24AbgDwMZL3VHi+1UeqLEprHZrZEQA+AuB1JY3+C8CPnQeIF9xN8r9tDMTMHg9gPQDxLvGxDQCeVNL2LQAuIakx9VJ6AcbMRKZ2Adg4Y1b/BvAtJyO3ktT/nRcz2w/AsU5OTwSg/4vKbQDOISly12npFBgz05sokvVBAE8smMndAK4EcB3Jv3Y625LGzexpADYBONt3VV4NvTA7nMRpZ3dSOgPGzI4D8FkABxeMfDeA7ST1Fo6umJl2t8juUQWD+z2AzSS/28XgWwfGzJ4A4FIA7y0YsM4OF5H8URcTartN54vbnB/lNb8TwIdI/qfNvlsFxswkAV0HQGeStPwBwBaSX21zAn21ZWanAbgcwLNz+tTZZxNJSYqtlNaAMbMTdEADcGAyMklTnwFwMUmJt5MtZiZR/GIA7wEg6S6Wv+iATPLbbUywFWDMTMzy8wAelwxKBzS9ST9rY7BjacO1FNcC0AE5lv8BeBdJCTONSmNgzEwM8pKcUdwI4G1DS1qNVmdGZZfgvgTglJzHLiC5vUnftYExM9X9tOT6HNL1fpL6bdUXMzsXwKdySJvObeeSlAZh7tIEGPGNFBTJ9ae1RWfnns1AFZy/SqhJNQi7SIofzV1qAVNAvsT8TiB519yjWAUVzOyVAMT4U+GnFlmbGxhn9F9M1lKi8EaSv1oFa1x7CmZ2KAAdmFOR+h3zCgRzAeNbVkw9Sl/aKUeudVAyNB2cHyY7R9LaKfOQ+MrA+OHx3qRD8ZTXrFXyVbS1nKzdnvAcvcAvqXoIrQSMq1n0FsQTvQ6Op87zFtSmEROs6NRF9px4EJWGQNSlVH1TFZjLcnRf560Vkbjue+Gi9BVJ/Z0k31fWZikwriX+TtLQjSRlfVyUkhUwM+2a9BD6+jKt9Exg3J4iSSuq7qVmEa0c1HYylTfCNQTizVF9I5PBoSQL7TllwHwUwAVhEcRXNqw23VfXILtuTWaOyG9kqr6wqO9CYNwc/MvE1FqJPnY90Sm2b2Ypn5Yl9MVFZupZwNya2Oh1iHzh1FX3Q4HqJoNfJ4fP20jK32BFyQXGrXYSj2OR+n6SRq6hwEj7dWObDImxSHxeYc0tAkZ27OhiJDfSV49lglMeh5l9PzFT30JS/hGPKSuAcWc8ea6UojrlBRpq7AXUaH3qVJgHzPXuIZmNfTfJVw01kdXYr5n9IPG+uYHkG+JcHwOM+xLL8z1+f+xYXYymCpq7Rkm4yoqMaYdEX+kUGJ1ZdHbJilxTXz7VBRjzuM3s54lT4YUkl030KTC63BO97uVY8IUxT3CqYzOzd7oDSzaFvSTl8L5UloExs8MA7AkT1QFoXR+qFzOTBHgegKcAkL1HB9lWnMiLgHPncikTTwbwdwBXkJTzeC/FVTW6QBV9pQ8n+ZMUGLmzvjuM6usk39z1KB2U1M1U/8uk0IljuTuSS7mYiqnH9QzO1wC8Kazx50huToGRcjLe5DqJpLzvOy1mlmoYsv46AWcGKOpXtwzKroi0th5mdhKAm0KD+0guKTuXSJnfefxteEBazwO7emPjzMxMzhuHF8y2VXBKQNEQ9pCUU0Uvxccjy2b0rnme7oRmwMiTMjpY3E7ytX2MzszOdyf0ou5aAacCKOr/fJKf7GPeWR9m9j2Z50OfS44bGTBfAfDW8ONWkh/vY4DOhL+ZQ+9j943AqQiK+hD57lToSNfUzD6suzbh+2tInp4B88fkyvaydNATOJJM8phxY3DmAKUzYWPWGuZIww+QfBY9uMGfQmVdRH3qAG9O6+CMHRTn7zKe/S25sHuQgNGF1ajiv5fkS/vYKTnbujVwpgBK4DO/kLk+rMeRAubtfgcy+/5akpHf9IpRGwvaRht9TtrMrgHwltDn2QJGUsgHwpfbSOpyzmClycI2qTvUhM1M631R6H+HgJEKRGqJrJxOUggOWuoscJ06g07SOzczUShJxlm5ScCkBzx5wYzCY3+ehfYZdSLZdQ2eu9TG4A57BIw8YV4UOpfnxn1dD6Zq+xXByWwbuY4N3lejs1DV8dZ5zsy0/sIhK/cJGDmfRWe0g4cMbpM3sYrgzFqT0YKiQbuBUjhk5X4B82cATw9fPoPkQ3WQ77JOA3BGDYoDo/UXDll5SMBItR7DiexH8pEuF7lu2zXAGT0oDozWP5o4HpkUMD4JHUKlKp/FT/So+M7JfWjI675oWT0zywVmEqQsTGI1ApNLykbP/BNQykTi+AJPhZRJ+FrB/EctLjcAJas6enCKxGUdbKLVbjQHzBZAmQQ4OQfMu0arkpkTlKkfMHNVMqNTYs4JyhKp8jpl/GeUZK1IiTkqtX8dUDKRuOI5Z3TgFKn9R2MoawJKG3Wbnkfq1jezXEOZYuQPblpuc2GntHPcGWWladlP04M6Y7QJShdt1d0JVeoVOmM4MIO5L3W5kFPYOWXuS4M5/AX9VycS1djBKXP4U1qQoVxk5b6zJh3+Sl1k/a1NncqlmdWCdVpG5iKr+Mmf6HTCofFSp3IHZqhrGGvZqbzSNQyFvFq6NOOll4tLa/UaRsHFpcOyxEKDX/VbqxeXKl/1c3I2yOVYB2eLJ+WRdfKyrn2nR3DVT7EUlOAoKzMvx8pgs7hO3jH3n/s6ue+abwCIwQAWARhaBionAMP1JN8Yu1mELGl50cuaqx2yxHfNIshP2QrX/L12kB8HJjUF6OtFWKyaYAR9oHLQ1A+L5eAsAsk1BCJWLwgkV3h9vSz0opzLo5fmIvRiTbBaC73ouyYvWOkRY0l7W3ONeq/WarBSB0aBARbhfRtA2Ul4XwdH8VYWAbFrgtNJQOwgTSxCyNcAptMQ8r5rlNtykXRhDnB6Sbrg4Cgy0yJNSQVwektTEkiacl0uEvvMAKf3xD4BnNRxQz8tUmE9epdymFRYAZy83JeL5HFDJo8L4CzSLfpijCbdogsDiwSlj5KvcSUoLSFr+nmR0reCBFf0SGkqrCptL5JgL6/SeJJgJ6L0Im38mNLGB3B0CJUhKKZlzH6WSL1lqjloPPfL5TlZYTU/pVGUIXFfFQpT5ZlWSFnsyHNmXpqTnjF77A7F5spLZlNlwH0/4zb6bUnOlziMnQDkWlua23KesbcOTNg90krL7TZmBIxj2w1g+1gzbbiLkc5rRxUsqO7lby5LmzgPGPHZzoBxkVr2nK0eQTDGsI9jkOPblSKBfeQRmLVQbjvZBEDajfUFz8p1eIdC8s5Kl1gXkKxep8CE3aMMG7uSZHTp2DVhhayXAKGkap3E9U879asQGwGcBeDEJAlC+rgyj59TlImvKRi97ZicRZD3jchDWfx8hbBXYAjxozsBKI9NK4Gq3TVWu+Fo5xsbkhDueeurLBkiuyuSvLUJxmDAhB0kn10BpFS3VXatYkErt038SAJ6OPmoiwOSjyRF5WWJn/0rLKiyIOmQLEDuqfB8q49UWZRWO4yNeWS7MwCcmSQU6qzPCg3vBXAVgKuHjHQ4KDAJSEosJICOT9KlVFjLxo9o990sQLLEOo1bbNjAaIBJQNKd0GP8I16wruE80+rKdCTeJR6mHJ+64TCqMkpgcoQGBYmIPEJS3kEAnpzwE1WNfOcfHlxC5GmZP5F8cFQo5Azm/5KfuQmQCbAuAAAAAElFTkSuQmCC");var i={resolve:function(){for(var A,e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n;r>=0?n=arguments[r]:(void 0===A&&(A=process.cwd()),n=A),o(n),0!==n.length&&(e=n+"/"+e,t=47===n.charCodeAt(0))}return e=B(e,!t),t?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(A){if(o(A),0===A.length)return".";var e=47===A.charCodeAt(0),t=47===A.charCodeAt(A.length-1);return 0!==(A=B(A,!e)).length||e||(A="."),A.length>0&&t&&(A+="/"),e?"/"+A:A},isAbsolute:function(A){return o(A),A.length>0&&47===A.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var A,e=0;e0&&(void 0===A?A=t:A+="/"+t)}return void 0===A?".":i.normalize(A)},relative:function(A,e){if(o(A),o(e),A===e)return"";if((A=i.resolve(A))===(e=i.resolve(e)))return"";for(var t=1;ta){if(47===e.charCodeAt(s+g))return e.slice(s+g+1);if(0===g)return e.slice(s+g)}else n>a&&(47===A.charCodeAt(t+g)?c=g:0===g&&(c=0));break}var l=A.charCodeAt(t+g);if(l!==e.charCodeAt(s+g))break;47===l&&(c=g)}var w="";for(g=t+c+1;g<=r;++g)g!==r&&47!==A.charCodeAt(g)||(0===w.length?w+="..":w+="/..");return w.length>0?w+e.slice(s+c):(s+=c,47===e.charCodeAt(s)&&++s,e.slice(s))},_makeLong:function(A){return A},dirname:function(A){if(o(A),0===A.length)return".";for(var e=A.charCodeAt(0),t=47===e,r=-1,n=!0,s=A.length-1;s>=1;--s)if(47===(e=A.charCodeAt(s))){if(!n){r=s;break}}else n=!1;return-1===r?t?"/":".":t&&1===r?"//":A.slice(0,r)},basename:function(A,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');o(A);var t,r=0,n=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=A.length){if(e.length===A.length&&e===A)return"";var B=e.length-1,i=-1;for(t=A.length-1;t>=0;--t){var a=A.charCodeAt(t);if(47===a){if(!s){r=t+1;break}}else-1===i&&(s=!1,i=t+1),B>=0&&(a===e.charCodeAt(B)?-1==--B&&(n=t):(B=-1,n=i))}return r===n?n=i:-1===n&&(n=A.length),A.slice(r,n)}for(t=A.length-1;t>=0;--t)if(47===A.charCodeAt(t)){if(!s){r=t+1;break}}else-1===n&&(s=!1,n=t+1);return-1===n?"":A.slice(r,n)},extname:function(A){o(A);for(var e=-1,t=0,r=-1,n=!0,s=0,B=A.length-1;B>=0;--B){var i=A.charCodeAt(B);if(47!==i)-1===r&&(n=!1,r=B+1),46===i?-1===e?e=B:1!==s&&(s=1):-1!==e&&(s=-1);else if(!n){t=B+1;break}}return-1===e||-1===r||0===s||1===s&&e===r-1&&e===t+1?"":A.slice(e,r)},format:function(A){if(null===A||"object"!=typeof A)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof A);return function(A,e){var t=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||"");return t?t===e.root?t+r:t+A+r:r}("/",A)},parse:function(A){o(A);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===A.length)return e;var t,r=A.charCodeAt(0),n=47===r;n?(e.root="/",t=1):t=0;for(var s=-1,B=0,i=-1,a=!0,c=A.length-1,g=0;c>=t;--c)if(47!==(r=A.charCodeAt(c)))-1===i&&(a=!1,i=c+1),46===r?-1===s?s=c:1!==g&&(g=1):-1!==s&&(g=-1);else if(!a){B=c+1;break}return-1===s||-1===i||0===g||1===g&&s===i-1&&s===B+1?-1!==i&&(e.base=e.name=0===B&&n?A.slice(1,i):A.slice(B,i)):(0===B&&n?(e.name=A.slice(1,s),e.base=A.slice(1,i)):(e.name=A.slice(B,s),e.base=A.slice(B,i)),e.ext=A.slice(s,i)),B>0?e.dir=A.slice(0,B-1):n&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};i.posix=i;const a=i.extname,c=i.basename;class g{constructor(){let A="undefined"==typeof global,e="image/png",t="image/jpeg",r="image/jpeg",n="image/webp",s="application/pdf",o="image/svg+xml";Object.assign(this,{toMime:this.toMime.bind(this),fromMime:this.fromMime.bind(this),expected:A?'"png", "jpg", or "webp"':'"png", "jpg", "pdf", or "svg"',formats:A?{png:e,jpg:t,jpeg:r,webp:n}:{png:e,jpg:t,jpeg:r,pdf:s,svg:o},mimes:A?{[e]:"png",[t]:"jpg",[n]:"webp"}:{[e]:"png",[t]:"jpg",[s]:"pdf",[o]:"svg"}})}toMime(A){return this.formats[(A||"").replace(/^\./,"").toLowerCase()]}fromMime(A){return this.mimes[A]}}class l{static for(A){return(new l).append(A).get()}constructor(){this.crc=-1}get(){return~this.crc}append(A){for(var e=0|this.crc,t=this.table,r=0,n=0|A.length;r>>8^t[255&(e^A[r])];return this.crc=e,this}}function w(A){let e=new Uint8Array(A),t=new DataView(e.buffer),r={array:e,view:t,size:A,set8:(A,e)=>(t.setUint8(A,e),r),set16:(A,e)=>(t.setUint16(A,e,!0),r),set32:(A,e)=>(t.setUint32(A,e,!0),r),bytes:(A,t)=>(e.set(t,A),r)};return r}l.prototype.table=(()=>{var A,e,t,r=[];for(A=0;A<256;A++){for(t=A,e=0;e<8;e++)t=1&t?t>>>1^3988292384:t>>>1;r[A]=t}return r})();class Q{constructor(A){let e=new Date;Object.assign(this,{directory:A,offset:0,files:[],time:(e.getHours()<<6|e.getMinutes())<<5|e.getSeconds()/2,date:(e.getFullYear()-1980<<4|e.getMonth()+1)<<5|e.getDate()}),this.add(A)}async add(A,e){let t=!e,r=Q.encoder.encode(`${this.directory}/${t?"":A}`),n=new Uint8Array(t?0:await e.arrayBuffer()),s=30+r.length,o=s+n.length,{offset:B}=this,i=w(26).set32(0,134742036).set16(6,this.time).set16(8,this.date).set32(10,l.for(n)).set32(14,n.length).set32(18,n.length).set16(22,r.length);B+=s;let a=w(s+n.length+16).set32(0,67324752).bytes(4,i.array).bytes(30,r).bytes(s,n);B+=n.length,a.set32(o,134695760).bytes(o+4,i.array.slice(10,22)),B+=16,this.files.push({offset:B,folder:t,name:r,header:i,payload:a}),this.offset=B}toBuffer(){let A=this.files.reduce(((A,{name:e})=>46+e.length+A),0),e=w(A+22),t=0;for(var{offset:r,name:n,header:s,folder:o}of this.files)e.set32(t,33639248).set16(t+4,20).bytes(t+6,s.array).set8(t+38,o?16:0).set32(t+42,r).bytes(t+46,n),t+=46+n.length;e.set32(t,101010256).set16(t+8,this.files.length).set16(t+10,this.files.length).set32(t+12,A).set32(t+16,this.offset);let B=new Uint8Array(this.offset+e.size),i=0;for(var{payload:a}of this.files)B.set(a.array,i),i+=a.size;return B.set(e.array,i),B}get blob(){return new Blob([this.toBuffer()],{type:"application/zip"})}}Q.encoder=new TextEncoder;const u=(A,e,t,r)=>{if(r){let{width:e,height:t}=A,n=Object.assign(document.createElement("canvas"),{width:e,height:t}),s=n.getContext("2d");s.fillStyle=r,s.fillRect(0,0,e,t),s.drawImage(A,0,0),A=n}return new Promise(((r,n)=>A.toBlob(r,e,t)))},h=(A,e)=>{const t=window.URL.createObjectURL(e),r=document.createElement("a");r.style.display="none",r.href=t,r.setAttribute("download",A),void 0===r.download&&r.setAttribute("target","_blank"),document.body.appendChild(r),r.click(),document.body.removeChild(r),setTimeout((()=>window.URL.revokeObjectURL(t)),100)},C={asBuffer:(...A)=>u(...A).then((A=>A.arrayBuffer())),asDownload:async(A,e,t,r,n)=>{h(n,await u(A,e,t,r))},asZipDownload:async(A,e,t,r,n,s,o)=>{let B=c(n,".zip")||"archive",i=new Q(B);await Promise.all(A.map((async(A,n)=>{let B=(A=>s.replace("{}",String(A+1).padStart(o,"0")))(n);await i.add(B,await u(A,e,t,r))}))),h(`${B}.zip`,i.blob)},atScale:(A,e,t)=>A.map((A=>{if(1==e&&!t)return A.canvas;let r=document.createElement("canvas"),n=r.getContext("2d"),s=A.canvas?A.canvas:A;return r.width=s.width*e,r.height=s.height*e,t&&(n.fillStyle=t,n.fillRect(0,0,r.width,r.height)),n.scale(e,e),n.drawImage(s,0,0),r})),options:function(A,{filename:e="",extension:t="",format:r,page:n,quality:s,matte:o,density:B,outline:i,archive:l}={}){var{fromMime:w,toMime:Q,expected:u}=new g,h=(l=l||"canvas",r||t.replace(/@\d+x$/i,"")||a(e)),C=(r=w(Q(h)||h),Q(r)),U=A.length;if(!h)throw new Error("Cannot determine image format (use a filename extension or 'format' argument)");if(!r)throw new Error(`Unsupported file format "${h}" (expected ${u})`);if(!U)throw new RangeError("Canvas has no associated contexts (try calling getContext or newPage first)");let F,d,f=e.replace(/{(\d*)}/g,((A,e)=>(d=!0,e=parseInt(e,10),F=isFinite(e)?e:isFinite(F)?F:-1,"{}"))),p=n>0?n-1:n<0?U+n:void 0;if(isFinite(p)&&p<0||p>=U)throw new RangeError(1==U?`Canvas only has a ‘page 1’ (${p} is out of bounds)`:`Canvas has pages 1–${U} (${p} is out of bounds)`);if(A=isFinite(p)?[A[p]]:d||"pdf"==r?A:A.slice(-1),void 0===s)s=.92;else if("number"!=typeof s||!isFinite(s)||s<0||s>1)throw new TypeError("The quality option must be an number in the 0.0–1.0 range");if(void 0===B){let A=(t||c(e,h)).match(/@(\d+)x$/i);B=A?parseInt(A[1],10):1}else if("number"!=typeof B||!Number.isInteger(B)||B<1)throw new TypeError("The density option must be a non-negative integer");return void 0===i?i=!0:"svg"==r&&(i=!!i),{filename:e,pattern:f,format:r,mime:C,pages:A,padding:F,quality:s,matte:o,density:B,outline:i,archive:l}}},{asBuffer:U,asDownload:F,asZipDownload:d,atScale:f,options:p}=C,H=Symbol.for("toDataURL"),{CanvasRenderingContext2D:E,CanvasGradient:y,CanvasPattern:m,Image:I,ImageData:K,Path2D:b,DOMMatrix:v,DOMRect:L,DOMPoint:D}=window,x={Canvas:class{constructor(A,e){let t=document.createElement("canvas"),r=[];for(var[n,s]of(Object.defineProperty(t,"async",{value:!0,writable:!1,enumerable:!0}),Object.entries({png:()=>U(t,"image/png"),jpg:()=>U(t,"image/jpeg"),pages:()=>r.concat(t).map((A=>A.getContext("2d")))})))Object.defineProperty(t,n,{get:s});return Object.assign(t,{width:A,height:e,newPage(...A){var{width:e,height:n}=t,s=Object.assign(document.createElement("canvas"),{width:e,height:n});s.getContext("2d").drawImage(t,0,0),r.push(s);var[e,n]=A.length?A:[e,n];return Object.assign(t,{width:e,height:n}).getContext("2d")},saveAs(A,e){e="number"==typeof e?{quality:e}:e;let t=p(this.pages,{filename:A,...e}),{pattern:r,padding:n,mime:s,quality:o,matte:B,density:i,archive:a}=t,c=f(t.pages,i);return null==n?F(c[0],s,o,B,A):d(c,s,o,B,a,r,n)},toBuffer(A="png",e={}){e="number"==typeof e?{quality:e}:e;let t=p(this.pages,{extension:A,...e}),{mime:r,quality:n,matte:s,pages:o,density:B}=t,i=f(o,B,s)[0];return U(i,r,n,s)},[H]:t.toDataURL.bind(t),toDataURL(A="png",e={}){e="number"==typeof e?{quality:e}:e;let r=p(this.pages,{extension:A,...e}),{mime:n,quality:s,matte:o,pages:B,density:i}=r,a=f(B,i,o)[0],c=a[a===t?H:"toDataURL"](n,s);return Promise.resolve(c)}})}},loadImage:A=>new Promise(((e,t)=>Object.assign(new I,{crossOrigin:"Anonymous",onload:e,onerror:t,src:A}))),CanvasRenderingContext2D:E,CanvasGradient:y,CanvasPattern:m,Image:I,ImageData:K,Path2D:b,DOMMatrix:v,DOMRect:L,DOMPoint:D},S=(A,e,t={},r=t)=>{if(Array.isArray(e))e.forEach((e=>S(A,e,t,r)));else if("function"==typeof e)e(A,t,r,S);else{const n=Object.keys(e)[0];Array.isArray(e[n])?(r[n]={},S(A,e[n],t,r[n])):r[n]=e[n](A,t,r,S)}return t},T=(A,e)=>(t,r,n,s)=>{e(t,r,n)&&s(t,A,r,n)},M=(A=0)=>e=>e.data[e.pos+A],O=A=>e=>e.data.subarray(e.pos,e.pos+=A),G=A=>e=>e.data.subarray(e.pos,e.pos+A),k=A=>e=>Array.from(O(A)(e)).map((A=>String.fromCharCode(A))).join(""),V=A=>e=>{const t=O(2)(e);return A?(t[1]<<8)+t[0]:(t[0]<<8)+t[1]},R=(A,e)=>(t,r,n)=>{const s="function"==typeof e?e(t,r,n):e,o=O(A),B=new Array(s);for(var i=0;ie=>{const t=(A=>A.data[A.pos++])(e),r=new Array(8);for(var n=0;n<8;n++)r[7-n]=!!(t&1<{const n=A[t];return n.length?e[t]=((A,e,t)=>{for(var r=0,n=0;n{const e=[],t=A.data.length;for(var r=0,n=(A=>A.data[A.pos++])(A);0!==n&&n;n=(A=>A.data[A.pos++])(A)){if(A.pos+n>=t){const n=t-A.pos;e.push(O(n)(A)),r+=n;break}e.push(O(n)(A)),r+=n}const s=new Uint8Array(r);for(var o=0,B=0;BA.data[A.pos++]},{extras:P({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:V(!0)},{transparentColorIndex:A=>A.data[A.pos++]},{terminator:A=>A.data[A.pos++]}]},(A=>{var e=G(2)(A);return 33===e[0]&&249===e[1]})),X=T({image:[{code:A=>A.data[A.pos++]},{descriptor:[{left:V(!0)},{top:V(!0)},{width:V(!0)},{height:V(!0)},{lct:P({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},T({lct:R(3,((A,e,t)=>Math.pow(2,t.descriptor.lct.size+1)))},((A,e,t)=>t.descriptor.lct.exists)),{data:[{minCodeSize:A=>A.data[A.pos++]},N]}]},(A=>44===M()(A))),Y=T({text:[{codes:O(2)},{blockSize:A=>A.data[A.pos++]},{preData:(A,e,t)=>O(t.text.blockSize)(A)},N]},(A=>{var e=G(2)(A);return 33===e[0]&&1===e[1]})),W=T({application:[{codes:O(2)},{blockSize:A=>A.data[A.pos++]},{id:(A,e,t)=>k(t.blockSize)(A)},N]},(A=>{var e=G(2)(A);return 33===e[0]&&255===e[1]})),Z=T({comment:[{codes:O(2)},N]},(A=>{var e=G(2)(A);return 33===e[0]&&254===e[1]})),_=[{header:[{signature:k(3)},{version:k(3)}]},{lsd:[{width:V(!0)},{height:V(!0)},{gct:P({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:A=>A.data[A.pos++]},{pixelAspectRatio:A=>A.data[A.pos++]}]},T({gct:R(3,((A,e)=>Math.pow(2,e.lsd.gct.size+1)))},((A,e)=>e.lsd.gct.exists)),{frames:((A,e)=>(t,r,n,s)=>{const o=[];let B=t.pos;for(;e(t,r,n);){const e={};if(s(t,A,r,e),t.pos===B)break;B=t.pos,o.push(e)}return o})([J,W,Z,X,Y],(A=>{var e=M()(A);return 33===e||44===e}))}],z=(A,e,t)=>{if(!A.image)return void console.warn("gif frame does not have associated image.");const{image:r}=A,n=r.descriptor.width*r.descriptor.height;var s=((A,e,t)=>{const r=4096,n=t;var s,o,B,i,a,c,g,l,w,Q;const u=new Array(t),h=new Array(r),C=new Array(r),U=new Array(4097);for(a=1+(o=1<<(Q=A)),s=o+2,g=-1,B=(1<<(i=Q+1))-1,l=0;l>=i,d-=i,l>s||l==a)break;if(l==o){B=(1<<(i=Q+1))-1,s=o+2,g=-1;continue}if(-1==g){U[p++]=C[l],g=l,f=l;continue}for(c=l,l==s&&(U[p++]=f,l=g);l>o;)U[p++]=C[l],l=h[l];f=255&C[l],U[p++]=f,s{const t=new Array(A.length),r=A.length/e,n=function(r,n){const s=A.slice(n*e,(n+1)*e);t.splice.apply(t,[r*e,e].concat(s))},s=[0,4,2,1],o=[8,8,4,2];for(var B=0,i=0;i<4;i++)for(var a=s[i];a{const e=A.pixels.length,t=new Uint8ClampedArray(4*e);for(var r=0;r65536?(A[0]=240|(1835008&r)>>>18,A[1]=128|(258048&r)>>>12,A[2]=128|(4032&r)>>>6,A[3]=128|63&r):r>2048?(A[0]=224|(61440&r)>>>12,A[1]=128|(4032&r)>>>6,A[2]=128|63&r):r>128?(A[0]=192|(1984&r)>>>6,A[1]=128|63&r):A[0]=r,e.push(A)}this.parsedData=Array.prototype.concat.apply([],e),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}getLength(){return this.parsedData.length}write(A){for(let e=0,t=this.parsedData.length;eiA.length)throw new Error("Too long data");return t}(A,this.errorCorrectLevel);else{if(this.typeNumber>40)throw new Error(`Invalid QR version: ${this.typeNumber}`);if(!function(A,e,t){const r=j(e),n=A-1;let s=0;switch(t){case AA.L:s=iA[n][0];break;case AA.M:s=iA[n][1];break;case AA.Q:s=iA[n][2];break;case AA.H:s=iA[n][3]}return r<=s}(this.typeNumber,A,this.errorCorrectLevel))throw new Error(`Data is too long for QR version: ${this.typeNumber}`)}const e=new q(A);this.dataList.push(e),this.dataCache=void 0}isDark(A,e){if(A<0||this.moduleCount<=A||e<0||this.moduleCount<=e)throw new Error(`${A},${e}`);return this.modules[A][e]}getModuleCount(){return this.moduleCount}make(){this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(A,e){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(let t=0;t=7&&this.setupTypeNumber(A),null==this.dataCache&&(this.dataCache=$.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(A,e){for(let t=-1;t<=7;t++)if(!(A+t<=-1||this.moduleCount<=A+t))for(let r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(this.modules[A+t][e+r]=0<=t&&t<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==t||6==t)||2<=t&&t<=4&&2<=r&&r<=4)}getBestMaskPattern(){if(Number.isInteger(this.maskPattern)&&Object.values(tA).includes(this.maskPattern))return this.maskPattern;let A=0,e=0;for(let t=0;t<8;t++){this.makeImpl(!0,t);const r=rA.getLostPoint(this);(0==t||A>r)&&(A=r,e=t)}return e}setupTimingPattern(){for(let A=8;A>t&1);this.modules[Math.floor(t/3)][t%3+this.moduleCount-8-3]=r}for(t=0;t<18;t++)r=!A&&1==(e>>t&1),this.modules[t%3+this.moduleCount-8-3][Math.floor(t/3)]=r}setupTypeInfo(A,e){const t=this.errorCorrectLevel<<3|e,r=rA.getBCHTypeInfo(t);for(var n=0;n<15;n++){var s=!A&&1==(r>>n&1);n<6?this.modules[n][8]=s:n<8?this.modules[n+1][8]=s:this.modules[this.moduleCount-15+n][8]=s}for(n=0;n<15;n++)s=!A&&1==(r>>n&1),n<8?this.modules[8][this.moduleCount-n-1]=s:n<9?this.modules[8][15-n-1+1]=s:this.modules[8][15-n-1]=s;this.modules[this.moduleCount-8][8]=!A}mapData(A,e){let t=-1,r=this.moduleCount-1,n=7,s=0;for(let o=this.moduleCount-1;o>0;o-=2)for(6==o&&o--;;){for(let t=0;t<2;t++)if(null==this.modules[r][o-t]){let B=!1;s>>n&1)),rA.getMask(e,r,o-t)&&(B=!B),this.modules[r][o-t]=B,n--,-1==n&&(s++,n=7)}if(r+=t,r<0||this.moduleCount<=r){r-=t,t=-t;break}}}static createData(A,e,t){const r=oA.getRSBlocks(A,e),n=new BA;for(var s=0;s8*o)throw new Error(`code length overflow. (${n.getLengthInBits()}>${8*o})`);for(n.getLengthInBits()+4<=8*o&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(!1);for(;!(n.getLengthInBits()>=8*o||(n.put($.PAD0,8),n.getLengthInBits()>=8*o));)n.put($.PAD1,8);return $.createBytes(n,r)}static createBytes(A,e){let t=0,r=0,n=0;const s=new Array(e.length),o=new Array(e.length);for(var B=0;B=0?l.get(A):0}}let a=0;for(i=0;i=0;)e^=rA.G15<=0;)e^=rA.G18<>>=1;return e}static getPatternPosition(A){return rA.PATTERN_POSITION_TABLE[A-1]}static getMask(A,e,t){switch(A){case tA.PATTERN000:return(e+t)%2==0;case tA.PATTERN001:return e%2==0;case tA.PATTERN010:return t%3==0;case tA.PATTERN011:return(e+t)%3==0;case tA.PATTERN100:return(Math.floor(e/2)+Math.floor(t/3))%2==0;case tA.PATTERN101:return e*t%2+e*t%3==0;case tA.PATTERN110:return(e*t%2+e*t%3)%2==0;case tA.PATTERN111:return(e*t%3+(e+t)%2)%2==0;default:throw new Error(`bad maskPattern:${A}`)}}static getErrorCorrectPolynomial(A){let e=new sA([1],0);for(let t=0;t5&&(t+=3+s-5)}for(r=0;r=256;)A-=255;return nA.EXP_TABLE[A]}}nA.EXP_TABLE=new Array(256),nA.LOG_TABLE=new Array(256),nA._constructor=function(){for(var A=0;A<8;A++)nA.EXP_TABLE[A]=1<>>7-A%8&1)}put(A,e){for(let t=0;t>>e-t-1&1))}getLengthInBits(){return this.length}putBit(A){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),A&&(this.buffer[e]|=128>>>this.length%8),this.length++}}const iA=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];var aA=256,cA=1024,gA=1<<18;function lA(A,e){var t,r,n,s,o;function B(A,e,r,n,s){t[e][0]-=A*(t[e][0]-r)/cA,t[e][1]-=A*(t[e][1]-n)/cA,t[e][2]-=A*(t[e][2]-s)/cA}function i(A,e,r,n,s){for(var B,i,a=Math.abs(e-A),c=Math.min(e+A,aA),g=e+1,l=e-1,w=1;ga;)i=o[w++],ga&&((B=t[l--])[0]-=i*(B[0]-r)/gA,B[1]-=i*(B[1]-n)/gA,B[2]-=i*(B[2]-s)/gA)}function a(A,e,r){var o,B,i,a,c,g=~(1<<31),l=g,w=-1,Q=w;for(o=0;o>12))>10,s[o]-=c,n[o]+=c<<10;return s[w]+=64,n[w]-=65536,Q}this.buildColormap=function(){!function(){var A,e;for(t=[],r=new Int32Array(256),n=new Int32Array(aA),s=new Int32Array(aA),o=new Int32Array(32),A=0;A>6;for(U<=1&&(U=0),t=0;t=l&&(F-=l),0===u&&(u=1),++t%u==0)for(h-=h/w,(U=(C-=C/30)>>6)<=1&&(U=0),g=0;g>=4,t[A][1]>>=4,t[A][2]>>=4,t[A][3]=A}(),function(){var A,e,n,s,o,B,i=0,a=0;for(A=0;A>1,e=i+1;e>1,e=i+1;e<256;e++)r[e]=255}()},this.getColormap=function(){for(var A=[],e=[],r=0;r=0;)c=i?c=aA:(c++,B<0&&(B=-B),(s=o[0]-A)<0&&(s=-s),(B+=s)=0&&((B=e-(o=t[g])[1])>=i?g=-1:(g--,B<0&&(B=-B),(s=o[0]-A)<0&&(s=-s),(B+=s)=254&&H(e)}function f(A){p(wA),U=i+2,F=!0,m(i,A)}function p(A){for(var e=0;e0&&(A.writeByte(s),A.writeBytes(Q,0,s),s=0)}function E(A){return(1<0?n|=A<=8;)d(255&n,e),n>>=8,C-=8;if((U>o||F)&&(F?(o=E(l=B),F=!1):(++l,o=12==l?4096:E(l))),A==a){for(;C>0;)d(255&n,e),n>>=8,C-=8;H(e)}}this.encode=function(t){t.writeByte(w),c=A*e,g=0,function(A,e){var t,r,n,c,g,w,Q;for(F=!1,o=E(l=B=A),a=1+(i=1<=0){g=w-n,0===n&&(g=1);do{if((n-=g)<0&&(n+=w),u[n]===t){c=h[n];continue A}}while(u[n]>=0)}m(c,e),c=r,U<4096?(h[n]=U++,u[n]=t):f(e)}else c=h[n];m(c,e),m(a,e)}(w+1,t),t.writeByte(0)}}function hA(){this.page=-1,this.pages=[],this.newPage()}hA.pageSize=4096,hA.charMap={};for(var CA=0;CA<256;CA++)hA.charMap[CA]=String.fromCharCode(CA);function UA(A,e){this.width=~~A,this.height=~~e,this.transparent=null,this.transIndex=0,this.repeat=-1,this.delay=0,this.image=null,this.pixels=null,this.indexedPixels=null,this.colorDepth=null,this.colorTab=null,this.neuQuant=null,this.usedEntry=new Array,this.palSize=7,this.dispose=-1,this.firstFrame=!0,this.sample=10,this.dither=!1,this.globalPalette=!1,this.out=new hA}hA.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(hA.pageSize),this.cursor=0},hA.prototype.getData=function(){for(var A="",e=0;eA+e.length),0));return A.reduce(((A,e)=>(t.set(e,A),A+e.length)),0),t},hA.prototype.writeByte=function(A){this.cursor>=hA.pageSize&&this.newPage(),this.pages[this.page][this.cursor++]=A},hA.prototype.writeUTFBytes=function(A){for(var e=A.length,t=0;t=0&&(this.dispose=A)},UA.prototype.setRepeat=function(A){this.repeat=A},UA.prototype.setTransparent=function(A){this.transparent=A},UA.prototype.addFrame=function(A){this.image=A,this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null,this.getImagePixels(),this.analyzePixels(),!0===this.globalPalette&&(this.globalPalette=this.colorTab),this.firstFrame&&(this.writeHeader(),this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),this.firstFrame||this.globalPalette||this.writePalette(),this.writePixels(),this.firstFrame=!1},UA.prototype.finish=function(){this.out.writeByte(59)},UA.prototype.setQuality=function(A){A<1&&(A=1),this.sample=A},UA.prototype.setDither=function(A){!0===A&&(A="FloydSteinberg"),this.dither=A},UA.prototype.setGlobalPalette=function(A){this.globalPalette=A},UA.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette},UA.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")},UA.prototype.analyzePixels=function(){this.colorTab||(this.neuQuant=new lA(this.pixels,this.sample),this.neuQuant.buildColormap(),this.colorTab=this.neuQuant.getColormap()),this.dither?this.ditherPixels(this.dither.replace("-serpentine",""),null!==this.dither.match(/-serpentine/)):this.indexPixels(),this.pixels=null,this.colorDepth=8,this.palSize=7,null!==this.transparent&&(this.transIndex=this.findClosest(this.transparent,!0))},UA.prototype.indexPixels=function(A){var e=this.pixels.length/3;this.indexedPixels=new Uint8Array(e);for(var t=0,r=0;r=0&&f+c=0&&p+a>16,(65280&A)>>8,255&A,e)},UA.prototype.findClosestRGB=function(A,e,t,r){if(null===this.colorTab)return-1;if(this.neuQuant&&!r)return this.neuQuant.lookupRGB(A,e,t);for(var n=0,s=16777216,o=this.colorTab.length,B=0,i=0;B=0&&(e=7&this.dispose),e<<=2,this.out.writeByte(0|e|A),this.writeShort(this.delay),this.out.writeByte(this.transIndex),this.out.writeByte(0)},UA.prototype.writeImageDesc=function(){this.out.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame||this.globalPalette?this.out.writeByte(0):this.out.writeByte(128|this.palSize)},UA.prototype.writeLSD=function(){this.writeShort(this.width),this.writeShort(this.height),this.out.writeByte(240|this.palSize),this.out.writeByte(0),this.out.writeByte(0)},UA.prototype.writeNetscapeExt=function(){this.out.writeByte(33),this.out.writeByte(255),this.out.writeByte(11),this.out.writeUTFBytes("NETSCAPE2.0"),this.out.writeByte(3),this.out.writeByte(1),this.writeShort(this.repeat),this.out.writeByte(0)},UA.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);for(var A=768-this.colorTab.length,e=0;e>8&255)},UA.prototype.writePixels=function(){new uA(this.width,this.height,this.indexedPixels,this.colorDepth).encode(this.out)},UA.prototype.stream=function(){return this.out};var FA=globalThis&&globalThis.__awaiter||function(A,e,t,r){return new(t||(t=Promise))((function(n,s){function o(A){try{i(r.next(A))}catch(e){s(e)}}function B(A){try{i(r.throw(A))}catch(e){s(e)}}function i(A){var e;A.done?n(A.value):(e=A.value,e instanceof t?e:new t((function(A){A(e)}))).then(o,B)}i((r=r.apply(A,e||[])).next())}))};const{Canvas:dA}=x,fA=.4;function pA(A){if(A)return new Promise((function(t,r){if("data"==A.slice(0,4)){let n=new Image;return n.onload=function(){t(n),e(n)},n.onerror=function(){r("Image load error"),e(n)},void(n.src=A)}let n=new Image;n.setAttribute("crossOrigin","Anonymous"),n.onload=function(){t(n)},n.onerror=function(){r("Image load error")},n.src=A}));function e(A){A.onload=null,A.onerror=null}}class HA{constructor(A){const e=Object.assign({},A);if(Object.keys(HA.defaultOptions).forEach((A=>{A in e||Object.defineProperty(e,A,{value:HA.defaultOptions[A],enumerable:!0,writable:!0})})),e.components?"object"==typeof e.components&&Object.keys(HA.defaultComponentOptions).forEach((A=>{A in e.components?Object.defineProperty(e.components,A,{value:Object.assign(Object.assign({},HA.defaultComponentOptions[A]),e.components[A]),enumerable:!0,writable:!0}):Object.defineProperty(e.components,A,{value:HA.defaultComponentOptions[A],enumerable:!0,writable:!0})})):e.components=HA.defaultComponentOptions,null!==e.dotScale&&void 0!==e.dotScale){if(e.dotScale<=0||e.dotScale>1)throw new Error("dotScale should be in range (0, 1].");e.components.data.scale=e.dotScale,e.components.timing.scale=e.dotScale,e.components.alignment.scale=e.dotScale}this.options=e,this.canvas=new dA(A.size,A.size),this.canvasContext=this.canvas.getContext("2d"),this.qrCode=new $(-1,this.options.correctLevel),Number.isInteger(this.options.maskPattern)&&(this.qrCode.maskPattern=this.options.maskPattern),Number.isInteger(this.options.version)&&(this.qrCode.typeNumber=this.options.version),this.qrCode.addData(this.options.text),this.qrCode.make()}draw(){return new Promise((A=>this._draw().then(A)))}_clear(){this.canvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}static _prepareRoundedCornerClip(A,e,t,r,n,s){A.beginPath(),A.moveTo(e,t),A.arcTo(e+r,t,e+r,t+n,s),A.arcTo(e+r,t+n,e,t+n,s),A.arcTo(e,t+n,e,t,s),A.arcTo(e,t,e+r,t,s),A.closePath()}static _getAverageRGB(A){const e={r:0,g:0,b:0};let t,r,n=-4;const s={r:0,g:0,b:0};let o=0;r=A.naturalHeight||A.height,t=A.naturalWidth||A.width;const B=new dA(t,r).getContext("2d");if(!B)return e;let i;B.drawImage(A,0,0);try{i=B.getImageData(0,0,t,r)}catch(a){return e}for(;(n+=20)200||i.data[n+1]>200||i.data[n+2]>200||(++o,s.r+=i.data[n],s.g+=i.data[n+1],s.b+=i.data[n+2]);return s.r=~~(s.r/o),s.g=~~(s.g/o),s.b=~~(s.b/o),s}static _drawDot(A,e,t,r,n=0,s=1){A.fillRect((e+n)*r,(t+n)*r,s*r,s*r)}static _drawAlignProtector(A,e,t,r){A.clearRect((e-2)*r,(t-2)*r,5*r,5*r),A.fillRect((e-2)*r,(t-2)*r,5*r,5*r)}static _drawAlign(A,e,t,r,n=0,s=1,o,B){const i=A.fillStyle;A.fillStyle=o,new Array(4).fill(0).map(((o,B)=>{HA._drawDot(A,e-2+B,t-2,r,n,s),HA._drawDot(A,e+2,t-2+B,r,n,s),HA._drawDot(A,e+2-B,t+2,r,n,s),HA._drawDot(A,e-2,t+2-B,r,n,s)})),HA._drawDot(A,e,t,r,n,s),B||(A.fillStyle="rgba(255, 255, 255, 0.6)",new Array(2).fill(0).map(((o,B)=>{HA._drawDot(A,e-1+B,t-1,r,n,s),HA._drawDot(A,e+1,t-1+B,r,n,s),HA._drawDot(A,e+1-B,t+1,r,n,s),HA._drawDot(A,e-1,t+1-B,r,n,s)}))),A.fillStyle=i}_draw(){var A,e,t,r,n,s,o,B,i,a,c,g,l,w,Q,u,h,C,U;return FA(this,void 0,void 0,(function*(){const F=null===(A=this.qrCode)||void 0===A?void 0:A.moduleCount,d=this.options.size;let f=this.options.margin;(f<0||2*f>=d)&&(f=0);const p=Math.ceil(f),H=d-2*f,E=this.options.whiteMargin,y=this.options.backgroundDimming,m=Math.ceil(H/F),I=m*F,K=I+2*p,b=new dA(K,K),v=b.getContext("2d");this._clear(),v.save(),v.translate(p,p);const L=new dA(K,K),D=L.getContext("2d");let x=null,T=[];if(this.options.gifBackground){const A=(A=>{const e=new Uint8Array(A);return S({data:e,pos:0},_)})(this.options.gifBackground);if(x=A,O=!0,T=(M=A).frames.filter((A=>A.image)).map((A=>z(A,M.gct,O))),this.options.autoColor){let A=0,e=0,t=0,r=0;for(let n=0;n200||s[1]>200||s[2]>200||0===s[0]&&0===s[1]&&0===s[2]||(r++,A+=s[0],e+=s[1],t+=s[2])}A=~~(A/r),e=~~(e/r),t=~~(t/r),this.options.colorDark=`rgb(${A},${e},${t})`}}else if(this.options.backgroundImage){const A=yield pA(this.options.backgroundImage);if(this.options.autoColor){const e=HA._getAverageRGB(A);this.options.colorDark=`rgb(${e.r},${e.g},${e.b})`}D.drawImage(A,0,0,A.width,A.height,0,0,K,K),D.rect(0,0,K,K),D.fillStyle=y,D.fill()}else D.rect(0,0,K,K),D.fillStyle=this.options.colorLight,D.fill();var M,O;const G=rA.getPatternPosition(this.qrCode.typeNumber),k=(null===(t=null===(e=this.options.components)||void 0===e?void 0:e.data)||void 0===t?void 0:t.scale)||fA,V=.5*(1-k);for(let A=0;A=F-8)||e>=F-8&&A<8;let n=r||6==A&&e>=8&&e<=F-8||6==e&&A>=8&&A<=F-8;for(let B=1;B=G[B]-2&&A<=G[B]+2&&e>=G[B]-2&&e<=G[B]+2;const s=e*m+(n?0:V*m),o=A*m+(n?0:V*m);v.strokeStyle=t?this.options.colorDark:this.options.colorLight,v.lineWidth=.5,v.fillStyle=t?this.options.colorDark:this.options.colorLight,0===G.length?n||v.fillRect(s,o,(n?1:k)*m,(n?1:k)*m):n||e=F-4-5&&A=F-4-5||v.fillRect(s,o,(n?1:k)*m,(n?1:k)*m)}const R=G[G.length-1],P=this.options.colorLight;if(v.fillStyle=P,v.fillRect(0,0,8*m,8*m),v.fillRect(0,(F-8)*m,8*m,8*m),v.fillRect((F-8)*m,0,8*m,8*m),(null===(n=null===(r=this.options.components)||void 0===r?void 0:r.timing)||void 0===n?void 0:n.protectors)&&(v.fillRect(8*m,6*m,(F-8-8)*m,m),v.fillRect(6*m,8*m,m,(F-8-8)*m)),(null===(o=null===(s=this.options.components)||void 0===s?void 0:s.cornerAlignment)||void 0===o?void 0:o.protectors)&&HA._drawAlignProtector(v,R,R,m),null===(i=null===(B=this.options.components)||void 0===B?void 0:B.alignment)||void 0===i?void 0:i.protectors)for(let A=0;A=1)&&(e=.2),t<0&&(t=0),r<0&&(r=0);const n=I*e,s=.5*(K-n),o=s;v.restore(),v.fillStyle=this.options.logoBackgroundColor,v.save(),HA._prepareRoundedCornerClip(v,s-t,o-t,n+2*t,n+2*t,r+t),v.clip();const B=v.globalCompositeOperation;v.globalCompositeOperation="destination-out",v.fill(),v.globalCompositeOperation=B,v.restore(),v.save(),HA._prepareRoundedCornerClip(v,s,o,n,n,r),v.clip(),v.drawImage(A,s,o,n,n),v.restore(),v.save(),v.translate(p,p)}if(x){let A,e,t,r,n,s;if(T.forEach((function(o){A||(A=new UA(d,d),A.setDelay(o.delay),A.setRepeat(0));const{width:B,height:i}=o.dims;e||(e=new dA(B,i),t=e.getContext("2d"),t.rect(0,0,e.width,e.height),t.fillStyle="#ffffff",t.fill()),r&&s&&B===r.width&&i===r.height||(r=new dA(B,i),n=r.getContext("2d"),s=n.createImageData(B,i)),s.data.set(o.patch),n.putImageData(s,0,0),t.drawImage(r.getContext("2d").canvas,o.dims.left,o.dims.top);const a=new dA(K,K),c=a.getContext("2d");c.drawImage(e.getContext("2d").canvas,0,0,K,K),c.rect(0,0,K,K),c.fillStyle=y,c.fill(),c.drawImage(b.getContext("2d").canvas,0,0,K,K);const g=new dA(d,d),l=g.getContext("2d");l.drawImage(a.getContext("2d").canvas,0,0,d,d),A.addFrame(l.getImageData(0,0,g.width,g.height).data)})),!A)throw new Error("No frames.");if(A.finish(),EA(this.canvas)){const e=A.stream().toFlattenUint8Array().reduce(((A,e)=>A+String.fromCharCode(e)),"");return Promise.resolve(`data:image/gif;base64,${window.btoa(e)}`)}return Promise.resolve(Buffer.from(A.stream().toFlattenUint8Array()))}{D.drawImage(b.getContext("2d").canvas,0,0,K,K),v.drawImage(L.getContext("2d").canvas,-p,-p,K,K);const A=new dA(d,d);A.getContext("2d").drawImage(b.getContext("2d").canvas,0,0,d,d),this.canvas=A;const e=this.options.gifBackground?"gif":"png";return EA(this.canvas)?Promise.resolve(this.canvas.toDataURL(e)):Promise.resolve(this.canvas.toBuffer(e))}}))}}function EA(A){try{return A instanceof HTMLElement}catch(e){return"object"==typeof A&&1===A.nodeType&&"object"==typeof A.style&&"object"==typeof A.ownerDocument}}function yA(A){return""===A?A:"true"===A||"1"==A}HA.CorrectLevel=AA,HA.defaultComponentOptions={data:{scale:.4},timing:{scale:.5,protectors:!1},alignment:{scale:.5,protectors:!1},cornerAlignment:{scale:.5,protectors:!0}},HA.defaultOptions={text:"",size:400,margin:20,colorDark:"#000000",colorLight:"rgba(255, 255, 255, 0.6)",correctLevel:AA.M,backgroundImage:void 0,backgroundDimming:"rgba(0,0,0,0)",logoImage:void 0,logoScale:.2,logoMargin:4,logoCornerRadius:8,whiteMargin:!0,components:HA.defaultComponentOptions,autoColor:!0,logoBackgroundColor:"#ffffff",backgroundColor:"#ffffff"},A("T",t({name:"TheQrCode",props:{text:{type:String,required:!0},qid:{type:String},correctLevel:{type:Number,default:0},size:{type:Number,default:220},margin:{type:Number,default:20},colorDark:{type:String,default:"#000000"},colorLight:{type:String,default:"#FFFFFF"},bgSrc:{type:String,default:void 0},background:{type:String,default:"rgba(0,0,0,0)"},backgroundDimming:{type:String,default:"rgba(0,0,0,0)"},logoSrc:{type:String,default:void 0},logoBackgroundColor:{type:String,default:"rgba(255,255,255,1)"},gifBgSrc:{type:String,default:void 0},logoScale:{type:Number,default:.2},logoMargin:{type:Number,default:0},logoCornerRadius:{type:Number,default:8},whiteMargin:{type:[Boolean,String],default:!0},dotScale:{type:Number,default:1},autoColor:{type:[Boolean,String],default:!0},binarize:{type:[Boolean,String],default:!1},binarizeThreshold:{type:Number,default:128},callback:{type:Function,default:function(){}},bindElement:{type:Boolean,default:!0},backgroundColor:{type:String,default:"#FFFFFF"},components:{default:function(){return{data:{scale:1},timing:{scale:1,protectors:!1},alignment:{scale:1,protectors:!1},cornerAlignment:{scale:1,protectors:!0}}}}},data:()=>({imgUrl:""}),watch:{$props:{deep:!0,handler(){this.main()}}},mounted(){this.main()},methods:{async main(){if(this.gifBgSrc){const e=await(A=this.gifBgSrc,new Promise((e=>{const t=new XMLHttpRequest;t.responseType="blob",t.onload=function(){const A=new FileReader;A.onloadend=function(){e(A.result)},A.readAsArrayBuffer(t.response)},t.open("GET",A),t.send()}))),t=this.logoSrc;return void this.render(void 0,t,e)}var A;const e=this.bgSrc,t=this.logoSrc;this.render(e,t)},async render(A,e,t){console.log(A,e,t,"render====>code");const r={gifBackground:t,text:this.text,size:this.size,margin:this.margin,colorDark:this.colorDark,colorLight:this.colorLight,backgroundColor:this.backgroundColor,backgroundImage:A,backgroundDimming:this.backgroundDimming,logoScale:this.logoScale,logoBackgroundColor:this.logoBackgroundColor,correctLevel:this.correctLevel,logoMargin:this.logoMargin,logoCornerRadius:this.logoCornerRadius,whiteMargin:yA(this.whiteMargin),dotScale:this.dotScale,autoColor:yA(this.autoColor),components:this.components};e&&(r.logoImage=e+"?"+(new Date).getTime()),new HA(r).draw().then((A=>{console.log("🚀 ~ dataUri:",A),this.imgUrl=A,this.callback&&this.callback(A,this.qid)}))}},render(){return r(s,null,[this.bindElement&&this.imgUrl&&r("img",{style:{width:n(this.size),height:n(this.size),display:"inline-block",zIndex:1e3},src:this.imgUrl},null)])}})),A("b",""+new URL("btnBg-e86054d6.png",e.meta.url).href); /*! * html2canvas 1.4.1 * Copyright (c) 2022 Niklas von Hertzen * Released under MIT License */ /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var mA=function(A,e){return mA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},mA(A,e)};function IA(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=A}mA(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}var KA=function(){return KA=Object.assign||function(A){for(var e,t=1,r=arguments.length;t0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]=55296&&n<=56319&&t>10),o%1024+56320)),(n+1===t||r.length>16384)&&(s+=String.fromCharCode.apply(String,r),r.length=0)}return s},MA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",OA="undefined"==typeof Uint8Array?[]:new Uint8Array(256),GA=0;GA<64;GA++)OA[MA.charCodeAt(GA)]=GA;for(var kA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",VA="undefined"==typeof Uint8Array?[]:new Uint8Array(256),RA=0;RA<64;RA++)VA[kA.charCodeAt(RA)]=RA;for(var PA=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},NA=function(){function A(A,e,t,r,n,s){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=r,this.index=n,this.data=s}return A.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),JA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",XA="undefined"==typeof Uint8Array?[]:new Uint8Array(256),YA=0;YA<64;YA++)XA[JA.charCodeAt(YA)]=YA;var WA=10,ZA=13,_A=15,zA=17,jA=18,qA=19,$A=20,Ae=21,ee=22,te=24,re=25,ne=26,se=27,oe=28,Be=30,ie=32,ae=33,ce=34,ge=35,le=37,we=38,Qe=39,ue=40,he=42,Ce=[9001,65288],Ue="×",Fe="÷",de=function(A,e){var t,r,n,s=function(A){var e,t,r,n,s,o=.75*A.length,B=A.length,i=0;"="===A[A.length-1]&&(o--,"="===A[A.length-2]&&o--);var a="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(o):new Array(o),c=Array.isArray(a)?a:new Uint8Array(a);for(e=0;e>4,c[i++]=(15&r)<<4|n>>2,c[i++]=(3&n)<<6|63&s;return a}(A),o=Array.isArray(s)?function(A){for(var e=A.length,t=[],r=0;r0;){var o=r[--s];if(Array.isArray(A)?-1!==A.indexOf(o):A===o)for(var B=t;B<=r.length;){var i;if((i=r[++B])===e)return!0;if(i!==WA)break}if(o!==WA)break}return!1},be=function(A,e){for(var t=A;t>=0;){var r=e[t];if(r!==WA)return r;t--}return 0},ve=function(A,e,t,r,n){if(0===t[r])return Ue;var s=r-1;if(Array.isArray(n)&&!0===n[s])return Ue;var o=s-1,B=s+1,i=e[s],a=o>=0?e[o]:0,c=e[B];if(2===i&&3===c)return Ue;if(-1!==pe.indexOf(i))return"!";if(-1!==pe.indexOf(c))return Ue;if(-1!==He.indexOf(c))return Ue;if(8===be(s,e))return Fe;if(11===de.get(A[s]))return Ue;if((i===ie||i===ae)&&11===de.get(A[B]))return Ue;if(7===i||7===c)return Ue;if(9===i)return Ue;if(-1===[WA,ZA,_A].indexOf(i)&&9===c)return Ue;if(-1!==[zA,jA,qA,te,oe].indexOf(c))return Ue;if(be(s,e)===ee)return Ue;if(Ke(23,ee,s,e))return Ue;if(Ke([zA,jA],Ae,s,e))return Ue;if(Ke(12,12,s,e))return Ue;if(i===WA)return Fe;if(23===i||23===c)return Ue;if(16===c||16===i)return Fe;if(-1!==[ZA,_A,Ae].indexOf(c)||14===i)return Ue;if(36===a&&-1!==Ie.indexOf(i))return Ue;if(i===oe&&36===c)return Ue;if(c===$A)return Ue;if(-1!==fe.indexOf(c)&&i===re||-1!==fe.indexOf(i)&&c===re)return Ue;if(i===se&&-1!==[le,ie,ae].indexOf(c)||-1!==[le,ie,ae].indexOf(i)&&c===ne)return Ue;if(-1!==fe.indexOf(i)&&-1!==Ee.indexOf(c)||-1!==Ee.indexOf(i)&&-1!==fe.indexOf(c))return Ue;if(-1!==[se,ne].indexOf(i)&&(c===re||-1!==[ee,_A].indexOf(c)&&e[B+1]===re)||-1!==[ee,_A].indexOf(i)&&c===re||i===re&&-1!==[re,oe,te].indexOf(c))return Ue;if(-1!==[re,oe,te,zA,jA].indexOf(c))for(var g=s;g>=0;){if((l=e[g])===re)return Ue;if(-1===[oe,te].indexOf(l))break;g--}if(-1!==[se,ne].indexOf(c))for(g=-1!==[zA,jA].indexOf(i)?o:s;g>=0;){var l;if((l=e[g])===re)return Ue;if(-1===[oe,te].indexOf(l))break;g--}if(we===i&&-1!==[we,Qe,ce,ge].indexOf(c)||-1!==[Qe,ce].indexOf(i)&&-1!==[Qe,ue].indexOf(c)||-1!==[ue,ge].indexOf(i)&&c===ue)return Ue;if(-1!==me.indexOf(i)&&-1!==[$A,ne].indexOf(c)||-1!==me.indexOf(c)&&i===se)return Ue;if(-1!==fe.indexOf(i)&&-1!==fe.indexOf(c))return Ue;if(i===te&&-1!==fe.indexOf(c))return Ue;if(-1!==fe.concat(re).indexOf(i)&&c===ee&&-1===Ce.indexOf(A[B])||-1!==fe.concat(re).indexOf(c)&&i===jA)return Ue;if(41===i&&41===c){for(var w=t[s],Q=1;w>0&&41===e[--w];)Q++;if(Q%2!=0)return Ue}return i===ie&&c===ae?Ue:Fe},Le=function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=function(A,e){void 0===e&&(e="strict");var t=[],r=[],n=[];return A.forEach((function(A,s){var o=de.get(A);if(o>50?(n.push(!0),o-=50):n.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(A))return r.push(s),t.push(16);if(4===o||11===o){if(0===s)return r.push(s),t.push(Be);var B=t[s-1];return-1===ye.indexOf(B)?(r.push(r[s-1]),t.push(B)):(r.push(s),t.push(Be))}return r.push(s),31===o?t.push("strict"===e?Ae:le):o===he||29===o?t.push(Be):43===o?A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(le):t.push(Be):void t.push(o)})),[r,t,n]}(A,e.lineBreak),r=t[0],n=t[1],s=t[2];"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(n=n.map((function(A){return-1!==[re,Be,he].indexOf(A)?le:A})));var o="keep-all"===e.wordBreak?s.map((function(e,t){return e&&A[t]>=19968&&A[t]<=40959})):void 0;return[r,n,o]},De=function(){function A(A,e,t,r){this.codePoints=A,this.required="!"===e,this.start=t,this.end=r}return A.prototype.slice=function(){return TA.apply(void 0,this.codePoints.slice(this.start,this.end))},A}(),xe=45,Se=43,Te=-1,Me=function(A){return A>=48&&A<=57},Oe=function(A){return Me(A)||A>=65&&A<=70||A>=97&&A<=102},Ge=function(A){return 10===A||9===A||32===A},ke=function(A){return function(A){return function(A){return A>=97&&A<=122}(A)||function(A){return A>=65&&A<=90}(A)}(A)||function(A){return A>=128}(A)||95===A},Ve=function(A){return ke(A)||Me(A)||A===xe},Re=function(A){return A>=0&&A<=8||11===A||A>=14&&A<=31||127===A},Pe=function(A,e){return 92===A&&10!==e},Ne=function(A,e,t){return A===xe?ke(e)||Pe(e,t):!!ke(A)||!(92!==A||!Pe(A,e))},Je=function(A,e,t){return A===Se||A===xe?!!Me(e)||46===e&&Me(t):Me(46===A?e:A)},Xe=function(A){var e=0,t=1;A[e]!==Se&&A[e]!==xe||(A[e]===xe&&(t=-1),e++);for(var r=[];Me(A[e]);)r.push(A[e++]);var n=r.length?parseInt(TA.apply(void 0,r),10):0;46===A[e]&&e++;for(var s=[];Me(A[e]);)s.push(A[e++]);var o=s.length,B=o?parseInt(TA.apply(void 0,s),10):0;69!==A[e]&&101!==A[e]||e++;var i=1;A[e]!==Se&&A[e]!==xe||(A[e]===xe&&(i=-1),e++);for(var a=[];Me(A[e]);)a.push(A[e++]);var c=a.length?parseInt(TA.apply(void 0,a),10):0;return t*(n+B*Math.pow(10,-o))*Math.pow(10,i*c)},Ye={type:2},We={type:3},Ze={type:4},_e={type:13},ze={type:8},je={type:21},qe={type:9},$e={type:10},At={type:11},et={type:12},tt={type:14},rt={type:23},nt={type:1},st={type:25},ot={type:24},Bt={type:26},it={type:27},at={type:28},ct={type:29},gt={type:31},lt={type:32},wt=function(){function A(){this._value=[]}return A.prototype.write=function(A){this._value=this._value.concat(SA(A))},A.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==lt;)A.push(e),e=this.consumeToken();return A},A.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case 34:return this.consumeStringToken(34);case 35:var e=this.peekCodePoint(0),t=this.peekCodePoint(1),r=this.peekCodePoint(2);if(Ve(e)||Pe(t,r)){var n=Ne(e,t,r)?2:1;return{type:5,value:this.consumeName(),flags:n}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),_e;break;case 39:return this.consumeStringToken(39);case 40:return Ye;case 41:return We;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),tt;break;case Se:if(Je(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 44:return Ze;case xe:var s=A,o=this.peekCodePoint(0),B=this.peekCodePoint(1);if(Je(s,o,B))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(Ne(s,o,B))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(o===xe&&62===B)return this.consumeCodePoint(),this.consumeCodePoint(),ot;break;case 46:if(Je(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var i=this.consumeCodePoint();if(42===i&&47===(i=this.consumeCodePoint()))return this.consumeToken();if(i===Te)return this.consumeToken()}break;case 58:return Bt;case 59:return it;case 60:if(33===this.peekCodePoint(0)&&this.peekCodePoint(1)===xe&&this.peekCodePoint(2)===xe)return this.consumeCodePoint(),this.consumeCodePoint(),st;break;case 64:var a=this.peekCodePoint(0),c=this.peekCodePoint(1),g=this.peekCodePoint(2);if(Ne(a,c,g))return{type:7,value:this.consumeName()};break;case 91:return at;case 92:if(Pe(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case 93:return ct;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),ze;break;case 123:return At;case 125:return et;case 117:case 85:var l=this.peekCodePoint(0),w=this.peekCodePoint(1);return l!==Se||!Oe(w)&&63!==w||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),qe;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),je;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),$e;break;case Te:return lt}return Ge(A)?(this.consumeWhiteSpace(),gt):Me(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):ke(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:6,value:TA(A)}},A.prototype.consumeCodePoint=function(){var A=this._value.shift();return void 0===A?-1:A},A.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},A.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},A.prototype.consumeUnicodeRangeToken=function(){for(var A=[],e=this.consumeCodePoint();Oe(e)&&A.length<6;)A.push(e),e=this.consumeCodePoint();for(var t=!1;63===e&&A.length<6;)A.push(e),e=this.consumeCodePoint(),t=!0;if(t)return{type:30,start:parseInt(TA.apply(void 0,A.map((function(A){return 63===A?48:A}))),16),end:parseInt(TA.apply(void 0,A.map((function(A){return 63===A?70:A}))),16)};var r=parseInt(TA.apply(void 0,A),16);if(this.peekCodePoint(0)===xe&&Oe(this.peekCodePoint(1))){this.consumeCodePoint(),e=this.consumeCodePoint();for(var n=[];Oe(e)&&n.length<6;)n.push(e),e=this.consumeCodePoint();return{type:30,start:r,end:parseInt(TA.apply(void 0,n),16)}}return{type:30,start:r,end:r}},A.prototype.consumeIdentLikeToken=function(){var A=this.consumeName();return"url"===A.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:19,value:A}):{type:20,value:A}},A.prototype.consumeUrlToken=function(){var A=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===Te)return{type:22,value:""};var e=this.peekCodePoint(0);if(39===e||34===e){var t=this.consumeStringToken(this.consumeCodePoint());return 0===t.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===Te||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:t.value}):(this.consumeBadUrlRemnants(),rt)}for(;;){var r=this.consumeCodePoint();if(r===Te||41===r)return{type:22,value:TA.apply(void 0,A)};if(Ge(r))return this.consumeWhiteSpace(),this.peekCodePoint(0)===Te||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:TA.apply(void 0,A)}):(this.consumeBadUrlRemnants(),rt);if(34===r||39===r||40===r||Re(r))return this.consumeBadUrlRemnants(),rt;if(92===r){if(!Pe(r,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),rt;A.push(this.consumeEscapedCodePoint())}else A.push(r)}},A.prototype.consumeWhiteSpace=function(){for(;Ge(this.peekCodePoint(0));)this.consumeCodePoint()},A.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(41===A||A===Te)return;Pe(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},A.prototype.consumeStringSlice=function(A){for(var e="";A>0;){var t=Math.min(5e4,A);e+=TA.apply(void 0,this._value.splice(0,t)),A-=t}return this._value.shift(),e},A.prototype.consumeStringToken=function(A){for(var e="",t=0;;){var r=this._value[t];if(r===Te||void 0===r||r===A)return{type:0,value:e+=this.consumeStringSlice(t)};if(10===r)return this._value.splice(0,t),nt;if(92===r){var n=this._value[t+1];n!==Te&&void 0!==n&&(10===n?(e+=this.consumeStringSlice(t),t=-1,this._value.shift()):Pe(r,n)&&(e+=this.consumeStringSlice(t),e+=TA(this.consumeEscapedCodePoint()),t=-1))}t++}},A.prototype.consumeNumber=function(){var A=[],e=4,t=this.peekCodePoint(0);for(t!==Se&&t!==xe||A.push(this.consumeCodePoint());Me(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(46===t&&Me(r))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;Me(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0),r=this.peekCodePoint(1);var n=this.peekCodePoint(2);if((69===t||101===t)&&((r===Se||r===xe)&&Me(n)||Me(r)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;Me(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[Xe(A),e]},A.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),e=A[0],t=A[1],r=this.peekCodePoint(0),n=this.peekCodePoint(1),s=this.peekCodePoint(2);return Ne(r,n,s)?{type:15,number:e,flags:t,unit:this.consumeName()}:37===r?(this.consumeCodePoint(),{type:16,number:e,flags:t}):{type:17,number:e,flags:t}},A.prototype.consumeEscapedCodePoint=function(){var A=this.consumeCodePoint();if(Oe(A)){for(var e=TA(A);Oe(this.peekCodePoint(0))&&e.length<6;)e+=TA(this.consumeCodePoint());Ge(this.peekCodePoint(0))&&this.consumeCodePoint();var t=parseInt(e,16);return 0===t||function(A){return A>=55296&&A<=57343}(t)||t>1114111?65533:t}return A===Te?65533:A},A.prototype.consumeName=function(){for(var A="";;){var e=this.consumeCodePoint();if(Ve(e))A+=TA(e);else{if(!Pe(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),A;A+=TA(this.consumeEscapedCodePoint())}}},A}(),Qt=function(){function A(A){this._tokens=A}return A.create=function(e){var t=new wt;return t.write(e),new A(t.read())},A.parseValue=function(e){return A.create(e).parseComponentValue()},A.parseValues=function(e){return A.create(e).parseComponentValues()},A.prototype.parseComponentValue=function(){for(var A=this.consumeToken();31===A.type;)A=this.consumeToken();if(32===A.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(A);var e=this.consumeComponentValue();do{A=this.consumeToken()}while(31===A.type);if(32===A.type)return e;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},A.prototype.parseComponentValues=function(){for(var A=[];;){var e=this.consumeComponentValue();if(32===e.type)return A;A.push(e),A.push()}},A.prototype.consumeComponentValue=function(){var A=this.consumeToken();switch(A.type){case 11:case 28:case 2:return this.consumeSimpleBlock(A.type);case 19:return this.consumeFunction(A)}return A},A.prototype.consumeSimpleBlock=function(A){for(var e={type:A,values:[]},t=this.consumeToken();;){if(32===t.type||Ht(t,A))return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue()),t=this.consumeToken()}},A.prototype.consumeFunction=function(A){for(var e={name:A.value,values:[],type:18};;){var t=this.consumeToken();if(32===t.type||3===t.type)return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue())}},A.prototype.consumeToken=function(){var A=this._tokens.shift();return void 0===A?lt:A},A.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},A}(),ut=function(A){return 15===A.type},ht=function(A){return 17===A.type},Ct=function(A){return 20===A.type},Ut=function(A){return 0===A.type},Ft=function(A,e){return Ct(A)&&A.value===e},dt=function(A){return 31!==A.type},ft=function(A){return 31!==A.type&&4!==A.type},pt=function(A){var e=[],t=[];return A.forEach((function(A){if(4===A.type){if(0===t.length)throw new Error("Error parsing function args, zero tokens for arg");return e.push(t),void(t=[])}31!==A.type&&t.push(A)})),t.length&&e.push(t),e},Ht=function(A,e){return 11===e&&12===A.type||28===e&&29===A.type||2===e&&3===A.type},Et=function(A){return 17===A.type||15===A.type},yt=function(A){return 16===A.type||Et(A)},mt=function(A){return A.length>1?[A[0],A[1]]:[A[0]]},It={type:17,number:0,flags:4},Kt={type:16,number:50,flags:4},bt={type:16,number:100,flags:4},vt=function(A,e,t){var r=A[0],n=A[1];return[Lt(r,e),Lt(void 0!==n?n:r,t)]},Lt=function(A,e){if(16===A.type)return A.number/100*e;if(ut(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},Dt="grad",xt="turn",St=function(A,e){if(15===e.type)switch(e.unit){case"deg":return Math.PI*e.number/180;case Dt:return Math.PI/200*e.number;case"rad":return e.number;case xt:return 2*Math.PI*e.number}throw new Error("Unsupported angle type")},Tt=function(A){return 15===A.type&&("deg"===A.unit||A.unit===Dt||"rad"===A.unit||A.unit===xt)},Mt=function(A){switch(A.filter(Ct).map((function(A){return A.value})).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[It,It];case"to top":case"bottom":return Ot(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[It,bt];case"to right":case"left":return Ot(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[bt,bt];case"to bottom":case"top":return Ot(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[bt,It];case"to left":case"right":return Ot(270)}return 0},Ot=function(A){return Math.PI*A/180},Gt=function(A,e){if(18===e.type){var t=Wt[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return t(A,e.values)}if(5===e.type){if(3===e.value.length){var r=e.value.substring(0,1),n=e.value.substring(1,2),s=e.value.substring(2,3);return Rt(parseInt(r+r,16),parseInt(n+n,16),parseInt(s+s,16),1)}if(4===e.value.length){r=e.value.substring(0,1),n=e.value.substring(1,2),s=e.value.substring(2,3);var o=e.value.substring(3,4);return Rt(parseInt(r+r,16),parseInt(n+n,16),parseInt(s+s,16),parseInt(o+o,16)/255)}if(6===e.value.length)return r=e.value.substring(0,2),n=e.value.substring(2,4),s=e.value.substring(4,6),Rt(parseInt(r,16),parseInt(n,16),parseInt(s,16),1);if(8===e.value.length)return r=e.value.substring(0,2),n=e.value.substring(2,4),s=e.value.substring(4,6),o=e.value.substring(6,8),Rt(parseInt(r,16),parseInt(n,16),parseInt(s,16),parseInt(o,16)/255)}if(20===e.type){var B=_t[e.value.toUpperCase()];if(void 0!==B)return B}return _t.TRANSPARENT},kt=function(A){return 0==(255&A)},Vt=function(A){var e=255&A,t=255&A>>8,r=255&A>>16,n=255&A>>24;return e<255?"rgba("+n+","+r+","+t+","+e/255+")":"rgb("+n+","+r+","+t+")"},Rt=function(A,e,t,r){return(A<<24|e<<16|t<<8|Math.round(255*r)<<0)>>>0},Pt=function(A,e){if(17===A.type)return A.number;if(16===A.type){var t=3===e?1:255;return 3===e?A.number/100*t:Math.round(A.number/100*t)}return 0},Nt=function(A,e){var t=e.filter(ft);if(3===t.length){var r=t.map(Pt),n=r[0],s=r[1],o=r[2];return Rt(n,s,o,1)}if(4===t.length){var B=t.map(Pt),i=(n=B[0],s=B[1],o=B[2],B[3]);return Rt(n,s,o,i)}return 0};function Jt(A,e,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-A)*t*6+A:t<.5?e:t<2/3?6*(e-A)*(2/3-t)+A:A}var Xt,Yt=function(A,e){var t=e.filter(ft),r=t[0],n=t[1],s=t[2],o=t[3],B=(17===r.type?Ot(r.number):St(A,r))/(2*Math.PI),i=yt(n)?n.number/100:0,a=yt(s)?s.number/100:0,c=void 0!==o&&yt(o)?Lt(o,1):1;if(0===i)return Rt(255*a,255*a,255*a,1);var g=a<=.5?a*(i+1):a+i-a*i,l=2*a-g,w=Jt(l,g,B+1/3),Q=Jt(l,g,B),u=Jt(l,g,B-1/3);return Rt(255*w,255*Q,255*u,c)},Wt={hsl:Yt,hsla:Yt,rgb:Nt,rgba:Nt},Zt=function(A,e){return Gt(A,Qt.create(e).parseComponentValue())},_t={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},zt={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map((function(A){if(Ct(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},jt={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},qt=function(A,e){var t=Gt(A,e[0]),r=e[1];return r&&yt(r)?{color:t,stop:r}:{color:t,stop:null}},$t=function(A,e){var t=A[0],r=A[A.length-1];null===t.stop&&(t.stop=It),null===r.stop&&(r.stop=bt);for(var n=[],s=0,o=0;os?n.push(i):n.push(s),s=i}else n.push(null)}var a=null;for(o=0;oA.optimumDistance)?{optimumCorner:e,optimumDistance:B}:A}),{optimumDistance:n?1/0:-1/0,optimumCorner:null}).optimumCorner},rr=function(A,e){var t=Ot(180),r=[];return pt(e).forEach((function(e,n){if(0===n){var s=e[0];if(20===s.type&&-1!==["top","left","right","bottom"].indexOf(s.value))return void(t=Mt(e));if(Tt(s))return void(t=(St(A,s)+Ot(270))%Ot(360))}var o=qt(A,e);r.push(o)})),{angle:t,stops:r,type:1}},nr="closest-side",sr="farthest-side",or="closest-corner",Br="farthest-corner",ir="circle",ar="ellipse",cr="cover",gr="contain",lr=function(A,e){var t=0,r=3,n=[],s=[];return pt(e).forEach((function(e,o){var B=!0;if(0===o?B=e.reduce((function(A,e){if(Ct(e))switch(e.value){case"center":return s.push(Kt),!1;case"top":case"left":return s.push(It),!1;case"right":case"bottom":return s.push(bt),!1}else if(yt(e)||Et(e))return s.push(e),!1;return A}),B):1===o&&(B=e.reduce((function(A,e){if(Ct(e))switch(e.value){case ir:return t=0,!1;case ar:return t=1,!1;case gr:case nr:return r=0,!1;case sr:return r=1,!1;case or:return r=2,!1;case cr:case Br:return r=3,!1}else if(Et(e)||yt(e))return Array.isArray(r)||(r=[]),r.push(e),!1;return A}),B)),B){var i=qt(A,e);n.push(i)}})),{size:r,shape:t,stops:n,position:s,type:2}},wr=function(A,e){if(22===e.type){var t={url:e.value,type:0};return A.cache.addImage(e.value),t}if(18===e.type){var r=Qr[e.name];if(void 0===r)throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return r(A,e.values)}throw new Error("Unsupported image type "+e.type)},Qr={"linear-gradient":function(A,e){var t=Ot(180),r=[];return pt(e).forEach((function(e,n){if(0===n){var s=e[0];if(20===s.type&&"to"===s.value)return void(t=Mt(e));if(Tt(s))return void(t=St(A,s))}var o=qt(A,e);r.push(o)})),{angle:t,stops:r,type:1}},"-moz-linear-gradient":rr,"-ms-linear-gradient":rr,"-o-linear-gradient":rr,"-webkit-linear-gradient":rr,"radial-gradient":function(A,e){var t=0,r=3,n=[],s=[];return pt(e).forEach((function(e,o){var B=!0;if(0===o){var i=!1;B=e.reduce((function(A,e){if(i)if(Ct(e))switch(e.value){case"center":return s.push(Kt),A;case"top":case"left":return s.push(It),A;case"right":case"bottom":return s.push(bt),A}else(yt(e)||Et(e))&&s.push(e);else if(Ct(e))switch(e.value){case ir:return t=0,!1;case ar:return t=1,!1;case"at":return i=!0,!1;case nr:return r=0,!1;case cr:case sr:return r=1,!1;case gr:case or:return r=2,!1;case Br:return r=3,!1}else if(Et(e)||yt(e))return Array.isArray(r)||(r=[]),r.push(e),!1;return A}),B)}if(B){var a=qt(A,e);n.push(a)}})),{size:r,shape:t,stops:n,position:s,type:2}},"-moz-radial-gradient":lr,"-ms-radial-gradient":lr,"-o-radial-gradient":lr,"-webkit-radial-gradient":lr,"-webkit-gradient":function(A,e){var t=Ot(180),r=[],n=1;return pt(e).forEach((function(e,t){var s=e[0];if(0===t){if(Ct(s)&&"linear"===s.value)return void(n=1);if(Ct(s)&&"radial"===s.value)return void(n=2)}if(18===s.type)if("from"===s.name){var o=Gt(A,s.values[0]);r.push({stop:It,color:o})}else if("to"===s.name)o=Gt(A,s.values[0]),r.push({stop:bt,color:o});else if("color-stop"===s.name){var B=s.values.filter(ft);if(2===B.length){o=Gt(A,B[1]);var i=B[0];ht(i)&&r.push({stop:{type:16,number:100*i.number,flags:i.flags},color:o})}}})),1===n?{angle:(t+Ot(180))%Ot(360),stops:r,type:n}:{size:3,shape:0,stops:r,position:[],type:n}}},ur={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(0===e.length)return[];var t=e[0];return 20===t.type&&"none"===t.value?[]:e.filter((function(A){return ft(A)&&function(A){return!(20===A.type&&"none"===A.value||18===A.type&&!Qr[A.name])}(A)})).map((function(e){return wr(A,e)}))}},hr={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map((function(A){if(Ct(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},Cr={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(A,e){return pt(e).map((function(A){return A.filter(yt)})).map(mt)}},Ur={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(A,e){return pt(e).map((function(A){return A.filter(Ct).map((function(A){return A.value})).join(" ")})).map(Fr)}},Fr=function(A){switch(A){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};!function(A){A.AUTO="auto",A.CONTAIN="contain",A.COVER="cover"}(Xt||(Xt={}));var dr,fr={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(A,e){return pt(e).map((function(A){return A.filter(pr)}))}},pr=function(A){return Ct(A)||yt(A)},Hr=function(A){return{name:"border-"+A+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},Er=Hr("top"),yr=Hr("right"),mr=Hr("bottom"),Ir=Hr("left"),Kr=function(A){return{name:"border-radius-"+A,initialValue:"0 0",prefix:!1,type:1,parse:function(A,e){return mt(e.filter(yt))}}},br=Kr("top-left"),vr=Kr("top-right"),Lr=Kr("bottom-right"),Dr=Kr("bottom-left"),xr=function(A){return{name:"border-"+A+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(A,e){switch(e){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},Sr=xr("top"),Tr=xr("right"),Mr=xr("bottom"),Or=xr("left"),Gr=function(A){return{name:"border-"+A+"-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return ut(e)?e.number:0}}},kr=Gr("top"),Vr=Gr("right"),Rr=Gr("bottom"),Pr=Gr("left"),Nr={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Jr={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(A,e){return"rtl"===e?1:0}},Xr={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(A,e){return e.filter(Ct).reduce((function(A,e){return A|Yr(e.value)}),0)}},Yr=function(A){switch(A){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},Wr={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},Zr={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(A,e){return 20===e.type&&"normal"===e.value?0:17===e.type||15===e.type?e.number:0}};!function(A){A.NORMAL="normal",A.STRICT="strict"}(dr||(dr={}));var _r,zr={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"strict"===e?dr.STRICT:dr.NORMAL}},jr={name:"line-height",initialValue:"normal",prefix:!1,type:4},qr=function(A,e){return Ct(A)&&"normal"===A.value?1.2*e:17===A.type?e*A.number:yt(A)?Lt(A,e):e},$r={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(A,e){return 20===e.type&&"none"===e.value?null:wr(A,e)}},An={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(A,e){return"inside"===e?0:1}},en={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},tn=function(A){return{name:"margin-"+A,initialValue:"0",prefix:!1,type:4}},rn=tn("top"),nn=tn("right"),sn=tn("bottom"),on=tn("left"),Bn={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(A,e){return e.filter(Ct).map((function(A){switch(A.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}}))}},an={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"break-word"===e?"break-word":"normal"}},cn=function(A){return{name:"padding-"+A,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},gn=cn("top"),ln=cn("right"),wn=cn("bottom"),Qn=cn("left"),un={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(A,e){switch(e){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},hn={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(A,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Cn={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&Ft(e[0],"none")?[]:pt(e).map((function(e){for(var t={color:_t.TRANSPARENT,offsetX:It,offsetY:It,blur:It},r=0,n=0;n1?1:0],this.overflowWrap=zn(A,an,e.overflowWrap),this.paddingTop=zn(A,gn,e.paddingTop),this.paddingRight=zn(A,ln,e.paddingRight),this.paddingBottom=zn(A,wn,e.paddingBottom),this.paddingLeft=zn(A,Qn,e.paddingLeft),this.paintOrder=zn(A,Jn,e.paintOrder),this.position=zn(A,hn,e.position),this.textAlign=zn(A,un,e.textAlign),this.textDecorationColor=zn(A,bn,null!==(t=e.textDecorationColor)&&void 0!==t?t:e.color),this.textDecorationLine=zn(A,vn,null!==(r=e.textDecorationLine)&&void 0!==r?r:e.textDecoration),this.textShadow=zn(A,Cn,e.textShadow),this.textTransform=zn(A,Un,e.textTransform),this.transform=zn(A,Fn,e.transform),this.transformOrigin=zn(A,Hn,e.transformOrigin),this.visibility=zn(A,En,e.visibility),this.webkitTextStrokeColor=zn(A,Xn,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=zn(A,Yn,e.webkitTextStrokeWidth),this.wordBreak=zn(A,yn,e.wordBreak),this.zIndex=zn(A,mn,e.zIndex)}return A.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},A.prototype.isTransparent=function(){return kt(this.backgroundColor)},A.prototype.isTransformed=function(){return null!==this.transform},A.prototype.isPositioned=function(){return 0!==this.position},A.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},A.prototype.isFloating=function(){return 0!==this.float},A.prototype.isInlineLevel=function(){return Mn(this.display,4)||Mn(this.display,33554432)||Mn(this.display,268435456)||Mn(this.display,536870912)||Mn(this.display,67108864)||Mn(this.display,134217728)},A}(),Zn=function(A,e){this.content=zn(A,On,e.content),this.quotes=zn(A,Rn,e.quotes)},_n=function(A,e){this.counterIncrement=zn(A,Gn,e.counterIncrement),this.counterReset=zn(A,kn,e.counterReset)},zn=function(A,e,t){var r=new wt,n=null!=t?t.toString():e.initialValue;r.write(n);var s=new Qt(r.read());switch(e.type){case 2:var o=s.parseComponentValue();return e.parse(A,Ct(o)?o.value:e.initialValue);case 0:return e.parse(A,s.parseComponentValue());case 1:return e.parse(A,s.parseComponentValues());case 4:return s.parseComponentValue();case 3:switch(e.format){case"angle":return St(A,s.parseComponentValue());case"color":return Gt(A,s.parseComponentValue());case"image":return wr(A,s.parseComponentValue());case"length":var B=s.parseComponentValue();return Et(B)?B:It;case"length-percentage":var i=s.parseComponentValue();return yt(i)?i:It;case"time":return In(A,s.parseComponentValue())}}},jn=function(A,e){var t=function(A){switch(A.getAttribute("data-html2canvas-debug")){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}}(A);return 1===t||e===t},qn=function(A,e){this.context=A,this.textNodes=[],this.elements=[],this.flags=0,jn(e,3),this.styles=new Wn(A,window.getComputedStyle(e,null)),to(e)&&(this.styles.animationDuration.some((function(A){return A>0}))&&(e.style.animationDuration="0s"),null!==this.styles.transform&&(e.style.transform="none")),this.bounds=xA(this.context,e),jn(e,4)&&(this.flags|=16)},$n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",As="undefined"==typeof Uint8Array?[]:new Uint8Array(256),es=0;es<64;es++)As[$n.charCodeAt(es)]=es;for(var ts=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},rs=function(){function A(A,e,t,r,n,s){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=r,this.index=n,this.data=s}return A.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),ns="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ss="undefined"==typeof Uint8Array?[]:new Uint8Array(256),os=0;os<64;os++)ss[ns.charCodeAt(os)]=os;var Bs,is=8,as=9,cs=11,gs=12,ls=function(){for(var A=[],e=0;e>10),o%1024+56320)),(n+1===t||r.length>16384)&&(s+=String.fromCharCode.apply(String,r),r.length=0)}return s},ws=function(A,e){var t,r,n,s=function(A){var e,t,r,n,s,o=.75*A.length,B=A.length,i=0;"="===A[A.length-1]&&(o--,"="===A[A.length-2]&&o--);var a="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(o):new Array(o),c=Array.isArray(a)?a:new Uint8Array(a);for(e=0;e>4,c[i++]=(15&r)<<4|n>>2,c[i++]=(3&n)<<6|63&s;return a}(A),o=Array.isArray(s)?function(A){for(var e=A.length,t=[],r=0;r=55296&&n<=56319&&t=t)return{done:!0,value:null};for(var A=Qs;ro.x||n.y>o.y;return o=n,0===e||B}));return A.body.removeChild(e),B}(document);return Object.defineProperty(fs,"SUPPORT_WORD_BREAKING",{value:A}),A},get SUPPORT_SVG_DRAWING(){var A=function(A){var e=new Image,t=A.createElement("canvas"),r=t.getContext("2d");if(!r)return!1;e.src="data:image/svg+xml,";try{r.drawImage(e,0,0),t.toDataURL()}catch(n){return!1}return!0}(document);return Object.defineProperty(fs,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A="function"==typeof Array.from&&"function"==typeof window.fetch?function(A){var e=A.createElement("canvas"),t=100;e.width=t,e.height=t;var r=e.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,t,t);var n=new Image,s=e.toDataURL();n.src=s;var o=Fs(t,t,0,0,n);return r.fillStyle="red",r.fillRect(0,0,t,t),ds(o).then((function(e){r.drawImage(e,0,0);var n=r.getImageData(0,0,t,t).data;r.fillStyle="red",r.fillRect(0,0,t,t);var o=A.createElement("div");return o.style.backgroundImage="url("+s+")",o.style.height=t+"px",Us(n)?ds(Fs(t,t,0,0,o)):Promise.reject(!1)})).then((function(A){return r.drawImage(A,0,0),Us(r.getImageData(0,0,t,t).data)})).catch((function(){return!1}))}(document):Promise.resolve(!1);return Object.defineProperty(fs,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(fs,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(fs,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(fs,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var A=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(fs,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:A}),A}},ps=function(A,e){this.text=A,this.bounds=e},Hs=function(A,e){var t=e.ownerDocument;if(t){var r=t.createElement("html2canvaswrapper");r.appendChild(e.cloneNode(!0));var n=e.parentNode;if(n){n.replaceChild(r,e);var s=xA(A,r);return r.firstChild&&n.replaceChild(r.firstChild,r),s}}return DA.EMPTY},Es=function(A,e,t){var r=A.ownerDocument;if(!r)throw new Error("Node has no owner document");var n=r.createRange();return n.setStart(A,e),n.setEnd(A,e+t),n},ys=function(A){if(fs.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(A)).map((function(A){return A.segment}))}return function(A){for(var e,t=Cs(A),r=[];!(e=t.next()).done;)e.value&&r.push(e.value.slice());return r}(A)},ms=function(A,e){return 0!==e.letterSpacing?ys(A):function(A,e){if(fs.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(A)).map((function(A){return A.segment}))}return Ks(A,e)}(A,e)},Is=[32,160,4961,65792,65793,4153,4241],Ks=function(A,e){for(var t,r=function(A,e){var t=SA(A),r=Le(t,e),n=r[0],s=r[1],o=r[2],B=t.length,i=0,a=0;return{next:function(){if(a>=B)return{done:!0,value:null};for(var A=Ue;a0)if(fs.SUPPORT_RANGE_BOUNDS){var n=Es(r,o,e.length).getClientRects();if(n.length>1){var B=ys(e),i=0;B.forEach((function(e){s.push(new ps(e,DA.fromDOMRectList(A,Es(r,i+o,e.length).getClientRects()))),i+=e.length}))}else s.push(new ps(e,DA.fromDOMRectList(A,n)))}else{var a=r.splitText(e.length);s.push(new ps(e,Hs(A,r))),r=a}else fs.SUPPORT_RANGE_BOUNDS||(r=r.splitText(e.length));o+=e.length})),s}(A,this.text,t,e)},vs=function(A,e){switch(e){case 1:return A.toLowerCase();case 3:return A.replace(Ls,Ds);case 2:return A.toUpperCase();default:return A}},Ls=/(^|\s|:|-|\(|\))([a-z])/g,Ds=function(A,e,t){return A.length>0?e+t.toUpperCase():A},xs=function(A){function e(e,t){var r=A.call(this,e,t)||this;return r.src=t.currentSrc||t.src,r.intrinsicWidth=t.naturalWidth,r.intrinsicHeight=t.naturalHeight,r.context.cache.addImage(r.src),r}return IA(e,A),e}(qn),Ss=function(A){function e(e,t){var r=A.call(this,e,t)||this;return r.canvas=t,r.intrinsicWidth=t.width,r.intrinsicHeight=t.height,r}return IA(e,A),e}(qn),Ts=function(A){function e(e,t){var r=A.call(this,e,t)||this,n=new XMLSerializer,s=xA(e,t);return t.setAttribute("width",s.width+"px"),t.setAttribute("height",s.height+"px"),r.svg="data:image/svg+xml,"+encodeURIComponent(n.serializeToString(t)),r.intrinsicWidth=t.width.baseVal.value,r.intrinsicHeight=t.height.baseVal.value,r.context.cache.addImage(r.svg),r}return IA(e,A),e}(qn),Ms=function(A){function e(e,t){var r=A.call(this,e,t)||this;return r.value=t.value,r}return IA(e,A),e}(qn),Os=function(A){function e(e,t){var r=A.call(this,e,t)||this;return r.start=t.start,r.reversed="boolean"==typeof t.reversed&&!0===t.reversed,r}return IA(e,A),e}(qn),Gs=[{type:15,flags:0,unit:"px",number:3}],ks=[{type:16,flags:0,number:50}],Vs="checkbox",Rs="radio",Ps="password",Ns=707406591,Js=function(A){function e(e,t){var r,n,s,o=A.call(this,e,t)||this;switch(o.type=t.type.toLowerCase(),o.checked=t.checked,o.value=0===(n=(r=t).type===Ps?new Array(r.value.length+1).join("•"):r.value).length?r.placeholder||"":n,o.type!==Vs&&o.type!==Rs||(o.styles.backgroundColor=3739148031,o.styles.borderTopColor=o.styles.borderRightColor=o.styles.borderBottomColor=o.styles.borderLeftColor=2779096575,o.styles.borderTopWidth=o.styles.borderRightWidth=o.styles.borderBottomWidth=o.styles.borderLeftWidth=1,o.styles.borderTopStyle=o.styles.borderRightStyle=o.styles.borderBottomStyle=o.styles.borderLeftStyle=1,o.styles.backgroundClip=[0],o.styles.backgroundOrigin=[0],o.bounds=(s=o.bounds).width>s.height?new DA(s.left+(s.width-s.height)/2,s.top,s.height,s.height):s.width0)t.textNodes.push(new bs(A,n,t.styles));else if(eo(n))if(ho(n)&&n.assignedNodes)n.assignedNodes().forEach((function(e){return _s(A,e,t,r)}));else{var o=zs(A,n);o.styles.isVisible()&&(qs(n,o,r)?o.flags|=4:$s(o.styles)&&(o.flags|=2),-1!==Zs.indexOf(n.tagName)&&(o.flags|=8),t.elements.push(o),n.slot,n.shadowRoot?_s(A,n.shadowRoot,o,r):Qo(n)||Bo(n)||uo(n)||_s(A,n,o,r))}},zs=function(A,e){return go(e)?new xs(A,e):ao(e)?new Ss(A,e):Bo(e)?new Ts(A,e):no(e)?new Ms(A,e):so(e)?new Os(A,e):oo(e)?new Js(A,e):uo(e)?new Xs(A,e):Qo(e)?new Ys(A,e):lo(e)?new Ws(A,e):new qn(A,e)},js=function(A,e){var t=zs(A,e);return t.flags|=4,_s(A,e,t,t),t},qs=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||io(A)&&t.styles.isTransparent()},$s=function(A){return A.isPositioned()||A.isFloating()},Ao=function(A){return A.nodeType===Node.TEXT_NODE},eo=function(A){return A.nodeType===Node.ELEMENT_NODE},to=function(A){return eo(A)&&void 0!==A.style&&!ro(A)},ro=function(A){return"object"==typeof A.className},no=function(A){return"LI"===A.tagName},so=function(A){return"OL"===A.tagName},oo=function(A){return"INPUT"===A.tagName},Bo=function(A){return"svg"===A.tagName},io=function(A){return"BODY"===A.tagName},ao=function(A){return"CANVAS"===A.tagName},co=function(A){return"VIDEO"===A.tagName},go=function(A){return"IMG"===A.tagName},lo=function(A){return"IFRAME"===A.tagName},wo=function(A){return"STYLE"===A.tagName},Qo=function(A){return"TEXTAREA"===A.tagName},uo=function(A){return"SELECT"===A.tagName},ho=function(A){return"SLOT"===A.tagName},Co=function(A){return A.tagName.indexOf("-")>0},Uo=function(){function A(){this.counters={}}return A.prototype.getCounterValue=function(A){var e=this.counters[A];return e&&e.length?e[e.length-1]:1},A.prototype.getCounterValues=function(A){var e=this.counters[A];return e||[]},A.prototype.pop=function(A){var e=this;A.forEach((function(A){return e.counters[A].pop()}))},A.prototype.parse=function(A){var e=this,t=A.counterIncrement,r=A.counterReset,n=!0;null!==t&&t.forEach((function(A){var t=e.counters[A.counter];t&&0!==A.increment&&(n=!1,t.length||t.push(1),t[Math.max(0,t.length-1)]+=A.increment)}));var s=[];return n&&r.forEach((function(A){var t=e.counters[A.counter];s.push(A.counter),t||(t=e.counters[A.counter]=[]),t.push(A.reset)})),s},A}(),Fo={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},fo={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},po={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Ho={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Eo=function(A,e,t,r,n,s){return At?xo(A,n,s.length>0):r.integers.reduce((function(e,t,n){for(;A>=t;)A-=t,e+=r.values[n];return e}),"")+s},yo=function(A,e,t,r){var n="";do{t||A--,n=r(A)+n,A/=e}while(A*e>=e);return n},mo=function(A,e,t,r,n){var s=t-e+1;return(A<0?"-":"")+(yo(Math.abs(A),s,r,(function(A){return TA(Math.floor(A%s)+e)}))+n)},Io=function(A,e,t){void 0===t&&(t=". ");var r=e.length;return yo(Math.abs(A),r,!1,(function(A){return e[Math.floor(A%r)]}))+t},Ko=function(A,e,t,r,n,s){if(A<-9999||A>9999)return xo(A,4,n.length>0);var o=Math.abs(A),B=n;if(0===o)return e[0]+B;for(var i=0;o>0&&i<=4;i++){var a=o%10;0===a&&Mn(s,1)&&""!==B?B=e[a]+B:a>1||1===a&&0===i||1===a&&1===i&&Mn(s,2)||1===a&&1===i&&Mn(s,4)&&A>100||1===a&&i>1&&Mn(s,8)?B=e[a]+(i>0?t[i-1]:"")+B:1===a&&i>0&&(B=t[i-1]+B),o=Math.floor(o/10)}return(A<0?r:"")+B},bo="十百千萬",vo="拾佰仟萬",Lo="マイナス",Do="마이너스",xo=function(A,e,t){var r=t?". ":"",n=t?"、":"",s=t?", ":"",o=t?" ":"";switch(e){case 0:return"•"+o;case 1:return"◦"+o;case 2:return"◾"+o;case 5:var B=mo(A,48,57,!0,r);return B.length<4?"0"+B:B;case 4:return Io(A,"〇一二三四五六七八九",n);case 6:return Eo(A,1,3999,Fo,3,r).toLowerCase();case 7:return Eo(A,1,3999,Fo,3,r);case 8:return mo(A,945,969,!1,r);case 9:return mo(A,97,122,!1,r);case 10:return mo(A,65,90,!1,r);case 11:return mo(A,1632,1641,!0,r);case 12:case 49:return Eo(A,1,9999,fo,3,r);case 35:return Eo(A,1,9999,fo,3,r).toLowerCase();case 13:return mo(A,2534,2543,!0,r);case 14:case 30:return mo(A,6112,6121,!0,r);case 15:return Io(A,"子丑寅卯辰巳午未申酉戌亥",n);case 16:return Io(A,"甲乙丙丁戊己庚辛壬癸",n);case 17:case 48:return Ko(A,"零一二三四五六七八九",bo,"負",n,14);case 47:return Ko(A,"零壹貳參肆伍陸柒捌玖",vo,"負",n,15);case 42:return Ko(A,"零一二三四五六七八九",bo,"负",n,14);case 41:return Ko(A,"零壹贰叁肆伍陆柒捌玖",vo,"负",n,15);case 26:return Ko(A,"〇一二三四五六七八九","十百千万",Lo,n,0);case 25:return Ko(A,"零壱弐参四伍六七八九","拾百千万",Lo,n,7);case 31:return Ko(A,"영일이삼사오육칠팔구","십백천만",Do,s,7);case 33:return Ko(A,"零一二三四五六七八九","十百千萬",Do,s,0);case 32:return Ko(A,"零壹貳參四五六七八九","拾百千",Do,s,7);case 18:return mo(A,2406,2415,!0,r);case 20:return Eo(A,1,19999,Ho,3,r);case 21:return mo(A,2790,2799,!0,r);case 22:return mo(A,2662,2671,!0,r);case 22:return Eo(A,1,10999,po,3,r);case 23:return Io(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return Io(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return mo(A,3302,3311,!0,r);case 28:return Io(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",n);case 29:return Io(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",n);case 34:return mo(A,3792,3801,!0,r);case 37:return mo(A,6160,6169,!0,r);case 38:return mo(A,4160,4169,!0,r);case 39:return mo(A,2918,2927,!0,r);case 40:return mo(A,1776,1785,!0,r);case 43:return mo(A,3046,3055,!0,r);case 44:return mo(A,3174,3183,!0,r);case 45:return mo(A,3664,3673,!0,r);case 46:return mo(A,3872,3881,!0,r);default:return mo(A,48,57,!0,r)}},So="data-html2canvas-ignore",To=function(){function A(A,e,t){if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new Uo,this.quoteDepth=0,!e.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(e.ownerDocument.documentElement,!1)}return A.prototype.toIFrame=function(A,e){var t=this,r=Oo(A,e);if(!r.contentWindow)return Promise.reject("Unable to find iframe window");var n=A.defaultView.pageXOffset,s=A.defaultView.pageYOffset,o=r.contentWindow,B=o.document,i=Vo(r).then((function(){return bA(t,void 0,void 0,(function(){var A,t;return vA(this,(function(n){switch(n.label){case 0:return this.scrolledElements.forEach(Xo),o&&(o.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||o.scrollY===e.top&&o.scrollX===e.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(o.scrollX-e.left,o.scrollY-e.top,0,0))),A=this.options.onclone,void 0===(t=this.clonedReferenceElement)?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:B.fonts&&B.fonts.ready?[4,B.fonts.ready]:[3,2];case 1:n.sent(),n.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,ko(B)]:[3,4];case 3:n.sent(),n.label=4;case 4:return"function"==typeof A?[2,Promise.resolve().then((function(){return A(B,t)})).then((function(){return r}))]:[2,r]}}))}))}));return B.open(),B.write(No(document.doctype)+""),Jo(this.referenceElement.ownerDocument,n,s),B.replaceChild(B.adoptNode(this.documentElement),B.documentElement),B.close(),i},A.prototype.createElementClone=function(A){if(jn(A,2),ao(A))return this.createCanvasClone(A);if(co(A))return this.createVideoClone(A);if(wo(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return go(e)&&(go(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),"lazy"===e.loading&&(e.loading="eager")),Co(e)?this.createCustomElementClone(e):e},A.prototype.createCustomElementClone=function(A){var e=document.createElement("html2canvascustomelement");return Po(A.style,e),e},A.prototype.createStyleClone=function(A){try{var e=A.sheet;if(e&&e.cssRules){var t=[].slice.call(e.cssRules,0).reduce((function(A,e){return e&&"string"==typeof e.cssText?A+e.cssText:A}),""),r=A.cloneNode(!1);return r.textContent=t,r}}catch(n){if(this.context.logger.error("Unable to access cssRules property",n),"SecurityError"!==n.name)throw n}return A.cloneNode(!1)},A.prototype.createCanvasClone=function(A){var e;if(this.options.inlineImages&&A.ownerDocument){var t=A.ownerDocument.createElement("img");try{return t.src=A.toDataURL(),t}catch(i){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",A)}}var r=A.cloneNode(!1);try{r.width=A.width,r.height=A.height;var n=A.getContext("2d"),s=r.getContext("2d");if(s)if(!this.options.allowTaint&&n)s.putImageData(n.getImageData(0,0,A.width,A.height),0,0);else{var o=null!==(e=A.getContext("webgl2"))&&void 0!==e?e:A.getContext("webgl");if(o){var B=o.getContextAttributes();!1===(null==B?void 0:B.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",A)}s.drawImage(A,0,0)}return r}catch(i){this.context.logger.info("Unable to clone canvas as it is tainted",A)}return r},A.prototype.createVideoClone=function(A){var e=A.ownerDocument.createElement("canvas");e.width=A.offsetWidth,e.height=A.offsetHeight;var t=e.getContext("2d");try{return t&&(t.drawImage(A,0,0,e.width,e.height),this.options.allowTaint||t.getImageData(0,0,e.width,e.height)),e}catch(n){this.context.logger.info("Unable to clone video as it is tainted",A)}var r=A.ownerDocument.createElement("canvas");return r.width=A.offsetWidth,r.height=A.offsetHeight,r},A.prototype.appendChildNode=function(A,e,t){eo(e)&&("SCRIPT"===e.tagName||e.hasAttribute(So)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(e))||this.options.copyStyles&&eo(e)&&wo(e)||A.appendChild(this.cloneNode(e,t))},A.prototype.cloneChildNodes=function(A,e,t){for(var r=this,n=A.shadowRoot?A.shadowRoot.firstChild:A.firstChild;n;n=n.nextSibling)if(eo(n)&&ho(n)&&"function"==typeof n.assignedNodes){var s=n.assignedNodes();s.length&&s.forEach((function(A){return r.appendChildNode(e,A,t)}))}else this.appendChildNode(e,n,t)},A.prototype.cloneNode=function(A,e){if(Ao(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var t=A.ownerDocument.defaultView;if(t&&eo(A)&&(to(A)||ro(A))){var r=this.createElementClone(A);r.style.transitionProperty="none";var n=t.getComputedStyle(A),s=t.getComputedStyle(A,":before"),o=t.getComputedStyle(A,":after");this.referenceElement===A&&to(r)&&(this.clonedReferenceElement=r),io(r)&&_o(r);var B=this.counters.parse(new _n(this.context,n)),i=this.resolvePseudoContent(A,r,s,Bs.BEFORE);Co(A)&&(e=!0),co(A)||this.cloneChildNodes(A,r,e),i&&r.insertBefore(i,r.firstChild);var a=this.resolvePseudoContent(A,r,o,Bs.AFTER);return a&&r.appendChild(a),this.counters.pop(B),(n&&(this.options.copyStyles||ro(A))&&!lo(A)||e)&&Po(n,r),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([r,A.scrollLeft,A.scrollTop]),(Qo(A)||uo(A))&&(Qo(r)||uo(r))&&(r.value=A.value),r}return A.cloneNode(!1)},A.prototype.resolvePseudoContent=function(A,e,t,r){var n=this;if(t){var s=t.content,o=e.ownerDocument;if(o&&s&&"none"!==s&&"-moz-alt-content"!==s&&"none"!==t.display){this.counters.parse(new _n(this.context,t));var B=new Zn(this.context,t),i=o.createElement("html2canvaspseudoelement");Po(t,i),B.content.forEach((function(e){if(0===e.type)i.appendChild(o.createTextNode(e.value));else if(22===e.type){var t=o.createElement("img");t.src=e.value,t.style.opacity="1",i.appendChild(t)}else if(18===e.type){if("attr"===e.name){var r=e.values.filter(Ct);r.length&&i.appendChild(o.createTextNode(A.getAttribute(r[0].value)||""))}else if("counter"===e.name){var s=e.values.filter(ft),a=s[0],c=s[1];if(a&&Ct(a)){var g=n.counters.getCounterValue(a.value),l=c&&Ct(c)?en.parse(n.context,c.value):3;i.appendChild(o.createTextNode(xo(g,l,!1)))}}else if("counters"===e.name){var w=e.values.filter(ft),Q=(a=w[0],w[1]);if(c=w[2],a&&Ct(a)){var u=n.counters.getCounterValues(a.value),h=c&&Ct(c)?en.parse(n.context,c.value):3,C=Q&&0===Q.type?Q.value:"",U=u.map((function(A){return xo(A,h,!1)})).join(C);i.appendChild(o.createTextNode(U))}}}else if(20===e.type)switch(e.value){case"open-quote":i.appendChild(o.createTextNode(Pn(B.quotes,n.quoteDepth++,!0)));break;case"close-quote":i.appendChild(o.createTextNode(Pn(B.quotes,--n.quoteDepth,!1)));break;default:i.appendChild(o.createTextNode(e.value))}})),i.className=Yo+" "+Wo;var a=r===Bs.BEFORE?" "+Yo:" "+Wo;return ro(e)?e.className.baseValue+=a:e.className+=a,i}}},A.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},A}();!function(A){A[A.BEFORE=0]="BEFORE",A[A.AFTER=1]="AFTER"}(Bs||(Bs={}));var Mo,Oo=function(A,e){var t=A.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute(So,"true"),A.body.appendChild(t),t},Go=function(A){return new Promise((function(e){A.complete?e():A.src?(A.onload=e,A.onerror=e):e()}))},ko=function(A){return Promise.all([].slice.call(A.images,0).map(Go))},Vo=function(A){return new Promise((function(e,t){var r=A.contentWindow;if(!r)return t("No window assigned for iframe");var n=r.document;r.onload=A.onload=function(){r.onload=A.onload=null;var t=setInterval((function(){n.body.childNodes.length>0&&"complete"===n.readyState&&(clearInterval(t),e(A))}),50)}}))},Ro=["all","d","content"],Po=function(A,e){for(var t=A.length-1;t>=0;t--){var r=A.item(t);-1===Ro.indexOf(r)&&e.style.setProperty(r,A.getPropertyValue(r))}return e},No=function(A){var e="";return A&&(e+=""),e},Jo=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},Xo=function(A){var e=A[0],t=A[1],r=A[2];e.scrollLeft=t,e.scrollTop=r},Yo="___html2canvas___pseudoelement_before",Wo="___html2canvas___pseudoelement_after",Zo='{\n content: "" !important;\n display: none !important;\n}',_o=function(A){zo(A,"."+Yo+":before"+Zo+"\n ."+Wo+":after"+Zo)},zo=function(A,e){var t=A.ownerDocument;if(t){var r=t.createElement("style");r.textContent=e,A.appendChild(r)}},jo=function(){function A(){}return A.getOrigin=function(e){var t=A._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},A.isSameOrigin=function(e){return A.getOrigin(e)===A._origin},A.setContext=function(e){A._link=e.document.createElement("a"),A._origin=A.getOrigin(e.location.href)},A._origin="about:blank",A}(),qo=function(){function A(A,e){this.context=A,this._options=e,this._cache={}}return A.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)?e:sB(A)||tB(A)?((this._cache[A]=this.loadImage(A)).catch((function(){})),e):e},A.prototype.match=function(A){return this._cache[A]},A.prototype.loadImage=function(A){return bA(this,void 0,void 0,(function(){var e,t,r,n,s=this;return vA(this,(function(o){switch(o.label){case 0:return e=jo.isSameOrigin(A),t=!rB(A)&&!0===this._options.useCORS&&fs.SUPPORT_CORS_IMAGES&&!e,r=!rB(A)&&!e&&!sB(A)&&"string"==typeof this._options.proxy&&fs.SUPPORT_CORS_XHR&&!t,e||!1!==this._options.allowTaint||rB(A)||sB(A)||r||t?(n=A,r?[4,this.proxy(n)]:[3,2]):[2];case 1:n=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+A.substring(0,256)),[4,new Promise((function(A,e){var r=new Image;r.onload=function(){return A(r)},r.onerror=e,(nB(n)||t)&&(r.crossOrigin="anonymous"),r.src=n,!0===r.complete&&setTimeout((function(){return A(r)}),500),s._options.imageTimeout>0&&setTimeout((function(){return e("Timed out ("+s._options.imageTimeout+"ms) loading image")}),s._options.imageTimeout)}))];case 3:return[2,o.sent()]}}))}))},A.prototype.has=function(A){return void 0!==this._cache[A]},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(A){var e=this,t=this._options.proxy;if(!t)throw new Error("No proxy defined");var r=A.substring(0,256);return new Promise((function(n,s){var o=fs.SUPPORT_RESPONSE_TYPE?"blob":"text",B=new XMLHttpRequest;B.onload=function(){if(200===B.status)if("text"===o)n(B.response);else{var A=new FileReader;A.addEventListener("load",(function(){return n(A.result)}),!1),A.addEventListener("error",(function(A){return s(A)}),!1),A.readAsDataURL(B.response)}else s("Failed to proxy resource "+r+" with status code "+B.status)},B.onerror=s;var i=t.indexOf("?")>-1?"&":"?";if(B.open("GET",""+t+i+"url="+encodeURIComponent(A)+"&responseType="+o),"text"!==o&&B instanceof XMLHttpRequest&&(B.responseType=o),e._options.imageTimeout){var a=e._options.imageTimeout;B.timeout=a,B.ontimeout=function(){return s("Timed out ("+a+"ms) proxying "+r)}}B.send()}))},A}(),$o=/^data:image\/svg\+xml/i,AB=/^data:image\/.*;base64,/i,eB=/^data:image\/.*/i,tB=function(A){return fs.SUPPORT_SVG_DRAWING||!oB(A)},rB=function(A){return eB.test(A)},nB=function(A){return AB.test(A)},sB=function(A){return"blob"===A.substr(0,4)},oB=function(A){return"svg"===A.substr(-3).toLowerCase()||$o.test(A)},BB=function(){function A(A,e){this.type=0,this.x=A,this.y=e}return A.prototype.add=function(e,t){return new A(this.x+e,this.y+t)},A}(),iB=function(A,e,t){return new BB(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)},aB=function(){function A(A,e,t,r){this.type=1,this.start=A,this.startControl=e,this.endControl=t,this.end=r}return A.prototype.subdivide=function(e,t){var r=iB(this.start,this.startControl,e),n=iB(this.startControl,this.endControl,e),s=iB(this.endControl,this.end,e),o=iB(r,n,e),B=iB(n,s,e),i=iB(o,B,e);return t?new A(this.start,r,o,i):new A(i,B,s,this.end)},A.prototype.add=function(e,t){return new A(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A}(),cB=function(A){return 1===A.type},gB=function(A){var e=A.styles,t=A.bounds,r=vt(e.borderTopLeftRadius,t.width,t.height),n=r[0],s=r[1],o=vt(e.borderTopRightRadius,t.width,t.height),B=o[0],i=o[1],a=vt(e.borderBottomRightRadius,t.width,t.height),c=a[0],g=a[1],l=vt(e.borderBottomLeftRadius,t.width,t.height),w=l[0],Q=l[1],u=[];u.push((n+B)/t.width),u.push((w+c)/t.width),u.push((s+Q)/t.height),u.push((i+g)/t.height);var h=Math.max.apply(Math,u);h>1&&(n/=h,s/=h,B/=h,i/=h,c/=h,g/=h,w/=h,Q/=h);var C=t.width-B,U=t.height-g,F=t.width-c,d=t.height-Q,f=e.borderTopWidth,p=e.borderRightWidth,H=e.borderBottomWidth,E=e.borderLeftWidth,y=Lt(e.paddingTop,A.bounds.width),m=Lt(e.paddingRight,A.bounds.width),I=Lt(e.paddingBottom,A.bounds.width),K=Lt(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=n>0||s>0?lB(t.left+E/3,t.top+f/3,n-E/3,s-f/3,Mo.TOP_LEFT):new BB(t.left+E/3,t.top+f/3),this.topRightBorderDoubleOuterBox=n>0||s>0?lB(t.left+C,t.top+f/3,B-p/3,i-f/3,Mo.TOP_RIGHT):new BB(t.left+t.width-p/3,t.top+f/3),this.bottomRightBorderDoubleOuterBox=c>0||g>0?lB(t.left+F,t.top+U,c-p/3,g-H/3,Mo.BOTTOM_RIGHT):new BB(t.left+t.width-p/3,t.top+t.height-H/3),this.bottomLeftBorderDoubleOuterBox=w>0||Q>0?lB(t.left+E/3,t.top+d,w-E/3,Q-H/3,Mo.BOTTOM_LEFT):new BB(t.left+E/3,t.top+t.height-H/3),this.topLeftBorderDoubleInnerBox=n>0||s>0?lB(t.left+2*E/3,t.top+2*f/3,n-2*E/3,s-2*f/3,Mo.TOP_LEFT):new BB(t.left+2*E/3,t.top+2*f/3),this.topRightBorderDoubleInnerBox=n>0||s>0?lB(t.left+C,t.top+2*f/3,B-2*p/3,i-2*f/3,Mo.TOP_RIGHT):new BB(t.left+t.width-2*p/3,t.top+2*f/3),this.bottomRightBorderDoubleInnerBox=c>0||g>0?lB(t.left+F,t.top+U,c-2*p/3,g-2*H/3,Mo.BOTTOM_RIGHT):new BB(t.left+t.width-2*p/3,t.top+t.height-2*H/3),this.bottomLeftBorderDoubleInnerBox=w>0||Q>0?lB(t.left+2*E/3,t.top+d,w-2*E/3,Q-2*H/3,Mo.BOTTOM_LEFT):new BB(t.left+2*E/3,t.top+t.height-2*H/3),this.topLeftBorderStroke=n>0||s>0?lB(t.left+E/2,t.top+f/2,n-E/2,s-f/2,Mo.TOP_LEFT):new BB(t.left+E/2,t.top+f/2),this.topRightBorderStroke=n>0||s>0?lB(t.left+C,t.top+f/2,B-p/2,i-f/2,Mo.TOP_RIGHT):new BB(t.left+t.width-p/2,t.top+f/2),this.bottomRightBorderStroke=c>0||g>0?lB(t.left+F,t.top+U,c-p/2,g-H/2,Mo.BOTTOM_RIGHT):new BB(t.left+t.width-p/2,t.top+t.height-H/2),this.bottomLeftBorderStroke=w>0||Q>0?lB(t.left+E/2,t.top+d,w-E/2,Q-H/2,Mo.BOTTOM_LEFT):new BB(t.left+E/2,t.top+t.height-H/2),this.topLeftBorderBox=n>0||s>0?lB(t.left,t.top,n,s,Mo.TOP_LEFT):new BB(t.left,t.top),this.topRightBorderBox=B>0||i>0?lB(t.left+C,t.top,B,i,Mo.TOP_RIGHT):new BB(t.left+t.width,t.top),this.bottomRightBorderBox=c>0||g>0?lB(t.left+F,t.top+U,c,g,Mo.BOTTOM_RIGHT):new BB(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=w>0||Q>0?lB(t.left,t.top+d,w,Q,Mo.BOTTOM_LEFT):new BB(t.left,t.top+t.height),this.topLeftPaddingBox=n>0||s>0?lB(t.left+E,t.top+f,Math.max(0,n-E),Math.max(0,s-f),Mo.TOP_LEFT):new BB(t.left+E,t.top+f),this.topRightPaddingBox=B>0||i>0?lB(t.left+Math.min(C,t.width-p),t.top+f,C>t.width+p?0:Math.max(0,B-p),Math.max(0,i-f),Mo.TOP_RIGHT):new BB(t.left+t.width-p,t.top+f),this.bottomRightPaddingBox=c>0||g>0?lB(t.left+Math.min(F,t.width-E),t.top+Math.min(U,t.height-H),Math.max(0,c-p),Math.max(0,g-H),Mo.BOTTOM_RIGHT):new BB(t.left+t.width-p,t.top+t.height-H),this.bottomLeftPaddingBox=w>0||Q>0?lB(t.left+E,t.top+Math.min(d,t.height-H),Math.max(0,w-E),Math.max(0,Q-H),Mo.BOTTOM_LEFT):new BB(t.left+E,t.top+t.height-H),this.topLeftContentBox=n>0||s>0?lB(t.left+E+K,t.top+f+y,Math.max(0,n-(E+K)),Math.max(0,s-(f+y)),Mo.TOP_LEFT):new BB(t.left+E+K,t.top+f+y),this.topRightContentBox=B>0||i>0?lB(t.left+Math.min(C,t.width+E+K),t.top+f+y,C>t.width+E+K?0:B-E+K,i-(f+y),Mo.TOP_RIGHT):new BB(t.left+t.width-(p+m),t.top+f+y),this.bottomRightContentBox=c>0||g>0?lB(t.left+Math.min(F,t.width-(E+K)),t.top+Math.min(U,t.height+f+y),Math.max(0,c-(p+m)),g-(H+I),Mo.BOTTOM_RIGHT):new BB(t.left+t.width-(p+m),t.top+t.height-(H+I)),this.bottomLeftContentBox=w>0||Q>0?lB(t.left+E+K,t.top+d,Math.max(0,w-(E+K)),Q-(H+I),Mo.BOTTOM_LEFT):new BB(t.left+E+K,t.top+t.height-(H+I))};!function(A){A[A.TOP_LEFT=0]="TOP_LEFT",A[A.TOP_RIGHT=1]="TOP_RIGHT",A[A.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",A[A.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(Mo||(Mo={}));var lB=function(A,e,t,r,n){var s=(Math.sqrt(2)-1)/3*4,o=t*s,B=r*s,i=A+t,a=e+r;switch(n){case Mo.TOP_LEFT:return new aB(new BB(A,a),new BB(A,a-B),new BB(i-o,e),new BB(i,e));case Mo.TOP_RIGHT:return new aB(new BB(A,e),new BB(A+o,e),new BB(i,a-B),new BB(i,a));case Mo.BOTTOM_RIGHT:return new aB(new BB(i,e),new BB(i,e+B),new BB(A+o,a),new BB(A,a));case Mo.BOTTOM_LEFT:default:return new aB(new BB(i,a),new BB(i-o,a),new BB(A,e+B),new BB(A,e))}},wB=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},QB=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},uB=function(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6},hB=function(A,e){this.path=A,this.target=e,this.type=1},CB=function(A){this.opacity=A,this.type=2,this.target=6},UB=function(A){return 1===A.type},FB=function(A,e){return A.length===e.length&&A.some((function(A,t){return A===e[t]}))},dB=function(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},fB=function(){function A(A,e){if(this.container=A,this.parent=e,this.effects=[],this.curves=new gB(this.container),this.container.styles.opacity<1&&this.effects.push(new CB(this.container.styles.opacity)),null!==this.container.styles.transform){var t=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,n=this.container.styles.transform;this.effects.push(new uB(t,r,n))}if(0!==this.container.styles.overflowX){var s=wB(this.curves),o=QB(this.curves);FB(s,o)?this.effects.push(new hB(s,6)):(this.effects.push(new hB(s,2)),this.effects.push(new hB(o,4)))}}return A.prototype.getEffects=function(A){for(var e=-1===[2,3].indexOf(this.container.styles.position),t=this.parent,r=this.effects.slice(0);t;){var n=t.effects.filter((function(A){return!UB(A)}));if(e||0!==t.container.styles.position||!t.parent){if(r.unshift.apply(r,n),e=-1===[2,3].indexOf(t.container.styles.position),0!==t.container.styles.overflowX){var s=wB(t.curves),o=QB(t.curves);FB(s,o)||r.unshift(new hB(o,6))}}else r.unshift.apply(r,n);t=t.parent}return r.filter((function(e){return Mn(e.target,A)}))},A}(),pB=function(A,e,t,r){A.container.elements.forEach((function(n){var s=Mn(n.flags,4),o=Mn(n.flags,2),B=new fB(n,A);Mn(n.styles.display,2048)&&r.push(B);var i=Mn(n.flags,8)?[]:r;if(s||o){var a=s||n.styles.isPositioned()?t:e,c=new dB(B);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var g=n.styles.zIndex.order;if(g<0){var l=0;a.negativeZIndex.some((function(A,e){return g>A.element.container.styles.zIndex.order?(l=e,!1):l>0})),a.negativeZIndex.splice(l,0,c)}else if(g>0){var w=0;a.positiveZIndex.some((function(A,e){return g>=A.element.container.styles.zIndex.order?(w=e+1,!1):w>0})),a.positiveZIndex.splice(w,0,c)}else a.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else n.styles.isFloating()?a.nonPositionedFloats.push(c):a.nonPositionedInlineLevel.push(c);pB(B,c,s?c:t,i)}else n.styles.isInlineLevel()?e.inlineLevel.push(B):e.nonInlineLevel.push(B),pB(B,e,t,i);Mn(n.flags,8)&&HB(n,i)}))},HB=function(A,e){for(var t=A instanceof Os?A.start:1,r=A instanceof Os&&A.reversed,n=0;n0&&A.intrinsicHeight>0){var r=KB(A),n=QB(e);this.path(n),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(t,0,0,A.intrinsicWidth,A.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(A){return bA(this,void 0,void 0,(function(){var t,r,n,s,o,B,i,a,c,g,l,w,Q,u,h,C,U,F;return vA(this,(function(d){switch(d.label){case 0:this.applyEffects(A.getEffects(4)),t=A.container,r=A.curves,n=t.styles,s=0,o=t.textNodes,d.label=1;case 1:return s0&&H>0&&(C=r.ctx.createPattern(Q,"repeat"),r.renderRepeat(F,C,y,m))):function(A){return 2===A.type}(t)&&(U=bB(A,e,[null,null,null]),F=U[0],d=U[1],f=U[2],p=U[3],H=U[4],E=0===t.position.length?[Kt]:t.position,y=Lt(E[0],p),m=Lt(E[E.length-1],H),I=function(A,e,t,r,n){var s=0,o=0;switch(A.size){case 0:0===A.shape?s=o=Math.min(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-n)):1===A.shape&&(s=Math.min(Math.abs(e),Math.abs(e-r)),o=Math.min(Math.abs(t),Math.abs(t-n)));break;case 2:if(0===A.shape)s=o=Math.min(er(e,t),er(e,t-n),er(e-r,t),er(e-r,t-n));else if(1===A.shape){var B=Math.min(Math.abs(t),Math.abs(t-n))/Math.min(Math.abs(e),Math.abs(e-r)),i=tr(r,n,e,t,!0),a=i[0],c=i[1];o=B*(s=er(a-e,(c-t)/B))}break;case 1:0===A.shape?s=o=Math.max(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-n)):1===A.shape&&(s=Math.max(Math.abs(e),Math.abs(e-r)),o=Math.max(Math.abs(t),Math.abs(t-n)));break;case 3:if(0===A.shape)s=o=Math.max(er(e,t),er(e,t-n),er(e-r,t),er(e-r,t-n));else if(1===A.shape){B=Math.max(Math.abs(t),Math.abs(t-n))/Math.max(Math.abs(e),Math.abs(e-r));var g=tr(r,n,e,t,!1);a=g[0],c=g[1],o=B*(s=er(a-e,(c-t)/B))}}return Array.isArray(A.size)&&(s=Lt(A.size[0],r),o=2===A.size.length?Lt(A.size[1],n):s),[s,o]}(t,y,m,p,H),K=I[0],b=I[1],K>0&&b>0&&(v=r.ctx.createRadialGradient(d+y,f+m,0,d+y,f+m,K),$t(t.stops,2*K).forEach((function(A){return v.addColorStop(A.stop,Vt(A.color))})),r.path(F),r.ctx.fillStyle=v,K!==b?(L=A.bounds.left+.5*A.bounds.width,D=A.bounds.top+.5*A.bounds.height,S=1/(x=b/K),r.ctx.save(),r.ctx.translate(L,D),r.ctx.transform(1,0,0,x,0,0),r.ctx.translate(-L,-D),r.ctx.fillRect(d,S*(f-D)+D,p,H*S),r.ctx.restore()):r.ctx.fill())),T.label=6;case 6:return e--,[2]}}))},r=this,n=0,s=A.styles.backgroundImage.slice(0).reverse(),B.label=1;case 1:return n0?2!==i.style?[3,5]:[4,this.renderDashedDottedBorder(i.color,i.width,s,A.curves,2)]:[3,11]:[3,13];case 4:return c.sent(),[3,11];case 5:return 3!==i.style?[3,7]:[4,this.renderDashedDottedBorder(i.color,i.width,s,A.curves,3)];case 6:return c.sent(),[3,11];case 7:return 4!==i.style?[3,9]:[4,this.renderDoubleBorder(i.color,i.width,s,A.curves)];case 8:return c.sent(),[3,11];case 9:return[4,this.renderSolidBorder(i.color,s,A.curves)];case 10:c.sent(),c.label=11;case 11:s++,c.label=12;case 12:return o++,[3,3];case 13:return[2]}}))}))},e.prototype.renderDashedDottedBorder=function(A,e,t,r,n){return bA(this,void 0,void 0,(function(){var s,o,B,i,a,c,g,l,w,Q,u,h,C,U,F,d;return vA(this,(function(f){return this.ctx.save(),s=function(A,e){switch(e){case 0:return yB(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return yB(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return yB(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return yB(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}}(r,t),o=EB(r,t),2===n&&(this.path(o),this.ctx.clip()),cB(o[0])?(B=o[0].start.x,i=o[0].start.y):(B=o[0].x,i=o[0].y),cB(o[1])?(a=o[1].end.x,c=o[1].end.y):(a=o[1].x,c=o[1].y),g=0===t||2===t?Math.abs(B-a):Math.abs(i-c),this.ctx.beginPath(),3===n?this.formatPath(s):this.formatPath(o.slice(0,2)),l=e<3?3*e:2*e,w=e<3?2*e:e,3===n&&(l=e,w=e),Q=!0,g<=2*l?Q=!1:g<=2*l+w?(l*=u=g/(2*l+w),w*=u):(h=Math.floor((g+w)/(l+w)),C=(g-h*l)/(h-1),w=(U=(g-(h+1)*l)/h)<=0||Math.abs(w-C)