1import{a as re}from"./react-B4GY_nsQ.js";var B={exports:{}},se=B.exports,Q;function ie(){return Q||(Q=1,function(X,le){(function(Y,G){X.exports=G(re())})(typeof self<"u"?self:se,function(Y){return function(){var G={155:function(e){e.exports=Y}},_={};function T(e){var t=_[e];if(t!==void 0)return t.exports;var s=_[e]={exports:{}};return G[e](s,s.exports,T),s.exports}T.d=function(e,t){for(var s in t)T.o(t,s)&&!T.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},T.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},T.r=function(e){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var V={};T.r(V),T.d(V,{useReactToPrint:function(){return oe}});var Z=T(155);function p({level:e="error",messages:t,suppressErrors:s=!1}){s||(e==="error"?console.error(t):e==="warning"?console.warn(t):console.debug(t))}function z(e,t){if(t||!e){const s=document.getElementById("printWindow");s&&document.body.removeChild(s)}}function H(e){return e instanceof Error?e:new Error("Unknown Error")}function U(e,t){const{documentTitle:s,onAfterPrint:d,onPrintError:g,preserveAfterPrint:f,print:w,suppressErrors:m}=t;setTimeout(()=>{var u,h;if(e.contentWindow){let R=function(){d==null||d(),z(f)};if(e.contentWindow.focus(),w)w(e).then(R).catch(b=>{g?g("print",H(b)):p({messages:["An error was thrown by the specified `print` function"],suppressErrors:m})});else{if(e.contentWindow.print){const b=(h=(u=e.contentDocument)===null||u===void 0?void 0:u.title)!==null&&h!==void 0?h:"",E=e.ownerDocument.title;s&&(e.ownerDocument.title=s,e.contentDocument&&(e.contentDocument.title=s)),e.contentWindow.print(),s&&(e.ownerDocument.title=E,e.contentDocument&&(e.contentDocument.title=b))}else p({messages:["Printing for this browser is not currently possible: the browser does not have a `print` method available for iframes."],suppressErrors:m});[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(b=>{var E,S;return((S=(E=navigator.userAgent)!==null&&E!==void 0?E:navigator.vendor)!==null&&S!==void 0?S:"opera"in window&&window.opera).match(b)})?setTimeout(R,500):R()}}else p({messages:["Printing failed because the `contentWindow` of the print iframe did not load. This is possibly an error with `react-to-print`. Please file an issue: https://github.com/MatthewHerbst/react-to-print/issues/"],suppressErrors:m})},500)}function J(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,null);let d=s.nextNode();for(;d;)t.push(d),d=s.nextNode();return t}function K(e,t,s){const d=J(e),g=J(t);if(d.length===g.length)for(let f=0;f<d.length;f++){const w=d[f],m=g[f],u=w.shadowRoot;if(u!==null){const h=m.attachShadow({mode:u.mode});h.innerHTML=u.innerHTML,K(u,h,s)}}else p({messages:["When cloning shadow root content, source and target elements have different size. `onBeforePrint` likely resolved too early.",e,t],suppressErrors:s})}const ee=` 2 @page { 3 /* Remove browser default header (title) and footer (url) */ 4 margin: 0; 5 } 6 @media print { 7 body { 8 /* Tell browsers to print background colors */ 9 color-adjust: exact; /* Firefox. This is an older version of "print-color-adjust" */ 10 print-color-adjust: exact; /* Firefox/Safari */ 11 -webkit-print-color-adjust: exact; /* Chrome/Safari/Edge/Opera */ 12 } 13 } 14`;function te(e,t,s,d){var g,f,w,m,u;const{contentNode:h,clonedContentNode:R,clonedImgNodes:b,clonedVideoNodes:E,numResourcesToLoad:S,originalCanvasNodes:M}=s,{bodyClass:O,fonts:x,ignoreGlobalStyles:j,pageStyle:q,nonce:P,suppressErrors:i,copyShadowRoots:D}=d;e.onload=null;const l=(g=e.contentDocument)!==null&&g!==void 0?g:(f=e.contentWindow)===null||f===void 0?void 0:f.document;if(l){const k=l.body.appendChild(R);D&&K(h,k,!!i),x&&(!((w=e.contentDocument)===null||w===void 0)&&w.fonts&&(!((m=e.contentWindow)===null||m===void 0)&&m.FontFace)?x.forEach(n=>{const o=new FontFace(n.family,n.source,{weight:n.weight,style:n.style});e.contentDocument.fonts.add(o),o.loaded.then(()=>{t(o)}).catch(c=>{t(o,["Failed loading the font:",o,"Load error:",H(c)])})}
14):(x.forEach(n=>{t(n)}),p({messages:['"react-to-print" is not able to load custom fonts because the browser does not support the FontFace API but will continue attempting to print the page'],suppressErrors:i})));const F=q??ee,W=l.createElement("style");P&&(W.setAttribute("nonce",P),l.head.setAttribute("nonce",P)),W.appendChild(l.createTextNode(F)),l.head.appendChild(W),O&&l.body.classList.add(...O.split(" "));const A=l.querySelectorAll("canvas");for(let n=0;n<M.length;++n){const o=M[n],c=A[n];if(c===void 0){p({messages:["A canvas element could not be copied for printing, has it loaded? `onBeforePrint` likely resolved too early.",o],suppressErrors:i});continue}const r=c.getContext("2d");r&&r.drawImage(o,0,0)}for(let n=0;n<b.length;n++){const o=b[n],c=o.getAttribute("src");if(c){const r=new Image;r.onload=()=>{t(o)},r.onerror=(a,y,L,v,N)=>{t(o,["Error loading <img>",o,"Error",N])},r.src=c}else t(o,['Found an <img> tag with an empty "src" attribute. This prevents pre-loading it.',o])}for(let n=0;n<E.length;n++){const o=E[n];o.preload="auto";const c=o.getAttribute("poster");if(c){const r=new Image;r.onload=()=>{t(o)},r.onerror=(a,y,L,v,N)=>{t(o,["Error loading video poster",c,"for video",o,"Error:",N])},r.src=c}else o.readyState>=2?t(o):o.src?(o.onloadeddata=()=>{t(o)},o.onerror=(r,a,y,L,v)=>{t(o,["Error loading video",o,"Error",v])},o.onstalled=()=>{t(o,["Loading video stalled, skipping",o])}):t(o,["Error loading video, `src` is empty",o])}const C="select",I=h.querySelectorAll(C),$=l.querySelectorAll(C);for(let n=0;n<I.length;n++)$[n].value=I[n].value;if(!j){const n=document.querySelectorAll("style, link[rel~='stylesheet'], link[as='style']");for(let o=0,c=n.length;o<c;++o){const r=n[o];if(r.tagName.toLowerCase()==="style"){const a=l.createElement(r.tagName),y=r.sheet;if(y){let L="";try{const v=y.cssRules.length;for(let N=0;N<v;++N)typeof y.cssRules[N].cssText=="string"&&(L+=`${y.cssRules[N].cssText}\r 15`)}catch(v){p({messages:["A stylesheet could not be accessed. This is likely due to the stylesheet having cross-origin imports, and many browsers block script access to cross-origin stylesheets. See https://github.com/MatthewHerbst/react-to-print/issues/429 for details. You may be able to load the sheet by both marking the stylesheet with the cross `crossorigin` attribute, and setting the `Access-Control-Allow-Origin` header on the server serving the stylesheet. Alternatively, host the stylesheet on your domain to avoid this issue entirely.",r,`Original error: ${H(v).message}`],level:"warning"})}a.setAttribute("id",`react-to-print-${o}`),P&&a.setAttribute("nonce",P),a.appendChild(l.createTextNode(L)),l.head.appendChild(a)}}else if(r.getAttribute("href"))if(r.hasAttribute("disabled"))p({messages:["`react-to-print` encountered a <link> tag with a `disabled` attribute and will ignore it. Note that the `disabled` attribute is deprecated, and some browsers ignore it. You should stop using it. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-disabled. The <link> is:",r],level:"warning"}),t(r);else{const a=l.createElement(r.tagName);for(let y=0,L=r.attributes.length;y<L;++y){const v=r.attributes[y];v&&a.setAttribute(v.nodeName,(u=v.nodeValue)!==null&&u!==void 0?u:"")}a.onload=()=>{t(a)},a.onerror=(y,L,v,N,ne)=>{t(a,["Failed to load",a,"Error:",ne])},P&&a.setAttribute("nonce",P),l.head.appendChild(a)}else p({messages:["`react-to-print` encountered a <link> tag with an empty `href` attribute. In addition to being invalid HTML, this can cause problems in many browsers, and so the <link> was not loaded. The <link> is:",r],level:"warning"}),t(r)}}}S===0&&U(e,d)}function oe({bodyClass:e,contentRef:t,copyShadowRoots:s,documentTitle:d,fonts:g,ignoreGlobalStyles:f,nonce:w,onAfterPrint:m,onBeforePrint:u,onPrintError:h,pageStyle:R,preserveAfterPrint:b,print:E,suppressErrors:S}){return(0,Z.useCallback)(M=>{function O(){const x={bodyClass:e,contentRef:t,copyShadowRoots:s,documentTitle:d,fonts:g,ignoreGlobalStyles:f,nonce:w,onAfterPrint:m,onPrintError:h,pageStyle:R,preserveAfterPrint:b,print:E,suppressErrors:S},j=function(){const i=document.createElement("iframe");return i.width=`${document.documentElement.clientWidth}px`,i.height=`${document.documentElement.clientHeight}px`,i.style.position="absolute",i.style.top=`-${document.documentElement.clientHeight+100}px`,i.style.left=`-${document.documentElement.clientWidth+100}px`,i.id="printWindow",i.srcdoc="<!DOCTYPE html>",i}(),q=function(i,D){const{contentRef:l,fonts:k,ignoreGlobalStyles:F,suppressErrors:W}=D,A=function({contentRef:c,optionalContent:r,suppressErrors:a}){return!r||r instanceof Event||(c&&p({level:"warning",messages:['"react-to-
15print" received a `contentRef` option and a optional-content param passed to its callback. The `contentRef` option will be ignored.']}),typeof r!="function")?c?c.current:void p({messages:['"react-to-print" did not receive a `contentRef` option or a optional-content param pass to its callback.'],suppressErrors:a}):r()}({contentRef:l,optionalContent:i,suppressErrors:W});if(!A)return;const C=A.cloneNode(!0),I=document.querySelectorAll("link[rel~='stylesheet'], link[as='style']"),$=C.querySelectorAll("img"),n=C.querySelectorAll("video"),o=k?k.length:0;return{contentNode:A,clonedContentNode:C,clonedImgNodes:$,clonedVideoNodes:n,numResourcesToLoad:(F?0:I.length)+$.length+n.length+o,originalCanvasNodes:A.querySelectorAll("canvas")}}(M,x);if(!q)return void p({messages:["There is nothing to print"],suppressErrors:S});const P=function(i,D,l){const{suppressErrors:k}=i,F=[],W=[];return function(A,C){F.includes(A)?p({level:"debug",messages:["Tried to mark a resource that has already been handled",A],suppressErrors:k}):(C?(p({messages:['"react-to-print" was unable to load a resource but will continue attempting to print the page',...C],suppressErrors:k}),W.push(A)):F.push(A),F.length+W.length===D&&U(l,i))}}(x,q.numResourcesToLoad,j);(function(i,D,l,k){i.onload=()=>{te(i,D,l,k)},document.body.appendChild(i)})(j,P,q,x)}z(b,!0),u?u().then(()=>{O()}).catch(x=>{h==null||h("onBeforePrint",H(x))}):O()},[e,t,s,d,g,f,w,m,u,h,R,b,E,S])}return V}()})}(B)),B.exports}var ce=ie();export{ce as l};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.