pabla1322's picture
download
raw
5.63 kB
/*! For license information please see server-ui-1.0.0.js.LICENSE.txt */
import*as r from"@minecraft/common";import*as e from"@minecraft/server-ui-bindings";var o={d:(r,e)=>{for(var n in e)o.o(e,n)&&!o.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:e[n]})},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e)},n={};o.d(n,{W_:()=>m.ActionFormData,S_:()=>m.ActionFormResponse,_v:()=>m.FormCancelationReason,wA:()=>m.FormRejectError,XJ:()=>m.FormRejectReason,KB:()=>m.FormResponse,Hk:()=>m.MessageFormData,zS:()=>m.MessageFormResponse,yX:()=>m.ModalFormData,FK:()=>m.ModalFormResponse,jz:()=>m.UIManager,vB:()=>m.uiManager});const t=(a={InvalidArgumentError:()=>r.InvalidArgumentError,InvalidArgumentErrorType:()=>r.InvalidArgumentErrorType},s={},o.d(s,a),s);var a,s,i,p=function(r,e,o,n){if("a"===o&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===o?n:"a"===o?n.call(r):n?n.value:e.get(r)};i=new WeakMap;const m=(r=>{var e={};return o.d(e,r),e})({ActionFormData:()=>e.ActionFormData,ActionFormResponse:()=>e.ActionFormResponse,FormCancelationReason:()=>e.FormCancelationReason,FormRejectError:()=>e.FormRejectError,FormRejectReason:()=>e.FormRejectReason,FormResponse:()=>e.FormResponse,MessageFormData:()=>e.MessageFormData,MessageFormResponse:()=>e.MessageFormResponse,ModalFormData:()=>e.ModalFormData,ModalFormResponse:()=>e.ModalFormResponse,UIManager:()=>e.UIManager,uiManager:()=>e.uiManager});new class{constructor(){i.set(this,Symbol()),this.coreToProxyConstructor=new Map,this.proxyToGetInner=new Map}registerProxy(r,e){this.coreToProxyConstructor.set(r,e.prototype.constructor),this.proxyToGetInner.set(e,e.prototype.getInner)}wrapError(r,e){try{return r()}catch(r){throw this.wrapCore(r,{name:"Error",is_error:!0},e)}}wrapCore(r,e,o){if(e.closure_type)return(...n)=>{const t=[];let a=0;for(const r of n)t.push(this.unwrapCore(r,e.closure_type.argument_types[a],`${o} closure`,a)),a++;try{return this.wrapCore(r(...t),e.closure_type.return_type,`${o} closure`)}catch(r){throw this.wrapCore(r,{name:"Error",is_error:!0},`${o} closure`)}};if(e.array_type){if(!Array.isArray(r))throw new Error(`Invalid type passed out of ${o}. Was expecting an array.`);let n=0;const t=[];for(const a of r)t[n++]=this.wrapCore(a,e.array_type,o);return t}if(e.is_external_enum){if("string"!=typeof r&&"number"!=typeof r)throw new Error(`Invalid type passed out of ${o}. Was expecting a string or number enum value.`);return r}if(e.is_internal_enum){if(-1===e.enum_values?.indexOf(r))throw new Error(`Invalid data passed out of ${o}. Received ${JSON.stringify(r)}, but expected one of [${e.enum_values?.join(",")}]`);return r}if(!(r instanceof Object))return r;if(!r.constructor.name)return r;const n=this.coreToProxyConstructor.get(r.constructor);return n?new n(r,p(this,i,"f")):r}unwrapCore(r,e,o,n){if("void"!==e.name){if(e.array_type){if(!Array.isArray(r))throw new t.InvalidArgumentError(o,"array",t.InvalidArgumentErrorType.InvalidType,n);let a=0;const s=[];for(const t of r)s[a++]=this.unwrapCore(t,e.array_type,o,n);return s}if(e.is_external_enum){if("string"!=typeof r&&"number"!=typeof r)throw new t.InvalidArgumentError(o,e.name,t.InvalidArgumentErrorType.InvalidType,n);return r}if(e.is_internal_enum){if(-1===e.enum_values?.indexOf(r))throw new t.InvalidArgumentError(o,e.name,t.InvalidArgumentErrorType.InvalidType,n);return r}if(e.is_type){if(e.type_alias)return this.unwrapCore(r,e.type_alias,o,n);throw new t.InvalidArgumentError(o,e.name,t.InvalidArgumentErrorType.InvalidType,n)}if(e.variant_types&&e.variant_types.length>0){const a=e.variant_types.map((r=>r.name));for(const t of e.variant_types)try{return this.unwrapCore(r,t,o,n)}catch{}throw new t.InvalidArgumentError(o,`variant of [ ${a.join(" | ")} ]`,t.InvalidArgumentErrorType.InvalidType,n)}if("string"===e.name||"number"===e.name||"boolean"===e.name){if(typeof r!==e.name)throw new t.InvalidArgumentError(o,e.name,t.InvalidArgumentErrorType.InvalidType,n);return r}if(e.optional_type)return r?this.unwrapCore(r,e.optional_type,o,n):r;if(e.class_type&&!(r instanceof e.class_type))throw new t.InvalidArgumentError(o,e.name,t.InvalidArgumentErrorType.InvalidType,n);if(e.interface_data){if("object"!=typeof r||void 0===r)throw new t.InvalidArgumentError(o,e.name,t.InvalidArgumentErrorType.InvalidType,n);const a=r,s={};for(const r of e.interface_data().properties)if(r.name in a)s[r.name]=this.unwrapCore(a[r.name],r.type,o,n);else if(void 0===r.type.optional_type)throw new t.InvalidArgumentError(o,e.name,t.InvalidArgumentErrorType.Empty,n);return s}if(e.closure_type)return(...n)=>{const t=[];let a=0;for(const r of n)t.push(this.wrapCore(r,e.closure_type.argument_types[a],`${o} returned closure`)),a++;try{return this.unwrapCore(r(...t),e.closure_type.return_type,`${o} closure`)}catch(r){throw this.unwrapCore(r,{name:"Error",is_error:!0},`${o} closure`)}};if(e.is_generic_instance||e.class_type||"unknown"===e.name||e.is_error){if(!(r instanceof Object))return r;const e=this.proxyToGetInner.get(r.constructor);return e?e.call(r,p(this,i,"f")):r}throw new t.InvalidArgumentError(o,e.name,t.InvalidArgumentErrorType.Unknown,n)}}};var u=n.W_,c=n.S_,l=n._v,y=n.wA,f=n.XJ,d=n.KB,w=n.Hk,v=n.zS,g=n.yX,_=n.FK,h=n.jz,I=n.vB;export{u as ActionFormData,c as ActionFormResponse,l as FormCancelationReason,y as FormRejectError,f as FormRejectReason,d as FormResponse,w as MessageFormData,v as MessageFormResponse,g as ModalFormData,_ as ModalFormResponse,h as UIManager,I as uiManager};

Xet Storage Details

Size:
5.63 kB
·
Xet hash:
0fe2a764ad8412b1bd60b15ee2d5874f4b371c776c9510a76a8031a0f230c33f

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.