Files
misode.github.io/assets/index.fcc7d815.js
2021-11-08 19:46:15 +00:00

3 lines
116 KiB
JavaScript

var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,i=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,s=(e,t)=>{for(var n in t||(t={}))a.call(t,n)&&i(e,n,t[n]);if(o)for(var n of o(t))r.call(t,n)&&i(e,n,t[n]);return e},l=(e,o)=>t(e,n(o));import{y as c,a as d,s as u,l as m,r as h,b as p,j as f,c as g,d as v,e as _,f as w,g as y,m as b,h as x,L as k,G as C,V as A,O as M,i as z,w as j,Z as V,k as $,z as E,T as I,E as O,C as L,n as P,A as S,o as D,p as T,q as N,t as B,u as H,v as R,x as F,B as W,D as J,F as G,N as U,R as Y}from"./vendor.f42aafe4.js";var Z,q=JSON.parse('{"languages":[{"code":"de","name":"Deutsch"},{"code":"en","name":"English"},{"code":"fr","name":"Français"},{"code":"it","name":"Italiano"},{"code":"ja","name":"日本語"},{"code":"pl","name":"Polski"},{"code":"pt","name":"Português"},{"code":"ru","name":"Русский"},{"code":"sk","name":"Slovenčina","schemas":false},{"code":"zh-cn","name":"简体中文"},{"code":"zh-tw","name":"正體中文"}],"versions":[{"id":"1.15","latest":"1.15.2","refs":{"mcdata_master":"13355f7","mcassets":"1.15.2"}},{"id":"1.16","latest":"1.16.5","refs":{"mcdata_master":"1.16.4","mcassets":"1.16.5","vanilla_datapack_data":"1.16.4-data","vanilla_datapack_summary":"1.16.4-summary"}},{"id":"1.17","latest":"1.17.1","refs":{"mcdata_master":"1.17.1","mcassets":"1.17.1","vanilla_datapack_data":"1.17.1-data","vanilla_datapack_summary":"1.17.1-summary"}},{"id":"1.18","refs":{"mcdata_master":"master","mcassets":"21w44a","vanilla_datapack_data":"data","vanilla_datapack_summary":"summary"},"dynamic":true}],"generators":[{"id":"loot_table","url":"loot-table","path":"loot_tables","schema":"loot_table","maxVersion":"1.17"},{"id":"predicate","url":"predicate","path":"predicates","schema":"predicate"},{"id":"item_modifier","url":"item-modifier","path":"item_modifiers","schema":"item_modifier","minVersion":"1.17"},{"id":"advancement","url":"advancement","path":"advancements","schema":"advancement"},{"id":"recipe","url":"recipe","path":"recipes","schema":"recipe"},{"id":"dimension","url":"dimension","schema":"dimension","category":"worldgen","minVersion":"1.16"},{"id":"dimension_type","url":"dimension-type","schema":"dimension_type","category":"worldgen","minVersion":"1.16"},{"id":"world","url":"world","schema":"world_settings","category":"worldgen","minVersion":"1.16"},{"id":"worldgen/biome","url":"worldgen/biome","category":"worldgen","schema":"biome","minVersion":"1.16"},{"id":"worldgen/configured_carver","url":"worldgen/carver","category":"worldgen","schema":"configured_carver","minVersion":"1.16"},{"id":"worldgen/configured_feature","url":"worldgen/feature","category":"worldgen","schema":"configured_feature","minVersion":"1.16"},{"id":"worldgen/noise","url":"worldgen/noise","category":"worldgen","schema":"noise_parameters","minVersion":"1.18"},{"id":"worldgen/noise_settings","url":"worldgen/noise-settings","category":"worldgen","schema":"noise_settings","minVersion":"1.16"},{"id":"worldgen/configured_structure_feature","url":"worldgen/structure-feature","category":"worldgen","schema":"configured_structure_feature","minVersion":"1.16"},{"id":"worldgen/configured_surface_builder","url":"worldgen/surface-builder","category":"worldgen","schema":"configured_surface_builder","minVersion":"1.16","maxVersion":"1.17"},{"id":"worldgen/processor_list","url":"worldgen/processor-list","category":"worldgen","schema":"processor_list","minVersion":"1.16"},{"id":"worldgen/template_pool","url":"worldgen/template-pool","category":"worldgen","schema":"template_pool","minVersion":"1.16"},{"id":"block_definition","url":"assets/blockstate","path":"blockstates","category":"assets","schema":"block_definition","minVersion":"1.18"},{"id":"model","url":"assets/model","path":"models","category":"assets","schema":"model","minVersion":"1.18"}],"registries":[{"id":"advancement","dynamic":true},{"id":"attribute","minVersion":"1.16"},{"id":"block"},{"id":"block_definition","path":"blockstates","asset":true},{"id":"block_predicate_type","minVersion":"1.18"},{"id":"dimension","dynamic":true},{"id":"dimension_type","dynamic":true},{"id":"enchantment"},{"id":"entity_type"},{"id":"fluid"},{"id":"function","dynamic":true},{"id":"float_provider_type","minVersion":"1.17"},{"id":"item"},{"id":"int_provider_type","minVersion":"1.17"},{"id":"height_provider_type","minVersion":"1.17"},{"id":"loot_condition_type","minVersion":"1.16"},{"id":"loot_condition_type","minVersion":"1.16"},{"id":"loot_function_type","minVersion":"1.16"},{"id":"loot_nbt_provider_type","minVersion":"1.17"},{"id":"loot_number_provider_type","minVersion":"1.17"},{"id":"loot_pool_entry_type","minVersion":"1.16"},{"id":"loot_score_provider_type","minVersion":"1.17"},{"id":"loot_table","dynamic":true},{"id":"mob_effect"},{"id":"model","path":"models","asset":true},{"id":"pos_rule_test","minVersion":"1.16"},{"id":"potion","minVersion":"1.15"},{"id":"predicate","dynamic":true},{"id":"recipe","dynamic":true},{"id":"recipe_serializer"},{"id":"rule_test","minVersion":"1.16"},{"id":"sound_event"},{"id":"stat_type"},{"id":"structure","dynamic":true},{"id":"tag/block","dynamic":true},{"id":"tag/entity_type","dynamic":true},{"id":"tag/fluid","dynamic":true},{"id":"tag/function","dynamic":true},{"id":"tag/item","dynamic":true},{"id":"texture","path":"textures","asset":true},{"id":"worldgen/biome","dynamic":true},{"id":"worldgen/block_state_provider_type","minVersion":"1.16"},{"id":"worldgen/block_placer_type","minVersion":"1.16","maxVersion":"1.17"},{"id":"worldgen/biome_source","minVersion":"1.16"},{"id":"worldgen/carver","minVersion":"1.16"},{"id":"worldgen/chunk_generator","minVersion":"1.16"},{"id":"worldgen/configured_carver","minVersion":"1.16","dynamic":true},{"id":"worldgen/configured_decorator","minVersion":"1.16","dynamic":true},{"id":"worldgen/configured_feature","minVersion":"1.16","dynamic":true},{"id":"worldgen/configured_structure_feature","minVersion":"1.16","dynamic":true},{"id":"worldgen/configured_surface_builder","minVersion":"1.16","dynamic":true},{"id":"worldgen/decorator","minVersion":"1.16"},{"id":"worldgen/feature","minVersion":"1.16"},{"id":"worldgen/feature_size_type","minVersion":"1.16"},{"id":"worldgen/foliage_placer_type","minVersion":"1.16"},{"id":"worldgen/material_condition","minVersion":"1.18"},{"id":"worldgen/material_rule","minVersion":"1.18"},{"id":"worldgen/noise","minVersion":"1.18","dynamic":true},{"id":"worldgen/noise_settings","minVersion":"1.16","dynamic":true},{"id":"worldgen/processor_list","minVersion":"1.16","dynamic":true},{"id":"worldgen/structure_feature","minVersion":"1.16"},{"id":"worldgen/structure_pool_element","minVersion":"1.16"},{"id":"worldgen/structure_processor","minVersion":"1.16"},{"id":"worldgen/surface_builder","minVersion":"1.16","maxVersion":"1.17"},{"id":"worldgen/template_pool","minVersion":"1.16","dynamic":true},{"id":"worldgen/tree_decorator_type","minVersion":"1.16"},{"id":"worldgen/trunk_placer_type","minVersion":"1.16"},{"id":"biome","maxVersion":"1.15"},{"id":"worldgen/biome","minVersion":"1.16","path":"processed/reports/biomes"}]}');function K({type:e,id:t}){return c((()=>{var e;null==(e=document.getElementById("ad-placeholder"))||e.remove(),"ethicalads"in window&&ethicalads.load()}),[]),d("div",{"data-ea-publisher":"misode-github-io","data-ea-type":e,class:"ad dark flat",id:t})}function X({icon:e,label:t,active:n,class:o,tooltip:a,tooltipLoc:r,onClick:i}){return d("div",{class:`btn${n?" active":""}${o?` ${o}`:""}${a?` tooltipped tip-${null!=r?r:"sw"}`:""}`,onClick:i,"aria-label":a},e&&ae[e],t&&d("span",null,t))}function Q({icon:e,label:t,large:n,doSelect:o,value:a,placeholder:r,onChange:i}){const s=void 0===i?()=>{}:e=>{const t=e.target.value;null==i||i(t)},l=u(null);return c((()=>{o&&l.current&&l.current.select()}),[o]),d("div",{class:"btn btn-input "+(n?"large-input":""),onClick:e=>e.stopPropagation()},e&&ae[e],t&&d("span",null,t),d("input",{ref:l,type:"text",value:a,onChange:s,placeholder:r}))}function ee({size:e,draw:t,onDrag:n,onHover:o,onLeave:a},r){const i=u(null),s=u(),l=u(),d=u([0,0]),m=u(!1);c((()=>{const e=e=>{s.current=[e.offsetX,e.offsetY]},t=e=>{if(void 0===s.current){const t=e.offsetX/i.current.clientWidth,n=e.offsetY/i.current.clientHeight;return void(null==o||o(t,n))}if(!n)return;const t=e.offsetX-s.current[0],a=e.offsetY-s.current[1];0===t&&0===a||(d.current=[d.current[0]+t,d.current[1]+a],m.current||(cancelAnimationFrame(l.current),l.current=requestAnimationFrame((async()=>{m.current=!0;const e=d.current[0]/i.current.clientWidth,t=d.current[1]/i.current.clientHeight;d.current=[0,0],await(null==n?void 0:n(e,t)),m.current=!1})))),s.current=[e.offsetX,e.offsetY]},r=()=>{s.current=void 0},c=()=>{null==a||a()};return i.current.addEventListener("mousedown",e),i.current.addEventListener("mousemove",t),i.current.addEventListener("mouseleave",c),document.body.addEventListener("mouseup",r),()=>{var n,o,a;null==(n=i.current)||n.removeEventListener("mousedown",e),null==(o=i.current)||o.removeEventListener("mousemove",t),null==(a=i.current)||a.removeEventListener("mouseleave",c),document.body.removeEventListener("mouseup",r)}}),[...null!=r?r:[],i.current]);const h=u(),p=u(0);return h.current=async()=>{const n=i.current.getContext("2d"),o=e();i.current.width=o[0],i.current.height=o[1];const a=n.getImageData(0,0,o[0],o[1]),r=p.current+=1;await t(a),r===p.current&&n.putImageData(a,0,0)},{canvas:i,redraw:h.current}}function te(){const[e,t]=m(!1),n=()=>{t(!1)};return c((()=>(e&&(document.body.addEventListener("click",n),document.body.addEventListener("contextmenu",n)),()=>{document.body.removeEventListener("click",n),document.body.removeEventListener("contextmenu",n)})),[e]),[e,()=>t(!0)]}function ne(e,t){const n={invalidated(){e&&t(e)}};c((()=>(null==e||e.addListener(n),()=>{null==e||e.removeListener(n)})),[e])}function oe({icon:e,label:t,relative:n,tooltip:o,children:a}){const[r,i]=te();return d("div",{class:"btn-menu"+(!1===n?" no-relative":"")},d(X,l(s({},{icon:e,label:t,tooltip:o}),{onClick:i})),r&&d("div",{class:"btn-group"},a))}!function(e){const t="Site",n="Generator";function o(e,t,n){ga("send","event",e,t,n)}function a(e,t){ga("set",`dimension${e}`,t)}e.pageview=function(e){ga("set","page",e),ga("send","pageview")},e.setLanguage=function(e){a(4,e),o(t,"set-language",e)},e.setTheme=function(e){a(1,e),o(t,"set-theme",e)},e.setVersion=function(e){a(3,e),o(n,"set-version",e)},e.setPreview=function(e){a(5,e),o(n,"set-preview",e)},e.setGenerator=function(e){a(6,e)},e.generatorEvent=function(e,t){o(n,e,t)}}(Z||(Z={}));const ae={alert:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z"})),archive:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M1.75 2.5a.25.25 0 00-.25.25v1.5c0 .138.112.25.25.25h12.5a.25.25 0 00.25-.25v-1.5a.25.25 0 00-.25-.25H1.75zM0 2.75C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75v1.5A1.75 1.75 0 0114.25 6H1.75A1.75 1.75 0 010 4.25v-1.5zM1.75 7a.75.75 0 01.75.75v5.5c0 .138.112.25.25.25h10.5a.25.25 0 00.25-.25v-5.5a.75.75 0 111.5 0v5.5A1.75 1.75 0 0113.25 15H2.75A1.75 1.75 0 011 13.25v-5.5A.75.75 0 011.75 7zm4.5 1a.75.75 0 000 1.5h3.5a.75.75 0 100-1.5h-3.5z"})),arrow_left:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M7.78 12.53a.75.75 0 01-1.06 0L2.47 8.28a.75.75 0 010-1.06l4.25-4.25a.75.75 0 011.06 1.06L4.81 7h7.44a.75.75 0 010 1.5H4.81l2.97 2.97a.75.75 0 010 1.06z"})),arrow_right:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M8.22 2.97a.75.75 0 011.06 0l4.25 4.25a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06-1.06l2.97-2.97H3.75a.75.75 0 010-1.5h7.44L8.22 4.03a.75.75 0 010-1.06z"})),check:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"})),chevron_down:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M12.78 6.22a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06 0L3.22 7.28a.75.75 0 011.06-1.06L8 9.94l3.72-3.72a.75.75 0 011.06 0z"})),chevron_right:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M6.22 3.22a.75.75 0 011.06 0l4.25 4.25a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06-1.06L9.94 8 6.22 4.28a.75.75 0 010-1.06z"})),chevron_up:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M3.22 9.78a.75.75 0 010-1.06l4.25-4.25a.75.75 0 011.06 0l4.25 4.25a.75.75 0 01-1.06 1.06L8 6.06 4.28 9.78a.75.75 0 01-1.06 0z"})),clippy:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M5.75 1a.75.75 0 00-.75.75v3c0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75v-3a.75.75 0 00-.75-.75h-4.5zm.75 3V2.5h3V4h-3zm-2.874-.467a.75.75 0 00-.752-1.298A1.75 1.75 0 002 3.75v9.5c0 .966.784 1.75 1.75 1.75h8.5A1.75 1.75 0 0014 13.25v-9.5a1.75 1.75 0 00-.874-1.515.75.75 0 10-.752 1.298.25.25 0 01.126.217v9.5a.25.25 0 01-.25.25h-8.5a.25.25 0 01-.25-.25v-9.5a.25.25 0 01.126-.217z"})),code:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M4.72 3.22a.75.75 0 011.06 1.06L2.06 8l3.72 3.72a.75.75 0 11-1.06 1.06L.47 8.53a.75.75 0 010-1.06l4.25-4.25zm6.56 0a.75.75 0 10-1.06 1.06L13.94 8l-3.72 3.72a.75.75 0 101.06 1.06l4.25-4.25a.75.75 0 000-1.06l-4.25-4.25z"})),dash:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M2 8a.75.75 0 01.75-.75h10.5a.75.75 0 010 1.5H2.75A.75.75 0 012 8z"})),device_desktop:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M1.75 2.5h12.5a.25.25 0 01.25.25v7.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25v-7.5a.25.25 0 01.25-.25zM14.25 1H1.75A1.75 1.75 0 000 2.75v7.5C0 11.216.784 12 1.75 12h3.727c-.1 1.041-.52 1.872-1.292 2.757A.75.75 0 004.75 16h6.5a.75.75 0 00.565-1.243c-.772-.885-1.193-1.716-1.292-2.757h3.727A1.75 1.75 0 0016 10.25v-7.5A1.75 1.75 0 0014.25 1zM9.018 12H6.982a5.72 5.72 0 01-.765 2.5h3.566a5.72 5.72 0 01-.765-2.5z"})),download:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M7.47 10.78a.75.75 0 001.06 0l3.75-3.75a.75.75 0 00-1.06-1.06L8.75 8.44V1.75a.75.75 0 00-1.5 0v6.69L4.78 5.97a.75.75 0 00-1.06 1.06l3.75 3.75zM3.75 13a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5z"})),duplicate:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{d:"M10.5 3a.75.75 0 01.75.75v1h1a.75.75 0 010 1.5h-1v1a.75.75 0 01-1.5 0v-1h-1a.75.75 0 010-1.5h1v-1A.75.75 0 0110.5 3z"}),d("path",{"fill-rule":"evenodd",d:"M6.75 0A1.75 1.75 0 005 1.75v7.5c0 .966.784 1.75 1.75 1.75h7.5A1.75 1.75 0 0016 9.25v-7.5A1.75 1.75 0 0014.25 0h-7.5zM6.5 1.75a.25.25 0 01.25-.25h7.5a.25.25 0 01.25.25v7.5a.25.25 0 01-.25.25h-7.5a.25.25 0 01-.25-.25v-7.5z"}),d("path",{d:"M1.75 5A1.75 1.75 0 000 6.75v7.5C0 15.216.784 16 1.75 16h7.5A1.75 1.75 0 0011 14.25v-1.5a.75.75 0 00-1.5 0v1.5a.25.25 0 01-.25.25h-7.5a.25.25 0 01-.25-.25v-7.5a.25.25 0 01.25-.25h1.5a.75.75 0 000-1.5h-1.5z"})),eye:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M1.679 7.932c.412-.621 1.242-1.75 2.366-2.717C5.175 4.242 6.527 3.5 8 3.5c1.473 0 2.824.742 3.955 1.715 1.124.967 1.954 2.096 2.366 2.717a.119.119 0 010 .136c-.412.621-1.242 1.75-2.366 2.717C10.825 11.758 9.473 12.5 8 12.5c-1.473 0-2.824-.742-3.955-1.715C2.92 9.818 2.09 8.69 1.679 8.068a.119.119 0 010-.136zM8 2c-1.981 0-3.67.992-4.933 2.078C1.797 5.169.88 6.423.43 7.1a1.619 1.619 0 000 1.798c.45.678 1.367 1.932 2.637 3.024C4.329 13.008 6.019 14 8 14c1.981 0 3.67-.992 4.933-2.078 1.27-1.091 2.187-2.345 2.637-3.023a1.619 1.619 0 000-1.798c-.45-.678-1.367-1.932-2.637-3.023C11.671 2.992 9.981 2 8 2zm0 8a2 2 0 100-4 2 2 0 000 4z"})),eye_closed:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M.143 2.31a.75.75 0 011.047-.167l14.5 10.5a.75.75 0 11-.88 1.214l-2.248-1.628C11.346 13.19 9.792 14 8 14c-1.981 0-3.67-.992-4.933-2.078C1.797 10.832.88 9.577.43 8.9a1.618 1.618 0 010-1.797c.353-.533.995-1.42 1.868-2.305L.31 3.357A.75.75 0 01.143 2.31zm3.386 3.378a14.21 14.21 0 00-1.85 2.244.12.12 0 00-.022.068c0 .021.006.045.022.068.412.621 1.242 1.75 2.366 2.717C5.175 11.758 6.527 12.5 8 12.5c1.195 0 2.31-.488 3.29-1.191L9.063 9.695A2 2 0 016.058 7.52l-2.53-1.832zM8 3.5c-.516 0-1.017.09-1.499.251a.75.75 0 11-.473-1.423A6.23 6.23 0 018 2c1.981 0 3.67.992 4.933 2.078 1.27 1.091 2.187 2.345 2.637 3.023a1.619 1.619 0 010 1.798c-.11.166-.248.365-.41.587a.75.75 0 11-1.21-.887c.148-.201.272-.382.371-.53a.119.119 0 000-.137c-.412-.621-1.242-1.75-2.366-2.717C10.825 4.242 9.473 3.5 8 3.5z"})),gear:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M7.429 1.525a6.593 6.593 0 011.142 0c.036.003.108.036.137.146l.289 1.105c.147.56.55.967.997 1.189.174.086.341.183.501.29.417.278.97.423 1.53.27l1.102-.303c.11-.03.175.016.195.046.219.31.41.641.573.989.014.031.022.11-.059.19l-.815.806c-.411.406-.562.957-.53 1.456a4.588 4.588 0 010 .582c-.032.499.119 1.05.53 1.456l.815.806c.08.08.073.159.059.19a6.494 6.494 0 01-.573.99c-.02.029-.086.074-.195.045l-1.103-.303c-.559-.153-1.112-.008-1.529.27-.16.107-.327.204-.5.29-.449.222-.851.628-.998 1.189l-.289 1.105c-.029.11-.101.143-.137.146a6.613 6.613 0 01-1.142 0c-.036-.003-.108-.037-.137-.146l-.289-1.105c-.147-.56-.55-.967-.997-1.189a4.502 4.502 0 01-.501-.29c-.417-.278-.97-.423-1.53-.27l-1.102.303c-.11.03-.175-.016-.195-.046a6.492 6.492 0 01-.573-.989c-.014-.031-.022-.11.059-.19l.815-.806c.411-.406.562-.957.53-1.456a4.587 4.587 0 010-.582c.032-.499-.119-1.05-.53-1.456l-.815-.806c-.08-.08-.073-.159-.059-.19a6.44 6.44 0 01.573-.99c.02-.029.086-.075.195-.045l1.103.303c.559.153 1.112.008 1.529-.27.16-.107.327-.204.5-.29.449-.222.851-.628.998-1.189l.289-1.105c.029-.11.101-.143.137-.146zM8 0c-.236 0-.47.01-.701.03-.743.065-1.29.615-1.458 1.261l-.29 1.106c-.017.066-.078.158-.211.224a5.994 5.994 0 00-.668.386c-.123.082-.233.09-.3.071L3.27 2.776c-.644-.177-1.392.02-1.82.63a7.977 7.977 0 00-.704 1.217c-.315.675-.111 1.422.363 1.891l.815.806c.05.048.098.147.088.294a6.084 6.084 0 000 .772c.01.147-.038.246-.088.294l-.815.806c-.474.469-.678 1.216-.363 1.891.2.428.436.835.704 1.218.428.609 1.176.806 1.82.63l1.103-.303c.066-.019.176-.011.299.071.213.143.436.272.668.386.133.066.194.158.212.224l.289 1.106c.169.646.715 1.196 1.458 1.26a8.094 8.094 0 001.402 0c.743-.064 1.29-.614 1.458-1.26l.29-1.106c.017-.066.078-.158.211-.224a5.98 5.98 0 00.668-.386c.123-.082.233-.09.3-.071l1.102.302c.644.177 1.392-.02 1.82-.63.268-.382.505-.789.704-1.217.315-.675.111-1.422-.364-1.891l-.814-.806c-.05-.048-.098-.147-.088-.294a6.1 6.1 0 000-.772c-.01-.147.039-.246.088-.294l.814-.806c.475-.469.679-1.216.364-1.891a7.992 7.992 0 00-.704-1.218c-.428-.609-1.176-.806-1.82-.63l-1.103.303c-.066.019-.176.011-.299-.071a5.991 5.991 0 00-.668-.386c-.133-.066-.194-.158-.212-.224L10.16 1.29C9.99.645 9.444.095 8.701.031A8.094 8.094 0 008 0zm1.5 8a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM11 8a3 3 0 11-6 0 3 3 0 016 0z"})),globe:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M1.543 7.25h2.733c.144-2.074.866-3.756 1.58-4.948.12-.197.237-.381.353-.552a6.506 6.506 0 00-4.666 5.5zm2.733 1.5H1.543a6.506 6.506 0 004.666 5.5 11.13 11.13 0 01-.352-.552c-.715-1.192-1.437-2.874-1.581-4.948zm1.504 0h4.44a9.637 9.637 0 01-1.363 4.177c-.306.51-.612.919-.857 1.215a9.978 9.978 0 01-.857-1.215A9.637 9.637 0 015.78 8.75zm4.44-1.5H5.78a9.637 9.637 0 011.363-4.177c.306-.51.612-.919.857-1.215.245.296.55.705.857 1.215A9.638 9.638 0 0110.22 7.25zm1.504 1.5c-.144 2.074-.866 3.756-1.58 4.948-.12.197-.237.381-.353.552a6.506 6.506 0 004.666-5.5h-2.733zm2.733-1.5h-2.733c-.144-2.074-.866-3.756-1.58-4.948a11.738 11.738 0 00-.353-.552 6.506 6.506 0 014.666 5.5zM8 0a8 8 0 100 16A8 8 0 008 0z"})),history:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M1.643 3.143L.427 1.927A.25.25 0 000 2.104V5.75c0 .138.112.25.25.25h3.646a.25.25 0 00.177-.427L2.715 4.215a6.5 6.5 0 11-1.18 4.458.75.75 0 10-1.493.154 8.001 8.001 0 101.6-5.684zM7.75 4a.75.75 0 01.75.75v2.992l2.028.812a.75.75 0 01-.557 1.392l-2.5-1A.75.75 0 017 8.25v-3.5A.75.75 0 017.75 4z"})),info:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM0 8a8 8 0 1116 0A8 8 0 010 8zm6.5-.25A.75.75 0 017.25 7h1a.75.75 0 01.75.75v2.75h.25a.75.75 0 010 1.5h-2a.75.75 0 010-1.5h.25v-2h-.25a.75.75 0 01-.75-.75zM8 6a1 1 0 100-2 1 1 0 000 2z"})),issue_opened:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM0 8a8 8 0 1116 0A8 8 0 010 8zm9 3a1 1 0 11-2 0 1 1 0 012 0zm-.25-6.25a.75.75 0 00-1.5 0v3.5a.75.75 0 001.5 0v-3.5z"})),kebab_horizontal:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{d:"M8 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM1.5 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3zm13 0a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"})),link:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"})),mark_github:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})),moon:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M9.598 1.591a.75.75 0 01.785-.175 7 7 0 11-8.967 8.967.75.75 0 01.961-.96 5.5 5.5 0 007.046-7.046.75.75 0 01.175-.786zm1.616 1.945a7 7 0 01-7.678 7.678 5.5 5.5 0 107.678-7.678z"})),play:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0zM8 0a8 8 0 100 16A8 8 0 008 0zM6.379 5.227A.25.25 0 006 5.442v5.117a.25.25 0 00.379.214l4.264-2.559a.25.25 0 000-.428L6.379 5.227z"})),plus:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M8 2a.75.75 0 01.75.75v4.5h4.5a.75.75 0 010 1.5h-4.5v4.5a.75.75 0 01-1.5 0v-4.5h-4.5a.75.75 0 010-1.5h4.5v-4.5A.75.75 0 018 2z"})),plus_circle:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0zM8 0a8 8 0 100 16A8 8 0 008 0zm.75 4.75a.75.75 0 00-1.5 0v2.5h-2.5a.75.75 0 000 1.5h2.5v2.5a.75.75 0 001.5 0v-2.5h2.5a.75.75 0 000-1.5h-2.5v-2.5z"})),search:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M11.5 7a4.499 4.499 0 11-8.998 0A4.499 4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z"})),sort_asc:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M0 4.25a.75.75 0 01.75-.75h2.5a.75.75 0 010 1.5H.75A.75.75 0 010 4.25zm0 4a.75.75 0 01.75-.75h4.5a.75.75 0 010 1.5H.75A.75.75 0 010 8.25zm0 4a.75.75 0 01.75-.75h7.5a.75.75 0 010 1.5H.75a.75.75 0 01-.75-.75zm12.927-9.677a.25.25 0 00-.354 0l-3 3A.25.25 0 009.75 6H12v6.75a.75.75 0 001.5 0V6h2.25a.25.25 0 00.177-.427l-3-3z"})),sort_desc:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M0 4.25a.75.75 0 01.75-.75h7.5a.75.75 0 010 1.5H.75A.75.75 0 010 4.25zm0 4a.75.75 0 01.75-.75h4.5a.75.75 0 010 1.5H.75A.75.75 0 010 8.25zm0 4a.75.75 0 01.75-.75h2.5a.75.75 0 010 1.5H.75a.75.75 0 01-.75-.75z"}),d("path",{d:"M13.5 10h2.25a.25.25 0 01.177.427l-3 3a.25.25 0 01-.354 0l-3-3A.25.25 0 019.75 10H12V3.75a.75.75 0 011.5 0V10z"})),stack:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M7.122.392a1.75 1.75 0 011.756 0l5.003 2.902c.83.481.83 1.68 0 2.162L8.878 8.358a1.75 1.75 0 01-1.756 0L2.119 5.456a1.25 1.25 0 010-2.162L7.122.392zM8.125 1.69a.25.25 0 00-.25 0l-4.63 2.685 4.63 2.685a.25.25 0 00.25 0l4.63-2.685-4.63-2.685zM1.601 7.789a.75.75 0 011.025-.273l5.249 3.044a.25.25 0 00.25 0l5.249-3.044a.75.75 0 01.752 1.298l-5.248 3.044a1.75 1.75 0 01-1.756 0L1.874 8.814A.75.75 0 011.6 7.789zm0 3.5a.75.75 0 011.025-.273l5.249 3.044a.25.25 0 00.25 0l5.249-3.044a.75.75 0 01.752 1.298l-5.248 3.044a1.75 1.75 0 01-1.756 0l-5.248-3.044a.75.75 0 01-.273-1.025z"})),sun:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M8 10.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zM8 12a4 4 0 100-8 4 4 0 000 8zM8 0a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0V.75A.75.75 0 018 0zm0 13a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5A.75.75 0 018 13zM2.343 2.343a.75.75 0 011.061 0l1.06 1.061a.75.75 0 01-1.06 1.06l-1.06-1.06a.75.75 0 010-1.06zm9.193 9.193a.75.75 0 011.06 0l1.061 1.06a.75.75 0 01-1.06 1.061l-1.061-1.06a.75.75 0 010-1.061zM16 8a.75.75 0 01-.75.75h-1.5a.75.75 0 010-1.5h1.5A.75.75 0 0116 8zM3 8a.75.75 0 01-.75.75H.75a.75.75 0 010-1.5h1.5A.75.75 0 013 8zm10.657-5.657a.75.75 0 010 1.061l-1.061 1.06a.75.75 0 11-1.06-1.06l1.06-1.06a.75.75 0 011.06 0zm-9.193 9.193a.75.75 0 010 1.06l-1.06 1.061a.75.75 0 11-1.061-1.06l1.06-1.061a.75.75 0 011.061 0z"})),sync:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M8 2.5a5.487 5.487 0 00-4.131 1.869l1.204 1.204A.25.25 0 014.896 6H1.25A.25.25 0 011 5.75V2.104a.25.25 0 01.427-.177l1.38 1.38A7.001 7.001 0 0114.95 7.16a.75.75 0 11-1.49.178A5.501 5.501 0 008 2.5zM1.705 8.005a.75.75 0 01.834.656 5.501 5.501 0 009.592 2.97l-1.204-1.204a.25.25 0 01.177-.427h3.646a.25.25 0 01.25.25v3.646a.25.25 0 01-.427.177l-1.38-1.38A7.001 7.001 0 011.05 8.84a.75.75 0 01.656-.834z"})),tag:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M2.5 7.775V2.75a.25.25 0 01.25-.25h5.025a.25.25 0 01.177.073l6.25 6.25a.25.25 0 010 .354l-5.025 5.025a.25.25 0 01-.354 0l-6.25-6.25a.25.25 0 01-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 010 2.474l-5.026 5.026a1.75 1.75 0 01-2.474 0l-6.25-6.25A1.75 1.75 0 011 7.775zM6 5a1 1 0 100 2 1 1 0 000-2z"})),terminal:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M0 2.75C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0114.25 15H1.75A1.75 1.75 0 010 13.25V2.75zm1.75-.25a.25.25 0 00-.25.25v10.5c0 .138.112.25.25.25h12.5a.25.25 0 00.25-.25V2.75a.25.25 0 00-.25-.25H1.75zM7.25 8a.75.75 0 01-.22.53l-2.25 2.25a.75.75 0 11-1.06-1.06L5.44 8 3.72 6.28a.75.75 0 111.06-1.06l2.25 2.25c.141.14.22.331.22.53zm1.5 1.5a.75.75 0 000 1.5h3a.75.75 0 000-1.5h-3z"})),three_bars:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M1 2.75A.75.75 0 011.75 2h12.5a.75.75 0 110 1.5H1.75A.75.75 0 011 2.75zm0 5A.75.75 0 011.75 7h12.5a.75.75 0 110 1.5H1.75A.75.75 0 011 7.75zM1.75 12a.75.75 0 100 1.5h12.5a.75.75 0 100-1.5H1.75z"})),trashcan:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M6.5 1.75a.25.25 0 01.25-.25h2.5a.25.25 0 01.25.25V3h-3V1.75zm4.5 0V3h2.25a.75.75 0 010 1.5H2.75a.75.75 0 010-1.5H5V1.75C5 .784 5.784 0 6.75 0h2.5C10.216 0 11 .784 11 1.75zM4.496 6.675a.75.75 0 10-1.492.15l.66 6.6A1.75 1.75 0 005.405 15h5.19c.9 0 1.652-.681 1.741-1.576l.66-6.6a.75.75 0 00-1.492-.149l-.66 6.6a.25.25 0 01-.249.225h-5.19a.25.25 0 01-.249-.225l-.66-6.6z"})),unfold:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{d:"M8.177.677l2.896 2.896a.25.25 0 01-.177.427H8.75v1.25a.75.75 0 01-1.5 0V4H5.104a.25.25 0 01-.177-.427L7.823.677a.25.25 0 01.354 0zM7.25 10.75a.75.75 0 011.5 0V12h2.146a.25.25 0 01.177.427l-2.896 2.896a.25.25 0 01-.354 0l-2.896-2.896A.25.25 0 015.104 12H7.25v-1.25zm-5-2a.75.75 0 000-1.5h-.5a.75.75 0 000 1.5h.5zM6 8a.75.75 0 01-.75.75h-.5a.75.75 0 010-1.5h.5A.75.75 0 016 8zm2.25.75a.75.75 0 000-1.5h-.5a.75.75 0 000 1.5h.5zM12 8a.75.75 0 01-.75.75h-.5a.75.75 0 010-1.5h.5A.75.75 0 0112 8zm2.25.75a.75.75 0 000-1.5h-.5a.75.75 0 000 1.5h.5z"})),upload:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M8.53 1.22a.75.75 0 00-1.06 0L3.72 4.97a.75.75 0 001.06 1.06l2.47-2.47v6.69a.75.75 0 001.5 0V3.56l2.47 2.47a.75.75 0 101.06-1.06L8.53 1.22zM3.75 13a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5z"})),x:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"})),x_circle:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M3.404 12.596a6.5 6.5 0 119.192-9.192 6.5 6.5 0 01-9.192 9.192zM2.344 2.343a8 8 0 1011.313 11.314A8 8 0 002.343 2.343zM6.03 4.97a.75.75 0 00-1.06 1.06L6.94 8 4.97 9.97a.75.75 0 101.06 1.06L8 9.06l1.97 1.97a.75.75 0 101.06-1.06L9.06 8l1.97-1.97a.75.75 0 10-1.06-1.06L8 6.94 6.03 4.97z"}))};function re({error:e,onDismiss:t}){return d("div",{class:"error"},t&&d("div",{class:"error-dismiss",onClick:t},ae.x),d("h3",null,e),d("p",null,"If you think this is a bug, you can report it ",d("a",{href:"https://github.com/misode/misode.github.io/issues/new",target:"_blank"},"on GitHub")))}function ie(e,t,n){const o=e=>{const o=e.onChange&&(t=>{var o;const a=t.target.value;null==(o=e.onChange)||o.call(e,n(a))}),a=e.onEnter&&(t=>{var o;if("Enter"===t.key){const a=t.target.value;null==(o=e.onEnter)||o.call(e,n(a))}});return d("input",s(s({},e),{type:t,onChange:o,onKeyDown:a}))};return o.displayName=e,o}const se=ie("TextInput","text",(e=>e)),le=ie("NumberInput","number",(e=>Number(e))),ce=ie("RangeInput","range",(e=>Number(e)));let de;const ue={},me=function(e,t){if(!t)return e();if(void 0===de){const e=document.createElement("link").relList;de=e&&e.supports&&e.supports("modulepreload")?"modulepreload":"preload"}return Promise.all(t.map((e=>{if(e in ue)return;ue[e]=!0;const t=e.endsWith(".css"),n=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${n}`))return;const o=document.createElement("link");return o.rel=t?"stylesheet":de,t||(o.as="script",o.crossOrigin=""),o.href=e,document.head.appendChild(o),t?new Promise(((e,t)=>{o.addEventListener("load",e),o.addEventListener("error",t)})):void 0}))).then((()=>e()))};var he=JSON.parse('{"add":"Add","add_bottom":"Add to bottom","add_top":"Add to top","advancement":"Advancement","assets":"Assets","block_definition":"Blockstate","changelog.search":"Search changes","collapse":"Collapse","collapse_all":"Hold %0% to collapse all","configure_layers":"Configure layers","copy":"Copy","copied":"Copied!","copy_context":"Copy context","dimension_type":"Dimension Type","dimension":"Dimension","disabled":"Disabled","download":"Download","duplicate":"Duplicate","enabled":"Enabled","entries_hidden":"%0% entries hidden","entries_hidden.more":"Show %0% more","entries_hidden.all":"Show all","expand":"Expand","expand_all":"Hold %0% to expand all","feature.decorated.decorators":"Decorators","feature.decorated.decorators.entry":"Decorator","format.json":"JSON","format.yaml":"YAML","fields":"Fields","generate_new_seed":"Generate new seed","github":"GitHub","hide_output":"Hide output","hide_preview":"Hide preview","home":"Home","import":"Import","indentation.2_spaces":"2 spaces","indentation.4_spaces":"4 spaces","indentation.minified":"Minified","indentation.tabs":"Tabs","item_modifier":"Item Modifier","language":"Language","layer.biomes":"Biomes","layer.temperature":"Temperature","layer.humidity":"Humidity","layer.continentalness":"Continentalness","layer.erosion":"Erosion","layer.weirdness":"Weirdness","layer.offset":"Offset","layer.factor":"Factor","layer.jaggedness":"Jaggedness","loot_table":"Loot Table","model":"Model","more":"More","move_down":"Move down","move_up":"Move up","not_found.description":"The page you were looking for does not exist.","no_presets":"No presets","output_settings":"Output settings","predicate":"Predicate","recipe":"Recipe","redo":"Redo","reset":"Reset","settings":"Settings","settings.fields.description":"Customize advanced field settings","settings.fields.path":"Context","settings.fields.name":"Name","share":"Share","theme":"Theme","theme.dark":"Dark","theme.light":"Light","theme.system":"System","title.changelog":"Technical Changelog","title.generator":"%0% Generator","title.generator_category":"%0% Generators","title.home":"Data Pack Generators","title.sounds":"Sound Explorer","presets":"Presets","preview":"Visualize","preview.scale":"Scale","preview.depth":"Depth","preview.factor":"Factor","preview.offset":"Offset","preview.peaks":"Peaks","preview.width":"Width","remove":"Remove","search":"Search","show_output":"Show output","show_preview":"Show preview","sounds.play":"Play","sounds.play_sound":"Play sound","sounds.play_all":"Play all","sounds.search":"Search sounds","sounds.download_function":"Download Mcfunction","sounds.delay":"Delay","sounds.pitch":"Pitch","sounds.volume":"Volume","sounds.copy_command":"Copy command","sounds.add_sound":"Add sound","sounds.remove_sound":"Remove sound","sounds.unknown_sound":"Unknown sound","sounds.loading_sound":"Loading sound","source_placeholder":"Paste raw content here","switch_generator":"Switch generator","terrain_settings":"Terrain settings","undo":"Undo","world":"World Settings","worldgen":"Worldgen","worldgen/biome":"Biome","worldgen/configured_carver":"Carver","worldgen/configured_feature":"Feature","worldgen/noise":"Noise","worldgen/noise_settings":"Noise Settings","worldgen/processor_list":"Processor List","worldgen/configured_structure_feature":"Structure Feature","worldgen/configured_surface_builder":"Surface Builder","worldgen/template_pool":"Template Pool","zoom_in":"Zoom in","zoom_out":"Zoom out"}'),pe=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:he});const fe={fallback:he};function ge(e,t,...n){var o,a,r,i,s;return function(e,t){return e.replace(/%\d+%/g,(e=>{const n=parseInt(e.slice(1,-1));return void 0!==(null==t?void 0:t[n])?t[n]:e}))}(null!=(s=null!=(i=null!=(r=null==(o=fe[e])?void 0:o[t])?r:null==(a=fe.en)?void 0:a[t])?i:fe.fallback[t])?s:t,n)}async function ve(e){const t=q.languages.find((t=>t.code===e));if(!t)return;const n=await function(e){switch(e){case"../locales/de.json":return me((()=>import("./de.1d005dc8.js")),void 0);case"../locales/en.json":return me((()=>Promise.resolve().then((function(){return pe}))),void 0);case"../locales/es.json":return me((()=>import("./es.d3abba45.js")),void 0);case"../locales/fr.json":return me((()=>import("./fr.f5531eea.js")),void 0);case"../locales/it.json":return me((()=>import("./it.fd9a8268.js")),void 0);case"../locales/ja.json":return me((()=>import("./ja.2d7ab812.js")),void 0);case"../locales/pl.json":return me((()=>import("./pl.3a9fb38c.js")),void 0);case"../locales/pt.json":return me((()=>import("./pt.689bba1d.js")),void 0);case"../locales/ru.json":return me((()=>import("./ru.3104e71e.js")),void 0);case"../locales/sk.json":return me((()=>import("./sk.69c71daa.js")),void 0);case"../locales/zh-cn.json":return me((()=>import("./zh-cn.b233fc7e.js")),void 0);case"../locales/zh-tw.json":return me((()=>import("./zh-tw.298bd51e.js")),void 0);default:return Promise.reject(new Error("Unknown variable dynamic import: "+e))}}(`../locales/${e}.json`),o=!1!==t.schemas&&await function(e){switch(e){case"../../node_modules/@mcschema/locales/src/de.json":return me((()=>import("./de.f9c3209c.js")),void 0);case"../../node_modules/@mcschema/locales/src/en.json":return me((()=>import("./en.1d6bc972.js")),void 0);case"../../node_modules/@mcschema/locales/src/es.json":return me((()=>import("./es.c83d9c73.js")),void 0);case"../../node_modules/@mcschema/locales/src/fr.json":return me((()=>import("./fr.e316b1e2.js")),void 0);case"../../node_modules/@mcschema/locales/src/it.json":return me((()=>import("./it.7ff123cd.js")),void 0);case"../../node_modules/@mcschema/locales/src/ja.json":return me((()=>import("./ja.4ae430b9.js")),void 0);case"../../node_modules/@mcschema/locales/src/pl.json":return me((()=>import("./pl.ae1f6791.js")),void 0);case"../../node_modules/@mcschema/locales/src/pt.json":return me((()=>import("./pt.31e14993.js")),void 0);case"../../node_modules/@mcschema/locales/src/ru.json":return me((()=>import("./ru.92df5b59.js")),void 0);case"../../node_modules/@mcschema/locales/src/zh-cn.json":return me((()=>import("./zh-cn.4129665a.js")),void 0);case"../../node_modules/@mcschema/locales/src/zh-tw.json":return me((()=>import("./zh-tw.1b64f94d.js")),void 0);default:return Promise.reject(new Error("Unknown variable dynamic import: "+e))}}(`../../node_modules/@mcschema/locales/src/${e}.json`);fe[e]=s(s({},n.default),o.default)}function _e(e){return"object"==typeof e&&null!==e}const we=e=>("0"+e.toString(16)).substr(-2);function ye(e=12){var t=new Uint8Array(e/2);return window.crypto.getRandomValues(t),Array.from(t,we).join("")}function be(){return BigInt(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))}function xe(e){const t=Math.floor(4294967296*Math.random())-2147483648,n=e.get(new p.Path(["dimensions"]));e.set(new p.Path(["seed"]),t,!0),"object"==typeof n&&null!==n&&Object.keys(n).forEach((n=>{e.set(new p.Path(["dimensions",n,"generator","seed"]),t,!0),e.set(new p.Path(["dimensions",n,"generator","biome_source","seed"]),t,!0)})),e.set(new p.Path(["generator","seed"]),t,!0),e.set(new p.Path(["generator","biome_source","seed"]),t)}function ke(e){let t=0;for(let n=0;n<e.length;n++)t=Math.imul(31,t)+e.charCodeAt(n)|0;return t}function Ce(e){return`/${e}/`.replaceAll("//","/")}function Ae(e){const t=e.replace(/^\//,"").replace(/\/$/,"").replace(/\?.*/,"");return q.generators.find((e=>e.url===t))}function Me(e){const t=Math.abs(ke(e));return[t%256,(t>>8)%256,(t>>16)%256]}function ze(e){return e*e}function je(e,t,n){return Math.max(e,Math.min(t,n))}function Ve(e,t,n){return n<0?e:n>1?t:$e(n,e,t)}function $e(e,t,n){return t+e*(n-t)}function Ee(e){return e instanceof Error?e.message:`${e}`}const Ie=h();function Oe(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;let n,o;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(o=0;o<n;o++)if(!Oe(e[o],t[o]))return!1;return!0}if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const a=Object.keys(e);if(n=a.length,n!==Object.keys(t).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(t,a[o]))return!1;for(o=n;0!=o--;){const n=a[o];if(!Oe(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}class Le{constructor(){this.forward=new Map,this.backward=new Map}set(e,t){this.forward.set(e,t),this.backward.set(t,e)}getA(e){return this.backward.get(e)}getB(e){return this.forward.get(e)}getOrPut(e,t){const n=this.forward.get(e);return void 0===n?(this.set(e,t),t):n}}const Pe="https://raw.githubusercontent.com/misode/technical-changes/main";let Se=null;async function De(){if(!Se){const e=await(await fetch(`${Pe}/index.json`)).json();Se=(await Promise.all(e.map(((e,t)=>async function(e,t){const n=await(await fetch(`${Pe}/${e.id}/index.json`)).json();return(await Promise.all(n.map(((n,o)=>async function(e,t,n,o){return function(e){return e.split("\n\n").map((e=>{const t=e.indexOf("|");return{tags:e.substring(0,t).trim().split(" "),content:e.slice(t+1).trim().replaceAll("->","→").replaceAll("\n...\n","\n\n")}}))}(await(await fetch(`${Pe}/${e.id}/${t.id}.md`)).text()).map((a=>s({version:t,group:e,order:1e3*n+o},a)))}(e,Te(n),t,o))))).flat()}(Te(e),t))))).flat()}return Se}function Te(e){return"string"==typeof e?{id:e,article:e.match(/\d\dw\d\d[a-z]/)?"minecraft-snapshot-"+e:e.match(/\d+\.\d+(\.\d+)?-pre[0-9]+/)?"minecraft-"+e.replaceAll(".","-").replaceAll("pre","pre-release-"):null}:_e(e)?e:{id:"unknown",article:null}}const Ne=["1.15","1.16","1.17","1.18"],Be={},He={},Re={1.15:f,1.16:g,1.17:v,1.18:_};let Fe,We;async function Je(e){return Be[e]||(Be[e]=(async()=>{try{const t=Re[e].getCollections(),n={};await async function(e,t,n){const o=q.versions.find((t=>t.id===e));if(!o)return void console.error(`[fetchData] Unknown version ${o} in ${JSON.stringify(q.versions)}`);console.debug(`[fetchData] ${JSON.stringify(o)}`),o.dynamic&&await Promise.all(qe.filter((e=>localStorage.getItem(`cached_${e.id}`)!==e.hash)).map((async e=>{console.debug(`[deleteMatching] ${e.id} '${localStorage.getItem(`cached_${e.id}`)}' < '${e.hash}' ${e.url}/${o.refs[e.id]}`),await async function(e){try{const t=await caches.open("misode-v1");console.debug("[deleteMatching] Opened cache misode-v1");const n=[];for(const o of await t.keys())e(o.url)&&n.push(t.delete(o));console.debug(`[deleteMatching] Removing ${n.length} cache objects...`),await Promise.all(n)}catch(t){console.warn(`[deleteMatching] Failed to open cache misode-v1: ${Ee(t)}`)}}((t=>t.startsWith(`${e.url}/${o.refs[e.id]}`))),console.debug(`[deleteMatching] Done! ${e.id} ${e.hash} '${localStorage.getItem(`cached_${e.id}`)}'`),localStorage.setItem(`cached_${e.id}`,e.hash),console.debug(`[deleteMatching] Set! ${e.id} ${e.hash} '${localStorage.getItem(`cached_${e.id}`)}'`)})));await Promise.all([Ke(o,t),Xe(o,n),Qe(o,t),et(o,t)])}(e,t,n);const o=Re[e].getSchemas(t);return Be[e]={collections:t,schemas:o,blockStates:n},Be[e]}catch(t){throw new Error(`Cannot get version "${e}": ${Ee(t)}`)}})()),Be[e]}function Ge(e,t,n){const o=q.versions.findIndex((t=>t.id===e)),a=t?q.versions.findIndex((e=>e.id===t)):0,r=n?q.versions.findIndex((e=>e.id===n)):q.versions.length-1;return a<=o&&o<=r}["1.15","1.16","1.17"].forEach((e=>localStorage.removeItem(`cache_${e}`)));const Ue="https://raw.githubusercontent.com/Arcensoth/mcdata",Ye="https://raw.githubusercontent.com/InventivetalentDev/minecraft-assets",Ze="https://raw.githubusercontent.com/SPGoding/vanilla-datapack",qe=[{id:"mcdata_master",hash:"5f32e0f8300e443d5462a0592cf392b0036f4f59",url:Ue},{id:"vanilla_datapack_summary",hash:"33019b47ae943f905d12933de26eb4b3c027f852",url:Ze}];async function Ke(e,t){console.debug(`[fetchRegistries] ${e.id}`);const n=q.registries.filter((e=>!e.dynamic&&!e.asset)).filter((t=>Ge(e.id,t.minVersion,t.maxVersion)));if(Ge(e.id,void 0,"1.15")){const a=`${Ue}/${e.refs.mcdata_master}/generated/reports/registries.json`;try{const e=await ot(a,(e=>{const t={};return Object.keys(e).forEach((n=>{t[n.slice(10)]=Object.keys(e[n].entries)})),t}));n.forEach((n=>{var o;t.register(n.id,null!=(o=e[n.id])?o:[])}))}catch(o){console.warn("Error occurred while fetching registries:",Ee(o))}}else await Promise.all(n.map((async n=>{try{const o=n.path?`${Ue}/${e.refs.mcdata_master}/${n.path}/data.min.json`:`${Ue}/${e.refs.mcdata_master}/processed/reports/registries/${n.id}/data.min.json`;t.register(n.id,await ot(o,(e=>e.values)))}catch(o){console.warn(`Error occurred while fetching registry ${n.id}:`,Ee(o))}})))}async function Xe(e,t){if(console.debug(`[fetchBlockStateMap] ${e.id}`),Ge(e.id,void 0,"1.16")){const o=Ge(e.id,void 0,"1.15")?`${Ue}/${e.refs.mcdata_master}/generated/reports/blocks.json`:`${Ue}/${e.refs.mcdata_master}/processed/reports/blocks/data.min.json`;try{const e=await ot(o,(e=>{const t={};return Object.keys(e).forEach((n=>{t[n]={properties:e[n].properties,default:e[n].states.find((e=>e.default)).properties}})),t}));Object.assign(t,e)}catch(n){console.warn("Error occurred while fetching block state map:",Ee(n))}}else{const o=`${Ue}/${e.refs.mcdata_master}/processed/reports/blocks/simplified/data.min.json`;try{const e=await ot(o);Object.assign(t,e)}catch(n){console.warn("Error occurred while fetching block state map:",Ee(n))}}}async function Qe(e,t){console.debug(`[fetchDynamicRegistries] ${e.id}`);const n=q.registries.filter((e=>e.dynamic&&!e.asset)).filter((t=>Ge(e.id,t.minVersion,t.maxVersion)));if(Ge(e.id,"1.16")){const a=`${Ze}/${e.refs.vanilla_datapack_summary}/summary/flattened.min.json`;try{const e=await ot(a);n.forEach((n=>{t.register(n.id,e[n.id])}))}catch(o){console.warn("Error occurred while fetching dynamic registries:",Ee(o))}}Ge(e.id,"1.18")&&t.register("worldgen/noise",at)}async function et(e,t){console.debug(`[fetchAssetsRegistries] ${e.id}`);const n=q.registries.filter((e=>e.asset)).filter((t=>Ge(e.id,t.minVersion,t.maxVersion)));await Promise.all(n.map((async n=>{var o;try{const a=async t=>{const n=`${Ye}/${e.refs.mcassets}/assets/minecraft/${t}/_list.json`,o=await ot(n);if(0===o.directories.length)return o.files;const r=await Promise.all(o.directories.map((async e=>(await a(`${t}/${e}`)).map((t=>`${e}/${t}`)))));return[...o.files,...r.flat()]},r=(await a(null!=(o=n.path)?o:n.id)).filter((e=>e.endsWith(".json")||e.endsWith(".png"))).map((e=>`minecraft:${e.replace(/\.(json|png)$/,"")}`));t.register(n.id,r)}catch(a){console.warn(`Error occurred while fetching assets registry ${n.id}:`,Ee(a))}})))}async function tt(e,t,n){console.debug(`[fetchPreset] ${t} ${n}`);const o=q.versions.find((t=>t.id===e));try{const a=["blockstates","models"].includes(t)?`${Ye}/${o.refs.mcassets}/assets/minecraft/${t}/${n}.json`:`${Ze}/${o.refs.vanilla_datapack_data}/data/minecraft/${t}/${n}.json`,r=await fetch(a);if("worldgen/noise_settings"===t&&"1.18"===e){let e=await r.text();e=e.replaceAll('"max_threshold": Infinity','"max_threshold": 100');const t=JSON.parse(e);return"overworld"!==n&&"large_biomes"!==n&&(t.noise.terrain_shaper={offset:0,factor:0,jaggedness:0}),t}return await r.json()}catch(a){console.warn(`Error occurred while fetching ${t} preset ${n}:`,Ee(a))}}function nt(e){return`https://misode-cors-anywhere.herokuapp.com/https://resources.download.minecraft.net/${e.slice(0,2)}/${e}`}async function ot(e,t=(e=>e)){try{const n=await caches.open("misode-v1");console.debug(`[getData] Opened cache misode-v1 ${e}`);const o=await n.match(e);if(o&&o.ok)return console.debug(`[getData] Retrieving cached data ${e}`),await o.json();console.debug(`[getData] fetching data ${e}`);const a=await fetch(e),r=t(await a.json());return await n.put(e,new Response(JSON.stringify(r))),r}catch(n){console.warn(`[getData] Failed to open cache misode-v1: ${Ee(n)}`),console.debug(`[getData] fetching data ${e}`);const o=await fetch(e);return t(await o.json())}}const at=["minecraft:aquifer_barrier","minecraft:aquifer_fluid_level_floodedness","minecraft:aquifer_fluid_level_spread","minecraft:aquifer_lava","minecraft:calcite","minecraft:cave_cheese","minecraft:cave_entrance","minecraft:cave_layer","minecraft:clay_bands_offset","minecraft:continentalness","minecraft:erosion","minecraft:gravel","minecraft:gravel_layer","minecraft:ice","minecraft:iceberg_and_badlands_pillar","minecraft:iceberg_and_badlands_pillar_roof","minecraft:jagged","minecraft:nether_state_selector","minecraft:nether_wart","minecraft:netherrack","minecraft:noodle","minecraft:noodle_ridge_a","minecraft:noodle_ridge_b","minecraft:noodle_thickness","minecraft:offset","minecraft:ore_gap","minecraft:ore_vein_a","minecraft:ore_vein_b","minecraft:ore_veininess","minecraft:packed_ice","minecraft:patch","minecraft:pillar","minecraft:pillar_rareness","minecraft:pillar_thickness","minecraft:powder_snow_surface","minecraft:powder_snow_under","minecraft:ridge","minecraft:soul_sand_layer","minecraft:spaghetti_2d","minecraft:spaghetti_2d_elevation","minecraft:spaghetti_2d_modulator","minecraft:spaghetti_2d_thickness","minecraft:spaghetti_3d_1","minecraft:spaghetti_3d_2","minecraft:spaghetti_3d_rarity","minecraft:spaghetti_3d_thickness","minecraft:spaghetti_roughness","minecraft:spaghetti_roughness_modulator","minecraft:surface","minecraft:surface_swamp","minecraft:temperature","minecraft:vegetation"];let rt=null;const it={},st={};async function lt(){return rt||(rt=async function(){try{const e=await fetch("https://launchermeta.mojang.com/mc/game/version_manifest.json");return await e.json()}catch(e){throw new Error(`Error occurred while fetching version manifest: ${Ee(e)}`)}}()),rt}async function ct(e){return it[e]||(it[e]=(async()=>{const t=await lt();return await async function(e,t){var n;const o=q.versions.find((t=>t.id===e)),a=null!=(n=null==o?void 0:o.latest)?n:t.latest.snapshot;try{const e=await ot(t.versions.find((e=>e.id===a)).url);return(await ot(e.assetIndex.url)).objects}catch(r){throw new Error(`Error occurred while fetching assets for ${o}: ${Ee(r)}`)}}(e,t)})()),it[e]}async function dt(e){return st[e]||(st[e]=(async()=>{const t=await ct(e);return await async function(e,t){try{const e=t["minecraft/sounds.json"].hash;return await ot(nt(e))}catch(n){throw new Error(`Error occurred while fetching sounds for ${e}: ${Ee(n)}`)}}(e,t)})()),st[e]}let ut=!1;const mt={temperature:[-1,1],humidity:[-1,1],continentalness:[-1.1,1],erosion:[-1,1],weirdness:[-1,1],offset:[-1,1],factor:[0,12],jaggedness:[0,1]};let ht,pt;async function ft(e,t){const n=[e,t.octaves,t.shaper.toJson(),`${t.seed}`,t.version];return Oe(n,ht)||(ht=Ie(n),pt=await async function(e,t){var n,o,a,r,i;switch(null==(n=null==e?void 0:e.type)?void 0:n.replace(/^minecraft:/,"")){case"fixed":return new M(e.biome);case"checkerboard":const n=(null!=(o=e.scale)?o:2)+2,l=null!=(r=null==(a=e.biomes)?void 0:a.length)?r:0;return{getBiome(t,o,a){var r;const i=(((t>>n)+(a>>n))%l+l)%l;return null==(r=e.biomes)?void 0:r[i].node}};case"multi_noise":switch(null==(i=e.preset)?void 0:i.replace(/^minecraft:/,"")){case"nether":e="1.18"===t.version?wt:_t;break;case"overworld":e="1.18"===t.version?await async function(){return(await tt("1.18","dimension","overworld")).generator.biome_source}():e}if(e=p.DataModel.unwrapLists(e),"1.18"===t.version){await async function(){ut||(await z(j),ut=!0,console.debug(`Loaded deepslate-rs from "${j}"`))}();const n=new Le,o=e=>"number"==typeof e?[e,e]:e,[a,r,i,l,c,d,u,m,h,p,f,g,v,_]=[[],[],[],[],[],[],[],[],[],[],[],[],[],[]];for(const t of e.biomes){const{temperature:e,humidity:s,continentalness:w,erosion:y,weirdness:b,depth:x,offset:k}=t.parameters;a.push(o(e)[0]),r.push(o(e)[1]),i.push(o(s)[0]),l.push(o(s)[1]),c.push(o(w)[0]),d.push(o(w)[1]),u.push(o(y)[0]),m.push(o(y)[1]),h.push(o(b)[0]),p.push(o(b)[1]),f.push(o(x)[0]),g.push(o(x)[1]),v.push(k),_.push(n.getOrPut(t.biome,Math.floor(2147483647*Math.random())))}const C=w(new Float64Array(a),new Float64Array(r),new Float64Array(i),new Float64Array(l),new Float64Array(c),new Float64Array(d),new Float64Array(u),new Float64Array(m),new Float64Array(h),new Float64Array(p),new Float64Array(f),new Float64Array(g),new Float64Array(v),new Int32Array(_)),A=y(t.seed,t.octaves.temperature.firstOctave,new Float64Array(t.octaves.temperature.amplitudes),t.octaves.humidity.firstOctave,new Float64Array(t.octaves.humidity.amplitudes),t.octaves.continentalness.firstOctave,new Float64Array(t.octaves.continentalness.amplitudes),t.octaves.erosion.firstOctave,new Float64Array(t.octaves.erosion.amplitudes),t.octaves.weirdness.firstOctave,new Float64Array(t.octaves.weirdness.amplitudes),t.octaves.shift.firstOctave,new Float64Array(t.octaves.shift.amplitudes));return{getBiome(e,t,o){var a;const r=b(C,A,e,e+1,1,t,t+1,1,o,o+1,1);return null!=(a=n.getA(r[0]))?a:"unknown"},getBiomes:(e,t,o,a,r,i,s,l,c)=>[...b(C,A,e,t,o,a,r,i,s,l,c)].map((e=>{var t;return null!=(t=n.getA(e))?t:"unknown"})),getClimate(e,n,o,a,r,i,l,c,d,u){const m=x(A,n,o,a,r,i,l,c,d,u),h=[];for(let p=0;p<m.length;p+=7){const[n,o,a,r,i]=m.slice(p,p+5),l=k.point(a,r,i);h.push(s(s(s({temperature:n,humidity:o,continentalness:a,erosion:r,weirdness:i},e.has("offset")&&{offset:t.shaper.offset(l)}),e.has("factor")&&{factor:t.shaper.factor(l)}),e.has("jaggedness")&&{jaggedness:t.shaper.jaggedness(l)}))}return h}}}{const n=["altitude","temperature","humidity","weirdness"].map(((n,o)=>{var a;const r=e[`${n}_noise`];return r.firstOctave=je(null!=(a=r.firstOctave)?a:-7,-100,-1),new C(new A(t.seed+BigInt(o)),r)}));return Array.isArray(e.biomes)&&0!==e.biomes.length?{getBiome(t,o,a){const r=n.map((e=>e.sample(t,a,0)));let i=1/0,s="";for(const{biome:n,parameters:l}of e.biomes){const e=ze(l.altitude-r[0])+ze(l.temperature-r[1])+ze(l.humidity-r[2])+ze(l.weirdness-r[3])+ze(l.offset);e<i&&(i=e,s=n)}return s}}:new M("unknown")}}throw new Error("Unknown biome source")}(e,t)),{biomeSource:pt}}function gt(e,t){var n;if(!e)return[128,128,128];const o=null!=(n=t[e])?n:vt[e];return void 0===o?Me(e):o}const vt={"minecraft:badlands":[217,69,21],"minecraft:badlands_plateau":[202,140,101],"minecraft:bamboo_jungle":[118,142,20],"minecraft:bamboo_jungle_hills":[59,71,10],"minecraft:basalt_deltas":[64,54,54],"minecraft:beach":[250,222,85],"minecraft:birch_forest":[48,116,68],"minecraft:birch_forest_hills":[31,95,50],"minecraft:cold_ocean":[32,32,112],"minecraft:crimson_forest":[221,8,8],"minecraft:dark_forest":[64,81,26],"minecraft:dark_forest_hills":[104,121,66],"minecraft:deep_cold_ocean":[32,32,56],"minecraft:deep_frozen_ocean":[64,64,144],"minecraft:deep_lukewarm_ocean":[0,0,64],"minecraft:deep_ocean":[0,0,48],"minecraft:deep_warm_ocean":[0,0,80],"minecraft:desert":[250,148,24],"minecraft:desert_hills":[210,95,18],"minecraft:desert_lakes":[255,188,64],"minecraft:end_barrens":[128,128,255],"minecraft:end_highlands":[128,128,255],"minecraft:end_midlands":[128,128,255],"minecraft:eroded_badlands":[255,109,61],"minecraft:flower_forest":[45,142,73],"minecraft:forest":[5,102,33],"minecraft:frozen_ocean":[112,112,214],"minecraft:frozen_river":[160,160,255],"minecraft:giant_spruce_taiga":[129,142,121],"minecraft:old_growth_spruce_taiga":[129,142,121],"minecraft:giant_spruce_taiga_hills":[109,119,102],"minecraft:giant_tree_taiga":[89,102,81],"minecraft:old_growth_pine_taiga":[89,102,81],"minecraft:giant_tree_taiga_hills":[69,79,62],"minecraft:gravelly_hills":[136,136,136],"minecraft:gravelly_mountains":[136,136,136],"minecraft:windswept_gravelly_hills":[136,136,136],"minecraft:ice_spikes":[180,220,220],"minecraft:jungle":[83,123,9],"minecraft:jungle_edge":[98,139,23],"minecraft:sparse_jungle":[98,139,23],"minecraft:jungle_hills":[44,66,5],"minecraft:lukewarm_ocean":[0,0,144],"minecraft:modified_badlands_plateau":[242,180,141],"minecraft:modified_gravelly_mountains":[120,152,120],"minecraft:modified_jungle":[123,163,49],"minecraft:modified_jungle_edge":[138,179,63],"minecraft:modified_wooded_badlands_plateau":[216,191,141],"minecraft:mountain_edge":[114,120,154],"minecraft:extreme_hills":[96,96,96],"minecraft:mountains":[96,96,96],"minecraft:windswept_hills":[96,96,96],"minecraft:mushroom_field_shore":[160,0,255],"minecraft:mushroom_fields":[255,0,255],"minecraft:nether_wastes":[191,59,59],"minecraft:ocean":[0,0,112],"minecraft:plains":[141,179,96],"minecraft:river":[0,0,255],"minecraft:savanna":[189,178,95],"minecraft:savanna_plateau":[167,157,100],"minecraft:shattered_savanna":[229,218,135],"minecraft:windswept_savanna":[229,218,135],"minecraft:shattered_savanna_plateau":[207,197,140],"minecraft:small_end_islands":[128,128,255],"minecraft:snowy_beach":[250,240,192],"minecraft:snowy_mountains":[160,160,160],"minecraft:snowy_taiga":[49,85,74],"minecraft:snowy_taiga_hills":[36,63,54],"minecraft:snowy_taiga_mountains":[89,125,114],"minecraft:snowy_tundra":[255,255,255],"minecraft:snowy_plains":[255,255,255],"minecraft:soul_sand_valley":[94,56,48],"minecraft:stone_shore":[162,162,132],"minecraft:stony_shore":[162,162,132],"minecraft:sunflower_plains":[181,219,136],"minecraft:swamp":[7,249,178],"minecraft:swamp_hills":[47,255,218],"minecraft:taiga":[11,102,89],"minecraft:taiga_hills":[22,57,51],"minecraft:taiga_mountains":[51,142,129],"minecraft:tall_birch_forest":[88,156,108],"minecraft:old_growth_birch_forest":[88,156,108],"minecraft:tall_birch_hills":[71,135,90],"minecraft:the_end":[128,128,255],"minecraft:the_void":[0,0,0],"minecraft:warm_ocean":[0,0,172],"minecraft:warped_forest":[73,144,123],"minecraft:wooded_badlands_plateau":[176,151,101],"minecraft:wooded_badlands":[176,151,101],"minecraft:wooded_hills":[34,85,28],"minecraft:wooded_mountains":[80,112,80],"minecraft:windswept_forest":[80,112,80],"minecraft:snowy_slopes":[140,195,222],"minecraft:lofty_peaks":[196,168,193],"minecraft:jagged_peaks":[196,168,193],"minecraft:snowcapped_peaks":[200,198,200],"minecraft:frozen_peaks":[200,198,200],"minecraft:stony_peaks":[82,92,103],"minecraft:grove":[150,150,189],"minecraft:meadow":[169,197,80],"minecraft:lush_caves":[112,255,79],"minecraft:dripstone_caves":[140,124,0]},_t={type:"minecraft:multi_noise",seed:0,altitude_noise:{firstOctave:-7,amplitudes:[1,1]},temperature_noise:{firstOctave:-7,amplitudes:[1,1]},humidity_noise:{firstOctave:-7,amplitudes:[1,1]},weirdness_noise:{firstOctave:-7,amplitudes:[1,1]},biomes:[{biome:"minecraft:nether_wastes",parameters:{altitude:0,temperature:0,humidity:0,weirdness:0,offset:0}},{biome:"minecraft:soul_sand_valley",parameters:{altitude:0,temperature:0,humidity:-.5,weirdness:0,offset:0}},{biome:"minecraft:crimson_forest",parameters:{altitude:0,temperature:.4,humidity:0,weirdness:0,offset:0}},{biome:"minecraft:warped_forest",parameters:{altitude:0,temperature:0,humidity:.5,weirdness:0,offset:.375}},{biome:"minecraft:basalt_deltas",parameters:{altitude:0,temperature:-.5,humidity:0,weirdness:0,offset:.175}}]},wt={type:"minecraft:multi_noise",biomes:[{biome:"minecraft:nether_wastes",parameters:{temperature:0,humidity:0,continentalness:0,erosion:0,depth:0,weirdness:0,offset:0}},{biome:"minecraft:soul_sand_valley",parameters:{temperature:0,humidity:-.5,continentalness:0,erosion:0,depth:0,weirdness:0,offset:0}},{biome:"minecraft:crimson_forest",parameters:{temperature:.4,humidity:0,continentalness:0,erosion:0,depth:0,weirdness:0,offset:0}},{biome:"minecraft:warped_forest",parameters:{temperature:0,humidity:.5,continentalness:0,erosion:0,depth:0,weirdness:0,offset:.375}},{biome:"minecraft:basalt_deltas",parameters:{temperature:-.5,humidity:0,continentalness:0,erosion:0,depth:0,weirdness:0,offset:.175}}]};const yt=[50,50,51,51,52,52,53,54,56,57,57,58,58,59,60,60,60,59,59,59,60,61,61,62,63,63,64,64,64,65,65,66,66,65,65,66,66,67,67,67,68,69,71,73,74,76,79,80,81,81,82,83,83,82,82,81,81,80,80,80,81,81,82,82],bt=[[255,77,54],[59,118,255],[91,207,25],[217,32,245],[255,209,41],[52,204,209]];function xt(e,t,n){const o=new A(n.seed),a={placements:[],features:[],random:o,biomeInfoNoise:new V(o.fork(),0,[1]),seaLevel:63,version:n.version,nextFloat:()=>o.nextFloat(),nextInt:e=>o.nextInt(e),sampleInt(e){return At(e,this)}};for(let i=0;i<n.size[0]/16;i+=1)for(let t=0;t<n.size[2]/16;t+=1)zt([16*i,0,16*t],p.DataModel.unwrapLists(e),a);const r=t.data;t.data.fill(255);for(const[i,s]of a.placements){if(i[0]<0||i[1]<0||i[2]<0||i[0]>=n.size[0]||i[1]>=n.size[1]||i[2]>=n.size[2])continue;const e=i[2]*(4*t.width)+4*i[0],o=s<bt.length?bt[s]:Me(a.features[s]);r[e]=je(50,205,o[0]),r[e+1]=je(50,205,o[1]),r[e+2]=je(50,205,o[2]),r[e+3]=255}for(let i=0;i<n.size[0];i+=1)for(let e=0;e<n.size[2];e+=1){if((Math.floor(i/16)+Math.floor(e/16))%2==0)continue;const n=e*(4*t.width)+4*i;for(let e=0;e<3;e+=1)r[n+e]=.85*r[n+e]}}function kt(e){return e.startsWith("minecraft:")?e.slice(10):e}function Ct(e,t){return[[e[0],t,e[2]]]}function At(e,t){var n,o;if("number"==typeof e)return e;if(e.base)return null!=(o=e.base)?o:1+t.nextInt(1+(null!=(n=e.spread)?n:0));switch(kt(e.type)){case"constant":return e.value;case"uniform":return e.value.min_inclusive+t.nextInt(e.value.max_inclusive-e.value.min_inclusive+1);case"biased_to_bottom":return e.value.min_inclusive+t.nextInt(t.nextInt(e.value.max_inclusive-e.value.min_inclusive+1)+1);case"clamped":return Math.max(e.value.min_inclusive,Math.min(e.value.max_inclusive,At(e.value.source,t)))}return 1}function Mt(e,t){const n=t.features.indexOf(e);return-1!=n?n:(t.features.push(e),t.features.length-1)}function zt(e,t,n){var o;if("string"==typeof t)return void n.placements.push([e,Mt(t,n)]);const a=kt(null!=(o=null==t?void 0:t.type)?o:"no_op"),r=Vt[a];r?r(t.config,e,n):n.placements.push([e,Mt(JSON.stringify(t),n)])}function jt(e,t,n){var o;const a=kt(null!=(o=null==t?void 0:t.type)?o:"nope"),r=$t[a];return r?r(null==t?void 0:t.config,e,n):[e]}const Vt={decorated:(e,t,n)=>{jt(t,null==e?void 0:e.decorator,n).forEach((t=>zt(t,null==e?void 0:e.feature,n)))},random_boolean_selector:(e,t,n)=>{zt(t,n.nextFloat()<.5?null==e?void 0:e.feature_true:null==e?void 0:e.feature_false,n)},random_selector:(e,t,n)=>{var o,a;for(const r of null!=(o=null==e?void 0:e.features)?o:[])if(n.nextFloat()<(null!=(a=null==r?void 0:r.chance)?a:0))return void zt(t,r.feature,n);zt(t,null==e?void 0:e.default,n)},simple_random_selector:(e,t,n)=>{var o,a,r;zt(t,null==(r=null==e?void 0:e.features)?void 0:r[n.nextInt(null!=(a=null==(o=null==e?void 0:e.features)?void 0:o.length)?a:0)],n)}},$t={chance:(e,t,n)=>{var o;return n.nextFloat()<1/(null!=(o=null==e?void 0:e.chance)?o:1)?[t]:[]},count:(e,t,n)=>{var o;return new Array(n.sampleInt(null!=(o=null==e?void 0:e.count)?o:1)).fill(t)},count_extra:(e,t,n)=>{var o,a;let r=null!=(o=null==e?void 0:e.count)?o:1;return n.nextFloat()<e.extra_chance&&(r+=null!=(a=e.extra_count)?a:0),new Array(r).fill(t)},count_multilayer:(e,t,n)=>{var o;return new Array(n.sampleInt(null!=(o=null==e?void 0:e.count)?o:1)).fill(t).map((e=>[e[0]+n.nextInt(16),e[1],e[2]+n.nextInt(16)]))},count_noise:(e,t,n)=>{const o=n.biomeInfoNoise.sample(t[0]/200,0,t[2]/200)<e.noise_level?e.below_noise:e.above_noise;return new Array(o).fill(t)},count_noise_biased:(e,t,n)=>{var o;const a=Math.max(1,e.noise_factor),r=n.biomeInfoNoise.sample(t[0]/a,0,t[2]/a),i=Math.max(0,Math.ceil((r+(null!=(o=e.noise_offset)?o:0))*e.noise_to_count_ratio));return new Array(i).fill(t)},dark_oak_tree:(e,t,n)=>[...new Array(16)].map(((e,o)=>{const a=4*Math.floor(o/4)+1+n.nextInt(3)+t[0];return[a,Math.max(n.seaLevel,yt[je(0,63,a)]),4*Math.floor(o%4)+1+n.nextInt(3)+t[2]]})),decorated:(e,t,n)=>jt(t,null==e?void 0:e.outer,n).flatMap((t=>jt(t,null==e?void 0:e.inner,n))),depth_average:(e,t,n)=>{var o,a,r,i;return Ct(t,n.nextInt(null!=(o=null==e?void 0:e.spread)?o:0)+n.nextInt(null!=(a=null==e?void 0:e.spread)?a:0)-(null!=(r=e.spread)?r:0)+(null!=(i=null==e?void 0:e.baseline)?i:0))},emerald_ore:(e,t,n)=>{const o=3+n.nextInt(6);return[...new Array(o)].map((()=>[t[0]+n.nextInt(16),4+n.nextInt(28),t[2]+n.nextInt(16)]))},fire:(e,t,n)=>{const o=1+n.nextInt(n.nextInt(n.sampleInt(null==e?void 0:e.count)));return[...new Array(o)].map((()=>[t[0]+n.nextInt(16),n.nextInt(128),t[2]+n.nextInt(16)]))},glowstone:(e,t,n)=>{const o=n.nextInt(1+n.nextInt(n.sampleInt(null==e?void 0:e.count)));return[...new Array(o)].map((()=>[t[0]+n.nextInt(16),n.nextInt(128),t[2]+n.nextInt(16)]))},heightmap:(e,t,n)=>Ct(t,Math.max(n.seaLevel,yt[je(0,63,t[0])])),heightmap_spread_double:(e,t,n)=>{const o=Math.max(n.seaLevel,yt[je(0,63,t[0])]);return Ct(t,n.nextInt(2*o))},heightmap_world_surface:(e,t,n)=>Ct(t,Math.max(n.seaLevel,yt[je(0,63,t[0])])),iceberg:(e,t,n)=>[[t[0]+4+n.nextInt(8),t[1],t[2]+4+n.nextInt(8)]],lava_lake:(e,t,n)=>{var o,a;if(0===n.nextInt((null!=(o=e.chance)?o:1)/10)){const o=n.nextInt(n.nextInt(248)+8);if(o<n.seaLevel||0==n.nextInt((null!=(a=null==e?void 0:e.chance)?a:1)/8)){return[[n.nextInt(16)+t[0],o,n.nextInt(16)+t[2]]]}}return[]},nope:(e,t)=>[t],range:(e,t,n)=>{var o,a,r;return Ct(t,n.nextInt((null!=(o=null==e?void 0:e.maximum)?o:1)-(null!=(a=null==e?void 0:e.top_offset)?a:0))+(null!=(r=null==e?void 0:e.bottom_offset)?r:0))},range_biased:(e,t,n)=>{var o,a,r;return Ct(t,n.nextInt(n.nextInt((null!=(o=null==e?void 0:e.maximum)?o:1)-(null!=(a=null==e?void 0:e.top_offset)?a:0))+(null!=(r=null==e?void 0:e.bottom_offset)?r:0)))},range_very_biased:(e,t,n)=>{var o,a,r,i;return Ct(t,n.nextInt(n.nextInt(n.nextInt((null!=(o=null==e?void 0:e.maximum)?o:1)-(null!=(a=null==e?void 0:e.top_offset)?a:0))+(null!=(r=null==e?void 0:e.bottom_offset)?r:0))+(null!=(i=null==e?void 0:e.bottom_offset)?i:0)))},spread_32_above:(e,t,n)=>Ct(t,n.nextInt(t[1]+32)),top_solid_heightmap:(e,t)=>Ct(t,yt[je(0,63,t[0])]),magma:(e,t,n)=>Ct(t,n.nextInt(t[1]+32)),square:(e,t,n)=>[[t[0]+n.nextInt(16),t[1],t[2]+n.nextInt(16)]],surface_relative_threshold:(e,t)=>{var n,o;const a=yt[je(0,63,t[0])],r=a+(null!=(n=null==e?void 0:e.min_inclusive)?n:-1/0),i=a+(null!=(o=null==e?void 0:e.max_inclusive)?o:1/0);return t[1]<r||t[1]>i?[t]:[]},water_lake:(e,t,n)=>{var o;return 0===n.nextInt(null!=(o=e.chance)?o:1)?[[t[0]+n.nextInt(16),n.nextInt(256),t[2]+n.nextInt(16)]]:[]}};class Et{constructor(e){this.settings={},this.chunkWidth=4,this.chunkHeight=4,this.chunkCountY=32,this.biomeDepth=.1,this.biomeScale=.2,this.noiseColumnCache=[],this.xOffset=0;const t=new A(e);this.minLimitPerlinNoise=new V(t,-15,[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]),this.maxLimitPerlinNoise=new V(t,-15,[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]),this.mainPerlinNoise=new V(t,-7,[1,1,1,1,1,1,1,1]),this.depthNoise=new V(t,-15,[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1])}reset(e,t,n,o,a){this.settings=e,this.chunkWidth=4*e.size_horizontal,this.chunkHeight=4*e.size_vertical,this.chunkCountY=Math.floor(e.height/this.chunkHeight),e.amplified&&t>0&&(t=1+2*t,n=1+4*n),this.biomeDepth=.265625*(.5*t-.125),this.biomeScale=96/(.9*n+.1),this.noiseColumnCache=Array(a).fill(null),this.xOffset=o}iterateNoiseColumn(e){const t=Array(this.chunkCountY*this.chunkHeight),n=Math.floor(e/this.chunkWidth),o=Math.floor(e%this.chunkWidth)/this.chunkWidth,a=this.fillNoiseColumn(n),r=this.fillNoiseColumn(n+1);for(let m=this.chunkCountY-1;m>=0;m-=1)for(let e=this.chunkHeight;e>=0;e-=1){const n=e/this.chunkHeight;t[m*this.chunkHeight+e]=(i=n,s=o,l=a[m],c=a[m+1],d=r[m],u=r[m+1],$e(s,$e(i,l,c),$e(i,d,u)))}var i,s,l,c,d,u;return t}fillNoiseColumn(e){const t=this.noiseColumnCache[e-this.xOffset];if(t)return t;const n=Array(this.chunkCountY+1),o=684.412*this.settings.sampling.xz_scale,a=684.412*this.settings.sampling.y_scale,r=o/this.settings.sampling.xz_factor,i=a/this.settings.sampling.y_factor,s=this.settings.random_density_offset?this.getRandomDensity(e):0;for(let l=0;l<=this.chunkCountY;l+=1){let t=this.sampleAndClampNoise(e,l,this.mainPerlinNoise.getOctaveNoise(0).zo,o,a,r,i);const c=((1-2*l/this.chunkCountY+s)*this.settings.density_factor+this.settings.density_offset+this.biomeDepth)*this.biomeScale;t+=c*(c>0?4:1),this.settings.top_slide.size>0&&(t=Ve(this.settings.top_slide.target,t,(this.chunkCountY-l-this.settings.top_slide.offset)/this.settings.top_slide.size)),this.settings.bottom_slide.size>0&&(t=Ve(this.settings.bottom_slide.target,t,(l-this.settings.bottom_slide.offset)/this.settings.bottom_slide.size)),n[l]=t}return this.noiseColumnCache[e-this.xOffset]=n,n}getRandomDensity(e){const t=this.depthNoise.sample(200*e,10,this.depthNoise.getOctaveNoise(0).zo,1,0,!0),n=24.575625*(t<0?.3*-t:t)-2;return n<0?.009486607142857142*n:.006640625*Math.min(n,1)}sampleAndClampNoise(e,t,n,o,a,r,i){let s=0,l=0,c=0,d=1;for(let u=0;u<16;u+=1){const m=V.wrap(e*o*d),h=V.wrap(t*a*d),p=V.wrap(n*o*d),f=a*d,g=this.minLimitPerlinNoise.getOctaveNoise(u);g&&(s+=g.sample(m,h,p,f,t*f)/d);const v=this.maxLimitPerlinNoise.getOctaveNoise(u);if(v&&(l+=v.sample(m,h,p,f,t*f)/d),u<8){const o=this.mainPerlinNoise.getOctaveNoise(u);o&&(c+=o.sample(V.wrap(e*r*d),V.wrap(t*i*d),V.wrap(n*r*d),i*d,t*i*d)/d)}d/=2}return Ve(s/512,l/512,(c/10+1)/2)}}const It={"minecraft:air":[150,160,170],"minecraft:water":[20,80,170],"minecraft:lava":[200,100,0],"minecraft:stone":[50,50,50],"minecraft:netherrack":[100,40,40],"minecraft:end_stone":[200,200,140]};let Ot,Lt,Pt=[];function St(e,t,n){var o,a,r;if(Ge(n.version,"1.18")){const{settings:a,generator:r}=function(e,t){const n=$.fromJson(p.DataModel.unwrapLists(e));n.octaves=Rt(n);const o=[e,`${t.seed}`];if(!Oe(o,Ot)){Ot=Ie(o),Pt=[];const e=new M("unknown");Lt=new E(t.seed,e,n)}return{settings:n,generator:Lt}}(e,n),i=new Tt(-n.offset,n.width,a.noise.minY,a.noise.height);i.fill(r);const s=t.data;for(let e=0;e<n.width;e+=1)for(let r=0;r<a.noise.height;r+=1){const l=4*e+4*(a.noise.height-r-1)*t.width,c=i.getBlockState([e-n.offset,r,0]),d=null!=(o=It[c.getName()])?o:[0,0,0];s[l]=d[0],s[l+1]=d[1],s[l+2]=d[2],s[l+3]=255}return}const i=new Et(n.seed);i.reset(e.noise,null!=(a=n.biomeDepth)?a:0,null!=(r=n.biomeScale)?r:0,n.offset,n.width);const s=t.data,l=4*t.width;for(let c=0;c<n.width;c+=1){const t=i.iterateNoiseColumn(c-n.offset).reverse();for(let n=0;n<e.noise.height;n+=1){const e=n*l+4*c,o=Dt(t,n);s[e]=o,s[e+1]=o,s[e+2]=o,s[e+3]=255}}}function Dt(e,t){return e[t]>0?0:e[t+1]>0?150:255}class Tt{constructor(e,t,n,o){this.minX=e,this.filled=[],this.chunks=[...Array(Math.ceil(t/16)+1)].map(((t,a)=>{const r=(e>>4)+a,i=Pt.find((e=>e.pos[0]===r));return i?(this.filled[a]=!0,i):new I(n,o,O.create(r,0))}))}fill(e){this.chunks.forEach(((t,n)=>{this.filled[n]||(e.fill(t),this.filled[n]=!0,Pt.push(t))}))}getBlockState(e){const t=(e[0]>>4)-(this.minX>>4);return this.chunks[t].getBlockState(e)}}const Nt=["biomes","temperature","humidity","continentalness","erosion","weirdness","offset","factor","jaggedness"],Bt=k.overworld(),Ht=({model:e,data:t,shown:n,lang:o,version:a})=>{var r;const[i,s]=m(2),[l,h]=m(void 0),[f,g]=m(new Set(["biomes"])),v=u([0,0]),_=u(1),w=u(void 0),y=BigInt(e.get(new p.Path(["generator","seed"]))),b=Rt(e.get(new p.Path(["generator","settings"]))),x=function(e){var t;if("string"==typeof e)switch(e.replace(/^minecraft:/,"")){case"overworld":case"amplified":return Bt;default:return k.fromJson({offset:0,factor:0,jaggedness:0})}return k.fromJson(p.DataModel.unwrapLists(null==(t=null==e?void 0:e.noise)?void 0:t.terrain_shaper))}(e.get(new p.Path(["generator","settings"]))),C=n?function(e,t,n){return JSON.stringify([e,t,n.toJson()])}(t,b,x):"",A=null==(r=t.type)?void 0:r.replace(/^minecraft:/,""),{canvas:M,redraw:z}=ee({size:()=>[200/_.current,200/_.current],async draw(e){const n={octaves:b,shaper:x,biomeColors:{},layers:f,offset:v.current,scale:i,seed:y,res:_.current,version:a};await async function(e,t,n){var o,a,r;const{biomeSource:i}=await ft(e,n),s=t.data,l=-Math.round(n.offset[0])-100+n.res/2,c=-Math.round(n.offset[1])-100+n.res/2,d=4*t.width/n.res,u=4/n.res,m=[l*n.scale,(200+l)*n.scale,n.res*n.scale],h=[c*n.scale,(200+c)*n.scale,n.res*n.scale],p=n.layers.has("biomes")?null==(o=i.getBiomes)?void 0:o.call(i,...m,64,65,1,...h):void 0,f=[...n.layers].filter((e=>"biomes"!==e)),g=0===f.length||null==(a=i.getClimate)?void 0:a.call(i,new Set(f),...m,64,65,1,...h);for(let v=0;v<200;v+=n.res)for(let e=0;e<200;e+=n.res){const t=e*d+v*u,o=v/n.res*200/n.res+e/n.res,a=(v+l)*n.scale,m=(e+c)*n.scale;let h=[50,50,50];if(n.layers.has("biomes"))h=gt(null!=(r=null==p?void 0:p[o])?r:i.getBiome(a,64,m),n.biomeColors);else if(g&&f[0]){const e=g[o][f[0]],[t,n]=mt[f[0]],a=(e-t)/(n-t)*256;h=[a,a,a]}s[t]=h[0],s[t+1]=h[1],s[t+2]=h[2],s[t+3]=255}}(t,e,n),4===_.current&&(clearTimeout(w.current),w.current=setTimeout((()=>{_.current=1,z()}),150))},async onDrag(e,t){v.current[0]=v.current[0]+200*e,v.current[1]=v.current[1]+200*t,clearTimeout(w.current),_.current="multi_noise"===A?4:1,z()},async onHover(e,n){const o={octaves:b,shaper:x,biomeColors:{},layers:f,offset:v.current,scale:i,seed:y,res:1,version:a},r=await async function(e,t,n,o){const{biomeSource:a}=await ft(e,o),[r,i]=function([e,t],n){return[(e-n.offset[0]-100+n.res/2)*n.scale,(t-n.offset[1]-100+n.res/2)*n.scale]}([t,n],o);return a.getBiome(r,64,i)}(t,Math.floor(200*e),Math.floor(200*n),o);h(r)},onLeave(){h(void 0)}},[C,i,y,f]);c((()=>{n&&(_.current="multi_noise"===A?4:1,z())}),[C,i,y,f,n]);const j=e=>{v.current[0]=v.current[0]*i/e,v.current[1]=v.current[1]*i/e,s(e)};return d(P,null,d("div",{class:"controls"},l&&d(X,{label:l,class:"no-pointer"}),"multi_noise"===A&&d(oe,{icon:"stack",tooltip:ge(o,"configure_layers")},Nt.map((e=>{const t=f.has(e);return d(X,{label:ge(o,`layer.${e}`),active:t,tooltip:ge(o,t?"enabled":"disabled"),onClick:t=>{g(new Set([e])),t.stopPropagation()}})}))),("multi_noise"===A||"checkerboard"===A)&&d(P,null,d(X,{icon:"dash",tooltip:ge(o,"zoom_out"),onClick:()=>j(1.5*i)}),d(X,{icon:"plus",tooltip:ge(o,"zoom_in"),onClick:()=>j(i/1.5)})),"multi_noise"===A&&d(X,{icon:"sync",tooltip:ge(o,"generate_new_seed"),onClick:()=>xe(e)})),d("canvas",{ref:M,width:"200",height:"200"}))};function Rt(e){if("string"!=typeof e){const t=$.fromJson(p.DataModel.unwrapLists(e));e=0===t.noise.densityFactor&&-.030078125===t.noise.densityOffset?"minecraft:nether":"minecraft:overworld"}switch(e.replace(/^minecraft:/,"")){case"overworld":case"amplified":return{temperature:{firstOctave:-9,amplitudes:[1.5,0,1,0,0,0]},humidity:{firstOctave:-7,amplitudes:[1,1,0,0,0,0]},continentalness:{firstOctave:-9,amplitudes:[1,1,2,2,2,1,1,1,1]},erosion:{firstOctave:-9,amplitudes:[1,1,0,1,1]},weirdness:{firstOctave:-7,amplitudes:[1,2,1,0,0,0]},shift:{firstOctave:-3,amplitudes:[1,1,1,0]}};case"end":case"floating_islands":return{temperature:{firstOctave:0,amplitudes:[0]},humidity:{firstOctave:0,amplitudes:[0]},continentalness:{firstOctave:0,amplitudes:[0]},erosion:{firstOctave:0,amplitudes:[0]},weirdness:{firstOctave:0,amplitudes:[0]},shift:{firstOctave:0,amplitudes:[0]}};default:return{temperature:{firstOctave:-7,amplitudes:[1,1]},humidity:{firstOctave:-7,amplitudes:[1,1]},continentalness:{firstOctave:-7,amplitudes:[1,1]},erosion:{firstOctave:-7,amplitudes:[1,1]},weirdness:{firstOctave:-7,amplitudes:[1,1]},shift:{firstOctave:0,amplitudes:[0]}}}}const Ft=({data:e,version:t,shown:n,lang:o})=>{const[a,r]=m(4),[i,s]=m(be()),{canvas:l,redraw:u}=ee({size:()=>[16*a,16*a],async draw(n){xt(e,n,{seed:i,version:t,size:[16*a,128,16*a]})}}),h=JSON.stringify(e);return c((()=>{n&&u()}),[h,a,i,n]),d(P,null,d("div",{class:"controls"},d(X,{icon:"dash",tooltip:ge(o,"zoom_out"),onClick:()=>r(Math.min(16,a+1))}),d(X,{icon:"plus",tooltip:ge(o,"zoom_in"),onClick:()=>r(Math.max(1,a-1))}),d(X,{icon:"sync",tooltip:ge(o,"generate_new_seed"),onClick:()=>s(be())})),d("canvas",{ref:l,width:"64",height:"64"}))},Wt=({lang:e,data:t,shown:n,version:o})=>{const[a,r]=m(be()),[i,s]=m(2),l=u([0,0]),h=JSON.stringify([t]),{canvas:f,redraw:g}=ee({size:()=>[256,256],async draw(e){const n={offset:l.current,scale:i,seed:a,version:o};!function(e,t,n){const o=new A(n.seed),a=L.fromJson(p.DataModel.unwrapLists(e)),r=new C(o,a),i=-n.offset[0]-100,s=-n.offset[1]-100,l=t.data;for(let c=0;c<256;c+=1)for(let e=0;e<256;e+=1){const t=4*c+4*e*256,o=(c+i)*n.scale,a=(e+s)*n.scale,d=128*(r.sample(o,a,0)+1);l[t]=d,l[t+1]=d,l[t+2]=d,l[t+3]=255}}(t,e,n)},async onDrag(e,t){l.current[0]=l.current[0]+256*e,l.current[1]=l.current[1]+256*t,g()}},[h,i,a]);c((()=>{n&&g()}),[h,i,a,n]);const v=e=>{l.current[0]=l.current[0]*i/e,l.current[1]=l.current[1]*i/e,s(e)};return d(P,null,d("div",{class:"controls"},d(X,{icon:"dash",tooltip:ge(e,"zoom_out"),onClick:()=>v(1.5*i)}),d(X,{icon:"plus",tooltip:ge(e,"zoom_in"),onClick:()=>v(i/1.5)}),d(X,{icon:"sync",tooltip:ge(e,"generate_new_seed"),onClick:()=>r(be())})),d("canvas",{ref:f,width:"256",height:"256"}))},Jt=({lang:e,data:t,shown:n,version:o})=>{var a,r;const i=ge.bind(null,e),[s,l]=m(be()),[h,p]=m(.2),[f,g]=m(.1),[v,_]=m(void 0),w=u(0),y=JSON.stringify([t,h,f]),b=null!=(r=null==(a=null==t?void 0:t.noise)?void 0:a.height)?r:256,{canvas:x,redraw:k}=ee({size:()=>[b,b],async draw(e){const n={biomeDepth:f,biomeScale:h,offset:w.current,width:e.width,seed:s,version:o};St(t,e,n)},async onDrag(e){w.current+=e*b,k()},async onHover(e,n){var o,a;const r=b-Math.max(1,Math.ceil(n*b))+(null!=(a=null==(o=null==t?void 0:t.noise)?void 0:o.min_y)?a:0);_(`${r}`)},onLeave(){_(void 0)}},[y,s]);return c((()=>{n&&k()}),[y,s,n]),d(P,null,d("div",{class:"controls"},v&&d(X,{label:`Y = ${v}`,class:"no-pointer"}),Ge(o,void 0,"1.17")&&d(oe,{icon:"gear",tooltip:ge(e,"terrain_settings")},d(Q,{label:i("preview.scale"),value:`${h}`,onChange:e=>p(Number(e))}),d(Q,{label:i("preview.depth"),value:`${f}`,onChange:e=>g(Number(e))})),d(X,{icon:"sync",tooltip:ge(e,"generate_new_seed"),onClick:()=>l(be())})),d("canvas",{ref:x,width:b,height:b}))},Gt=["dimension","worldgen/noise","worldgen/noise_settings","worldgen/configured_feature"];function Ut({lang:e,model:t,version:n,id:o,shown:a}){var r;const[,i]=m(0);if(ne(t,(()=>{i((e=>e+1))})),"dimension"===o&&(null==(r=null==t?void 0:t.get(new p.Path(["generator","type"])))?void 0:r.endsWith("noise"))){const o=t.get(new p.Path(["generator","biome_source"]));if(o)return d(Ht,s({},{lang:e,model:t,version:n,shown:a,data:o}))}if("worldgen/noise"===o&&t){const o=t.get(new p.Path([]));if(o)return d(Wt,s({},{lang:e,model:t,version:n,shown:a,data:o}))}if("worldgen/noise_settings"===o&&t){const o=t.get(new p.Path([]));if(o)return d(Jt,s({},{lang:e,model:t,version:n,shown:a,data:o}))}if("worldgen/configured_feature"===o&&t){const o=t.get(new p.Path([]));if(o)return d(Ft,s({},{lang:e,model:t,version:n,shown:a,data:o}))}return d(P,null)}const Yt={base:({},e,t)=>t,choice({switchNode:e},t,n,o){return e.hook(this,t,n,o)},list({children:e},t,n,o){if(!Array.isArray(n))return n;const a=n.map(((n,a)=>e.hook(this,t.push(a),n.node,o)));for(const r of Object.getOwnPropertySymbols(n))a[r]=n[r];return a},map({children:e,config:t},n,o,a){var r,i;if(void 0===o)return;const s="block_state_map"===(null==(r=t.validation)?void 0:r.validator)?null==(i=a.blockStates)?void 0:i[p.relativePath(n,t.validation.params.id).get()]:null,l={};Object.keys(o).forEach((t=>{var r;s&&!Object.keys(null!=(r=s.properties)?r:{}).includes(t)||(l[t]=e.hook(this,n.push(t),o[t],a))}));for(const c of Object.getOwnPropertySymbols(o))l[c]=o[c];return l},object({getActiveFields:e},t,n,o){if(null==n||"object"!=typeof n)return n;const a={},r=e(t);Object.keys(r).filter((e=>r[e].enabled(t))).forEach((e=>{const i=r[e].hook(this,t.push(e),n[e],o);null!=i&&(a[e]=i)}));for(const i of Object.getOwnPropertySymbols(n))a[i]=n[i];return a}};var Zt,qt;(qt=Zt||(Zt={})).ID_LANGUAGE="language",qt.ID_THEME="theme",qt.ID_VERSION="schema_version",qt.ID_INDENT="indentation",qt.ID_FORMAT="output_format",qt.ID_SOUNDS_VERSION="minecraft_sounds_version",qt.getLanguage=function(){var e;return null!=(e=localStorage.getItem(qt.ID_LANGUAGE))?e:"en"},qt.getTheme=function(){var e;return null!=(e=localStorage.getItem(qt.ID_THEME))?e:"dark"},qt.getVersion=function(){const e=localStorage.getItem(qt.ID_VERSION);return e&&Ne.includes(e)?e:"1.17"},qt.getIndent=function(){var e;return null!=(e=localStorage.getItem(qt.ID_INDENT))?e:"2_spaces"},qt.getFormat=function(){var e;return null!=(e=localStorage.getItem(qt.ID_FORMAT))?e:"json"},qt.getSoundsVersion=function(){var e;return null!=(e=localStorage.getItem(qt.ID_SOUNDS_VERSION))?e:"latest"},qt.setLanguage=function(e){e&&localStorage.setItem(qt.ID_LANGUAGE,e)},qt.setTheme=function(e){e&&localStorage.setItem(qt.ID_THEME,e)},qt.setVersion=function(e){e&&localStorage.setItem(qt.ID_VERSION,e)},qt.setIndent=function(e){e&&localStorage.setItem(qt.ID_INDENT,e)},qt.setFormat=function(e){e&&localStorage.setItem(qt.ID_FORMAT,e)},qt.setSoundsVersion=function(e){e&&localStorage.setItem(qt.ID_SOUNDS_VERSION,e)};const Kt={"2_spaces":2,"4_spaces":4,tabs:"\t",minified:void 0},Xt={json:{parse:D.parse,stringify:(e,t)=>D.stringify(e,null,t)},yaml:{parse:T.load,stringify:(e,t)=>T.dump(e,{flowLevel:void 0===t?0:-1,indent:"string"==typeof t?4:t})}};function Qt({lang:e,name:t,model:n,blockStates:o,doCopy:a,doDownload:r,doImport:i,copySuccess:s,onError:l}){const h=ge.bind(null,e),[f,g]=m(Zt.getIndent()),[v,_]=m(Zt.getFormat()),w=u(null),y=u(null),b=u(),x=S(((e,t)=>{const n=e.schema.hook(Yt,new p.ModelPath(e),e.data,{blockStates:t});return Xt[v].stringify(n,Kt[f])+"\n"}),[f,v]);c((()=>{b.current=()=>{if(n&&o)try{const e=x(n,o);e.length>=1e4?w.current.value=e.slice(0,1e4)+"\n\nOutput is too large to display (+10000 chars)\nExport to view complete output\n\n":w.current.value=e}catch(e){l(`Error getting JSON output: ${Ee(e)}`),console.error(e),w.current.value=""}}})),ne(n,(()=>{b.current()})),c((()=>{n&&b.current()}),[n]),c((()=>{b.current()}),[f,v]);c((()=>{a&&n&&o&&navigator.clipboard.writeText(x(n,o)).then((()=>{s()}))}),[a]),c((()=>{if(r&&n&&o&&y.current){const e=encodeURIComponent(x(n,o));y.current.setAttribute("href",`data:text/json;charset=utf-8,${e}`),y.current.setAttribute("download",`${t}.${v}`),y.current.click()}}),[r]),c((()=>{i&&w.current&&(w.current.value="",w.current.select())}),[i]);return d(P,null,d("div",{class:"controls"},d(oe,{icon:"gear",tooltip:h("output_settings")},Object.entries(Kt).map((([e])=>d(X,{label:h(`indentation.${e}`),active:f===e,onClick:()=>{return t=e,Zt.setIndent(t),void g(t);var t}}))),d("hr",null),Object.keys(Xt).map((e=>d(X,{label:h(`format.${e}`),active:v===e,onClick:()=>{return t=e,Zt.setFormat(t),void _(t);var t}}))))),d("textarea",{ref:w,class:"source",onBlur:()=>{if(0!==w.current.value.length)try{const e=Xt[v].parse(w.current.value);null==n||n.reset(p.DataModel.wrapLists(e),!1)}catch(e){l(`Error importing: ${Ee(e)}`),console.error(e)}},spellcheck:!1,autocorrect:"off",placeholder:h("source_placeholder")}),d("a",{ref:y,style:"display: none;"}))}class en extends p.DataModel{constructor(e,t,n,o){super(e),this.mapper=t,this.getter=n,this.setter=o}map(e){return this.mapper(e)}get(e){return this.getter(e)}set(e,t,n){return this.setter(e,t,n)}}const tn=["loot_table.type","loot_entry.type","function.function","condition.condition","criterion.trigger","recipe.type","dimension.generator.type","dimension.generator.biome_source.type","dimension.generator.biome_source.preset","carver.type","feature.type","decorator.type","feature.tree.minimum_size.type","block_state_provider.type","trunk_placer.type","foliage_placer.type","tree_decorator.type","int_provider.type","float_provider.type","height_provider.type","structure_feature.type","surface_builder.type","processor.processor_type","rule_test.predicate_type","pos_rule_test.predicate_type","template_element.element_type","block_placer.type","block_predicate.type","material_rule.type","material_condition.type"],nn=["number_provider.type","score_provider.type","nbt_provider.type","int_provider.type","float_provider.type","height_provider.type"],on=["feature.config","decorator.config","int_provider.value","float_provider.value","block_state_provider.simple_state_provider.state","block_state_provider.rotated_block_provider.state","block_state_provider.weighted_state_provider.entries.entry.data","rule_test.block_state","structure_feature.config","surface_builder.config","template_pool.elements.entry.element","decorator.block_survives_filter.state","material_rule.block.result_state"],an=["loot_entry.type","function.function","condition.condition","criterion.trigger","dimension.generator.type","dimension.generator.biome_source.type","feature.type","decorator.type","block_state_provider.type","feature.tree.minimum_size.type","trunk_placer.type","foliage_placer.type","tree_decorator.type","block_placer.type","rule_test.predicate_type","processor.processor_type","template_element.element_type","nbt_operation.op","number_provider.value","score_provider.name","score_provider.target","nbt_provider.source","nbt_provider.target","generator_biome.biome","block_predicate.type","material_rule.type","material_condition.type"],rn=["function.set_nbt.tag","advancement.display.icon.nbt","text_component_object.nbt","entity.nbt","block.nbt","item.nbt"],sn=["generator_biome.parameters.temperature","generator_biome.parameters.humidity","generator_biome.parameters.continentalness","generator_biome.parameters.erosion","generator_biome.parameters.depth","generator_biome.parameters.weirdness","feature.end_spike.crystal_beam_target","feature.end_gateway.exit","decorator.block_filter.offset","block_predicate.matching_blocks.offset","block_predicate.matching_fluids.offset","model_element.from","model_element.to","model_element.rotation.origin","model_element.faces.uv","item_transform.rotation","item_transform.translation","item_transform.scale"],ln=["noise_settings.surface_rule","noise_settings.noise.terrain_shaper"],cn=new p.DataModel(p.MapNode(p.StringNode(),p.StringNode()),{historyMax:0});function dn({model:e,lang:t,blockStates:n}){var o;const a=new p.ModelPath(e),[r,i,s]=e.schema.hook(un,a,Ie(e.data),t,n,{});return(null==(o=null==i?void 0:i.props)?void 0:o.children.some((e=>e)))?d("div",{class:`node ${e.schema.type(a)}-node`,"data-category":e.schema.category(a)},d("div",{class:"node-header"},r,i),d("div",{class:"node-body"},s)):s}const un={base:()=>[null,null,null],boolean:(e,t,n,o,a,r)=>[null,d(pn,s({},l(s({},e),{path:t,value:n,lang:o,states:a,ctx:r}))),null],choice({choices:e,config:t,switchNode:n},o,a,r,i,s){const l=n.activeCase(o,!0),c=(null==t?void 0:t.context)?new p.ModelPath(o.getModel(),new p.Path(o.getArray(),[t.context])):o,[u,m,h]=l.node.hook(this,c,a,r,i,s);if(1===e.length)return[u,m,h];const f=(null==t?void 0:t.choiceContext)?new p.Path([],[t.choiceContext]):(null==t?void 0:t.context)?new p.Path([],[t.context]):o,g=d("select",{value:l.type,onChange:n=>(n=>{var r,i,s;const c=null!=(r=e.find((e=>e.type===n)))?r:l,d=c.change?c.change(p.DataModel.unwrapLists(a)):"feature"===t.choiceContext?null==(s=null==(i=c.node.default())?void 0:i.config)?void 0:s.feature:c.node.default();o.model.set(o,p.DataModel.wrapLists(d))})(n.target.value)},e.map((e=>d("option",{value:e.type},yn(r,f.contextPush(e.type))))));return[u,d(P,null,g,m),h]},list({children:e,config:t},n,o,a,r,i){const{expand:c,collapse:u,isToggled:h}=hn(),[f,g]=m(50),v=n.getContext().join(".");if(sn.includes(v)){return[d(P,null,[...Array(t.maxLength)].map(((e,t)=>d(bn,{lang:a,path:n.modelPush(t)}))),d("div",{class:"fixed-list"})),d(P,null,[...Array(t.maxLength)].map(((t,s)=>{var l;return e.hook(this,n.modelPush(s),null==(l=null==o?void 0:o[s])?void 0:l.node,a,r,i)[1]}))),null]}return[null,d("button",{class:"add tooltipped tip-se","aria-label":ge(a,"add_top"),onClick:()=>{Array.isArray(o)||(o=[]);const t=p.DataModel.wrapLists(e.default());n.model.set(n,[{node:t,id:ye()},...o])}},ae.plus_circle),d(P,null,o&&Array.isArray(o)&&o.map((({node:t,id:m},p)=>{if(p===f)return d("div",{class:"node node-header"},d("label",null,ge(a,"entries_hidden",""+(o.length-f))),d("button",{onClick:()=>g(Math.min(f+50,o.length))},ge(a,"entries_hidden.more","50")),d("button",{onClick:()=>g(o.length)},ge(a,"entries_hidden.all")));if(p>f)return null;const v=n.push(p).contextPush("entry"),_="object"===e.type(v),w=h(m);if(_&&(!1===w||void 0===w&&o.length>20))return d("div",{class:"node node-header","data-category":e.category(v)},d(bn,{lang:a,path:v,nested:!0}),d("button",{class:"toggle tooltipped tip-se","aria-label":`${ge(a,"expand")}\n${ge(a,"expand_all","Ctrl")}`,onClick:c(m)},ae.chevron_right),d("label",null,yn(a,v,`${p}`)),d(mn,{key:m,path:v,value:t,schema:e}));return d(vn,l(s({key:m,path:v,schema:e,value:t},{lang:a,states:r,actions:[{icon:"duplicate",label:"duplicate",onSelect:()=>{const e=[...n.get()];e.splice(p,0,{id:ye(),node:Ie(t)}),n.model.set(n,e)}}]}),{ctx:l(s({},i),{index:(0===p?1:0)+(p===o.length-1?2:0)})}),_&&d("button",{class:"toggle tooltipped tip-se","aria-label":`${ge(a,"collapse")}\n${ge(a,"collapse_all","Ctrl")}`,onClick:u(m)},ae.chevron_down),d("button",{class:"remove tooltipped tip-se","aria-label":ge(a,"remove"),onClick:()=>v.set(void 0)},ae.trashcan),o.length>1&&d("div",{class:"node-move"},d("button",{class:"move tooltipped tip-se","aria-label":ge(a,"move_up"),onClick:()=>{const e=[...n.get()];[e[p-1],e[p]]=[e[p],e[p-1]],n.model.set(n,e)},disabled:0===p},ae.chevron_up),d("button",{class:"move tooltipped tip-se","aria-label":ge(a,"move_down"),onClick:()=>{const e=[...n.get()];[e[p+1],e[p]]=[e[p],e[p+1]],n.model.set(n,e)},disabled:p===o.length-1},ae.chevron_down)))})),o&&o.length>0&&o.length<=f&&d("div",{class:"node node-header"},d("button",{class:"add tooltipped tip-se","aria-label":ge(a,"add_bottom"),onClick:()=>{Array.isArray(o)||(o=[]);const t=p.DataModel.wrapLists(e.default());n.model.set(n,[...o,{node:t,id:ye()}])}},ae.plus_circle)))]},map({children:e,keys:t,config:n},o,a,r,i,c){var u,m,h,f,g;const{expand:v,collapse:_,isToggled:w}=hn(),y=new p.ModelPath(cn,new p.Path([wn(o.toString())])),b="block_state_map"===(null==(u=n.validation)?void 0:u.validator)?null==i?void 0:i[p.relativePath(o,n.validation.params.id).get()]:null,x=(null==b?void 0:b.properties)?p.StringNode(null,{enum:Object.keys(null!=(m=b.properties)?m:{})}):t;if(b&&"Properties"===o.last()){"object"!=typeof a&&(a={});const e=Object.entries(null!=(h=b.properties)?h:{}).map((([e,t])=>[e,p.StringNode(null,{enum:t})]));return Object.entries(null!=(f=b.properties)?f:{}).forEach((([e,t])=>{"string"!=typeof a[e]?o.model.errors.add(o.push(e),"error.expected_string"):t.includes(a[e])||o.model.errors.add(o.push(e),"error.invalid_enum_option",a[e])})),p.ObjectNode(Object.fromEntries(e)).hook(this,o,a,r,i,c)}return[null,d(P,null,x.hook(this,y,null!=(g=y.get())?g:"",r,i,c)[1],d("button",{class:"add tooltipped tip-se","aria-label":ge(r,"add"),onClick:()=>{const t=y.get();o.model.set(o.push(t),p.DataModel.wrapLists(e.default()))}},ae.plus_circle)),d(P,null,"object"==typeof a&&Object.entries(a).map((([t,n])=>{var u,m,h,f;const g=o.modelPush(t),y="object"===e.type(g),x=w(t);if(y&&(!1===x||void 0===x&&a.length>20))return d("div",{class:"node node-header","data-category":e.category(g)},d(bn,{lang:r,path:g,nested:!0}),d("button",{class:"toggle tooltipped tip-se","aria-label":`${ge(r,"expand")}\n${ge(r,"expand_all","Ctrl")}`,onClick:v(t)},ae.chevron_right),d("label",null,t),d(mn,{key:t,path:g,value:n,schema:e}));const k=b?p.StringNode(null,{enum:null!=(m=null==(u=b.properties)?void 0:u[t])?m:[]}):e;(null==(h=null==b?void 0:b.properties)?void 0:h[t])&&"string"==typeof n&&!(null==(f=b.properties)?void 0:f[t].includes(n))&&o.model.errors.add(g,"error.invalid_enum_option",n);return d(vn,l(s({key:t,schema:k,path:g,value:n},{lang:r,states:i,ctx:c}),{label:t}),y&&d("button",{class:"toggle tooltipped tip-se","aria-label":`${ge(r,"collapse")}\n${ge(r,"collapse_all","Ctrl")}`,onClick:_(t)},ae.chevron_down),d("button",{class:"remove tooltipped tip-se","aria-label":ge(r,"remove"),onClick:()=>g.set(void 0)},ae.trashcan))})))]},number:(e,t,n,o,a,r)=>[null,d(fn,s({},l(s({},e),{path:t,value:n,lang:o,states:a,ctx:r}))),null],object({node:e,config:t,getActiveFields:n,getChildModelPath:o},a,r,i,c,u){var m;const{expand:h,collapse:f,isToggled:g}=hn();if(0==a.getArray().length&&function(e,t){var n;return"feature"===e&&"decorated"===(null==(n=null==t?void 0:t.type)?void 0:n.replace(/^minecraft:/,""))&&_e(null==t?void 0:t.config)}(t.context,r)){const{wrapper:e,fields:t}=function(e,t,n){const o=[],a=Cn(n,o),r={type:e.type,config:p.ObjectNode({decorators:p.ListNode(Fe),feature:We},{context:"feature.decorated"})},i=p.ObjectNode(r,{context:"feature"}),s=new p.Path(["config","feature"]),l=new p.Path(["config","decorators"]),c=t.getModel(),d=new en(i,(e=>{if(e.startsWith(s))return new p.Path([...[...Array(o.length-1)].flatMap((()=>["config","feature"])),...e.modelArr]);if(e.startsWith(l)){if(2===e.modelArr.length)return new p.Path([]);const t=e.modelArr[2];if("number"==typeof t)return new p.Path([...[...Array(t)].flatMap((()=>["config","feature"])),"config","decorator",...e.modelArr.slice(3)])}return e}),(e=>{if(e.equals(l)){const e=[];return Cn(c.data,e),e}return c.get(d.map(e))}),((e,t,n)=>{if(e.startsWith(s)){const o=[];Cn(c.data,o);const a=new p.Path([...[...Array(o.length-1)].flatMap((()=>["config","feature"])),...e.modelArr]);return c.set(a,t,n)}if(e.startsWith(l)){const o=e.modelArr[2];if(2===e.modelArr.length){const e=d.get(s);return c.set(new p.Path,An(e,t),n)}if("number"==typeof o){if(3===e.modelArr.length&&void 0===t){const e=d.get(s),t=[];Cn(c.data,t),t.splice(o,1);const a=An(e,t);return c.set(new p.Path,a,n)}{const a=new p.Path([...[...Array(o)].flatMap((()=>["config","feature"])),"config","decorator",...e.modelArr.slice(3)]);return c.set(a,t,n)}}}c.set(e,t,n)}));return d.data={type:c.data.type,config:{decorators:o,feature:a}},d.errors=c.errors,{fields:r,wrapper:d}}(n(a),a,r);r=e.data,n=()=>t,o=(t,n)=>new p.ModelPath(e,new p.Path(t.getArray(),["feature"])).push(n)}let v=null,_=null;if(e.optional())if(void 0===r){const t=()=>a.set(p.DataModel.wrapLists(e.default()));_=d("button",{class:"collapse closed tooltipped tip-se","aria-label":ge(i,"expand"),onClick:t},ae.plus_circle)}else{const e=()=>a.set(void 0);_=d("button",{class:"collapse open tooltipped tip-se","aria-label":ge(i,"remove"),onClick:e},ae.trashcan)}const w=a.getContext().join(".");if(ln.includes(w)){const e=g("");if(v=d(P,null,d("button",{class:"toggle tooltipped tip-se","aria-label":ge(i,e?"collapse":"expand"),onClick:e?f(""):h("")},e?ae.chevron_down:ae.chevron_right)),!e)return[v,_,null]}const y="object"==typeof r&&null!==r&&(null==(m=e.default())?void 0:m.pools)?l(s({},u),{loot:null==r?void 0:r.type}):u,b=d(P,null,"object"==typeof r&&null!==r&&!(e.optional()&&void 0===r)&&Object.entries(n(a)).filter((([e,t])=>t.enabled(a))).map((([e,t])=>{var n,l,u;const m=o(a,e),h=m.getContext().join(".");if(nn.includes(h))return null;const[p,f,g]=t.hook(this,m,r[e],i,c,y);if(!(p||f||(null!=(u=null==(l=null==(n=null==g?void 0:g.props)?void 0:n.children)?void 0:l.length)?u:0)>0))return null;const w="object"===t.type(m)&&on.includes(h),b=an.includes(h);return w||b?(v=d(P,null,v,d(bn,{lang:i,path:m}),d(xn,{lang:i,path:m}),p),_=d(P,null,_,f),w?g:null):d(vn,s({key:e,schema:t,path:m,value:r[e]},{lang:i,states:c,ctx:y}))})));return[v,_,b]},string:(e,t,n,o,a,r)=>[null,d(gn,s({},l(s({},e),{path:t,value:n,lang:o,states:a,ctx:r}))),null]};function mn({path:e,value:t}){var n,o,a,r,i;switch(e.getContext().join(".")){case"loot_table.pools.entry":return d("label",null,null!=(o=null==(n=null==t?void 0:t.entries)?void 0:n.length)?o:0," entries");case"function.set_contents.entries.entry":case"loot_pool.entries.entry":return d("label",null,null!=(i=null==(a=null==t?void 0:t.name)?void 0:a.replace(/^minecraft:/,""))?i:null==(r=null==t?void 0:t.type)?void 0:r.replace(/^minecraft:/,""))}for(const s of Object.values(null!=t?t:{}))if("string"==typeof s)return d("label",null,s.replace(/^minecraft:/,""));return null}function hn(){const[e,t]=m(new Map),[n,o]=m(void 0);return{expand:e=>n=>{n.ctrlKey?(t(new Map),o(!0)):t((t=>new Map(t.set(e,!0))))},collapse:e=>n=>{n.ctrlKey?(t(new Map),o(!1)):t((t=>new Map(t.set(e,!1))))},isToggled:t=>{var o;return e instanceof Map&&(null!=(o=e.get(t))?o:n)}}}function pn({path:e,node:t,value:n,lang:o}){const a=o=>{e.model.set(e,t.optional()&&n===o?void 0:o)};return d(P,null,d("button",{class:!1===n?"selected":"",onClick:()=>a(!1)},ge(o,"false")),d("button",{class:!0===n?"selected":"",onClick:()=>a(!0)},ge(o,"true")))}function fn({path:e,config:t,integer:n,value:o,lang:a}){var r;const i=t=>{const o=t.target.value,a=n?parseInt(o):parseFloat(o);e.model.set(e,a)};return d(P,null,d("input",{type:"text",value:null!=o?o:"",onBlur:i,onKeyDown:e=>{"Enter"===e.key&&i(e)}}),(null==t?void 0:t.color)&&d("input",{type:"color",value:"#"+(null!=(r=null==o?void 0:o.toString(16).padStart(6,"0"))?r:"000000"),onChange:t=>{const n=t.target.value,o=parseInt(n.slice(1),16);e.model.set(e,o)}}),["dimension.generator.seed","dimension.generator.biome_source.seed","world_settings.seed"].includes(e.getContext().join("."))&&d("button",{onClick:()=>xe(e.model),class:"tooltipped tip-se","aria-label":ge(a,"generate_new_seed")},ae.sync))}function gn({path:e,getValues:t,config:n,node:o,value:a,lang:r,states:i}){var s;const l=t=>{t.stopPropagation();const n=t.target.value;n!==a&&e.model.set(e,0===n.length?void 0:n)},c=t(),u=e.getContext().join(".");if(rn.includes(u))return d("textarea",{value:null!=a?a:"",onBlur:l});if(_n(n)&&!n.additional||tn.includes(u)){let t=new p.Path([]);return _n(n)&&"string"==typeof n.enum?t=t.contextPush(n.enum):_n(n)||"resource"!==(null==n?void 0:n.validator)||"string"!=typeof n.params.pool?_n(n)&&(t=e):t=t.contextPush(n.params.pool),d("select",{value:null!=a?a:"",onChange:l},o.optional()&&d("option",{value:""},ge(r,"unset")),c.map((e=>d("option",{value:e},yn(r,t.contextPush(e.replace(/^minecraft:/,"")))))))}if(_n(n)||"block_state_key"!==(null==n?void 0:n.validator)){const e=ye();return d(P,null,d("input",{value:null!=a?a:"",onBlur:l,onKeyDown:e=>{"Enter"===e.key&&l(e)},list:c.length>0?e:""}),c.length>0&&d("datalist",{id:e},c.map((e=>d("option",{value:e})))))}{const t=null==i?void 0:i[p.relativePath(e,n.params.id).get()],o=Object.keys(null!=(s=null==t?void 0:t.properties)?s:{});return d("select",{value:null!=a?a:"",onChange:l},o.map((e=>d("option",null,e))))}}const vn=N((function({label:e,schema:t,path:n,value:o,lang:a,states:r,ctx:i,actions:c,children:u}){var m;const h=t.type(n),p=t.category(n),f=n.getContext().join("."),[g,v]=te(),_=l(s({},i),{depth:(null!=(m=i.depth)?m:0)+1});delete _.index;const[w,y,b]=t.hook(un,n,o,a,r,_);return d("div",{class:`node ${h}-node`,"data-category":p},d("div",{class:"node-header",onContextMenu:e=>{e.preventDefault(),v()}},d(bn,{lang:a,path:n}),d(xn,{lang:a,path:n}),u,w,d("label",null,null!=e?e:yn(a,n,`${n.last()}`),g&&d("div",{class:"node-menu"},null==c?void 0:c.map((e=>{var t;return d("div",{key:e.label,class:"menu-item"},d(X,{icon:e.icon,tooltip:ge(a,e.label),tooltipLoc:"se",onClick:()=>e.onSelect()}),d("span",null,null!=(t=e.description)?t:ge(a,e.label)))})),d("div",{class:"menu-item"},d(X,{icon:"clippy",tooltip:ge(a,"copy_context"),tooltipLoc:"se",onClick:()=>navigator.clipboard.writeText(f)}),d("span",null,f)))),y),b&&d("div",{class:"node-body"},b))}),((e,t)=>e.schema===t.schema&&e.lang===t.lang&&e.path.equals(t.path)&&Oe(e.ctx,t.ctx)&&Oe(e.value,t.value)));function _n(e){return!!(null==e?void 0:e.enum)}function wn(e){var t,n=0;for(t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n}function yn(e,t,...n){const o=t.getContext();for(let a=0;a<o.length;a+=1){const t=o.slice(a).join("."),r=ge(e,t,...n);if(t!==r)return r}return o[o.length-1]}function bn({lang:e,path:t,nested:n}){var o;t.model instanceof en&&(t=t.model.map(t).withModel(t.model));const a=n?t.model.errors.getAll().filter((e=>e.path.startsWith(t))):t.model.errors.get(t,!0);if(0===a.length)return null;const r=ge(e,a[0].error,...null!=(o=a[0].params)?o:[]);return kn("node-error","issue_opened",r)}function xn({lang:e,path:t}){const n=t.contextPush("help").getContext().join("."),o=ge(e,n);return o===n?null:kn("node-help","info",o)}const kn=(e,t,n)=>{const[o,a]=te();return d("div",{class:`node-icon ${e}${o?" show":""}`,onClick:a},ae[t],d("span",{class:"icon-popup"},n))};function Cn(e,t){var n,o;return"decorated"!==(null==(n=null==e?void 0:e.type)?void 0:n.replace(/^minecraft:/,""))?e:_e(null==e?void 0:e.config)?(t.push({id:t.length,node:e.config.decorator}),Cn(null!=(o=e.config.feature)?o:"",t)):e}function An(e,t){return 0===t.length?e:{type:"minecraft:decorated",config:{decorator:t.shift().node,feature:An(e,t)}}}function Mn({lang:e,model:t,blockStates:n,onError:o}){if(!t||!n||"none"===e)return d(P,null);const[a]=B((e=>{o(`Error rendering the tree: ${e.message}`),console.error(e)}));if(a)return d(P,null);const[,r]=m(0);return ne(t,(()=>{r((e=>e+1))})),d("div",{class:"tree"},d(dn,s({},{model:t,lang:e,blockStates:n})))}const zn={system:"device_desktop",dark:"moon",light:"sun"};function jn({lang:e,title:t,version:n,theme:o,changeTheme:a,language:r,changeLanguage:i}){const s=ge.bind(null,e),l=Ae(H());return d("header",null,d("div",{class:"title"},d(R,{class:"home-link",href:"/","aria-label":s("home")},Vn.home),d("h1",null,t),l&&d(oe,{icon:"chevron_down",tooltip:s("switch_generator")},q.generators.filter((e=>e.category===(null==l?void 0:l.category)&&Ge(n,e.minVersion))).map((e=>d(X,{label:s(e.id),active:e.id===l.id,onClick:()=>F(Ce(e.url))}))))),d("nav",null,d("ul",null,d("li",null,d(oe,{icon:"globe",tooltip:s("language")},q.languages.map((({code:e,name:t})=>d(X,{label:t,active:e===r,onClick:()=>i(e)}))))),d("li",null,d(oe,{icon:zn[o],tooltip:s("theme")},Object.entries(zn).map((([e,t])=>d(X,{icon:t,label:s(`theme.${e}`),active:e===o,onClick:()=>a(e)}))))),d("li",{class:"dimmed"},d("a",{href:"https://github.com/misode/misode.github.io",target:"_blank",rel:"noreferrer",class:"tooltipped tip-sw","aria-label":s("github")},ae.mark_github)))))}const Vn={home:d("svg",{width:"32",height:"28",viewBox:"0 0 32 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("rect",{width:"26",height:"6",rx:"3",fill:"#7CB45C"}),d("rect",{x:"8",width:"18",height:"6",rx:"3",fill:"#4BA041"}),d("rect",{y:"11",width:"32",height:"6",rx:"3",fill:"#AAA8A8"}),d("rect",{x:"11",y:"11",width:"21",height:"6",rx:"3",fill:"#91908F"}),d("rect",{x:"11",y:"22",width:"21",height:"6",rx:"3",fill:"#70B5C3"}),d("rect",{x:"17",y:"22",width:"15",height:"6",rx:"3",fill:"#4D989B"})),report:d("svg",{width:"30",height:"36",viewBox:"0 0 30 36",xmlns:"http://www.w3.org/2000/svg"},d("path",{d:"M0 16C0 13.7909 1.79086 12 4 12V12C6.20914 12 8 13.7909 8 16V32C8 34.2091 6.20914 36 4 36V36C1.79086 36 0 34.2091 0 32V16Z",fill:"#6ACC5D"}),d("path",{d:"M11 4C11 1.79086 12.7909 0 15 0V0C17.2091 0 19 1.79086 19 4V32C19 34.2091 17.2091 36 15 36V36C12.7909 36 11 34.2091 11 32V4Z",fill:"#FF4C4C"}),d("path",{d:"M22 10C22 7.79086 23.7909 6 26 6V6C28.2091 6 30 7.79086 30 10V32C30 34.2091 28.2091 36 26 36V36C23.7909 36 22 34.2091 22 32V10Z",fill:"#E5B442"}),d("path",{d:"M0 23C0 20.7909 1.79086 19 4 19V19C6.20914 19 8 20.7909 8 23V32C8 34.2091 6.20914 36 4 36V36C1.79086 36 0 34.2091 0 32V23Z",fill:"#2BAD1D"}),d("path",{d:"M11 15C11 12.7909 12.7909 11 15 11V11C17.2091 11 19 12.7909 19 15V32C19 34.2091 17.2091 36 15 36V36C12.7909 36 11 34.2091 11 32V15Z",fill:"#C10B0B"}),d("path",{d:"M22 19C22 16.7909 23.7909 15 26 15V15C28.2091 15 30 16.7909 30 19V32C30 34.2091 28.2091 36 26 36V36C23.7909 36 22 34.2091 22 32V19Z",fill:"#CC8E00"})),sounds:d("svg",{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},d("circle",{cx:"10",cy:"10",r:"10",fill:"#451475"}),d("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.5 10C3.5 8.27609 4.18482 6.62279 5.40381 5.40381C6.62279 4.18482 8.27609 3.5 10 3.5C11.7239 3.5 13.3772 4.18482 14.5962 5.40381C15.8152 6.62279 16.5 8.27609 16.5 10C16.5 11.7239 15.8152 13.3772 14.5962 14.5962C13.3772 15.8152 11.7239 16.5 10 16.5C8.27609 16.5 6.62279 15.8152 5.40381 14.5962C4.18482 13.3772 3.5 11.7239 3.5 10V10ZM10 2C7.87827 2 5.84344 2.84285 4.34315 4.34315C2.84285 5.84344 2 7.87827 2 10C2 12.1217 2.84285 14.1566 4.34315 15.6569C5.84344 17.1571 7.87827 18 10 18C12.1217 18 14.1566 17.1571 15.6569 15.6569C17.1571 14.1566 18 12.1217 18 10C18 7.87827 17.1571 5.84344 15.6569 4.34315C14.1566 2.84285 12.1217 2 10 2V2ZM8.379 7.227C8.34101 7.20412 8.29762 7.19175 8.25327 7.19117C8.20892 7.19059 8.16522 7.20181 8.12664 7.2237C8.08807 7.24558 8.05601 7.27733 8.03375 7.3157C8.0115 7.35406 7.99985 7.39765 8 7.442V12.559C8.00003 12.6033 8.0118 12.6467 8.03413 12.685C8.05646 12.7232 8.08854 12.7548 8.12708 12.7765C8.16563 12.7983 8.20926 12.8095 8.25352 12.8088C8.29778 12.8082 8.34108 12.7958 8.379 12.773L12.643 10.214C12.6798 10.1917 12.7103 10.1604 12.7315 10.1229C12.7526 10.0854 12.7638 10.043 12.7638 10C12.7638 9.95695 12.7526 9.91463 12.7315 9.87714C12.7103 9.83965 12.6798 9.80825 12.643 9.786L8.379 7.227Z",fill:"#C5A5E6"}))};function $n({lang:e,assets:t,sounds:n,sound:o,delay:a,pitch:r,volume:i,onEdit:s,onDelete:l,delayedPlay:h}){const p=ge.bind(null,e),[f,g]=m(!0),[v,_]=m(!1),[w,y]=m(!1),b=u([]),x=`playsound minecraft:${o} master @s ~ ~ ~ ${i} ${r}`;c((()=>{var e,a,s;const l=n[o];y(0===(null!=(a=null==(e=null==l?void 0:l.sounds)?void 0:e.length)?a:0)),b.current.forEach((e=>e.stop())),b.current=(null!=(s=null==l?void 0:l.sounds)?s:[]).map((e=>{const n="string"==typeof e?e:e.name,o=nt(t[`minecraft/sounds/${n}.ogg`].hash),a=new W.Howl({src:[o],format:["ogg"],volume:i,rate:r});a.on("end",(()=>{_(!1)}));const s=()=>{f&&b.current.every((e=>"loaded"===e.state()))&&g(!1)};return"loaded"===a.state()?setTimeout((()=>s())):a.on("load",(()=>{s()})),a})),g(!0)}),[o,n]),c((()=>{b.current.forEach((e=>e.rate(r)))}),[r]),c((()=>{b.current.forEach((e=>e.volume(i)))}),[i]);const k=()=>{if(f||w)return;C();const e=Math.floor(Math.random()*b.current.length);b.current[e].play(),_(!0)},C=()=>{b.current.forEach((e=>e.stop()))};c((()=>{h&&setTimeout((()=>k()),50*a)}),[h]),c((()=>()=>C()),[]);const[A,M]=m(!1),z=u(void 0);return d("div",{class:`sound-config${f?" loading":v?" playing":""}${w?" invalid":""}`},d(X,{class:"play",icon:w?"alert":f?"sync":"play",label:p("sounds.play"),onClick:k,tooltip:p(w?"sounds.unknown_sound":f?"sounds.loading_sound":"sounds.play_sound"),tooltipLoc:"se"}),d(se,{class:"btn btn-input sound",list:"sound-list",spellcheck:!1,value:o,onChange:e=>s({sound:e})}),d("label",{class:"delay-label"},p("sounds.delay"),": "),d(le,{class:"btn btn-input delay",min:0,value:a,onChange:e=>s({delay:e})}),d("label",{class:"pitch-label"},p("sounds.pitch"),": "),d(ce,{class:"pitch tooltipped tip-s",min:.5,max:2,step:.01,"aria-label":r.toFixed(2),style:`--x: ${100/1.5*(r-.5)}%`,value:r,onChange:e=>s({pitch:e})}),d("label",{class:"volume-label"},p("sounds.volume"),": "),d(ce,{class:"volume tooltipped tip-s",min:0,max:1,step:.01,"aria-label":i.toFixed(2),style:`--x: ${100*i}%`,value:i,onChange:e=>s({volume:e})}),d(X,{class:"copy"+(A?" active":""),icon:A?"check":"terminal",label:p("copy"),tooltip:p(A?"copied":"sounds.copy_command"),onClick:()=>{navigator.clipboard.writeText(x),M(!0),void 0!==z.current&&clearTimeout(z.current),z.current=setTimeout((()=>{M(!1)}),2e3)}}),d(X,{class:"remove",icon:"trashcan",tooltip:p("sounds.remove_sound"),onClick:()=>{l(),C()}}))}function En({title:e,desc:t,link:n,icon:o,children:a}){const r=d(P,null,d("div",{class:"tool-head"},o&&Vn[o],d("div",null,d("h3",null,e),d("p",null,t))),a&&d("div",{class:"tool-body"},a));return n?d("a",{class:"tool-card",href:n},r):d("div",{class:"tool-card"},r)}function In({category:e,lang:t,changeTitle:n}){const o=ge.bind(null,t);return n(o("title.generator_category",o(e))),d("main",null,d("div",{class:"category"},q.generators.filter((t=>t.category===e)).map((e=>d(En,{title:o(e.id),link:Ce(e.url)})))))}function On({lang:e,changeTitle:t}){const n=ge.bind(null,e),[o,a]=m(null);t(n("title.changelog"));const[r,i]=m([]);c((()=>{De().then((e=>i(e))).catch((e=>{console.error(e),a(e)}))}),[]);const[s,l]=m(""),[u,h]=m([]),p=e=>{u.includes(e)?h(u.filter((t=>t!==e))):h([...u,e])},f=J((()=>{const e=s.split(" ").map((e=>e.trim().toLowerCase())).filter((e=>e.length>0));return 0===e.length&&0===u.length?r:r.filter((t=>{if(!u.every((e=>t.tags.includes(e))))return!1;const n=t.tags.join(" ")+" "+t.content.toLowerCase();return e.every((e=>n.includes(e)))}))}),[r,s,u]),[g,v]=m(!1),_=J((()=>f.sort(((e,t)=>g?t.order-e.order:e.order-t.order))),[f,g]);return d("main",null,d(K,{type:"text",id:"changelog"}),o&&d(re,{error:o,onDismiss:()=>a(null)}),d("div",{class:"changelog-controls"},d("div",{class:"changelog-query"},d(se,{class:"btn btn-input changelog-search",list:"sound-list",placeholder:n("changelog.search"),value:s,onChange:l}),d(X,{icon:g?"sort_desc":"sort_asc",label:g?"Newest first":"Oldest first",onClick:()=>v(!g)})),u.length>0&&d("div",{class:"changelog-tags"},u.map((e=>d(Sn,{label:e,onClick:()=>h(u.filter((t=>t!==e)))}))))),d("div",{class:"changelog"},_.map((e=>d(Ln,{change:e,activeTags:u,toggleTag:p})))))}function Ln({change:e,activeTags:t,toggleTag:n}){return d("div",{class:"changelog-entry"},d("div",{class:"changelog-version"},d(Pn,s({},e.version)),d(Pn,s({},e.group))),d("div",{class:"changelog-tags"},e.tags.map((e=>d(Sn,{label:e,onClick:()=>n(e),active:t.includes(e)})))),d("div",{class:"changelog-content",dangerouslySetInnerHTML:{__html:G(e.content)}}))}function Pn({id:e,article:t}){return null===t?d("span",null,e):d("a",{href:`https://www.minecraft.net/en-us/article/${t}`,target:"_blank"},e)}function Sn({label:e,active:t,onClick:n}){const o="breaking"===e?5:ke(e)%360;return d("div",{class:`changelog-tag${t?" active":""}${n?" clickable":""}`,style:`--tint: ${o}`,onClick:n},"breaking"===e&&ae.alert,e)}function Dn({lang:e,changeTitle:t,version:n,changeVersion:o}){var a;const r=ge.bind(null,e),[i,h]=m(null),[f,g]=B();if(f)return d("main",null,d(re,{error:`Something went wrong rendering the generator: ${f.message}`,onDismiss:g}));const v=Ae(H());if(!v)return d("main",null,d(re,{error:`Cannot find generator "${H()}"`}));const _=q.versions.filter((e=>Ge(e.id,v.minVersion,v.maxVersion))).map((e=>e.id));t(r("title.generator",r(v.id)),_),Ge(n,v.minVersion)||h(`The minimum version for this generator is ${v.minVersion}`);const[w,y]=m(null),[b,x]=m(null);c((()=>{h(null),y(null),async function(e){return(await Je(e)).blockStates}(n).then((e=>x(e))),async function(e,t){var n;if(!He[t]||He[t].version!==e){const a=await Je(e);Fe=p.Reference(a.schemas,"configured_decorator"),We=p.ChoiceNode([{type:"string",node:p.StringNode(a.collections,{validator:"resource",params:{pool:"$worldgen/configured_feature"}})},{type:"object",node:p.Reference(a.schemas,"configured_feature")}],{choiceContext:"feature"});const r=null==(n=q.generators.find((e=>e.id===t)))?void 0:n.schema;if(!r)throw new Error(`Cannot find model ${t}`);try{const n=a.schemas.get(r),o=new p.DataModel(n,{wrapLists:!0});He[t]?o.reset(He[t].model.data,!1):(o.validate(!0),o.history=[JSON.stringify(o.data)]),He[t]={model:o,version:e}}catch(o){const n=new Error(`Cannot get generator "${t}" for version "${e}": ${Ee(o)}`);throw o instanceof Error&&(n.stack=o.stack),n}}return He[t].model}(n,v.id).then((e=>{Z.setGenerator(v.id),y(e)})).catch((e=>{console.error(e),h(Ee(e))}))}),[n,v.id]),ne(w,(()=>{h(null)}));const k=e=>{e.ctrlKey&&"z"===e.key?(Z.generatorEvent("undo","Hotkey"),null==w||w.undo()):e.ctrlKey&&"y"===e.key&&(Z.generatorEvent("redo","Hotkey"),null==w||w.redo())};c((()=>(document.addEventListener("keyup",k),()=>{document.removeEventListener("keyup",k)})),[w]);const[C,A]=m(""),[M,z]=m([]);c((()=>{(async function(e){return(await Je(e)).collections})(n).then((e=>{const t=(null!=C?C:"").trim().split(" "),n=e.get(v.id).map((e=>e.slice(10))).filter((e=>t.every((t=>e.includes(t)))));n&&z(n)})).catch((e=>{console.error(e),h(e.message)}))}),[n,v.id,C]);const[j,V]=m(window.innerWidth>820),[$,E]=m(0),[I,O]=m(0),[L,S]=m(0),[D,T]=m(!1),N=u(void 0),[R,F]=m(!1),W=Gt.includes(v.id);R&&!W&&F(!1);let J=1;W&&(J+=1),j&&(J+=2);return d(P,null,d("main",{class:R?"has-preview":""},d(K,{id:"data-pack-generator",type:"text"}),d("div",{class:"controls"},d(X,{icon:"upload",label:r("import"),onClick:()=>{Z.generatorEvent("import"),V(!0),S(L+1)}}),d(oe,{icon:"archive",label:r("presets"),relative:!1},d(Q,{icon:"search",large:!0,value:C,onChange:A,doSelect:1,placeholder:r("search")}),d("div",{class:"result-list"},M.map((e=>d(X,{label:e,onClick:()=>{return t=e,Z.generatorEvent("load-preset",t),void tt(n,null!=(o=v.path)?o:v.id,t).then((e=>{var t,n;const o=null==w?void 0:w.get(new p.Path(["generator","seed"]));void 0!==(null==(t=null==e?void 0:e.generator)?void 0:t.seed)&&void 0!==o&&(e.generator.seed=o,void 0!==(null==(n=e.generator.biome_source)?void 0:n.seed)&&(e.generator.biome_source.seed=o)),null==w||w.reset(p.DataModel.wrapLists(e),!1)}));var t,o}})))),0===M.length&&d(X,{label:r("no_presets")})),d(oe,{icon:"tag",label:n},_.reverse().map((e=>d(X,{label:e,active:e===n,onClick:()=>o(e)})))),d(oe,{icon:"kebab_horizontal",tooltip:r("more")},d(X,{icon:"history",label:r("reset"),onClick:()=>{Z.generatorEvent("reset"),null==w||w.reset(p.DataModel.wrapLists(w.schema.default()),!0)}}),d(X,{icon:"arrow_left",label:r("undo"),onClick:e=>{e.stopPropagation(),Z.generatorEvent("undo","Menu"),null==w||w.undo()}}),d(X,{icon:"arrow_right",label:r("redo"),onClick:e=>{e.stopPropagation(),Z.generatorEvent("redo","Menu"),null==w||w.redo()}}))),i&&d(re,{error:i,onDismiss:()=>h(null)}),d(Mn,l(s({},{lang:e,model:w,version:n,blockStates:b}),{onError:h}))),d("div",{class:"popup-actions",style:`--offset: -${8+50*J}px;`},d("div",{class:`popup-action action-preview${W?" shown":""} tooltipped tip-nw`,"aria-label":r(R?"hide_preview":"show_preview"),onClick:()=>{Z.generatorEvent("toggle-preview",R?"hidden":"visible"),F(!R)}},R?ae.x_circle:ae.play),d("div",{class:`popup-action action-download${j?" shown":""} tooltipped tip-nw`,"aria-label":r("download"),onClick:()=>{Z.generatorEvent("download"),O(I+1)}},ae.download),d("div",{class:`popup-action action-copy${j?" shown":""}${D?" active":""} tooltipped tip-nw`,"aria-label":r(D?"copied":"copy"),onClick:()=>{Z.generatorEvent("copy"),E($+1)}},D?ae.check:ae.clippy),d("div",{class:"popup-action action-code shown tooltipped tip-nw","aria-label":r(j?"hide_output":"show_output"),onClick:()=>{Z.generatorEvent("toggle-output",j?"hidden":"visible"),V(!j),E(0),O(0),S(0)}},j?ae.chevron_right:ae.code)),d("div",{class:"popup-preview"+(R?" shown":"")},d(Ut,l(s({},{lang:e,model:w,version:n,id:v.id}),{shown:R,onError:h}))),d("div",{class:"popup-source"+(j?" shown":"")},d(Qt,l(s({},{lang:e,model:w,blockStates:b,doCopy:$,doDownload:I,doImport:L}),{name:null!=(a=v.schema)?a:"data",copySuccess:()=>{T(!0),void 0!==N.current&&clearTimeout(N.current),N.current=setTimeout((()=>{T(!1)}),2e3)},onError:h}))))}function Tn({lang:e,changeTitle:t}){const n=ge.bind(null,e);return t(n("title.home")),d("main",null,d("div",{class:"home"},d(En,{title:"Data packs"},q.generators.filter((e=>!e.category)).map((e=>d(En,{title:n(e.id),link:Ce(e.url)}))),d(En,{title:n("worldgen"),link:"/worldgen/"})),d(En,{title:"Resource packs"},q.generators.filter((e=>"assets"===e.category)).map((e=>d(En,{title:n(e.id),link:Ce(e.url)})))),d(En,{title:"Report Inspector",icon:"report",link:"https://misode.github.io/report/",desc:"Analyse your performance reports"}),d(En,{title:"Minecraft Sounds",icon:"sounds",link:"/sounds/",desc:"Browse through and mix all the vanilla sounds"}),d(En,{title:"Data Pack Upgrader",link:"https://misode.github.io/upgrader/",desc:"Convert your 1.16 data packs to 1.17"}),d(En,{title:"Technical Changelog",link:"/changelog/"})))}function Nn({lang:e,changeTitle:t,version:n,changeVersion:o}){const a=ge.bind(null,e),[r,i]=m(null);t(a("title.sounds"));const[h,p]=m({}),[f,g]=m({}),v=Object.keys(null!=f?f:{});c((()=>{ct(n).then((e=>(p(e),dt(n)))).then((e=>{e&&g(e)})).catch((e=>{console.error(e),i(Ee(e))}))}),[n]);const[_,w]=m(""),[y,b]=m([]),x=()=>{b([{id:ye(),sound:_,delay:0,pitch:1,volume:1},...y])},k=e=>()=>{b(y.filter((t=>t.id!==e)))},[C,A]=m(0),M=u(null);return d("main",null,d(K,{type:"text",id:"sounds"}),r&&d(re,{error:r,onDismiss:()=>i(null)}),v.length>0&&d(P,null,d("div",{class:"controls sounds-controls"},d("div",{class:"sound-search-group"},d(se,{class:"btn btn-input sound-search",list:"sound-list",placeholder:a("sounds.search"),value:_,onChange:w,onEnter:x}),d(X,{icon:"plus",tooltip:a("sounds.add_sound"),class:"add-sound",onClick:x})),y.length>1&&d(X,{icon:"play",label:a("sounds.play_all"),class:"play-all-sounds",onClick:()=>{A(C+1)}}),d("div",{class:"spacer"}),d(X,{icon:"download",label:a("download"),tooltip:a("sounds.download_function"),class:"download-sounds",onClick:()=>{const e=y.some((e=>e.delay>0)),t=y.sort(((e,t)=>e.delay-t.delay)).map((t=>`${e?`execute if score @s delay matches ${t.delay} run `:""}playsound minecraft:${t.sound} master @s ~ ~ ~ ${t.volume} ${t.pitch}`)).join("\n");M.current.setAttribute("href","data:text/plain;charset=utf-8,"+t+"%0A"),M.current.setAttribute("download","sounds.mcfunction"),M.current.click()}}),d(oe,{icon:"tag",label:n},q.versions.reverse().map((e=>d(X,{label:e.id,active:e.id===n,onClick:()=>o(e.id)}))))),d("div",{class:"sounds"},y.map((t=>{return d($n,l(s(s({key:t.id},t),{lang:e,assets:h,sounds:f,delayedPlay:C}),{onEdit:(n=t.id,e=>{b(y.map((t=>t.id===n?s(s({},t),e):t)))}),onDelete:k(t.id)}));var n}))),d("a",{ref:M,style:"display: none;"})),d("datalist",{id:"sound-list"},v.map((e=>d("option",{key:e,value:e})))))}function Bn(){const[e,t]=m("none");c((()=>{(async()=>{const e=Zt.getLanguage();await Promise.all([ve("en"),..."en"!==e?[ve(e)]:[]]),t(e)})()}),[]);const[n,o]=m(Zt.getTheme());c((()=>{document.documentElement.setAttribute("data-theme",n)}),[n]);const[a,r]=m(Zt.getVersion()),i=e=>{Z.setVersion(e),Zt.setVersion(e),r(e)},[l,u]=m(ge(e,"title.home")),h=(e,t)=>{null!=t||(t=q.versions.map((e=>e.id))),t.splice(0,t.length-3),document.title=`${e} Minecraft ${t.join(", ")}`,u(e)};return d(P,null,d(jn,s({},{lang:e,title:l,version:a,theme:n,language:e,changeLanguage:async e=>{fe[e]||await ve(e),Z.setLanguage(e),Zt.setLanguage(e),t(e)},changeTheme:e=>{Z.setTheme(e),Zt.setTheme(e),o(e)}})),d(Y,{onChange:e=>{setTimeout((()=>Z.pageview(Ce(e.url))))}},d(Tn,s({path:"/"},{lang:e,changeTitle:h})),d(In,s({path:"/worldgen",category:"worldgen"},{lang:e,changeTitle:h})),d(In,s({path:"/assets",category:"assets"},{lang:e,changeTitle:h})),d(Nn,s({path:"/sounds"},{lang:e,version:a,changeTitle:h,changeVersion:i})),d(On,s({path:"/changelog"},{lang:e,changeTitle:h})),d(Dn,s({default:!0},{lang:e,version:a,changeTitle:h,changeVersion:i}))))}U(d(Bn,null),document.body);
//# sourceMappingURL=index.fcc7d815.js.map