1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1584,87489],{1584:(e,t,r)=>{r.r(t),r.d(t,{EditTextInImageWorkbench:()=>Z});var a=r(60390),n=r(6166),i=r(62310),s=r(28555),l=r.n(s),o=r(90139),d=r(71631),c=r(37652),u=r(84492),m=r(36719),h=r(78451),g=r(47604),x=r(16752),p=r(11830),f=r(85204);function b(e){return!!e&&"object"==typeof e&&[e.x,e.y,e.width,e.height].every(Number.isFinite)&&e.x>=0&&e.y>=0&&e.width>0&&e.height>0&&e.x+e.width<=1&&e.y+e.height<=1}function w(e){return new Promise((t,r)=>{let a=new Image;a.crossOrigin="anonymous",a.onload=()=>t(a),a.onerror=()=>r(Error("Could not load the image for the boxed edit.")),a.src=e})}async function v(e,t,r){let[a,n]=await Promise.all([w(e),w(t)]),i=function(e,t,r){if(!b(r))throw Error("Select an edit box first.");let a=e.naturalWidth,n=e.naturalHeight,i=Math.ceil(r.x*a),s=Math.ceil(r.y*n),l=Math.floor((r.x+r.width)*a),o=Math.floor((r.y+r.height)*n);if(!a||!n||l<=i||o<=s)throw Error("Select a larger edit box.");let d=document.createElement("canvas");d.width=a,d.height=n;let c=d.getContext("2d"),u=document.createElement("canvas");u.width=l-i,u.height=o-s;let m=u.getContext("2d");if(!c||!m)throw Error("Could not prepare the edited image.");return c.drawImage(e,0,0),m.drawImage(t,i/a*t.naturalWidth,s/n*t.naturalHeight,u.width/a*t.naturalWidth,u.height/n*t.naturalHeight,0,0,u.width,u.height),c.putImageData(m.getImageData(0,0,u.width,u.height),i,s),d}(a,n,r);return new Promise((e,t)=>{i.toBlob(r=>r?e(r):t(Error("Could not export the edited image.")),"image/png")})}function y(e){let t,r,s,l,o,d,c,u,m,h,g,x,p,f=(0,n.c)(31),{src:w,box:v,disabled:y,onChange:N}=e,k=(0,i.useRef)(null),C=j;f[0]!==y||f[1]!==N?(t=e=>{if(y||!k.current)return;let t=C(e),r={x:Math.min(k.current.x,t.x),y:Math.min(k.current.y,t.y),width:Math.abs(t.x-k.current.x),height:Math.abs(t.y-k.current.y)};b(r)&&N(r)},f[0]=y,f[1]=N,f[2]=t):t=f[2];let I=t;return f[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)("legend",{className:"text-xs font-semibold",children:"Edit box"}),s=(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:"Drag around the text. Only pixels inside this box will change."}),f[3]=r,f[4]=s):(r=f[3],s=f[4]),f[5]!==y?(l=e=>{y||0!==e.button||(e.currentTarget.setPointerCapture(e.pointerId),k.current=C(e))},f[5]=y,f[6]=l):l=f[6],f[7]!==I?(o=e=>{I(e),k.current=null},f[7]=I,f[8]=o):o=f[8],f[9]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{k.current=null},c=()=>{k.current=null},f[9]=d,f[10]=c):(d=f[9],c=f[10]),f[11]!==w?(u=(0,a.jsx)("img",{src:w,alt:"Select the text area to edit",draggable:!1,className:"block h-auto w-full select-none"}),f[11]=w,f[12]=u):u=f[12],f[13]!==v?(m=v&&(0,a.jsx)("div",{className:"pointer-events-none absolute border-2 border-white bg-white/10 outline outline-1 outline-black",style:{left:"".concat(100*v.x,"%"),top:"".concat(100*v.y,"%"),width:"".concat(100*v.width,"%"),height:"".concat(100*v.height,"%")}}),f[13]=v,f[14]=m):m=f[14],f[15]!==I||f[16]!==l||f[17]!==o||f[18]!==u||f[19]!==m?(h=(0,a.jsxs)("div",{className:"relative touch-none overflow-hidden rounded-lg",onPointerDown:l,onPointerMove:I,onPointerUp:o,onPointerCancel:d,onLostPointerCapture:c,children:[u,m]}),f[15]=I,f[16]=l,f[17]=o,f[18]=u,f[19]=m,f[20]=h):h=f[20],f[21]!==N?(g=(0,a.jsx)("button",{type:"button",className:"text-primary text-xs underline",onClick:()=>N({x:.25,y:.25,width:.5,height:.5}),children:"Start with a centered box"}),f[21]=N,f[22]=g):g=f[22],f[23]!==v||f[24]!==N?(x=v&&(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:["x","y","width","height"].map(e=>(0,a.jsxs)("label",{className:"text-xs",children:[{x:"Left",y:"Top",width:"Width",height:"Height"}[e]," ","(%)",(0,a.jsx)("input",{type:"number",min:0,max:100,step:.1,value:Math.round(1e3*v[e])/10,className:"border-border bg-background mt-1 w-full rounded border p-1",onChange:t=>{let r={...v,[e]:Number(t.target.value)/100};b(r)&&N(r)}})]},e))}),f[23]=v,f[24]=N,f[25]=x):x=f[25],f[26]!==y||f[27]!==h||f[28]!==g||f[29]!==x?(p=(0,a.jsxs)("fieldset",{disabled:y,className:"space-y-2",children:[r,s,h,g,x]}),f[26]=y,f[27]=h,f[28]=g,f[29]=x,f[30]=p):p=f[30],p}function j(e){let t=e.currentTarget.getBoundingClientRect();return{x:Math.max(0,Math.min(1,(e.clientX-t.left)/t.width)),y:Math.max(0,Math.min(1,(e.clientY-t.top)/t.height))}}
1var N=r(45938),k=r(55271),C=r(77685),I=r(73343),S=r(38390),_=r(47991),T=r(11020),U=r(5519);let P=["image/jpeg","image/jpg","image/png","image/webp"],A=["replace","add","remove"],E=[{value:"replace",label:"Replace text",hint:"Swap existing wording for new wording in the same spot",needsNewText:!0},{value:"add",label:"Add text",hint:"Write new wording into an open area of the image",needsNewText:!0},{value:"remove",label:"Remove text",hint:"Erase wording and rebuild the background behind it",needsNewText:!1}];function R(e){return"remove"!==e}let D=["match","bold","minimal","handwritten","elegant"],L=[{value:"match",label:"Match the image",hint:"Copy the original font, weight, color, and lighting"},{value:"bold",label:"Bold",hint:"Heavy, high-contrast sans-serif"},{value:"minimal",label:"Minimal",hint:"Thin, clean sans-serif"},{value:"handwritten",label:"Handwritten",hint:"Relaxed script that fits the scene"},{value:"elegant",label:"Elegant",hint:"Refined serif with fine detail"}];Object.freeze({currency:"USD",lastReviewedAt:"2026-09-19",paymentFeeRate:.05,marginFloor:.3,providerCost:.06,source:"https://kie.ai/gpt-image-2-5"});let M={uploadFirst:"Upload a JPG, PNG, or WebP image with text first.",uploading:"Wait for the upload to finish.",uploadFailed:"Upload failed. Replace the file and try again.",invalidDimensions:"Use an image between 256 and 4,096 pixels on each side and n
1o more than 16 megapixels.",unreadableDimensions:"Could not read valid source image dimensions.",missingNewText:"Type the exact wording you want the image to show.",missingTargetText:"Describe which existing wording to change, or switch to Add text.",submitUncertain:"The request could not be confirmed. Recover this task instead of starting a new one.",pollPaused:"Status checks paused. Your paid task was not restarted; open My Creations for the result.",providerFailed:"The text edit failed. Your balance has been refreshed. Try again with a clearer source image.",downloadFailed:"Could not download the edited image.",rejected:"This request was rejected before any credits were reserved. Check the file and wording and try again.",rights:"I own this image or have permission to edit it, and I will not use this to create deceptive or misleading content."};function O(e){return e.replace(/\s+/g," ").trim()}let W=/^[a-zA-Z0-9_-]{16,100}$/;function q(e){return"string"==typeof e&&W.test(e)}function z(e){let t="".concat("txtedit_").concat(e);if(!q(t))throw Error("invalid edit text request identity");return t}function G(e,t){return{...e,accountId:t}}class B extends Error{constructor(...e){super(...e),this.safeToRetry=!0}}var F=r(73471),J=r(34084);let H={tool_slug:"edit-text-in-image",mode:"edit-text"},$=[{id:"coffee-sign",title:"Replacing the wording on a caf\xe9 sign",before:"/imgs/tools/edit-text-in-image/coffee-sign-before.png",after:"/imgs/tools/edit-text-in-image/coffee-sign-after.png",beforeAlt:"Concept photograph of a wooden caf\xe9 sign reading DAILY GRIND in painted capital letters",afterAlt:"The same caf\xe9 sign after its lettering is replaced with SLOW ROAST in the matching painted style",body:"The clean case: a short, high-contrast phrase on a simple background. Check that the new capitals match the original stroke weight, spacing, and paint texture, that the sign board and its light are untouched, and that the old wording leaves no ghost outline behind.",settings:"Replace \xb7 match the image \xb7 1K render \xb7 20 credits",provenance:"Concept example generated for this page; not a measured customer result from IMG AI."},{id:"product-label",title:"Updating text on a product label",before:"/imgs/tools/edit-text-in-image/product-label-before.png",after:"/imgs/tools/edit-text-in-image/product-label-after.png",beforeAlt:"Concept product photograph of a matte bottle label with printed product text and a small ingredient list",afterAlt:"The same bottle label after one line of text is changed while the rest of the label and lighting stay the same",body:"Labels combine several type sizes on one surface, so name exactly which line changes and inspect the small print closely. The editor aims to keep the untouched lines, borders, and icons identical, and to wrap the new text within the label instead of spilling over its edge.",settings:"Replace \xb7 match the image \xb7 other lines preserved",provenance:"Concept example generated for this page; not a measured customer result from IMG AI."},{id:"travel-poster",title:"Adding a line of text to a travel photo",before:"/imgs/tools/edit-text-in-image/travel-poster-before.png",after:"/imgs/tools/edit-text-in-image/travel-poster-after.png",beforeAlt:"Concept travel photograph of a coastal town street at golden hour with an empty sky area",afterAlt:"The same travel photograph after a short headline is added naturally into the open sky area",body:"Adding text is about placement and perspective. The editor puts the new wording in an open area and matches the scene lighting, so it does not sit flat on top of the photo. Check that the placement reads naturally and that no other part of the scene was altered to make room.",settings:"Add \xb7 match the image \xb7 framing preserved",provenance:"Concept example generated for this page; not a measured customer result from IMG AI."}].map(e=>({src:e.after,alt:e.afterAlt}));function V(e){return new Promise((t,r)=>{let a=new window.Image;a.onload=()=>t({width:a.naturalWidth,height:a.naturalHeight}),a.onerror=()=>r(Error(M.unreadableDimensions)),a.src=e})}function Y(e){let t,r,i,s,l,o,d,c,u,m=(0,n.c)(22),{original:h,edited:g,originalAlt:x,editedAlt:p,position:f,onPositionChange:b}=e;m[0]!==h||m[1]!==x?(t=(0,a.jsx)("img",{src:h,alt:x,className:"absolute inset-0 h-full w-full object-contain"}),m[0]=h,m[1]=x,m[2]=t):t=m[2];let w="inset(0 ".concat(100-f,"% 0 0)");return m[3]!==w?(r={clipPath:w},m[3]=w,m[4]=r):r=m[4],m[5]!==g||m[6]!==p?(i=(0,a.jsx)("img",{src:g,alt:p,className:"absolute inset-0 h-full w-full object-contain"}),m[5]=g,m[6]=p,m[7]=i):i=m[7],m[8]!==r||m[9]!==i?(s=(0,a.jsx)("div",{className:"absolute inset-0 overflow-hidden border-r border-white/80",style:r,children:i}),m[8]=r,m[9]=i,m[10]=s):s=m[10],m[11]!==b?(l=e=>b(Number(e.target.value)),m[11]=b,m[12]=l):l=m[12],m[13]!==f||m[14]!==l?(o=(0,a.jsx)("input",{"aria-label":"Compare the original image and the edited text result",type:"range",min:"5",max:"95",value:f,onChange:l,className:"absolute inset-0 z-20 h-full w-full cursor-ew-resize opacity-0 focus-visible:opacity-100 focus-visible:outline-2 focus-visible:outline-offset-[-4px]"}),m[13]=f,m[14]=l,m[15]=o):o=m[15],m[16]===Symbol.for("react.memo_cache_sentinel")?(d=(0,a.jsx)("span",{className:"absolute bottom-3 left-3 rounded bg-black/75 px-2 py-1 text-[10px] font-semibold tracking-widest text-white uppercase",children:"Edited"}),c=(0,a.jsx)("span",{className:"absolute right-3 bottom-3 rounded bg-black/75 px-2 py-1 text-[10px] font-semibold tracking-widest text-white uppercase",children:"Original"}),m[16]=d,m[17]=c):(d=m[16],c=m[17]),m[18]!==t||m[19]!==s||m[20]!==o?(u=(0,a.jsxs)("div",{className:"relative aspect-[4/3] w-full overflow-hidden rounded-xl bg-black",children:[t,s,o,d,c]}),m[18]=t,m[19]=s,m[20]=o,m[21]=u):u=m[21],u}async function K(e,t){let r=await fetch("/api/ai/edit-text/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:t?AbortSignal.any([t,AbortSignal.timeout(2e4)]):AbortSignal.timeout(2e4)});if(!r.ok)throw Error(M.submitUncertain);let a=await r.json();if(0!==a.code){var n;let e=a.message||M.rejected;if((null==(n=a.data)?void 0:n.acceptance)==="rejected")throw new B(e);throw Error(e)}let i=a.data;if(!(null==i?void 0:i.id))throw Error(M.submitUncertain);return i}async function X(e,t){let r=await fetch("/api/ai/query",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e}),signal:t?AbortSignal.any([t,AbortSignal.timeout(2e4)]):AbortSignal.timeout(2e4)});if(!r.ok)throw Error("Request failed with status ".concat(r.status));let a=await r.json();if(0!==a.code||!a.data)throw Error(a.message||"Could not read text edit status");return a.data}function Z(e){var t,r,n,s,w,j,W,Z;let{id:Q="edit-text-tool",className:ee}=e,{user:et,isCheckSign:er,setIsShowSignModal:ea,fetchUserCredits:en}=(0,_.U)(),[ei,es]=(0,i.useState)([]),[el,eo]=(0,i.useState)(null),[ed,ec]=(0,i.useState)(null),[eu,em]=(0,i.useState)("replace"),[eh,eg]=(0,i.useState)(""),[ex,ep]=(0,i.useState)(""),[ef,eb]=(0,i.useState)("match"),[ew,ev]=(0,i.useState)(!1),[ey,ej]=(0,i.useState)(null),[eN,ek]=(0,i.useState)(null),[eC,eI]=(0,i.useState)(null),[eS,e_]=(0,i.useState)(!1),[eT,eU]=(0,i.useState)(0),[eP,eA]=(0,i.useState)(null),[eE,eR]=(0,i.useState)(null),[eD,eL]=(0,i.useState)(!1),[eM,eO]=(0,i.useState)(!1),[eW,eq]=(0,i.useState)(null),[ez,eG]=(0,i.useState)(!1),[eB,eF]=(0,i.useState)(!1),[eJ,eH]=(0,i.useState)(null),[e$,eV]=(0,i.useState)(),[eY,eK]=(0,i.useState)(50),eX=(0,i.useRef)(null),eZ=(0,i.useRef)(null),eQ=(0,i.useRef)(null),e0=(0,i.useRef)(0),e1=(0,i.useRef)(z(crypto.randomUUID())),e2=(0,i.useRef)(null==et?void 0:et.id),e4=(0,i.useRef)({userId:null==et?void 0:et.id});e4.current.userId!==(null==et?void 0:et.id)&&(e4.current={userId:null==et?void 0:et.id});let e3=e4.current,e5=(0,i.useCallback)(()=>e4.current===e3,[e3]);e2.current=null==et?void 0:et.id;let e6=null!=(n=null==et||null==(t=et.credits)?void 0:t.remainingCredits)?n:0,e7=ei.find(e=>"uploaded"===e.status&&e.url),e8=null!=(s=null==e7?void 0:e7.url)?s:null,e9=null!=(w=null==e7?void 0:e7.preview)?w:null,te=ei.some(e=>"uploading"===e.status),tt=ei.some(e=>"error"===e.status),tr=(0,i.useMemo)(()=>{var e,t;return el?(e=el.width,t=el.height,!Number.isSafeInteger(e)||!Number.isSafeInteger(t)||e<256||t<256||e>4096||t>4096||e*t>16e6?{valid:!1,code:"invalid_dimensions",message:M.invalidDimensions}:{valid:!0,width:e,height:t}):null},[el]),ta=(0,i.useMemo)(()=>(function(e,t){if(!R(t))return;let r=O(e);if(r.length<1||r.length>300)return M.missingNewText})(eh,eu),[eh,eu]),tn=(0,i.useMemo)(()=>(function(e,t){let r=O(e);if(r.length>160||"add"!==t&&!r)return M.missingTargetText})(ex,eu),[ex,eu]),ti=eS||eM||!!eP,ts=et?(Z=et.id,"img-ai:edit-text-in-image:".concat(Z)):null,tl=R(eu);(0,i.useEffect)(()=>()=>{eN&&URL.revokeObjectURL(eN)},[eN]),(0,i.useEffect)(()=>{(0,F.OD)("tool_view",H)},[]),(0,i.useEffect)(()=>{ej(tr&&!tr.valid?tr.message:null)},[tr]);let to=(0,i.useCallback)(e=>{if(ts&&e3.userId&&e5()){eZ.current=e;try{var t;sessionStorage.setItem(ts,(t=e3.userId,JSON.stringify({userId:t,requestId:e.requestId,sourceImageUrl:e.sourceImageUrl,sourcePreview:e.sourcePreview,mode:e.mode,newText:e.newText,targetText:e.targetText,style:e.style,taskId:e.taskId,box:e.box})))}catch(e){x.oR.error("Browser storage is unavailable. Keep this tab open to recover the request.")}}},[ts,e3,e5]),td=(0,i.useCallback)(()=>
1{if(eZ.current=null,ts)try{sessionStorage.removeItem(ts)}catch(e){}},[ts]),tc=(0,i.useCallback)(()=>{e_(!1),eA(null),eL(!1),eR(null),eO(!1),eQ.current=null,td()},[td]),tu=(0,i.useCallback)(async(e,t,r)=>{ek(e),eI(t),eH(r),eU(100),eK(50),tc(),e1.current=z(crypto.randomUUID()),(0,F.OD)("generation_success",H),x.oR.success("Edited image ready"),await en()},[en,tc]),tm=(0,i.useCallback)(async(e,t)=>{if(!e5())return!0;let r=e.status;if(eR(r),r===p.i4.SUCCESS){var a;let r=(0,T.h0)(e.taskInfo);if(!r[0])throw Error("The image service returned no result.");if(to({...t,taskId:e.id}),!b(t.box))throw Error("This saved task has no edit box.");let n=await v(t.sourceImageUrl,(0,U.p)(r[0],e.id),t.box);return!e5()||(null==(a=eZ.current)?void 0:a.requestId)!==t.requestId||(eX.current=n,await tu(URL.createObjectURL(n),t.sourceImageUrl,e.id),!0)}return r===p.i4.FAILED||r===p.i4.CANCELED?(tc(),e1.current=z(crypto.randomUUID()),(0,F.OD)("generation_failure",H),await en(),!e5()||(x.oR.error(M.providerFailed),eq(M.providerFailed),!0)):(to({...t,taskId:e.id}),eA(e.id),eU(e=>r===p.i4.PROCESSING?Math.min(e+7,88):Math.max(e,22)),!1)},[en,tu,to,tc,e5]);(0,i.useEffect)(()=>{eZ.current=null,eQ.current=null,e0.current+=1,e1.current=z(crypto.randomUUID()),es([]),ec(null),eX.current=null,eo(null),em("replace"),eg(""),ep(""),eb("match"),ev(!1),ej(null),eV(void 0),ek(null),eI(null),eH(null),e_(!1),eA(null),eR(null),eL(!1),eO(!1),eq(null),eG(!1),eU(0)},[e3]),(0,i.useEffect)(()=>{if(er||!ts||!(null==et?void 0:et.id)||eZ.current)return;let e=null;try{e=sessionStorage.getItem(ts)}catch(e){return}try{var t;let r=function(e,t){var r,a;if(!e||!t)return;let n=JSON.parse(e);if(!n||"object"!=typeof n||n.userId!==t||!q(n.requestId)||"string"!=typeof n.sourceImageUrl||!n.sourceImageUrl||"string"!=typeof n.sourcePreview||!n.sourcePreview||void 0!==n.taskId&&"string"!=typeof n.taskId||void 0!==n.box&&!b(n.box))throw Error("invalid edit text recovery");let i="string"==typeof(r=n.mode)&&A.includes(r)?n.mode:"replace",s="string"==typeof(a=n.style)&&D.includes(a)?n.style:"match";return{...void 0!==n.box?{box:n.box}:{},requestId:n.requestId,sourceImageUrl:n.sourceImageUrl,sourcePreview:n.sourcePreview,mode:i,newText:"string"==typeof n.newText?O(n.newText).slice(0,300):"",targetText:"string"==typeof n.targetText?O(n.targetText).slice(0,160):"",style:s,taskId:"string"==typeof n.taskId?n.taskId:void 0}}(e,et.id);if(!r)return;eZ.current=r,e1.current=r.requestId,em(r.mode),ec(null!=(t=r.box)?t:null),eg(r.newText),ep(r.targetText),eb(r.style),ev(!0),eV([r.sourceImageUrl]),es([{id:"recovery-".concat(r.requestId),preview:r.sourceImageUrl,url:r.sourceImageUrl,status:"uploaded"}]),e_(!0),eU(20),eO(!1),eQ.current=Date.now(),r.taskId?eA(r.taskId):eL(!0),V(r.sourcePreview).then(e=>{e5()&&eo(e)}).catch(()=>void 0)}catch(e){try{sessionStorage.removeItem(ts)}catch(e){}}},[er,ts,null==et?void 0:et.id,e5]);let th=(0,i.useCallback)(async(e,t)=>{to(e);let r=e.taskId?await X(e.taskId):await K(G({requestId:e.requestId,sourceUrl:e.sourceImageUrl,mode:e.mode,newText:e.newText,targetText:e.targetText,style:e.style,box:e.box},t));await tm(r,e)},[tm,to]),tg=async()=>{if(!e5()||eZ.current||eS)return;if(!et)return void ea(!0);if(te)return void x.oR.error(M.uploading);if(!e8||!e9)return void x.oR.error(M.uploadFirst);if(!b(ed)||!el||Math.floor((ed.x+ed.width)*el.width)<=Math.ceil(ed.x*el.width)||Math.floor((ed.y+ed.height)*el.height)<=Math.ceil(ed.y*el.height))return void x.oR.error("Select an edit box that contains at least one image pixel.");if(ey)return void x.oR.error(ey);if(ta)return void x.oR.error(ta);if(tn)return void x.oR.error(tn);if(!ew)return void x.oR.error("Confirm you have permission to edit this image.");if(e6<20)return void eG(!0);eq(null),ek(null),e_(!0),eR(p.i4.PENDING),eU(16),eQ.current=Date.now();let e={requestId:e1.current,box:ed,sourceImageUrl:e8,sourcePreview:e9,mode:eu,newText:eh,targetText:ex,style:ef};(0,F.OD)("generation_submit",H);try{await th(e,et.id)}catch(n){var t,r;if(!e5())return;if(n instanceof B){if(tc(),e1.current=z(crypto.randomUUID()),await en(),!e5())return;eq(n.message),x.oR.error(n.message);return}let a=eZ.current;if(!a){e_(!1),eq("This browser could not save the request. Enable browser storage and try again.");return}eA(null!=(r=null!=(t=a.taskId)?t:e.taskId)?r:null),eL(!0),eO(!1),e_(!0),x.oR.error("Connection interrupted. Recovering the original task without a second charge.")}};(0,i.useEffect)(()=>{let e;if(!eP&&!eD||!eS)return;let t=e2.current;if(!t)return;let r=!1,a=new AbortController,n=t=>new Promise(r=>{e=window.setTimeout(r,t)});return(async()=>{let e=0;for(;!r;){if((eQ.current?Date.now()-eQ.current:0)>24e4){e_(!1),eO(!0),x.oR.error(M.pollPaused);return}try{let n=eZ.current;if(!n)return;let i=n.taskId?await X(n.taskId,a.signal):await K(G({requestId:n.requestId,sourceUrl:n.sourceImageUrl,mode:n.mode,newText:n.newText,targetText:n.targetText,style:n.style,box:n.box},t),a.signal);if(r||!e5()||await tm(i,n)||r)return;e=0}catch(t){var i;if(r||a.signal.aborted||!e5())return;if(t instanceof B&&!(null==(i=eZ.current)?void 0:i.taskId)){tc(),e1.current=z(crypto.randomUUID()),eq(t.message),x.oR.error(t.message),await en();return}if((e+=1)>=5){e_(!1),eO(!0),x.oR.error(M.pollPaused);return}console.warn("Text edit status check failed; retrying.",t)}await n(5e3*Math.max(1,e))}})(),()=>{r=!0,a.abort(),void 0!==e&&window.clearTimeout(e)}},[tm,e5,en,eS,eD,tc,eP]);let tx=(0,i.useCallback)(e=>{if(!e5()||eZ.current)return;e0.current+=1;let t=e0.current;es(e),ec(null),eX.current=null,ek(null),eI(null),eH(null),eq(null),ev(!1),e1.current=z(crypto.randomUUID()),tc();let r=e.find(e=>"uploaded"===e.status&&e.url);if(!r)return void eo(null);(0,F.OD)("upload_success",H),V(r.preview).then(e=>{e5()&&t===e0.current&&eo(e)}).catch(()=>{e5()&&t===e0.current&&(eo(null),ej(M.unreadableDimensions))})},[tc,e5]),tp=async()=>
1{if(eN&&eJ)try{eF(!0);let e=eX.current;if(!e)throw Error(M.downloadFailed);let t=URL.createObjectURL(e),r=document.createElement("a");r.href=t,r.download="img-ai-edited-text.png",document.body.appendChild(r),r.click(),document.body.removeChild(r),setTimeout(()=>URL.revokeObjectURL(t),200),(0,F.OD)("download",H),x.oR.success("Download started")}catch(e){x.oR.error(M.downloadFailed)}finally{eF(!1)}},tf=eM?"Check My Creations":eE===p.i4.PROCESSING?"Rendering the new lettering":eE===p.i4.PENDING?"Preparing image":eN?"Text edit complete":"Ready";return(0,a.jsxs)("section",{id:Q,"aria-label":"Edit text in image workbench",className:(0,J.cn)("relative",ee),children:[(0,a.jsxs)(C.Zp,{className:"border-border/70 bg-background/88 grid overflow-hidden rounded-2xl border p-0 shadow-2xl backdrop-blur-xl lg:grid-cols-[410px_1fr]",children:[(0,a.jsxs)("div",{className:"border-border/70 flex flex-col gap-5 border-b p-5 md:p-6 lg:border-r lg:border-b-0",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-primary text-xs font-semibold tracking-[0.18em] uppercase",children:"Text editor"}),(0,a.jsx)("h2",{className:"text-foreground mt-1 text-lg font-semibold",children:"Change the text inside an image"}),(0,a.jsx)("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:"Upload one image with text, choose what should happen, type the exact wording, and let one pass rebuild the lettering in place."})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(I.J,{htmlFor:"edit-text-upload",className:"text-xs font-semibold",children:"Image with text"}),(0,a.jsxs)("div",{className:"relative",inert:ti,"aria-disabled":ti,children:[(0,a.jsx)(f.ImageUploader,{uploadPurpose:"edit-text-in-image",accessibleLabel:"Upload an image that contains text",defaultPreviews:e$,maxImages:1,maxSizeMB:10,acceptedMimeTypes:P,title:"Upload image",emptyHint:"JPG, PNG, or WebP \xb7 up to ".concat(10," MB"),onChange:tx},"".concat(null!=(j=null==et?void 0:et.id)?j:"anonymous",":").concat(null!=(W=null==e$?void 0:e$[0])?W:"upload")),et||er?null:(0,a.jsx)("button",{type:"button","aria-label":"Sign in before uploading an image",onClick:()=>ea(!0),className:"absolute inset-0 z-20 rounded-xl"})]}),et||er?null:(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:"Sign in before selecting a file."}),tt?(0,a.jsx)("p",{className:"text-destructive text-xs",children:M.uploadFailed}):null]}),e8&&(0,a.jsx)(y,{src:e8,box:ed,disabled:ti,onChange:ec}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(I.J,{className:"text-xs font-semibold",children:"What should happen?"}),(0,a.jsx)("div",{role:"radiogroup","aria-label":"Text edit mode",className:"grid grid-cols-1 gap-1.5 sm:grid-cols-3",children:E.map(e=>{let t=eu===e.value;return(0,a.jsxs)("button",{type:"button",role:"radio","aria-checked":t,disabled:ti,title:e.hint,onClick:()=>em(e.value),className:(0,J.cn)("flex flex-col items-start rounded-lg border px-3 py-2 text-left transition-colors",t?"border-primary/40 bg-primary/10 text-foreground":"border-border text-muted-foreground hover:border-primary/30"),children:[(0,a.jsx)("span",{className:"text-xs font-semibold",children:e.label}),(0,a.jsx)("span",{className:"mt-0.5 text-[11px] leading-4",children:e.hint})]},e.value)})})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(I.J,{htmlFor:"edit-text-new",className:"text-xs font-semibold",children:tl?"Wording to render":"Wording (not used)"}),(0,a.jsx)("textarea",{id:"edit-text-new",value:eh,disabled:ti||!tl,maxLength:300,rows:2,onChange:e=>eg(e.target.value),placeholder:tl?"e.g. SLOW ROAST â exact characters, no quotes needed":"Switch to Replace or Add to enter wording",className:"border-border bg-background focus-visible:border-primary/50 min-h-[64px] w-full resize-none rounded-lg border px-3 py-2 text-sm outline-none disabled:opacity-60"}),(0,a.jsxs)("p",{className:"text-muted-foreground flex justify-between text-[11px]",children:[(0,a.jsx)("span",{children:"The model renders this exactly, character for character."}),(0,a.jsxs)("span",{children:[eh.length,"/",300]})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(I.J,{htmlFor:"edit-text-target",className:"text-xs font-semibold",children:"Which existing wording?"}),(0,a.jsx)("input",{id:"edit-text-target",value:ex,disabled:ti,maxLength:160,onChange:e=>ep(e.target.value),placeholder:"add"===eu?"Optional for Add text":"e.g. DAILY GRIND â the text to find",className:"border-border bg-background focus-visible:border-primary/50 h-10 w-full rounded-lg border px-3 text-sm outline-none disabled:opacity-60"}),(0,a.jsx)("p",{className:"text-muted-foreground text-[11px]",children:"Naming the current text keeps every other word untouched."})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(I.J,{className:"text-xs font-semibold",children:"Lettering style"}),(0,a.jsx)("div",{role:"radiogroup","aria-label":"Lettering style",className:"grid grid-cols-2 gap-1.5",children:L.map(e=>{let t=ef===e.value;return(0,a.jsxs)("button",{type:"button",role:"radio","aria-checked":t,disabled:ti,title:e.hint,onClick:()=>eb(e.value),className:(0,J.cn)("flex flex-col items-start rounded-lg border px-3 py-2 text-left transition-colors",t?"border-primary/40 bg-primary/10 text-foreground":"border-border text-muted-foreground hover:border-primary/30"),children:[(0,a.jsx)("span",{className:"text-xs font-semibold",children:e.label}),(0,a.jsx)("span",{className:"mt-0.5 text-[11px] leading-4",children:e.hint})]},e.value)})})]}),(0,a.jsxs)("label",{className:"text-muted-foreground flex cursor-pointer items-start gap-2.5 text-xs leading-5",children:[(0,a.jsx)("input",{type:"checkbox",checked:ew,disabled:ti,onChange:e=>ev(e.target.checked),className:"accent-primary mt-1"}),(0,a.jsx)("span",{children:M.rights})]}),(0,a.jsx)("div",{className:"border-primary/30 bg-primary/5 rounded-xl border px-4 py-4",children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold",children:"One local text edit"}),(0,a.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-5",children:"One guided pass inside your selected box. Pixels outside the box stay original, and the download keeps your upload dimensions."})]}),(0,a.jsxs)("span",{className:"text-primary shrink-0 text-xs font-semibold",children:[20," credits"]})]})}),(0,a.jsxs)("div",{className:"bg-muted/40 grid grid-cols-2 gap-3 rounded-lg p-3 text-xs",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-muted-foreground",children:"Source"}),(0,a.jsx)("p",{className:"mt-1 font-semibold",children:el?"".concat(el.width," \xd7 ").concat(el.height):"â"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-muted-foreground",children:"Output"}),(0,a.jsx)("p",{className:"mt-1 font-semibold",children:"Original upload size \xb7 PNG"})]})]}),ey?(0,a.jsx)("p",{role:"alert",className:"text-destructive text-xs",children:ey}):null,er?(0,a.jsxs)(k.$,{disabled:!0,size:"lg",className:"h-12 rounded-full",children:[(0,a.jsx)(o.A,{className:"h-4 w-4 animate-spin"}),"Checking accountâ¦"]}):et?(0,a.jsxs)(k.$,{size:"lg",className:"h-12 rounded-full text-sm font-semibold",onClick:()=>void tg(),disabled:ti||!e8||!ed||te||tt||!ew||!!ey||!!ta||!!tn,children:[eS?(0,a.jsx)(o.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(d.A,{className:"h-4 w-4"}),eS?"Editing textâ¦":eM?"Task continues in My Creations":"Edit text \xb7 ".concat(20," credits")]}):(0,a.jsxs)(k.$,{size:"lg",className:"h-12 rounded-full text-sm font-semibold",onClick:()=>ea(!0),children:[(0,a.jsx)(c.A,{className:"h-4 w-4"}),"Sign in to edit"]}),(0,a.jsxs)("div",{className:"text-muted-foreground flex items-center justify-between text-xs",children:[(0,a.jsxs)("span",{children:[20," credits for this run"]}),et?(0,a.jsxs)("span",{children:[e6," remaining"]}):(0,a.jsx)(l(),{href:"/pricing",className:"text-primary underline-offset-4 hover:underline",children:"View pricing"})]})]}),(0,a.jsxs)("div",{className:"bg-card/50 relative min-h-[420px] overflow-hidden",children:[(0,a.jsxs)("div",{className:"border-border/70 flex h-14 items-center justify-between border-b px-5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:(0,J.cn)("h-2.5 w-2.5 rounded-full",eS?"bg-primary animate-pulse":"bg-primary/70")}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs font-semibold",children:tf})]}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:"Concept render \xb7 verify wording before publishing"})]}),eS?(0,a.jsxs)("div",{className:"flex h-[calc(100%-3.5rem)] flex-col items-center justify-center gap-5 p-8 text-center",children:[(0,a.jsx)(o.A,{className:"text-primary h-10 w-10 animate-spin"}),(0,a.jsxs)("div",{className:"w-full max-w-sm space-y-3",children:[(0,a.jsx)("p",{className:"text-lg font-semibold",children:"Redrawing your lettering"}),(0,a.jsx)("p",{className:"text-muted-foreground text-sm",children:"The original stays in this workspace. One task identity is kept, so a refresh does not start a second charge."}),(0,a.jsx)(S.k,{value:Math.min(100,Math.round(eT))})]})]}):eM?(0,a.jsxs)("div",{className:"flex flex-col items-center gap-4 p-8 text-center",children:[(0,a.jsxs)("p",{className:"text-sm",children:["Status checks paused. Keep this page open to recover the original request without another charge. If it stays unresolved, contact support with request ID"," ",(0,a.jsx)("code",{children:null==(r=eZ.current)?void 0:r.requestId}),"."]}),(0,a.jsx)(k.$,{onClick:()=>{eQ.current=Date.now(),eO(!1),eL(!0),e_(!0)},children:"Recover original task"}),(0,a.jsx)(l(),{href:"/my-creations",className:"text-primary text-sm underline underline-offset-4",children:"Check My Creations"})]}):eW?(0,a.jsxs)("div",{className:"flex h-[calc(100%-3.5rem)] flex-col items-center justify-center gap-4 p-8 text-center",children:[(0,a.jsx)(u.A,{className:"text-destructive h-7 w-7"}),(0,a.jsx)("p",{className:"max-w-md text-sm",children:eW}),(0,a.jsxs)(k.$,{type:"button",variant:"outline",size:"sm",onClick:()=>void tg(),children:[(0,a.jsx)(m.A,{className:"h-4 w-4"}),"Retry"]})]}):eN&&eC?(0,a.jsxs)("div",{className:"flex h-[calc(100%-3.5rem)] flex-col",children:[(0,a.jsx)("div",{className:"flex flex-1 items-center justify-center p-4",children:(0,a.jsx)(Y,{original:eC,edited:eN,originalAlt:"Uploaded image with its original text",editedAlt:"Edited text result from IMG AI",position:eY,onPositionChange:eK})}),(0,a.jsxs)("div",{className:"border-border/70 flex flex-wrap items-center justify-between gap-3 border-t px-5 py-3",children:[(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:"Drag to compare. Check the changed wording, the untouched lines, and the rebuilt background before you publish."}),(0,a.jsxs)(k.$,{type:"button",size:"sm",onClick:()=>void tp(),disabled:eB,children:[eB?(0,a.jsx)(o.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(h.A,{className:"h-4 w-4"}),"Download"]})]})]}):(0,a.jsxs)("div",{className:"flex h-[calc(100%-3.5rem)] flex-col items-center justify-center gap-4 p-6 text-center",children:[(0,a.jsx)("p",{className:"text-lg font-semibold",children:"Your edited image will appear here"}),(0,a.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:"Upload a JPG, PNG, or WebP between 256 and 4,096 pixels per side to change the text, add new wording, or clear text away."}),(0,a.jsx)("div",{className:"grid w-full max-w-lg grid-cols-3 gap-2",children:$.map(e=>(0,a.jsx)("div",{className:"bg-muted aspect-[4/3] overflow-hidden rounded-lg",children:(0,a.jsx)("img",{src:e.src,alt:e.alt,className:"h-full w-full object-cover"})},e.src))}),(0,a.jsxs)("p",{className:"text-muted-foreground flex items-center gap-1.5 text-xs",children:[(0,a.jsx)(g.A,{className:"h-3.5 w-3.5"}),"Concept examples, not measured customer results."]})]})]})]}),(0,a.jsx)(N.h,{open:ez,onOpenChange:eG,remainingCredits:e6,costCredits:20})]})}},5519:(e,t,r)=>{r.d(t,{e:()=>i,p:()=>n});var a=r(11020);let n=(e,t)=>(0,a.QT)(e)?e:"/api/proxy/file?url=".concat(encodeURIComponent(e),"&taskId=").concat(encodeURIComponent(t)),i=e=>{var t;switch(null==(t=e.split(";")[0])?void 0:t.trim().toLowerCase()){case"image/svg+xml":return"svg";case"image/jpeg":case"image/jpg":return"jpg";case"image/webp":return"webp";default:return"png"}}},11020:(e,t,r)=>{r.d(t,{Ch:()=>n,QT:()=>i,h0:()=>s});let a="/api/proxy/file",n=(e,t)=>"".concat(a,"?taskId=").concat(encodeURIComponent(e),"&index=").concat(encodeURIComponent(String(t))),i=e=>{try{let t=new URL(e,"https://local.invalid");return t.pathname===a&&t.searchParams.has("taskId")&&t.searchParams.has("index")}catch(e){return!1}},s=e=>{let t=(e=>{if(!e)return null;try{return JSON.parse(e)}catch(e){return null}})(e);if(!t||"object"!=typeof t)return[];let r=t.images;return Array.isArray(r)?r.map(e=>(e=>e?"string"==typeof e?e:e.imageUrl||e.url||e.src||e.image||e.uri||null:null)(e)).filter(e=>!!e):[]}},11830:(e,t,r)=>{r.d(t,{Vs:()=>a,i4:()=>n});var a=function(e){return e.MUSIC="music",e.IMAGE="image",e.VIDEO="video",e.TEXT="text",e.SPEECH="speech",e}({}),n=function(e){return e.PENDING="pending",e.PROCESSING="processing",e.SUCCESS="success",e.FAILED="failed",e.CANCELED="canceled",e}({})},38390:(e,t,r)=>{r.d(t,{k:()=>l});var a=r(60390),n=r(6166);r(62310);var i=r(83912),s=r(34084);function l(e){let t,r,l,o,d,c,u=(0,n.c)(12);u[0]!==e?({className:t,value:l,...r}=e,u[0]=e,u[1]=t,u[2]=r,u[3]=l):(t=u[1],r=u[2],l=u[3]),u[4]!==t?(o=(0,s.cn)("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",t),u[4]=t,u[5]=o):o=u[5];let m="translateX(-".concat(100-(l||0),"%)");return u[6]!==m?(d=(0,a.jsx)(i.C1,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:m}}),u[6]=m,u[7]=d):d=u[7],u[8]!==r||u[9]!==o||u[10]!==d?(c=(0,a.jsx)(i.bL,{"data-slot":"progress",className:o,...r,children:d}),u[8]=r,u[9]=o,u[10]=d,u[11]=c):c=u[11],c}},45938:(e,t,r)=>{r.d(t,{h:()=>f});var a=r(60390),n=r(6166),i=r(88252),s=r(91848),l=r(2930),o=r(27496),d=r(55271),c=r(92603),u=r(26792),m=r(29289),h=r(34084);let g=[.25,.46,.45,.94],x=e=>({initial:{opacity:0,y:12}
1,animate:{opacity:1,y:0,transition:{delay:e,duration:.35,ease:g}}});function p(e){let t,r,c,u,m,p,f,b,w,v,y,j,N,k,C,I,S,_,T,U,P,A,E,R,D,L,M,O,W,q,z,G,B,F,J,H,$,V,Y,K,X,Z,Q,ee,et,er=(0,n.c)(91),{remainingCredits:ea,costCredits:en,onDismiss:ei}=e,es=(0,i.c3)("ai.video.generator"),el=Math.max(0,en-ea),eo=en>0?Math.min(ea/en,1):0,ed=eo<.25?"bg-red-500":eo<.5?"bg-orange-500":"bg-amber-500";er[0]===Symbol.for("react.memo_cache_sentinel")?(t=x(0),er[0]=t):t=er[0],er[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(s.P.div,{className:"absolute h-16 w-16 rounded-full bg-amber-500/20",animate:{scale:[1,1.4,1],opacity:[.4,.1,.4]},transition:{duration:2.5,repeat:1/0,ease:"easeInOut"}}),er[1]=r):r=er[1],er[2]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(s.P.div,{className:"absolute h-12 w-12 rounded-full bg-amber-500/30",animate:{scale:[1,1.2,1],opacity:[.6,.2,.6]},transition:{duration:2.5,repeat:1/0,ease:"easeInOut",delay:.3}}),er[2]=c):c=er[2],er[3]===Symbol.for("react.memo_cache_sentinel")?(u={scale:0},m={scale:1},p={type:"spring",stiffness:260,damping:20,delay:.1},er[3]=u,er[4]=m,er[5]=p):(u=er[3],m=er[4],p=er[5]),er[6]===Symbol.for("react.memo_cache_sentinel")?(f=(0,a.jsxs)(s.P.div,{...t,className:"relative flex items-center justify-center",children:[r,c,(0,a.jsx)(s.P.div,{initial:u,animate:m,transition:p,className:"relative flex h-14 w-14 items-center justify-center rounded-2xl bg-gradient-to-br from-amber-400 to-orange-500 shadow-lg shadow-amber-500/25",children:(0,a.jsx)(l.A,{className:"h-7 w-7 text-white",fill:"white"})})]}),er[6]=f):f=er[6],er[7]===Symbol.for("react.memo_cache_sentinel")?(b=x(.05),er[7]=b):b=er[7],er[8]!==es?(w=es("insufficient_credits_title"),er[8]=es,er[9]=w):w=er[9],er[10]!==w?(v=(0,a.jsx)("h3",{className:"text-lg font-bold tracking-tight text-foreground",children:w}),er[10]=w,er[11]=v):v=er[11],er[12]!==es?(y=es("insufficient_credits_description"),er[12]=es,er[13]=y):y=er[13],er[14]!==y?(j=(0,a.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:y}),er[14]=y,er[15]=j):j=er[15],er[16]!==v||er[17]!==j?(N=(0,a.jsxs)(s.P.div,{...b,className:"space-y-1.5 text-center",children:[v,j]}),er[16]=v,er[17]=j,er[18]=N):N=er[18],er[19]===Symbol.for("react.memo_cache_sentinel")?(k=x(.1),er[19]=k):k=er[19],er[20]!==es?(C=es("insufficient_credits_remaining"),er[20]=es,er[21]=C):C=er[21],er[22]!==C?(I=(0,a.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:C}),er[22]=C,er[23]=I):I=er[23],er[24]!==ea?(S=ea.toLocaleString(),er[24]=ea,er[25]=S):S=er[25],er[26]!==S?(_=(0,a.jsx)("p",{className:"text-2xl font-black tabular-nums text-foreground",children:S}),er[26]=S,er[27]=_):_=er[27],er[28]!==es?(T=es("insufficient_credits_credits_unit"),er[28]=es,er[29]=T):T=er[29],er[30]!==T?(U=(0,a.jsx)("p",{className:"text-[10px] text-muted-foreground/60",children:T}),er[30]=T,er[31]=U):U=er[31],er[32]!==I||er[33]!==_||er[34]!==U?(P=(0,a.jsxs)("div",{className:"space-y-1 text-center",children:[I,_,U]}),er[32]=I,er[33]=_,er[34]=U,er[35]=P):P=er[35],er[36]!==es?(A=es("insufficient_credits_required"),er[36]=es,er[37]=A):A=er[37],er[38]!==A?(E=(0,a.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:A}),er[38]=A,er[39]=E):E=er[39],er[40]!==en?(R=en.toLocaleString(),er[40]=en,er[41]=R):R=er[41],er[42]!==R?(D=(0,a.jsx)("p",{className:"text-2xl font-black tabular-nums text-foreground",children:R}),er[42]=R,er[43]=D):D=er[43],er[44]!==es?(L=es("insufficient_credits_credits_unit"),er[44]=es,er[45]=L):L=er[45],er[46]!==L?(M=(0,a.jsx)("p",{className:"text-[10px] text-muted-foreground/60",children:L}),er[46]=L,er[47]=M):M=er[47],er[48]!==E||er[49]!==D||er[50]!==M?(O=(0,a.jsxs)("div",{className:"space-y-1 text-center",children:[E,D,M]}),er[48]=E,er[49]=D,er[50]=M,er[51]=O):O=er[51],er[52]!==P||er[53]!==O?(W=(0,a.jsxs)("div",{className:"mb-4 grid grid-cols-2 gap-4",children:[P,O]}),er[52]=P,er[53]=O,er[54]=W):W=er[54],er[55]!==ed?(q=(0,h.cn)("h-full rounded-full",ed),er[55]=ed,er[56]=q):q=er[56],er[57]===Symbol.for("react.memo_cache_sentinel")?(z={width:0},er[57]=z):z=er[57];let ec="".concat(100*eo,"%");return er[58]!==ec?(G={width:ec},er[58]=ec,er[59]=G):G=er[59],er[60]===Symbol.for("react.memo_cache_sentinel")?(B={duration:.8,ease:g,delay:.3},er[60]=B):B=er[60],er[61]!==q||er[62]!==G?(F=(0,a.jsx)("div",{className:"mb-3 h-2.5 w-full overflow-hidden rounded-full bg-muted/60",children:(0,a.jsx)(s.P.div,{className:q,initial:z,animate:G,transition:B})}
1),er[61]=q,er[62]=G,er[63]=F):F=er[63],er[64]!==el||er[65]!==es?(J=el>0&&(0,a.jsx)("p",{className:"text-center text-xs font-semibold text-amber-600 dark:text-amber-400",children:es("insufficient_credits_needed",{credits:el.toLocaleString()})}),er[64]=el,er[65]=es,er[66]=J):J=er[66],er[67]!==W||er[68]!==F||er[69]!==J?(H=(0,a.jsxs)(s.P.div,{...k,className:"w-full rounded-2xl border border-border/40 bg-muted/30 p-5 backdrop-blur-sm",children:[W,F,J]}),er[67]=W,er[68]=F,er[69]=J,er[70]=H):H=er[70],er[71]===Symbol.for("react.memo_cache_sentinel")?($=x(.15),er[71]=$):$=er[71],er[72]===Symbol.for("react.memo_cache_sentinel")?(V=(0,a.jsx)(s.P.div,{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/25 to-transparent",animate:{x:["-100%","200%"]},transition:{duration:2.5,repeat:1/0,ease:"easeInOut",repeatDelay:1},style:{width:"50%"}}),er[72]=V):V=er[72],er[73]!==es?(Y=es("insufficient_credits_cta"),er[73]=es,er[74]=Y):Y=er[74],er[75]!==Y?(K=(0,a.jsxs)(d.$,{size:"lg",className:"relative w-full h-12 overflow-hidden rounded-xl bg-gradient-to-r from-amber-500 via-orange-500 to-amber-500 font-bold text-white shadow-lg shadow-amber-500/25 transition-all hover:shadow-xl hover:shadow-amber-500/30",children:[V,(0,a.jsx)("span",{className:"relative z-10",children:Y})]}),er[75]=Y,er[76]=K):K=er[76],er[77]!==ei||er[78]!==K?(X=(0,a.jsx)(s.P.div,{...$,className:"w-full",children:(0,a.jsx)(o.N_,{href:"/pricing",className:"block w-full",onClick:ei,children:K})}),er[77]=ei,er[78]=K,er[79]=X):X=er[79],er[80]===Symbol.for("react.memo_cache_sentinel")?(Z=x(.2),er[80]=Z):Z=er[80],er[81]!==es?(Q=es("insufficient_credits_dismiss"),er[81]=es,er[82]=Q):Q=er[82],er[83]!==ei||er[84]!==Q?(ee=(0,a.jsx)(s.P.div,{...Z,className:"w-full",children:(0,a.jsx)(d.$,{variant:"ghost",size:"lg",className:"w-full text-muted-foreground hover:text-foreground",onClick:ei,children:Q})}),er[83]=ei,er[84]=Q,er[85]=ee):ee=er[85],er[86]!==N||er[87]!==H||er[88]!==X||er[89]!==ee?(et=(0,a.jsxs)("div",{className:"flex flex-col items-center gap-5",children:[f,N,H,X,ee]}),er[86]=N,er[87]=H,er[88]=X,er[89]=ee,er[90]=et):et=er[90],et}function f(e){let t,r,s,l,o,d,h,g,x,f,b=(0,n.c)(47),{open:w,onOpenChange:v,remainingCredits:y,costCredits:j}=e,N=(0,i.c3)("ai.video.generator"),k=(0,m.U)("(min-width: 768px)");b[0]!==v?(t=()=>v(!1),b[0]=v,b[1]=t):t=b[1];let C=t;if(k){let e,t,r,n,i,s,l,o;return b[2]!==N?(e=N("insufficient_credits_title"),b[2]=N,b[3]=e):e=b[3],b[4]!==e?(t=(0,a.jsx)(c.L3,{children:e}),b[4]=e,b[5]=t):t=b[5],b[6]!==N?(r=N("insufficient_credits_description"),b[6]=N,b[7]=r):r=b[7],b[8]!==r?(n=(0,a.jsx)(c.rr,{children:r}),b[8]=r,b[9]=n):n=b[9],b[10]!==t||b[11]!==n?(i=(0,a.jsxs)(c.c7,{className:"sr-only",children:[t,n]}),b[10]=t,b[11]=n,b[12]=i):i=b[12],b[13]!==j||b[14]!==C||b[15]!==y?(s=(0,a.jsx)(p,{remainingCredits:y,costCredits:j,onDismiss:C}),b[13]=j,b[14]=C,b[15]=y,b[16]=s):s=b[16],b[17]!==i||b[18]!==s?(l=(0,a.jsxs)(c.Cf,{className:"border-border/60 bg-background/80 rounded-2xl shadow-2xl backdrop-blur-xl sm:max-w-[440px] p-6",showCloseButton:!1,children:[i,s]}),b[17]=i,b[18]=s,b[19]=l):l=b[19],b[20]!==v||b[21]!==w||b[22]!==l?(o=(0,a.jsx)(c.lG,{open:w,onOpenChange:v,children:l}),b[20]=v,b[21]=w,b[22]=l,b[23]=o):o=b[23],o}return b[24]!==N?(r=N("insufficient_credits_title"),b[24]=N,b[25]=r):r=b[25],b[26]!==r?(s=(0,a.jsx)(u.gk,{children:r}),b[26]=r,b[27]=s):s=b[27],b[28]!==N?(l=N("insufficient_credits_description"),b[28]=N,b[29]=l):l=b[29],b[30]!==l?(o=(0,a.jsx)(u.I6,{children:l}),b[30]=l,b[31]=o):o=b[31],b[32]!==s||b[33]!==o?(d=(0,a.jsxs)(u.BE,{className:"sr-only",children:[s,o]}),b[32]=s,b[33]=o,b[34]=d):d=b[34],b[35]!==j||b[36]!==C||b[37]!==y?(h=(0,a.jsx)(p,{remainingCredits:y,costCredits:j,onDismiss:C}),b[35]=j,b[36]=C,b[37]=y,b[38]=h):h=b[38],b[39]===Symbol.for("react.memo_cache_sentinel")?(g=(0,a.jsx)(u.tb,{className:"pt-0"}),b[39]=g):g=b[39],b[40]!==d||b[41]!==h?(x=(0,a.jsxs)(u.zj,{className:"border-border/60 bg-background/80 rounded-t-2xl backdrop-blur-xl px-4 pb-6",children:[d,h,g]}),b[40]=d,b[41]=h,b[42]=x):x=b[42],b[43]!==v||b[44]!==w||b[45]!==x?(f=(0,a.jsx)(u._s,{open:w,onOpenChange:v,children:x}),b[43]=v,b[44]=w,b[45]=x,b[46]=f):f=b[46],f}},48549:(e,t,r)=>{r.d(t,{S:()=>i});var a=r(60390),n=r(6166);function i(e){let t,r=(0,n.c)(2),{message:i}=e;return r[0]!==i?(t=(0,a.jsx)("div",{className:"flex h-[50vh] w-full flex-col items-center justify-center",children:(0,a.jsx)("p",{children:i})}),r[0]=i,r[1]=t):t=r[1],t}},77685:(e,t,r)=>{r.d(t,{BT:()=>d,Wu:()=>u,X9:()=>c,ZB:()=>o,Zp:()=>s,aR:()=>l,wL:()=>m});var a=r(60390),n=r(6166);r(62310);var i=r(34084);function s(e){let t,r,s,l,o=(0,n.c)(8);return o[0]!==e?({className:t,...r}=e,o[0]=e,o[1]=t,o[2]=r):(t=o[1],r=o[2]),o[3]!==t?(s=(0,i.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),o[3]=t,o[4]=s):s=o[4],o[5]!==r||o[6]!==s?(l=(0,a.jsx)("div",{"data-slot":"card",className:s,...r}),o[5]=r,o[6]=s,o[7]=l):l=o[7],l}function l(e){let t,r,s,l,o=(0,n.c)(8);return o[0]!==e?({className:t,...r}=e,o[0]=e,o[1]=t,o[2]=r):(t=o[1],r=o[2]),o[3]!==t?(s=(0,i.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),o[3]=t,o[4]=s):s=o[4],o[5]!==r||o[6]!==s?(l=(0,a.jsx)("div",{"data-slot":"card-header",className:s,...r}),o[5]=r,o[6]=s,o[7]=l):l=o[7],l}function o(e){let t,r,s,l,o=(0,n.c)(8);return o[0]!==e?({className:t,...r}=e,o[0]=e,o[1]=t,o[2]=r):(t=o[1],r=o[2]),o[3]!==t?(s=(0,i.cn)("leading-none font-semibold",t),o[3]=t,o[4]=s):s=o[4],o[5]!==r||o[6]!==s?(l=(0,a.jsx)("div",{"data-slot":"card-title",className:s,...r}),o[5]=r,o[6]=s,o[7]=l):l=o[7],l}function d(e){let t,r,s,l,o=(0,n.c)(8);return o[0]!==e?({className:t,...r}=e,o[0]=e,o[1]=t,o[2]=r):(t=o[1],r=o[2]),o[3]!==t?(s=(0,i.cn)("text-muted-foreground text-sm",t),o[3]=t,o[4]=s):s=o[4],o[5]!==r||o[6]!==s?(l=(0,a.jsx)("div",{"data-slot":"card-description",className:s,...r}),o[5]=r,o[6]=s,o[7]=l):l=o[7],l}function c(e){let t,r,s,l,o=(0,n.c)(8);return o[0]!==e?({className:t,...r}=e,o[0]=e,o[1]=t,o[2]=r):(t=o[1],r=o[2]),o[3]!==t?(s=(0,i.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),o[3]=t,o[4]=s):s=o[4],o[5]!==r||o[6]!==s?(l=(0,a.jsx)("div",{"data-slot":"card-action",className:s,...r}),o[5]=r,o[6]=s,o[7]=l):l=o[7],l}function u(e){let t,r,s,l,o=(0,n.c)(8);return o[0]!==e?({className:t,...r}=e,o[0]=e,o[1]=t,o[2]=r):(t=o[1],r=o[2]),o[3]!==t?(s=(0,i.cn)("px-6",t),o[3]=t,o[4]=s):s=o[4],o[5]!==r||o[6]!==s?(l=(0,a.jsx)("div",{"data-slot":"card-content",className:s,...r}),o[5]=r,o[6]=s,o[7]=l):l=o[7],l}function m(e){let t,r,s,l,o=(0,n.c)(8);return o[0]!==e?({className:t,...r}=e,o[0]=e,o[1]=t,o[2]=r):(t=o[1],r=o[2]),o[3]!==t?(s=(0,i.cn)("flex items-center px-6 [.border-t]:pt-6",t),o[3]=t,o[4]=s):s=o[4],o[5]!==r||o[6]!==s?(l=(0,a.jsx)("div",{"data-slot":"card-footer",className:s,...r}),o[5]=r,o[6]=s,o[7]=l):l=o[7],l}},85204:(e,t,r)=>{r.r(t),r.d(t,{AudioPlayer:()=>W.AudioPlayer,BrandLogo:()=>d,BuiltWith:()=>f,CookieConsentBanner:()=>z.CookieConsentBanner,CookieConsentInitScript:()=>H,CookieConsentPreferences:()=>G.CookieConsentPreferences,CookieSettingsButton:()=>B.CookieSettingsButton,Copyright:()=>h.Copyright,Empty:()=>j.S,ErrorBoundary:()=>q.ErrorBoundary,ImageUploader:()=>k.ImageUploader,LazyImage:()=>N.LazyImage,LocaleDetector:()=>c.LocaleDetector,LocaleSelector:()=>u.LocaleSelector,MDXContent:()=>M,MarkdownContent:()=>S,MarkdownEditor:()=>_.MarkdownEditor,MarkdownPreview:()=>C.MarkdownPreview,PageHeader:()=>w,Pagination:()=>n.Pagination,SectionHeader:()=>y,SignUser:()=>O.SignUser,SmartIcon:()=>a.L,ThemeToggler:()=>m.ThemeToggler,getTocItems:()=>C.getTocItems});var a=r(2705),n=r(66102),i=r(60390),s=r(6166),l=r(60711),o=r(27496);function d(e){let t,r,a,n=(0,s.c)(11),{brand:d}=e,c=d.url||"",u=d.target||"_self",m="flex items-center space-x-2 ".concat(d.className);return n[0]!==d.logo||n[1]!==d.title?(t=d.logo&&(0,i.jsx)(l.default,{src:d.logo.src,alt:d.logo.alt||d.title||"",width:d.logo.width||100,height:d.logo.height||100,unoptimized:!0,className:"h-10 w-auto"}),n[0]=d.logo,n[1]=d.title,n[2]=t):t=n[2],n[3]!==d.title?(r=d.title&&(0,i.jsx)("span",{className:"text-lg font-medium",children:d.title}),n[3]=d.title,n[4]=r):r=n[4],n[5]!==c||n[6]!==u||n[7]!==m||n[8]!==t||n[9]!==r?(a=(0,i.jsxs)(o.N_,{href:c,target:u,className:m,children:[t,r]}),n[5]=c,n[6]=u,n[7]=m,n[8]=t,n[9]=r,n[10]=a):a=n[10],a}var c=r(71871),u=r(39634),m=r(1857),h=r(87129),g=r(28555),x=r.n(g),p=r(55271);function f(){let e,t=(0,s.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,i.jsx)(p.$,{asChild:!0,variant:"outline",size:"sm",className:"hover:bg-primary/10",children:(0,i.jsx)(x(),{href:"https://shipany.ai",target:"_blank",children:"Built with â¤ï¸ ShipAny"})}),t[0]=e):e=t[0],e}var b=r(34084);function w(e){let t,r,a,n,l,o,d,c=(0,s.c)(17),{title:u,description:m,buttons:h,className:g}=e;
1return c[0]!==g?(t=(0,b.cn)("py-16 md:py-32",g),c[0]=g,c[1]=t):t=c[1],c[2]!==u?(r=(0,i.jsx)("h1",{className:"text-center text-4xl font-semibold lg:text-5xl",children:u}),c[2]=u,c[3]=r):r=c[3],c[4]!==m?(a=(0,i.jsx)("p",{children:m}),c[4]=m,c[5]=a):a=c[5],c[6]!==h?(n=null==h?void 0:h.map(v),c[6]=h,c[7]=n):n=c[7],c[8]!==n?(l=(0,i.jsx)("div",{className:"flex justify-center",children:n}),c[8]=n,c[9]=l):l=c[9],c[10]!==r||c[11]!==a||c[12]!==l?(o=(0,i.jsx)("div",{className:"mx-auto max-w-6xl px-6",children:(0,i.jsxs)("div",{className:"mx-auto max-w-4xl space-y-6 text-center",children:[r,a,l]})}),c[10]=r,c[11]=a,c[12]=l,c[13]=o):o=c[13],c[14]!==t||c[15]!==o?(d=(0,i.jsx)("section",{className:t,children:o}),c[14]=t,c[15]=o,c[16]=d):d=c[16],d}function v(e,t){return(0,i.jsx)(p.$,{...e,asChild:!0,children:(0,i.jsxs)(o.N_,{href:e.url||"",target:e.target||"_self",children:[e.icon&&(0,i.jsx)(a.L,{name:e.icon}),e.title]})},t)}function y(e){let t,r,a,n,l=(0,s.c)(10),{title:o,description:d,className:c}=e;return l[0]!==c?(t=(0,b.cn)("container space-y-6 py-16 text-center md:py-24",c),l[0]=c,l[1]=t):t=l[1],l[2]!==o?(r=(0,i.jsx)("h2",{className:"text-center text-4xl font-semibold lg:text-5xl",children:o}),l[2]=o,l[3]=r):r=l[3],l[4]!==d?(a=(0,i.jsx)("p",{children:d}),l[4]=d,l[5]=a):a=l[5],l[6]!==t||l[7]!==r||l[8]!==a?(n=(0,i.jsxs)("div",{className:t,children:[r,a]}),l[6]=t,l[7]=r,l[8]=a,l[9]=n):n=l[9],n}var j=r(48549),N=r(68316),k=r(5428),C=r(52222);let I=new(r(12496)).A({html:!0,linkify:!0,breaks:!0});function S(e){let t,r,a=(0,s.c)(4),{content:n}=e;a[0]!==n?(t=n?I.render(n):"",a[0]=n,a[1]=t):t=a[1];let l=t;return a[2]!==l?(r=(0,i.jsx)("div",{className:"markdown-body",dangerouslySetInnerHTML:{__html:l}}),a[2]=l,a[3]=r):r=a[3],r}I.renderer.rules.heading_open=function(e,t){let r=e[t].markup.length,a=e[t+1];if(a&&"inline"===a.type){let e=a.content.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/(^-|-$)/g,"");return"<h".concat(r,' id="').concat(e,'">')}return"<h".concat(r,">")},I.renderer.rules.link_open=function(e,t,r,a,n){let i=e[t];if(i.attrIndex("href")>=0){let e=i.attrGet("href");i.attrSet("rel","nofollow"),e&&(e.startsWith("http://")||e.startsWith("https://"))&&i.attrSet("target","_blank")}return n.renderToken(e,t,r)};var _=r(19481);r(62310);var T=r(42201),U=r(7727);let P=new Set(["minih3.pro","www.minih3.pro"]);function A(e){try{let t=new URL((null==e?void 0:e.startsWith("//"))?"https:".concat(e):e||"");if(P.has(t.hostname.toLowerCase()))return"noopener noreferrer"}catch(e){}return"nofollow noopener noreferrer"}let E=e=>{let t,r,a,n,l=(0,s.c)(15);if(l[0]!==e?({href:r,children:t,...a}=e,l[0]=e,l[1]=t,l[2]=r,l[3]=a):(t=l[1],r=l[2],a=l[3]),(null==r?void 0:r.startsWith("http"))||(null==r?void 0:r.startsWith("//"))){let e,n;return l[4]!==r?(e=A(r),l[4]=r,l[5]=e):e=l[5],l[6]!==t||l[7]!==r||l[8]!==a||l[9]!==e?(n=(0,i.jsx)("a",{...a,href:r,target:"_blank",rel:e,children:t}),l[6]=t,l[7]=r,l[8]=a,l[9]=e,l[10]=n):n=l[10],n}return l[11]!==t||l[12]!==r||l[13]!==a?(n=(0,i.jsx)("a",{href:r,...a,children:t}),l[11]=t,l[12]=r,l[13]=a,l[14]=n):n=l[14],n};var R=r(86404),D=r(4732),L=r(51903);async function M(e){let t,r,a,n=(0,s.c)(6),{source:l,components:o}=e;n[0]!==o?(t=function(e){let t={...T.A,a:E,img:e=>{let{src:t}=e,r="object"==typeof t&&null!==t&&"src"in t?t.src:t;return(0,i.jsx)("img",{...e,src:r,className:(0,b.cn)("rounded-lg border",e.className),style:{maxWidth:"100%",height:"auto"}})},Video:e=>{let{className:t,...r}=e;return(0,i.jsx)("video",{className:(0,b.cn)("rounded-md border",t),controls:!0,loop:!0,...r})},Accordion:U.Accordion,AccordionItem:U.AccordionItem,AccordionTrigger:U.AccordionTrigger,AccordionContent:U.AccordionContent,...e};return(null==e?void 0:e.a)&&e.a!==E&&(t.a=function(e){let t=t=>{let r,a,n,l,o=(0,s.c)(15);if(o[0]!==t?({href:a,children:r,...n}=t,o[0]=t,o[1]=r,o[2]=a,o[3]=n):(r=o[1],a=o[2],n=o[3]),(null==a?void 0:a.startsWith("http"))||(null==a?void 0:a.startsWith("//"))){let t,s;return o[4]!==a?(t=A(a),o[4]=a,o[5]=t):t=o[5],o[6]!==r||o[7]!==a||o[8]!==n||o[9]!==t?(s=(0,i.jsx)(e,{...n,href:a,target:"_blank",rel:t,children:r}),o[6]=r,o[7]=a,o[8]=n,o[9]=t,o[10]=s):s=o[10],s}return o[11]!==r||o[12]!==a||o[13]!==n?(l=(0,i.jsx)(e,{href:a,...n,children:r}),o[11]=r,o[12]=a,o[13]=n,o[14]=l):l=o[14],l};return t.displayName="withNoFollow(".concat(e.displayName||e.name||"Component",")"),t}(e.a)),t}(o),n[0]=o,n[1]=t):t=n[1];let d=t;return n[2]===Symbol.for("react.memo_cache_sentinel")?(r={mdxOptions:{remarkPlugins:[L.A],rehypePlugins:[D.A]}},n[2]=r):r=n[2],n[3]!==d||n[4]!==l?(a=(0,i.jsx)(R.m,{source:l,components:d,options:r}),n[3]=d,n[4]=l,n[5]=a):a=n[5],a}var O=r(76587),W=r(83006),q=r(81563),z=r(20364),G=r(31360),B=r(17139),F=r(79297),J=r(70104);function H(){let e,t,r,a,n,l=(0,s.c)(5);l[0]===Symbol.for("react.memo_cache_sentinel")?(e=JSON.stringify(J.i1),t=JSON.stringify(J.ph),r=JSON.stringify(J.aL),l[0]=e,l[1]=t,l[2]=r):(e=l[0],t=l[1],r=l[2]),l[3]===Symbol.for("react.memo_cache_sentinel")?(a=JSON.stringify(J.oL),l[3]=a):a=l[3];let o="(() =>
1 {\n try {\n var regionCookieName = ".concat(e,";\n var consentKey = ").concat(t,";\n var consentVersion = ").concat(r,";\n var maxAge = ").concat(J.bb,";\n var region = null;\n var match = document.cookie.split(';').find(function (cookie) {\n return cookie.trim().startsWith(regionCookieName + '=');\n });\n if (match) {\n region = match.split('=')[1];\n }\n var isEU = region === ").concat(a,";\n if (!region) {\n isEU = true;\n }\n var stored = null;\n try {\n stored = JSON.parse(localStorage.getItem(consentKey) || '');\n } catch (e) {}\n var hasConsent =\n stored &&\n stored.version === consentVersion &&\n typeof stored.timestamp === 'number' &&\n Date.now() - stored.timestamp <= maxAge;\n var marketing = hasConsent ? !!stored.marketing : false;\n var analytics = hasConsent ? !!stored.analytics : false;\n var adState = (!isEU || marketing) ? 'granted' : 'denied';\n var analyticsState = (!isEU || analytics) ? 'granted' : 'denied';\n window.dataLayer = window.dataLayer || [];\n window.gtag = window.gtag || function(){window.dataLayer.push(arguments);};\n window.gtag('consent', 'default', {\n ad_storage: adState,\n ad_user_data: adState,\n ad_personalization: adState,\n analytics_storage: analyticsState,\n wait_for_update: 500\n });\n } catch (e) {}\n })();");return l[4]===Symbol.for("react.memo_cache_sentinel")?(n=(0,i.jsx)(F.default,{id:"cookie-consent-init",strategy:"beforeInteractive",dangerouslySetInnerHTML:{__html:o}}),l[4]=n):n=l[4],n}}}]);
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.