@m1kapp/kit 0.0.32 → 0.0.33

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/dist/ogimage.js CHANGED
@@ -1 +1 @@
1
- "use strict";var w=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var Q=(t,e)=>{for(var o in e)w(t,o,{get:e[o],enumerable:!0})},X=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Y(e))!K.call(t,n)&&n!==o&&w(t,n,{get:()=>e[n],enumerable:!(r=J(e,n))||r.enumerable});return t};var Z=t=>X(w({},"__esModule",{value:!0}),t);var gt={};Q(gt,{OGImage:()=>A,createEmojiLoader:()=>U,createFaviconElement:()=>M,getOGVersion:()=>_,loadFont:()=>N,loadGoogleFont:()=>H,loadPretendard:()=>j});module.exports=Z(gt);function S(t){let e=t.replace("#",""),o=parseInt(e.length===3?e.split("").map(r=>r+r).join(""):e,16);return{r:o>>16&255,g:o>>8&255,b:o&255}}function C(t,e){let{r:o,g:r,b:n}=S(t);return`rgba(${o},${r},${n},${e})`}function tt(t,e,o){t/=255,e/=255,o/=255;let r=Math.max(t,e,o),n=Math.min(t,e,o),i=(r+n)/2;if(r===n)return{h:0,s:0,l:i};let a=r-n,s=i>.5?a/(2-r-n):a/(r+n),f=0;return r===t?f=60*(((e-o)/a+(e<o?6:0))%6):r===e?f=60*(((o-t)/a+2)%6):f=60*(((t-e)/a+4)%6),{h:f,s,l:i}}function et(t,e,o){let r=(1-Math.abs(2*o-1))*e,n=r*(1-Math.abs(t/60%2-1)),i=o-r/2,a=0,s=0,f=0;return t<60?[a,s,f]=[r,n,0]:t<120?[a,s,f]=[n,r,0]:t<180?[a,s,f]=[0,r,n]:t<240?[a,s,f]=[0,n,r]:t<300?[a,s,f]=[n,0,r]:[a,s,f]=[r,0,n],{r:Math.round((a+i)*255),g:Math.round((s+i)*255),b:Math.round((f+i)*255)}}function G(t,e=45){let{r:o,g:r,b:n}=S(t),{h:i,s:a,l:s}=tt(o,r,n),f=(i+e)%360,{r:c,g:u,b:m}=et(f,a,s);return`rgb(${c},${u},${m})`}function v(t,e){let{r:o,g:r,b:n}=S(t),i=a=>Math.max(0,Math.min(255,a));return`rgb(${i(o+e)},${i(r+e)},${i(n+e)})`}function T(t,e=.5){let{r:o,g:r,b:n}=S(t),i=a=>Math.round(a+(255-a)*e);return`rgb(${i(o)},${i(r)},${i(n)})`}var d=require("react/jsx-runtime"),B={blend:{logoIconBg:()=>"rgba(255,255,255,0.2)",logoTextColor:"#ffffff",domainColor:"rgba(255,255,255,0.75)",dotColor:()=>"rgba(255,255,255,0.6)",baseBg:t=>T(t,.55),baseGradient:void 0},gradient:{logoIconBg:()=>"rgba(255,255,255,0.18)",logoTextColor:"rgba(255,255,255,0.95)",domainColor:"rgba(255,255,255,0.5)",dotColor:()=>"rgba(255,255,255,0.5)",baseBg:()=>"#06060a",baseGradient:void 0},dark:{logoIconBg:t=>t,logoTextColor:"#e4e4e7",domainColor:"#52525b",dotColor:t=>t,baseBg:()=>"#0a0a0c",baseGradient:"linear-gradient(180deg, #1a1a1f 0%, #0a0a0c 100%)"}};function ot({color:t}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{style:{position:"absolute",top:-500,left:-400,width:1400,height:1300,borderRadius:"50%",backgroundColor:t,opacity:.7,filter:"blur(240px)",display:"flex"}}),(0,d.jsx)("div",{style:{position:"absolute",bottom:-480,right:-380,width:1380,height:1280,borderRadius:"50%",backgroundColor:G(t,50),opacity:.65,filter:"blur(235px)",display:"flex"}}),(0,d.jsx)("div",{style:{position:"absolute",top:"20%",right:-200,width:1e3,height:900,borderRadius:"50%",backgroundColor:G(t,-50),opacity:.6,filter:"blur(220px)",display:"flex"}})]})}function rt({color:t}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{style:{position:"absolute",bottom:-180,left:-80,width:700,height:560,borderRadius:"50%",backgroundColor:t,opacity:.8,filter:"blur(130px)",display:"flex"}}),(0,d.jsx)("div",{style:{position:"absolute",top:-160,right:-60,width:580,height:480,borderRadius:"50%",backgroundColor:v(t,70),opacity:.6,filter:"blur(110px)",display:"flex"}}),(0,d.jsx)("div",{style:{position:"absolute",top:-80,left:"20%",width:340,height:260,borderRadius:"50%",backgroundColor:"#ffffff",opacity:.07,filter:"blur(70px)",display:"flex"}}),(0,d.jsx)("div",{style:{position:"absolute",bottom:-60,right:"10%",width:380,height:300,borderRadius:"50%",backgroundColor:v(t,-50),opacity:.4,filter:"blur(90px)",display:"flex"}}),(0,d.jsx)("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.52)",display:"flex"}})]})}function nt({color:t}){return(0,d.jsx)("div",{style:{position:"absolute",bottom:-200,left:"30%",width:500,height:300,borderRadius:"50%",backgroundColor:t,opacity:.08,filter:"blur(80px)",display:"flex"}})}function P({appName:t,color:e="#007B5F",domain:o,bg:r="dark",logoUrl:n,children:i}){let a=t||"m1k",s=B[r]??B.dark,f=s.logoIconBg(e),c="#ffffff",u=s.logoTextColor,m=s.domainColor,y=s.dotColor(e);return(0,d.jsxs)("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",backgroundColor:s.baseBg(e),...s.baseGradient?{background:s.baseGradient}:{},padding:"72px 80px",fontFamily:"Pretendard, system-ui, sans-serif",position:"relative",overflow:"hidden"},children:[r==="blend"?(0,d.jsx)(ot,{color:e}):r==="gradient"?(0,d.jsx)(rt,{color:e}):(0,d.jsx)(nt,{color:e}),(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:18,position:"relative",zIndex:1},children:[n?(0,d.jsx)("img",{src:n,width:52,height:52,style:{borderRadius:14,objectFit:"cover",display:"flex"}}):(0,d.jsx)("div",{style:{width:52,height:52,borderRadius:14,backgroundColor:f,display:"flex",alignItems:"center",justifyContent:"center",fontSize:24,fontWeight:900,color:c},children:a[0].toUpperCase()}),(0,d.jsx)("span",{style:{fontSize:30,fontWeight:800,color:u,letterSpacing:"-0.5px"},children:a})]}),(0,d.jsx)("div",{style:{display:"flex",flexDirection:"column",flex:1,justifyContent:"center",position:"relative",zIndex:1},children:i}),o&&(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,position:"relative",zIndex:1},children:[(0,d.jsx)("div",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:y,display:"flex"}}),(0,d.jsx)("span",{style:{fontSize:22,color:m,fontWeight:600},children:o})]})]})}var x=require("react/jsx-runtime");function it(t){let e=[],o=/\p{Extended_Pictographic}/gu,r=0;for(let i of t.matchAll(o)){let a=t.slice(r,i.index).trim();a&&e.push(a),e.push(i[0]),r=i.index+i[0].length}let n=t.slice(r).trim();return n&&e.push(n),e}function p({text:t,style:e}){let o=it(t);return o.length<=1?(0,x.jsx)("span",{style:{display:"flex",...e},children:t}):(0,x.jsx)("span",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",...e},children:o.map((r,n)=>(0,x.jsx)("span",{children:r},n))})}function h({text:t,color:e,bg:o="dark"}){let r=o==="gradient",n=o==="blend";return(0,x.jsx)("div",{style:{display:"flex"},children:(0,x.jsx)("div",{style:{display:"flex",backgroundColor:n||r?"rgba(255,255,255,0.2)":C(e,.12),borderRadius:24,paddingLeft:18,paddingRight:18,paddingTop:8,paddingBottom:8},children:(0,x.jsx)(p,{text:t,style:{fontSize:22,fontWeight:700,color:n||r?"#ffffff":e,letterSpacing:"0.2px"}})})})}var g=require("react/jsx-runtime");function R({title:t,sub:e,badge:o,color:r="#007B5F",bg:n="dark"}){let i=n==="blend";return(0,g.jsxs)(g.Fragment,{children:[o&&(0,g.jsx)("div",{style:{display:"flex",marginBottom:20},children:(0,g.jsx)(h,{text:o,color:r,bg:n})}),(0,g.jsx)(p,{text:t,style:{fontSize:72,fontWeight:900,color:"#ffffff",letterSpacing:"-2px",lineHeight:1.1}}),e&&(0,g.jsx)(p,{text:e,style:{fontSize:34,color:n==="gradient"?"rgba(255,255,255,0.72)":i?"rgba(255,255,255,0.85)":"#a1a1aa",marginTop:22,fontWeight:500}})]})}function I({home:t,away:e,score:o,sub:r,badge:n,color:i="#007B5F",bg:a="dark"}){let s=a==="gradient",f=a==="blend",c="#ffffff",u=s?"rgba(255,255,255,0.9)":f?"rgba(255,255,255,0.85)":i,m=s?"rgba(255,255,255,0.6)":f?"rgba(255,255,255,0.9)":C(i,.6),y=s?"rgba(255,255,255,0.35)":f?C(i,.5):C(i,.35);return(0,g.jsxs)(g.Fragment,{children:[r&&(0,g.jsx)(p,{text:r,style:{fontSize:28,color:u,fontWeight:700,marginBottom:24}}),(0,g.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:28},children:[(0,g.jsx)("span",{style:{fontSize:64,fontWeight:900,color:c,letterSpacing:"-1.5px"},children:t}),o?(0,g.jsx)("span",{style:{fontSize:48,fontWeight:900,color:m,letterSpacing:"3px"},children:o}):(0,g.jsx)("span",{style:{fontSize:36,fontWeight:700,color:y},children:"vs"}),(0,g.jsx)("span",{style:{fontSize:64,fontWeight:900,color:"#ffffff",letterSpacing:"-1.5px"},children:e})]}),n&&(0,g.jsx)("div",{style:{display:"flex",marginTop:24},children:(0,g.jsx)(h,{text:n,color:i,bg:a})})]})}function F({title:t,sub:e,badge:o,color:r="#007B5F",bg:n="dark"}){let i=n==="blend";return(0,g.jsxs)(g.Fragment,{children:[o&&(0,g.jsx)("div",{style:{display:"flex",marginBottom:24},children:(0,g.jsx)(h,{text:o,color:r,bg:n})}),(0,g.jsx)(p,{text:t,style:{fontSize:80,fontWeight:900,color:"#ffffff",letterSpacing:"-2px",lineHeight:1.15}}),e&&(0,g.jsx)(p,{text:e,style:{fontSize:38,color:n==="gradient"?"rgba(255,255,255,0.72)":i?"rgba(255,255,255,0.85)":"#71717a",marginTop:28,fontWeight:500}})]})}var l=require("react/jsx-runtime");function E({letter:t,radius:e=96,appName:o="m1k",color:r="#007B5F",bg:n="dark",fontSize:i=240}){let s=t??(o||"m1k")[0].toUpperCase(),f=n==="gradient",c=n==="blend",u=c?T(r,.55):f?"#06060a":r,m=r,y=G(r,50),O=G(r,-50);return(0,l.jsxs)("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:u,borderRadius:e,fontFamily:"Pretendard, system-ui, sans-serif",position:"relative",overflow:"hidden"},children:[c?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{style:{position:"absolute",top:-280,left:-250,width:800,height:750,borderRadius:"50%",backgroundColor:m,opacity:.62,filter:"blur(200px)",display:"flex"}}),(0,l.jsx)("div",{style:{position:"absolute",bottom:-260,right:-220,width:780,height:730,borderRadius:"50%",backgroundColor:y,opacity:.58,filter:"blur(195px)",display:"flex"}}),(0,l.jsx)("div",{style:{position:"absolute",top:"25%",right:-100,width:600,height:550,borderRadius:"50%",backgroundColor:O,opacity:.55,filter:"blur(180px)",display:"flex"}})]}):f?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{style:{position:"absolute",bottom:-100,left:-80,width:420,height:380,borderRadius:"50%",backgroundColor:r,opacity:.7,filter:"blur(100px)",display:"flex"}}),(0,l.jsx)("div",{style:{position:"absolute",top:-80,right:-60,width:350,height:320,borderRadius:"50%",backgroundColor:v(r,70),opacity:.45,filter:"blur(90px)",display:"flex"}}),(0,l.jsx)("div",{style:{position:"absolute",top:-40,left:"25%",width:200,height:150,borderRadius:"50%",backgroundColor:"#ffffff",opacity:.07,filter:"blur(60px)",display:"flex"}})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{style:{position:"absolute",top:-80,right:-80,width:300,height:300,borderRadius:"50%",backgroundColor:"#ffffff",opacity:.1,filter:"blur(80px)",display:"flex"}}),(0,l.jsx)("div",{style:{position:"absolute",bottom:-60,left:-60,width:250,height:250,borderRadius:"50%",backgroundColor:"#000000",opacity:.15,filter:"blur(60px)",display:"flex"}})]}),(0,l.jsx)("span",{style:{fontSize:i,fontWeight:900,color:"#ffffff",letterSpacing:`${(-i*.025).toFixed(1)}px`,lineHeight:1,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",...c?{textShadow:"0 2px 8px rgba(0,0,0,0.3)"}:{}},children:s})]})}var $={gradient:{muted:"rgba(255,255,255,0.55)",accent:t=>"rgba(255,255,255,0.9)",authorLetter:"#18181b",dotSep:"rgba(255,255,255,0.3)"},blend:{muted:"rgba(255,255,255,0.8)",accent:t=>"rgba(255,255,255,0.6)",authorLetter:"#000000",dotSep:"rgba(255,255,255,0.5)"},dark:{muted:"#71717a",accent:t=>t,authorLetter:"#fff",dotSep:"#3f3f46"}};function W({title:t,author:e,date:o,category:r,sub:n,color:i="#007B5F",bg:a="dark"}){let s=$[a]??$.dark,f="#ffffff",c=s.muted,u=s.accent(i),m=s.authorLetter,y=s.dotSep;return(0,l.jsxs)(l.Fragment,{children:[r&&(0,l.jsx)("div",{style:{display:"flex",marginBottom:20},children:(0,l.jsx)(h,{text:r,color:i,bg:a})}),(0,l.jsx)(p,{text:t,style:{fontSize:64,fontWeight:900,color:f,letterSpacing:"-1.5px",lineHeight:1.15}}),n&&(0,l.jsx)(p,{text:n,style:{fontSize:30,color:c,marginTop:18,fontWeight:500}}),(e||o)&&(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,marginTop:28},children:[e&&(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,l.jsx)("div",{style:{width:32,height:32,borderRadius:"50%",backgroundColor:u,display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:800,color:m},children:e[0].toUpperCase()}),(0,l.jsx)("span",{style:{fontSize:22,color:c,fontWeight:600},children:e})]}),e&&o&&(0,l.jsx)("span",{style:{fontSize:20,color:y,display:"flex"},children:"\xB7"}),o&&(0,l.jsx)("span",{style:{fontSize:22,color:c,fontWeight:500,display:"flex"},children:o})]})]})}function z({stat:t,label:e,sub:o,badge:r,color:n="#007B5F",bg:i="dark"}){let a=i==="gradient",s=i==="blend";return(0,l.jsxs)(l.Fragment,{children:[r&&(0,l.jsx)("div",{style:{display:"flex",marginBottom:20},children:(0,l.jsx)(h,{text:r,color:n,bg:i})}),(0,l.jsx)(p,{text:t,style:{fontSize:110,fontWeight:900,color:s||a?"#ffffff":n,letterSpacing:"-4px",lineHeight:1}}),(0,l.jsx)("div",{style:{fontSize:36,fontWeight:700,color:"#ffffff",marginTop:12,display:"flex"},children:e}),o&&(0,l.jsx)(p,{text:o,style:{fontSize:26,color:s?"rgba(255,255,255,0.8)":a?"rgba(255,255,255,0.55)":"#71717a",marginTop:14,fontWeight:500}})]})}function L({title:t,tagline:e,features:o,badge:r,color:n="#007B5F",bg:i="dark"}){let a=i==="gradient",s=i==="blend",f="#ffffff",c=a?"rgba(255,255,255,0.75)":s?"rgba(255,255,255,0.85)":"#a1a1aa",u=a?"rgba(255,255,255,0.7)":s?"rgba(255,255,255,0.8)":"#a1a1aa",m=a?"rgba(255,255,255,0.5)":s?"rgba(255,255,255,0.6)":n,y=(o??[]).slice(0,3);return(0,l.jsxs)(l.Fragment,{children:[r&&(0,l.jsx)("div",{style:{display:"flex",marginBottom:20},children:(0,l.jsx)(h,{text:r,color:n,bg:i})}),(0,l.jsx)(p,{text:t,style:{fontSize:72,fontWeight:900,color:f,letterSpacing:"-2px",lineHeight:1.1}}),e&&(0,l.jsx)(p,{text:e,style:{fontSize:32,color:c,marginTop:16,fontWeight:500}}),y.length>0&&(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10,marginTop:24},children:y.map((O,V)=>(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,l.jsx)("div",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:m,display:"flex",flexShrink:0}}),(0,l.jsx)(p,{text:O,style:{fontSize:24,color:u,fontWeight:500}})]},V))})]})}var b=require("react/jsx-runtime");function M({text:t,appName:e="app",color:o="#0f0f1a",size:r=512}={}){let n=t??e,i=r*(n.length===1?.6:n.length<=3?.42:.3);return(0,b.jsx)("div",{style:{width:r,height:r,display:"flex",alignItems:"center",justifyContent:"center",background:o},children:(0,b.jsx)("div",{style:{display:"flex",flexDirection:"row",gap:`${r*.02}px`,alignItems:"center"},children:n.split("").map((a,s)=>(0,b.jsx)("span",{style:{fontSize:i,fontWeight:900,color:"#ffffff",fontFamily:"system-ui, sans-serif",lineHeight:1},children:a},s))})})}function A(t){let{appName:e,color:o,domain:r,bg:n,logoUrl:i}=t,a=t.type??"default";return a==="icon"?(0,b.jsx)(E,{...t,appName:e,color:o,bg:n}):(0,b.jsx)(P,{appName:e,color:o,domain:r,bg:n,logoUrl:i,children:a==="match"?(0,b.jsx)(I,{...t,color:o,bg:n}):a==="square"?(0,b.jsx)(F,{...t,color:o,bg:n}):a==="article"?(0,b.jsx)(W,{...t,color:o,bg:n}):a==="stat"?(0,b.jsx)(z,{...t,color:o,bg:n}):a==="product"?(0,b.jsx)(L,{...t,color:o,bg:n}):(0,b.jsx)(R,{...t,color:o,bg:n})})}var at="https://cdn.jsdelivr.net/gh/fonts-archive/Pretendard",lt={400:"Pretendard-Regular.otf",700:"Pretendard-Bold.otf",900:"Pretendard-Black.otf"},D=new Map;function k(t){let e=D.get(t);if(e)return e;let o=fetch(t).then(r=>{if(!r.ok)throw new Error(`Font fetch failed: ${r.status} ${t}`);return r.arrayBuffer()});return D.set(t,o),o}async function j(t=[700,900]){return await Promise.all(t.map(async o=>{let r=lt[o];return{name:"Pretendard",data:await k(`${at}/${r}`),weight:o,style:"normal"}}))}async function N(t){let e=await k(t.url);return{name:t.name,data:e,weight:t.weight??400,style:t.style??"normal"}}async function H(t,e=[400,700]){let o=e.map(f=>`${f}`).join(";"),r=`https://fonts.googleapis.com/css2?family=${encodeURIComponent(t)}:wght@${o}&display=swap`,n=await fetch(r,{headers:{"User-Agent":"Mozilla/5.0"}}).then(f=>{if(!f.ok)throw new Error(`Google Fonts fetch failed: ${f.status}`);return f.text()}),i=[...n.matchAll(/src:\s*url\(([^)]+)\)\s*format\(['"]?(truetype|opentype|woff2?)['"]?\)/g)],a=[...n.matchAll(/font-weight:\s*(\d+)/g)],s=[];for(let f=0;f<i.length;f++){let c=i[f][1].replace(/['"]/g,""),u=a[f]?Number(a[f][1]):e[f]??400,m=await k(c);s.push({name:t,data:m,weight:u,style:"normal"})}if(s.length===0)throw new Error(`No fonts found for "${t}"`);return s}var st="https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg",q=new Map;function ft(t){let e=[];for(let o=0;o<t.length;o++){let r=t.codePointAt(o);r>65535&&o++,r!==65039&&e.push(r.toString(16))}return e.join("-")}async function dt(t){let e=ft(t),o=`${st}/${e}.svg`,r=q.get(o);if(r)return r;let n=fetch(o).then(async i=>i.ok?i.text():"");return q.set(o,n),n}function U(){return async(t,e)=>{if(t==="emoji"){let o=await dt(e);return o?`data:image/svg+xml;base64,${btoa(o)}`:void 0}}}function _(){let t=new Date,e=t.getFullYear(),o=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0"),n=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0");return`${e}${o}${r}${n}${i}${a}`}0&&(module.exports={OGImage,createEmojiLoader,createFaviconElement,getOGVersion,loadFont,loadGoogleFont,loadPretendard});
1
+ "use strict";var w=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var Q=(t,e)=>{for(var o in e)w(t,o,{get:e[o],enumerable:!0})},X=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Y(e))!K.call(t,n)&&n!==o&&w(t,n,{get:()=>e[n],enumerable:!(r=J(e,n))||r.enumerable});return t};var Z=t=>X(w({},"__esModule",{value:!0}),t);var ct={};Q(ct,{OGImage:()=>M,createEmojiLoader:()=>U,createFaviconElement:()=>L,getOGVersion:()=>_,loadFont:()=>N,loadGoogleFont:()=>H,loadPretendard:()=>j});module.exports=Z(ct);function S(t){let e=t.replace("#",""),o=parseInt(e.length===3?e.split("").map(r=>r+r).join(""):e,16);return{r:o>>16&255,g:o>>8&255,b:o&255}}function C(t,e){let{r:o,g:r,b:n}=S(t);return`rgba(${o},${r},${n},${e})`}function tt(t,e,o){t/=255,e/=255,o/=255;let r=Math.max(t,e,o),n=Math.min(t,e,o),i=(r+n)/2;if(r===n)return{h:0,s:0,l:i};let a=r-n,l=i>.5?a/(2-r-n):a/(r+n),f=0;return r===t?f=60*(((e-o)/a+(e<o?6:0))%6):r===e?f=60*(((o-t)/a+2)%6):f=60*(((t-e)/a+4)%6),{h:f,s:l,l:i}}function et(t,e,o){let r=(1-Math.abs(2*o-1))*e,n=r*(1-Math.abs(t/60%2-1)),i=o-r/2,a=0,l=0,f=0;return t<60?[a,l,f]=[r,n,0]:t<120?[a,l,f]=[n,r,0]:t<180?[a,l,f]=[0,r,n]:t<240?[a,l,f]=[0,n,r]:t<300?[a,l,f]=[n,0,r]:[a,l,f]=[r,0,n],{r:Math.round((a+i)*255),g:Math.round((l+i)*255),b:Math.round((f+i)*255)}}function v(t,e=45){let{r:o,g:r,b:n}=S(t),{h:i,s:a,l}=tt(o,r,n),f=(i+e)%360,{r:c,g:u,b:m}=et(f,a,l);return`rgb(${c},${u},${m})`}function G(t,e){let{r:o,g:r,b:n}=S(t),i=a=>Math.max(0,Math.min(255,a));return`rgb(${i(o+e)},${i(r+e)},${i(n+e)})`}function T(t,e=.5){let{r:o,g:r,b:n}=S(t),i=a=>Math.round(a+(255-a)*e);return`rgb(${i(o)},${i(r)},${i(n)})`}var d=require("react/jsx-runtime"),B={blend:{logoIconBg:()=>"rgba(255,255,255,0.2)",logoTextColor:"#ffffff",domainColor:"rgba(255,255,255,0.75)",dotColor:()=>"rgba(255,255,255,0.6)",baseBg:t=>T(t,.55),baseGradient:void 0},gradient:{logoIconBg:()=>"rgba(255,255,255,0.18)",logoTextColor:"rgba(255,255,255,0.95)",domainColor:"rgba(255,255,255,0.5)",dotColor:()=>"rgba(255,255,255,0.5)",baseBg:()=>"#06060a",baseGradient:void 0},dark:{logoIconBg:t=>t,logoTextColor:"#e4e4e7",domainColor:"#52525b",dotColor:t=>t,baseBg:()=>"#0a0a0c",baseGradient:"linear-gradient(180deg, #1a1a1f 0%, #0a0a0c 100%)"}};function ot({color:t}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{style:{position:"absolute",top:-500,left:-400,width:1400,height:1300,borderRadius:"50%",backgroundColor:t,opacity:.7,filter:"blur(240px)",display:"flex"}}),(0,d.jsx)("div",{style:{position:"absolute",bottom:-480,right:-380,width:1380,height:1280,borderRadius:"50%",backgroundColor:v(t,50),opacity:.65,filter:"blur(235px)",display:"flex"}}),(0,d.jsx)("div",{style:{position:"absolute",top:"20%",right:-200,width:1e3,height:900,borderRadius:"50%",backgroundColor:v(t,-50),opacity:.6,filter:"blur(220px)",display:"flex"}})]})}function rt({color:t}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{style:{position:"absolute",bottom:-180,left:-80,width:700,height:560,borderRadius:"50%",backgroundColor:t,opacity:.8,filter:"blur(130px)",display:"flex"}}),(0,d.jsx)("div",{style:{position:"absolute",top:-160,right:-60,width:580,height:480,borderRadius:"50%",backgroundColor:G(t,70),opacity:.6,filter:"blur(110px)",display:"flex"}}),(0,d.jsx)("div",{style:{position:"absolute",top:-80,left:"20%",width:340,height:260,borderRadius:"50%",backgroundColor:"#ffffff",opacity:.07,filter:"blur(70px)",display:"flex"}}),(0,d.jsx)("div",{style:{position:"absolute",bottom:-60,right:"10%",width:380,height:300,borderRadius:"50%",backgroundColor:G(t,-50),opacity:.4,filter:"blur(90px)",display:"flex"}}),(0,d.jsx)("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.52)",display:"flex"}})]})}function nt({color:t}){return(0,d.jsx)("div",{style:{position:"absolute",bottom:-200,left:"30%",width:500,height:300,borderRadius:"50%",backgroundColor:t,opacity:.08,filter:"blur(80px)",display:"flex"}})}function P({appName:t,color:e="#007B5F",domain:o,bg:r="dark",logoUrl:n,children:i}){let a=t||"m1k",l=B[r]??B.dark,f=l.logoIconBg(e),c="#ffffff",u=l.logoTextColor,m=l.domainColor,b=l.dotColor(e);return(0,d.jsxs)("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",backgroundColor:l.baseBg(e),...l.baseGradient?{background:l.baseGradient}:{},padding:"72px 80px",fontFamily:"Pretendard, system-ui, sans-serif",position:"relative",overflow:"hidden"},children:[r==="blend"?(0,d.jsx)(ot,{color:e}):r==="gradient"?(0,d.jsx)(rt,{color:e}):(0,d.jsx)(nt,{color:e}),(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:18,position:"relative",zIndex:1},children:[n?(0,d.jsx)("img",{src:n,width:52,height:52,style:{borderRadius:14,objectFit:"cover",display:"flex"}}):(0,d.jsx)("div",{style:{width:52,height:52,borderRadius:14,backgroundColor:f,display:"flex",alignItems:"center",justifyContent:"center",fontSize:24,fontWeight:900,color:c},children:a[0].toUpperCase()}),(0,d.jsx)("span",{style:{fontSize:30,fontWeight:800,color:u,letterSpacing:"-0.5px"},children:a})]}),(0,d.jsx)("div",{style:{display:"flex",flexDirection:"column",flex:1,justifyContent:"center",position:"relative",zIndex:1},children:i}),o&&(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,position:"relative",zIndex:1},children:[(0,d.jsx)("div",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:b,display:"flex"}}),(0,d.jsx)("span",{style:{fontSize:22,color:m,fontWeight:600},children:o})]})]})}var x=require("react/jsx-runtime");function it(t){let e=[],o=/\p{Extended_Pictographic}/gu,r=0;for(let i of t.matchAll(o)){let a=t.slice(r,i.index).trim();a&&e.push(a),e.push(i[0]),r=i.index+i[0].length}let n=t.slice(r).trim();return n&&e.push(n),e}function p({text:t,style:e}){let o=it(t);return o.length<=1?(0,x.jsx)("span",{style:{display:"flex",...e},children:t}):(0,x.jsx)("span",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",...e},children:o.map((r,n)=>(0,x.jsx)("span",{children:r},n))})}function h({text:t,color:e,bg:o="dark"}){let r=o==="gradient",n=o==="blend";return(0,x.jsx)("div",{style:{display:"flex"},children:(0,x.jsx)("div",{style:{display:"flex",backgroundColor:n||r?"rgba(255,255,255,0.2)":C(e,.12),borderRadius:24,paddingLeft:18,paddingRight:18,paddingTop:8,paddingBottom:8},children:(0,x.jsx)(p,{text:t,style:{fontSize:22,fontWeight:700,color:n||r?"#ffffff":e,letterSpacing:"0.2px"}})})})}var g=require("react/jsx-runtime");function R({title:t,sub:e,badge:o,color:r="#007B5F",bg:n="dark"}){let i=n==="blend";return(0,g.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[o&&(0,g.jsx)("div",{style:{display:"flex",marginBottom:20},children:(0,g.jsx)(h,{text:o,color:r,bg:n})}),(0,g.jsx)(p,{text:t,style:{fontSize:72,fontWeight:900,color:"#ffffff",letterSpacing:"-2px",lineHeight:1.1}}),e&&(0,g.jsx)(p,{text:e,style:{fontSize:34,color:n==="gradient"?"rgba(255,255,255,0.72)":i?"rgba(255,255,255,0.85)":"#a1a1aa",marginTop:22,fontWeight:500}})]})}function I({home:t,away:e,score:o,sub:r,badge:n,color:i="#007B5F",bg:a="dark"}){let l=a==="gradient",f=a==="blend",c="#ffffff",u=l?"rgba(255,255,255,0.9)":f?"rgba(255,255,255,0.85)":i,m=l?"rgba(255,255,255,0.6)":f?"rgba(255,255,255,0.9)":C(i,.6),b=l?"rgba(255,255,255,0.35)":f?C(i,.5):C(i,.35);return(0,g.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[r&&(0,g.jsx)(p,{text:r,style:{fontSize:28,color:u,fontWeight:700,marginBottom:24}}),(0,g.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:28},children:[(0,g.jsx)("span",{style:{fontSize:64,fontWeight:900,color:c,letterSpacing:"-1.5px"},children:t}),o?(0,g.jsx)("span",{style:{fontSize:48,fontWeight:900,color:m,letterSpacing:"3px"},children:o}):(0,g.jsx)("span",{style:{fontSize:36,fontWeight:700,color:b},children:"vs"}),(0,g.jsx)("span",{style:{fontSize:64,fontWeight:900,color:"#ffffff",letterSpacing:"-1.5px"},children:e})]}),n&&(0,g.jsx)("div",{style:{display:"flex",marginTop:24},children:(0,g.jsx)(h,{text:n,color:i,bg:a})})]})}function F({title:t,sub:e,badge:o,color:r="#007B5F",bg:n="dark"}){let i=n==="blend";return(0,g.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[o&&(0,g.jsx)("div",{style:{display:"flex",marginBottom:24},children:(0,g.jsx)(h,{text:o,color:r,bg:n})}),(0,g.jsx)(p,{text:t,style:{fontSize:80,fontWeight:900,color:"#ffffff",letterSpacing:"-2px",lineHeight:1.15}}),e&&(0,g.jsx)(p,{text:e,style:{fontSize:38,color:n==="gradient"?"rgba(255,255,255,0.72)":i?"rgba(255,255,255,0.85)":"#71717a",marginTop:28,fontWeight:500}})]})}var s=require("react/jsx-runtime");function E({letter:t,radius:e=96,appName:o="m1k",color:r="#007B5F",bg:n="dark",fontSize:i=240}){let l=t??(o||"m1k")[0].toUpperCase(),f=n==="gradient",c=n==="blend",u=c?T(r,.55):f?"#06060a":r,m=r,b=v(r,50),O=v(r,-50);return(0,s.jsxs)("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:u,borderRadius:e,fontFamily:"Pretendard, system-ui, sans-serif",position:"relative",overflow:"hidden"},children:[c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{style:{position:"absolute",top:-280,left:-250,width:800,height:750,borderRadius:"50%",backgroundColor:m,opacity:.62,filter:"blur(200px)",display:"flex"}}),(0,s.jsx)("div",{style:{position:"absolute",bottom:-260,right:-220,width:780,height:730,borderRadius:"50%",backgroundColor:b,opacity:.58,filter:"blur(195px)",display:"flex"}}),(0,s.jsx)("div",{style:{position:"absolute",top:"25%",right:-100,width:600,height:550,borderRadius:"50%",backgroundColor:O,opacity:.55,filter:"blur(180px)",display:"flex"}})]}):f?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{style:{position:"absolute",bottom:-100,left:-80,width:420,height:380,borderRadius:"50%",backgroundColor:r,opacity:.7,filter:"blur(100px)",display:"flex"}}),(0,s.jsx)("div",{style:{position:"absolute",top:-80,right:-60,width:350,height:320,borderRadius:"50%",backgroundColor:G(r,70),opacity:.45,filter:"blur(90px)",display:"flex"}}),(0,s.jsx)("div",{style:{position:"absolute",top:-40,left:"25%",width:200,height:150,borderRadius:"50%",backgroundColor:"#ffffff",opacity:.07,filter:"blur(60px)",display:"flex"}})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{style:{position:"absolute",top:-80,right:-80,width:300,height:300,borderRadius:"50%",backgroundColor:"#ffffff",opacity:.1,filter:"blur(80px)",display:"flex"}}),(0,s.jsx)("div",{style:{position:"absolute",bottom:-60,left:-60,width:250,height:250,borderRadius:"50%",backgroundColor:"#000000",opacity:.15,filter:"blur(60px)",display:"flex"}})]}),(0,s.jsx)("span",{style:{fontSize:i,fontWeight:900,color:"#ffffff",letterSpacing:`${(-i*.025).toFixed(1)}px`,lineHeight:1,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",...c?{textShadow:"0 2px 8px rgba(0,0,0,0.3)"}:{}},children:l})]})}var $={gradient:{muted:"rgba(255,255,255,0.55)",accent:t=>"rgba(255,255,255,0.9)",authorLetter:"#18181b",dotSep:"rgba(255,255,255,0.3)"},blend:{muted:"rgba(255,255,255,0.8)",accent:t=>"rgba(255,255,255,0.6)",authorLetter:"#000000",dotSep:"rgba(255,255,255,0.5)"},dark:{muted:"#71717a",accent:t=>t,authorLetter:"#fff",dotSep:"#3f3f46"}};function W({title:t,author:e,date:o,category:r,sub:n,color:i="#007B5F",bg:a="dark"}){let l=$[a]??$.dark,f="#ffffff",c=l.muted,u=l.accent(i),m=l.authorLetter,b=l.dotSep;return(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[r&&(0,s.jsx)("div",{style:{display:"flex",marginBottom:20},children:(0,s.jsx)(h,{text:r,color:i,bg:a})}),(0,s.jsx)(p,{text:t,style:{fontSize:64,fontWeight:900,color:f,letterSpacing:"-1.5px",lineHeight:1.15}}),n&&(0,s.jsx)(p,{text:n,style:{fontSize:30,color:c,marginTop:18,fontWeight:500}}),(e||o)&&(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,marginTop:28},children:[e&&(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,s.jsx)("div",{style:{width:32,height:32,borderRadius:"50%",backgroundColor:u,display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:800,color:m},children:e[0].toUpperCase()}),(0,s.jsx)("span",{style:{fontSize:22,color:c,fontWeight:600},children:e})]}),e&&o&&(0,s.jsx)("span",{style:{fontSize:20,color:b,display:"flex"},children:"\xB7"}),o&&(0,s.jsx)("span",{style:{fontSize:22,color:c,fontWeight:500,display:"flex"},children:o})]})]})}function z({stat:t,label:e,sub:o,badge:r,color:n="#007B5F",bg:i="dark"}){let a=i==="gradient",l=i==="blend";return(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[r&&(0,s.jsx)("div",{style:{display:"flex",marginBottom:20},children:(0,s.jsx)(h,{text:r,color:n,bg:i})}),(0,s.jsx)(p,{text:t,style:{fontSize:110,fontWeight:900,color:l||a?"#ffffff":n,letterSpacing:"-4px",lineHeight:1}}),(0,s.jsx)("div",{style:{fontSize:36,fontWeight:700,color:"#ffffff",marginTop:12,display:"flex"},children:e}),o&&(0,s.jsx)(p,{text:o,style:{fontSize:26,color:l?"rgba(255,255,255,0.8)":a?"rgba(255,255,255,0.55)":"#71717a",marginTop:14,fontWeight:500}})]})}function D({title:t,tagline:e,features:o,badge:r,color:n="#007B5F",bg:i="dark"}){let a=i==="gradient",l=i==="blend",f="#ffffff",c=a?"rgba(255,255,255,0.75)":l?"rgba(255,255,255,0.85)":"#a1a1aa",u=a?"rgba(255,255,255,0.7)":l?"rgba(255,255,255,0.8)":"#a1a1aa",m=a?"rgba(255,255,255,0.5)":l?"rgba(255,255,255,0.6)":n,b=(o??[]).slice(0,3);return(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[r&&(0,s.jsx)("div",{style:{display:"flex",marginBottom:20},children:(0,s.jsx)(h,{text:r,color:n,bg:i})}),(0,s.jsx)(p,{text:t,style:{fontSize:72,fontWeight:900,color:f,letterSpacing:"-2px",lineHeight:1.1}}),e&&(0,s.jsx)(p,{text:e,style:{fontSize:32,color:c,marginTop:16,fontWeight:500}}),b.length>0&&(0,s.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10,marginTop:24},children:b.map((O,V)=>(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,s.jsx)("div",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:m,display:"flex",flexShrink:0}}),(0,s.jsx)(p,{text:O,style:{fontSize:24,color:u,fontWeight:500}})]},V))})]})}var y=require("react/jsx-runtime");function L({text:t,appName:e="app",color:o="#0f0f1a",size:r=512,maskable:n=!1}={}){let i=t??e,a=n?r*.8:r,l=a*(i.length===1?.6:i.length<=3?.42:.3);return(0,y.jsx)("div",{style:{width:r,height:r,display:"flex",alignItems:"center",justifyContent:"center",background:o},children:(0,y.jsx)("div",{style:{display:"flex",flexDirection:"row",gap:`${a*.02}px`,alignItems:"center"},children:i.split("").map((f,c)=>(0,y.jsx)("span",{style:{fontSize:l,fontWeight:900,color:"#ffffff",fontFamily:"system-ui, sans-serif",lineHeight:1},children:f},c))})})}function M(t){let{appName:e,color:o,domain:r,bg:n,logoUrl:i}=t,a=t.type??"default";return a==="icon"?(0,y.jsx)(E,{...t,appName:e,color:o,bg:n}):(0,y.jsx)(P,{appName:e,color:o,domain:r,bg:n,logoUrl:i,children:a==="match"?(0,y.jsx)(I,{...t,color:o,bg:n}):a==="square"?(0,y.jsx)(F,{...t,color:o,bg:n}):a==="article"?(0,y.jsx)(W,{...t,color:o,bg:n}):a==="stat"?(0,y.jsx)(z,{...t,color:o,bg:n}):a==="product"?(0,y.jsx)(D,{...t,color:o,bg:n}):(0,y.jsx)(R,{...t,color:o,bg:n})})}var at="https://cdn.jsdelivr.net/gh/fonts-archive/Pretendard",lt={400:"Pretendard-Regular.otf",700:"Pretendard-Bold.otf",900:"Pretendard-Black.otf"},A=new Map;function k(t){let e=A.get(t);if(e)return e;let o=fetch(t).then(r=>{if(!r.ok)throw new Error(`Font fetch failed: ${r.status} ${t}`);return r.arrayBuffer()});return A.set(t,o),o}async function j(t=[700,900]){return await Promise.all(t.map(async o=>{let r=lt[o];return{name:"Pretendard",data:await k(`${at}/${r}`),weight:o,style:"normal"}}))}async function N(t){let e=await k(t.url);return{name:t.name,data:e,weight:t.weight??400,style:t.style??"normal"}}async function H(t,e=[400,700]){let o=e.map(f=>`${f}`).join(";"),r=`https://fonts.googleapis.com/css2?family=${encodeURIComponent(t)}:wght@${o}&display=swap`,n=await fetch(r,{headers:{"User-Agent":"Mozilla/5.0"}}).then(f=>{if(!f.ok)throw new Error(`Google Fonts fetch failed: ${f.status}`);return f.text()}),i=[...n.matchAll(/src:\s*url\(([^)]+)\)\s*format\(['"]?(truetype|opentype|woff2?)['"]?\)/g)],a=[...n.matchAll(/font-weight:\s*(\d+)/g)],l=[];for(let f=0;f<i.length;f++){let c=i[f][1].replace(/['"]/g,""),u=a[f]?Number(a[f][1]):e[f]??400,m=await k(c);l.push({name:t,data:m,weight:u,style:"normal"})}if(l.length===0)throw new Error(`No fonts found for "${t}"`);return l}var st="https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg",q=new Map;function ft(t){let e=[];for(let o=0;o<t.length;o++){let r=t.codePointAt(o);r>65535&&o++,r!==65039&&e.push(r.toString(16))}return e.join("-")}async function dt(t){let e=ft(t),o=`${st}/${e}.svg`,r=q.get(o);if(r)return r;let n=fetch(o).then(async i=>i.ok?i.text():"");return q.set(o,n),n}function U(){return async(t,e)=>{if(t==="emoji"){let o=await dt(e);return o?`data:image/svg+xml;base64,${btoa(o)}`:void 0}}}function _(){let t=new Date,e=t.getFullYear(),o=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0"),n=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0");return`${e}${o}${r}${n}${i}${a}`}0&&(module.exports={OGImage,createEmojiLoader,createFaviconElement,getOGVersion,loadFont,loadGoogleFont,loadPretendard});
package/dist/ogimage.mjs CHANGED
@@ -1 +1 @@
1
- function w(t){let r=t.replace("#",""),o=parseInt(r.length===3?r.split("").map(e=>e+e).join(""):r,16);return{r:o>>16&255,g:o>>8&255,b:o&255}}function C(t,r){let{r:o,g:e,b:n}=w(t);return`rgba(${o},${e},${n},${r})`}function _(t,r,o){t/=255,r/=255,o/=255;let e=Math.max(t,r,o),n=Math.min(t,r,o),i=(e+n)/2;if(e===n)return{h:0,s:0,l:i};let a=e-n,l=i>.5?a/(2-e-n):a/(e+n),s=0;return e===t?s=60*(((r-o)/a+(r<o?6:0))%6):e===r?s=60*(((o-t)/a+2)%6):s=60*(((t-r)/a+4)%6),{h:s,s:l,l:i}}function V(t,r,o){let e=(1-Math.abs(2*o-1))*r,n=e*(1-Math.abs(t/60%2-1)),i=o-e/2,a=0,l=0,s=0;return t<60?[a,l,s]=[e,n,0]:t<120?[a,l,s]=[n,e,0]:t<180?[a,l,s]=[0,e,n]:t<240?[a,l,s]=[0,n,e]:t<300?[a,l,s]=[n,0,e]:[a,l,s]=[e,0,n],{r:Math.round((a+i)*255),g:Math.round((l+i)*255),b:Math.round((s+i)*255)}}function G(t,r=45){let{r:o,g:e,b:n}=w(t),{h:i,s:a,l}=_(o,e,n),s=(i+r)%360,{r:d,g:u,b:m}=V(s,a,l);return`rgb(${d},${u},${m})`}function T(t,r){let{r:o,g:e,b:n}=w(t),i=a=>Math.max(0,Math.min(255,a));return`rgb(${i(o+r)},${i(e+r)},${i(n+r)})`}function k(t,r=.5){let{r:o,g:e,b:n}=w(t),i=a=>Math.round(a+(255-a)*r);return`rgb(${i(o)},${i(e)},${i(n)})`}import{Fragment as E,jsx as g,jsxs as O}from"react/jsx-runtime";var F={blend:{logoIconBg:()=>"rgba(255,255,255,0.2)",logoTextColor:"#ffffff",domainColor:"rgba(255,255,255,0.75)",dotColor:()=>"rgba(255,255,255,0.6)",baseBg:t=>k(t,.55),baseGradient:void 0},gradient:{logoIconBg:()=>"rgba(255,255,255,0.18)",logoTextColor:"rgba(255,255,255,0.95)",domainColor:"rgba(255,255,255,0.5)",dotColor:()=>"rgba(255,255,255,0.5)",baseBg:()=>"#06060a",baseGradient:void 0},dark:{logoIconBg:t=>t,logoTextColor:"#e4e4e7",domainColor:"#52525b",dotColor:t=>t,baseBg:()=>"#0a0a0c",baseGradient:"linear-gradient(180deg, #1a1a1f 0%, #0a0a0c 100%)"}};function J({color:t}){return O(E,{children:[g("div",{style:{position:"absolute",top:-500,left:-400,width:1400,height:1300,borderRadius:"50%",backgroundColor:t,opacity:.7,filter:"blur(240px)",display:"flex"}}),g("div",{style:{position:"absolute",bottom:-480,right:-380,width:1380,height:1280,borderRadius:"50%",backgroundColor:G(t,50),opacity:.65,filter:"blur(235px)",display:"flex"}}),g("div",{style:{position:"absolute",top:"20%",right:-200,width:1e3,height:900,borderRadius:"50%",backgroundColor:G(t,-50),opacity:.6,filter:"blur(220px)",display:"flex"}})]})}function Y({color:t}){return O(E,{children:[g("div",{style:{position:"absolute",bottom:-180,left:-80,width:700,height:560,borderRadius:"50%",backgroundColor:t,opacity:.8,filter:"blur(130px)",display:"flex"}}),g("div",{style:{position:"absolute",top:-160,right:-60,width:580,height:480,borderRadius:"50%",backgroundColor:T(t,70),opacity:.6,filter:"blur(110px)",display:"flex"}}),g("div",{style:{position:"absolute",top:-80,left:"20%",width:340,height:260,borderRadius:"50%",backgroundColor:"#ffffff",opacity:.07,filter:"blur(70px)",display:"flex"}}),g("div",{style:{position:"absolute",bottom:-60,right:"10%",width:380,height:300,borderRadius:"50%",backgroundColor:T(t,-50),opacity:.4,filter:"blur(90px)",display:"flex"}}),g("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.52)",display:"flex"}})]})}function K({color:t}){return g("div",{style:{position:"absolute",bottom:-200,left:"30%",width:500,height:300,borderRadius:"50%",backgroundColor:t,opacity:.08,filter:"blur(80px)",display:"flex"}})}function $({appName:t,color:r="#007B5F",domain:o,bg:e="dark",logoUrl:n,children:i}){let a=t||"m1k",l=F[e]??F.dark,s=l.logoIconBg(r),d="#ffffff",u=l.logoTextColor,m=l.domainColor,y=l.dotColor(r);return O("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",backgroundColor:l.baseBg(r),...l.baseGradient?{background:l.baseGradient}:{},padding:"72px 80px",fontFamily:"Pretendard, system-ui, sans-serif",position:"relative",overflow:"hidden"},children:[e==="blend"?g(J,{color:r}):e==="gradient"?g(Y,{color:r}):g(K,{color:r}),O("div",{style:{display:"flex",alignItems:"center",gap:18,position:"relative",zIndex:1},children:[n?g("img",{src:n,width:52,height:52,style:{borderRadius:14,objectFit:"cover",display:"flex"}}):g("div",{style:{width:52,height:52,borderRadius:14,backgroundColor:s,display:"flex",alignItems:"center",justifyContent:"center",fontSize:24,fontWeight:900,color:d},children:a[0].toUpperCase()}),g("span",{style:{fontSize:30,fontWeight:800,color:u,letterSpacing:"-0.5px"},children:a})]}),g("div",{style:{display:"flex",flexDirection:"column",flex:1,justifyContent:"center",position:"relative",zIndex:1},children:i}),o&&O("div",{style:{display:"flex",alignItems:"center",gap:10,position:"relative",zIndex:1},children:[g("div",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:y,display:"flex"}}),g("span",{style:{fontSize:22,color:m,fontWeight:600},children:o})]})]})}import{jsx as v}from"react/jsx-runtime";function Q(t){let r=[],o=/\p{Extended_Pictographic}/gu,e=0;for(let i of t.matchAll(o)){let a=t.slice(e,i.index).trim();a&&r.push(a),r.push(i[0]),e=i.index+i[0].length}let n=t.slice(e).trim();return n&&r.push(n),r}function c({text:t,style:r}){let o=Q(t);return o.length<=1?v("span",{style:{display:"flex",...r},children:t}):v("span",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",...r},children:o.map((e,n)=>v("span",{children:e},n))})}function x({text:t,color:r,bg:o="dark"}){let e=o==="gradient",n=o==="blend";return v("div",{style:{display:"flex"},children:v("div",{style:{display:"flex",backgroundColor:n||e?"rgba(255,255,255,0.2)":C(r,.12),borderRadius:24,paddingLeft:18,paddingRight:18,paddingTop:8,paddingBottom:8},children:v(c,{text:t,style:{fontSize:22,fontWeight:700,color:n||e?"#ffffff":r,letterSpacing:"0.2px"}})})})}import{Fragment as R,jsx as p,jsxs as B}from"react/jsx-runtime";function W({title:t,sub:r,badge:o,color:e="#007B5F",bg:n="dark"}){let i=n==="blend";return B(R,{children:[o&&p("div",{style:{display:"flex",marginBottom:20},children:p(x,{text:o,color:e,bg:n})}),p(c,{text:t,style:{fontSize:72,fontWeight:900,color:"#ffffff",letterSpacing:"-2px",lineHeight:1.1}}),r&&p(c,{text:r,style:{fontSize:34,color:n==="gradient"?"rgba(255,255,255,0.72)":i?"rgba(255,255,255,0.85)":"#a1a1aa",marginTop:22,fontWeight:500}})]})}function z({home:t,away:r,score:o,sub:e,badge:n,color:i="#007B5F",bg:a="dark"}){let l=a==="gradient",s=a==="blend",d="#ffffff",u=l?"rgba(255,255,255,0.9)":s?"rgba(255,255,255,0.85)":i,m=l?"rgba(255,255,255,0.6)":s?"rgba(255,255,255,0.9)":C(i,.6),y=l?"rgba(255,255,255,0.35)":s?C(i,.5):C(i,.35);return B(R,{children:[e&&p(c,{text:e,style:{fontSize:28,color:u,fontWeight:700,marginBottom:24}}),B("div",{style:{display:"flex",alignItems:"center",gap:28},children:[p("span",{style:{fontSize:64,fontWeight:900,color:d,letterSpacing:"-1.5px"},children:t}),o?p("span",{style:{fontSize:48,fontWeight:900,color:m,letterSpacing:"3px"},children:o}):p("span",{style:{fontSize:36,fontWeight:700,color:y},children:"vs"}),p("span",{style:{fontSize:64,fontWeight:900,color:"#ffffff",letterSpacing:"-1.5px"},children:r})]}),n&&p("div",{style:{display:"flex",marginTop:24},children:p(x,{text:n,color:i,bg:a})})]})}function L({title:t,sub:r,badge:o,color:e="#007B5F",bg:n="dark"}){let i=n==="blend";return B(R,{children:[o&&p("div",{style:{display:"flex",marginBottom:24},children:p(x,{text:o,color:e,bg:n})}),p(c,{text:t,style:{fontSize:80,fontWeight:900,color:"#ffffff",letterSpacing:"-2px",lineHeight:1.15}}),r&&p(c,{text:r,style:{fontSize:38,color:n==="gradient"?"rgba(255,255,255,0.72)":i?"rgba(255,255,255,0.85)":"#71717a",marginTop:28,fontWeight:500}})]})}import{Fragment as S,jsx as f,jsxs as h}from"react/jsx-runtime";function A({letter:t,radius:r=96,appName:o="m1k",color:e="#007B5F",bg:n="dark",fontSize:i=240}){let l=t??(o||"m1k")[0].toUpperCase(),s=n==="gradient",d=n==="blend",u=d?k(e,.55):s?"#06060a":e,m=e,y=G(e,50),P=G(e,-50);return h("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:u,borderRadius:r,fontFamily:"Pretendard, system-ui, sans-serif",position:"relative",overflow:"hidden"},children:[d?h(S,{children:[f("div",{style:{position:"absolute",top:-280,left:-250,width:800,height:750,borderRadius:"50%",backgroundColor:m,opacity:.62,filter:"blur(200px)",display:"flex"}}),f("div",{style:{position:"absolute",bottom:-260,right:-220,width:780,height:730,borderRadius:"50%",backgroundColor:y,opacity:.58,filter:"blur(195px)",display:"flex"}}),f("div",{style:{position:"absolute",top:"25%",right:-100,width:600,height:550,borderRadius:"50%",backgroundColor:P,opacity:.55,filter:"blur(180px)",display:"flex"}})]}):s?h(S,{children:[f("div",{style:{position:"absolute",bottom:-100,left:-80,width:420,height:380,borderRadius:"50%",backgroundColor:e,opacity:.7,filter:"blur(100px)",display:"flex"}}),f("div",{style:{position:"absolute",top:-80,right:-60,width:350,height:320,borderRadius:"50%",backgroundColor:T(e,70),opacity:.45,filter:"blur(90px)",display:"flex"}}),f("div",{style:{position:"absolute",top:-40,left:"25%",width:200,height:150,borderRadius:"50%",backgroundColor:"#ffffff",opacity:.07,filter:"blur(60px)",display:"flex"}})]}):h(S,{children:[f("div",{style:{position:"absolute",top:-80,right:-80,width:300,height:300,borderRadius:"50%",backgroundColor:"#ffffff",opacity:.1,filter:"blur(80px)",display:"flex"}}),f("div",{style:{position:"absolute",bottom:-60,left:-60,width:250,height:250,borderRadius:"50%",backgroundColor:"#000000",opacity:.15,filter:"blur(60px)",display:"flex"}})]}),f("span",{style:{fontSize:i,fontWeight:900,color:"#ffffff",letterSpacing:`${(-i*.025).toFixed(1)}px`,lineHeight:1,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",...d?{textShadow:"0 2px 8px rgba(0,0,0,0.3)"}:{}},children:l})]})}var M={gradient:{muted:"rgba(255,255,255,0.55)",accent:t=>"rgba(255,255,255,0.9)",authorLetter:"#18181b",dotSep:"rgba(255,255,255,0.3)"},blend:{muted:"rgba(255,255,255,0.8)",accent:t=>"rgba(255,255,255,0.6)",authorLetter:"#000000",dotSep:"rgba(255,255,255,0.5)"},dark:{muted:"#71717a",accent:t=>t,authorLetter:"#fff",dotSep:"#3f3f46"}};function D({title:t,author:r,date:o,category:e,sub:n,color:i="#007B5F",bg:a="dark"}){let l=M[a]??M.dark,s="#ffffff",d=l.muted,u=l.accent(i),m=l.authorLetter,y=l.dotSep;return h(S,{children:[e&&f("div",{style:{display:"flex",marginBottom:20},children:f(x,{text:e,color:i,bg:a})}),f(c,{text:t,style:{fontSize:64,fontWeight:900,color:s,letterSpacing:"-1.5px",lineHeight:1.15}}),n&&f(c,{text:n,style:{fontSize:30,color:d,marginTop:18,fontWeight:500}}),(r||o)&&h("div",{style:{display:"flex",alignItems:"center",gap:16,marginTop:28},children:[r&&h("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f("div",{style:{width:32,height:32,borderRadius:"50%",backgroundColor:u,display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:800,color:m},children:r[0].toUpperCase()}),f("span",{style:{fontSize:22,color:d,fontWeight:600},children:r})]}),r&&o&&f("span",{style:{fontSize:20,color:y,display:"flex"},children:"\xB7"}),o&&f("span",{style:{fontSize:22,color:d,fontWeight:500,display:"flex"},children:o})]})]})}function j({stat:t,label:r,sub:o,badge:e,color:n="#007B5F",bg:i="dark"}){let a=i==="gradient",l=i==="blend";return h(S,{children:[e&&f("div",{style:{display:"flex",marginBottom:20},children:f(x,{text:e,color:n,bg:i})}),f(c,{text:t,style:{fontSize:110,fontWeight:900,color:l||a?"#ffffff":n,letterSpacing:"-4px",lineHeight:1}}),f("div",{style:{fontSize:36,fontWeight:700,color:"#ffffff",marginTop:12,display:"flex"},children:r}),o&&f(c,{text:o,style:{fontSize:26,color:l?"rgba(255,255,255,0.8)":a?"rgba(255,255,255,0.55)":"#71717a",marginTop:14,fontWeight:500}})]})}function N({title:t,tagline:r,features:o,badge:e,color:n="#007B5F",bg:i="dark"}){let a=i==="gradient",l=i==="blend",s="#ffffff",d=a?"rgba(255,255,255,0.75)":l?"rgba(255,255,255,0.85)":"#a1a1aa",u=a?"rgba(255,255,255,0.7)":l?"rgba(255,255,255,0.8)":"#a1a1aa",m=a?"rgba(255,255,255,0.5)":l?"rgba(255,255,255,0.6)":n,y=(o??[]).slice(0,3);return h(S,{children:[e&&f("div",{style:{display:"flex",marginBottom:20},children:f(x,{text:e,color:n,bg:i})}),f(c,{text:t,style:{fontSize:72,fontWeight:900,color:s,letterSpacing:"-2px",lineHeight:1.1}}),r&&f(c,{text:r,style:{fontSize:32,color:d,marginTop:16,fontWeight:500}}),y.length>0&&f("div",{style:{display:"flex",flexDirection:"column",gap:10,marginTop:24},children:y.map((P,U)=>h("div",{style:{display:"flex",alignItems:"center",gap:12},children:[f("div",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:m,display:"flex",flexShrink:0}}),f(c,{text:P,style:{fontSize:24,color:u,fontWeight:500}})]},U))})]})}import{jsx as b}from"react/jsx-runtime";function X({text:t,appName:r="app",color:o="#0f0f1a",size:e=512}={}){let n=t??r,i=e*(n.length===1?.6:n.length<=3?.42:.3);return b("div",{style:{width:e,height:e,display:"flex",alignItems:"center",justifyContent:"center",background:o},children:b("div",{style:{display:"flex",flexDirection:"row",gap:`${e*.02}px`,alignItems:"center"},children:n.split("").map((a,l)=>b("span",{style:{fontSize:i,fontWeight:900,color:"#ffffff",fontFamily:"system-ui, sans-serif",lineHeight:1},children:a},l))})})}function Z(t){let{appName:r,color:o,domain:e,bg:n,logoUrl:i}=t,a=t.type??"default";return a==="icon"?b(A,{...t,appName:r,color:o,bg:n}):b($,{appName:r,color:o,domain:e,bg:n,logoUrl:i,children:a==="match"?b(z,{...t,color:o,bg:n}):a==="square"?b(L,{...t,color:o,bg:n}):a==="article"?b(D,{...t,color:o,bg:n}):a==="stat"?b(j,{...t,color:o,bg:n}):a==="product"?b(N,{...t,color:o,bg:n}):b(W,{...t,color:o,bg:n})})}var tt="https://cdn.jsdelivr.net/gh/fonts-archive/Pretendard",et={400:"Pretendard-Regular.otf",700:"Pretendard-Bold.otf",900:"Pretendard-Black.otf"},H=new Map;function I(t){let r=H.get(t);if(r)return r;let o=fetch(t).then(e=>{if(!e.ok)throw new Error(`Font fetch failed: ${e.status} ${t}`);return e.arrayBuffer()});return H.set(t,o),o}async function ot(t=[700,900]){return await Promise.all(t.map(async o=>{let e=et[o];return{name:"Pretendard",data:await I(`${tt}/${e}`),weight:o,style:"normal"}}))}async function rt(t){let r=await I(t.url);return{name:t.name,data:r,weight:t.weight??400,style:t.style??"normal"}}async function nt(t,r=[400,700]){let o=r.map(s=>`${s}`).join(";"),e=`https://fonts.googleapis.com/css2?family=${encodeURIComponent(t)}:wght@${o}&display=swap`,n=await fetch(e,{headers:{"User-Agent":"Mozilla/5.0"}}).then(s=>{if(!s.ok)throw new Error(`Google Fonts fetch failed: ${s.status}`);return s.text()}),i=[...n.matchAll(/src:\s*url\(([^)]+)\)\s*format\(['"]?(truetype|opentype|woff2?)['"]?\)/g)],a=[...n.matchAll(/font-weight:\s*(\d+)/g)],l=[];for(let s=0;s<i.length;s++){let d=i[s][1].replace(/['"]/g,""),u=a[s]?Number(a[s][1]):r[s]??400,m=await I(d);l.push({name:t,data:m,weight:u,style:"normal"})}if(l.length===0)throw new Error(`No fonts found for "${t}"`);return l}var it="https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg",q=new Map;function at(t){let r=[];for(let o=0;o<t.length;o++){let e=t.codePointAt(o);e>65535&&o++,e!==65039&&r.push(e.toString(16))}return r.join("-")}async function lt(t){let r=at(t),o=`${it}/${r}.svg`,e=q.get(o);if(e)return e;let n=fetch(o).then(async i=>i.ok?i.text():"");return q.set(o,n),n}function st(){return async(t,r)=>{if(t==="emoji"){let o=await lt(r);return o?`data:image/svg+xml;base64,${btoa(o)}`:void 0}}}function ft(){let t=new Date,r=t.getFullYear(),o=String(t.getMonth()+1).padStart(2,"0"),e=String(t.getDate()).padStart(2,"0"),n=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0");return`${r}${o}${e}${n}${i}${a}`}export{Z as OGImage,st as createEmojiLoader,X as createFaviconElement,ft as getOGVersion,rt as loadFont,nt as loadGoogleFont,ot as loadPretendard};
1
+ function O(t){let r=t.replace("#",""),o=parseInt(r.length===3?r.split("").map(e=>e+e).join(""):r,16);return{r:o>>16&255,g:o>>8&255,b:o&255}}function C(t,r){let{r:o,g:e,b:n}=O(t);return`rgba(${o},${e},${n},${r})`}function U(t,r,o){t/=255,r/=255,o/=255;let e=Math.max(t,r,o),n=Math.min(t,r,o),i=(e+n)/2;if(e===n)return{h:0,s:0,l:i};let a=e-n,l=i>.5?a/(2-e-n):a/(e+n),s=0;return e===t?s=60*(((r-o)/a+(r<o?6:0))%6):e===r?s=60*(((o-t)/a+2)%6):s=60*(((t-r)/a+4)%6),{h:s,s:l,l:i}}function _(t,r,o){let e=(1-Math.abs(2*o-1))*r,n=e*(1-Math.abs(t/60%2-1)),i=o-e/2,a=0,l=0,s=0;return t<60?[a,l,s]=[e,n,0]:t<120?[a,l,s]=[n,e,0]:t<180?[a,l,s]=[0,e,n]:t<240?[a,l,s]=[0,n,e]:t<300?[a,l,s]=[n,0,e]:[a,l,s]=[e,0,n],{r:Math.round((a+i)*255),g:Math.round((l+i)*255),b:Math.round((s+i)*255)}}function v(t,r=45){let{r:o,g:e,b:n}=O(t),{h:i,s:a,l}=U(o,e,n),s=(i+r)%360,{r:d,g:u,b:m}=_(s,a,l);return`rgb(${d},${u},${m})`}function S(t,r){let{r:o,g:e,b:n}=O(t),i=a=>Math.max(0,Math.min(255,a));return`rgb(${i(o+r)},${i(e+r)},${i(n+r)})`}function w(t,r=.5){let{r:o,g:e,b:n}=O(t),i=a=>Math.round(a+(255-a)*r);return`rgb(${i(o)},${i(e)},${i(n)})`}import{Fragment as $,jsx as c,jsxs as T}from"react/jsx-runtime";var I={blend:{logoIconBg:()=>"rgba(255,255,255,0.2)",logoTextColor:"#ffffff",domainColor:"rgba(255,255,255,0.75)",dotColor:()=>"rgba(255,255,255,0.6)",baseBg:t=>w(t,.55),baseGradient:void 0},gradient:{logoIconBg:()=>"rgba(255,255,255,0.18)",logoTextColor:"rgba(255,255,255,0.95)",domainColor:"rgba(255,255,255,0.5)",dotColor:()=>"rgba(255,255,255,0.5)",baseBg:()=>"#06060a",baseGradient:void 0},dark:{logoIconBg:t=>t,logoTextColor:"#e4e4e7",domainColor:"#52525b",dotColor:t=>t,baseBg:()=>"#0a0a0c",baseGradient:"linear-gradient(180deg, #1a1a1f 0%, #0a0a0c 100%)"}};function V({color:t}){return T($,{children:[c("div",{style:{position:"absolute",top:-500,left:-400,width:1400,height:1300,borderRadius:"50%",backgroundColor:t,opacity:.7,filter:"blur(240px)",display:"flex"}}),c("div",{style:{position:"absolute",bottom:-480,right:-380,width:1380,height:1280,borderRadius:"50%",backgroundColor:v(t,50),opacity:.65,filter:"blur(235px)",display:"flex"}}),c("div",{style:{position:"absolute",top:"20%",right:-200,width:1e3,height:900,borderRadius:"50%",backgroundColor:v(t,-50),opacity:.6,filter:"blur(220px)",display:"flex"}})]})}function J({color:t}){return T($,{children:[c("div",{style:{position:"absolute",bottom:-180,left:-80,width:700,height:560,borderRadius:"50%",backgroundColor:t,opacity:.8,filter:"blur(130px)",display:"flex"}}),c("div",{style:{position:"absolute",top:-160,right:-60,width:580,height:480,borderRadius:"50%",backgroundColor:S(t,70),opacity:.6,filter:"blur(110px)",display:"flex"}}),c("div",{style:{position:"absolute",top:-80,left:"20%",width:340,height:260,borderRadius:"50%",backgroundColor:"#ffffff",opacity:.07,filter:"blur(70px)",display:"flex"}}),c("div",{style:{position:"absolute",bottom:-60,right:"10%",width:380,height:300,borderRadius:"50%",backgroundColor:S(t,-50),opacity:.4,filter:"blur(90px)",display:"flex"}}),c("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.52)",display:"flex"}})]})}function Y({color:t}){return c("div",{style:{position:"absolute",bottom:-200,left:"30%",width:500,height:300,borderRadius:"50%",backgroundColor:t,opacity:.08,filter:"blur(80px)",display:"flex"}})}function F({appName:t,color:r="#007B5F",domain:o,bg:e="dark",logoUrl:n,children:i}){let a=t||"m1k",l=I[e]??I.dark,s=l.logoIconBg(r),d="#ffffff",u=l.logoTextColor,m=l.domainColor,b=l.dotColor(r);return T("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",backgroundColor:l.baseBg(r),...l.baseGradient?{background:l.baseGradient}:{},padding:"72px 80px",fontFamily:"Pretendard, system-ui, sans-serif",position:"relative",overflow:"hidden"},children:[e==="blend"?c(V,{color:r}):e==="gradient"?c(J,{color:r}):c(Y,{color:r}),T("div",{style:{display:"flex",alignItems:"center",gap:18,position:"relative",zIndex:1},children:[n?c("img",{src:n,width:52,height:52,style:{borderRadius:14,objectFit:"cover",display:"flex"}}):c("div",{style:{width:52,height:52,borderRadius:14,backgroundColor:s,display:"flex",alignItems:"center",justifyContent:"center",fontSize:24,fontWeight:900,color:d},children:a[0].toUpperCase()}),c("span",{style:{fontSize:30,fontWeight:800,color:u,letterSpacing:"-0.5px"},children:a})]}),c("div",{style:{display:"flex",flexDirection:"column",flex:1,justifyContent:"center",position:"relative",zIndex:1},children:i}),o&&T("div",{style:{display:"flex",alignItems:"center",gap:10,position:"relative",zIndex:1},children:[c("div",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:b,display:"flex"}}),c("span",{style:{fontSize:22,color:m,fontWeight:600},children:o})]})]})}import{jsx as G}from"react/jsx-runtime";function K(t){let r=[],o=/\p{Extended_Pictographic}/gu,e=0;for(let i of t.matchAll(o)){let a=t.slice(e,i.index).trim();a&&r.push(a),r.push(i[0]),e=i.index+i[0].length}let n=t.slice(e).trim();return n&&r.push(n),r}function g({text:t,style:r}){let o=K(t);return o.length<=1?G("span",{style:{display:"flex",...r},children:t}):G("span",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",...r},children:o.map((e,n)=>G("span",{children:e},n))})}function x({text:t,color:r,bg:o="dark"}){let e=o==="gradient",n=o==="blend";return G("div",{style:{display:"flex"},children:G("div",{style:{display:"flex",backgroundColor:n||e?"rgba(255,255,255,0.2)":C(r,.12),borderRadius:24,paddingLeft:18,paddingRight:18,paddingTop:8,paddingBottom:8},children:G(g,{text:t,style:{fontSize:22,fontWeight:700,color:n||e?"#ffffff":r,letterSpacing:"0.2px"}})})})}import{jsx as p,jsxs as k}from"react/jsx-runtime";function E({title:t,sub:r,badge:o,color:e="#007B5F",bg:n="dark"}){let i=n==="blend";return k("div",{style:{display:"flex",flexDirection:"column"},children:[o&&p("div",{style:{display:"flex",marginBottom:20},children:p(x,{text:o,color:e,bg:n})}),p(g,{text:t,style:{fontSize:72,fontWeight:900,color:"#ffffff",letterSpacing:"-2px",lineHeight:1.1}}),r&&p(g,{text:r,style:{fontSize:34,color:n==="gradient"?"rgba(255,255,255,0.72)":i?"rgba(255,255,255,0.85)":"#a1a1aa",marginTop:22,fontWeight:500}})]})}function W({home:t,away:r,score:o,sub:e,badge:n,color:i="#007B5F",bg:a="dark"}){let l=a==="gradient",s=a==="blend",d="#ffffff",u=l?"rgba(255,255,255,0.9)":s?"rgba(255,255,255,0.85)":i,m=l?"rgba(255,255,255,0.6)":s?"rgba(255,255,255,0.9)":C(i,.6),b=l?"rgba(255,255,255,0.35)":s?C(i,.5):C(i,.35);return k("div",{style:{display:"flex",flexDirection:"column"},children:[e&&p(g,{text:e,style:{fontSize:28,color:u,fontWeight:700,marginBottom:24}}),k("div",{style:{display:"flex",alignItems:"center",gap:28},children:[p("span",{style:{fontSize:64,fontWeight:900,color:d,letterSpacing:"-1.5px"},children:t}),o?p("span",{style:{fontSize:48,fontWeight:900,color:m,letterSpacing:"3px"},children:o}):p("span",{style:{fontSize:36,fontWeight:700,color:b},children:"vs"}),p("span",{style:{fontSize:64,fontWeight:900,color:"#ffffff",letterSpacing:"-1.5px"},children:r})]}),n&&p("div",{style:{display:"flex",marginTop:24},children:p(x,{text:n,color:i,bg:a})})]})}function z({title:t,sub:r,badge:o,color:e="#007B5F",bg:n="dark"}){let i=n==="blend";return k("div",{style:{display:"flex",flexDirection:"column"},children:[o&&p("div",{style:{display:"flex",marginBottom:24},children:p(x,{text:o,color:e,bg:n})}),p(g,{text:t,style:{fontSize:80,fontWeight:900,color:"#ffffff",letterSpacing:"-2px",lineHeight:1.15}}),r&&p(g,{text:r,style:{fontSize:38,color:n==="gradient"?"rgba(255,255,255,0.72)":i?"rgba(255,255,255,0.85)":"#71717a",marginTop:28,fontWeight:500}})]})}import{Fragment as P,jsx as f,jsxs as h}from"react/jsx-runtime";function L({letter:t,radius:r=96,appName:o="m1k",color:e="#007B5F",bg:n="dark",fontSize:i=240}){let l=t??(o||"m1k")[0].toUpperCase(),s=n==="gradient",d=n==="blend",u=d?w(e,.55):s?"#06060a":e,m=e,b=v(e,50),B=v(e,-50);return h("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:u,borderRadius:r,fontFamily:"Pretendard, system-ui, sans-serif",position:"relative",overflow:"hidden"},children:[d?h(P,{children:[f("div",{style:{position:"absolute",top:-280,left:-250,width:800,height:750,borderRadius:"50%",backgroundColor:m,opacity:.62,filter:"blur(200px)",display:"flex"}}),f("div",{style:{position:"absolute",bottom:-260,right:-220,width:780,height:730,borderRadius:"50%",backgroundColor:b,opacity:.58,filter:"blur(195px)",display:"flex"}}),f("div",{style:{position:"absolute",top:"25%",right:-100,width:600,height:550,borderRadius:"50%",backgroundColor:B,opacity:.55,filter:"blur(180px)",display:"flex"}})]}):s?h(P,{children:[f("div",{style:{position:"absolute",bottom:-100,left:-80,width:420,height:380,borderRadius:"50%",backgroundColor:e,opacity:.7,filter:"blur(100px)",display:"flex"}}),f("div",{style:{position:"absolute",top:-80,right:-60,width:350,height:320,borderRadius:"50%",backgroundColor:S(e,70),opacity:.45,filter:"blur(90px)",display:"flex"}}),f("div",{style:{position:"absolute",top:-40,left:"25%",width:200,height:150,borderRadius:"50%",backgroundColor:"#ffffff",opacity:.07,filter:"blur(60px)",display:"flex"}})]}):h(P,{children:[f("div",{style:{position:"absolute",top:-80,right:-80,width:300,height:300,borderRadius:"50%",backgroundColor:"#ffffff",opacity:.1,filter:"blur(80px)",display:"flex"}}),f("div",{style:{position:"absolute",bottom:-60,left:-60,width:250,height:250,borderRadius:"50%",backgroundColor:"#000000",opacity:.15,filter:"blur(60px)",display:"flex"}})]}),f("span",{style:{fontSize:i,fontWeight:900,color:"#ffffff",letterSpacing:`${(-i*.025).toFixed(1)}px`,lineHeight:1,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",...d?{textShadow:"0 2px 8px rgba(0,0,0,0.3)"}:{}},children:l})]})}var D={gradient:{muted:"rgba(255,255,255,0.55)",accent:t=>"rgba(255,255,255,0.9)",authorLetter:"#18181b",dotSep:"rgba(255,255,255,0.3)"},blend:{muted:"rgba(255,255,255,0.8)",accent:t=>"rgba(255,255,255,0.6)",authorLetter:"#000000",dotSep:"rgba(255,255,255,0.5)"},dark:{muted:"#71717a",accent:t=>t,authorLetter:"#fff",dotSep:"#3f3f46"}};function M({title:t,author:r,date:o,category:e,sub:n,color:i="#007B5F",bg:a="dark"}){let l=D[a]??D.dark,s="#ffffff",d=l.muted,u=l.accent(i),m=l.authorLetter,b=l.dotSep;return h("div",{style:{display:"flex",flexDirection:"column"},children:[e&&f("div",{style:{display:"flex",marginBottom:20},children:f(x,{text:e,color:i,bg:a})}),f(g,{text:t,style:{fontSize:64,fontWeight:900,color:s,letterSpacing:"-1.5px",lineHeight:1.15}}),n&&f(g,{text:n,style:{fontSize:30,color:d,marginTop:18,fontWeight:500}}),(r||o)&&h("div",{style:{display:"flex",alignItems:"center",gap:16,marginTop:28},children:[r&&h("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f("div",{style:{width:32,height:32,borderRadius:"50%",backgroundColor:u,display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:800,color:m},children:r[0].toUpperCase()}),f("span",{style:{fontSize:22,color:d,fontWeight:600},children:r})]}),r&&o&&f("span",{style:{fontSize:20,color:b,display:"flex"},children:"\xB7"}),o&&f("span",{style:{fontSize:22,color:d,fontWeight:500,display:"flex"},children:o})]})]})}function A({stat:t,label:r,sub:o,badge:e,color:n="#007B5F",bg:i="dark"}){let a=i==="gradient",l=i==="blend";return h("div",{style:{display:"flex",flexDirection:"column"},children:[e&&f("div",{style:{display:"flex",marginBottom:20},children:f(x,{text:e,color:n,bg:i})}),f(g,{text:t,style:{fontSize:110,fontWeight:900,color:l||a?"#ffffff":n,letterSpacing:"-4px",lineHeight:1}}),f("div",{style:{fontSize:36,fontWeight:700,color:"#ffffff",marginTop:12,display:"flex"},children:r}),o&&f(g,{text:o,style:{fontSize:26,color:l?"rgba(255,255,255,0.8)":a?"rgba(255,255,255,0.55)":"#71717a",marginTop:14,fontWeight:500}})]})}function j({title:t,tagline:r,features:o,badge:e,color:n="#007B5F",bg:i="dark"}){let a=i==="gradient",l=i==="blend",s="#ffffff",d=a?"rgba(255,255,255,0.75)":l?"rgba(255,255,255,0.85)":"#a1a1aa",u=a?"rgba(255,255,255,0.7)":l?"rgba(255,255,255,0.8)":"#a1a1aa",m=a?"rgba(255,255,255,0.5)":l?"rgba(255,255,255,0.6)":n,b=(o??[]).slice(0,3);return h("div",{style:{display:"flex",flexDirection:"column"},children:[e&&f("div",{style:{display:"flex",marginBottom:20},children:f(x,{text:e,color:n,bg:i})}),f(g,{text:t,style:{fontSize:72,fontWeight:900,color:s,letterSpacing:"-2px",lineHeight:1.1}}),r&&f(g,{text:r,style:{fontSize:32,color:d,marginTop:16,fontWeight:500}}),b.length>0&&f("div",{style:{display:"flex",flexDirection:"column",gap:10,marginTop:24},children:b.map((B,q)=>h("div",{style:{display:"flex",alignItems:"center",gap:12},children:[f("div",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:m,display:"flex",flexShrink:0}}),f(g,{text:B,style:{fontSize:24,color:u,fontWeight:500}})]},q))})]})}import{jsx as y}from"react/jsx-runtime";function Q({text:t,appName:r="app",color:o="#0f0f1a",size:e=512,maskable:n=!1}={}){let i=t??r,a=n?e*.8:e,l=a*(i.length===1?.6:i.length<=3?.42:.3);return y("div",{style:{width:e,height:e,display:"flex",alignItems:"center",justifyContent:"center",background:o},children:y("div",{style:{display:"flex",flexDirection:"row",gap:`${a*.02}px`,alignItems:"center"},children:i.split("").map((s,d)=>y("span",{style:{fontSize:l,fontWeight:900,color:"#ffffff",fontFamily:"system-ui, sans-serif",lineHeight:1},children:s},d))})})}function X(t){let{appName:r,color:o,domain:e,bg:n,logoUrl:i}=t,a=t.type??"default";return a==="icon"?y(L,{...t,appName:r,color:o,bg:n}):y(F,{appName:r,color:o,domain:e,bg:n,logoUrl:i,children:a==="match"?y(W,{...t,color:o,bg:n}):a==="square"?y(z,{...t,color:o,bg:n}):a==="article"?y(M,{...t,color:o,bg:n}):a==="stat"?y(A,{...t,color:o,bg:n}):a==="product"?y(j,{...t,color:o,bg:n}):y(E,{...t,color:o,bg:n})})}var Z="https://cdn.jsdelivr.net/gh/fonts-archive/Pretendard",tt={400:"Pretendard-Regular.otf",700:"Pretendard-Bold.otf",900:"Pretendard-Black.otf"},N=new Map;function R(t){let r=N.get(t);if(r)return r;let o=fetch(t).then(e=>{if(!e.ok)throw new Error(`Font fetch failed: ${e.status} ${t}`);return e.arrayBuffer()});return N.set(t,o),o}async function et(t=[700,900]){return await Promise.all(t.map(async o=>{let e=tt[o];return{name:"Pretendard",data:await R(`${Z}/${e}`),weight:o,style:"normal"}}))}async function ot(t){let r=await R(t.url);return{name:t.name,data:r,weight:t.weight??400,style:t.style??"normal"}}async function rt(t,r=[400,700]){let o=r.map(s=>`${s}`).join(";"),e=`https://fonts.googleapis.com/css2?family=${encodeURIComponent(t)}:wght@${o}&display=swap`,n=await fetch(e,{headers:{"User-Agent":"Mozilla/5.0"}}).then(s=>{if(!s.ok)throw new Error(`Google Fonts fetch failed: ${s.status}`);return s.text()}),i=[...n.matchAll(/src:\s*url\(([^)]+)\)\s*format\(['"]?(truetype|opentype|woff2?)['"]?\)/g)],a=[...n.matchAll(/font-weight:\s*(\d+)/g)],l=[];for(let s=0;s<i.length;s++){let d=i[s][1].replace(/['"]/g,""),u=a[s]?Number(a[s][1]):r[s]??400,m=await R(d);l.push({name:t,data:m,weight:u,style:"normal"})}if(l.length===0)throw new Error(`No fonts found for "${t}"`);return l}var nt="https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg",H=new Map;function it(t){let r=[];for(let o=0;o<t.length;o++){let e=t.codePointAt(o);e>65535&&o++,e!==65039&&r.push(e.toString(16))}return r.join("-")}async function at(t){let r=it(t),o=`${nt}/${r}.svg`,e=H.get(o);if(e)return e;let n=fetch(o).then(async i=>i.ok?i.text():"");return H.set(o,n),n}function lt(){return async(t,r)=>{if(t==="emoji"){let o=await at(r);return o?`data:image/svg+xml;base64,${btoa(o)}`:void 0}}}function st(){let t=new Date,r=t.getFullYear(),o=String(t.getMonth()+1).padStart(2,"0"),e=String(t.getDate()).padStart(2,"0"),n=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0");return`${r}${o}${e}${n}${i}${a}`}export{X as OGImage,lt as createEmojiLoader,Q as createFaviconElement,st as getOGVersion,ot as loadFont,rt as loadGoogleFont,et as loadPretendard};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m1kapp/kit",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
4
4
  "description": "UI, SEO, and PWA utilities for side projects",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",