PageSourceSearch

https://openlover.ai/_nuxt/DoipzibS.js

js openlover.ai collected 2026-10-05 12:24:40 UTC 16,918 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DqMHpNBf.js","./DQ8Q0yk1.js","./entry.C1z6vq29.css","./DfLSM9Mo.js"])))=>i.map(i=>d[i]);
2import{d as e,a,E as l,G as t,H as s,o as i,I as o,J as n,y as r,b as u,K as v,c,F as g,f as d,e as p,j as m,L as h,C as f,m as y,l as w,M as b,N as S,q as I}from"./DQ8Q0yk1.js";import{u as j}from"./BetIe0d5.js";import{StoryProjectAPI as P,ImageAPI as C}from"./DqMHpNBf.js";import{P as _,L as T,C as E,R as x,M as U,S as D,I as A,G as V,a as R,T as G,b as k,B as $,V as B,c as M,d as N,e as F,Y as W,f as L,g as Y,h as O,i as z}from"./BaLhPL2K.js";import{C as H}from"./yxgEcqgk.js";import"./DfLSM9Mo.js";import"./VzEV1Uf4.js";import"./DsfI_pGc.js";import"./CmnLzyhU.js";import"./BoCyQXIP.js";import"./Dam_uA4N.js";import"./Bt1J2kgS.js";import"./CMy2HIqV.js";import"./DhvI55dm.js";import"./BM79M0Zf.js";const J={class:"mobile-content"},K=I(e({__name:"[id]",setup(e){const I=a(),K=l(),q=I.params.id;t({title:"Project Editor - Create Amazing Stories",description:"Advanced story editor with AI-powered features for creative storytelling",keywords:"story, editor, AI, creative writing, storytelling"});const{shouldUseMobileLayout:Q}=s(),X=y(()=>Q.value);j();const Z=w(null),ee=w(!0),ae=w(!1),le=w(!1),te=y(()=>Z.value?.paragraphs||[]),se=w(null),ie=y(()=>te.value.find(e=>e.id===se.value)||null),oe=w([]),ne=y(()=>oe.value.length>0),re=y(()=>!le.value&&Boolean(Z.value)),ue=w(new Set),ve=w(new Set),ce=w(!1);let ge=null;const de=e=>ue.value.has(e),pe=e=>{if(ue.value.has(e.id))return!0;const a=(e.images||[]).some(e=>"pending"===e.status),l=(e.images||[]).some(e=>"pending"===e.video_status);return a||l},me=y(()=>({totalImages:te.value.reduce((e,a)=>e+(a.images?.length||0),0),totalVideos:0,totalScenes:te.value.length})),he=y(()=>te.value.flatMap(e=>e.images||[]).filter(e=>oe.value.includes(e.id))),fe=w({maxImagesPerGroup:8,autoSave:!0}),ye=w("grid"),we=w(0),be=w("scenes"),Se=w(!1),Ie=w(!1),je=w(!1),Pe=w(!1),Ce=w(!1),_e=w(!1),Te=w(!1),Ee=w(!1),xe=w(!1),Ue=w(!1),De=w(!1),Ae=w(!1),Ve=w(null),Re=w(null),Ge=w([]),ke=w(null),$e=w(!1),Be=w([]),Me=w(null),Ne=w(null),Fe=w(!1),We=w({title:"",message:"",type:"danger",confirmText:"Delete",cancelText:"Cancel",onConfirm:null}),Le=y(()=>te.value.flatMap(e=>e.images||[])||[]),Ye=e=>{se.value=e,Z.value?.id&&(e?localStorage.setItem(`storyEditor:lastParagraph:${Z.value.id}`,e):localStorage.removeItem(`storyEditor:lastParagraph:${Z.value.id}`))},Oe=e=>{const a=oe.value.indexOf(e);-1===a?oe.value.push(e):oe.value.splice(a,1)},ze=async e=>{if(re.value&&!le.value)if(Z.value){le.value=!0;try{const a={project_id:Z.value.id};if(e){const l=te.value.find(a=>a.id===e.targetGroupId);l&&("before"===e.type?a.pre_paragraph_id=l.id:a.next_paragraph_id=l.id)}const l=await P.createParagraph(a);if(l)return Z.value&&await Sa(Z.value.id),await b(),Ye(l),Ca.value?.showSuccess("Scene created successfully","Your new scene is ready for content generation."),X.value&&(be.value="generate"),l}catch(a){Ca.value?.showError("Failed to create scene","Please try again or contact support if the problem persists.")}finally{le.value=!1}}else Ca.value?.showError("No project selected","Please select a project first.");else Ca.value?.showError("Cannot create more scenes right now","Please wait for current operations to complete.")},He=e=>{const a=te.value.findIndex(a=>a.id===e);if(-1===a)return;const l=te.value[a],t=l.images&&l.images.length>0;wa({title:"Delete Scene",message:`Are you sure you want to delete "Scene ${a+1}"?${t?` This will also delete ${l.images?.length||0} image${(l.images?.length||0)>1?"s":""} in this scene.`:""} This action cannot be undone.`,type:"danger",confirmText:"Delete Scene",cancelText:"Cancel",onConfirm:()=>Je(e)})},Je=async e=>{try{await P.deleteParagraph(e);const a=te.value.findIndex(a=>a.id===e);if(Z.value&&await Sa(Z.value.id),await b(),se.value===e)if(te.value.length>0){const e=Math.min(a,te.value.length-1);Ye(te.value[e].id)}else Ye(null);oe.value=[],Ca.value?.showSuccess("Scene deleted successfully","The scene and all its content have been removed.")}catch(a){Ca.value?.showError("Failed to delete scene","Please try again or c
2ontact support if the problem persists.")}},Ke=async e=>{if(ie.value)try{const a=await C.generateImage({paragraphId:ie.value.id,prompt:e.prompt,loraId:e.loraId,count:e.count||1,modelName:e.modelName,aspectRatio:e.aspectRatio,poseWeight:e.poseWeight,poseEnd:e.poseEnd,poseDepthWeight:e.poseDepthWeight,poseDepthEnd:e.poseDepthEnd,poseImageUrl:e.poseImageUrl,clothesImageUrl:e.clothesImageUrl});a&&a.length>0&&(ue.value.add(ie.value.id),ce.value||Ia(),Ca.value?.showSuccess("Image generation started","Your images are being generated. This may take a few moments."))}catch(a){Ca.value?.showError("Failed to generate images","Please check your parameters and try again.")}finally{_a.value&&(_a.value.isLocalGenerating=!1)}else Ca.value?.showWarning("No scene selected","Please select a scene from the left panel before generating images.")},qe=e=>{Ye(e),be.value="images"},Qe=e=>{const a=Le.value.find(a=>a.id===e);a&&(Ve.value=a,Se.value=!0)},Xe=async e=>{const a=Le.value.find(a=>a.id===e);a&&(Re.value=a,Ce.value=!0)},Ze=async e=>{Re.value&&(ve.value.add(Re.value.id),Ca.value?.showSuccess("Video conversion started","Your video is being generated. This may take a few minutes.")),ce.value||Ia(),Se.value=!1},ea=()=>{Re.value=null,Ge.value=[]},aa=e=>{const a=Le.value.find(a=>a.id===e);a?.is_video_enabled&&a?.video_url&&(Me.value=a.video_url,Ne.value=e,Pe.value=!0)},la=async e=>{const a=Le.value.find(a=>a.id===e);a&&(ke.value=a,_e.value=!0)},ta=async e=>{if(ke.value)try{$e.value=!0;const a=te.value.find(a=>(a.images||[]).some(a=>a.id===e.imageId));if(!a)return void Ca.value?.showError("Cannot find scene","The scene containing this image could not be found.");const l=await C.generateImage(a.id,e.prompt,ke.value.lora_id,e.count,e.modelName,e.aspectRatio);l&&l.length>0&&(ue.value.add(a.id),ce.value||Ia(),Ca.value?.showSuccess("Image regeneration started","Your new images are being generated with the updated parameters."),_e.value=!1,Se.value=!1)}catch(a){Ca.value?.showError("Failed to regenerate image","Please check your parameters and try again.")}finally{$e.value=!1}},sa=async e=>{_e.value=!1,Se.value=!1},ia=()=>{_e.value=!1,ke.value=null},oa=e=>{Le.value.find(a=>a.id===e)&&wa({title:"Delete Image",message:"Are you sure you want to delete this image? This action cannot be undone.",type:"danger",confirmText:"Delete",cancelText:"Cancel",onConfirm:()=>na([e])})},na=async e=>{try{await C.deleteImages(e),Z.value?.paragraphs&&Z.value.paragraphs.forEach(a=>{a.images=(a.images||[]).filter(a=>!e.includes(a.id))}),oe.value=oe.value.filter(a=>!e.includes(a));const a=e.length;Ca.value?.showSuccess(`Successfully deleted ${a} image${a>1?"s":""}`,"The selected images have been permanently removed.")}catch(a){Ca.value?.showError("Failed to delete images","Please try again or contact support if the problem persists.")}},ra=async e=>{try{const e=se.value;Z.value?.id&&(await Sa(Z.value.id),e&&Ye(e),Ca.value?.showSuccess("Image uploaded successfully","Your image has been added to the current scene."))}catch(a){console.error("Failed to refresh after upload:",a),Ca.value?.showError("Upload successful, but failed to refresh","Please refresh the page to see your uploaded image.")}},ua=()=>{if(Ne.value){const e=Le.value.find(e=>e.id===Ne.value);e&&(ke.value=e,_e.value=!0,Pe.value=!1)}},va=e=>{"select"===e?Le.value.forEach(e=>{oe.value.includes(e.id)||oe.value.push(e.id)}):oe.value=[]},ca=async()=>{if(0===oe.value.length)return void Ca.value?.showWarning("No images selected","Please select one or more images to convert.");const e=he.value.filter(e=>!e.is_video_enabled||!e.video_url||"failed"===e.video_status);0!==e.length?(Be.value=e,Ae.value=!0):Ca.value?.showWarning("No convertible images","All selected images have already been converted to videos.")},ga=async()=>{0!==oe.value.length?wa({title:"Delete Selected Images",message:`Are you sure you want to delete ${oe.value.length} selected image${oe.value.length>1?"s":""}? This action cannot be undone.`,type:"danger",confirmText:"Delete",cancelText:"Cancel",onConfirm:()=>na([...oe.value])}):Ca.value?.showWarning("No images selected","Please select one or more images to delete.")},da=()=>{De.value=!0},pa=e=>{},ma=()=>{Be.value=[],Ae.value=!1},ha=async e=>{},fa=e=>{Object.assign(fe.value,e)},ya=e=>{},wa=e=>{We.value={title:e.title,message:e.message,type:e.type||"danger",confirmText:e.confirmText||"Confirm",cancelText:e.cancelText||"Cancel",onConfirm:e.onConfirm},Fe.value=!0},ba=()=>{We.value.onConfirm&&We.value.onConfirm(),Fe.value=!1},Sa=async e=>{if(!ae.value){ae.value=!0;try{const{StoryProjectAPI:a}=await S(async()=>{const{StoryProjectAPI:e}=await import("./DqMHpNBf.js");return{StoryProjectAPI:e}},__vite__mapDeps([0,1,2,3]),import.meta.url),l=await a.getProjectDetail(e);if(Z.value=l,l&&te.value.length>0){const a=localStorage.getItem(`storyEditor:lastParagraph:${e}`);a&&te.value.some(e=>e.id===a)?Ye(a):te.value.length>0&&Ye(te.value[0].id)}Pa()}catch(a){Ca.value?.showError("Failed to load project","The project could not be loaded. You will be redirected to the project list."),await o(K("/projects/"))}finally{ae.value=!1,ee.value=!1}}},Ia=async()=>
2{if(ce.value||!Z.value?.id)return;ce.value=!0;const e=async()=>{try{const{StoryProjectAPI:a}=await S(async()=>{const{StoryProjectAPI:e}=await import("./DqMHpNBf.js");return{StoryProjectAPI:e}},__vite__mapDeps([0,1,2,3]),import.meta.url),l=await a.getProjectDetail(Z.value.id);Z.value=l;let t=!1;for(const e of ue.value){const a=l.paragraphs.find(a=>a.id===e);if(a){if(a.images.some(e=>"pending"===e.status))t=!0;else{ue.value.delete(e);const l=a.images.filter(e=>"success"===e.status);l.length>0&&Ca.value?.showSuccess("Generation completed",`Scene generated ${l.length} image(s) successfully!`)}}else ue.value.delete(e)}let s=!1;for(const e of ve.value){let a=!1,t=!1;for(const i of l.paragraphs){const l=i.images.find(a=>a.id===e);if(l){a=!0,"success"===l.video_status&&l.video_url?(ve.value.delete(e),t=!0,Ca.value?.showSuccess("Video completed","Video conversion completed successfully!")):"failed"===l.video_status?(ve.value.delete(e),t=!0,Ca.value?.showError("Video failed","Video conversion failed")):"pending"===l.video_status&&(s=!0);break}}a||ve.value.delete(e)}t||s?ge=setTimeout(e,1e4):(ja(),X.value&&ie.value&&ie.value.images.length>0&&(be.value="images"))}catch(a){(ue.value.size>0||ve.value.size>0)&&(ge=setTimeout(e,2e4))}};e()},ja=()=>{ce.value=!1,ge&&(clearTimeout(ge),ge=null)},Pa=()=>{if(!Z.value?.paragraphs)return;let e=!1;for(const a of Z.value.paragraphs){const l=a.images||[];for(const t of l)"pending"===t.status&&(ue.value.add(a.id),e=!0),"pending"===t.video_status&&(ve.value.add(t.id),e=!0)}e&&(ce.value||Ia())};i(async()=>{if(!q)return void(await o(K("/projects/")));await Sa(q);const e=localStorage.getItem("storyEditor:viewMode");e&&(ye.value=e),X.value&&0===te.value.length&&(be.value="scenes")}),n(()=>{ja(),ue.value.clear(),ve.value.clear()}),r(ye,e=>{localStorage.setItem("storyEditor:viewMode",e)});const Ca=w(null),_a=w(null);return(e,a)=>ee.value?(u(),v(_,{key:0})):(u(),c("div",{key:1,class:f(["story-editor-container",{"mobile-view":X.value}])},[X.value?(u(),c(g,{key:1},[d(U,{"current-project":Z.value,"active-tab":be.value,"scenes-count":te.value.length,"has-active-paragraph":!!ie.value,"active-image-count":ie.value?.images?.length||0,"onUpdate:activeTab":a[7]||(a[7]=e=>be.value=e)},null,8,["current-project","active-tab","scenes-count","has-active-paragraph","active-image-count"]),p("div",J,[m(d(D,{paragraphs:te.value,"active-paragraph-id":se.value,"can-generate":re.value,"is-creating-scene":le.value,"is-paragraph-generating":de,"is-paragraph-content-generating":pe,onCreateScene:ze,onSelectSceneAndSwitch:qe,onDeleteScene:He},null,8,["paragraphs","active-paragraph-id","can-generate","is-creating-scene"]),[[h,"scenes"===be.value]]),m(d(A,{paragraphs:te.value,"active-paragraph":ie.value,"selected-image-ids":oe.value,"has-selected-images":ne.value,"selected-image-count":he.value.length,onSelectImage:Oe,onShowBatchActions:a[8]||(a[8]=e=>Ie.value=!0),onPreviewImage:Qe,onConvertVideo:Xe,onPlayVideo:aa,onRegenerateImage:la,onDeleteImage:oa,onImageUploaded:ra},null,8,["paragraphs","active-paragraph","selected-image-ids","has-selected-images","selected-image-count"]),[[h,"images"===be.value]]),m(d(V,{"active-paragraph":ie.value,"is-generating":!!ie.value&&de(ie.value.id),"generation-progress":we.value,"total-images":me.value.totalImages,config:fe.value,onGenerate:Ke,onShowTutorial:a[9]||(a[9]=e=>Te.value=!0),onShowGallery:a[10]||(a[10]=e=>Ee.value=!0),onShowSettings:a[11]||(a[11]=e=>je.value=!0),onShowExport:a[12]||(a[12]=e=>xe.value=!0),onShowBatchConvert:da},null,8,["active-paragraph","is-generating","generation-progress","total-images","config"]),[[h,"generate"===be.value]])])],64)):(u(),c(g,{key:0},[d(T,{paragraphs:te.value,"current-project":Z.value,"active-paragraph-id":se.value,"can-generate":re.value,"is-creating-scene":le.value,"is-paragraph-generating":de,"is-paragraph-content-generating":pe,onCreateScene:ze,onSelectScene:Ye,onDeleteScene:He},null,8,["paragraphs","current-project","active-paragraph-id","can-generate","is-creating-scene"]),d(E,{"view-mode":ye.value,"onUpdate:viewMode":a[0]||(a[0]=e=>ye.value=e),paragraphs:te.value,"active-paragraph":ie.value,"selected-image-ids":oe.value,onSelectImage:Oe,onPreviewImage:Qe,onConvertVideo:Xe,onPlayVideo:aa,onRegenerateImage:la,onDeleteImage:oa,onImageUploaded:ra},null,8,["view-mode","paragraphs","active-paragraph","selected-image-ids"]),d(x,{ref_key:"rightPanelRef",ref:_a,"has-selected-images":ne.value,"selected-image-count":he.value.length,"is-generating":!!ie.value&&de(ie.value.id),"generation-progress":we.value,config:fe.value,stats:me.value,"active-paragraph":ie.value,paragraphs:te.value,onShowBatchActions:a[1]||(a[1]=e=>Ie.value=!0),onGenerate:Ke,onShowTutorial:a[2]||(a[2]=e=>Te.value=!0),onShowGallery:a[3]||(a[3]=e=>Ee.value=!0),onShowSettings:a[4]||(a[4]=e=>je.value=!0),onShowExport:a[5]||(a[5]=e=>xe.value=!0),onCreateGame:a[6]||(a[6]=e=>Ue.value=!0),onShowBatchConvert:da}
2,null,8,["has-selected-images","selected-image-count","is-generating","generation-progress","config","stats","active-paragraph","paragraphs"])],64)),d(R,{visible:Se.value,"onUpdate:visible":a[13]||(a[13]=e=>Se.value=e),image:Ve.value,"onUpdate:image":a[14]||(a[14]=e=>Ve.value=e),"all-images":ie.value?.images||[],onSelect:a[15]||(a[15]=e=>Oe(e)),onConvertVideo:Xe,onPlayVideo:aa,onRegenerate:la},null,8,["visible","image","all-images"]),d(G,{visible:Te.value,"onUpdate:visible":a[16]||(a[16]=e=>Te.value=e)},null,8,["visible"]),d(k,{visible:Ee.value,"onUpdate:visible":a[17]||(a[17]=e=>Ee.value=e)},null,8,["visible"]),d($,{visible:Ie.value,"onUpdate:visible":a[18]||(a[18]=e=>Ie.value=e),"selected-images":he.value,onBatchSelect:a[19]||(a[19]=e=>va("select")),onBatchDeselect:a[20]||(a[20]=e=>va("deselect")),onBatchConvert:ca,onBatchDelete:ga},null,8,["visible","selected-images"]),d(B,{visible:Ce.value,"onUpdate:visible":a[21]||(a[21]=e=>Ce.value=e),image:Re.value,images:Ge.value,"all-images":ie.value?.images||[],onConverted:Ze,onClose:ea},null,8,["visible","image","images","all-images"]),d(M,{visible:_e.value,"onUpdate:visible":a[22]||(a[22]=e=>_e.value=e),image:ke.value,"is-regenerating":$e.value,onRegenerate:ta,onRegenerateVideo:sa,onClose:ia},null,8,["visible","image","is-regenerating"]),d(N,{visible:je.value,"onUpdate:visible":a[23]||(a[23]=e=>je.value=e),config:fe.value,onUpdateConfig:fa},null,8,["visible","config"]),d(F,{visible:Pe.value,"onUpdate:visible":a[24]||(a[24]=e=>Pe.value=e),video:Me.value,onRegenerateVideo:ua},null,8,["visible","video"]),d(H,{visible:Fe.value,"onUpdate:visible":a[25]||(a[25]=e=>Fe.value=e),title:We.value.title,message:We.value.message,type:We.value.type,"confirm-text":We.value.confirmText,"cancel-text":We.value.cancelText,onConfirm:ba}
2,null,8,["visible","title","message","type","confirm-text","cancel-text"]),d(W,{visible:xe.value,paragraphs:te.value,"project-title":Z.value?.title||"Untitled Project",onClose:a[26]||(a[26]=e=>xe.value=!1),onExport:ya},null,8,["visible","paragraphs","project-title"]),d(L,{visible:Ue.value,paragraphs:te.value,"project-title":Z.value?.title||"Untitled Project",onClose:a[27]||(a[27]=e=>Ue.value=!1)},null,8,["visible","paragraphs","project-title"]),d(Y,{visible:De.value,"all-images":Le.value,paragraphs:te.value,"selected-image-ids":oe.value,onClose:a[28]||(a[28]=e=>De.value=!1),onSelectImage:Oe,onConvert:pa},null,8,["visible","all-images","paragraphs","selected-image-ids"]),d(O,{visible:Ae.value,images:Be.value,paragraphs:te.value,onClose:ma,onConvert:ha},null,8,["visible","images","paragraphs"]),d(z,{ref_key:"toastRef",ref:Ca},null,512)],2))}}),[["__scopeId","data-v-42784285"]]);export{K as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.