let namespace="vp";$(document).ready(function(){const $cmd=$("#custommodeldata");const form=$("#calculatorForm");const formOptions=$("#formItems");const item=$("#item");const itemCount=$("#itemcount");const items=$("#items");const output=$("#content");const copyButton=$("#copyButton");const downloadButton=$("#downloadButton");const minus=$("#minus");const plus=$("#plus");const input=$("input[name='quant']");const nsp=$("#namespace");const $select=$("#item");minus.click(function(){const currentVal=parseInt(input.attr("value"));if(!isNaN(currentVal)){if(currentVal>input.attr("min")){input.attr("value",(currentVal-1).toString())}if(currentVal-1===input.attr("min")){$(this).attr("disabled",true)}$("#iteminput"+currentVal).remove()}else{input.attr("value","0")}});plus.click(function(){const currentVal=parseInt(input.attr("value"));if(!isNaN(currentVal)){if(currentVal1){minus.prop("disabled",false)}else{minus.prop("disabled",true)}items.append('
'+namespace+':item/
')}else{input.attr("value","0")}});$.each(itemDamages,function(key){const itemName=capitalize(key);$select.append($("").attr("value",key).text(itemName))});$cmd.change(function(){$select.find("option").each(function(){const key=$(this).val();const itemName=capitalize(key);const hasSupportText=$(this).text().includes("(supports");if(key===""){return}if($cmd.is(":checked")){if(hasSupportText){$(this).text(itemName)}}else{if(!hasSupportText){const updatedText=itemName+" (supports "+itemDamages[key]+" models)";$(this).text(updatedText)}}})});nsp.change(function(){namespace=nsp.val();if(!namespace)namespace="minecraft";nsp.val(namespace);$("span[id^='namespace']").text(namespace+":item/")});item.change(function(){if(this.value!==""){formOptions.show();const max=itemDamages[this.value];itemCount.prop("max",max);plus.prop("disabled",false)}else{formOptions.hide()}});form.on("submit",function(e){e.preventDefault();const supportsCMD=$cmd.is(":checked");const selectedItem=item.val();const currentVal=parseInt(input.attr("value"));const models=[];for(let i=0;iword.charAt(0).toUpperCase()+word.slice(1)).join(" ")}function randomModel(){const months=["red_car","blue_car","green_car","orange_car","blue_bicycle","red_bicycle","green_bicycle","orange_bicycle"];return months[Math.floor(Math.random()*months.length)]}});