PageSourceSearch

https://modrinth.com/_nuxt/COoI8LEy.js

js modrinth.com collected 2026-10-01 10:39:54 UTC 4,800 bytes, 1 lines download raw bytes

1import{d as A,u as L,aW as O,aU as F,c as l,o as s,a as j,m as a,k as e,F as N,fG as b,p as E,v as R,a1 as U,U as W}from"./DUququmF.js";import{u as Y}from"./BLAvMVIs.js";import{A as c}from"./CQXioT8-.js";import{_ as $}from"./Ceb5hOOj.js";import{_ as G}from"./BSCmzh_G.js";import{i as q}from"./DfZrApHQ.js";const Z=A({__name:"EnvironmentMigration",props:{showFloatingSave:{type:Boolean,default:!0}},setup(T,{expose:k}){const{formatMessage:t}=L(),M=T,{currentMember:D,projectV2:P,projectV3:n,invalidate:V}=q(),{handleError:S}=O(),I=F(),d=l(()=>(n.value?.project_types??[]).some(o=>["mod","modpack"].includes(o))),r=l(()=>n.value?.side_types_migration_review_status==="pending"&&(n.value?.environment?.length??0)>0&&n.value?.environment?.[0]!=="unknown"&&d.value),p=l(()=>((D.value?.permissions??0)&4)===4);function g(){const o=n.value?.environment;return o?.length===1?o[0]:void 0}const{saved:x,current:v,saving:y,reset:u,save:f,hasChanges:B}=Y(()=>({environment:g(),side_types_migration_review_status:n.value?.side_types_migration_review_status}),async({environment:o})=>{try{await I.labrinth.projects_v3.edit(P.value.id,{environment:o,side_types_migration_review_status:"reviewed"}),await V(),u()}catch(m){S(m)}}),h=g();h&&h!=="unknown"&&(v.value.side_types_migration_review_status="reviewed");const _=l(()=>!r.value),w=l(()=>d.value&&p.value&&(n.value?.environment?.length??0)<=1);k({hasChanges:B,saving:y,canReset:_,canSave:w,needsToVerify:r,reset:u,save:f});const i=W({verifyButton:{id:"project.settings.environment.verification.verify-button",defaultMessage:"Verify"},verifyLabel:{id:"project.settings.environment.verification.verify-text",defaultMessage:"Verify that this project's environment is set correctly."},wrongProjectTypeTitle:{id:"project.settings.environment.notice.wrong-project-type.title",defaultMessage:"This project type does not support environment metadata"},wrongProjectTypeDescription:{id:"project.settings.environment.notice.wrong-project-type.description",defaultMessage:"Only mod or modpack projects can have environment metadata."},missingEnvTitle:{id:"project.settings.environment.notice.missing-env.title",defaultMessage:"Please select an environment for your project"},missingEnvDescription:{id:"project.settings.environment.notice.missing-env.description",defaultMessage:"Your project is missing environment metadata, please select the appropriate option below."}
1,multipleEnvironmentsTitle:{id:"project.settings.environment.notice.multiple-environments.title",defaultMessage:"Your project has multiple environments"},multipleEnvironmentsDescription:{id:"project.settings.environment.notice.multiple-environments.description",defaultMessage:"Different versions of your project have different environments selected, so you can't edit them globally at this time."},reviewOptionsTitle:{id:"project.settings.environment.notice.review-options.title",defaultMessage:"Please review the options below"},reviewOptionsDescription:{id:"project.settings.environment.notice.review-options.description",defaultMessage:"We've just overhauled the Environments system on Modrinth and new options are now available. Please ensure the correct option is selected below and then click 'Verify' when you're done!"}});return(o,m)=>(s(),j("div",null,[d.value?(s(),j(N,{key:1},[p.value?!e(n)?.environment||e(n).environment.length===0||e(n).environment.length===1&&e(n).environment[0]==="unknown"?(s(),a(e(c),{key:1,type:"critical",header:e(t)(e(i).missingEnvTitle),body:e(t)(e(i).missingEnvDescription),class:"mb-3"},null,8,["header","body"])):(e(n)?.environment?.length??0)>
11?(s(),a(e(c),{key:2,type:"info",header:e(t)(e(i).multipleEnvironmentsTitle),body:e(t)(e(i).multipleEnvironmentsDescription),class:"mb-3"},null,8,["header","body"])):r.value?(s(),a(e(c),{key:3,type:"warning",header:e(t)(e(i).reviewOptionsTitle),body:e(t)(e(i).reviewOptionsDescription),class:"mb-3"},null,8,["header","body"])):E("",!0):(s(),a(e(c),{key:0,type:"critical",header:e(t)(e(b).noPermissionTitle),body:e(t)(e(b).noPermissionDescription),class:"mb-3"},null,8,["header","body"])),R(e($),{modelValue:e(v).environment,"onUpdate:modelValue":m[0]||(m[0]=C=>e(v).environment=C),disabled:!p.value||(e(n)?.environment?.length??0)>1},null,8,["modelValue","disabled"])],64)):(s(),a(e(c),{key:0,type:"critical",header:e(t)(e(i).wrongProjectTypeTitle),body:e(t)(e(i).wrongProjectTypeDescription),class:"mb-3"},null,8,["header","body"])),M.showFloatingSave&&w.value?(s(),a(e(G),{key:2,original:e(x),modified:e(v),saving:e(y),"can-reset":_.value,text:r.value?e(i).verifyLabel:void 0,"save-label":r.value?e(i).verifyButton:void 0,"save-icon":r.value?e(U):void 0,onReset:e(u),onSave:e(f)},null,8,["original","modified","saving","can-reset","text","save-label","save-icon","onReset","onSave"])):E("",!0)]))}});export{Z as _};

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.