1try{(function(){var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`ffe28ae1-453e-49cf-96a8-ac2149dfb222`,e._sentryDebugIdIdentifier=`sentry-dbid-ffe28ae1-453e-49cf-96a8-ac2149dfb222`)})()}catch{}import{a as e}from"./rolldown-runtime-b3djmhq7.js";import{A as t,C as n,E as r,K as i,O as a,S as o,St as s,T as c,X as l,_ as u,_t as d,at as f,c as p,dt as m,et as h,h as g,it as _,k as v,nt as y,o as b,ot as x,s as S,v as C,w,yt as T}from"./@[email protected][email protected][email protected][email protected]_-jxrs2q3w.js";import{Q as ee,T as E,Z as D,w as O}from"./graphql-o7niqh9y.js";import{a as k,i as te}from"./[email protected][email protected][email protected]_-fl4zvr4k.js";import{s as A,t as j}from"./[email protected]";import{t as M}from"./_plugin-vue_export-helper-dcll0qwj.js";import{H as N,K as ne,S as P,z as F}from"./html-oa9xpjfb.js";import{a as I,i as L,n as R,r as z}from"./[email protected]";import{a as B,c as re,i as V,o as ie,r as H,s as U,t as W}from"./forms-oaw6x9r8.js";import{t as G}from"./CreationListingItem-bcytm6q2.js";p();var K=e(A()),q=e(j()),J={class:`d-flex flex-column`},Y={class:`input-group`},X={key:1,class:`text-danger mt-2`},ae=t({__name:`CreationSearchInput`,props:{modelValue:{},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let t=h(e,`modelValue`),a=k(),o=m(),l=m(``),u=m(),d=RegExp(`^`+(0,q.default)(location.origin)+`\\/?`);function f(){o.value=void 0,u.value=void 0,t.value=null}return y(l,(0,K.default)(async()=>{if(f(),l.value==``)return;let e=l.value;e=e.replace(d,``);let n=a.resolve(`/`+e);n.name===`creation`&&(e=String(n.params.id));let r=await S({query:O,variables:{id:e}}).execute();r.error?u.value=`Creation not found`:(o.value=r.data?.creation,t.value=o.value?.shareId)},300)),(e,t)=>(i(),r(`div`,J,[n(`div`,Y,[x(n(`input`,{class:`form-control`,type:`text`,"onUpdate:modelValue":t[0]||=e=>l.value=e,placeholder:`Creation ID or URL, e.g. af89dx`},null,512),[[g,l.value]]),l.value?(i(),r(`button`,{key:0,class:`btn btn-secondary`,onClick:t[1]||=e=>{f(),l.value=``}},`Clear`)):c(``,!0)]),o.value?(i(),w(G,{key:0,class:`mx-auto mt-3`,item:o.value},null,8,[`item`])):u.value?(i(),r(`span`,X,s(u.value),1)):c(``,!0)]))}});p();var oe={key:0,class:`container`},se={class:`row`},ce={class:`col card`},le={class:`card-body`},ue={class:`text-center`},de={class:`col flex-grow-0 flex-shrink-1`},fe={key:1,class:`container`},pe={class:`display-4 text-center`},me={class:`row`},he={class:`col`},ge={class:`card-body d-flex flex-column gap-5 position-relative`},_e={class:`step`},ve={class:`mx-3 mt-3`},ye={key:0,class:`file-input`,style:{"max-width":`40rem`}},be=[`value`],xe={key:1,class:`text-success`},Z={class:`mx-3 mt-3`},Se={class:`ms-0 ms-md-2 mt-2`},Ce={class:`mx-3 mt-1 mb-2`},we={key:0,class:`text-danger`},Te={class:`mx-3 mt-3`},Ee={class:`mx-3 mt-3 row`},De={class:`col-lg-6 align-self-start card px-0`},Oe={class:`card-body`},Q=M(t({__name:`UploadCreation`,props:{kind:String},async setup(e){let t,p,h=te(),g=k(),x=new W(z({title:L().label(`Title`).default(``).required().max(300),body:L().label(`Body`).default(``).max(F),file:I().label(`File`).default(!1).oneOf([!0]),images:R().default([]).of(L())}),Q),w=m(!1),O=m(null),A=m(),j=m(),M=o(()=>!w.value&&!x.data.file?1:x.data.title==``?2:3),K=m(typeof h.query.images==`string`?h.query.images.split(`,`).map(e=>({id:e,name:e})):[]);y(K,e=>x.data.images=e.filter(e=>!e.loading).map(e=>e.id),{deep:!0});let q=m();if(h.query.prefill){h.query.blobs||(location.href=`/`),w.value=!0,x.data.file=!0,q.value=String(h.query.blobs);try{let e=JSON.parse(atob(String(h.query.prefill)));e.version===1&&(e.title&&(x.data.title=e.title),e.body&&(x.data.body=e.body))}catch(e){console.error(`Failed to parse prefilled data from URL hash`,e)}}let J=m();if(w.value){let e=([t,p]=_(()=>P()),t=await t,p(),t);if(e){let{data:n}=([t,p]=_(()=>S({query:E,variables:{id:e}}).execute()),t=await t,p(),t);n&&(J.value=n)}}function Y(){j.value=A.value.files[0],x.data.file=!0}let{execute:X}=b(D);async function Q(){if(K.value.length==0&&!confirm(`You haven't uploaded any carousel images, are you sure you want to continue?`))return;let e;if(q.value)e=q.value;else if(j.value){let t=await N(j.value,`creation`,{type:`application/zip+lwblotter`});if(!t){alert(`Failed to upload file`);return}e=t.id.toString()}else{alert(`You must select a file to upload.`);return}let{error:t,data:n}=await X({input:{title:x.data.title,body:x.data.body,images:K.value.filter(e=>!e.loading).map(e=>e.id),isGameUpload:w.value,uploadedFileId:e,parentId:O.value}});if(t)throw t;g.push(n.uploadCreation.creation.canonicalPath)}let $=new W(z({summary:L().label(`Summary`).default(``).max(100)}),Ae),{execute:ke}=b(ee);async function Ae(){if(!q.value){alert(`You must select a file to upload.`);return}let{data:e,error:t}=await ke({input:{creationId:J.value.creation.shareId,uploadId:q.value,summary:$.data.summary}});if(t)throw t;g.push(e.uploadCreationVersion.creation.canonicalPath)}function je(){x.reset(),j.value=void 0}return(t,o)=>{let p=l(`icon`);return i(),r(C,null,[v(d(ne),{title:`Upload creation`}),J.value?(i(),r(`div`,oe,[o[7]||=n(`p`,{class:`display-4 text-center`},`Upload new creation revision`,-1),n(`div`,se,[n(`div`,ce,[n(`div`,le,[n(`h5`,ue,[o[4]||=a(`Uploading this file will create revision `,-1),n(`b`,null,s(J.value.creation.versions.length+1),1),a(` of your `+s(J.value.creation.kind.toLocaleLowerCase()),1)]),o[5]||=n(`hr`,null,null,-1),o[6]||=n(`div`,{class:`mb-2`},`You may optionally write a short summary of the changes you've made in this revision:`,-1),v(d(B),{form:d($)},{default:f(()=>[v(d(V),{name:`summary`}),v(d(U),{class:`mt-2`}),v(d(H))]),_:1},8,[`form`])])]),n(`div`,de,[v(G,{item:J.value.creation},null,8,[`item`])])])])):(i(),r(`div`,fe,[n(`p`,pe,s(w.value?`Finish publishing your creation`:`Upload your `+(e.kind||`creation`)),1),n(`div`,me,[o[17]||=n(`div`,{class:`col-md-1`},null,-1),n(`div`,he,[v(d(B),{class:`card`,id:`create-creation`,form:d(x),warn:``,"restore-omit-keys":[`file`]},{default:f(()=>[n(`div`,ge,[M.value>1?(i(),r(`button`,{key:0,class:`btn btn-danger reset-button`,onClick:o[0]||=e=>je()},`Reset`)):c(``,!0),n(`div`,_e,[o[10]||=n(`h5`,null,[n(`span`,{class:`step-marker`},`1`),a(`Upload your ZIP file`)],-1),n(`div`,ve,[w.value?(i(),r(`p`,xe,[v(p,{class:`me-2`,icon:`check`}),o[9]||=a(`Already uploaded`,-1)])):(i(),r(`div`,ye,[n(`div`,{class:`input-group`,onClick:o[1]||=u(e=>A.value?.click(),[`prevent`])},[o[8]||=n(`div`,{class:`btn btn-primary`},`Select file`,-1),n(`input`,{class:`form-control`,type:`text`,value:j.value?.name,placeholder:`No file selected`},null,8,be)]),n(`input`,{type:`file`,ref_key:`fileInputEl`,ref:A,onCh
1ange:Y,accept:`.zip,application/zip`},null,544)]))])]),n(`div`,{class:T([`step`,{blurred:M.value<2}])},[o[12]||=n(`h5`,null,[n(`span`,{class:`step-marker`},`2`),a(`Give it a title and a description`)],-1),n(`div`,Z,[v(d(V),{name:`title`,"show-error":!1}),v(d(V),{class:`mt-3`,name:`body`,is:`textarea`,initialHeight:200}),n(`details`,Se,[o[11]||=n(`summary`,{class:`text-muted`},`Add description images (these won't be shown on the carousel)`,-1),v(d(ie),{class:`mt-3`,nature:`inline_image`})])])],2),n(`div`,{class:T([`step`,{blurred:M.value<3}])},[o[14]||=n(`h5`,{class:`mb-0`},[n(`span`,{class:`step-marker`},`3`),a(`Add some carousel images`)],-1),n(`div`,Ce,[o[13]||=n(`div`,{class:`text-muted`},`These images will be shown at the top of your post. You can reorder them by clicking and dragging!`,-1),K.value.length==0?(i(),r(`div`,we,`Make sure to add at least one image so that people can see your creation in action!`)):c(``,!0)]),n(`div`,Te,[v(re,{class:`justify-content-start`,modelValue:K.value,"onUpdate:modelValue":o[2]||=e=>K.value=e,nature:`creation_image`,reorderable:``,showNotAddedWarning:!1},null,8,[`modelValue`])])],2),n(`div`,{class:T([`step`,{blurred:M.value<3}])},[o[16]||=n(`h5`,null,[n(`span`,{class:`step-marker`},`4`),a(`Additional Options`)],-1),n(`div`,Ee,[o[15]||=n(`div`,{class:`col-lg-6 pt-2 pe-4`},[n(`h5`,null,`Mark as remix`),n(`p`,{class:`text-muted`},`You may indicate that your creation is based on previous work by you or a different user, for example if you made it smaller or more efficient.`)],-1),n(`div`,De,[n(`div`,Oe,[v(ae,{class:`py-2`,modelValue:O.value,"onUpdate:modelValue":o[3]||=e=>O.value=e},null,8,[`modelValue`])])])])],2),n(`div`,{class:T([`step align-self-stretch`,{blurred:M.value<3}])},[v(d(H),{class:`fs-6`}),v(d(U),{class:`w-100`})],2)])]),_:1},8,[`form`])]),o[18]||=n(`div`,{class:`col-md-1`},null,-1)])]))],64)}}}),[[`__scopeId`,`data-v-4958e0b7`]]);export{Q 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.