@oxog/printkit 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -4
- package/dist/chunk-E7TXCY3N.cjs +491 -0
- package/dist/chunk-E7TXCY3N.cjs.map +1 -0
- package/dist/chunk-N44HS34F.js +491 -0
- package/dist/chunk-N44HS34F.js.map +1 -0
- package/dist/{errors-B6q-4bX_.d.cts → errors-COjJm-gl.d.cts} +20 -1
- package/dist/{errors-B6q-4bX_.d.ts → errors-COjJm-gl.d.ts} +20 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +13 -7
- package/dist/index.d.ts +13 -7
- package/dist/index.js +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +9 -8
- package/dist/react.d.ts +9 -8
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/package.json +4 -2
- package/dist/chunk-KWR7DOLQ.cjs +0 -482
- package/dist/chunk-KWR7DOLQ.cjs.map +0 -1
- package/dist/chunk-YHD5OSS6.js +0 -482
- package/dist/chunk-YHD5OSS6.js.map +0 -1
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
function E(){return typeof window<"u"&&typeof window.print=="function"&&typeof document<"u"}function Tt(){if(typeof document>"u")return false;try{let e=document.createElement("canvas");return typeof e.getContext=="function"&&e.getContext("2d")!==null&&typeof e.toDataURL=="function"}catch{return false}}function Rn(){return typeof window<"u"&&typeof document<"u"}var D=class e extends Error{constructor(t,n,r){super(n),this.name="PrintError",this.code=t,this.target=r,Error.captureStackTrace&&Error.captureStackTrace(this,e);}},ge={PRINT_NOT_SUPPORTED:"Printing is not supported in this environment",ELEMENT_NOT_FOUND:"Element not found",IFRAME_LOAD_FAILED:"Failed to load print iframe",PDF_EXPORT_FAILED:"Failed to export PDF",STYLE_LOAD_FAILED:"Failed to load stylesheet",CANCELLED:"Print operation was cancelled",UNKNOWN:"An unknown error occurred"};function c(e,t,n){let r=ge[e];return t&&(r=`${r}: ${t}`),new D(e,r,n)}function he(e){return e instanceof D}function wt(e,t){return he(e)?e:e instanceof Error?new D("UNKNOWN",e.message,t):new D("UNKNOWN",String(e),t)}function m(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function vt(e){return e.replace(/<\/(style)/gi,"<\\/$1")}var ye=new Set(["script","iframe","frame","frameset","object","embed","applet","base","meta","noscript","noembed","noframes","xmp","plaintext","portal","animate","animatemotion","animatetransform","set","handler","listener"]),be=new Set(["href","xlink:href","src","action","formaction","background","poster","lowsrc","dynsrc","ping","cite","longdesc","manifest","data","codebase"]);function Et(e){return e.replace(/[\u0000- \u007f-\u009f]+/g,"").toLowerCase()}function Q(e){let t=Et(e);return t.startsWith("javascript:")||t.startsWith("vbscript:")?true:t.startsWith("data:")&&!t.startsWith("data:image/")}function z(e,t={}){let n=Array.from(e.querySelectorAll("*"));for(let r of n){let o=r.localName.toLowerCase();if(t.scriptsOnly?o==="script":ye.has(o)){r.remove();continue}for(let i of Array.from(r.attributes)){let s=i.name.toLowerCase();if(t.scriptsOnly){s.startsWith("on")&&r.removeAttribute(i.name);continue}(s.startsWith("on")||s==="srcdoc"||be.has(s)&&Q(i.value)||s==="srcset"&&/(?:^|,)\s*(?:javascript|vbscript):/i.test(i.value))&&r.removeAttribute(i.name);}}}function xe(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}var Pe=4,V="http://www.w3.org/1999/xhtml",Y="http://www.w3.org/2000/svg",Te=new Set("a abbr acronym address area article aside audio b bdi bdo big blockquote br button caption center cite code col colgroup data datalist dd del details dfn dialog dir div dl dt em fieldset figcaption figure font footer form h1 h2 h3 h4 h5 h6 header hgroup hr i img input ins kbd label legend li link main map mark menu meter nav nobr ol optgroup option output p picture pre progress q rp rt ruby s samp section select small source span strike strong style sub summary sup table tbody td textarea tfoot th thead time tr track tt u ul var video wbr".split(" ")),we=new Set("svg a circle clippath defs desc ellipse filter g image line lineargradient marker mask metadata path pattern polygon polyline radialgradient rect stop switch symbol text textpath title tspan use view feblend fecolormatrix fecomponenttransfer fecomposite feconvolvematrix fediffuselighting fedisplacementmap fedistantlight fedropshadow feflood fefunca fefuncb fefuncg fefuncr fegaussianblur femerge femergenode femorphology feoffset fepointlight fespecularlighting fespotlight fetile feturbulence".split(" ")),ve=new Set("script iframe frame frameset object embed applet base meta head title template noscript noembed noframes xmp plaintext portal math svg param".split(" ")),Ee=new Set("abbr accept align alt autocomplete axis background bgcolor border cellpadding cellspacing char charoff charset checked cite class clear color cols colspan controls coords datetime default dir disabled download face for frame headers height hidden high href hreflang id kind label lang list loop low max maxlength media method min minlength multiple muted name noshade novalidate nowrap open optimum pattern placeholder poster preload readonly rel required rev reversed role rows rowspan rules scope selected shape size sizes span spellcheck src srclang srcset start step style summary tabindex target title translate type usemap valign value width wrap action enctype".split(" ")),Se=new Set("accent-height accumulate additive alignment-baseline ascent azimuth basefrequency baseline-shift begin bias class clip clip-path clip-rule clippathunits color color-interpolation color-interpolation-filters color-profile color-rendering cx cy d dx dy diffuseconstant direction display divisor dominant-baseline dur edgemode elevation end exponent fill fill-opacity fill-rule filter filterunits flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight fr fx fy g1 g2 glyph-name glyphref gradienttransform gradientunits height href id image-rendering in in2 intercept k k1 k2 k3 k4 kernelmatrix kernelunitlength kerning keypoints keysplines keytimes lang lengthadjust letter-spacing lighting-color local marker-end marker-mid marker-start markerheight markerunits markerwidth mask mask-type maskcontentunits maskunits max media method mode min numoctaves offset opacity operator order orient orientation origin overflow paint-order path pathlength patterncontentunits patterntransform patternunits points pointer-events pointsatx pointsaty pointsatz preservealpha preserveaspectratio primitiveunits r radius refx refy repeatcount repeatdur requiredfeatures restart result role rotate rx ry scale seed shape-rendering side slope specularconstant specularexponent spreadmethod startoffset stddeviation stitchtiles stop-color stop-opacity stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width style surfacescale systemlanguage tabindex tablevalues targetx targety text-anchor text-decoration text-rendering textlength transform transform-origin type u1 u2 unicode vector-effect version vert-adv-y vert-origin-x vert-origin-y viewbox visibility width word-spacing wrap writing-mode x x1 x2 xchannelselector xlink:href xlink:title xml:space y y1 y2 ychannelselector z zoomandpan aria-label aria-hidden".split(" ")),Le=new Set(["href","xlink:href","src","action","cite","poster","background"]),Oe=new Set(["img","source","video","audio","track","input"]),Me=/((--!?|])>)|<\/(style|title|textarea|noscript|xmp)/i;function tt(e,t=false){let n=Et(e),r=/^([a-z][a-z0-9+.-]*):/.exec(n)?.[1];return r===void 0||["http","https","mailto","tel","ftp"].includes(r)?true:t&&(r==="blob"||n.startsWith("data:image/"))}function Ae(e){return e.split(",").map(t=>t.trim().split(/\s+/)[0]??"").every(t=>tt(t,true))}function ke(e,t,n){let r=t.name.toLowerCase(),o=t.value;if(r.startsWith("on")||Me.test(o)||!(n?Se.has(r):Ee.has(r)||/^(aria|data)-[\w.-]+$/.test(r)))return false;let s=e.localName.toLowerCase();return n&&s==="use"&&(r==="href"||r==="xlink:href")?o.trim().startsWith("#"):r==="srcset"?Ae(o):Le.has(r)?tt(o,n?s==="image":Oe.has(s)):s==="link"&&r==="rel"?o.toLowerCase().split(/\s+/).includes("stylesheet"):true}function De(e,t){let n=e.localName.toLowerCase(),r=t.nodeType===1?t.namespaceURI:V;return e.namespaceURI===Y?(n==="svg"||r===Y)&&we.has(n)?"keep":"drop":e.namespaceURI!==V||r!==V||ve.has(n)||n==="link"&&!(e.getAttribute("rel")??"").toLowerCase().split(/\s+/).includes("stylesheet")?"drop":Te.has(n)?"keep":"unwrap"}function St(e){let t=e.firstChild;for(;t;){let n=t.nextSibling;if(t.nodeType===1){let r=t,o=De(r,e);if(o==="drop")r.remove();else if(o==="unwrap"){let i=r.firstChild;for(;r.firstChild;)e.insertBefore(r.firstChild,r);if(r.remove(),i){t=i;continue}}else {let i=r.namespaceURI===Y;for(let s of Array.from(r.attributes))ke(r,s,i)||r.removeAttribute(s.name);St(r);}}else t.nodeType!==3&&t.parentNode?.removeChild(t);t=n;}}function A(e){if(typeof DOMParser>"u")return m(e);let t=r=>new DOMParser().parseFromString(`<!DOCTYPE html><html><head></head><body>${r}</body></html>`,"text/html").body,n=String(e);for(let r=0;r<Pe;r++){let o=t(n);St(o);let i=o.innerHTML;if(i===n)return i;n=i;}return m(t(n).textContent??"")}function Lt(e,t){let n=xe(e);if(!n)return {body:m(e),styles:[],styleSheets:[],title:""};let r=[],o=[];for(let i of Array.from(n.head.querySelectorAll("style")))i.textContent&&r.push(i.textContent);for(let i of Array.from(n.head.querySelectorAll("link"))){let s=(i.getAttribute("rel")??"").toLowerCase().split(/\s+/),a=i.getAttribute("href");if(!(!s.includes("stylesheet")||!a||!tt(a)))try{o.push(t?new URL(a,t).href:a);}catch{}}return {body:A(n.body.innerHTML),styles:r,styleSheets:o,title:n.title}}function Ot(e){return typeof e=="string"?document.querySelector(e):typeof e!="object"||e===null||typeof e.cloneNode!="function"||e.nodeType!==1?null:e}function Ce(e){if(Array.isArray(e)){let n=[];for(let r of e){let o=Ot(r);o&&n.push(o);}return n}let t=Ot(e);return t?[t]:[]}function k(e){let t=Ce(e);if(t.length===0){let n=typeof e=="string"?e:Array.isArray(e)?e.join(", "):"element";throw c("ELEMENT_NOT_FOUND",n,e)}return t}function Mt(e){let t=e.cloneNode(true),n=e.querySelectorAll("canvas"),r=t.querySelectorAll("canvas");n.forEach((s,a)=>{let l=r[a];if(l){let d=l.getContext("2d");d&&d.drawImage(s,0,0);}});let o=e.querySelectorAll("input, textarea, select"),i=t.querySelectorAll("input, textarea, select");return o.forEach((s,a)=>{let l=i[a];l&&(s instanceof HTMLInputElement?s.type==="checkbox"||s.type==="radio"?l.checked=s.checked:l.value=s.value:(s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement)&&(l.value=s.value));}),t}function et(e,t){let n="input, textarea, select",r=e.matches(n)?[e,...Array.from(e.querySelectorAll(n))]:Array.from(e.querySelectorAll(n)),o=t.matches(n)?[t,...Array.from(t.querySelectorAll(n))]:Array.from(t.querySelectorAll(n));r.forEach((i,s)=>{let a=o[s];if(a){if(i instanceof HTMLInputElement){let l=i.type.toLowerCase();l==="checkbox"||l==="radio"?i.checked?a.setAttribute("checked",""):a.removeAttribute("checked"):l==="password"||l==="file"?a.removeAttribute("value"):a.setAttribute("value",i.value);}else if(i instanceof HTMLTextAreaElement)a.textContent=i.value;else if(i instanceof HTMLSelectElement){let l=Array.from(a.querySelectorAll("option"));Array.from(i.options).forEach((d,f)=>{let u=l[f];u&&(d.selected?u.setAttribute("selected",""):u.removeAttribute("selected"));});}}});}function nt(e,t){let n=Array.from(e.querySelectorAll("canvas")),r=Array.from(t.querySelectorAll("canvas"));n.forEach((o,i)=>{let s=r[i];if(!s)return;let a;try{a=o.toDataURL("image/png");}catch{return}if(!a.startsWith("data:image/"))return;let l=document.createElement("img");l.src=a,l.width=o.width,l.height=o.height;for(let d of Array.from(s.attributes))d.name!=="width"&&d.name!=="height"&&l.setAttribute(d.name,d.value);s.replaceWith(l);});}function U(e){return e.map(t=>{let n=t.cloneNode(true);et(t,n),nt(t,n),n.querySelectorAll("img[loading]").forEach(o=>o.removeAttribute("loading"));let r=document.createElement("div");return r.appendChild(n),z(r,{scriptsOnly:true}),r.innerHTML}).join(`
|
|
2
|
+
`)}function At(){let e=document.createElement("div");return e.style.cssText="position:absolute;left:-9999px;top:-9999px;visibility:hidden;",e}function kt(e){document.body.appendChild(e);}function Dt(e){document.body.contains(e)&&document.body.removeChild(e);}function B(e,t=1e4){let r=Array.from(e.querySelectorAll("img")).filter(o=>!o.complete&&o.getAttribute("loading")?.toLowerCase()!=="lazy");return r.length===0?Promise.resolve():new Promise(o=>{let i=r.length,s=[],a=()=>{clearTimeout(l),s.forEach(d=>d()),o();},l=setTimeout(a,t);for(let d of r){let f=()=>{i--,i===0&&a();};d.addEventListener("load",f,{once:true}),d.addEventListener("error",f,{once:true}),s.push(()=>{d.removeEventListener("load",f),d.removeEventListener("error",f);});}})}var Ct={A3:{width:"297mm",height:"420mm"},A4:{width:"210mm",height:"297mm"},A5:{width:"148mm",height:"210mm"},Letter:{width:"8.5in",height:"11in"},Legal:{width:"8.5in",height:"14in"},Tabloid:{width:"11in",height:"17in"}};function S(e){return e===void 0?"0mm":typeof e=="number"?`${e}mm`:/\d+\s*(mm|cm|in|pt|px|%|em|rem)$/i.test(e)?e:`${e}mm`}function Ie(e){return typeof e=="string"&&e in Ct}function j(e,t="portrait"){let n;return Ie(e)?n={...Ct[e]}:n={width:S(e.width),height:S(e.height)},t==="landscape"?{width:n.height,height:n.width}:n}function It(e,t="portrait"){let n=j(e,t);return `
|
|
3
|
+
@page {
|
|
4
|
+
size: ${n.width} ${n.height};
|
|
5
|
+
}
|
|
6
|
+
`}function C(e,t="portrait",n=96){let r=j(e,t),o=i=>{let s=parseFloat(i);return i.endsWith("mm")?s/25.4*n:i.endsWith("cm")?s/2.54*n:i.endsWith("in")?s*n:i.endsWith("pt")?s/72*n:s};return {width:Math.round(o(r.width)),height:Math.round(o(r.height))}}var $=10;function W(e){if(e===void 0){let t=S($);return {top:t,right:t,bottom:t,left:t}}if(typeof e=="number"||typeof e=="string"){let t=S(e);return {top:t,right:t,bottom:t,left:t}}return {top:S(e.top??$),right:S(e.right??$),bottom:S(e.bottom??$),left:S(e.left??$)}}function Ht(e){let t=W(e);return `
|
|
7
|
+
@page {
|
|
8
|
+
margin: ${t.top} ${t.right} ${t.bottom} ${t.left};
|
|
9
|
+
}
|
|
10
|
+
`}function N(e,t=96){let n=W(e),r=o=>{let i=parseFloat(o);return o.endsWith("mm")?i/25.4*t:o.endsWith("cm")?i/2.54*t:o.endsWith("in")?i*t:o.endsWith("pt")?i/72*t:i};return {top:Math.round(r(n.top)),right:Math.round(r(n.right)),bottom:Math.round(r(n.bottom)),left:Math.round(r(n.left))}}var rt="print-break-before",$t="print-break-after",Nt="print-avoid-break";function Vn(){let e=document.createElement("div");return e.className=rt,e.style.cssText="height: 0; page-break-before: always; break-before: page;",e.setAttribute("aria-hidden","true"),e}function Yn(e){e.classList.add(Nt);}function Qn(e){e.classList.add(rt);}function tr(e){e.classList.add($t);}function Ft(){return `
|
|
11
|
+
@media print {
|
|
12
|
+
.${rt} {
|
|
13
|
+
page-break-before: always !important;
|
|
14
|
+
break-before: page !important;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.${$t} {
|
|
18
|
+
page-break-after: always !important;
|
|
19
|
+
break-after: page !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.${Nt} {
|
|
23
|
+
page-break-inside: avoid !important;
|
|
24
|
+
break-inside: avoid !important;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
`}function Rt(e){let t=[];return e.pageBreakBefore&&t.push(`
|
|
28
|
+
@media print {
|
|
29
|
+
${e.pageBreakBefore} {
|
|
30
|
+
page-break-before: always !important;
|
|
31
|
+
break-before: page !important;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`),e.pageBreakAfter&&t.push(`
|
|
35
|
+
@media print {
|
|
36
|
+
${e.pageBreakAfter} {
|
|
37
|
+
page-break-after: always !important;
|
|
38
|
+
break-after: page !important;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`),e.avoidBreakInside&&t.push(`
|
|
42
|
+
@media print {
|
|
43
|
+
${e.avoidBreakInside} {
|
|
44
|
+
page-break-inside: avoid !important;
|
|
45
|
+
break-inside: avoid !important;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
`),t.join(`
|
|
49
|
+
`)}function er(e,t,n=0,r=0){let o=t-n-r;return o<=0?1:Math.ceil(e/o)}function K(e,t,n,r=new Date){return {pageNumber:e,totalPages:t,title:n,date:r}}function He(e,t){return e.replace(/\{page\}/gi,String(t.pageNumber)).replace(/\{pages\}/gi,String(t.totalPages)).replace(/\{title\}/gi,t.title).replace(/\{date\}/gi,t.date.toLocaleDateString()).replace(/\{time\}/gi,t.date.toLocaleTimeString())}function q(e,t){return e?typeof e=="function"?e(t):He(e,{...t,title:m(t.title)}):""}function _t(e,t={}){return e?`
|
|
50
|
+
<header class="print-header" style="
|
|
51
|
+
${t.fixed?`
|
|
52
|
+
position: fixed;
|
|
53
|
+
top: 0;
|
|
54
|
+
left: 0;
|
|
55
|
+
right: 0;
|
|
56
|
+
`:""}
|
|
57
|
+
width: 100%;
|
|
58
|
+
box-sizing: border-box;
|
|
59
|
+
">
|
|
60
|
+
${e}
|
|
61
|
+
</header>
|
|
62
|
+
`:""}function zt(e,t={}){return e?`
|
|
63
|
+
<footer class="print-footer" style="
|
|
64
|
+
${t.fixed?`
|
|
65
|
+
position: fixed;
|
|
66
|
+
bottom: 0;
|
|
67
|
+
left: 0;
|
|
68
|
+
right: 0;
|
|
69
|
+
`:""}
|
|
70
|
+
width: 100%;
|
|
71
|
+
box-sizing: border-box;
|
|
72
|
+
">
|
|
73
|
+
${e}
|
|
74
|
+
</footer>
|
|
75
|
+
`:""}function Ut(){return `
|
|
76
|
+
@media print {
|
|
77
|
+
.print-header {
|
|
78
|
+
page-break-after: avoid;
|
|
79
|
+
}
|
|
80
|
+
.print-footer {
|
|
81
|
+
page-break-before: avoid;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.print-header,
|
|
86
|
+
.print-footer {
|
|
87
|
+
-webkit-print-color-adjust: exact;
|
|
88
|
+
print-color-adjust: exact;
|
|
89
|
+
}
|
|
90
|
+
`}var $e=/\{pages?\}/gi;function Ne(e){return typeof e=="string"&&/\{pages?\}/i.test(e)}function Fe(){return typeof globalThis.CSSMarginRule<"u"}function Re(e){return (typeof DOMParser>"u"?e.replace(/<[^>]*>/g,""):new DOMParser().parseFromString(`<body>${e}`,"text/html").body.textContent??"").replace(/\s+/g," ").trim()}function _e(e){return `"${e.replace(/[\\"]/g,"\\$&").replace(/[\u0000-\u001f\u007f]/g," ")}"`}function ze(e,t,n){let o=Re(e).replace(/\{title\}/gi,()=>n.title).replace(/\{date\}/gi,()=>n.date.toLocaleDateString()).replace(/\{time\}/gi,()=>n.date.toLocaleTimeString()).split(/(\{pages?\})/i).filter(i=>i!=="").map(i=>/^\{pages\}$/i.test(i)?"counter(pages)":/^\{page\}$/i.test(i)?"counter(page)":_e(i)).join(" ");return `@page { @${t} { content: ${o||'""'}; } }`}function ot(e,t,n){return Ne(e)?Fe()?{html:"",css:ze(e,t,n)}:{html:q(e.replace($e,""),n),css:""}:{html:q(e,n),css:""}}function Ue(){return `printkit-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function sr(e){let t=Ue(),n=document.createElement("style");return n.id=t,n.setAttribute("data-printkit","true"),n.textContent=e,document.head.appendChild(n),t}function ar(e){let t=document.getElementById(e);t&&t.remove();}function lr(){document.querySelectorAll('style[data-printkit="true"]').forEach(t=>t.remove());}function J(e){let t=Array.isArray(e)?e.join(`
|
|
91
|
+
`):e;return `<style>${vt(t)}</style>`}function it(e){return `<link rel="stylesheet" href="${m(e)}">`}function Bt(e){return e.map(it).join(`
|
|
92
|
+
`)}function jt(e){let t=[];for(let n of e)n&&(Array.isArray(n)?t.push(...n):t.push(n));return t.join(`
|
|
93
|
+
`)}function Be(){let e=[];return document.querySelectorAll('link[rel="stylesheet"]').forEach(n=>{let r=n.href;r&&e.push(it(r));}),e}function je(){let e=[];return document.querySelectorAll("style").forEach(n=>{if(n.hasAttribute("data-printkit"))return;let r=n.textContent;r&&e.push(J(r));}),e}function We(){return [...Be(),...je()]}function Wt(){return We().join(`
|
|
94
|
+
`)}function pr(e){let t=window.getComputedStyle(e),n=[];for(let r=0;r<t.length;r++){let o=t[r];if(o){let i=t.getPropertyValue(o);i&&n.push(`${o}: ${i}`);}}return n.join("; ")}var qe="print-hide",qt="print-only";function Ke(){return `
|
|
95
|
+
/* Print visibility classes */
|
|
96
|
+
@media print {
|
|
97
|
+
.${qe},
|
|
98
|
+
.no-print {
|
|
99
|
+
display: none !important;
|
|
100
|
+
visibility: hidden !important;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.${qt},
|
|
104
|
+
.print-only {
|
|
105
|
+
display: block !important;
|
|
106
|
+
visibility: visible !important;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@media screen {
|
|
111
|
+
.${qt},
|
|
112
|
+
.print-only {
|
|
113
|
+
display: none !important;
|
|
114
|
+
visibility: hidden !important;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* Default print optimizations */
|
|
119
|
+
@media print {
|
|
120
|
+
* {
|
|
121
|
+
-webkit-print-color-adjust: exact !important;
|
|
122
|
+
print-color-adjust: exact !important;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
body {
|
|
126
|
+
margin: 0;
|
|
127
|
+
padding: 0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Remove backgrounds by default for better printing */
|
|
131
|
+
html {
|
|
132
|
+
background: white !important;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* Ensure links are readable */
|
|
136
|
+
a[href]:after {
|
|
137
|
+
content: none !important;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* Prevent orphans and widows */
|
|
141
|
+
p, h1, h2, h3, h4, h5, h6 {
|
|
142
|
+
orphans: 3;
|
|
143
|
+
widows: 3;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* Avoid breaking inside these elements */
|
|
147
|
+
h1, h2, h3, h4, h5, h6 {
|
|
148
|
+
page-break-after: avoid;
|
|
149
|
+
break-after: avoid;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
img {
|
|
153
|
+
page-break-inside: avoid;
|
|
154
|
+
break-inside: avoid;
|
|
155
|
+
max-width: 100% !important;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
table {
|
|
159
|
+
page-break-inside: auto;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
tr {
|
|
163
|
+
page-break-inside: avoid;
|
|
164
|
+
break-inside: avoid;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
thead {
|
|
168
|
+
display: table-header-group;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
tfoot {
|
|
172
|
+
display: table-footer-group;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
`}function Je(){return `
|
|
176
|
+
*, *::before, *::after {
|
|
177
|
+
box-sizing: border-box;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
html {
|
|
181
|
+
font-size: 16px;
|
|
182
|
+
line-height: 1.5;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
body {
|
|
186
|
+
margin: 0;
|
|
187
|
+
padding: 0;
|
|
188
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
189
|
+
'Helvetica Neue', Arial, sans-serif;
|
|
190
|
+
color: #000;
|
|
191
|
+
background: #fff;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
img {
|
|
195
|
+
max-width: 100%;
|
|
196
|
+
height: auto;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
table {
|
|
200
|
+
border-collapse: collapse;
|
|
201
|
+
width: 100%;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
th, td {
|
|
205
|
+
text-align: left;
|
|
206
|
+
padding: 8px;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
pre, code {
|
|
210
|
+
font-family: 'Courier New', Courier, monospace;
|
|
211
|
+
font-size: 14px;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
pre {
|
|
215
|
+
white-space: pre-wrap;
|
|
216
|
+
word-wrap: break-word;
|
|
217
|
+
overflow-x: auto;
|
|
218
|
+
}
|
|
219
|
+
`}function Ge(){return `
|
|
220
|
+
@media print {
|
|
221
|
+
* {
|
|
222
|
+
-webkit-print-color-adjust: exact !important;
|
|
223
|
+
print-color-adjust: exact !important;
|
|
224
|
+
color-adjust: exact !important;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
`}function Kt(){return [Je(),Ke(),Ge()].join(`
|
|
228
|
+
`)}function Xe(){let e=document.createElement("iframe");return e.style.cssText=`
|
|
229
|
+
position: fixed;
|
|
230
|
+
right: 0;
|
|
231
|
+
bottom: 0;
|
|
232
|
+
width: 0;
|
|
233
|
+
height: 0;
|
|
234
|
+
border: 0;
|
|
235
|
+
visibility: hidden;
|
|
236
|
+
opacity: 0;
|
|
237
|
+
pointer-events: none;
|
|
238
|
+
`,e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","-1"),e}function Ze(e,t=3e4){return new Promise((n,r)=>{let o=setTimeout(()=>{e.onload=null,e.onerror=null,r(c("IFRAME_LOAD_FAILED","Load timeout"));},t);e.onload=()=>{clearTimeout(o),requestAnimationFrame(()=>{requestAnimationFrame(()=>{n();});});},e.onerror=()=>{clearTimeout(o),r(c("IFRAME_LOAD_FAILED","Load error"));};})}function Ve(e,t){let n=e.contentDocument??e.contentWindow?.document;if(!n)throw c("IFRAME_LOAD_FAILED","Cannot access iframe document");n.open(),n.write(t),n.close();}function st(e){e&&(e.onload=null,e.onerror=null,e.parentNode&&e.parentNode.removeChild(e));}function Jt(e){return new Promise((t,n)=>{let r;try{let o=e.contentWindow;if(!o){n(c("IFRAME_LOAD_FAILED","Cannot access iframe window"));return}o.focus();let i=()=>{o.removeEventListener("afterprint",i),clearTimeout(r),t();};o.addEventListener("afterprint",i),r=setTimeout(()=>{o.removeEventListener("afterprint",i),t();},1e3),o.print();}catch(o){clearTimeout(r),n(c("IFRAME_LOAD_FAILED",o instanceof Error?o.message:"Print failed"));}})}async function Gt(e,t){let n=Xe();document.body.appendChild(n);try{let r=Ze(n,t);try{Ve(n,e);}catch(o){throw r.catch(()=>{}),o}await r;}catch(r){throw st(n),r}return n}var Xt=new WeakSet;function I(e,t){let n=typeof e=="object"&&e!==null?e:null;!t.onError||n&&Xt.has(n)||(n&&Xt.add(n),t.onError(wt(e)));}var Zt={pageSize:"A4",orientation:"portrait"},Ye=`
|
|
239
|
+
:not(#printkit-no-background),
|
|
240
|
+
:not(#printkit-no-background)::before,
|
|
241
|
+
:not(#printkit-no-background)::after {
|
|
242
|
+
background-color: transparent !important;
|
|
243
|
+
background-image: none !important;
|
|
244
|
+
}
|
|
245
|
+
`,Qe="script-src 'none'; base-uri 'none'";function b(e,t={}){let n=t.pageSize??Zt.pageSize,r=t.orientation??Zt.orientation,o=j(n,r),i=W(t.margin),s=K(1,1,t.title??"Print Document"),a=ot(t.header,"top-center",s),l=ot(t.footer,"bottom-center",s),d=jt([Kt(),It(n,r),Ht(t.margin),Ft(),Rt({pageBreakBefore:t.pageBreakBefore,pageBreakAfter:t.pageBreakAfter,avoidBreakInside:t.avoidBreakInside}),Ut(),a.css,l.css,t.printBackground===false?Ye:"",Array.isArray(t.styles)?t.styles.join(`
|
|
246
|
+
`):t.styles]);return {content:e,styles:d,header:a.html,footer:l.html,pageSize:o,margins:i,title:t.title??"Print Document"}}function x(e,t={}){let n=t.copyStyles!==false?Wt():"",r=t.styleSheets?Bt(t.styleSheets):"";return `
|
|
247
|
+
<!DOCTYPE html>
|
|
248
|
+
<html>
|
|
249
|
+
<head>
|
|
250
|
+
<meta charset="utf-8">
|
|
251
|
+
<meta http-equiv="Content-Security-Policy" content="${Qe}">
|
|
252
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
253
|
+
<title>${m(e.title)}</title>
|
|
254
|
+
${n}
|
|
255
|
+
${r}
|
|
256
|
+
${J(e.styles)}
|
|
257
|
+
</head>
|
|
258
|
+
<body>
|
|
259
|
+
${e.header?_t(e.header):""}
|
|
260
|
+
<main class="print-content">
|
|
261
|
+
${e.content}
|
|
262
|
+
</main>
|
|
263
|
+
${e.footer?zt(e.footer):""}
|
|
264
|
+
</body>
|
|
265
|
+
</html>
|
|
266
|
+
`}async function P(e,t={}){let n=null;try{t.onBeforePrint&&await t.onBeforePrint(),n=await Gt(e),await Jt(n),t.onAfterPrint&&t.onAfterPrint();}catch(r){throw I(r,t),r}finally{t.removeAfterPrint!==false&&st(n);}}async function Vt(e,t={}){let n=k(e);for(let s of n)await B(s);let r=U(n),o=b(r,t),i=x(o,t);await P(i,t);}function tn(e){if(!e||typeof e!="string")throw c("ELEMENT_NOT_FOUND","HTML content is empty or invalid");if(e.trim().length===0)throw c("ELEMENT_NOT_FOUND","HTML content is empty")}function en(e){let t=e.toLowerCase().trim();return t.includes("<!doctype")||t.includes("<html")}async function G(e,t={},n){tn(e);let r,o=[],i=[];if(en(e)){let v=Lt(e,n);r=v.body,o=v.styles,i=v.styleSheets;}else r=A(e);let s=[...t.styleSheets??[],...i],a=Array.isArray(t.styles)?[...t.styles,...o]:t.styles?[t.styles,...o]:o,{styles:l,styleSheets:d,...f}=t,u={...f,...a.length>0?{styles:a}:{},...s.length>0?{styleSheets:s}:{}},h=b(r,u),T=x(h,u);await P(T,t);}function nn(e){if(!e||typeof e!="string")throw c("ELEMENT_NOT_FOUND","URL is empty or invalid");try{new URL(e,window.location.origin);}catch{throw c("ELEMENT_NOT_FOUND",`Invalid URL: ${e}`)}}async function rn(e){try{let t=await fetch(e,{method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"}});if(!t.ok)throw c("IFRAME_LOAD_FAILED",`Failed to fetch URL: ${t.status} ${t.statusText}`);return await t.text()}catch(t){throw t instanceof Error&&t.name==="PrintError"?t:c("IFRAME_LOAD_FAILED",`Failed to fetch URL: ${t instanceof Error?t.message:"Unknown error"}`)}}async function Yt(e,t={}){nn(e);let n=new URL(e,window.location.origin).href;try{let r=await rn(n);await G(r,{...t,title:t.title??n},n);}catch(r){throw I(r,t),r}}function at(e,t){let n=document.createElement("canvas");return n.width=e,n.height=t,n}function lt(e){let t=e.getContext("2d");if(!t)throw c("PDF_EXPORT_FAILED","Cannot get canvas 2D context");return t}function Qt(e,t=.92){return e.toDataURL("image/jpeg",t)}function ct(e){return new Promise((t,n)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>t(r),r.onerror=()=>n(c("ELEMENT_NOT_FOUND",`Failed to load image: ${e}`)),r.src=e;})}function dt(e){return typeof e=="string"?e:e.src}function te(e){let t=dt(e);if(!t||t.trim().length===0)throw c("ELEMENT_NOT_FOUND","Image source is empty");if(Q(t))throw c("ELEMENT_NOT_FOUND","Image source must be an image URL")}function ee(e,t="",n={}){let r=n.fit==="cover"?"object-fit: cover;":n.fit==="fill"?"object-fit: fill;":"object-fit: contain;";return `
|
|
267
|
+
<div class="print-image-container" style="
|
|
268
|
+
display: flex;
|
|
269
|
+
justify-content: center;
|
|
270
|
+
align-items: center;
|
|
271
|
+
width: 100%;
|
|
272
|
+
height: 100%;
|
|
273
|
+
page-break-inside: avoid;
|
|
274
|
+
">
|
|
275
|
+
<img
|
|
276
|
+
src="${m(e)}"
|
|
277
|
+
alt="${m(t)}"
|
|
278
|
+
style="
|
|
279
|
+
max-width: 100%;
|
|
280
|
+
max-height: 100%;
|
|
281
|
+
${r}
|
|
282
|
+
"
|
|
283
|
+
/>
|
|
284
|
+
</div>
|
|
285
|
+
`}function on(e,t={}){return e.map((n,r)=>`
|
|
286
|
+
<div class="print-image-page" style="
|
|
287
|
+
page-break-after: ${r<e.length-1?"always":"auto"};
|
|
288
|
+
min-height: 100vh;
|
|
289
|
+
display: flex;
|
|
290
|
+
justify-content: center;
|
|
291
|
+
align-items: center;
|
|
292
|
+
">
|
|
293
|
+
${ee(n,`Image ${r+1}`,t)}
|
|
294
|
+
</div>
|
|
295
|
+
`).join("")}function ne(){return `
|
|
296
|
+
.print-image-container {
|
|
297
|
+
page-break-inside: avoid;
|
|
298
|
+
break-inside: avoid;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.print-image-page {
|
|
302
|
+
page-break-inside: avoid;
|
|
303
|
+
break-inside: avoid;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
@media print {
|
|
307
|
+
.print-image-container img {
|
|
308
|
+
max-width: 100% !important;
|
|
309
|
+
max-height: 100% !important;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
`}async function re(e,t={}){te(e);let n=dt(e);await ct(n);let r=ee(n,t.title??"Image"),o=b(r,{...t,styles:[ne(),...Array.isArray(t.styles)?t.styles:t.styles?[t.styles]:[]]}),i=x(o,t);await P(i,t);}async function oe(e,t={}){if(!e||e.length===0)throw c("ELEMENT_NOT_FOUND","No images provided");for(let s of e)te(s);let n=e.map(dt);await Promise.all(n.map(ct));let r=on(n),o=b(r,{...t,styles:[ne(),...Array.isArray(t.styles)?t.styles:t.styles?[t.styles]:[]]}),i=x(o,t);await P(i,t);}var F={string:"#22863a",number:"#005cc5",boolean:"#d73a49",null:"#6f42c1",key:"#032f62"};function sn(e){return e.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g,t=>{let n=F.number;if(/^"/.test(t)){if(/:$/.test(t))return n=F.key,t=t.replace(/:$/,""),`<span style="color:${n}">${m(t)}</span>:`;n=F.string;}else /true|false/.test(t)?n=F.boolean:/null/.test(t)&&(n=F.null);return `<span style="color:${n}">${m(t)}</span>`})}function an(e,t=2){let n;try{n=JSON.stringify(e,null,t);}catch{throw c("UNKNOWN","Failed to stringify JSON data")}if(n===void 0)throw c("UNKNOWN","Data cannot be represented as JSON");return n}function ln(e,t={}){let{indent:n=2,syntaxHighlight:r=false}=t,o=an(e,n);return `
|
|
313
|
+
<pre class="print-json" style="
|
|
314
|
+
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
|
|
315
|
+
font-size: 12px;
|
|
316
|
+
line-height: 1.5;
|
|
317
|
+
white-space: pre-wrap;
|
|
318
|
+
word-wrap: break-word;
|
|
319
|
+
overflow-wrap: break-word;
|
|
320
|
+
padding: 16px;
|
|
321
|
+
margin: 0;
|
|
322
|
+
background: #f6f8fa;
|
|
323
|
+
border-radius: 6px;
|
|
324
|
+
border: 1px solid #e1e4e8;
|
|
325
|
+
"><code>${r?sn(o):m(o)}</code></pre>
|
|
326
|
+
`}function cn(){return `
|
|
327
|
+
.print-json {
|
|
328
|
+
page-break-inside: auto;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.print-json code {
|
|
332
|
+
display: block;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
@media print {
|
|
336
|
+
.print-json {
|
|
337
|
+
background: #f6f8fa !important;
|
|
338
|
+
border: 1px solid #e1e4e8 !important;
|
|
339
|
+
-webkit-print-color-adjust: exact;
|
|
340
|
+
print-color-adjust: exact;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
`}async function ie(e,t={}){if(e===void 0)throw c("ELEMENT_NOT_FOUND","JSON data is undefined");let n=ln(e,t),r=b(n,{...t,styles:[cn(),...Array.isArray(t.styles)?t.styles:t.styles?[t.styles]:[]]}),o=x(r,t);await P(o,t);}function dn(e){if(!e)throw c("ELEMENT_NOT_FOUND","Table data is empty");if(!Array.isArray(e.headers)||e.headers.length===0)throw c("ELEMENT_NOT_FOUND","Table headers are required");if(!Array.isArray(e.rows))throw c("ELEMENT_NOT_FOUND","Table rows must be an array")}function pn(e,t={}){let n=t.headerStyles??"",r=t.cellStyles??"",o=e.map(i=>`<th style="${m(r)}">${m(i)}</th>`).join("");return `
|
|
344
|
+
<thead style="${m(n)}">
|
|
345
|
+
<tr>${o}</tr>
|
|
346
|
+
</thead>
|
|
347
|
+
`}function mn(e,t,n={}){let r=n.cellStyles??"",i=n.stripedRows&&t%2===1?"background-color: #f9f9f9;":"",s=e.map(a=>`<td style="${m(r)}">${m(a??"")}</td>`).join("");return `<tr style="${i}">${s}</tr>`}function un(e,t={}){return `<tbody>${e.map((r,o)=>mn(r,o,t)).join("")}</tbody>`}function fn(e,t={}){let n=t.tableStyles??"",o=t.bordered!==false?"border: 1px solid #ddd; border-collapse: collapse;":"border-collapse: collapse;",i=e.caption?`<caption style="padding: 10px; font-weight: bold; text-align: left;">${m(e.caption)}</caption>`:"";return `
|
|
348
|
+
<table class="print-table" style="
|
|
349
|
+
width: 100%;
|
|
350
|
+
${o}
|
|
351
|
+
${m(n)}
|
|
352
|
+
">
|
|
353
|
+
${i}
|
|
354
|
+
${pn(e.headers,t)}
|
|
355
|
+
${un(e.rows,t)}
|
|
356
|
+
</table>
|
|
357
|
+
`}function gn(e={}){return `
|
|
358
|
+
.print-table {
|
|
359
|
+
page-break-inside: auto;
|
|
360
|
+
border-collapse: collapse;
|
|
361
|
+
width: 100%;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.print-table thead {
|
|
365
|
+
display: table-header-group;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.print-table tfoot {
|
|
369
|
+
display: table-footer-group;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.print-table tbody tr {
|
|
373
|
+
page-break-inside: avoid;
|
|
374
|
+
break-inside: avoid;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.print-table th,
|
|
378
|
+
.print-table td {
|
|
379
|
+
padding: 8px 12px;
|
|
380
|
+
text-align: left;
|
|
381
|
+
vertical-align: top;
|
|
382
|
+
${e.bordered!==false?"border: 1px solid #ddd;":""}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.print-table th {
|
|
386
|
+
font-weight: bold;
|
|
387
|
+
background-color: #f5f5f5;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
@media print {
|
|
391
|
+
.print-table {
|
|
392
|
+
-webkit-print-color-adjust: exact;
|
|
393
|
+
print-color-adjust: exact;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.print-table th {
|
|
397
|
+
background-color: #f5f5f5 !important;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.print-table tbody tr:nth-child(even) {
|
|
401
|
+
background-color: #f9f9f9 !important;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
`}async function se(e,t={}){dn(e);let n=fn(e,t),r=b(n,{...t,styles:[gn(t),...Array.isArray(t.styles)?t.styles:t.styles?[t.styles]:[]]}),o=x(r,t);await P(o,t);}var X={title:"Print Document",pageSize:"A4",orientation:"portrait",copyStyles:true,removeAfterPrint:true,printBackground:true};function L(e,t){return t?{...e,...t,margin:t.margin!==void 0?t.margin:e.margin,styles:hn(e.styles,t.styles),styleSheets:yn(e.styleSheets,t.styleSheets)}:{...e}}function hn(e,t){if(!t)return e;if(!e)return t;let n=Array.isArray(e)?e:[e],r=Array.isArray(t)?t:[t];return [...n,...r]}function yn(e,t){return t?e?[...e,...t]:t:e}function pt(e){e.pageSize!==void 0&&(typeof e.pageSize=="string"?["A3","A4","A5","Letter","Legal","Tabloid"].includes(e.pageSize)||console.warn(`Invalid page size: ${e.pageSize}. Using default.`):typeof e.pageSize=="object"&&(e.pageSize.width===void 0||e.pageSize.height===void 0)&&console.warn("Custom page size must have width and height.")),e.orientation!==void 0&&(["portrait","landscape"].includes(e.orientation)||console.warn(`Invalid orientation: ${e.orientation}. Using default.`)),e.margin!==void 0&&typeof e.margin=="number"&&e.margin<0&&console.warn("Margin cannot be negative.");}var ut=class{constructor(t){E()||console.warn("Printing is not supported in this environment"),this.defaultOptions={...X,...t},t&&pt(t);}async print(t,n){if(!E())throw c("PRINT_NOT_SUPPORTED");let r=L(this.defaultOptions,n);await Vt(t,r);}async printHTML(t,n){if(!E())throw c("PRINT_NOT_SUPPORTED");let r=L(this.defaultOptions,n);await G(t,r);}async printURL(t,n){if(!E())throw c("PRINT_NOT_SUPPORTED");let r=L(this.defaultOptions,n);await Yt(t,r);}async printImage(t,n){if(!E())throw c("PRINT_NOT_SUPPORTED");let r=L(this.defaultOptions,n);await re(t,r);}async printImages(t,n){if(!E())throw c("PRINT_NOT_SUPPORTED");let r=L(this.defaultOptions,n);await oe(t,r);}async printJSON(t,n){if(!E())throw c("PRINT_NOT_SUPPORTED");let r=L(this.defaultOptions,n);await ie(t,r);}async printTable(t,n){if(!E())throw c("PRINT_NOT_SUPPORTED");let r=L(this.defaultOptions,n);await se(t,r);}setDefaultOptions(t){pt(t),this.defaultOptions=L(this.defaultOptions,t);}getDefaultOptions(){return {...this.defaultOptions}}destroy(){}};function bn(e){return new ut(e)}var mt=null;function lo(){return mt||(mt=bn()),mt}var xn=1,Pn=6,Tn=4,wn=12;function vn(e){let t=[],n=0,r="",o=0;for(let i=0;i<e.length;i++){let s=e[i];s==="\\"?i++:r?s===r&&(r=""):s==='"'||s==="'"?r=s:s==="("||s==="["?n++:s===")"||s==="]"?n--:s===","&&n===0&&(t.push(e.slice(o,i)),o=i+1);}return t.push(e.slice(o)),t.map(i=>i.trim()).filter(Boolean)}function En(e,t){return vn(e).map(n=>{let r=/^(?:(?::root|html)(?:\s*>?\s*body)?|body)(?![\w-])/i.exec(n);return r?`${t}${n.slice(r[0].length)}`:`${t} ${n}`}).join(", ")}function ft(e,t){let n="";for(let r of Array.from(e))if(r.type===xn){let o=r;if(o.selectorText.startsWith("@"))continue;n+=`${En(o.selectorText,t)}{${o.style.cssText}}`;}else if(r.type===Tn){let o=r,i=ft(o.cssRules,t),s=o.media.mediaText;n+=s.split(",").some(a=>a.trim().toLowerCase()==="print")?i:`@media ${s}{${i}}`;}else if(r.type===wn){let o=r;n+=`@supports ${o.conditionText}{${ft(o.cssRules,t)}}`;}else r.type!==Pn&&(n+=r.cssText);return n}function Sn(e,t){let n=document.createElement("style");n.media="not all",n.textContent=e,document.head.appendChild(n);try{return n.sheet?ft(n.sheet.cssRules,t):""}finally{n.remove();}}var Ln=0;function gt(e){let{pageWidth:t,pageHeight:n,margins:r}=e;return {width:Math.max(1,t-r.left-r.right),height:Math.max(1,n-r.top-r.bottom)}}function le(e,t){let n=window.getComputedStyle(e),r="";for(let s=0;s<n.length;s++){let a=n[s];a&&(r+=`${a}:${n.getPropertyValue(a)};`);}t.setAttribute("style",r);let o=e.children,i=t.children;for(let s=0;s<o.length;s++){let a=o[s],l=i[s];a&&l&&le(a,l);}}function On(e,t){let n=Array.from(e.querySelectorAll("img")),r=Array.from(t.querySelectorAll("img"));n.forEach((o,i)=>{let s=r[i];if(!(!s||!o.complete||o.naturalWidth===0)&&!(o.currentSrc.startsWith("data:")||o.src.startsWith("data:")))try{let a=at(o.naturalWidth,o.naturalHeight);lt(a).drawImage(o,0,0),s.setAttribute("src",a.toDataURL("image/png")),s.removeAttribute("srcset");}catch{}});}function Mn(e,t=3e4){return new Promise((n,r)=>{let o=new Image,i=setTimeout(()=>{o.onload=null,o.onerror=null,r(c("PDF_EXPORT_FAILED","Timed out rendering the element"));},t);o.onload=()=>{clearTimeout(i),n(o);},o.onerror=()=>{clearTimeout(i),r(c("PDF_EXPORT_FAILED","Failed to render the element"));},o.src=e;})}async function ce(e,t){let n=gt(t),r=document.createElement("div");r.setAttribute("aria-hidden","true"),r.style.cssText=["position: fixed","left: -100000px","top: 0",`width: ${n.width}px`,"margin: 0","padding: 0","border: 0","pointer-events: none","overflow: visible",`background: ${t.backgroundColor??"#ffffff"}`].join(";");let o=`${++Ln}`;r.setAttribute("data-printkit-snapshot",o);let i=null;t.styles&&(i=document.createElement("style"),i.setAttribute("data-printkit","true"),i.textContent=Sn(t.styles,`[data-printkit-snapshot="${o}"]`));let s=e.cloneNode(true);et(e,s),nt(e,s),s.querySelectorAll("img[loading]").forEach(a=>a.removeAttribute("loading")),r.appendChild(s),z(r),document.body.appendChild(r),i&&document.head.appendChild(i);try{await B(r,1e4);let a=Math.max(1,Math.ceil(r.scrollHeight)),l=r.cloneNode(!0);return le(r,l),On(r,l),l.style.position="static",l.style.left="0",l.style.top="0",l.style.transform="none",l.removeAttribute("aria-hidden"),l.removeAttribute("data-printkit-snapshot"),{markup:new XMLSerializer().serializeToString(l),width:n.width,height:a}}finally{r.remove(),i?.remove();}}function An(e,t){let n=document.createElement("div");return n.innerHTML=A(e),ce(n,t)}function ae(e,t,n,r){let o=`<svg xmlns="http://www.w3.org/2000/svg" width="${Math.ceil(e.width*r)}" height="${Math.ceil(n*r)}" viewBox="0 ${t} ${e.width} ${n}"><foreignObject x="0" y="0" width="${e.width}" height="${e.height}">`+e.markup+"</foreignObject></svg>";return Mn(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(o)}`)}async function kn(e,t,n,r=[]){let o=gt(t),{scale:i,margins:s}=t,a=Math.min(o.height,e.height-n),l=await ae(e,n,a,i),d=at(Math.round(t.pageWidth*i),Math.round(t.pageHeight*i)),f=lt(d);f.fillStyle=t.backgroundColor??"#ffffff",f.fillRect(0,0,d.width,d.height),f.drawImage(l,Math.round(s.left*i),Math.round(s.top*i),Math.ceil(o.width*i),Math.ceil(a*i));for(let u of r){let h=Math.min(u.height,u.snapshot.height),T=await ae(u.snapshot,0,h,i);f.drawImage(T,Math.round(u.left*i),Math.round(u.top*i),Math.ceil(u.snapshot.width*i),Math.ceil(h*i));}return d}async function de(e,t,n={},r){let o=n.title??"Print Document",i=new Date,s=(y,O,M)=>y?An(q(y,K(O,M,o,i)),t):null,a=(await s(n.header,1,1))?.height??0,l=(await s(n.footer,1,1))?.height??0,d={...t,margins:{...t.margins,top:t.margins.top+a,bottom:t.margins.bottom+l}},f=gt(d).height,u=[];for(let y of e)u.push(await ce(y,d));let h=u.map(y=>Math.max(1,Math.ceil(y.height/f))),T=h.reduce((y,O)=>y+O,0),v=[];for(let[y,O]of u.entries())for(let M=0;M<(h[y]??1);M++){let H=v.length+1,p=[],g=await s(n.header,H,T);g&&p.push({snapshot:g,top:t.margins.top,height:a,left:t.margins.left});let w=await s(n.footer,H,T);w&&p.push({snapshot:w,top:t.pageHeight-t.margins.bottom-l,height:l,left:t.margins.left}),v.push(await kn(O,d,M*f,p)),r?.(v.length-1,T);}return v}function R(e){if(/^[\x20-\x7e]*$/.test(e))return `(${e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")})`;let t="FEFF";for(let n=0;n<e.length;n++)t+=e.charCodeAt(n).toString(16).padStart(4,"0").toUpperCase();return `<${t}>`}function Dn(e){let t=l=>l.toString().padStart(2,"0"),n=e.getFullYear(),r=t(e.getMonth()+1),o=t(e.getDate()),i=t(e.getHours()),s=t(e.getMinutes()),a=t(e.getSeconds());return `D:${n}${r}${o}${i}${s}${a}`}function Cn(e){let t=[];return e?.title&&t.push(`/Title ${R(e.title)}`),e?.author&&t.push(`/Author ${R(e.author)}`),e?.subject&&t.push(`/Subject ${R(e.subject)}`),e?.keywords&&e.keywords.length>0&&t.push(`/Keywords ${R(e.keywords.join(", "))}`),t.push(`/Creator ${R(e?.creator??"PrintKit")}`),t.push("/Producer (PrintKit)"),t.push(`/CreationDate (${Dn(e?.creationDate??new Date)})`),t.join(`
|
|
405
|
+
`)}function In(e){let t=e.slice(e.indexOf(",")+1),n=atob(t),r=new Uint8Array(n.length);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return r}function Hn(e,t,n,r){let o=[],i=[],s=0,a=p=>{let g=new Uint8Array(p.length);for(let w=0;w<p.length;w++)g[w]=p.charCodeAt(w)&255;return g},l=p=>{let g=typeof p=="string"?a(p):p;o.push(g),s+=g.length;},d=p=>{i[p]=s,l(`${p} 0 obj
|
|
406
|
+
`);},f=Number(t.toFixed(2)),u=Number(n.toFixed(2)),h=p=>4+p*3,T=3+e.length*3;l(`%PDF-1.4
|
|
407
|
+
%\xFF\xFF\xFF\xFF
|
|
408
|
+
`),d(1),l(`<< /Type /Catalog /Pages 2 0 R >>
|
|
409
|
+
endobj
|
|
410
|
+
`),d(2);let v=e.map((p,g)=>`${h(g)} 0 R`).join(" ");l(`<< /Type /Pages /Kids [${v}] /Count ${e.length} >>
|
|
411
|
+
endobj
|
|
412
|
+
`),d(3),l(`<< ${Cn(r)} >>
|
|
413
|
+
endobj
|
|
414
|
+
`),e.forEach((p,g)=>{let w=h(g),bt=w+1,xt=w+2;d(w),l(`<< /Type /Page /Parent 2 0 R /MediaBox [0 0 ${f} ${u}] /Contents ${bt} 0 R /Resources << /XObject << /Im${g} ${xt} 0 R >> >> >>
|
|
415
|
+
endobj
|
|
416
|
+
`);let Pt=`q ${f} 0 0 ${u} 0 0 cm /Im${g} Do Q`;d(bt),l(`<< /Length ${Pt.length} >>
|
|
417
|
+
stream
|
|
418
|
+
${Pt}
|
|
419
|
+
endstream
|
|
420
|
+
endobj
|
|
421
|
+
`),d(xt),l(`<< /Type /XObject /Subtype /Image /Width ${p.width} /Height ${p.height} /ColorSpace /DeviceRGB /BitsPerComponent 8 /Filter /DCTDecode /Length ${p.jpeg.length} >>
|
|
422
|
+
stream
|
|
423
|
+
`),l(p.jpeg),l(`
|
|
424
|
+
endstream
|
|
425
|
+
endobj
|
|
426
|
+
`);});let y=s,O=`xref
|
|
427
|
+
0 ${T+1}
|
|
428
|
+
0000000000 65535 f
|
|
429
|
+
`;for(let p=1;p<=T;p++)O+=`${String(i[p]??0).padStart(10,"0")} 00000 n
|
|
430
|
+
`;l(O),l(`trailer
|
|
431
|
+
<< /Size ${T+1} /Root 1 0 R /Info 3 0 R >>
|
|
432
|
+
startxref
|
|
433
|
+
${y}
|
|
434
|
+
%%EOF`);let M=new Uint8Array(s),H=0;for(let p of o)M.set(p,H),H+=p.length;return M}function $n(e,t){let n;try{n=Qt(e,t);}catch(r){throw c("PDF_EXPORT_FAILED",`This browser does not allow reading back the rendered page (${r instanceof Error?r.message:"canvas is tainted"})`)}if(!n.startsWith("data:image/jpeg"))throw c("PDF_EXPORT_FAILED","The browser could not encode the page as JPEG");return {jpeg:In(n),width:e.width,height:e.height}}var ht=class{async toBlob(t,n){if(!Tt())throw c("PDF_EXPORT_FAILED","PDF export is not supported");let r=k(t),o=n?.onProgress;o?.(0);let i=C(n?.pageSize??"A4",n?.orientation??"portrait"),s=n?.quality??.92,a=Array.isArray(n?.styles)?n.styles.join(`
|
|
435
|
+
`):n?.styles,l=[],d=await de(r,{pageWidth:i.width,pageHeight:i.height,margins:N(n?.margin),scale:n?.scale??2,styles:a},{header:n?.header,footer:n?.footer,title:n?.title??n?.metadata?.title},(u,h)=>{o?.(Math.min(99,Math.round((u+1)/h*95)));});for(let u of d)l.push($n(u,s));let f=Hn(l,i.width*.75,i.height*.75,n?.metadata);return o?.(100),new Blob([f.buffer],{type:"application/pdf"})}async toBase64(t,n){let r=await this.toBlob(t,n);return new Promise((o,i)=>{let s=new FileReader;s.onloadend=()=>{let a=s.result;o(a.split(",")[1]??"");},s.onerror=()=>i(c("PDF_EXPORT_FAILED","Failed to convert to base64")),s.readAsDataURL(r);})}async toDataURL(t,n){let r=await this.toBlob(t,n);return new Promise((o,i)=>{let s=new FileReader;s.onloadend=()=>o(s.result),s.onerror=()=>i(c("PDF_EXPORT_FAILED","Failed to convert to data URL")),s.readAsDataURL(r);})}async download(t,n,r){let o=await this.toBlob(t,r),i=URL.createObjectURL(o),s=document.createElement("a");s.href=i,s.download=n.endsWith(".pdf")?n:`${n}.pdf`,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i);}async downloadHTML(t,n,r){let o=At();o.innerHTML=A(t),kt(o);try{await this.download(o,n,r);}finally{Dt(o);}}};function pe(){return new ht}function me(e,t){let n={...e};if(t)for(let r of Object.keys(t)){let o=t[r];o!==void 0&&(n[r]=o);}return n}var Nn={width:"90%",height:"85%",showToolbar:true,showPageNumbers:true,zoom:100,className:""},Fn={print:true,download:true,zoom:true,navigation:true,close:true},_=[25,50,75,100,125,150,175,200],ue=25,fe=200,Z=25,yt=class{constructor(t,n){this.modal=null;this.contentContainer=null;this.currentPage=1;this.totalPages=1;this.zoomLevel=100;this.isModalOpen=false;this.target=t,this.options={...X,...n},this.modalOptions=me(Nn,n?.modal),this.toolbarOptions=me(Fn,n?.toolbar),this.zoomLevel=this.modalOptions.zoom,this.boundHandleKeydown=this.handleKeydown.bind(this);}open(){this.isModalOpen||(this.createModal(),this.renderContent(),this.calculatePages(),this.attachEventListeners(),this.isModalOpen=true);}close(){this.isModalOpen&&(this.removeEventListeners(),this.destroyModal(),this.isModalOpen=false,this.options.onClose&&this.options.onClose());}async print(){try{let t=k(this.target),n=U(t),r=b(n,this.options),o=x(r,this.options);await P(o,this.options);}catch(t){throw I(t,this.options),t}this.options.onPrint&&this.options.onPrint();}async download(t="document.pdf"){try{await pe().download(this.target,t,this.options);}catch(n){throw I(n,this.options),n}this.options.onDownload&&this.options.onDownload();}setZoom(t){this.zoomLevel=Math.max(ue,Math.min(fe,t)),this.updateZoom();}getZoom(){return this.zoomLevel}zoomIn(){let t=_.indexOf(this.zoomLevel);t<_.length-1?this.zoomLevel=_[t+1]??this.zoomLevel+Z:this.zoomLevel=Math.min(fe,this.zoomLevel+Z),this.updateZoom();}zoomOut(){let t=_.indexOf(this.zoomLevel);t>0?this.zoomLevel=_[t-1]??this.zoomLevel-Z:this.zoomLevel=Math.max(ue,this.zoomLevel-Z),this.updateZoom();}resetZoom(){this.zoomLevel=100,this.updateZoom();}nextPage(){this.currentPage<this.totalPages&&(this.currentPage++,this.scrollToPage(this.currentPage));}prevPage(){this.currentPage>1&&(this.currentPage--,this.scrollToPage(this.currentPage));}goToPage(t){t>=1&&t<=this.totalPages&&(this.currentPage=t,this.scrollToPage(this.currentPage));}getCurrentPage(){return this.currentPage}getTotalPages(){return this.totalPages}isOpen(){return this.isModalOpen}destroy(){this.close(),this.target=null;}createModal(){this.modal=document.createElement("div"),this.modal.className=`printkit-preview-modal ${this.modalOptions.className}`.trim(),this.modal.style.cssText=`
|
|
436
|
+
position: fixed;
|
|
437
|
+
top: 0;
|
|
438
|
+
left: 0;
|
|
439
|
+
right: 0;
|
|
440
|
+
bottom: 0;
|
|
441
|
+
background: rgba(0, 0, 0, 0.75);
|
|
442
|
+
display: flex;
|
|
443
|
+
flex-direction: column;
|
|
444
|
+
align-items: center;
|
|
445
|
+
justify-content: center;
|
|
446
|
+
z-index: 999999;
|
|
447
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
448
|
+
`;let t=document.createElement("div");t.className="printkit-preview-container",t.style.cssText=`
|
|
449
|
+
width: ${typeof this.modalOptions.width=="number"?`${this.modalOptions.width}px`:this.modalOptions.width};
|
|
450
|
+
height: ${typeof this.modalOptions.height=="number"?`${this.modalOptions.height}px`:this.modalOptions.height};
|
|
451
|
+
display: flex;
|
|
452
|
+
flex-direction: column;
|
|
453
|
+
background: #f5f5f5;
|
|
454
|
+
border-radius: 8px;
|
|
455
|
+
overflow: hidden;
|
|
456
|
+
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
|
|
457
|
+
`,this.modalOptions.showToolbar&&t.appendChild(this.createToolbar()),this.contentContainer=document.createElement("div"),this.contentContainer.className="printkit-preview-content",this.contentContainer.style.cssText=`
|
|
458
|
+
flex: 1;
|
|
459
|
+
overflow: auto;
|
|
460
|
+
padding: 20px;
|
|
461
|
+
display: flex;
|
|
462
|
+
flex-direction: column;
|
|
463
|
+
align-items: center;
|
|
464
|
+
gap: 20px;
|
|
465
|
+
`,t.appendChild(this.contentContainer),this.modal.appendChild(t),document.body.appendChild(this.modal);}createToolbar(){let t=document.createElement("div");t.className="printkit-preview-toolbar",t.style.cssText=`
|
|
466
|
+
display: flex;
|
|
467
|
+
align-items: center;
|
|
468
|
+
justify-content: space-between;
|
|
469
|
+
padding: 12px 16px;
|
|
470
|
+
background: #fff;
|
|
471
|
+
border-bottom: 1px solid #e0e0e0;
|
|
472
|
+
`;let n=document.createElement("div");n.style.cssText="display: flex; align-items: center; gap: 8px;";let r=document.createElement("div");r.style.cssText="display: flex; align-items: center; gap: 8px;";let o=document.createElement("div");if(o.style.cssText="display: flex; align-items: center; gap: 8px;",this.toolbarOptions.navigation){let i=this.createButton("< Prev",()=>this.prevPage()),s=this.createButton("Next >",()=>this.nextPage()),a=document.createElement("span");a.className="printkit-page-info",a.style.cssText="font-size: 14px; color: #666;",a.textContent=`Page ${this.currentPage} of ${this.totalPages}`,n.appendChild(i),n.appendChild(a),n.appendChild(s);}if(this.toolbarOptions.zoom){let i=this.createButton("-",()=>this.zoomOut()),s=document.createElement("span");s.className="printkit-zoom-level",s.style.cssText="font-size: 14px; min-width: 50px; text-align: center;",s.textContent=`${this.zoomLevel}%`;let a=this.createButton("+",()=>this.zoomIn()),l=this.createButton("Reset",()=>this.resetZoom());r.appendChild(i),r.appendChild(s),r.appendChild(a),r.appendChild(l);}if(this.toolbarOptions.print){let i=this.createButton("Print",()=>this.print().catch(()=>{}),true);o.appendChild(i);}if(this.toolbarOptions.download){let i=this.createButton("Download",()=>this.download().catch(()=>{}));o.appendChild(i);}if(this.toolbarOptions.close){let i=this.createButton("Close",()=>this.close());i.style.marginLeft="8px",o.appendChild(i);}return t.appendChild(n),t.appendChild(r),t.appendChild(o),t}createButton(t,n,r=false){let o=document.createElement("button");return o.textContent=t,o.onclick=n,o.style.cssText=`
|
|
473
|
+
padding: 6px 12px;
|
|
474
|
+
border: 1px solid ${r?"#0066cc":"#ccc"};
|
|
475
|
+
border-radius: 4px;
|
|
476
|
+
background: ${r?"#0066cc":"#fff"};
|
|
477
|
+
color: ${r?"#fff":"#333"};
|
|
478
|
+
font-size: 14px;
|
|
479
|
+
cursor: pointer;
|
|
480
|
+
transition: all 0.2s;
|
|
481
|
+
`,o.onmouseover=()=>{o.style.opacity="0.8";},o.onmouseout=()=>{o.style.opacity="1";},o}renderContent(){if(this.contentContainer)try{let t=k(this.target),n=C(this.options.pageSize??"A4",this.options.orientation??"portrait"),r=N(this.options.margin),o=document.createElement("div");o.className="printkit-page",o.style.cssText=`
|
|
482
|
+
width: ${n.width}px;
|
|
483
|
+
min-height: ${n.height}px;
|
|
484
|
+
background: white;
|
|
485
|
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
486
|
+
padding: ${r.top}px ${r.right}px ${r.bottom}px ${r.left}px;
|
|
487
|
+
box-sizing: border-box;
|
|
488
|
+
transform-origin: top center;
|
|
489
|
+
transform: scale(${this.zoomLevel/100});
|
|
490
|
+
`;for(let i of t){let s=Mt(i);o.appendChild(s);}this.contentContainer.appendChild(o);}catch(t){let n=document.createElement("div");n.style.cssText="color: red; padding: 20px;",n.textContent=t instanceof Error?t.message:"Failed to load content",this.contentContainer.appendChild(n);}}calculatePages(){if(!this.contentContainer)return;let t=C(this.options.pageSize??"A4",this.options.orientation??"portrait"),n=N(this.options.margin),r=t.height-n.top-n.bottom,o=this.contentContainer.querySelectorAll(".printkit-page"),i=0;o.forEach(s=>{i+=s.scrollHeight;}),this.totalPages=Math.max(1,Math.ceil(i/r)),this.updatePageInfo();}updateZoom(){if(!this.contentContainer)return;this.contentContainer.querySelectorAll(".printkit-page").forEach(r=>{r.style.transform=`scale(${this.zoomLevel/100})`;});let n=this.modal?.querySelector(".printkit-zoom-level");n&&(n.textContent=`${this.zoomLevel}%`);}updatePageInfo(){let t=this.modal?.querySelector(".printkit-page-info");t&&(t.textContent=`Page ${this.currentPage} of ${this.totalPages}`);}scrollToPage(t){if(!this.contentContainer)return;let n=C(this.options.pageSize??"A4",this.options.orientation??"portrait"),r=(t-1)*(n.height+20)*(this.zoomLevel/100);this.contentContainer.scrollTop=r,this.updatePageInfo();}attachEventListeners(){document.addEventListener("keydown",this.boundHandleKeydown);}removeEventListeners(){document.removeEventListener("keydown",this.boundHandleKeydown);}handleKeydown(t){if(this.isModalOpen)switch(t.key){case "Escape":this.close();break;case "ArrowLeft":this.prevPage();break;case "ArrowRight":this.nextPage();break;case "+":case "=":(t.ctrlKey||t.metaKey)&&(t.preventDefault(),this.zoomIn());break;case "-":(t.ctrlKey||t.metaKey)&&(t.preventDefault(),this.zoomOut());break}}destroyModal(){this.modal&&(this.modal.remove(),this.modal=null),this.contentContainer=null,this.currentPage=1;}};function Co(e,t){return new yt(e,t)}export{He as A,q as B,sr as C,ar as D,lr as E,J as F,jt as G,We as H,pr as I,qe as J,qt as K,Ke as L,Je as M,Kt as N,L as O,bn as P,lo as Q,pe as R,Co as S,E as a,Tt as b,Rn as c,D as d,c as e,he as f,wt as g,A as h,Ot as i,Ce as j,Mt as k,B as l,Ct as m,j as n,C as o,W as p,N as q,rt as r,$t as s,Nt as t,Vn as u,Yn as v,Qn as w,tr as x,er as y,K as z};//# sourceMappingURL=chunk-N44HS34F.js.map
|
|
491
|
+
//# sourceMappingURL=chunk-N44HS34F.js.map
|