oe.length)&&(P=oe.length);for(var ee=0,le=new Array(P);ee"u"||typeof document>"u")&&!P._hasLoadedGA){var pe=document.createElement("script");pe.async=!0,pe.src="https://www.googletagmanager.com/gtag/js?id=".concat(ee),le&&pe.setAttribute("nonce",le),document.body.appendChild(pe),window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},P._hasLoadedGA=!0}}),G(this,"_toGtagOptions",function(ee){if(!!ee){var le={cookieUpdate:"cookie_update",cookieExpires:"cookie_expires",cookieDomain:"cookie_domain",cookieFlags:"cookie_flags",userId:"user_id",clientId:"client_id",anonymizeIp:"anonymize_ip",contentGroup1:"content_group1",contentGroup2:"content_group2",contentGroup3:"content_group3",contentGroup4:"content_group4",contentGroup5:"content_group5",allowAdFeatures:"allow_google_signals",allowAdPersonalizationSignals:"allow_ad_personalization_signals",nonInteraction:"non_interaction",page:"page_path",hitCallback:"event_callback"},pe=Object.entries(ee).reduce(function(_e,J){var ft=k(J,2),Le=ft[0],He=ft[1];return le[Le]?_e[le[Le]]=He:_e[Le]=He,_e},{});return pe}}),G(this,"initialize",function(ee){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!ee)throw new Error("Require GA_MEASUREMENT_ID");var pe=typeof ee=="string"?[{trackingId:ee}]:ee;P._currentMeasurementId=pe[0].trackingId;var _e=le.gaOptions,J=le.gtagOptions,ft=le.legacyDimensionMetric,Le=ft===void 0?!0:ft,He=le.nonce,nr=le.testMode,Bt=nr===void 0?!1:nr;if(P._testMode=Bt,Bt||P._loadGA(P._currentMeasurementId,He),P.isInitialized||(P._gtag("js",new Date),pe.forEach(function(vr){var At=P._appendCustomMap(_(_(_({send_page_view:!1},P._toGtagOptions(_(_({},_e),vr.gaOptions))),J),vr.gtagOptions),Le);P._gtag("config",vr.trackingId,At)})),P.isInitialized=!0,!Bt){var Rt=p(P._queueGtag);for(P._queueGtag=[],P._isQueuing=!1;Rt.length;){var Jt=Rt.shift();P._gtag.apply(P,p(Jt)),Jt[0]==="get"&&(P._isQueuing=!0)}}}),G(this,"set",function(ee){if(!ee){console.warn("`fieldsObject` is required in .set()");return}if(d(ee)!=="object"){console.warn("Expected `fieldsObject` arg to be an Object");return}Object.keys(ee).length===0&&console.warn("empty `fieldsObject` given to .set()"),P._gaCommand("set",ee)}),G(this,"_gaCommandSendEvent",function(ee,le,pe,_e,J){P._gtag("event",le,_(_({event_category:ee,event_label:pe,value:_e},J&&{non_interaction:J.nonInteraction}),P._toGtagOptions(J)))}),G(this,"_gaCommandSendEventParameters",function(){for(var ee=arguments.length,le=new Array(ee),pe=0;pe1?le-1:0),_e=1;_e1&&arguments[1]!==void 0?arguments[1]:!0;if(!le)return ee;ee.custom_map||(ee.custom_map={});for(var pe=1;pe<=200;pe++)ee.custom_map["dimension".concat(pe)]||(ee.custom_map["dimension".concat(pe)]="dimension".concat(pe)),ee.custom_map["metric".concat(pe)]||(ee.custom_map["metric".concat(pe)]="metric".concat(pe));return ee}},{key:"outboundLink",value:function(ee,le){var pe=ee.label;if(typeof le!="function"){console.warn("hitCallback function is required");return}if(!pe){console.warn("args.label is required in outboundLink()");return}var _e={hitType:"event",eventCategory:"Outbound",eventAction:"Click",eventLabel:(0,r.default)(pe)},J=!1,ft=function(){J=!0,le()},Le=setTimeout(ft,250),He=function(){clearTimeout(Le),J||le()};_e.hitCallback=He,this._gaCommand("send",_e)}}]),oe}();e.GA4=ae;var V=new ae;e.default=V})(YN);(function(e){function t(l){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(c){return typeof c}:t=function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},t(l)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.ReactGAImplementation=void 0;var r=o(YN);function i(l){if(typeof WeakMap!="function")return null;var u=new WeakMap,c=new WeakMap;return(i=function(p){return p?c:u})(l)}function o(l,u){if(!u&&l&&l.__esModule)return l;if(l===null||t(l)!=="object"&&typeof l!="function")return{default:l};var c=i(u);if(c&&c.has(l))return c.get(l);var d={},p=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in l)if(v!=="default"&&Object.prototype.hasOwnProperty.call(l,v)){var x=p?Object.getOwnPropertyDescriptor(l,v):null;x&&(x.get||x.set)?Object.defineProperty(d,v,x):d[v]=l[v]}return d.default=l,c&&c.set(l,d),d}var a=r.GA4;e.ReactGAImplementation=a;var s=r.default;e.default=s})(GN);const Ab=Kb(GN);var ha=(e=>(e.ADD_FILE="ADD_FILE",e.CONNECT_WALLET_POPUP="CONNECT_WALLET_POPUP",e.WALLET_CONNECTED="WALLET_CONNECTED",e.SELECT_WALLET="SELECT_WALLET",e.COMPILE_SUBMIT="COMPILE_SUBMIT",e.COMPILE_SERVER_ERROR="COMPILE_SERVER_ERROR",e.SIGN_SERVER_ERROR="SIGN_SERVER_ERROR",e.SIGN_SERVER_SUCCESS="SIGN_SERVER_SUCCESS",e.COMPILE_HASHES_NOT_SIMILAR="COMPILE_HASHES_NOT_SIMILAR",e.COMPILE_COMPILATION_ERROR="COMPILE_COMPILATION_ERROR",e.COMPILE_SUCCESS_HASHES_MATCH="COMPILE_SUCCESS_HASHES_MATCH",e.PUBLISH_CLICK="PUBLISH_CLICK",e.TRANSACTION_ISSUED="TRANSACTION_ISSUED",e.TRANSACTION_REJECTED="TRANSACTION_REJECTED",e.TRANSACTION_ERROR="TRANSACTION_ERROR",e.TRANSACTION_EXPIRED="TRANSACTION_EXPIRED",e.CONTRACT_DEPLOYED="CONTRACT_DEPLOYED",e.IN_BROWSER_COMPILE_ERROR="IN_BROWSER_COMPILE_ERROR",e.IN_BROWSER_COMPILE_START="IN_BROWSER_COMPILE_START",e.IN_BROWSER_COMPILE_SUCCESS="IN_BROWSER_COMPILE_SUCCESS",e.GETTER_PARSE_START="GETTER_PARSE_START",e.RUN_GETTER="RUN_GETTER",e))(ha||{});const wa=(e,t="")=>{if(!!Ab.isInitialized)try{Ab.event({category:"VERIFIER",action:e,label:t})}catch(r){console.log(r)}},P1e=()=>{try{Ab.initialize("G-2TB9KYGCFR"),Ab.send(window.location.pathname+window.location.search)}catch{}};let Tb=["fc","func","pkg"];({}).VITE_ALLOW_FIFT&&Tb.push("fift");const zu=_g($x((e,t)=>({files:[],hasFiles:()=>t().files.length>0,addFiles:async r=>{const i=await Promise.all(r.map(async o=>{const a=await o.text(),s=o.path?.split("/").filter(l=>l)??[];return{fileObj:o,includeInCommand:!0,folder:s.slice(0,s.length-1).join("/"),hasIncludeDirectives:a.includes("#include"),isEntrypoint:/\(\)\s*(recv_internal|main)\s*\(/.test(a),isStdlib:/stdlib.(fc|func)/i.test(o.name)}}));e(o=>{const a=i.filter(s=>s.fileObj.name.match(new RegExp(`.*.(${Tb.join("|")})$`))&&!o.files.find(l=>l.fileObj.name===s.fileObj.name));a&&(wa(ha.ADD_FILE),o.files.push(...a))})},setInclueInCommand:(r,i)=>{e(o=>{o.files.find(a=>a.fileObj.name===r).includeInCommand=i})},setDirectory:(r,i)=>{e(o=>{o.files.find(a=>a.fileObj.name===r).folder=i})},removeFile:r=>{e(i=>{i.files=i.files.filter(o=>o.fileObj.name!==r)})},reorderFiles:(r,i)=>{e(o=>{const a=o.files,s=a.findIndex(c=>c.fileObj.name===r),l=a.findIndex(c=>c.fileObj.name===i),[u]=a.splice(s,1);a.splice(l,0,u)})},reset:()=>{e(r=>{r.files=[]})}}))),M1e="https://raw.githubusercontent.com/ton-community/contract-verifier-config/main/config.json";function uE(){const[e,t]=X.exports.useState(!0);return bc(["remoteConfig"],async()=>{const{funcVersions:r,tactVersions:i}=await(await fetch(M1e)).json();return t(!1),{funcVersions:r,tactVersions:i}},{enabled:e,initialData:{funcVersions:[],tactVersions:[]}})}const O1e=_g($x((e,t)=>({compiler:"func",compilerSettings:{funcVersion:"",commandLine:""},_defaultFuncVersion:"",initialize:r=>{e(i=>{i._defaultFuncVersion=r,i.compilerSettings={funcVersion:i._defaultFuncVersion,commandLine:"",overrideCommandLine:null}})},setCompilerSettings:r=>{e(i=>{i.compilerSettings=r})},setOverrideCommandLine:r=>{e(i=>{if(i.compiler!=="func")throw new Error("not func compiler");i.compilerSettings.overrideCommandLine=r})},setFuncCliVersion:r=>{e(i=>{if(i.compiler!=="func")throw new Error("not func compiler");i.compilerSettings.funcVersion=r})},setTactCliVersion:r=>{e(i=>{if(i.compiler!=="tact")throw new Error("not tact compiler");i.compilerSettings={tactVersion:r}})},setCompiler:r=>{e(i=>{i.compiler=r,r==="func"?i.compilerSettings={funcVersion:i._defaultFuncVersion,commandLine:"",overrideCommandLine:null}:r==="tact"&&(i.compilerSettings={tactVersion:""})})}})));function cE(){const{files:e,setInclueInCommand:t}=zu(),r=O1e(),{data:{tactVersions:i}}=uE();function o(){const s=e.filter(l=>l.includeInCommand).map(l=>(l.folder?l.folder+"/":"")+l.fileObj.name).join(" ");return e?`-SPA ${s}`:""}X.exports.useEffect(()=>{const s=e.find(l=>l.fileObj.name.endsWith(".pkg"));(async()=>{if(!s)return;const l=await s.fileObj.text(),u=JSON.parse(l);if(r.setCompiler("tact"),!i.includes(u.compiler.version))throw new Error("Unsupported tact version "+u.compiler.version);r.setCompilerSettings({tactVersion:u.compiler.version})})()},[e]);const a={};return r.compiler==="func"&&(a.commandLine=r.compilerSettings.overrideCommandLine??o()),{...r,compilerSettings:{...r.compilerSettings,...a}}}const B1e=(e,t,r)=>{const i=()=>{o.invalidateQueries(["CustomMutation",e]),o.invalidateQueries(["CustomMutationError",e])},o=hw(),a=bc(["CustomMutation",e],async()=>await Promise.resolve(!1),{retry:!1,cacheTime:1/0,staleTime:1/0}),s=bc(["CustomMutationError",e],async()=>await Promise.resolve(!1),{retry:!1,cacheTime:1/0,staleTime:1/0}),l=hU(e,async(...c)=>(i(),o.setQueryData(["CustomMutationError",e],!1),await t(...c)),{...r,onSuccess:(c,d,p)=>{o.setQueryData(["CustomMutation",e],c),r?.onSuccess&&r.onSuccess(c,d,p)},onError:(c,d,p)=>{o.setQueryData(["CustomMutationError",e],c),r?.onError&&r.onError(c,d,p)}}),u=Hq(e);return{...l,data:a.data,isLoading:!!u,error:s.data,isError:!!s.data,invalidate:i}};var Uy={};Object.defineProperty(Uy,"__esModule",{value:!0});function U1e(e){{const t=Buffer.from(e);t.reverse();const r=t.toString("hex");return r.length===0?BigInt(0):BigInt(`0x${r}`)}}Uy.toBigIntLE=U1e;function D1e(e){{const t=e.toString("hex");return t.length===0?BigInt(0):BigInt(`0x${t}`)}}var Ib=Uy.toBigIntBE=D1e;function L1e(e,t){{const r=e.toString(16),i=Buffer.from(r.padStart(t*2,"0").slice(0,t*2),"hex");return i.reverse(),i}}Uy.toBufferLE=L1e;function N1e(e,t){{const r=e.toString(16);return Buffer.from(r.padStart(t*2,"0").slice(0,t*2),"hex")}}var XN=Uy.toBufferBE=N1e;function j1e(e){let t=XN(e,4);return[t[0].toString(),t[1].toString(),t[2].toString(),t[3].toString()].join(".")}function $1e(){return{serialize:(e,t)=>{t.storeSlice(e)},parse:e=>e}}class dE{constructor(t,r){this.address=t,this.init=r}static createFromAddress(t){return new dE(t)}async sendInternalMessage(t,r,i,o){await t.internal(r,{value:o,sendMode:fo.SendMode.PAY_GAS_SEPARATELY,body:i})}async sendDeploy(t,r,i){await t.internal(r,{value:i,sendMode:fo.SendMode.PAY_GAS_SEPARATELY,body:fo.beginCell().endCell()})}async getVerifier(t,r){let i=await t.get("get_verifier",[{type:"int",value:r}]);const o=i.stack.readCell(),a=i.stack.readCellOpt();return i.stack.readNumber()==0?{admin:null,settings:null}:{admin:o.beginParse().loadAddress(),settings:a}}async getVerifiersNum(t){return(await t.get("get_verifiers_num",[])).stack.readNumber()}async getVerifiers(t){const a=(await t.get("get_verifiers",[])).stack.readCell().beginParse().loadDict(fo.Dictionary.Keys.BigUint(256),$1e());return Array.from(a.values()).map(s=>{const l=s.loadAddress(),u=s.loadUint(8),c=s.loadDict(fo.Dictionary.Keys.BigUint(256),fo.Dictionary.Values.BigUint(32));return{admin:l,quorum:u,pubKeyEndpoints:Object.fromEntries(Array.from(c).map(([d,p])=>[XN(d,32).toString("base64"),j1e(p)])),name:s.loadRef().beginParse().loadStringTail(),url:s.loadRef().beginParse().loadStringTail()}})}}const F1e=e=>{const t=new Xk.Sha256;return t.update(e),Buffer.from(t.digestSync())};class Fx{constructor(t,r){this.address=t,this.init=r}static createFromAddress(t){return new Fx(t)}async sendInternalMessage(t,r,i,o){await t.internal(r,{value:o,sendMode:fo.SendMode.PAY_GAS_SEPARATELY,body:i})}async sendDeploy(t,r,i,o=!0){await t.internal(r,{value:i,sendMode:fo.SendMode.PAY_GAS_SEPARATELY,body:fo.beginCell().endCell(),bounce:o})}async getChildAddressFromChain(t,r,i){return(await t.get("get_source_item_address",[{type:"int",value:Ib(F1e(r))},{type:"int",value:Ib(Buffer.from(i,"base64"))}])).stack.readCell().beginParse().loadAddress()}async getVerifierRegistryAddress(t){return(await t.get("get_verifier_registry_address",[])).stack.readCell().beginParse().loadAddress()}async getAdminAddress(t){return(await t.get("get_admin_address",[])).stack.readCell().beginParse().loadMaybeAddress()}async getCodeOpt(t){const r=await t.getState();return r.state.type!="active"?null:r.state.code}async getDeploymentCosts(t){const r=await t.get("get_deployment_costs",[]),i=r.stack.readBigNumber(),o=r.stack.readBigNumber();return{min:fo.fromNano(i),max:fo.fromNano(o)}}}async function JN(e,t){return(await t.open(Fx.createFromAddress(e)).getAdminAddress())?.toString()}function Dy(){const e=Vn.Address.parse(window.sourcesRegistryAddress);return bc(["sourcesRegistry",e],async()=>{const t=await yp(),r=await JN(e,t),i=t.open(Fx.createFromAddress(e)),o=(await i.getVerifierRegistryAddress()).toString(),a=await i.getDeploymentCosts(),s=Vn.Cell.fromBoc((await t.getContractState(e)).code)[0].hash().toString("base64");return{admin:r,verifierRegistry:o,codeCellHash:s,address:e,deploymentCosts:a}})}function zx(){const{data:e}=Dy();return bc(["verifierRegistry",e?.verifierRegistry],async()=>await(await yp()).open(dE.createFromAddress(Vn.Address.parse(e.verifierRegistry))).getVerifiers())}function ej(e){return e[Math.floor(Math.random()*e.length)]}function z1e(e){return new Blob([JSON.stringify(e)],{type:"application/json"})}const m1=window.isTestnet?"https://ton-source-prod-testnet-1.herokuapp.com".split(","):"https://ton-source-prod-1.herokuapp.com,https://ton-source-prod-2.herokuapp.com,https://ton-source-prod-3.herokuapp.com".split(","),H1e=Py(e=>({status:null,setStatus:t=>e({status:t}),clear:()=>e({status:null})}));function Hu(){const{contractAddress:e}=$u(),{data:t}=vp(),{hasFiles:r,files:i}=zu(),{compiler:o,compilerSettings:a}=cE(),s=Bx(),{clear:l,setStatus:u,status:c}=H1e(),{data:d}=zx(),p=d?.find(x=>x.name===window.verifierId);return{...B1e(["submitSources"],async()=>{if(!e||!t?.codeCellHash.base64||!r()||!p)return;if(!s)throw new Error("Wallet is not connected");l();const x=p.quorum;let b=x,y;wa(ha.COMPILE_SUBMIT);const _=new FormData;for(const j of i)_.append((j.folder?j.folder+"/":"")+j.fileObj.name,j.fileObj);_.append("json",z1e({compiler:o,compilerSettings:a,knownContractAddress:e,knownContractHash:t.codeCellHash.base64,sources:i.map(j=>({includeInCommand:j.includeInCommand,isEntrypoint:j.isEntrypoint,isStdLib:j.isStdlib,hasIncludeDirectives:j.hasIncludeDirectives,folder:j.folder})),senderAddress:s}));const k=m1[Math.floor(Math.random()*m1.length)],E=await fetch(`${k}/source`,{method:"POST",body:_});if(E.status!==200)throw wa(ha.COMPILE_SERVER_ERROR),new Error(`Error compiling on ${k} ${await E.text()}`);const B=await E.json(),U=[];["unknown_error","compile_error"].includes(B.compileResult.result)&&(wa(ha.COMPILE_COMPILATION_ERROR),i.some(j=>j.isStdlib)?i[0].isStdlib||U.push(Na.STDLIB_ORDER):Na.STDLIB_MISSING,i.some(j=>j.isEntrypoint)||U.push(Na.ENTRYPOINT_MISSING),U.push(Na.COMPILER_VERSION),U.push(Na.REQUIRED_FILES),U.push(Na.FILE_ORDER)),B.compileResult.result==="not_similar"&&(wa(ha.COMPILE_HASHES_NOT_SIMILAR),U.push(Na.NOT_SIMILAR)),B.compileResult.result!=="similar"&&U.push(Na.SUPPORT_GROUP),B.compileResult.result==="similar"&&wa(ha.COMPILE_SUCCESS_HASHES_MATCH);let D;if(B.msgCell){b--;const j=new Set([k]);for(y=B.msgCell;b;){u(`Compile successful. Collected ${x-b}/${x}`);const H=ej(m1.filter(ae=>!j.has(ae)));if(!H)throw new Error("Not enough backends to collect signatures");console.log("Backends used: "+[...j],"; next backend",H);const W=await fetch(`${H}/sign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messageCell:y})});if(W.status!==200)throw wa(ha.SIGN_SERVER_ERROR),new Error(`Error collecting signatures from ${H} ${await W.text()}`);wa(ha.SIGN_SERVER_SUCCESS),y=(await W.json()).msgCell,b--}u(`Compile successful. Collected ${x-b}/${x}`),D=Vn.Cell.fromBoc(Buffer.from(B.msgCell))[0].beginParse().loadUint(64)}return{result:{...B,msgCell:y},hints:U,queryId:D,status:c}}),compileStatus:c}}var Na=(e=>(e[e.STDLIB_ORDER=0]="STDLIB_ORDER",e[e.STDLIB_MISSING=1]="STDLIB_MISSING",e[e.NOT_SIMILAR=2]="NOT_SIMILAR",e[e.COMPILER_VERSION=3]="COMPILER_VERSION",e[e.REQUIRED_FILES=4]="REQUIRED_FILES",e[e.FILE_ORDER=5]="FILE_ORDER",e[e.ENTRYPOINT_MISSING=6]="ENTRYPOINT_MISSING",e[e.SUPPORT_GROUP=7]="SUPPORT_GROUP",e))(Na||{});const fE=()=>{const[e]=kg();return async(t,r,i,o)=>{try{let a;if(o){const l=Vn.beginCell();Vn.storeStateInit(o)(l),a=l.asCell()}const s={validUntil:Date.now()+5*60*1e3,messages:[{address:t,amount:r.toString(),stateInit:a?a.toBoc().toString("base64"):void 0,payload:i?.toBoc().toString("base64")}]};return await e.sendTransaction(s),"issued"}catch(a){return console.error(a),"rejected"}}},W1e=Py((e,t)=>({txns:{},updateTxn:(r,i)=>{e(o=>({txns:{...t().txns,[r]:i}}))}}));function tj(e,t){const r=fE(),{updateTxn:i,txns:o}=W1e();return X.exports.useEffect(()=>{o[e]||i(e,"initial")},[]),{sendTXN:async(a,s,l,u)=>{i(e,"pending");const c=await r(a.toString(),s,l,u);let d=1;if(c==="issued"){i(e,"issued");const p=setInterval(async()=>{const v=await t(d);d++,i(e,v),v!=="issued"&&clearInterval(p)},2e3)}else c==="rejected"&&i(e,"rejected")},data:{status:o[e]},clearTXN:()=>{i(e,"initial")}}}function rj(){const{data:e}=Hu(),{data:t}=vp(),{data:r}=Dy(),{sendTXN:i,data:o,clearTXN:a}=tj("publishProof",async s=>{const l=await pE(t.codeCellHash.base64);return s>20?"error":l?"success":"issued"});return X.exports.useEffect(()=>{switch(o.status){case"pending":wa(ha.PUBLISH_CLICK);break;case"issued":wa(ha.TRANSACTION_ISSUED);break;case"rejected":wa(ha.TRANSACTION_REJECTED);break;case"error":wa(ha.TRANSACTION_ERROR);break;case"expired":wa(ha.TRANSACTION_EXPIRED);break;case"success":wa(ha.CONTRACT_DEPLOYED);break}},[o.status]),{sendTXN:()=>{i(Vn.Address.parse(r.verifierRegistry),Vn.toNano("0.5"),Vn.Cell.fromBoc(Buffer.from(e.result.msgCell))[0])},status:o.status,clearTXN:a}}const V1e=e=>{const t=new Xk.Sha256;return t.update(e),Buffer.from(t.digestSync())};async function pE(e){return ContractVerifier.getSourcesJsonUrl(e,{verifier:window.verifierId,testnet:window.isTestnet})}function Pc(){const{contractAddress:e}=$u(),{data:t,error:r}=vp(),{status:i}=rj(),{isLoading:o,error:a,data:s,refetch:l}=bc([e,"proof"],async()=>{if(!e)return{hasOnchainProof:!1};const u=await pE(t.codeCellHash.base64);return u?{hasOnchainProof:!0,...await ContractVerifier.getSourcesData(u,{testnet:window.isTestnet})}:{hasOnchainProof:!1,ipfsLink:u}},{enabled:!!e&&!!t?.codeCellHash.base64&&i==="initial",retry:2});return{isLoading:o,error:a??r,data:s,refetch:l}}function q1e(){const{data:e}=Pc();return X.exports.useEffect(()=>{!e?.files||ContractVerifierUI.loadSourcesData(e,{containerSelector:"#myVerifierContainer",fileListSelector:"#myVerifierFiles",contentSelector:"#myVerifierContent",theme:"light"})},[e?.files]),{hasOnchainProof:e?.hasOnchainProof}}function K1e({button:e}){return q1e(),Ut("div",{id:"myVerifierContainer",style:{color:"black"},children:[L("div",{id:"myVerifierFiles"}),Ut("div",{style:{position:"relative",overflow:"hidden",width:"100%"},children:[L("div",{id:"myVerifierContent"}),L("div",{style:{position:"absolute",top:-73,right:-24,zIndex:3},children:e})]})]})}var hE={exports:{}};function gE(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(function(t){var r=e[t];typeof r=="object"&&!Object.isFrozen(r)&&gE(r)}),e}hE.exports=gE;hE.exports.default=gE;class sM{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function nj(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function rd(e,...t){const r=Object.create(null);for(const i in e)r[i]=e[i];return t.forEach(function(i){for(const o in i)r[o]=i[o]}),r}const G1e="",lM=e=>!!e.scope||e.sublanguage&&e.language,Y1e=(e,{prefix:t})=>{if(e.includes(".")){const r=e.split(".");return[`${t}${r.shift()}`,...r.map((i,o)=>`${i}${"_".repeat(o+1)}`)].join(" ")}return`${t}${e}`};class Q1e{constructor(t,r){this.buffer="",this.classPrefix=r.classPrefix,t.walk(this)}addText(t){this.buffer+=nj(t)}openNode(t){if(!lM(t))return;let r="";t.sublanguage?r=`language-${t.language}`:r=Y1e(t.scope,{prefix:this.classPrefix}),this.span(r)}closeNode(t){!lM(t)||(this.buffer+=G1e)}value(){return this.buffer}span(t){this.buffer+=``}}const uM=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class mE{constructor(){this.rootNode=uM(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const r=uM({scope:t});this.add(r),this.stack.push(r)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,r){return typeof r=="string"?t.addText(r):r.children&&(t.openNode(r),r.children.forEach(i=>this._walk(t,i)),t.closeNode(r)),t}static _collapse(t){typeof t!="string"&&(!t.children||(t.children.every(r=>typeof r=="string")?t.children=[t.children.join("")]:t.children.forEach(r=>{mE._collapse(r)})))}}class Z1e extends mE{constructor(t){super(),this.options=t}addKeyword(t,r){t!==""&&(this.openNode(r),this.addText(t),this.closeNode())}addText(t){t!==""&&this.add(t)}addSublanguage(t,r){const i=t.root;i.sublanguage=!0,i.language=r,this.add(i)}toHTML(){return new Q1e(this,this.options).value()}finalize(){return!0}}function X0(e){return e?typeof e=="string"?e:e.source:null}function ij(e){return bp("(?=",e,")")}function X1e(e){return bp("(?:",e,")*")}function J1e(e){return bp("(?:",e,")?")}function bp(...e){return e.map(r=>X0(r)).join("")}function ebe(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function yE(...e){return"("+(ebe(e).capture?"":"?:")+e.map(i=>X0(i)).join("|")+")"}function oj(e){return new RegExp(e.toString()+"|").exec("").length-1}function tbe(e,t){const r=e&&e.exec(t);return r&&r.index===0}const rbe=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function vE(e,{joinWith:t}){let r=0;return e.map(i=>{r+=1;const o=r;let a=X0(i),s="";for(;a.length>0;){const l=rbe.exec(a);if(!l){s+=a;break}s+=a.substring(0,l.index),a=a.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?s+="\\"+String(Number(l[1])+o):(s+=l[0],l[0]==="("&&r++)}return s}).map(i=>`(${i})`).join(t)}const nbe=/\b\B/,aj="[a-zA-Z]\\w*",bE="[a-zA-Z_]\\w*",sj="\\b\\d+(\\.\\d+)?",lj="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",uj="\\b(0b[01]+)",ibe="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",obe=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=bp(t,/.*\b/,e.binary,/\b.*/)),rd({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(r,i)=>{r.index!==0&&i.ignoreMatch()}},e)},J0={begin:"\\\\[\\s\\S]",relevance:0},abe={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[J0]},sbe={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[J0]},lbe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Hx=function(e,t,r={}){const i=rd({scope:"comment",begin:e,end:t,contains:[]},r);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const o=yE("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:bp(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},ube=Hx("//","$"),cbe=Hx("/\\*","\\*/"),dbe=Hx("#","$"),fbe={scope:"number",begin:sj,relevance:0},pbe={scope:"number",begin:lj,relevance:0},hbe={scope:"number",begin:uj,relevance:0},gbe={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[J0,{begin:/\[/,end:/\]/,relevance:0,contains:[J0]}]}]},mbe={scope:"title",begin:aj,relevance:0},ybe={scope:"title",begin:bE,relevance:0},vbe={begin:"\\.\\s*"+bE,relevance:0},bbe=function(e){return Object.assign(e,{"on:begin":(t,r)=>{r.data._beginMatch=t[1]},"on:end":(t,r)=>{r.data._beginMatch!==t[1]&&r.ignoreMatch()}})};var jv=Object.freeze({__proto__:null,MATCH_NOTHING_RE:nbe,IDENT_RE:aj,UNDERSCORE_IDENT_RE:bE,NUMBER_RE:sj,C_NUMBER_RE:lj,BINARY_NUMBER_RE:uj,RE_STARTERS_RE:ibe,SHEBANG:obe,BACKSLASH_ESCAPE:J0,APOS_STRING_MODE:abe,QUOTE_STRING_MODE:sbe,PHRASAL_WORDS_MODE:lbe,COMMENT:Hx,C_LINE_COMMENT_MODE:ube,C_BLOCK_COMMENT_MODE:cbe,HASH_COMMENT_MODE:dbe,NUMBER_MODE:fbe,C_NUMBER_MODE:pbe,BINARY_NUMBER_MODE:hbe,REGEXP_MODE:gbe,TITLE_MODE:mbe,UNDERSCORE_TITLE_MODE:ybe,METHOD_GUARD:vbe,END_SAME_AS_BEGIN:bbe});function wbe(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function xbe(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function _be(e,t){!t||!e.beginKeywords||(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=wbe,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Sbe(e,t){!Array.isArray(e.illegal)||(e.illegal=yE(...e.illegal))}function Cbe(e,t){if(!!e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function kbe(e,t){e.relevance===void 0&&(e.relevance=1)}const Ebe=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const r=Object.assign({},e);Object.keys(e).forEach(i=>{delete e[i]}),e.keywords=r.keywords,e.begin=bp(r.beforeMatch,ij(r.begin)),e.starts={relevance:0,contains:[Object.assign(r,{endsParent:!0})]},e.relevance=0,delete r.beforeMatch},Abe=["of","and","for","in","not","or","if","then","parent","list","value"],Tbe="keyword";function cj(e,t,r=Tbe){const i=Object.create(null);return typeof e=="string"?o(r,e.split(" ")):Array.isArray(e)?o(r,e):Object.keys(e).forEach(function(a){Object.assign(i,cj(e[a],t,a))}),i;function o(a,s){t&&(s=s.map(l=>l.toLowerCase())),s.forEach(function(l){const u=l.split("|");i[u[0]]=[a,Ibe(u[0],u[1])]})}}function Ibe(e,t){return t?Number(t):Rbe(e)?0:1}function Rbe(e){return Abe.includes(e.toLowerCase())}const cM={},Af=e=>{console.error(e)},dM=(e,...t)=>{console.log(`WARN: ${e}`,...t)},jp=(e,t)=>{cM[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),cM[`${e}/${t}`]=!0)},Rb=new Error;function dj(e,t,{key:r}){let i=0;const o=e[r],a={},s={};for(let l=1;l<=t.length;l++)s[l+i]=o[l],a[l+i]=!0,i+=oj(t[l-1]);e[r]=s,e[r]._emit=a,e[r]._multi=!0}function Pbe(e){if(!!Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Af("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Rb;if(typeof e.beginScope!="object"||e.beginScope===null)throw Af("beginScope must be object"),Rb;dj(e,e.begin,{key:"beginScope"}),e.begin=vE(e.begin,{joinWith:""})}}function Mbe(e){if(!!Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Af("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Rb;if(typeof e.endScope!="object"||e.endScope===null)throw Af("endScope must be object"),Rb;dj(e,e.end,{key:"endScope"}),e.end=vE(e.end,{joinWith:""})}}function Obe(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Bbe(e){Obe(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Pbe(e),Mbe(e)}function Ube(e){function t(s,l){return new RegExp(X0(s),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,l]),this.matchAt+=oj(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(u=>u[1]);this.matcherRe=t(vE(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const u=this.matcherRe.exec(l);if(!u)return null;const c=u.findIndex((p,v)=>v>0&&p!==void 0),d=this.matchIndexes[c];return u.splice(0,c),Object.assign(u,d)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const u=new r;return this.rules.slice(l).forEach(([c,d])=>u.addRule(c,d)),u.compile(),this.multiRegexes[l]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,u){this.rules.push([l,u]),u.type==="begin"&&this.count++}exec(l){const u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let c=u.exec(l);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,c=d.exec(l)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function o(s){const l=new i;return s.contains.forEach(u=>l.addRule(u.begin,{rule:u,type:"begin"})),s.terminatorEnd&&l.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&l.addRule(s.illegal,{type:"illegal"}),l}function a(s,l){const u=s;if(s.isCompiled)return u;[xbe,Cbe,Bbe,Ebe].forEach(d=>d(s,l)),e.compilerExtensions.forEach(d=>d(s,l)),s.__beforeBegin=null,[_be,Sbe,kbe].forEach(d=>d(s,l)),s.isCompiled=!0;let c=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),c=s.keywords.$pattern,delete s.keywords.$pattern),c=c||/\w+/,s.keywords&&(s.keywords=cj(s.keywords,e.case_insensitive)),u.keywordPatternRe=t(c,!0),l&&(s.begin||(s.begin=/\B|\b/),u.beginRe=t(u.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(u.endRe=t(u.end)),u.terminatorEnd=X0(u.end)||"",s.endsWithParent&&l.terminatorEnd&&(u.terminatorEnd+=(s.end?"|":"")+l.terminatorEnd)),s.illegal&&(u.illegalRe=t(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(d){return Dbe(d==="self"?s:d)})),s.contains.forEach(function(d){a(d,u)}),s.starts&&a(s.starts,l),u.matcher=o(u),u}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=rd(e.classNameAliases||{}),a(e)}function fj(e){return e?e.endsWithParent||fj(e.starts):!1}function Dbe(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return rd(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:fj(e)?rd(e,{starts:e.starts?rd(e.starts):null}):Object.isFrozen(e)?rd(e):e}var Lbe="11.6.0";class Nbe extends Error{constructor(t,r){super(t),this.name="HTMLInjectionError",this.html=r}}const q5=nj,fM=rd,pM=Symbol("nomatch"),jbe=7,$be=function(e){const t=Object.create(null),r=Object.create(null),i=[];let o=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Z1e};function u(le){return l.noHighlightRe.test(le)}function c(le){let pe=le.className+" ";pe+=le.parentNode?le.parentNode.className:"";const _e=l.languageDetectRe.exec(pe);if(_e){const J=W(_e[1]);return J||(dM(a.replace("{}",_e[1])),dM("Falling back to no-highlight mode for this block.",le)),J?_e[1]:"no-highlight"}return pe.split(/\s+/).find(J=>u(J)||W(J))}function d(le,pe,_e){let J="",ft="";typeof pe=="object"?(J=le,_e=pe.ignoreIllegals,ft=pe.language):(jp("10.7.0","highlight(lang, code, ...args) has been deprecated."),jp("10.7.0",`Please use highlight(code, options) instead.
https://github.com/highlightjs/highlight.js/issues/2277`),ft=le,J=pe),_e===void 0&&(_e=!0);const Le={code:J,language:ft};P("before:highlight",Le);const He=Le.result?Le.result:p(Le.language,Le.code,_e);return He.code=Le.code,P("after:highlight",He),He}function p(le,pe,_e,J){const ft=Object.create(null);function Le(ie,de){return ie.keywords[de]}function He(){if(!Ie.keywords){fe.addText(Be);return}let ie=0;Ie.keywordPatternRe.lastIndex=0;let de=Ie.keywordPatternRe.exec(Be),$="";for(;de;){$+=Be.substring(ie,de.index);const C=ne.case_insensitive?de[0].toLowerCase():de[0],T=Le(Ie,C);if(T){const[Q,ve]=T;if(fe.addText($),$="",ft[C]=(ft[C]||0)+1,ft[C]<=jbe&&(rt+=ve),Q.startsWith("_"))$+=de[0];else{const je=ne.classNameAliases[Q]||Q;fe.addKeyword(de[0],je)}}else $+=de[0];ie=Ie.keywordPatternRe.lastIndex,de=Ie.keywordPatternRe.exec(Be)}$+=Be.substring(ie),fe.addText($)}function nr(){if(Be==="")return;let ie=null;if(typeof Ie.subLanguage=="string"){if(!t[Ie.subLanguage]){fe.addText(Be);return}ie=p(Ie.subLanguage,Be,!0,Ae[Ie.subLanguage]),Ae[Ie.subLanguage]=ie._top}else ie=x(Be,Ie.subLanguage.length?Ie.subLanguage:null);Ie.relevance>0&&(rt+=ie.relevance),fe.addSublanguage(ie._emitter,ie.language)}function Bt(){Ie.subLanguage!=null?nr():He(),Be=""}function Rt(ie,de){let $=1;const C=de.length-1;for(;$<=C;){if(!ie._emit[$]){$++;continue}const T=ne.classNameAliases[ie[$]]||ie[$],Q=de[$];T?fe.addKeyword(Q,T):(Be=Q,He(),Be=""),$++}}function Jt(ie,de){return ie.scope&&typeof ie.scope=="string"&&fe.openNode(ne.classNameAliases[ie.scope]||ie.scope),ie.beginScope&&(ie.beginScope._wrap?(fe.addKeyword(Be,ne.classNameAliases[ie.beginScope._wrap]||ie.beginScope._wrap),Be=""):ie.beginScope._multi&&(Rt(ie.beginScope,de),Be="")),Ie=Object.create(ie,{parent:{value:Ie}}),Ie}function vr(ie,de,$){let C=tbe(ie.endRe,$);if(C){if(ie["on:end"]){const T=new sM(ie);ie["on:end"](de,T),T.isMatchIgnored&&(C=!1)}if(C){for(;ie.endsParent&&ie.parent;)ie=ie.parent;return ie}}if(ie.endsWithParent)return vr(ie.parent,de,$)}function At(ie){return Ie.matcher.regexIndex===0?(Be+=ie[0],1):(ce=!0,0)}function kt(ie){const de=ie[0],$=ie.rule,C=new sM($),T=[$.__beforeBegin,$["on:begin"]];for(const Q of T)if(!!Q&&(Q(ie,C),C.isMatchIgnored))return At(de);return $.skip?Be+=de:($.excludeBegin&&(Be+=de),Bt(),!$.returnBegin&&!$.excludeBegin&&(Be=de)),Jt($,ie),$.returnBegin?0:de.length}function Ct(ie){const de=ie[0],$=pe.substring(ie.index),C=vr(Ie,ie,$);if(!C)return pM;const T=Ie;Ie.endScope&&Ie.endScope._wrap?(Bt(),fe.addKeyword(de,Ie.endScope._wrap)):Ie.endScope&&Ie.endScope._multi?(Bt(),Rt(Ie.endScope,ie)):T.skip?Be+=de:(T.returnEnd||T.excludeEnd||(Be+=de),Bt(),T.excludeEnd&&(Be=de));do Ie.scope&&fe.closeNode(),!Ie.skip&&!Ie.subLanguage&&(rt+=Ie.relevance),Ie=Ie.parent;while(Ie!==C.parent);return C.starts&&Jt(C.starts,ie),T.returnEnd?0:de.length}function Lt(){const ie=[];for(let de=Ie;de!==ne;de=de.parent)de.scope&&ie.unshift(de.scope);ie.forEach(de=>fe.openNode(de))}let Kt={};function yr(ie,de){const $=de&&de[0];if(Be+=ie,$==null)return Bt(),0;if(Kt.type==="begin"&&de.type==="end"&&Kt.index===de.index&&$===""){if(Be+=pe.slice(de.index,de.index+1),!o){const C=new Error(`0 width match regex (${le})`);throw C.languageName=le,C.badRule=Kt.rule,C}return 1}if(Kt=de,de.type==="begin")return kt(de);if(de.type==="illegal"&&!_e){const C=new Error('Illegal lexeme "'+$+'" for mode "'+(Ie.scope||"")+'"');throw C.mode=Ie,C}else if(de.type==="end"){const C=Ct(de);if(C!==pM)return C}if(de.type==="illegal"&&$==="")return 1;if(jt>1e5&&jt>de.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Be+=$,$.length}const ne=W(le);if(!ne)throw Af(a.replace("{}",le)),new Error('Unknown language: "'+le+'"');const Mt=Ube(ne);let Nt="",Ie=J||Mt;const Ae={},fe=new l.__emitter(l);Lt();let Be="",rt=0,lt=0,jt=0,ce=!1;try{for(Ie.matcher.considerAll();;){jt++,ce?ce=!1:Ie.matcher.considerAll(),Ie.matcher.lastIndex=lt;const ie=Ie.matcher.exec(pe);if(!ie)break;const de=pe.substring(lt,ie.index),$=yr(de,ie);lt=ie.index+$}return yr(pe.substring(lt)),fe.closeAllNodes(),fe.finalize(),Nt=fe.toHTML(),{language:le,value:Nt,relevance:rt,illegal:!1,_emitter:fe,_top:Ie}}catch(ie){if(ie.message&&ie.message.includes("Illegal"))return{language:le,value:q5(pe),illegal:!0,relevance:0,_illegalBy:{message:ie.message,index:lt,context:pe.slice(lt-100,lt+100),mode:ie.mode,resultSoFar:Nt},_emitter:fe};if(o)return{language:le,value:q5(pe),illegal:!1,relevance:0,errorRaised:ie,_emitter:fe,_top:Ie};throw ie}}function v(le){const pe={value:q5(le),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return pe._emitter.addText(le),pe}function x(le,pe){pe=pe||l.languages||Object.keys(t);const _e=v(le),J=pe.filter(W).filter(ae).map(Bt=>p(Bt,le,!1));J.unshift(_e);const ft=J.sort((Bt,Rt)=>{if(Bt.relevance!==Rt.relevance)return Rt.relevance-Bt.relevance;if(Bt.language&&Rt.language){if(W(Bt.language).supersetOf===Rt.language)return 1;if(W(Rt.language).supersetOf===Bt.language)return-1}return 0}),[Le,He]=ft,nr=Le;return nr.secondBest=He,nr}function b(le,pe,_e){const J=pe&&r[pe]||_e;le.classList.add("hljs"),le.classList.add(`language-${J}`)}function y(le){let pe=null;const _e=c(le);if(u(_e))return;if(P("before:highlightElement",{el:le,language:_e}),le.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(le)),l.throwUnescapedHTML))throw new Nbe("One of your code blocks includes unescaped HTML.",le.innerHTML);pe=le;const J=pe.textContent,ft=_e?d(J,{language:_e,ignoreIllegals:!0}):x(J);le.innerHTML=ft.value,b(le,_e,ft.language),le.result={language:ft.language,re:ft.relevance,relevance:ft.relevance},ft.secondBest&&(le.secondBest={language:ft.secondBest.language,relevance:ft.secondBest.relevance}),P("after:highlightElement",{el:le,result:ft,text:J})}function _(le){l=fM(l,le)}const k=()=>{U(),jp("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function E(){U(),jp("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let B=!1;function U(){if(document.readyState==="loading"){B=!0;return}document.querySelectorAll(l.cssSelector).forEach(y)}function D(){B&&U()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",D,!1);function j(le,pe){let _e=null;try{_e=pe(e)}catch(J){if(Af("Language definition for '{}' could not be registered.".replace("{}",le)),o)Af(J);else throw J;_e=s}_e.name||(_e.name=le),t[le]=_e,_e.rawDefinition=pe.bind(null,e),_e.aliases&&G(_e.aliases,{languageName:le})}function F(le){delete t[le];for(const pe of Object.keys(r))r[pe]===le&&delete r[pe]}function H(){return Object.keys(t)}function W(le){return le=(le||"").toLowerCase(),t[le]||t[r[le]]}function G(le,{languageName:pe}){typeof le=="string"&&(le=[le]),le.forEach(_e=>{r[_e.toLowerCase()]=pe})}function ae(le){const pe=W(le);return pe&&!pe.disableAutodetect}function V(le){le["before:highlightBlock"]&&!le["before:highlightElement"]&&(le["before:highlightElement"]=pe=>{le["before:highlightBlock"](Object.assign({block:pe.el},pe))}),le["after:highlightBlock"]&&!le["after:highlightElement"]&&(le["after:highlightElement"]=pe=>{le["after:highlightBlock"](Object.assign({block:pe.el},pe))})}function oe(le){V(le),i.push(le)}function P(le,pe){const _e=le;i.forEach(function(J){J[_e]&&J[_e](pe)})}function ee(le){return jp("10.7.0","highlightBlock will be removed entirely in v12.0"),jp("10.7.0","Please use highlightElement now."),y(le)}Object.assign(e,{highlight:d,highlightAuto:x,highlightAll:U,highlightElement:y,highlightBlock:ee,configure:_,initHighlighting:k,initHighlightingOnLoad:E,registerLanguage:j,unregisterLanguage:F,listLanguages:H,getLanguage:W,registerAliases:G,autoDetection:ae,inherit:fM,addPlugin:oe}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Lbe,e.regex={concat:bp,lookahead:ij,either:yE,optional:J1e,anyNumberOfTimes:X1e};for(const le in jv)typeof jv[le]=="object"&&hE.exports(jv[le]);return Object.assign(e,jv),e};var ey=$be({}),Fbe=ey;ey.HighlightJS=ey;ey.default=ey;const pj=Fbe,hM='(?!")(`([^`]+)`|((?=_)_|(?=\\{)\\{|(?=\\})\\}|(?![_`{}]))([^;,\\[\\]\\(\\)\\s~.]+))',gM=/\"[^\n\"]+\"[Hhcusa]?/;let y4;try{y4=new RegExp("(-?(?!_)([\\d_]+|0x[\\d_a-fA-F]+)|0b[1_0]+)(?=/,/<=/,/=/,/>/,/,/\^/)},{scope:"number",match:/([0-9]+)(.[0-9]+)?(.[0-9]+)?/}]},{scope:"keyword",begin:/#include/,end:/;/,contains:[{scope:"string",match:gM}]},{scope:"number",match:y4},{scope:"string",match:gM},{match:[/\b(const|global)\b/,/\s+/,/\w+/,/\s+/,hM],scope:{1:"keyword",5:"variable.constant"}},{scope:"function",match:new RegExp(hM+"(?=[(])")},{scope:"operator",match:e.regex.either(/<=>/,/>=/,/<=/,/!=/,/==/,/\^>>/,/~>>/,/>>/,/<,/\/%/,/\^%/,/~%/,/\^\//,/~\//,/\+=/,/-=/,/\*=/,/\/=/,/~\/=/,/\^\/=/,/%=/,/\^%=/,/<<=/,/>>=/,/~>>=/,/\^>>=/,/&=/,/\^=/,/\|=/,/\^/,/=/,/~/,/\//,/%/,/-/,/\*/,/\+/,/>/,/,/&/,/\|/,/:/,/\?/)},{scope:"punctuation",match:/[\.;\(\),\[\]~\{\}]/}]}}const K5=/[0-9A-Za-z$_-]+/,mM=/(::_|::|:_|=:|:)/;function Hbe(e){return{name:"Fift",aliases:["fift"],case_insensitive:!1,keywords:{keyword:["-roll","-rot|10","-trailing","-trailing0","2constant|10","2drop|10","2dup|10","2over|10","2swap|10","abort","abs","allot","and","anon","atom","bbitrefs","bbits","bl","box","brefs","brembitrefs","brembits","bremrefs","bye","cadr","caddr","car","cddr","cdr","char","chr","cmp","cond","cons","constant","count","cr","create","drop","depth","dictmap","dictmerge","dictnew","does","drop","dup","ed25519_chksign","ed25519_sign","ed25519_sign_uint","emit","exch","exch2|10","execute","explode","find","first","fits","forget","gasrunvm","gasrunvmcode","gasrunvmctx","gasrunvmdict","halt","hash","hashB","hashu","hold","hole","if","ifnot","include","list","minmax","max","min","mod","negate","newkeypair","nil","nip","nop","not","now","null","or","over","pair","pick","quit","remaining","reverse","roll","rot","runvm","runvmcode","runvmctx","runvmdict","sbitrefs","sbits","second","sgn","sign","shash","space","swap","single","skipspc","srefs","ten","third","times","triple","tuck","tuple","type","ufits","uncons","unpair","unsingle","until","untriple","untuple","variable","while","word","words","xor"],literal:["true","false"],type:[],built_in:[]},contains:[{scope:"comment",variants:[e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE],relevance:0},{match:[/\s/,/2?constant/,/\s+/,K5],scope:{2:"keyword",4:"variable.constant"}},{match:[/\s/,/variable/,/\s+/,K5],scope:{2:"keyword",4:"variable"}},{match:[/}/,/\s+/,mM,/\s+/,K5],scope:{1:"punctuation",3:"operator",5:"function"}},{scope:"operator",match:e.regex.either(/!/,/#>/,/#s/,/\$#/,/#/,/\$\+/,/\$,/,/\$\d/,/\$=/,/\$(?=\()/,/\$>smca/,/\$>s/,/\$@\+/,/\$@\?\+/,/\$@\?/,/\$@/,/\$cmp/,/\$len/,/\$pos/,/\$reverse/,/%1<,/\('\)/,/\(-trailing\)/,/\(\.\)/,/\(atom\)/,/\(b\.\)/,/\(compile\)/,/\(create\)/,/\(def\?\)/,/\(dump\)/,/\(execute\)/,/\(forget\)/,/\(number\)/,/\(x\.\)/,/\(\{\)/,/\(\}\)/,/\*\/cmod/,/\*\/c/,/\*\/mod/,/\*\/rmod/,/\*\/r/,/\*\//,/\*>>c/,/\*>>r/,/\*>>/,/\*mod/,/\*/,/\+!/,/\+/,/,/,/-!/,/-/,/-1<,/\._/,/\.dump/,/\.l/,/\.sl/,/\.s/,/\.tc/,/\//,/\/\*/,/\/cmod/,/\/c/,/\/mod/,/\/rmod/,/\/r/,/0!/,/0<=/,/0<>/,/0,/0=/,/0>=/,/0>/,/1\+!/,/1\+/,/1-!/,/1-/,/1<,/1<<1-/,/2\*/,/2\+/,/2-/,/2\//,/2=:/,mM,/<#/,/<<\/c/,/<<\/r/,/<=/,/<>/,/=/,/>>c/,/>>r/,/>>/,/>/,/\?dup/,/@'/,/@/,/B\+/,/B,/,/B=/,/B>Li@\+/,/B>Li@/,/B>Lu@\+/,/B>Lu@/,/B>boc/,/B>file/,/B>i@\+/,/B>i@/,/B>u@\+/,/B>u@/,/B@\?\+/,/B@\+/,/B@\?/,/B@/,/Bcmp/,/BhashB/,/Bhashu/,/Bhash/,/Blen/,/Bx\./,/B\|/,/Li>B/,/Lu>B/,/\[\]/,/\[compile\]/,/\[/,/\]/,/atom\?/,/b\+/,/b\._/,/b\./,/b>idict!\+/,/b>idict!/,/b>sdict!\+/,/b>sdict!/,/b>udict!\+/,/b>udict!/,/b>/,/boc+>B/,/boc>B/,/csr\./,/def\?/,/empty\?/,/eq\?/,/file-exists\?/,/file>B/,/i,/,/i>B/,/i@\+/,/i@/,/i@\?\+/,/i@\?/,/idict!\+/,/idict!/,/idict-/,/idict@-/,/idict@/,/null!/,/null\?/,/pfxdict!\+/,/pfxdict!/,/pfxdict@/,/priv>pub/,/ref@\+/,/ref@/,/ref@\?\+/,/ref@\?/,/s,/,/s>c/,/s>/,/sdict!\+/,/sdict!/,/sdict-/,/sdict@-/,/sdict@/,/smca>\$/,/sr,/,/tuple\?/,/u,/,/u>B/,/u@\+/,/u@\?\+/,/u@\?/,/udict!\+/,/udict!/,/udict-/,/udict@-/,/udict@/,/undef\?/,/x\._/,/x\./,/\|\+/,/\|/,/\|_/,new RegExp("(?<=\\s)\\.(?=\\s)"))},{scope:"number",match:e.regex.either(/(0[xX][0-9a-fA-F]+)/,/(0[bB][01]+)/,/(-?[0-9]+(\/-?[0-9]+)?)/)},{scope:"string",match:/"([^"\r\n\\]|\\.)*"/},{scope:"symbol",match:/[xX]\{[0-9a-fA-F_]*}/,relevance:10},{scope:"symbol",match:/[bB]\{[01]*}/,relevance:10},{scope:"symbol",match:/'[^\s]+/},{scope:"punctuation",match:/[\[\{\}\],]/}]}}const yM=/[a-zA-Z_][0-9a-zA-Z_]*/;function Wbe(e){return{name:"TL-B",aliases:["Tlb","tlb","TLB","tl-b","TL-b","Tl-B","Tl-b"],case_insensitive:!1,keywords:{keyword:[],literal:["True","BoolTrue","False","BoolFalse","Null"],type:["Type","Bool","Unit","Maybe","Either","Both","Cell","uint8","uint15","uint16","uint32","uint63","uint64","int8","int16","int32","int64","bits256","bits512"],built_in:[]},contains:[{scope:"comment",variants:[e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},{scope:"symbol",match:e.regex.either(/#[0-9a-f]*_?/,/\$[01]*_?/,/##/,/#<=/,/#)},{match:[/=/,/\s+/,yM,/[\s;]/],scope:{1:"operator",3:"type"}},{scope:"variable",match:yM},{scope:"operator",match:e.regex.either(/\+/,/-/,/\*/,/\//,/!=/,/==/,/=/,/\?/,/~/,/\./,/\^/,/<=/,/>=/,/,/>/)},{scope:"number",match:/[0-9]+/},{scope:"punctuation",match:/[;\(\):\[\]\{\}]/}]}}function Vbe(e){e.registerLanguage("fift",Hbe),e.registerLanguage("func",zbe),e.registerLanguage("tlb",Wbe)}Vbe(pj);function qbe({button:e}){const{data:t}=vp(),r=la(),i=aa(r.breakpoints.down("lg")),o=X.exports.useRef(null);return X.exports.useEffect(()=>{pj.highlightElement(o.current)},[t?.decompiled,o.current]),Ut("pre",{style:{overflow:"auto",height:800,marginTop:0,lineHeight:"25px",fontSize:14,paddingTop:"0.5em",fontFamily:"monospace"},children:[Ut("code",{className:"language-fift",style:{background:"#fff",display:"flex"},children:[L("div",{style:{textAlign:"right",color:"#728a96",paddingLeft:i?0:20},children:t?.decompiled?.trim().split(`
`).map((a,s)=>s+1).join(`
-`)}),L("div",{style:{background:"transparent",paddingLeft:20},ref:o,children:t?.decompiled})]}),e]})}const Kbe="/assets/verified-light.2c74da9f.svg",Gbe="/assets/download.62d50798.svg",Wx="/assets/copy.da496d78.svg";var hj={exports:{}};/*!
+`)}),L("div",{style:{background:"transparent",paddingLeft:20},ref:o,children:t?.decompiled})]}),e]})}const Kbe="/verifier/assets/verified-light.2c74da9f.svg",Gbe="/verifier/assets/download.62d50798.svg",Wx="/verifier/assets/copy.da496d78.svg";var hj={exports:{}};/*!
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
@@ -1227,7 +1227,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
`)[0];let Un,xo=$i.match(Fn)[0];switch(ii){case 2:Un=new RangeError(`Bad node name '${xo}'`);break;case 3:Un=new RangeError(`Bad field name '${xo}'`);break;case 4:Un=new RangeError(`Bad capture name @${xo}`);break;case 5:Un=new TypeError(`Bad pattern structure at offset ${Oi}: '${$i}'...`),xo="";break;default:Un=new SyntaxError(`Bad syntax at offset ${Oi}: '${$i}'...`),xo=""}throw Un.index=Oi,Un.length=xo.length,ir._free(Ht),Un}const kr=ir._ts_query_string_count(or),$r=ir._ts_query_capture_count(or),Vr=ir._ts_query_pattern_count(or),dn=new Array($r),yi=new Array(kr);for(let ii=0;ii<$r;ii++){const Oi=ir._ts_query_capture_name_for_id(or,ii,cn),$i=J(cn,"i32");dn[ii]=Kt(Oi,$i)}for(let ii=0;ii0){if(Un[0].type!=="string")throw new Error("Predicates must begin with a literal value");const Kd=Un[0].value;let Mc=!0;switch(Kd){case"not-eq?":Mc=!1;case"eq?":if(Un.length!==3)throw new Error(`Wrong number of arguments to \`#eq?\` predicate. Expected 2, got ${Un.length-1}`);if(Un[1].type!=="capture")throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${Un[1].value}"`);if(Un[2].type==="capture"){const Ml=Un[1].name,Vu=Un[2].name;Aa[ii].push(function(xp){let qu,Bg;for(const _p of xp)_p.name===Ml&&(qu=_p.node),_p.name===Vu&&(Bg=_p.node);return qu===void 0||Bg===void 0||qu.text===Bg.text===Mc})}else{const Ml=Un[1].name,Vu=Un[2].value;Aa[ii].push(function(xp){for(const qu of xp)if(qu.name===Ml)return qu.node.text===Vu===Mc;return!0})}break;case"not-match?":Mc=!1;case"match?":if(Un.length!==3)throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${Un.length-1}.`);if(Un[1].type!=="capture")throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${Un[1].value}".`);if(Un[2].type!=="string")throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${Un[2].value}.`);const qy=Un[1].name,Xx=new RegExp(Un[2].value);Aa[ii].push(function(Ml){for(const Vu of Ml)if(Vu.name===qy)return Xx.test(Vu.node.text)===Mc;return!0});break;case"set!":if(Un.length<2||Un.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${Un.length-1}.`);if(Un.some(Ml=>Ml.type!=="string"))throw new Error('Arguments to `#set!` predicate must be a strings.".');qn[ii]||(qn[ii]={}),qn[ii][Un[1].value]=Un[2]?Un[2].value:null;break;case"is?":case"is-not?":if(Un.length<2||Un.length>3)throw new Error(`Wrong number of arguments to \`#${Kd}\` predicate. Expected 1 or 2. Got ${Un.length-1}.`);if(Un.some(Ml=>Ml.type!=="string"))throw new Error(`Arguments to \`#${Kd}\` predicate must be a strings.".`);const wp=Kd==="is?"?wi:so;wp[ii]||(wp[ii]={}),wp[ii][Un[1].value]=Un[2]?Un[2].value:null;break;default:Ko[ii].push({operator:Kd,operands:Un.slice(1)})}Un.length=0}}Object.freeze(qn[ii]),Object.freeze(wi[ii]),Object.freeze(so[ii])}return ir._free(Ht),new bo(gr,or,dn,Aa,Ko,Object.freeze(qn),Object.freeze(wi),Object.freeze(so))}static load(ke){let Ze;if(ke instanceof Uint8Array)Ze=Promise.resolve(ke);else{const or=ke;if(typeof process<"u"&&process.versions&&process.versions.node){const kr=Nm;Ze=Promise.resolve(kr.readFileSync(or))}else Ze=fetch(or).then(kr=>kr.arrayBuffer().then($r=>{if(kr.ok)return new Uint8Array($r);{const Vr=new TextDecoder("utf-8").decode($r);throw new Error(`Language.load failed with status ${kr.status}.
${Vr}`)}}))}const Ht=typeof loadSideModule=="function"?loadSideModule:Wi;return Ze.then(or=>Ht(or,{loadAsync:!0})).then(or=>{const kr=Object.keys(or),$r=kr.find(dn=>si.test(dn)&&!dn.includes("external_scanner_"));$r||console.log(`Couldn't find language function in WASM file. Symbols:
-${JSON.stringify(kr,null,2)}`);const Vr=or[$r]();return new Li(gr,Vr)})}}class bo{constructor(ke,Ze,Ht,or,kr,$r,Vr,dn){To(ke),this[0]=Ze,this.captureNames=Ht,this.textPredicates=or,this.predicates=kr,this.setProperties=$r,this.assertedProperties=Vr,this.refutedProperties=dn,this.exceededMatchLimit=!1}delete(){ir._ts_query_delete(this[0]),this[0]=0}matches(ke,Ze,Ht,or){Ze||(Ze=Wr),Ht||(Ht=Wr),or||(or={});let kr=or.matchLimit;if(kr===void 0)kr=0;else if(typeof kr!="number")throw new Error("Arguments must be numbers");Qn(ke),ir._ts_query_matches_wasm(this[0],ke.tree[0],Ze.row,Ze.column,Ht.row,Ht.column,kr);const $r=J(cn,"i32"),Vr=J(cn+Gt,"i32"),dn=J(cn+2*Gt,"i32"),yi=new Array($r);this.exceededMatchLimit=!!dn;let qn=0,wi=Vr;for(let so=0;so<$r;so++){const Ko=J(wi,"i32"),Aa=J(wi+=Gt,"i32");wi+=Gt;const ii=new Array(Aa);if(wi=$o(this,ke.tree,wi,ii),this.textPredicates[Ko].every(Oi=>Oi(ii))){yi[qn++]={pattern:Ko,captures:ii};const Oi=this.setProperties[Ko];Oi&&(yi[so].setProperties=Oi);const $i=this.assertedProperties[Ko];$i&&(yi[so].assertedProperties=$i);const Un=this.refutedProperties[Ko];Un&&(yi[so].refutedProperties=Un)}}return yi.length=qn,ir._free(Vr),yi}captures(ke,Ze,Ht,or){Ze||(Ze=Wr),Ht||(Ht=Wr),or||(or={});let kr=or.matchLimit;if(kr===void 0)kr=0;else if(typeof kr!="number")throw new Error("Arguments must be numbers");Qn(ke),ir._ts_query_captures_wasm(this[0],ke.tree[0],Ze.row,Ze.column,Ht.row,Ht.column,kr);const $r=J(cn,"i32"),Vr=J(cn+Gt,"i32"),dn=J(cn+2*Gt,"i32"),yi=[];this.exceededMatchLimit=!!dn;const qn=[];let wi=Vr;for(let so=0;so<$r;so++){const Ko=J(wi,"i32"),Aa=J(wi+=Gt,"i32"),ii=J(wi+=Gt,"i32");if(wi+=Gt,qn.length=Aa,wi=$o(this,ke.tree,wi,qn),this.textPredicates[Ko].every(Oi=>Oi(qn))){const Oi=qn[ii],$i=this.setProperties[Ko];$i&&(Oi.setProperties=$i);const Un=this.assertedProperties[Ko];Un&&(Oi.assertedProperties=Un);const xo=this.refutedProperties[Ko];xo&&(Oi.refutedProperties=xo),yi.push(Oi)}}return ir._free(Vr),yi}predicatesForPattern(ke){return this.predicates[ke]}didExceedMatchLimit(){return this.exceededMatchLimit}}function wo(Ge,ke,Ze){const Ht=Ze-ke;let or=Ge.textCallback(ke,null,Ze);for(ke+=or.length;ke0))break;ke+=kr.length,or+=kr}return ke>Ze&&(or=or.slice(0,Ht)),or}function $o(Ge,ke,Ze,Ht){for(let or=0,kr=Ht.length;or{Ai.init(),c()}}))}}return s}();e.exports=i})(wj);const v4=wj.exports,xj=()=>(()=>{try{if(typeof WebAssembly=="object"&&typeof WebAssembly.instantiate=="function"){const e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e)instanceof WebAssembly.Instance}}catch{}return!1})(),nwe=()=>window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1";let b4;const iwe=async(e,t)=>{if(b4)return;const r={locateFile(){return e}};await v4.init(r),b4=await v4.Language.load(t)},owe=()=>{const e=new v4;return e.setLanguage(b4),e.setTimeoutMicros(1e3*1e3),e};async function awe(e){return xj()?(wa(ha.GETTER_PARSE_START),await iwe("./tree-sitter.wasm","./tree-sitter-func.wasm"),owe().parse(e).rootNode.children.filter(a=>a.type==="function_definition"&&a.children.find(s=>s.type==="specifiers_list")?.text.includes("method_id")).map(a=>{const s=a.children[0].children.filter(c=>!c.type.match(/[,()]/)).map(c=>c.text),l=a.children.find(c=>c.type==="function_name").text,u=a.children.find(c=>c.type==="parameter_list").children.filter(c=>c.type==="parameter_declaration").map(c=>({type:c.child(0).text,name:c.child(1).text}));return{returnTypes:s,name:l,parameters:u}})):[]}const swe=_g($x((e,t)=>({name:"",setName:r=>{e(i=>{i.name=r})},parameters:[],addParameter:()=>{e(r=>{const i=Math.random();r.parameters.push({name:"",_id:i,possibleTypes:["int","slice","address"],selectedTypeIdx:0,setValue:o=>r.parameters.find(a=>a._id===i).value=o,setName:o=>{e(a=>{a.parameters.find(s=>s._id===i).name=o})},toggleNextType:()=>{e(o=>{const a=o.parameters.find(s=>s._id===i);a.selectedTypeIdx=(a.selectedTypeIdx+1)%a.possibleTypes.length})},type:()=>{const o=t().parameters.find(a=>a._id===i);return o.possibleTypes[o.selectedTypeIdx]},originalType:()=>t().parameters.find(a=>a._id===i).possibleTypes[0],value:""})})},returnTypes:[],removeParameter:()=>{e(r=>{r.parameters.pop()})},clear:()=>{e(r=>{r.name="",r.parameters=[]})}})));function _j(){return swe()}const $v=(e,t,r)=>e.find(i=>i.name===t).parameters.find(i=>i.name===r),Sj=_g($x((e,t)=>({getters:[],setGetters:r=>{e(i=>{const o=r.map(a=>({name:a.name,parameters:a.parameters.map(s=>{const l=[s.type];return["cell","slice"].includes(s.type)&&l.push("address"),{name:s.name,value:"",possibleTypes:l,selectedTypeIdx:0,toggleNextType:()=>{e(u=>{const c=$v(u.getters,a.name,s.name);c.selectedTypeIdx=(c.selectedTypeIdx+1)%c.possibleTypes.length})},type:()=>{const u=$v(t().getters,a.name,s.name);return u.possibleTypes[u.selectedTypeIdx]},originalType:()=>$v(t().getters,a.name,s.name).possibleTypes[0],setValue:u=>{e(c=>{const d=$v(c.getters,a.name,s.name);d.value=u})}}}),returnTypes:a.returnTypes}));i.getters=o})}})));function xE(){const{getters:e}=Sj();return{getters:e}}function lwe(){const{data:e}=Pc(),{setGetters:t}=Sj(),{clear:r}=_j(),{contractAddress:i}=$u();X.exports.useEffect(()=>{t([]),r()},[i]),X.exports.useEffect(()=>{(async()=>{const o=[];for(const a of e?.files??[])!a.name.match(/\.(fc|func)/)||o.push(...await awe(a.content));t(o),r()})()},[e?.files])}function uwe(e=[]){const t=new Vn.TupleBuilder;return e.forEach(r=>{if(r instanceof Vn.Cell)t.writeSlice(r);else if(typeof r=="bigint")t.writeNumber(r);else throw new Error("unknown type!")}),t.build()}function cwe(e){const t=[];for(;e.remaining;){const r=e.pop();switch(r.type){case"int":{t.push(r.value);break}case"cell":{t.push(r.cell);break}case"tuple":{if(r.items.length===0)t.push(null);else throw new Error("list parsing not supported");break}default:throw new Error(`unknown type: ${r.type}`)}}return t}async function dwe(e,t,r,i,o){const{stack:a}=await o.runMethod(e,t,uwe(r));return i(cwe(a))}function Cj(e){const{contractAddress:t}=$u(),{getters:r}=xE();return hU([t,"getter",e.name],async()=>{const i=await yp();return!t||!r?void 0:(wa(ha.RUN_GETTER),dwe(Vn.Address.parse(t),e.name,e.parameters.map(a=>{switch(a.possibleTypes[a.selectedTypeIdx]){case"int":return BigInt(a.value);case"address":return Vn.beginCell().storeAddress(Vn.Address.parse(a.value)).endCell();default:return Vn.Cell.fromBoc(Buffer.from(a.value,"base64"))[0]}}),a=>a.map(s=>{const l=[];if(s instanceof Vn.Cell){try{s.beginParse().remainingBits===267&&l.push({type:"address",value:s.beginParse().loadAddress().toString()})}catch{}l.push({type:"base64",value:s.toBoc().toString("base64")}),l.push({type:"boc",value:s.toString()})}else typeof s=="bigint"?(l.push({type:"int",value:s.toString()}),l.push({type:"coins",value:Vn.fromNano(s)}),l.push({type:"hex",value:s.toString(16)}),l.push({type:"base64",value:Buffer.from(s.toString(16),"hex").toString("base64")})):l.push({type:"raw",value:String(s)});return l}),i))})}var ps=(e=>(e.ERROR="Error",e.HINT="Hint",e.SUCCESS="Success",e.INFO="Info",e))(ps||{});const fwe=Xi(da)(e=>({padding:`${e.singleLine?0:15}px 25px`,marginBottom:e.noBottomMargin?0:24,marginTop:e.noTopMargin?0:24,background:e.backgroundColor||"",border:`1px solid ${e.borderColor||"#D8D8D8"}`,borderRadius:12}));function Cs({title:e,type:t,notificationBody:r,singleLine:i,noBottomMargin:o,noTopMargin:a}){let s,l;switch(t){case"Info":l="rgba(216, 216, 216, 0.2);";break;case"Error":s="rgba(252, 86, 86, 0.42);",l="rgba(252, 86, 86, 0.08);";break;case"Hint":l="rgba(94, 117, 232, 0.1);";break;case"Success":l="#D6FFCE";break}return Ut(fwe,{singleLine:i,borderColor:s,backgroundColor:l,noBottomMargin:o,noTopMargin:a,children:[e,r]})}function pwe({parameter:e}){return Ut(Cc,{sx:{gap:1},children:[Ut(Cc,{sx:{gap:.5,flexDirection:"row"},children:[L(kn,{children:e.name}),L(bj,{sx:{cursor:e.possibleTypes.length>1?"pointer":"inherit"},onClick:()=>{e.toggleNextType()},children:e.type()})]}),L(twe,{onChange:t=>{e.setValue(t.target.value)}})]})}function kj({getter:e}){return Ut(kn,{children:[L(kn,{sx:{mb:1},children:L("b",{children:"Request"})}),Ut(Cc,{sx:{gap:2},children:[e.parameters.map((t,r)=>L(pwe,{parameter:t},t.name)),(e.parameters.length??0)===0&&L(kn,{sx:{color:"#949597"},children:"(No params)"})]})]})}function hwe({value:e}){const[t,r]=X.exports.useState(0);return{onClick:()=>{r((t+1)%e.length)},type:e[t]?.type??"unknown",value:e[t].value}}function gwe({type:e,value:t}){const{type:r,value:i,onClick:o}=hwe({value:t}),{showNotification:a}=Ry();return Ut(xc,{sx:{gap:1,cursor:t.length>1?"pointer":"initial"},onClick:o,children:[L(G5,{children:L(bj,{children:r})}),L(G5,{width:"100%",children:L(ewe,{children:i})}),L(G5,{children:L(Bs,{sx:{padding:0,opacity:.8},onClick:s=>{s.stopPropagation(),navigator.clipboard.writeText(i),a("Copied to clipboard!","success")},children:L("img",{src:Wx,alt:"Copy icon",width:15,height:15})})})]})}function Ej({returnTypes:e,values:t,isLoading:r}){return Ut(ta,{children:[(t.length>0||r)&&L(kn,{children:L("b",{children:"Response"})}),t.length>0&&L(Cc,{sx:{gap:1.5},children:L(L6,{children:L(N6,{children:t.map((i,o)=>L(gwe,{type:e[o],value:i}))})})}),t.length===0&&r&&L(Cc,{sx:{gap:1},children:e.map(i=>L(Xa,{variant:"rounded",height:20}))})]})}function mwe({getter:e}){const{data:t,isLoading:r,mutate:i,error:o}=Cj(e);return Ut(mj,{children:[Ut(yj,{children:[Ut(kn,{sx:{flexGrow:1},children:[Ut(Xbe,{children:[e.name,"(",e.parameters.map(a=>a.originalType()).join(", "),")"]}),Ut(Jbe,{children:[L("b",{children:"returns"})," ",e.returnTypes.join(", ")]})]}),L(kn,{children:L(Ha,{fontSize:12,fontWeight:800,textColor:"#fff",height:32,width:60,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{i()},children:"Run"})})]}),Ut(vj,{sx:{padding:"10px 20px",gap:2},children:[L(kj,{getter:e}),L(Ej,{returnTypes:e.returnTypes,values:t??[],isLoading:r}),!!o&&L(Cs,{noBottomMargin:!0,noTopMargin:!0,title:L(kn,{children:o.toString()}),type:ps.ERROR,notificationBody:L(kn,{})})]})]})}function ywe({getter:e}){const{data:t,isLoading:r,mutate:i,error:o}=Cj(e);return Ut(mj,{children:[Ut(yj,{children:[L(kn,{sx:{flexGrow:1},children:L(rwe,{value:e.name,placeholder:"Get method name",onChange:a=>e.setName(a.target.value)})}),L(kn,{children:L(Ha,{fontSize:12,fontWeight:800,textColor:"#fff",height:32,width:60,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{i()},children:"Run"})})]}),Ut(vj,{sx:{padding:"10px 20px",gap:2},children:[L(kj,{getter:e}),Ut("div",{style:{width:300,display:"flex",gap:10},children:[L(Ha,{fontSize:12,fontWeight:700,height:32,textColor:"#50A7EA",transparent:!0,onClick:()=>{e.addParameter()},children:"Add parameter"}),L(Ha,{fontSize:12,fontWeight:700,height:32,textColor:"#50A7EA",transparent:!0,onClick:()=>{e.removeParameter()},children:"Remove parameter"})]}),L(Ej,{returnTypes:e.returnTypes,values:t??[],isLoading:r}),!!o&&L(Cs,{noBottomMargin:!0,noTopMargin:!0,title:L(kn,{children:o.toString()}),type:ps.ERROR,notificationBody:L(kn,{})})]})]})}function vwe(){const{getters:e}=xE(),t=_j();return Ut(kn,{sx:{display:"flex",gap:4,flexDirection:"column",mt:2},children:[e?.map(r=>L(mwe,{getter:r})),L(ywe,{getter:t})]})}const bwe=Xi($n)({justifyContent:"space-between",width:"100%"}),wwe=Xi(kn)({position:"relative"}),xwe=Xi(kn)({position:"absolute",top:"80px",right:"40px",zIndex:3}),_we=Xi(H7)({borderBottom:"1px solid #E8E8E8","& .MuiTabs-indicator":{borderBottom:"4px solid #0088CC",borderRadius:20},"& .MuiTab-root.Mui-selected":{color:"#000",fontWeight:800}});function Swe(){const{data:e}=Pc(),[t,r]=X.exports.useState(void 0),i=aa("(max-width: 450px)"),o=aa("(max-width: 600px)"),{showNotification:a}=Ry(),s=(c,d)=>{r(d)},l=X.exports.useCallback(async c=>{const d=document.querySelector(c===1?"#myVerifierContent > pre > code > .contract-verifier-code-content":"pre > code > div.hljs.language-fift");navigator.clipboard.writeText(d?.innerText),a("Copied to clipboard!","success")},[]);X.exports.useEffect(()=>{r(e?.hasOnchainProof?0:1)},[e?.hasOnchainProof]);const{getters:u}=xE();return Ut(kn,{sx:{border:"0.5px solid rgba(114, 138, 150, 0.24)",boxShadow:"rgb(114 138 150 / 8%) 0px 2px 16px",borderRadius:"20px",position:"relative"},children:[L(p2,{mb:1,children:Ut(bwe,{children:[Ut($n,{mb:i?2:0,sx:{width:"100%"},children:[L(cg,{children:L("img",{src:Kbe,alt:"Block icon",width:41,height:41})}),Ut(Fd,{children:[!!e?.hasOnchainProof&&"Verified"," Source ",i&&L("br",{})," ","Code"]})]}),t===0&&L(kn,{sx:{alignSelf:"baseline",position:"relative",top:o?"5px":"3px"},children:Ut(Ha,{fontSize:12,fontWeight:500,hoverBackground:"#F5F5F5",background:"#F2F2F2",height:o?30:37,width:o?30:167,onClick:()=>{e?.files?.length&&Zbe(e.files)},children:[L("img",{src:Gbe,alt:"Download icon",width:19,height:19}),o?"":"Download sources"]})})]})}),Ut(wwe,{p:3,children:[Ut(_we,{value:t,onChange:s,children:[L(Z_,{sx:{textTransform:"none"},disabled:!e?.hasOnchainProof,label:"Sources"}),L(Z_,{sx:{textTransform:"none"},label:"Disassembled"}),L(Z_,{sx:{textTransform:"none"},label:`Getters (${u?.length??0})`})]}),L(kn,{sx:{display:t===0?"block":"none"},children:L(K1e,{button:L(vM,{onCopy:l,copyText:1})})}),L(kn,{sx:{display:t===1?"block":"none"},children:L(qbe,{button:L(vM,{onCopy:l,copyText:0})})}),L(kn,{sx:{display:t===2?"block":"none"},children:L(vwe,{})})]})]})}const vM=({copyText:e,onCopy:t})=>L(xwe,{children:L(Bs,{onClick:()=>t(e),children:L("img",{alt:"Copy Icon",src:Wx,width:16,height:16})})});function Cwe(){const{contractAddress:e}=$u(),t=Bx(),[r]=yw(),[i,o]=X.exports.useState(!1);return X.exports.useEffect(()=>{(async()=>{if(!(!t||!e)){if(r.get("override")!==null){const a=await yp();if(await JN(Vn.Address.parse(window.sourcesRegistryAddress),a)===t){o(!0);return}}o(!1)}})()},[t,e]),i}const hc={COMPILE:"COMPILE",PUBLISH:"PUBLISH"},sc={SOURCES:"SOURCES",PUBLISH:"PUBLISH"},bM=()=>({step:hc.COMPILE,currentSection:sc.SOURCES}),kwe=e=>({...bM(),proceedToPublish:()=>{e({step:hc.PUBLISH,currentSection:sc.PUBLISH})},toggleSection:t=>{e({currentSection:t})},reset:()=>{e(bM())}}),Vx=Py(kwe),Aj=_g(e=>({isPreloaded:!1,markPreloaded:()=>{e({isPreloaded:!0})},clearPreloaded:()=>{e({isPreloaded:!1})}}));function Ewe(){const{contractAddress:e}=$u(),t=Hu(),{reset:r}=zu(),{reset:i}=Vx(),{isPreloaded:o,clearPreloaded:a}=Aj();X.exports.useEffect(()=>{o?a():r(),i(),t.invalidate()},[e])}const _E="/assets/contract.ff46c407.svg",Awe=Xi(ug)({minWidth:100}),Twe=Xi(kn)(e=>({display:e.isShrinked&&!e.isExtraSmallScreen?"flex":"inherit",flexWrap:e.isShrinked&&!e.isExtraSmallScreen?"wrap":"inherit",columnGap:e.isShrinked&&!e.isExtraSmallScreen?30:"",padding:e.isShrinked&&!e.isExtraSmallScreen?"0 30px":"","&>*:last-child":{borderBottom:e.isShrinked?"":"none !important"},"&:last-child":{marginBottom:3}})),Iwe=Xi($n)(e=>({boxSizing:e.isShrinked?"border-box":"inherit",flex:e.isShrinked?"40%":"inherit",width:e.isShrinked&&!e.isExtraSmallScreen?0:e.isShrinked&&e.isExtraSmallScreen?"100%":"",minHeight:38,padding:"10px 24px",transition:"background .15s",borderTop:"1px solid rgba(114, 138, 150, 0.2)"})),Tj=Xi(jo)({fontSize:14,color:"#000",minWidth:90,fontWeight:800}),Ij=Xi(jo)({width:"100%",wordBreak:"break-word",fontSize:14,color:"#728A96"}),Rwe=Xi($n)({minWidth:25,justifyContent:"flex-end"}),Pwe=(e,t,r,i)=>Ut(({children:s})=>r?L($7,{placement:"top-start",title:e,children:L("span",{children:s})}):L(ta,{children:s}),{children:[L(({children:s})=>t&&!!e?L(uc,{target:"_blank",href:t,sx:{textDecoration:"none",cursor:"pointer"},children:s}):L(ta,{children:s}),{children:e??"-"}),L(kn,{sx:{fontSize:12,opacity:.8},children:i??""})]});function SE({isFlexibleWrapper:e,icon:t,title:r,dataRows:i,isLoading:o}){const a=e?Awe:ug,{showNotification:s}=Ry(),l=aa("(max-width: 500px)"),u=X.exports.useCallback(async c=>{navigator.clipboard.writeText(c),s("Copied to clipboard!","success")},[]);return Ut(a,{pb:e?0:2,children:[Ut(p2,{mb:1,children:[L(cg,{children:L("img",{src:t,alt:"Block icon",width:41,height:41})}),L(Fd,{children:r})]}),L(Twe,{mt:2.5,isShrinked:!e,isExtraSmallScreen:l,children:i.map(({title:c,value:d,showIcon:p,color:v,customLink:x,tooltip:b,onClick:y,subtitle:_})=>Ut(Iwe,{isExtraSmallScreen:l,isShrinked:!e,children:[L(Tj,{children:c}),L(Ij,{sx:{cursor:y?"pointer":"initial"},onClick:y,children:Pwe(d,x,b,_)}),p&&L(Rwe,{children:d&&L(Bs,{sx:{padding:0},onClick:()=>u(d),children:L("img",{src:Wx,alt:"Copy icon",width:15,height:15})})})]},c))})]})}function Rj(e){try{const t=Vn.Address.parse(e);switch(t.workChain){case-1:return"Masterchain (-1)";case 0:return"Basic Workchain (0)";default:return`${t.workChain}`}}catch{return""}}const Mwe=new Intl.NumberFormat("en-US",{minimumFractionDigits:4});function Y5(e,t){const[r,i]=X.exports.useState(e);return X.exports.useEffect(()=>{i(e)},[e,t]),[r,()=>{i(r===e?t:e)}]}function Owe(){const{contractAddress:e,contractAddressHex:t}=$u(),{data:r,isLoading:i}=vp(),{data:o}=Pc(),a=[],[s,l]=Y5(e,t),[u,c]=Y5(r?.codeCellHash.base64,r?.codeCellHash.hex),[d,p]=Y5(r?.dataCellHash.base64,r?.dataCellHash.hex);return r&&(a.push({title:"Address",value:s??"",showIcon:!0,onClick:()=>{l()},tooltip:!0,subtitle:Rj(e||"")}),a.push({title:"Balance",value:`${Mwe.format(parseFloat(r.balance))} TON`}),a.push({title:"Code Hash",value:u??"",showIcon:!0,onClick:()=>{c()},tooltip:!0}),a.push({title:"Data Hash",value:d??"",showIcon:!0,onClick:()=>{p()},tooltip:!0})),L(SE,{title:"Contract",icon:_E,dataRows:a,isLoading:i,isFlexibleWrapper:!!o?.hasOnchainProof})}const Bwe="/assets/compiler.05d3a143.svg";var Pj="en",CE={},w4={};function Mj(){return Pj}function Uwe(e){Pj=e}function Dwe(e){return CE[e]}function Lwe(e){if(!e)throw new Error("No locale data passed");CE[e.locale]=e,w4[e.locale.toLowerCase()]=e.locale}function wM(e){if(CE[e])return e;if(w4[e.toLowerCase()])return w4[e.toLowerCase()]}function Oj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.localeMatcher||"lookup";switch(r){case"lookup":return xM(e);case"best fit":return xM(e);default:throw new RangeError('Invalid "localeMatcher" option: '.concat(r))}}function xM(e){var t=wM(e);if(t)return t;for(var r=e.split("-");e.length>1;){r.pop(),e=r.join("-");var i=wM(e);if(i)return i}}var er={af:function(t){return t==1?"one":"other"},am:function(t){return t>=0&&t<=1?"one":"other"},ar:function(t){var r=String(t).split("."),i=Number(r[0])==t,o=i&&r[0].slice(-2);return t==0?"zero":t==1?"one":t==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"},ast:function(t){var r=String(t).split("."),i=!r[1];return t==1&&i?"one":"other"},be:function(t){var r=String(t).split("."),i=Number(r[0])==t,o=i&&r[0].slice(-1),a=i&&r[0].slice(-2);return o==1&&a!=11?"one":o>=2&&o<=4&&(a<12||a>14)?"few":i&&o==0||o>=5&&o<=9||a>=11&&a<=14?"many":"other"},br:function(t){var r=String(t).split("."),i=Number(r[0])==t,o=i&&r[0].slice(-1),a=i&&r[0].slice(-2),s=i&&r[0].slice(-6);return o==1&&a!=11&&a!=71&&a!=91?"one":o==2&&a!=12&&a!=72&&a!=92?"two":(o==3||o==4||o==9)&&(a<10||a>19)&&(a<70||a>79)&&(a<90||a>99)?"few":t!=0&&i&&s==0?"many":"other"},bs:function(t){var r=String(t).split("."),i=r[0],o=r[1]||"",a=!r[1],s=i.slice(-1),l=i.slice(-2),u=o.slice(-1),c=o.slice(-2);return a&&s==1&&l!=11||u==1&&c!=11?"one":a&&s>=2&&s<=4&&(l<12||l>14)||u>=2&&u<=4&&(c<12||c>14)?"few":"other"},ca:function(t){var r=String(t).split("."),i=r[0],o=!r[1],a=i.slice(-6);return t==1&&o?"one":i!=0&&a==0&&o?"many":"other"},ceb:function(t){var r=String(t).split("."),i=r[0],o=r[1]||"",a=!r[1],s=i.slice(-1),l=o.slice(-1);return a&&(i==1||i==2||i==3)||a&&s!=4&&s!=6&&s!=9||!a&&l!=4&&l!=6&&l!=9?"one":"other"},cs:function(t){var r=String(t).split("."),i=r[0],o=!r[1];return t==1&&o?"one":i>=2&&i<=4&&o?"few":o?"other":"many"},cy:function(t){return t==0?"zero":t==1?"one":t==2?"two":t==3?"few":t==6?"many":"other"},da:function(t){var r=String(t).split("."),i=r[0],o=Number(r[0])==t;return t==1||!o&&(i==0||i==1)?"one":"other"},dsb:function(t){var r=String(t).split("."),i=r[0],o=r[1]||"",a=!r[1],s=i.slice(-2),l=o.slice(-2);return a&&s==1||l==1?"one":a&&s==2||l==2?"two":a&&(s==3||s==4)||l==3||l==4?"few":"other"},dz:function(t){return"other"},es:function(t){var r=String(t).split("."),i=r[0],o=!r[1],a=i.slice(-6);return t==1?"one":i!=0&&a==0&&o?"many":"other"},ff:function(t){return t>=0&&t<2?"one":"other"},fr:function(t){var r=String(t).split("."),i=r[0],o=!r[1],a=i.slice(-6);return t>=0&&t<2?"one":i!=0&&a==0&&o?"many":"other"},ga:function(t){var r=String(t).split("."),i=Number(r[0])==t;return t==1?"one":t==2?"two":i&&t>=3&&t<=6?"few":i&&t>=7&&t<=10?"many":"other"},gd:function(t){var r=String(t).split("."),i=Number(r[0])==t;return t==1||t==11?"one":t==2||t==12?"two":i&&t>=3&&t<=10||i&&t>=13&&t<=19?"few":"other"},he:function(t){var r=String(t).split("."),i=r[0],o=!r[1];return i==1&&o||i==0&&!o?"one":i==2&&o?"two":"other"},is:function(t){var r=String(t).split("."),i=r[0],o=(r[1]||"").replace(/0+$/,""),a=Number(r[0])==t,s=i.slice(-1),l=i.slice(-2);return a&&s==1&&l!=11||o%10==1&&o%100!=11?"one":"other"},ksh:function(t){return t==0?"zero":t==1?"one":"other"},lt:function(t){var r=String(t).split("."),i=r[1]||"",o=Number(r[0])==t,a=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return a==1&&(s<11||s>19)?"one":a>=2&&a<=9&&(s<11||s>19)?"few":i!=0?"many":"other"},lv:function(t){var r=String(t).split("."),i=r[1]||"",o=i.length,a=Number(r[0])==t,s=a&&r[0].slice(-1),l=a&&r[0].slice(-2),u=i.slice(-2),c=i.slice(-1);return a&&s==0||l>=11&&l<=19||o==2&&u>=11&&u<=19?"zero":s==1&&l!=11||o==2&&c==1&&u!=11||o!=2&&c==1?"one":"other"},mk:function(t){var r=String(t).split("."),i=r[0],o=r[1]||"",a=!r[1],s=i.slice(-1),l=i.slice(-2),u=o.slice(-1),c=o.slice(-2);return a&&s==1&&l!=11||u==1&&c!=11?"one":"other"},mt:function(t){var r=String(t).split("."),i=Number(r[0])==t,o=i&&r[0].slice(-2);return t==1?"one":t==2?"two":t==0||o>=3&&o<=10?"few":o>=11&&o<=19?"many":"other"},pa:function(t){return t==0||t==1?"one":"other"},pl:function(t){var r=String(t).split("."),i=r[0],o=!r[1],a=i.slice(-1),s=i.slice(-2);return t==1&&o?"one":o&&a>=2&&a<=4&&(s<12||s>14)?"few":o&&i!=1&&(a==0||a==1)||o&&a>=5&&a<=9||o&&s>=12&&s<=14?"many":"other"},pt:function(t){var r=String(t).split("."),i=r[0],o=!r[1],a=i.slice(-6);return i==0||i==1?"one":i!=0&&a==0&&o?"many":"other"},ro:function(t){var r=String(t).split("."),i=!r[1],o=Number(r[0])==t,a=o&&r[0].slice(-2);return t==1&&i?"one":!i||t==0||t!=1&&a>=1&&a<=19?"few":"other"},ru:function(t){var r=String(t).split("."),i=r[0],o=!r[1],a=i.slice(-1),s=i.slice(-2);return o&&a==1&&s!=11?"one":o&&a>=2&&a<=4&&(s<12||s>14)?"few":o&&a==0||o&&a>=5&&a<=9||o&&s>=11&&s<=14?"many":"other"},se:function(t){return t==1?"one":t==2?"two":"other"},si:function(t){var r=String(t).split("."),i=r[0],o=r[1]||"";return t==0||t==1||i==0&&o==1?"one":"other"},sl:function(t){var r=String(t).split("."),i=r[0],o=!r[1],a=i.slice(-2);return o&&a==1?"one":o&&a==2?"two":o&&(a==3||a==4)||!o?"few":"other"}};er.as=er.am;er.az=er.af;er.bg=er.af;er.bn=er.am;er.brx=er.af;er.ce=er.af;er.chr=er.af;er.de=er.ast;er.ee=er.af;er.el=er.af;er.en=er.ast;er.et=er.ast;er.eu=er.af;er.fa=er.am;er.fi=er.ast;er.fil=er.ceb;er.fo=er.af;er.fur=er.af;er.fy=er.ast;er.gl=er.ast;er.gu=er.am;er.ha=er.af;er.hi=er.am;er.hr=er.bs;er.hsb=er.dsb;er.hu=er.af;er.hy=er.ff;er.ia=er.ast;er.id=er.dz;er.ig=er.dz;er.it=er.ca;er.ja=er.dz;er.jgo=er.af;er.jv=er.dz;er.ka=er.af;er.kea=er.dz;er.kk=er.af;er.kl=er.af;er.km=er.dz;er.kn=er.am;er.ko=er.dz;er.ks=er.af;er.ku=er.af;er.ky=er.af;er.lb=er.af;er.lkt=er.dz;er.lo=er.dz;er.ml=er.af;er.mn=er.af;er.mr=er.af;er.ms=er.dz;er.my=er.dz;er.nb=er.af;er.ne=er.af;er.nl=er.ast;er.nn=er.af;er.no=er.af;er.or=er.af;er.pcm=er.am;er.ps=er.af;er.rm=er.af;er.sah=er.dz;er.sc=er.ast;er.sd=er.af;er.sk=er.cs;er.so=er.af;er.sq=er.af;er.sr=er.bs;er.su=er.dz;er.sv=er.ast;er.sw=er.ast;er.ta=er.af;er.te=er.af;er.th=er.dz;er.ti=er.pa;er.tk=er.af;er.to=er.dz;er.tr=er.af;er.ug=er.af;er.uk=er.ru;er.ur=er.ast;er.uz=er.af;er.vi=er.dz;er.wae=er.af;er.wo=er.dz;er.xh=er.af;er.yi=er.ast;er.yo=er.dz;er.yue=er.dz;er.zh=er.dz;er.zu=er.am;const _M=er;function SM(e){return e==="pt-PT"?e:jwe(e)}var Nwe=/^([a-z0-9]+)/i;function jwe(e){var t=e.match(Nwe);if(!t)throw new TypeError("Invalid locale: ".concat(e));return t[1]}function $we(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CM(e,t){for(var r=0;rOi(ii))){yi[qn++]={pattern:Ko,captures:ii};const Oi=this.setProperties[Ko];Oi&&(yi[so].setProperties=Oi);const $i=this.assertedProperties[Ko];$i&&(yi[so].assertedProperties=$i);const Un=this.refutedProperties[Ko];Un&&(yi[so].refutedProperties=Un)}}return yi.length=qn,ir._free(Vr),yi}captures(ke,Ze,Ht,or){Ze||(Ze=Wr),Ht||(Ht=Wr),or||(or={});let kr=or.matchLimit;if(kr===void 0)kr=0;else if(typeof kr!="number")throw new Error("Arguments must be numbers");Qn(ke),ir._ts_query_captures_wasm(this[0],ke.tree[0],Ze.row,Ze.column,Ht.row,Ht.column,kr);const $r=J(cn,"i32"),Vr=J(cn+Gt,"i32"),dn=J(cn+2*Gt,"i32"),yi=[];this.exceededMatchLimit=!!dn;const qn=[];let wi=Vr;for(let so=0;so<$r;so++){const Ko=J(wi,"i32"),Aa=J(wi+=Gt,"i32"),ii=J(wi+=Gt,"i32");if(wi+=Gt,qn.length=Aa,wi=$o(this,ke.tree,wi,qn),this.textPredicates[Ko].every(Oi=>Oi(qn))){const Oi=qn[ii],$i=this.setProperties[Ko];$i&&(Oi.setProperties=$i);const Un=this.assertedProperties[Ko];Un&&(Oi.assertedProperties=Un);const xo=this.refutedProperties[Ko];xo&&(Oi.refutedProperties=xo),yi.push(Oi)}}return ir._free(Vr),yi}predicatesForPattern(ke){return this.predicates[ke]}didExceedMatchLimit(){return this.exceededMatchLimit}}function wo(Ge,ke,Ze){const Ht=Ze-ke;let or=Ge.textCallback(ke,null,Ze);for(ke+=or.length;ke0))break;ke+=kr.length,or+=kr}return ke>Ze&&(or=or.slice(0,Ht)),or}function $o(Ge,ke,Ze,Ht){for(let or=0,kr=Ht.length;or{Ai.init(),c()}}))}}return s}();e.exports=i})(wj);const v4=wj.exports,xj=()=>(()=>{try{if(typeof WebAssembly=="object"&&typeof WebAssembly.instantiate=="function"){const e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e)instanceof WebAssembly.Instance}}catch{}return!1})(),nwe=()=>window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1";let b4;const iwe=async(e,t)=>{if(b4)return;const r={locateFile(){return e}};await v4.init(r),b4=await v4.Language.load(t)},owe=()=>{const e=new v4;return e.setLanguage(b4),e.setTimeoutMicros(1e3*1e3),e};async function awe(e){return xj()?(wa(ha.GETTER_PARSE_START),await iwe("./tree-sitter.wasm","./tree-sitter-func.wasm"),owe().parse(e).rootNode.children.filter(a=>a.type==="function_definition"&&a.children.find(s=>s.type==="specifiers_list")?.text.includes("method_id")).map(a=>{const s=a.children[0].children.filter(c=>!c.type.match(/[,()]/)).map(c=>c.text),l=a.children.find(c=>c.type==="function_name").text,u=a.children.find(c=>c.type==="parameter_list").children.filter(c=>c.type==="parameter_declaration").map(c=>({type:c.child(0).text,name:c.child(1).text}));return{returnTypes:s,name:l,parameters:u}})):[]}const swe=_g($x((e,t)=>({name:"",setName:r=>{e(i=>{i.name=r})},parameters:[],addParameter:()=>{e(r=>{const i=Math.random();r.parameters.push({name:"",_id:i,possibleTypes:["int","slice","address"],selectedTypeIdx:0,setValue:o=>r.parameters.find(a=>a._id===i).value=o,setName:o=>{e(a=>{a.parameters.find(s=>s._id===i).name=o})},toggleNextType:()=>{e(o=>{const a=o.parameters.find(s=>s._id===i);a.selectedTypeIdx=(a.selectedTypeIdx+1)%a.possibleTypes.length})},type:()=>{const o=t().parameters.find(a=>a._id===i);return o.possibleTypes[o.selectedTypeIdx]},originalType:()=>t().parameters.find(a=>a._id===i).possibleTypes[0],value:""})})},returnTypes:[],removeParameter:()=>{e(r=>{r.parameters.pop()})},clear:()=>{e(r=>{r.name="",r.parameters=[]})}})));function _j(){return swe()}const $v=(e,t,r)=>e.find(i=>i.name===t).parameters.find(i=>i.name===r),Sj=_g($x((e,t)=>({getters:[],setGetters:r=>{e(i=>{const o=r.map(a=>({name:a.name,parameters:a.parameters.map(s=>{const l=[s.type];return["cell","slice"].includes(s.type)&&l.push("address"),{name:s.name,value:"",possibleTypes:l,selectedTypeIdx:0,toggleNextType:()=>{e(u=>{const c=$v(u.getters,a.name,s.name);c.selectedTypeIdx=(c.selectedTypeIdx+1)%c.possibleTypes.length})},type:()=>{const u=$v(t().getters,a.name,s.name);return u.possibleTypes[u.selectedTypeIdx]},originalType:()=>$v(t().getters,a.name,s.name).possibleTypes[0],setValue:u=>{e(c=>{const d=$v(c.getters,a.name,s.name);d.value=u})}}}),returnTypes:a.returnTypes}));i.getters=o})}})));function xE(){const{getters:e}=Sj();return{getters:e}}function lwe(){const{data:e}=Pc(),{setGetters:t}=Sj(),{clear:r}=_j(),{contractAddress:i}=$u();X.exports.useEffect(()=>{t([]),r()},[i]),X.exports.useEffect(()=>{(async()=>{const o=[];for(const a of e?.files??[])!a.name.match(/\.(fc|func)/)||o.push(...await awe(a.content));t(o),r()})()},[e?.files])}function uwe(e=[]){const t=new Vn.TupleBuilder;return e.forEach(r=>{if(r instanceof Vn.Cell)t.writeSlice(r);else if(typeof r=="bigint")t.writeNumber(r);else throw new Error("unknown type!")}),t.build()}function cwe(e){const t=[];for(;e.remaining;){const r=e.pop();switch(r.type){case"int":{t.push(r.value);break}case"cell":{t.push(r.cell);break}case"tuple":{if(r.items.length===0)t.push(null);else throw new Error("list parsing not supported");break}default:throw new Error(`unknown type: ${r.type}`)}}return t}async function dwe(e,t,r,i,o){const{stack:a}=await o.runMethod(e,t,uwe(r));return i(cwe(a))}function Cj(e){const{contractAddress:t}=$u(),{getters:r}=xE();return hU([t,"getter",e.name],async()=>{const i=await yp();return!t||!r?void 0:(wa(ha.RUN_GETTER),dwe(Vn.Address.parse(t),e.name,e.parameters.map(a=>{switch(a.possibleTypes[a.selectedTypeIdx]){case"int":return BigInt(a.value);case"address":return Vn.beginCell().storeAddress(Vn.Address.parse(a.value)).endCell();default:return Vn.Cell.fromBoc(Buffer.from(a.value,"base64"))[0]}}),a=>a.map(s=>{const l=[];if(s instanceof Vn.Cell){try{s.beginParse().remainingBits===267&&l.push({type:"address",value:s.beginParse().loadAddress().toString()})}catch{}l.push({type:"base64",value:s.toBoc().toString("base64")}),l.push({type:"boc",value:s.toString()})}else typeof s=="bigint"?(l.push({type:"int",value:s.toString()}),l.push({type:"coins",value:Vn.fromNano(s)}),l.push({type:"hex",value:s.toString(16)}),l.push({type:"base64",value:Buffer.from(s.toString(16),"hex").toString("base64")})):l.push({type:"raw",value:String(s)});return l}),i))})}var ps=(e=>(e.ERROR="Error",e.HINT="Hint",e.SUCCESS="Success",e.INFO="Info",e))(ps||{});const fwe=Xi(da)(e=>({padding:`${e.singleLine?0:15}px 25px`,marginBottom:e.noBottomMargin?0:24,marginTop:e.noTopMargin?0:24,background:e.backgroundColor||"",border:`1px solid ${e.borderColor||"#D8D8D8"}`,borderRadius:12}));function Cs({title:e,type:t,notificationBody:r,singleLine:i,noBottomMargin:o,noTopMargin:a}){let s,l;switch(t){case"Info":l="rgba(216, 216, 216, 0.2);";break;case"Error":s="rgba(252, 86, 86, 0.42);",l="rgba(252, 86, 86, 0.08);";break;case"Hint":l="rgba(94, 117, 232, 0.1);";break;case"Success":l="#D6FFCE";break}return Ut(fwe,{singleLine:i,borderColor:s,backgroundColor:l,noBottomMargin:o,noTopMargin:a,children:[e,r]})}function pwe({parameter:e}){return Ut(Cc,{sx:{gap:1},children:[Ut(Cc,{sx:{gap:.5,flexDirection:"row"},children:[L(kn,{children:e.name}),L(bj,{sx:{cursor:e.possibleTypes.length>1?"pointer":"inherit"},onClick:()=>{e.toggleNextType()},children:e.type()})]}),L(twe,{onChange:t=>{e.setValue(t.target.value)}})]})}function kj({getter:e}){return Ut(kn,{children:[L(kn,{sx:{mb:1},children:L("b",{children:"Request"})}),Ut(Cc,{sx:{gap:2},children:[e.parameters.map((t,r)=>L(pwe,{parameter:t},t.name)),(e.parameters.length??0)===0&&L(kn,{sx:{color:"#949597"},children:"(No params)"})]})]})}function hwe({value:e}){const[t,r]=X.exports.useState(0);return{onClick:()=>{r((t+1)%e.length)},type:e[t]?.type??"unknown",value:e[t].value}}function gwe({type:e,value:t}){const{type:r,value:i,onClick:o}=hwe({value:t}),{showNotification:a}=Ry();return Ut(xc,{sx:{gap:1,cursor:t.length>1?"pointer":"initial"},onClick:o,children:[L(G5,{children:L(bj,{children:r})}),L(G5,{width:"100%",children:L(ewe,{children:i})}),L(G5,{children:L(Bs,{sx:{padding:0,opacity:.8},onClick:s=>{s.stopPropagation(),navigator.clipboard.writeText(i),a("Copied to clipboard!","success")},children:L("img",{src:Wx,alt:"Copy icon",width:15,height:15})})})]})}function Ej({returnTypes:e,values:t,isLoading:r}){return Ut(ta,{children:[(t.length>0||r)&&L(kn,{children:L("b",{children:"Response"})}),t.length>0&&L(Cc,{sx:{gap:1.5},children:L(L6,{children:L(N6,{children:t.map((i,o)=>L(gwe,{type:e[o],value:i}))})})}),t.length===0&&r&&L(Cc,{sx:{gap:1},children:e.map(i=>L(Xa,{variant:"rounded",height:20}))})]})}function mwe({getter:e}){const{data:t,isLoading:r,mutate:i,error:o}=Cj(e);return Ut(mj,{children:[Ut(yj,{children:[Ut(kn,{sx:{flexGrow:1},children:[Ut(Xbe,{children:[e.name,"(",e.parameters.map(a=>a.originalType()).join(", "),")"]}),Ut(Jbe,{children:[L("b",{children:"returns"})," ",e.returnTypes.join(", ")]})]}),L(kn,{children:L(Ha,{fontSize:12,fontWeight:800,textColor:"#fff",height:32,width:60,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{i()},children:"Run"})})]}),Ut(vj,{sx:{padding:"10px 20px",gap:2},children:[L(kj,{getter:e}),L(Ej,{returnTypes:e.returnTypes,values:t??[],isLoading:r}),!!o&&L(Cs,{noBottomMargin:!0,noTopMargin:!0,title:L(kn,{children:o.toString()}),type:ps.ERROR,notificationBody:L(kn,{})})]})]})}function ywe({getter:e}){const{data:t,isLoading:r,mutate:i,error:o}=Cj(e);return Ut(mj,{children:[Ut(yj,{children:[L(kn,{sx:{flexGrow:1},children:L(rwe,{value:e.name,placeholder:"Get method name",onChange:a=>e.setName(a.target.value)})}),L(kn,{children:L(Ha,{fontSize:12,fontWeight:800,textColor:"#fff",height:32,width:60,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{i()},children:"Run"})})]}),Ut(vj,{sx:{padding:"10px 20px",gap:2},children:[L(kj,{getter:e}),Ut("div",{style:{width:300,display:"flex",gap:10},children:[L(Ha,{fontSize:12,fontWeight:700,height:32,textColor:"#50A7EA",transparent:!0,onClick:()=>{e.addParameter()},children:"Add parameter"}),L(Ha,{fontSize:12,fontWeight:700,height:32,textColor:"#50A7EA",transparent:!0,onClick:()=>{e.removeParameter()},children:"Remove parameter"})]}),L(Ej,{returnTypes:e.returnTypes,values:t??[],isLoading:r}),!!o&&L(Cs,{noBottomMargin:!0,noTopMargin:!0,title:L(kn,{children:o.toString()}),type:ps.ERROR,notificationBody:L(kn,{})})]})]})}function vwe(){const{getters:e}=xE(),t=_j();return Ut(kn,{sx:{display:"flex",gap:4,flexDirection:"column",mt:2},children:[e?.map(r=>L(mwe,{getter:r})),L(ywe,{getter:t})]})}const bwe=Xi($n)({justifyContent:"space-between",width:"100%"}),wwe=Xi(kn)({position:"relative"}),xwe=Xi(kn)({position:"absolute",top:"80px",right:"40px",zIndex:3}),_we=Xi(H7)({borderBottom:"1px solid #E8E8E8","& .MuiTabs-indicator":{borderBottom:"4px solid #0088CC",borderRadius:20},"& .MuiTab-root.Mui-selected":{color:"#000",fontWeight:800}});function Swe(){const{data:e}=Pc(),[t,r]=X.exports.useState(void 0),i=aa("(max-width: 450px)"),o=aa("(max-width: 600px)"),{showNotification:a}=Ry(),s=(c,d)=>{r(d)},l=X.exports.useCallback(async c=>{const d=document.querySelector(c===1?"#myVerifierContent > pre > code > .contract-verifier-code-content":"pre > code > div.hljs.language-fift");navigator.clipboard.writeText(d?.innerText),a("Copied to clipboard!","success")},[]);X.exports.useEffect(()=>{r(e?.hasOnchainProof?0:1)},[e?.hasOnchainProof]);const{getters:u}=xE();return Ut(kn,{sx:{border:"0.5px solid rgba(114, 138, 150, 0.24)",boxShadow:"rgb(114 138 150 / 8%) 0px 2px 16px",borderRadius:"20px",position:"relative"},children:[L(p2,{mb:1,children:Ut(bwe,{children:[Ut($n,{mb:i?2:0,sx:{width:"100%"},children:[L(cg,{children:L("img",{src:Kbe,alt:"Block icon",width:41,height:41})}),Ut(Fd,{children:[!!e?.hasOnchainProof&&"Verified"," Source ",i&&L("br",{})," ","Code"]})]}),t===0&&L(kn,{sx:{alignSelf:"baseline",position:"relative",top:o?"5px":"3px"},children:Ut(Ha,{fontSize:12,fontWeight:500,hoverBackground:"#F5F5F5",background:"#F2F2F2",height:o?30:37,width:o?30:167,onClick:()=>{e?.files?.length&&Zbe(e.files)},children:[L("img",{src:Gbe,alt:"Download icon",width:19,height:19}),o?"":"Download sources"]})})]})}),Ut(wwe,{p:3,children:[Ut(_we,{value:t,onChange:s,children:[L(Z_,{sx:{textTransform:"none"},disabled:!e?.hasOnchainProof,label:"Sources"}),L(Z_,{sx:{textTransform:"none"},label:"Disassembled"}),L(Z_,{sx:{textTransform:"none"},label:`Getters (${u?.length??0})`})]}),L(kn,{sx:{display:t===0?"block":"none"},children:L(K1e,{button:L(vM,{onCopy:l,copyText:1})})}),L(kn,{sx:{display:t===1?"block":"none"},children:L(qbe,{button:L(vM,{onCopy:l,copyText:0})})}),L(kn,{sx:{display:t===2?"block":"none"},children:L(vwe,{})})]})]})}const vM=({copyText:e,onCopy:t})=>L(xwe,{children:L(Bs,{onClick:()=>t(e),children:L("img",{alt:"Copy Icon",src:Wx,width:16,height:16})})});function Cwe(){const{contractAddress:e}=$u(),t=Bx(),[r]=yw(),[i,o]=X.exports.useState(!1);return X.exports.useEffect(()=>{(async()=>{if(!(!t||!e)){if(r.get("override")!==null){const a=await yp();if(await JN(Vn.Address.parse(window.sourcesRegistryAddress),a)===t){o(!0);return}}o(!1)}})()},[t,e]),i}const hc={COMPILE:"COMPILE",PUBLISH:"PUBLISH"},sc={SOURCES:"SOURCES",PUBLISH:"PUBLISH"},bM=()=>({step:hc.COMPILE,currentSection:sc.SOURCES}),kwe=e=>({...bM(),proceedToPublish:()=>{e({step:hc.PUBLISH,currentSection:sc.PUBLISH})},toggleSection:t=>{e({currentSection:t})},reset:()=>{e(bM())}}),Vx=Py(kwe),Aj=_g(e=>({isPreloaded:!1,markPreloaded:()=>{e({isPreloaded:!0})},clearPreloaded:()=>{e({isPreloaded:!1})}}));function Ewe(){const{contractAddress:e}=$u(),t=Hu(),{reset:r}=zu(),{reset:i}=Vx(),{isPreloaded:o,clearPreloaded:a}=Aj();X.exports.useEffect(()=>{o?a():r(),i(),t.invalidate()},[e])}const _E="/verifier/assets/contract.ff46c407.svg",Awe=Xi(ug)({minWidth:100}),Twe=Xi(kn)(e=>({display:e.isShrinked&&!e.isExtraSmallScreen?"flex":"inherit",flexWrap:e.isShrinked&&!e.isExtraSmallScreen?"wrap":"inherit",columnGap:e.isShrinked&&!e.isExtraSmallScreen?30:"",padding:e.isShrinked&&!e.isExtraSmallScreen?"0 30px":"","&>*:last-child":{borderBottom:e.isShrinked?"":"none !important"},"&:last-child":{marginBottom:3}})),Iwe=Xi($n)(e=>({boxSizing:e.isShrinked?"border-box":"inherit",flex:e.isShrinked?"40%":"inherit",width:e.isShrinked&&!e.isExtraSmallScreen?0:e.isShrinked&&e.isExtraSmallScreen?"100%":"",minHeight:38,padding:"10px 24px",transition:"background .15s",borderTop:"1px solid rgba(114, 138, 150, 0.2)"})),Tj=Xi(jo)({fontSize:14,color:"#000",minWidth:90,fontWeight:800}),Ij=Xi(jo)({width:"100%",wordBreak:"break-word",fontSize:14,color:"#728A96"}),Rwe=Xi($n)({minWidth:25,justifyContent:"flex-end"}),Pwe=(e,t,r,i)=>Ut(({children:s})=>r?L($7,{placement:"top-start",title:e,children:L("span",{children:s})}):L(ta,{children:s}),{children:[L(({children:s})=>t&&!!e?L(uc,{target:"_blank",href:t,sx:{textDecoration:"none",cursor:"pointer"},children:s}):L(ta,{children:s}),{children:e??"-"}),L(kn,{sx:{fontSize:12,opacity:.8},children:i??""})]});function SE({isFlexibleWrapper:e,icon:t,title:r,dataRows:i,isLoading:o}){const a=e?Awe:ug,{showNotification:s}=Ry(),l=aa("(max-width: 500px)"),u=X.exports.useCallback(async c=>{navigator.clipboard.writeText(c),s("Copied to clipboard!","success")},[]);return Ut(a,{pb:e?0:2,children:[Ut(p2,{mb:1,children:[L(cg,{children:L("img",{src:t,alt:"Block icon",width:41,height:41})}),L(Fd,{children:r})]}),L(Twe,{mt:2.5,isShrinked:!e,isExtraSmallScreen:l,children:i.map(({title:c,value:d,showIcon:p,color:v,customLink:x,tooltip:b,onClick:y,subtitle:_})=>Ut(Iwe,{isExtraSmallScreen:l,isShrinked:!e,children:[L(Tj,{children:c}),L(Ij,{sx:{cursor:y?"pointer":"initial"},onClick:y,children:Pwe(d,x,b,_)}),p&&L(Rwe,{children:d&&L(Bs,{sx:{padding:0},onClick:()=>u(d),children:L("img",{src:Wx,alt:"Copy icon",width:15,height:15})})})]},c))})]})}function Rj(e){try{const t=Vn.Address.parse(e);switch(t.workChain){case-1:return"Masterchain (-1)";case 0:return"Basic Workchain (0)";default:return`${t.workChain}`}}catch{return""}}const Mwe=new Intl.NumberFormat("en-US",{minimumFractionDigits:4});function Y5(e,t){const[r,i]=X.exports.useState(e);return X.exports.useEffect(()=>{i(e)},[e,t]),[r,()=>{i(r===e?t:e)}]}function Owe(){const{contractAddress:e,contractAddressHex:t}=$u(),{data:r,isLoading:i}=vp(),{data:o}=Pc(),a=[],[s,l]=Y5(e,t),[u,c]=Y5(r?.codeCellHash.base64,r?.codeCellHash.hex),[d,p]=Y5(r?.dataCellHash.base64,r?.dataCellHash.hex);return r&&(a.push({title:"Address",value:s??"",showIcon:!0,onClick:()=>{l()},tooltip:!0,subtitle:Rj(e||"")}),a.push({title:"Balance",value:`${Mwe.format(parseFloat(r.balance))} TON`}),a.push({title:"Code Hash",value:u??"",showIcon:!0,onClick:()=>{c()},tooltip:!0}),a.push({title:"Data Hash",value:d??"",showIcon:!0,onClick:()=>{p()},tooltip:!0})),L(SE,{title:"Contract",icon:_E,dataRows:a,isLoading:i,isFlexibleWrapper:!!o?.hasOnchainProof})}const Bwe="/verifier/assets/compiler.05d3a143.svg";var Pj="en",CE={},w4={};function Mj(){return Pj}function Uwe(e){Pj=e}function Dwe(e){return CE[e]}function Lwe(e){if(!e)throw new Error("No locale data passed");CE[e.locale]=e,w4[e.locale.toLowerCase()]=e.locale}function wM(e){if(CE[e])return e;if(w4[e.toLowerCase()])return w4[e.toLowerCase()]}function Oj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.localeMatcher||"lookup";switch(r){case"lookup":return xM(e);case"best fit":return xM(e);default:throw new RangeError('Invalid "localeMatcher" option: '.concat(r))}}function xM(e){var t=wM(e);if(t)return t;for(var r=e.split("-");e.length>1;){r.pop(),e=r.join("-");var i=wM(e);if(i)return i}}var er={af:function(t){return t==1?"one":"other"},am:function(t){return t>=0&&t<=1?"one":"other"},ar:function(t){var r=String(t).split("."),i=Number(r[0])==t,o=i&&r[0].slice(-2);return t==0?"zero":t==1?"one":t==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"},ast:function(t){var r=String(t).split("."),i=!r[1];return t==1&&i?"one":"other"},be:function(t){var r=String(t).split("."),i=Number(r[0])==t,o=i&&r[0].slice(-1),a=i&&r[0].slice(-2);return o==1&&a!=11?"one":o>=2&&o<=4&&(a<12||a>14)?"few":i&&o==0||o>=5&&o<=9||a>=11&&a<=14?"many":"other"},br:function(t){var r=String(t).split("."),i=Number(r[0])==t,o=i&&r[0].slice(-1),a=i&&r[0].slice(-2),s=i&&r[0].slice(-6);return o==1&&a!=11&&a!=71&&a!=91?"one":o==2&&a!=12&&a!=72&&a!=92?"two":(o==3||o==4||o==9)&&(a<10||a>19)&&(a<70||a>79)&&(a<90||a>99)?"few":t!=0&&i&&s==0?"many":"other"},bs:function(t){var r=String(t).split("."),i=r[0],o=r[1]||"",a=!r[1],s=i.slice(-1),l=i.slice(-2),u=o.slice(-1),c=o.slice(-2);return a&&s==1&&l!=11||u==1&&c!=11?"one":a&&s>=2&&s<=4&&(l<12||l>14)||u>=2&&u<=4&&(c<12||c>14)?"few":"other"},ca:function(t){var r=String(t).split("."),i=r[0],o=!r[1],a=i.slice(-6);return t==1&&o?"one":i!=0&&a==0&&o?"many":"other"},ceb:function(t){var r=String(t).split("."),i=r[0],o=r[1]||"",a=!r[1],s=i.slice(-1),l=o.slice(-1);return a&&(i==1||i==2||i==3)||a&&s!=4&&s!=6&&s!=9||!a&&l!=4&&l!=6&&l!=9?"one":"other"},cs:function(t){var r=String(t).split("."),i=r[0],o=!r[1];return t==1&&o?"one":i>=2&&i<=4&&o?"few":o?"other":"many"},cy:function(t){return t==0?"zero":t==1?"one":t==2?"two":t==3?"few":t==6?"many":"other"},da:function(t){var r=String(t).split("."),i=r[0],o=Number(r[0])==t;return t==1||!o&&(i==0||i==1)?"one":"other"},dsb:function(t){var r=String(t).split("."),i=r[0],o=r[1]||"",a=!r[1],s=i.slice(-2),l=o.slice(-2);return a&&s==1||l==1?"one":a&&s==2||l==2?"two":a&&(s==3||s==4)||l==3||l==4?"few":"other"},dz:function(t){return"other"},es:function(t){var r=String(t).split("."),i=r[0],o=!r[1],a=i.slice(-6);return t==1?"one":i!=0&&a==0&&o?"many":"other"},ff:function(t){return t>=0&&t<2?"one":"other"},fr:function(t){var r=String(t).split("."),i=r[0],o=!r[1],a=i.slice(-6);return t>=0&&t<2?"one":i!=0&&a==0&&o?"many":"other"},ga:function(t){var r=String(t).split("."),i=Number(r[0])==t;return t==1?"one":t==2?"two":i&&t>=3&&t<=6?"few":i&&t>=7&&t<=10?"many":"other"},gd:function(t){var r=String(t).split("."),i=Number(r[0])==t;return t==1||t==11?"one":t==2||t==12?"two":i&&t>=3&&t<=10||i&&t>=13&&t<=19?"few":"other"},he:function(t){var r=String(t).split("."),i=r[0],o=!r[1];return i==1&&o||i==0&&!o?"one":i==2&&o?"two":"other"},is:function(t){var r=String(t).split("."),i=r[0],o=(r[1]||"").replace(/0+$/,""),a=Number(r[0])==t,s=i.slice(-1),l=i.slice(-2);return a&&s==1&&l!=11||o%10==1&&o%100!=11?"one":"other"},ksh:function(t){return t==0?"zero":t==1?"one":"other"},lt:function(t){var r=String(t).split("."),i=r[1]||"",o=Number(r[0])==t,a=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return a==1&&(s<11||s>19)?"one":a>=2&&a<=9&&(s<11||s>19)?"few":i!=0?"many":"other"},lv:function(t){var r=String(t).split("."),i=r[1]||"",o=i.length,a=Number(r[0])==t,s=a&&r[0].slice(-1),l=a&&r[0].slice(-2),u=i.slice(-2),c=i.slice(-1);return a&&s==0||l>=11&&l<=19||o==2&&u>=11&&u<=19?"zero":s==1&&l!=11||o==2&&c==1&&u!=11||o!=2&&c==1?"one":"other"},mk:function(t){var r=String(t).split("."),i=r[0],o=r[1]||"",a=!r[1],s=i.slice(-1),l=i.slice(-2),u=o.slice(-1),c=o.slice(-2);return a&&s==1&&l!=11||u==1&&c!=11?"one":"other"},mt:function(t){var r=String(t).split("."),i=Number(r[0])==t,o=i&&r[0].slice(-2);return t==1?"one":t==2?"two":t==0||o>=3&&o<=10?"few":o>=11&&o<=19?"many":"other"},pa:function(t){return t==0||t==1?"one":"other"},pl:function(t){var r=String(t).split("."),i=r[0],o=!r[1],a=i.slice(-1),s=i.slice(-2);return t==1&&o?"one":o&&a>=2&&a<=4&&(s<12||s>14)?"few":o&&i!=1&&(a==0||a==1)||o&&a>=5&&a<=9||o&&s>=12&&s<=14?"many":"other"},pt:function(t){var r=String(t).split("."),i=r[0],o=!r[1],a=i.slice(-6);return i==0||i==1?"one":i!=0&&a==0&&o?"many":"other"},ro:function(t){var r=String(t).split("."),i=!r[1],o=Number(r[0])==t,a=o&&r[0].slice(-2);return t==1&&i?"one":!i||t==0||t!=1&&a>=1&&a<=19?"few":"other"},ru:function(t){var r=String(t).split("."),i=r[0],o=!r[1],a=i.slice(-1),s=i.slice(-2);return o&&a==1&&s!=11?"one":o&&a>=2&&a<=4&&(s<12||s>14)?"few":o&&a==0||o&&a>=5&&a<=9||o&&s>=11&&s<=14?"many":"other"},se:function(t){return t==1?"one":t==2?"two":"other"},si:function(t){var r=String(t).split("."),i=r[0],o=r[1]||"";return t==0||t==1||i==0&&o==1?"one":"other"},sl:function(t){var r=String(t).split("."),i=r[0],o=!r[1],a=i.slice(-2);return o&&a==1?"one":o&&a==2?"two":o&&(a==3||a==4)||!o?"few":"other"}};er.as=er.am;er.az=er.af;er.bg=er.af;er.bn=er.am;er.brx=er.af;er.ce=er.af;er.chr=er.af;er.de=er.ast;er.ee=er.af;er.el=er.af;er.en=er.ast;er.et=er.ast;er.eu=er.af;er.fa=er.am;er.fi=er.ast;er.fil=er.ceb;er.fo=er.af;er.fur=er.af;er.fy=er.ast;er.gl=er.ast;er.gu=er.am;er.ha=er.af;er.hi=er.am;er.hr=er.bs;er.hsb=er.dsb;er.hu=er.af;er.hy=er.ff;er.ia=er.ast;er.id=er.dz;er.ig=er.dz;er.it=er.ca;er.ja=er.dz;er.jgo=er.af;er.jv=er.dz;er.ka=er.af;er.kea=er.dz;er.kk=er.af;er.kl=er.af;er.km=er.dz;er.kn=er.am;er.ko=er.dz;er.ks=er.af;er.ku=er.af;er.ky=er.af;er.lb=er.af;er.lkt=er.dz;er.lo=er.dz;er.ml=er.af;er.mn=er.af;er.mr=er.af;er.ms=er.dz;er.my=er.dz;er.nb=er.af;er.ne=er.af;er.nl=er.ast;er.nn=er.af;er.no=er.af;er.or=er.af;er.pcm=er.am;er.ps=er.af;er.rm=er.af;er.sah=er.dz;er.sc=er.ast;er.sd=er.af;er.sk=er.cs;er.so=er.af;er.sq=er.af;er.sr=er.bs;er.su=er.dz;er.sv=er.ast;er.sw=er.ast;er.ta=er.af;er.te=er.af;er.th=er.dz;er.ti=er.pa;er.tk=er.af;er.to=er.dz;er.tr=er.af;er.ug=er.af;er.uk=er.ru;er.ur=er.ast;er.uz=er.af;er.vi=er.dz;er.wae=er.af;er.wo=er.dz;er.xh=er.af;er.yi=er.ast;er.yo=er.dz;er.yue=er.dz;er.zh=er.dz;er.zu=er.am;const _M=er;function SM(e){return e==="pt-PT"?e:jwe(e)}var Nwe=/^([a-z0-9]+)/i;function jwe(e){var t=e.match(Nwe);if(!t)throw new TypeError("Invalid locale: ".concat(e));return t[1]}function $we(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CM(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,i=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Kwe(this,e);var i=r.numeric,o=r.style,a=r.localeMatcher;if(this.numeric="always",this.style="long",this.localeMatcher="lookup",i!==void 0){if(Qwe.indexOf(i)<0)throw new RangeError('Invalid "numeric" option: '.concat(i));this.numeric=i}if(o!==void 0){if(Zwe.indexOf(o)<0)throw new RangeError('Invalid "style" option: '.concat(o));this.style=o}if(a!==void 0){if(Xwe.indexOf(a)<0)throw new RangeError('Invalid "localeMatcher" option: '.concat(a));this.localeMatcher=a}if(typeof t=="string"&&(t=[t]),t.push(Mj()),this.locale=e.supportedLocalesOf(t,{localeMatcher:this.localeMatcher})[0],!this.locale)throw new Error("No supported locale was found");x4.supportedLocalesOf(this.locale).length>0?this.pluralRules=new x4(this.locale):console.warn('"'.concat(this.locale,'" locale is not supported')),typeof Intl<"u"&&Intl.NumberFormat?(this.numberFormat=new Intl.NumberFormat(this.locale),this.numberingSystem=this.numberFormat.resolvedOptions().numberingSystem):this.numberingSystem="latn",this.locale=Oj(this.locale,{localeMatcher:this.localeMatcher})}return Gwe(e,[{key:"format",value:function(){var r=RM(arguments),i=AM(r,2),o=i[0],a=i[1];return this.getRule(o,a).replace("{0}",this.formatNumber(Math.abs(o)))}},{key:"formatToParts",value:function(){var r=RM(arguments),i=AM(r,2),o=i[0],a=i[1],s=this.getRule(o,a),l=s.indexOf("{0}");if(l<0)return[{type:"literal",value:s}];var u=[];return l>0&&u.push({type:"literal",value:s.slice(0,l)}),u=u.concat(this.formatNumberToParts(Math.abs(o)).map(function(c){return EM(EM({},c),{},{unit:a})})),l+31&&arguments[1]!==void 0?arguments[1]:{};if(typeof e=="string")e=[e];else if(!Array.isArray(e))throw new TypeError('Invalid "locales" argument');return e.filter(function(r){return Oj(r,t)})};Ud.addLocale=Lwe;Ud.setDefaultLocale=Uwe;Ud.getDefaultLocale=Mj;Ud.PluralRules=x4;var Q5='Invalid "unit" argument';function Jwe(e){if(_4(e)==="symbol")throw new TypeError(Q5);if(typeof e!="string")throw new RangeError("".concat(Q5,": ").concat(e));if(e[e.length-1]==="s"&&(e=e.slice(0,e.length-1)),Ywe.indexOf(e)<0)throw new RangeError("".concat(Q5,": ").concat(e));return e}var e2e='Invalid "number" argument';function t2e(e){if(e=Number(e),Number.isFinite&&!Number.isFinite(e))throw new RangeError("".concat(e2e,": ").concat(e));return e}function r2e(e){return 1/e===-1/0}function n2e(e){return e<0||e===0&&r2e(e)}function RM(e){if(e.length<2)throw new TypeError('"unit" argument is required');return[t2e(e[0]),Jwe(e[1])]}function Pb(e){return Pb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pb(e)}function i2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PM(e,t){for(var r=0;r=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s2e(e,t){if(!!e){if(typeof e=="string")return OM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return OM(e,t)}}function OM(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r1;)if(a.pop(),o=a.join("-"),t(o))return o}throw new Error("No locale data has been registered for any of the locales: ".concat(e.join(", ")))}function u2e(){var e=(typeof Intl>"u"?"undefined":S4(Intl))==="object";return e&&typeof Intl.DateTimeFormat=="function"}function C4(e){return C4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C4(e)}function c2e(e){return f2e(e)&&(Array.isArray(e.steps)||Array.isArray(e.gradation)||Array.isArray(e.flavour)||typeof e.flavour=="string"||Array.isArray(e.labels)||typeof e.labels=="string"||Array.isArray(e.units)||typeof e.custom=="function")}var d2e={}.constructor;function f2e(e){return C4(e)!==void 0&&e!==null&&e.constructor===d2e}var nc=60,Mb=60*nc,Tf=24*Mb,k4=7*Tf,E4=30.44*Tf,Bj=146097/400*Tf;function xh(e){switch(e){case"second":return 1;case"minute":return nc;case"hour":return Mb;case"day":return Tf;case"week":return k4;case"month":return E4;case"year":return Bj}}function Uj(e){return e.factor!==void 0?e.factor:xh(e.unit||e.formatAs)||1}function ty(e){switch(e){case"floor":return Math.floor;default:return Math.round}}function kE(e){switch(e){case"floor":return 1;default:return .5}}function A4(e){return A4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A4(e)}function Dj(e,t){var r=t.prevStep,i=t.timestamp,o=t.now,a=t.future,s=t.round,l;return r&&(r.id||r.unit)&&(l=e["threshold_for_".concat(r.id||r.unit)]),l===void 0&&e.threshold!==void 0&&(l=e.threshold,typeof l=="function"&&(l=l(o,a))),l===void 0&&(l=e.minTime),A4(l)==="object"&&(r&&r.id&&l[r.id]!==void 0?l=l[r.id]:l=l.default),typeof l=="function"&&(l=l(i,{future:a,getMinTimeForUnit:function(c,d){return BM(c,d||r&&r.formatAs,{round:s})}})),l===void 0&&e.test&&(e.test(i,{now:o,future:a})?l=0:l=9007199254740991),l===void 0&&(r?e.formatAs&&r.formatAs&&(l=BM(e.formatAs,r.formatAs,{round:s})):l=0),l===void 0&&console.warn("[javascript-time-ago] A step should specify `minTime`:\n"+JSON.stringify(e,null,2)),l}function BM(e,t,r){var i=r.round,o=xh(e),a;if(t==="now"?a=xh(e):a=xh(t),o!==void 0&&a!==void 0)return o-a*(1-kE(i))}function UM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,i)}return r}function p2e(e){for(var t=1;t0)return e[s-1]}return l}}}function Lj(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=Dj(e[i],p2e({prevStep:e[i-1],timestamp:r.now-t*1e3},r));return o===void 0||Math.abs(t)=0:!0})}function v2e(e,t,r){var i=r.now,o=r.round;if(!!xh(e)){var a=xh(e)*1e3,s=t>i,l=Math.abs(t-i),u=ty(o)(l/a)*a;return s?u>0?l-u+w2e(o,a):l-u+1:-(l-u)+b2e(o,a)}}function b2e(e,t){return kE(e)*t}function w2e(e,t){return(1-kE(e))*t+1}var x2e=365*24*60*60*1e3,Nj=1e3*x2e;function _2e(e,t,r){var i=r.prevStep,o=r.nextStep,a=r.now,s=r.future,l=r.round,u=e.getTime?e.getTime():e,c=function(b){return v2e(b,u,{now:a,round:l})},d=C2e(s?t:o,u,{future:s,now:a,round:l,prevStep:s?i:t});if(d!==void 0){var p;if(t&&(t.getTimeToNextUpdate&&(p=t.getTimeToNextUpdate(u,{getTimeToNextUpdateForUnit:c,getRoundFunction:ty,now:a,future:s,round:l})),p===void 0)){var v=t.unit||t.formatAs;v&&(p=c(v))}return p===void 0?d:Math.min(p,d)}}function S2e(e,t,r){var i=r.now,o=r.future,a=r.round,s=r.prevStep,l=Dj(e,{timestamp:t,now:i,future:o,round:a,prevStep:s});if(l!==void 0)return o?t-l*1e3+1:l===0&&t===i?Nj:t+l*1e3}function C2e(e,t,r){var i=r.now,o=r.future,a=r.round,s=r.prevStep;if(e){var l=S2e(e,t,{now:i,future:o,round:a,prevStep:s});return l===void 0?void 0:l-i}else return o?t-i+1:Nj}var jj={};function uh(e){return jj[e]}function $j(e){if(!e)throw new Error("[javascript-time-ago] No locale data passed.");jj[e.locale]=e}const k2e=[{formatAs:"now"},{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"},{formatAs:"day"},{formatAs:"week"},{formatAs:"month"},{formatAs:"year"}],T4={steps:k2e,labels:"long"};function DM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,i)}return r}function LM(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W2e(e,t){return K2e(e)||q2e(e,t)||Hj(e,t)||V2e()}function V2e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
@@ -1235,8 +1235,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wxe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xxe(e){if(Array.isArray(e))return B4(e)}function aO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,i)}return r}function sO(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,i=new Array(t);rr)return[!1,lO(r)];if(e.sizer)return[!1,lO(r)]}return[!0,null]}function pf(e){return e!=null}function Pxe(e){var t=e.files,r=e.accept,i=e.minSize,o=e.maxSize,a=e.multiple,s=e.maxFiles,l=e.validator;return!a&&t.length>1||a&&s>=1&&t.length>s?!1:t.every(function(u){var c=Yj(u,r),d=ny(c,1),p=d[0],v=Qj(u,i,o),x=ny(v,1),b=x[0],y=l?l(u):null;return p&&b&&!y})}function Ub(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function zv(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function cO(e){e.preventDefault()}function Mxe(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Oxe(e){return e.indexOf("Edge/")!==-1}function Bxe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Mxe(e)||Oxe(e)}function lu(){for(var e=arguments.length,t=new Array(e),r=0;r1?o-1:0),s=1;se.length)&&(t=e.length);for(var r=0,i=new Array(t);r=0)&&(!Object.prototype.propertyIsEnumerable.call(e,i)||(r[i]=e[i]))}return r}function Zxe(e,t){if(e==null)return{};var r={},i=Object.keys(e),o,a;for(a=0;a=0)&&(r[o]=e[o]);return r}var EE=X.exports.forwardRef(function(e,t){var r=e.children,i=Db(e,$xe),o=t$(i),a=o.open,s=Db(o,Fxe);return X.exports.useImperativeHandle(t,function(){return{open:a}},[a]),L(X.exports.Fragment,{children:r(Go(Go({},s),{},{open:a}))})});EE.displayName="Dropzone";var e$={disabled:!1,getFilesFromEvent:uxe,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};EE.defaultProps=e$;EE.propTypes={children:Co.exports.func,accept:Co.exports.objectOf(Co.exports.arrayOf(Co.exports.string)),multiple:Co.exports.bool,preventDropOnDocument:Co.exports.bool,noClick:Co.exports.bool,noKeyboard:Co.exports.bool,noDrag:Co.exports.bool,noDragEventsBubbling:Co.exports.bool,minSize:Co.exports.number,maxSize:Co.exports.number,maxFiles:Co.exports.number,disabled:Co.exports.bool,getFilesFromEvent:Co.exports.func,onFileDialogCancel:Co.exports.func,onFileDialogOpen:Co.exports.func,useFsAccessApi:Co.exports.bool,autoFocus:Co.exports.bool,onDragEnter:Co.exports.func,onDragLeave:Co.exports.func,onDragOver:Co.exports.func,onDrop:Co.exports.func,onDropAccepted:Co.exports.func,onDropRejected:Co.exports.func,onError:Co.exports.func,validator:Co.exports.func};var L4={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function t$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Go(Go({},e$),e),r=t.accept,i=t.disabled,o=t.getFilesFromEvent,a=t.maxSize,s=t.minSize,l=t.multiple,u=t.maxFiles,c=t.onDragEnter,d=t.onDragLeave,p=t.onDragOver,v=t.onDrop,x=t.onDropAccepted,b=t.onDropRejected,y=t.onFileDialogCancel,_=t.onFileDialogOpen,k=t.useFsAccessApi,E=t.autoFocus,B=t.preventDropOnDocument,U=t.noClick,D=t.noKeyboard,j=t.noDrag,F=t.noDragEventsBubbling,H=t.onError,W=t.validator,G=X.exports.useMemo(function(){return Lxe(r)},[r]),ae=X.exports.useMemo(function(){return Dxe(r)},[r]),V=X.exports.useMemo(function(){return typeof _=="function"?_:fO},[_]),oe=X.exports.useMemo(function(){return typeof y=="function"?y:fO},[y]),P=X.exports.useRef(null),ee=X.exports.useRef(null),le=X.exports.useReducer(Xxe,L4),pe=Z5(le,2),_e=pe[0],J=pe[1],ft=_e.isFocused,Le=_e.isFileDialogActive,He=X.exports.useRef(typeof window<"u"&&window.isSecureContext&&k&&Uxe()),nr=function(){!He.current&&Le&&setTimeout(function(){if(ee.current){var ie=ee.current.files;ie.length||(J({type:"closeDialog"}),oe())}},300)};X.exports.useEffect(function(){return window.addEventListener("focus",nr,!1),function(){window.removeEventListener("focus",nr,!1)}},[ee,Le,oe,He]);var Bt=X.exports.useRef([]),Rt=function(ie){P.current&&P.current.contains(ie.target)||(ie.preventDefault(),Bt.current=[])};X.exports.useEffect(function(){return B&&(document.addEventListener("dragover",cO,!1),document.addEventListener("drop",Rt,!1)),function(){B&&(document.removeEventListener("dragover",cO),document.removeEventListener("drop",Rt))}},[P,B]),X.exports.useEffect(function(){return!i&&E&&P.current&&P.current.focus(),function(){}},[P,E,i]);var Jt=X.exports.useCallback(function(ce){H?H(ce):console.error(ce)},[H]),vr=X.exports.useCallback(function(ce){ce.preventDefault(),ce.persist(),Be(ce),Bt.current=[].concat(Wxe(Bt.current),[ce.target]),zv(ce)&&Promise.resolve(o(ce)).then(function(ie){if(!(Ub(ce)&&!F)){var de=ie.length,$=de>0&&Pxe({files:ie,accept:G,minSize:s,maxSize:a,multiple:l,maxFiles:u,validator:W}),C=de>0&&!$;J({isDragAccept:$,isDragReject:C,isDragActive:!0,type:"setDraggedFiles"}),c&&c(ce)}}).catch(function(ie){return Jt(ie)})},[o,c,Jt,F,G,s,a,l,u,W]),At=X.exports.useCallback(function(ce){ce.preventDefault(),ce.persist(),Be(ce);var ie=zv(ce);if(ie&&ce.dataTransfer)try{ce.dataTransfer.dropEffect="copy"}catch{}return ie&&p&&p(ce),!1},[p,F]),kt=X.exports.useCallback(function(ce){ce.preventDefault(),ce.persist(),Be(ce);var ie=Bt.current.filter(function($){return P.current&&P.current.contains($)}),de=ie.indexOf(ce.target);de!==-1&&ie.splice(de,1),Bt.current=ie,!(ie.length>0)&&(J({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),zv(ce)&&d&&d(ce))},[P,d,F]),Ct=X.exports.useCallback(function(ce,ie){var de=[],$=[];ce.forEach(function(C){var T=Yj(C,G),Q=Z5(T,2),ve=Q[0],je=Q[1],ct=Qj(C,s,a),ur=Z5(ct,2),Dr=ur[0],hr=ur[1],Rr=W?W(C):null;if(ve&&Dr&&!Rr)de.push(C);else{var Gr=[je,hr];Rr&&(Gr=Gr.concat(Rr)),$.push({file:C,errors:Gr.filter(function(Nr){return Nr})})}}),(!l&&de.length>1||l&&u>=1&&de.length>u)&&(de.forEach(function(C){$.push({file:C,errors:[Rxe]})}),de.splice(0)),J({acceptedFiles:de,fileRejections:$,type:"setFiles"}),v&&v(de,$,ie),$.length>0&&b&&b($,ie),de.length>0&&x&&x(de,ie)},[J,l,G,s,a,u,v,x,b,W]),Lt=X.exports.useCallback(function(ce){ce.preventDefault(),ce.persist(),Be(ce),Bt.current=[],zv(ce)&&Promise.resolve(o(ce)).then(function(ie){Ub(ce)&&!F||Ct(ie,ce)}).catch(function(ie){return Jt(ie)}),J({type:"reset"})},[o,Ct,Jt,F]),Kt=X.exports.useCallback(function(){if(He.current){J({type:"openDialog"}),V();var ce={multiple:l,types:ae};window.showOpenFilePicker(ce).then(function(ie){return o(ie)}).then(function(ie){Ct(ie,null),J({type:"closeDialog"})}).catch(function(ie){Nxe(ie)?(oe(ie),J({type:"closeDialog"})):jxe(ie)?(He.current=!1,ee.current?(ee.current.value=null,ee.current.click()):Jt(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):Jt(ie)});return}ee.current&&(J({type:"openDialog"}),V(),ee.current.value=null,ee.current.click())},[J,V,oe,k,Ct,Jt,ae,l]),yr=X.exports.useCallback(function(ce){!P.current||!P.current.isEqualNode(ce.target)||(ce.key===" "||ce.key==="Enter"||ce.keyCode===32||ce.keyCode===13)&&(ce.preventDefault(),Kt())},[P,Kt]),ne=X.exports.useCallback(function(){J({type:"focus"})},[]),Mt=X.exports.useCallback(function(){J({type:"blur"})},[]),Nt=X.exports.useCallback(function(){U||(Bxe()?setTimeout(Kt,0):Kt())},[U,Kt]),Ie=function(ie){return i?null:ie},Ae=function(ie){return D?null:Ie(ie)},fe=function(ie){return j?null:Ie(ie)},Be=function(ie){F&&ie.stopPropagation()},rt=X.exports.useMemo(function(){return function(){var ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ie=ce.refKey,de=ie===void 0?"ref":ie,$=ce.role,C=ce.onKeyDown,T=ce.onFocus,Q=ce.onBlur,ve=ce.onClick,je=ce.onDragEnter,ct=ce.onDragOver,ur=ce.onDragLeave,Dr=ce.onDrop,hr=Db(ce,zxe);return Go(Go(D4({onKeyDown:Ae(lu(C,yr)),onFocus:Ae(lu(T,ne)),onBlur:Ae(lu(Q,Mt)),onClick:Ie(lu(ve,Nt)),onDragEnter:fe(lu(je,vr)),onDragOver:fe(lu(ct,At)),onDragLeave:fe(lu(ur,kt)),onDrop:fe(lu(Dr,Lt)),role:typeof $=="string"&&$!==""?$:"presentation"},de,P),!i&&!D?{tabIndex:0}:{}),hr)}},[P,yr,ne,Mt,Nt,vr,At,kt,Lt,D,j,i]),lt=X.exports.useCallback(function(ce){ce.stopPropagation()},[]),jt=X.exports.useMemo(function(){return function(){var ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ie=ce.refKey,de=ie===void 0?"ref":ie,$=ce.onChange,C=ce.onClick,T=Db(ce,Hxe),Q=D4({accept:G,multiple:l,type:"file",style:{display:"none"},onChange:Ie(lu($,Lt)),onClick:Ie(lu(C,lt)),tabIndex:-1},de,ee);return Go(Go({},Q),T)}},[ee,r,l,Lt,i]);return Go(Go({},_e),{},{isFocused:ft&&!i,getRootProps:rt,getInputProps:jt,rootRef:P,inputRef:ee,open:Ie(Kt)})}function Xxe(e,t){switch(t.type){case"focus":return Go(Go({},e),{},{isFocused:!0});case"blur":return Go(Go({},e),{},{isFocused:!1});case"openDialog":return Go(Go({},L4),{},{isFileDialogActive:!0});case"closeDialog":return Go(Go({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Go(Go({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Go(Go({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Go({},L4);default:return e}}function fO(){}const Jxe="/assets/sources.bdd55da1.svg",r$="/assets/verified-bold.54828026.svg",e_e="/assets/upload.c0ad3052.svg",t_e=Xi($n)({justifyContent:"center",backgroundColor:"#F7F9FB",textAlign:"center",height:148,overflow:"hidden",border:"1px dashed #E3E8EA",color:"#728A96",borderRadius:20,lineHeight:148,cursor:"pointer","&:hover":{border:"1px dashed #9da3a5"}});function r_e(){const{addFiles:e,hasFiles:t}=zu(),{step:r}=Vx(),i=aa("(max-width: 450px)"),{active:o}=wk(),a=c=>{e(c)},{getRootProps:s,getInputProps:l,isDragActive:u}=t$({onDrop:a,accept:{"text/plain":Tb.map(c=>`.${c}`)}});return Ut(ta,{children:[L(p2,{mb:1,children:Ut($n,{sx:{justifyContent:"space-between",width:"100%",flexDirection:i?"column":"inherit"},children:[Ut($n,{mb:i?2:0,sx:{width:"100%"},children:[L(cg,{children:L("img",{src:r===hc.PUBLISH?r$:Jxe,alt:"Block icon",width:41,height:41})}),L(Fd,{children:"Add sources"})]}),t()&&r!==hc.PUBLISH&&L("div",{...s(),children:Ut(Ha,{fontSize:12,fontWeight:700,hoverBackground:"#e3e3e3",background:"#F8F8F8",height:44,width:159,children:[L("img",{src:e_e,alt:"Sources icon",width:19,height:19}),"Upload source"]})})]})}),Ut(kn,{sx:{padding:"15px 30px"},children:[L(kn,{sx:{position:"relative",zIndex:o?0:4,transition:o?"":"1.5s z-index"},children:!t()&&Ut(t_e,{...s(),children:["Drop sources (",Tb.map(c=>`.${c}`).join(", "),") here"]})}),L("input",{...l(),onClick:c=>{c.target.value=""},style:{display:"none"},id:"fileUpload",type:"file",multiple:!0,accept:".fc,.func,.fif"})]})]})}function n_e(){for(var e=arguments.length,t=new Array(e),r=0;ri=>{t.forEach(o=>o(i))},t)}const qx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Rg(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function AE(e){return"nodeType"in e}function Ds(e){var t,r;return e?Rg(e)?e:AE(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function TE(e){const{Document:t}=Ds(e);return e instanceof t}function Ny(e){return Rg(e)?!1:e instanceof Ds(e).HTMLElement}function i_e(e){return e instanceof Ds(e).SVGElement}function Pg(e){return e?Rg(e)?e.document:AE(e)?TE(e)?e:Ny(e)?e.ownerDocument:document:document:document}const Jl=qx?X.exports.useLayoutEffect:X.exports.useEffect;function IE(e){const t=X.exports.useRef(e);return Jl(()=>{t.current=e}),X.exports.useCallback(function(){for(var r=arguments.length,i=new Array(r),o=0;o{e.current=setInterval(i,o)},[]),r=X.exports.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function iy(e,t){t===void 0&&(t=[e]);const r=X.exports.useRef(e);return Jl(()=>{r.current!==e&&(r.current=e)},t),r}function jy(e,t){const r=X.exports.useRef();return X.exports.useMemo(()=>{const i=e(r.current);return r.current=i,i},[...t])}function Lb(e){const t=IE(e),r=X.exports.useRef(null),i=X.exports.useCallback(o=>{o!==r.current&&t?.(o,r.current),r.current=o},[]);return[r,i]}function N4(e){const t=X.exports.useRef();return X.exports.useEffect(()=>{t.current=e},[e]),t.current}let X5={};function $y(e,t){return X.exports.useMemo(()=>{if(t)return t;const r=X5[e]==null?0:X5[e]+1;return X5[e]=r,e+"-"+r},[e,t])}function n$(e){return function(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o{const l=Object.entries(s);for(const[u,c]of l){const d=a[u];d!=null&&(a[u]=d+e*c)}return a},{...t})}}const _h=n$(1),oy=n$(-1);function a_e(e){return"clientX"in e&&"clientY"in e}function RE(e){if(!e)return!1;const{KeyboardEvent:t}=Ds(e.target);return t&&e instanceof t}function s_e(e){if(!e)return!1;const{TouchEvent:t}=Ds(e.target);return t&&e instanceof t}function j4(e){if(s_e(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return a_e(e)?{x:e.clientX,y:e.clientY}:null}const ay=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(!!e)return[ay.Translate.toString(e),ay.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:i}=e;return t+" "+r+"ms "+i}}}),pO="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function l_e(e){return e.matches(pO)?e:e.querySelector(pO)}function u_e(e,t,r){const i={...e};return t.top+e.y<=r.top?i.y=r.top-t.top:t.bottom+e.y>=r.top+r.height&&(i.y=r.top+r.height-t.bottom),t.left+e.x<=r.left?i.x=r.left-t.left:t.right+e.x>=r.left+r.width&&(i.x=r.left+r.width-t.right),i}const c_e=e=>{let{containerNodeRect:t,draggingNodeRect:r,transform:i}=e;return!r||!t?i:u_e(i,r,t)},d_e=e=>{let{transform:t}=e;return{...t,x:0}},f_e={display:"none"};function p_e(e){let{id:t,value:r}=e;return L("div",{id:t,style:f_e,children:r})}const h_e={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function g_e(e){let{id:t,announcement:r}=e;return L("div",{id:t,style:h_e,role:"status","aria-live":"assertive","aria-atomic":!0,children:r})}function m_e(){const[e,t]=X.exports.useState("");return{announce:X.exports.useCallback(i=>{i!=null&&t(i)},[]),announcement:e}}const i$=X.exports.createContext(null);function y_e(e){const t=X.exports.useContext(i$);X.exports.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function v_e(){const[e]=X.exports.useState(()=>new Set),t=X.exports.useCallback(i=>(e.add(i),()=>e.delete(i)),[e]);return[X.exports.useCallback(i=>{let{type:o,event:a}=i;e.forEach(s=>{var l;return(l=s[o])==null?void 0:l.call(s,a)})},[e]),t]}const b_e={draggable:`
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jj(e,t){if(!!e){if(typeof e=="string")return U4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return U4(e,t)}}function U4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r=0)&&(!Object.prototype.propertyIsEnumerable.call(e,i)||(r[i]=e[i]))}return r}function Zxe(e,t){if(e==null)return{};var r={},i=Object.keys(e),o,a;for(a=0;a=0)&&(r[o]=e[o]);return r}var EE=X.exports.forwardRef(function(e,t){var r=e.children,i=Db(e,$xe),o=t$(i),a=o.open,s=Db(o,Fxe);return X.exports.useImperativeHandle(t,function(){return{open:a}},[a]),L(X.exports.Fragment,{children:r(Go(Go({},s),{},{open:a}))})});EE.displayName="Dropzone";var e$={disabled:!1,getFilesFromEvent:uxe,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};EE.defaultProps=e$;EE.propTypes={children:Co.exports.func,accept:Co.exports.objectOf(Co.exports.arrayOf(Co.exports.string)),multiple:Co.exports.bool,preventDropOnDocument:Co.exports.bool,noClick:Co.exports.bool,noKeyboard:Co.exports.bool,noDrag:Co.exports.bool,noDragEventsBubbling:Co.exports.bool,minSize:Co.exports.number,maxSize:Co.exports.number,maxFiles:Co.exports.number,disabled:Co.exports.bool,getFilesFromEvent:Co.exports.func,onFileDialogCancel:Co.exports.func,onFileDialogOpen:Co.exports.func,useFsAccessApi:Co.exports.bool,autoFocus:Co.exports.bool,onDragEnter:Co.exports.func,onDragLeave:Co.exports.func,onDragOver:Co.exports.func,onDrop:Co.exports.func,onDropAccepted:Co.exports.func,onDropRejected:Co.exports.func,onError:Co.exports.func,validator:Co.exports.func};var L4={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function t$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Go(Go({},e$),e),r=t.accept,i=t.disabled,o=t.getFilesFromEvent,a=t.maxSize,s=t.minSize,l=t.multiple,u=t.maxFiles,c=t.onDragEnter,d=t.onDragLeave,p=t.onDragOver,v=t.onDrop,x=t.onDropAccepted,b=t.onDropRejected,y=t.onFileDialogCancel,_=t.onFileDialogOpen,k=t.useFsAccessApi,E=t.autoFocus,B=t.preventDropOnDocument,U=t.noClick,D=t.noKeyboard,j=t.noDrag,F=t.noDragEventsBubbling,H=t.onError,W=t.validator,G=X.exports.useMemo(function(){return Lxe(r)},[r]),ae=X.exports.useMemo(function(){return Dxe(r)},[r]),V=X.exports.useMemo(function(){return typeof _=="function"?_:fO},[_]),oe=X.exports.useMemo(function(){return typeof y=="function"?y:fO},[y]),P=X.exports.useRef(null),ee=X.exports.useRef(null),le=X.exports.useReducer(Xxe,L4),pe=Z5(le,2),_e=pe[0],J=pe[1],ft=_e.isFocused,Le=_e.isFileDialogActive,He=X.exports.useRef(typeof window<"u"&&window.isSecureContext&&k&&Uxe()),nr=function(){!He.current&&Le&&setTimeout(function(){if(ee.current){var ie=ee.current.files;ie.length||(J({type:"closeDialog"}),oe())}},300)};X.exports.useEffect(function(){return window.addEventListener("focus",nr,!1),function(){window.removeEventListener("focus",nr,!1)}},[ee,Le,oe,He]);var Bt=X.exports.useRef([]),Rt=function(ie){P.current&&P.current.contains(ie.target)||(ie.preventDefault(),Bt.current=[])};X.exports.useEffect(function(){return B&&(document.addEventListener("dragover",cO,!1),document.addEventListener("drop",Rt,!1)),function(){B&&(document.removeEventListener("dragover",cO),document.removeEventListener("drop",Rt))}},[P,B]),X.exports.useEffect(function(){return!i&&E&&P.current&&P.current.focus(),function(){}},[P,E,i]);var Jt=X.exports.useCallback(function(ce){H?H(ce):console.error(ce)},[H]),vr=X.exports.useCallback(function(ce){ce.preventDefault(),ce.persist(),Be(ce),Bt.current=[].concat(Wxe(Bt.current),[ce.target]),zv(ce)&&Promise.resolve(o(ce)).then(function(ie){if(!(Ub(ce)&&!F)){var de=ie.length,$=de>0&&Pxe({files:ie,accept:G,minSize:s,maxSize:a,multiple:l,maxFiles:u,validator:W}),C=de>0&&!$;J({isDragAccept:$,isDragReject:C,isDragActive:!0,type:"setDraggedFiles"}),c&&c(ce)}}).catch(function(ie){return Jt(ie)})},[o,c,Jt,F,G,s,a,l,u,W]),At=X.exports.useCallback(function(ce){ce.preventDefault(),ce.persist(),Be(ce);var ie=zv(ce);if(ie&&ce.dataTransfer)try{ce.dataTransfer.dropEffect="copy"}catch{}return ie&&p&&p(ce),!1},[p,F]),kt=X.exports.useCallback(function(ce){ce.preventDefault(),ce.persist(),Be(ce);var ie=Bt.current.filter(function($){return P.current&&P.current.contains($)}),de=ie.indexOf(ce.target);de!==-1&&ie.splice(de,1),Bt.current=ie,!(ie.length>0)&&(J({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),zv(ce)&&d&&d(ce))},[P,d,F]),Ct=X.exports.useCallback(function(ce,ie){var de=[],$=[];ce.forEach(function(C){var T=Yj(C,G),Q=Z5(T,2),ve=Q[0],je=Q[1],ct=Qj(C,s,a),ur=Z5(ct,2),Dr=ur[0],hr=ur[1],Rr=W?W(C):null;if(ve&&Dr&&!Rr)de.push(C);else{var Gr=[je,hr];Rr&&(Gr=Gr.concat(Rr)),$.push({file:C,errors:Gr.filter(function(Nr){return Nr})})}}),(!l&&de.length>1||l&&u>=1&&de.length>u)&&(de.forEach(function(C){$.push({file:C,errors:[Rxe]})}),de.splice(0)),J({acceptedFiles:de,fileRejections:$,type:"setFiles"}),v&&v(de,$,ie),$.length>0&&b&&b($,ie),de.length>0&&x&&x(de,ie)},[J,l,G,s,a,u,v,x,b,W]),Lt=X.exports.useCallback(function(ce){ce.preventDefault(),ce.persist(),Be(ce),Bt.current=[],zv(ce)&&Promise.resolve(o(ce)).then(function(ie){Ub(ce)&&!F||Ct(ie,ce)}).catch(function(ie){return Jt(ie)}),J({type:"reset"})},[o,Ct,Jt,F]),Kt=X.exports.useCallback(function(){if(He.current){J({type:"openDialog"}),V();var ce={multiple:l,types:ae};window.showOpenFilePicker(ce).then(function(ie){return o(ie)}).then(function(ie){Ct(ie,null),J({type:"closeDialog"})}).catch(function(ie){Nxe(ie)?(oe(ie),J({type:"closeDialog"})):jxe(ie)?(He.current=!1,ee.current?(ee.current.value=null,ee.current.click()):Jt(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):Jt(ie)});return}ee.current&&(J({type:"openDialog"}),V(),ee.current.value=null,ee.current.click())},[J,V,oe,k,Ct,Jt,ae,l]),yr=X.exports.useCallback(function(ce){!P.current||!P.current.isEqualNode(ce.target)||(ce.key===" "||ce.key==="Enter"||ce.keyCode===32||ce.keyCode===13)&&(ce.preventDefault(),Kt())},[P,Kt]),ne=X.exports.useCallback(function(){J({type:"focus"})},[]),Mt=X.exports.useCallback(function(){J({type:"blur"})},[]),Nt=X.exports.useCallback(function(){U||(Bxe()?setTimeout(Kt,0):Kt())},[U,Kt]),Ie=function(ie){return i?null:ie},Ae=function(ie){return D?null:Ie(ie)},fe=function(ie){return j?null:Ie(ie)},Be=function(ie){F&&ie.stopPropagation()},rt=X.exports.useMemo(function(){return function(){var ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ie=ce.refKey,de=ie===void 0?"ref":ie,$=ce.role,C=ce.onKeyDown,T=ce.onFocus,Q=ce.onBlur,ve=ce.onClick,je=ce.onDragEnter,ct=ce.onDragOver,ur=ce.onDragLeave,Dr=ce.onDrop,hr=Db(ce,zxe);return Go(Go(D4({onKeyDown:Ae(lu(C,yr)),onFocus:Ae(lu(T,ne)),onBlur:Ae(lu(Q,Mt)),onClick:Ie(lu(ve,Nt)),onDragEnter:fe(lu(je,vr)),onDragOver:fe(lu(ct,At)),onDragLeave:fe(lu(ur,kt)),onDrop:fe(lu(Dr,Lt)),role:typeof $=="string"&&$!==""?$:"presentation"},de,P),!i&&!D?{tabIndex:0}:{}),hr)}},[P,yr,ne,Mt,Nt,vr,At,kt,Lt,D,j,i]),lt=X.exports.useCallback(function(ce){ce.stopPropagation()},[]),jt=X.exports.useMemo(function(){return function(){var ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ie=ce.refKey,de=ie===void 0?"ref":ie,$=ce.onChange,C=ce.onClick,T=Db(ce,Hxe),Q=D4({accept:G,multiple:l,type:"file",style:{display:"none"},onChange:Ie(lu($,Lt)),onClick:Ie(lu(C,lt)),tabIndex:-1},de,ee);return Go(Go({},Q),T)}},[ee,r,l,Lt,i]);return Go(Go({},_e),{},{isFocused:ft&&!i,getRootProps:rt,getInputProps:jt,rootRef:P,inputRef:ee,open:Ie(Kt)})}function Xxe(e,t){switch(t.type){case"focus":return Go(Go({},e),{},{isFocused:!0});case"blur":return Go(Go({},e),{},{isFocused:!1});case"openDialog":return Go(Go({},L4),{},{isFileDialogActive:!0});case"closeDialog":return Go(Go({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Go(Go({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Go(Go({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Go({},L4);default:return e}}function fO(){}const Jxe="/verifier/assets/sources.bdd55da1.svg",r$="/verifier/assets/verified-bold.54828026.svg",e_e="/verifier/assets/upload.c0ad3052.svg",t_e=Xi($n)({justifyContent:"center",backgroundColor:"#F7F9FB",textAlign:"center",height:148,overflow:"hidden",border:"1px dashed #E3E8EA",color:"#728A96",borderRadius:20,lineHeight:148,cursor:"pointer","&:hover":{border:"1px dashed #9da3a5"}});function r_e(){const{addFiles:e,hasFiles:t}=zu(),{step:r}=Vx(),i=aa("(max-width: 450px)"),{active:o}=wk(),a=c=>{e(c)},{getRootProps:s,getInputProps:l,isDragActive:u}=t$({onDrop:a,accept:{"text/plain":Tb.map(c=>`.${c}`)}});return Ut(ta,{children:[L(p2,{mb:1,children:Ut($n,{sx:{justifyContent:"space-between",width:"100%",flexDirection:i?"column":"inherit"},children:[Ut($n,{mb:i?2:0,sx:{width:"100%"},children:[L(cg,{children:L("img",{src:r===hc.PUBLISH?r$:Jxe,alt:"Block icon",width:41,height:41})}),L(Fd,{children:"Add sources"})]}),t()&&r!==hc.PUBLISH&&L("div",{...s(),children:Ut(Ha,{fontSize:12,fontWeight:700,hoverBackground:"#e3e3e3",background:"#F8F8F8",height:44,width:159,children:[L("img",{src:e_e,alt:"Sources icon",width:19,height:19}),"Upload source"]})})]})}),Ut(kn,{sx:{padding:"15px 30px"},children:[L(kn,{sx:{position:"relative",zIndex:o?0:4,transition:o?"":"1.5s z-index"},children:!t()&&Ut(t_e,{...s(),children:["Drop sources (",Tb.map(c=>`.${c}`).join(", "),") here"]})}),L("input",{...l(),onClick:c=>{c.target.value=""},style:{display:"none"},id:"fileUpload",type:"file",multiple:!0,accept:".fc,.func,.fif"})]})]})}function n_e(){for(var e=arguments.length,t=new Array(e),r=0;ri=>{t.forEach(o=>o(i))},t)}const qx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Rg(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function AE(e){return"nodeType"in e}function Ds(e){var t,r;return e?Rg(e)?e:AE(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function TE(e){const{Document:t}=Ds(e);return e instanceof t}function Ny(e){return Rg(e)?!1:e instanceof Ds(e).HTMLElement}function i_e(e){return e instanceof Ds(e).SVGElement}function Pg(e){return e?Rg(e)?e.document:AE(e)?TE(e)?e:Ny(e)?e.ownerDocument:document:document:document}const Jl=qx?X.exports.useLayoutEffect:X.exports.useEffect;function IE(e){const t=X.exports.useRef(e);return Jl(()=>{t.current=e}),X.exports.useCallback(function(){for(var r=arguments.length,i=new Array(r),o=0;o{e.current=setInterval(i,o)},[]),r=X.exports.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function iy(e,t){t===void 0&&(t=[e]);const r=X.exports.useRef(e);return Jl(()=>{r.current!==e&&(r.current=e)},t),r}function jy(e,t){const r=X.exports.useRef();return X.exports.useMemo(()=>{const i=e(r.current);return r.current=i,i},[...t])}function Lb(e){const t=IE(e),r=X.exports.useRef(null),i=X.exports.useCallback(o=>{o!==r.current&&t?.(o,r.current),r.current=o},[]);return[r,i]}function N4(e){const t=X.exports.useRef();return X.exports.useEffect(()=>{t.current=e},[e]),t.current}let X5={};function $y(e,t){return X.exports.useMemo(()=>{if(t)return t;const r=X5[e]==null?0:X5[e]+1;return X5[e]=r,e+"-"+r},[e,t])}function n$(e){return function(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o{const l=Object.entries(s);for(const[u,c]of l){const d=a[u];d!=null&&(a[u]=d+e*c)}return a},{...t})}}const _h=n$(1),oy=n$(-1);function a_e(e){return"clientX"in e&&"clientY"in e}function RE(e){if(!e)return!1;const{KeyboardEvent:t}=Ds(e.target);return t&&e instanceof t}function s_e(e){if(!e)return!1;const{TouchEvent:t}=Ds(e.target);return t&&e instanceof t}function j4(e){if(s_e(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return a_e(e)?{x:e.clientX,y:e.clientY}:null}const ay=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(!!e)return[ay.Translate.toString(e),ay.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:i}=e;return t+" "+r+"ms "+i}}}),pO="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function l_e(e){return e.matches(pO)?e:e.querySelector(pO)}function u_e(e,t,r){const i={...e};return t.top+e.y<=r.top?i.y=r.top-t.top:t.bottom+e.y>=r.top+r.height&&(i.y=r.top+r.height-t.bottom),t.left+e.x<=r.left?i.x=r.left-t.left:t.right+e.x>=r.left+r.width&&(i.x=r.left+r.width-t.right),i}const c_e=e=>{let{containerNodeRect:t,draggingNodeRect:r,transform:i}=e;return!r||!t?i:u_e(i,r,t)},d_e=e=>{let{transform:t}=e;return{...t,x:0}},f_e={display:"none"};function p_e(e){let{id:t,value:r}=e;return L("div",{id:t,style:f_e,children:r})}const h_e={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function g_e(e){let{id:t,announcement:r}=e;return L("div",{id:t,style:h_e,role:"status","aria-live":"assertive","aria-atomic":!0,children:r})}function m_e(){const[e,t]=X.exports.useState("");return{announce:X.exports.useCallback(i=>{i!=null&&t(i)},[]),announcement:e}}const i$=X.exports.createContext(null);function y_e(e){const t=X.exports.useContext(i$);X.exports.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function v_e(){const[e]=X.exports.useState(()=>new Set),t=X.exports.useCallback(i=>(e.add(i),()=>e.delete(i)),[e]);return[X.exports.useCallback(i=>{let{type:o,event:a}=i;e.forEach(s=>{var l;return(l=s[o])==null?void 0:l.call(s,a)})},[e]),t]}const b_e={draggable:`
To pick up a draggable item, press the space bar.
While dragging, use the arrow keys to move the item.
Press space again to drop the item in its new position, or press escape to cancel.
- `},w_e={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function x_e(e){let{announcements:t=w_e,container:r,hiddenTextDescribedById:i,screenReaderInstructions:o=b_e}=e;const{announce:a,announcement:s}=m_e(),l=$y("DndLiveRegion"),[u,c]=X.exports.useState(!1);if(X.exports.useEffect(()=>{c(!0)},[]),y_e(X.exports.useMemo(()=>({onDragStart(p){let{active:v}=p;a(t.onDragStart({active:v}))},onDragMove(p){let{active:v,over:x}=p;t.onDragMove&&a(t.onDragMove({active:v,over:x}))},onDragOver(p){let{active:v,over:x}=p;a(t.onDragOver({active:v,over:x}))},onDragEnd(p){let{active:v,over:x}=p;a(t.onDragEnd({active:v,over:x}))},onDragCancel(p){let{active:v,over:x}=p;a(t.onDragCancel({active:v,over:x}))}}),[a,t])),!u)return null;const d=Ut(ta,{children:[L(p_e,{id:i,value:o.draggable}),L(g_e,{id:l,announcement:s})]});return r?ml.exports.createPortal(d,r):d}var xa;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(xa||(xa={}));function Nb(){}function J5(e,t){return X.exports.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function __e(){for(var e=arguments.length,t=new Array(e),r=0;r[...t].filter(i=>i!=null),[...t])}const eu=Object.freeze({x:0,y:0});function o$(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function a$(e,t){let{data:{value:r}}=e,{data:{value:i}}=t;return r-i}function S_e(e,t){let{data:{value:r}}=e,{data:{value:i}}=t;return i-r}function hO(e){let{left:t,top:r,height:i,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+i},{x:t+o,y:r+i}]}function s$(e,t){if(!e||e.length===0)return null;const[r]=e;return t?r[t]:r}function gO(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const C_e=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:i}=e;const o=gO(t,t.left,t.top),a=[];for(const s of i){const{id:l}=s,u=r.get(l);if(u){const c=o$(gO(u),o);a.push({id:l,data:{droppableContainer:s,value:c}})}}return a.sort(a$)},k_e=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:i}=e;const o=hO(t),a=[];for(const s of i){const{id:l}=s,u=r.get(l);if(u){const c=hO(u),d=o.reduce((v,x,b)=>v+o$(c[b],x),0),p=Number((d/4).toFixed(4));a.push({id:l,data:{droppableContainer:s,value:p}})}}return a.sort(a$)};function E_e(e,t){const r=Math.max(t.top,e.top),i=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),s=o-i,l=a-r;if(i{let{collisionRect:t,droppableRects:r,droppableContainers:i}=e;const o=[];for(const a of i){const{id:s}=a,l=r.get(s);if(l){const u=E_e(l,t);u>0&&o.push({id:s,data:{droppableContainer:a,value:u}})}}return o.sort(S_e)};function T_e(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function l$(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:eu}function I_e(e){return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),a=1;a({...s,top:s.top+e*l.y,bottom:s.bottom+e*l.y,left:s.left+e*l.x,right:s.right+e*l.x}),{...r})}}const R_e=I_e(1);function P_e(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function M_e(e,t,r){const i=P_e(t);if(!i)return e;const{scaleX:o,scaleY:a,x:s,y:l}=i,u=e.left-s-(1-o)*parseFloat(r),c=e.top-l-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),d=o?e.width/o:e.width,p=a?e.height/a:e.height;return{width:d,height:p,top:c,right:u+d,bottom:c+p,left:u}}const O_e={ignoreTransform:!1};function Mg(e,t){t===void 0&&(t=O_e);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{getComputedStyle:c}=Ds(e),{transform:d,transformOrigin:p}=c(e);d&&(r=M_e(r,d,p))}const{top:i,left:o,width:a,height:s,bottom:l,right:u}=r;return{top:i,left:o,width:a,height:s,bottom:l,right:u}}function mO(e){return Mg(e,{ignoreTransform:!0})}function B_e(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function U_e(e,t){return t===void 0&&(t=Ds(e).getComputedStyle(e)),t.position==="fixed"}function D_e(e,t){t===void 0&&(t=Ds(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const a=t[o];return typeof a=="string"?r.test(a):!1})}function Kx(e,t){const r=[];function i(o){if(t!=null&&r.length>=t||!o)return r;if(TE(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!Ny(o)||i_e(o)||r.includes(o))return r;const{getComputedStyle:a}=Ds(o),s=a(o);return o!==e&&D_e(o,s)&&r.push(o),U_e(o,s)?r:i(o.parentNode)}return e?i(e):r}function u$(e){const[t]=Kx(e,1);return t??null}function e3(e){return!qx||!e?null:Rg(e)?e:AE(e)?TE(e)||e===Pg(e).scrollingElement?window:Ny(e)?e:null:null}function c$(e){return Rg(e)?e.scrollX:e.scrollLeft}function d$(e){return Rg(e)?e.scrollY:e.scrollTop}function $4(e){return{x:c$(e),y:d$(e)}}var Ma;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Ma||(Ma={}));function f$(e){return!qx||!e?!1:e===document.scrollingElement}function p$(e){const t={x:0,y:0},r=f$(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,s=e.scrollTop>=i.y,l=e.scrollLeft>=i.x;return{isTop:o,isLeft:a,isBottom:s,isRight:l,maxScroll:i,minScroll:t}}const L_e={x:.2,y:.2};function N_e(e,t,r,i,o){let{top:a,left:s,right:l,bottom:u}=r;i===void 0&&(i=10),o===void 0&&(o=L_e);const{isTop:c,isBottom:d,isLeft:p,isRight:v}=p$(e),x={x:0,y:0},b={x:0,y:0},y={height:t.height*o.y,width:t.width*o.x};return!c&&a<=t.top+y.height?(x.y=Ma.Backward,b.y=i*Math.abs((t.top+y.height-a)/y.height)):!d&&u>=t.bottom-y.height&&(x.y=Ma.Forward,b.y=i*Math.abs((t.bottom-y.height-u)/y.height)),!v&&l>=t.right-y.width?(x.x=Ma.Forward,b.x=i*Math.abs((t.right-y.width-l)/y.width)):!p&&s<=t.left+y.width&&(x.x=Ma.Backward,b.x=i*Math.abs((t.left+y.width-s)/y.width)),{direction:x,speed:b}}function j_e(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:s}=window;return{top:0,left:0,right:a,bottom:s,width:a,height:s}}const{top:t,left:r,right:i,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:i,bottom:o,width:e.clientWidth,height:e.clientHeight}}function h$(e){return e.reduce((t,r)=>_h(t,$4(r)),eu)}function $_e(e){return e.reduce((t,r)=>t+c$(r),0)}function F_e(e){return e.reduce((t,r)=>t+d$(r),0)}function z_e(e,t){if(t===void 0&&(t=Mg),!e)return;const{top:r,left:i,bottom:o,right:a}=t(e);!u$(e)||(o<=0||a<=0||r>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const H_e=[["x",["left","right"],$_e],["y",["top","bottom"],F_e]];class PE{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const i=Kx(r),o=h$(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,s,l]of H_e)for(const u of s)Object.defineProperty(this,u,{get:()=>{const c=l(i),d=o[a]-c;return this.rect[u]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class l0{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...r)})},this.target=t}add(t,r,i){var o;(o=this.target)==null||o.addEventListener(t,r,i),this.listeners.push([t,r,i])}}function W_e(e){const{EventTarget:t}=Ds(e);return e instanceof t?e:Pg(e)}function t3(e,t){const r=Math.abs(e.x),i=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+i**2)>t:"x"in t&&"y"in t?r>t.x&&i>t.y:"x"in t?r>t.x:"y"in t?i>t.y:!1}var pl;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(pl||(pl={}));function yO(e){e.preventDefault()}function V_e(e){e.stopPropagation()}var zi;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(zi||(zi={}));const g$={start:[zi.Space,zi.Enter],cancel:[zi.Esc],end:[zi.Space,zi.Enter]},q_e=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case zi.Right:return{...r,x:r.x+25};case zi.Left:return{...r,x:r.x-25};case zi.Down:return{...r,y:r.y+25};case zi.Up:return{...r,y:r.y-25}}};class ME{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new l0(Pg(r)),this.windowListeners=new l0(Ds(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pl.Resize,this.handleCancel),this.windowListeners.add(pl.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(pl.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,i=t.node.current;i&&z_e(i),r(eu)}handleKeyDown(t){if(RE(t)){const{active:r,context:i,options:o}=this.props,{keyboardCodes:a=g$,coordinateGetter:s=q_e,scrollBehavior:l="smooth"}=o,{code:u}=t;if(a.end.includes(u)){this.handleEnd(t);return}if(a.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:c}=i.current,d=c?{x:c.left,y:c.top}:eu;this.referenceCoordinates||(this.referenceCoordinates=d);const p=s(t,{active:r,context:i.current,currentCoordinates:d});if(p){const v=oy(p,d),x={x:0,y:0},{scrollableAncestors:b}=i.current;for(const y of b){const _=t.code,{isTop:k,isRight:E,isLeft:B,isBottom:U,maxScroll:D,minScroll:j}=p$(y),F=j_e(y),H={x:Math.min(_===zi.Right?F.right-F.width/2:F.right,Math.max(_===zi.Right?F.left:F.left+F.width/2,p.x)),y:Math.min(_===zi.Down?F.bottom-F.height/2:F.bottom,Math.max(_===zi.Down?F.top:F.top+F.height/2,p.y))},W=_===zi.Right&&!E||_===zi.Left&&!B,G=_===zi.Down&&!U||_===zi.Up&&!k;if(W&&H.x!==p.x){const ae=y.scrollLeft+v.x,V=_===zi.Right&&ae<=D.x||_===zi.Left&&ae>=j.x;if(V&&!v.y){y.scrollTo({left:ae,behavior:l});return}V?x.x=y.scrollLeft-ae:x.x=_===zi.Right?y.scrollLeft-D.x:y.scrollLeft-j.x,x.x&&y.scrollBy({left:-x.x,behavior:l});break}else if(G&&H.y!==p.y){const ae=y.scrollTop+v.y,V=_===zi.Down&&ae<=D.y||_===zi.Up&&ae>=j.y;if(V&&!v.x){y.scrollTo({top:ae,behavior:l});return}V?x.y=y.scrollTop-ae:x.y=_===zi.Down?y.scrollTop-D.y:y.scrollTop-j.y,x.y&&y.scrollBy({top:-x.y,behavior:l});break}}this.handleMove(t,_h(oy(p,this.referenceCoordinates),x))}}}handleMove(t,r){const{onMove:i}=this.props;t.preventDefault(),i(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}ME.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:i=g$,onActivation:o}=t,{active:a}=r;const{code:s}=e.nativeEvent;if(i.start.includes(s)){const l=a.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function vO(e){return Boolean(e&&"distance"in e)}function bO(e){return Boolean(e&&"delay"in e)}class OE{constructor(t,r,i){var o;i===void 0&&(i=W_e(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:a}=t,{target:s}=a;this.props=t,this.events=r,this.document=Pg(s),this.documentListeners=new l0(this.document),this.listeners=new l0(i),this.windowListeners=new l0(Ds(s)),this.initialCoordinates=(o=j4(a))!=null?o:eu,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),this.windowListeners.add(pl.Resize,this.handleCancel),this.windowListeners.add(pl.DragStart,yO),this.windowListeners.add(pl.VisibilityChange,this.handleCancel),this.windowListeners.add(pl.ContextMenu,yO),this.documentListeners.add(pl.Keydown,this.handleKeydown),r){if(vO(r))return;if(bO(r)){this.timeoutId=setTimeout(this.handleStart,r.delay);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(pl.Click,V_e,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pl.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:i,initialCoordinates:o,props:a}=this,{onMove:s,options:{activationConstraint:l}}=a;if(!o)return;const u=(r=j4(t))!=null?r:eu,c=oy(o,u);if(!i&&l){if(bO(l))return t3(c,l.tolerance)?this.handleCancel():void 0;if(vO(l))return l.tolerance!=null&&t3(c,l.tolerance)?this.handleCancel():t3(c,l.distance)?this.handleStart():void 0}t.cancelable&&t.preventDefault(),s(u)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===zi.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const K_e={move:{name:"pointermove"},end:{name:"pointerup"}};class m$ extends OE{constructor(t){const{event:r}=t,i=Pg(r.target);super(t,K_e,i)}}m$.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:i}=t;return!r.isPrimary||r.button!==0?!1:(i?.({event:r}),!0)}}];const G_e={move:{name:"mousemove"},end:{name:"mouseup"}};var F4;(function(e){e[e.RightClick=2]="RightClick"})(F4||(F4={}));class y$ extends OE{constructor(t){super(t,G_e,Pg(t.event.target))}}y$.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:i}=t;return r.button===F4.RightClick?!1:(i?.({event:r}),!0)}}];const r3={move:{name:"touchmove"},end:{name:"touchend"}};class v$ extends OE{constructor(t){super(t,r3)}static setup(){return window.addEventListener(r3.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(r3.move.name,t)};function t(){}}}v$.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:i}=t;const{touches:o}=r;return o.length>1?!1:(i?.({event:r}),!0)}}];var u0;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(u0||(u0={}));var jb;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(jb||(jb={}));function Y_e(e){let{acceleration:t,activator:r=u0.Pointer,canScroll:i,draggingRect:o,enabled:a,interval:s=5,order:l=jb.TreeOrder,pointerCoordinates:u,scrollableAncestors:c,scrollableAncestorRects:d,delta:p,threshold:v}=e;const x=Z_e({delta:p,disabled:!a}),[b,y]=o_e(),_=X.exports.useRef({x:0,y:0}),k=X.exports.useRef({x:0,y:0}),E=X.exports.useMemo(()=>{switch(r){case u0.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case u0.DraggableRect:return o}},[r,o,u]),B=X.exports.useRef(null),U=X.exports.useCallback(()=>{const j=B.current;if(!j)return;const F=_.current.x*k.current.x,H=_.current.y*k.current.y;j.scrollBy(F,H)},[]),D=X.exports.useMemo(()=>l===jb.TreeOrder?[...c].reverse():c,[l,c]);X.exports.useEffect(()=>{if(!a||!c.length||!E){y();return}for(const j of D){if(i?.(j)===!1)continue;const F=c.indexOf(j),H=d[F];if(!H)continue;const{direction:W,speed:G}=N_e(j,H,E,t,v);for(const ae of["x","y"])x[ae][W[ae]]||(G[ae]=0,W[ae]=0);if(G.x>0||G.y>0){y(),B.current=j,b(U,s),_.current=G,k.current=W;return}}_.current={x:0,y:0},k.current={x:0,y:0},y()},[t,U,i,y,a,s,JSON.stringify(E),JSON.stringify(x),b,c,D,d,JSON.stringify(v)])}const Q_e={x:{[Ma.Backward]:!1,[Ma.Forward]:!1},y:{[Ma.Backward]:!1,[Ma.Forward]:!1}};function Z_e(e){let{delta:t,disabled:r}=e;const i=N4(t);return jy(o=>{if(r||!i||!o)return Q_e;const a={x:Math.sign(t.x-i.x),y:Math.sign(t.y-i.y)};return{x:{[Ma.Backward]:o.x[Ma.Backward]||a.x===-1,[Ma.Forward]:o.x[Ma.Forward]||a.x===1},y:{[Ma.Backward]:o.y[Ma.Backward]||a.y===-1,[Ma.Forward]:o.y[Ma.Forward]||a.y===1}}},[r,t,i])}function X_e(e,t){const r=t!==null?e.get(t):void 0,i=r?r.node.current:null;return jy(o=>{var a;return t===null?null:(a=i??o)!=null?a:null},[i,t])}function J_e(e,t){return X.exports.useMemo(()=>e.reduce((r,i)=>{const{sensor:o}=i,a=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,i)}));return[...r,...a]},[]),[e,t])}var sy;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(sy||(sy={}));var z4;(function(e){e.Optimized="optimized"})(z4||(z4={}));const wO=new Map;function e5e(e,t){let{dragging:r,dependencies:i,config:o}=t;const[a,s]=X.exports.useState(null),{frequency:l,measure:u,strategy:c}=o,d=X.exports.useRef(e),p=_(),v=iy(p),x=X.exports.useCallback(function(k){k===void 0&&(k=[]),!v.current&&s(E=>E===null?k:E.concat(k.filter(B=>!E.includes(B))))},[v]),b=X.exports.useRef(null),y=jy(k=>{if(p&&!r)return wO;if(!k||k===wO||d.current!==e||a!=null){const E=new Map;for(let B of e){if(!B)continue;if(a&&a.length>0&&!a.includes(B.id)&&B.rect.current){E.set(B.id,B.rect.current);continue}const U=B.node.current,D=U?new PE(u(U),U):null;B.rect.current=D,D&&E.set(B.id,D)}return E}return k},[e,a,r,p,u]);return X.exports.useEffect(()=>{d.current=e},[e]),X.exports.useEffect(()=>{p||x()},[r,p]),X.exports.useEffect(()=>{a&&a.length>0&&s(null)},[JSON.stringify(a)]),X.exports.useEffect(()=>{p||typeof l!="number"||b.current!==null||(b.current=setTimeout(()=>{x(),b.current=null},l))},[l,p,x,...i]),{droppableRects:y,measureDroppableContainers:x,measuringScheduled:a!=null};function _(){switch(c){case sy.Always:return!1;case sy.BeforeDragging:return r;default:return!r}}}function b$(e,t){return jy(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function t5e(e,t){return b$(e,t)}function r5e(e){let{callback:t,disabled:r}=e;const i=IE(t),o=X.exports.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(i)},[i,r]);return X.exports.useEffect(()=>()=>o?.disconnect(),[o]),o}function Gx(e){let{callback:t,disabled:r}=e;const i=IE(t),o=X.exports.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(i)},[r]);return X.exports.useEffect(()=>()=>o?.disconnect(),[o]),o}function n5e(e){return new PE(Mg(e),e)}function xO(e,t,r){t===void 0&&(t=n5e);const[i,o]=X.exports.useReducer(l,null),a=r5e({callback(u){if(!!e)for(const c of u){const{type:d,target:p}=c;if(d==="childList"&&p instanceof HTMLElement&&p.contains(e)){o();break}}}}),s=Gx({callback:o});return Jl(()=>{o(),e?(s?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),a?.disconnect())},[e]),i;function l(u){if(!e)return null;if(e.isConnected===!1){var c;return(c=u??r)!=null?c:null}const d=t(e);return JSON.stringify(u)===JSON.stringify(d)?u:d}}function i5e(e){const t=b$(e);return l$(e,t)}const _O=[];function o5e(e){const t=X.exports.useRef(e),r=jy(i=>e?i&&i!==_O&&e&&t.current&&e.parentNode===t.current.parentNode?i:Kx(e):_O,[e]);return X.exports.useEffect(()=>{t.current=e},[e]),r}function a5e(e){const[t,r]=X.exports.useState(null),i=X.exports.useRef(e),o=X.exports.useCallback(a=>{const s=e3(a.target);!s||r(l=>l?(l.set(s,$4(s)),new Map(l)):null)},[]);return X.exports.useEffect(()=>{const a=i.current;if(e!==a){s(a);const l=e.map(u=>{const c=e3(u);return c?(c.addEventListener("scroll",o,{passive:!0}),[c,$4(c)]):null}).filter(u=>u!=null);r(l.length?new Map(l):null),i.current=e}return()=>{s(e),s(a)};function s(l){l.forEach(u=>{const c=e3(u);c?.removeEventListener("scroll",o)})}},[o,e]),X.exports.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,s)=>_h(a,s),eu):h$(e):eu,[e,t])}function SO(e,t){t===void 0&&(t=[]);const r=X.exports.useRef(null);return X.exports.useEffect(()=>{r.current=null},t),X.exports.useEffect(()=>{const i=e!==eu;i&&!r.current&&(r.current=e),!i&&r.current&&(r.current=null)},[e]),r.current?oy(e,r.current):eu}function s5e(e){X.exports.useEffect(()=>{if(!qx)return;const t=e.map(r=>{let{sensor:i}=r;return i.setup==null?void 0:i.setup()});return()=>{for(const r of t)r?.()}},e.map(t=>{let{sensor:r}=t;return r}))}function l5e(e,t){return X.exports.useMemo(()=>e.reduce((r,i)=>{let{eventName:o,handler:a}=i;return r[o]=s=>{a(s,t)},r},{}),[e,t])}function w$(e){return X.exports.useMemo(()=>e?B_e(e):null,[e])}const n3=[];function u5e(e,t){t===void 0&&(t=Mg);const[r]=e,i=w$(r?Ds(r):null),[o,a]=X.exports.useReducer(l,n3),s=Gx({callback:a});return e.length>0&&o===n3&&a(),Jl(()=>{e.length?e.forEach(u=>s?.observe(u)):(s?.disconnect(),a())},[e]),o;function l(){return e.length?e.map(u=>f$(u)?i:new PE(t(u),u)):n3}}function c5e(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ny(t)?t:e}function d5e(e){let{measure:t}=e;const[r,i]=X.exports.useState(null),o=X.exports.useCallback(c=>{for(const{target:d}of c)if(Ny(d)){i(p=>{const v=t(d);return p?{...p,width:v.width,height:v.height}:v});break}},[t]),a=Gx({callback:o}),s=X.exports.useCallback(c=>{const d=c5e(c);a?.disconnect(),d&&a?.observe(d),i(d?t(d):null)},[t,a]),[l,u]=Lb(s);return X.exports.useMemo(()=>({nodeRef:l,rect:r,setRef:u}),[r,l,u])}const f5e=[{sensor:m$,options:{}},{sensor:ME,options:{}}],p5e={current:{}},y1={draggable:{measure:mO},droppable:{measure:mO,strategy:sy.WhileDragging,frequency:z4.Optimized},dragOverlay:{measure:Mg}};class c0 extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,i;return(r=(i=this.get(t))==null?void 0:i.node.current)!=null?r:void 0}}const h5e={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new c0,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Nb},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:y1,measureDroppableContainers:Nb,windowRect:null,measuringScheduled:!1},g5e={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Nb,draggableNodes:new Map,over:null,measureDroppableContainers:Nb},Yx=X.exports.createContext(g5e),x$=X.exports.createContext(h5e);function m5e(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new c0}}}function y5e(e,t){switch(t.type){case xa.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case xa.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case xa.DragEnd:case xa.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case xa.RegisterDroppable:{const{element:r}=t,{id:i}=r,o=new c0(e.droppable.containers);return o.set(i,r),{...e,droppable:{...e.droppable,containers:o}}}case xa.SetDroppableDisabled:{const{id:r,key:i,disabled:o}=t,a=e.droppable.containers.get(r);if(!a||i!==a.key)return e;const s=new c0(e.droppable.containers);return s.set(r,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case xa.UnregisterDroppable:{const{id:r,key:i}=t,o=e.droppable.containers.get(r);if(!o||i!==o.key)return e;const a=new c0(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function v5e(e){let{disabled:t}=e;const{active:r,activatorEvent:i,draggableNodes:o}=X.exports.useContext(Yx),a=N4(i),s=N4(r?.id);return X.exports.useEffect(()=>{if(!t&&!i&&a&&s!=null){if(!RE(a)||document.activeElement===a.target)return;const l=o.get(s);if(!l)return;const{activatorNode:u,node:c}=l;if(!u.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[u.current,c.current]){if(!d)continue;const p=l_e(d);if(p){p.focus();break}}})}},[i,t,o,s,a]),null}function b5e(e,t){let{transform:r,...i}=t;return e!=null&&e.length?e.reduce((o,a)=>a({transform:o,...i}),r):r}function w5e(e){return X.exports.useMemo(()=>({draggable:{...y1.draggable,...e?.draggable},droppable:{...y1.droppable,...e?.droppable},dragOverlay:{...y1.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function x5e(e){let{activeNode:t,measure:r,initialRect:i,config:o=!0}=e;const a=X.exports.useRef(!1),{x:s,y:l}=typeof o=="boolean"?{x:o,y:o}:o;Jl(()=>{if(!s&&!l||!t){a.current=!1;return}if(a.current||!i)return;const c=t?.node.current;if(!c||c.isConnected===!1)return;const d=r(c),p=l$(d,i);if(s||(p.x=0),l||(p.y=0),a.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const v=u$(c);v&&v.scrollBy({top:p.y,left:p.x})}},[t,s,l,i,r])}const _$=X.exports.createContext({...eu,scaleX:1,scaleY:1});var Kc;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Kc||(Kc={}));const _5e=X.exports.memo(function(t){var r,i,o,a;let{id:s,accessibility:l,autoScroll:u=!0,children:c,sensors:d=f5e,collisionDetection:p=A_e,measuring:v,modifiers:x,...b}=t;const y=X.exports.useReducer(y5e,void 0,m5e),[_,k]=y,[E,B]=v_e(),[U,D]=X.exports.useState(Kc.Uninitialized),j=U===Kc.Initialized,{draggable:{active:F,nodes:H,translate:W},droppable:{containers:G}}=_,ae=F?H.get(F):null,V=X.exports.useRef({initial:null,translated:null}),oe=X.exports.useMemo(()=>{var Tn;return F!=null?{id:F,data:(Tn=ae?.data)!=null?Tn:p5e,rect:V}:null},[F,ae]),P=X.exports.useRef(null),[ee,le]=X.exports.useState(null),[pe,_e]=X.exports.useState(null),J=iy(b,Object.values(b)),ft=$y("DndDescribedBy",s),Le=X.exports.useMemo(()=>G.getEnabled(),[G]),He=w5e(v),{droppableRects:nr,measureDroppableContainers:Bt,measuringScheduled:Rt}=e5e(Le,{dragging:j,dependencies:[W.x,W.y],config:He.droppable}),Jt=X_e(H,F),vr=X.exports.useMemo(()=>pe?j4(pe):null,[pe]),At=Kn(),kt=t5e(Jt,He.draggable.measure);x5e({activeNode:F?H.get(F):null,config:At.layoutShiftCompensation,initialRect:kt,measure:He.draggable.measure});const Ct=xO(Jt,He.draggable.measure,kt),Lt=xO(Jt?Jt.parentElement:null),Kt=X.exports.useRef({activatorEvent:null,active:null,activeNode:Jt,collisionRect:null,collisions:null,droppableRects:nr,draggableNodes:H,draggingNode:null,draggingNodeRect:null,droppableContainers:G,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),yr=G.getNodeFor((r=Kt.current.over)==null?void 0:r.id),ne=d5e({measure:He.dragOverlay.measure}),Mt=(i=ne.nodeRef.current)!=null?i:Jt,Nt=j?(o=ne.rect)!=null?o:Ct:null,Ie=Boolean(ne.nodeRef.current&&ne.rect),Ae=i5e(Ie?null:Ct),fe=w$(Mt?Ds(Mt):null),Be=o5e(j?yr??Jt:null),rt=u5e(Be),lt=b5e(x,{transform:{x:W.x-Ae.x,y:W.y-Ae.y,scaleX:1,scaleY:1},activatorEvent:pe,active:oe,activeNodeRect:Ct,containerNodeRect:Lt,draggingNodeRect:Nt,over:Kt.current.over,overlayNodeRect:ne.rect,scrollableAncestors:Be,scrollableAncestorRects:rt,windowRect:fe}),jt=vr?_h(vr,W):null,ce=a5e(Be),ie=SO(ce),de=SO(ce,[Ct]),$=_h(lt,ie),C=Nt?R_e(Nt,lt):null,T=oe&&C?p({active:oe,collisionRect:C,droppableRects:nr,droppableContainers:Le,pointerCoordinates:jt}):null,Q=s$(T,"id"),[ve,je]=X.exports.useState(null),ct=Ie?lt:_h(lt,de),ur=T_e(ct,(a=ve?.rect)!=null?a:null,Ct),Dr=X.exports.useCallback((Tn,In)=>{let{sensor:yt,options:Ei}=In;if(P.current==null)return;const Yn=H.get(P.current);if(!Yn)return;const Pi=Tn.nativeEvent,Ji=new yt({active:P.current,activeNode:Yn,event:Pi,options:Ei,context:Kt,onStart(eo){const Mo=P.current;if(Mo==null)return;const Wi=H.get(Mo);if(!Wi)return;const{onDragStart:pa}=J.current,ue={active:{id:Mo,data:Wi.data,rect:V}};ml.exports.unstable_batchedUpdates(()=>{pa?.(ue),D(Kc.Initializing),k({type:xa.DragStart,initialCoordinates:eo,active:Mo}),E({type:"onDragStart",event:ue})})},onMove(eo){k({type:xa.DragMove,coordinates:eo})},onEnd:qo(xa.DragEnd),onCancel:qo(xa.DragCancel)});ml.exports.unstable_batchedUpdates(()=>{le(Ji),_e(Tn.nativeEvent)});function qo(eo){return async function(){const{active:Wi,collisions:pa,over:ue,scrollAdjustedTranslate:Re}=Kt.current;let Ee=null;if(Wi&&Re){const{cancelDrop:q}=J.current;Ee={activatorEvent:Pi,active:Wi,collisions:pa,delta:Re,over:ue},eo===xa.DragEnd&&typeof q=="function"&&await Promise.resolve(q(Ee))&&(eo=xa.DragCancel)}P.current=null,ml.exports.unstable_batchedUpdates(()=>{k({type:eo}),D(Kc.Uninitialized),je(null),le(null),_e(null);const q=eo===xa.DragEnd?"onDragEnd":"onDragCancel";if(Ee){const Fe=J.current[q];Fe?.(Ee),E({type:q,event:Ee})}})}}},[H]),hr=X.exports.useCallback((Tn,In)=>(yt,Ei)=>{const Yn=yt.nativeEvent,Pi=H.get(Ei);if(P.current!==null||!Pi||Yn.dndKit||Yn.defaultPrevented)return;const Ji={active:Pi};Tn(yt,In.options,Ji)===!0&&(Yn.dndKit={capturedBy:In.sensor},P.current=Ei,Dr(yt,In))},[H,Dr]),Rr=J_e(d,hr);s5e(d),Jl(()=>{Ct&&U===Kc.Initializing&&D(Kc.Initialized)},[Ct,U]),X.exports.useEffect(()=>{const{onDragMove:Tn}=J.current,{active:In,activatorEvent:yt,collisions:Ei,over:Yn}=Kt.current;if(!In||!yt)return;const Pi={active:In,activatorEvent:yt,collisions:Ei,delta:{x:$.x,y:$.y},over:Yn};ml.exports.unstable_batchedUpdates(()=>{Tn?.(Pi),E({type:"onDragMove",event:Pi})})},[$.x,$.y]),X.exports.useEffect(()=>{const{active:Tn,activatorEvent:In,collisions:yt,droppableContainers:Ei,scrollAdjustedTranslate:Yn}=Kt.current;if(!Tn||P.current==null||!In||!Yn)return;const{onDragOver:Pi}=J.current,Ji=Ei.get(Q),qo=Ji&&Ji.rect.current?{id:Ji.id,rect:Ji.rect.current,data:Ji.data,disabled:Ji.disabled}:null,eo={active:Tn,activatorEvent:In,collisions:yt,delta:{x:Yn.x,y:Yn.y},over:qo};ml.exports.unstable_batchedUpdates(()=>{je(qo),Pi?.(eo),E({type:"onDragOver",event:eo})})},[Q]),Jl(()=>{Kt.current={activatorEvent:pe,active:oe,activeNode:Jt,collisionRect:C,collisions:T,droppableRects:nr,draggableNodes:H,draggingNode:Mt,draggingNodeRect:Nt,droppableContainers:G,over:ve,scrollableAncestors:Be,scrollAdjustedTranslate:$},V.current={initial:Nt,translated:C}},[oe,Jt,T,C,H,Mt,Nt,nr,G,ve,Be,$]),Y_e({...At,delta:W,draggingRect:C,pointerCoordinates:jt,scrollableAncestors:Be,scrollableAncestorRects:rt});const Gr=X.exports.useMemo(()=>({active:oe,activeNode:Jt,activeNodeRect:Ct,activatorEvent:pe,collisions:T,containerNodeRect:Lt,dragOverlay:ne,draggableNodes:H,droppableContainers:G,droppableRects:nr,over:ve,measureDroppableContainers:Bt,scrollableAncestors:Be,scrollableAncestorRects:rt,measuringConfiguration:He,measuringScheduled:Rt,windowRect:fe}),[oe,Jt,Ct,pe,T,Lt,ne,H,G,nr,ve,Bt,Be,rt,He,Rt,fe]),Nr=X.exports.useMemo(()=>({activatorEvent:pe,activators:Rr,active:oe,activeNodeRect:Ct,ariaDescribedById:{draggable:ft},dispatch:k,draggableNodes:H,over:ve,measureDroppableContainers:Bt}),[pe,Rr,oe,Ct,k,ft,H,ve,Bt]);return Ut(i$.Provider,{value:B,children:[Ut(Yx.Provider,{value:Nr,children:[L(x$.Provider,{value:Gr,children:L(_$.Provider,{value:ur,children:c})}),L(v5e,{disabled:l?.restoreFocus===!1})]}),L(x_e,{...l,hiddenTextDescribedById:ft})]});function Kn(){const Tn=ee?.autoScrollEnabled===!1,In=typeof u=="object"?u.enabled===!1:u===!1,yt=j&&!Tn&&!In;return typeof u=="object"?{...u,enabled:yt}:{enabled:yt}}}),S5e=X.exports.createContext(null),CO="button",C5e="Droppable";function k5e(e){let{id:t,data:r,disabled:i=!1,attributes:o}=e;const a=$y(C5e),{activators:s,activatorEvent:l,active:u,activeNodeRect:c,ariaDescribedById:d,draggableNodes:p,over:v}=X.exports.useContext(Yx),{role:x=CO,roleDescription:b="draggable",tabIndex:y=0}=o??{},_=u?.id===t,k=X.exports.useContext(_?_$:S5e),[E,B]=Lb(),[U,D]=Lb(),j=l5e(s,t),F=iy(r);Jl(()=>(p.set(t,{id:t,key:a,node:E,activatorNode:U,data:F}),()=>{const W=p.get(t);W&&W.key===a&&p.delete(t)}),[p,t]);const H=X.exports.useMemo(()=>({role:x,tabIndex:y,"aria-disabled":i,"aria-pressed":_&&x===CO?!0:void 0,"aria-roledescription":b,"aria-describedby":d.draggable}),[i,x,y,_,b,d.draggable]);return{active:u,activatorEvent:l,activeNodeRect:c,attributes:H,isDragging:_,listeners:i?void 0:j,node:E,over:v,setNodeRef:B,setActivatorNodeRef:D,transform:k}}function E5e(){return X.exports.useContext(x$)}const A5e="Droppable",T5e={timeout:25};function I5e(e){let{data:t,disabled:r=!1,id:i,resizeObserverConfig:o}=e;const a=$y(A5e),{active:s,dispatch:l,over:u,measureDroppableContainers:c}=X.exports.useContext(Yx),d=X.exports.useRef({disabled:r}),p=X.exports.useRef(!1),v=X.exports.useRef(null),x=X.exports.useRef(null),{disabled:b,updateMeasurementsFor:y,timeout:_}={...T5e,...o},k=iy(y??i),E=X.exports.useCallback(()=>{if(!p.current){p.current=!0;return}x.current!=null&&clearTimeout(x.current),x.current=setTimeout(()=>{c(Array.isArray(k.current)?k.current:[k.current]),x.current=null},_)},[_]),B=Gx({callback:E,disabled:b||!s}),U=X.exports.useCallback((H,W)=>{!B||(W&&(B.unobserve(W),p.current=!1),H&&B.observe(H))},[B]),[D,j]=Lb(U),F=iy(t);return X.exports.useEffect(()=>{!B||!D.current||(B.disconnect(),p.current=!1,B.observe(D.current))},[D,B]),Jl(()=>(l({type:xa.RegisterDroppable,element:{id:i,key:a,disabled:r,node:D,rect:v,data:F}}),()=>l({type:xa.UnregisterDroppable,key:a,id:i})),[i]),X.exports.useEffect(()=>{r!==d.current.disabled&&(l({type:xa.SetDroppableDisabled,id:i,key:a,disabled:r}),d.current.disabled=r)},[i,a,r,l]),{active:s,rect:v,isOver:u?.id===i,node:D,over:u,setNodeRef:j}}function S$(e,t,r){const i=e.slice();return i.splice(r<0?i.length+r:r,0,i.splice(t,1)[0]),i}function R5e(e,t){return e.reduce((r,i,o)=>{const a=t.get(i);return a&&(r[o]=a),r},Array(e.length))}function Hv(e){return e!==null&&e>=0}function P5e(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r{let{rects:t,activeIndex:r,overIndex:i,index:o}=e;const a=S$(t,i,r),s=t[o],l=a[o];return!l||!s?null:{x:l.left-s.left,y:l.top-s.top,scaleX:l.width/s.width,scaleY:l.height/s.height}},Wv={scaleX:1,scaleY:1},O5e=e=>{var t;let{activeIndex:r,activeNodeRect:i,index:o,rects:a,overIndex:s}=e;const l=(t=a[r])!=null?t:i;if(!l)return null;if(o===r){const c=a[s];return c?{x:0,y:rr&&o<=s?{x:0,y:-l.height-u,...Wv}:o=s?{x:0,y:l.height+u,...Wv}:{x:0,y:0,...Wv}};function B5e(e,t,r){const i=e[t],o=e[t-1],a=e[t+1];return i?ri.map(j=>typeof j=="object"&&"id"in j?j.id:j),[i]),b=s!=null,y=s?x.indexOf(s.id):-1,_=c?x.indexOf(c.id):-1,k=X.exports.useRef(x),E=!P5e(x,k.current),B=_!==-1&&y===-1||E,U=M5e(a);Jl(()=>{E&&b&&d(x)},[E,x,b,d]),X.exports.useEffect(()=>{k.current=x},[x]);const D=X.exports.useMemo(()=>({activeIndex:y,containerId:p,disabled:U,disableTransforms:B,items:x,overIndex:_,useDragOverlay:v,sortedRects:R5e(x,u),strategy:o}),[y,p,U.draggable,U.droppable,B,x,_,u,v,o]);return L(E$.Provider,{value:D,children:t})}const D5e=e=>{let{id:t,items:r,activeIndex:i,overIndex:o}=e;return S$(r,i,o).indexOf(t)},L5e=e=>{let{containerId:t,isSorting:r,wasDragging:i,index:o,items:a,newIndex:s,previousItems:l,previousContainerId:u,transition:c}=e;return!c||!i||l!==a&&o===s?!1:r?!0:s!==o&&t===u},N5e={duration:200,easing:"ease"},A$="transform",j5e=ay.Transition.toString({property:A$,duration:0,easing:"linear"}),$5e={roleDescription:"sortable"};function F5e(e){let{disabled:t,index:r,node:i,rect:o}=e;const[a,s]=X.exports.useState(null),l=X.exports.useRef(r);return Jl(()=>{if(!t&&r!==l.current&&i.current){const u=o.current;if(u){const c=Mg(i.current,{ignoreTransform:!0}),d={x:u.left-c.left,y:u.top-c.top,scaleX:u.width/c.width,scaleY:u.height/c.height};(d.x||d.y)&&s(d)}}r!==l.current&&(l.current=r)},[t,r,i,o]),X.exports.useEffect(()=>{a&&s(null)},[a]),a}function T$(e){let{animateLayoutChanges:t=L5e,attributes:r,disabled:i,data:o,getNewIndex:a=D5e,id:s,strategy:l,resizeObserverConfig:u,transition:c=N5e}=e;const{items:d,containerId:p,activeIndex:v,disabled:x,disableTransforms:b,sortedRects:y,overIndex:_,useDragOverlay:k,strategy:E}=X.exports.useContext(E$),B=z5e(i,x),U=d.indexOf(s),D=X.exports.useMemo(()=>({sortable:{containerId:p,index:U,items:d},...o}),[p,o,U,d]),j=X.exports.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:F,node:H,isOver:W,setNodeRef:G}=I5e({id:s,data:D,disabled:B.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...u}}),{active:ae,activatorEvent:V,activeNodeRect:oe,attributes:P,setNodeRef:ee,listeners:le,isDragging:pe,over:_e,setActivatorNodeRef:J,transform:ft}=k5e({id:s,data:D,attributes:{...$5e,...r},disabled:B.draggable}),Le=n_e(G,ee),He=Boolean(ae),nr=He&&!b&&Hv(v)&&Hv(_),Bt=!k&&pe,Rt=Bt&&nr?ft:null,vr=nr?Rt??(l??E)({rects:y,activeNodeRect:oe,activeIndex:v,overIndex:_,index:U}):null,At=Hv(v)&&Hv(_)?a({id:s,items:d,activeIndex:v,overIndex:_}):U,kt=ae?.id,Ct=X.exports.useRef({activeId:kt,items:d,newIndex:At,containerId:p}),Lt=d!==Ct.current.items,Kt=t({active:ae,containerId:p,isDragging:pe,isSorting:He,id:s,index:U,items:d,newIndex:Ct.current.newIndex,previousItems:Ct.current.items,previousContainerId:Ct.current.containerId,transition:c,wasDragging:Ct.current.activeId!=null}),yr=F5e({disabled:!Kt,index:U,node:H,rect:F});return X.exports.useEffect(()=>{He&&Ct.current.newIndex!==At&&(Ct.current.newIndex=At),p!==Ct.current.containerId&&(Ct.current.containerId=p),d!==Ct.current.items&&(Ct.current.items=d)},[He,At,p,d]),X.exports.useEffect(()=>{if(kt===Ct.current.activeId)return;if(kt&&!Ct.current.activeId){Ct.current.activeId=kt;return}const Mt=setTimeout(()=>{Ct.current.activeId=kt},50);return()=>clearTimeout(Mt)},[kt]),{active:ae,activeIndex:v,attributes:P,data:D,rect:F,index:U,newIndex:At,items:d,isOver:W,isSorting:He,isDragging:pe,listeners:le,node:H,overIndex:_,over:_e,setNodeRef:Le,setActivatorNodeRef:J,setDroppableNodeRef:G,setDraggableNodeRef:ee,transform:yr??vr,transition:ne()};function ne(){if(yr||Lt&&Ct.current.newIndex===U)return j5e;if(!(Bt&&!RE(V)||!c)&&(He||Kt))return ay.Transition.toString({...c,property:A$})}}function z5e(e,t){var r,i;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e?.draggable)!=null?r:t.draggable,droppable:(i=e?.droppable)!=null?i:t.droppable}}function $b(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const H5e=[zi.Down,zi.Right,zi.Up,zi.Left],W5e=(e,t)=>{let{context:{active:r,collisionRect:i,droppableRects:o,droppableContainers:a,over:s,scrollableAncestors:l}}=t;if(H5e.includes(e.code)){if(e.preventDefault(),!r||!i)return;const u=[];a.getEnabled().forEach(p=>{if(!p||p!=null&&p.disabled)return;const v=o.get(p.id);if(!!v)switch(e.code){case zi.Down:i.topv.top&&u.push(p);break;case zi.Left:i.left>v.left&&u.push(p);break;case zi.Right:i.left1&&(d=c[1].id),d!=null){const p=a.get(r.id),v=a.get(d),x=v?o.get(v.id):null,b=v?.node.current;if(b&&x&&p&&v){const _=Kx(b).some((j,F)=>l[F]!==j),k=I$(p,v),E=V5e(p,v),B=_||!k?{x:0,y:0}:{x:E?i.width-x.width:0,y:E?i.height-x.height:0},U={x:x.left,y:x.top};return B.x&&B.y?U:oy(U,B)}}}};function I$(e,t){return!$b(e)||!$b(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function V5e(e,t){return!$b(e)||!$b(t)||!I$(e,t)?!1:e.data.current.sortable.indext(!0),o=()=>t(!1);return X.exports.useEffect(()=>{const a=r.current;if(a)return a.addEventListener("mouseover",i),a.addEventListener("mouseout",o),()=>{a.removeEventListener("mouseover",i),a.removeEventListener("mouseout",o)}},[r.current]),{hoverRef:r,isHover:e}}const K5e="/assets/delete.42fb1897.svg",G5e="/assets/dnd.dcf4594c.svg",Y5e=Xi("input")({display:"flex",alignItems:"center",width:300,height:44,background:"#FFFFFF",border:"1px solid #D8D8D8",borderRadius:"12px",fontSize:14,fontFamily:"Mulish",paddingLeft:10,outline:"none","&:hover":{border:"1px solid #b0b0b0"},"&:focus":{border:"1px solid #807e7e"}}),rs=Xi(j6)({border:"none",padding:0}),qp=Xi(j6)({fontWeight:700}),Fl=Xi("hr")({display:"block",width:"100%",height:1,backgroundColor:"#ccc",border:"none"}),Q5e=e=>e.replace(/\/+/g,"/").replace(/^\/[^\/]/,"").replace(/\/$/,"");function kO({file:e,pos:t,isHover:r}){const i=e.fileObj.name,{attributes:o,listeners:a}=T$({id:i}),s=la(),l=aa(s.breakpoints.down("lg")),{setInclueInCommand:u,setDirectory:c,removeFile:d}=zu(),{data:p}=Hu(),v=!!p?.result?.msgCell;return Ut(ta,{children:[L(rs,{sx:{paddingLeft:1},...o,...a,children:Ut($n,{sx:{color:"#D8D8D8"},children:[t,".",L($n,{ml:5,style:{cursor:"pointer",visibility:r?"visible":"hidden"},children:L("img",{src:G5e,alt:"Drag n drop icon",width:24,height:24})})]})}),L(rs,{children:L(Y5e,{disabled:v,value:e.folder,onBlur:x=>{c(i,Q5e(x.target.value))},onChange:x=>{c(i,x.target.value)}})}),L(rs,{sx:{paddingLeft:l?2:0},children:Ut($n,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"flex-start"},children:[L(jo,{sx:{fontSize:14},children:e.fileObj.name}),Ut(jo,{sx:{fontSize:12,color:"#C1C1C1"},children:[e.fileObj.size," bytes"]})]})}),L(rs,{children:L(woe,{disabled:v,checked:e.includeInCommand,onChange:x=>{u(i,x.target.checked)}})}),L(rs,{align:"right",children:L(Bs,{sx:{visibility:r?"visible":"hidden",opacity:.5,cursor:"pointer",marginRight:1},onClick:()=>{d(i)},children:L("img",{src:K5e,alt:"Delete icon",width:18,height:18})})})]})}function Z5e({file:e,pos:t}){const r=e.fileObj.name,{hoverRef:i,isHover:o}=q5e(),{data:a}=Hu(),s=!!a?.result?.msgCell,{setNodeRef:l,transform:u,transition:c,isDragging:d}=T$({id:r}),p={transform:ay.Transform.toString(u),transition:c};return s?L(xc,{sx:{height:60},children:L(kO,{file:e,pos:t,isDragging:!1,isHover:!1})}):L(xc,{sx:{height:60,transition:".15s all","&:hover":{background:"#FAFAFA"}},ref:v=>{l(v),i.current=v},style:p,children:L(kO,{file:e,pos:t,isDragging:d,isHover:o})},r)}function X5e(){const{files:e,reorderFiles:t}=zu(),{data:r}=Hu(),i=la(),o=aa(i.breakpoints.down("lg")),a=!!r?.result?.msgCell,s=__e(J5(y$,{}),J5(v$,{}),J5(ME,{coordinateGetter:W5e}));function l(u){const{active:c,over:d}=u;c.id!==d.id&&t(c.id,d.id)}return L(_5e,{sensors:s,collisionDetection:C_e,onDragEnd:l,modifiers:[d_e,c_e],children:L(Xoe,{children:Ut(L6,{sx:{minWidth:650},children:[Ut(z7,{sx:{"&.MuiTableHead-root th":{border:"none"}},children:[Ut(xc,{sx:{fontWeight:700},children:[L(qp,{sx:{paddingLeft:0,paddingBottom:o?0:2,width:100},children:"Order"}),L(qp,{sx:{paddingLeft:0,paddingBottom:o?0:2},children:"Directory"}),L(qp,{sx:{paddingLeft:o?2:0,width:300,paddingBottom:o?0:2},children:"File"}),L(qp,{sx:{paddingLeft:0,width:150,paddingBottom:o?0:2},children:"Include in command"}),L(qp,{sx:{paddingLeft:0,width:100,paddingBottom:o?0:2}})]}),Ut(xc,{children:[L(rs,{sx:{paddingBottom:o?0:2},children:L(Fl,{})}),L(rs,{sx:{paddingBottom:o?0:2},children:L(Fl,{})}),L(rs,{sx:{paddingBottom:o?0:2},children:L(Fl,{})}),L(rs,{sx:{paddingBottom:o?0:2},children:L(Fl,{})}),L(rs,{sx:{paddingBottom:o?0:2},children:L(Fl,{})})]})]}),L(N6,{children:L(U5e,{disabled:a,items:e.map(u=>u.fileObj.name),strategy:O5e,children:e.map((u,c)=>L(Z5e,{file:u,pos:c+1},u.fileObj.name))})})]})})})}const i3=Xi(k7)({flexGrow:1}),o3=Xi(j7)(({theme:e})=>({borderRadius:e.spacing(1.2),height:e.spacing(5.3),minWidth:150,".MuiOutlinedInput-notchedOutline":{border:"1px solid #D8D8D8"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{border:"1px solid #807e7e"},"&:hover .MuiOutlinedInput-notchedOutline":{border:"1px solid #b0b0b0"}})),Vv=Xi(E7)(({theme:e})=>({color:"#000",fontSize:12,marginLeft:e.spacing(1),marginBottom:e.spacing(1)})),J5e=Xi("input")(({theme:e})=>({display:"flex",alignItems:"center",boxSizing:"border-box",width:"100%",flex:2,height:e.spacing(5.3),borderRadius:e.spacing(1.2),border:"1px solid #D8D8D8",outline:"none",padding:"0 40px 0 125px",color:"#000",background:"transparent",fontFamily:"Mulish",fontSize:14,"&:hover":{border:"1px solid #b0b0b0"},"&:focus":{border:"1px solid #807e7e"}})),e3e="/assets/undo.944d3e45.svg";function t3e(){const{compilerSettings:e,setOverrideCommandLine:t,setFuncCliVersion:r,setTactCliVersion:i,compiler:o,setCompiler:a}=cE(),{data:s}=Hu(),l=la(),u=aa(l.breakpoints.down("md")),c=!!s?.result?.msgCell,{data:{funcVersions:d,tactVersions:p}}=uE();return Ut(da,{mt:4,children:[L(jo,{variant:"h5",style:{fontWeight:800,fontSize:16,marginBottom:16},children:"Compiler"}),Ut($n,{sx:{gap:1,alignItems:u?"center":"flex-end",flexDirection:u?"column":"inherit"},children:[L($n,{mb:u?1:0,sx:{width:u?"100%":"inherit"},children:Ut(i3,{children:[L(Vv,{children:"Compiler"}),Ut(o3,{value:o,onChange:v=>{a(v.target.value)},children:[L(rm,{value:"func",children:"func"}),L(rm,{value:"tact",children:"tact"}),{}.VITE_ALLOW_FIFT&&L(rm,{value:"fift",children:"fift"})]})]})}),o==="func"&&Ut(ta,{children:[L($n,{mb:u?1:0,sx:{width:u?"100%":"inherit"},children:Ut(i3,{disabled:c,children:[L(Vv,{children:"Version"}),L(o3,{value:e.funcVersion,onChange:v=>{r(v.target.value)},children:d?.map(v=>L(rm,{value:v,children:v},v))})]})}),Ut(da,{sx:{width:"100%",position:"relative"},children:[L(Vv,{sx:{display:"block"},children:"Func command"}),L(J5e,{disabled:c,value:e.commandLine,onChange:v=>{t(v.target.value)}}),L(Fee,{sx:{position:"absolute",left:3,top:28,height:37,background:"#F5F5F5",borderRadius:1.5,color:"#000",fontSize:14},label:"func -o tmp.fif"}),!!e.overrideCommandLine&&L(Bs,{sx:{color:"blue",position:"absolute",right:10,top:31},onClick:()=>{t(null)},children:L("img",{src:e3e,alt:"Undo icon",width:15,height:15})})]})]}),o==="tact"&&L(ta,{children:L($n,{mb:u?1:0,sx:{width:u?"100%":"inherit"},children:Ut(i3,{disabled:c,children:[L(Vv,{children:"Version"}),L(o3,{value:e.tactVersion,disabled:!0,children:p?.map(v=>L(rm,{value:v,children:v},v))})]})})})]})]})}const r3e="/assets/reorder-hint.5f3a54fb.svg",n3e="/assets/light-bulb.7768be40.svg",R$="/assets/like.af7e7b33.svg",i3e=sr(kn)({maxWidth:1160,width:"calc(100% - 50px)",margin:"auto"}),o3e=sr(kn)({display:"flex",justifyContent:"space-between",height:73}),a3e=sr(kn)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:e.spacing(1.5)})),s3e=sr(kn)(({theme:e})=>({display:"flex",flexWrap:"wrap",justifyContent:"space-between",marginTop:e.spacing(3),marginBottom:e.spacing(2),color:"#728A96",fontSize:14,[e.breakpoints.down("md")]:{"& > *":{marginBottom:`${e.spacing(1)} !important`}}})),l3e=sr("hr")({height:"1px",backgroundColor:"#e6e6e6",border:"none"}),EO=sr(uc)(({theme:e})=>({display:"inline-flex",alignItems:"center",color:"inherit",textDecoration:"none",[e.breakpoints.down("md")]:{justifyContent:"flex-end"}})),Fy=sr(kn)({display:"flex",justifyContent:"center",alignItems:"center"}),u3e=sr(Fy)(({theme:e})=>({[e.breakpoints.down("md")]:{minWidth:"100%",flex:2,order:3}})),P$=sr(Fy)(({theme:e})=>({[e.breakpoints.down("md")]:{minWidth:"50%"}})),c3e=sr(P$)(({theme:e})=>({[e.breakpoints.down("md")]:{justifyContent:"start"},[e.breakpoints.down("sm")]:{minWidth:100}})),d3e=sr(P$)(({theme:e})=>({[e.breakpoints.down("md")]:{justifyContent:"end"},[e.breakpoints.down("sm")]:{minWidth:100}})),f3e="/assets/heart.52fe96d0.svg",p3e="/assets/orbs.eb35e74b.svg",h3e="/assets/telegram.bcba2ca3.svg",g3e="/assets/telegram-hover.72b9d3ce.svg",m3e="/assets/github-footer.0bd3bbab.svg",y3e="/assets/github-hover.33daf3ef.svg",AO=sr(kn)(e=>({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"center",width:t.spacing(3),height:t.spacing(3),background:`url(${e.iconUrl})`,"&:hover":{transitionDuration:".25s",background:`url(${e.disabled?e.iconUrl:e.hoveredIconUrl})`,cursor:e.disabled?"cursor":"pointer"}})),TO=({iconUrl:e,hoveredIconUrl:t,link:r})=>r.length?L(uc,{target:"_blank",href:r,children:L(AO,{iconUrl:e,hoveredIconUrl:t})}):L(AO,{iconUrl:e,hoveredIconUrl:t,disabled:!0});function M$(){const e=QC(),[t,r]=yw();return()=>{t.has("testnet")?t.delete("testnet"):t.append("testnet",""),r(t),e(0)}}function BE(){const e=M$();return L(kn,{sx:{background:"red",color:"white",py:2},children:Ut(wE,{sx:{gap:4,px:4},children:[L(jo,{sx:{fontWeight:"bold",flexGrow:1},children:"Testnet"}),L(jo,{onClick:()=>{e()},sx:{cursor:"pointer"},children:"Switch to mainnet"})]})})}const H4="https://t.me/tonverifier";function Fb(){const e=aa("(max-width: 450px)"),t=Ac(),r=M$();return Ut(i3e,{children:[Ut(o3e,{mb:e?5:"inherit",sx:{flexDirection:e?"column":"inherit",alignItems:e?"center":"inherit"},children:[L($n,{children:Ut(ap,{sx:{color:"#000"},onClick:()=>t("/"),children:[L("img",{src:vw,alt:"App icon",width:30,height:30}),L(cx,{children:"TON VERIFIER"})]})}),Ut(a3e,{children:[L(TO,{iconUrl:h3e,hoveredIconUrl:g3e,link:H4}),L(TO,{iconUrl:m3e,hoveredIconUrl:y3e,link:"https://github.com/orbs-network/ton-contract-verifier"})]})]}),L(l3e,{}),Ut(s3e,{children:[L(c3e,{children:L(jo,{variant:"body2",children:"\xA9 2023"})}),L(u3e,{children:Ut($n,{sx:{gap:.1},children:["Contributed with",L($n,{mx:.4,children:L("img",{src:f3e,alt:"Heart",width:12,height:12})}),"by",L($n,{mx:.4,children:L("img",{src:p3e,alt:"Orbs logo",width:12,height:12})}),L(EO,{sx:{color:"#5E75E8"},target:"_blank",href:"https://orbs.com/powered-by",children:"Orbs"})]})}),Ut(d3e,{children:[L(EO,{target:"_blank",href:H4,children:L(jo,{variant:"body2",children:"Support"})}),!window.isTestnet&&L(jo,{onClick:()=>{r()},sx:{ml:2,cursor:"pointer"},variant:"body2",children:"Switch to Testnet"})]})]})]})}const v3e=sr("li")({maxWidth:650,fontSize:14,fontWeight:400,marginBottom:10});function b3e(e,t){switch(e){case Na.ENTRYPOINT_MISSING:return"There usually should be at least one file containing an entrypoint (recv_internal, main)";case Na.STDLIB_ORDER:return"stdlib.fc should usually be the first file in the list (unless it's imported from another file)";case Na.STDLIB_MISSING:return"You can try to add stdlib.fc to your sources.";case Na.NOT_SIMILAR:return"Source code compiles correctly but does not match the on-chain contract hash. Make sure you are using the correct compiler version, command line and file order.";case Na.FILE_ORDER:return"Make sure all files in the command line are in the correct order";case Na.COMPILER_VERSION:return"Try to use the same compiler version as the contract was compiled with";case Na.REQUIRED_FILES:return"Make sure all required files are included in the command line";case Na.SUPPORT_GROUP:return Ut("div",{children:["If you are still facing issues, you can use the"," ",L(uc,{target:"_blank",href:H4,sx:{textDecoration:"none",cursor:"pointer"},children:"Telegram support group"})]})}}const w3e=({hint:e})=>{const{data:t}=Hu();return L(v3e,{children:b3e(e,t?.result.compileResult)})},Dd=sr(jo)({fontSize:14,fontWeight:400,marginBottom:"10px"}),IO=sr(jo)({fontSize:14,fontWeight:700}),O$=sr(jo)({fontSize:14,fontWeight:400}),RO=sr($n)({padding:"20px 30px",paddingLeft:0,"&:hover":{background:"transparent"}}),PO=sr(Tj)({minWidth:200,fontSize:14,fontWeight:600}),x3e=sr(da)({borderBottom:"1px solid rgba(0, 0, 0, 0.2)"}),MO=sr(Ij)({color:"#000",fontSize:14,fontWeight:400});function _3e(){const{data:e,error:t}=Hu(),{data:r}=vp(),i=e?.result?.compileResult,o=e?.hints??[];return Ut(da,{my:3,children:[["similar"].includes(i?.result??"")&&L(Cs,{singleLine:!0,type:ps.SUCCESS,title:Ut($n,{sx:{height:42},children:[L($n,{mr:1,children:L("img",{src:R$,alt:"Like icon",width:31,height:31})}),Ut(O$,{children:[" ",L("b",{children:"Great!"})," Compile output hash matches this on-chain contract"]})]}),notificationBody:L(da,{})}),["not_similar"].includes(i?.result??"")&&L(Cs,{type:ps.ERROR,title:Ut($n,{children:[L($n,{mr:1,children:L("img",{src:r3e,alt:"Reorder icon",width:39,height:26})}),L(IO,{children:"Hashes are not similar"})]}),notificationBody:Ut(da,{sx:{display:"flex",flexDirection:"column"},children:[Ut(RO,{children:[L(PO,{children:"Contract hash"}),L(MO,{children:r?.codeCellHash.base64??"-"})]}),L(x3e,{}),Ut(RO,{children:[L(PO,{children:"Compile output hash"}),L(MO,{children:i?.hash??"-"})]})]})}),i?.error&&L(Cs,{type:ps.ERROR,title:Ut(Dd,{children:[L("span",{style:{color:"#FC5656"},children:"Error: "}),"Compile error"]}),notificationBody:L(da,{sx:{overflow:"auto",maxHeight:300},children:L("div",{children:L("code",{children:i.error})})})}),!!t&&L(Cs,{type:ps.ERROR,title:Ut(Dd,{children:[L("span",{style:{color:"#FC5656"},children:"Error: "}),"Server error"]}),notificationBody:L(da,{sx:{overflow:"auto",maxHeight:300},children:L("div",{children:L("code",{children:t.toString()})})})}),o.length>0&&L(Cs,{type:ps.HINT,title:Ut($n,{mb:2,children:[L($n,{mr:1,children:L("img",{src:n3e,alt:"Light bulb icon",width:21,height:22})}),L(IO,{children:"Possible reasons for failure"})]}),notificationBody:L("ul",{style:{paddingLeft:25},children:o.map(a=>L(w3e,{hint:a},a))})})]})}function B$(){const[e]=kg();return L(Ha,{background:"#1976d2",hoverBackground:"#156cc2",height:37,fontSize:14,fontWeight:700,textColor:"#fff",type:"button",onClick:()=>e.connectWallet(),children:"Connect wallet"})}const S3e=Xi(da)({padding:"15px 24px"});function C3e(){const e=Bx(),{hasFiles:t}=zu(),{step:r,proceedToPublish:i,toggleSection:o,currentSection:a}=Vx(),{mutate:s,data:l,error:u,isLoading:c,compileStatus:d}=Hu(),p=!!l?.result?.msgCell,v=()=>o(sc.SOURCES);return Ut(ug,{children:[L(da,{sx:{cursor:r===hc.PUBLISH&&p?"pointer":"inherit"},onClick:v,children:L(r_e,{})}),a===sc.SOURCES&&L(vy,{in:a===sc.SOURCES,children:L(S3e,{children:Ut(ta,{children:[t()&&Ut(ta,{children:[L(X5e,{}),L(t3e,{})]}),(l||u)&&L(_3e,{}),t()&&L($n,{sx:{justifyContent:"center"},mt:3,mb:"9px",children:e?l?.result?.msgCell?L(Ha,{disabled:r===hc.PUBLISH,fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:i,children:"Ready to publish"}):Ut(Ha,{disabled:!t(),fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{s(null)},children:[c&&L(lg,{sx:{color:"#fff",height:"20px !important",width:"20px !important"}}),"Compile"]}):L(B$,{})})]})})})]})}const k3e=sr(c2)({borderRadius:40,fontFamily:"inherit",fontWeight:700,textTransform:"none",background:"#0088CC","&:disabled":{backgroundColor:"#e0e0e0"}});function nd(e){return L(k3e,{disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,variant:"contained",disabled:e.disabled,onClick:e.disabled?void 0:e.onClick,...e,children:e.text})}const E3e="/assets/publish.83df630b.svg";function A3e(){const{data:e}=Hu(),{sendTXN:t,status:r,clearTXN:i}=rj(),{step:o,toggleSection:a,currentSection:s}=Vx();zu();const l=!!e?.result?.msgCell;let u;const c=()=>o===hc.PUBLISH&&l&&a(sc.PUBLISH);switch(r){case"initial":u=L("span",{children:"To store your contract\u2019s verification proof on-chain, you will need to issue a transaction. This will cost 0.5 TON"});break;case"rejected":u="Transaction rejected, please retry.";break;case"pending":u="Check your wallet for a pending transaction.";break;case"issued":u="Transaction issued, monitoring proof deployment on-chain.";break;case"success":u="Your contract is now verified! Click below to view it.";break;case"expired":u="Transaction expired, please retry.";break;case"error":u="The transaction is taking too long to complete or have failed. Please use a blockchain explorer to monitor it. You can also use our telegram support group."}return Ut(ug,{mb:6,children:[Ut($n,{p:s===sc.PUBLISH?"30px 24px 0 24px":"20px 24px",onClick:c,sx:{opacity:o===hc.PUBLISH&&l?1:.25,cursor:o===hc.PUBLISH&&l?"pointer":"inherit"},children:[L(cg,{children:L("img",{src:r==="success"?r$:E3e,alt:"publish icon",width:41,height:41})}),L(Fd,{children:"Publish"})]}),s===sc.PUBLISH&&l&&L(vy,{in:s===sc.PUBLISH,children:Ut(da,{children:[L(da,{sx:{padding:"0 30px"},children:L(Cs,{type:ps.INFO,title:L(ta,{}),notificationBody:L($n,{sx:{overflow:"auto",maxHeight:300},children:L(Dd,{sx:{marginBottom:0},children:u})})})}),Ut($n,{mb:3,sx:{justifyContent:"center"},children:[r!=="success"&&Ut(Ha,{disabled:r==="pending"||r==="issued",fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{t()},children:[(r==="pending"||r==="issued")&&L(lg,{sx:{color:"#fff",height:"20px !important",width:"20px !important"}}),"Publish"]}),r==="success"&&L(nd,{sx:{height:44},text:"View verified contract",onClick:()=>{location.reload()}})]})]})})]})}const T3e="/assets/verification-alert.0ebcec4f.svg",I3e="/assets/verification-binary.d6844d86.svg",R3e="/assets/verification-bomb.3bf48d9c.svg",P3e="/assets/verification-paper.34a39e79.svg",M3e="/assets/show.836c8f4f.svg",O3e="/assets/verification.fbd44dba.svg",B3e=Xi(Bs)(()=>({color:"#000"})),U3e=Xi(da)({display:"flex",alignItems:"center",flexDirection:"column","& .title":{texAlign:"center",fontWeight:500,fontSize:20,marginBottom:20},"& .base-button":{height:40,marginTop:30}});function D3e({open:e,onClose:t,children:r,backgroundColor:i="rgba(48, 48, 48, 0.4)",blur:o=!0,className:a="",maxWidth:s,hideCloseButton:l,paddingTop:u}){return L(rre,{className:`${a} ${o&&"popup-filter"}`,fullWidth:!0,onClose:t,open:e,PaperProps:{style:{maxWidth:s||"unset",width:"100%",borderRadius:"10px",padding:0,overflow:"unset",margin:20}},BackdropProps:{style:{backgroundColor:i}},children:Ut(da,{sx:{overflow:"scroll","::-webkit-scrollbar":{display:"none"}},children:[!l&&L(da,{sx:{display:"flex",justifyContent:"end",width:"100%"},children:L(B3e,{onClick:t,children:L(Ck,{style:{width:23,height:23}})})}),L(U3e,{px:3,pb:3,pt:u?3:0,children:r})]})})}const L3e="/assets/verification-popup.1a3fc640.svg",N3e=sr(L6)({overflow:"scroll",background:"#F7F9FB",borderRadius:"5px",width:"100%"}),j3e=sr(kn)({background:"#F7F9FB",borderRadius:"5px",width:"100%"}),$3e=sr(z7)({"&.MuiTableHead-root th":{border:"none",fontSize:13}}),F3e=sr(xc)({fontWeight:700}),$p=sr(qp)({paddingLeft:0,paddingBottom:"2px"}),Fp=sr(rs)({paddingBottom:10}),z3e=sr($n)({width:59,height:21,background:"#08D088",borderRadius:40,color:"#fff",justifyContent:"space-around",fontSize:12}),id=sr(rs)({paddingBottom:16}),H3e=sr(uc)({textDecoration:"none",cursor:"pointer",color:"#0088CC"}),W3e=sr(kn)({width:"100%",display:"flex",justifyContent:"flex-end"}),a3=sr(jo)({color:"#728A96",fontSize:14}),V3e=sr(Fd)({fontSize:18,fontWeight:800,color:"#000",textAlign:"center"}),q3e=sr(kn)({display:"inline-flex",alignItems:"center",height:"20px",padding:"0 7px",background:"rgba(146, 146, 146, 0.3)",borderRadius:"10px",color:"#212121",fontWeight:400,fontSize:"14px",fontFamily:"IBM Plex Mono, monospace"});sr(q3e)({position:"relative",top:5,display:"inline-block",whiteSpace:"nowrap",lineHeight:"20px",width:"100%",maxWidth:600,overflow:"hidden",textOverflow:"ellipsis"});const K3e="/assets/verified.4e0dc210.svg",Am=()=>L(Xa,{width:"85%",variant:"text",sx:{transform:"none",background:"#e6e8eb"}}),G3e=()=>Ut($3e,{children:[Ut(F3e,{children:[L($p,{sx:{width:80,paddingLeft:3},children:"Status"}),L($p,{sx:{width:370},children:"Public Key"}),L($p,{sx:{width:35}}),L($p,{sx:{width:105},children:"IP"}),L($p,{sx:{width:150},children:"Verification date"}),L($p,{sx:{width:100},children:"Verifier"})]}),Ut(xc,{children:[L(Fp,{children:L(Fl,{})}),L(Fp,{children:L(Fl,{})}),L(Fp,{children:L(Fl,{})}),L(Fp,{children:L(Fl,{})}),L(Fp,{children:L(Fl,{})}),L(Fp,{children:L(Fl,{})})]})]}),OO=()=>Ut(xc,{children:[L(rs,{sx:{paddingLeft:3,paddingBottom:2},children:L(Am,{})}),L(id,{children:L(Am,{})}),L(id,{children:L(Xa,{width:25,variant:"text",sx:{transform:"none",background:"#e6e8eb"}})}),L(id,{children:L(Am,{})}),L(id,{children:L(Am,{})}),L(rs,{sx:{paddingRight:3,paddingBottom:2},children:L(Am,{})})]}),Y3e=({pubKey:e,endpoint:t,name:r,onCopy:i,date:o,url:a})=>Ut(xc,{children:[L(rs,{sx:{paddingLeft:3,paddingBottom:2},children:Ut(z3e,{px:1,children:[L("img",{src:K3e,alt:"Verified icon",width:11,height:11}),"Verified"]})}),L(id,{children:L(a3,{children:e})}),L(id,{children:L(Bs,{onClick:()=>i(e),sx:{padding:.5},children:L("img",{src:Wx,alt:"Copy icon",width:16,height:16})})}),L(id,{children:L(a3,{children:t})}),L(id,{children:L(a3,{children:o})}),L(rs,{sx:{paddingRight:3,paddingBottom:2},children:L($n,{children:L(H3e,{target:"_blank",href:a,children:r})})})]});function Q3e(){const{data:e,isLoading:t,error:r}=Pc(),{data:i,isLoading:o,error:a}=zx(),{showNotification:s}=Ry(),l=i?.find(c=>c.name===window.verifierId),u=X.exports.useCallback(async c=>{navigator.clipboard.writeText(c),s("Copied to clipboard!","success")},[]);return Ut(kn,{sx:{overflow:"scroll",borderRadius:"5px","::-webkit-scrollbar":{display:"none"}},children:[Ut(N3e,{sx:{minWidth:900},children:[L(G3e,{}),L(N6,{children:t||o?Ut(ta,{children:[L(OO,{}),L(OO,{})]}):l&&e&&Object.entries(l.pubKeyEndpoints).map(([c,d])=>L(Y3e,{pubKey:c,onCopy:u,url:l.url,date:e?.verificationDate?.toLocaleDateString()||"",endpoint:d,name:l.name},c))})]}),(!!r||!!a)&&`${r} ${a} (App notification)`]})}const Z3e="modulepreload",X3e=function(e){return"/"+e},BO={},Tm=function(t,r,i){if(!r||r.length===0)return t();const o=document.getElementsByTagName("link");return Promise.all(r.map(a=>{if(a=X3e(a),a in BO)return;BO[a]=!0;const s=a.endsWith(".css"),l=s?'[rel="stylesheet"]':"";if(!!i)for(let d=o.length-1;d>=0;d--){const p=o[d];if(p.href===a&&(!s||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${l}`))return;const c=document.createElement("link");if(c.rel=s?"stylesheet":Z3e,s||(c.as="script",c.crossOrigin=""),c.href=a,document.head.appendChild(c),s)return new Promise((d,p)=>{c.addEventListener("load",d),c.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>t())};var v1=(e=>(e.VALID="VALID",e.WASM="WebAssembly is not supported",e.COMPILER="Only FunC contracts can be verified",e.VERSION="FunC version is not supported",e))(v1||{});const J3e=["0.2.0","0.3.0","0.4.0","0.4.1"];function eSe(){const{data:e}=Pc(),{data:t}=vp(),[r,i]=X.exports.useState(null),[o,a]=X.exports.useState(!1),[s,l]=X.exports.useState(null),u=async()=>{wa(ha.IN_BROWSER_COMPILE_START),i(null),a(!0);const{FuncCompiler:p}=await Tm(()=>import("./index.9dd948c7.js").then(E=>E.i),[]),v=e?.files?.map(E=>({filename:E.name,content:E.content}))??[],x=e?.compilerSettings?.funcVersion;if(!x){i("FunC is not available for in-browser verification"),a(!1);return}let b;switch(x){case"0.2.0":{let{object:E}=await Tm(()=>import("./index.fbca1507.js").then(B=>B.i),[]);b=E;break}case"0.3.0":{let{object:E}=await Tm(()=>import("./index.f65cb428.js").then(B=>B.i),[]);b=E;break}case"0.4.0":{let{object:E}=await Tm(()=>import("./index.fb59a6c3.js").then(B=>B.i),[]);b=E;break}case"0.4.1":{let{object:E}=await Tm(()=>import("./index.bf0da248.js").then(B=>B.i),[]);b=E;break}}let _=await new p(b).compileFunc({sources:v,targets:(e?.compilerSettings).commandLine.split(" ").filter(E=>E.match(/\.(fc|func)$/))});if(_.status==="error"){i(_.message),a(!1),wa(ha.IN_BROWSER_COMPILE_ERROR);return}const k=Vn.Cell.fromBoc(Buffer.from(_.codeBoc,"base64"))[0];a(!1),t?.codeCellHash.base64===k.hash().toString("base64")&&l(k.hash().toString("base64")),wa(ha.IN_BROWSER_COMPILE_SUCCESS)},c=()=>xj()?e?.compiler!=="func"?"Only FunC contracts can be verified":d()?"VALID":"FunC version is not supported":"WebAssembly is not supported",d=()=>J3e.some(p=>p===e?.compilerSettings?.funcVersion);return{verifyContract:u,isVerificationEnabled:c,loading:o,error:r,hash:s}}function tSe(){const{verifyContract:e,isVerificationEnabled:t,error:r,loading:i,hash:o}=eSe(),a=la(),s=aa(a.breakpoints.down("md"));return Ut(kn,{p:2,children:[Ut(jo,{sx:{fontSize:14},children:["You are not required to rely on third-party validators. You can now verify this contract by yourself by having your browser download the sources and compile them locally in-browser using"," ",L(uc,{sx:{textDecoration:"none"},href:"https://github.com/ton-community/func-js",target:"_blank",children:"WASM"}),".",!nwe()&&L($n,{mt:1,sx:{overflow:"auto",maxHeight:300},children:Ut(Dd,{sx:{margin:0},children:["The web page you're looking at is"," ",L(uc,{sx:{textDecoration:"none"},href:"https://github.com/ton-community/contract-verifier",target:"_blank",children:"open source"}),", you can also fork or run it locally if you wish to have absolute control."]})})]}),t()!==v1.VALID?L($7,{arrow:!0,title:L(jo,{sx:{fontSize:13},children:t()}),placement:"top",children:L(kn,{sx:{width:144,margin:"auto"},children:L(Ha,{onClick:()=>e(),disabled:t()!==v1.VALID||i||!!o,fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",children:"Verify"})})}):Ut(Ha,{onClick:()=>e(),disabled:t()!==v1.VALID||i||!!o,fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",children:[i&&L(lg,{sx:{color:"#fff",height:"20px !important",width:"20px !important"}}),"Verify"]}),r&&Ut(ta,{children:[L(Cs,{noBottomMargin:!0,type:ps.ERROR,title:Ut(Dd,{children:[L("span",{style:{color:"#FC5656"},children:"Error: "}),"Compile error"]}),notificationBody:L(kn,{sx:{overflow:"auto",maxHeight:300},children:L("div",{children:L("code",{children:r})})})}),Ut(jo,{sx:{marginTop:1,fontSize:13},children:["You can ask for help in our"," ",L(uc,{sx:{textDecoration:"none",cursor:"pointer",color:"#0088CC"},href:"https://t.me/tonverifier",target:"_blank",children:"Telegram support group"})]})]}),!!o&&L(Cs,{noBottomMargin:!0,singleLine:!s,type:ps.SUCCESS,title:Ut($n,{sx:{height:42},children:[L($n,{mr:1,children:L("img",{src:R$,alt:"Like icon",width:31,height:31})}),Ut(O$,{children:[" ",L("b",{children:"Great!"})," Compile output hash matches this on-chain contract"]})]}),notificationBody:L(kn,{})})]})}function rSe(){const{data:e,isLoading:t}=Pc(),{isLoading:r}=zx();return Ut(kn,{sx:{width:"100%"},children:[e&&!r&&Ut(j3e,{pt:3,pb:1,children:[L(V3e,{children:"Verify manually"}),L(nSe,{})]}),(t||r)&&L(Xa,{width:"100%",height:250,sx:{transform:"none",borderRadius:"20px",background:"#e6e8eb"}})]})}Xi(H7)({borderBottom:"none","& .MuiTabs-indicator":{borderBottom:"4px solid #0088CC",borderRadius:20},"& .MuiTab-root.Mui-selected":{color:"#000",fontWeight:800}});function nSe(){return L(kn,{sx:{width:"100%"},children:L(tSe,{})})}function iSe({onClose:e}){const t=la(),r=aa(t.breakpoints.down("lg"));return L(D3e,{open:!0,maxWidth:r?"88%":1e3,hideCloseButton:!0,children:L(w6,{onClickAway:e,children:Ut(kn,{sx:{width:"100%"},children:[L(W3e,{pt:2,children:L(Bs,{sx:{padding:0},onClick:e,children:L("img",{src:b6,alt:"Close icon",width:15,height:15})})}),Ut($n,{mb:4,justifyContent:"center",children:[L("img",{src:L3e,alt:"Popup icon",width:41,height:41}),L(Fd,{pl:2,sx:{fontSize:18,fontWeight:800},children:"Verification Proof"})]}),L(Q3e,{}),L($n,{mt:3,children:L(rSe,{})})]})})})}const oSe=Xi($n)(({theme:e})=>t=>({flexWrap:t.makeFlexible?"wrap":"inherit",gap:t.makeFlexible?20:"inherit",justifyContent:t.makeFlexible?"center":"space-between",padding:24,[e.breakpoints.down("lg")]:{width:"70%",margin:"auto"}})),aSe=Xi(Fy)({boxSizing:"border-box",display:"flex",minWidth:200,maxWidth:260,height:108,background:"#F7F9FB",borderRadius:14,padding:"28px 13px"}),sSe=Xi(jo)({fontSize:14,color:"#000"}),lSe=[{icon:P3e,description:"This source code compiles to the same exact bytecode that is found on-chain."},{icon:R3e,description:"You can review verification proofs and perform your own client-side verification."},{icon:T3e,description:"Variable/function names may not reflect actual usage. compiler may remove unused code."},{icon:I3e,description:"Comments may not be honest and should generally be ignored."}],uSe=()=>{const[e]=yw(),[t,r]=Gn.useState(e.get("showProof")!==null),i=la(),o=aa(i.breakpoints.down("lg")),a=aa(i.breakpoints.down("md")),s=aa("(max-width: 450px)");return Ut(ug,{children:[L(p2,{mb:1,children:Ut($n,{sx:{justifyContent:"space-between",flexDirection:s?"column":"inherit",width:"100%"},children:[Ut($n,{mb:s?2:0,sx:{width:"100%"},children:[L(cg,{children:L("img",{src:O3e,alt:"Verification icon",width:41,height:41})}),L(Fd,{children:"How is this contract verified?"})]}),Ut("div",{children:[Ut(Ha,{fontSize:12,fontWeight:800,textColor:"#fff",background:"#1976d2",hoverBackground:"#156cc2",height:37,width:132,onClick:()=>{r(!0)},children:[L("img",{src:M3e,alt:"Show icon",width:19,height:19}),"Show Proof"]}),t&&L(iSe,{onClose:()=>r(!1)})]})]})}),L(oSe,{makeFlexible:o,isMobile:a,children:lSe.map(u=>Ut(aSe,{children:[L(Fy,{sx:{alignSelf:"flex-start"},mr:1.5,children:L("img",{alt:"Icon",src:u.icon,width:41,height:41})}),L(sSe,{children:u.description})]},u.description))})]})};function cSe(){const e=ej(m1),{isLoading:t,error:r,data:i}=bc(["latestVerifiedContracts"],async()=>(await(await fetch(`${e}/latestVerified`,{method:"GET"})).json()).slice(0,100));return{isLoading:t,error:r,data:i}}const dSe=sr(kn)(({theme:e})=>({background:"white",padding:"16px 20px",borderRadius:10,boxShadow:"rgb(114 138 150 / 8%) 0px 2px 16px",border:"0.5px solid rgba(114, 138, 150, 0.24)",cursor:"pointer",[e.breakpoints.down("sm")]:{width:280}})),fSe=sr(kn)(({theme:e})=>({maxWidth:1160,width:"calc(100% - 50px)",paddingTop:20,margin:"0 auto"})),pSe=sr(kn)({display:"flex",flexDirection:"row",flexWrap:"wrap",gap:24,margin:"0 auto",justifyContent:"left",overflow:"auto",marginTop:24,"-webkit-text-size-adjust":"100%"}),hSe=sr(kn)({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:16,color:"#728A96"}),gSe=sr(kn)({marginLeft:"auto",fontSize:14,background:"#F0F0F099",color:"#728A9699",padding:"2px 12px",borderRadius:4});function mSe(){const{data:e,isLoading:t}=cSe(),r=Ac(),i=X.exports.useRef(new Array(30).fill(null).map(o=>Math.random()*100));return Ut(fSe,{children:[L(jo,{variant:"h6",children:L("b",{children:"Latest verified contracts"})}),Ut(pSe,{children:[t&&i.current.map(o=>L(Xa,{sx:{borderRadius:2},variant:"rectangular",width:400+o,height:70})),e?.map(o=>Ut(dSe,{onClick:a=>{r(`/${o.address}`)},children:[L(hSe,{children:o.address}),Ut("div",{style:{display:"flex",alignItems:"center",marginTop:6.5},children:[L(jo,{sx:{fontSize:14,color:"#728A9699"},children:o.mainFile}),L(gSe,{children:o.compiler})]})]}))]})]})}const U$=Xi(kn)({maxWidth:1160,margin:"auto"}),D$=Xi(kn)(e=>({display:e.isMobile?"inherit":"flex",gap:20})),qv=Xi(kn)({boxSizing:"border-box",maxWidth:1160,width:"100%",marginTop:20,backgroundColor:"#fff",borderRadius:20,padding:20,color:"#000"});function UO(){const{isLoading:e,data:t,error:r}=Pc(),[i,o]=X.exports.useState(!1),a=la(),s=Cwe(),{contractAddress:l,isAddressEmpty:u}=$u(),{hasFiles:c}=zu(),d=X.exports.useRef(),p=aa(a.breakpoints.down("lg")),v=aa(a.breakpoints.down("md")),x=!r&&e&&l;AL(),Ewe(),lwe(),X.exports.useEffect(()=>{window.scrollTo({behavior:"auto",top:d.current?.offsetTop})},[window.location.pathname]);const{initialize:b}=cE(),{data:{funcVersions:y}}=uE();return X.exports.useEffect(()=>{(y?.length??0)>0&&b(y[0])},[y]),Ut(kn,{onDragEnter:()=>o(!0),onDrop:()=>o(!1),onClick:()=>o(!1),children:[L(u2,{sx:{color:"#fff",zIndex:4},open:i,onDragEnd:()=>o(!1)}),L(kn,{ref:d}),window.isTestnet&&L(BE,{}),L(gve,{}),l===null&&u&&L(mSe,{}),l===null&&!u&&L(kn,{m:4,children:L(Cs,{singleLine:!0,type:ps.ERROR,title:Ut($n,{sx:{height:42},children:[L("span",{style:{color:"#FC5656",marginRight:4},children:"Error: "}),"Invalid address"]}),notificationBody:L(kn,{})})}),Ut(U$,{px:p?"20px":0,children:[!!r&&L(kn,{mt:4,children:L(Cs,{type:ps.ERROR,title:Ut(Dd,{children:[L("span",{style:{color:"#FC5656"},children:"Error: "}),"Unable to fetch contract data"]}),notificationBody:L(kn,{sx:{overflow:"auto",maxHeight:300},children:L("pre",{children:L("code",{children:r.toString()})})})})}),x&&Ut(qv,{sx:{padding:"30px 24px 24px 24px"},mb:3,children:[Ut($n,{mb:3,children:[L(Xa,{variant:"circular",width:41,height:41,sx:{marginRight:2}}),L(Xa,{variant:"text",sx:{fontSize:"20px",width:200}})]}),L(Xa,{variant:"rectangular",width:"100%",height:250})]}),Ut(D$,{isMobile:v,children:[L(Owe,{}),t?.hasOnchainProof&&L(oxe,{})]}),x&&Ut(qv,{sx:{padding:"30px 24px 24px 24px"},mb:3,children:[Ut($n,{mb:3,children:[L(Xa,{variant:"circular",width:41,height:41,sx:{marginRight:2}}),L(Xa,{variant:"text",sx:{fontSize:"20px",width:200}})]}),L(Xa,{variant:"rectangular",width:"100%",height:250})]}),!e&&t?.hasOnchainProof&&L(uSe,{}),t&&(!t.hasOnchainProof||s)&&Ut(ta,{children:[L(C3e,{}),c()&&L(A3e,{})]}),t&&!c()?L(qv,{sx:{padding:0},mb:5,children:L(Swe,{})}):L(ta,{children:x&&Ut(qv,{sx:{padding:"30px 24px 24px 24px"},mb:5,children:[Ut($n,{mb:3,children:[L(Xa,{variant:"circular",width:41,height:41,sx:{marginRight:2}}),L(Xa,{variant:"text",sx:{fontSize:"20px",width:250}})]}),L(Xa,{variant:"rectangular",width:"100%",height:500})]})}),t&&L(Fb,{})]}),!t&&L(Fy,{sx:{bottom:0,width:"100%"},children:L(Fb,{})})]})}function L$({space:e}){return L("div",{style:{height:e}})}function ySe(){const[e,t]=X.exports.useState({spec:[],builder:Vn.beginCell()});return Ut("div",{children:[L("h4",{children:"Build the cell"}),L(wh,{required:!0,id:"outlined-required",label:"UINT",fullWidth:!0,onKeyUp:r=>{if(r.code==="Enter"){const[i,o]=r.target.value.split(",");t(a=>({spec:[...a.spec,{type:"uint"+o,value:i}],builder:a.builder.storeUint(i,o)})),r.target.value=""}}}),L(wh,{required:!0,id:"outlined-required",label:"Address",fullWidth:!0,onKeyUp:r=>{if(r.code==="Enter"){const i=r.target.value;t(o=>({spec:[...o.spec,{type:"address",value:i}],builder:o.builder.storeAddress(Vn.Address.parse(i))})),r.target.value=""}}}),L("div",{children:JSON.stringify(e.spec)}),L(L$,{space:30}),L(c2,{variant:"outlined",children:"Send the message"})]})}function vSe(){return Ut("div",{style:{margin:"0 auto",maxWidth:1100,padding:40},children:[L(B$,{}),L(L$,{space:35}),L(wh,{required:!0,id:"outlined-required",label:"Contract address",fullWidth:!0}),L(wh,{required:!0,id:"outlined-required",label:"Value",fullWidth:!0,type:"number"}),Ut("div",{children:[L("h3",{children:"OPs"}),L(wh,{required:!0,id:"outlined-required",label:"Value",fullWidth:!0,type:"number"}),L(ySe,{})]})]})}const bSe=v6({typography:{fontFamily:"Mulish"},components:{MuiSwitch:{styleOverrides:{switchBase:{color:"#ccc"},colorPrimary:{"&.Mui-checked":{color:"#fff"}},track:{opacity:1,backgroundColor:"#D1D1D6",".Mui-checked.Mui-checked + &":{opacity:1,backgroundColor:"#0088CC"}},thumb:{background:"#fff",boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.16)"}}}}});function UE({label:e,data:t}){return Ut("div",{className:"InfoPiece",children:[L("div",{className:"InfoPiece-Label",children:e}),L("div",{className:"InfoPiece-Data",children:t})]})}var zy=e=>e.type==="checkbox",ch=e=>e instanceof Date,ds=e=>e==null;const N$=e=>typeof e=="object";var ka=e=>!ds(e)&&!Array.isArray(e)&&N$(e)&&!ch(e),j$=e=>ka(e)&&e.target?zy(e.target)?e.target.checked:e.target.value:e,wSe=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,$$=(e,t)=>e.has(wSe(t)),xSe=e=>{const t=e.constructor&&e.constructor.prototype;return ka(t)&&t.hasOwnProperty("isPrototypeOf")},DE=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ja(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(DE&&(e instanceof Blob||e instanceof FileList))&&(r||ka(e)))if(t=r?[]:{},!r&&!xSe(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=Ja(e[i]));else return e;return t}var Og=e=>Array.isArray(e)?e.filter(Boolean):[],Ro=e=>e===void 0,vn=(e,t,r)=>{if(!t||!ka(e))return r;const i=Og(t.split(/[,[\].]+?/)).reduce((o,a)=>ds(o)?o:o[a],e);return Ro(i)||i===e?Ro(e[t])?r:e[t]:i},vu=e=>typeof e=="boolean";const zb={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},yl={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Xu={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},_Se=Gn.createContext(null),Qx=()=>Gn.useContext(_Se);var F$=(e,t,r,i=!0)=>{const o={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(o,a,{get:()=>{const s=a;return t._proxyFormState[s]!==yl.all&&(t._proxyFormState[s]=!i||yl.all),r&&(r[s]=!0),e[s]}});return o},Vs=e=>ka(e)&&!Object.keys(e).length,z$=(e,t,r,i)=>{r(e);const{name:o,...a}=e;return Vs(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(s=>t[s]===(!i||yl.all))},Gs=e=>Array.isArray(e)?e:[e],H$=(e,t,r)=>!e||!t||e===t||Gs(e).some(i=>i&&(r?i===t:i.startsWith(t)||t.startsWith(i)));function Zx(e){const t=Gn.useRef(e);t.current=e,Gn.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function SSe(e){const t=Qx(),{control:r=t.control,disabled:i,name:o,exact:a}=e||{},[s,l]=Gn.useState(r._formState),u=Gn.useRef(!0),c=Gn.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=Gn.useRef(o);return d.current=o,Zx({disabled:i,next:p=>u.current&&H$(d.current,p.name,a)&&z$(p,c.current,r._updateFormState)&&l({...r._formState,...p}),subject:r._subjects.state}),Gn.useEffect(()=>(u.current=!0,c.current.isValid&&r._updateValid(!0),()=>{u.current=!1}),[r]),F$(s,r,c.current,!1)}var bu=e=>typeof e=="string",W$=(e,t,r,i,o)=>bu(e)?(i&&t.watch.add(e),vn(r,e,o)):Array.isArray(e)?e.map(a=>(i&&t.watch.add(a),vn(r,a))):(i&&(t.watchAll=!0),r);function CSe(e){const t=Qx(),{control:r=t.control,name:i,defaultValue:o,disabled:a,exact:s}=e||{},l=Gn.useRef(i);l.current=i,Zx({disabled:a,subject:r._subjects.values,next:d=>{H$(l.current,d.name,s)&&c(Ja(W$(l.current,r._names,d.values||r._formValues,!1,o)))}});const[u,c]=Gn.useState(r._getWatch(i,o));return Gn.useEffect(()=>r._removeUnmounted()),u}var LE=e=>/^\w*$/.test(e),V$=e=>Og(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Ao(e,t,r){let i=-1;const o=LE(t)?[t]:V$(t),a=o.length,s=a-1;for(;++i{const d=o._options.shouldUnregister||a,p=(v,x)=>{const b=vn(o._fields,v);b&&(b._f.mount=x)};if(p(r,!0),d){const v=Ja(vn(o._options.defaultValues,r));Ao(o._defaultValues,r,v),Ro(vn(o._formValues,r))&&Ao(o._formValues,r,v)}return()=>{(s?d&&!o._state.action:d)?o.unregister(r):p(r,!1)}},[r,o,s,a]),Gn.useEffect(()=>{vn(o._fields,r)&&o._updateDisabledField({disabled:i,fields:o._fields,name:r,value:vn(o._fields,r)._f.value})},[i,r,o]),{field:{name:r,value:l,...vu(i)||vu(u.disabled)?{disabled:u.disabled||i}:{},onChange:Gn.useCallback(d=>c.current.onChange({target:{value:j$(d),name:r},type:zb.CHANGE}),[r]),onBlur:Gn.useCallback(()=>c.current.onBlur({target:{value:vn(o._formValues,r),name:r},type:zb.BLUR}),[r,o]),ref:d=>{const p=vn(o._fields,r);p&&d&&(p._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:v=>d.setCustomValidity(v),reportValidity:()=>d.reportValidity()})}},formState:u,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!vn(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!vn(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!vn(u.touchedFields,r)},error:{enumerable:!0,get:()=>vn(u.errors,r)}})}}const ESe=e=>e.render(kSe(e));var ASe=(e,t,r,i,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[i]:o||!0}}:{},zc=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},s3=(e,t,r={})=>r.shouldFocus||Ro(r.shouldFocus)?r.focusName||`${e}.${Ro(r.focusIndex)?t:r.focusIndex}.`:"",W4=e=>({isOnSubmit:!e||e===yl.onSubmit,isOnBlur:e===yl.onBlur,isOnChange:e===yl.onChange,isOnAll:e===yl.all,isOnTouch:e===yl.onTouched}),V4=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const d0=(e,t,r,i)=>{for(const o of r||Object.keys(e)){const a=vn(e,o);if(a){const{_f:s,...l}=a;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],o)&&!i)break;if(s.ref&&t(s.ref,s.name)&&!i)break}else ka(l)&&d0(l,t)}}};var q$=(e,t,r)=>{const i=Og(vn(e,r));return Ao(i,"root",t[r]),Ao(e,r,i),e},NE=e=>e.type==="file",od=e=>typeof e=="function",Hb=e=>{if(!DE)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},b1=e=>bu(e),jE=e=>e.type==="radio",Wb=e=>e instanceof RegExp;const DO={value:!1,isValid:!1},LO={value:!0,isValid:!0};var K$=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ro(e[0].attributes.value)?Ro(e[0].value)||e[0].value===""?LO:{value:e[0].value,isValid:!0}:LO:DO}return DO};const NO={isValid:!1,value:null};var G$=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,NO):NO;function jO(e,t,r="validate"){if(b1(e)||Array.isArray(e)&&e.every(b1)||vu(e)&&!e)return{type:r,message:b1(e)?e:"",ref:t}}var zp=e=>ka(e)&&!Wb(e)?e:{value:e,message:""},q4=async(e,t,r,i,o)=>{const{ref:a,refs:s,required:l,maxLength:u,minLength:c,min:d,max:p,pattern:v,validate:x,name:b,valueAsNumber:y,mount:_,disabled:k}=e._f,E=vn(t,b);if(!_||k)return{};const B=s?s[0]:a,U=V=>{i&&B.reportValidity&&(B.setCustomValidity(vu(V)?"":V||""),B.reportValidity())},D={},j=jE(a),F=zy(a),H=j||F,W=(y||NE(a))&&Ro(a.value)&&Ro(E)||Hb(a)&&a.value===""||E===""||Array.isArray(E)&&!E.length,G=ASe.bind(null,b,r,D),ae=(V,oe,P,ee=Xu.maxLength,le=Xu.minLength)=>{const pe=V?oe:P;D[b]={type:V?ee:le,message:pe,ref:a,...G(V?ee:le,pe)}};if(o?!Array.isArray(E)||!E.length:l&&(!H&&(W||ds(E))||vu(E)&&!E||F&&!K$(s).isValid||j&&!G$(s).isValid)){const{value:V,message:oe}=b1(l)?{value:!!l,message:l}:zp(l);if(V&&(D[b]={type:Xu.required,message:oe,ref:B,...G(Xu.required,oe)},!r))return U(oe),D}if(!W&&(!ds(d)||!ds(p))){let V,oe;const P=zp(p),ee=zp(d);if(!ds(E)&&!isNaN(E)){const le=a.valueAsNumber||E&&+E;ds(P.value)||(V=le>P.value),ds(ee.value)||(oe=lenew Date(new Date().toDateString()+" "+ft),_e=a.type=="time",J=a.type=="week";bu(P.value)&&E&&(V=_e?pe(E)>pe(P.value):J?E>P.value:le>new Date(P.value)),bu(ee.value)&&E&&(oe=_e?pe(E)+V.value,ee=!ds(oe.value)&&E.length<+oe.value;if((P||ee)&&(ae(P,V.message,oe.message),!r))return U(D[b].message),D}if(v&&!W&&bu(E)){const{value:V,message:oe}=zp(v);if(Wb(V)&&!E.match(V)&&(D[b]={type:Xu.pattern,message:oe,ref:a,...G(Xu.pattern,oe)},!r))return U(oe),D}if(x){if(od(x)){const V=await x(E,t),oe=jO(V,B);if(oe&&(D[b]={...oe,...G(Xu.validate,oe.message)},!r))return U(oe.message),D}else if(ka(x)){let V={};for(const oe in x){if(!Vs(V)&&!r)break;const P=jO(await x[oe](E,t),B,oe);P&&(V={...P,...G(oe,P.message)},U(P.message),r&&(D[b]=V))}if(!Vs(V)&&(D[b]={ref:B,...V},!r))return D}}return U(!0),D};function l3(e,t){return[...e,...Gs(t)]}var u3=e=>Array.isArray(e)?e.map(()=>{}):void 0;function c3(e,t,r){return[...e.slice(0,t),...Gs(r),...e.slice(t)]}var d3=(e,t,r)=>Array.isArray(e)?(Ro(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[];function f3(e,t){return[...Gs(t),...Gs(e)]}function TSe(e,t){let r=0;const i=[...e];for(const o of t)i.splice(o-r,1),r++;return Og(i).length?i:[]}var p3=(e,t)=>Ro(t)?[]:TSe(e,Gs(t).sort((r,i)=>r-i)),h3=(e,t,r)=>{e[t]=[e[r],e[r]=e[t]][0]};function ISe(e,t){const r=t.slice(0,-1).length;let i=0;for(;i(e[t]=r,e);function PSe(e){const t=Qx(),{control:r=t.control,name:i,keyName:o="id",shouldUnregister:a}=e,[s,l]=Gn.useState(r._getFieldArray(i)),u=Gn.useRef(r._getFieldArray(i).map(zc)),c=Gn.useRef(s),d=Gn.useRef(i),p=Gn.useRef(!1);d.current=i,c.current=s,r._names.array.add(i),e.rules&&r.register(i,e.rules),Zx({next:({values:D,name:j})=>{if(j===d.current||!j){const F=vn(D,d.current);Array.isArray(F)&&(l(F),u.current=F.map(zc))}},subject:r._subjects.array});const v=Gn.useCallback(D=>{p.current=!0,r._updateFieldArray(i,D)},[r,i]),x=(D,j)=>{const F=Gs(Ja(D)),H=l3(r._getFieldArray(i),F);r._names.focus=s3(i,H.length-1,j),u.current=l3(u.current,F.map(zc)),v(H),l(H),r._updateFieldArray(i,H,l3,{argA:u3(D)})},b=(D,j)=>{const F=Gs(Ja(D)),H=f3(r._getFieldArray(i),F);r._names.focus=s3(i,0,j),u.current=f3(u.current,F.map(zc)),v(H),l(H),r._updateFieldArray(i,H,f3,{argA:u3(D)})},y=D=>{const j=p3(r._getFieldArray(i),D);u.current=p3(u.current,D),v(j),l(j),r._updateFieldArray(i,j,p3,{argA:D})},_=(D,j,F)=>{const H=Gs(Ja(j)),W=c3(r._getFieldArray(i),D,H);r._names.focus=s3(i,D,F),u.current=c3(u.current,D,H.map(zc)),v(W),l(W),r._updateFieldArray(i,W,c3,{argA:D,argB:u3(j)})},k=(D,j)=>{const F=r._getFieldArray(i);h3(F,D,j),h3(u.current,D,j),v(F),l(F),r._updateFieldArray(i,F,h3,{argA:D,argB:j},!1)},E=(D,j)=>{const F=r._getFieldArray(i);d3(F,D,j),d3(u.current,D,j),v(F),l(F),r._updateFieldArray(i,F,d3,{argA:D,argB:j},!1)},B=(D,j)=>{const F=Ja(j),H=$O(r._getFieldArray(i),D,F);u.current=[...H].map((W,G)=>!W||G===D?zc():u.current[G]),v(H),l([...H]),r._updateFieldArray(i,H,$O,{argA:D,argB:F},!0,!1)},U=D=>{const j=Gs(Ja(D));u.current=j.map(zc),v([...j]),l([...j]),r._updateFieldArray(i,[...j],F=>F,{},!0,!1)};return Gn.useEffect(()=>{if(r._state.action=!1,V4(i,r._names)&&r._subjects.state.next({...r._formState}),p.current&&(!W4(r._options.mode).isOnSubmit||r._formState.isSubmitted))if(r._options.resolver)r._executeSchema([i]).then(D=>{const j=vn(D.errors,i),F=vn(r._formState.errors,i);(F?!j&&F.type||j&&(F.type!==j.type||F.message!==j.message):j&&j.type)&&(j?Ao(r._formState.errors,i,j):Ra(r._formState.errors,i),r._subjects.state.next({errors:r._formState.errors}))});else{const D=vn(r._fields,i);D&&D._f&&q4(D,r._formValues,r._options.criteriaMode===yl.all,r._options.shouldUseNativeValidation,!0).then(j=>!Vs(j)&&r._subjects.state.next({errors:q$(r._formState.errors,j,i)}))}r._subjects.values.next({name:i,values:{...r._formValues}}),r._names.focus&&d0(r._fields,(D,j)=>{if(r._names.focus&&j.startsWith(r._names.focus)&&D.focus)return D.focus(),1}),r._names.focus="",r._updateValid(),p.current=!1},[s,i,r]),Gn.useEffect(()=>(!vn(r._formValues,i)&&r._updateFieldArray(i),()=>{(r._options.shouldUnregister||a)&&r.unregister(i)}),[i,r,o,a]),{swap:Gn.useCallback(k,[v,i,r]),move:Gn.useCallback(E,[v,i,r]),prepend:Gn.useCallback(b,[v,i,r]),append:Gn.useCallback(x,[v,i,r]),remove:Gn.useCallback(y,[v,i,r]),insert:Gn.useCallback(_,[v,i,r]),update:Gn.useCallback(B,[v,i,r]),replace:Gn.useCallback(U,[v,i,r]),fields:Gn.useMemo(()=>s.map((D,j)=>({...D,[o]:u.current[j]||zc()})),[s,o])}}function g3(){let e=[];return{get observers(){return e},next:o=>{for(const a of e)a.next&&a.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(a=>a!==o)}}),unsubscribe:()=>{e=[]}}}var Vb=e=>ds(e)||!N$(e);function wf(e,t){if(Vb(e)||Vb(t))return e===t;if(ch(e)&&ch(t))return e.getTime()===t.getTime();const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(const o of r){const a=e[o];if(!i.includes(o))return!1;if(o!=="ref"){const s=t[o];if(ch(a)&&ch(s)||ka(a)&&ka(s)||Array.isArray(a)&&Array.isArray(s)?!wf(a,s):a!==s)return!1}}return!0}var Y$=e=>e.type==="select-multiple",MSe=e=>jE(e)||zy(e),m3=e=>Hb(e)&&e.isConnected,Q$=e=>{for(const t in e)if(od(e[t]))return!0;return!1};function qb(e,t={}){const r=Array.isArray(e);if(ka(e)||r)for(const i in e)Array.isArray(e[i])||ka(e[i])&&!Q$(e[i])?(t[i]=Array.isArray(e[i])?[]:{},qb(e[i],t[i])):ds(e[i])||(t[i]=!0);return t}function Z$(e,t,r){const i=Array.isArray(e);if(ka(e)||i)for(const o in e)Array.isArray(e[o])||ka(e[o])&&!Q$(e[o])?Ro(t)||Vb(r[o])?r[o]=Array.isArray(e[o])?qb(e[o],[]):{...qb(e[o])}:Z$(e[o],ds(t)?{}:t[o],r[o]):r[o]=!wf(e[o],t[o]);return r}var y3=(e,t)=>Z$(e,t,qb(t)),X$=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:i})=>Ro(e)?e:t?e===""?NaN:e&&+e:r&&bu(e)?new Date(e):i?i(e):e;function v3(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return NE(t)?t.files:jE(t)?G$(e.refs).value:Y$(t)?[...t.selectedOptions].map(({value:r})=>r):zy(t)?K$(e.refs).value:X$(Ro(t.value)?e.ref.value:t.value,e)}var OSe=(e,t,r,i)=>{const o={};for(const a of e){const s=vn(t,a);s&&Ao(o,a,s._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:i}},Im=e=>Ro(e)?e:Wb(e)?e.source:ka(e)?Wb(e.value)?e.value.source:e.value:e,BSe=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function FO(e,t,r){const i=vn(e,r);if(i||LE(r))return{error:i,name:r};const o=r.split(".");for(;o.length;){const a=o.join("."),s=vn(t,a),l=vn(e,a);if(s&&!Array.isArray(s)&&r!==a)return{name:r};if(l&&l.type)return{name:a,error:l};o.pop()}return{name:r}}var USe=(e,t,r,i,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?i.isOnBlur:o.isOnBlur)?!e:(r?i.isOnChange:o.isOnChange)?e:!0,DSe=(e,t)=>!Og(vn(e,t)).length&&Ra(e,t);const LSe={mode:yl.onSubmit,reValidateMode:yl.onChange,shouldFocusError:!0};function NSe(e={},t){let r={...LSe,...e},i={submitCount:0,isDirty:!1,isLoading:od(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{},disabled:!1},o={},a=ka(r.defaultValues)||ka(r.values)?Ja(r.defaultValues||r.values)||{}:{},s=r.shouldUnregister?{}:Ja(a),l={action:!1,mount:!1,watch:!1},u={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0;const p={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={values:g3(),array:g3(),state:g3()},x=e.resetOptions&&e.resetOptions.keepDirtyValues,b=W4(r.mode),y=W4(r.reValidateMode),_=r.criteriaMode===yl.all,k=fe=>Be=>{clearTimeout(d),d=setTimeout(fe,Be)},E=async fe=>{if(p.isValid||fe){const Be=r.resolver?Vs((await W()).errors):await ae(o,!0);Be!==i.isValid&&v.state.next({isValid:Be})}},B=fe=>p.isValidating&&v.state.next({isValidating:fe}),U=(fe,Be=[],rt,lt,jt=!0,ce=!0)=>{if(lt&&rt){if(l.action=!0,ce&&Array.isArray(vn(o,fe))){const ie=rt(vn(o,fe),lt.argA,lt.argB);jt&&Ao(o,fe,ie)}if(ce&&Array.isArray(vn(i.errors,fe))){const ie=rt(vn(i.errors,fe),lt.argA,lt.argB);jt&&Ao(i.errors,fe,ie),DSe(i.errors,fe)}if(p.touchedFields&&ce&&Array.isArray(vn(i.touchedFields,fe))){const ie=rt(vn(i.touchedFields,fe),lt.argA,lt.argB);jt&&Ao(i.touchedFields,fe,ie)}p.dirtyFields&&(i.dirtyFields=y3(a,s)),v.state.next({name:fe,isDirty:oe(fe,Be),dirtyFields:i.dirtyFields,errors:i.errors,isValid:i.isValid})}else Ao(s,fe,Be)},D=(fe,Be)=>{Ao(i.errors,fe,Be),v.state.next({errors:i.errors})},j=(fe,Be,rt,lt)=>{const jt=vn(o,fe);if(jt){const ce=vn(s,fe,Ro(rt)?vn(a,fe):rt);Ro(ce)||lt&<.defaultChecked||Be?Ao(s,fe,Be?ce:v3(jt._f)):le(fe,ce),l.mount&&E()}},F=(fe,Be,rt,lt,jt)=>{let ce=!1,ie=!1;const de={name:fe};if(!rt||lt){p.isDirty&&(ie=i.isDirty,i.isDirty=de.isDirty=oe(),ce=ie!==de.isDirty);const $=wf(vn(a,fe),Be);ie=vn(i.dirtyFields,fe),$?Ra(i.dirtyFields,fe):Ao(i.dirtyFields,fe,!0),de.dirtyFields=i.dirtyFields,ce=ce||p.dirtyFields&&ie!==!$}if(rt){const $=vn(i.touchedFields,fe);$||(Ao(i.touchedFields,fe,rt),de.touchedFields=i.touchedFields,ce=ce||p.touchedFields&&$!==rt)}return ce&&jt&&v.state.next(de),ce?de:{}},H=(fe,Be,rt,lt)=>{const jt=vn(i.errors,fe),ce=p.isValid&&vu(Be)&&i.isValid!==Be;if(e.delayError&&rt?(c=k(()=>D(fe,rt)),c(e.delayError)):(clearTimeout(d),c=null,rt?Ao(i.errors,fe,rt):Ra(i.errors,fe)),(rt?!wf(jt,rt):jt)||!Vs(lt)||ce){const ie={...lt,...ce&&vu(Be)?{isValid:Be}:{},errors:i.errors,name:fe};i={...i,...ie},v.state.next(ie)}B(!1)},W=async fe=>r.resolver(s,r.context,OSe(fe||u.mount,o,r.criteriaMode,r.shouldUseNativeValidation)),G=async fe=>{const{errors:Be}=await W(fe);if(fe)for(const rt of fe){const lt=vn(Be,rt);lt?Ao(i.errors,rt,lt):Ra(i.errors,rt)}else i.errors=Be;return Be},ae=async(fe,Be,rt={valid:!0})=>{for(const lt in fe){const jt=fe[lt];if(jt){const{_f:ce,...ie}=jt;if(ce){const de=u.array.has(ce.name),$=await q4(jt,s,_,r.shouldUseNativeValidation&&!Be,de);if($[ce.name]&&(rt.valid=!1,Be))break;!Be&&(vn($,ce.name)?de?q$(i.errors,$,ce.name):Ao(i.errors,ce.name,$[ce.name]):Ra(i.errors,ce.name))}ie&&await ae(ie,Be,rt)}}return rt.valid},V=()=>{for(const fe of u.unMount){const Be=vn(o,fe);Be&&(Be._f.refs?Be._f.refs.every(rt=>!m3(rt)):!m3(Be._f.ref))&&vr(fe)}u.unMount=new Set},oe=(fe,Be)=>(fe&&Be&&Ao(s,fe,Be),!wf(He(),a)),P=(fe,Be,rt)=>W$(fe,u,{...l.mount?s:Ro(Be)?a:bu(fe)?{[fe]:Be}:Be},rt,Be),ee=fe=>Og(vn(l.mount?s:a,fe,e.shouldUnregister?vn(a,fe,[]):[])),le=(fe,Be,rt={})=>{const lt=vn(o,fe);let jt=Be;if(lt){const ce=lt._f;ce&&(!ce.disabled&&Ao(s,fe,X$(Be,ce)),jt=Hb(ce.ref)&&ds(Be)?"":Be,Y$(ce.ref)?[...ce.ref.options].forEach(ie=>ie.selected=jt.includes(ie.value)):ce.refs?zy(ce.ref)?ce.refs.length>1?ce.refs.forEach(ie=>(!ie.defaultChecked||!ie.disabled)&&(ie.checked=Array.isArray(jt)?!!jt.find(de=>de===ie.value):jt===ie.value)):ce.refs[0]&&(ce.refs[0].checked=!!jt):ce.refs.forEach(ie=>ie.checked=ie.value===jt):NE(ce.ref)?ce.ref.value="":(ce.ref.value=jt,ce.ref.type||v.values.next({name:fe,values:{...s}})))}(rt.shouldDirty||rt.shouldTouch)&&F(fe,jt,rt.shouldTouch,rt.shouldDirty,!0),rt.shouldValidate&&Le(fe)},pe=(fe,Be,rt)=>{for(const lt in Be){const jt=Be[lt],ce=`${fe}.${lt}`,ie=vn(o,ce);(u.array.has(fe)||!Vb(jt)||ie&&!ie._f)&&!ch(jt)?pe(ce,jt,rt):le(ce,jt,rt)}},_e=(fe,Be,rt={})=>{const lt=vn(o,fe),jt=u.array.has(fe),ce=Ja(Be);Ao(s,fe,ce),jt?(v.array.next({name:fe,values:{...s}}),(p.isDirty||p.dirtyFields)&&rt.shouldDirty&&v.state.next({name:fe,dirtyFields:y3(a,s),isDirty:oe(fe,ce)})):lt&&!lt._f&&!ds(ce)?pe(fe,ce,rt):le(fe,ce,rt),V4(fe,u)&&v.state.next({...i}),v.values.next({name:fe,values:{...s}}),!l.mount&&t()},J=async fe=>{const Be=fe.target;let rt=Be.name,lt=!0;const jt=vn(o,rt),ce=()=>Be.type?v3(jt._f):j$(fe),ie=de=>{lt=Number.isNaN(de)||de===vn(s,rt,de)};if(jt){let de,$;const C=ce(),T=fe.type===zb.BLUR||fe.type===zb.FOCUS_OUT,Q=!BSe(jt._f)&&!r.resolver&&!vn(i.errors,rt)&&!jt._f.deps||USe(T,vn(i.touchedFields,rt),i.isSubmitted,y,b),ve=V4(rt,u,T);Ao(s,rt,C),T?(jt._f.onBlur&&jt._f.onBlur(fe),c&&c(0)):jt._f.onChange&&jt._f.onChange(fe);const je=F(rt,C,T,!1),ct=!Vs(je)||ve;if(!T&&v.values.next({name:rt,type:fe.type,values:{...s}}),Q)return p.isValid&&E(),ct&&v.state.next({name:rt,...ve?{}:je});if(!T&&ve&&v.state.next({...i}),B(!0),r.resolver){const{errors:ur}=await W([rt]);if(ie(C),lt){const Dr=FO(i.errors,o,rt),hr=FO(ur,o,Dr.name||rt);de=hr.error,rt=hr.name,$=Vs(ur)}}else de=(await q4(jt,s,_,r.shouldUseNativeValidation))[rt],ie(C),lt&&(de?$=!1:p.isValid&&($=await ae(o,!0)));lt&&(jt._f.deps&&Le(jt._f.deps),H(rt,$,de,je))}},ft=(fe,Be)=>{if(vn(i.errors,Be)&&fe.focus)return fe.focus(),1},Le=async(fe,Be={})=>{let rt,lt;const jt=Gs(fe);if(B(!0),r.resolver){const ce=await G(Ro(fe)?fe:jt);rt=Vs(ce),lt=fe?!jt.some(ie=>vn(ce,ie)):rt}else fe?(lt=(await Promise.all(jt.map(async ce=>{const ie=vn(o,ce);return await ae(ie&&ie._f?{[ce]:ie}:ie)}))).every(Boolean),!(!lt&&!i.isValid)&&E()):lt=rt=await ae(o);return v.state.next({...!bu(fe)||p.isValid&&rt!==i.isValid?{}:{name:fe},...r.resolver||!fe?{isValid:rt}:{},errors:i.errors,isValidating:!1}),Be.shouldFocus&&!lt&&d0(o,ft,fe?jt:u.mount),lt},He=fe=>{const Be={...a,...l.mount?s:{}};return Ro(fe)?Be:bu(fe)?vn(Be,fe):fe.map(rt=>vn(Be,rt))},nr=(fe,Be)=>({invalid:!!vn((Be||i).errors,fe),isDirty:!!vn((Be||i).dirtyFields,fe),isTouched:!!vn((Be||i).touchedFields,fe),error:vn((Be||i).errors,fe)}),Bt=fe=>{fe&&Gs(fe).forEach(Be=>Ra(i.errors,Be)),v.state.next({errors:fe?i.errors:{}})},Rt=(fe,Be,rt)=>{const lt=(vn(o,fe,{_f:{}})._f||{}).ref;Ao(i.errors,fe,{...Be,ref:lt}),v.state.next({name:fe,errors:i.errors,isValid:!1}),rt&&rt.shouldFocus&<&<.focus&<.focus()},Jt=(fe,Be)=>od(fe)?v.values.subscribe({next:rt=>fe(P(void 0,Be),rt)}):P(fe,Be,!0),vr=(fe,Be={})=>{for(const rt of fe?Gs(fe):u.mount)u.mount.delete(rt),u.array.delete(rt),Be.keepValue||(Ra(o,rt),Ra(s,rt)),!Be.keepError&&Ra(i.errors,rt),!Be.keepDirty&&Ra(i.dirtyFields,rt),!Be.keepTouched&&Ra(i.touchedFields,rt),!r.shouldUnregister&&!Be.keepDefaultValue&&Ra(a,rt);v.values.next({values:{...s}}),v.state.next({...i,...Be.keepDirty?{isDirty:oe()}:{}}),!Be.keepIsValid&&E()},At=({disabled:fe,name:Be,field:rt,fields:lt,value:jt})=>{if(vu(fe)){const ce=fe?void 0:Ro(jt)?v3(rt?rt._f:vn(lt,Be)._f):jt;Ao(s,Be,ce),F(Be,ce,!1,!1,!0)}},kt=(fe,Be={})=>{let rt=vn(o,fe);const lt=vu(Be.disabled);return Ao(o,fe,{...rt||{},_f:{...rt&&rt._f?rt._f:{ref:{name:fe}},name:fe,mount:!0,...Be}}),u.mount.add(fe),rt?At({field:rt,disabled:Be.disabled,name:fe}):j(fe,!0,Be.value),{...lt?{disabled:Be.disabled}:{},...r.progressive?{required:!!Be.required,min:Im(Be.min),max:Im(Be.max),minLength:Im(Be.minLength),maxLength:Im(Be.maxLength),pattern:Im(Be.pattern)}:{},name:fe,onChange:J,onBlur:J,ref:jt=>{if(jt){kt(fe,Be),rt=vn(o,fe);const ce=Ro(jt.value)&&jt.querySelectorAll&&jt.querySelectorAll("input,select,textarea")[0]||jt,ie=MSe(ce),de=rt._f.refs||[];if(ie?de.find($=>$===ce):ce===rt._f.ref)return;Ao(o,fe,{_f:{...rt._f,...ie?{refs:[...de.filter(m3),ce,...Array.isArray(vn(a,fe))?[{}]:[]],ref:{type:ce.type,name:fe}}:{ref:ce}}}),j(fe,!1,void 0,ce)}else rt=vn(o,fe,{}),rt._f&&(rt._f.mount=!1),(r.shouldUnregister||Be.shouldUnregister)&&!($$(u.array,fe)&&l.action)&&u.unMount.add(fe)}}},Ct=()=>r.shouldFocusError&&d0(o,ft,u.mount),Lt=fe=>{vu(fe)&&(v.state.next({disabled:fe}),d0(o,Be=>{Be.disabled=fe},0,!1))},Kt=(fe,Be)=>async rt=>{rt&&(rt.preventDefault&&rt.preventDefault(),rt.persist&&rt.persist());let lt=Ja(s);if(v.state.next({isSubmitting:!0}),r.resolver){const{errors:jt,values:ce}=await W();i.errors=jt,lt=ce}else await ae(o);Ra(i.errors,"root"),Vs(i.errors)?(v.state.next({errors:{}}),await fe(lt,rt)):(Be&&await Be({...i.errors},rt),Ct(),setTimeout(Ct)),v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Vs(i.errors),submitCount:i.submitCount+1,errors:i.errors})},yr=(fe,Be={})=>{vn(o,fe)&&(Ro(Be.defaultValue)?_e(fe,vn(a,fe)):(_e(fe,Be.defaultValue),Ao(a,fe,Be.defaultValue)),Be.keepTouched||Ra(i.touchedFields,fe),Be.keepDirty||(Ra(i.dirtyFields,fe),i.isDirty=Be.defaultValue?oe(fe,vn(a,fe)):oe()),Be.keepError||(Ra(i.errors,fe),p.isValid&&E()),v.state.next({...i}))},ne=(fe,Be={})=>{const rt=fe?Ja(fe):a,lt=Ja(rt),jt=fe&&!Vs(fe)?lt:a;if(Be.keepDefaultValues||(a=rt),!Be.keepValues){if(Be.keepDirtyValues||x)for(const ce of u.mount)vn(i.dirtyFields,ce)?Ao(jt,ce,vn(s,ce)):_e(ce,vn(jt,ce));else{if(DE&&Ro(fe))for(const ce of u.mount){const ie=vn(o,ce);if(ie&&ie._f){const de=Array.isArray(ie._f.refs)?ie._f.refs[0]:ie._f.ref;if(Hb(de)){const $=de.closest("form");if($){$.reset();break}}}}o={}}s=e.shouldUnregister?Be.keepDefaultValues?Ja(a):{}:Ja(jt),v.array.next({values:{...jt}}),v.values.next({values:{...jt}})}u={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!l.mount&&t(),l.mount=!p.isValid||!!Be.keepIsValid,l.watch=!!e.shouldUnregister,v.state.next({submitCount:Be.keepSubmitCount?i.submitCount:0,isDirty:Be.keepDirty?i.isDirty:!!(Be.keepDefaultValues&&!wf(fe,a)),isSubmitted:Be.keepIsSubmitted?i.isSubmitted:!1,dirtyFields:Be.keepDirtyValues?i.dirtyFields:Be.keepDefaultValues&&fe?y3(a,fe):{},touchedFields:Be.keepTouched?i.touchedFields:{},errors:Be.keepErrors?i.errors:{},isSubmitSuccessful:Be.keepIsSubmitSuccessful?i.isSubmitSuccessful:!1,isSubmitting:!1})},Mt=(fe,Be)=>ne(od(fe)?fe(s):fe,Be);return{control:{register:kt,unregister:vr,getFieldState:nr,handleSubmit:Kt,setError:Rt,_executeSchema:W,_getWatch:P,_getDirty:oe,_updateValid:E,_removeUnmounted:V,_updateFieldArray:U,_updateDisabledField:At,_getFieldArray:ee,_reset:ne,_resetDefaultValues:()=>od(r.defaultValues)&&r.defaultValues().then(fe=>{Mt(fe,r.resetOptions),v.state.next({isLoading:!1})}),_updateFormState:fe=>{i={...i,...fe}},_disableForm:Lt,_subjects:v,_proxyFormState:p,get _fields(){return o},get _formValues(){return s},get _state(){return l},set _state(fe){l=fe},get _defaultValues(){return a},get _names(){return u},set _names(fe){u=fe},get _formState(){return i},set _formState(fe){i=fe},get _options(){return r},set _options(fe){r={...r,...fe}}},trigger:Le,register:kt,handleSubmit:Kt,watch:Jt,setValue:_e,getValues:He,reset:Mt,resetField:yr,clearErrors:Bt,unregister:vr,setError:Rt,setFocus:(fe,Be={})=>{const rt=vn(o,fe),lt=rt&&rt._f;if(lt){const jt=lt.refs?lt.refs[0]:lt.ref;jt.focus&&(jt.focus(),Be.shouldSelect&&jt.select())}},getFieldState:nr}}function w1(e={}){const t=Gn.useRef(),r=Gn.useRef(),[i,o]=Gn.useState({isDirty:!1,isValidating:!1,isLoading:od(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},disabled:!1,defaultValues:od(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...NSe(e,()=>o(s=>({...s}))),formState:i});const a=t.current.control;return a._options=e,Zx({subject:a._subjects.state,next:s=>{z$(s,a._proxyFormState,a._updateFormState,!0)&&o({...a._formState})}}),Gn.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),Gn.useEffect(()=>{if(a._proxyFormState.isDirty){const s=a._getDirty();s!==i.isDirty&&a._subjects.state.next({isDirty:s})}},[a,i.isDirty]),Gn.useEffect(()=>{e.values&&!wf(e.values,r.current)?(a._reset(e.values,a._options.resetOptions),r.current=e.values):a._resetDefaultValues()},[e.values,a]),Gn.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=F$(i,a),t.current}function ic({label:e,name:t,control:r}){return L(ESe,{name:t,control:r,render:({field:i,fieldState:{error:o}})=>L(wh,{helperText:o?o.message:null,error:!!o,fullWidth:!0,label:e,variant:"outlined",...i})})}function jSe(e){return Vn.beginCell().storeUint(2003,32).storeUint(0,64).storeAddress(e).endCell()}function $Se(e){return Vn.beginCell().storeUint(3004,32).storeUint(0,64).storeAddress(e).endCell()}function FSe(e,t){return Vn.beginCell().storeUint(6007,32).storeUint(0,64).storeCoins(e).storeCoins(t).endCell()}function zSe(){const{data:e,isLoading:t}=Dy();kg();const r=fE(),i=w1({defaultValues:{admin:e?.admin||""}}),o=w1({defaultValues:{verifierRegistry:e?.verifierRegistry||""}}),a=w1({defaultValues:{minTon:e?.deploymentCosts.min||"",maxTon:e?.deploymentCosts.max||""}});async function s(c){if(!e?.address)throw new Error("no address");if(c.admin!==e?.admin)try{const d=$Se(Vn.Address.parse(c.admin));await r(e.address.toString(),Vn.toNano("0.01"),d)==="rejected"&&i.setError("admin",{message:"Failed to change admin"})}catch(d){let p="Failed to change admin";"message"in d&&(p=d.message),i.setError("admin",{message:p})}}async function l(c){if(!e?.address)throw new Error("no address");if(c.verifierRegistry!==e?.verifierRegistry)try{const d=jSe(Vn.Address.parse(c.verifierRegistry));await r(e.address.toString(),Vn.toNano("0.01"),d)==="rejected"&&o.setError("verifierRegistry",{message:"Failed to change verifier registry"})}catch(d){let p="Failed to change verifier registry";"message"in d&&(p=d.message),o.setError("verifierRegistry",{message:p})}}async function u(c){if(!e?.address)throw new Error("no address");if(c.minTon!==e?.deploymentCosts.min||c.maxTon!==e?.deploymentCosts.max)try{const d=FSe(Vn.toNano(c.minTon),Vn.toNano(c.maxTon));await r(e.address.toString(),Vn.toNano("0.01"),d)==="rejected"&&a.setError("root",{message:"Failed to change deployment costs"})}catch(d){let p="Failed to change deployment costs";"message"in d&&(p=d.message),a.setError("root",{message:p})}}return X.exports.useEffect(()=>{e&&(i.reset({admin:e.admin}),o.reset({verifierRegistry:e.verifierRegistry}),a.reset({minTon:e.deploymentCosts.min,maxTon:e.deploymentCosts.max}))},[e]),Ut(xs,{spacing:4,p:4,children:[L("h1",{children:"Sources Registry"}),t&&L(lg,{}),e&&Ut(ta,{children:[L(UE,{label:"Address",data:e.address.toString()}),L("form",{id:"adminForm",onSubmit:i.handleSubmit(s),children:Ut(xs,{spacing:2,children:[!i.formState.isValid&&L(d1,{severity:"error",children:Object.entries(i.formState.errors).map(([c,d])=>L("div",{children:d.message},c))}),Ut(xs,{direction:"row",spacing:2,alignItems:"center",children:[L(ic,{...i.register("admin"),control:i.control,label:"Admin"}),L(nd,{text:"Save",type:"submit",disabled:!i.formState.isDirty})]})]})}),L("form",{id:"verifierRegistryForm",onSubmit:o.handleSubmit(l),children:Ut(xs,{spacing:2,children:[!o.formState.isValid&&L(d1,{severity:"error",children:Object.entries(o.formState.errors).map(([c,d])=>L("div",{children:d.message},c))}),Ut(xs,{direction:"row",spacing:2,alignItems:"center",children:[L(ic,{...o.register("verifierRegistry"),control:o.control,label:"Verifier Reg."}),L(nd,{text:"Save",type:"submit",disabled:!o.formState.isDirty})]})]})}),L("form",{id:"sourcesRegistryForm",onSubmit:a.handleSubmit(u),children:Ut(xs,{spacing:2,children:[!a.formState.isValid&&L(d1,{severity:"error",children:Object.entries(a.formState.errors).map(([c,d])=>L("div",{children:d.message},c))}),Ut(xs,{direction:"row",spacing:2,alignItems:"center",children:[L(ic,{...a.register("minTon"),control:a.control,label:"Min Ton"}),L(ic,{...a.register("maxTon"),control:a.control,label:"Max Ton"}),L(nd,{text:"Save",type:"submit",disabled:!a.formState.isDirty})]})]})})]})]})}const J$={removeVerifier:435836471,updateVerifier:1610798618,forwardMessage:1965127512};function zO(e){return Ib(V1e(e))}function HSe(e){let t=e.split(".");return((+t[0]*256+ +t[1])*256+ +t[2])*256+ +t[3]}function WSe(){return{serialize:(e,t)=>{t.storeSlice(e)},parse:e=>e}}function VSe(e){let t=Vn.beginCell();t.storeUint(J$.updateVerifier,32),t.storeUint(e.queryId||0,64),t.storeUint(e.id,256),t.storeUint(e.quorum,8);let r=Vn.Dictionary.empty(Vn.Dictionary.Keys.BigUint(256),WSe());return e.endpoints.forEach(function(i,o){r.set(o,Vn.beginCell().storeUint(i,32).endCell().beginParse())}),t.storeDict(r),t.storeRef(Vn.beginCell().storeBuffer(Buffer.from(e.name)).endCell()),t.storeRef(Vn.beginCell().storeBuffer(Buffer.from(e.marketingUrl)).endCell()),t.endCell()}function qSe(e){let t=Vn.beginCell();return t.storeUint(J$.removeVerifier,32),t.storeUint(e.queryId||0,64),t.storeUint(e.id,256),t.endCell()}function HO({verifier:e,altColor:t,isNew:r}){const i=fE(),{data:o}=Dy(),a=X.exports.useMemo(()=>Object.entries(e.pubKeyEndpoints).map(([p,v])=>({pubKey:p,ip:v})),[e.pubKeyEndpoints]),s=w1({defaultValues:{quorum:e.quorum.toString()||"",name:e.name||"",url:e.url||"",pubKeyEndpoints:a||[]},mode:"onChange"});async function l(p){if(!p.name){s.setError("name",{message:"Name is required"});return}if(!p.url){s.setError("url",{message:"Url is required"});return}if(!p.quorum||Number(p.quorum)<1){s.setError("quorum",{message:"Quorum is required and should be at least 1"});return}try{await i(o?.verifierRegistry??"",Vn.toNano(r?"1000":"0.01"),VSe({id:zO(p.name),quorum:Number(p.quorum),endpoints:new Map(p.pubKeyEndpoints.map(({pubKey:x,ip:b})=>[Ib(Buffer.from(x,"base64")),HSe(b)])),name:p.name,marketingUrl:p.url}))==="rejected"&&s.setError("root",{message:`Failed to update config of ${p.name}`})}catch(v){let x=`Failed to update config of ${p.name}`;"message"in v&&(x=v.message),s.setError("root",{message:x})}}const{fields:u,append:c,remove:d}=PSe({control:s.control,name:"pubKeyEndpoints"});return L("form",{id:e.admin.toString(),onSubmit:s.handleSubmit(l),children:Ut(xs,{spacing:4,px:4,py:6,style:{backgroundColor:t?"#eeeeef":"transparent"},children:[!s.formState.isValid&&L(d1,{severity:"error",children:Object.entries(s.formState.errors).map(([p,v])=>L("div",{children:v.message},p))}),Ut(xs,{flexDirection:"row",alignItems:"center",gap:2,children:[L("h3",{style:{margin:0},children:r?"Add Verifier":s.getValues("name")}),!r&&L(nd,{text:"Remove",onClick:()=>{i(o.verifierRegistry,Vn.toNano("0.01"),qSe({id:zO(s.getValues("name"))}))}})]}),L(UE,{label:"Admin",data:e.admin.toString()}),r&&L(ic,{label:"Name",name:"name",control:s.control}),L(ic,{label:"Url",name:"url",control:s.control}),L(ic,{label:"Quorum",name:"quorum",control:s.control}),Ut(xs,{spacing:2,alignItems:"flex-start",children:[Ut(xs,{direction:"row",spacing:4,alignItems:"center",children:[L("h4",{children:"Public Key Endpoints"}),L(nd,{size:"small",text:"Add",onClick:()=>{c({pubKey:"",ip:""})}})]}),u.map((p,v)=>Ut(Cv,{container:!0,alignItems:"center",gap:2,wrap:"nowrap",children:[L(Cv,{item:!0,xs:6,children:L(ic,{label:`PubKey-${v}`,name:`pubKeyEndpoints.${v}.pubKey`,control:s.control})}),L(Cv,{item:!0,xs:5,children:L(ic,{label:`IP-${v}`,name:`pubKeyEndpoints.${v}.ip`,control:s.control})}),L(Cv,{item:!0,xs:1,children:L(nd,{text:"Remove",onClick:()=>d(v)})})]},p.id))]}),L(nd,{text:r?"Add verifier":"Update config",type:"submit",disabled:!s.formState.isDirty})]})})}function KSe(){const{data:e,isLoading:t}=zx(),{data:r}=Dy(),[i]=kg();return Ut(xs,{spacing:4,p:4,children:[L("h1",{children:"Verifier Registry"}),L(UE,{label:"Address",data:r?.verifierRegistry??""}),t&&L(lg,{}),Ut(xs,{children:[t&&"Loading...",e?.map((o,a)=>L(HO,{verifier:o,altColor:a%2!==1,isNew:!1}))]}),i.account?.address&&L(HO,{isNew:!0,altColor:!0,verifier:{admin:Vn.Address.parse(i.account?.address),name:"",quorum:0,url:"",pubKeyEndpoints:{}}})]})}function GSe(){return Ut("div",{children:[window.isTestnet&&L(BE,{}),Ut(xs,{direction:"row",justifyContent:"space-between",alignItems:"center",p:4,children:[L("h1",{children:"Admin"}),L(Ux,{})]}),L(zSe,{}),L(KSe,{}),L(Fb,{})]})}const YSe=sr(kn)(({theme:e})=>t=>({display:t.isMobile?"flex":"inherit",alignItems:t.isMobile?"center":"inherit",fontWight:700,color:"#fff",height:t.isMobile?90:100,background:"#fff",borderBottomLeftRadius:e.spacing(6),borderBottomRightRadius:e.spacing(6),border:"0.5px solid rgba(114, 138, 150, 0.24)",boxShadow:"rgb(114 138 150 / 8%) 0px 2px 16px"}));function QSe(){const e=la(),t=aa(e.breakpoints.down("md")),r=aa(e.breakpoints.down("lg"));return L(YSe,{px:r?3.4:0,isMobile:t,children:Ut(IL,{mb:5,children:[Ut(ap,{children:[L("img",{src:vw,width:30,height:30,alt:"App icon"}),L(cx,{children:"TACT DEPLOYER"})]}),Ut(TL,{children:[L($n,{mr:t?0:2,children:L(Ux,{})}),!t&&Ut(ap,{href:$6,target:"_blank",children:[L("img",{src:ZC,alt:"Github icon",width:20,height:20}),L(xk,{children:"GitHub"})]})]})]})})}const ZSe=sr("input")({display:"flex",alignItems:"center",paddingLeft:14,boxSizing:"border-box",height:34,background:"#FFFFFF",border:"1px solid #D8D8D8",borderRadius:"12px",fontSize:14,fontFamily:"Mulish",outline:"none","&:hover":{border:"1px solid #b0b0b0"},"&:focus":{border:"1px solid #807e7e"}}),XSe=Vn.Cell.fromBoc(Buffer.from("te6cckEBAQEADgAAGJRqmLYAAAAAAAAAAOnNeQ0=","base64"))[0];async function b3(e){const t=`https://tact-deployer${window.isTestnet?"-testnet":""}.infura-ipfs.io`;return fetch(`${t}/ipfs/${e}`)}function $E({workchain:e}){const{ipfsHash:t}=xU(),{data:r,error:i,isLoading:o}=bc(["tactDeploy",t],async()=>{if(!t)return null;const a=await yp(),s=await b3(t).then(_=>_.json()),l=await b3(s.pkg).then(_=>_.json()),u=await b3(s.dataCell).then(_=>_.arrayBuffer()).then(_=>Vn.Cell.fromBoc(Buffer.from(_))[0]),c=Vn.Cell.fromBoc(Buffer.from(l.code,"base64"))[0],d=Vn.contractAddress(e,{code:c,data:u}),p={code:c,data:u},v=u.hash().toString("base64"),x=c.hash().toString("base64"),b=await a.isContractDeployed(d),y=b&&await pE(x);return{address:d,stateInit:p,pkg:l,codeCellHash:x,dataCellHash:v,isDeployed:b,hasProof:y}});return{data:r,error:i,isLoading:o}}function JSe(e,t,r){const{sendTXN:i,data:o,clearTXN:a}=tj("deployContract",async s=>{if(!r)throw new Error("No address");const l=await yp();return s>20?"error":await l.isContractDeployed(r)?"success":"issued"});return{sendTXN:()=>{!r||i(r,Vn.toNano(e),XSe,t)},status:o.status,clearTXN:a}}function e4e(){const e=[],{data:t,error:r}=$E({workchain:0});return t&&(e.push({title:"Name",value:t.pkg.name}),e.push({title:"Compiler",value:`Tact ${t.pkg.compiler.version}`}),e.push({title:"Code Hash",value:t.codeCellHash}),e.push({title:"Data Hash",value:t.dataCellHash}),e.push({title:"Workchain",value:Rj(t.address.toString())})),L(SE,{title:"Contract",icon:_E,dataRows:e,isLoading:!1,isFlexibleWrapper:!0})}function t4e(){const[e,t]=X.exports.useState("0.5"),{data:r,error:i}=$E({workchain:0}),{sendTXN:o,status:a}=JSe(e,r?.stateInit,r?.address),{markPreloaded:s}=Aj(),l=Ac(),u=zu();let c="";if(i)c=i.toString();else if(r?.isDeployed)c=Ut("div",{children:["Contract is already deployed.",!r.hasProof&&" You can publish its sources to verify it."]});else switch(a){case"initial":c="Contract is ready for deployment";break;case"pending":c="Please approve the transaction in your wallet";break;case"issued":c="Transaction was issued. Monitoring deployment...";break;case"rejected":c="Transaction was rejected. Please retry.";break;case"error":c="Transaction failed. Please retry.";break;case"expired":c="Transaction expired. Please retry.";break;case"success":c="Contract deployed successfully! You can now publish its sources to verify it.";break}let d=Ut(Ha,{disabled:a==="pending"||a==="issued"||r?.isDeployed,fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{o()},children:[(a==="pending"||a==="issued")&&L(lg,{sx:{color:"#fff",height:"20px !important",width:"20px !important"}}),"Deploy"]});return(a==="success"||r?.isDeployed&&!r.hasProof)&&(d=L(Ha,{fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{s(),l("/"+r.address.toString()),u.addFiles([new File([JSON.stringify(r.pkg)],r.pkg.name+".pkg",{type:"text/plain"})])},children:"Verify"})),Ut(ug,{mb:6,children:[Ut($n,{p:"30px 24px 0 24px",children:[L(cg,{children:L("img",{src:_E,alt:"publish icon",width:41,height:41})}),L(Fd,{children:"Deploy"})]}),Ut(kn,{children:[Ut(kn,{sx:{padding:"0 30px"},children:[Ut(wE,{gap:2,sx:{mt:2},children:[L(Cc,{children:L("div",{children:"Value to initialize contract (TON)"})}),L(Cc,{children:L(ZSe,{disabled:!!r?.isDeployed||a==="issued"||a=="pending",value:e,type:"number",onChange:p=>{t(p.target.value)}})})]}),L(Cs,{type:ps.HINT,title:L(ta,{}),notificationBody:L($n,{sx:{overflow:"auto",maxHeight:300},children:Ut(Dd,{sx:{marginBottom:0},children:[L(kn,{sx:{fontWeight:600},children:"Contract Address"}),L(kn,{sx:{fontSize:18,fontWeight:700,wordBreak:"break-all"},children:r?.address.toString()})]})})}),L(Cs,{type:ps.INFO,title:L(ta,{}),notificationBody:L($n,{sx:{overflow:"auto",maxHeight:300},children:L(Dd,{sx:{marginBottom:0},children:c})})}),d]}),L($n,{mb:3,sx:{justifyContent:"center"}})]})]})}function r4e(){const e=la(),t=aa(e.breakpoints.down("md")),r=aa(e.breakpoints.down("lg")),{data:i,error:o,isLoading:a}=$E({workchain:0});return Ut(kn,{children:[window.isTestnet&&L(BE,{}),L(QSe,{}),Ut(U$,{px:r?"20px":0,children:[a&&Ut(Cc,{sx:{marginTop:3},children:[L(Xa,{height:330,variant:"rounded",sx:{marginBottom:3}}),L(Xa,{height:280,variant:"rounded"})]}),!a&&Ut(ta,{children:[L(D$,{isMobile:t,children:L(e4e,{})}),L(t4e,{})]})]}),")",L(Fb,{})]})}const n4e=new KH({defaultOptions:{queries:{refetchOnWindowFocus:!1}}});P1e();yS.createRoot(document.getElementById("root")).render(L(ope,{maxSnack:3,children:L(BQ,{theme:bSe,children:L(Rq,{client:n4e,children:L(uve,{manifestUrl:"https://verifier.ton.org/tonconnect-manifest.json",children:L(HK,{basename:"/",children:Ut(FK,{children:[L(Hp,{path:"/interact",element:L(vSe,{})}),L(Hp,{path:"/admin",element:L(GSe,{})}),L(Hp,{path:"/tactDeployer/:ipfsHash",element:L(r4e,{})}),L(Hp,{path:"/:contractAddress",element:L(UO,{})}),L(Hp,{path:"/",element:L(UO,{})})]})})})})})}));export{Kb as g};
+ `},w_e={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function x_e(e){let{announcements:t=w_e,container:r,hiddenTextDescribedById:i,screenReaderInstructions:o=b_e}=e;const{announce:a,announcement:s}=m_e(),l=$y("DndLiveRegion"),[u,c]=X.exports.useState(!1);if(X.exports.useEffect(()=>{c(!0)},[]),y_e(X.exports.useMemo(()=>({onDragStart(p){let{active:v}=p;a(t.onDragStart({active:v}))},onDragMove(p){let{active:v,over:x}=p;t.onDragMove&&a(t.onDragMove({active:v,over:x}))},onDragOver(p){let{active:v,over:x}=p;a(t.onDragOver({active:v,over:x}))},onDragEnd(p){let{active:v,over:x}=p;a(t.onDragEnd({active:v,over:x}))},onDragCancel(p){let{active:v,over:x}=p;a(t.onDragCancel({active:v,over:x}))}}),[a,t])),!u)return null;const d=Ut(ta,{children:[L(p_e,{id:i,value:o.draggable}),L(g_e,{id:l,announcement:s})]});return r?ml.exports.createPortal(d,r):d}var xa;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(xa||(xa={}));function Nb(){}function J5(e,t){return X.exports.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function __e(){for(var e=arguments.length,t=new Array(e),r=0;r[...t].filter(i=>i!=null),[...t])}const eu=Object.freeze({x:0,y:0});function o$(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function a$(e,t){let{data:{value:r}}=e,{data:{value:i}}=t;return r-i}function S_e(e,t){let{data:{value:r}}=e,{data:{value:i}}=t;return i-r}function hO(e){let{left:t,top:r,height:i,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+i},{x:t+o,y:r+i}]}function s$(e,t){if(!e||e.length===0)return null;const[r]=e;return t?r[t]:r}function gO(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const C_e=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:i}=e;const o=gO(t,t.left,t.top),a=[];for(const s of i){const{id:l}=s,u=r.get(l);if(u){const c=o$(gO(u),o);a.push({id:l,data:{droppableContainer:s,value:c}})}}return a.sort(a$)},k_e=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:i}=e;const o=hO(t),a=[];for(const s of i){const{id:l}=s,u=r.get(l);if(u){const c=hO(u),d=o.reduce((v,x,b)=>v+o$(c[b],x),0),p=Number((d/4).toFixed(4));a.push({id:l,data:{droppableContainer:s,value:p}})}}return a.sort(a$)};function E_e(e,t){const r=Math.max(t.top,e.top),i=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),s=o-i,l=a-r;if(i{let{collisionRect:t,droppableRects:r,droppableContainers:i}=e;const o=[];for(const a of i){const{id:s}=a,l=r.get(s);if(l){const u=E_e(l,t);u>0&&o.push({id:s,data:{droppableContainer:a,value:u}})}}return o.sort(S_e)};function T_e(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function l$(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:eu}function I_e(e){return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),a=1;a({...s,top:s.top+e*l.y,bottom:s.bottom+e*l.y,left:s.left+e*l.x,right:s.right+e*l.x}),{...r})}}const R_e=I_e(1);function P_e(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function M_e(e,t,r){const i=P_e(t);if(!i)return e;const{scaleX:o,scaleY:a,x:s,y:l}=i,u=e.left-s-(1-o)*parseFloat(r),c=e.top-l-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),d=o?e.width/o:e.width,p=a?e.height/a:e.height;return{width:d,height:p,top:c,right:u+d,bottom:c+p,left:u}}const O_e={ignoreTransform:!1};function Mg(e,t){t===void 0&&(t=O_e);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{getComputedStyle:c}=Ds(e),{transform:d,transformOrigin:p}=c(e);d&&(r=M_e(r,d,p))}const{top:i,left:o,width:a,height:s,bottom:l,right:u}=r;return{top:i,left:o,width:a,height:s,bottom:l,right:u}}function mO(e){return Mg(e,{ignoreTransform:!0})}function B_e(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function U_e(e,t){return t===void 0&&(t=Ds(e).getComputedStyle(e)),t.position==="fixed"}function D_e(e,t){t===void 0&&(t=Ds(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const a=t[o];return typeof a=="string"?r.test(a):!1})}function Kx(e,t){const r=[];function i(o){if(t!=null&&r.length>=t||!o)return r;if(TE(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!Ny(o)||i_e(o)||r.includes(o))return r;const{getComputedStyle:a}=Ds(o),s=a(o);return o!==e&&D_e(o,s)&&r.push(o),U_e(o,s)?r:i(o.parentNode)}return e?i(e):r}function u$(e){const[t]=Kx(e,1);return t??null}function e3(e){return!qx||!e?null:Rg(e)?e:AE(e)?TE(e)||e===Pg(e).scrollingElement?window:Ny(e)?e:null:null}function c$(e){return Rg(e)?e.scrollX:e.scrollLeft}function d$(e){return Rg(e)?e.scrollY:e.scrollTop}function $4(e){return{x:c$(e),y:d$(e)}}var Ma;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Ma||(Ma={}));function f$(e){return!qx||!e?!1:e===document.scrollingElement}function p$(e){const t={x:0,y:0},r=f$(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,s=e.scrollTop>=i.y,l=e.scrollLeft>=i.x;return{isTop:o,isLeft:a,isBottom:s,isRight:l,maxScroll:i,minScroll:t}}const L_e={x:.2,y:.2};function N_e(e,t,r,i,o){let{top:a,left:s,right:l,bottom:u}=r;i===void 0&&(i=10),o===void 0&&(o=L_e);const{isTop:c,isBottom:d,isLeft:p,isRight:v}=p$(e),x={x:0,y:0},b={x:0,y:0},y={height:t.height*o.y,width:t.width*o.x};return!c&&a<=t.top+y.height?(x.y=Ma.Backward,b.y=i*Math.abs((t.top+y.height-a)/y.height)):!d&&u>=t.bottom-y.height&&(x.y=Ma.Forward,b.y=i*Math.abs((t.bottom-y.height-u)/y.height)),!v&&l>=t.right-y.width?(x.x=Ma.Forward,b.x=i*Math.abs((t.right-y.width-l)/y.width)):!p&&s<=t.left+y.width&&(x.x=Ma.Backward,b.x=i*Math.abs((t.left+y.width-s)/y.width)),{direction:x,speed:b}}function j_e(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:s}=window;return{top:0,left:0,right:a,bottom:s,width:a,height:s}}const{top:t,left:r,right:i,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:i,bottom:o,width:e.clientWidth,height:e.clientHeight}}function h$(e){return e.reduce((t,r)=>_h(t,$4(r)),eu)}function $_e(e){return e.reduce((t,r)=>t+c$(r),0)}function F_e(e){return e.reduce((t,r)=>t+d$(r),0)}function z_e(e,t){if(t===void 0&&(t=Mg),!e)return;const{top:r,left:i,bottom:o,right:a}=t(e);!u$(e)||(o<=0||a<=0||r>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const H_e=[["x",["left","right"],$_e],["y",["top","bottom"],F_e]];class PE{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const i=Kx(r),o=h$(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,s,l]of H_e)for(const u of s)Object.defineProperty(this,u,{get:()=>{const c=l(i),d=o[a]-c;return this.rect[u]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class l0{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...r)})},this.target=t}add(t,r,i){var o;(o=this.target)==null||o.addEventListener(t,r,i),this.listeners.push([t,r,i])}}function W_e(e){const{EventTarget:t}=Ds(e);return e instanceof t?e:Pg(e)}function t3(e,t){const r=Math.abs(e.x),i=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+i**2)>t:"x"in t&&"y"in t?r>t.x&&i>t.y:"x"in t?r>t.x:"y"in t?i>t.y:!1}var pl;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(pl||(pl={}));function yO(e){e.preventDefault()}function V_e(e){e.stopPropagation()}var zi;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(zi||(zi={}));const g$={start:[zi.Space,zi.Enter],cancel:[zi.Esc],end:[zi.Space,zi.Enter]},q_e=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case zi.Right:return{...r,x:r.x+25};case zi.Left:return{...r,x:r.x-25};case zi.Down:return{...r,y:r.y+25};case zi.Up:return{...r,y:r.y-25}}};class ME{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new l0(Pg(r)),this.windowListeners=new l0(Ds(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pl.Resize,this.handleCancel),this.windowListeners.add(pl.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(pl.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,i=t.node.current;i&&z_e(i),r(eu)}handleKeyDown(t){if(RE(t)){const{active:r,context:i,options:o}=this.props,{keyboardCodes:a=g$,coordinateGetter:s=q_e,scrollBehavior:l="smooth"}=o,{code:u}=t;if(a.end.includes(u)){this.handleEnd(t);return}if(a.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:c}=i.current,d=c?{x:c.left,y:c.top}:eu;this.referenceCoordinates||(this.referenceCoordinates=d);const p=s(t,{active:r,context:i.current,currentCoordinates:d});if(p){const v=oy(p,d),x={x:0,y:0},{scrollableAncestors:b}=i.current;for(const y of b){const _=t.code,{isTop:k,isRight:E,isLeft:B,isBottom:U,maxScroll:D,minScroll:j}=p$(y),F=j_e(y),H={x:Math.min(_===zi.Right?F.right-F.width/2:F.right,Math.max(_===zi.Right?F.left:F.left+F.width/2,p.x)),y:Math.min(_===zi.Down?F.bottom-F.height/2:F.bottom,Math.max(_===zi.Down?F.top:F.top+F.height/2,p.y))},W=_===zi.Right&&!E||_===zi.Left&&!B,G=_===zi.Down&&!U||_===zi.Up&&!k;if(W&&H.x!==p.x){const ae=y.scrollLeft+v.x,V=_===zi.Right&&ae<=D.x||_===zi.Left&&ae>=j.x;if(V&&!v.y){y.scrollTo({left:ae,behavior:l});return}V?x.x=y.scrollLeft-ae:x.x=_===zi.Right?y.scrollLeft-D.x:y.scrollLeft-j.x,x.x&&y.scrollBy({left:-x.x,behavior:l});break}else if(G&&H.y!==p.y){const ae=y.scrollTop+v.y,V=_===zi.Down&&ae<=D.y||_===zi.Up&&ae>=j.y;if(V&&!v.x){y.scrollTo({top:ae,behavior:l});return}V?x.y=y.scrollTop-ae:x.y=_===zi.Down?y.scrollTop-D.y:y.scrollTop-j.y,x.y&&y.scrollBy({top:-x.y,behavior:l});break}}this.handleMove(t,_h(oy(p,this.referenceCoordinates),x))}}}handleMove(t,r){const{onMove:i}=this.props;t.preventDefault(),i(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}ME.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:i=g$,onActivation:o}=t,{active:a}=r;const{code:s}=e.nativeEvent;if(i.start.includes(s)){const l=a.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function vO(e){return Boolean(e&&"distance"in e)}function bO(e){return Boolean(e&&"delay"in e)}class OE{constructor(t,r,i){var o;i===void 0&&(i=W_e(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:a}=t,{target:s}=a;this.props=t,this.events=r,this.document=Pg(s),this.documentListeners=new l0(this.document),this.listeners=new l0(i),this.windowListeners=new l0(Ds(s)),this.initialCoordinates=(o=j4(a))!=null?o:eu,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),this.windowListeners.add(pl.Resize,this.handleCancel),this.windowListeners.add(pl.DragStart,yO),this.windowListeners.add(pl.VisibilityChange,this.handleCancel),this.windowListeners.add(pl.ContextMenu,yO),this.documentListeners.add(pl.Keydown,this.handleKeydown),r){if(vO(r))return;if(bO(r)){this.timeoutId=setTimeout(this.handleStart,r.delay);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(pl.Click,V_e,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pl.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:i,initialCoordinates:o,props:a}=this,{onMove:s,options:{activationConstraint:l}}=a;if(!o)return;const u=(r=j4(t))!=null?r:eu,c=oy(o,u);if(!i&&l){if(bO(l))return t3(c,l.tolerance)?this.handleCancel():void 0;if(vO(l))return l.tolerance!=null&&t3(c,l.tolerance)?this.handleCancel():t3(c,l.distance)?this.handleStart():void 0}t.cancelable&&t.preventDefault(),s(u)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===zi.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const K_e={move:{name:"pointermove"},end:{name:"pointerup"}};class m$ extends OE{constructor(t){const{event:r}=t,i=Pg(r.target);super(t,K_e,i)}}m$.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:i}=t;return!r.isPrimary||r.button!==0?!1:(i?.({event:r}),!0)}}];const G_e={move:{name:"mousemove"},end:{name:"mouseup"}};var F4;(function(e){e[e.RightClick=2]="RightClick"})(F4||(F4={}));class y$ extends OE{constructor(t){super(t,G_e,Pg(t.event.target))}}y$.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:i}=t;return r.button===F4.RightClick?!1:(i?.({event:r}),!0)}}];const r3={move:{name:"touchmove"},end:{name:"touchend"}};class v$ extends OE{constructor(t){super(t,r3)}static setup(){return window.addEventListener(r3.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(r3.move.name,t)};function t(){}}}v$.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:i}=t;const{touches:o}=r;return o.length>1?!1:(i?.({event:r}),!0)}}];var u0;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(u0||(u0={}));var jb;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(jb||(jb={}));function Y_e(e){let{acceleration:t,activator:r=u0.Pointer,canScroll:i,draggingRect:o,enabled:a,interval:s=5,order:l=jb.TreeOrder,pointerCoordinates:u,scrollableAncestors:c,scrollableAncestorRects:d,delta:p,threshold:v}=e;const x=Z_e({delta:p,disabled:!a}),[b,y]=o_e(),_=X.exports.useRef({x:0,y:0}),k=X.exports.useRef({x:0,y:0}),E=X.exports.useMemo(()=>{switch(r){case u0.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case u0.DraggableRect:return o}},[r,o,u]),B=X.exports.useRef(null),U=X.exports.useCallback(()=>{const j=B.current;if(!j)return;const F=_.current.x*k.current.x,H=_.current.y*k.current.y;j.scrollBy(F,H)},[]),D=X.exports.useMemo(()=>l===jb.TreeOrder?[...c].reverse():c,[l,c]);X.exports.useEffect(()=>{if(!a||!c.length||!E){y();return}for(const j of D){if(i?.(j)===!1)continue;const F=c.indexOf(j),H=d[F];if(!H)continue;const{direction:W,speed:G}=N_e(j,H,E,t,v);for(const ae of["x","y"])x[ae][W[ae]]||(G[ae]=0,W[ae]=0);if(G.x>0||G.y>0){y(),B.current=j,b(U,s),_.current=G,k.current=W;return}}_.current={x:0,y:0},k.current={x:0,y:0},y()},[t,U,i,y,a,s,JSON.stringify(E),JSON.stringify(x),b,c,D,d,JSON.stringify(v)])}const Q_e={x:{[Ma.Backward]:!1,[Ma.Forward]:!1},y:{[Ma.Backward]:!1,[Ma.Forward]:!1}};function Z_e(e){let{delta:t,disabled:r}=e;const i=N4(t);return jy(o=>{if(r||!i||!o)return Q_e;const a={x:Math.sign(t.x-i.x),y:Math.sign(t.y-i.y)};return{x:{[Ma.Backward]:o.x[Ma.Backward]||a.x===-1,[Ma.Forward]:o.x[Ma.Forward]||a.x===1},y:{[Ma.Backward]:o.y[Ma.Backward]||a.y===-1,[Ma.Forward]:o.y[Ma.Forward]||a.y===1}}},[r,t,i])}function X_e(e,t){const r=t!==null?e.get(t):void 0,i=r?r.node.current:null;return jy(o=>{var a;return t===null?null:(a=i??o)!=null?a:null},[i,t])}function J_e(e,t){return X.exports.useMemo(()=>e.reduce((r,i)=>{const{sensor:o}=i,a=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,i)}));return[...r,...a]},[]),[e,t])}var sy;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(sy||(sy={}));var z4;(function(e){e.Optimized="optimized"})(z4||(z4={}));const wO=new Map;function e5e(e,t){let{dragging:r,dependencies:i,config:o}=t;const[a,s]=X.exports.useState(null),{frequency:l,measure:u,strategy:c}=o,d=X.exports.useRef(e),p=_(),v=iy(p),x=X.exports.useCallback(function(k){k===void 0&&(k=[]),!v.current&&s(E=>E===null?k:E.concat(k.filter(B=>!E.includes(B))))},[v]),b=X.exports.useRef(null),y=jy(k=>{if(p&&!r)return wO;if(!k||k===wO||d.current!==e||a!=null){const E=new Map;for(let B of e){if(!B)continue;if(a&&a.length>0&&!a.includes(B.id)&&B.rect.current){E.set(B.id,B.rect.current);continue}const U=B.node.current,D=U?new PE(u(U),U):null;B.rect.current=D,D&&E.set(B.id,D)}return E}return k},[e,a,r,p,u]);return X.exports.useEffect(()=>{d.current=e},[e]),X.exports.useEffect(()=>{p||x()},[r,p]),X.exports.useEffect(()=>{a&&a.length>0&&s(null)},[JSON.stringify(a)]),X.exports.useEffect(()=>{p||typeof l!="number"||b.current!==null||(b.current=setTimeout(()=>{x(),b.current=null},l))},[l,p,x,...i]),{droppableRects:y,measureDroppableContainers:x,measuringScheduled:a!=null};function _(){switch(c){case sy.Always:return!1;case sy.BeforeDragging:return r;default:return!r}}}function b$(e,t){return jy(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function t5e(e,t){return b$(e,t)}function r5e(e){let{callback:t,disabled:r}=e;const i=IE(t),o=X.exports.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(i)},[i,r]);return X.exports.useEffect(()=>()=>o?.disconnect(),[o]),o}function Gx(e){let{callback:t,disabled:r}=e;const i=IE(t),o=X.exports.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(i)},[r]);return X.exports.useEffect(()=>()=>o?.disconnect(),[o]),o}function n5e(e){return new PE(Mg(e),e)}function xO(e,t,r){t===void 0&&(t=n5e);const[i,o]=X.exports.useReducer(l,null),a=r5e({callback(u){if(!!e)for(const c of u){const{type:d,target:p}=c;if(d==="childList"&&p instanceof HTMLElement&&p.contains(e)){o();break}}}}),s=Gx({callback:o});return Jl(()=>{o(),e?(s?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),a?.disconnect())},[e]),i;function l(u){if(!e)return null;if(e.isConnected===!1){var c;return(c=u??r)!=null?c:null}const d=t(e);return JSON.stringify(u)===JSON.stringify(d)?u:d}}function i5e(e){const t=b$(e);return l$(e,t)}const _O=[];function o5e(e){const t=X.exports.useRef(e),r=jy(i=>e?i&&i!==_O&&e&&t.current&&e.parentNode===t.current.parentNode?i:Kx(e):_O,[e]);return X.exports.useEffect(()=>{t.current=e},[e]),r}function a5e(e){const[t,r]=X.exports.useState(null),i=X.exports.useRef(e),o=X.exports.useCallback(a=>{const s=e3(a.target);!s||r(l=>l?(l.set(s,$4(s)),new Map(l)):null)},[]);return X.exports.useEffect(()=>{const a=i.current;if(e!==a){s(a);const l=e.map(u=>{const c=e3(u);return c?(c.addEventListener("scroll",o,{passive:!0}),[c,$4(c)]):null}).filter(u=>u!=null);r(l.length?new Map(l):null),i.current=e}return()=>{s(e),s(a)};function s(l){l.forEach(u=>{const c=e3(u);c?.removeEventListener("scroll",o)})}},[o,e]),X.exports.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,s)=>_h(a,s),eu):h$(e):eu,[e,t])}function SO(e,t){t===void 0&&(t=[]);const r=X.exports.useRef(null);return X.exports.useEffect(()=>{r.current=null},t),X.exports.useEffect(()=>{const i=e!==eu;i&&!r.current&&(r.current=e),!i&&r.current&&(r.current=null)},[e]),r.current?oy(e,r.current):eu}function s5e(e){X.exports.useEffect(()=>{if(!qx)return;const t=e.map(r=>{let{sensor:i}=r;return i.setup==null?void 0:i.setup()});return()=>{for(const r of t)r?.()}},e.map(t=>{let{sensor:r}=t;return r}))}function l5e(e,t){return X.exports.useMemo(()=>e.reduce((r,i)=>{let{eventName:o,handler:a}=i;return r[o]=s=>{a(s,t)},r},{}),[e,t])}function w$(e){return X.exports.useMemo(()=>e?B_e(e):null,[e])}const n3=[];function u5e(e,t){t===void 0&&(t=Mg);const[r]=e,i=w$(r?Ds(r):null),[o,a]=X.exports.useReducer(l,n3),s=Gx({callback:a});return e.length>0&&o===n3&&a(),Jl(()=>{e.length?e.forEach(u=>s?.observe(u)):(s?.disconnect(),a())},[e]),o;function l(){return e.length?e.map(u=>f$(u)?i:new PE(t(u),u)):n3}}function c5e(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ny(t)?t:e}function d5e(e){let{measure:t}=e;const[r,i]=X.exports.useState(null),o=X.exports.useCallback(c=>{for(const{target:d}of c)if(Ny(d)){i(p=>{const v=t(d);return p?{...p,width:v.width,height:v.height}:v});break}},[t]),a=Gx({callback:o}),s=X.exports.useCallback(c=>{const d=c5e(c);a?.disconnect(),d&&a?.observe(d),i(d?t(d):null)},[t,a]),[l,u]=Lb(s);return X.exports.useMemo(()=>({nodeRef:l,rect:r,setRef:u}),[r,l,u])}const f5e=[{sensor:m$,options:{}},{sensor:ME,options:{}}],p5e={current:{}},y1={draggable:{measure:mO},droppable:{measure:mO,strategy:sy.WhileDragging,frequency:z4.Optimized},dragOverlay:{measure:Mg}};class c0 extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,i;return(r=(i=this.get(t))==null?void 0:i.node.current)!=null?r:void 0}}const h5e={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new c0,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Nb},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:y1,measureDroppableContainers:Nb,windowRect:null,measuringScheduled:!1},g5e={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Nb,draggableNodes:new Map,over:null,measureDroppableContainers:Nb},Yx=X.exports.createContext(g5e),x$=X.exports.createContext(h5e);function m5e(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new c0}}}function y5e(e,t){switch(t.type){case xa.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case xa.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case xa.DragEnd:case xa.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case xa.RegisterDroppable:{const{element:r}=t,{id:i}=r,o=new c0(e.droppable.containers);return o.set(i,r),{...e,droppable:{...e.droppable,containers:o}}}case xa.SetDroppableDisabled:{const{id:r,key:i,disabled:o}=t,a=e.droppable.containers.get(r);if(!a||i!==a.key)return e;const s=new c0(e.droppable.containers);return s.set(r,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case xa.UnregisterDroppable:{const{id:r,key:i}=t,o=e.droppable.containers.get(r);if(!o||i!==o.key)return e;const a=new c0(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function v5e(e){let{disabled:t}=e;const{active:r,activatorEvent:i,draggableNodes:o}=X.exports.useContext(Yx),a=N4(i),s=N4(r?.id);return X.exports.useEffect(()=>{if(!t&&!i&&a&&s!=null){if(!RE(a)||document.activeElement===a.target)return;const l=o.get(s);if(!l)return;const{activatorNode:u,node:c}=l;if(!u.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[u.current,c.current]){if(!d)continue;const p=l_e(d);if(p){p.focus();break}}})}},[i,t,o,s,a]),null}function b5e(e,t){let{transform:r,...i}=t;return e!=null&&e.length?e.reduce((o,a)=>a({transform:o,...i}),r):r}function w5e(e){return X.exports.useMemo(()=>({draggable:{...y1.draggable,...e?.draggable},droppable:{...y1.droppable,...e?.droppable},dragOverlay:{...y1.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function x5e(e){let{activeNode:t,measure:r,initialRect:i,config:o=!0}=e;const a=X.exports.useRef(!1),{x:s,y:l}=typeof o=="boolean"?{x:o,y:o}:o;Jl(()=>{if(!s&&!l||!t){a.current=!1;return}if(a.current||!i)return;const c=t?.node.current;if(!c||c.isConnected===!1)return;const d=r(c),p=l$(d,i);if(s||(p.x=0),l||(p.y=0),a.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const v=u$(c);v&&v.scrollBy({top:p.y,left:p.x})}},[t,s,l,i,r])}const _$=X.exports.createContext({...eu,scaleX:1,scaleY:1});var Kc;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Kc||(Kc={}));const _5e=X.exports.memo(function(t){var r,i,o,a;let{id:s,accessibility:l,autoScroll:u=!0,children:c,sensors:d=f5e,collisionDetection:p=A_e,measuring:v,modifiers:x,...b}=t;const y=X.exports.useReducer(y5e,void 0,m5e),[_,k]=y,[E,B]=v_e(),[U,D]=X.exports.useState(Kc.Uninitialized),j=U===Kc.Initialized,{draggable:{active:F,nodes:H,translate:W},droppable:{containers:G}}=_,ae=F?H.get(F):null,V=X.exports.useRef({initial:null,translated:null}),oe=X.exports.useMemo(()=>{var Tn;return F!=null?{id:F,data:(Tn=ae?.data)!=null?Tn:p5e,rect:V}:null},[F,ae]),P=X.exports.useRef(null),[ee,le]=X.exports.useState(null),[pe,_e]=X.exports.useState(null),J=iy(b,Object.values(b)),ft=$y("DndDescribedBy",s),Le=X.exports.useMemo(()=>G.getEnabled(),[G]),He=w5e(v),{droppableRects:nr,measureDroppableContainers:Bt,measuringScheduled:Rt}=e5e(Le,{dragging:j,dependencies:[W.x,W.y],config:He.droppable}),Jt=X_e(H,F),vr=X.exports.useMemo(()=>pe?j4(pe):null,[pe]),At=Kn(),kt=t5e(Jt,He.draggable.measure);x5e({activeNode:F?H.get(F):null,config:At.layoutShiftCompensation,initialRect:kt,measure:He.draggable.measure});const Ct=xO(Jt,He.draggable.measure,kt),Lt=xO(Jt?Jt.parentElement:null),Kt=X.exports.useRef({activatorEvent:null,active:null,activeNode:Jt,collisionRect:null,collisions:null,droppableRects:nr,draggableNodes:H,draggingNode:null,draggingNodeRect:null,droppableContainers:G,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),yr=G.getNodeFor((r=Kt.current.over)==null?void 0:r.id),ne=d5e({measure:He.dragOverlay.measure}),Mt=(i=ne.nodeRef.current)!=null?i:Jt,Nt=j?(o=ne.rect)!=null?o:Ct:null,Ie=Boolean(ne.nodeRef.current&&ne.rect),Ae=i5e(Ie?null:Ct),fe=w$(Mt?Ds(Mt):null),Be=o5e(j?yr??Jt:null),rt=u5e(Be),lt=b5e(x,{transform:{x:W.x-Ae.x,y:W.y-Ae.y,scaleX:1,scaleY:1},activatorEvent:pe,active:oe,activeNodeRect:Ct,containerNodeRect:Lt,draggingNodeRect:Nt,over:Kt.current.over,overlayNodeRect:ne.rect,scrollableAncestors:Be,scrollableAncestorRects:rt,windowRect:fe}),jt=vr?_h(vr,W):null,ce=a5e(Be),ie=SO(ce),de=SO(ce,[Ct]),$=_h(lt,ie),C=Nt?R_e(Nt,lt):null,T=oe&&C?p({active:oe,collisionRect:C,droppableRects:nr,droppableContainers:Le,pointerCoordinates:jt}):null,Q=s$(T,"id"),[ve,je]=X.exports.useState(null),ct=Ie?lt:_h(lt,de),ur=T_e(ct,(a=ve?.rect)!=null?a:null,Ct),Dr=X.exports.useCallback((Tn,In)=>{let{sensor:yt,options:Ei}=In;if(P.current==null)return;const Yn=H.get(P.current);if(!Yn)return;const Pi=Tn.nativeEvent,Ji=new yt({active:P.current,activeNode:Yn,event:Pi,options:Ei,context:Kt,onStart(eo){const Mo=P.current;if(Mo==null)return;const Wi=H.get(Mo);if(!Wi)return;const{onDragStart:pa}=J.current,ue={active:{id:Mo,data:Wi.data,rect:V}};ml.exports.unstable_batchedUpdates(()=>{pa?.(ue),D(Kc.Initializing),k({type:xa.DragStart,initialCoordinates:eo,active:Mo}),E({type:"onDragStart",event:ue})})},onMove(eo){k({type:xa.DragMove,coordinates:eo})},onEnd:qo(xa.DragEnd),onCancel:qo(xa.DragCancel)});ml.exports.unstable_batchedUpdates(()=>{le(Ji),_e(Tn.nativeEvent)});function qo(eo){return async function(){const{active:Wi,collisions:pa,over:ue,scrollAdjustedTranslate:Re}=Kt.current;let Ee=null;if(Wi&&Re){const{cancelDrop:q}=J.current;Ee={activatorEvent:Pi,active:Wi,collisions:pa,delta:Re,over:ue},eo===xa.DragEnd&&typeof q=="function"&&await Promise.resolve(q(Ee))&&(eo=xa.DragCancel)}P.current=null,ml.exports.unstable_batchedUpdates(()=>{k({type:eo}),D(Kc.Uninitialized),je(null),le(null),_e(null);const q=eo===xa.DragEnd?"onDragEnd":"onDragCancel";if(Ee){const Fe=J.current[q];Fe?.(Ee),E({type:q,event:Ee})}})}}},[H]),hr=X.exports.useCallback((Tn,In)=>(yt,Ei)=>{const Yn=yt.nativeEvent,Pi=H.get(Ei);if(P.current!==null||!Pi||Yn.dndKit||Yn.defaultPrevented)return;const Ji={active:Pi};Tn(yt,In.options,Ji)===!0&&(Yn.dndKit={capturedBy:In.sensor},P.current=Ei,Dr(yt,In))},[H,Dr]),Rr=J_e(d,hr);s5e(d),Jl(()=>{Ct&&U===Kc.Initializing&&D(Kc.Initialized)},[Ct,U]),X.exports.useEffect(()=>{const{onDragMove:Tn}=J.current,{active:In,activatorEvent:yt,collisions:Ei,over:Yn}=Kt.current;if(!In||!yt)return;const Pi={active:In,activatorEvent:yt,collisions:Ei,delta:{x:$.x,y:$.y},over:Yn};ml.exports.unstable_batchedUpdates(()=>{Tn?.(Pi),E({type:"onDragMove",event:Pi})})},[$.x,$.y]),X.exports.useEffect(()=>{const{active:Tn,activatorEvent:In,collisions:yt,droppableContainers:Ei,scrollAdjustedTranslate:Yn}=Kt.current;if(!Tn||P.current==null||!In||!Yn)return;const{onDragOver:Pi}=J.current,Ji=Ei.get(Q),qo=Ji&&Ji.rect.current?{id:Ji.id,rect:Ji.rect.current,data:Ji.data,disabled:Ji.disabled}:null,eo={active:Tn,activatorEvent:In,collisions:yt,delta:{x:Yn.x,y:Yn.y},over:qo};ml.exports.unstable_batchedUpdates(()=>{je(qo),Pi?.(eo),E({type:"onDragOver",event:eo})})},[Q]),Jl(()=>{Kt.current={activatorEvent:pe,active:oe,activeNode:Jt,collisionRect:C,collisions:T,droppableRects:nr,draggableNodes:H,draggingNode:Mt,draggingNodeRect:Nt,droppableContainers:G,over:ve,scrollableAncestors:Be,scrollAdjustedTranslate:$},V.current={initial:Nt,translated:C}},[oe,Jt,T,C,H,Mt,Nt,nr,G,ve,Be,$]),Y_e({...At,delta:W,draggingRect:C,pointerCoordinates:jt,scrollableAncestors:Be,scrollableAncestorRects:rt});const Gr=X.exports.useMemo(()=>({active:oe,activeNode:Jt,activeNodeRect:Ct,activatorEvent:pe,collisions:T,containerNodeRect:Lt,dragOverlay:ne,draggableNodes:H,droppableContainers:G,droppableRects:nr,over:ve,measureDroppableContainers:Bt,scrollableAncestors:Be,scrollableAncestorRects:rt,measuringConfiguration:He,measuringScheduled:Rt,windowRect:fe}),[oe,Jt,Ct,pe,T,Lt,ne,H,G,nr,ve,Bt,Be,rt,He,Rt,fe]),Nr=X.exports.useMemo(()=>({activatorEvent:pe,activators:Rr,active:oe,activeNodeRect:Ct,ariaDescribedById:{draggable:ft},dispatch:k,draggableNodes:H,over:ve,measureDroppableContainers:Bt}),[pe,Rr,oe,Ct,k,ft,H,ve,Bt]);return Ut(i$.Provider,{value:B,children:[Ut(Yx.Provider,{value:Nr,children:[L(x$.Provider,{value:Gr,children:L(_$.Provider,{value:ur,children:c})}),L(v5e,{disabled:l?.restoreFocus===!1})]}),L(x_e,{...l,hiddenTextDescribedById:ft})]});function Kn(){const Tn=ee?.autoScrollEnabled===!1,In=typeof u=="object"?u.enabled===!1:u===!1,yt=j&&!Tn&&!In;return typeof u=="object"?{...u,enabled:yt}:{enabled:yt}}}),S5e=X.exports.createContext(null),CO="button",C5e="Droppable";function k5e(e){let{id:t,data:r,disabled:i=!1,attributes:o}=e;const a=$y(C5e),{activators:s,activatorEvent:l,active:u,activeNodeRect:c,ariaDescribedById:d,draggableNodes:p,over:v}=X.exports.useContext(Yx),{role:x=CO,roleDescription:b="draggable",tabIndex:y=0}=o??{},_=u?.id===t,k=X.exports.useContext(_?_$:S5e),[E,B]=Lb(),[U,D]=Lb(),j=l5e(s,t),F=iy(r);Jl(()=>(p.set(t,{id:t,key:a,node:E,activatorNode:U,data:F}),()=>{const W=p.get(t);W&&W.key===a&&p.delete(t)}),[p,t]);const H=X.exports.useMemo(()=>({role:x,tabIndex:y,"aria-disabled":i,"aria-pressed":_&&x===CO?!0:void 0,"aria-roledescription":b,"aria-describedby":d.draggable}),[i,x,y,_,b,d.draggable]);return{active:u,activatorEvent:l,activeNodeRect:c,attributes:H,isDragging:_,listeners:i?void 0:j,node:E,over:v,setNodeRef:B,setActivatorNodeRef:D,transform:k}}function E5e(){return X.exports.useContext(x$)}const A5e="Droppable",T5e={timeout:25};function I5e(e){let{data:t,disabled:r=!1,id:i,resizeObserverConfig:o}=e;const a=$y(A5e),{active:s,dispatch:l,over:u,measureDroppableContainers:c}=X.exports.useContext(Yx),d=X.exports.useRef({disabled:r}),p=X.exports.useRef(!1),v=X.exports.useRef(null),x=X.exports.useRef(null),{disabled:b,updateMeasurementsFor:y,timeout:_}={...T5e,...o},k=iy(y??i),E=X.exports.useCallback(()=>{if(!p.current){p.current=!0;return}x.current!=null&&clearTimeout(x.current),x.current=setTimeout(()=>{c(Array.isArray(k.current)?k.current:[k.current]),x.current=null},_)},[_]),B=Gx({callback:E,disabled:b||!s}),U=X.exports.useCallback((H,W)=>{!B||(W&&(B.unobserve(W),p.current=!1),H&&B.observe(H))},[B]),[D,j]=Lb(U),F=iy(t);return X.exports.useEffect(()=>{!B||!D.current||(B.disconnect(),p.current=!1,B.observe(D.current))},[D,B]),Jl(()=>(l({type:xa.RegisterDroppable,element:{id:i,key:a,disabled:r,node:D,rect:v,data:F}}),()=>l({type:xa.UnregisterDroppable,key:a,id:i})),[i]),X.exports.useEffect(()=>{r!==d.current.disabled&&(l({type:xa.SetDroppableDisabled,id:i,key:a,disabled:r}),d.current.disabled=r)},[i,a,r,l]),{active:s,rect:v,isOver:u?.id===i,node:D,over:u,setNodeRef:j}}function S$(e,t,r){const i=e.slice();return i.splice(r<0?i.length+r:r,0,i.splice(t,1)[0]),i}function R5e(e,t){return e.reduce((r,i,o)=>{const a=t.get(i);return a&&(r[o]=a),r},Array(e.length))}function Hv(e){return e!==null&&e>=0}function P5e(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r{let{rects:t,activeIndex:r,overIndex:i,index:o}=e;const a=S$(t,i,r),s=t[o],l=a[o];return!l||!s?null:{x:l.left-s.left,y:l.top-s.top,scaleX:l.width/s.width,scaleY:l.height/s.height}},Wv={scaleX:1,scaleY:1},O5e=e=>{var t;let{activeIndex:r,activeNodeRect:i,index:o,rects:a,overIndex:s}=e;const l=(t=a[r])!=null?t:i;if(!l)return null;if(o===r){const c=a[s];return c?{x:0,y:rr&&o<=s?{x:0,y:-l.height-u,...Wv}:o=s?{x:0,y:l.height+u,...Wv}:{x:0,y:0,...Wv}};function B5e(e,t,r){const i=e[t],o=e[t-1],a=e[t+1];return i?ri.map(j=>typeof j=="object"&&"id"in j?j.id:j),[i]),b=s!=null,y=s?x.indexOf(s.id):-1,_=c?x.indexOf(c.id):-1,k=X.exports.useRef(x),E=!P5e(x,k.current),B=_!==-1&&y===-1||E,U=M5e(a);Jl(()=>{E&&b&&d(x)},[E,x,b,d]),X.exports.useEffect(()=>{k.current=x},[x]);const D=X.exports.useMemo(()=>({activeIndex:y,containerId:p,disabled:U,disableTransforms:B,items:x,overIndex:_,useDragOverlay:v,sortedRects:R5e(x,u),strategy:o}),[y,p,U.draggable,U.droppable,B,x,_,u,v,o]);return L(E$.Provider,{value:D,children:t})}const D5e=e=>{let{id:t,items:r,activeIndex:i,overIndex:o}=e;return S$(r,i,o).indexOf(t)},L5e=e=>{let{containerId:t,isSorting:r,wasDragging:i,index:o,items:a,newIndex:s,previousItems:l,previousContainerId:u,transition:c}=e;return!c||!i||l!==a&&o===s?!1:r?!0:s!==o&&t===u},N5e={duration:200,easing:"ease"},A$="transform",j5e=ay.Transition.toString({property:A$,duration:0,easing:"linear"}),$5e={roleDescription:"sortable"};function F5e(e){let{disabled:t,index:r,node:i,rect:o}=e;const[a,s]=X.exports.useState(null),l=X.exports.useRef(r);return Jl(()=>{if(!t&&r!==l.current&&i.current){const u=o.current;if(u){const c=Mg(i.current,{ignoreTransform:!0}),d={x:u.left-c.left,y:u.top-c.top,scaleX:u.width/c.width,scaleY:u.height/c.height};(d.x||d.y)&&s(d)}}r!==l.current&&(l.current=r)},[t,r,i,o]),X.exports.useEffect(()=>{a&&s(null)},[a]),a}function T$(e){let{animateLayoutChanges:t=L5e,attributes:r,disabled:i,data:o,getNewIndex:a=D5e,id:s,strategy:l,resizeObserverConfig:u,transition:c=N5e}=e;const{items:d,containerId:p,activeIndex:v,disabled:x,disableTransforms:b,sortedRects:y,overIndex:_,useDragOverlay:k,strategy:E}=X.exports.useContext(E$),B=z5e(i,x),U=d.indexOf(s),D=X.exports.useMemo(()=>({sortable:{containerId:p,index:U,items:d},...o}),[p,o,U,d]),j=X.exports.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:F,node:H,isOver:W,setNodeRef:G}=I5e({id:s,data:D,disabled:B.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...u}}),{active:ae,activatorEvent:V,activeNodeRect:oe,attributes:P,setNodeRef:ee,listeners:le,isDragging:pe,over:_e,setActivatorNodeRef:J,transform:ft}=k5e({id:s,data:D,attributes:{...$5e,...r},disabled:B.draggable}),Le=n_e(G,ee),He=Boolean(ae),nr=He&&!b&&Hv(v)&&Hv(_),Bt=!k&&pe,Rt=Bt&&nr?ft:null,vr=nr?Rt??(l??E)({rects:y,activeNodeRect:oe,activeIndex:v,overIndex:_,index:U}):null,At=Hv(v)&&Hv(_)?a({id:s,items:d,activeIndex:v,overIndex:_}):U,kt=ae?.id,Ct=X.exports.useRef({activeId:kt,items:d,newIndex:At,containerId:p}),Lt=d!==Ct.current.items,Kt=t({active:ae,containerId:p,isDragging:pe,isSorting:He,id:s,index:U,items:d,newIndex:Ct.current.newIndex,previousItems:Ct.current.items,previousContainerId:Ct.current.containerId,transition:c,wasDragging:Ct.current.activeId!=null}),yr=F5e({disabled:!Kt,index:U,node:H,rect:F});return X.exports.useEffect(()=>{He&&Ct.current.newIndex!==At&&(Ct.current.newIndex=At),p!==Ct.current.containerId&&(Ct.current.containerId=p),d!==Ct.current.items&&(Ct.current.items=d)},[He,At,p,d]),X.exports.useEffect(()=>{if(kt===Ct.current.activeId)return;if(kt&&!Ct.current.activeId){Ct.current.activeId=kt;return}const Mt=setTimeout(()=>{Ct.current.activeId=kt},50);return()=>clearTimeout(Mt)},[kt]),{active:ae,activeIndex:v,attributes:P,data:D,rect:F,index:U,newIndex:At,items:d,isOver:W,isSorting:He,isDragging:pe,listeners:le,node:H,overIndex:_,over:_e,setNodeRef:Le,setActivatorNodeRef:J,setDroppableNodeRef:G,setDraggableNodeRef:ee,transform:yr??vr,transition:ne()};function ne(){if(yr||Lt&&Ct.current.newIndex===U)return j5e;if(!(Bt&&!RE(V)||!c)&&(He||Kt))return ay.Transition.toString({...c,property:A$})}}function z5e(e,t){var r,i;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e?.draggable)!=null?r:t.draggable,droppable:(i=e?.droppable)!=null?i:t.droppable}}function $b(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const H5e=[zi.Down,zi.Right,zi.Up,zi.Left],W5e=(e,t)=>{let{context:{active:r,collisionRect:i,droppableRects:o,droppableContainers:a,over:s,scrollableAncestors:l}}=t;if(H5e.includes(e.code)){if(e.preventDefault(),!r||!i)return;const u=[];a.getEnabled().forEach(p=>{if(!p||p!=null&&p.disabled)return;const v=o.get(p.id);if(!!v)switch(e.code){case zi.Down:i.topv.top&&u.push(p);break;case zi.Left:i.left>v.left&&u.push(p);break;case zi.Right:i.left1&&(d=c[1].id),d!=null){const p=a.get(r.id),v=a.get(d),x=v?o.get(v.id):null,b=v?.node.current;if(b&&x&&p&&v){const _=Kx(b).some((j,F)=>l[F]!==j),k=I$(p,v),E=V5e(p,v),B=_||!k?{x:0,y:0}:{x:E?i.width-x.width:0,y:E?i.height-x.height:0},U={x:x.left,y:x.top};return B.x&&B.y?U:oy(U,B)}}}};function I$(e,t){return!$b(e)||!$b(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function V5e(e,t){return!$b(e)||!$b(t)||!I$(e,t)?!1:e.data.current.sortable.indext(!0),o=()=>t(!1);return X.exports.useEffect(()=>{const a=r.current;if(a)return a.addEventListener("mouseover",i),a.addEventListener("mouseout",o),()=>{a.removeEventListener("mouseover",i),a.removeEventListener("mouseout",o)}},[r.current]),{hoverRef:r,isHover:e}}const K5e="/verifier/assets/delete.42fb1897.svg",G5e="/verifier/assets/dnd.dcf4594c.svg",Y5e=Xi("input")({display:"flex",alignItems:"center",width:300,height:44,background:"#FFFFFF",border:"1px solid #D8D8D8",borderRadius:"12px",fontSize:14,fontFamily:"Mulish",paddingLeft:10,outline:"none","&:hover":{border:"1px solid #b0b0b0"},"&:focus":{border:"1px solid #807e7e"}}),rs=Xi(j6)({border:"none",padding:0}),qp=Xi(j6)({fontWeight:700}),Fl=Xi("hr")({display:"block",width:"100%",height:1,backgroundColor:"#ccc",border:"none"}),Q5e=e=>e.replace(/\/+/g,"/").replace(/^\/[^\/]/,"").replace(/\/$/,"");function kO({file:e,pos:t,isHover:r}){const i=e.fileObj.name,{attributes:o,listeners:a}=T$({id:i}),s=la(),l=aa(s.breakpoints.down("lg")),{setInclueInCommand:u,setDirectory:c,removeFile:d}=zu(),{data:p}=Hu(),v=!!p?.result?.msgCell;return Ut(ta,{children:[L(rs,{sx:{paddingLeft:1},...o,...a,children:Ut($n,{sx:{color:"#D8D8D8"},children:[t,".",L($n,{ml:5,style:{cursor:"pointer",visibility:r?"visible":"hidden"},children:L("img",{src:G5e,alt:"Drag n drop icon",width:24,height:24})})]})}),L(rs,{children:L(Y5e,{disabled:v,value:e.folder,onBlur:x=>{c(i,Q5e(x.target.value))},onChange:x=>{c(i,x.target.value)}})}),L(rs,{sx:{paddingLeft:l?2:0},children:Ut($n,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"flex-start"},children:[L(jo,{sx:{fontSize:14},children:e.fileObj.name}),Ut(jo,{sx:{fontSize:12,color:"#C1C1C1"},children:[e.fileObj.size," bytes"]})]})}),L(rs,{children:L(woe,{disabled:v,checked:e.includeInCommand,onChange:x=>{u(i,x.target.checked)}})}),L(rs,{align:"right",children:L(Bs,{sx:{visibility:r?"visible":"hidden",opacity:.5,cursor:"pointer",marginRight:1},onClick:()=>{d(i)},children:L("img",{src:K5e,alt:"Delete icon",width:18,height:18})})})]})}function Z5e({file:e,pos:t}){const r=e.fileObj.name,{hoverRef:i,isHover:o}=q5e(),{data:a}=Hu(),s=!!a?.result?.msgCell,{setNodeRef:l,transform:u,transition:c,isDragging:d}=T$({id:r}),p={transform:ay.Transform.toString(u),transition:c};return s?L(xc,{sx:{height:60},children:L(kO,{file:e,pos:t,isDragging:!1,isHover:!1})}):L(xc,{sx:{height:60,transition:".15s all","&:hover":{background:"#FAFAFA"}},ref:v=>{l(v),i.current=v},style:p,children:L(kO,{file:e,pos:t,isDragging:d,isHover:o})},r)}function X5e(){const{files:e,reorderFiles:t}=zu(),{data:r}=Hu(),i=la(),o=aa(i.breakpoints.down("lg")),a=!!r?.result?.msgCell,s=__e(J5(y$,{}),J5(v$,{}),J5(ME,{coordinateGetter:W5e}));function l(u){const{active:c,over:d}=u;c.id!==d.id&&t(c.id,d.id)}return L(_5e,{sensors:s,collisionDetection:C_e,onDragEnd:l,modifiers:[d_e,c_e],children:L(Xoe,{children:Ut(L6,{sx:{minWidth:650},children:[Ut(z7,{sx:{"&.MuiTableHead-root th":{border:"none"}},children:[Ut(xc,{sx:{fontWeight:700},children:[L(qp,{sx:{paddingLeft:0,paddingBottom:o?0:2,width:100},children:"Order"}),L(qp,{sx:{paddingLeft:0,paddingBottom:o?0:2},children:"Directory"}),L(qp,{sx:{paddingLeft:o?2:0,width:300,paddingBottom:o?0:2},children:"File"}),L(qp,{sx:{paddingLeft:0,width:150,paddingBottom:o?0:2},children:"Include in command"}),L(qp,{sx:{paddingLeft:0,width:100,paddingBottom:o?0:2}})]}),Ut(xc,{children:[L(rs,{sx:{paddingBottom:o?0:2},children:L(Fl,{})}),L(rs,{sx:{paddingBottom:o?0:2},children:L(Fl,{})}),L(rs,{sx:{paddingBottom:o?0:2},children:L(Fl,{})}),L(rs,{sx:{paddingBottom:o?0:2},children:L(Fl,{})}),L(rs,{sx:{paddingBottom:o?0:2},children:L(Fl,{})})]})]}),L(N6,{children:L(U5e,{disabled:a,items:e.map(u=>u.fileObj.name),strategy:O5e,children:e.map((u,c)=>L(Z5e,{file:u,pos:c+1},u.fileObj.name))})})]})})})}const i3=Xi(k7)({flexGrow:1}),o3=Xi(j7)(({theme:e})=>({borderRadius:e.spacing(1.2),height:e.spacing(5.3),minWidth:150,".MuiOutlinedInput-notchedOutline":{border:"1px solid #D8D8D8"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{border:"1px solid #807e7e"},"&:hover .MuiOutlinedInput-notchedOutline":{border:"1px solid #b0b0b0"}})),Vv=Xi(E7)(({theme:e})=>({color:"#000",fontSize:12,marginLeft:e.spacing(1),marginBottom:e.spacing(1)})),J5e=Xi("input")(({theme:e})=>({display:"flex",alignItems:"center",boxSizing:"border-box",width:"100%",flex:2,height:e.spacing(5.3),borderRadius:e.spacing(1.2),border:"1px solid #D8D8D8",outline:"none",padding:"0 40px 0 125px",color:"#000",background:"transparent",fontFamily:"Mulish",fontSize:14,"&:hover":{border:"1px solid #b0b0b0"},"&:focus":{border:"1px solid #807e7e"}})),e3e="/verifier/assets/undo.944d3e45.svg";function t3e(){const{compilerSettings:e,setOverrideCommandLine:t,setFuncCliVersion:r,setTactCliVersion:i,compiler:o,setCompiler:a}=cE(),{data:s}=Hu(),l=la(),u=aa(l.breakpoints.down("md")),c=!!s?.result?.msgCell,{data:{funcVersions:d,tactVersions:p}}=uE();return Ut(da,{mt:4,children:[L(jo,{variant:"h5",style:{fontWeight:800,fontSize:16,marginBottom:16},children:"Compiler"}),Ut($n,{sx:{gap:1,alignItems:u?"center":"flex-end",flexDirection:u?"column":"inherit"},children:[L($n,{mb:u?1:0,sx:{width:u?"100%":"inherit"},children:Ut(i3,{children:[L(Vv,{children:"Compiler"}),Ut(o3,{value:o,onChange:v=>{a(v.target.value)},children:[L(rm,{value:"func",children:"func"}),L(rm,{value:"tact",children:"tact"}),{}.VITE_ALLOW_FIFT&&L(rm,{value:"fift",children:"fift"})]})]})}),o==="func"&&Ut(ta,{children:[L($n,{mb:u?1:0,sx:{width:u?"100%":"inherit"},children:Ut(i3,{disabled:c,children:[L(Vv,{children:"Version"}),L(o3,{value:e.funcVersion,onChange:v=>{r(v.target.value)},children:d?.map(v=>L(rm,{value:v,children:v},v))})]})}),Ut(da,{sx:{width:"100%",position:"relative"},children:[L(Vv,{sx:{display:"block"},children:"Func command"}),L(J5e,{disabled:c,value:e.commandLine,onChange:v=>{t(v.target.value)}}),L(Fee,{sx:{position:"absolute",left:3,top:28,height:37,background:"#F5F5F5",borderRadius:1.5,color:"#000",fontSize:14},label:"func -o tmp.fif"}),!!e.overrideCommandLine&&L(Bs,{sx:{color:"blue",position:"absolute",right:10,top:31},onClick:()=>{t(null)},children:L("img",{src:e3e,alt:"Undo icon",width:15,height:15})})]})]}),o==="tact"&&L(ta,{children:L($n,{mb:u?1:0,sx:{width:u?"100%":"inherit"},children:Ut(i3,{disabled:c,children:[L(Vv,{children:"Version"}),L(o3,{value:e.tactVersion,disabled:!0,children:p?.map(v=>L(rm,{value:v,children:v},v))})]})})})]})]})}const r3e="/verifier/assets/reorder-hint.5f3a54fb.svg",n3e="/verifier/assets/light-bulb.7768be40.svg",R$="/verifier/assets/like.af7e7b33.svg",i3e=sr(kn)({maxWidth:1160,width:"calc(100% - 50px)",margin:"auto"}),o3e=sr(kn)({display:"flex",justifyContent:"space-between",height:73}),a3e=sr(kn)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:e.spacing(1.5)})),s3e=sr(kn)(({theme:e})=>({display:"flex",flexWrap:"wrap",justifyContent:"space-between",marginTop:e.spacing(3),marginBottom:e.spacing(2),color:"#728A96",fontSize:14,[e.breakpoints.down("md")]:{"& > *":{marginBottom:`${e.spacing(1)} !important`}}})),l3e=sr("hr")({height:"1px",backgroundColor:"#e6e6e6",border:"none"}),EO=sr(uc)(({theme:e})=>({display:"inline-flex",alignItems:"center",color:"inherit",textDecoration:"none",[e.breakpoints.down("md")]:{justifyContent:"flex-end"}})),Fy=sr(kn)({display:"flex",justifyContent:"center",alignItems:"center"}),u3e=sr(Fy)(({theme:e})=>({[e.breakpoints.down("md")]:{minWidth:"100%",flex:2,order:3}})),P$=sr(Fy)(({theme:e})=>({[e.breakpoints.down("md")]:{minWidth:"50%"}})),c3e=sr(P$)(({theme:e})=>({[e.breakpoints.down("md")]:{justifyContent:"start"},[e.breakpoints.down("sm")]:{minWidth:100}})),d3e=sr(P$)(({theme:e})=>({[e.breakpoints.down("md")]:{justifyContent:"end"},[e.breakpoints.down("sm")]:{minWidth:100}})),f3e="/verifier/assets/heart.52fe96d0.svg",p3e="/verifier/assets/orbs.eb35e74b.svg",h3e="/verifier/assets/telegram.bcba2ca3.svg",g3e="/verifier/assets/telegram-hover.72b9d3ce.svg",m3e="/verifier/assets/github-footer.0bd3bbab.svg",y3e="/verifier/assets/github-hover.33daf3ef.svg",AO=sr(kn)(e=>({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"center",width:t.spacing(3),height:t.spacing(3),background:`url(${e.iconUrl})`,"&:hover":{transitionDuration:".25s",background:`url(${e.disabled?e.iconUrl:e.hoveredIconUrl})`,cursor:e.disabled?"cursor":"pointer"}})),TO=({iconUrl:e,hoveredIconUrl:t,link:r})=>r.length?L(uc,{target:"_blank",href:r,children:L(AO,{iconUrl:e,hoveredIconUrl:t})}):L(AO,{iconUrl:e,hoveredIconUrl:t,disabled:!0});function M$(){const e=QC(),[t,r]=yw();return()=>{t.has("testnet")?t.delete("testnet"):t.append("testnet",""),r(t),e(0)}}function BE(){const e=M$();return L(kn,{sx:{background:"red",color:"white",py:2},children:Ut(wE,{sx:{gap:4,px:4},children:[L(jo,{sx:{fontWeight:"bold",flexGrow:1},children:"Testnet"}),L(jo,{onClick:()=>{e()},sx:{cursor:"pointer"},children:"Switch to mainnet"})]})})}const H4="https://t.me/tonverifier";function Fb(){const e=aa("(max-width: 450px)"),t=Ac(),r=M$();return Ut(i3e,{children:[Ut(o3e,{mb:e?5:"inherit",sx:{flexDirection:e?"column":"inherit",alignItems:e?"center":"inherit"},children:[L($n,{children:Ut(ap,{sx:{color:"#000"},onClick:()=>t("/"),children:[L("img",{src:vw,alt:"App icon",width:30,height:30}),L(cx,{children:"TON VERIFIER"})]})}),Ut(a3e,{children:[L(TO,{iconUrl:h3e,hoveredIconUrl:g3e,link:H4}),L(TO,{iconUrl:m3e,hoveredIconUrl:y3e,link:"https://github.com/orbs-network/ton-contract-verifier"})]})]}),L(l3e,{}),Ut(s3e,{children:[L(c3e,{children:L(jo,{variant:"body2",children:"\xA9 2023"})}),L(u3e,{children:Ut($n,{sx:{gap:.1},children:["Contributed with",L($n,{mx:.4,children:L("img",{src:f3e,alt:"Heart",width:12,height:12})}),"by",L($n,{mx:.4,children:L("img",{src:p3e,alt:"Orbs logo",width:12,height:12})}),L(EO,{sx:{color:"#5E75E8"},target:"_blank",href:"https://orbs.com/powered-by",children:"Orbs"})]})}),Ut(d3e,{children:[L(EO,{target:"_blank",href:H4,children:L(jo,{variant:"body2",children:"Support"})}),!window.isTestnet&&L(jo,{onClick:()=>{r()},sx:{ml:2,cursor:"pointer"},variant:"body2",children:"Switch to Testnet"})]})]})]})}const v3e=sr("li")({maxWidth:650,fontSize:14,fontWeight:400,marginBottom:10});function b3e(e,t){switch(e){case Na.ENTRYPOINT_MISSING:return"There usually should be at least one file containing an entrypoint (recv_internal, main)";case Na.STDLIB_ORDER:return"stdlib.fc should usually be the first file in the list (unless it's imported from another file)";case Na.STDLIB_MISSING:return"You can try to add stdlib.fc to your sources.";case Na.NOT_SIMILAR:return"Source code compiles correctly but does not match the on-chain contract hash. Make sure you are using the correct compiler version, command line and file order.";case Na.FILE_ORDER:return"Make sure all files in the command line are in the correct order";case Na.COMPILER_VERSION:return"Try to use the same compiler version as the contract was compiled with";case Na.REQUIRED_FILES:return"Make sure all required files are included in the command line";case Na.SUPPORT_GROUP:return Ut("div",{children:["If you are still facing issues, you can use the"," ",L(uc,{target:"_blank",href:H4,sx:{textDecoration:"none",cursor:"pointer"},children:"Telegram support group"})]})}}const w3e=({hint:e})=>{const{data:t}=Hu();return L(v3e,{children:b3e(e,t?.result.compileResult)})},Dd=sr(jo)({fontSize:14,fontWeight:400,marginBottom:"10px"}),IO=sr(jo)({fontSize:14,fontWeight:700}),O$=sr(jo)({fontSize:14,fontWeight:400}),RO=sr($n)({padding:"20px 30px",paddingLeft:0,"&:hover":{background:"transparent"}}),PO=sr(Tj)({minWidth:200,fontSize:14,fontWeight:600}),x3e=sr(da)({borderBottom:"1px solid rgba(0, 0, 0, 0.2)"}),MO=sr(Ij)({color:"#000",fontSize:14,fontWeight:400});function _3e(){const{data:e,error:t}=Hu(),{data:r}=vp(),i=e?.result?.compileResult,o=e?.hints??[];return Ut(da,{my:3,children:[["similar"].includes(i?.result??"")&&L(Cs,{singleLine:!0,type:ps.SUCCESS,title:Ut($n,{sx:{height:42},children:[L($n,{mr:1,children:L("img",{src:R$,alt:"Like icon",width:31,height:31})}),Ut(O$,{children:[" ",L("b",{children:"Great!"})," Compile output hash matches this on-chain contract"]})]}),notificationBody:L(da,{})}),["not_similar"].includes(i?.result??"")&&L(Cs,{type:ps.ERROR,title:Ut($n,{children:[L($n,{mr:1,children:L("img",{src:r3e,alt:"Reorder icon",width:39,height:26})}),L(IO,{children:"Hashes are not similar"})]}),notificationBody:Ut(da,{sx:{display:"flex",flexDirection:"column"},children:[Ut(RO,{children:[L(PO,{children:"Contract hash"}),L(MO,{children:r?.codeCellHash.base64??"-"})]}),L(x3e,{}),Ut(RO,{children:[L(PO,{children:"Compile output hash"}),L(MO,{children:i?.hash??"-"})]})]})}),i?.error&&L(Cs,{type:ps.ERROR,title:Ut(Dd,{children:[L("span",{style:{color:"#FC5656"},children:"Error: "}),"Compile error"]}),notificationBody:L(da,{sx:{overflow:"auto",maxHeight:300},children:L("div",{children:L("code",{children:i.error})})})}),!!t&&L(Cs,{type:ps.ERROR,title:Ut(Dd,{children:[L("span",{style:{color:"#FC5656"},children:"Error: "}),"Server error"]}),notificationBody:L(da,{sx:{overflow:"auto",maxHeight:300},children:L("div",{children:L("code",{children:t.toString()})})})}),o.length>0&&L(Cs,{type:ps.HINT,title:Ut($n,{mb:2,children:[L($n,{mr:1,children:L("img",{src:n3e,alt:"Light bulb icon",width:21,height:22})}),L(IO,{children:"Possible reasons for failure"})]}),notificationBody:L("ul",{style:{paddingLeft:25},children:o.map(a=>L(w3e,{hint:a},a))})})]})}function B$(){const[e]=kg();return L(Ha,{background:"#1976d2",hoverBackground:"#156cc2",height:37,fontSize:14,fontWeight:700,textColor:"#fff",type:"button",onClick:()=>e.connectWallet(),children:"Connect wallet"})}const S3e=Xi(da)({padding:"15px 24px"});function C3e(){const e=Bx(),{hasFiles:t}=zu(),{step:r,proceedToPublish:i,toggleSection:o,currentSection:a}=Vx(),{mutate:s,data:l,error:u,isLoading:c,compileStatus:d}=Hu(),p=!!l?.result?.msgCell,v=()=>o(sc.SOURCES);return Ut(ug,{children:[L(da,{sx:{cursor:r===hc.PUBLISH&&p?"pointer":"inherit"},onClick:v,children:L(r_e,{})}),a===sc.SOURCES&&L(vy,{in:a===sc.SOURCES,children:L(S3e,{children:Ut(ta,{children:[t()&&Ut(ta,{children:[L(X5e,{}),L(t3e,{})]}),(l||u)&&L(_3e,{}),t()&&L($n,{sx:{justifyContent:"center"},mt:3,mb:"9px",children:e?l?.result?.msgCell?L(Ha,{disabled:r===hc.PUBLISH,fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:i,children:"Ready to publish"}):Ut(Ha,{disabled:!t(),fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{s(null)},children:[c&&L(lg,{sx:{color:"#fff",height:"20px !important",width:"20px !important"}}),"Compile"]}):L(B$,{})})]})})})]})}const k3e=sr(c2)({borderRadius:40,fontFamily:"inherit",fontWeight:700,textTransform:"none",background:"#0088CC","&:disabled":{backgroundColor:"#e0e0e0"}});function nd(e){return L(k3e,{disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,variant:"contained",disabled:e.disabled,onClick:e.disabled?void 0:e.onClick,...e,children:e.text})}const E3e="/verifier/assets/publish.83df630b.svg";function A3e(){const{data:e}=Hu(),{sendTXN:t,status:r,clearTXN:i}=rj(),{step:o,toggleSection:a,currentSection:s}=Vx();zu();const l=!!e?.result?.msgCell;let u;const c=()=>o===hc.PUBLISH&&l&&a(sc.PUBLISH);switch(r){case"initial":u=L("span",{children:"To store your contract\u2019s verification proof on-chain, you will need to issue a transaction. This will cost 0.5 TON"});break;case"rejected":u="Transaction rejected, please retry.";break;case"pending":u="Check your wallet for a pending transaction.";break;case"issued":u="Transaction issued, monitoring proof deployment on-chain.";break;case"success":u="Your contract is now verified! Click below to view it.";break;case"expired":u="Transaction expired, please retry.";break;case"error":u="The transaction is taking too long to complete or have failed. Please use a blockchain explorer to monitor it. You can also use our telegram support group."}return Ut(ug,{mb:6,children:[Ut($n,{p:s===sc.PUBLISH?"30px 24px 0 24px":"20px 24px",onClick:c,sx:{opacity:o===hc.PUBLISH&&l?1:.25,cursor:o===hc.PUBLISH&&l?"pointer":"inherit"},children:[L(cg,{children:L("img",{src:r==="success"?r$:E3e,alt:"publish icon",width:41,height:41})}),L(Fd,{children:"Publish"})]}),s===sc.PUBLISH&&l&&L(vy,{in:s===sc.PUBLISH,children:Ut(da,{children:[L(da,{sx:{padding:"0 30px"},children:L(Cs,{type:ps.INFO,title:L(ta,{}),notificationBody:L($n,{sx:{overflow:"auto",maxHeight:300},children:L(Dd,{sx:{marginBottom:0},children:u})})})}),Ut($n,{mb:3,sx:{justifyContent:"center"},children:[r!=="success"&&Ut(Ha,{disabled:r==="pending"||r==="issued",fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{t()},children:[(r==="pending"||r==="issued")&&L(lg,{sx:{color:"#fff",height:"20px !important",width:"20px !important"}}),"Publish"]}),r==="success"&&L(nd,{sx:{height:44},text:"View verified contract",onClick:()=>{location.reload()}})]})]})})]})}const T3e="/verifier/assets/verification-alert.0ebcec4f.svg",I3e="/verifier/assets/verification-binary.d6844d86.svg",R3e="/verifier/assets/verification-bomb.3bf48d9c.svg",P3e="/verifier/assets/verification-paper.34a39e79.svg",M3e="/verifier/assets/show.836c8f4f.svg",O3e="/verifier/assets/verification.fbd44dba.svg",B3e=Xi(Bs)(()=>({color:"#000"})),U3e=Xi(da)({display:"flex",alignItems:"center",flexDirection:"column","& .title":{texAlign:"center",fontWeight:500,fontSize:20,marginBottom:20},"& .base-button":{height:40,marginTop:30}});function D3e({open:e,onClose:t,children:r,backgroundColor:i="rgba(48, 48, 48, 0.4)",blur:o=!0,className:a="",maxWidth:s,hideCloseButton:l,paddingTop:u}){return L(rre,{className:`${a} ${o&&"popup-filter"}`,fullWidth:!0,onClose:t,open:e,PaperProps:{style:{maxWidth:s||"unset",width:"100%",borderRadius:"10px",padding:0,overflow:"unset",margin:20}},BackdropProps:{style:{backgroundColor:i}},children:Ut(da,{sx:{overflow:"scroll","::-webkit-scrollbar":{display:"none"}},children:[!l&&L(da,{sx:{display:"flex",justifyContent:"end",width:"100%"},children:L(B3e,{onClick:t,children:L(Ck,{style:{width:23,height:23}})})}),L(U3e,{px:3,pb:3,pt:u?3:0,children:r})]})})}const L3e="/verifier/assets/verification-popup.1a3fc640.svg",N3e=sr(L6)({overflow:"scroll",background:"#F7F9FB",borderRadius:"5px",width:"100%"}),j3e=sr(kn)({background:"#F7F9FB",borderRadius:"5px",width:"100%"}),$3e=sr(z7)({"&.MuiTableHead-root th":{border:"none",fontSize:13}}),F3e=sr(xc)({fontWeight:700}),$p=sr(qp)({paddingLeft:0,paddingBottom:"2px"}),Fp=sr(rs)({paddingBottom:10}),z3e=sr($n)({width:59,height:21,background:"#08D088",borderRadius:40,color:"#fff",justifyContent:"space-around",fontSize:12}),id=sr(rs)({paddingBottom:16}),H3e=sr(uc)({textDecoration:"none",cursor:"pointer",color:"#0088CC"}),W3e=sr(kn)({width:"100%",display:"flex",justifyContent:"flex-end"}),a3=sr(jo)({color:"#728A96",fontSize:14}),V3e=sr(Fd)({fontSize:18,fontWeight:800,color:"#000",textAlign:"center"}),q3e=sr(kn)({display:"inline-flex",alignItems:"center",height:"20px",padding:"0 7px",background:"rgba(146, 146, 146, 0.3)",borderRadius:"10px",color:"#212121",fontWeight:400,fontSize:"14px",fontFamily:"IBM Plex Mono, monospace"});sr(q3e)({position:"relative",top:5,display:"inline-block",whiteSpace:"nowrap",lineHeight:"20px",width:"100%",maxWidth:600,overflow:"hidden",textOverflow:"ellipsis"});const K3e="/verifier/assets/verified.4e0dc210.svg",Am=()=>L(Xa,{width:"85%",variant:"text",sx:{transform:"none",background:"#e6e8eb"}}),G3e=()=>Ut($3e,{children:[Ut(F3e,{children:[L($p,{sx:{width:80,paddingLeft:3},children:"Status"}),L($p,{sx:{width:370},children:"Public Key"}),L($p,{sx:{width:35}}),L($p,{sx:{width:105},children:"IP"}),L($p,{sx:{width:150},children:"Verification date"}),L($p,{sx:{width:100},children:"Verifier"})]}),Ut(xc,{children:[L(Fp,{children:L(Fl,{})}),L(Fp,{children:L(Fl,{})}),L(Fp,{children:L(Fl,{})}),L(Fp,{children:L(Fl,{})}),L(Fp,{children:L(Fl,{})}),L(Fp,{children:L(Fl,{})})]})]}),OO=()=>Ut(xc,{children:[L(rs,{sx:{paddingLeft:3,paddingBottom:2},children:L(Am,{})}),L(id,{children:L(Am,{})}),L(id,{children:L(Xa,{width:25,variant:"text",sx:{transform:"none",background:"#e6e8eb"}})}),L(id,{children:L(Am,{})}),L(id,{children:L(Am,{})}),L(rs,{sx:{paddingRight:3,paddingBottom:2},children:L(Am,{})})]}),Y3e=({pubKey:e,endpoint:t,name:r,onCopy:i,date:o,url:a})=>Ut(xc,{children:[L(rs,{sx:{paddingLeft:3,paddingBottom:2},children:Ut(z3e,{px:1,children:[L("img",{src:K3e,alt:"Verified icon",width:11,height:11}),"Verified"]})}),L(id,{children:L(a3,{children:e})}),L(id,{children:L(Bs,{onClick:()=>i(e),sx:{padding:.5},children:L("img",{src:Wx,alt:"Copy icon",width:16,height:16})})}),L(id,{children:L(a3,{children:t})}),L(id,{children:L(a3,{children:o})}),L(rs,{sx:{paddingRight:3,paddingBottom:2},children:L($n,{children:L(H3e,{target:"_blank",href:a,children:r})})})]});function Q3e(){const{data:e,isLoading:t,error:r}=Pc(),{data:i,isLoading:o,error:a}=zx(),{showNotification:s}=Ry(),l=i?.find(c=>c.name===window.verifierId),u=X.exports.useCallback(async c=>{navigator.clipboard.writeText(c),s("Copied to clipboard!","success")},[]);return Ut(kn,{sx:{overflow:"scroll",borderRadius:"5px","::-webkit-scrollbar":{display:"none"}},children:[Ut(N3e,{sx:{minWidth:900},children:[L(G3e,{}),L(N6,{children:t||o?Ut(ta,{children:[L(OO,{}),L(OO,{})]}):l&&e&&Object.entries(l.pubKeyEndpoints).map(([c,d])=>L(Y3e,{pubKey:c,onCopy:u,url:l.url,date:e?.verificationDate?.toLocaleDateString()||"",endpoint:d,name:l.name},c))})]}),(!!r||!!a)&&`${r} ${a} (App notification)`]})}const Z3e="modulepreload",X3e=function(e){return"/verifier/"+e},BO={},Tm=function(t,r,i){if(!r||r.length===0)return t();const o=document.getElementsByTagName("link");return Promise.all(r.map(a=>{if(a=X3e(a),a in BO)return;BO[a]=!0;const s=a.endsWith(".css"),l=s?'[rel="stylesheet"]':"";if(!!i)for(let d=o.length-1;d>=0;d--){const p=o[d];if(p.href===a&&(!s||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${l}`))return;const c=document.createElement("link");if(c.rel=s?"stylesheet":Z3e,s||(c.as="script",c.crossOrigin=""),c.href=a,document.head.appendChild(c),s)return new Promise((d,p)=>{c.addEventListener("load",d),c.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>t())};var v1=(e=>(e.VALID="VALID",e.WASM="WebAssembly is not supported",e.COMPILER="Only FunC contracts can be verified",e.VERSION="FunC version is not supported",e))(v1||{});const J3e=["0.2.0","0.3.0","0.4.0","0.4.1"];function eSe(){const{data:e}=Pc(),{data:t}=vp(),[r,i]=X.exports.useState(null),[o,a]=X.exports.useState(!1),[s,l]=X.exports.useState(null),u=async()=>{wa(ha.IN_BROWSER_COMPILE_START),i(null),a(!0);const{FuncCompiler:p}=await Tm(()=>import("./index.a8990815.js").then(E=>E.i),[]),v=e?.files?.map(E=>({filename:E.name,content:E.content}))??[],x=e?.compilerSettings?.funcVersion;if(!x){i("FunC is not available for in-browser verification"),a(!1);return}let b;switch(x){case"0.2.0":{let{object:E}=await Tm(()=>import("./index.fbca1507.js").then(B=>B.i),[]);b=E;break}case"0.3.0":{let{object:E}=await Tm(()=>import("./index.f65cb428.js").then(B=>B.i),[]);b=E;break}case"0.4.0":{let{object:E}=await Tm(()=>import("./index.fb59a6c3.js").then(B=>B.i),[]);b=E;break}case"0.4.1":{let{object:E}=await Tm(()=>import("./index.bf0da248.js").then(B=>B.i),[]);b=E;break}}let _=await new p(b).compileFunc({sources:v,targets:(e?.compilerSettings).commandLine.split(" ").filter(E=>E.match(/\.(fc|func)$/))});if(_.status==="error"){i(_.message),a(!1),wa(ha.IN_BROWSER_COMPILE_ERROR);return}const k=Vn.Cell.fromBoc(Buffer.from(_.codeBoc,"base64"))[0];a(!1),t?.codeCellHash.base64===k.hash().toString("base64")&&l(k.hash().toString("base64")),wa(ha.IN_BROWSER_COMPILE_SUCCESS)},c=()=>xj()?e?.compiler!=="func"?"Only FunC contracts can be verified":d()?"VALID":"FunC version is not supported":"WebAssembly is not supported",d=()=>J3e.some(p=>p===e?.compilerSettings?.funcVersion);return{verifyContract:u,isVerificationEnabled:c,loading:o,error:r,hash:s}}function tSe(){const{verifyContract:e,isVerificationEnabled:t,error:r,loading:i,hash:o}=eSe(),a=la(),s=aa(a.breakpoints.down("md"));return Ut(kn,{p:2,children:[Ut(jo,{sx:{fontSize:14},children:["You are not required to rely on third-party validators. You can now verify this contract by yourself by having your browser download the sources and compile them locally in-browser using"," ",L(uc,{sx:{textDecoration:"none"},href:"https://github.com/ton-community/func-js",target:"_blank",children:"WASM"}),".",!nwe()&&L($n,{mt:1,sx:{overflow:"auto",maxHeight:300},children:Ut(Dd,{sx:{margin:0},children:["The web page you're looking at is"," ",L(uc,{sx:{textDecoration:"none"},href:"https://github.com/ton-community/contract-verifier",target:"_blank",children:"open source"}),", you can also fork or run it locally if you wish to have absolute control."]})})]}),t()!==v1.VALID?L($7,{arrow:!0,title:L(jo,{sx:{fontSize:13},children:t()}),placement:"top",children:L(kn,{sx:{width:144,margin:"auto"},children:L(Ha,{onClick:()=>e(),disabled:t()!==v1.VALID||i||!!o,fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",children:"Verify"})})}):Ut(Ha,{onClick:()=>e(),disabled:t()!==v1.VALID||i||!!o,fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",children:[i&&L(lg,{sx:{color:"#fff",height:"20px !important",width:"20px !important"}}),"Verify"]}),r&&Ut(ta,{children:[L(Cs,{noBottomMargin:!0,type:ps.ERROR,title:Ut(Dd,{children:[L("span",{style:{color:"#FC5656"},children:"Error: "}),"Compile error"]}),notificationBody:L(kn,{sx:{overflow:"auto",maxHeight:300},children:L("div",{children:L("code",{children:r})})})}),Ut(jo,{sx:{marginTop:1,fontSize:13},children:["You can ask for help in our"," ",L(uc,{sx:{textDecoration:"none",cursor:"pointer",color:"#0088CC"},href:"https://t.me/tonverifier",target:"_blank",children:"Telegram support group"})]})]}),!!o&&L(Cs,{noBottomMargin:!0,singleLine:!s,type:ps.SUCCESS,title:Ut($n,{sx:{height:42},children:[L($n,{mr:1,children:L("img",{src:R$,alt:"Like icon",width:31,height:31})}),Ut(O$,{children:[" ",L("b",{children:"Great!"})," Compile output hash matches this on-chain contract"]})]}),notificationBody:L(kn,{})})]})}function rSe(){const{data:e,isLoading:t}=Pc(),{isLoading:r}=zx();return Ut(kn,{sx:{width:"100%"},children:[e&&!r&&Ut(j3e,{pt:3,pb:1,children:[L(V3e,{children:"Verify manually"}),L(nSe,{})]}),(t||r)&&L(Xa,{width:"100%",height:250,sx:{transform:"none",borderRadius:"20px",background:"#e6e8eb"}})]})}Xi(H7)({borderBottom:"none","& .MuiTabs-indicator":{borderBottom:"4px solid #0088CC",borderRadius:20},"& .MuiTab-root.Mui-selected":{color:"#000",fontWeight:800}});function nSe(){return L(kn,{sx:{width:"100%"},children:L(tSe,{})})}function iSe({onClose:e}){const t=la(),r=aa(t.breakpoints.down("lg"));return L(D3e,{open:!0,maxWidth:r?"88%":1e3,hideCloseButton:!0,children:L(w6,{onClickAway:e,children:Ut(kn,{sx:{width:"100%"},children:[L(W3e,{pt:2,children:L(Bs,{sx:{padding:0},onClick:e,children:L("img",{src:b6,alt:"Close icon",width:15,height:15})})}),Ut($n,{mb:4,justifyContent:"center",children:[L("img",{src:L3e,alt:"Popup icon",width:41,height:41}),L(Fd,{pl:2,sx:{fontSize:18,fontWeight:800},children:"Verification Proof"})]}),L(Q3e,{}),L($n,{mt:3,children:L(rSe,{})})]})})})}const oSe=Xi($n)(({theme:e})=>t=>({flexWrap:t.makeFlexible?"wrap":"inherit",gap:t.makeFlexible?20:"inherit",justifyContent:t.makeFlexible?"center":"space-between",padding:24,[e.breakpoints.down("lg")]:{width:"70%",margin:"auto"}})),aSe=Xi(Fy)({boxSizing:"border-box",display:"flex",minWidth:200,maxWidth:260,height:108,background:"#F7F9FB",borderRadius:14,padding:"28px 13px"}),sSe=Xi(jo)({fontSize:14,color:"#000"}),lSe=[{icon:P3e,description:"This source code compiles to the same exact bytecode that is found on-chain."},{icon:R3e,description:"You can review verification proofs and perform your own client-side verification."},{icon:T3e,description:"Variable/function names may not reflect actual usage. compiler may remove unused code."},{icon:I3e,description:"Comments may not be honest and should generally be ignored."}],uSe=()=>{const[e]=yw(),[t,r]=Gn.useState(e.get("showProof")!==null),i=la(),o=aa(i.breakpoints.down("lg")),a=aa(i.breakpoints.down("md")),s=aa("(max-width: 450px)");return Ut(ug,{children:[L(p2,{mb:1,children:Ut($n,{sx:{justifyContent:"space-between",flexDirection:s?"column":"inherit",width:"100%"},children:[Ut($n,{mb:s?2:0,sx:{width:"100%"},children:[L(cg,{children:L("img",{src:O3e,alt:"Verification icon",width:41,height:41})}),L(Fd,{children:"How is this contract verified?"})]}),Ut("div",{children:[Ut(Ha,{fontSize:12,fontWeight:800,textColor:"#fff",background:"#1976d2",hoverBackground:"#156cc2",height:37,width:132,onClick:()=>{r(!0)},children:[L("img",{src:M3e,alt:"Show icon",width:19,height:19}),"Show Proof"]}),t&&L(iSe,{onClose:()=>r(!1)})]})]})}),L(oSe,{makeFlexible:o,isMobile:a,children:lSe.map(u=>Ut(aSe,{children:[L(Fy,{sx:{alignSelf:"flex-start"},mr:1.5,children:L("img",{alt:"Icon",src:u.icon,width:41,height:41})}),L(sSe,{children:u.description})]},u.description))})]})};function cSe(){const e=ej(m1),{isLoading:t,error:r,data:i}=bc(["latestVerifiedContracts"],async()=>(await(await fetch(`${e}/latestVerified`,{method:"GET"})).json()).slice(0,100));return{isLoading:t,error:r,data:i}}const dSe=sr(kn)(({theme:e})=>({background:"white",padding:"16px 20px",borderRadius:10,boxShadow:"rgb(114 138 150 / 8%) 0px 2px 16px",border:"0.5px solid rgba(114, 138, 150, 0.24)",cursor:"pointer",[e.breakpoints.down("sm")]:{width:280}})),fSe=sr(kn)(({theme:e})=>({maxWidth:1160,width:"calc(100% - 50px)",paddingTop:20,margin:"0 auto"})),pSe=sr(kn)({display:"flex",flexDirection:"row",flexWrap:"wrap",gap:24,margin:"0 auto",justifyContent:"left",overflow:"auto",marginTop:24,"-webkit-text-size-adjust":"100%"}),hSe=sr(kn)({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:16,color:"#728A96"}),gSe=sr(kn)({marginLeft:"auto",fontSize:14,background:"#F0F0F099",color:"#728A9699",padding:"2px 12px",borderRadius:4});function mSe(){const{data:e,isLoading:t}=cSe(),r=Ac(),i=X.exports.useRef(new Array(30).fill(null).map(o=>Math.random()*100));return Ut(fSe,{children:[L(jo,{variant:"h6",children:L("b",{children:"Latest verified contracts"})}),Ut(pSe,{children:[t&&i.current.map(o=>L(Xa,{sx:{borderRadius:2},variant:"rectangular",width:400+o,height:70})),e?.map(o=>Ut(dSe,{onClick:a=>{r(`/${o.address}`)},children:[L(hSe,{children:o.address}),Ut("div",{style:{display:"flex",alignItems:"center",marginTop:6.5},children:[L(jo,{sx:{fontSize:14,color:"#728A9699"},children:o.mainFile}),L(gSe,{children:o.compiler})]})]}))]})]})}const U$=Xi(kn)({maxWidth:1160,margin:"auto"}),D$=Xi(kn)(e=>({display:e.isMobile?"inherit":"flex",gap:20})),qv=Xi(kn)({boxSizing:"border-box",maxWidth:1160,width:"100%",marginTop:20,backgroundColor:"#fff",borderRadius:20,padding:20,color:"#000"});function UO(){const{isLoading:e,data:t,error:r}=Pc(),[i,o]=X.exports.useState(!1),a=la(),s=Cwe(),{contractAddress:l,isAddressEmpty:u}=$u(),{hasFiles:c}=zu(),d=X.exports.useRef(),p=aa(a.breakpoints.down("lg")),v=aa(a.breakpoints.down("md")),x=!r&&e&&l;AL(),Ewe(),lwe(),X.exports.useEffect(()=>{window.scrollTo({behavior:"auto",top:d.current?.offsetTop})},[window.location.pathname]);const{initialize:b}=cE(),{data:{funcVersions:y}}=uE();return X.exports.useEffect(()=>{(y?.length??0)>0&&b(y[0])},[y]),Ut(kn,{onDragEnter:()=>o(!0),onDrop:()=>o(!1),onClick:()=>o(!1),children:[L(u2,{sx:{color:"#fff",zIndex:4},open:i,onDragEnd:()=>o(!1)}),L(kn,{ref:d}),window.isTestnet&&L(BE,{}),L(gve,{}),l===null&&u&&L(mSe,{}),l===null&&!u&&L(kn,{m:4,children:L(Cs,{singleLine:!0,type:ps.ERROR,title:Ut($n,{sx:{height:42},children:[L("span",{style:{color:"#FC5656",marginRight:4},children:"Error: "}),"Invalid address"]}),notificationBody:L(kn,{})})}),Ut(U$,{px:p?"20px":0,children:[!!r&&L(kn,{mt:4,children:L(Cs,{type:ps.ERROR,title:Ut(Dd,{children:[L("span",{style:{color:"#FC5656"},children:"Error: "}),"Unable to fetch contract data"]}),notificationBody:L(kn,{sx:{overflow:"auto",maxHeight:300},children:L("pre",{children:L("code",{children:r.toString()})})})})}),x&&Ut(qv,{sx:{padding:"30px 24px 24px 24px"},mb:3,children:[Ut($n,{mb:3,children:[L(Xa,{variant:"circular",width:41,height:41,sx:{marginRight:2}}),L(Xa,{variant:"text",sx:{fontSize:"20px",width:200}})]}),L(Xa,{variant:"rectangular",width:"100%",height:250})]}),Ut(D$,{isMobile:v,children:[L(Owe,{}),t?.hasOnchainProof&&L(oxe,{})]}),x&&Ut(qv,{sx:{padding:"30px 24px 24px 24px"},mb:3,children:[Ut($n,{mb:3,children:[L(Xa,{variant:"circular",width:41,height:41,sx:{marginRight:2}}),L(Xa,{variant:"text",sx:{fontSize:"20px",width:200}})]}),L(Xa,{variant:"rectangular",width:"100%",height:250})]}),!e&&t?.hasOnchainProof&&L(uSe,{}),t&&(!t.hasOnchainProof||s)&&Ut(ta,{children:[L(C3e,{}),c()&&L(A3e,{})]}),t&&!c()?L(qv,{sx:{padding:0},mb:5,children:L(Swe,{})}):L(ta,{children:x&&Ut(qv,{sx:{padding:"30px 24px 24px 24px"},mb:5,children:[Ut($n,{mb:3,children:[L(Xa,{variant:"circular",width:41,height:41,sx:{marginRight:2}}),L(Xa,{variant:"text",sx:{fontSize:"20px",width:250}})]}),L(Xa,{variant:"rectangular",width:"100%",height:500})]})}),t&&L(Fb,{})]}),!t&&L(Fy,{sx:{bottom:0,width:"100%"},children:L(Fb,{})})]})}function L$({space:e}){return L("div",{style:{height:e}})}function ySe(){const[e,t]=X.exports.useState({spec:[],builder:Vn.beginCell()});return Ut("div",{children:[L("h4",{children:"Build the cell"}),L(wh,{required:!0,id:"outlined-required",label:"UINT",fullWidth:!0,onKeyUp:r=>{if(r.code==="Enter"){const[i,o]=r.target.value.split(",");t(a=>({spec:[...a.spec,{type:"uint"+o,value:i}],builder:a.builder.storeUint(i,o)})),r.target.value=""}}}),L(wh,{required:!0,id:"outlined-required",label:"Address",fullWidth:!0,onKeyUp:r=>{if(r.code==="Enter"){const i=r.target.value;t(o=>({spec:[...o.spec,{type:"address",value:i}],builder:o.builder.storeAddress(Vn.Address.parse(i))})),r.target.value=""}}}),L("div",{children:JSON.stringify(e.spec)}),L(L$,{space:30}),L(c2,{variant:"outlined",children:"Send the message"})]})}function vSe(){return Ut("div",{style:{margin:"0 auto",maxWidth:1100,padding:40},children:[L(B$,{}),L(L$,{space:35}),L(wh,{required:!0,id:"outlined-required",label:"Contract address",fullWidth:!0}),L(wh,{required:!0,id:"outlined-required",label:"Value",fullWidth:!0,type:"number"}),Ut("div",{children:[L("h3",{children:"OPs"}),L(wh,{required:!0,id:"outlined-required",label:"Value",fullWidth:!0,type:"number"}),L(ySe,{})]})]})}const bSe=v6({typography:{fontFamily:"Mulish"},components:{MuiSwitch:{styleOverrides:{switchBase:{color:"#ccc"},colorPrimary:{"&.Mui-checked":{color:"#fff"}},track:{opacity:1,backgroundColor:"#D1D1D6",".Mui-checked.Mui-checked + &":{opacity:1,backgroundColor:"#0088CC"}},thumb:{background:"#fff",boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.16)"}}}}});function UE({label:e,data:t}){return Ut("div",{className:"InfoPiece",children:[L("div",{className:"InfoPiece-Label",children:e}),L("div",{className:"InfoPiece-Data",children:t})]})}var zy=e=>e.type==="checkbox",ch=e=>e instanceof Date,ds=e=>e==null;const N$=e=>typeof e=="object";var ka=e=>!ds(e)&&!Array.isArray(e)&&N$(e)&&!ch(e),j$=e=>ka(e)&&e.target?zy(e.target)?e.target.checked:e.target.value:e,wSe=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,$$=(e,t)=>e.has(wSe(t)),xSe=e=>{const t=e.constructor&&e.constructor.prototype;return ka(t)&&t.hasOwnProperty("isPrototypeOf")},DE=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ja(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(DE&&(e instanceof Blob||e instanceof FileList))&&(r||ka(e)))if(t=r?[]:{},!r&&!xSe(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=Ja(e[i]));else return e;return t}var Og=e=>Array.isArray(e)?e.filter(Boolean):[],Ro=e=>e===void 0,vn=(e,t,r)=>{if(!t||!ka(e))return r;const i=Og(t.split(/[,[\].]+?/)).reduce((o,a)=>ds(o)?o:o[a],e);return Ro(i)||i===e?Ro(e[t])?r:e[t]:i},vu=e=>typeof e=="boolean";const zb={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},yl={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Xu={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},_Se=Gn.createContext(null),Qx=()=>Gn.useContext(_Se);var F$=(e,t,r,i=!0)=>{const o={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(o,a,{get:()=>{const s=a;return t._proxyFormState[s]!==yl.all&&(t._proxyFormState[s]=!i||yl.all),r&&(r[s]=!0),e[s]}});return o},Vs=e=>ka(e)&&!Object.keys(e).length,z$=(e,t,r,i)=>{r(e);const{name:o,...a}=e;return Vs(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(s=>t[s]===(!i||yl.all))},Gs=e=>Array.isArray(e)?e:[e],H$=(e,t,r)=>!e||!t||e===t||Gs(e).some(i=>i&&(r?i===t:i.startsWith(t)||t.startsWith(i)));function Zx(e){const t=Gn.useRef(e);t.current=e,Gn.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function SSe(e){const t=Qx(),{control:r=t.control,disabled:i,name:o,exact:a}=e||{},[s,l]=Gn.useState(r._formState),u=Gn.useRef(!0),c=Gn.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=Gn.useRef(o);return d.current=o,Zx({disabled:i,next:p=>u.current&&H$(d.current,p.name,a)&&z$(p,c.current,r._updateFormState)&&l({...r._formState,...p}),subject:r._subjects.state}),Gn.useEffect(()=>(u.current=!0,c.current.isValid&&r._updateValid(!0),()=>{u.current=!1}),[r]),F$(s,r,c.current,!1)}var bu=e=>typeof e=="string",W$=(e,t,r,i,o)=>bu(e)?(i&&t.watch.add(e),vn(r,e,o)):Array.isArray(e)?e.map(a=>(i&&t.watch.add(a),vn(r,a))):(i&&(t.watchAll=!0),r);function CSe(e){const t=Qx(),{control:r=t.control,name:i,defaultValue:o,disabled:a,exact:s}=e||{},l=Gn.useRef(i);l.current=i,Zx({disabled:a,subject:r._subjects.values,next:d=>{H$(l.current,d.name,s)&&c(Ja(W$(l.current,r._names,d.values||r._formValues,!1,o)))}});const[u,c]=Gn.useState(r._getWatch(i,o));return Gn.useEffect(()=>r._removeUnmounted()),u}var LE=e=>/^\w*$/.test(e),V$=e=>Og(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Ao(e,t,r){let i=-1;const o=LE(t)?[t]:V$(t),a=o.length,s=a-1;for(;++i{const d=o._options.shouldUnregister||a,p=(v,x)=>{const b=vn(o._fields,v);b&&(b._f.mount=x)};if(p(r,!0),d){const v=Ja(vn(o._options.defaultValues,r));Ao(o._defaultValues,r,v),Ro(vn(o._formValues,r))&&Ao(o._formValues,r,v)}return()=>{(s?d&&!o._state.action:d)?o.unregister(r):p(r,!1)}},[r,o,s,a]),Gn.useEffect(()=>{vn(o._fields,r)&&o._updateDisabledField({disabled:i,fields:o._fields,name:r,value:vn(o._fields,r)._f.value})},[i,r,o]),{field:{name:r,value:l,...vu(i)||vu(u.disabled)?{disabled:u.disabled||i}:{},onChange:Gn.useCallback(d=>c.current.onChange({target:{value:j$(d),name:r},type:zb.CHANGE}),[r]),onBlur:Gn.useCallback(()=>c.current.onBlur({target:{value:vn(o._formValues,r),name:r},type:zb.BLUR}),[r,o]),ref:d=>{const p=vn(o._fields,r);p&&d&&(p._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:v=>d.setCustomValidity(v),reportValidity:()=>d.reportValidity()})}},formState:u,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!vn(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!vn(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!vn(u.touchedFields,r)},error:{enumerable:!0,get:()=>vn(u.errors,r)}})}}const ESe=e=>e.render(kSe(e));var ASe=(e,t,r,i,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[i]:o||!0}}:{},zc=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},s3=(e,t,r={})=>r.shouldFocus||Ro(r.shouldFocus)?r.focusName||`${e}.${Ro(r.focusIndex)?t:r.focusIndex}.`:"",W4=e=>({isOnSubmit:!e||e===yl.onSubmit,isOnBlur:e===yl.onBlur,isOnChange:e===yl.onChange,isOnAll:e===yl.all,isOnTouch:e===yl.onTouched}),V4=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const d0=(e,t,r,i)=>{for(const o of r||Object.keys(e)){const a=vn(e,o);if(a){const{_f:s,...l}=a;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],o)&&!i)break;if(s.ref&&t(s.ref,s.name)&&!i)break}else ka(l)&&d0(l,t)}}};var q$=(e,t,r)=>{const i=Og(vn(e,r));return Ao(i,"root",t[r]),Ao(e,r,i),e},NE=e=>e.type==="file",od=e=>typeof e=="function",Hb=e=>{if(!DE)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},b1=e=>bu(e),jE=e=>e.type==="radio",Wb=e=>e instanceof RegExp;const DO={value:!1,isValid:!1},LO={value:!0,isValid:!0};var K$=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ro(e[0].attributes.value)?Ro(e[0].value)||e[0].value===""?LO:{value:e[0].value,isValid:!0}:LO:DO}return DO};const NO={isValid:!1,value:null};var G$=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,NO):NO;function jO(e,t,r="validate"){if(b1(e)||Array.isArray(e)&&e.every(b1)||vu(e)&&!e)return{type:r,message:b1(e)?e:"",ref:t}}var zp=e=>ka(e)&&!Wb(e)?e:{value:e,message:""},q4=async(e,t,r,i,o)=>{const{ref:a,refs:s,required:l,maxLength:u,minLength:c,min:d,max:p,pattern:v,validate:x,name:b,valueAsNumber:y,mount:_,disabled:k}=e._f,E=vn(t,b);if(!_||k)return{};const B=s?s[0]:a,U=V=>{i&&B.reportValidity&&(B.setCustomValidity(vu(V)?"":V||""),B.reportValidity())},D={},j=jE(a),F=zy(a),H=j||F,W=(y||NE(a))&&Ro(a.value)&&Ro(E)||Hb(a)&&a.value===""||E===""||Array.isArray(E)&&!E.length,G=ASe.bind(null,b,r,D),ae=(V,oe,P,ee=Xu.maxLength,le=Xu.minLength)=>{const pe=V?oe:P;D[b]={type:V?ee:le,message:pe,ref:a,...G(V?ee:le,pe)}};if(o?!Array.isArray(E)||!E.length:l&&(!H&&(W||ds(E))||vu(E)&&!E||F&&!K$(s).isValid||j&&!G$(s).isValid)){const{value:V,message:oe}=b1(l)?{value:!!l,message:l}:zp(l);if(V&&(D[b]={type:Xu.required,message:oe,ref:B,...G(Xu.required,oe)},!r))return U(oe),D}if(!W&&(!ds(d)||!ds(p))){let V,oe;const P=zp(p),ee=zp(d);if(!ds(E)&&!isNaN(E)){const le=a.valueAsNumber||E&&+E;ds(P.value)||(V=le>P.value),ds(ee.value)||(oe=lenew Date(new Date().toDateString()+" "+ft),_e=a.type=="time",J=a.type=="week";bu(P.value)&&E&&(V=_e?pe(E)>pe(P.value):J?E>P.value:le>new Date(P.value)),bu(ee.value)&&E&&(oe=_e?pe(E)+V.value,ee=!ds(oe.value)&&E.length<+oe.value;if((P||ee)&&(ae(P,V.message,oe.message),!r))return U(D[b].message),D}if(v&&!W&&bu(E)){const{value:V,message:oe}=zp(v);if(Wb(V)&&!E.match(V)&&(D[b]={type:Xu.pattern,message:oe,ref:a,...G(Xu.pattern,oe)},!r))return U(oe),D}if(x){if(od(x)){const V=await x(E,t),oe=jO(V,B);if(oe&&(D[b]={...oe,...G(Xu.validate,oe.message)},!r))return U(oe.message),D}else if(ka(x)){let V={};for(const oe in x){if(!Vs(V)&&!r)break;const P=jO(await x[oe](E,t),B,oe);P&&(V={...P,...G(oe,P.message)},U(P.message),r&&(D[b]=V))}if(!Vs(V)&&(D[b]={ref:B,...V},!r))return D}}return U(!0),D};function l3(e,t){return[...e,...Gs(t)]}var u3=e=>Array.isArray(e)?e.map(()=>{}):void 0;function c3(e,t,r){return[...e.slice(0,t),...Gs(r),...e.slice(t)]}var d3=(e,t,r)=>Array.isArray(e)?(Ro(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[];function f3(e,t){return[...Gs(t),...Gs(e)]}function TSe(e,t){let r=0;const i=[...e];for(const o of t)i.splice(o-r,1),r++;return Og(i).length?i:[]}var p3=(e,t)=>Ro(t)?[]:TSe(e,Gs(t).sort((r,i)=>r-i)),h3=(e,t,r)=>{e[t]=[e[r],e[r]=e[t]][0]};function ISe(e,t){const r=t.slice(0,-1).length;let i=0;for(;i(e[t]=r,e);function PSe(e){const t=Qx(),{control:r=t.control,name:i,keyName:o="id",shouldUnregister:a}=e,[s,l]=Gn.useState(r._getFieldArray(i)),u=Gn.useRef(r._getFieldArray(i).map(zc)),c=Gn.useRef(s),d=Gn.useRef(i),p=Gn.useRef(!1);d.current=i,c.current=s,r._names.array.add(i),e.rules&&r.register(i,e.rules),Zx({next:({values:D,name:j})=>{if(j===d.current||!j){const F=vn(D,d.current);Array.isArray(F)&&(l(F),u.current=F.map(zc))}},subject:r._subjects.array});const v=Gn.useCallback(D=>{p.current=!0,r._updateFieldArray(i,D)},[r,i]),x=(D,j)=>{const F=Gs(Ja(D)),H=l3(r._getFieldArray(i),F);r._names.focus=s3(i,H.length-1,j),u.current=l3(u.current,F.map(zc)),v(H),l(H),r._updateFieldArray(i,H,l3,{argA:u3(D)})},b=(D,j)=>{const F=Gs(Ja(D)),H=f3(r._getFieldArray(i),F);r._names.focus=s3(i,0,j),u.current=f3(u.current,F.map(zc)),v(H),l(H),r._updateFieldArray(i,H,f3,{argA:u3(D)})},y=D=>{const j=p3(r._getFieldArray(i),D);u.current=p3(u.current,D),v(j),l(j),r._updateFieldArray(i,j,p3,{argA:D})},_=(D,j,F)=>{const H=Gs(Ja(j)),W=c3(r._getFieldArray(i),D,H);r._names.focus=s3(i,D,F),u.current=c3(u.current,D,H.map(zc)),v(W),l(W),r._updateFieldArray(i,W,c3,{argA:D,argB:u3(j)})},k=(D,j)=>{const F=r._getFieldArray(i);h3(F,D,j),h3(u.current,D,j),v(F),l(F),r._updateFieldArray(i,F,h3,{argA:D,argB:j},!1)},E=(D,j)=>{const F=r._getFieldArray(i);d3(F,D,j),d3(u.current,D,j),v(F),l(F),r._updateFieldArray(i,F,d3,{argA:D,argB:j},!1)},B=(D,j)=>{const F=Ja(j),H=$O(r._getFieldArray(i),D,F);u.current=[...H].map((W,G)=>!W||G===D?zc():u.current[G]),v(H),l([...H]),r._updateFieldArray(i,H,$O,{argA:D,argB:F},!0,!1)},U=D=>{const j=Gs(Ja(D));u.current=j.map(zc),v([...j]),l([...j]),r._updateFieldArray(i,[...j],F=>F,{},!0,!1)};return Gn.useEffect(()=>{if(r._state.action=!1,V4(i,r._names)&&r._subjects.state.next({...r._formState}),p.current&&(!W4(r._options.mode).isOnSubmit||r._formState.isSubmitted))if(r._options.resolver)r._executeSchema([i]).then(D=>{const j=vn(D.errors,i),F=vn(r._formState.errors,i);(F?!j&&F.type||j&&(F.type!==j.type||F.message!==j.message):j&&j.type)&&(j?Ao(r._formState.errors,i,j):Ra(r._formState.errors,i),r._subjects.state.next({errors:r._formState.errors}))});else{const D=vn(r._fields,i);D&&D._f&&q4(D,r._formValues,r._options.criteriaMode===yl.all,r._options.shouldUseNativeValidation,!0).then(j=>!Vs(j)&&r._subjects.state.next({errors:q$(r._formState.errors,j,i)}))}r._subjects.values.next({name:i,values:{...r._formValues}}),r._names.focus&&d0(r._fields,(D,j)=>{if(r._names.focus&&j.startsWith(r._names.focus)&&D.focus)return D.focus(),1}),r._names.focus="",r._updateValid(),p.current=!1},[s,i,r]),Gn.useEffect(()=>(!vn(r._formValues,i)&&r._updateFieldArray(i),()=>{(r._options.shouldUnregister||a)&&r.unregister(i)}),[i,r,o,a]),{swap:Gn.useCallback(k,[v,i,r]),move:Gn.useCallback(E,[v,i,r]),prepend:Gn.useCallback(b,[v,i,r]),append:Gn.useCallback(x,[v,i,r]),remove:Gn.useCallback(y,[v,i,r]),insert:Gn.useCallback(_,[v,i,r]),update:Gn.useCallback(B,[v,i,r]),replace:Gn.useCallback(U,[v,i,r]),fields:Gn.useMemo(()=>s.map((D,j)=>({...D,[o]:u.current[j]||zc()})),[s,o])}}function g3(){let e=[];return{get observers(){return e},next:o=>{for(const a of e)a.next&&a.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(a=>a!==o)}}),unsubscribe:()=>{e=[]}}}var Vb=e=>ds(e)||!N$(e);function wf(e,t){if(Vb(e)||Vb(t))return e===t;if(ch(e)&&ch(t))return e.getTime()===t.getTime();const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(const o of r){const a=e[o];if(!i.includes(o))return!1;if(o!=="ref"){const s=t[o];if(ch(a)&&ch(s)||ka(a)&&ka(s)||Array.isArray(a)&&Array.isArray(s)?!wf(a,s):a!==s)return!1}}return!0}var Y$=e=>e.type==="select-multiple",MSe=e=>jE(e)||zy(e),m3=e=>Hb(e)&&e.isConnected,Q$=e=>{for(const t in e)if(od(e[t]))return!0;return!1};function qb(e,t={}){const r=Array.isArray(e);if(ka(e)||r)for(const i in e)Array.isArray(e[i])||ka(e[i])&&!Q$(e[i])?(t[i]=Array.isArray(e[i])?[]:{},qb(e[i],t[i])):ds(e[i])||(t[i]=!0);return t}function Z$(e,t,r){const i=Array.isArray(e);if(ka(e)||i)for(const o in e)Array.isArray(e[o])||ka(e[o])&&!Q$(e[o])?Ro(t)||Vb(r[o])?r[o]=Array.isArray(e[o])?qb(e[o],[]):{...qb(e[o])}:Z$(e[o],ds(t)?{}:t[o],r[o]):r[o]=!wf(e[o],t[o]);return r}var y3=(e,t)=>Z$(e,t,qb(t)),X$=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:i})=>Ro(e)?e:t?e===""?NaN:e&&+e:r&&bu(e)?new Date(e):i?i(e):e;function v3(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return NE(t)?t.files:jE(t)?G$(e.refs).value:Y$(t)?[...t.selectedOptions].map(({value:r})=>r):zy(t)?K$(e.refs).value:X$(Ro(t.value)?e.ref.value:t.value,e)}var OSe=(e,t,r,i)=>{const o={};for(const a of e){const s=vn(t,a);s&&Ao(o,a,s._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:i}},Im=e=>Ro(e)?e:Wb(e)?e.source:ka(e)?Wb(e.value)?e.value.source:e.value:e,BSe=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function FO(e,t,r){const i=vn(e,r);if(i||LE(r))return{error:i,name:r};const o=r.split(".");for(;o.length;){const a=o.join("."),s=vn(t,a),l=vn(e,a);if(s&&!Array.isArray(s)&&r!==a)return{name:r};if(l&&l.type)return{name:a,error:l};o.pop()}return{name:r}}var USe=(e,t,r,i,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?i.isOnBlur:o.isOnBlur)?!e:(r?i.isOnChange:o.isOnChange)?e:!0,DSe=(e,t)=>!Og(vn(e,t)).length&&Ra(e,t);const LSe={mode:yl.onSubmit,reValidateMode:yl.onChange,shouldFocusError:!0};function NSe(e={},t){let r={...LSe,...e},i={submitCount:0,isDirty:!1,isLoading:od(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{},disabled:!1},o={},a=ka(r.defaultValues)||ka(r.values)?Ja(r.defaultValues||r.values)||{}:{},s=r.shouldUnregister?{}:Ja(a),l={action:!1,mount:!1,watch:!1},u={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0;const p={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={values:g3(),array:g3(),state:g3()},x=e.resetOptions&&e.resetOptions.keepDirtyValues,b=W4(r.mode),y=W4(r.reValidateMode),_=r.criteriaMode===yl.all,k=fe=>Be=>{clearTimeout(d),d=setTimeout(fe,Be)},E=async fe=>{if(p.isValid||fe){const Be=r.resolver?Vs((await W()).errors):await ae(o,!0);Be!==i.isValid&&v.state.next({isValid:Be})}},B=fe=>p.isValidating&&v.state.next({isValidating:fe}),U=(fe,Be=[],rt,lt,jt=!0,ce=!0)=>{if(lt&&rt){if(l.action=!0,ce&&Array.isArray(vn(o,fe))){const ie=rt(vn(o,fe),lt.argA,lt.argB);jt&&Ao(o,fe,ie)}if(ce&&Array.isArray(vn(i.errors,fe))){const ie=rt(vn(i.errors,fe),lt.argA,lt.argB);jt&&Ao(i.errors,fe,ie),DSe(i.errors,fe)}if(p.touchedFields&&ce&&Array.isArray(vn(i.touchedFields,fe))){const ie=rt(vn(i.touchedFields,fe),lt.argA,lt.argB);jt&&Ao(i.touchedFields,fe,ie)}p.dirtyFields&&(i.dirtyFields=y3(a,s)),v.state.next({name:fe,isDirty:oe(fe,Be),dirtyFields:i.dirtyFields,errors:i.errors,isValid:i.isValid})}else Ao(s,fe,Be)},D=(fe,Be)=>{Ao(i.errors,fe,Be),v.state.next({errors:i.errors})},j=(fe,Be,rt,lt)=>{const jt=vn(o,fe);if(jt){const ce=vn(s,fe,Ro(rt)?vn(a,fe):rt);Ro(ce)||lt&<.defaultChecked||Be?Ao(s,fe,Be?ce:v3(jt._f)):le(fe,ce),l.mount&&E()}},F=(fe,Be,rt,lt,jt)=>{let ce=!1,ie=!1;const de={name:fe};if(!rt||lt){p.isDirty&&(ie=i.isDirty,i.isDirty=de.isDirty=oe(),ce=ie!==de.isDirty);const $=wf(vn(a,fe),Be);ie=vn(i.dirtyFields,fe),$?Ra(i.dirtyFields,fe):Ao(i.dirtyFields,fe,!0),de.dirtyFields=i.dirtyFields,ce=ce||p.dirtyFields&&ie!==!$}if(rt){const $=vn(i.touchedFields,fe);$||(Ao(i.touchedFields,fe,rt),de.touchedFields=i.touchedFields,ce=ce||p.touchedFields&&$!==rt)}return ce&&jt&&v.state.next(de),ce?de:{}},H=(fe,Be,rt,lt)=>{const jt=vn(i.errors,fe),ce=p.isValid&&vu(Be)&&i.isValid!==Be;if(e.delayError&&rt?(c=k(()=>D(fe,rt)),c(e.delayError)):(clearTimeout(d),c=null,rt?Ao(i.errors,fe,rt):Ra(i.errors,fe)),(rt?!wf(jt,rt):jt)||!Vs(lt)||ce){const ie={...lt,...ce&&vu(Be)?{isValid:Be}:{},errors:i.errors,name:fe};i={...i,...ie},v.state.next(ie)}B(!1)},W=async fe=>r.resolver(s,r.context,OSe(fe||u.mount,o,r.criteriaMode,r.shouldUseNativeValidation)),G=async fe=>{const{errors:Be}=await W(fe);if(fe)for(const rt of fe){const lt=vn(Be,rt);lt?Ao(i.errors,rt,lt):Ra(i.errors,rt)}else i.errors=Be;return Be},ae=async(fe,Be,rt={valid:!0})=>{for(const lt in fe){const jt=fe[lt];if(jt){const{_f:ce,...ie}=jt;if(ce){const de=u.array.has(ce.name),$=await q4(jt,s,_,r.shouldUseNativeValidation&&!Be,de);if($[ce.name]&&(rt.valid=!1,Be))break;!Be&&(vn($,ce.name)?de?q$(i.errors,$,ce.name):Ao(i.errors,ce.name,$[ce.name]):Ra(i.errors,ce.name))}ie&&await ae(ie,Be,rt)}}return rt.valid},V=()=>{for(const fe of u.unMount){const Be=vn(o,fe);Be&&(Be._f.refs?Be._f.refs.every(rt=>!m3(rt)):!m3(Be._f.ref))&&vr(fe)}u.unMount=new Set},oe=(fe,Be)=>(fe&&Be&&Ao(s,fe,Be),!wf(He(),a)),P=(fe,Be,rt)=>W$(fe,u,{...l.mount?s:Ro(Be)?a:bu(fe)?{[fe]:Be}:Be},rt,Be),ee=fe=>Og(vn(l.mount?s:a,fe,e.shouldUnregister?vn(a,fe,[]):[])),le=(fe,Be,rt={})=>{const lt=vn(o,fe);let jt=Be;if(lt){const ce=lt._f;ce&&(!ce.disabled&&Ao(s,fe,X$(Be,ce)),jt=Hb(ce.ref)&&ds(Be)?"":Be,Y$(ce.ref)?[...ce.ref.options].forEach(ie=>ie.selected=jt.includes(ie.value)):ce.refs?zy(ce.ref)?ce.refs.length>1?ce.refs.forEach(ie=>(!ie.defaultChecked||!ie.disabled)&&(ie.checked=Array.isArray(jt)?!!jt.find(de=>de===ie.value):jt===ie.value)):ce.refs[0]&&(ce.refs[0].checked=!!jt):ce.refs.forEach(ie=>ie.checked=ie.value===jt):NE(ce.ref)?ce.ref.value="":(ce.ref.value=jt,ce.ref.type||v.values.next({name:fe,values:{...s}})))}(rt.shouldDirty||rt.shouldTouch)&&F(fe,jt,rt.shouldTouch,rt.shouldDirty,!0),rt.shouldValidate&&Le(fe)},pe=(fe,Be,rt)=>{for(const lt in Be){const jt=Be[lt],ce=`${fe}.${lt}`,ie=vn(o,ce);(u.array.has(fe)||!Vb(jt)||ie&&!ie._f)&&!ch(jt)?pe(ce,jt,rt):le(ce,jt,rt)}},_e=(fe,Be,rt={})=>{const lt=vn(o,fe),jt=u.array.has(fe),ce=Ja(Be);Ao(s,fe,ce),jt?(v.array.next({name:fe,values:{...s}}),(p.isDirty||p.dirtyFields)&&rt.shouldDirty&&v.state.next({name:fe,dirtyFields:y3(a,s),isDirty:oe(fe,ce)})):lt&&!lt._f&&!ds(ce)?pe(fe,ce,rt):le(fe,ce,rt),V4(fe,u)&&v.state.next({...i}),v.values.next({name:fe,values:{...s}}),!l.mount&&t()},J=async fe=>{const Be=fe.target;let rt=Be.name,lt=!0;const jt=vn(o,rt),ce=()=>Be.type?v3(jt._f):j$(fe),ie=de=>{lt=Number.isNaN(de)||de===vn(s,rt,de)};if(jt){let de,$;const C=ce(),T=fe.type===zb.BLUR||fe.type===zb.FOCUS_OUT,Q=!BSe(jt._f)&&!r.resolver&&!vn(i.errors,rt)&&!jt._f.deps||USe(T,vn(i.touchedFields,rt),i.isSubmitted,y,b),ve=V4(rt,u,T);Ao(s,rt,C),T?(jt._f.onBlur&&jt._f.onBlur(fe),c&&c(0)):jt._f.onChange&&jt._f.onChange(fe);const je=F(rt,C,T,!1),ct=!Vs(je)||ve;if(!T&&v.values.next({name:rt,type:fe.type,values:{...s}}),Q)return p.isValid&&E(),ct&&v.state.next({name:rt,...ve?{}:je});if(!T&&ve&&v.state.next({...i}),B(!0),r.resolver){const{errors:ur}=await W([rt]);if(ie(C),lt){const Dr=FO(i.errors,o,rt),hr=FO(ur,o,Dr.name||rt);de=hr.error,rt=hr.name,$=Vs(ur)}}else de=(await q4(jt,s,_,r.shouldUseNativeValidation))[rt],ie(C),lt&&(de?$=!1:p.isValid&&($=await ae(o,!0)));lt&&(jt._f.deps&&Le(jt._f.deps),H(rt,$,de,je))}},ft=(fe,Be)=>{if(vn(i.errors,Be)&&fe.focus)return fe.focus(),1},Le=async(fe,Be={})=>{let rt,lt;const jt=Gs(fe);if(B(!0),r.resolver){const ce=await G(Ro(fe)?fe:jt);rt=Vs(ce),lt=fe?!jt.some(ie=>vn(ce,ie)):rt}else fe?(lt=(await Promise.all(jt.map(async ce=>{const ie=vn(o,ce);return await ae(ie&&ie._f?{[ce]:ie}:ie)}))).every(Boolean),!(!lt&&!i.isValid)&&E()):lt=rt=await ae(o);return v.state.next({...!bu(fe)||p.isValid&&rt!==i.isValid?{}:{name:fe},...r.resolver||!fe?{isValid:rt}:{},errors:i.errors,isValidating:!1}),Be.shouldFocus&&!lt&&d0(o,ft,fe?jt:u.mount),lt},He=fe=>{const Be={...a,...l.mount?s:{}};return Ro(fe)?Be:bu(fe)?vn(Be,fe):fe.map(rt=>vn(Be,rt))},nr=(fe,Be)=>({invalid:!!vn((Be||i).errors,fe),isDirty:!!vn((Be||i).dirtyFields,fe),isTouched:!!vn((Be||i).touchedFields,fe),error:vn((Be||i).errors,fe)}),Bt=fe=>{fe&&Gs(fe).forEach(Be=>Ra(i.errors,Be)),v.state.next({errors:fe?i.errors:{}})},Rt=(fe,Be,rt)=>{const lt=(vn(o,fe,{_f:{}})._f||{}).ref;Ao(i.errors,fe,{...Be,ref:lt}),v.state.next({name:fe,errors:i.errors,isValid:!1}),rt&&rt.shouldFocus&<&<.focus&<.focus()},Jt=(fe,Be)=>od(fe)?v.values.subscribe({next:rt=>fe(P(void 0,Be),rt)}):P(fe,Be,!0),vr=(fe,Be={})=>{for(const rt of fe?Gs(fe):u.mount)u.mount.delete(rt),u.array.delete(rt),Be.keepValue||(Ra(o,rt),Ra(s,rt)),!Be.keepError&&Ra(i.errors,rt),!Be.keepDirty&&Ra(i.dirtyFields,rt),!Be.keepTouched&&Ra(i.touchedFields,rt),!r.shouldUnregister&&!Be.keepDefaultValue&&Ra(a,rt);v.values.next({values:{...s}}),v.state.next({...i,...Be.keepDirty?{isDirty:oe()}:{}}),!Be.keepIsValid&&E()},At=({disabled:fe,name:Be,field:rt,fields:lt,value:jt})=>{if(vu(fe)){const ce=fe?void 0:Ro(jt)?v3(rt?rt._f:vn(lt,Be)._f):jt;Ao(s,Be,ce),F(Be,ce,!1,!1,!0)}},kt=(fe,Be={})=>{let rt=vn(o,fe);const lt=vu(Be.disabled);return Ao(o,fe,{...rt||{},_f:{...rt&&rt._f?rt._f:{ref:{name:fe}},name:fe,mount:!0,...Be}}),u.mount.add(fe),rt?At({field:rt,disabled:Be.disabled,name:fe}):j(fe,!0,Be.value),{...lt?{disabled:Be.disabled}:{},...r.progressive?{required:!!Be.required,min:Im(Be.min),max:Im(Be.max),minLength:Im(Be.minLength),maxLength:Im(Be.maxLength),pattern:Im(Be.pattern)}:{},name:fe,onChange:J,onBlur:J,ref:jt=>{if(jt){kt(fe,Be),rt=vn(o,fe);const ce=Ro(jt.value)&&jt.querySelectorAll&&jt.querySelectorAll("input,select,textarea")[0]||jt,ie=MSe(ce),de=rt._f.refs||[];if(ie?de.find($=>$===ce):ce===rt._f.ref)return;Ao(o,fe,{_f:{...rt._f,...ie?{refs:[...de.filter(m3),ce,...Array.isArray(vn(a,fe))?[{}]:[]],ref:{type:ce.type,name:fe}}:{ref:ce}}}),j(fe,!1,void 0,ce)}else rt=vn(o,fe,{}),rt._f&&(rt._f.mount=!1),(r.shouldUnregister||Be.shouldUnregister)&&!($$(u.array,fe)&&l.action)&&u.unMount.add(fe)}}},Ct=()=>r.shouldFocusError&&d0(o,ft,u.mount),Lt=fe=>{vu(fe)&&(v.state.next({disabled:fe}),d0(o,Be=>{Be.disabled=fe},0,!1))},Kt=(fe,Be)=>async rt=>{rt&&(rt.preventDefault&&rt.preventDefault(),rt.persist&&rt.persist());let lt=Ja(s);if(v.state.next({isSubmitting:!0}),r.resolver){const{errors:jt,values:ce}=await W();i.errors=jt,lt=ce}else await ae(o);Ra(i.errors,"root"),Vs(i.errors)?(v.state.next({errors:{}}),await fe(lt,rt)):(Be&&await Be({...i.errors},rt),Ct(),setTimeout(Ct)),v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Vs(i.errors),submitCount:i.submitCount+1,errors:i.errors})},yr=(fe,Be={})=>{vn(o,fe)&&(Ro(Be.defaultValue)?_e(fe,vn(a,fe)):(_e(fe,Be.defaultValue),Ao(a,fe,Be.defaultValue)),Be.keepTouched||Ra(i.touchedFields,fe),Be.keepDirty||(Ra(i.dirtyFields,fe),i.isDirty=Be.defaultValue?oe(fe,vn(a,fe)):oe()),Be.keepError||(Ra(i.errors,fe),p.isValid&&E()),v.state.next({...i}))},ne=(fe,Be={})=>{const rt=fe?Ja(fe):a,lt=Ja(rt),jt=fe&&!Vs(fe)?lt:a;if(Be.keepDefaultValues||(a=rt),!Be.keepValues){if(Be.keepDirtyValues||x)for(const ce of u.mount)vn(i.dirtyFields,ce)?Ao(jt,ce,vn(s,ce)):_e(ce,vn(jt,ce));else{if(DE&&Ro(fe))for(const ce of u.mount){const ie=vn(o,ce);if(ie&&ie._f){const de=Array.isArray(ie._f.refs)?ie._f.refs[0]:ie._f.ref;if(Hb(de)){const $=de.closest("form");if($){$.reset();break}}}}o={}}s=e.shouldUnregister?Be.keepDefaultValues?Ja(a):{}:Ja(jt),v.array.next({values:{...jt}}),v.values.next({values:{...jt}})}u={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!l.mount&&t(),l.mount=!p.isValid||!!Be.keepIsValid,l.watch=!!e.shouldUnregister,v.state.next({submitCount:Be.keepSubmitCount?i.submitCount:0,isDirty:Be.keepDirty?i.isDirty:!!(Be.keepDefaultValues&&!wf(fe,a)),isSubmitted:Be.keepIsSubmitted?i.isSubmitted:!1,dirtyFields:Be.keepDirtyValues?i.dirtyFields:Be.keepDefaultValues&&fe?y3(a,fe):{},touchedFields:Be.keepTouched?i.touchedFields:{},errors:Be.keepErrors?i.errors:{},isSubmitSuccessful:Be.keepIsSubmitSuccessful?i.isSubmitSuccessful:!1,isSubmitting:!1})},Mt=(fe,Be)=>ne(od(fe)?fe(s):fe,Be);return{control:{register:kt,unregister:vr,getFieldState:nr,handleSubmit:Kt,setError:Rt,_executeSchema:W,_getWatch:P,_getDirty:oe,_updateValid:E,_removeUnmounted:V,_updateFieldArray:U,_updateDisabledField:At,_getFieldArray:ee,_reset:ne,_resetDefaultValues:()=>od(r.defaultValues)&&r.defaultValues().then(fe=>{Mt(fe,r.resetOptions),v.state.next({isLoading:!1})}),_updateFormState:fe=>{i={...i,...fe}},_disableForm:Lt,_subjects:v,_proxyFormState:p,get _fields(){return o},get _formValues(){return s},get _state(){return l},set _state(fe){l=fe},get _defaultValues(){return a},get _names(){return u},set _names(fe){u=fe},get _formState(){return i},set _formState(fe){i=fe},get _options(){return r},set _options(fe){r={...r,...fe}}},trigger:Le,register:kt,handleSubmit:Kt,watch:Jt,setValue:_e,getValues:He,reset:Mt,resetField:yr,clearErrors:Bt,unregister:vr,setError:Rt,setFocus:(fe,Be={})=>{const rt=vn(o,fe),lt=rt&&rt._f;if(lt){const jt=lt.refs?lt.refs[0]:lt.ref;jt.focus&&(jt.focus(),Be.shouldSelect&&jt.select())}},getFieldState:nr}}function w1(e={}){const t=Gn.useRef(),r=Gn.useRef(),[i,o]=Gn.useState({isDirty:!1,isValidating:!1,isLoading:od(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},disabled:!1,defaultValues:od(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...NSe(e,()=>o(s=>({...s}))),formState:i});const a=t.current.control;return a._options=e,Zx({subject:a._subjects.state,next:s=>{z$(s,a._proxyFormState,a._updateFormState,!0)&&o({...a._formState})}}),Gn.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),Gn.useEffect(()=>{if(a._proxyFormState.isDirty){const s=a._getDirty();s!==i.isDirty&&a._subjects.state.next({isDirty:s})}},[a,i.isDirty]),Gn.useEffect(()=>{e.values&&!wf(e.values,r.current)?(a._reset(e.values,a._options.resetOptions),r.current=e.values):a._resetDefaultValues()},[e.values,a]),Gn.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=F$(i,a),t.current}function ic({label:e,name:t,control:r}){return L(ESe,{name:t,control:r,render:({field:i,fieldState:{error:o}})=>L(wh,{helperText:o?o.message:null,error:!!o,fullWidth:!0,label:e,variant:"outlined",...i})})}function jSe(e){return Vn.beginCell().storeUint(2003,32).storeUint(0,64).storeAddress(e).endCell()}function $Se(e){return Vn.beginCell().storeUint(3004,32).storeUint(0,64).storeAddress(e).endCell()}function FSe(e,t){return Vn.beginCell().storeUint(6007,32).storeUint(0,64).storeCoins(e).storeCoins(t).endCell()}function zSe(){const{data:e,isLoading:t}=Dy();kg();const r=fE(),i=w1({defaultValues:{admin:e?.admin||""}}),o=w1({defaultValues:{verifierRegistry:e?.verifierRegistry||""}}),a=w1({defaultValues:{minTon:e?.deploymentCosts.min||"",maxTon:e?.deploymentCosts.max||""}});async function s(c){if(!e?.address)throw new Error("no address");if(c.admin!==e?.admin)try{const d=$Se(Vn.Address.parse(c.admin));await r(e.address.toString(),Vn.toNano("0.01"),d)==="rejected"&&i.setError("admin",{message:"Failed to change admin"})}catch(d){let p="Failed to change admin";"message"in d&&(p=d.message),i.setError("admin",{message:p})}}async function l(c){if(!e?.address)throw new Error("no address");if(c.verifierRegistry!==e?.verifierRegistry)try{const d=jSe(Vn.Address.parse(c.verifierRegistry));await r(e.address.toString(),Vn.toNano("0.01"),d)==="rejected"&&o.setError("verifierRegistry",{message:"Failed to change verifier registry"})}catch(d){let p="Failed to change verifier registry";"message"in d&&(p=d.message),o.setError("verifierRegistry",{message:p})}}async function u(c){if(!e?.address)throw new Error("no address");if(c.minTon!==e?.deploymentCosts.min||c.maxTon!==e?.deploymentCosts.max)try{const d=FSe(Vn.toNano(c.minTon),Vn.toNano(c.maxTon));await r(e.address.toString(),Vn.toNano("0.01"),d)==="rejected"&&a.setError("root",{message:"Failed to change deployment costs"})}catch(d){let p="Failed to change deployment costs";"message"in d&&(p=d.message),a.setError("root",{message:p})}}return X.exports.useEffect(()=>{e&&(i.reset({admin:e.admin}),o.reset({verifierRegistry:e.verifierRegistry}),a.reset({minTon:e.deploymentCosts.min,maxTon:e.deploymentCosts.max}))},[e]),Ut(xs,{spacing:4,p:4,children:[L("h1",{children:"Sources Registry"}),t&&L(lg,{}),e&&Ut(ta,{children:[L(UE,{label:"Address",data:e.address.toString()}),L("form",{id:"adminForm",onSubmit:i.handleSubmit(s),children:Ut(xs,{spacing:2,children:[!i.formState.isValid&&L(d1,{severity:"error",children:Object.entries(i.formState.errors).map(([c,d])=>L("div",{children:d.message},c))}),Ut(xs,{direction:"row",spacing:2,alignItems:"center",children:[L(ic,{...i.register("admin"),control:i.control,label:"Admin"}),L(nd,{text:"Save",type:"submit",disabled:!i.formState.isDirty})]})]})}),L("form",{id:"verifierRegistryForm",onSubmit:o.handleSubmit(l),children:Ut(xs,{spacing:2,children:[!o.formState.isValid&&L(d1,{severity:"error",children:Object.entries(o.formState.errors).map(([c,d])=>L("div",{children:d.message},c))}),Ut(xs,{direction:"row",spacing:2,alignItems:"center",children:[L(ic,{...o.register("verifierRegistry"),control:o.control,label:"Verifier Reg."}),L(nd,{text:"Save",type:"submit",disabled:!o.formState.isDirty})]})]})}),L("form",{id:"sourcesRegistryForm",onSubmit:a.handleSubmit(u),children:Ut(xs,{spacing:2,children:[!a.formState.isValid&&L(d1,{severity:"error",children:Object.entries(a.formState.errors).map(([c,d])=>L("div",{children:d.message},c))}),Ut(xs,{direction:"row",spacing:2,alignItems:"center",children:[L(ic,{...a.register("minTon"),control:a.control,label:"Min Ton"}),L(ic,{...a.register("maxTon"),control:a.control,label:"Max Ton"}),L(nd,{text:"Save",type:"submit",disabled:!a.formState.isDirty})]})]})})]})]})}const J$={removeVerifier:435836471,updateVerifier:1610798618,forwardMessage:1965127512};function zO(e){return Ib(V1e(e))}function HSe(e){let t=e.split(".");return((+t[0]*256+ +t[1])*256+ +t[2])*256+ +t[3]}function WSe(){return{serialize:(e,t)=>{t.storeSlice(e)},parse:e=>e}}function VSe(e){let t=Vn.beginCell();t.storeUint(J$.updateVerifier,32),t.storeUint(e.queryId||0,64),t.storeUint(e.id,256),t.storeUint(e.quorum,8);let r=Vn.Dictionary.empty(Vn.Dictionary.Keys.BigUint(256),WSe());return e.endpoints.forEach(function(i,o){r.set(o,Vn.beginCell().storeUint(i,32).endCell().beginParse())}),t.storeDict(r),t.storeRef(Vn.beginCell().storeBuffer(Buffer.from(e.name)).endCell()),t.storeRef(Vn.beginCell().storeBuffer(Buffer.from(e.marketingUrl)).endCell()),t.endCell()}function qSe(e){let t=Vn.beginCell();return t.storeUint(J$.removeVerifier,32),t.storeUint(e.queryId||0,64),t.storeUint(e.id,256),t.endCell()}function HO({verifier:e,altColor:t,isNew:r}){const i=fE(),{data:o}=Dy(),a=X.exports.useMemo(()=>Object.entries(e.pubKeyEndpoints).map(([p,v])=>({pubKey:p,ip:v})),[e.pubKeyEndpoints]),s=w1({defaultValues:{quorum:e.quorum.toString()||"",name:e.name||"",url:e.url||"",pubKeyEndpoints:a||[]},mode:"onChange"});async function l(p){if(!p.name){s.setError("name",{message:"Name is required"});return}if(!p.url){s.setError("url",{message:"Url is required"});return}if(!p.quorum||Number(p.quorum)<1){s.setError("quorum",{message:"Quorum is required and should be at least 1"});return}try{await i(o?.verifierRegistry??"",Vn.toNano(r?"1000":"0.01"),VSe({id:zO(p.name),quorum:Number(p.quorum),endpoints:new Map(p.pubKeyEndpoints.map(({pubKey:x,ip:b})=>[Ib(Buffer.from(x,"base64")),HSe(b)])),name:p.name,marketingUrl:p.url}))==="rejected"&&s.setError("root",{message:`Failed to update config of ${p.name}`})}catch(v){let x=`Failed to update config of ${p.name}`;"message"in v&&(x=v.message),s.setError("root",{message:x})}}const{fields:u,append:c,remove:d}=PSe({control:s.control,name:"pubKeyEndpoints"});return L("form",{id:e.admin.toString(),onSubmit:s.handleSubmit(l),children:Ut(xs,{spacing:4,px:4,py:6,style:{backgroundColor:t?"#eeeeef":"transparent"},children:[!s.formState.isValid&&L(d1,{severity:"error",children:Object.entries(s.formState.errors).map(([p,v])=>L("div",{children:v.message},p))}),Ut(xs,{flexDirection:"row",alignItems:"center",gap:2,children:[L("h3",{style:{margin:0},children:r?"Add Verifier":s.getValues("name")}),!r&&L(nd,{text:"Remove",onClick:()=>{i(o.verifierRegistry,Vn.toNano("0.01"),qSe({id:zO(s.getValues("name"))}))}})]}),L(UE,{label:"Admin",data:e.admin.toString()}),r&&L(ic,{label:"Name",name:"name",control:s.control}),L(ic,{label:"Url",name:"url",control:s.control}),L(ic,{label:"Quorum",name:"quorum",control:s.control}),Ut(xs,{spacing:2,alignItems:"flex-start",children:[Ut(xs,{direction:"row",spacing:4,alignItems:"center",children:[L("h4",{children:"Public Key Endpoints"}),L(nd,{size:"small",text:"Add",onClick:()=>{c({pubKey:"",ip:""})}})]}),u.map((p,v)=>Ut(Cv,{container:!0,alignItems:"center",gap:2,wrap:"nowrap",children:[L(Cv,{item:!0,xs:6,children:L(ic,{label:`PubKey-${v}`,name:`pubKeyEndpoints.${v}.pubKey`,control:s.control})}),L(Cv,{item:!0,xs:5,children:L(ic,{label:`IP-${v}`,name:`pubKeyEndpoints.${v}.ip`,control:s.control})}),L(Cv,{item:!0,xs:1,children:L(nd,{text:"Remove",onClick:()=>d(v)})})]},p.id))]}),L(nd,{text:r?"Add verifier":"Update config",type:"submit",disabled:!s.formState.isDirty})]})})}function KSe(){const{data:e,isLoading:t}=zx(),{data:r}=Dy(),[i]=kg();return Ut(xs,{spacing:4,p:4,children:[L("h1",{children:"Verifier Registry"}),L(UE,{label:"Address",data:r?.verifierRegistry??""}),t&&L(lg,{}),Ut(xs,{children:[t&&"Loading...",e?.map((o,a)=>L(HO,{verifier:o,altColor:a%2!==1,isNew:!1}))]}),i.account?.address&&L(HO,{isNew:!0,altColor:!0,verifier:{admin:Vn.Address.parse(i.account?.address),name:"",quorum:0,url:"",pubKeyEndpoints:{}}})]})}function GSe(){return Ut("div",{children:[window.isTestnet&&L(BE,{}),Ut(xs,{direction:"row",justifyContent:"space-between",alignItems:"center",p:4,children:[L("h1",{children:"Admin"}),L(Ux,{})]}),L(zSe,{}),L(KSe,{}),L(Fb,{})]})}const YSe=sr(kn)(({theme:e})=>t=>({display:t.isMobile?"flex":"inherit",alignItems:t.isMobile?"center":"inherit",fontWight:700,color:"#fff",height:t.isMobile?90:100,background:"#fff",borderBottomLeftRadius:e.spacing(6),borderBottomRightRadius:e.spacing(6),border:"0.5px solid rgba(114, 138, 150, 0.24)",boxShadow:"rgb(114 138 150 / 8%) 0px 2px 16px"}));function QSe(){const e=la(),t=aa(e.breakpoints.down("md")),r=aa(e.breakpoints.down("lg"));return L(YSe,{px:r?3.4:0,isMobile:t,children:Ut(IL,{mb:5,children:[Ut(ap,{children:[L("img",{src:vw,width:30,height:30,alt:"App icon"}),L(cx,{children:"TACT DEPLOYER"})]}),Ut(TL,{children:[L($n,{mr:t?0:2,children:L(Ux,{})}),!t&&Ut(ap,{href:$6,target:"_blank",children:[L("img",{src:ZC,alt:"Github icon",width:20,height:20}),L(xk,{children:"GitHub"})]})]})]})})}const ZSe=sr("input")({display:"flex",alignItems:"center",paddingLeft:14,boxSizing:"border-box",height:34,background:"#FFFFFF",border:"1px solid #D8D8D8",borderRadius:"12px",fontSize:14,fontFamily:"Mulish",outline:"none","&:hover":{border:"1px solid #b0b0b0"},"&:focus":{border:"1px solid #807e7e"}}),XSe=Vn.Cell.fromBoc(Buffer.from("te6cckEBAQEADgAAGJRqmLYAAAAAAAAAAOnNeQ0=","base64"))[0];async function b3(e){const t=`https://tact-deployer${window.isTestnet?"-testnet":""}.infura-ipfs.io`;return fetch(`${t}/ipfs/${e}`)}function $E({workchain:e}){const{ipfsHash:t}=xU(),{data:r,error:i,isLoading:o}=bc(["tactDeploy",t],async()=>{if(!t)return null;const a=await yp(),s=await b3(t).then(_=>_.json()),l=await b3(s.pkg).then(_=>_.json()),u=await b3(s.dataCell).then(_=>_.arrayBuffer()).then(_=>Vn.Cell.fromBoc(Buffer.from(_))[0]),c=Vn.Cell.fromBoc(Buffer.from(l.code,"base64"))[0],d=Vn.contractAddress(e,{code:c,data:u}),p={code:c,data:u},v=u.hash().toString("base64"),x=c.hash().toString("base64"),b=await a.isContractDeployed(d),y=b&&await pE(x);return{address:d,stateInit:p,pkg:l,codeCellHash:x,dataCellHash:v,isDeployed:b,hasProof:y}});return{data:r,error:i,isLoading:o}}function JSe(e,t,r){const{sendTXN:i,data:o,clearTXN:a}=tj("deployContract",async s=>{if(!r)throw new Error("No address");const l=await yp();return s>20?"error":await l.isContractDeployed(r)?"success":"issued"});return{sendTXN:()=>{!r||i(r,Vn.toNano(e),XSe,t)},status:o.status,clearTXN:a}}function e4e(){const e=[],{data:t,error:r}=$E({workchain:0});return t&&(e.push({title:"Name",value:t.pkg.name}),e.push({title:"Compiler",value:`Tact ${t.pkg.compiler.version}`}),e.push({title:"Code Hash",value:t.codeCellHash}),e.push({title:"Data Hash",value:t.dataCellHash}),e.push({title:"Workchain",value:Rj(t.address.toString())})),L(SE,{title:"Contract",icon:_E,dataRows:e,isLoading:!1,isFlexibleWrapper:!0})}function t4e(){const[e,t]=X.exports.useState("0.5"),{data:r,error:i}=$E({workchain:0}),{sendTXN:o,status:a}=JSe(e,r?.stateInit,r?.address),{markPreloaded:s}=Aj(),l=Ac(),u=zu();let c="";if(i)c=i.toString();else if(r?.isDeployed)c=Ut("div",{children:["Contract is already deployed.",!r.hasProof&&" You can publish its sources to verify it."]});else switch(a){case"initial":c="Contract is ready for deployment";break;case"pending":c="Please approve the transaction in your wallet";break;case"issued":c="Transaction was issued. Monitoring deployment...";break;case"rejected":c="Transaction was rejected. Please retry.";break;case"error":c="Transaction failed. Please retry.";break;case"expired":c="Transaction expired. Please retry.";break;case"success":c="Contract deployed successfully! You can now publish its sources to verify it.";break}let d=Ut(Ha,{disabled:a==="pending"||a==="issued"||r?.isDeployed,fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{o()},children:[(a==="pending"||a==="issued")&&L(lg,{sx:{color:"#fff",height:"20px !important",width:"20px !important"}}),"Deploy"]});return(a==="success"||r?.isDeployed&&!r.hasProof)&&(d=L(Ha,{fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{s(),l("/"+r.address.toString()),u.addFiles([new File([JSON.stringify(r.pkg)],r.pkg.name+".pkg",{type:"text/plain"})])},children:"Verify"})),Ut(ug,{mb:6,children:[Ut($n,{p:"30px 24px 0 24px",children:[L(cg,{children:L("img",{src:_E,alt:"publish icon",width:41,height:41})}),L(Fd,{children:"Deploy"})]}),Ut(kn,{children:[Ut(kn,{sx:{padding:"0 30px"},children:[Ut(wE,{gap:2,sx:{mt:2},children:[L(Cc,{children:L("div",{children:"Value to initialize contract (TON)"})}),L(Cc,{children:L(ZSe,{disabled:!!r?.isDeployed||a==="issued"||a=="pending",value:e,type:"number",onChange:p=>{t(p.target.value)}})})]}),L(Cs,{type:ps.HINT,title:L(ta,{}),notificationBody:L($n,{sx:{overflow:"auto",maxHeight:300},children:Ut(Dd,{sx:{marginBottom:0},children:[L(kn,{sx:{fontWeight:600},children:"Contract Address"}),L(kn,{sx:{fontSize:18,fontWeight:700,wordBreak:"break-all"},children:r?.address.toString()})]})})}),L(Cs,{type:ps.INFO,title:L(ta,{}),notificationBody:L($n,{sx:{overflow:"auto",maxHeight:300},children:L(Dd,{sx:{marginBottom:0},children:c})})}),d]}),L($n,{mb:3,sx:{justifyContent:"center"}})]})]})}function r4e(){const e=la(),t=aa(e.breakpoints.down("md")),r=aa(e.breakpoints.down("lg")),{data:i,error:o,isLoading:a}=$E({workchain:0});return Ut(kn,{children:[window.isTestnet&&L(BE,{}),L(QSe,{}),Ut(U$,{px:r?"20px":0,children:[a&&Ut(Cc,{sx:{marginTop:3},children:[L(Xa,{height:330,variant:"rounded",sx:{marginBottom:3}}),L(Xa,{height:280,variant:"rounded"})]}),!a&&Ut(ta,{children:[L(D$,{isMobile:t,children:L(e4e,{})}),L(t4e,{})]})]}),")",L(Fb,{})]})}const n4e=new KH({defaultOptions:{queries:{refetchOnWindowFocus:!1}}});P1e();yS.createRoot(document.getElementById("root")).render(L(ope,{maxSnack:3,children:L(BQ,{theme:bSe,children:L(Rq,{client:n4e,children:L(uve,{manifestUrl:"https://verifier.ton.org/tonconnect-manifest.json",children:L(HK,{basename:"/verifier/",children:Ut(FK,{children:[L(Hp,{path:"/interact",element:L(vSe,{})}),L(Hp,{path:"/admin",element:L(GSe,{})}),L(Hp,{path:"/tactDeployer/:ipfsHash",element:L(r4e,{})}),L(Hp,{path:"/:contractAddress",element:L(UO,{})}),L(Hp,{path:"/",element:L(UO,{})})]})})})})})}));export{Kb as g};
diff --git a/assets/index.9dd948c7.js b/assets/index.a8990815.js
similarity index 99%
rename from assets/index.9dd948c7.js
rename to assets/index.a8990815.js
index ce2318b..dc7ec06 100644
--- a/assets/index.9dd948c7.js
+++ b/assets/index.a8990815.js
@@ -1,4 +1,4 @@
-import{g as HI}from"./index.5bdfee9b.js";function sI(S,t){for(var L=0;Ln[f]})}}}return Object.freeze(Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}))}var FB={},uA={};Object.defineProperty(uA,"__esModule",{value:!0});uA.normalize=void 0;const tA=47,GB=46,KI=(S,t)=>{let L="",n=0,f=-1,G=0,u;for(let T=0;T<=S.length;++T){if(T2){const v=L.lastIndexOf("/");if(v!==L.length-1){v===-1?(L="",n=0):(L=L.slice(0,v),n=L.length-1-L.lastIndexOf("/")),f=T,G=0;continue}}else if(L.length===2||L.length===1){L="",n=0,f=T,G=0;continue}}t&&(L.length>0?L+="/..":L="..",n=2)}else L.length>0?L+="/"+S.slice(f+1,T):L=S.slice(f+1,T),n=T-f-1;f=T,G=0}else u===GB&&G!==-1?++G:G=-1}return L},LI=S=>{let t=S;if(t.length===0)return".";const L=t.charCodeAt(0)===tA,n=t.charCodeAt(t.length-1)===tA;return t=KI(t,!L),t.length===0&&!L&&(t="."),t.length>0&&n&&(t+="/"),L?"/"+t:t};uA.normalize=LI;var PA={};Object.defineProperty(PA,"__esModule",{value:!0});PA.base64Decode=void 0;function VI(S){return S>64&&S<91?S-65:S>96&&S<123?S-71:S>47&&S<58?S+4:S===43?62:S===47?63:0}function ZI(S){const t=S.replace(/[^A-Za-z0-9+/]/g,""),L=t.length,n=L*3+1>>2,f=new Uint8Array(n);let G,u,T=0,v=0;for(let _=0;_>>(16>>>G&24)&255,G++,v++;T=0}return f}PA.base64Decode=ZI;var _A={},$B={exports:{}};(function(S,t){var L=(()=>{var n=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(f){f=f||{};var G=typeof f<"u"?f:{},u,T;G.ready=new Promise(function(A,B){u=A,T=B});var v=Object.assign({},G),_="./this.program",WA=(A,B)=>{throw B},z=!0,b="";function $(A){return G.locateFile?G.locateFile(A,b):b+A}var r,RA,NA;typeof document<"u"&&document.currentScript&&(b=document.currentScript.src),n&&(b=n),b.indexOf("blob:")!==0?b=b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):b="",r=A=>{var B=new XMLHttpRequest;return B.open("GET",A,!1),B.send(null),B.responseText},RA=(A,B,g)=>{var Q=new XMLHttpRequest;Q.open("GET",A,!0),Q.responseType="arraybuffer",Q.onload=()=>{if(Q.status==200||Q.status==0&&Q.response){B(Q.response);return}g()},Q.onerror=g,Q.send(null)};var wA=G.print||console.log.bind(console),p=G.printErr||console.warn.bind(console);Object.assign(G,v),v=null,G.arguments&&G.arguments,G.thisProgram&&(_=G.thisProgram),G.quit&&(WA=G.quit);var AA;G.wasmBinary&&(AA=G.wasmBinary);var dA=G.noExitRuntime||!0;typeof WebAssembly!="object"&&oA("no native wasm support detected");var HA,sA=!1;function $A(A,B){A||oA(B)}var mA=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function CA(A,B,g){for(var Q=B+g,C=B;A[C]&&!(C>=Q);)++C;if(C-B>16&&A.buffer&&mA)return mA.decode(A.subarray(B,C));for(var E="";B>10,56320|o&1023)}}return E}function GA(A,B){return A?CA(gA,A,B):""}function aA(A,B,g,Q){if(!(Q>0))return 0;for(var C=g,E=g+Q-1,D=0;D=55296&&N<=57343){var F=A.charCodeAt(++D);N=65536+((N&1023)<<10)|F&1023}if(N<=127){if(g>=E)break;B[g++]=N}else if(N<=2047){if(g+1>=E)break;B[g++]=192|N>>6,B[g++]=128|N&63}else if(N<=65535){if(g+2>=E)break;B[g++]=224|N>>12,B[g++]=128|N>>6&63,B[g++]=128|N&63}else{if(g+3>=E)break;B[g++]=240|N>>18,B[g++]=128|N>>12&63,B[g++]=128|N>>6&63,B[g++]=128|N&63}}return B[g]=0,g-C}function KA(A,B,g){return aA(A,gA,B,g)}function e(A){for(var B=0,g=0;g=55296&&Q<=57343?(B+=4,++g):B+=3}return B}var FA,W,gA,hA,R,d,MA,kA;function Ag(A){FA=A,G.HEAP8=W=new Int8Array(A),G.HEAP16=hA=new Int16Array(A),G.HEAP32=R=new Int32Array(A),G.HEAPU8=gA=new Uint8Array(A),G.HEAPU16=new Uint16Array(A),G.HEAPU32=d=new Uint32Array(A),G.HEAPF32=MA=new Float32Array(A),G.HEAPF64=kA=new Float64Array(A)}G.INITIAL_MEMORY;var LA,oB=[],UB=[],YB=[];function Bg(){return dA}function gg(){if(G.preRun)for(typeof G.preRun=="function"&&(G.preRun=[G.preRun]);G.preRun.length;)Cg(G.preRun.shift());AB(oB)}function Qg(){!G.noFSInit&&!I.init.initialized&&I.init(),I.ignorePermissions=!1,AB(UB)}function Ig(){if(G.postRun)for(typeof G.postRun=="function"&&(G.postRun=[G.postRun]);G.postRun.length;)Dg(G.postRun.shift());AB(YB)}function Cg(A){oB.unshift(A)}function Eg(A){UB.unshift(A)}function Dg(A){YB.unshift(A)}var SA=0,jA=null;function mI(A){return A}function TA(A){SA++,G.monitorRunDependencies&&G.monitorRunDependencies(SA)}function lA(A){if(SA--,G.monitorRunDependencies&&G.monitorRunDependencies(SA),SA==0&&jA){var B=jA;jA=null,B()}}function oA(A){G.onAbort&&G.onAbort(A),A="Aborted("+A+")",p(A),sA=!0,A+=". Build with -sASSERTIONS for more info.";var B=new WebAssembly.RuntimeError(A);throw T(B),B}var Ng="data:application/octet-stream;base64,";function iB(A){return A.startsWith(Ng)}var QA;QA="funcfiftlib.wasm",iB(QA)||(QA=$(QA));function RB(A){try{if(A==QA&&AA)return new Uint8Array(AA);throw"both async and sync fetching of the wasm failed"}catch(B){oA(B)}}function Gg(){return!AA&&z&&typeof fetch=="function"?fetch(QA,{credentials:"same-origin"}).then(function(A){if(!A.ok)throw"failed to load wasm binary file at '"+QA+"'";return A.arrayBuffer()}).catch(function(){return RB(QA)}):Promise.resolve().then(function(){return RB(QA)})}function Fg(){var A={a:bQ};function B(D,N){var F=D.exports;G.asm=F,HA=G.asm.Ea,Ag(HA.buffer),LA=G.asm.Ia,Eg(G.asm.Fa),lA()}TA();function g(D){B(D.instance)}function Q(D){return Gg().then(function(N){return WebAssembly.instantiate(N,A)}).then(function(N){return N}).then(D,function(N){p("failed to asynchronously prepare wasm: "+N),oA(N)})}function C(){return!AA&&typeof WebAssembly.instantiateStreaming=="function"&&!iB(QA)&&typeof fetch=="function"?fetch(QA,{credentials:"same-origin"}).then(function(D){var N=WebAssembly.instantiateStreaming(D,A);return N.then(g,function(F){return p("wasm streaming compile failed: "+F),p("falling back to ArrayBuffer instantiation"),Q(g)})}):Q(g)}if(G.instantiateWasm)try{var E=G.instantiateWasm(A,B);return E}catch(D){return p("Module.instantiateWasm callback failed with error: "+D),!1}return C().catch(T),{}}var M,X,og={567360:A=>{throw GA(A)}};function Ug(A){this.name="ExitStatus",this.message="Program terminated with exit("+A+")",this.status=A}function AB(A){for(;A.length>0;)A.shift()(G)}function Yg(){var A=new Error;if(!A.stack){try{throw new Error}catch(B){A=B}if(!A.stack)return"(no stack trace available)"}return A.stack.toString()}function ig(A,B,g="i8"){switch(g.endsWith("*")&&(g="*"),g){case"i1":W[A>>0]=B;break;case"i8":W[A>>0]=B;break;case"i16":hA[A>>1]=B;break;case"i32":R[A>>2]=B;break;case"i64":X=[B>>>0,(M=B,+Math.abs(M)>=1?M>0?(Math.min(+Math.floor(M/4294967296),4294967295)|0)>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],R[A>>2]=X[0],R[A+4>>2]=X[1];break;case"float":MA[A>>2]=B;break;case"double":kA[A>>3]=B;break;case"*":d[A>>2]=B;break;default:oA("invalid type for setValue: "+g)}}function wB(A,B){W.set(A,B)}function Rg(A){return EB(A+24)+24}var pA=[];function wg(A){A.add_ref()}var nA=0;function hg(A){var B=new JA(A);return B.get_caught()||(B.set_caught(!0),nA--),B.set_rethrown(!1),pA.push(B),wg(B),B.get_exception_ptr()}var UA=0;function JA(A){this.excPtr=A,this.ptr=A-24,this.set_type=function(B){d[this.ptr+4>>2]=B},this.get_type=function(){return d[this.ptr+4>>2]},this.set_destructor=function(B){d[this.ptr+8>>2]=B},this.get_destructor=function(){return d[this.ptr+8>>2]},this.set_refcount=function(B){R[this.ptr>>2]=B},this.set_caught=function(B){B=B?1:0,W[this.ptr+12>>0]=B},this.get_caught=function(){return W[this.ptr+12>>0]!=0},this.set_rethrown=function(B){B=B?1:0,W[this.ptr+13>>0]=B},this.get_rethrown=function(){return W[this.ptr+13>>0]!=0},this.init=function(B,g){this.set_adjusted_ptr(0),this.set_type(B),this.set_destructor(g),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var B=R[this.ptr>>2];R[this.ptr>>2]=B+1},this.release_ref=function(){var B=R[this.ptr>>2];return R[this.ptr>>2]=B-1,B===1},this.set_adjusted_ptr=function(B){d[this.ptr+16>>2]=B},this.get_adjusted_ptr=function(){return d[this.ptr+16>>2]},this.get_exception_ptr=function(){var B=xB(this.get_type());if(B)return d[this.excPtr>>2];var g=this.get_adjusted_ptr();return g!==0?g:this.excPtr}}function hB(A){try{return jB(new JA(A).ptr)}catch{}}function l(A){return LA.get(A)}function kg(A){if(A.release_ref()&&!A.get_rethrown()){var B=A.get_destructor();B&&l(B)(A.excPtr),hB(A.excPtr)}}function yg(){H(0);var A=pA.pop();kg(A),UA=0}function ag(A){throw UA||(UA=A),A}function Mg(){var A=UA;if(!A)return O(0),0;var B=new JA(A);B.set_adjusted_ptr(A);var g=B.get_type();if(!g)return O(0),A;for(var Q=Array.prototype.slice.call(arguments),C=0;C>2]=A,A}var m={isAbs:A=>A.charAt(0)==="/",splitPath:A=>{var B=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return B.exec(A).slice(1)},normalizeArray:(A,B)=>{for(var g=0,Q=A.length-1;Q>=0;Q--){var C=A[Q];C==="."?A.splice(Q,1):C===".."?(A.splice(Q,1),g++):g&&(A.splice(Q,1),g--)}if(B)for(;g;g--)A.unshift("..");return A},normalize:A=>{var B=m.isAbs(A),g=A.substr(-1)==="/";return A=m.normalizeArray(A.split("/").filter(Q=>!!Q),!B).join("/"),!A&&!B&&(A="."),A&&g&&(A+="/"),(B?"/":"")+A},dirname:A=>{var B=m.splitPath(A),g=B[0],Q=B[1];return!g&&!Q?".":(Q&&(Q=Q.substr(0,Q.length-1)),g+Q)},basename:A=>{if(A==="/")return"/";A=m.normalize(A),A=A.replace(/\/$/,"");var B=A.lastIndexOf("/");return B===-1?A:A.substr(B+1)},join:function(){var A=Array.prototype.slice.call(arguments,0);return m.normalize(A.join("/"))},join2:(A,B)=>m.normalize(A+"/"+B)};function Vg(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var A=new Uint8Array(1);return()=>(crypto.getRandomValues(A),A[0])}else return()=>oA("randomDevice")}var YA={resolve:function(){for(var A="",B=!1,g=arguments.length-1;g>=-1&&!B;g--){var Q=g>=0?arguments[g]:I.cwd();if(typeof Q!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!Q)return"";A=Q+"/"+A,B=m.isAbs(Q)}return A=m.normalizeArray(A.split("/").filter(C=>!!C),!B).join("/"),(B?"/":"")+A||"."},relative:(A,B)=>{A=YA.resolve(A).substr(1),B=YA.resolve(B).substr(1);function g(o){for(var h=0;h=0&&o[y]==="";y--);return h>y?[]:o.slice(h,y-h+1)}for(var Q=g(A.split("/")),C=g(B.split("/")),E=Math.min(Q.length,C.length),D=E,N=0;N0?g:e(A)+1,C=new Array(Q),E=aA(A,C,0,C.length);return B&&(C.length=E),C}var cA={ttys:[],init:function(){},shutdown:function(){},register:function(A,B){cA.ttys[A]={input:[],output:[],ops:B},I.registerDevice(A,cA.stream_ops)},stream_ops:{open:function(A){var B=cA.ttys[A.node.rdev];if(!B)throw new I.ErrnoError(43);A.tty=B,A.seekable=!1},close:function(A){A.tty.ops.fsync(A.tty)},fsync:function(A){A.tty.ops.fsync(A.tty)},read:function(A,B,g,Q,C){if(!A.tty||!A.tty.ops.get_char)throw new I.ErrnoError(60);for(var E=0,D=0;Dn[f]})}}}return Object.freeze(Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}))}var FB={},uA={};Object.defineProperty(uA,"__esModule",{value:!0});uA.normalize=void 0;const tA=47,GB=46,KI=(S,t)=>{let L="",n=0,f=-1,G=0,u;for(let T=0;T<=S.length;++T){if(T2){const v=L.lastIndexOf("/");if(v!==L.length-1){v===-1?(L="",n=0):(L=L.slice(0,v),n=L.length-1-L.lastIndexOf("/")),f=T,G=0;continue}}else if(L.length===2||L.length===1){L="",n=0,f=T,G=0;continue}}t&&(L.length>0?L+="/..":L="..",n=2)}else L.length>0?L+="/"+S.slice(f+1,T):L=S.slice(f+1,T),n=T-f-1;f=T,G=0}else u===GB&&G!==-1?++G:G=-1}return L},LI=S=>{let t=S;if(t.length===0)return".";const L=t.charCodeAt(0)===tA,n=t.charCodeAt(t.length-1)===tA;return t=KI(t,!L),t.length===0&&!L&&(t="."),t.length>0&&n&&(t+="/"),L?"/"+t:t};uA.normalize=LI;var PA={};Object.defineProperty(PA,"__esModule",{value:!0});PA.base64Decode=void 0;function VI(S){return S>64&&S<91?S-65:S>96&&S<123?S-71:S>47&&S<58?S+4:S===43?62:S===47?63:0}function ZI(S){const t=S.replace(/[^A-Za-z0-9+/]/g,""),L=t.length,n=L*3+1>>2,f=new Uint8Array(n);let G,u,T=0,v=0;for(let _=0;_>>(16>>>G&24)&255,G++,v++;T=0}return f}PA.base64Decode=ZI;var _A={},$B={exports:{}};(function(S,t){var L=(()=>{var n=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(f){f=f||{};var G=typeof f<"u"?f:{},u,T;G.ready=new Promise(function(A,B){u=A,T=B});var v=Object.assign({},G),_="./this.program",WA=(A,B)=>{throw B},z=!0,b="";function $(A){return G.locateFile?G.locateFile(A,b):b+A}var r,RA,NA;typeof document<"u"&&document.currentScript&&(b=document.currentScript.src),n&&(b=n),b.indexOf("blob:")!==0?b=b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):b="",r=A=>{var B=new XMLHttpRequest;return B.open("GET",A,!1),B.send(null),B.responseText},RA=(A,B,g)=>{var Q=new XMLHttpRequest;Q.open("GET",A,!0),Q.responseType="arraybuffer",Q.onload=()=>{if(Q.status==200||Q.status==0&&Q.response){B(Q.response);return}g()},Q.onerror=g,Q.send(null)};var wA=G.print||console.log.bind(console),p=G.printErr||console.warn.bind(console);Object.assign(G,v),v=null,G.arguments&&G.arguments,G.thisProgram&&(_=G.thisProgram),G.quit&&(WA=G.quit);var AA;G.wasmBinary&&(AA=G.wasmBinary);var dA=G.noExitRuntime||!0;typeof WebAssembly!="object"&&oA("no native wasm support detected");var HA,sA=!1;function $A(A,B){A||oA(B)}var mA=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function CA(A,B,g){for(var Q=B+g,C=B;A[C]&&!(C>=Q);)++C;if(C-B>16&&A.buffer&&mA)return mA.decode(A.subarray(B,C));for(var E="";B>10,56320|o&1023)}}return E}function GA(A,B){return A?CA(gA,A,B):""}function aA(A,B,g,Q){if(!(Q>0))return 0;for(var C=g,E=g+Q-1,D=0;D=55296&&N<=57343){var F=A.charCodeAt(++D);N=65536+((N&1023)<<10)|F&1023}if(N<=127){if(g>=E)break;B[g++]=N}else if(N<=2047){if(g+1>=E)break;B[g++]=192|N>>6,B[g++]=128|N&63}else if(N<=65535){if(g+2>=E)break;B[g++]=224|N>>12,B[g++]=128|N>>6&63,B[g++]=128|N&63}else{if(g+3>=E)break;B[g++]=240|N>>18,B[g++]=128|N>>12&63,B[g++]=128|N>>6&63,B[g++]=128|N&63}}return B[g]=0,g-C}function KA(A,B,g){return aA(A,gA,B,g)}function e(A){for(var B=0,g=0;g=55296&&Q<=57343?(B+=4,++g):B+=3}return B}var FA,W,gA,hA,R,d,MA,kA;function Ag(A){FA=A,G.HEAP8=W=new Int8Array(A),G.HEAP16=hA=new Int16Array(A),G.HEAP32=R=new Int32Array(A),G.HEAPU8=gA=new Uint8Array(A),G.HEAPU16=new Uint16Array(A),G.HEAPU32=d=new Uint32Array(A),G.HEAPF32=MA=new Float32Array(A),G.HEAPF64=kA=new Float64Array(A)}G.INITIAL_MEMORY;var LA,oB=[],UB=[],YB=[];function Bg(){return dA}function gg(){if(G.preRun)for(typeof G.preRun=="function"&&(G.preRun=[G.preRun]);G.preRun.length;)Cg(G.preRun.shift());AB(oB)}function Qg(){!G.noFSInit&&!I.init.initialized&&I.init(),I.ignorePermissions=!1,AB(UB)}function Ig(){if(G.postRun)for(typeof G.postRun=="function"&&(G.postRun=[G.postRun]);G.postRun.length;)Dg(G.postRun.shift());AB(YB)}function Cg(A){oB.unshift(A)}function Eg(A){UB.unshift(A)}function Dg(A){YB.unshift(A)}var SA=0,jA=null;function mI(A){return A}function TA(A){SA++,G.monitorRunDependencies&&G.monitorRunDependencies(SA)}function lA(A){if(SA--,G.monitorRunDependencies&&G.monitorRunDependencies(SA),SA==0&&jA){var B=jA;jA=null,B()}}function oA(A){G.onAbort&&G.onAbort(A),A="Aborted("+A+")",p(A),sA=!0,A+=". Build with -sASSERTIONS for more info.";var B=new WebAssembly.RuntimeError(A);throw T(B),B}var Ng="data:application/octet-stream;base64,";function iB(A){return A.startsWith(Ng)}var QA;QA="funcfiftlib.wasm",iB(QA)||(QA=$(QA));function RB(A){try{if(A==QA&&AA)return new Uint8Array(AA);throw"both async and sync fetching of the wasm failed"}catch(B){oA(B)}}function Gg(){return!AA&&z&&typeof fetch=="function"?fetch(QA,{credentials:"same-origin"}).then(function(A){if(!A.ok)throw"failed to load wasm binary file at '"+QA+"'";return A.arrayBuffer()}).catch(function(){return RB(QA)}):Promise.resolve().then(function(){return RB(QA)})}function Fg(){var A={a:bQ};function B(D,N){var F=D.exports;G.asm=F,HA=G.asm.Ea,Ag(HA.buffer),LA=G.asm.Ia,Eg(G.asm.Fa),lA()}TA();function g(D){B(D.instance)}function Q(D){return Gg().then(function(N){return WebAssembly.instantiate(N,A)}).then(function(N){return N}).then(D,function(N){p("failed to asynchronously prepare wasm: "+N),oA(N)})}function C(){return!AA&&typeof WebAssembly.instantiateStreaming=="function"&&!iB(QA)&&typeof fetch=="function"?fetch(QA,{credentials:"same-origin"}).then(function(D){var N=WebAssembly.instantiateStreaming(D,A);return N.then(g,function(F){return p("wasm streaming compile failed: "+F),p("falling back to ArrayBuffer instantiation"),Q(g)})}):Q(g)}if(G.instantiateWasm)try{var E=G.instantiateWasm(A,B);return E}catch(D){return p("Module.instantiateWasm callback failed with error: "+D),!1}return C().catch(T),{}}var M,X,og={567360:A=>{throw GA(A)}};function Ug(A){this.name="ExitStatus",this.message="Program terminated with exit("+A+")",this.status=A}function AB(A){for(;A.length>0;)A.shift()(G)}function Yg(){var A=new Error;if(!A.stack){try{throw new Error}catch(B){A=B}if(!A.stack)return"(no stack trace available)"}return A.stack.toString()}function ig(A,B,g="i8"){switch(g.endsWith("*")&&(g="*"),g){case"i1":W[A>>0]=B;break;case"i8":W[A>>0]=B;break;case"i16":hA[A>>1]=B;break;case"i32":R[A>>2]=B;break;case"i64":X=[B>>>0,(M=B,+Math.abs(M)>=1?M>0?(Math.min(+Math.floor(M/4294967296),4294967295)|0)>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],R[A>>2]=X[0],R[A+4>>2]=X[1];break;case"float":MA[A>>2]=B;break;case"double":kA[A>>3]=B;break;case"*":d[A>>2]=B;break;default:oA("invalid type for setValue: "+g)}}function wB(A,B){W.set(A,B)}function Rg(A){return EB(A+24)+24}var pA=[];function wg(A){A.add_ref()}var nA=0;function hg(A){var B=new JA(A);return B.get_caught()||(B.set_caught(!0),nA--),B.set_rethrown(!1),pA.push(B),wg(B),B.get_exception_ptr()}var UA=0;function JA(A){this.excPtr=A,this.ptr=A-24,this.set_type=function(B){d[this.ptr+4>>2]=B},this.get_type=function(){return d[this.ptr+4>>2]},this.set_destructor=function(B){d[this.ptr+8>>2]=B},this.get_destructor=function(){return d[this.ptr+8>>2]},this.set_refcount=function(B){R[this.ptr>>2]=B},this.set_caught=function(B){B=B?1:0,W[this.ptr+12>>0]=B},this.get_caught=function(){return W[this.ptr+12>>0]!=0},this.set_rethrown=function(B){B=B?1:0,W[this.ptr+13>>0]=B},this.get_rethrown=function(){return W[this.ptr+13>>0]!=0},this.init=function(B,g){this.set_adjusted_ptr(0),this.set_type(B),this.set_destructor(g),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var B=R[this.ptr>>2];R[this.ptr>>2]=B+1},this.release_ref=function(){var B=R[this.ptr>>2];return R[this.ptr>>2]=B-1,B===1},this.set_adjusted_ptr=function(B){d[this.ptr+16>>2]=B},this.get_adjusted_ptr=function(){return d[this.ptr+16>>2]},this.get_exception_ptr=function(){var B=xB(this.get_type());if(B)return d[this.excPtr>>2];var g=this.get_adjusted_ptr();return g!==0?g:this.excPtr}}function hB(A){try{return jB(new JA(A).ptr)}catch{}}function l(A){return LA.get(A)}function kg(A){if(A.release_ref()&&!A.get_rethrown()){var B=A.get_destructor();B&&l(B)(A.excPtr),hB(A.excPtr)}}function yg(){H(0);var A=pA.pop();kg(A),UA=0}function ag(A){throw UA||(UA=A),A}function Mg(){var A=UA;if(!A)return O(0),0;var B=new JA(A);B.set_adjusted_ptr(A);var g=B.get_type();if(!g)return O(0),A;for(var Q=Array.prototype.slice.call(arguments),C=0;C>2]=A,A}var m={isAbs:A=>A.charAt(0)==="/",splitPath:A=>{var B=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return B.exec(A).slice(1)},normalizeArray:(A,B)=>{for(var g=0,Q=A.length-1;Q>=0;Q--){var C=A[Q];C==="."?A.splice(Q,1):C===".."?(A.splice(Q,1),g++):g&&(A.splice(Q,1),g--)}if(B)for(;g;g--)A.unshift("..");return A},normalize:A=>{var B=m.isAbs(A),g=A.substr(-1)==="/";return A=m.normalizeArray(A.split("/").filter(Q=>!!Q),!B).join("/"),!A&&!B&&(A="."),A&&g&&(A+="/"),(B?"/":"")+A},dirname:A=>{var B=m.splitPath(A),g=B[0],Q=B[1];return!g&&!Q?".":(Q&&(Q=Q.substr(0,Q.length-1)),g+Q)},basename:A=>{if(A==="/")return"/";A=m.normalize(A),A=A.replace(/\/$/,"");var B=A.lastIndexOf("/");return B===-1?A:A.substr(B+1)},join:function(){var A=Array.prototype.slice.call(arguments,0);return m.normalize(A.join("/"))},join2:(A,B)=>m.normalize(A+"/"+B)};function Vg(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var A=new Uint8Array(1);return()=>(crypto.getRandomValues(A),A[0])}else return()=>oA("randomDevice")}var YA={resolve:function(){for(var A="",B=!1,g=arguments.length-1;g>=-1&&!B;g--){var Q=g>=0?arguments[g]:I.cwd();if(typeof Q!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!Q)return"";A=Q+"/"+A,B=m.isAbs(Q)}return A=m.normalizeArray(A.split("/").filter(C=>!!C),!B).join("/"),(B?"/":"")+A||"."},relative:(A,B)=>{A=YA.resolve(A).substr(1),B=YA.resolve(B).substr(1);function g(o){for(var h=0;h=0&&o[y]==="";y--);return h>y?[]:o.slice(h,y-h+1)}for(var Q=g(A.split("/")),C=g(B.split("/")),E=Math.min(Q.length,C.length),D=E,N=0;N0?g:e(A)+1,C=new Array(Q),E=aA(A,C,0,C.length);return B&&(C.length=E),C}var cA={ttys:[],init:function(){},shutdown:function(){},register:function(A,B){cA.ttys[A]={input:[],output:[],ops:B},I.registerDevice(A,cA.stream_ops)},stream_ops:{open:function(A){var B=cA.ttys[A.node.rdev];if(!B)throw new I.ErrnoError(43);A.tty=B,A.seekable=!1},close:function(A){A.tty.ops.fsync(A.tty)},fsync:function(A){A.tty.ops.fsync(A.tty)},read:function(A,B,g,Q,C){if(!A.tty||!A.tty.ops.get_char)throw new I.ErrnoError(60);for(var E=0,D=0;D0&&(wA(CA(A.output,0)),A.output=[])}},default_tty1_ops:{put_char:function(A,B){B===null||B===10?(p(CA(A.output,0)),A.output=[]):B!=0&&A.output.push(B)},fsync:function(A){A.output&&A.output.length>0&&(p(CA(A.output,0)),A.output=[])}}};function Zg(A,B){gA.fill(0,A,A+B)}function Wg(A,B){return Math.ceil(A/B)*B}function kB(A){A=Wg(A,65536);var B=qB(65536,A);return B?(Zg(B,A),B):0}var J={ops_table:null,mount:function(A){return J.createNode(null,"/",16895,0)},createNode:function(A,B,g,Q){if(I.isBlkdev(g)||I.isFIFO(g))throw new I.ErrnoError(63);J.ops_table||(J.ops_table={dir:{node:{getattr:J.node_ops.getattr,setattr:J.node_ops.setattr,lookup:J.node_ops.lookup,mknod:J.node_ops.mknod,rename:J.node_ops.rename,unlink:J.node_ops.unlink,rmdir:J.node_ops.rmdir,readdir:J.node_ops.readdir,symlink:J.node_ops.symlink},stream:{llseek:J.stream_ops.llseek}},file:{node:{getattr:J.node_ops.getattr,setattr:J.node_ops.setattr},stream:{llseek:J.stream_ops.llseek,read:J.stream_ops.read,write:J.stream_ops.write,allocate:J.stream_ops.allocate,mmap:J.stream_ops.mmap,msync:J.stream_ops.msync}},link:{node:{getattr:J.node_ops.getattr,setattr:J.node_ops.setattr,readlink:J.node_ops.readlink},stream:{}},chrdev:{node:{getattr:J.node_ops.getattr,setattr:J.node_ops.setattr},stream:I.chrdev_stream_ops}});var C=I.createNode(A,B,g,Q);return I.isDir(C.mode)?(C.node_ops=J.ops_table.dir.node,C.stream_ops=J.ops_table.dir.stream,C.contents={}):I.isFile(C.mode)?(C.node_ops=J.ops_table.file.node,C.stream_ops=J.ops_table.file.stream,C.usedBytes=0,C.contents=null):I.isLink(C.mode)?(C.node_ops=J.ops_table.link.node,C.stream_ops=J.ops_table.link.stream):I.isChrdev(C.mode)&&(C.node_ops=J.ops_table.chrdev.node,C.stream_ops=J.ops_table.chrdev.stream),C.timestamp=Date.now(),A&&(A.contents[B]=C,A.timestamp=C.timestamp),C},getFileDataAsTypedArray:function(A){return A.contents?A.contents.subarray?A.contents.subarray(0,A.usedBytes):new Uint8Array(A.contents):new Uint8Array(0)},expandFileStorage:function(A,B){var g=A.contents?A.contents.length:0;if(!(g>=B)){var Q=1024*1024;B=Math.max(B,g*(g>>0),g!=0&&(B=Math.max(B,256));var C=A.contents;A.contents=new Uint8Array(B),A.usedBytes>0&&A.contents.set(C.subarray(0,A.usedBytes),0)}},resizeFileStorage:function(A,B){if(A.usedBytes!=B)if(B==0)A.contents=null,A.usedBytes=0;else{var g=A.contents;A.contents=new Uint8Array(B),g&&A.contents.set(g.subarray(0,Math.min(B,A.usedBytes))),A.usedBytes=B}},node_ops:{getattr:function(A){var B={};return B.dev=I.isChrdev(A.mode)?A.id:1,B.ino=A.id,B.mode=A.mode,B.nlink=1,B.uid=0,B.gid=0,B.rdev=A.rdev,I.isDir(A.mode)?B.size=4096:I.isFile(A.mode)?B.size=A.usedBytes:I.isLink(A.mode)?B.size=A.link.length:B.size=0,B.atime=new Date(A.timestamp),B.mtime=new Date(A.timestamp),B.ctime=new Date(A.timestamp),B.blksize=4096,B.blocks=Math.ceil(B.size/B.blksize),B},setattr:function(A,B){B.mode!==void 0&&(A.mode=B.mode),B.timestamp!==void 0&&(A.timestamp=B.timestamp),B.size!==void 0&&J.resizeFileStorage(A,B.size)},lookup:function(A,B){throw I.genericErrors[44]},mknod:function(A,B,g,Q){return J.createNode(A,B,g,Q)},rename:function(A,B,g){if(I.isDir(A.mode)){var Q;try{Q=I.lookupNode(B,g)}catch{}if(Q)for(var C in Q.contents)throw new I.ErrnoError(55)}delete A.parent.contents[A.name],A.parent.timestamp=Date.now(),A.name=g,B.contents[g]=A,B.timestamp=A.parent.timestamp,A.parent=B},unlink:function(A,B){delete A.contents[B],A.timestamp=Date.now()},rmdir:function(A,B){var g=I.lookupNode(A,B);for(var Q in g.contents)throw new I.ErrnoError(55);delete A.contents[B],A.timestamp=Date.now()},readdir:function(A){var B=[".",".."];for(var g in A.contents)!A.contents.hasOwnProperty(g)||B.push(g);return B},symlink:function(A,B,g){var Q=J.createNode(A,B,41471,0);return Q.link=g,Q},readlink:function(A){if(!I.isLink(A.mode))throw new I.ErrnoError(28);return A.link}},stream_ops:{read:function(A,B,g,Q,C){var E=A.node.contents;if(C>=A.node.usedBytes)return 0;var D=Math.min(A.node.usedBytes-C,Q);if(D>8&&E.subarray)B.set(E.subarray(C,C+D),g);else for(var N=0;N0||g+B{$A(E,'Loading data file "'+A+'" failed (no arrayBuffer).'),B(new Uint8Array(E)),C&&lA()},E=>{if(g)g();else throw'Loading data file "'+A+'" failed.'}),C&&TA()}var I={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(A,B={})=>{if(A=YA.resolve(I.cwd(),A),!A)return{path:"",node:null};var g={follow_mount:!0,recurse_count:0};if(B=Object.assign(g,B),B.recurse_count>8)throw new I.ErrnoError(32);for(var Q=m.normalizeArray(A.split("/").filter(y=>!!y),!1),C=I.root,E="/",D=0;D40)throw new I.ErrnoError(32)}}return{path:E,node:C}},getPath:A=>{for(var B;;){if(I.isRoot(A)){var g=A.mount.mountpoint;return B?g[g.length-1]!=="/"?g+"/"+B:g+B:g}B=B?A.name+"/"+B:A.name,A=A.parent}},hashName:(A,B)=>{for(var g=0,Q=0;Q>>0)%I.nameTable.length},hashAddNode:A=>{var B=I.hashName(A.parent.id,A.name);A.name_next=I.nameTable[B],I.nameTable[B]=A},hashRemoveNode:A=>{var B=I.hashName(A.parent.id,A.name);if(I.nameTable[B]===A)I.nameTable[B]=A.name_next;else for(var g=I.nameTable[B];g;){if(g.name_next===A){g.name_next=A.name_next;break}g=g.name_next}},lookupNode:(A,B)=>{var g=I.mayLookup(A);if(g)throw new I.ErrnoError(g,A);for(var Q=I.hashName(A.id,B),C=I.nameTable[Q];C;C=C.name_next){var E=C.name;if(C.parent.id===A.id&&E===B)return C}return I.lookup(A,B)},createNode:(A,B,g,Q)=>{var C=new I.FSNode(A,B,g,Q);return I.hashAddNode(C),C},destroyNode:A=>{I.hashRemoveNode(A)},isRoot:A=>A===A.parent,isMountpoint:A=>!!A.mounted,isFile:A=>(A&61440)===32768,isDir:A=>(A&61440)===16384,isLink:A=>(A&61440)===40960,isChrdev:A=>(A&61440)===8192,isBlkdev:A=>(A&61440)===24576,isFIFO:A=>(A&61440)===4096,isSocket:A=>(A&49152)===49152,flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:A=>{var B=I.flagModes[A];if(typeof B>"u")throw new Error("Unknown file open mode: "+A);return B},flagsToPermissionString:A=>{var B=["r","w","rw"][A&3];return A&512&&(B+="w"),B},nodePermissions:(A,B)=>I.ignorePermissions?0:B.includes("r")&&!(A.mode&292)||B.includes("w")&&!(A.mode&146)||B.includes("x")&&!(A.mode&73)?2:0,mayLookup:A=>{var B=I.nodePermissions(A,"x");return B||(A.node_ops.lookup?0:2)},mayCreate:(A,B)=>{try{var g=I.lookupNode(A,B);return 20}catch{}return I.nodePermissions(A,"wx")},mayDelete:(A,B,g)=>{var Q;try{Q=I.lookupNode(A,B)}catch(E){return E.errno}var C=I.nodePermissions(A,"wx");if(C)return C;if(g){if(!I.isDir(Q.mode))return 54;if(I.isRoot(Q)||I.getPath(Q)===I.cwd())return 10}else if(I.isDir(Q.mode))return 31;return 0},mayOpen:(A,B)=>A?I.isLink(A.mode)?32:I.isDir(A.mode)&&(I.flagsToPermissionString(B)!=="r"||B&512)?31:I.nodePermissions(A,I.flagsToPermissionString(B)):44,MAX_OPEN_FDS:4096,nextfd:(A=0,B=I.MAX_OPEN_FDS)=>{for(var g=A;g<=B;g++)if(!I.streams[g])return g;throw new I.ErrnoError(33)},getStream:A=>I.streams[A],createStream:(A,B,g)=>{I.FSStream||(I.FSStream=function(){this.shared={}},I.FSStream.prototype={},Object.defineProperties(I.FSStream.prototype,{object:{get:function(){return this.node},set:function(C){this.node=C}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}},flags:{get:function(){return this.shared.flags},set:function(C){this.shared.flags=C}},position:{get:function(){return this.shared.position},set:function(C){this.shared.position=C}}})),A=Object.assign(new I.FSStream,A);var Q=I.nextfd(B,g);return A.fd=Q,I.streams[Q]=A,A},closeStream:A=>{I.streams[A]=null},chrdev_stream_ops:{open:A=>{var B=I.getDevice(A.node.rdev);A.stream_ops=B.stream_ops,A.stream_ops.open&&A.stream_ops.open(A)},llseek:()=>{throw new I.ErrnoError(70)}},major:A=>A>>8,minor:A=>A&255,makedev:(A,B)=>A<<8|B,registerDevice:(A,B)=>{I.devices[A]={stream_ops:B}},getDevice:A=>I.devices[A],getMounts:A=>{for(var B=[],g=[A];g.length;){var Q=g.pop();B.push(Q),g.push.apply(g,Q.mounts)}return B},syncfs:(A,B)=>{typeof A=="function"&&(B=A,A=!1),I.syncFSRequests++,I.syncFSRequests>1&&p("warning: "+I.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var g=I.getMounts(I.root.mount),Q=0;function C(D){return I.syncFSRequests--,B(D)}function E(D){if(D)return E.errored?void 0:(E.errored=!0,C(D));++Q>=g.length&&C(null)}g.forEach(D=>{if(!D.type.syncfs)return E(null);D.type.syncfs(D,A,E)})},mount:(A,B,g)=>{var Q=g==="/",C=!g,E;if(Q&&I.root)throw new I.ErrnoError(10);if(!Q&&!C){var D=I.lookupPath(g,{follow_mount:!1});if(g=D.path,E=D.node,I.isMountpoint(E))throw new I.ErrnoError(10);if(!I.isDir(E.mode))throw new I.ErrnoError(54)}var N={type:A,opts:B,mountpoint:g,mounts:[]},F=A.mount(N);return F.mount=N,N.root=F,Q?I.root=F:E&&(E.mounted=N,E.mount&&E.mount.mounts.push(N)),F},unmount:A=>{var B=I.lookupPath(A,{follow_mount:!1});if(!I.isMountpoint(B.node))throw new I.ErrnoError(28);var g=B.node,Q=g.mounted,C=I.getMounts(Q);Object.keys(I.nameTable).forEach(D=>{for(var N=I.nameTable[D];N;){var F=N.name_next;C.includes(N.mount)&&I.destroyNode(N),N=F}}),g.mounted=null;var E=g.mount.mounts.indexOf(Q);g.mount.mounts.splice(E,1)},lookup:(A,B)=>A.node_ops.lookup(A,B),mknod:(A,B,g)=>{var Q=I.lookupPath(A,{parent:!0}),C=Q.node,E=m.basename(A);if(!E||E==="."||E==="..")throw new I.ErrnoError(28);var D=I.mayCreate(C,E);if(D)throw new I.ErrnoError(D);if(!C.node_ops.mknod)throw new I.ErrnoError(63);return C.node_ops.mknod(C,E,B,g)},create:(A,B)=>(B=B!==void 0?B:438,B&=4095,B|=32768,I.mknod(A,B,0)),mkdir:(A,B)=>(B=B!==void 0?B:511,B&=1023,B|=16384,I.mknod(A,B,0)),mkdirTree:(A,B)=>{for(var g=A.split("/"),Q="",C=0;C(typeof g>"u"&&(g=B,B=438),B|=8192,I.mknod(A,B,g)),symlink:(A,B)=>{if(!YA.resolve(A))throw new I.ErrnoError(44);var g=I.lookupPath(B,{parent:!0}),Q=g.node;if(!Q)throw new I.ErrnoError(44);var C=m.basename(B),E=I.mayCreate(Q,C);if(E)throw new I.ErrnoError(E);if(!Q.node_ops.symlink)throw new I.ErrnoError(63);return Q.node_ops.symlink(Q,C,A)},rename:(A,B)=>{var g=m.dirname(A),Q=m.dirname(B),C=m.basename(A),E=m.basename(B),D,N,F;if(D=I.lookupPath(A,{parent:!0}),N=D.node,D=I.lookupPath(B,{parent:!0}),F=D.node,!N||!F)throw new I.ErrnoError(44);if(N.mount!==F.mount)throw new I.ErrnoError(75);var o=I.lookupNode(N,C),h=YA.relative(A,Q);if(h.charAt(0)!==".")throw new I.ErrnoError(28);if(h=YA.relative(B,g),h.charAt(0)!==".")throw new I.ErrnoError(55);var y;try{y=I.lookupNode(F,E)}catch{}if(o!==y){var Y=I.isDir(o.mode),i=I.mayDelete(N,C,Y);if(i)throw new I.ErrnoError(i);if(i=y?I.mayDelete(F,E,Y):I.mayCreate(F,E),i)throw new I.ErrnoError(i);if(!N.node_ops.rename)throw new I.ErrnoError(63);if(I.isMountpoint(o)||y&&I.isMountpoint(y))throw new I.ErrnoError(10);if(F!==N&&(i=I.nodePermissions(N,"w"),i))throw new I.ErrnoError(i);I.hashRemoveNode(o);try{N.node_ops.rename(o,F,E)}catch(k){throw k}finally{I.hashAddNode(o)}}},rmdir:A=>{var B=I.lookupPath(A,{parent:!0}),g=B.node,Q=m.basename(A),C=I.lookupNode(g,Q),E=I.mayDelete(g,Q,!0);if(E)throw new I.ErrnoError(E);if(!g.node_ops.rmdir)throw new I.ErrnoError(63);if(I.isMountpoint(C))throw new I.ErrnoError(10);g.node_ops.rmdir(g,Q),I.destroyNode(C)},readdir:A=>{var B=I.lookupPath(A,{follow:!0}),g=B.node;if(!g.node_ops.readdir)throw new I.ErrnoError(54);return g.node_ops.readdir(g)},unlink:A=>{var B=I.lookupPath(A,{parent:!0}),g=B.node;if(!g)throw new I.ErrnoError(44);var Q=m.basename(A),C=I.lookupNode(g,Q),E=I.mayDelete(g,Q,!1);if(E)throw new I.ErrnoError(E);if(!g.node_ops.unlink)throw new I.ErrnoError(63);if(I.isMountpoint(C))throw new I.ErrnoError(10);g.node_ops.unlink(g,Q),I.destroyNode(C)},readlink:A=>{var B=I.lookupPath(A),g=B.node;if(!g)throw new I.ErrnoError(44);if(!g.node_ops.readlink)throw new I.ErrnoError(28);return YA.resolve(I.getPath(g.parent),g.node_ops.readlink(g))},stat:(A,B)=>{var g=I.lookupPath(A,{follow:!B}),Q=g.node;if(!Q)throw new I.ErrnoError(44);if(!Q.node_ops.getattr)throw new I.ErrnoError(63);return Q.node_ops.getattr(Q)},lstat:A=>I.stat(A,!0),chmod:(A,B,g)=>{var Q;if(typeof A=="string"){var C=I.lookupPath(A,{follow:!g});Q=C.node}else Q=A;if(!Q.node_ops.setattr)throw new I.ErrnoError(63);Q.node_ops.setattr(Q,{mode:B&4095|Q.mode&-4096,timestamp:Date.now()})},lchmod:(A,B)=>{I.chmod(A,B,!0)},fchmod:(A,B)=>{var g=I.getStream(A);if(!g)throw new I.ErrnoError(8);I.chmod(g.node,B)},chown:(A,B,g,Q)=>{var C;if(typeof A=="string"){var E=I.lookupPath(A,{follow:!Q});C=E.node}else C=A;if(!C.node_ops.setattr)throw new I.ErrnoError(63);C.node_ops.setattr(C,{timestamp:Date.now()})},lchown:(A,B,g)=>{I.chown(A,B,g,!0)},fchown:(A,B,g)=>{var Q=I.getStream(A);if(!Q)throw new I.ErrnoError(8);I.chown(Q.node,B,g)},truncate:(A,B)=>{if(B<0)throw new I.ErrnoError(28);var g;if(typeof A=="string"){var Q=I.lookupPath(A,{follow:!0});g=Q.node}else g=A;if(!g.node_ops.setattr)throw new I.ErrnoError(63);if(I.isDir(g.mode))throw new I.ErrnoError(31);if(!I.isFile(g.mode))throw new I.ErrnoError(28);var C=I.nodePermissions(g,"w");if(C)throw new I.ErrnoError(C);g.node_ops.setattr(g,{size:B,timestamp:Date.now()})},ftruncate:(A,B)=>{var g=I.getStream(A);if(!g)throw new I.ErrnoError(8);if((g.flags&2097155)===0)throw new I.ErrnoError(28);I.truncate(g.node,B)},utime:(A,B,g)=>{var Q=I.lookupPath(A,{follow:!0}),C=Q.node;C.node_ops.setattr(C,{timestamp:Math.max(B,g)})},open:(A,B,g)=>{if(A==="")throw new I.ErrnoError(44);B=typeof B=="string"?I.modeStringToFlags(B):B,g=typeof g>"u"?438:g,B&64?g=g&4095|32768:g=0;var Q;if(typeof A=="object")Q=A;else{A=m.normalize(A);try{var C=I.lookupPath(A,{follow:!(B&131072)});Q=C.node}catch{}}var E=!1;if(B&64)if(Q){if(B&128)throw new I.ErrnoError(20)}else Q=I.mknod(A,g,0),E=!0;if(!Q)throw new I.ErrnoError(44);if(I.isChrdev(Q.mode)&&(B&=-513),B&65536&&!I.isDir(Q.mode))throw new I.ErrnoError(54);if(!E){var D=I.mayOpen(Q,B);if(D)throw new I.ErrnoError(D)}B&512&&!E&&I.truncate(Q,0),B&=-131713;var N=I.createStream({node:Q,path:I.getPath(Q),flags:B,seekable:!0,position:0,stream_ops:Q.stream_ops,ungotten:[],error:!1});return N.stream_ops.open&&N.stream_ops.open(N),G.logReadFiles&&!(B&1)&&(I.readFiles||(I.readFiles={}),A in I.readFiles||(I.readFiles[A]=1)),N},close:A=>{if(I.isClosed(A))throw new I.ErrnoError(8);A.getdents&&(A.getdents=null);try{A.stream_ops.close&&A.stream_ops.close(A)}catch(B){throw B}finally{I.closeStream(A.fd)}A.fd=null},isClosed:A=>A.fd===null,llseek:(A,B,g)=>{if(I.isClosed(A))throw new I.ErrnoError(8);if(!A.seekable||!A.stream_ops.llseek)throw new I.ErrnoError(70);if(g!=0&&g!=1&&g!=2)throw new I.ErrnoError(28);return A.position=A.stream_ops.llseek(A,B,g),A.ungotten=[],A.position},read:(A,B,g,Q,C)=>{if(Q<0||C<0)throw new I.ErrnoError(28);if(I.isClosed(A))throw new I.ErrnoError(8);if((A.flags&2097155)===1)throw new I.ErrnoError(8);if(I.isDir(A.node.mode))throw new I.ErrnoError(31);if(!A.stream_ops.read)throw new I.ErrnoError(28);var E=typeof C<"u";if(!E)C=A.position;else if(!A.seekable)throw new I.ErrnoError(70);var D=A.stream_ops.read(A,B,g,Q,C);return E||(A.position+=D),D},write:(A,B,g,Q,C,E)=>{if(Q<0||C<0)throw new I.ErrnoError(28);if(I.isClosed(A))throw new I.ErrnoError(8);if((A.flags&2097155)===0)throw new I.ErrnoError(8);if(I.isDir(A.node.mode))throw new I.ErrnoError(31);if(!A.stream_ops.write)throw new I.ErrnoError(28);A.seekable&&A.flags&1024&&I.llseek(A,0,2);var D=typeof C<"u";if(!D)C=A.position;else if(!A.seekable)throw new I.ErrnoError(70);var N=A.stream_ops.write(A,B,g,Q,C,E);return D||(A.position+=N),N},allocate:(A,B,g)=>{if(I.isClosed(A))throw new I.ErrnoError(8);if(B<0||g<=0)throw new I.ErrnoError(28);if((A.flags&2097155)===0)throw new I.ErrnoError(8);if(!I.isFile(A.node.mode)&&!I.isDir(A.node.mode))throw new I.ErrnoError(43);if(!A.stream_ops.allocate)throw new I.ErrnoError(138);A.stream_ops.allocate(A,B,g)},mmap:(A,B,g,Q,C)=>{if((Q&2)!==0&&(C&2)===0&&(A.flags&2097155)!==2)throw new I.ErrnoError(2);if((A.flags&2097155)===1)throw new I.ErrnoError(2);if(!A.stream_ops.mmap)throw new I.ErrnoError(43);return A.stream_ops.mmap(A,B,g,Q,C)},msync:(A,B,g,Q,C)=>!A||!A.stream_ops.msync?0:A.stream_ops.msync(A,B,g,Q,C),munmap:A=>0,ioctl:(A,B,g)=>{if(!A.stream_ops.ioctl)throw new I.ErrnoError(59);return A.stream_ops.ioctl(A,B,g)},readFile:(A,B={})=>{if(B.flags=B.flags||0,B.encoding=B.encoding||"binary",B.encoding!=="utf8"&&B.encoding!=="binary")throw new Error('Invalid encoding type "'+B.encoding+'"');var g,Q=I.open(A,B.flags),C=I.stat(A),E=C.size,D=new Uint8Array(E);return I.read(Q,D,0,E,0),B.encoding==="utf8"?g=CA(D,0):B.encoding==="binary"&&(g=D),I.close(Q),g},writeFile:(A,B,g={})=>{g.flags=g.flags||577;var Q=I.open(A,g.flags,g.mode);if(typeof B=="string"){var C=new Uint8Array(e(B)+1),E=aA(B,C,0,C.length);I.write(Q,C,0,E,void 0,g.canOwn)}else if(ArrayBuffer.isView(B))I.write(Q,B,0,B.byteLength,void 0,g.canOwn);else throw new Error("Unsupported data type");I.close(Q)},cwd:()=>I.currentPath,chdir:A=>{var B=I.lookupPath(A,{follow:!0});if(B.node===null)throw new I.ErrnoError(44);if(!I.isDir(B.node.mode))throw new I.ErrnoError(54);var g=I.nodePermissions(B.node,"x");if(g)throw new I.ErrnoError(g);I.currentPath=B.path},createDefaultDirectories:()=>{I.mkdir("/tmp"),I.mkdir("/home"),I.mkdir("/home/web_user")},createDefaultDevices:()=>{I.mkdir("/dev"),I.registerDevice(I.makedev(1,3),{read:()=>0,write:(B,g,Q,C,E)=>C}),I.mkdev("/dev/null",I.makedev(1,3)),cA.register(I.makedev(5,0),cA.default_tty_ops),cA.register(I.makedev(6,0),cA.default_tty1_ops),I.mkdev("/dev/tty",I.makedev(5,0)),I.mkdev("/dev/tty1",I.makedev(6,0));var A=Vg();I.createDevice("/dev","random",A),I.createDevice("/dev","urandom",A),I.mkdir("/dev/shm"),I.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{I.mkdir("/proc");var A=I.mkdir("/proc/self");I.mkdir("/proc/self/fd"),I.mount({mount:()=>{var B=I.createNode(A,"fd",16895,73);return B.node_ops={lookup:(g,Q)=>{var C=+Q,E=I.getStream(C);if(!E)throw new I.ErrnoError(8);var D={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>E.path}};return D.parent=D,D}},B}},{},"/proc/self/fd")},createStandardStreams:()=>{G.stdin?I.createDevice("/dev","stdin",G.stdin):I.symlink("/dev/tty","/dev/stdin"),G.stdout?I.createDevice("/dev","stdout",null,G.stdout):I.symlink("/dev/tty","/dev/stdout"),G.stderr?I.createDevice("/dev","stderr",null,G.stderr):I.symlink("/dev/tty1","/dev/stderr"),I.open("/dev/stdin",0),I.open("/dev/stdout",1),I.open("/dev/stderr",1)},ensureErrnoError:()=>{I.ErrnoError||(I.ErrnoError=function(B,g){this.node=g,this.setErrno=function(Q){this.errno=Q},this.setErrno(B),this.message="FS error"},I.ErrnoError.prototype=new Error,I.ErrnoError.prototype.constructor=I.ErrnoError,[44].forEach(A=>{I.genericErrors[A]=new I.ErrnoError(A),I.genericErrors[A].stack=""}))},staticInit:()=>{I.ensureErrnoError(),I.nameTable=new Array(4096),I.mount(J,{},"/"),I.createDefaultDirectories(),I.createDefaultDevices(),I.createSpecialDirectories(),I.filesystems={MEMFS:J}},init:(A,B,g)=>{I.init.initialized=!0,I.ensureErrnoError(),G.stdin=A||G.stdin,G.stdout=B||G.stdout,G.stderr=g||G.stderr,I.createStandardStreams()},quit:()=>{I.init.initialized=!1;for(var A=0;A{var g=0;return A&&(g|=365),B&&(g|=146),g},findObject:(A,B)=>{var g=I.analyzePath(A,B);return g.exists?g.object:null},analyzePath:(A,B)=>{try{var g=I.lookupPath(A,{follow:!B});A=g.path}catch{}var Q={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var g=I.lookupPath(A,{parent:!0});Q.parentExists=!0,Q.parentPath=g.path,Q.parentObject=g.node,Q.name=m.basename(A),g=I.lookupPath(A,{follow:!B}),Q.exists=!0,Q.path=g.path,Q.object=g.node,Q.name=g.node.name,Q.isRoot=g.path==="/"}catch(C){Q.error=C.errno}return Q},createPath:(A,B,g,Q)=>{A=typeof A=="string"?A:I.getPath(A);for(var C=B.split("/").reverse();C.length;){var E=C.pop();if(!!E){var D=m.join2(A,E);try{I.mkdir(D)}catch{}A=D}}return D},createFile:(A,B,g,Q,C)=>{var E=m.join2(typeof A=="string"?A:I.getPath(A),B),D=I.getMode(Q,C);return I.create(E,D)},createDataFile:(A,B,g,Q,C,E)=>{var D=B;A&&(A=typeof A=="string"?A:I.getPath(A),D=B?m.join2(A,B):A);var N=I.getMode(Q,C),F=I.create(D,N);if(g){if(typeof g=="string"){for(var o=new Array(g.length),h=0,y=g.length;h{var C=m.join2(typeof A=="string"?A:I.getPath(A),B),E=I.getMode(!!g,!!Q);I.createDevice.major||(I.createDevice.major=64);var D=I.makedev(I.createDevice.major++,0);return I.registerDevice(D,{open:N=>{N.seekable=!1},close:N=>{Q&&Q.buffer&&Q.buffer.length&&Q(10)},read:(N,F,o,h,y)=>{for(var Y=0,i=0;i{for(var Y=0;Y{if(A.isDevice||A.isFolder||A.link||A.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(r)try{A.contents=qA(r(A.url),!0),A.usedBytes=A.contents.length}catch{throw new I.ErrnoError(29)}else throw new Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile:(A,B,g,Q,C)=>{function E(){this.lengthKnown=!1,this.chunks=[]}if(E.prototype.get=function(i){if(!(i>this.length-1||i<0)){var k=i%this.chunkSize,Z=i/this.chunkSize|0;return this.getter(Z)[k]}},E.prototype.setDataGetter=function(i){this.getter=i},E.prototype.cacheLength=function(){var i=new XMLHttpRequest;if(i.open("HEAD",g,!1),i.send(null),!(i.status>=200&&i.status<300||i.status===304))throw new Error("Couldn't load "+g+". Status: "+i.status);var k=Number(i.getResponseHeader("Content-length")),Z,c=(Z=i.getResponseHeader("Accept-Ranges"))&&Z==="bytes",q=(Z=i.getResponseHeader("Content-Encoding"))&&Z==="gzip",U=1024*1024;c||(U=k);var a=(x,BA)=>{if(x>BA)throw new Error("invalid range ("+x+", "+BA+") or no bytes requested!");if(BA>k-1)throw new Error("only "+k+" bytes available! programmer error!");var w=new XMLHttpRequest;if(w.open("GET",g,!1),k!==U&&w.setRequestHeader("Range","bytes="+x+"-"+BA),w.responseType="arraybuffer",w.overrideMimeType&&w.overrideMimeType("text/plain; charset=x-user-defined"),w.send(null),!(w.status>=200&&w.status<300||w.status===304))throw new Error("Couldn't load "+g+". Status: "+w.status);return w.response!==void 0?new Uint8Array(w.response||[]):qA(w.responseText||"",!0)},V=this;V.setDataGetter(x=>{var BA=x*U,w=(x+1)*U-1;if(w=Math.min(w,k-1),typeof V.chunks[x]>"u"&&(V.chunks[x]=a(BA,w)),typeof V.chunks[x]>"u")throw new Error("doXHR failed!");return V.chunks[x]}),(q||!k)&&(U=k=1,k=this.getter(0).length,U=k,wA("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=k,this._chunkSize=U,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var D,N}else var N={isDevice:!1,url:g};var F=I.createFile(A,B,N,Q,C);N.contents?F.contents=N.contents:N.url&&(F.contents=null,F.url=N.url),Object.defineProperties(F,{usedBytes:{get:function(){return this.contents.length}}});var o={},h=Object.keys(F.stream_ops);h.forEach(Y=>{var i=F.stream_ops[Y];o[Y]=function(){return I.forceLoadFile(F),i.apply(null,arguments)}});function y(Y,i,k,Z,c){var q=Y.node.contents;if(c>=q.length)return 0;var U=Math.min(q.length-c,Z);if(q.slice)for(var a=0;a(I.forceLoadFile(F),y(Y,i,k,Z,c)),o.mmap=(Y,i,k,Z,c)=>{I.forceLoadFile(F);var q=kB(i);if(!q)throw new I.ErrnoError(48);return y(Y,W,q,i,k),{ptr:q,allocated:!0}},F.stream_ops=o,F},createPreloadedFile:(A,B,g,Q,C,E,D,N,F,o)=>{var h=B?YA.resolve(m.join2(A,B)):A;function y(Y){function i(k){o&&o(),N||I.createDataFile(A,B,k,Q,C,F),E&&E(),lA()}Browser.handledByPreloadPlugin(Y,h,i,()=>{D&&D(),lA()})||i(Y)}TA(),typeof g=="string"?dg(g,Y=>y(Y),D):y(g)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(A,B,g)=>{B=B||(()=>{}),g=g||(()=>{});var Q=I.indexedDB();try{var C=Q.open(I.DB_NAME(),I.DB_VERSION)}catch(E){return g(E)}C.onupgradeneeded=()=>{wA("creating db");var E=C.result;E.createObjectStore(I.DB_STORE_NAME)},C.onsuccess=()=>{var E=C.result,D=E.transaction([I.DB_STORE_NAME],"readwrite"),N=D.objectStore(I.DB_STORE_NAME),F=0,o=0,h=A.length;function y(){o==0?B():g()}A.forEach(Y=>{var i=N.put(I.analyzePath(Y).object.contents,Y);i.onsuccess=()=>{F++,F+o==h&&y()},i.onerror=()=>{o++,F+o==h&&y()}}),D.onerror=g},C.onerror=g},loadFilesFromDB:(A,B,g)=>{B=B||(()=>{}),g=g||(()=>{});var Q=I.indexedDB();try{var C=Q.open(I.DB_NAME(),I.DB_VERSION)}catch(E){return g(E)}C.onupgradeneeded=g,C.onsuccess=()=>{var E=C.result;try{var D=E.transaction([I.DB_STORE_NAME],"readonly")}catch(Y){g(Y);return}var N=D.objectStore(I.DB_STORE_NAME),F=0,o=0,h=A.length;function y(){o==0?B():g()}A.forEach(Y=>{var i=N.get(Y);i.onsuccess=()=>{I.analyzePath(Y).exists&&I.unlink(Y),I.createDataFile(m.dirname(Y),m.basename(Y),i.result,!0,!0,!0),F++,F+o==h&&y()},i.onerror=()=>{o++,F+o==h&&y()}}),D.onerror=g},C.onerror=g}},j={DEFAULT_POLLMASK:5,calculateAt:function(A,B,g){if(m.isAbs(B))return B;var Q;if(A===-100)Q=I.cwd();else{var C=I.getStream(A);if(!C)throw new I.ErrnoError(8);Q=C.path}if(B.length==0){if(!g)throw new I.ErrnoError(44);return Q}return m.join2(Q,B)},doStat:function(A,B,g){try{var Q=A(B)}catch(C){if(C&&C.node&&m.normalize(B)!==m.normalize(I.getPath(C.node)))return-54;throw C}return R[g>>2]=Q.dev,R[g+8>>2]=Q.ino,R[g+12>>2]=Q.mode,R[g+16>>2]=Q.nlink,R[g+20>>2]=Q.uid,R[g+24>>2]=Q.gid,R[g+28>>2]=Q.rdev,X=[Q.size>>>0,(M=Q.size,+Math.abs(M)>=1?M>0?(Math.min(+Math.floor(M/4294967296),4294967295)|0)>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],R[g+40>>2]=X[0],R[g+44>>2]=X[1],R[g+48>>2]=4096,R[g+52>>2]=Q.blocks,X=[Math.floor(Q.atime.getTime()/1e3)>>>0,(M=Math.floor(Q.atime.getTime()/1e3),+Math.abs(M)>=1?M>0?(Math.min(+Math.floor(M/4294967296),4294967295)|0)>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],R[g+56>>2]=X[0],R[g+60>>2]=X[1],R[g+64>>2]=0,X=[Math.floor(Q.mtime.getTime()/1e3)>>>0,(M=Math.floor(Q.mtime.getTime()/1e3),+Math.abs(M)>=1?M>0?(Math.min(+Math.floor(M/4294967296),4294967295)|0)>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],R[g+72>>2]=X[0],R[g+76>>2]=X[1],R[g+80>>2]=0,X=[Math.floor(Q.ctime.getTime()/1e3)>>>0,(M=Math.floor(Q.ctime.getTime()/1e3),+Math.abs(M)>=1?M>0?(Math.min(+Math.floor(M/4294967296),4294967295)|0)>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],R[g+88>>2]=X[0],R[g+92>>2]=X[1],R[g+96>>2]=0,X=[Q.ino>>>0,(M=Q.ino,+Math.abs(M)>=1?M>0?(Math.min(+Math.floor(M/4294967296),4294967295)|0)>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],R[g+104>>2]=X[0],R[g+108>>2]=X[1],0},doMsync:function(A,B,g,Q,C){var E=gA.slice(A,A+g);I.msync(B,E,C,g,Q)},varargs:void 0,get:function(){j.varargs+=4;var A=R[j.varargs-4>>2];return A},getStr:function(A){var B=GA(A);return B},getStreamFromFD:function(A){var B=I.getStream(A);if(!B)throw new I.ErrnoError(8);return B}};function mg(A,B,g){j.varargs=g;try{var Q=j.getStreamFromFD(A);switch(B){case 0:{var C=j.get();if(C<0)return-28;var E;return E=I.createStream(Q,C),E.fd}case 1:case 2:return 0;case 3:return Q.flags;case 4:{var C=j.get();return Q.flags|=C,0}case 5:{var C=j.get(),D=0;return hA[C+D>>1]=2,0}case 6:case 7:return 0;case 16:case 8:return-28;case 9:return Lg(28),-1;default:return-28}}catch(N){if(typeof I>"u"||!(N instanceof I.ErrnoError))throw N;return-N.errno}}function jg(A,B){try{var g=j.getStreamFromFD(A);return j.doStat(I.stat,g.path,B)}catch(Q){if(typeof I>"u"||!(Q instanceof I.ErrnoError))throw Q;return-Q.errno}}function lg(A,B){try{if(B===0)return-28;var g=I.cwd(),Q=e(g)+1;return B"u"||!(C instanceof I.ErrnoError))throw C;return-C.errno}}function qg(A,B,g){try{var Q=j.getStreamFromFD(A);Q.getdents||(Q.getdents=I.readdir(Q.path));for(var C=280,E=0,D=I.llseek(Q,0,1),N=Math.floor(D/C);N>>0,(M=F,+Math.abs(M)>=1?M>0?(Math.min(+Math.floor(M/4294967296),4294967295)|0)>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],R[B+E>>2]=X[0],R[B+E+4>>2]=X[1],X=[(N+1)*C>>>0,(M=(N+1)*C,+Math.abs(M)>=1?M>0?(Math.min(+Math.floor(M/4294967296),4294967295)|0)>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],R[B+E+8>>2]=X[0],R[B+E+12>>2]=X[1],hA[B+E+16>>1]=280,W[B+E+18>>0]=o,KA(h,B+E+19,256),E+=C,N+=1}return I.llseek(Q,N*C,0),E}catch(i){if(typeof I>"u"||!(i instanceof I.ErrnoError))throw i;return-i.errno}}function xg(A,B,g){j.varargs=g;try{var Q=j.getStreamFromFD(A);switch(B){case 21509:case 21505:return Q.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return Q.tty?0:-59;case 21519:{if(!Q.tty)return-59;var C=j.get();return R[C>>2]=0,0}case 21520:return Q.tty?-28:-59;case 21531:{var C=j.get();return I.ioctl(Q,B,C)}case 21523:return Q.tty?0:-59;case 21524:return Q.tty?0:-59;default:return-28}}catch(E){if(typeof I>"u"||!(E instanceof I.ErrnoError))throw E;return-E.errno}}function bg(A,B){try{return A=j.getStr(A),j.doStat(I.lstat,A,B)}catch(g){if(typeof I>"u"||!(g instanceof I.ErrnoError))throw g;return-g.errno}}function Xg(A,B,g,Q){try{B=j.getStr(B);var C=Q&256,E=Q&4096;return Q=Q&-4353,B=j.calculateAt(A,B,E),j.doStat(C?I.lstat:I.stat,B,g)}catch(D){if(typeof I>"u"||!(D instanceof I.ErrnoError))throw D;return-D.errno}}function fg(A,B,g,Q){j.varargs=Q;try{B=j.getStr(B),B=j.calculateAt(A,B);var C=Q?j.get():0;return I.open(B,g,C).fd}catch(E){if(typeof I>"u"||!(E instanceof I.ErrnoError))throw E;return-E.errno}}function tg(A,B,g,Q){try{if(B=j.getStr(B),B=j.calculateAt(A,B),Q<=0)return-28;var C=I.readlink(B),E=Math.min(Q,e(C)),D=W[g+E];return KA(C,g,Q+1),W[g+E]=D,E}catch(N){if(typeof I>"u"||!(N instanceof I.ErrnoError))throw N;return-N.errno}}function Tg(A,B){try{return A=j.getStr(A),j.doStat(I.stat,A,B)}catch(g){if(typeof I>"u"||!(g instanceof I.ErrnoError))throw g;return-g.errno}}function pg(){return Date.now()}function ng(A){do{var B=d[A>>2];A+=4;var g=d[A>>2];A+=4;var Q=d[A>>2];A+=4;var C=GA(B);I.createPath("/",m.dirname(C),!0,!0),I.createDataFile(C,null,W.subarray(Q,Q+g),!0,!0,!0)}while(d[A>>2])}var zg=!0;function rg(){return zg}function yB(A){return d[A>>2]+R[A+4>>2]*4294967296}function eg(A,B){var g=new Date(yB(A)*1e3);R[B>>2]=g.getUTCSeconds(),R[B+4>>2]=g.getUTCMinutes(),R[B+8>>2]=g.getUTCHours(),R[B+12>>2]=g.getUTCDate(),R[B+16>>2]=g.getUTCMonth(),R[B+20>>2]=g.getUTCFullYear()-1900,R[B+24>>2]=g.getUTCDay();var Q=Date.UTC(g.getUTCFullYear(),0,1,0,0,0,0),C=(g.getTime()-Q)/(1e3*60*60*24)|0;R[B+28>>2]=C}function Og(A,B){var g=new Date(yB(A)*1e3);R[B>>2]=g.getSeconds(),R[B+4>>2]=g.getMinutes(),R[B+8>>2]=g.getHours(),R[B+12>>2]=g.getDate(),R[B+16>>2]=g.getMonth(),R[B+20>>2]=g.getFullYear()-1900,R[B+24>>2]=g.getDay();var Q=new Date(g.getFullYear(),0,1),C=(g.getTime()-Q.getTime())/(1e3*60*60*24)|0;R[B+28>>2]=C,R[B+36>>2]=-(g.getTimezoneOffset()*60);var E=new Date(g.getFullYear(),6,1).getTimezoneOffset(),D=Q.getTimezoneOffset(),N=(E!=D&&g.getTimezoneOffset()==Math.min(D,E))|0;R[B+32>>2]=N}function vg(A,B,g,Q,C,E){try{var D=I.getStream(C);D&&(g&2&&j.doMsync(A,D,B,Q,E),I.munmap(D))}catch(N){if(typeof I>"u"||!(N instanceof I.ErrnoError))throw N;return-N.errno}}function aB(A){var B=e(A)+1,g=EB(B);return g&&aA(A,W,g,B),g}function ug(A,B,g){var Q=new Date().getFullYear(),C=new Date(Q,0,1),E=new Date(Q,6,1),D=C.getTimezoneOffset(),N=E.getTimezoneOffset(),F=Math.max(D,N);R[A>>2]=F*60,R[B>>2]=Number(D!=N);function o(k){var Z=k.toTimeString().match(/\(([A-Za-z ]+)\)$/);return Z?Z[1]:"GMT"}var h=o(C),y=o(E),Y=aB(h),i=aB(y);N>2]=Y,d[g+4>>2]=i):(d[g>>2]=i,d[g+4>>2]=Y)}function BB(A,B,g){BB.called||(BB.called=!0,ug(A,B,g))}function Pg(){oA("")}var gB=[];function _g(A,B){gB.length=0;var g;for(B>>=2;g=gA[A++];)B+=g!=105&B,gB.push(g==105?R[B]:kA[B++>>1]),++B;return gB}function $g(A,B,g){var Q=_g(B,g);return og[A].apply(null,Q)}var MB;MB=()=>performance.now();function AQ(A){return A<0||A===0&&1/A===-1/0}function BQ(A,B){return(A>>>0)+B*4294967296}function gQ(A,B){return(A>>>0)+(B>>>0)*4294967296}function SB(A,B){if(A<=0)return A;var g=B<=32?Math.abs(1<=g&&(B<=32||A>g)&&(A=-2*g+A),A}function JB(A,B){return A>=0?A:B<=32?2*Math.abs(1<>3],Q+=8):DA=="i64"?(iA=[R[Q>>2],R[Q+4>>2]],Q+=8):(DA="i32",iA=R[Q>>2],Q+=4),iA}for(var D=[],N,F,o;;){var h=g;if(N=W[g>>0],N===0)break;if(F=W[g+1>>0],N==37){var y=!1,Y=!1,i=!1,k=!1,Z=!1;A:for(;;){switch(F){case 43:y=!0;break;case 45:Y=!0;break;case 35:i=!0;break;case 48:if(k)break A;k=!0;break;case 32:Z=!0;break;default:break A}g++,F=W[g+1>>0]}var c=0;if(F==42)c=E("i32"),g++,F=W[g+1>>0];else for(;F>=48&&F<=57;)c=c*10+(F-48),g++,F=W[g+1>>0];var q=!1,U=-1;if(F==46){if(U=0,q=!0,g++,F=W[g+1>>0],F==42)U=E("i32"),g++;else for(;;){var a=W[g+1>>0];if(a<48||a>57)break;U=U*10+(a-48),g++}F=W[g+1>>0]}U<0&&(U=6,q=!1);var V;switch(String.fromCharCode(F)){case"h":var x=W[g+2>>0];x==104?(g++,V=1):V=2;break;case"l":var x=W[g+2>>0];x==108?(g++,V=8):V=4;break;case"L":case"q":case"j":V=8;break;case"z":case"t":case"I":V=4;break;default:V=null}switch(V&&g++,F=W[g+1>>0],String.fromCharCode(F)){case"d":case"i":case"u":case"o":case"x":case"X":case"p":{var BA=F==100||F==105;V=V||4,o=E("i"+V*8);var w;if(V==8&&(o=F==117?gQ(o[0],o[1]):BQ(o[0],o[1])),V<=4){var JI=Math.pow(256,V)-1;o=(BA?SB:JB)(o&JI,V*8)}var XA=Math.abs(o),P="";if(F==100||F==105)w=SB(o,8*V).toString(10);else if(F==117)w=JB(o,8*V).toString(10),o=Math.abs(o);else if(F==111)w=(i?"0":"")+XA.toString(8);else if(F==120||F==88){if(P=i&&o!=0?"0x":"",o<0){o=-o,w=(XA-1).toString(16);for(var PB=[],EA=0;EA=0&&(y?P="+"+P:Z&&(P=" "+P)),w.charAt(0)=="-"&&(P="-"+P,w=w.substr(1));P.length+w.lengthNB&&NB>=-4?(F=(F==103?"f":"F").charCodeAt(0),U-=NB+1):(F=(F==103?"e":"E").charCodeAt(0),U--),fA=Math.min(U,20)}F==101||F==69?(w=o.toExponential(fA),/[eE][-+]\d$/.test(w)&&(w=w.slice(0,-1)+"0"+w.slice(-1))):(F==102||F==70)&&(w=o.toFixed(fA),o===0&&AQ(o)&&(w="-"+w));var IA=w.split("e");if(_B&&!i)for(;IA[0].length>1&&IA[0].includes(".")&&(IA[0].slice(-1)=="0"||IA[0].slice(-1)==".");)IA[0]=IA[0].slice(0,-1);else for(i&&w.indexOf(".")==-1&&(IA[0]+=".");U>fA++;)IA[0]+="0";w=IA[0]+(IA.length>1?"e"+IA[1]:""),F==69&&(w=w.toUpperCase()),o>=0&&(y?w="+"+w:Z&&(w=" "+w))}for(;w.length>0]);else D=D.concat(qA("(null)".substr(0,ZA),!0));if(Y)for(;ZA0;)D.push(32);Y||D.push(E("i8"));break}case"n":{var cI=E("i32*");R[cI>>2]=D.length;break}case"%":{D.push(N);break}default:for(var EA=h;EA>0])}g+=2}else D.push(N),g+=1}return D}function QB(A){if(!A||!A.callee||!A.callee.name)return[null,"",""];A.callee.toString();var B=A.callee.name,g="(",Q=!0;for(var C in A){var E=A[C];Q||(g+=", "),Q=!1,typeof E=="number"||typeof E=="string"?g+=E:g+="("+typeof E+")"}g+=")";var D=A.callee.caller;return A=D?D.arguments:[],Q&&(g=""),[A,B,g]}function VA(A){VA.shown||(VA.shown={}),VA.shown[A]||(VA.shown[A]=1,p(A))}function CQ(A){var B=Yg(),g=B.lastIndexOf("_emscripten_log"),Q=B.lastIndexOf("_emscripten_get_callstack"),C=B.indexOf(`
`,Math.max(g,Q))+1;B=B.slice(C),A&32&&VA("EM_LOG_DEMANGLE is deprecated; ignoring"),A&8&&typeof emscripten_source_map>"u"&&(VA('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.'),A^=8,A|=16);var E=null;if(A&128)for(E=QB(arguments);E[1].includes("_emscripten_");)E=QB(E[0]);var D=B.split(`
diff --git a/index.html b/index.html
index 93aad06..ed06565 100644
--- a/index.html
+++ b/index.html
@@ -2,7 +2,7 @@
-
+
-
+
+