PageSourceSearch

https://www.metadata2go.com/build/554205.c344e069.js

js metadata2go.com collected 2026-09-24 18:20:44 UTC 63,011 bytes, 4 lines download raw bytes

1"use strict";
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3d02025d-7a72-5925-845f-55b7f36166e1")}catch(e){}}();
3(globalThis.webpackChunksat_monorepo=globalThis.webpackChunksat_monorepo||[]).push([[554205],{825366(e,t,o){o.d(t,{Cm:()=>y,GE:()=>l,GY:()=>m,Ri:()=>f,SM:()=>w,UP:()=>k,Wn:()=>i,ah:()=>n,az:()=>v,fR:()=>c,fv:()=>b,jX:()=>h,m5:()=>s,n8:()=>d,pB:()=>u,pR:()=>g,rw:()=>p,sZ:()=>r,sk:()=>a});const a="draft",r="processing",l="completed",i="failed",n="cancelled",s="zip",u="download",d="not_found",c="unauthorized",p=[{name:"Preview Text",path:"/no_job_id/no_output_id/txt",type:"preview_txt",extension:"txt"},{name:"Preview Image",path:"/no_job_id/no_output_id/image",type:"preview_image",extension:"jpg"},{name:"Preview Image",path:"/no_job_id/no_output_id/image",type:"preview_image",extension:"jpeg"},{name:"Preview Image",path:"/no_job_id/no_output_id/image",type:"preview_image",extension:"png"},{name:"Preview Image",path:"/no_job_id/no_output_id/image",type:"preview_image",extension:"gif"},{name:"Preview Image",path:"/no_job_id/no_output_id/image",type:"preview_image",extension:"webp"},{name:"Preview Image",path:"/no_job_id/no_output_id/image",type:"preview_image",extension:"bmp"},{name:"Preview Image",path:"/no_job_id/no_output_id/image",type:"preview_image",extension:"svg"},{name:"Preview PDF",path:"/no_job_id/no_output_id/pdf",type:"preview_pdf",extension:"pdf"}],v=new Set(["jpg","jpeg","png","pdf","odp","ods","odt","3g2","3gp","avi","flac","flv","mkv","mov","mp3","mp4","mpg","ogg","ogv","webm","wmv","azw","azw3","azw4","epub","fb2","lit","lrf","mobi","pdb","bmp","eps","exr","gif","ico","svg","tga","tif","tiff","webp"]),f=[{name:"Metadata",path:"/no_job_id/no_output_id/metadata",type:"metadata",category:"metadata",target:"json",operation:"",dismissable:!1},{name:"Compare Video",path:"/no_job_id/no_output_id/compare-video",type:"compare_video",category:"operation",target:"compare-video",operation:"",dismissable:!1},{name:"Compare Image",path:"/no_job_id/no_output_id/compare-image",type:"compare_image",category:"operation",target:"compare-image",operation:"",dismissable:!1},{name:"Validate PDFA",path:"/no_job_id/no_output_id/validate-pdfa",type:"validate_pdfa",category:"operation",target:"validate-pdfa",operation:"",dismissable:!1},{name:"Hash",path:"/no_job_id/no_output_id/hash",type:"hash",category:"hash",target:null,operation:"",dismissable:!1}],g=209715200,b=2e3,m=60,h=1e3,w=60,k=[{id:"json",label:"JSON",extension:"json",mimeType:"application/json"},{id:"csv",label:"CSV",extension:"csv",mimeType:"text/csv"},{id:"txt",label:"Plain Text",extension:"txt",mimeType:"text/plain"}],y=1500},352664(e,t,o){o.d(t,{b:()=>l});var a=o(683387),r=o(58352);class l{static async create(e){return(await a.A.post("/jobs",e)).data}static async get(e){try{const t=`/jobs/${encodeURIComponent(e)}`;return(await a.A.get(t)).data}catch(e){const t=e?.response?.status;if(401===t||403===t||404===t)return t;throw r.vF.error("ResultApiService.get failed",e),e}}static async delete(e){await a.A.post(`/jobs/${encodeURIComponent(e)}/delete`,{})}static async getShareAccessScope(e){return(await a.A.get(`/jobs/${encodeURIComponent(e)}/share`)).data}static async setShareAccessScope(e,t){await a.A.post(`/jobs/${encodeURIComponent(e)}/share`,t)}static async removeShareAccess(e,t){await a.A.post(`/jobs/${encodeURIComponent(e)}/share/remove-user/${encodeURIComponent(t)}`,{})}static async addShareAccess(e,t){return(await a.A.post(`/jobs/${encodeURIComponent(e)}/share/add-user`,{email:t})).data}static async requestEmailNotification(e,t){await a.A.post(`/jobs/${encodeURIComponent(e)}/notify`,{email:t})}static async cancel(e){await a.A.post(`/jobs/${encodeURIComponent(e)}/cancel`,{})}}},527649(e,t,o){o.d(t,{O5:()=>k,PD:()=>h,VQ:()=>v,_N:()=>m,qD:()=>f,sG:()=>g});o(874423);var a=o(58352),r=o(352664),l=o(961341),i=o(915276),n=o(687192),s=o(680658),u=o(629569),d=o(825366);let c=0,p=new Set;function v(e){p=new Set(e)}function f(e){p.delete(e)}function g(){p.clear()}const b=new Map;function m(e,t){b.set(e,t)}function h(){b.clear()}function w(e){return new Promise(t=>setTimeout(t,e))}class k{static createJob(){return{id:`result-job-${++c}-${Date.now()}`,apiJob:null,state:d.sk,selectedOutputs:[],downloadedOutputs:[],zipJob:null,createdAt:null}}static async initFromApiJobId(e,t,o){e.state=d.sZ;const a=await r.b.get(t);if("number"==typeof a){if(401===a||403===a)return e.state=d.fR,d.fR;if(404===a)return e.state=d.n8,d.n8}return e.apiJob=a,a.created_at&&(e.createdAt=new Date(a.created_at).getTime()),o?.(e),await this.pollUntilComplete(e,0,o)}static async pollUntilComplete(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2?arguments[2]:void 0;if(!e.apiJob)return d.Wn;const l=await r.b.get(e.apiJob.id);if("number"==typeof l)return 401===l||403===l?(e.state=d.fR,d.fR):404===l?(e.state=d.n8,d.n8):t<d.GY?(await w(d.fv),this.pollUntilComplete(e,t+1,o)):(e.state=d.Wn,d.Wn);e.apiJob=l,!e.createdAt&&l.created_at&&(e.createdAt=new Date(l.created_at).getTime()),o?.(e);const i=l.status?.code;return i===d.Wn?(e.state=d.Wn,d.Wn):i===d.ah?(e.state=d.ah,d.ah):i===d.GE?(e.state=d.GE,e.selectedOutputs=l.output.map(e=>e.id),d.GE):t>=d.GY?(a.vF.error("Job polling timed out",{jobId:e.apiJob.id,attempts:t}),e.state=d.Wn,d.Wn):(await w(d.fv),this.pollUntilComplete(e,t+1,o))}static async deleteJob(e){e.apiJob&&await r.b.delete(e.apiJob.id)}static async initFromWorkflowHash(e,t){try{const o=await l.WorkflowService.get(e,"workspace"),a=o.workflow??o,r=a.file_groups??[],i=this.getResultFileGroups(r),n={hash:e,workflow:a,fileGroups:i,jobs:new Map,totalFiles:i.length,completedFiles:0,failedFiles:0};for(const e of n.fileGroups){const t=this.getLatestVersion(e);t&&(t.version>1||this.isGeneratedOutput(e))&&n.completedFiles++}return t(n),n}catch(t){return a.vF.error("Failed to initialise from workflow hash",{hash:e,error:t}),null}}static async pollWorkflow(e,t){try{const o=await l.WorkflowService.get(e.hash,"workspace"),a=o.workflow??o;e.workflow=a;const r=a.file_groups??[],i=this.getResultFileGroups(r);e.fileGroups=i,e.totalFiles=i.length;let n=0,s=0;for(const t of e.fileGroups){const e=this.getLatestVersion(t);e&&(e.version>1||this.isGeneratedOutput(t))?n++:"failed"===t.status&&s++}return e.completedFiles=n,e.failedFiles=s,t(e),e.totalFiles>0&&n+s>=e.totalFiles}catch{return!1}}static mapJobToOutputs(e){const t=e.status?.code,o=t===d.GE?"complete":t===d.Wn?"failed":t===d.ah?"cancelled":"processing";return e.output.map(t=>{const a=this.getExtensionFromUri(t.uri),r=this.getFilenameFromUri(t.uri);let l=o;if(t.status){const e=t.status.toLowerCase();"completed"===e||"complete"===e?l="complete":"failed"===e||"error"===e?l="failed":"cancelled"===e||"canceled"===e?l="cancelled":"processing"!==e&&"pending"!==e&&"queued"!==e||(l="cancelled"===o?"cancelled":"processing")}const i=t.source?.input?.[0],n=i?e.input.find(e=>e.id_api===i||e.id===i):void 0;return{id:t.id,filename:r,extension:a,size:t.size,uri:t.uri,downloadUri:t.download_uri,status:l,sourceJobId:e.id,inputUri:void 0,inputSize:n?.size,metadata:t.metadata,error:"failed"===l?this.getJobErrorMessage(e):void 0}})}static mapWorkflowToOutputs(e){const t=e.fileGroups.every(e=>"failed"===e.status);return e.fileGroups.map(o=>{const a=this.getLatestVersion(o),r=o.versions?.[0],l=void 0,i=this.failedJobForGroup(e,o),n=p.has(o.group_id);if(!a)return{id:o.group_id,filename:o.original_filename,extension:o.original_extension,size:0,uri:"",downloadUri:"",status:t?"failed":n?"queued":"processing",inputUri:r?.uri,inputSize:r?.size,error:t?this.getErrorFromStepOptions(l,i):void 0};const s=this.isGeneratedOutput(o),u=a.version>1||s,c=a.source_job_id,v=(c?e.jobs.get(c):void 0)??i;let f=n?"queued":"processing";u?f="complete":(t||"failed"===o.status||v?.status?.code===d.Wn)&&(f="failed");const g=u?a:void 0;return{id:o.group_id,filename:g?.filename??r?.filename??o.original_filename,extension:g?.extension??r?.extension??o.original_extension,size:g?.size??r?.size??0,uri:g?.uri??"",downloadUri:g?.uri??"",thumbnailUri:g?.variants?.thumbnail?.uri??a.variants?.thumbnail?.uri??r?.variants?.thumbnail?.uri,previewUri:g?.variants?.preview?.uri??a.variants?.preview?.uri??r?.variants?.preview?.uri,status:f,sourceJobId:a.source_job_id??void 0,inputUri:r?.uri,inputSize:r?.size,metadata:a.metadata??r?.metadata??void 0,error:"failed"===f?this.getErrorFromStepOptions(l,v):void 0}})}static getExtensionFromUri(e){const t=e.lastIndexOf(".");return t>=0?e.substring(t+1).toLowerCase():""}static getFilenameFromUri(e){const t=e.lastIndexOf("/");return t>=0?e.substring(t+1):e}static isCompressJob(e){return e.sat?.operation?.includes("compress")??!1}
3static getInputByOutputSource(e,t){return t.input.filter(t=>t.id_api===e.source.input[0]||t.id===e.source.input[0])}static getOutputCompressDiff(e,t){const o=this.getInputByOutputSource(e,t);if(0===o.length)return{diffSize:0,diffPercent:0};const a=o[0].size;return{diffSize:a-e.size,diffPercent:Number((100-100/a*e.size).toFixed(2))}}static getReconvertLink(e,t){const o=e.sat_links?.reconvert??e.sat?.sat_links?.reconvert;if(!o)return null;const a=o.find(e=>e.operation===t);return a?.href?.link??null}static getLatestVersion(e){if(e.versions?.length)return e.versions[e.versions.length-1]}static isGeneratedOutput(e){if(!e.versions||1!==e.versions.length)return!1;const t=e.versions[0];return 1===t.version&&!!t.source_job_id}static getResultFileGroups(e){return e.some(e=>this.isGeneratedOutput(e))?e.filter(e=>this.isGeneratedOutput(e)||(this.getLatestVersion(e)?.version??0)>1):e}static failedJobForGroup(e,t){const o=b.get(t.group_id);return o?e.jobs.get(o):void 0}static async hydrateFailedJobs(e){const t=new Set;for(const o of e.fileGroups){const a=o.status,r=b.get(o.group_id),l=(this.getLatestVersion(o)?.version??0)>1;"failed"!==a||!r||l||e.jobs.has(r)||t.add(r)}if(0===t.size)return!1;const o=await Promise.all([...t].map(async e=>{try{const t=await r.b.get(e);return"number"==typeof t?null:[e,t]}catch(t){return a.vF.warn("Could not fetch the job behind a failed file group",{jobId:e,error:t}),null}}));let l=!1;for(const t of o)t&&(e.jobs.set(t[0],t[1]),l=!0);return l}static failedJobErrorCode(e){for(const t of e.fileGroups){const o=this.failedJobForGroup(e,t),a=o?.errors?.find(e=>"number"==typeof e?.code);if(void 0!==a?.code)return{code:a.code,details:a.details}}return null}static getErrorFromStepOptions(e,t){if(e){if("number"==typeof e.code&&i.KP[e.code]){const t=i.KP[e.code];try{return(0,n.H4)(t).title}catch{}}if(e.message)return(0,u.$)(e.message)}return t?this.getJobErrorMessage(t):this.FALLBACK_MESSAGE}static getJobErrorMessage(e){if(!e)return this.FALLBACK_MESSAGE;const t=e.errors;if(t?.length){const e=t[0],o=(0,s.KX)(e.code,e.details);if("number"==typeof o&&i.KP[o]){const t=i.KP[o];try{return(0,n.H4)(t,void 0,(0,s.oc)(e.details)).title}catch{}}if(e.message)return(0,u.$)(e.message)}return e.status?.info?(0,u.$)(e.status.info):this.FALLBACK_MESSAGE}}k.FALLBACK_MESSAGE="Something went wrong"},524888(e,t,o){o.d(t,{m:()=>s});var a=o(410810),r=o(750953),l=o(120641),i=o(825366),n=o(606265);const s=(0,a.nY)("resultPage",()=>{const e=(0,r.KR)("job"),t=(0,r.KR)(null),o=(0,r.KR)(null),a=(0,r.KR)([]),s=(0,r.KR)(new Set),u=(0,r.KR)([]),d=(0,r.KR)(null),c=(0,r.KR)(!1),p=(0,r.KR)(!1),v=(0,r.KR)(!1),f=(0,r.KR)(!1),g=(0,r.KR)(new Set),b=(0,r.KR)(null),m=(0,r.KR)(!1),h=(0,r.KR)(new Set),w=(0,l.EW)(()=>t.value?.state??""),k=(0,l.EW)(()=>{if("workflow"===e.value)return a.value.some(e=>"processing"===e.status||"queued"===e.status);const t=w.value;return""!==t&&t!==i.GE&&t!==i.Wn&&t!==i.ah&&t!==i.fR&&t!==i.n8}),y=(0,l.EW)(()=>"workflow"===e.value?a.value.length>0&&a.value.every(e=>"processing"!==e.status&&"queued"!==e.status):w.value===i.GE),_=(0,l.EW)(()=>"workflow"!==e.value&&w.value===i.Wn),F=(0,l.EW)(()=>m.value||w.value===i.ah),S=(0,l.EW)(()=>w.value===i.n8),I=(0,l.EW)(()=>w.value===i.fR),C=(0,l.EW)(()=>a.value.length),P=(0,l.EW)(()=>C.value>0),x=(0,l.EW)(()=>a.value.filter(e=>"complete"===e.status).length),R=(0,l.EW)(()=>a.value.filter(e=>"failed"===e.status).length),E=(0,l.EW)(()=>a.value.filter(e=>"cancelled"===e.status).length),U=(0,l.EW)(()=>0===C.value?0:Math.round(x.value/C.value*100)),j=(0,l.EW)(()=>s.value.size),W=(0,l.EW)(()=>P.value&&s.value.size===C.value),A=(0,l.EW)(()=>a.value.filter(e=>s.value.has(e.id))),O=(0,l.EW)(()=>u.value.find(e=>e.id===d.value)??null);function K(e){const t=(o=e,m.value&&0!==h.value.size?o.map(e=>h.value.has(e.id)&&"complete"!==e.status?{...e,status:"cancelled",error:void 0}:e):o);var o;a.value=t,s.value=new Set(t.filter(e=>"complete"===e.status).map(e=>e.id))}return{mode:e,currentJob:t,currentWorkflow:o,outputs:a,selectedOutputIds:s,openTabs:u,activeTabId:d,isMobile:c,isInitialized:p,isZipping:v,feedbackSubmitted:f,shownHints:g,redoUrl:b,cancelledByUser:m,jobState:w,isLoading:k,isComplete:y,isFailed:_,isCancelled:F,isNotFound:S,isUnauthorized:I,outputCount:C,hasOutputs:P,completedCount:x,failedCount:R,cancelledCount:E,processingProgress:U,selectedCount:j,allSelected:W,selectedOutputs:A,activeTab:O,setMode:function(t){e.value=t},setJob:function(e){t.value=e,(0,n.d)().setJobWarnings(e.apiJob?.
3warnings)},setWorkflow:function(e){o.value=e},setOutputs:K,markCancelled:function(e){m.value=!0,h.value=new Set(e),K(a.value)},updateOutputStatus:function(e,t,o){const r=a.value.find(t=>t.id===e);r&&(r.status=t,o&&(r.error=o),"complete"===t&&s.value.add(e))},openTab:function(e){u.value.some(t=>t.path===e.path)||u.value.push(e),d.value=e.id},closeTab:function(e){const t=u.value.findIndex(t=>t.id===e);if(-1===t)return;u.value[t].dismissable&&(u.value.splice(t,1),d.value===e&&(d.value=u.value[0]?.id??null))},toggleOutput:function(e){const t=a.value.find(t=>t.id===e);"failed"!==t?.status&&"cancelled"!==t?.status&&(s.value.has(e)?s.value.delete(e):s.value.add(e))},selectAll:function(){s.value=new Set(a.value.filter(e=>"failed"!==e.status&&"cancelled"!==e.status).map(e=>e.id))},clearSelection:function(){s.value=new Set},markFeedbackSubmitted:function(){f.value=!0},markHintShown:function(e){g.value.add(e)},updateMobile:function(){c.value=window.matchMedia("(max-width: 820px)").matches},$reset:function(){e.value="job",t.value=null,o.value=null,a.value=[],s.value=new Set,u.value=[],d.value=null,p.value=!1,v.value=!1,f.value=!1,g.value=new Set,b.value=null,m.value=!1,h.value=new Set}}})},846990(e,t,o){o.d(t,{W:()=>N});o(874423);var a=o(952629),r=o(846319),l=o(152810),i=o(961341),n=o(914126),s=o(953760),u=o(58352),d=o(960082),c=o(946419),p=o(868895),v=o(606265),f=o(527649),g=o(680658),b=o(687192),m=o(575647),h=o(571244),w=o(534750),k=o(400588),y=o(657448),_=o(500893),F=o(178966),S=o(661507),I=o(878773),C=o(306218),P=o(269978),x=o(850282);function R(e){return e.reduce((e,t)=>e+(t.uploaded?100:t.uploadProgress??0),0)}var E=o(189603);const U=u.J6.getInstance().createContextLogger("FeatureConversionService");function j(e,t){if("integer"!==t&&"number"!==t)return e;if("string"!=typeof e||""===e.trim())return e;const o=Number(e);return Number.isFinite(o)?"integer"===t?Math.trunc(o):o:e}const W={"com.video2edit.resizevideo":S.$T,"com.video2edit.compressvideo":S.D$,"com.video2edit.normalizeaudio":S.cl,"com.video2edit.cut":e=>(0,S.p3)(e).options},A={"com.compress2go.compressimage":e=>(0,I.E3)(e),"com.compress2go.compressvideo":e=>(0,I.MW)(e),"com.compress2go.compresspdf":e=>(0,I.rX)(e),"com.compress2go.compresstojpg":e=>(0,I.rc)(e,"jpg"),"com.compress2go.compresstopng":e=>(0,I.rc)(e,"png"),"com.compress2go.zip":e=>(0,I.P5)(e,"zip"),"com.compress2go.archive":e=>(0,I.P5)(e,e.target||"zip")},O={...E.sg,"com.pdf2go.deletepdfassets":E.Fo,"com.pdf2go.extractassets":E.$6},K=new Set(["com.video2edit.converttomp4","com.video2edit.converttowebm","com.video2edit.converttomov","com.video2edit.converttovideo","convert-from-video"]);function L(e,t,o,a){let r;if("compress-image"===e||"com.img2go.compressimage"===e)r=(0,y.buildConversionOptions)(t);else if("resize-image"===e||"com.img2go.resizeimage"===e)r=function(e){const t=e.mode,o={};"dimensions"===t?(null!=e.width&&(o.width=e.width),null!=e.height&&(o.height=e.height),e.resize_by&&(o.resize_by=e.resize_by),null!=e.dpi&&(o.dpi=e.dpi),o.resize_handling=e.resize_handling||"stretch"):"percentage"===t?(o.width=e.scale,o.height=e.scale,o.resize_by="perc"):"aspect-ratio"===t?(o.aspect_ratio=e.aspect_ratio,o.resize_handling=e.resize_handling||"keep_aspect_ratio_crop"):"device"===t?o.width=e.device_width||768:"social"===t&&(o.width=e.social_width||1080,o.height=e.social_height||1080,o.dpi=96,o.resize_handling=e.resize_handling||"keep_aspect_ratio_crop");e.target_format&&"auto"!==e.target_format&&(o.resize_target=e.target_format);return o}(t);else if("ai-upscale-image"===e||"upscale-image"===e)r=function(e){const t=e.mode,o={};"factor"===t?o.upscale_factor=e.upscale_factor||"2x":"pixel"===t?(o.resize_unit="px",null!=e.width&&(o.width=e.width),null!=e.height&&(o.height=e.height)):"percentage"===t&&(o.resize_unit="perc",o.width=e.percentage);e.target_format&&"auto"!==e.target_format&&(o.target_format=e.target_format);return o}(t);else if(W[e])r=W[e](t);else if(A[e])r=A[e](t);else if(O[e])r=O[e](t);else{const{mode:o,target:a,category:l,...i}=t,n={};for(const[e,t]of Object.entries(i))null!=t&&"null"!==t&&(n[e]=t);r=n,K.has(e)&&Object.assign(r,(0,S.au)(t))}return function(e,t,o){if(!e||!t)return o;const a=(0,F.$E)(e,t);if(!a)return o;const r=new Set(Object.keys(a)),l={},i=[];for(const[e,t]of Object.entries(o))r.has(e)?l[e]=j(t,a[e]?.type):i.push(e);return i.length>0&&U.warn("Stripped unknown conversion options",{category:e,target:t,stripped:i}),l}(o,a,r)}function G(e,t,o,a,l){const i=E.Uz[e];if(i){const e=i(t);if(e&&Object.keys(e).length>0)return e}return(0,r.bJ)(l,a,o)}function D(e){const{category:t,target:o}=e.appOptions.value;return"string"==typeof t&&""!==t?"string"!=typeof o||""===o?(U.warn("Ignoring settings-panel category override with no target",{category:t}),null):{category:t,target:o}:function(e){if("com.video2edit.cut"!==e.config.value?.appId)return null;const{category:t,target:o}=(0,S.p3)(e.appOptions.value);return{category:t,target:o}}(e)}function T(e,t){return D(t)?.category??e.category}function M(e,t){const o=D(t);if(o)return o.target;if(e.target)return e.target;const a=t.appOptions.value.target;if("string"==typeof a&&""!==a)return a;
3if(e.firstExtensionAsTarget){const o=t.files.value[0]?.name??"",a=o.includes(".")?o.split(".").pop().toLowerCase():"",r=T(e,t);if(a&&r&&(0,F.$E)(r,a))return a}return e.target}let J=null,z=null,B=null,H=null;function $(){if(!H){const e=(0,m.useUserStore)(h.G);H=e.fetchUser().then(()=>{}).catch(e=>{throw H=null,e})}return H}class N{static async ensureJob(){await $();const e=(0,k.F)();if(e.job.value)return e.job.value;if(J)return J;const t=e.config.value;if(!t)throw new Error("Feature configuration missing");J=(async()=>{U.debug("Creating job",{operation:t.operation});const o=await a.JobService.create(t.operation);if(!(o.id||o.sat?.id_job))throw new Error("Failed to create job — no job ID returned");e.setJob(o);const r=o.sat?.product?.constraints;return r&&e.setConstraints(r),o})();try{return await J}finally{J=null}}static async ensureWorkflow(){await $();const e=(0,k.F)();if(e.workflowHash.value)return e.workflowHash.value;if(z)return z;z=(async()=>{U.debug("Creating workflow");const t=await i.WorkflowService.create({origin:"auto"});if(!t.hash)throw new Error("Failed to create workflow — no hash returned");return e.setWorkflowHash(t.hash),t.hash})();try{return await z}finally{z=null}}static isFileCountAllowed(){const e=(0,k.F)(),t=e.maxInputCount.value;return!(t&&e.files.value.length>=t)||(U.debug("File count limit reached",{current:e.files.value.length,max:t}),!1)}static async ensureConstraints(){await $();const e=(0,k.F)();if(e.constraints.value)return;if(B)return void await B;const t=e.config.value;if(t){B=(async()=>{if(t.useWorkflow){const t=await a.JobService.create((0,p.b)("initialupload"),{conversion:[{target:"mirror",category:"mirror",options:{}}]},!1),o=t.sat?.product?.constraints??t.sat?.constraints??null;o&&(U.debug("Constraints loaded from mirror job",{constraints:o}),e.setConstraints(o)),n.U.setPreCreatedJob(t)}else await this.ensureJob()})();try{await B}catch(e){U.error("Failed to pre-fetch constraints",{error:e})}finally{B=null}}}static showFileLimitError(){const e=(0,k.F)(),t=(0,v.d)(),o=(0,m.useUserStore)(h.G),a=o.isLoggedIn?"free"===o.userTier.toLowerCase()?"free":"premium":"unregistered";t.setActiveError((0,b.tX)(a,e.maxInputCount.value))}static applyWorkflowConstraints(e){const t=(0,k.F)();!t.constraints.value&&e.constraints&&t.setConstraints(e.constraints)}static beginUpload(e){"converting"!==e.status.value&&e.setStatus("uploading")}static async uploadFile(e){const t=(0,k.F)(),o=t.config.value;try{if(this.beginUpload(t),o?.useWorkflow){const o=await this.ensureWorkflow(),a=Date.now(),r=await n.U.uploadFileToWorkflow(e.file,o,o=>{const r=o.loaded,l=o.total??e.file.size,i=(Date.now()-a)/1e3,n=i>0?r/i:0,s=n>0?(l-r)/n:-1;t.updateFileProgress(e.id,r,l,n,s)});this.applyWorkflowConstraints(r),t.setFileGroupId(e.id,r.fileGroupId),t.markFileUploaded(e.id,r.thumbnailUri),this.pollThumbnailForEntry(o,r.uploadedFileId,e.id)}else{const o=await this.ensureJob();await l.UploadService.uploadFile(o,e.file,{onProgress:o=>{t.updateFileProgress(e.id,o.bytesUploaded,o.bytesTotal,o.speed,o.timeRemaining)}}),t.markFileUploaded(e.id)}}catch(o){if(U.error("File upload failed",{fileId:e.id,error:o}),o instanceof l.Di)return P.A.track("upload:fail",{reason:o.message.substring(0,200),file_type:e.file.type||"unknown",status_code:String(o.httpStatus)}),t.markFileError(e.id,o.message,!1),void this.handleConversionError(o);const a=o instanceof Error?o.message:"Upload failed",r=e.retryCount>=this.MAX_UPLOAD_RETRIES,i=C.L.t("Upload failed due to a connection problem. Please check your internet connection and try again.");r?(P.A.track("upload:fail",{reason:a.substring(0,200),file_type:e.file.type||"unknown",retries:String(e.retryCount)}),t.markFileError(e.id,i,!1),this.handleConversionError(o)):t.markFileError(e.id,i,!0)}}static async retryUpload(e){const t=(0,k.F)(),o=t.getFileById(e);o&&(P.A.track("upload:retry",{file_type:o.file.type||"unknown",location:"feature_page"}),t.resetFileForRetry(e),await this.uploadFile(o))}static async runConversion(){const e=(0,k.F)(),t=e.config.value;if(!t)return void e.setError("Feature configuration missing");if(0===e.files.value.length)return void e.setError("No files to convert");const o=e.maxInputCount.value;if(o&&e.files.value.length>
3o)return U.debug("Conversion blocked: file count exceeds limit",{files:e.files.value.length,max:o}),void this.showFileLimitError();try{if(e.setStatus("converting"),!e.allFilesUploaded.value){U.debug("Waiting for pending uploads to complete");const t=new Set(e.files.value.filter(e=>e.error).map(e=>e.id)),o=function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),a=t,r=o;return{check(t){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();return t!==a&&(a=t,r=o),o-r>e},stalledForMs(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now())-r},get lastProgress(){return a}}}(this.UPLOAD_STALL_TIMEOUT_MS,R(e.files.value));if(await new Promise(a=>{const r=()=>{if(e.allFilesUploaded.value)return void a(!1);const l=o.check(R(e.files.value));return e.files.value.some(e=>e.error&&!t.has(e.id))?(U.debug("Aborting conversion: an upload failed during this attempt"),void a(!0)):"converting"===e.status.value?l?(U.error("Aborting conversion: upload stalled",{stalledForMs:o.stalledForMs(),progressPercentSum:o.lastProgress}),this.handleConversionError(new Error("Timed out waiting for uploads to complete")),void a(!0)):void setTimeout(r,200):void a(!0)};r()}))return U.debug("Conversion cancelled while waiting for uploads"),void("converting"===e.status.value&&e.setStatus("ready"))}if("converting"!==e.status.value)return void U.debug("Conversion cancelled");if("design"===t.resultMode||"fileview"===t.resultMode)return void await this.redirectToWorkspace(t,e);await this.executeConversionWithRetry(t,e)}catch(e){U.error("Conversion failed",{error:e}),this.handleConversionError(e)}}static async executeConversionWithRetry(e,t){const o=Date.now();let a=0;for(;;)try{return void(e.useWorkflow?await this.runWorkflowConversion(e,t):await this.runJobConversion(e,t))}catch(e){const r=Date.now()-o;if(!this.isRetryableConversionError(e)||r>=this.MAX_CONVERSION_RETRY_DURATION_MS)throw e;a++;const l=this.getConversionRetryDelay(e,a);if(U.warn(`Conversion attempt ${a} failed, retrying in ${l}ms`,{error:(0,x.g)(e),elapsed:r,delay:l}),P.A.track("conversion:auto_retry",{attempt:String(a),delay_ms:String(l),elapsed_ms:String(r),reason:e instanceof Error?e.message.substring(0,200):"unknown",is_429:String(429===this.getErrorStatus(e))}),"converting"!==t.status.value)return;if(await new Promise(e=>setTimeout(e,l)),"converting"!==t.status.value)return}}static isRetryableConversionError(e){if(!e||"object"!=typeof e)return!1;if(!0===e.isNetworkError)return!0;const t=this.getErrorStatus(e);return 429===t||void 0!==t&&t>=500&&t<600}static getConversionRetryDelay(e,t){const o=3e4;if(429===this.getErrorStatus(e)){const a=this.extractRetryAfterSeconds(e);return null!==a?Math.min(1e3*a,o):Math.min(1e4*Math.pow(2,t-1),o)}return Math.min(5e3*Math.pow(2,t-1),o)}static getErrorStatus(e){if(!e||"object"!=typeof e)return;const t=e;return"number"==typeof t.status?t.status:void 0}static extractRetryAfterSeconds(e){if(!e||"object"!=typeof e)return null;const t=e.response;if(t?.headers){const e=t.headers["retry-after"];if(e){const t=parseInt(e,10);if(!isNaN(t)&&t>0&&t<=300)return t}}return null}static handleConversionError(e){const t=(0,k.F)(),o=(0,v.d)(),a=(0,g.fe)(e);P.A.track("conversion:error",{error_type:a.errorType,category:a.category,message:(0,x.g)(e).substring(0,200),file_count:String(t.files.value.length),is_network:String("network_error"===a.errorType)});const r=(0,m.useUserStore)(h.G),l=r.isLoggedIn?"free"===r.userTier.toLowerCase()?"free":"premium":"unregistered",i=(0,b.dn)(a.errorType,l,a.context);o.setActiveError(i),t.setStatus("ready")}static async runJobConversion(e,t){const o=await this.ensureJob(),r=o.id||o.sat?.id_job;if(!r)throw new Error("No job ID available");const l=M(e,t),i=T(e,t),n=L(e.appId,t.appOptions.value,i,l),s=G(e.appId,t.appOptions.value,n,i,l),u={target:l,category:i,options:n,...s?{metadata:s}:{}};U.debug("Starting job conversion",{target:l,category:i,options:n}),await a.JobService.startConversion(o,u),U.debug("Polling for completion",{jobId:r});const p=await a.JobService.waitUntilComplete(o);if(a.JobService.isJobFailed(p))throw(0,w.C)(p);
3if((0,g.vY)(p.warnings))throw{isNsfwBlocked:!0,jobId:r,warnings:p.warnings,message:"Content blocked due to inappropriate material"};(0,v.d)().setJobWarnings(p.warnings);if("redirect"===e.resultMode||!e.resultMode&&e.redirectToResult){const t=e.resultUrl||window.sat?.resultUrl||"";if(t){const e=encodeURIComponent(window.location.pathname);return U.debug("Redirecting to result page",{resultUrl:t,jobId:r}),void(window.location.href=`${t}#j=${r}&redo=${e}`)}}const f=a.JobService.getPrimaryOutput(p),b=a.JobService.getDownloadUrls(p),m=p.sat?.download_password;m&&d.k.isDownloadPasswordEnabled()&&(await c.a.init(),c.a.setPassword(r,m)),t.setResult({jobId:r,downloadUrls:b,isWorkflow:!1,files:b.map((e,t)=>({filename:f?.filename||`output-${t+1}`,extension:(f?.filename||"").split(".").pop()||"",uri:e,size:f?.size??0})),primaryOutput:f?{uri:f.download_uri||f.uri,renderUri:f.uri,filename:f.filename||"output",size:f.size}:null})}static getMaxConcurrency(){const e=(0,m.useUserStore)(h.G);return e.isLoggedIn?"free"===e.userTier.toLowerCase()?2:3:1}static async runWorkflowConversion(e,t){const o=t.workflowHash.value;if(!o)throw new Error("No workflow hash available");const r=M(e,t),l=T(e,t),n=L(e.appId,t.appOptions.value,l,r);U.debug("Starting workflow conversion",{hash:o,operation:e.operation,category:l,options:n});const s=await i.WorkflowService.getFileGroups(o);if(!s.length)throw new Error("No files found in workflow");const u=new Set(t.files.value.map(e=>e.fileGroupId).filter(e=>!!e)),d=u.size>0?s.filter(e=>u.has(e.group_id)):s,c=s.map(e=>e.group_id).filter(e=>!d.some(t=>t.group_id===e));for(const e of c)i.WorkflowService.deleteFileGroup(o,e).catch(t=>{U.warn("Failed to delete orphan file group",{groupId:e,error:t})});if(!d.length)throw new Error("No files found in workflow");const p=G(e.appId,t.appOptions.value,n,l,r),b={target:r,category:l,options:n,...p?{metadata:p}:{}};if("redirect"===e.resultMode||!e.resultMode&&e.redirectToResult){const t=e.resultUrl||window.sat?.resultUrl||"";if(t){const e=encodeURIComponent(window.location.pathname);return U.debug("Redirecting to result page (workflow)",{resultUrl:t,hash:o}),void(window.location.href=`${t}#w=${o}&redo=${e}`)}}U.debug("Setting inline result for workflow",{hash:o}),(0,f.VQ)(d.map(e=>e.group_id)),(0,f.PD)(),t.setResult({jobId:o,downloadUrls:[],isWorkflow:!0,files:[],primaryOutput:null});const m=this.getMaxConcurrency(),h=new Set;for(const t of d){const r=t.versions[t.versions.length-1];if(!r){U.warn("File group has no versions, skipping",{groupId:t.group_id}),(0,f.qD)(t.group_id);continue}h.size>=m&&await Promise.race(h),(0,f.qD)(t.group_id);const l=(async()=>{const l=await a.JobService.create(e.operation,{workflow_hash:o,input_file_ids:[r.file_id]},!0);if(!l?.id&&!l?.sat?.id_job)throw new Error(`Failed to create job for file group ${t.group_id}`);U.debug("Created job for file group",{jobId:l.id||l.sat?.id_job,groupId:t.group_id}),(0,f._N)(t.group_id,l.id||l.sat?.id_job),await a.JobService.addInputs(l,{type:"remote",source:r.uri,filename:r.filename}),await a.JobService.startConversion(l,b)})().then(()=>{h.delete(l)},e=>{h.delete(l),U.error("Job failed for file group",{groupId:t.group_id,error:(0,x.g)(e)}),P.A.track("conversion:file_group_error",{group_id:t.group_id,error:(0,x.g)(e).substring(0,200),status:String(e?.status??0)}),(0,v.d)().hasActiveError||"payment_limit"!==(0,g.fe)(e).category||this.handleConversionError(e)});h.add(l)}await Promise.all(h),(0,f.sG)(),U.debug("All file group jobs started",{hash:o,fileGroupCount:d.length})}static async redirectToWorkspace(e,t){const o=t.workflowHash.value;if(!o)throw new Error("Workspace redirect requires a workflow — no workflow hash available");const a=e.workspaceUrl||"/workspace/canvas",r="fileview"===e.resultMode?"fileview":"design";let l=`${a}/${o}?mode=${r}`;if(e.workspaceApp){l+=`&app=${encodeURIComponent(e.workspaceApp)}`,e.workspaceAutoStart&&(l+="&autostart=1");const o=(0,_.b6)(e.workspaceApp,t.appOptions.value);o&&(l+=`&${_.Oh}=${o}`)}U.debug(`Redirecting to workspace (${r} mode)`,{workspaceUrl:l,hash:o}),window.location.href=l}
3static pollThumbnailForEntry(e,t,o){if(!t)return;const a=(0,k.F)(),r=a.getFileById(o);r?.previewUrl||i.WorkflowService.pollUntilVariantsReady(e).then(e=>{const r=(e.latest_files??[]).find(e=>e.file_id===t),l=r?(0,s.x7)(r):null;l&&a.setFilePreviewUrl(o,l)}).catch(o=>{U.warn("Thumbnail polling failed",{workflowHash:e,uploadedFileId:t,err:o})})}static async addSampleFile(e){const t=(0,k.F)(),o=t.config.value,r=e.split("/").pop()||"sample.png";if(await this.ensureConstraints(),!this.isFileCountAllowed())return U.debug("Sample file rejected: file count limit reached"),void this.showFileLimitError();const l=new File([],r,{type:"application/octet-stream"}),i=t.addFile(l,"sample");try{if(this.beginUpload(t),o?.useWorkflow){const o=await this.ensureWorkflow(),a=await n.U.uploadRemoteUrlToWorkflow(e,o,r);return this.applyWorkflowConstraints(a),t.setFileGroupId(i.id,a.fileGroupId),t.markFileUploaded(i.id,a.thumbnailUri),void this.pollThumbnailForEntry(o,a.uploadedFileId,i.id)}const l=await this.ensureJob(),s={type:"remote",source:e,filename:r};await a.JobService.addInputs(l,s),t.markFileUploaded(i.id)}catch(o){U.error("Failed to load sample file",{url:e,error:o});const a=o instanceof Error?o.message:"Failed to add sample file";t.markFileError(i.id,a)}}static async addRemoteInput(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"remote";const r=(0,k.F)(),l=r.config.value,i=t||e.split("/").pop()||"file";if(await this.ensureConstraints(),!this.isFileCountAllowed())return U.debug("Remote input rejected: file count limit reached",{url:e}),void this.showFileLimitError();const s=new File([],i,{type:"application/octet-stream"}),u=r.addFile(s,o),d="dropbox"===o||"onedrive"===o;d&&P.A.track("upload:cloud_file_start",{provider:o});try{if(this.beginUpload(r),l?.useWorkflow){const t=await this.ensureWorkflow(),a=await n.U.uploadRemoteUrlToWorkflow(e,t,i);return this.applyWorkflowConstraints(a),r.setFileGroupId(u.id,a.fileGroupId),r.markFileUploaded(u.id,a.thumbnailUri),this.pollThumbnailForEntry(t,a.uploadedFileId,u.id),void(d&&P.A.track("upload:cloud_file_complete",{provider:o}))}const t=await this.ensureJob();await a.JobService.addExternalUrl(t,e),r.markFileUploaded(u.id),d&&P.A.track("upload:cloud_file_complete",{provider:o})}catch(t){U.error("Failed to add remote input",{url:e,error:t});const a=t instanceof Error?t.message:"Failed to add remote file";r.markFileError(u.id,a),d&&P.A.trackError("upload:cloud_file_fail",t,{provider:o})}}static async addInputById(e,t){const o=(0,k.F)(),r=o.config.value,l=t||"file",i=new File([],l,{type:"application/octet-stream"}),s=o.addFile(i,"remote");try{if(this.beginUpload(o),r?.useWorkflow){const t=await this.ensureWorkflow(),a=await n.U.uploadInputIdToWorkflow(e,t,l);return o.setFileGroupId(s.id,a.fileGroupId),void o.markFileUploaded(s.id)}const t=await this.ensureJob();await a.JobService.addInputId(t,e),o.markFileUploaded(s.id)}catch(t){U.error("Failed to add input by ID",{inputId:e,error:t});const a=t instanceof Error?t.message:"Failed to add input";o.markFileError(s.id,a)}}static async addGoogleDriveInput(e,t,o,r){const l=(0,k.F)(),i=l.config.value;if(await this.ensureConstraints(),!this.isFileCountAllowed())return U.debug("Google Drive input rejected: file count limit reached",{fileId:e}),void this.showFileLimitError();const s=new File([],t,{type:"application/octet-stream"}),u=l.addFile(s,"gdrive");P.A.track("upload:cloud_file_start",{provider:"gdrive"});try{if(this.beginUpload(l),i?.useWorkflow){const a=await this.ensureWorkflow(),i=await n.U.uploadGoogleDriveToWorkflow(e,r,a,t,o);return this.applyWorkflowConstraints(i),l.setFileGroupId(u.id,i.fileGroupId),l.markFileUploaded(u.id,i.thumbnailUri),this.pollThumbnailForEntry(a,i.uploadedFileId,u.id),void P.A.track("upload:cloud_file_complete",{provider:"gdrive"})}const s=await this.ensureJob();await a.JobService.addCloudInput(s,{type:"gdrive_picker",source:e,credentials:{token:r},filename:t,content_type:o}),l.markFileUploaded(u.id),P.A.track("upload:cloud_file_complete",{provider:"gdrive"})}catch(t){U.error("Failed to add Google Drive input",{fileId:e,error:t});const o=t instanceof Error?t.message:"Failed to add Google Drive file";l.markFileError(u.id,o),P.A.trackError("upload:cloud_file_fail",t,{provider:"gdrive"})}}static async removeFile(e){const t=(0,k.F)(),o=t.config.value,a=t.files.value.find(t=>
3t.id===e);if(t.removeFile(e),0!==t.files.value.length){if(o?.useWorkflow&&a?.fileGroupId&&t.workflowHash.value)try{await i.WorkflowService.deleteFileGroup(t.workflowHash.value,a.fileGroupId),U.debug("Deleted workflow file group",{groupId:a.fileGroupId})}catch(e){U.warn("Failed to delete workflow file group",{groupId:a.fileGroupId,error:e})}}else await this.deleteBackendResources()}static async clearAllFiles(){const e=(0,k.F)(),t=e.files.value.map(e=>e.id);for(const o of t)e.removeFile(o);await this.deleteBackendResources()}static async deleteBackendResources(){const e=(0,k.F)();try{e.workflowHash.value?(await i.WorkflowService.delete(e.workflowHash.value),U.debug("Deleted workflow",{hash:e.workflowHash.value})):e.jobId.value&&(await a.JobService.delete(e.jobId.value),U.debug("Deleted job",{jobId:e.jobId.value}))}catch(e){U.warn("Failed to delete backend resource",{error:e})}e.jobId.value=null,e.job.value=null,e.workflowHash.value=null}}N.MAX_UPLOAD_RETRIES=5,N.UPLOAD_STALL_TIMEOUT_MS=12e4,N.MAX_CONVERSION_RETRY_DURATION_MS=12e4},236345(e,t,o){o.d(t,{v:()=>n});var a=o(683387),r=o(846990),l=o(400588),i=o(58352);class n{static async loadFilesFromUrl(){const e=this.getParam("rj"),t=this.getParam("rw");if(e||t)return void this.restoreInlineResult(e,t);const o=this.getParam("j"),a=this.getParam("w"),l=this.getParam("su"),i=this.getParam("remote_url"),n=this.getParam("external_url");o?await this.loadFromJob(o):a?await this.loadFromWorkflow(a):l&&await this.loadFromStorage(l),i&&await r.W.addRemoteInput(i),n&&n!==i&&await r.W.addRemoteInput(n)}static async loadFromJob(e){try{const t=(await a.A.get(`/jobs/${encodeURIComponent(e)}`)).data;if(!t?.input?.length)return;await Promise.all(t.input.filter(e=>e.id).map(e=>r.W.addInputById(e.id,e.filename)))}catch(e){i.vF.error("FeatureUrlParamsService: failed to load job inputs",e)}}static async loadFromWorkflow(e){try{const t=(await a.A.get(`/workflows/${encodeURIComponent(e)}`)).data,o=(t?.workflow?.file_groups??t?.file_groups??[]).map(e=>{const t=e.versions??[];return t.find(e=>1===e.version)??(t.length>0?t[0]:null)}).filter(e=>null!=e&&!!e.uri);await Promise.all(o.map(e=>r.W.addRemoteInput(e.uri,e.filename)))}catch(e){i.vF.error("FeatureUrlParamsService: failed to load workflow files",e)}}static async loadFromStorage(e){try{const t=await a.A.get(`storage/url/${encodeURIComponent(e)}`),o=t.data?.items??[];await Promise.all(o.filter(e=>e.url).map(e=>r.W.addRemoteInput(e.url,e.name)))}catch(e){i.vF.error("FeatureUrlParamsService: failed to load storage files",e)}}static restoreInlineResult(e,t){const o=e||t||"",a=!!t;(0,l.F)().setResult({jobId:o,downloadUrls:[],isWorkflow:a,files:[],primaryOutput:null}),i.vF.debug("Restored inline result from URL",{jobId:e,workflowHash:t})}static getParam(e){const t=window.location.hash.replace(/^#/,""),o=new URLSearchParams(t).get(e);if(o)return o;return new URLSearchParams(window.location.search).get(e)}}},400588(e,t,o){o.d(t,{F:()=>oe});var a=o(750953),r=o(120641),l=o(785530),i=o(306003),n=o(7111),s=o(212868),u=o(874321);const d=(0,a.KR)("idle"),c=(0,a.KR)([]),p=(0,a.KR)(null),v=(0,a.KR)({}),f=(0,a.KR)(null),g=(0,a.KR)(null),b=(0,a.KR)(null),m=(0,a.KR)(null),h=(0,a.KR)(null),w=(0,a.KR)(null);let k=1,y={};const _=(0,r.EW)(()=>c.value.length),F=(0,r.EW)(()=>c.value.reduce((e,t)=>e+t.size,0)),S=(0,r.EW)(()=>c.value.length>0&&c.value.every(e=>e.uploaded)),I=(0,r.EW)(()=>c.value.length>0&&("ready"===d.value||"idle"===d.value)),C=(0,r.EW)(()=>"converting"===d.value),P=(0,r.EW)(()=>"uploading"===d.value),x=(0,r.EW)(()=>"completed"===d.value&&null!==f.value),R=(0,r.EW)(()=>"failed"===d.value),E=(0,r.EW)(()=>"converting"===d.value&&!S.value),U=(0,r.EW)(()=>p.value?.actionLabel??"Start"),j=(0,r.EW)(()=>{const e=w.value?.job?.inputs?.max_size??w.value?.job?.api?.max_file_size??null;return null!=e&&e>0?e:null}),W=(0,r.EW)(()=>w.value?.job?.inputs?.max_count??null),A=(0,r.EW)(()=>{const e=w.value?.job?.general?.max_size??null;return null!=e&&e>0?e:null});function O(e){"simple"===e.resultMode&&(e.useWorkflow=!1,e.singleFile=!0),p.value=e;const t=(0,l.sO)(e.appId)??(0,l.e_)(e.operation),o=t&&"defaultOptions"in t&&t.defaultOptions&&"object"==typeof t.defaultOptions?{...t.defaultOptions}:{};y={...o,...(0,i.pS)(e.appId,o),...(0,n.rM)(e.appId)},v.value={...y,...v.value}}function K(e){p.value&&(p.value={...p.value,target:e})}function L(e){v.value={...v.value,...e}}function G(e){v.value=e}function D(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"upload";const o="file-"+k++,a={id:o,file:e,name:e.name,size:e.size,source:t,previewUrl:null,uploadProgress:0,uploadSpeed:0,timeRemaining:-1,uploaded:!1,error:null,isRetryable:!1,retryCount:0,fileGroupId:null};return c.value=[...c.value,a],e.type.startsWith("image/")&&e.size>0&&async function(e,t){const o=await(0,s.o)(t);if(!o)return;if(!c.value.some(t=>t.id===e))return void(0,u.D)(o);J(e,o)}(o,e),a}function T(e){const t=c.value.find(t=>
3t.id===e);(0,u.D)(t?.previewUrl),c.value=c.value.filter(t=>t.id!==e),0===c.value.length&&(d.value="idle")}function M(e,t){const o=c.value.find(t=>t.id===e);o&&(o.fileGroupId=t,c.value=[...c.value])}function J(e,t){const o=c.value.find(t=>t.id===e);o&&(o.previewUrl!==t&&(0,u.D)(o.previewUrl),o.previewUrl=t,c.value=[...c.value])}function z(e){return c.value.find(t=>t.id===e)}function B(e,t,o,a,r){const l=c.value.find(t=>t.id===e);l&&(l.uploadProgress=o>0?Math.round(t/o*100):0,l.uploadSpeed=a??l.uploadSpeed,l.timeRemaining=r??l.timeRemaining,c.value=[...c.value])}function H(e,t){const o=c.value.find(t=>t.id===e);o&&(o.uploaded=!0,o.uploadProgress=100,t&&!o.previewUrl&&(o.previewUrl=t),c.value=[...c.value],c.value.every(e=>e.uploaded)&&"converting"!==d.value&&(d.value="ready"))}function $(e,t){let o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const a=c.value.find(t=>t.id===e);a&&(a.error=t,a.isRetryable=o,c.value=[...c.value])}function N(e){const t=c.value.find(t=>t.id===e);t&&(t.retryCount++,t.error=null,t.isRetryable=!1,t.uploaded=!1,t.uploadProgress=0,t.uploadSpeed=0,t.timeRemaining=-1,t.fileGroupId=null,c.value=[...c.value])}function V(e){d.value=e}function X(e){b.value=e}function q(e){m.value=e;const t=e.id||e.sat?.id_job;t&&(b.value=t)}function Y(e){h.value=e}function Z(e){w.value=e}function Q(e){f.value=e,d.value="completed"}function ee(e){g.value=e,d.value="failed"}function te(){let{keepOptions:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(const e of c.value)(0,u.D)(e.previewUrl);d.value="idle",c.value=[],e||(v.value={...y}),f.value=null,g.value=null,b.value=null,m.value=null,h.value=null,w.value=null}function oe(){return{status:d,files:c,config:p,appOptions:v,conversionResult:f,errorMessage:g,jobId:b,job:m,workflowHash:h,constraints:w,fileCount:_,totalSize:F,allFilesUploaded:S,isReady:I,isConverting:C,isUploading:P,isWaitingForUploads:E,hasResult:x,hasFailed:R,actionLabel:U,maxFileSize:j,maxInputCount:W,maxJobSize:A,setConfig:O,setTarget:K,updateAppOptions:L,setAppOptions:G,addFile:D,removeFile:T,setFileGroupId:M,setFilePreviewUrl:J,getFileById:z,updateFileProgress:B,markFileUploaded:H,markFileError:$,resetFileForRetry:N,setStatus:V,setJobId:X,setJob:q,setWorkflowHash:Y,setConstraints:Z,setResult:Q,setError:ee,reset:te}}},7111(e,t,o){o.d(t,{$m:()=>s,Eu:()=>n,Kw:()=>d,OJ:()=>r,VB:()=>l,Y5:()=>g,Zf:()=>c,b7:()=>u,cq:()=>p,kb:()=>f,rM:()=>m,vK:()=>i,wD:()=>v});var a=o(178966);const r=[{value:"ascii",label:"ASCII"},{value:"utf8",label:"UTF-8"},{value:"utf-16",label:"UTF-16"},{value:"cp1250",label:"CP1250 (Central European)"},{value:"cp1251",label:"CP1251 (Cyrillic)"},{value:"cp1252",label:"CP1252 (Western)"},{value:"cp1253",label:"CP1253 (Greek)"},{value:"cp1254",label:"CP1254 (Turkish)"},{value:"cp1257",label:"CP1257 (Baltic)"},{value:"iso8859_1",label:"ISO 8859-1 (Latin-1)"},{value:"iso8859_2",label:"ISO 8859-2 (Latin-2)"},{value:"iso8859_4",label:"ISO 8859-4 (Latin-4)"},{value:"iso8859_5",label:"ISO 8859-5 (Cyrillic)"},{value:"iso8859_7",label:"ISO 8859-7 (Greek)"},{value:"iso8859_9",label:"ISO 8859-9 (Turkish)"},{value:"iso8859_13",label:"ISO 8859-13 (Baltic)"},{value:"iso8859_15",label:"ISO 8859-15 (Latin-9)"},{value:"koi8_r",label:"KOI8-R (Russian)"},{value:"euc_jp",label:"EUC-JP (Japanese)"},{value:"sjis",label:"Shift JIS (Japanese)"},{value:"iso2022jp",label:"ISO-2022-JP (Japanese)"},{value:"gbk",label:"GBK (Chinese)"},{value:"gb2312",label:"GB2312 (Chinese)"},{value:"big5",label:"Big5 (Traditional Chinese)"},{value:"iscii91",label:"ISCII-91 (Indian)"},{value:"tis620",label:"TIS-620 (Thai)"},{value:"ISO-2022-KR",label:"ISO-2022-KR (Korean)"}],l=[{value:"default",label:"Default"},{value:"Cybook 3",label:"Cybook 3"},{value:"Cybook Opus",label:"Cybook Opus"},{value:"Ectaco jetBook",label:"Ectaco jetBook"},{value:"Hanlin V3",label:"Hanlin V3"},{value:"Hanlin V5",label:"Hanlin V5"},{value:"iLiad",label:"iLiad"},{value:"Kindle",label:"Kindle"},{value:"Kindle DX",label:"Kindle DX"},{value:"Kindle Fire",label:"Kindle Fire"},{value:"Kindle Oasis",label:"Kindle Oasis"},{value:"Kindle Paperwhite",label:"Kindle Paperwhite"},{value:"Kindle Paperwhite 3",label:"Kindle Paperwhite 3"},{value:"Kindle Voyage",label:"Kindle Voyage"},{value:"Kobo",label:"Kobo"},{value:"Pocketbook 900",label:"Pocketbook 900"},{value:"Pocketbook Pro 912",label:"Pocketbook Pro 912"},{value:"Pocketbook InkPad 3",label:"Pocketbook InkPad 3"},{value:"Pocketbook InkPad Lux",label:"Pocketbook InkPad Lux"},{value:"Pocketbook InkPad HD",label:"Pocketbook InkPad HD"}],i=[{value:"default",label:"Default"},{value:"Apple iPad",label:"Apple iPad"},{value:"Apple iPad 3",label:"Apple iPad 3"},{value:"Cybook 3",label:"Cybook 3"},{value:"Cybook Opus",label:"Cybook Opus"},{value:"Ectaco jetBook",label:"Ectaco jetBook"},{value:"Galaxy",label:"Galaxy"},{value:"Generic e-ink",label:"Generic e-ink"},{value:"Generic HD e-ink",label:"Generic HD e-ink"},{value:"Generic large e-ink",label:"Generic large e-ink"},{value:"Hanlin V3",label:"Hanlin V3"},{value:"Hanlin V5",label:"Hanlin V5"},{value:"iLiad",label:"iLiad"},{value:"IrexDR800",label:"IrexDR800"},{value:"IrexDR1000",label:"IrexDR1000"},{value:"jetBook",label:"jetBook"},{value:"Kindle",label:"Kindle"},{value:"Kindle DX",label:"Kindle DX"},{value:"Kindle Fire",label:"Kindle Fire"},{value:"Kindle Oasis",label:"Kindle Oasis"},{value:"Kindle Paperwhite",label:"Kindle Paperwhite"},{value:"Kindle Paperwhite 3",label:"Kindle Paperwhite 3"},{value:"Kindle Voyage",label:"Kindle Voyage"},{value:"Kobo",label:"Kobo"},{value:"Mobipocket",label:"Mobipocket"},{value:"MS Reader",label:"MS Reader"},{value:"Nook",label:"Nook"},{value:"Nook Color",label:"Nook Color"},{value:"Nook HD Plus",label:"Nook HD Plus"},{value:"Pocketbook 900",label:"Pocketbook 900"},{value:"Pocketbook Pro 912",label:"Pocketbook Pro 912"},{value:"Pocketbook InkPad 3",label:"Pocketbook InkPad 3"},{value:"Pocketbook InkPad Lux",label:"Pocketbook InkPad Lux"},{value:"Pocketbook InkPad HD",label:"Pocketbook InkPad HD"},{value:"Sony",label:"Sony"},{value:"Sony 300",label:"Sony 300"},{value:"Sony 900",label:"Sony 900"},{value:"Sony Landscape",label:"Sony Landscape"},{value:"Sony T3",label:"Sony T3"},{value:"Tablet",label:"Tablet"}],n=[{value:"default",label:"Default"},{value:"Apple iPad",label:"Apple iPad"},{value:"Apple iPad 3",label:"Apple iPad 3"},{value:"Cybook 3",label:"Cybook 3"},{value:"Cybook Opus",label:"Cybook Opus"},{value:"Ectaco jetBook",label:"Ectaco jetBook"},{value:"Galaxy",label:"Galaxy"},{value:"Generic e-ink",label:"Generic e-ink"},{value:"Generic HD e-ink",label:"Generic HD e-ink"},{value:"Generic large e-ink",label:"Generic large e-ink"},{value:"Hanlin V3",label:"Hanlin V3"},{value:"Hanlin V5",label:"Hanlin V5"},{value:"iLiad",label:"iLiad"},{value:"IrexDR800",label:"IrexDR800"},{value:"IrexDR1000",label:"IrexDR1000"},{value:"jetBook",label:"jetBook"},{value:"Kobo",label:"Kobo"},{value:"Mobipocket",label:"Mobipocket"},{value:"MS Reader",label:"MS Reader"},{value:"Nook",label:"Nook"},{value:"Nook Color",label:"Nook Color"},{value:"Nook HD Plus",label:"Nook HD Plus"},{value:"Pocketbook 900",label:"Pocketbook 900"},{value:"Pocketbook Pro 912",label:"Pocketbook Pro 912"},{value:"Pocketbook InkPad 3",label:"Pocketbook InkPad 3"},{value:"Pocketbook InkPad Lux",label:"Pocketbook InkPad Lux"},{value:"Pocketbook InkPad HD",label:"Pocketbook InkPad HD"},{value:"Sony",label:"Sony"},{value:"Sony 300",label:"Sony 300"},{value:"Sony 900",label:"Sony 900"},{value:"Sony Landscape",label:"Sony Landscape"},{value:"Sony T3",label:"Sony T3"},{value:"Tablet",label:"Tablet"}],s=[{value:"Kindle",label:"Kindle"},{value:"Kindle DX",label:"Kindle DX"},{value:"Kindle Fire",label:"Kindle Fire"},{value:"Kindle Oasis",label:"Kindle Oasis"},{value:"Kindle Paperwhite",label:"Kindle Paperwhite"},{value:"Kindle Paperwhite 3",label:"Kindle Paperwhite 3"},{value:"Kindle Scribe",label:"Kindle Scribe"},{value:"Kindle Voyage",label:"Kindle Voyage"}];function u(e){return[{value:"a0",label:"A0"},{value:"a1",label:"A1"},{value:"a2",label:"A2"},{value:"a3",label:"A3"},{value:"a4",label:"A4"},{value:"a5",label:"A5"},{value:"a6",label:"A6"},{value:"b0",label:"B0"},{value:"b1",label:"B1"},{value:"b2",label:"B2"},{value:"b3",label:"B3"},{value:"b4",label:"B4"},{value:"b5",label:"B5"},{value:"b6",label:"B6"},{value:"legal",label:e("Legal")},{value:"letter",label:e("Letter")}]}const d=[{value:"azw3",label:"AZW3"},{value:"epub",label:"EPUB"},{value:"fb2",label:"FB2"},{value:"lit",label:"LIT"},{value:"lrf",label:"LRF"},{value:"mobi",label:"MOBI"},{value:"pdb",label:"PDB"},{value:"pdf-ebook",label:"PDF (Ebook)"},{value:"tcr",label:"TCR"}],c=[{value:"sans",label:"Sans-serif"},{value:"serif",label:"Serif"}],p=[{value:"sans",label:"Sans"},{value:"serif",label:"Serif"}];function v(e){return[{value:"false",label:e("Convert")},{value:"true",label:e("Convert with OCR")}]}function f(e,t){return!!e&&void 0!==(0,a.$E)("ebook",e)?.[t]}function g(e){if(!e)return[];const t=(0,a.$E)("ebook",e)?.reader?.enum;return Array.isArray(t)?t.map(e=>{const t=String(e);return{value:t,label:"default"===t?"Default":t}}):[]}const b={"com.ebook2edit.kindle":{reader:"Kindle"}}
3;function m(e){return{...b[e]??{}}}},306003(e,t,o){o.d(t,{CU:()=>r,G:()=>b,Ke:()=>I,RL:()=>x,Rr:()=>m,UF:()=>f,X$:()=>a,Xe:()=>h,ZZ:()=>C,hr:()=>P,nA:()=>c,ol:()=>d,pS:()=>v,tP:()=>w,tY:()=>l,yx:()=>g});o(874423);function a(e){return[{value:"",label:e("Standard OCR"),description:e("Best for a clean scan: sharp, straight, good contrast. The fastest option.")},{value:"document_1",label:e("Advanced AI-OCR"),description:e("Best for a faded or blurry scan: faint print, speckled paper or a low-quality original."),badge:"AI"},{value:"document_3",label:e("Advanced AI-OCR+"),description:e("Best for a photo of a page: shadows, glare, or a page that curves away from the camera."),badge:"AI"},{value:"image_1",label:e("Photo OCR"),description:e("Best for a photo of a sign or object: signs, posters, labels, packaging and screens."),badge:"AI"}]}function r(e){return[{value:"convert",label:e("Convert"),description:e("Best when the PDF already holds real text you can select. Nothing to recognise.")},...a(e)]}function l(e,t){const o=e.find(e=>e.value===String(t??""));return(o??e[0])?.description??""}const i=["document_1","document_3","image_1"];function n(e){return i.includes(String(e??""))}const s={category:"operation",target:"ai-ocr"},u={category:null,target:null};function d(e){return n(e)?{ocr_engine:String(e),ocr:null,...s}:{ocr_engine:null,ocr:!0,...u}}function c(e){const t=String(e??"");return n(t)?{ocr_engine:t,ocr:null,...s}:"convert"===t?{ocr_engine:null,ocr:!1,...u}:{ocr_engine:null,ocr:null,...u}}const p={"com.ocr2edit.scannedpdftotext":e=>({...c(e.ocr_engine)}),"com.ocr2edit.imagetotext":e=>({...d(e.ocr_engine)}),"com.ocr2edit.converttotxt":()=>({ocr:!0}),"com.ocr2edit.converttopdf":()=>({ocr:!0}),"com.ocr2edit.converttoword":()=>({ocr:!0}),"com.ocr2edit.converttopowerpoint":()=>({ocr:!0})};function v(e,t){return p[e]?.(t)??{}}function f(e){return[{value:"false",label:e("Convert"),description:e("Scanned pages will be images.")},{value:"true",label:e("Convert with OCR"),description:e("Scanned pages will be converted to text that can be edited"),title:e("Use this option if your file does not contain editable text (most common in scanned documents).")}]}function g(e){return[{value:"layout",label:e("Keep the layout"),description:e("Columns, tables and the position of every block stay where they were on the page.")},{value:"text",label:e("Get the cleanest text"),description:e("Reads the characters as well as it can and ignores the page geometry. Best when only the words matter.")}]}const b=[{value:"docx",label:"Microsoft Word (*.docx)"},{value:"doc",label:"Word 2003 or older (*.doc)"}],m=[{value:"xlsx",label:"Microsoft Excel (*.xlsx)"},{value:"xls",label:"Excel 2003 or earlier (*.xls)"}],h=[{value:"pptx",label:"PowerPoint 2007-2013 (*.pptx)"},{value:"ppt",label:"PowerPoint 2003 or older (*.ppt)"}],w=[{value:"1.4",label:"PDF 1.4"},{value:"1.5",label:"PDF 1.5"},{value:"1.6",label:"PDF 1.6"},{value:"1.7",label:"PDF 1.7"},{value:"2.0",label:"PDF 2.0"}];function k(e,t,o){return e.map(e=>({value:String(e.value),label:e.label,description:t[String(e.value)]?.(o)??""}))}const y={docx:e=>e("Opens in Word 2007 and later, and in Google Docs, Pages and LibreOffice."),doc:e=>e("The older format. Pick it only if your file has to open in Word 2003.")},_={xlsx:e=>e("Opens in Excel 2007 and later, and in Google Sheets and LibreOffice."),xls:e=>e("The older format. Pick it only if your file has to open in Excel 2003.")},F={pptx:e=>e("Opens in PowerPoint 2007 and later, and in Google Slides and Keynote."),ppt:e=>e("The older format. Pick it only if your file has to open in PowerPoint 2003.")},S={1.4:e=>e("The most compatible. Opens in almost any reader, however old."),1.5:e=>e("Compresses scanned pages better, so the file comes out smaller."),1.6:e=>e("Adds support for OpenType fonts and larger embedded files."),1.7:e=>e("The long-standing ISO standard. A safe choice for any modern reader."),"2.0":e=>e("The newest specification. Some older readers cannot open it.")},I=e=>k(b,y,e),C=e=>k(m,_,e),P=e=>k(h,F,e),x=e=>k(w,S,e)},330261(e,t,o){o.d(t,{Q:()=>f});var a=o(750953),r=o(120641);const l=(0,a.KR)(!1),i=(0,a.KR)(!1),n=(0,a.KR)(!0),s=(0,a.KR)(!1),u=(0,a.KR)("portrait");function d(){const e=window.innerWidth;l.value=e<768,i.value=e>=768&&e<1024,n.value=e>=1024,u.value=window.innerHeight>window.innerWidth?"portrait":"landscape"}function c(){s.value=window.matchMedia("(hover: none) and (pointer: coarse)").matches}let p=0,v=null;function f(){return(0,r.sV)(()=>{d(),c(),0===p&&(window.addEventListener("resize",d),v=window.matchMedia("(hover: none) and (pointer: coarse)"),v.addEventListener("change",c)),p++}),(0,r.hi)(()=>{p--,0===p&&(window.removeEventListener("resize",d),v?.removeEventListener("change",c),v=null)}),{isMobile:l,isTablet:i,isDesktop:n,isTouchDevice:s,orientation:u}}},534750(e,t,o){function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Conversion failed";const o=e.errors??[],a=o.find(e=>"number"==typeof e?.code)??o[0];return{isJobFailure:!0,errorCode:"number"==typeof a?.code?a.code:void 0,errorDetails:a?.details,message:a?.message||e.status?.info||t,jobId:e.id||e.sat?.id_job}}o.d(t,{C:()=>a})},212868(e,t,o){async function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:192;if("undefined"==typeof document)return null;if("image/svg+xml"===e.type)return URL.createObjectURL(e);const o=URL.createObjectURL(e);try{const e=new Image;await new Promise((t,a)=>{e.onload=()=>t(),e.onerror=()=>
3a(new Error("Thumbnail image decode failed")),e.src=o});const a=e.naturalWidth,r=e.naturalHeight;if(!a||!r)return null;const l=Math.min(t/a,t/r,1),i=Math.max(1,Math.round(a*l)),n=Math.max(1,Math.round(r*l)),s=document.createElement("canvas");s.width=i,s.height=n;const u=s.getContext("2d");if(!u)return null;u.drawImage(e,0,0,i,n);const d=await new Promise(e=>s.toBlob(e,"image/png"));return d?URL.createObjectURL(d):null}catch{return null}finally{URL.revokeObjectURL(o)}}o.d(t,{o:()=>a})},368659(e,t,o){o.d(t,{A:()=>R});var a=o(120641),r=o(790033),l=o(750953),i=o(953751),n=o(693576),s=o(802800),u=o(330247),d=o(960082);const c={class:"rounded-2xl bg-white dark:bg-neutral-800 ring-1 ring-neutral-200 dark:ring-neutral-700 p-6","data-testid":"feedback-panel"},p={class:"text-lg font-semibold text-neutral-900 dark:text-white"},v={class:"mt-2 text-sm text-neutral-500 dark:text-neutral-400"},f={class:"flex items-center gap-3 mt-4"},g={class:"flex items-center"},b=["onClick","onMouseenter","data-testid"],m={class:"text-sm font-medium text-neutral-500 dark:text-neutral-400"},h={class:"text-neutral-900 dark:text-white"},w=["placeholder"],k=["disabled"],y={key:0,class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},_={key:1,class:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24"},F={key:1,class:"flex flex-col items-center text-center py-4",style:{"min-height":"280px"}},S={class:"text-lg font-semibold text-neutral-900 dark:text-white"},I={class:"mt-1 text-sm text-neutral-500 dark:text-neutral-400"},C={key:0,class:"mt-6 w-full rounded-xl border border-blue-200 dark:border-blue-500/30 bg-blue-50 dark:bg-blue-500/10 p-4"},P={class:"text-sm text-neutral-700 dark:text-neutral-300"},x=["href"],R=(0,a.pM)({__name:"FeedbackPanel",props:{origin:{}},emits:["submit"],setup(e,t){let{emit:o}=t;const R=o,{t:E}=(0,n.B)(),{track:U}=(0,s.f)(),j=(0,l.KR)(0),W=(0,l.KR)(0),A=(0,l.KR)(""),O=(0,l.KR)(!1),K=(0,l.KR)(!1);async function L(){0!==j.value&&(O.value=!0,R("submit",{rating:j.value,comment:A.value}),K.value=!0,O.value=!1)}const G=(0,a.EW)(()=>{if(j.value<4||!u.X.isRatingEnabled())return null;const e=u.X.getConfiguredRatingUrls(),t=d.k.getBaseDomain(),o=[];t&&o.push({platform:"Trustpilot",url:`https://www.trustpilot.com/review/${t}`});for(const[t,a]of Object.entries(e))if(a){const e=t.charAt(0).toUpperCase()+t.slice(1);o.push({platform:e,url:a})}if(0===o.length)return null;return o[Math.floor(Math.random()*o.length)]}),D=(0,a.EW)(()=>G.value?.url??null),T=(0,a.EW)(()=>G.value?.platform??"");function M(){U("feedback:trust_page_open",{platform:T.value,url:D.value??""})}return(e,t)=>((0,a.uX)(),(0,a.CE)("div",c,[K.value?((0,a.uX)(),(0,a.CE)("div",F,[t[7]||(t[7]=(0,a.Lk)("div",{class:"flex items-center justify-center w-12 h-12 mb-3 rounded-full bg-green-100 dark:bg-green-500/15"},[(0,a.Lk)("svg",{class:"w-6 h-6 text-green-600 dark:text-green-400",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},[(0,a.Lk)("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"})])],-1)),(0,a.Lk)("h3",S,(0,r.v_)((0,l.R1)(E)("Thank you!")),1),(0,a.Lk)("p",I,(0,r.v_)((0,l.R1)(E)("Your feedback helps us improve.")),1),D.value?((0,a.uX)(),(0,a.CE)("div",C,[(0,a.Lk)("p",P,(0,r.v_)((0,l.R1)(E)("We’d greatly appreciate if you would also rate us on %platform%",{"%platform%":T.value})),1),(0,a.Lk)("a",{href:D.value,target:"_blank",rel:"noopener noreferrer",class:"mt-2 inline-flex items-center gap-1.5 text-sm font-semibold text-blue-600 dark:text-blue-400 hover:underline","data-testid":"feedback-external-review-link",onClick:M},[(0,a.eW)((0,r.v_)((0,l.R1)(E)("Rate us on %platform%",{"%platform%":T.value}))+" ",1),t[6]||(t[6]=(0,a.Lk)("svg",{class:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},[(0,a.Lk)("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})],-1))],8,x)])):(0,a.Q3)("v-if",!0)])):((0,a.uX)(),(0,a.CE)(a.FK,{key:0},[(0,a.Lk)("h3",p,(0,r.v_)((0,l.R1)(E)("How was your experience?")),1),(0,a.Lk)("p",v,(0,r.v_)((0,l.R1)(E)("Your feedback helps us improve. Rate us and optionally leave a comment.")),1),(0,a.Lk)("div",f,[(0,a.Lk)("div",g,[((0,a.uX)(),(0,a.CE)(a.FK,null,(0,a.pI)(5,e=>(0,a.Lk)("button",{key:e,onClick:t=>j.value=e,onMouseenter:t=>W.value=e,onMouseleave:t[0]||(t[0]=e=>W.value=0),type:"button","data-testid":`feedback-star-${e}`,class:"p-0.5 cursor-pointer transition-transform duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 active:scale-90"},[((0,a.uX)(),(0,a.CE)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:(0,r.C4)(["w-7 h-7 transition-colors duration-150",(W.value||j.value)>=e?"fill-yellow-400 stroke-yellow-500":"fill-neutral-200 dark:fill-neutral-600 stroke-neutral-300 dark:stroke-neutral-500"]),"stroke-width":"1.5",stroke:"currentColor"},[...t[2]||(t[2]=[(0,a.Lk)("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.562.562 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.562.562 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5Z"},null,-1)])],2))],40,b)),64))]),(0,a.Lk)("span",m,[j.value>0?((0,a.uX)(),(0,a.CE)(a.FK,{key:0},[(0,a.Lk)("span",h,(0,r.v_)(j.value),1),t[3]||(t[3]=(0,a.eW)(" /5 Stars ",-1))],64)):((0,a.uX)(),(0,a.CE)(a.FK,{key:1},[(0,a.eW)((0,r.v_)((0,l.R1)(E)("0/5 Stars")),1)],64))])]),(0,a.bo)((0,a.Lk)("textarea",{"onUpdate:modelValue":t[1]||(t[1]=e=>A.value=e),placeholder:j.value>0?(0,l.R1)(E)("Tell us more (optional)..."):(0,l.R1)(E)("Select a rating above, then share your thoughts..."),rows:"3",class:"mt-4 w-full resize-none rounded-xl border border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-900 px-4 py-3 text-sm text-neutral-800 dark:text-neutral-200 placeholder-neutral-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500 focus:outline-none transition-colors"},null,8,w),[[i.Jo,A.value]]),(0,a.Lk)("button",{onClick:L,disabled:O.value||0===j.value,"data-testid":"feedback-submit",class:"mt-3 inline-flex items-center gap-2 rounded-xl bg-blue-600 px-5 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-blue-700 disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer"},[O.value?((0,a.uX)(),(0,a.CE)("svg",_,[...t[5]||(t[5]=[(0,a.Lk)("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),(0,a.Lk)("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])])):((0,a.uX)(),(0,a.CE)("svg",y,[...t[4]||(t[4]=[(0,a.Lk)("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 12 3.269 3.125A59.769 59.769 0 0 1 21.485 12 59.768 59.768 0 0 1 3.27 20.875L5.999 12Zm0 0h7.5"},null,-1)])])),(0,a.eW)(" "+(0,r.v_)(O.value?(0,l.R1)(E)("Sending..."):(0,l.R1)(E)("Submit Feedback")),1)],8,k)],64))]))}})},667650(e,t,o){o.d(t,{A:()=>u});var a=o(120641),r=o(606265),l=o(237631),i=o(269978),n=o(759641);const s={key:0,"data-testid":"job-warning-notices",class:"flex flex-col gap-2"},u=(0,a.pM)({__name:"JobWarningNotices",emits:["action"],setup(e,t){let{emit:o}=t;const u=o,d=(0,r.u)(),c=(0,a.EW)(()=>d.warnings);return(e,t)=>c.value.length?((0,a.uX)(),(0,a.CE)("div",s,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(c.value,(e,t)=>((0,a.uX)(),(0,a.Wv)(l.A,{key:`${e.metadata?.warningCode??t}`,mode:"notice",config:e,onAction:e=>function(e,t){const o=d.warnings[e];i.A.track(n.Wm.WARNING_ACTION,{action:t,warning_code:String(o?.metadata?.warningCode??"")}),d.dismissWarning(e),u("action",t)}(t,e)},null,8,["config","onAction"]))),128))])):(0,a.Q3)("v-if",!0)}})}}]);
4//# debugId=3d02025d-7a72-5925-845f-55b7f36166e1

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.