1import{u as C,r as n,j as e,L as h,H as D}from"./app-DP13319Q.js";import{F as c,b0 as L,bm as U,av as H,P as V,az as Z,aI as q}from"./index-CtyZ6W6U.js";import{D as O}from"./DraggableMenu-Bk7Spryo.js";/* empty css */import"./index-DQkUn08L.js";function Q(){var x;const{props:g}=C(),{auth:b,template:t,invoice:s}=g,p=n.useCallback(a=>{try{return new URL(a),!0}catch{return!1}},[]),d=n.useCallback(a=>{var i;return(i=a.split("?")[0].split(".").pop())==null?void 0:i.toLowerCase()},[]),m=n.useCallback(a=>a?["jpg","jpeg","png","gif","bmp","tiff","tif","webp","apng","svg","ico"].includes(a):!1,[]),y=n.useMemo(()=>t!=null&&t.image&&m(d(t.image))?e.jsx("style",{children:` 2 .blur-bg { 3 background: url('${t.user_id===0?"https://admin.ez3d.ai/":"https://ez.wiki/"}${t.image}') no-repeat center center; 4 background-size: cover; 5 } 6 `}):null,[t,d,m]),w=n.useMemo(()=>{var f;if(!t)return null;const a=((f=t.image.split(".").pop())==null?void 0:f.toLowerCase())||"",i=`${t.user_id===0?"https://admin.ez3d.ai/":"https://ez.wiki/"}${t.image}`,j=["jpg","jpeg","png","gif","bmp","tiff","tif","webp","apng","svg","ico"],N=["ppt","pptx","pdf","xls","xlsx","doc","docx","pages","ai","psd","eps","ttf","dxf","xps","rar","zip","ods","odt","odp"],$=/(?:youtube(?:-nocookie)?\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?/ ]{11})/i,k=/(?:https?:\/\/)?(?:www\.)?linkedin\.com\/(?:in|posts|company|feed|showcase|embed\/feed\/update\/urn:li:[^/]+:[^"&?/ ]+)/i,z=/^https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)(?:[?]?.*)$/im,_=/^(https?:\/\/)?(www\.)?fb\.watch\/[a-zA-Z0-9(\.\?)?]/,P=/^(https?:\/\/)?(www\.)?facebook\.com\/[a-zA-Z0-9(\.\?)?]/,B=/<iframe.*?src=["'](.*?)["'].*?>.*?<\/iframe>/is,I=/<blockquote/,o=t.image.match($),T=t.image.match(k),u=t.image.match(z),E=t.image.match(_),F=t.image.match(P),S=t.image.match(B)||I.test(t.image),R=new Blob([t.image],{type:"text/html"}),M=URL.createObjectURL(R);if(j.includes(a))return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 7 .blur-overlay { 8 position: fixed; 9 top: 0; 10 left: 0; 11 width: 100%; 12 height: 100%; 13 backdrop-filter: blur(20px); 14 z-index: -1; 15 } 16 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("img",{src:i,alt:"Background",className:"absolute inset-0 max-w-full max-h-full m-auto z-0 rounded-lg",onError:l=>console.error("Image failed to load",l)},`image-${t.image}`)]});if(N.includes(a))return e.jsx("iframe",{src:`https://docs.google.com/viewer?url=${i}&embedded=true`,className:"fixed top-0 left-0 w-full h-full",frameBorder:"0",loading:"lazy",allow:"autoplay; fullscreen",allowFullScreen:!0,sandbox:"allow-scripts allow-same-origin",title:"Document Viewer",scrolling:"yes"},`doc-${t.image}`);if(S){const l=t.image.replace(/<(iframe|blockquote)([^>]*)\s(height|width|style)=["'][^"']*["']([^>]*)>/gi,'<$1$2$4 class="fixed top-0 left-0 w-full h-full" scrolling="yes">').replace(/class="([^"]*)"/g,'class="$1 absolute inset-0 m-auto"'),A=/<(iframe|blockquote)[^>]*class="/i.test(l)?l:l.replace(/<(iframe|blockquote)/g,'<$1 scrolling="yes" class="absolute w-full h-full inset-0 m-auto"');return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 17 .blur-overlay { 18 position: fixed; 19 top: 0; 20 left: 0; 21 width: 100%; 22 height: 100%; 23 backdrop-filter: blur(20px); 24 z-index: -2; 25 } 26 .twitter-tweet { 27 position: fixed; 28 top: 0; 29 left: 0; 30 width: 100vw; 31 height: 100vh; 32 object-fit: cover; 33 z-index: 0; 34 border: none; 35 } 36 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("div",{className:"fixed top-0 left-0 w-full h-full object-cover",dangerouslySetInnerHTML:{__html:A}},`iframe-${t.image}`)]})}if(o){const l=t.option==="autoplay"?"autoplay=1":t.option==="mute"?"autoplay=1&mute=1":"mute=1";return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed top-0 left-0 w-full h-full z-[-2]",children:e.jsx("iframe",{loading:"lazy",src:`https://www.youtube.com/embed/${o[1]}?${l}&loop=1&playlist=${o[1]}&controls=0&showinfo=0&modestbranding=1&iv_load_policy=3`,className:"w-full h-full object-cover",frameBorder:"0",allow:"autoplay; fullscreen",allowFullScreen:!0},`youtube-1-${o[1]}`)}),e.jsx("style",{children:` 37 .blur-overlay { 38 position: fixed; 39 top: 0; 40 left: 0; 41 width: 100%; 42 height: 100%; 43 backdrop-filter: blur(20px); 44 z-index: -1; 45 } 46 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{id:"bgVideo",loading:"lazy",className:"fixed top-0 left-0 w-full h-full object-cover",src:`https://www.youtube.com/embed/${o[1]}?${t.option}=1&mute=1&loop=1&playlist=${o[1]}`,title:"YouTube video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture;
46 web-share",referrerPolicy:"strict-origin-when-cross-origin",allowFullScreen:!0},`youtube-2-${o[1]}`)]})}if(T){let l=t.image;return l.includes("?compact=1")||(l+=(l.includes("?")?"&":"?")+"compact=1"),e.jsx("div",{className:"fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black",children:e.jsx("iframe",{id:"bgVideo",src:l,className:"w-full h-full",frameBorder:"0",allowFullScreen:!0,title:"Embedded LinkedIn Post",scrolling:"yes"},`linkedin-${l}`)})}return u?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 47 .blur-overlay { 48 position: fixed; 49 top: 0; 50 left: 0; 51 width: 100%; 52 height: 100%; 53 backdrop-filter: blur(20px); 54 z-index: -1; 55 } 56 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{loading:"lazy",id:"bgVideo",allow:"camera; microphone; fullscreen; display-capture; autoplay",src:`https://player.vimeo.com/video/${u[3]}?h=33160d1512&color=de0101`,className:"fixed top-0 left-0 w-full h-full object-cover",frameBorder:"0",allowFullScreen:!0},`vimeo-${u[3]}`)]}):E||F&&!t.image.includes("groups")?e.jsx("div",{className:"fixed top-0 left-0 w-full h-full",children:e.jsx("div",{className:"fb-post","data-href":t.image,"data-width":"1400","data-show-text":"true"},`fb-${t.image}`)}):a==="mp4"?e.jsxs(e.Fragment,{children:[e.jsxs("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"fixed top-0 left-0 w-full h-full object-cover z-[-3]",children:[e.jsx("source",{src:i,type:"video/mp4"}),"Your browser does not support the video tag."]},`video-bg-${t.image}`),e.jsx("style",{children:` 57 .blur-overlay { 58 position: fixed; 59 top: 0; 60 left: 0; 61 width: 100%; 62 height: 100%; 63 backdrop-filter: blur(20px); 64 z-index: -2; 65 } 66 `}),e.jsx("div",{className:"blur-overlay"}),e.jsxs("video",{id:"bgVideo",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"absolute inset-0 max-w-full max-h-full m-auto",controls:!0,children:[e.jsx("source",{src:i,type:"video/mp4"}),"Your browser does not support the video tag."]},`video-main-${t.image}`)]}):a==="glb"?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 67 .blur-overlay { 68 position: fixed; 69 top: 0; 70 left: 0; 71 width: 100%; 72 height: 100%; 73 backdrop-filter: blur(20px); 74 z-index: -1; 75 } 76 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("model-viewer",{src:i,alt:"3D model",className:"fixed top-0 left-0 w-full h-full",ar:!0,"auto-rotate":!0,"camera-controls":!0,"shadow-intensity":"1"},`model-${t.image}`)]}):p(t.image)?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 77 .blur-overlay { 78 position: fixed; 79 top: 0; 80 left: 0; 81 width: 100%; 82 height: 100%; 83 backdrop-filter: blur(20px); 84 z-index: -1; 85 } 86 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{loading:"lazy",id:"bgVideo",allow:"camera; microphone; fullscreen; display-capture; autoplay",src:t.image,className:"fixed top-0 left-0 w-full h-full",frameBorder:"0",allowFullScreen:!0,scrolling:"yes"},`iframe-url-${t.image}`)]}):e.jsx("iframe",{src:M,className:"fixed top-0 left-0 w-full h-full border-none",allow:"microphone *; camera *; autoplay *; fullscreen *; display-capture *;",sandbox:`allow-forms allow-modals allow-orientation-lock allow-pointer-lock \r 87 allow-popups allow-popups-to-escape-sandbox allow-presentation \r 88 allow-same-origin allow-scripts allow-top-navigation \r 89 allow-top-navigation-by-user-activation allow-downloads allow-storage-access-by-user-activation`,allowFullScreen:!0,loading:"lazy",name:"binauralMixerFrame",allowTransparency:"true",scrolling:"yes"},`html-${t.image}`)}
89,[t,p]);if(!s)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsxs("div",{className:"text-center p-8 bg-white rounded-lg shadow-md",children:[e.jsx("h1",{className:"text-2xl font-bold text-red-600 mb-4",children:"Invoice Not Found"}),e.jsx(h,{href:"/sendbee",className:"text-blue-600 hover:text-blue-800",children:"Back to Send Bee"})]})});const v=()=>{var r;const a=window.open("","_blank");a?(a.document.write(` 90 <!DOCTYPE html> 91 <html> 92 <head> 93 <title>Bee Transfer Invoice ${s.invoice_number}</title> 94 <style> 95 body { font-family: Arial, sans-serif; margin: 0; padding: 20px; color: #333; } 96 .invoice-header { background: #f59e0b; color: #000; padding: 20px; } 97 .invoice-body { padding: 20px; } 98 table { width: 100%; border-collapse: collapse; margin: 20px 0; } 99 th, td { padding: 12px; text-align: left; border-bottom: 1px solid #ddd; } 100 th { background-color: #f5f5f5; } 101 .total-row { font-weight: bold; } 102 .status { display: inline-block; padding: 5px 10px; border-radius: 20px; font-size: 14px; } 103 .paid { background: #d4edda; color: #155724; } 104 </style> 105 </head> 106 <body> 107 <div class="invoice-header"> 108 <h1>Bee Transfer Invoice #${s.invoice_number}</h1> 109 <p>Issued: ${s.issue_date}</p> 110 <span class="status paid"> 111 COMPLETED 112 </span> 113 </div> 114 <div class="invoice-body"> 115 <h2>Transfer Details</h2> 116 <div style="margin-bottom: 20px;"> 117 <p><strong>Type:</strong> ${s.transfer_type==="outgoing"?"Sent":"Received"}</p> 118 <p><strong>Counterparty:</strong> ${((r=s.counterparty)==null?void 0:r.email)||"N/A"}</p> 119 <p><strong>Transaction Hash:</strong> ${s.transaction_hash}</p> 120 <p><strong>Processed At:</strong> ${s.processed_at}</p> 121 </div> 122 123 <h2>Bee Points ${s.transfer_type==="outgoing"?"Sent":"Received"}</h2> 124 <table> 125 <thead> 126 <tr> 127 <th>Description</th> 128 <th>Amount</th> 129 </tr> 130 </thead> 131 <tbody> 132 ${s.items.map(i=>` 133 <tr> 134 <td>${i.description}</td> 135 <td>EZ$${i.amount}</td> 136 </tr> 137 `).join("")} 138 </tbody> 139 <tfoot> 140 <tr class="total-row"> 141 <td colspan="1" style="text-align: right;">Total</td> 142 <td>EZ$${s.amount}</td> 143 </tr> 144 </tfoot> 145 </table> 146 147 ${s.notes?` 148 <h2>Notes</h2> 149 <p>${s.notes}</p> 150 `:""} 151 </div> 152 <script>window.print(); window.close();<\/script> 153 </body> 154 </html> 155 `),a.document.close()):window.print()};return e.jsxs(e.Fragment,{children:[e.jsxs(D,{children:[e.jsx("title",{children:`Invoice ${s.invoice_number} - Bee Transfer`}),e.jsx("meta",{name:"description",content:`Invoice for your Bee Points transfer - ${s.invoice_number}`}),y]}),e.jsx(O,{auth:b}),e.jsxs("main",{className:`relative min-h-screen p-4 md:p-8 ${t!=null&&t.image&&m(d(t.image))?"blur-bg":""}`,children:[e.jsx("div",{className:"absolute inset-0 z-0",children:w}),e.jsx("div",{className:"relative z-10",children:e.jsxs("div",{className:"max-w-4xl mx-auto bg-white rounded-lg shadow-lg overflow-hidden",children:[e.jsx("div",{className:"p-6 md:p-8 bg-yellow-500 text-black",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center",children:[e.jsx(c,{icon:L,className:"mr-3"}),"Bee Transfer Invoice #",s.invoice_number]}),e.jsxs("p",{className:"text-gray-800 mt-2",children:["Issued: ",s.issue_date]})]}),e.jsx("div",{className:"text-right",children:e.jsx("span",{className:"px-3 py-1 rounded-full text-sm font-medium bg-green-100 text-green-800",children:"COMPLETED"})})]})}),e.jsxs("div",{className:"p-6 md:p-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-lg font-medium text-gray-900 mb-4",children:"Transfer Details"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-500 mb-2",children:"Transfer Type"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx(c,{icon:s.transfer_type==="outgoing"?U:H,className:s.transfer_type==="outgoing"?"text-blue-500 mr-2":"text-green-500 mr-2"}),e.jsx("span",{className:"font-medium capitalize",children:s.transfer_type==="outgoing"?"Sent":"Received"})]})]}),e.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-500 mb-2",children:s.transfer_type==="outgoing"?"Recipient":"Sender"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx(c,{icon:V,className:"text-gray-500 mr-2"}),e.jsx("span",{className:"text-sm",children:((x=s.counterparty)==null?void 0:x.email)||"N/A"})]})]}),e.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-500 mb-2",children:"Transaction Hash"}),e.jsx("div",{className:"font-mono text-sm",children:s.transaction_hash})]}),e.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-500 mb-2",children:"Processed At"}),e.jsx("div",{className:"text-sm",children:s.processed_at})]})]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsxs("h2",{className:"text-lg font-medium text-gray-900 mb-4",children:["Bee Points ",s.transfer_type==="outgoing"?"Sent":"Received"]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Description"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Amount"})]})}),e.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:s.items.map((a,r)=>
155e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(c,{icon:Z,className:"text-yellow-500 mr-2"}),e.jsx("div",{className:"text-sm font-medium text-gray-900",children:a.description})]})}),e.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:["EZ$",a.amount]})]},r))}),e.jsx("tfoot",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("td",{colSpan:1,className:"px-6 py-4 text-right text-sm font-medium text-gray-500",children:"Total"}),e.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-bold text-gray-900",children:["EZ$",s.amount]})]})})]})})]}),s.notes&&e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-lg font-medium text-gray-900 mb-2",children:"Notes"}),e.jsx("p",{className:"text-gray-600",children:s.notes})]}),e.jsxs("div",{className:"flex justify-end space-x-4",children:[e.jsxs("button",{onClick:v,className:"inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[e.jsx(c,{icon:q,className:"mr-2"}),"Print Invoice"]}),e.jsx(h,{href:"/sendbee",className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Back to Send Bee"})]})]})]})})]})]})}export{Q as default};
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.