PageSourceSearch

https://app.wask.co/_nuxt/DZbP8-tU.js

js wask.co collected 2026-09-24 18:12:32 UTC 16,087 bytes, 1 lines download raw bytes

1import{_ as y,a as I}from"./BFMcj6E6.js";import{u as S,m as $,k as g,l as z,P as A,q as v,D as E,E as F,F as M,a as P}from"./BPgqnNfr.js";import{J as m,L as c,V as t,I as n,S as h,X as i,O as u,W as f,an as G,ar as V,H as L,U as B,P as T,aa as N}from"./DALBwJBo.js";import{A as x}from"./BA7hc29k.js";import{A as O}from"./DZ7GPFJo.js";import{C}from"./BPlQ8EJt.js";import{C as w}from"./eEMye59r.js";import{F as b}from"./XV7S-2_Z.js";import{V as k}from"./D485WgMd.js";import"./C90pP_ZT.js";import"./Bycnflcz.js";import"./DxS3uDwG.js";import"./CDPAGobt.js";import"./D5hv5eFT.js";import"./BLGg1Yom.js";import"./Dt83pHF2.js";import"./DHF4M4F_.js";import"./CRbqSEBK.js";import"./COunaS3f.js";import"./Do0gMI3x.js";import"./DchUxt1O.js";import"./BSRKY28A.js";import"./BK9Oog7Z.js";import"./CWQGBsMF.js";import"./HAnbDMC8.js";import"./F4HK9gTY.js";import"./CMhdUk-6.js";import"./B6GXWl68.js";import"./BypuowLa.js";import"./Cv9n5X1Z.js";import"./CxZiWszh.js";import"./D24afW9p.js";import"./BpvOVp6I.js";import"./BXDT1f1W.js";import"./x7UQqTqO.js";import"./DEYKolwf.js";import"./BR5rFDVn.js";import"./PjAoEdae.js";import"./DZKrq1ob.js";import"./cd2LqQ0L.js";import"./C3GOKM3M.js";import"./B5Ne6h2o.js";import"./DVCaC3OG.js";import"./BwgIDY1d.js";import"./BZ_Gedro.js";import"./B1mph6XT.js";const R={class:"flex flex-col lg:min-h-screen lg:h-screen"},D={class:"bg-white border-neutral-900 h-full flex flex-col overflow-hidden"},U={class:"hidden lg:flex items-center flex-wrap gap-2 justify-between border-b border-neutral-200 px-[20px] pt-[15px] pb-[14px]"},j={class:"flex items-center gap-4"},q={class:"font-medium text-base"},H={class:"h-full overflow-hidden"},W={class:"grid grid-cols-12 h-full overflow-hidden"},Z={class:"lg:col-span-5 xl:col-span-4 2xl:col-span-4 col-span-12 border-r border-neutral-200 flex order-2 lg:order-1 flex-col justify-between max-h-full overflow-y-auto"},J={class:"p-[20px]"},K={class:"mb-5"},X={class:"text-sm text-neutral-900 mb-2"},Q={class:"w-full border-r mb-0 border-neutral-200 p-3 flex flex-col 2xl:flex-row gap-3 items-start 2xl:items-center cursor-pointer",title:"Square"},Y={class:"text-neutral-700 text-xs font-medium"},ee={class:"w-full border-r mb-0 border-neutral-200 p-3 flex flex-col 2xl:flex-row gap-3 items-start 2xl:items-center cursor-pointer",title:"Landscape"},te={class:"text-neutral-700 text-xs font-medium"},se={class:"w-full mb-0 p-3 flex flex-col 2xl:flex-row gap-3 items-start 2xl:items-center cursor-pointer",title:"Portrait"},ae={class:"text-neutral-700 text-xs font-medium"},oe={class:"text-sm text-neutral-900"},ie={class:"flex items-center gap-1"},re={class:"text-sm text-neutral-500"},le=["placeholder","disabled"],ne={key:0,class:"px-[20px] py-4 bg-white border-t border-neutral-200 sticky bottom-0"},de={key:1,class:"flex gap-1 items-center justify-between w-full"},pe={class:"flex items-center gap-1"},me={class:"flex items-center gap-1"},ce={class:"lg:col-span-7 xl:col-span-8 2xl:col-span-8 col-span-12 h-full p-[20px] order-1 bg-dot-grid flex flex-col justify-between relative gap-3 max-h-full overflow-hidden"},ue={key:1,class:"flex flex-col items-center justify-center h-full"},he={class:"font-medium text-lg mb-[10px] text-neutral-900 text-center"},fe={class:"text-neutral-800 text-xs text-center mb-6"},ge={class:"italic"},we={name:"ai-creative-image-creator",components:{AppHeader:x,AdPlatformAccountPicker:O,creatorPreview:C,creativeBalance:w,FileUploadArea:b,VideoTemplateSelect:k},data(){return{btn_loading:!1,picker:{},workflowId:null,type:null,creative:null,injectCreative:null,campaign_loading:!0,loading:!1,prompt_text_show:!1,prompt_text:"",video_size:"portrait",uploadedFile:null,selected_template:null,policy_warn:!1,templates:[{key:"square",name:"Square",image:"https://picsum.photos/200/300"},{key:"landscape",name:"Landscape",image:"https://picsum.photos/200/300"},{key:"portrait",name:"Portrait",image:"https://picsum.photos/200/300"}]}},computed:{constant:{get(){return g().get_constants}},button_validation:function(){return this.selected_template&&this.selected_template.type!=="IMAGE_PROMPT"?!this.uploadedFile:this.prompt_text.length<1||!this.uploadedFile},creative_is_loading:function(){let a=!1;return this.creative&&this.creative.last_ai_creative&&(this.creative.last_ai_creative.status==="GENERATING"||this.creative.last_ai_creative.status==="IDLE")&&(a=!0),a},system_user:{get(){return g().get_user}},user_has_access:function(){return g().checkUserPermission(this.system_user,"ai_creative.manage")},socket_data:function(){return z().get_socket_data},check_optinal:function(){return this.selected_template&&this.selected_template.type!=="PROMPT"}},mounted(){this.getTemplate()},methods:{refreshPage:function(){this.loading=!1,this.policy_warn=!1},getTemplate:async function(){const a=(this._.provides[A]||this.$route).query.id,{data:d,status:e}=await v('ai-creatives/template/list?order=ASC&type=["IMAGE","IMAGE_PROMPT"]',{method:"GET"});if(e&&d){this.templates=d;let s=this.templates.find(r=>r.id==a);s?this.selected_template=s:this.selected_template=this.templates[0]}},goBack:function(){this.$router.back()},setCreative:function(a){a&&!this.btn_loading&&(this.creative=a)},setCampaignLoading:function(a){this.campaign_loading=a},setPicker:function(a){a&&(this.picker=a)},onFileUploaded:function(a){this.uploadedFile=a},onFileRemoved:function(){this.uploadedFile=null},getImageSize:function(){switch(this.video_size){case"square":return{size:"1024x1024",aspect_ratio:"1:1"};case"landscape":return{size:"1536x1024",aspect_ratio:"16:9"};case"portrait":return{size:"1024x1536",aspect_ratio:"9:16"};default:return{size:"1024x1024",aspect_ratio:"1:1"}}},dataLayer_fx:function(a){try{window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:a})}catch(d){console.warn("dataLayer: "+(d&&d.message))}},fetchCreate:async function(){var d,e,s;
1if(!(this.loading||(this.mixpanelEvent("Creative Create Image Generate Button Clicked"),!E().checkUserCanMakeAICreative(((s=(e=(d=this.constant)==null?void 0:d.credits)==null?void 0:e.IMAGE_GENERATION)==null?void 0:s.price)||10,!0,"ai-creative-image-creator")))){this.loading=!0;try{const r=this.getImageSize()||{};if(this.uploadedFile){let l=new FormData;l.append("workflow_id",this.workflowId),l.append("details",JSON.stringify({user_prompt:this.prompt_text})),l.append("image_size",r.size),l.append("aspect_ratio",r.aspect_ratio),l.append("type",this.type),l.append("user_image",this.uploadedFile),l.append("template_image_url",this.selected_template.preview_url);const{status:p,data:o}=await F("ai-creatives/template/image",{method:"POST",body:l});p&&o||(this.loading=!1)}else{const{status:l,data:p}=await v("ai-creatives/template/image",{method:"POST",body:JSON.stringify({workflow_id:this.workflowId,details:{user_prompt:this.prompt_text},image_size:r.size,aspect_ratio:r.aspect_ratio,template_image_url:this.selected_template.preview_url})});l&&p||(this.loading=!1)}this.dataLayer_fx("generate_image")}catch(r){console.warn("Image generation hatası:",r),this.loading=!1}}},handleVideoGeneration:function(a){a&&a.type==="IMAGE_GENERATION"&&(console.log("burada"),a.status==="COMPLETED"?(this.loading=!1,console.log("burada 2"),a.image&&a.image.id&&(console.log("3 burada"),this.$router.push({name:"ai-creative-image-creator-detail",params:{detail:a.image.id}}))):a.status==="FAILED"&&(console.log("4 burada"),this.policy_warn=!0))},mixpanelEvent:function(a,d){let e=this.getImageSize();try{M.track(a||"Creative Create Image Detail Generate Button Clicked",{path:window.location.pathname,workflowId:this.workflowId,image_size:e.size,aspect_ratio:e.aspect_ratio,create_type:this.t
1ype})}catch(s){console.warn(s)}}},watch:{selected_template:{handler:function(a){this.workflowId=a.workflow_id,this.type=a.type}},socket_data:{handler:function(a){a&&this.handleVideoGeneration(a)}}}},pt=Object.assign(we,{setup(a){const{t:d}=S();return $({title:d("WASK - AI Creative - Image Creator")}),(e,s)=>{const r=y,l=I,p=P;return m(),c("div",R,[t("div",D,[n(x,{title:e.$t("Create Image"),back:""},{default:h(()=>[n(w)]),_:1},8,["title"]),t("div",U,[t("div",j,[t("div",{class:"cursor-pointer",onClick:s[0]||(s[0]=o=>e.goBack())},s[7]||(s[7]=[t("svg",{width:"25",height:"26",viewBox:"0 0 25 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("path",{d:"M11 8.3125L6.3125 13L11 17.6875M6.875 13H18.6875",stroke:"#445469","stroke-width":"1.71429","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])),t("h1",q,i(e.$t("Create Image")),1)]),n(w)]),t("div",H,[t("div",W,[t("div",Z,[t("div",J,[n(k,{modelValue:e.selected_template,"onUpdate:modelValue":s[1]||(s[1]=o=>e.selected_template=o),items:e.templates,placeholder:e.$t("Select a Image style"),title:"Image Style",type:"Image",class:u({"pointer-events-none opacity-50":e.loading})},null,8,["modelValue","items","placeholder","class"]),n(b,{onFileUploaded:e.onFileUploaded,optional_tag:!1,onFileRemoved:e.onFileRemoved,class:u(["mb-5",{"pointer-events-none opacity-50":e.loading}])},null,8,["onFileUploaded","onFileRemoved","class"]),t("div",K,[t("p",X,i(e.$t("Image Size")),1),n(l,{modelValue:e.video_size,"onUpdate:modelValue":s[2]||(s[2]=o=>e.video_size=o),disabled:e.loading,class:"grid-cols-3 gap-0 border border-neutral-200 rounded mb-3"},{default:h(()=>[t("label",Q,[n(r,{id:"square",value:"square",class:"w-[18px] h-[18px]"}),t("span",Y,[f(i(e.$t("Square"))+" ",1),s[8]||(s[8]=t("span",{class:"text-xs"},"1024x1024",-1))])]),t("label",ee,[n(r,{id:"landscape",value:"landscape",class:"w-[18px] h-[18px]"}),t("span",te,[f(i(e.$t("Landscape"))+" ",1),s[9]||(s[9]=t("span",{class:"text-xs"},"1536x1024",-1))])]),t("label",se,[n(r,{id:"portrait",value:"portrait",class:"w-[18px] h-[18px]"}),t("span",ae,[f(i(e.$t("Portrait"))+" ",1),s[10]||(s[10]=t("span",{class:"text-xs"},"1024x1536",-1))])])]),_:1},8,["modelValue","disabled"])]),t("div",{class:u(["mb-3 border border-neutral-200 rounded-[12px] overflow-hidden transition-all shadow-[0px_1px_2px_0px_rgba(16,24,40,0.05)]",e.prompt_text_show?"bg-neutral-50":"bg-white"])},[t("div",{class:u(["flex items-center justify-between gap-2 pt-[6px] pb-[5px] pl-3 pr-1 border-b",e.prompt_text_show?" border-neutral-200":"border-transparent"])},[t("p",oe,i(e.$t("Additional Prompt")),1),t("div",ie,[t("span",re,i(e.$t("Optional")),1),n(p,{class:"bg-transparent border p-2 border-none shadow-none hover:bg-neutral-100",onClick:s[3]||(s[3]=o=>e.prompt_text_show=!e.prompt_text_show)},{default:h(()=>[(m(),c("svg",{class:u(["shrink-0 transition-transform",e.prompt_text_show?"rotate-180":""]),width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s[11]||(s[11]=[t("path",{d:"M4.5 6.78906L8.60225 10.8913C8.82192 11.111 9.17808 11.111 9.39775 10.8913L13.5 6.78906",stroke:"#627086","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]),2))]),_:1})])],2),t("div",{class:u(["overflow-hidden transition-all duration-200 ease-in-out",e.prompt_text_show?"max-h-[140px] opacity-100":"max-h-0 opacity-0"])},[G(t("textarea",{class:"w-full h-full bg-white rounded-t-none rounded-b-[12px] border-none p-3 focus-visible:!shadow-none !shadow-none focus-visible:outline-none resize-none max-h-[140px]",placeholder:e.$t("Describe what you want"),"onUpdate:modelValue":s[4]||(s[4]=o=>e.prompt_text=o),disabled:e.loading,rows:"5",maxlength:"2500"},"                ",8,le),[[V,e.prompt_text]])],2)],2)]),e.user_has_access?(m(),c("div",ne,[n(p,{size:"lg",block:"",variant:"gradient",class:"w-full",onClick:s[5]||(s[5]=o=>e.fetchCreate()),disabled:e.loading||e.button_validation},{default:h(()=>{var o,_;return[e.loading?(m(),c(L,{key:0},[t("p",null,i(e.$t("Generating"))+"...",1),s[12]||(s[12]=t("svg",{class:"animate-spin h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),t("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}
1)],-1))],64)):(m(),c("div",de,[t("div",pe,[s[13]||(s[13]=t("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("path",{d:"M8.33081 3.11023C8.3022 2.85767 8.08867 2.66676 7.8345 2.6665C7.58032 2.66624 7.3664 2.85672 7.33728 3.10921C7.1479 4.75111 6.657 5.90564 5.86506 6.69758C5.07312 7.48952 3.91859 7.98042 2.2767 8.1698C2.0242 8.19892 1.83373 8.41284 1.83398 8.66702C1.83424 8.92119 2.02515 9.13472 2.27771 9.16333C3.89247 9.34623 5.07154 9.83693 5.88228 10.633C6.68998 11.4261 7.19112 12.5804 7.33595 14.2107C7.35888 14.4689 7.57533 14.6668 7.83455 14.6665C8.09376 14.6662 8.30977 14.4679 8.33212 14.2096C8.47093 12.6061 8.97161 11.4275 9.7833 10.6158C10.595 9.80412 11.7736 9.30345 13.3771 9.16464C13.6354 9.14229 13.8337 8.92628 13.834 8.66707C13.8343 8.40785 13.6364 8.1914 13.3782 8.16846C11.7479 8.02364 10.5936 7.5225 9.80049 6.7148C9.00441 5.90406 8.51371 4.72499 8.33081 3.11023Z",fill:"currentColor"}),t("path",{d:"M13.6939 0.839064C13.6827 0.740847 13.5997 0.666605 13.5008 0.666504C13.402 0.666403 13.3188 0.740475 13.3075 0.838669C13.2338 1.47718 13.0429 1.92617 12.735 2.23415C12.427 2.54212 11.978 2.73303 11.3395 2.80667C11.2413 2.818 11.1672 2.90119 11.1673 3.00004C11.1674 3.09888 11.2417 3.18192 11.3399 3.19305C11.9678 3.26418 12.4264 3.455 12.7417 3.76459C13.0558 4.07301 13.2506 4.5219 13.307 5.15593C13.3159 5.25634 13.4001 5.33328 13.5009 5.33317C13.6017 5.33306 13.6857 5.25592 13.6944 5.1555C13.7484 4.5319 13.9431 4.07357 14.2587 3.75791C14.5744 3.44225 15.0327 3.24754 15.6563 3.19356C15.7567 3.18486 15.8339 3.10086 15.834 3.00006C15.8341 2.89925 15.7572 2.81507 15.6567 2.80616C15.0227 2.74983 14.5738 2.55495 14.2654 2.24084C13.9558 1.92555 13.765 1.46703 13.6939 0.839064Z",fill:"currentColor"})],-1)),t("span",null,i(e.$t("Generate Image")),1)]),t("div",me,[s[14]||(s[14]=t("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("path",{d:"M11.5074 5.53594C10.7645 3.92812 9.13752 2.8125 7.25 2.8125C4.66117 2.8125 2.5625 4.91117 2.5625 7.5C2.5625 10.0471 4.59405 12.1197 7.12519 12.1859M16.4375 10.5C16.4375 13.0888 14.3388 15.1875 11.75 15.1875C9.75544 15.1875 8.05183 13.9418 7.3748 12.1859C7.17309 11.6627 7.0625 11.0943 7.0625 10.5C7.0625 7.9529 9.09405 5.88029 11.6252 5.81413C11.6667 5.81305 11.7083 5.8125 11.75 5.8125C14.3388 5.8125 16.4375 7.91117 16.4375 10.5Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"square"})],-1)),t("span",null,i((_=(o=e.constant.credits)==null?void 0:o.IMAGE_GENERATION)==null?void 0:_.price),1)])]))]}),_:1},8,["disabled"])])):B("",!0)]),t("div",ce,[e.policy_warn?(m(),c("div",ue,[s[15]||(s[15]=N('<div class="bg-warning-50 border-[#FAE9CB] border-[2px] rounded-[16px] mb-[18px]"><figure class="p-3"><svg width="42" height="42" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M21 24.5V18.375M16.2649 32.3464L19.8787 35.3756C20.5262 35.9183 21.4688 35.9211 22.1194 35.3821L25.7914 32.3399C26.1053 32.0798 26.5002 31.9375 26.9079 31.9375H31.9375C33.8705 31.9375 35.4375 30.3705 35.4375 28.4375V10.0625C35.4375 8.1295 33.8705 6.5625 31.9375 6.5625H10.0625C8.1295 6.5625 6.5625 8.1295 6.5625 10.0625V28.4375C6.5625 30.3705 8.1295 31.9375 10.0625 31.9375H15.1407C15.5518 31.9375 15.9498 32.0822 16.2649 32.3464Z" stroke="#D97706" stroke-width="2.63" stroke-linecap="round"></path><path d="M21 14H21.0175" stroke="#D97706" stroke-width="3" stroke-linecap="round"></path></svg></figure></div>',1)),t("p",he,i(e.$t("Something Went Wrong")),1),t("p",fe,[f(i(e.$t("The image couldn't be generated due to a policy restriction or an issue."))+" ",1),t("strong",ge,i(e.$t("No credits were used")),1)]),n(p,{variant:"outline",onClick:s[6]||(s[6]=o=>e.refreshPage())},{default:h(()=>[f(i(e.$t("Understood")),1)]),_:1})])):(m(),T(C,{key:0,limit:90,from:!0,loading:e.loading,text:"Based on your inputs, we'll generate a high-performing ad creative. Click Generate Image to get started."},null,8,["loading"]))])])])])])}}});export{pt 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.