From 8cc7a7315b0c8d7012080b5a909b32c68d2916d8 Mon Sep 17 00:00:00 2001 From: thekiba Date: Tue, 17 Dec 2024 11:32:25 +0400 Subject: [PATCH] chore: rebuild --- docs/assets/{index-57ae93c0.js => index-9bb25390.js} | 4 ++-- docs/index.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename docs/assets/{index-57ae93c0.js => index-9bb25390.js} (95%) diff --git a/docs/assets/index-57ae93c0.js b/docs/assets/index-9bb25390.js similarity index 95% rename from docs/assets/index-57ae93c0.js rename to docs/assets/index-9bb25390.js index 2c39b65..67bf447 100644 --- a/docs/assets/index-57ae93c0.js +++ b/docs/assets/index-9bb25390.js @@ -56,7 +56,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */function __rest(b,_){var d={};for(var k in b)Object.prototype.hasOwnProperty.call(b,k)&&_.indexOf(k)<0&&(d[k]=b[k]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function")for(var j=0,k=Object.getOwnPropertySymbols(b);j{var j,$;if(!((j=_==null?void 0:_.signal)===null||j===void 0)&&j.aborted){k(new TonConnectError("Delay aborted"));return}const et=setTimeout(()=>d(),b);($=_==null?void 0:_.signal)===null||$===void 0||$.addEventListener("abort",()=>{clearTimeout(et),k(new TonConnectError("Delay aborted"))})})})}function createAbortController(b){const _=new AbortController;return b!=null&&b.aborted?_.abort():b==null||b.addEventListener("abort",()=>_.abort(),{once:!0}),_}function callForSuccess(b,_){var d,k;return __awaiter(this,void 0,void 0,function*(){const j=(d=_==null?void 0:_.attempts)!==null&&d!==void 0?d:10,$=(k=_==null?void 0:_.delayMs)!==null&&k!==void 0?k:200,et=createAbortController(_==null?void 0:_.signal);if(typeof b!="function")throw new TonConnectError(`Expected a function, got ${typeof b}`);let tt=0,rt;for(;tt__awaiter(this,void 0,void 0,function*(){if($=at??null,et==null||et.abort(),et=createAbortController(at),et.signal.aborted)throw new TonConnectError("Resource creation was aborted");k=it??null;const dt=b(et.signal,...it);j=dt;const ct=yield dt;if(j!==dt&&ct!==d)throw yield _(ct),new TonConnectError("Resource creation was aborted by a new resource creation");return d=ct,d});return{create:tt,current:()=>d??null,dispose:()=>__awaiter(this,void 0,void 0,function*(){try{const at=d;d=null;const it=j;j=null;try{et==null||et.abort()}catch{}yield Promise.allSettled([at?_(at):Promise.resolve(),it?_(yield it):Promise.resolve()])}catch{}}),recreate:at=>__awaiter(this,void 0,void 0,function*(){const it=d,dt=j,ct=k,ht=$;if(yield delay(at),it===d&&dt===j&&ct===k&&ht===$)return yield tt($,...ct??[]);throw new TonConnectError("Resource recreation was aborted by a new resource creation")})}}function timeout(b,_){const d=_==null?void 0:_.timeout,k=_==null?void 0:_.signal,j=createAbortController(k);return new Promise(($,et)=>__awaiter(this,void 0,void 0,function*(){if(j.signal.aborted){et(new TonConnectError("Operation aborted"));return}let tt;typeof d<"u"&&(tt=setTimeout(()=>{j.abort(),et(new TonConnectError(`Timeout after ${d}ms`))},d)),j.signal.addEventListener("abort",()=>{clearTimeout(tt),et(new TonConnectError("Operation aborted"))},{once:!0});const rt={timeout:d,abort:j.signal};yield b((...nt)=>{clearTimeout(tt),$(...nt)},()=>{clearTimeout(tt),et()},rt)}))}class BridgeGateway{constructor(_,d,k,j,$){this.bridgeUrl=d,this.sessionId=k,this.listener=j,this.errorsListener=$,this.ssePath="events",this.postPath="message",this.heartbeatMessage="heartbeat",this.defaultTtl=300,this.defaultReconnectDelay=2e3,this.defaultResendDelay=5e3,this.eventSource=createResource$1((et,tt)=>__awaiter(this,void 0,void 0,function*(){const rt={bridgeUrl:this.bridgeUrl,ssePath:this.ssePath,sessionId:this.sessionId,bridgeGatewayStorage:this.bridgeGatewayStorage,errorHandler:this.errorsHandler.bind(this),messageHandler:this.messagesHandler.bind(this),signal:et,openingDeadlineMS:tt};return yield createEventSource(rt)}),et=>__awaiter(this,void 0,void 0,function*(){et.close()})),this.bridgeGatewayStorage=new HttpBridgeGatewayStorage(_,d)}get isReady(){const _=this.eventSource.current();return(_==null?void 0:_.readyState)===EventSource.OPEN}get isClosed(){const _=this.eventSource.current();return(_==null?void 0:_.readyState)!==EventSource.OPEN}get isConnecting(){const _=this.eventSource.current();return(_==null?void 0:_.readyState)===EventSource.CONNECTING}registerSession(_){return __awaiter(this,void 0,void 0,function*(){yield this.eventSource.create(_==null?void 0:_.signal,_==null?void 0:_.openingDeadlineMS)})}send(_,d,k,j){var $;return __awaiter(this,void 0,void 0,function*(){const et={};typeof j=="number"?et.ttl=j:(et.ttl=j==null?void 0:j.ttl,et.signal=j==null?void 0:j.signal,et.attempts=j==null?void 0:j.attempts);const tt=new URL(addPathToUrl(this.bridgeUrl,this.postPath));tt.searchParams.append("client_id",this.sessionId),tt.searchParams.append("to",d),tt.searchParams.append("ttl",((et==null?void 0:et.ttl)||this.defaultTtl).toString()),tt.searchParams.append("topic",k);const rt=Base64.encode(_);yield callForSuccess(nt=>__awaiter(this,void 0,void 0,function*(){const ot=yield this.post(tt,rt,nt.signal);if(!ot.ok)throw new TonConnectError(`Bridge send failed, status ${ot.status}`)}),{attempts:($=et==null?void 0:et.attempts)!==null&&$!==void 0?$:Number.MAX_SAFE_INTEGER,delayMs:this.defaultResendDelay,signal:et==null?void 0:et.signal})})}pause(){this.eventSource.dispose().catch(_=>logError$1(`Bridge pause failed, ${_}`))}unPause(){return __awaiter(this,void 0,void 0,function*(){yield this.eventSource.recreate(0)})}close(){return __awaiter(this,void 0,void 0,function*(){yield this.eventSource.dispose().catch(_=>logError$1(`Bridge close failed, ${_}`))})}setListener(_){this.listener=_}setErrorsListener(_){this.errorsListener=_}post(_,d,k){return __awaiter(this,void 0,void 0,function*(){const j=yield fetch(_,{method:"post",body:d,signal:k});if(!j.ok)throw new TonConnectError(`Bridge send failed, status ${j.status}`);return j})}errorsHandler(_,d){return __awaiter(this,void 0,void 0,function*(){if(this.isConnecting)throw _.close(),new TonConnectError("Bridge error, failed to connect");if(this.isReady){try{this.errorsListener(d)}catch{}return}if(this.isClosed)return _.close(),logDebug$1(`Bridge reconnecting, ${this.defaultReconnectDelay}ms delay`),yield this.eventSource.recreate(this.defaultReconnectDelay);throw new TonConnectError("Bridge error, unknown state")})}messagesHandler(_){return __awaiter(this,void 0,void 0,function*(){if(_.data===this.heartbeatMessage||(yield this.bridgeGatewayStorage.storeLastEventId(_.lastEventId),this.isClosed))return;let d;try{d=JSON.parse(_.data)}catch(k){throw new TonConnectError(`Bridge message parse failed, message ${k.data}`)}this.listener(d)})}}function createEventSource(b){return __awaiter(this,void 0,void 0,function*(){return yield timeout((_,d,k)=>__awaiter(this,void 0,void 0,function*(){var j;const et=createAbortController(k.signal).signal;if(et.aborted){d(new TonConnectError("Bridge connection aborted"));return}const tt=new URL(addPathToUrl(b.bridgeUrl,b.ssePath));tt.searchParams.append("client_id",b.sessionId);const rt=yield b.bridgeGatewayStorage.getLastEventId();if(rt&&tt.searchParams.append("last_event_id",rt),et.aborted){d(new TonConnectError("Bridge connection aborted"));return}const nt=new EventSource(tt.toString());nt.onerror=ot=>__awaiter(this,void 0,void 0,function*(){if(et.aborted){nt.close(),d(new TonConnectError("Bridge connection aborted"));return}try{const at=yield b.errorHandler(nt,ot);at!==nt&&nt.close(),at&&at!==nt&&_(at)}catch(at){nt.close(),d(at)}}),nt.onopen=()=>{if(et.aborted){nt.close(),d(new TonConnectError("Bridge connection aborted"));return}_(nt)},nt.onmessage=ot=>{if(et.aborted){nt.close(),d(new TonConnectError("Bridge connection aborted"));return}b.messageHandler(ot)},(j=b.signal)===null||j===void 0||j.addEventListener("abort",()=>{nt.close(),d(new TonConnectError("Bridge connection aborted"))})}),{timeout:b.openingDeadlineMS,signal:b.signal})})}function isPendingConnectionHttp(b){return!("connectEvent"in b)}class BridgeConnectionStorage{constructor(_){this.storage=_,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(_){return __awaiter(this,void 0,void 0,function*(){if(_.type==="injected")return this.storage.setItem(this.storeKey,JSON.stringify(_));if(!isPendingConnectionHttp(_)){const k={sessionKeyPair:_.session.sessionCrypto.stringifyKeypair(),walletPublicKey:_.session.walletPublicKey,bridgeUrl:_.session.bridgeUrl},j={type:"http",connectEvent:_.connectEvent,session:k,lastWalletEventId:_.lastWalletEventId,nextRpcRequestId:_.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(j))}const d={type:"http",connectionSource:_.connectionSource,sessionCrypto:_.sessionCrypto.stringifyKeypair()};return this.storage.setItem(this.storeKey,JSON.stringify(d))})}removeConnection(){return __awaiter(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getConnection(){return __awaiter(this,void 0,void 0,function*(){const _=yield this.storage.getItem(this.storeKey);if(!_)return null;const d=JSON.parse(_);if(d.type==="injected")return d;if("connectEvent"in d){const k=new SessionCrypto(d.session.sessionKeyPair);return{type:"http",connectEvent:d.connectEvent,lastWalletEventId:d.lastWalletEventId,nextRpcRequestId:d.nextRpcRequestId,session:{sessionCrypto:k,bridgeUrl:d.session.bridgeUrl,walletPublicKey:d.session.walletPublicKey}}}return{type:"http",sessionCrypto:new SessionCrypto(d.sessionCrypto),connectionSource:d.connectionSource}})}getHttpConnection(){return __awaiter(this,void 0,void 0,function*(){const _=yield this.getConnection();if(!_)throw new TonConnectError("Trying to read HTTP connection source while nothing is stored");if(_.type==="injected")throw new TonConnectError("Trying to read HTTP connection source while injected connection is stored");return _})}getHttpPendingConnection(){return __awaiter(this,void 0,void 0,function*(){const _=yield this.getConnection();if(!_)throw new TonConnectError("Trying to read HTTP connection source while nothing is stored");if(_.type==="injected")throw new TonConnectError("Trying to read HTTP connection source while injected connection is stored");if(!isPendingConnectionHttp(_))throw new TonConnectError("Trying to read HTTP-pending connection while http connection is stored");return _})}getInjectedConnection(){return __awaiter(this,void 0,void 0,function*(){const _=yield this.getConnection();if(!_)throw new TonConnectError("Trying to read Injected bridge connection source while nothing is stored");if((_==null?void 0:_.type)==="http")throw new TonConnectError("Trying to read Injected bridge connection source while HTTP connection is stored");return _})}storedConnectionType(){return __awaiter(this,void 0,void 0,function*(){const _=yield this.storage.getItem(this.storeKey);return _?JSON.parse(_).type:null})}storeLastWalletEventId(_){return __awaiter(this,void 0,void 0,function*(){const d=yield this.getConnection();if(d&&d.type==="http"&&!isPendingConnectionHttp(d))return d.lastWalletEventId=_,this.storeConnection(d)})}getLastWalletEventId(){return __awaiter(this,void 0,void 0,function*(){const _=yield this.getConnection();if(_&&"lastWalletEventId"in _)return _.lastWalletEventId})}increaseNextRpcRequestId(){return __awaiter(this,void 0,void 0,function*(){const _=yield this.getConnection();if(_&&"nextRpcRequestId"in _){const d=_.nextRpcRequestId||0;return _.nextRpcRequestId=d+1,this.storeConnection(_)}})}getNextRpcRequestId(){return __awaiter(this,void 0,void 0,function*(){const _=yield this.getConnection();return _&&"nextRpcRequestId"in _&&_.nextRpcRequestId||0})}}const PROTOCOL_VERSION=2;class BridgeProvider{constructor(_,d){this.storage=_,this.walletConnectionSource=d,this.type="http",this.standardUniversalLink="tc://",this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.defaultOpeningDeadlineMS=12e3,this.defaultRetryTimeoutMS=2e3,this.connectionStorage=new BridgeConnectionStorage(_)}static fromStorage(_){return __awaiter(this,void 0,void 0,function*(){const k=yield new BridgeConnectionStorage(_).getHttpConnection();return isPendingConnectionHttp(k)?new BridgeProvider(_,k.connectionSource):new BridgeProvider(_,{bridgeUrl:k.session.bridgeUrl})})}connect(_,d){var k;const j=createAbortController(d==null?void 0:d.signal);(k=this.abortController)===null||k===void 0||k.abort(),this.abortController=j,this.closeGateways();const $=new SessionCrypto;this.session={sessionCrypto:$,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:$}).then(()=>__awaiter(this,void 0,void 0,function*(){j.signal.aborted||(yield callForSuccess(tt=>{var rt;return this.openGateways($,{openingDeadlineMS:(rt=d==null?void 0:d.openingDeadlineMS)!==null&&rt!==void 0?rt:this.defaultOpeningDeadlineMS,signal:tt==null?void 0:tt.signal})},{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:j.signal}))}));const et="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(et,_)}restoreConnection(_){var d,k;return __awaiter(this,void 0,void 0,function*(){const j=createAbortController(_==null?void 0:_.signal);if((d=this.abortController)===null||d===void 0||d.abort(),this.abortController=j,j.signal.aborted)return;this.closeGateways();const $=yield this.connectionStorage.getHttpConnection();if(!$||j.signal.aborted)return;const et=(k=_==null?void 0:_.openingDeadlineMS)!==null&&k!==void 0?k:this.defaultOpeningDeadlineMS;if(isPendingConnectionHttp($))return this.session={sessionCrypto:$.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},yield this.openGateways($.sessionCrypto,{openingDeadlineMS:et,signal:j==null?void 0:j.signal});if(Array.isArray(this.walletConnectionSource))throw new TonConnectError("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");if(this.session=$.session,this.gateway&&(logDebug$1("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new BridgeGateway(this.storage,this.walletConnectionSource.bridgeUrl,$.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),!j.signal.aborted){this.listeners.forEach(tt=>tt($.connectEvent));try{yield callForSuccess(tt=>this.gateway.registerSession({openingDeadlineMS:et,signal:tt.signal}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:j.signal})}catch{yield this.disconnect({signal:j.signal});return}}})}sendRequest(_,d){const k={};return typeof d=="function"?k.onRequestSent=d:(k.onRequestSent=d==null?void 0:d.onRequestSent,k.signal=d==null?void 0:d.signal,k.attempts=d==null?void 0:d.attempts),new Promise((j,$)=>__awaiter(this,void 0,void 0,function*(){var et;if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new TonConnectError("Trying to send bridge request without session");const tt=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),logDebug$1("Send http-bridge request:",Object.assign(Object.assign({},_),{id:tt}));const rt=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},_),{id:tt})),hexToByteArray(this.session.walletPublicKey));try{yield this.gateway.send(rt,this.session.walletPublicKey,_.method,{attempts:k==null?void 0:k.attempts,signal:k==null?void 0:k.signal}),(et=k==null?void 0:k.onRequestSent)===null||et===void 0||et.call(k),this.pendingRequests.set(tt.toString(),j)}catch(nt){$(nt)}}))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(_){return __awaiter(this,void 0,void 0,function*(){return new Promise(d=>__awaiter(this,void 0,void 0,function*(){let k=!1,j=null;const $=()=>{k||(k=!0,this.removeBridgeAndSession().then(d))};try{this.closeGateways();const et=createAbortController(_==null?void 0:_.signal);j=setTimeout(()=>{et.abort()},this.defaultOpeningDeadlineMS),yield this.sendRequest({method:"disconnect",params:[]},{onRequestSent:$,signal:et.signal,attempts:1})}catch(et){logDebug$1("Disconnect error:",et),k||this.removeBridgeAndSession().then(d)}finally{j&&clearTimeout(j),$()}}))})}listen(_){return this.listeners.push(_),()=>this.listeners=this.listeners.filter(d=>d!==_)}pause(){var _;(_=this.gateway)===null||_===void 0||_.pause(),this.pendingGateways.forEach(d=>d.pause())}unPause(){return __awaiter(this,void 0,void 0,function*(){const _=this.pendingGateways.map(d=>d.unPause());this.gateway&&_.push(this.gateway.unPause()),yield Promise.all(_)})}pendingGatewaysListener(_,d,k){return __awaiter(this,void 0,void 0,function*(){if(!this.pendingGateways.includes(_)){yield _.close();return}return this.closeGateways({except:_}),this.gateway&&(logDebug$1("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.session.bridgeUrl=d,this.gateway=_,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(k)})}gatewayListener(_){return __awaiter(this,void 0,void 0,function*(){const d=JSON.parse(this.session.sessionCrypto.decrypt(Base64.decode(_.message).toUint8Array(),hexToByteArray(_.from)));if(logDebug$1("Wallet message received:",d),!("event"in d)){const j=d.id.toString(),$=this.pendingRequests.get(j);if(!$){logDebug$1(`Response id ${j} doesn't match any request's id`);return}$(d),this.pendingRequests.delete(j);return}if(d.id!==void 0){const j=yield this.connectionStorage.getLastWalletEventId();if(j!==void 0&&d.id<=j){logError$1(`Received event id (=${d.id}) must be greater than stored last wallet event id (=${j}) `);return}d.event!=="connect"&&(yield this.connectionStorage.storeLastWalletEventId(d.id))}const k=this.listeners;d.event==="connect"&&(yield this.updateSession(d,_.from)),d.event==="disconnect"&&(logDebug$1("Removing bridge and session: received disconnect event"),yield this.removeBridgeAndSession()),k.forEach(j=>j(d))})}gatewayErrorsListener(_){return __awaiter(this,void 0,void 0,function*(){throw new TonConnectError(`Bridge error ${JSON.stringify(_)}`)})}updateSession(_,d){return __awaiter(this,void 0,void 0,function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:d});const k=_.payload.items.find($=>$.name==="ton_addr"),j=Object.assign(Object.assign({},_),{payload:Object.assign(Object.assign({},_.payload),{items:[k]})});yield this.connectionStorage.storeConnection({type:"http",session:this.session,lastWalletEventId:_.id,connectEvent:j,nextRpcRequestId:0})})}removeBridgeAndSession(){return __awaiter(this,void 0,void 0,function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()})}generateUniversalLink(_,d){return isTelegramUrl(_)?this.generateTGUniversalLink(_,d):this.generateRegularUniversalLink(_,d)}generateRegularUniversalLink(_,d){const k=new URL(_);return k.searchParams.append("v",PROTOCOL_VERSION.toString()),k.searchParams.append("id",this.session.sessionCrypto.sessionId),k.searchParams.append("r",JSON.stringify(d)),k.toString()}generateTGUniversalLink(_,d){const j=this.generateRegularUniversalLink("about:blank",d).split("?")[1],$="tonconnect-"+encodeTelegramUrlParameters(j),et=this.convertToDirectLink(_),tt=new URL(et);return tt.searchParams.append("startapp",$),tt.toString()}convertToDirectLink(_){const d=new URL(_);return d.searchParams.has("attach")&&(d.searchParams.delete("attach"),d.pathname+="/start"),d.toString()}openGateways(_,d){return __awaiter(this,void 0,void 0,function*(){if(Array.isArray(this.walletConnectionSource)){this.pendingGateways.map(k=>k.close().catch()),this.pendingGateways=this.walletConnectionSource.map(k=>{const j=new BridgeGateway(this.storage,k.bridgeUrl,_.sessionId,()=>{},()=>{});return j.setListener($=>this.pendingGatewaysListener(j,k.bridgeUrl,$)),j}),yield Promise.allSettled(this.pendingGateways.map(k=>callForSuccess(j=>{var $;return this.pendingGateways.some(et=>et===k)?k.registerSession({openingDeadlineMS:($=d==null?void 0:d.openingDeadlineMS)!==null&&$!==void 0?$:this.defaultOpeningDeadlineMS,signal:j.signal}):k.close()},{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:d==null?void 0:d.signal})));return}else return this.gateway&&(logDebug$1("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new BridgeGateway(this.storage,this.walletConnectionSource.bridgeUrl,_.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),yield this.gateway.registerSession({openingDeadlineMS:d==null?void 0:d.openingDeadlineMS,signal:d==null?void 0:d.signal})})}closeGateways(_){var d;(d=this.gateway)===null||d===void 0||d.close(),this.pendingGateways.filter(k=>k!==(_==null?void 0:_.except)).forEach(k=>k.close()),this.pendingGateways=[]}}function hasProperty(b,_){return hasProperties(b,[_])}function hasProperties(b,_){return!b||typeof b!="object"?!1:_.every(d=>d in b)}function isJSBridgeWithMetadata(b){try{return!hasProperty(b,"tonconnect")||!hasProperty(b.tonconnect,"walletInfo")?!1:hasProperties(b.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch{return!1}}let InMemoryStorage$1=class Jo{constructor(){this.storage={}}static getInstance(){return Jo.instance||(Jo.instance=new Jo),Jo.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(_){var d;return(d=this.storage[_])!==null&&d!==void 0?d:null}key(_){var d;const k=Object.keys(this.storage);return _<0||_>=k.length?null:(d=k[_])!==null&&d!==void 0?d:null}removeItem(_){delete this.storage[_]}setItem(_,d){this.storage[_]=d}};function getWindow$2(){if(!(typeof window>"u"))return window}function tryGetWindowKeys(){const b=getWindow$2();if(!b)return[];try{return Object.keys(b)}catch{return[]}}function getDocument(){if(!(typeof document>"u"))return document}function getWebPageManifest(){var b;const _=(b=getWindow$2())===null||b===void 0?void 0:b.location.origin;return _?_+"/tonconnect-manifest.json":""}function tryGetLocalStorage$1(){if(isLocalStorageAvailable$1())return localStorage;if(isNodeJs$1())throw new TonConnectError("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return InMemoryStorage$1.getInstance()}function isLocalStorageAvailable$1(){try{return typeof localStorage<"u"}catch{return!1}}function isNodeJs$1(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null}class InjectedProvider{constructor(_,d){this.injectedWalletKey=d,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const k=InjectedProvider.window;if(!InjectedProvider.isWindowContainsWallet(k,d))throw new WalletNotInjectedError;this.connectionStorage=new BridgeConnectionStorage(_),this.injectedWallet=k[d].tonconnect}static fromStorage(_){return __awaiter(this,void 0,void 0,function*(){const k=yield new BridgeConnectionStorage(_).getInjectedConnection();return new InjectedProvider(_,k.jsBridgeKey)})}static isWalletInjected(_){return InjectedProvider.isWindowContainsWallet(this.window,_)}static isInsideWalletBrowser(_){return InjectedProvider.isWindowContainsWallet(this.window,_)?this.window[_].tonconnect.isWalletBrowser:!1}static getCurrentlyInjectedWallets(){return this.window?tryGetWindowKeys().filter(k=>isJSBridgeWithMetadata(k)).map(([k,j])=>({name:j.tonconnect.walletInfo.name,appName:j.tonconnect.walletInfo.app_name,aboutUrl:j.tonconnect.walletInfo.about_url,imageUrl:j.tonconnect.walletInfo.image,tondns:j.tonconnect.walletInfo.tondns,jsBridgeKey:k,injected:!0,embedded:j.tonconnect.isWalletBrowser,platforms:j.tonconnect.walletInfo.platforms})):[]}static isWindowContainsWallet(_,d){return!!_&&d in _&&typeof _[d]=="object"&&"tonconnect"in _[d]}connect(_){this._connect(PROTOCOL_VERSION,_)}restoreConnection(){return __awaiter(this,void 0,void 0,function*(){try{logDebug$1("Injected Provider restoring connection...");const _=yield this.injectedWallet.restoreConnection();logDebug$1("Injected Provider restoring connection response",_),_.event==="connect"?(this.makeSubscriptions(),this.listeners.forEach(d=>d(_))):yield this.connectionStorage.removeConnection()}catch(_){yield this.connectionStorage.removeConnection(),console.error(_)}})}closeConnection(){this.listenSubscriptions&&this.injectedWallet.disconnect(),this.closeAllListeners()}disconnect(){return __awaiter(this,void 0,void 0,function*(){return new Promise(_=>{const d=()=>{this.closeAllListeners(),this.connectionStorage.removeConnection().then(_)};try{this.injectedWallet.disconnect(),d()}catch(k){logDebug$1(k),this.sendRequest({method:"disconnect",params:[]},d)}})})}closeAllListeners(){var _;this.listenSubscriptions=!1,this.listeners=[],(_=this.unsubscribeCallback)===null||_===void 0||_.call(this)}listen(_){return this.listeners.push(_),()=>this.listeners=this.listeners.filter(d=>d!==_)}sendRequest(_,d){var k;return __awaiter(this,void 0,void 0,function*(){const j={};typeof d=="function"?j.onRequestSent=d:(j.onRequestSent=d==null?void 0:d.onRequestSent,j.signal=d==null?void 0:d.signal);const $=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),logDebug$1("Send injected-bridge request:",Object.assign(Object.assign({},_),{id:$}));const et=this.injectedWallet.send(Object.assign(Object.assign({},_),{id:$}));return et.then(tt=>logDebug$1("Wallet message received:",tt)),(k=j==null?void 0:j.onRequestSent)===null||k===void 0||k.call(j),et})}_connect(_,d){return __awaiter(this,void 0,void 0,function*(){try{logDebug$1(`Injected Provider connect request: protocolVersion: ${_}, message:`,d);const k=yield this.injectedWallet.connect(_,d);logDebug$1("Injected Provider connect response:",k),k.event==="connect"&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach(j=>j(k))}catch(k){logDebug$1("Injected Provider connect error:",k);const j={event:"connect_error",payload:{code:0,message:k==null?void 0:k.toString()}};this.listeners.forEach($=>$(j))}})}makeSubscriptions(){this.listenSubscriptions=!0,this.unsubscribeCallback=this.injectedWallet.listen(_=>{logDebug$1("Wallet message received:",_),this.listenSubscriptions&&this.listeners.forEach(d=>d(_)),_.event==="disconnect"&&this.disconnect()})}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}}InjectedProvider.window=getWindow$2();class DefaultStorage{constructor(){this.localStorage=tryGetLocalStorage$1()}getItem(_){return __awaiter(this,void 0,void 0,function*(){return this.localStorage.getItem(_)})}removeItem(_){return __awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(_)})}setItem(_,d){return __awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(_,d)})}}function isWalletInfoCurrentlyInjected(b){return isWalletInfoInjectable(b)&&b.injected}function isWalletInfoCurrentlyEmbedded(b){return isWalletInfoCurrentlyInjected(b)&&b.embedded}function isWalletInfoInjectable(b){return"jsBridgeKey"in b}function isWalletInfoRemote(b){return"bridgeUrl"in b}const FALLBACK_WALLETS_LIST=[{app_name:"telegram-wallet",name:"Wallet",image:"https://wallet.tg/images/logo-288.png",about_url:"https://wallet.tg/",universal_url:"https://t.me/wallet?attach=wallet",bridge:[{type:"sse",url:"https://walletbot.me/tonconnect-bridge/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"tonkeeper",name:"Tonkeeper",image:"https://tonkeeper.com/assets/tonconnect-icon.png",tondns:"tonkeeper.ton",about_url:"https://tonkeeper.com",universal_url:"https://app.tonkeeper.com/ton-connect",deepLink:"tonkeeper-tc://",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"},{type:"js",key:"tonkeeper"}],platforms:["ios","android","chrome","firefox","macos"]},{app_name:"mytonwallet",name:"MyTonWallet",image:"https://static.mytonwallet.io/icon-256.png",about_url:"https://mytonwallet.io",universal_url:"https://connect.mytonwallet.org",bridge:[{type:"js",key:"mytonwallet"},{type:"sse",url:"https://tonconnectbridge.mytonwallet.org/bridge/"}],platforms:["chrome","windows","macos","linux","ios","android","firefox"]},{app_name:"tonhub",name:"Tonhub",image:"https://tonhub.com/tonconnect_logo.png",about_url:"https://tonhub.com",universal_url:"https://tonhub.com/ton-connect",bridge:[{type:"js",key:"tonhub"},{type:"sse",url:"https://connect.tonhubapi.com/tonconnect"}],platforms:["ios","android"]},{app_name:"bitgetTonWallet",name:"Bitget Wallet",image:"https://raw.githubusercontent.com/bitgetwallet/download/refs/heads/main/logo/png/bitget_wallet_logo_288_mini.png",about_url:"https://web3.bitget.com",deepLink:"bitkeep://",bridge:[{type:"js",key:"bitgetTonWallet"},{type:"sse",url:"https://ton-connect-bridge.bgwapi.io/bridge"}],platforms:["ios","android","chrome"],universal_url:"https://bkcode.vip/ton-connect"},{app_name:"okxMiniWallet",name:"OKX Mini Wallet",image:"https://static.okx.com/cdn/assets/imgs/2411/8BE1A4A434D8F58A.png",about_url:"https://www.okx.com/web3",universal_url:"https://t.me/OKX_WALLET_BOT?attach=wallet",bridge:[{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"binanceWeb3TonWallet",name:"Binance Web3 Wallet",image:"https://public.bnbstatic.com/static/binance-w3w/ton-provider/binancew3w.png",about_url:"https://www.binance.com/en/web3wallet",deepLink:"bnc://app.binance.com/cedefi/ton-connect",bridge:[{type:"js",key:"binancew3w"},{type:"sse",url:"https://wallet.binance.com/tonbridge/bridge"}],platforms:["ios","android","macos","windows","linux"],universal_url:"https://app.binance.com/cedefi/ton-connect"},{app_name:"fintopio-tg",name:"Fintopio",image:"https://fintopio.com/tonconnect-icon.png",about_url:"https://fintopio.com",universal_url:"https://t.me/fintopio?attach=wallet",bridge:[{type:"sse",url:"https://wallet-bridge.fintopio.com/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"okxTonWallet",name:"OKX Wallet",image:"https://static.okx.com/cdn/assets/imgs/247/58E63FEA47A2B7D7.png",about_url:"https://www.okx.com/web3",universal_url:"https://www.okx.com/download?appendQuery=true&deeplink=okx://web3/wallet/tonconnect",bridge:[{type:"js",key:"okxTonWallet"},{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["chrome","safari","firefox","ios","android"]},{app_name:"hot",name:"HOT",image:"https://raw.githubusercontent.com/hot-dao/media/main/logo.png",about_url:"https://hot-labs.org/",universal_url:"https://t.me/herewalletbot?attach=wallet",bridge:[{type:"sse",url:"https://sse-bridge.hot-labs.org"},{type:"js",key:"hotWallet"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"bybitTonWallet",name:"Bybit Wallet",image:"https://raw.githubusercontent.com/bybit-web3/bybit-web3.github.io/main/docs/images/bybit-logo.png",about_url:"https://www.bybit.com/web3",universal_url:"https://app.bybit.com/ton-connect",deepLink:"bybitapp://",bridge:[{type:"js",key:"bybitTonWallet"},{type:"sse",url:"https://api-node.bybit.com/spot/api/web3/bridge/ton/bridge"}],platforms:["ios","android","chrome"]},{app_name:"dewallet",name:"DeWallet",image:"https://raw.githubusercontent.com/delab-team/manifests-images/main/WalletAvatar.png",about_url:"https://delabwallet.com",universal_url:"https://t.me/dewallet?attach=wallet",bridge:[{type:"sse",url:"https://bridge.dewallet.pro/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"safepalwallet",name:"SafePal",image:"https://s.pvcliping.com/web/public_image/SafePal_x288.png",tondns:"",about_url:"https://www.safepal.com",universal_url:"https://link.safepal.io/ton-connect",deepLink:"safepal-tc://",bridge:[{type:"sse",url:"https://ton-bridge.safepal.com/tonbridge/v1/bridge"},{type:"js",key:"safepalwallet"}],platforms:["ios","android","chrome","firefox"]},{app_name:"GateWallet",name:"GateWallet",image:"https://img.gatedataimg.com/prd-ordinal-imgs/036f07bb8730716e/gateio-0925.png",about_url:"https://www.gate.io/",bridge:[{type:"js",key:"gatetonwallet"},{type:"sse",url:"https://dapp.gateio.services/tonbridge_api/bridge/v1"}],platforms:["ios","android"],universal_url:"https://gateio.go.link/gateio/web3?adj_t=1ff8khdw_1fu4ccc7"},{app_name:"openmask",name:"OpenMask",image:"https://raw.githubusercontent.com/OpenProduct/openmask-extension/main/public/openmask-logo-288.png",about_url:"https://www.openmask.app/",bridge:[{type:"js",key:"openmask"}],platforms:["chrome"]},{app_name:"BitgetWeb3",name:"BitgetWeb3",image:"https://img.bitgetimg.com/image/third/1731638059795.png",about_url:"​https://www.bitget.com",universal_url:"https://t.me/BitgetOfficialBot?attach=wallet",bridge:[{type:"sse",url:"https://ton-connect-bridge.bgwapi.io/bridge"}],platforms:["ios","android","windows","macos","linux"]},{app_name:"tobi",name:"Tobi",image:"https://app.tobiwallet.app/icons/logo-288.png",about_url:"https://tobi.fun",universal_url:"https://t.me/TobiCopilotBot?attach=wallet",bridge:[{type:"sse",url:"https://ton-bridge.tobiwallet.app/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"xtonwallet",name:"XTONWallet",image:"https://xtonwallet.com/assets/img/icon-256-back.png",about_url:"https://xtonwallet.com",bridge:[{type:"js",key:"xtonwallet"}],platforms:["chrome","firefox"]},{app_name:"tonwallet",name:"TON Wallet",image:"https://wallet.ton.org/assets/ui/qr-logo.png",about_url:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",bridge:[{type:"js",key:"tonwallet"}],platforms:["chrome"]}];class WalletsListManager{constructor(_){this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null,this.walletsListSource="https://raw.githubusercontent.com/ton-blockchain/wallets-list/main/wallets-v2.json",_!=null&&_.walletsListSource&&(this.walletsListSource=_.walletsListSource),_!=null&&_.cacheTTLMs&&(this.cacheTTLMs=_.cacheTTLMs)}getWallets(){return __awaiter(this,void 0,void 0,function*(){return this.cacheTTLMs&&this.walletsListCacheCreationTimestamp&&Date.now()>this.walletsListCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListCache=null),this.walletsListCache||(this.walletsListCache=this.fetchWalletsList(),this.walletsListCache.then(()=>{this.walletsListCacheCreationTimestamp=Date.now()}).catch(()=>{this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null})),this.walletsListCache})}getEmbeddedWallet(){return __awaiter(this,void 0,void 0,function*(){const d=(yield this.getWallets()).filter(isWalletInfoCurrentlyEmbedded);return d.length!==1?null:d[0]})}fetchWalletsList(){return __awaiter(this,void 0,void 0,function*(){let _=[];try{if(_=yield(yield fetch(this.walletsListSource)).json(),_.push({app_name:"hpyTonWallet",name:"HyperPay Wallet",image:"https://onchain-oss.hyperpay.online/images/logo.png",about_url:"https://www.hyperpay.tech",universal_url:"https://www.hyperpay.tech/download&deeplink=hyperpay://web3/wallet/tonconnect",bridge:[{type:"js",key:"hpyTonWallet"},{type:"sse",url:"https://onchain-wallet.hyperpay.online/bridge"}],platforms:["ios","android","macos","windows","linux"]}),_.push({app_name:"nicegramWallet",name:"Nicegram Wallet",image:"https://static.nicegram.app/icon.png",about_url:"https://nicegram.app",universal_url:"https://nicegram.app/tc",deepLink:"nicegram-tc://",bridge:[{type:"sse",url:"https://tc.nicegram.app/bridge"},{type:"js",key:"nicegramWallet"}],platforms:["ios","android","macos","windows","linux"]}),_.push({app_name:"foxwallet",name:"FoxWallet",image:"https://hc.foxwallet.com/img/logo.png",about_url:"https://foxwallet.com/",bridge:[{type:"js",key:"foxwallet"}],platforms:["ios","android","macos","windows","linux"]}),_.push({app_name:"trustwalletTon",name:"Trust",image:"https://assets-cdn.trustwallet.com/dapps/trust.logo.png",about_url:"https://trustwallet.com/about-us",deepLink:"trust://ton-connect",universal_url:"https://trustwallet.com",bridge:[{type:"js",key:"trustwalletTon"},{type:"sse",url:"https://tonconnect.trustwallet.com/bridge"}],platforms:["chrome","ios","android"]}),_.push({app_name:"jambo",name:"Jambo",image:"https://cdn-prod.jambotechnology.xyz/content/jambo_288x288_02da416a6c.png",about_url:"https://www.jambo.technology/",deepLink:"jambotc://",universal_url:"https://jambophone.xyz/",bridge:[{type:"js",key:"jambowallet"},{type:"sse",url:"https://bridge.tonapi.io/bridge"}],platforms:["android"]}),_.push({app_name:"tokenpocket",name:"TokenPocket",image:"https://hk.tpstatic.net/logo/tokenpocket.png",about_url:"https://www.tokenpocket.pro",universal_url:"https://tp-lab.tptool.pro/ton-connect/",bridge:[{type:"js",key:"tokenpocket"},{type:"sse",url:"https://ton-connect.mytokenpocket.vip/bridge"}],platforms:["ios","android"]}),!Array.isArray(_))throw new FetchWalletsError("Wrong wallets list format, wallets list must be an array.");const j=_.filter($=>!this.isCorrectWalletConfigDTO($));j.length&&(logError$1(`Wallet(s) ${j.map($=>$.name).join(", ")} config format is wrong. They were removed from the wallets list.`),_=_.filter($=>this.isCorrectWalletConfigDTO($)))}catch(k){logError$1(k),_=FALLBACK_WALLETS_LIST}let d=[];try{d=InjectedProvider.getCurrentlyInjectedWallets()}catch(k){logError$1(k)}return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(_),d)})}walletConfigDTOListToWalletConfigList(_){return _.map(d=>{const j={name:d.name,appName:d.app_name,imageUrl:d.image,aboutUrl:d.about_url,tondns:d.tondns,platforms:d.platforms};return d.bridge.forEach($=>{if($.type==="sse"&&(j.bridgeUrl=$.url,j.universalLink=d.universal_url,j.deepLink=d.deepLink),$.type==="js"){const et=$.key;j.jsBridgeKey=et,j.injected=InjectedProvider.isWalletInjected(et),j.embedded=InjectedProvider.isInsideWalletBrowser(et)}}),j})}mergeWalletsLists(_,d){return[...new Set(_.concat(d).map(j=>j.name)).values()].map(j=>{const $=_.find(tt=>tt.name===j),et=d.find(tt=>tt.name===j);return Object.assign(Object.assign({},$&&Object.assign({},$)),et&&Object.assign({},et))})}isCorrectWalletConfigDTO(_){if(!_||typeof _!="object")return!1;const d="name"in _,k="app_name"in _,j="image"in _,$="about_url"in _,et="platforms"in _;if(!d||!j||!$||!et||!k||!_.platforms||!Array.isArray(_.platforms)||!_.platforms.length||!("bridge"in _)||!Array.isArray(_.bridge)||!_.bridge.length)return!1;const tt=_.bridge;if(tt.some(ot=>!ot||typeof ot!="object"||!("type"in ot)))return!1;const rt=tt.find(ot=>ot.type==="sse");if(rt&&(!("url"in rt)||!rt.url||!_.universal_url))return!1;const nt=tt.find(ot=>ot.type==="js");return!(nt&&(!("key"in nt)||!nt.key))}}class WalletNotSupportFeatureError extends TonConnectError{get info(){return"Wallet doesn't support requested feature method."}constructor(..._){super(..._),Object.setPrototypeOf(this,WalletNotSupportFeatureError.prototype)}}function checkSendTransactionSupport(b,_){const d=b.includes("SendTransaction"),k=b.find(j=>j&&typeof j=="object"&&j.name==="SendTransaction");if(!d&&!k)throw new WalletNotSupportFeatureError("Wallet doesn't support SendTransaction feature.");if(k&&k.maxMessages!==void 0){if(k.maxMessages<_.requiredMessagesNumber)throw new WalletNotSupportFeatureError(`Wallet is not able to handle such SendTransaction request. Max support messages number is ${k.maxMessages}, but ${_.requiredMessagesNumber} is required.`);return}logWarning$1("Connected wallet didn't provide information about max allowed messages in the SendTransaction request. Request may be rejected by the wallet.")}function createRequestVersionEvent(){return{type:"request-version"}}function createResponseVersionEvent(b){return{type:"response-version",version:b}}function createVersionInfo(b){return{ton_connect_sdk_lib:b.ton_connect_sdk_lib,ton_connect_ui_lib:b.ton_connect_ui_lib}}function createConnectionInfo(b,_){var d,k,j,$,et,tt,rt,nt;const at=((d=_==null?void 0:_.connectItems)===null||d===void 0?void 0:d.tonProof)&&"proof"in _.connectItems.tonProof?"ton_proof":"ton_addr";return{wallet_address:(j=(k=_==null?void 0:_.account)===null||k===void 0?void 0:k.address)!==null&&j!==void 0?j:null,wallet_type:($=_==null?void 0:_.device.appName)!==null&&$!==void 0?$:null,wallet_version:(et=_==null?void 0:_.device.appVersion)!==null&&et!==void 0?et:null,auth_type:at,custom_data:Object.assign({chain_id:(rt=(tt=_==null?void 0:_.account)===null||tt===void 0?void 0:tt.chain)!==null&&rt!==void 0?rt:null,provider:(nt=_==null?void 0:_.provider)!==null&&nt!==void 0?nt:null},createVersionInfo(b))}}function createConnectionStartedEvent(b){return{type:"connection-started",custom_data:createVersionInfo(b)}}function createConnectionCompletedEvent(b,_){return Object.assign({type:"connection-completed",is_success:!0},createConnectionInfo(b,_))}function createConnectionErrorEvent(b,_,d){return{type:"connection-error",is_success:!1,error_message:_,error_code:d??null,custom_data:createVersionInfo(b)}}function createConnectionRestoringStartedEvent(b){return{type:"connection-restoring-started",custom_data:createVersionInfo(b)}}function createConnectionRestoringCompletedEvent(b,_){return Object.assign({type:"connection-restoring-completed",is_success:!0},createConnectionInfo(b,_))}function createConnectionRestoringErrorEvent(b,_){return{type:"connection-restoring-error",is_success:!1,error_message:_,custom_data:createVersionInfo(b)}}function createTransactionInfo(b,_){var d,k,j,$;return{valid_until:(d=String(_.validUntil))!==null&&d!==void 0?d:null,from:($=(k=_.from)!==null&&k!==void 0?k:(j=b==null?void 0:b.account)===null||j===void 0?void 0:j.address)!==null&&$!==void 0?$:null,messages:_.messages.map(et=>{var tt,rt;return{address:(tt=et.address)!==null&&tt!==void 0?tt:null,amount:(rt=et.amount)!==null&&rt!==void 0?rt:null}})}}function createTransactionSentForSignatureEvent(b,_,d){return Object.assign(Object.assign({type:"transaction-sent-for-signature"},createConnectionInfo(b,_)),createTransactionInfo(_,d))}function createTransactionSignedEvent(b,_,d,k){return Object.assign(Object.assign({type:"transaction-signed",is_success:!0,signed_transaction:k.boc},createConnectionInfo(b,_)),createTransactionInfo(_,d))}function createTransactionSigningFailedEvent(b,_,d,k,j){return Object.assign(Object.assign({type:"transaction-signing-failed",is_success:!1,error_message:k,error_code:j??null},createConnectionInfo(b,_)),createTransactionInfo(_,d))}function createDisconnectionEvent(b,_,d){return Object.assign({type:"disconnection",scope:d},createConnectionInfo(b,_))}class BrowserEventDispatcher{constructor(){this.window=getWindow$2()}dispatchEvent(_,d){var k;return __awaiter(this,void 0,void 0,function*(){const j=new CustomEvent(_,{detail:d});(k=this.window)===null||k===void 0||k.dispatchEvent(j)})}addEventListener(_,d,k){var j;return __awaiter(this,void 0,void 0,function*(){return(j=this.window)===null||j===void 0||j.addEventListener(_,d,k),()=>{var $;return($=this.window)===null||$===void 0?void 0:$.removeEventListener(_,d)}})}}class TonConnectTracker{constructor(_){var d;this.eventPrefix="ton-connect-",this.tonConnectUiVersion=null,this.eventDispatcher=(d=_==null?void 0:_.eventDispatcher)!==null&&d!==void 0?d:new BrowserEventDispatcher,this.tonConnectSdkVersion=_.tonConnectSdkVersion,this.init().catch()}get version(){return createVersionInfo({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return __awaiter(this,void 0,void 0,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectUiVersion=yield this.requestTonConnectUiVersion()}catch{}})}setRequestVersionHandler(){return __awaiter(this,void 0,void 0,function*(){yield this.eventDispatcher.addEventListener("ton-connect-request-version",()=>__awaiter(this,void 0,void 0,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-response-version",createResponseVersionEvent(this.tonConnectSdkVersion))}))})}requestTonConnectUiVersion(){return __awaiter(this,void 0,void 0,function*(){return new Promise((_,d)=>__awaiter(this,void 0,void 0,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-ui-response-version",k=>{_(k.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-ui-request-version",createRequestVersionEvent())}catch(k){d(k)}}))})}dispatchUserActionEvent(_){try{this.eventDispatcher.dispatchEvent(`${this.eventPrefix}${_.type}`,_).catch()}catch{}}trackConnectionStarted(..._){try{const d=createConnectionStartedEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}trackConnectionCompleted(..._){try{const d=createConnectionCompletedEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}trackConnectionError(..._){try{const d=createConnectionErrorEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringStarted(..._){try{const d=createConnectionRestoringStartedEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringCompleted(..._){try{const d=createConnectionRestoringCompletedEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringError(..._){try{const d=createConnectionRestoringErrorEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}trackDisconnection(..._){try{const d=createDisconnectionEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSentForSignature(..._){try{const d=createTransactionSentForSignatureEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSigned(..._){try{const d=createTransactionSignedEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSigningFailed(..._){try{const d=createTransactionSigningFailedEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}}const tonConnectSdkVersion="3.0.6-beta.0";class TonConnect{constructor(_){if(this.walletsList=new WalletsListManager,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.dappSettings={manifestUrl:(_==null?void 0:_.manifestUrl)||getWebPageManifest(),storage:(_==null?void 0:_.storage)||new DefaultStorage},this.walletsList=new WalletsListManager({walletsListSource:_==null?void 0:_.walletsListSource,cacheTTLMs:_==null?void 0:_.walletsListCacheTTLMs}),this.tracker=new TonConnectTracker({eventDispatcher:_==null?void 0:_.eventDispatcher,tonConnectSdkVersion}),!this.dappSettings.manifestUrl)throw new DappMetadataError("Dapp tonconnect-manifest.json must be specified if window.location.origin is undefined. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest");this.bridgeConnectionStorage=new BridgeConnectionStorage(this.dappSettings.storage),_!=null&&_.disableAutoPauseConnection||this.addWindowFocusAndBlurSubscriptions()}static getWallets(){return this.walletsList.getWallets()}get connected(){return this._wallet!==null}get account(){var _;return((_=this._wallet)===null||_===void 0?void 0:_.account)||null}get wallet(){return this._wallet}set wallet(_){this._wallet=_,this.statusChangeSubscriptions.forEach(d=>d(this._wallet))}getWallets(){return this.walletsList.getWallets()}onStatusChange(_,d){return this.statusChangeSubscriptions.push(_),d&&this.statusChangeErrorSubscriptions.push(d),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter(k=>k!==_),d&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter(k=>k!==d))}}connect(_,d){var k,j;const $={};if(typeof d=="object"&&"tonProof"in d&&($.request=d),typeof d=="object"&&("openingDeadlineMS"in d||"signal"in d||"request"in d)&&($.request=d==null?void 0:d.request,$.openingDeadlineMS=d==null?void 0:d.openingDeadlineMS,$.signal=d==null?void 0:d.signal),this.connected)throw new WalletAlreadyConnectedError;const et=createAbortController($==null?void 0:$.signal);if((k=this.abortController)===null||k===void 0||k.abort(),this.abortController=et,et.signal.aborted)throw new TonConnectError("Connection was aborted");return(j=this.provider)===null||j===void 0||j.closeConnection(),this.provider=this.createProvider(_),et.signal.addEventListener("abort",()=>{var tt;(tt=this.provider)===null||tt===void 0||tt.closeConnection(),this.provider=null}),this.tracker.trackConnectionStarted(),this.provider.connect(this.createConnectRequest($==null?void 0:$.request),{openingDeadlineMS:$==null?void 0:$.openingDeadlineMS,signal:et.signal})}restoreConnection(_){var d,k;return __awaiter(this,void 0,void 0,function*(){this.tracker.trackConnectionRestoringStarted();const j=createAbortController(_==null?void 0:_.signal);if((d=this.abortController)===null||d===void 0||d.abort(),this.abortController=j,j.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}const[$,et]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);if(j.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}let tt=null;try{switch($){case"http":tt=yield BridgeProvider.fromStorage(this.dappSettings.storage);break;case"injected":tt=yield InjectedProvider.fromStorage(this.dappSettings.storage);break;default:if(et)tt=this.createProvider(et);else return}}catch{this.tracker.trackConnectionRestoringError("Provider is not restored"),yield this.bridgeConnectionStorage.removeConnection(),tt==null||tt.closeConnection(),tt=null;return}if(j.signal.aborted){tt==null||tt.closeConnection(),this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}if(!tt){logError$1("Provider is not restored"),this.tracker.trackConnectionRestoringError("Provider is not restored");return}(k=this.provider)===null||k===void 0||k.closeConnection(),this.provider=tt,tt.listen(this.walletEventsListener.bind(this));const rt=()=>{this.tracker.trackConnectionRestoringError("Connection restoring was aborted"),tt==null||tt.closeConnection(),tt=null};j.signal.addEventListener("abort",rt);const nt=callForSuccess(at=>__awaiter(this,void 0,void 0,function*(){yield tt==null?void 0:tt.restoreConnection({openingDeadlineMS:_==null?void 0:_.openingDeadlineMS,signal:at.signal}),j.signal.removeEventListener("abort",rt),this.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):this.tracker.trackConnectionRestoringError("Connection restoring failed")}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:2e3,signal:_==null?void 0:_.signal}),ot=new Promise(at=>setTimeout(()=>at(),12e3));return Promise.race([nt,ot])})}sendTransaction(_,d){return __awaiter(this,void 0,void 0,function*(){const k={};typeof d=="function"?k.onRequestSent=d:(k.onRequestSent=d==null?void 0:d.onRequestSent,k.signal=d==null?void 0:d.signal);const j=createAbortController(k==null?void 0:k.signal);if(j.signal.aborted)throw new TonConnectError("Transaction sending was aborted");this.checkConnection(),checkSendTransactionSupport(this.wallet.device.features,{requiredMessagesNumber:_.messages.length}),this.tracker.trackTransactionSentForSignature(this.wallet,_);const{validUntil:$}=_,et=__rest(_,["validUntil"]),tt=_.from||this.account.address,rt=_.network||this.account.chain,nt=yield this.provider.sendRequest(sendTransactionParser.convertToRpcRequest(Object.assign(Object.assign({},et),{valid_until:$,from:tt,network:rt})),{onRequestSent:k.onRequestSent,signal:j.signal});if(sendTransactionParser.isError(nt))return this.tracker.trackTransactionSigningFailed(this.wallet,_,nt.error.message,nt.error.code),sendTransactionParser.parseAndThrowError(nt);const ot=sendTransactionParser.convertFromRpcResponse(nt);return this.tracker.trackTransactionSigned(this.wallet,_,ot),ot})}disconnect(_){var d;return __awaiter(this,void 0,void 0,function*(){if(!this.connected)throw new WalletNotConnectedError;const k=createAbortController(_==null?void 0:_.signal),j=this.abortController;if(this.abortController=k,k.signal.aborted)throw new TonConnectError("Disconnect was aborted");this.onWalletDisconnected("dapp"),yield(d=this.provider)===null||d===void 0?void 0:d.disconnect({signal:k.signal}),j==null||j.abort()})}pauseConnection(){var _;((_=this.provider)===null||_===void 0?void 0:_.type)==="http"&&this.provider.pause()}unPauseConnection(){var _;return((_=this.provider)===null||_===void 0?void 0:_.type)!=="http"?Promise.resolve():this.provider.unPause()}addWindowFocusAndBlurSubscriptions(){const _=getDocument();if(_)try{_.addEventListener("visibilitychange",()=>{_.hidden?this.pauseConnection():this.unPauseConnection().catch()})}catch(d){logError$1("Cannot subscribe to the document.visibilitychange: ",d)}}createProvider(_){let d;return!Array.isArray(_)&&isWalletConnectionSourceJS(_)?d=new InjectedProvider(this.dappSettings.storage,_.jsBridgeKey):d=new BridgeProvider(this.dappSettings.storage,_),d.listen(this.walletEventsListener.bind(this)),d}walletEventsListener(_){switch(_.event){case"connect":this.onWalletConnected(_.payload);break;case"connect_error":this.onWalletConnectError(_.payload);break;case"disconnect":this.onWalletDisconnected("wallet")}}onWalletConnected(_){const d=_.items.find($=>$.name==="ton_addr"),k=_.items.find($=>$.name==="ton_proof");if(!d)throw new TonConnectError("ton_addr connection item was not found");const j={device:_.device,provider:this.provider.type,account:{address:d.address,chain:d.network,walletStateInit:d.walletStateInit,publicKey:d.publicKey}};k&&(j.connectItems={tonProof:k}),this.wallet=j,this.tracker.trackConnectionCompleted(j)}onWalletConnectError(_){const d=connectErrorsParser.parseError(_);if(this.statusChangeErrorSubscriptions.forEach(k=>k(d)),logDebug$1(d),this.tracker.trackConnectionError(_.message,_.code),d instanceof ManifestNotFoundError||d instanceof ManifestContentErrorError)throw logError$1(d),d}onWalletDisconnected(_){this.tracker.trackDisconnection(this.wallet,_),this.wallet=null}checkConnection(){if(!this.connected)throw new WalletNotConnectedError}createConnectRequest(_){const d=[{name:"ton_addr"}];return _!=null&&_.tonProof&&d.push({name:"ton_proof",payload:_.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:d}}}TonConnect.walletsList=new WalletsListManager;TonConnect.isWalletInjected=b=>InjectedProvider.isWalletInjected(b);TonConnect.isInsideWalletBrowser=b=>InjectedProvider.isInsideWalletBrowser(b);const noBounceableTag=81,testOnlyTag=128;function toUserFriendlyAddress(b,_=!1){const{wc:d,hex:k}=parseHexAddress(b);let j=noBounceableTag;_&&(j|=testOnlyTag);const $=new Int8Array(34);$[0]=j,$[1]=d,$.set(k,2);const et=new Uint8Array(36);return et.set($),et.set(crc16($),34),Base64.encode(et).replace(/\+/g,"-").replace(/\//g,"_")}function parseHexAddress(b){if(!b.includes(":"))throw new WrongAddressError(`Wrong address ${b}. Address must include ":".`);const _=b.split(":");if(_.length!==2)throw new WrongAddressError(`Wrong address ${b}. Address must include ":" only once.`);const d=parseInt(_[0]);if(d!==0&&d!==-1)throw new WrongAddressError(`Wrong address ${b}. WC must be eq 0 or -1, but ${d} received.`);const k=_[1];if((k==null?void 0:k.length)!==64)throw new WrongAddressError(`Wrong address ${b}. Hex part must be 64bytes length, but ${k==null?void 0:k.length} received.`);return{wc:d,hex:hexToBytes(k)}}function crc16(b){let d=0;const k=new Uint8Array(b.length+2);k.set(b);for(let j of k){let $=128;for(;$>0;)d<<=1,j&$&&(d+=1),$>>=1,d>65535&&(d&=65535,d^=4129)}return new Uint8Array([Math.floor(d/256),d%256])}const toByteMap={};for(let b=0;b<=255;b++){let _=b.toString(16);_.length<2&&(_="0"+_),toByteMap[_]=b}function hexToBytes(b){b=b.toLowerCase();const _=b.length;if(_%2!==0)throw new ParseHexError("Hex string must have length a multiple of 2: "+b);const d=_/2,k=new Uint8Array(d);for(let j=0;j0?tr.length===2?typeof tr[1]==tt?this[tr[0]]=tr[1].call(this,gr):this[tr[0]]=tr[1]:tr.length===3?typeof tr[1]===tt&&!(tr[1].exec&&tr[1].test)?this[tr[0]]=gr?tr[1].call(this,gr,tr[2]):k:this[tr[0]]=gr?gr.replace(tr[1],tr[2]):k:tr.length===4&&(this[tr[0]]=gr?tr[3].call(this,gr.replace(tr[1],tr[2])):k):this[tr]=gr||k;pn+=2}},Cn=function(Ht,Xt){for(var pn in Xt)if(typeof Xt[pn]===nt&&Xt[pn].length>0){for(var Tn=0;Tn2&&(Xn[it]="iPad",Xn[ct]=st),Xn},this.getEngine=function(){var Xn={};return Xn[dt]=k,Xn[ft]=k,Pn.call(Xn,Tn,yr.engine),Xn},this.getOS=function(){var Xn={};return Xn[dt]=k,Xn[ft]=k,Pn.call(Xn,Tn,yr.os),tr&&!Xn[dt]&&cr&&cr.platform&&cr.platform!="Unknown"&&(Xn[dt]=cr.platform.replace(/chrome os/i,wn).replace(/macos/i,fn)),Xn},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Tn},this.setUA=function(Xn){return Tn=typeof Xn===ot&&Xn.length>St?Nn(Xn,St):Xn,this},this.setUA(Tn),this};Ln.VERSION=j,Ln.BROWSER=hn([dt,ft,at]),Ln.CPU=hn([lt]),Ln.DEVICE=hn([it,ht,ct,ut,pt,wt,st,yt,vt]),Ln.ENGINE=Ln.OS=hn([dt,ft]),b.exports&&(_=b.exports=Ln),_.UAParser=Ln;var Dn=typeof d!==rt&&(d.jQuery||d.Zepto);if(Dn&&!Dn.ua){var An=new Ln;Dn.ua=An.getResult(),Dn.ua.get=function(){return An.getUA()},Dn.ua.set=function(Ht){An.setUA(Ht);var Xt=An.getResult();for(var pn in Xt)Dn.ua[pn]=Xt[pn]}}})(typeof window=="object"?window:commonjsGlobal)})(uaParser,uaParser.exports);var uaParserExports=uaParser.exports;const UAParser=getDefaultExportFromCjs(uaParserExports);var isMergeableObject=function(_){return isNonNullObject(_)&&!isSpecial(_)};function isNonNullObject(b){return!!b&&typeof b=="object"}function isSpecial(b){var _=Object.prototype.toString.call(b);return _==="[object RegExp]"||_==="[object Date]"||isReactElement(b)}var canUseSymbol=typeof Symbol=="function"&&Symbol.for,REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(b){return b.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(b){return Array.isArray(b)?[]:{}}function cloneUnlessOtherwiseSpecified(b,_){return _.clone!==!1&&_.isMergeableObject(b)?deepmerge(emptyTarget(b),b,_):b}function defaultArrayMerge(b,_,d){return b.concat(_).map(function(k){return cloneUnlessOtherwiseSpecified(k,d)})}function getMergeFunction(b,_){if(!_.customMerge)return deepmerge;var d=_.customMerge(b);return typeof d=="function"?d:deepmerge}function getEnumerableOwnPropertySymbols(b){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(b).filter(function(_){return Object.propertyIsEnumerable.call(b,_)}):[]}function getKeys(b){return Object.keys(b).concat(getEnumerableOwnPropertySymbols(b))}function propertyIsOnObject(b,_){try{return _ in b}catch{return!1}}function propertyIsUnsafe(b,_){return propertyIsOnObject(b,_)&&!(Object.hasOwnProperty.call(b,_)&&Object.propertyIsEnumerable.call(b,_))}function mergeObject(b,_,d){var k={};return d.isMergeableObject(b)&&getKeys(b).forEach(function(j){k[j]=cloneUnlessOtherwiseSpecified(b[j],d)}),getKeys(_).forEach(function(j){propertyIsUnsafe(b,j)||(propertyIsOnObject(b,j)&&d.isMergeableObject(_[j])?k[j]=getMergeFunction(j,d)(b[j],_[j],d):k[j]=cloneUnlessOtherwiseSpecified(_[j],d))}),k}function deepmerge(b,_,d){d=d||{},d.arrayMerge=d.arrayMerge||defaultArrayMerge,d.isMergeableObject=d.isMergeableObject||isMergeableObject,d.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var k=Array.isArray(_),j=Array.isArray(b),$=k===j;return $?k?d.arrayMerge(b,_,d):mergeObject(b,_,d):cloneUnlessOtherwiseSpecified(_,d)}deepmerge.all=function(_,d){if(!Array.isArray(_))throw new Error("first argument should be an array");return _.reduce(function(k,j){return deepmerge(k,j,d)},{})};var deepmerge_1=deepmerge,cjs=deepmerge_1;const deepmerge$1=getDefaultExportFromCjs(cjs);var classnames={exports:{}};/*! +`+_:""}`,Object.setPrototypeOf(this,TonConnectError.prototype)}get info(){return""}}TonConnectError.prefix="[TON_CONNECT_SDK_ERROR]";class DappMetadataError extends TonConnectError{get info(){return"Passed DappMetadata is in incorrect format."}constructor(..._){super(..._),Object.setPrototypeOf(this,DappMetadataError.prototype)}}class ManifestContentErrorError extends TonConnectError{get info(){return"Passed `tonconnect-manifest.json` contains errors. Check format of your manifest. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(..._){super(..._),Object.setPrototypeOf(this,ManifestContentErrorError.prototype)}}class ManifestNotFoundError extends TonConnectError{get info(){return"Manifest not found. Make sure you added `tonconnect-manifest.json` to the root of your app or passed correct manifestUrl. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(..._){super(..._),Object.setPrototypeOf(this,ManifestNotFoundError.prototype)}}class WalletAlreadyConnectedError extends TonConnectError{get info(){return"Wallet connection called but wallet already connected. To avoid the error, disconnect the wallet before doing a new connection."}constructor(..._){super(..._),Object.setPrototypeOf(this,WalletAlreadyConnectedError.prototype)}}class WalletNotConnectedError extends TonConnectError{get info(){return"Send transaction or other protocol methods called while wallet is not connected."}constructor(..._){super(..._),Object.setPrototypeOf(this,WalletNotConnectedError.prototype)}}function isWalletConnectionSourceJS(b){return"jsBridgeKey"in b}class UserRejectsError extends TonConnectError{get info(){return"User rejects the action in the wallet."}constructor(..._){super(..._),Object.setPrototypeOf(this,UserRejectsError.prototype)}}class BadRequestError extends TonConnectError{get info(){return"Request to the wallet contains errors."}constructor(..._){super(..._),Object.setPrototypeOf(this,BadRequestError.prototype)}}class UnknownAppError extends TonConnectError{get info(){return"App tries to send rpc request to the injected wallet while not connected."}constructor(..._){super(..._),Object.setPrototypeOf(this,UnknownAppError.prototype)}}class WalletNotInjectedError extends TonConnectError{get info(){return"There is an attempt to connect to the injected wallet while it is not exists in the webpage."}constructor(..._){super(..._),Object.setPrototypeOf(this,WalletNotInjectedError.prototype)}}class FetchWalletsError extends TonConnectError{get info(){return"An error occurred while fetching the wallets list."}constructor(..._){super(..._),Object.setPrototypeOf(this,FetchWalletsError.prototype)}}class WrongAddressError extends TonConnectError{get info(){return"Passed address is in incorrect format."}constructor(..._){super(..._),Object.setPrototypeOf(this,WrongAddressError.prototype)}}class ParseHexError extends TonConnectError{get info(){return"Passed hex is in incorrect format."}constructor(..._){super(..._),Object.setPrototypeOf(this,ParseHexError.prototype)}}class UnknownError extends TonConnectError{constructor(..._){super(..._),Object.setPrototypeOf(this,UnknownError.prototype)}}const connectEventErrorsCodes={[CONNECT_EVENT_ERROR_CODES.UNKNOWN_ERROR]:UnknownError,[CONNECT_EVENT_ERROR_CODES.USER_REJECTS_ERROR]:UserRejectsError,[CONNECT_EVENT_ERROR_CODES.BAD_REQUEST_ERROR]:BadRequestError,[CONNECT_EVENT_ERROR_CODES.UNKNOWN_APP_ERROR]:UnknownAppError,[CONNECT_EVENT_ERROR_CODES.MANIFEST_NOT_FOUND_ERROR]:ManifestNotFoundError,[CONNECT_EVENT_ERROR_CODES.MANIFEST_CONTENT_ERROR]:ManifestContentErrorError};class ConnectErrorsParser{parseError(_){let d=UnknownError;return _.code in connectEventErrorsCodes&&(d=connectEventErrorsCodes[_.code]||UnknownError),new d(_.message)}}const connectErrorsParser=new ConnectErrorsParser;class RpcParser{isError(_){return"error"in _}}const sendTransactionErrors={[SEND_TRANSACTION_ERROR_CODES.UNKNOWN_ERROR]:UnknownError,[SEND_TRANSACTION_ERROR_CODES.USER_REJECTS_ERROR]:UserRejectsError,[SEND_TRANSACTION_ERROR_CODES.BAD_REQUEST_ERROR]:BadRequestError,[SEND_TRANSACTION_ERROR_CODES.UNKNOWN_APP_ERROR]:UnknownAppError};class SendTransactionParser extends RpcParser{convertToRpcRequest(_){return{method:"sendTransaction",params:[JSON.stringify(_)]}}parseAndThrowError(_){let d=UnknownError;throw _.error.code in sendTransactionErrors&&(d=sendTransactionErrors[_.error.code]||UnknownError),new d(_.error.message)}convertFromRpcResponse(_){return{boc:_.result}}}const sendTransactionParser=new SendTransactionParser;class HttpBridgeGatewayStorage{constructor(_,d){this.storage=_,this.storeKey="ton-connect-storage_http-bridge-gateway::"+d}storeLastEventId(_){return __awaiter(this,void 0,void 0,function*(){return this.storage.setItem(this.storeKey,_)})}removeLastEventId(){return __awaiter(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getLastEventId(){return __awaiter(this,void 0,void 0,function*(){const _=yield this.storage.getItem(this.storeKey);return _||null})}}function removeUrlLastSlash(b){return b.slice(-1)==="/"?b.slice(0,-1):b}function addPathToUrl(b,_){return removeUrlLastSlash(b)+"/"+_}function isTelegramUrl(b){if(!b)return!1;const _=new URL(b);return _.protocol==="tg:"||_.hostname==="t.me"}function encodeTelegramUrlParameters(b){return b.replaceAll(".","%2E").replaceAll("-","%2D").replaceAll("_","%5F").replaceAll("&","-").replaceAll("=","__").replaceAll("%","--")}function delay(b,_){return __awaiter(this,void 0,void 0,function*(){return new Promise((d,k)=>{var j,$;if(!((j=_==null?void 0:_.signal)===null||j===void 0)&&j.aborted){k(new TonConnectError("Delay aborted"));return}const et=setTimeout(()=>d(),b);($=_==null?void 0:_.signal)===null||$===void 0||$.addEventListener("abort",()=>{clearTimeout(et),k(new TonConnectError("Delay aborted"))})})})}function createAbortController(b){const _=new AbortController;return b!=null&&b.aborted?_.abort():b==null||b.addEventListener("abort",()=>_.abort(),{once:!0}),_}function callForSuccess(b,_){var d,k;return __awaiter(this,void 0,void 0,function*(){const j=(d=_==null?void 0:_.attempts)!==null&&d!==void 0?d:10,$=(k=_==null?void 0:_.delayMs)!==null&&k!==void 0?k:200,et=createAbortController(_==null?void 0:_.signal);if(typeof b!="function")throw new TonConnectError(`Expected a function, got ${typeof b}`);let tt=0,rt;for(;tt__awaiter(this,void 0,void 0,function*(){if($=at??null,et==null||et.abort(),et=createAbortController(at),et.signal.aborted)throw new TonConnectError("Resource creation was aborted");k=it??null;const dt=b(et.signal,...it);j=dt;const ct=yield dt;if(j!==dt&&ct!==d)throw yield _(ct),new TonConnectError("Resource creation was aborted by a new resource creation");return d=ct,d});return{create:tt,current:()=>d??null,dispose:()=>__awaiter(this,void 0,void 0,function*(){try{const at=d;d=null;const it=j;j=null;try{et==null||et.abort()}catch{}yield Promise.allSettled([at?_(at):Promise.resolve(),it?_(yield it):Promise.resolve()])}catch{}}),recreate:at=>__awaiter(this,void 0,void 0,function*(){const it=d,dt=j,ct=k,ht=$;if(yield delay(at),it===d&&dt===j&&ct===k&&ht===$)return yield tt($,...ct??[]);throw new TonConnectError("Resource recreation was aborted by a new resource creation")})}}function timeout(b,_){const d=_==null?void 0:_.timeout,k=_==null?void 0:_.signal,j=createAbortController(k);return new Promise(($,et)=>__awaiter(this,void 0,void 0,function*(){if(j.signal.aborted){et(new TonConnectError("Operation aborted"));return}let tt;typeof d<"u"&&(tt=setTimeout(()=>{j.abort(),et(new TonConnectError(`Timeout after ${d}ms`))},d)),j.signal.addEventListener("abort",()=>{clearTimeout(tt),et(new TonConnectError("Operation aborted"))},{once:!0});const rt={timeout:d,abort:j.signal};yield b((...nt)=>{clearTimeout(tt),$(...nt)},()=>{clearTimeout(tt),et()},rt)}))}class BridgeGateway{constructor(_,d,k,j,$){this.bridgeUrl=d,this.sessionId=k,this.listener=j,this.errorsListener=$,this.ssePath="events",this.postPath="message",this.heartbeatMessage="heartbeat",this.defaultTtl=300,this.defaultReconnectDelay=2e3,this.defaultResendDelay=5e3,this.eventSource=createResource$1((et,tt)=>__awaiter(this,void 0,void 0,function*(){const rt={bridgeUrl:this.bridgeUrl,ssePath:this.ssePath,sessionId:this.sessionId,bridgeGatewayStorage:this.bridgeGatewayStorage,errorHandler:this.errorsHandler.bind(this),messageHandler:this.messagesHandler.bind(this),signal:et,openingDeadlineMS:tt};return yield createEventSource(rt)}),et=>__awaiter(this,void 0,void 0,function*(){et.close()})),this.bridgeGatewayStorage=new HttpBridgeGatewayStorage(_,d)}get isReady(){const _=this.eventSource.current();return(_==null?void 0:_.readyState)===EventSource.OPEN}get isClosed(){const _=this.eventSource.current();return(_==null?void 0:_.readyState)!==EventSource.OPEN}get isConnecting(){const _=this.eventSource.current();return(_==null?void 0:_.readyState)===EventSource.CONNECTING}registerSession(_){return __awaiter(this,void 0,void 0,function*(){yield this.eventSource.create(_==null?void 0:_.signal,_==null?void 0:_.openingDeadlineMS)})}send(_,d,k,j){var $;return __awaiter(this,void 0,void 0,function*(){const et={};typeof j=="number"?et.ttl=j:(et.ttl=j==null?void 0:j.ttl,et.signal=j==null?void 0:j.signal,et.attempts=j==null?void 0:j.attempts);const tt=new URL(addPathToUrl(this.bridgeUrl,this.postPath));tt.searchParams.append("client_id",this.sessionId),tt.searchParams.append("to",d),tt.searchParams.append("ttl",((et==null?void 0:et.ttl)||this.defaultTtl).toString()),tt.searchParams.append("topic",k);const rt=Base64.encode(_);yield callForSuccess(nt=>__awaiter(this,void 0,void 0,function*(){const ot=yield this.post(tt,rt,nt.signal);if(!ot.ok)throw new TonConnectError(`Bridge send failed, status ${ot.status}`)}),{attempts:($=et==null?void 0:et.attempts)!==null&&$!==void 0?$:Number.MAX_SAFE_INTEGER,delayMs:this.defaultResendDelay,signal:et==null?void 0:et.signal})})}pause(){this.eventSource.dispose().catch(_=>logError$1(`Bridge pause failed, ${_}`))}unPause(){return __awaiter(this,void 0,void 0,function*(){yield this.eventSource.recreate(0)})}close(){return __awaiter(this,void 0,void 0,function*(){yield this.eventSource.dispose().catch(_=>logError$1(`Bridge close failed, ${_}`))})}setListener(_){this.listener=_}setErrorsListener(_){this.errorsListener=_}post(_,d,k){return __awaiter(this,void 0,void 0,function*(){const j=yield fetch(_,{method:"post",body:d,signal:k});if(!j.ok)throw new TonConnectError(`Bridge send failed, status ${j.status}`);return j})}errorsHandler(_,d){return __awaiter(this,void 0,void 0,function*(){if(this.isConnecting)throw _.close(),new TonConnectError("Bridge error, failed to connect");if(this.isReady){try{this.errorsListener(d)}catch{}return}if(this.isClosed)return _.close(),logDebug$1(`Bridge reconnecting, ${this.defaultReconnectDelay}ms delay`),yield this.eventSource.recreate(this.defaultReconnectDelay);throw new TonConnectError("Bridge error, unknown state")})}messagesHandler(_){return __awaiter(this,void 0,void 0,function*(){if(_.data===this.heartbeatMessage||(yield this.bridgeGatewayStorage.storeLastEventId(_.lastEventId),this.isClosed))return;let d;try{d=JSON.parse(_.data)}catch(k){throw new TonConnectError(`Bridge message parse failed, message ${k.data}`)}this.listener(d)})}}function createEventSource(b){return __awaiter(this,void 0,void 0,function*(){return yield timeout((_,d,k)=>__awaiter(this,void 0,void 0,function*(){var j;const et=createAbortController(k.signal).signal;if(et.aborted){d(new TonConnectError("Bridge connection aborted"));return}const tt=new URL(addPathToUrl(b.bridgeUrl,b.ssePath));tt.searchParams.append("client_id",b.sessionId);const rt=yield b.bridgeGatewayStorage.getLastEventId();if(rt&&tt.searchParams.append("last_event_id",rt),et.aborted){d(new TonConnectError("Bridge connection aborted"));return}const nt=new EventSource(tt.toString());nt.onerror=ot=>__awaiter(this,void 0,void 0,function*(){if(et.aborted){nt.close(),d(new TonConnectError("Bridge connection aborted"));return}try{const at=yield b.errorHandler(nt,ot);at!==nt&&nt.close(),at&&at!==nt&&_(at)}catch(at){nt.close(),d(at)}}),nt.onopen=()=>{if(et.aborted){nt.close(),d(new TonConnectError("Bridge connection aborted"));return}_(nt)},nt.onmessage=ot=>{if(et.aborted){nt.close(),d(new TonConnectError("Bridge connection aborted"));return}b.messageHandler(ot)},(j=b.signal)===null||j===void 0||j.addEventListener("abort",()=>{nt.close(),d(new TonConnectError("Bridge connection aborted"))})}),{timeout:b.openingDeadlineMS,signal:b.signal})})}function isPendingConnectionHttp(b){return!("connectEvent"in b)}class BridgeConnectionStorage{constructor(_){this.storage=_,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(_){return __awaiter(this,void 0,void 0,function*(){if(_.type==="injected")return this.storage.setItem(this.storeKey,JSON.stringify(_));if(!isPendingConnectionHttp(_)){const k={sessionKeyPair:_.session.sessionCrypto.stringifyKeypair(),walletPublicKey:_.session.walletPublicKey,bridgeUrl:_.session.bridgeUrl},j={type:"http",connectEvent:_.connectEvent,session:k,lastWalletEventId:_.lastWalletEventId,nextRpcRequestId:_.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(j))}const d={type:"http",connectionSource:_.connectionSource,sessionCrypto:_.sessionCrypto.stringifyKeypair()};return this.storage.setItem(this.storeKey,JSON.stringify(d))})}removeConnection(){return __awaiter(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getConnection(){return __awaiter(this,void 0,void 0,function*(){const _=yield this.storage.getItem(this.storeKey);if(!_)return null;const d=JSON.parse(_);if(d.type==="injected")return d;if("connectEvent"in d){const k=new SessionCrypto(d.session.sessionKeyPair);return{type:"http",connectEvent:d.connectEvent,lastWalletEventId:d.lastWalletEventId,nextRpcRequestId:d.nextRpcRequestId,session:{sessionCrypto:k,bridgeUrl:d.session.bridgeUrl,walletPublicKey:d.session.walletPublicKey}}}return{type:"http",sessionCrypto:new SessionCrypto(d.sessionCrypto),connectionSource:d.connectionSource}})}getHttpConnection(){return __awaiter(this,void 0,void 0,function*(){const _=yield this.getConnection();if(!_)throw new TonConnectError("Trying to read HTTP connection source while nothing is stored");if(_.type==="injected")throw new TonConnectError("Trying to read HTTP connection source while injected connection is stored");return _})}getHttpPendingConnection(){return __awaiter(this,void 0,void 0,function*(){const _=yield this.getConnection();if(!_)throw new TonConnectError("Trying to read HTTP connection source while nothing is stored");if(_.type==="injected")throw new TonConnectError("Trying to read HTTP connection source while injected connection is stored");if(!isPendingConnectionHttp(_))throw new TonConnectError("Trying to read HTTP-pending connection while http connection is stored");return _})}getInjectedConnection(){return __awaiter(this,void 0,void 0,function*(){const _=yield this.getConnection();if(!_)throw new TonConnectError("Trying to read Injected bridge connection source while nothing is stored");if((_==null?void 0:_.type)==="http")throw new TonConnectError("Trying to read Injected bridge connection source while HTTP connection is stored");return _})}storedConnectionType(){return __awaiter(this,void 0,void 0,function*(){const _=yield this.storage.getItem(this.storeKey);return _?JSON.parse(_).type:null})}storeLastWalletEventId(_){return __awaiter(this,void 0,void 0,function*(){const d=yield this.getConnection();if(d&&d.type==="http"&&!isPendingConnectionHttp(d))return d.lastWalletEventId=_,this.storeConnection(d)})}getLastWalletEventId(){return __awaiter(this,void 0,void 0,function*(){const _=yield this.getConnection();if(_&&"lastWalletEventId"in _)return _.lastWalletEventId})}increaseNextRpcRequestId(){return __awaiter(this,void 0,void 0,function*(){const _=yield this.getConnection();if(_&&"nextRpcRequestId"in _){const d=_.nextRpcRequestId||0;return _.nextRpcRequestId=d+1,this.storeConnection(_)}})}getNextRpcRequestId(){return __awaiter(this,void 0,void 0,function*(){const _=yield this.getConnection();return _&&"nextRpcRequestId"in _&&_.nextRpcRequestId||0})}}const PROTOCOL_VERSION=2;class BridgeProvider{constructor(_,d){this.storage=_,this.walletConnectionSource=d,this.type="http",this.standardUniversalLink="tc://",this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.defaultOpeningDeadlineMS=12e3,this.defaultRetryTimeoutMS=2e3,this.connectionStorage=new BridgeConnectionStorage(_)}static fromStorage(_){return __awaiter(this,void 0,void 0,function*(){const k=yield new BridgeConnectionStorage(_).getHttpConnection();return isPendingConnectionHttp(k)?new BridgeProvider(_,k.connectionSource):new BridgeProvider(_,{bridgeUrl:k.session.bridgeUrl})})}connect(_,d){var k;const j=createAbortController(d==null?void 0:d.signal);(k=this.abortController)===null||k===void 0||k.abort(),this.abortController=j,this.closeGateways();const $=new SessionCrypto;this.session={sessionCrypto:$,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:$}).then(()=>__awaiter(this,void 0,void 0,function*(){j.signal.aborted||(yield callForSuccess(tt=>{var rt;return this.openGateways($,{openingDeadlineMS:(rt=d==null?void 0:d.openingDeadlineMS)!==null&&rt!==void 0?rt:this.defaultOpeningDeadlineMS,signal:tt==null?void 0:tt.signal})},{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:j.signal}))}));const et="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(et,_)}restoreConnection(_){var d,k;return __awaiter(this,void 0,void 0,function*(){const j=createAbortController(_==null?void 0:_.signal);if((d=this.abortController)===null||d===void 0||d.abort(),this.abortController=j,j.signal.aborted)return;this.closeGateways();const $=yield this.connectionStorage.getHttpConnection();if(!$||j.signal.aborted)return;const et=(k=_==null?void 0:_.openingDeadlineMS)!==null&&k!==void 0?k:this.defaultOpeningDeadlineMS;if(isPendingConnectionHttp($))return this.session={sessionCrypto:$.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},yield this.openGateways($.sessionCrypto,{openingDeadlineMS:et,signal:j==null?void 0:j.signal});if(Array.isArray(this.walletConnectionSource))throw new TonConnectError("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");if(this.session=$.session,this.gateway&&(logDebug$1("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new BridgeGateway(this.storage,this.walletConnectionSource.bridgeUrl,$.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),!j.signal.aborted){this.listeners.forEach(tt=>tt($.connectEvent));try{yield callForSuccess(tt=>this.gateway.registerSession({openingDeadlineMS:et,signal:tt.signal}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:j.signal})}catch{yield this.disconnect({signal:j.signal});return}}})}sendRequest(_,d){const k={};return typeof d=="function"?k.onRequestSent=d:(k.onRequestSent=d==null?void 0:d.onRequestSent,k.signal=d==null?void 0:d.signal,k.attempts=d==null?void 0:d.attempts),new Promise((j,$)=>__awaiter(this,void 0,void 0,function*(){var et;if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new TonConnectError("Trying to send bridge request without session");const tt=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),logDebug$1("Send http-bridge request:",Object.assign(Object.assign({},_),{id:tt}));const rt=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},_),{id:tt})),hexToByteArray(this.session.walletPublicKey));try{yield this.gateway.send(rt,this.session.walletPublicKey,_.method,{attempts:k==null?void 0:k.attempts,signal:k==null?void 0:k.signal}),(et=k==null?void 0:k.onRequestSent)===null||et===void 0||et.call(k),this.pendingRequests.set(tt.toString(),j)}catch(nt){$(nt)}}))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(_){return __awaiter(this,void 0,void 0,function*(){return new Promise(d=>__awaiter(this,void 0,void 0,function*(){let k=!1,j=null;const $=()=>{k||(k=!0,this.removeBridgeAndSession().then(d))};try{this.closeGateways();const et=createAbortController(_==null?void 0:_.signal);j=setTimeout(()=>{et.abort()},this.defaultOpeningDeadlineMS),yield this.sendRequest({method:"disconnect",params:[]},{onRequestSent:$,signal:et.signal,attempts:1})}catch(et){logDebug$1("Disconnect error:",et),k||this.removeBridgeAndSession().then(d)}finally{j&&clearTimeout(j),$()}}))})}listen(_){return this.listeners.push(_),()=>this.listeners=this.listeners.filter(d=>d!==_)}pause(){var _;(_=this.gateway)===null||_===void 0||_.pause(),this.pendingGateways.forEach(d=>d.pause())}unPause(){return __awaiter(this,void 0,void 0,function*(){const _=this.pendingGateways.map(d=>d.unPause());this.gateway&&_.push(this.gateway.unPause()),yield Promise.all(_)})}pendingGatewaysListener(_,d,k){return __awaiter(this,void 0,void 0,function*(){if(!this.pendingGateways.includes(_)){yield _.close();return}return this.closeGateways({except:_}),this.gateway&&(logDebug$1("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.session.bridgeUrl=d,this.gateway=_,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(k)})}gatewayListener(_){return __awaiter(this,void 0,void 0,function*(){const d=JSON.parse(this.session.sessionCrypto.decrypt(Base64.decode(_.message).toUint8Array(),hexToByteArray(_.from)));if(logDebug$1("Wallet message received:",d),!("event"in d)){const j=d.id.toString(),$=this.pendingRequests.get(j);if(!$){logDebug$1(`Response id ${j} doesn't match any request's id`);return}$(d),this.pendingRequests.delete(j);return}if(d.id!==void 0){const j=yield this.connectionStorage.getLastWalletEventId();if(j!==void 0&&d.id<=j){logError$1(`Received event id (=${d.id}) must be greater than stored last wallet event id (=${j}) `);return}d.event!=="connect"&&(yield this.connectionStorage.storeLastWalletEventId(d.id))}const k=this.listeners;d.event==="connect"&&(yield this.updateSession(d,_.from)),d.event==="disconnect"&&(logDebug$1("Removing bridge and session: received disconnect event"),yield this.removeBridgeAndSession()),k.forEach(j=>j(d))})}gatewayErrorsListener(_){return __awaiter(this,void 0,void 0,function*(){throw new TonConnectError(`Bridge error ${JSON.stringify(_)}`)})}updateSession(_,d){return __awaiter(this,void 0,void 0,function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:d});const k=_.payload.items.find($=>$.name==="ton_addr"),j=Object.assign(Object.assign({},_),{payload:Object.assign(Object.assign({},_.payload),{items:[k]})});yield this.connectionStorage.storeConnection({type:"http",session:this.session,lastWalletEventId:_.id,connectEvent:j,nextRpcRequestId:0})})}removeBridgeAndSession(){return __awaiter(this,void 0,void 0,function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()})}generateUniversalLink(_,d){return isTelegramUrl(_)?this.generateTGUniversalLink(_,d):this.generateRegularUniversalLink(_,d)}generateRegularUniversalLink(_,d){const k=new URL(_);return k.searchParams.append("v",PROTOCOL_VERSION.toString()),k.searchParams.append("id",this.session.sessionCrypto.sessionId),k.searchParams.append("r",JSON.stringify(d)),k.toString()}generateTGUniversalLink(_,d){const j=this.generateRegularUniversalLink("about:blank",d).split("?")[1],$="tonconnect-"+encodeTelegramUrlParameters(j),et=this.convertToDirectLink(_),tt=new URL(et);return tt.searchParams.append("startapp",$),tt.toString()}convertToDirectLink(_){const d=new URL(_);return d.searchParams.has("attach")&&(d.searchParams.delete("attach"),d.pathname+="/start"),d.toString()}openGateways(_,d){return __awaiter(this,void 0,void 0,function*(){if(Array.isArray(this.walletConnectionSource)){this.pendingGateways.map(k=>k.close().catch()),this.pendingGateways=this.walletConnectionSource.map(k=>{const j=new BridgeGateway(this.storage,k.bridgeUrl,_.sessionId,()=>{},()=>{});return j.setListener($=>this.pendingGatewaysListener(j,k.bridgeUrl,$)),j}),yield Promise.allSettled(this.pendingGateways.map(k=>callForSuccess(j=>{var $;return this.pendingGateways.some(et=>et===k)?k.registerSession({openingDeadlineMS:($=d==null?void 0:d.openingDeadlineMS)!==null&&$!==void 0?$:this.defaultOpeningDeadlineMS,signal:j.signal}):k.close()},{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:d==null?void 0:d.signal})));return}else return this.gateway&&(logDebug$1("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new BridgeGateway(this.storage,this.walletConnectionSource.bridgeUrl,_.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),yield this.gateway.registerSession({openingDeadlineMS:d==null?void 0:d.openingDeadlineMS,signal:d==null?void 0:d.signal})})}closeGateways(_){var d;(d=this.gateway)===null||d===void 0||d.close(),this.pendingGateways.filter(k=>k!==(_==null?void 0:_.except)).forEach(k=>k.close()),this.pendingGateways=[]}}function hasProperty(b,_){return hasProperties(b,[_])}function hasProperties(b,_){return!b||typeof b!="object"?!1:_.every(d=>d in b)}function isJSBridgeWithMetadata(b){try{return!hasProperty(b,"tonconnect")||!hasProperty(b.tonconnect,"walletInfo")?!1:hasProperties(b.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch{return!1}}let InMemoryStorage$1=class Jo{constructor(){this.storage={}}static getInstance(){return Jo.instance||(Jo.instance=new Jo),Jo.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(_){var d;return(d=this.storage[_])!==null&&d!==void 0?d:null}key(_){var d;const k=Object.keys(this.storage);return _<0||_>=k.length?null:(d=k[_])!==null&&d!==void 0?d:null}removeItem(_){delete this.storage[_]}setItem(_,d){this.storage[_]=d}};function getWindow$2(){if(!(typeof window>"u"))return window}function tryGetWindowKeys(){const b=getWindow$2();if(!b)return[];try{return Object.keys(b)}catch{return[]}}function getDocument(){if(!(typeof document>"u"))return document}function getWebPageManifest(){var b;const _=(b=getWindow$2())===null||b===void 0?void 0:b.location.origin;return _?_+"/tonconnect-manifest.json":""}function tryGetLocalStorage$1(){if(isLocalStorageAvailable$1())return localStorage;if(isNodeJs$1())throw new TonConnectError("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return InMemoryStorage$1.getInstance()}function isLocalStorageAvailable$1(){try{return typeof localStorage<"u"}catch{return!1}}function isNodeJs$1(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null}class InjectedProvider{constructor(_,d){this.injectedWalletKey=d,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const k=InjectedProvider.window;if(!InjectedProvider.isWindowContainsWallet(k,d))throw new WalletNotInjectedError;this.connectionStorage=new BridgeConnectionStorage(_),this.injectedWallet=k[d].tonconnect}static fromStorage(_){return __awaiter(this,void 0,void 0,function*(){const k=yield new BridgeConnectionStorage(_).getInjectedConnection();return new InjectedProvider(_,k.jsBridgeKey)})}static isWalletInjected(_){return InjectedProvider.isWindowContainsWallet(this.window,_)}static isInsideWalletBrowser(_){return InjectedProvider.isWindowContainsWallet(this.window,_)?this.window[_].tonconnect.isWalletBrowser:!1}static getCurrentlyInjectedWallets(){return this.window?tryGetWindowKeys().filter(k=>isJSBridgeWithMetadata(k)).map(([k,j])=>({name:j.tonconnect.walletInfo.name,appName:j.tonconnect.walletInfo.app_name,aboutUrl:j.tonconnect.walletInfo.about_url,imageUrl:j.tonconnect.walletInfo.image,tondns:j.tonconnect.walletInfo.tondns,jsBridgeKey:k,injected:!0,embedded:j.tonconnect.isWalletBrowser,platforms:j.tonconnect.walletInfo.platforms})):[]}static isWindowContainsWallet(_,d){return!!_&&d in _&&typeof _[d]=="object"&&"tonconnect"in _[d]}connect(_){this._connect(PROTOCOL_VERSION,_)}restoreConnection(){return __awaiter(this,void 0,void 0,function*(){try{logDebug$1("Injected Provider restoring connection...");const _=yield this.injectedWallet.restoreConnection();logDebug$1("Injected Provider restoring connection response",_),_.event==="connect"?(this.makeSubscriptions(),this.listeners.forEach(d=>d(_))):yield this.connectionStorage.removeConnection()}catch(_){yield this.connectionStorage.removeConnection(),console.error(_)}})}closeConnection(){this.listenSubscriptions&&this.injectedWallet.disconnect(),this.closeAllListeners()}disconnect(){return __awaiter(this,void 0,void 0,function*(){return new Promise(_=>{const d=()=>{this.closeAllListeners(),this.connectionStorage.removeConnection().then(_)};try{this.injectedWallet.disconnect(),d()}catch(k){logDebug$1(k),this.sendRequest({method:"disconnect",params:[]},d)}})})}closeAllListeners(){var _;this.listenSubscriptions=!1,this.listeners=[],(_=this.unsubscribeCallback)===null||_===void 0||_.call(this)}listen(_){return this.listeners.push(_),()=>this.listeners=this.listeners.filter(d=>d!==_)}sendRequest(_,d){var k;return __awaiter(this,void 0,void 0,function*(){const j={};typeof d=="function"?j.onRequestSent=d:(j.onRequestSent=d==null?void 0:d.onRequestSent,j.signal=d==null?void 0:d.signal);const $=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),logDebug$1("Send injected-bridge request:",Object.assign(Object.assign({},_),{id:$}));const et=this.injectedWallet.send(Object.assign(Object.assign({},_),{id:$}));return et.then(tt=>logDebug$1("Wallet message received:",tt)),(k=j==null?void 0:j.onRequestSent)===null||k===void 0||k.call(j),et})}_connect(_,d){return __awaiter(this,void 0,void 0,function*(){try{logDebug$1(`Injected Provider connect request: protocolVersion: ${_}, message:`,d);const k=yield this.injectedWallet.connect(_,d);logDebug$1("Injected Provider connect response:",k),k.event==="connect"&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach(j=>j(k))}catch(k){logDebug$1("Injected Provider connect error:",k);const j={event:"connect_error",payload:{code:0,message:k==null?void 0:k.toString()}};this.listeners.forEach($=>$(j))}})}makeSubscriptions(){this.listenSubscriptions=!0,this.unsubscribeCallback=this.injectedWallet.listen(_=>{logDebug$1("Wallet message received:",_),this.listenSubscriptions&&this.listeners.forEach(d=>d(_)),_.event==="disconnect"&&this.disconnect()})}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}}InjectedProvider.window=getWindow$2();class DefaultStorage{constructor(){this.localStorage=tryGetLocalStorage$1()}getItem(_){return __awaiter(this,void 0,void 0,function*(){return this.localStorage.getItem(_)})}removeItem(_){return __awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(_)})}setItem(_,d){return __awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(_,d)})}}function isWalletInfoCurrentlyInjected(b){return isWalletInfoInjectable(b)&&b.injected}function isWalletInfoCurrentlyEmbedded(b){return isWalletInfoCurrentlyInjected(b)&&b.embedded}function isWalletInfoInjectable(b){return"jsBridgeKey"in b}function isWalletInfoRemote(b){return"bridgeUrl"in b}const FALLBACK_WALLETS_LIST=[{app_name:"telegram-wallet",name:"Wallet",image:"https://wallet.tg/images/logo-288.png",about_url:"https://wallet.tg/",universal_url:"https://t.me/wallet?attach=wallet",bridge:[{type:"sse",url:"https://walletbot.me/tonconnect-bridge/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"tonkeeper",name:"Tonkeeper",image:"https://tonkeeper.com/assets/tonconnect-icon.png",tondns:"tonkeeper.ton",about_url:"https://tonkeeper.com",universal_url:"https://app.tonkeeper.com/ton-connect",deepLink:"tonkeeper-tc://",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"},{type:"js",key:"tonkeeper"}],platforms:["ios","android","chrome","firefox","macos"]},{app_name:"mytonwallet",name:"MyTonWallet",image:"https://static.mytonwallet.io/icon-256.png",about_url:"https://mytonwallet.io",universal_url:"https://connect.mytonwallet.org",bridge:[{type:"js",key:"mytonwallet"},{type:"sse",url:"https://tonconnectbridge.mytonwallet.org/bridge/"}],platforms:["chrome","windows","macos","linux","ios","android","firefox"]},{app_name:"tonhub",name:"Tonhub",image:"https://tonhub.com/tonconnect_logo.png",about_url:"https://tonhub.com",universal_url:"https://tonhub.com/ton-connect",bridge:[{type:"js",key:"tonhub"},{type:"sse",url:"https://connect.tonhubapi.com/tonconnect"}],platforms:["ios","android"]},{app_name:"bitgetTonWallet",name:"Bitget Wallet",image:"https://raw.githubusercontent.com/bitgetwallet/download/refs/heads/main/logo/png/bitget_wallet_logo_288_mini.png",about_url:"https://web3.bitget.com",deepLink:"bitkeep://",bridge:[{type:"js",key:"bitgetTonWallet"},{type:"sse",url:"https://ton-connect-bridge.bgwapi.io/bridge"}],platforms:["ios","android","chrome"],universal_url:"https://bkcode.vip/ton-connect"},{app_name:"okxMiniWallet",name:"OKX Mini Wallet",image:"https://static.okx.com/cdn/assets/imgs/2411/8BE1A4A434D8F58A.png",about_url:"https://www.okx.com/web3",universal_url:"https://t.me/OKX_WALLET_BOT?attach=wallet",bridge:[{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"binanceWeb3TonWallet",name:"Binance Web3 Wallet",image:"https://public.bnbstatic.com/static/binance-w3w/ton-provider/binancew3w.png",about_url:"https://www.binance.com/en/web3wallet",deepLink:"bnc://app.binance.com/cedefi/ton-connect",bridge:[{type:"js",key:"binancew3w"},{type:"sse",url:"https://wallet.binance.com/tonbridge/bridge"}],platforms:["ios","android","macos","windows","linux"],universal_url:"https://app.binance.com/cedefi/ton-connect"},{app_name:"fintopio-tg",name:"Fintopio",image:"https://fintopio.com/tonconnect-icon.png",about_url:"https://fintopio.com",universal_url:"https://t.me/fintopio?attach=wallet",bridge:[{type:"sse",url:"https://wallet-bridge.fintopio.com/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"okxTonWallet",name:"OKX Wallet",image:"https://static.okx.com/cdn/assets/imgs/247/58E63FEA47A2B7D7.png",about_url:"https://www.okx.com/web3",universal_url:"https://www.okx.com/download?appendQuery=true&deeplink=okx://web3/wallet/tonconnect",bridge:[{type:"js",key:"okxTonWallet"},{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["chrome","safari","firefox","ios","android"]},{app_name:"hot",name:"HOT",image:"https://raw.githubusercontent.com/hot-dao/media/main/logo.png",about_url:"https://hot-labs.org/",universal_url:"https://t.me/herewalletbot?attach=wallet",bridge:[{type:"sse",url:"https://sse-bridge.hot-labs.org"},{type:"js",key:"hotWallet"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"bybitTonWallet",name:"Bybit Wallet",image:"https://raw.githubusercontent.com/bybit-web3/bybit-web3.github.io/main/docs/images/bybit-logo.png",about_url:"https://www.bybit.com/web3",universal_url:"https://app.bybit.com/ton-connect",deepLink:"bybitapp://",bridge:[{type:"js",key:"bybitTonWallet"},{type:"sse",url:"https://api-node.bybit.com/spot/api/web3/bridge/ton/bridge"}],platforms:["ios","android","chrome"]},{app_name:"dewallet",name:"DeWallet",image:"https://raw.githubusercontent.com/delab-team/manifests-images/main/WalletAvatar.png",about_url:"https://delabwallet.com",universal_url:"https://t.me/dewallet?attach=wallet",bridge:[{type:"sse",url:"https://bridge.dewallet.pro/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"safepalwallet",name:"SafePal",image:"https://s.pvcliping.com/web/public_image/SafePal_x288.png",tondns:"",about_url:"https://www.safepal.com",universal_url:"https://link.safepal.io/ton-connect",deepLink:"safepal-tc://",bridge:[{type:"sse",url:"https://ton-bridge.safepal.com/tonbridge/v1/bridge"},{type:"js",key:"safepalwallet"}],platforms:["ios","android","chrome","firefox"]},{app_name:"GateWallet",name:"GateWallet",image:"https://img.gatedataimg.com/prd-ordinal-imgs/036f07bb8730716e/gateio-0925.png",about_url:"https://www.gate.io/",bridge:[{type:"js",key:"gatetonwallet"},{type:"sse",url:"https://dapp.gateio.services/tonbridge_api/bridge/v1"}],platforms:["ios","android"],universal_url:"https://gateio.go.link/gateio/web3?adj_t=1ff8khdw_1fu4ccc7"},{app_name:"openmask",name:"OpenMask",image:"https://raw.githubusercontent.com/OpenProduct/openmask-extension/main/public/openmask-logo-288.png",about_url:"https://www.openmask.app/",bridge:[{type:"js",key:"openmask"}],platforms:["chrome"]},{app_name:"BitgetWeb3",name:"BitgetWeb3",image:"https://img.bitgetimg.com/image/third/1731638059795.png",about_url:"​https://www.bitget.com",universal_url:"https://t.me/BitgetOfficialBot?attach=wallet",bridge:[{type:"sse",url:"https://ton-connect-bridge.bgwapi.io/bridge"}],platforms:["ios","android","windows","macos","linux"]},{app_name:"tobi",name:"Tobi",image:"https://app.tobiwallet.app/icons/logo-288.png",about_url:"https://tobi.fun",universal_url:"https://t.me/TobiCopilotBot?attach=wallet",bridge:[{type:"sse",url:"https://ton-bridge.tobiwallet.app/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"xtonwallet",name:"XTONWallet",image:"https://xtonwallet.com/assets/img/icon-256-back.png",about_url:"https://xtonwallet.com",bridge:[{type:"js",key:"xtonwallet"}],platforms:["chrome","firefox"]},{app_name:"tonwallet",name:"TON Wallet",image:"https://wallet.ton.org/assets/ui/qr-logo.png",about_url:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",bridge:[{type:"js",key:"tonwallet"}],platforms:["chrome"]}];class WalletsListManager{constructor(_){this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null,this.walletsListSource="https://raw.githubusercontent.com/ton-blockchain/wallets-list/main/wallets-v2.json",_!=null&&_.walletsListSource&&(this.walletsListSource=_.walletsListSource),_!=null&&_.cacheTTLMs&&(this.cacheTTLMs=_.cacheTTLMs)}getWallets(){return __awaiter(this,void 0,void 0,function*(){return this.cacheTTLMs&&this.walletsListCacheCreationTimestamp&&Date.now()>this.walletsListCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListCache=null),this.walletsListCache||(this.walletsListCache=this.fetchWalletsList(),this.walletsListCache.then(()=>{this.walletsListCacheCreationTimestamp=Date.now()}).catch(()=>{this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null})),this.walletsListCache})}getEmbeddedWallet(){return __awaiter(this,void 0,void 0,function*(){const d=(yield this.getWallets()).filter(isWalletInfoCurrentlyEmbedded);return d.length!==1?null:d[0]})}fetchWalletsList(){return __awaiter(this,void 0,void 0,function*(){let _=[];try{if(_=yield(yield fetch(this.walletsListSource)).json(),_.push({app_name:"hpyTonWallet",name:"HyperPay Wallet",image:"https://onchain-oss.hyperpay.online/images/logo.png",about_url:"https://www.hyperpay.tech",universal_url:"https://www.hyperpay.tech/download&deeplink=hyperpay://web3/wallet/tonconnect",bridge:[{type:"js",key:"hpyTonWallet"},{type:"sse",url:"https://onchain-wallet.hyperpay.online/bridge"}],platforms:["ios","android","macos","windows","linux"]}),_.push({app_name:"nicegramWallet",name:"Nicegram Wallet",image:"https://static.nicegram.app/icon.png",about_url:"https://nicegram.app",universal_url:"https://nicegram.app/tc",deepLink:"nicegram-tc://",bridge:[{type:"sse",url:"https://tc.nicegram.app/bridge"},{type:"js",key:"nicegramWallet"}],platforms:["ios","android","macos","windows","linux"]}),_.push({app_name:"foxwallet",name:"FoxWallet",image:"https://hc.foxwallet.com/img/logo.png",about_url:"https://foxwallet.com/",universal_url:"https://link.foxwallet.com/tc",bridge:[{type:"js",key:"foxwallet"},{type:"sse",url:"https://connect.foxwallet.com/ton/bridge"}],platforms:["ios","android"]}),_.push({app_name:"trustwalletTon",name:"Trust",image:"https://assets-cdn.trustwallet.com/dapps/trust.logo.png",about_url:"https://trustwallet.com/about-us",deepLink:"trust://ton-connect",universal_url:"https://trustwallet.com",bridge:[{type:"js",key:"trustwalletTon"},{type:"sse",url:"https://tonconnect.trustwallet.com/bridge"}],platforms:["chrome","ios","android"]}),_.push({app_name:"jambo",name:"Jambo",image:"https://cdn-prod.jambotechnology.xyz/content/jambo_288x288_02da416a6c.png",about_url:"https://www.jambo.technology/",deepLink:"jambotc://",universal_url:"https://jambophone.xyz/",bridge:[{type:"js",key:"jambowallet"},{type:"sse",url:"https://bridge.tonapi.io/bridge"}],platforms:["android"]}),_.push({app_name:"tokenpocket",name:"TokenPocket",image:"https://hk.tpstatic.net/logo/tokenpocket.png",about_url:"https://www.tokenpocket.pro",universal_url:"https://tp-lab.tptool.pro/ton-connect/",bridge:[{type:"js",key:"tokenpocket"},{type:"sse",url:"https://ton-connect.mytokenpocket.vip/bridge"}],platforms:["ios","android"]}),!Array.isArray(_))throw new FetchWalletsError("Wrong wallets list format, wallets list must be an array.");const j=_.filter($=>!this.isCorrectWalletConfigDTO($));j.length&&(logError$1(`Wallet(s) ${j.map($=>$.name).join(", ")} config format is wrong. They were removed from the wallets list.`),_=_.filter($=>this.isCorrectWalletConfigDTO($)))}catch(k){logError$1(k),_=FALLBACK_WALLETS_LIST}let d=[];try{d=InjectedProvider.getCurrentlyInjectedWallets()}catch(k){logError$1(k)}return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(_),d)})}walletConfigDTOListToWalletConfigList(_){return _.map(d=>{const j={name:d.name,appName:d.app_name,imageUrl:d.image,aboutUrl:d.about_url,tondns:d.tondns,platforms:d.platforms};return d.bridge.forEach($=>{if($.type==="sse"&&(j.bridgeUrl=$.url,j.universalLink=d.universal_url,j.deepLink=d.deepLink),$.type==="js"){const et=$.key;j.jsBridgeKey=et,j.injected=InjectedProvider.isWalletInjected(et),j.embedded=InjectedProvider.isInsideWalletBrowser(et)}}),j})}mergeWalletsLists(_,d){return[...new Set(_.concat(d).map(j=>j.name)).values()].map(j=>{const $=_.find(tt=>tt.name===j),et=d.find(tt=>tt.name===j);return Object.assign(Object.assign({},$&&Object.assign({},$)),et&&Object.assign({},et))})}isCorrectWalletConfigDTO(_){if(!_||typeof _!="object")return!1;const d="name"in _,k="app_name"in _,j="image"in _,$="about_url"in _,et="platforms"in _;if(!d||!j||!$||!et||!k||!_.platforms||!Array.isArray(_.platforms)||!_.platforms.length||!("bridge"in _)||!Array.isArray(_.bridge)||!_.bridge.length)return!1;const tt=_.bridge;if(tt.some(ot=>!ot||typeof ot!="object"||!("type"in ot)))return!1;const rt=tt.find(ot=>ot.type==="sse");if(rt&&(!("url"in rt)||!rt.url||!_.universal_url))return!1;const nt=tt.find(ot=>ot.type==="js");return!(nt&&(!("key"in nt)||!nt.key))}}class WalletNotSupportFeatureError extends TonConnectError{get info(){return"Wallet doesn't support requested feature method."}constructor(..._){super(..._),Object.setPrototypeOf(this,WalletNotSupportFeatureError.prototype)}}function checkSendTransactionSupport(b,_){const d=b.includes("SendTransaction"),k=b.find(j=>j&&typeof j=="object"&&j.name==="SendTransaction");if(!d&&!k)throw new WalletNotSupportFeatureError("Wallet doesn't support SendTransaction feature.");if(k&&k.maxMessages!==void 0){if(k.maxMessages<_.requiredMessagesNumber)throw new WalletNotSupportFeatureError(`Wallet is not able to handle such SendTransaction request. Max support messages number is ${k.maxMessages}, but ${_.requiredMessagesNumber} is required.`);return}logWarning$1("Connected wallet didn't provide information about max allowed messages in the SendTransaction request. Request may be rejected by the wallet.")}function createRequestVersionEvent(){return{type:"request-version"}}function createResponseVersionEvent(b){return{type:"response-version",version:b}}function createVersionInfo(b){return{ton_connect_sdk_lib:b.ton_connect_sdk_lib,ton_connect_ui_lib:b.ton_connect_ui_lib}}function createConnectionInfo(b,_){var d,k,j,$,et,tt,rt,nt;const at=((d=_==null?void 0:_.connectItems)===null||d===void 0?void 0:d.tonProof)&&"proof"in _.connectItems.tonProof?"ton_proof":"ton_addr";return{wallet_address:(j=(k=_==null?void 0:_.account)===null||k===void 0?void 0:k.address)!==null&&j!==void 0?j:null,wallet_type:($=_==null?void 0:_.device.appName)!==null&&$!==void 0?$:null,wallet_version:(et=_==null?void 0:_.device.appVersion)!==null&&et!==void 0?et:null,auth_type:at,custom_data:Object.assign({chain_id:(rt=(tt=_==null?void 0:_.account)===null||tt===void 0?void 0:tt.chain)!==null&&rt!==void 0?rt:null,provider:(nt=_==null?void 0:_.provider)!==null&&nt!==void 0?nt:null},createVersionInfo(b))}}function createConnectionStartedEvent(b){return{type:"connection-started",custom_data:createVersionInfo(b)}}function createConnectionCompletedEvent(b,_){return Object.assign({type:"connection-completed",is_success:!0},createConnectionInfo(b,_))}function createConnectionErrorEvent(b,_,d){return{type:"connection-error",is_success:!1,error_message:_,error_code:d??null,custom_data:createVersionInfo(b)}}function createConnectionRestoringStartedEvent(b){return{type:"connection-restoring-started",custom_data:createVersionInfo(b)}}function createConnectionRestoringCompletedEvent(b,_){return Object.assign({type:"connection-restoring-completed",is_success:!0},createConnectionInfo(b,_))}function createConnectionRestoringErrorEvent(b,_){return{type:"connection-restoring-error",is_success:!1,error_message:_,custom_data:createVersionInfo(b)}}function createTransactionInfo(b,_){var d,k,j,$;return{valid_until:(d=String(_.validUntil))!==null&&d!==void 0?d:null,from:($=(k=_.from)!==null&&k!==void 0?k:(j=b==null?void 0:b.account)===null||j===void 0?void 0:j.address)!==null&&$!==void 0?$:null,messages:_.messages.map(et=>{var tt,rt;return{address:(tt=et.address)!==null&&tt!==void 0?tt:null,amount:(rt=et.amount)!==null&&rt!==void 0?rt:null}})}}function createTransactionSentForSignatureEvent(b,_,d){return Object.assign(Object.assign({type:"transaction-sent-for-signature"},createConnectionInfo(b,_)),createTransactionInfo(_,d))}function createTransactionSignedEvent(b,_,d,k){return Object.assign(Object.assign({type:"transaction-signed",is_success:!0,signed_transaction:k.boc},createConnectionInfo(b,_)),createTransactionInfo(_,d))}function createTransactionSigningFailedEvent(b,_,d,k,j){return Object.assign(Object.assign({type:"transaction-signing-failed",is_success:!1,error_message:k,error_code:j??null},createConnectionInfo(b,_)),createTransactionInfo(_,d))}function createDisconnectionEvent(b,_,d){return Object.assign({type:"disconnection",scope:d},createConnectionInfo(b,_))}class BrowserEventDispatcher{constructor(){this.window=getWindow$2()}dispatchEvent(_,d){var k;return __awaiter(this,void 0,void 0,function*(){const j=new CustomEvent(_,{detail:d});(k=this.window)===null||k===void 0||k.dispatchEvent(j)})}addEventListener(_,d,k){var j;return __awaiter(this,void 0,void 0,function*(){return(j=this.window)===null||j===void 0||j.addEventListener(_,d,k),()=>{var $;return($=this.window)===null||$===void 0?void 0:$.removeEventListener(_,d)}})}}class TonConnectTracker{constructor(_){var d;this.eventPrefix="ton-connect-",this.tonConnectUiVersion=null,this.eventDispatcher=(d=_==null?void 0:_.eventDispatcher)!==null&&d!==void 0?d:new BrowserEventDispatcher,this.tonConnectSdkVersion=_.tonConnectSdkVersion,this.init().catch()}get version(){return createVersionInfo({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return __awaiter(this,void 0,void 0,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectUiVersion=yield this.requestTonConnectUiVersion()}catch{}})}setRequestVersionHandler(){return __awaiter(this,void 0,void 0,function*(){yield this.eventDispatcher.addEventListener("ton-connect-request-version",()=>__awaiter(this,void 0,void 0,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-response-version",createResponseVersionEvent(this.tonConnectSdkVersion))}))})}requestTonConnectUiVersion(){return __awaiter(this,void 0,void 0,function*(){return new Promise((_,d)=>__awaiter(this,void 0,void 0,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-ui-response-version",k=>{_(k.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-ui-request-version",createRequestVersionEvent())}catch(k){d(k)}}))})}dispatchUserActionEvent(_){try{this.eventDispatcher.dispatchEvent(`${this.eventPrefix}${_.type}`,_).catch()}catch{}}trackConnectionStarted(..._){try{const d=createConnectionStartedEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}trackConnectionCompleted(..._){try{const d=createConnectionCompletedEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}trackConnectionError(..._){try{const d=createConnectionErrorEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringStarted(..._){try{const d=createConnectionRestoringStartedEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringCompleted(..._){try{const d=createConnectionRestoringCompletedEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringError(..._){try{const d=createConnectionRestoringErrorEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}trackDisconnection(..._){try{const d=createDisconnectionEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSentForSignature(..._){try{const d=createTransactionSentForSignatureEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSigned(..._){try{const d=createTransactionSignedEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSigningFailed(..._){try{const d=createTransactionSigningFailedEvent(this.version,..._);this.dispatchUserActionEvent(d)}catch{}}}const tonConnectSdkVersion="3.0.6-beta.0";class TonConnect{constructor(_){if(this.walletsList=new WalletsListManager,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.dappSettings={manifestUrl:(_==null?void 0:_.manifestUrl)||getWebPageManifest(),storage:(_==null?void 0:_.storage)||new DefaultStorage},this.walletsList=new WalletsListManager({walletsListSource:_==null?void 0:_.walletsListSource,cacheTTLMs:_==null?void 0:_.walletsListCacheTTLMs}),this.tracker=new TonConnectTracker({eventDispatcher:_==null?void 0:_.eventDispatcher,tonConnectSdkVersion}),!this.dappSettings.manifestUrl)throw new DappMetadataError("Dapp tonconnect-manifest.json must be specified if window.location.origin is undefined. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest");this.bridgeConnectionStorage=new BridgeConnectionStorage(this.dappSettings.storage),_!=null&&_.disableAutoPauseConnection||this.addWindowFocusAndBlurSubscriptions()}static getWallets(){return this.walletsList.getWallets()}get connected(){return this._wallet!==null}get account(){var _;return((_=this._wallet)===null||_===void 0?void 0:_.account)||null}get wallet(){return this._wallet}set wallet(_){this._wallet=_,this.statusChangeSubscriptions.forEach(d=>d(this._wallet))}getWallets(){return this.walletsList.getWallets()}onStatusChange(_,d){return this.statusChangeSubscriptions.push(_),d&&this.statusChangeErrorSubscriptions.push(d),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter(k=>k!==_),d&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter(k=>k!==d))}}connect(_,d){var k,j;const $={};if(typeof d=="object"&&"tonProof"in d&&($.request=d),typeof d=="object"&&("openingDeadlineMS"in d||"signal"in d||"request"in d)&&($.request=d==null?void 0:d.request,$.openingDeadlineMS=d==null?void 0:d.openingDeadlineMS,$.signal=d==null?void 0:d.signal),this.connected)throw new WalletAlreadyConnectedError;const et=createAbortController($==null?void 0:$.signal);if((k=this.abortController)===null||k===void 0||k.abort(),this.abortController=et,et.signal.aborted)throw new TonConnectError("Connection was aborted");return(j=this.provider)===null||j===void 0||j.closeConnection(),this.provider=this.createProvider(_),et.signal.addEventListener("abort",()=>{var tt;(tt=this.provider)===null||tt===void 0||tt.closeConnection(),this.provider=null}),this.tracker.trackConnectionStarted(),this.provider.connect(this.createConnectRequest($==null?void 0:$.request),{openingDeadlineMS:$==null?void 0:$.openingDeadlineMS,signal:et.signal})}restoreConnection(_){var d,k;return __awaiter(this,void 0,void 0,function*(){this.tracker.trackConnectionRestoringStarted();const j=createAbortController(_==null?void 0:_.signal);if((d=this.abortController)===null||d===void 0||d.abort(),this.abortController=j,j.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}const[$,et]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);if(j.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}let tt=null;try{switch($){case"http":tt=yield BridgeProvider.fromStorage(this.dappSettings.storage);break;case"injected":tt=yield InjectedProvider.fromStorage(this.dappSettings.storage);break;default:if(et)tt=this.createProvider(et);else return}}catch{this.tracker.trackConnectionRestoringError("Provider is not restored"),yield this.bridgeConnectionStorage.removeConnection(),tt==null||tt.closeConnection(),tt=null;return}if(j.signal.aborted){tt==null||tt.closeConnection(),this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}if(!tt){logError$1("Provider is not restored"),this.tracker.trackConnectionRestoringError("Provider is not restored");return}(k=this.provider)===null||k===void 0||k.closeConnection(),this.provider=tt,tt.listen(this.walletEventsListener.bind(this));const rt=()=>{this.tracker.trackConnectionRestoringError("Connection restoring was aborted"),tt==null||tt.closeConnection(),tt=null};j.signal.addEventListener("abort",rt);const nt=callForSuccess(at=>__awaiter(this,void 0,void 0,function*(){yield tt==null?void 0:tt.restoreConnection({openingDeadlineMS:_==null?void 0:_.openingDeadlineMS,signal:at.signal}),j.signal.removeEventListener("abort",rt),this.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):this.tracker.trackConnectionRestoringError("Connection restoring failed")}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:2e3,signal:_==null?void 0:_.signal}),ot=new Promise(at=>setTimeout(()=>at(),12e3));return Promise.race([nt,ot])})}sendTransaction(_,d){return __awaiter(this,void 0,void 0,function*(){const k={};typeof d=="function"?k.onRequestSent=d:(k.onRequestSent=d==null?void 0:d.onRequestSent,k.signal=d==null?void 0:d.signal);const j=createAbortController(k==null?void 0:k.signal);if(j.signal.aborted)throw new TonConnectError("Transaction sending was aborted");this.checkConnection(),checkSendTransactionSupport(this.wallet.device.features,{requiredMessagesNumber:_.messages.length}),this.tracker.trackTransactionSentForSignature(this.wallet,_);const{validUntil:$}=_,et=__rest(_,["validUntil"]),tt=_.from||this.account.address,rt=_.network||this.account.chain,nt=yield this.provider.sendRequest(sendTransactionParser.convertToRpcRequest(Object.assign(Object.assign({},et),{valid_until:$,from:tt,network:rt})),{onRequestSent:k.onRequestSent,signal:j.signal});if(sendTransactionParser.isError(nt))return this.tracker.trackTransactionSigningFailed(this.wallet,_,nt.error.message,nt.error.code),sendTransactionParser.parseAndThrowError(nt);const ot=sendTransactionParser.convertFromRpcResponse(nt);return this.tracker.trackTransactionSigned(this.wallet,_,ot),ot})}disconnect(_){var d;return __awaiter(this,void 0,void 0,function*(){if(!this.connected)throw new WalletNotConnectedError;const k=createAbortController(_==null?void 0:_.signal),j=this.abortController;if(this.abortController=k,k.signal.aborted)throw new TonConnectError("Disconnect was aborted");this.onWalletDisconnected("dapp"),yield(d=this.provider)===null||d===void 0?void 0:d.disconnect({signal:k.signal}),j==null||j.abort()})}pauseConnection(){var _;((_=this.provider)===null||_===void 0?void 0:_.type)==="http"&&this.provider.pause()}unPauseConnection(){var _;return((_=this.provider)===null||_===void 0?void 0:_.type)!=="http"?Promise.resolve():this.provider.unPause()}addWindowFocusAndBlurSubscriptions(){const _=getDocument();if(_)try{_.addEventListener("visibilitychange",()=>{_.hidden?this.pauseConnection():this.unPauseConnection().catch()})}catch(d){logError$1("Cannot subscribe to the document.visibilitychange: ",d)}}createProvider(_){let d;return!Array.isArray(_)&&isWalletConnectionSourceJS(_)?d=new InjectedProvider(this.dappSettings.storage,_.jsBridgeKey):d=new BridgeProvider(this.dappSettings.storage,_),d.listen(this.walletEventsListener.bind(this)),d}walletEventsListener(_){switch(_.event){case"connect":this.onWalletConnected(_.payload);break;case"connect_error":this.onWalletConnectError(_.payload);break;case"disconnect":this.onWalletDisconnected("wallet")}}onWalletConnected(_){const d=_.items.find($=>$.name==="ton_addr"),k=_.items.find($=>$.name==="ton_proof");if(!d)throw new TonConnectError("ton_addr connection item was not found");const j={device:_.device,provider:this.provider.type,account:{address:d.address,chain:d.network,walletStateInit:d.walletStateInit,publicKey:d.publicKey}};k&&(j.connectItems={tonProof:k}),this.wallet=j,this.tracker.trackConnectionCompleted(j)}onWalletConnectError(_){const d=connectErrorsParser.parseError(_);if(this.statusChangeErrorSubscriptions.forEach(k=>k(d)),logDebug$1(d),this.tracker.trackConnectionError(_.message,_.code),d instanceof ManifestNotFoundError||d instanceof ManifestContentErrorError)throw logError$1(d),d}onWalletDisconnected(_){this.tracker.trackDisconnection(this.wallet,_),this.wallet=null}checkConnection(){if(!this.connected)throw new WalletNotConnectedError}createConnectRequest(_){const d=[{name:"ton_addr"}];return _!=null&&_.tonProof&&d.push({name:"ton_proof",payload:_.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:d}}}TonConnect.walletsList=new WalletsListManager;TonConnect.isWalletInjected=b=>InjectedProvider.isWalletInjected(b);TonConnect.isInsideWalletBrowser=b=>InjectedProvider.isInsideWalletBrowser(b);const noBounceableTag=81,testOnlyTag=128;function toUserFriendlyAddress(b,_=!1){const{wc:d,hex:k}=parseHexAddress(b);let j=noBounceableTag;_&&(j|=testOnlyTag);const $=new Int8Array(34);$[0]=j,$[1]=d,$.set(k,2);const et=new Uint8Array(36);return et.set($),et.set(crc16($),34),Base64.encode(et).replace(/\+/g,"-").replace(/\//g,"_")}function parseHexAddress(b){if(!b.includes(":"))throw new WrongAddressError(`Wrong address ${b}. Address must include ":".`);const _=b.split(":");if(_.length!==2)throw new WrongAddressError(`Wrong address ${b}. Address must include ":" only once.`);const d=parseInt(_[0]);if(d!==0&&d!==-1)throw new WrongAddressError(`Wrong address ${b}. WC must be eq 0 or -1, but ${d} received.`);const k=_[1];if((k==null?void 0:k.length)!==64)throw new WrongAddressError(`Wrong address ${b}. Hex part must be 64bytes length, but ${k==null?void 0:k.length} received.`);return{wc:d,hex:hexToBytes(k)}}function crc16(b){let d=0;const k=new Uint8Array(b.length+2);k.set(b);for(let j of k){let $=128;for(;$>0;)d<<=1,j&$&&(d+=1),$>>=1,d>65535&&(d&=65535,d^=4129)}return new Uint8Array([Math.floor(d/256),d%256])}const toByteMap={};for(let b=0;b<=255;b++){let _=b.toString(16);_.length<2&&(_="0"+_),toByteMap[_]=b}function hexToBytes(b){b=b.toLowerCase();const _=b.length;if(_%2!==0)throw new ParseHexError("Hex string must have length a multiple of 2: "+b);const d=_/2,k=new Uint8Array(d);for(let j=0;j0?tr.length===2?typeof tr[1]==tt?this[tr[0]]=tr[1].call(this,gr):this[tr[0]]=tr[1]:tr.length===3?typeof tr[1]===tt&&!(tr[1].exec&&tr[1].test)?this[tr[0]]=gr?tr[1].call(this,gr,tr[2]):k:this[tr[0]]=gr?gr.replace(tr[1],tr[2]):k:tr.length===4&&(this[tr[0]]=gr?tr[3].call(this,gr.replace(tr[1],tr[2])):k):this[tr]=gr||k;pn+=2}},Cn=function(Ht,Xt){for(var pn in Xt)if(typeof Xt[pn]===nt&&Xt[pn].length>0){for(var Tn=0;Tn2&&(Xn[it]="iPad",Xn[ct]=st),Xn},this.getEngine=function(){var Xn={};return Xn[dt]=k,Xn[ft]=k,Pn.call(Xn,Tn,yr.engine),Xn},this.getOS=function(){var Xn={};return Xn[dt]=k,Xn[ft]=k,Pn.call(Xn,Tn,yr.os),tr&&!Xn[dt]&&cr&&cr.platform&&cr.platform!="Unknown"&&(Xn[dt]=cr.platform.replace(/chrome os/i,wn).replace(/macos/i,fn)),Xn},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Tn},this.setUA=function(Xn){return Tn=typeof Xn===ot&&Xn.length>St?Nn(Xn,St):Xn,this},this.setUA(Tn),this};Ln.VERSION=j,Ln.BROWSER=hn([dt,ft,at]),Ln.CPU=hn([lt]),Ln.DEVICE=hn([it,ht,ct,ut,pt,wt,st,yt,vt]),Ln.ENGINE=Ln.OS=hn([dt,ft]),b.exports&&(_=b.exports=Ln),_.UAParser=Ln;var Dn=typeof d!==rt&&(d.jQuery||d.Zepto);if(Dn&&!Dn.ua){var An=new Ln;Dn.ua=An.getResult(),Dn.ua.get=function(){return An.getUA()},Dn.ua.set=function(Ht){An.setUA(Ht);var Xt=An.getResult();for(var pn in Xt)Dn.ua[pn]=Xt[pn]}}})(typeof window=="object"?window:commonjsGlobal)})(uaParser,uaParser.exports);var uaParserExports=uaParser.exports;const UAParser=getDefaultExportFromCjs(uaParserExports);var isMergeableObject=function(_){return isNonNullObject(_)&&!isSpecial(_)};function isNonNullObject(b){return!!b&&typeof b=="object"}function isSpecial(b){var _=Object.prototype.toString.call(b);return _==="[object RegExp]"||_==="[object Date]"||isReactElement(b)}var canUseSymbol=typeof Symbol=="function"&&Symbol.for,REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(b){return b.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(b){return Array.isArray(b)?[]:{}}function cloneUnlessOtherwiseSpecified(b,_){return _.clone!==!1&&_.isMergeableObject(b)?deepmerge(emptyTarget(b),b,_):b}function defaultArrayMerge(b,_,d){return b.concat(_).map(function(k){return cloneUnlessOtherwiseSpecified(k,d)})}function getMergeFunction(b,_){if(!_.customMerge)return deepmerge;var d=_.customMerge(b);return typeof d=="function"?d:deepmerge}function getEnumerableOwnPropertySymbols(b){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(b).filter(function(_){return Object.propertyIsEnumerable.call(b,_)}):[]}function getKeys(b){return Object.keys(b).concat(getEnumerableOwnPropertySymbols(b))}function propertyIsOnObject(b,_){try{return _ in b}catch{return!1}}function propertyIsUnsafe(b,_){return propertyIsOnObject(b,_)&&!(Object.hasOwnProperty.call(b,_)&&Object.propertyIsEnumerable.call(b,_))}function mergeObject(b,_,d){var k={};return d.isMergeableObject(b)&&getKeys(b).forEach(function(j){k[j]=cloneUnlessOtherwiseSpecified(b[j],d)}),getKeys(_).forEach(function(j){propertyIsUnsafe(b,j)||(propertyIsOnObject(b,j)&&d.isMergeableObject(_[j])?k[j]=getMergeFunction(j,d)(b[j],_[j],d):k[j]=cloneUnlessOtherwiseSpecified(_[j],d))}),k}function deepmerge(b,_,d){d=d||{},d.arrayMerge=d.arrayMerge||defaultArrayMerge,d.isMergeableObject=d.isMergeableObject||isMergeableObject,d.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var k=Array.isArray(_),j=Array.isArray(b),$=k===j;return $?k?d.arrayMerge(b,_,d):mergeObject(b,_,d):cloneUnlessOtherwiseSpecified(_,d)}deepmerge.all=function(_,d){if(!Array.isArray(_))throw new Error("first argument should be an array");return _.reduce(function(k,j){return deepmerge(k,j,d)},{})};var deepmerge_1=deepmerge,cjs=deepmerge_1;const deepmerge$1=getDefaultExportFromCjs(cjs);var classnames={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames @@ -1145,7 +1145,7 @@ PERFORMANCE OF THIS SOFTWARE. The above lifecycles should be removed. Learn more about this warning here: https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof Et.getDerivedStateFromProps=="function"&&(Lt.componentWillMount=wt,Lt.componentWillReceiveProps=yt),typeof Lt.getSnapshotBeforeUpdate=="function"){if(typeof Lt.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");Lt.componentWillUpdate=vt;var Yt=Lt.componentDidUpdate;Lt.componentDidUpdate=function(zt,gn,Wn){var Gn=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:Wn;Yt.call(this,zt,gn,Gn)}}return Et}function xt(Et,Lt){if(Et==null)return{};var jt,$t,It=function(nn,Yt){if(nn==null)return{};var zt,gn,Wn={},Gn=Object.keys(nn);for(gn=0;gn=0||(Wn[zt]=nn[zt]);return Wn}(Et,Lt);if(Object.getOwnPropertySymbols){var an=Object.getOwnPropertySymbols(Et);for($t=0;$t=0||Object.prototype.propertyIsEnumerable.call(Et,jt)&&(It[jt]=Et[jt])}return It}function bt(Et){var Lt=function(jt){return{}.toString.call(jt).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}(Et);return Lt==="number"&&(Lt=isNaN(Et)?"nan":(0|Et)!=Et?"float":"integer"),Lt}wt.__suppressDeprecationWarning=!0,yt.__suppressDeprecationWarning=!0,vt.__suppressDeprecationWarning=!0;var At={scheme:"rjv-default",author:"mac gainor",base00:"rgba(0, 0, 0, 0)",base01:"rgb(245, 245, 245)",base02:"rgb(235, 235, 235)",base03:"#93a1a1",base04:"rgba(0, 0, 0, 0.3)",base05:"#586e75",base06:"#073642",base07:"#002b36",base08:"#d33682",base09:"#cb4b16",base0A:"#dc322f",base0B:"#859900",base0C:"#6c71c4",base0D:"#586e75",base0E:"#2aa198",base0F:"#268bd2"},_t={scheme:"rjv-grey",author:"mac gainor",base00:"rgba(1, 1, 1, 0)",base01:"rgba(1, 1, 1, 0.1)",base02:"rgba(0, 0, 0, 0.2)",base03:"rgba(1, 1, 1, 0.3)",base04:"rgba(0, 0, 0, 0.4)",base05:"rgba(1, 1, 1, 0.5)",base06:"rgba(1, 1, 1, 0.6)",base07:"rgba(1, 1, 1, 0.7)",base08:"rgba(1, 1, 1, 0.8)",base09:"rgba(1, 1, 1, 0.8)",base0A:"rgba(1, 1, 1, 0.8)",base0B:"rgba(1, 1, 1, 0.8)",base0C:"rgba(1, 1, 1, 0.8)",base0D:"rgba(1, 1, 1, 0.8)",base0E:"rgba(1, 1, 1, 0.8)",base0F:"rgba(1, 1, 1, 0.8)"},Ct={white:"#fff",black:"#000",transparent:"rgba(1, 1, 1, 0)",globalFontFamily:"monospace",globalCursor:"default",indentBlockWidth:"5px",braceFontWeight:"bold",braceCursor:"pointer",ellipsisFontSize:"18px",ellipsisLineHeight:"10px",ellipsisCursor:"pointer",keyMargin:"0px 5px",keyLetterSpacing:"0.5px",keyFontStyle:"none",keyBorderRadius:"3px",keyColonWeight:"bold",keyVerticalAlign:"top",keyOpacity:"0.85",keyOpacityHover:"1",keyValPaddingTop:"3px",keyValPaddingBottom:"3px",keyValPaddingRight:"5px",keyValBorderLeft:"1px solid",keyValBorderHover:"2px solid",keyValPaddingHover:"3px 5px 3px 4px",pushedContentMarginLeft:"6px",variableValuePaddingRight:"6px",nullFontSize:"11px",nullFontWeight:"bold",nullPadding:"1px 2px",nullBorderRadius:"3px",nanFontSize:"11px",nanFontWeight:"bold",nanPadding:"1px 2px",nanBorderRadius:"3px",undefinedFontSize:"11px",undefinedFontWeight:"bold",undefinedPadding:"1px 2px",undefinedBorderRadius:"3px",dataTypeFontSize:"11px",dataTypeMarginRight:"4px",datatypeOpacity:"0.8",objectSizeBorderRadius:"3px",objectSizeFontStyle:"italic",objectSizeMargin:"0px 6px 0px 0px",clipboardCursor:"pointer",clipboardCheckMarginLeft:"-12px",metaDataPadding:"0px 0px 0px 10px",arrayGroupMetaPadding:"0px 0px 0px 4px",iconContainerWidth:"17px",tooltipPadding:"4px",editInputMinWidth:"130px",editInputBorderRadius:"2px",editInputPadding:"5px",editInputMarginRight:"4px",editInputFontFamily:"monospace",iconCursor:"pointer",iconFontSize:"15px",iconPaddingRight:"1px",dateValueMarginLeft:"2px",iconMarginRight:"3px",detectedRowPaddingTop:"3px",addKeyCoverBackground:"rgba(255, 255, 255, 0.3)",addKeyCoverPosition:"absolute",addKeyCoverPositionPx:"0px",addKeyModalWidth:"200px",addKeyModalMargin:"auto",addKeyModalPadding:"10px",addKeyModalRadius:"3px"},Mt=$(45),Ot=function(Et){var Lt=function(jt){return{backgroundColor:jt.base00,ellipsisColor:jt.base09,braceColor:jt.base07,expandedIcon:jt.base0D,collapsedIcon:jt.base0E,keyColor:jt.base07,arrayKeyColor:jt.base0C,objectSize:jt.base04,copyToClipboard:jt.base0F,copyToClipboardCheck:jt.base0D,objectBorder:jt.base02,dataTypes:{boolean:jt.base0E,date:jt.base0D,float:jt.base0B,function:jt.base0D,integer:jt.base0F,string:jt.base09,nan:jt.base08,null:jt.base0A,undefined:jt.base05,regexp:jt.base0A,background:jt.base02},editVariable:{editIcon:jt.base0E,cancelIcon:jt.base09,removeIcon:jt.base09,addIcon:jt.base0E,checkIcon:jt.base0E,background:jt.base01,color:jt.base0A,border:jt.base07},addKeyModal:{background:jt.base05,border:jt.base04,color:jt.base0A,labelColor:jt.base01},validationFailure:{background:jt.base09,iconColor:jt.base01,fontColor:jt.base01}}}(Et);return{"app-container":{fontFamily:Ct.globalFontFamily,cursor:Ct.globalCursor,backgroundColor:Lt.backgroundColor,position:"relative"},ellipsis:{display:"inline-block",color:Lt.ellipsisColor,fontSize:Ct.ellipsisFontSize,lineHeight:Ct.ellipsisLineHeight,cursor:Ct.ellipsisCursor},"brace-row":{display:"inline-block",cursor:"pointer"},brace:{display:"inline-block",cursor:Ct.braceCursor,fontWeight:Ct.braceFontWeight,color:Lt.braceColor},"expanded-icon":{color:Lt.expandedIcon},"collapsed-icon":{color:Lt.collapsedIcon},colon:{display:"inline-block",margin:Ct.keyMargin,color:Lt.keyColor,verticalAlign:"top"},objectKeyVal:function(jt,$t){return{style:rt({paddingTop:Ct.keyValPaddingTop,paddingRight:Ct.keyValPaddingRight,paddingBottom:Ct.keyValPaddingBottom,borderLeft:Ct.keyValBorderLeft+" "+Lt.objectBorder,":hover":{paddingLeft:$t.paddingLeft-1+"px",borderLeft:Ct.keyValBorderHover+" "+Lt.objectBorder}},$t)}},"object-key-val-no-border":{padding:Ct.keyValPadding},"pushed-content":{marginLeft:Ct.pushedContentMarginLeft},variableValue:function(jt,$t){return{style:rt({display:"inline-block",paddingRight:Ct.variableValuePaddingRight,position:"relative"},$t)}},"object-name":{display:"inline-block",color:Lt.keyColor,letterSpacing:Ct.keyLetterSpacing,fontStyle:Ct.keyFontStyle,verticalAlign:Ct.keyVerticalAlign,opacity:Ct.keyOpacity,":hover":{opacity:Ct.keyOpacityHover}},"array-key":{display:"inline-block",color:Lt.arrayKeyColor,letterSpacing:Ct.keyLetterSpacing,fontStyle:Ct.keyFontStyle,verticalAlign:Ct.keyVerticalAlign,opacity:Ct.keyOpacity,":hover":{opacity:Ct.keyOpacityHover}},"object-size":{color:Lt.objectSize,borderRadius:Ct.objectSizeBorderRadius,fontStyle:Ct.objectSizeFontStyle,margin:Ct.objectSizeMargin,cursor:"default"},"data-type-label":{fontSize:Ct.dataTypeFontSize,marginRight:Ct.dataTypeMarginRight,opacity:Ct.datatypeOpacity},boolean:{display:"inline-block",color:Lt.dataTypes.boolean},date:{display:"inline-block",color:Lt.dataTypes.date},"date-value":{marginLeft:Ct.dateValueMarginLeft},float:{display:"inline-block",color:Lt.dataTypes.float},function:{display:"inline-block",color:Lt.dataTypes.function,cursor:"pointer",whiteSpace:"pre-line"},"function-value":{fontStyle:"italic"},integer:{display:"inline-block",color:Lt.dataTypes.integer},string:{display:"inline-block",color:Lt.dataTypes.string},nan:{display:"inline-block",color:Lt.dataTypes.nan,fontSize:Ct.nanFontSize,fontWeight:Ct.nanFontWeight,backgroundColor:Lt.dataTypes.background,padding:Ct.nanPadding,borderRadius:Ct.nanBorderRadius},null:{display:"inline-block",color:Lt.dataTypes.null,fontSize:Ct.nullFontSize,fontWeight:Ct.nullFontWeight,backgroundColor:Lt.dataTypes.background,padding:Ct.nullPadding,borderRadius:Ct.nullBorderRadius},undefined:{display:"inline-block",color:Lt.dataTypes.undefined,fontSize:Ct.undefinedFontSize,padding:Ct.undefinedPadding,borderRadius:Ct.undefinedBorderRadius,backgroundColor:Lt.dataTypes.background},regexp:{display:"inline-block",color:Lt.dataTypes.regexp},"copy-to-clipboard":{cursor:Ct.clipboardCursor},"copy-icon":{color:Lt.copyToClipboard,fontSize:Ct.iconFontSize,marginRight:Ct.iconMarginRight,verticalAlign:"top"},"copy-icon-copied":{color:Lt.copyToClipboardCheck,marginLeft:Ct.clipboardCheckMarginLeft},"array-group-meta-data":{display:"inline-block",padding:Ct.arrayGroupMetaPadding},"object-meta-data":{display:"inline-block",padding:Ct.metaDataPadding},"icon-container":{display:"inline-block",width:Ct.iconContainerWidth},tooltip:{padding:Ct.tooltipPadding},removeVarIcon:{verticalAlign:"top",display:"inline-block",color:Lt.editVariable.removeIcon,cursor:Ct.iconCursor,fontSize:Ct.iconFontSize,marginRight:Ct.iconMarginRight},addVarIcon:{verticalAlign:"top",display:"inline-block",color:Lt.editVariable.addIcon,cursor:Ct.iconCursor,fontSize:Ct.iconFontSize,marginRight:Ct.iconMarginRight},editVarIcon:{verticalAlign:"top",display:"inline-block",color:Lt.editVariable.editIcon,cursor:Ct.iconCursor,fontSize:Ct.iconFontSize,marginRight:Ct.iconMarginRight},"edit-icon-container":{display:"inline-block",verticalAlign:"top"},"check-icon":{display:"inline-block",cursor:Ct.iconCursor,color:Lt.editVariable.checkIcon,fontSize:Ct.iconFontSize,paddingRight:Ct.iconPaddingRight},"cancel-icon":{display:"inline-block",cursor:Ct.iconCursor,color:Lt.editVariable.cancelIcon,fontSize:Ct.iconFontSize,paddingRight:Ct.iconPaddingRight},"edit-input":{display:"inline-block",minWidth:Ct.editInputMinWidth,borderRadius:Ct.editInputBorderRadius,backgroundColor:Lt.editVariable.background,color:Lt.editVariable.color,padding:Ct.editInputPadding,marginRight:Ct.editInputMarginRight,fontFamily:Ct.editInputFontFamily},"detected-row":{paddingTop:Ct.detectedRowPaddingTop},"key-modal-request":{position:Ct.addKeyCoverPosition,top:Ct.addKeyCoverPositionPx,left:Ct.addKeyCoverPositionPx,right:Ct.addKeyCoverPositionPx,bottom:Ct.addKeyCoverPositionPx,backgroundColor:Ct.addKeyCoverBackground},"key-modal":{width:Ct.addKeyModalWidth,backgroundColor:Lt.addKeyModal.background,marginLeft:Ct.addKeyModalMargin,marginRight:Ct.addKeyModalMargin,padding:Ct.addKeyModalPadding,borderRadius:Ct.addKeyModalRadius,marginTop:"15px",position:"relative"},"key-modal-label":{color:Lt.addKeyModal.labelColor,marginLeft:"2px",marginBottom:"5px",fontSize:"11px"},"key-modal-input-container":{overflow:"hidden"},"key-modal-input":{width:"100%",padding:"3px 6px",fontFamily:"monospace",color:Lt.addKeyModal.color,border:"none",boxSizing:"border-box",borderRadius:"2px"},"key-modal-cancel":{backgroundColor:Lt.editVariable.removeIcon,position:"absolute",top:"0px",right:"0px",borderRadius:"0px 3px 0px 3px",cursor:"pointer"},"key-modal-cancel-icon":{color:Lt.addKeyModal.labelColor,fontSize:Ct.iconFontSize,transform:"rotate(45deg)"},"key-modal-submit":{color:Lt.editVariable.addIcon,fontSize:Ct.iconFontSize,position:"absolute",right:"2px",top:"3px",cursor:"pointer"},"function-ellipsis":{display:"inline-block",color:Lt.ellipsisColor,fontSize:Ct.ellipsisFontSize,lineHeight:Ct.ellipsisLineHeight,cursor:Ct.ellipsisCursor},"validation-failure":{float:"right",padding:"3px 6px",borderRadius:"2px",cursor:"pointer",color:Lt.validationFailure.fontColor,backgroundColor:Lt.validationFailure.background},"validation-failure-label":{marginRight:"6px"},"validation-failure-clear":{position:"relative",verticalAlign:"top",cursor:"pointer",color:Lt.validationFailure.iconColor,fontSize:Ct.iconFontSize,transform:"rotate(45deg)"}}};function Rt(Et,Lt,jt){return Et||console.error("theme has not been set"),function($t){var It=At;return $t!==!1&&$t!=="none"||(It=_t),Object(Mt.createStyling)(Ot,{defaultBase16:It})($t)}(Et)(Lt,jt)}var Wt=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=($t.rjvId,$t.type_name),an=$t.displayDataTypes,nn=$t.theme;return an?st.a.createElement("span",Object.assign({className:"data-type-label"},Rt(nn,"data-type-label")),It):null}}]),jt}(st.a.PureComponent),Jt=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props;return st.a.createElement("div",Rt($t.theme,"boolean"),st.a.createElement(Wt,Object.assign({type_name:"bool"},$t)),$t.value?"true":"false")}}]),jt}(st.a.PureComponent),Qt=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props;return st.a.createElement("div",Rt($t.theme,"date"),st.a.createElement(Wt,Object.assign({type_name:"date"},$t)),st.a.createElement("span",Object.assign({className:"date-value"},Rt($t.theme,"date-value")),$t.value.toLocaleTimeString("en-us",{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})))}}]),jt}(st.a.PureComponent),Gt=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props;return st.a.createElement("div",Rt($t.theme,"float"),st.a.createElement(Wt,Object.assign({type_name:"float"},$t)),this.props.value)}}]),jt}(st.a.PureComponent);function Vt(Et,Lt){(Lt==null||Lt>Et.length)&&(Lt=Et.length);for(var jt=0,$t=new Array(Lt);jt"u"||Et[Symbol.iterator]==null){if(Array.isArray(Et)||(jt=dn(Et))||Lt&&Et&&typeof Et.length=="number"){jt&&(Et=jt);var $t=0,It=function(){};return{s:It,n:function(){return $t>=Et.length?{done:!0}:{done:!1,value:Et[$t++]}},e:function(zt){throw zt},f:It}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var an,nn=!0,Yt=!1;return{s:function(){jt=Et[Symbol.iterator]()},n:function(){var zt=jt.next();return nn=zt.done,zt},e:function(zt){Yt=!0,an=zt},f:function(){try{nn||jt.return==null||jt.return()}finally{if(Yt)throw an}}}}function En(Et){return function(Lt){if(Array.isArray(Lt))return Vt(Lt)}(Et)||function(Lt){if(typeof Symbol<"u"&&Symbol.iterator in Object(Lt))return Array.from(Lt)}(Et)||dn(Et)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var yn=$(46),Rn=new($(47)).Dispatcher,Hn=new(function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){var $t;nt(this,jt);for(var It=arguments.length,an=new Array(It),nn=0;nnIt&&(Yt.style.cursor="pointer",this.state.collapsed&&(nn=st.a.createElement("span",null,nn.substring(0,It),st.a.createElement("span",Rt(an,"ellipsis")," ...")))),st.a.createElement("div",Rt(an,"string"),st.a.createElement(Wt,Object.assign({type_name:"string"},$t)),st.a.createElement("span",Object.assign({className:"string-value"},Yt,{onClick:this.toggleCollapsed}),'"',nn,'"'))}}]),jt}(st.a.PureComponent),ln=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){return st.a.createElement("div",Rt(this.props.theme,"undefined"),"undefined")}}]),jt}(st.a.PureComponent);function Mn(){return(Mn=Object.assign||function(Et){for(var Lt=1;Lt=0||(Bn[hr]=Jn[hr]);return Bn}(Et,["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"]),Wn,Gn=gn.value!==void 0,Kn=Object(pt.useRef)(null),er=zn(Kn,Lt),Un=Object(pt.useRef)(0),Qn=Object(pt.useRef)(),ir=function(){var Jn=Kn.current,vr=jt&&Qn.current?Qn.current:function(lr){var rr=window.getComputedStyle(lr);if(rr===null)return null;var nr,ar=(nr=rr,An.reduce(function(Mr,Or){return Mr[Or]=nr[Or],Mr},{})),Ar=ar.boxSizing;return Ar===""?null:(Ht&&Ar==="border-box"&&(ar.width=parseFloat(ar.width)+parseFloat(ar.borderRightWidth)+parseFloat(ar.borderLeftWidth)+parseFloat(ar.paddingRight)+parseFloat(ar.paddingLeft)+"px"),{sizingStyle:ar,paddingSize:parseFloat(ar.paddingBottom)+parseFloat(ar.paddingTop),borderSize:parseFloat(ar.borderBottomWidth)+parseFloat(ar.borderTopWidth)})}(Jn);if(vr){Qn.current=vr;var hr=function(lr,rr,nr,ar){nr===void 0&&(nr=1),ar===void 0&&(ar=1/0),Ln||((Ln=document.createElement("textarea")).setAttribute("tab-index","-1"),Ln.setAttribute("aria-hidden","true"),Zn(Ln)),Ln.parentNode===null&&document.body.appendChild(Ln);var Ar=lr.paddingSize,Mr=lr.borderSize,Or=lr.sizingStyle,jr=Or.boxSizing;Object.keys(Or).forEach(function(Nr){var $r=Nr;Ln.style[$r]=Or[$r]}),Zn(Ln),Ln.value=rr;var sn=function(Nr,$r){var Ur=Nr.scrollHeight;return $r.sizingStyle.boxSizing==="border-box"?Ur+$r.borderSize:Ur-$r.paddingSize}(Ln,lr);Ln.value="x";var Lr=Ln.scrollHeight-Ar,Dr=Lr*nr;jr==="border-box"&&(Dr=Dr+Ar+Mr),sn=Math.max(Dr,sn);var Fr=Lr*ar;return jr==="border-box"&&(Fr=Fr+Ar+Mr),[sn=Math.min(Fr,sn),Lr]}(vr,Jn.value||Jn.placeholder||"x",It,$t),jn=hr[0],Bn=hr[1];Un.current!==jn&&(Un.current=jn,Jn.style.setProperty("height",jn+"px","important"),zt(jn,{rowHeight:Bn}))}};return Object(pt.useLayoutEffect)(ir),Wn=Pn(ir),Object(pt.useLayoutEffect)(function(){var Jn=function(vr){Wn.current(vr)};return window.addEventListener("resize",Jn),function(){window.removeEventListener("resize",Jn)}},[]),Object(pt.createElement)("textarea",Mn({},gn,{onChange:function(Jn){Gn||ir(),nn(Jn)},ref:er}))},pn=Object(pt.forwardRef)(Xt);function Tn(Et){Et=Et.trim();try{if((Et=JSON.stringify(JSON.parse(Et)))[0]==="[")return cr("array",JSON.parse(Et));if(Et[0]==="{")return cr("object",JSON.parse(Et));if(Et.match(/\-?\d+\.\d+/)&&Et.match(/\-?\d+\.\d+/)[0]===Et)return cr("float",parseFloat(Et));if(Et.match(/\-?\d+e-\d+/)&&Et.match(/\-?\d+e-\d+/)[0]===Et)return cr("float",Number(Et));if(Et.match(/\-?\d+/)&&Et.match(/\-?\d+/)[0]===Et)return cr("integer",parseInt(Et));if(Et.match(/\-?\d+e\+\d+/)&&Et.match(/\-?\d+e\+\d+/)[0]===Et)return cr("integer",Number(Et))}catch{}switch(Et=Et.toLowerCase()){case"undefined":return cr("undefined",void 0);case"nan":return cr("nan",NaN);case"null":return cr("null",null);case"true":return cr("boolean",!0);case"false":return cr("boolean",!1);default:if(Et=Date.parse(Et))return cr("date",new Date(Et))}return cr(!1,null)}function cr(Et,Lt){return{type:Et,value:Lt}}var yr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",Object.assign({},ur(It),{viewBox:"0 0 24 24",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),st.a.createElement("path",{d:"M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M7,13H17V11H7"})))}}]),jt}(st.a.PureComponent),tr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",Object.assign({},ur(It),{viewBox:"0 0 24 24",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),st.a.createElement("path",{d:"M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,7H11V11H7V13H11V17H13V13H17V11H13V7Z"})))}}]),jt}(st.a.PureComponent),Xn=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]),nn=ur(It).style;return st.a.createElement("span",an,st.a.createElement("svg",{fill:nn.color,width:nn.height,height:nn.width,style:nn,viewBox:"0 0 1792 1792"},st.a.createElement("path",{d:"M1344 800v64q0 14-9 23t-23 9h-832q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h832q14 0 23 9t9 23zm128 448v-832q0-66-47-113t-113-47h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113zm128-832v832q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z"})))}}]),jt}(st.a.PureComponent),gr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]),nn=ur(It).style;return st.a.createElement("span",an,st.a.createElement("svg",{fill:nn.color,width:nn.height,height:nn.width,style:nn,viewBox:"0 0 1792 1792"},st.a.createElement("path",{d:"M1344 800v64q0 14-9 23t-23 9h-352v352q0 14-9 23t-23 9h-64q-14 0-23-9t-9-23v-352h-352q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h352v-352q0-14 9-23t23-9h64q14 0 23 9t9 23v352h352q14 0 23 9t9 23zm128 448v-832q0-66-47-113t-113-47h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113zm128-832v832q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z"})))}}]),jt}(st.a.PureComponent),In=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",{style:rt(rt({},ur(It).style),{},{paddingLeft:"2px",verticalAlign:"top"}),viewBox:"0 0 15 15",fill:"currentColor"},st.a.createElement("path",{d:"M0 14l6-6-6-6z"})))}}]),jt}(st.a.PureComponent),dr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",{style:rt(rt({},ur(It).style),{},{paddingLeft:"2px",verticalAlign:"top"}),viewBox:"0 0 15 15",fill:"currentColor"},st.a.createElement("path",{d:"M0 5l6 6 6-6z"})))}}]),jt}(st.a.PureComponent),Vn=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",Object.assign({},ur(It),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),st.a.createElement("g",null,st.a.createElement("path",{d:"m30 35h-25v-22.5h25v7.5h2.5v-12.5c0-1.4-1.1-2.5-2.5-2.5h-7.5c0-2.8-2.2-5-5-5s-5 2.2-5 5h-7.5c-1.4 0-2.5 1.1-2.5 2.5v27.5c0 1.4 1.1 2.5 2.5 2.5h25c1.4 0 2.5-1.1 2.5-2.5v-5h-2.5v5z m-20-27.5h2.5s2.5-1.1 2.5-2.5 1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5 1.3 2.5 2.5 2.5h2.5s2.5 1.1 2.5 2.5h-20c0-1.5 1.1-2.5 2.5-2.5z m-2.5 20h5v-2.5h-5v2.5z m17.5-5v-5l-10 7.5 10 7.5v-5h12.5v-5h-12.5z m-17.5 10h7.5v-2.5h-7.5v2.5z m12.5-17.5h-12.5v2.5h12.5v-2.5z m-7.5 5h-5v2.5h5v-2.5z"}))))}}]),jt}(st.a.PureComponent),pr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",Object.assign({},ur(It),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),st.a.createElement("g",null,st.a.createElement("path",{d:"m28.6 25q0-0.5-0.4-1l-4-4 4-4q0.4-0.5 0.4-1 0-0.6-0.4-1.1l-2-2q-0.4-0.4-1-0.4-0.6 0-1 0.4l-4.1 4.1-4-4.1q-0.4-0.4-1-0.4-0.6 0-1 0.4l-2 2q-0.5 0.5-0.5 1.1 0 0.5 0.5 1l4 4-4 4q-0.5 0.5-0.5 1 0 0.7 0.5 1.1l2 2q0.4 0.4 1 0.4 0.6 0 1-0.4l4-4.1 4.1 4.1q0.4 0.4 1 0.4 0.6 0 1-0.4l2-2q0.4-0.4 0.4-1z m8.7-5q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z"}))))}}]),jt}(st.a.PureComponent),qn=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",Object.assign({},ur(It),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),st.a.createElement("g",null,st.a.createElement("path",{d:"m30.1 21.4v-2.8q0-0.6-0.4-1t-1-0.5h-5.7v-5.7q0-0.6-0.4-1t-1-0.4h-2.9q-0.6 0-1 0.4t-0.4 1v5.7h-5.7q-0.6 0-1 0.5t-0.5 1v2.8q0 0.6 0.5 1t1 0.5h5.7v5.7q0 0.5 0.4 1t1 0.4h2.9q0.6 0 1-0.4t0.4-1v-5.7h5.7q0.6 0 1-0.5t0.4-1z m7.2-1.4q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z"}))))}}]),jt}(st.a.PureComponent),Fn=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",Object.assign({},ur(It),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),st.a.createElement("g",null,st.a.createElement("path",{d:"m31.6 21.6h-10v10h-3.2v-10h-10v-3.2h10v-10h3.2v10h10v3.2z"}))))}}]),jt}(st.a.PureComponent),sr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",Object.assign({},ur(It),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),st.a.createElement("g",null,st.a.createElement("path",{d:"m19.8 26.4l2.6-2.6-3.4-3.4-2.6 2.6v1.3h2.2v2.1h1.2z m9.8-16q-0.3-0.4-0.7 0l-7.8 7.8q-0.4 0.4 0 0.7t0.7 0l7.8-7.8q0.4-0.4 0-0.7z m1.8 13.2v4.3q0 2.6-1.9 4.5t-4.5 1.9h-18.6q-2.6 0-4.5-1.9t-1.9-4.5v-18.6q0-2.7 1.9-4.6t4.5-1.8h18.6q1.4 0 2.6 0.5 0.3 0.2 0.4 0.5 0.1 0.4-0.2 0.7l-1.1 1.1q-0.3 0.3-0.7 0.1-0.5-0.1-1-0.1h-18.6q-1.4 0-2.5 1.1t-1 2.5v18.6q0 1.4 1 2.5t2.5 1h18.6q1.5 0 2.5-1t1.1-2.5v-2.9q0-0.2 0.2-0.4l1.4-1.5q0.3-0.3 0.8-0.1t0.4 0.6z m-2.1-16.5l6.4 6.5-15 15h-6.4v-6.5z m9.9 3l-2.1 2-6.4-6.4 2.1-2q0.6-0.7 1.5-0.7t1.5 0.7l3.4 3.4q0.6 0.6 0.6 1.5t-0.6 1.5z"}))))}}]),jt}(st.a.PureComponent),or=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",Object.assign({},ur(It),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),st.a.createElement("g",null,st.a.createElement("path",{d:"m31.7 16.4q0-0.6-0.4-1l-2.1-2.1q-0.4-0.4-1-0.4t-1 0.4l-9.1 9.1-5-5q-0.5-0.4-1-0.4t-1 0.4l-2.1 2q-0.4 0.4-0.4 1 0 0.6 0.4 1l8.1 8.1q0.4 0.4 1 0.4 0.6 0 1-0.4l12.2-12.1q0.4-0.4 0.4-1z m5.6 3.6q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z"}))))}}]),jt}(st.a.PureComponent);function ur(Et){return Et||(Et={}),{style:rt(rt({verticalAlign:"middle"},Et),{},{color:Et.color?Et.color:"#000000",height:"1em",width:"1em"})}}var xr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt($t){var It;return nt(this,jt),(It=Lt.call(this,$t)).copiedTimer=null,It.handleCopy=function(){var an=document.createElement("textarea"),nn=It.props,Yt=nn.clickCallback,zt=nn.src,gn=nn.namespace;an.innerHTML=JSON.stringify(It.clipboardValue(zt),null," "),document.body.appendChild(an),an.select(),document.execCommand("copy"),document.body.removeChild(an),It.copiedTimer=setTimeout(function(){It.setState({copied:!1})},5500),It.setState({copied:!0},function(){typeof Yt=="function"&&Yt({src:zt,namespace:gn,name:gn[gn.length-1]})})},It.getClippyIcon=function(){var an=It.props.theme;return It.state.copied?st.a.createElement("span",null,st.a.createElement(Vn,Object.assign({className:"copy-icon"},Rt(an,"copy-icon"))),st.a.createElement("span",Rt(an,"copy-icon-copied"),"✔")):st.a.createElement(Vn,Object.assign({className:"copy-icon"},Rt(an,"copy-icon")))},It.clipboardValue=function(an){switch(bt(an)){case"function":case"regexp":return an.toString();default:return an}},It.state={copied:!1},It}return at(jt,[{key:"componentWillUnmount",value:function(){this.copiedTimer&&(clearTimeout(this.copiedTimer),this.copiedTimer=null)}},{key:"render",value:function(){var $t=this.props,It=($t.src,$t.theme),an=$t.hidden,nn=$t.rowHovered,Yt=Rt(It,"copy-to-clipboard").style,zt="inline";return an&&(zt="none"),st.a.createElement("span",{className:"copy-to-clipboard-container",title:"Copy to clipboard",style:{verticalAlign:"top",display:nn?"inline-block":"none"}},st.a.createElement("span",{style:rt(rt({},Yt),{},{display:zt}),onClick:this.handleCopy},this.getClippyIcon()))}}]),jt}(st.a.PureComponent),kr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt($t){var It;return nt(this,jt),(It=Lt.call(this,$t)).getEditIcon=function(){var an=It.props,nn=an.variable,Yt=an.theme;return st.a.createElement("div",{className:"click-to-edit",style:{verticalAlign:"top",display:It.state.hovered?"inline-block":"none"}},st.a.createElement(sr,Object.assign({className:"click-to-edit-icon"},Rt(Yt,"editVarIcon"),{onClick:function(){It.prepopInput(nn)}})))},It.prepopInput=function(an){if(It.props.onEdit!==!1){var nn=function(zt){var gn;switch(bt(zt)){case"undefined":gn="undefined";break;case"nan":gn="NaN";break;case"string":gn=zt;break;case"date":case"function":case"regexp":gn=zt.toString();break;default:try{gn=JSON.stringify(zt,null," ")}catch{gn=""}}return gn}(an.value),Yt=Tn(nn);It.setState({editMode:!0,editValue:nn,parsedInput:{type:Yt.type,value:Yt.value}})}},It.getRemoveIcon=function(){var an=It.props,nn=an.variable,Yt=an.namespace,zt=an.theme,gn=an.rjvId;return st.a.createElement("div",{className:"click-to-remove",style:{verticalAlign:"top",display:It.state.hovered?"inline-block":"none"}},st.a.createElement(pr,Object.assign({className:"click-to-remove-icon"},Rt(zt,"removeVarIcon"),{onClick:function(){Rn.dispatch({name:"VARIABLE_REMOVED",rjvId:gn,data:{name:nn.name,namespace:Yt,existing_value:nn.value,variable_removed:!0}})}})))},It.getValue=function(an,nn){var Yt=!nn&&an.type,zt=ft(It).props;switch(Yt){case!1:return It.getEditInput();case"string":return st.a.createElement(_n,Object.assign({value:an.value},zt));case"integer":return st.a.createElement(bn,Object.assign({value:an.value},zt));case"float":return st.a.createElement(Gt,Object.assign({value:an.value},zt));case"boolean":return st.a.createElement(Jt,Object.assign({value:an.value},zt));case"function":return st.a.createElement(wn,Object.assign({value:an.value},zt));case"null":return st.a.createElement(Sn,zt);case"nan":return st.a.createElement(fn,zt);case"undefined":return st.a.createElement(ln,zt);case"date":return st.a.createElement(Qt,Object.assign({value:an.value},zt));case"regexp":return st.a.createElement(hn,Object.assign({value:an.value},zt));default:return st.a.createElement("div",{className:"object-value"},JSON.stringify(an.value))}},It.getEditInput=function(){var an=It.props.theme,nn=It.state.editValue;return st.a.createElement("div",null,st.a.createElement(pn,Object.assign({type:"text",inputRef:function(Yt){return Yt&&Yt.focus()},value:nn,className:"variable-editor",onChange:function(Yt){var zt=Yt.target.value,gn=Tn(zt);It.setState({editValue:zt,parsedInput:{type:gn.type,value:gn.value}})},onKeyDown:function(Yt){switch(Yt.key){case"Escape":It.setState({editMode:!1,editValue:""});break;case"Enter":(Yt.ctrlKey||Yt.metaKey)&&It.submitEdit(!0)}Yt.stopPropagation()},placeholder:"update this value",minRows:2},Rt(an,"edit-input"))),st.a.createElement("div",Rt(an,"edit-icon-container"),st.a.createElement(pr,Object.assign({className:"edit-cancel"},Rt(an,"cancel-icon"),{onClick:function(){It.setState({editMode:!1,editValue:""})}})),st.a.createElement(or,Object.assign({className:"edit-check string-value"},Rt(an,"check-icon"),{onClick:function(){It.submitEdit()}})),st.a.createElement("div",null,It.showDetected())))},It.submitEdit=function(an){var nn=It.props,Yt=nn.variable,zt=nn.namespace,gn=nn.rjvId,Wn=It.state,Gn=Wn.editValue,Kn=Wn.parsedInput,er=Gn;an&&Kn.type&&(er=Kn.value),It.setState({editMode:!1}),Rn.dispatch({name:"VARIABLE_UPDATED",rjvId:gn,data:{name:Yt.name,namespace:zt,existing_value:Yt.value,new_value:er,variable_removed:!1}})},It.showDetected=function(){var an=It.props,nn=an.theme,Yt=(an.variable,an.namespace,an.rjvId,It.state.parsedInput),zt=(Yt.type,Yt.value,It.getDetectedInput());if(zt)return st.a.createElement("div",null,st.a.createElement("div",Rt(nn,"detected-row"),zt,st.a.createElement(or,{className:"edit-check detected",style:rt({verticalAlign:"top",paddingLeft:"3px"},Rt(nn,"check-icon").style),onClick:function(){It.submitEdit(!0)}})))},It.getDetectedInput=function(){var an=It.state.parsedInput,nn=an.type,Yt=an.value,zt=ft(It).props,gn=zt.theme;if(nn!==!1)switch(nn.toLowerCase()){case"object":return st.a.createElement("span",null,st.a.createElement("span",{style:rt(rt({},Rt(gn,"brace").style),{},{cursor:"default"})},"{"),st.a.createElement("span",{style:rt(rt({},Rt(gn,"ellipsis").style),{},{cursor:"default"})},"..."),st.a.createElement("span",{style:rt(rt({},Rt(gn,"brace").style),{},{cursor:"default"})},"}"));case"array":return st.a.createElement("span",null,st.a.createElement("span",{style:rt(rt({},Rt(gn,"brace").style),{},{cursor:"default"})},"["),st.a.createElement("span",{style:rt(rt({},Rt(gn,"ellipsis").style),{},{cursor:"default"})},"..."),st.a.createElement("span",{style:rt(rt({},Rt(gn,"brace").style),{},{cursor:"default"})},"]"));case"string":return st.a.createElement(_n,Object.assign({value:Yt},zt));case"integer":return st.a.createElement(bn,Object.assign({value:Yt},zt));case"float":return st.a.createElement(Gt,Object.assign({value:Yt},zt));case"boolean":return st.a.createElement(Jt,Object.assign({value:Yt},zt));case"function":return st.a.createElement(wn,Object.assign({value:Yt},zt));case"null":return st.a.createElement(Sn,zt);case"nan":return st.a.createElement(fn,zt);case"undefined":return st.a.createElement(ln,zt);case"date":return st.a.createElement(Qt,Object.assign({value:new Date(Yt)},zt))}},It.state={editMode:!1,editValue:"",hovered:!1,renameKey:!1,parsedInput:{type:!1,value:null}},It}return at(jt,[{key:"render",value:function(){var $t=this,It=this.props,an=It.variable,nn=It.singleIndent,Yt=It.type,zt=It.theme,gn=It.namespace,Wn=It.indentWidth,Gn=It.enableClipboard,Kn=It.onEdit,er=It.onDelete,Un=It.onSelect,Qn=It.displayArrayKey,ir=It.quotesOnKeys,Jn=this.state.editMode;return st.a.createElement("div",Object.assign({},Rt(zt,"objectKeyVal",{paddingLeft:Wn*nn}),{onMouseEnter:function(){return $t.setState(rt(rt({},$t.state),{},{hovered:!0}))},onMouseLeave:function(){return $t.setState(rt(rt({},$t.state),{},{hovered:!1}))},className:"variable-row",key:an.name}),Yt=="array"?Qn?st.a.createElement("span",Object.assign({},Rt(zt,"array-key"),{key:an.name+"_"+gn}),an.name,st.a.createElement("div",Rt(zt,"colon"),":")):null:st.a.createElement("span",null,st.a.createElement("span",Object.assign({},Rt(zt,"object-name"),{className:"object-key",key:an.name+"_"+gn}),!!ir&&st.a.createElement("span",{style:{verticalAlign:"top"}},'"'),st.a.createElement("span",{style:{display:"inline-block"}},an.name),!!ir&&st.a.createElement("span",{style:{verticalAlign:"top"}},'"')),st.a.createElement("span",Rt(zt,"colon"),":")),st.a.createElement("div",Object.assign({className:"variable-value",onClick:Un===!1&&Kn===!1?null:function(vr){var hr=En(gn);(vr.ctrlKey||vr.metaKey)&&Kn!==!1?$t.prepopInput(an):Un!==!1&&(hr.shift(),Un(rt(rt({},an),{},{namespace:hr})))}},Rt(zt,"variableValue",{cursor:Un===!1?"default":"pointer"})),this.getValue(an,Jn)),Gn?st.a.createElement(xr,{rowHovered:this.state.hovered,hidden:Jn,src:an.value,clickCallback:Gn,theme:zt,namespace:[].concat(En(gn),[an.name])}):null,Kn!==!1&&Jn==0?this.getEditIcon():null,er!==!1&&Jn==0?this.getRemoveIcon():null)}}]),jt}(st.a.PureComponent),Tr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){var $t;nt(this,jt);for(var It=arguments.length,an=new Array(It),nn=0;nn0?Gn:null,namespace:Wn.splice(0,Wn.length-1),existing_value:Kn,variable_removed:!1,key_name:null};bt(Kn)==="object"?Rn.dispatch({name:"ADD_VARIABLE_KEY_REQUEST",rjvId:er,data:Qn}):Rn.dispatch({name:"VARIABLE_ADDED",rjvId:er,data:rt(rt({},Qn),{},{new_value:[].concat(En(Kn),[null])})})}})))},$t.getRemoveObject=function(Yt){var zt=$t.props,gn=zt.theme,Wn=(zt.hover,zt.namespace),Gn=zt.name,Kn=zt.src,er=zt.rjvId;if(Wn.length!==1)return st.a.createElement("span",{className:"click-to-remove",style:{display:Yt?"inline-block":"none"}},st.a.createElement(pr,Object.assign({className:"click-to-remove-icon"},Rt(gn,"removeVarIcon"),{onClick:function(){Rn.dispatch({name:"VARIABLE_REMOVED",rjvId:er,data:{name:Gn,namespace:Wn.splice(0,Wn.length-1),existing_value:Kn,variable_removed:!0}})}})))},$t.render=function(){var Yt=$t.props,zt=Yt.theme,gn=Yt.onDelete,Wn=Yt.onAdd,Gn=Yt.enableClipboard,Kn=Yt.src,er=Yt.namespace,Un=Yt.rowHovered;return st.a.createElement("div",Object.assign({},Rt(zt,"object-meta-data"),{className:"object-meta-data",onClick:function(Qn){Qn.stopPropagation()}}),$t.getObjectSize(),Gn?st.a.createElement(xr,{rowHovered:Un,clickCallback:Gn,src:Kn,theme:zt,namespace:er}):null,Wn!==!1?$t.getAddAttribute(Un):null,gn!==!1?$t.getRemoveObject(Un):null)},$t}return jt}(st.a.PureComponent);function Pr(Et){var Lt=Et.parent_type,jt=Et.namespace,$t=Et.quotesOnKeys,It=Et.theme,an=Et.jsvRoot,nn=Et.name,Yt=Et.displayArrayKey,zt=Et.name?Et.name:"";return!an||nn!==!1&&nn!==null?Lt=="array"?Yt?st.a.createElement("span",Object.assign({},Rt(It,"array-key"),{key:jt}),st.a.createElement("span",{className:"array-key"},zt),st.a.createElement("span",Rt(It,"colon"),":")):st.a.createElement("span",null):st.a.createElement("span",Object.assign({},Rt(It,"object-name"),{key:jt}),st.a.createElement("span",{className:"object-key"},$t&&st.a.createElement("span",{style:{verticalAlign:"top"}},'"'),st.a.createElement("span",null,zt),$t&&st.a.createElement("span",{style:{verticalAlign:"top"}},'"')),st.a.createElement("span",Rt(It,"colon"),":")):st.a.createElement("span",null)}function Ir(Et){var Lt=Et.theme;switch(Et.iconStyle){case"triangle":return st.a.createElement(dr,Object.assign({},Rt(Lt,"expanded-icon"),{className:"expanded-icon"}));case"square":return st.a.createElement(Xn,Object.assign({},Rt(Lt,"expanded-icon"),{className:"expanded-icon"}));default:return st.a.createElement(yr,Object.assign({},Rt(Lt,"expanded-icon"),{className:"expanded-icon"}))}}function Wr(Et){var Lt=Et.theme;switch(Et.iconStyle){case"triangle":return st.a.createElement(In,Object.assign({},Rt(Lt,"collapsed-icon"),{className:"collapsed-icon"}));case"square":return st.a.createElement(gr,Object.assign({},Rt(Lt,"collapsed-icon"),{className:"collapsed-icon"}));default:return st.a.createElement(tr,Object.assign({},Rt(Lt,"collapsed-icon"),{className:"collapsed-icon"}))}}var Qr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt($t){var It;return nt(this,jt),(It=Lt.call(this,$t)).toggleCollapsed=function(an){var nn=[];for(var Yt in It.state.expanded)nn.push(It.state.expanded[Yt]);nn[an]=!nn[an],It.setState({expanded:nn})},It.state={expanded:[]},It}return at(jt,[{key:"getExpandedIcon",value:function($t){var It=this.props,an=It.theme,nn=It.iconStyle;return this.state.expanded[$t]?st.a.createElement(Ir,{theme:an,iconStyle:nn}):st.a.createElement(Wr,{theme:an,iconStyle:nn})}},{key:"render",value:function(){var $t=this,It=this.props,an=It.src,nn=It.groupArraysAfterLength,Yt=(It.depth,It.name),zt=It.theme,gn=It.jsvRoot,Wn=It.namespace,Gn=(It.parent_type,xt(It,["src","groupArraysAfterLength","depth","name","theme","jsvRoot","namespace","parent_type"])),Kn=0,er=5*this.props.indentWidth;gn||(Kn=5*this.props.indentWidth);var Un=nn,Qn=Math.ceil(an.length/Un);return st.a.createElement("div",Object.assign({className:"object-key-val"},Rt(zt,gn?"jsv-root":"objectKeyVal",{paddingLeft:Kn})),st.a.createElement(Pr,this.props),st.a.createElement("span",null,st.a.createElement(Tr,Object.assign({size:an.length},this.props))),En(Array(Qn)).map(function(ir,Jn){return st.a.createElement("div",Object.assign({key:Jn,className:"object-key-val array-group"},Rt(zt,"objectKeyVal",{marginLeft:6,paddingLeft:er})),st.a.createElement("span",Rt(zt,"brace-row"),st.a.createElement("div",Object.assign({className:"icon-container"},Rt(zt,"icon-container"),{onClick:function(vr){$t.toggleCollapsed(Jn)}}),$t.getExpandedIcon(Jn)),$t.state.expanded[Jn]?st.a.createElement(kt,Object.assign({key:Yt+Jn,depth:0,name:!1,collapsed:!1,groupArraysAfterLength:Un,index_offset:Jn*Un,src:an.slice(Jn*Un,Jn*Un+Un),namespace:Wn,type:"array",parent_type:"array_group",theme:zt},Gn)):st.a.createElement("span",Object.assign({},Rt(zt,"brace"),{onClick:function(vr){$t.toggleCollapsed(Jn)},className:"array-group-brace"}),"[",st.a.createElement("div",Object.assign({},Rt(zt,"array-group-meta-data"),{className:"array-group-meta-data"}),st.a.createElement("span",Object.assign({className:"object-size"},Rt(zt,"object-size")),Jn*Un," - ",Jn*Un+Un>an.length?an.length:Jn*Un+Un)),"]")))}))}}]),jt}(st.a.PureComponent),Zr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt($t){var It;nt(this,jt),(It=Lt.call(this,$t)).toggleCollapsed=function(){It.setState({expanded:!It.state.expanded},function(){rn.set(It.props.rjvId,It.props.namespace,"expanded",It.state.expanded)})},It.getObjectContent=function(nn,Yt,zt){return st.a.createElement("div",{className:"pushed-content object-container"},st.a.createElement("div",Object.assign({className:"object-content"},Rt(It.props.theme,"pushed-content")),It.renderObjectContents(Yt,zt)))},It.getEllipsis=function(){return It.state.size===0?null:st.a.createElement("div",Object.assign({},Rt(It.props.theme,"ellipsis"),{className:"node-ellipsis",onClick:It.toggleCollapsed}),"...")},It.getObjectMetaData=function(nn){var Yt=It.props,zt=(Yt.rjvId,Yt.theme,It.state),gn=zt.size,Wn=zt.hovered;return st.a.createElement(Tr,Object.assign({rowHovered:Wn,size:gn},It.props))},It.renderObjectContents=function(nn,Yt){var zt,gn=It.props,Wn=gn.depth,Gn=gn.parent_type,Kn=gn.index_offset,er=gn.groupArraysAfterLength,Un=gn.namespace,Qn=It.state.object_type,ir=[],Jn=Object.keys(nn||{});return It.props.sortKeys&&Qn!=="array"&&(Jn=Jn.sort()),Jn.forEach(function(vr){if(zt=new mo(vr,nn[vr]),Gn==="array_group"&&Kn&&(zt.name=parseInt(zt.name)+Kn),nn.hasOwnProperty(vr))if(zt.type==="object")ir.push(st.a.createElement(kt,Object.assign({key:zt.name,depth:Wn+1,name:zt.name,src:zt.value,namespace:Un.concat(zt.name),parent_type:Qn},Yt)));else if(zt.type==="array"){var hr=kt;er&&zt.value.length>er&&(hr=Qr),ir.push(st.a.createElement(hr,Object.assign({key:zt.name,depth:Wn+1,name:zt.name,src:zt.value,namespace:Un.concat(zt.name),type:"array",parent_type:Qn},Yt)))}else ir.push(st.a.createElement(kr,Object.assign({key:zt.name+"_"+Un,variable:zt,singleIndent:5,namespace:Un,type:It.props.type},Yt)))}),ir};var an=jt.getState($t);return It.state=rt(rt({},an),{},{prevProps:{}}),It}return at(jt,[{key:"getBraceStart",value:function($t,It){var an=this,nn=this.props,Yt=nn.src,zt=nn.theme,gn=nn.iconStyle;if(nn.parent_type==="array_group")return st.a.createElement("span",null,st.a.createElement("span",Rt(zt,"brace"),$t==="array"?"[":"{"),It?this.getObjectMetaData(Yt):null);var Wn=It?Ir:Wr;return st.a.createElement("span",null,st.a.createElement("span",Object.assign({onClick:function(Gn){an.toggleCollapsed()}},Rt(zt,"brace-row")),st.a.createElement("div",Object.assign({className:"icon-container"},Rt(zt,"icon-container")),st.a.createElement(Wn,{theme:zt,iconStyle:gn})),st.a.createElement(Pr,this.props),st.a.createElement("span",Rt(zt,"brace"),$t==="array"?"[":"{")),It?this.getObjectMetaData(Yt):null)}},{key:"render",value:function(){var $t=this,It=this.props,an=It.depth,nn=It.src,Yt=(It.namespace,It.name,It.type,It.parent_type),zt=It.theme,gn=It.jsvRoot,Wn=It.iconStyle,Gn=xt(It,["depth","src","namespace","name","type","parent_type","theme","jsvRoot","iconStyle"]),Kn=this.state,er=Kn.object_type,Un=Kn.expanded,Qn={};return gn||Yt==="array_group"?Yt==="array_group"&&(Qn.borderLeft=0,Qn.display="inline"):Qn.paddingLeft=5*this.props.indentWidth,st.a.createElement("div",Object.assign({className:"object-key-val",onMouseEnter:function(){return $t.setState(rt(rt({},$t.state),{},{hovered:!0}))},onMouseLeave:function(){return $t.setState(rt(rt({},$t.state),{},{hovered:!1}))}},Rt(zt,gn?"jsv-root":"objectKeyVal",Qn)),this.getBraceStart(er,Un),Un?this.getObjectContent(an,nn,rt({theme:zt,iconStyle:Wn},Gn)):this.getEllipsis(),st.a.createElement("span",{className:"brace-row"},st.a.createElement("span",{style:rt(rt({},Rt(zt,"brace").style),{},{paddingLeft:Un?"3px":"0px"})},er==="array"?"]":"}"),Un?null:this.getObjectMetaData(nn)))}}],[{key:"getDerivedStateFromProps",value:function($t,It){var an=It.prevProps;return $t.src!==an.src||$t.collapsed!==an.collapsed||$t.name!==an.name||$t.namespace!==an.namespace||$t.rjvId!==an.rjvId?rt(rt({},jt.getState($t)),{},{prevProps:$t}):null}}]),jt}(st.a.PureComponent);Zr.getState=function(Et){var Lt=Object.keys(Et.src).length,jt=(Et.collapsed===!1||Et.collapsed!==!0&&Et.collapsed>Et.depth)&&(!Et.shouldCollapse||Et.shouldCollapse({name:Et.name,src:Et.src,type:bt(Et.src),namespace:Et.namespace})===!1)&&Lt!==0;return{expanded:rn.get(Et.rjvId,Et.namespace,"expanded",jt),object_type:Et.type==="array"?"array":"object",parent_type:Et.type==="array"?"array":"object",size:Lt,hovered:!1}};var mo=function Et(Lt,jt){nt(this,Et),this.name=Lt,this.value=jt,this.type=bt(jt)};St(Zr);var kt=Zr,Bt=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){var $t;nt(this,jt);for(var It=arguments.length,an=new Array(It),nn=0;nnYt.groupArraysAfterLength&&(gn=Qr),st.a.createElement("div",{className:"pretty-json-container object-container"},st.a.createElement("div",{className:"object-content"},st.a.createElement(gn,Object.assign({namespace:zt,depth:0,jsvRoot:!0},Yt))))},$t}return jt}(st.a.PureComponent),Pt=function(Et){dt(jt,Et);var Lt=ut(jt);function jt($t){var It;return nt(this,jt),(It=Lt.call(this,$t)).closeModal=function(){Rn.dispatch({rjvId:It.props.rjvId,name:"RESET"})},It.submit=function(){It.props.submit(It.state.input)},It.state={input:$t.input?$t.input:""},It}return at(jt,[{key:"render",value:function(){var $t=this,It=this.props,an=It.theme,nn=It.rjvId,Yt=It.isValid,zt=this.state.input,gn=Yt(zt);return st.a.createElement("div",Object.assign({className:"key-modal-request"},Rt(an,"key-modal-request"),{onClick:this.closeModal}),st.a.createElement("div",Object.assign({},Rt(an,"key-modal"),{onClick:function(Wn){Wn.stopPropagation()}}),st.a.createElement("div",Rt(an,"key-modal-label"),"Key Name:"),st.a.createElement("div",{style:{position:"relative"}},st.a.createElement("input",Object.assign({},Rt(an,"key-modal-input"),{className:"key-modal-input",ref:function(Wn){return Wn&&Wn.focus()},spellCheck:!1,value:zt,placeholder:"...",onChange:function(Wn){$t.setState({input:Wn.target.value})},onKeyPress:function(Wn){gn&&Wn.key==="Enter"?$t.submit():Wn.key==="Escape"&&$t.closeModal()}})),gn?st.a.createElement(or,Object.assign({},Rt(an,"key-modal-submit"),{className:"key-modal-submit",onClick:function(Wn){return $t.submit()}})):null),st.a.createElement("span",Rt(an,"key-modal-cancel"),st.a.createElement(Fn,Object.assign({},Rt(an,"key-modal-cancel-icon"),{className:"key-modal-cancel",onClick:function(){Rn.dispatch({rjvId:nn,name:"RESET"})}})))))}}]),jt}(st.a.PureComponent),gt=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){var $t;nt(this,jt);for(var It=arguments.length,an=new Array(It),nn=0;nn_($.updated_src),[]);return jsxs("div",{className:"send-tx-form",children:[jsx$1("h3",{children:"Configure and send transaction"}),jsx$1(ReactJson,{src:defaultTx,theme:"ocean",onEdit:j,onAdd:j,onDelete:j}),d?jsx$1("button",{onClick:()=>k.sendTransaction(b),children:"Send transaction"}):jsx$1("button",{onClick:()=>k.openModal(),children:"Connect wallet to send the transaction"})]})}function App(){return jsx$1(TonConnectUIProvider$1,{manifestUrl:"https://ton-connect.github.io/demo-dapp-with-wallet/tonconnect-manifest.json",uiPreferences:{theme:THEME.DARK},walletsListConfiguration:{includeWallets:[{appName:"telegram-wallet",name:"Wallet",imageUrl:"https://wallet.tg/images/logo-288.png",aboutUrl:"https://wallet.tg/",universalLink:"https://t.me/wallet?attach=wallet",bridgeUrl:"https://bridge.ton.space/bridge",platforms:["ios","android","macos","windows","linux"]},{appName:"tonwallet",name:"TON Wallet",imageUrl:"https://wallet.ton.org/assets/ui/qr-logo.png",aboutUrl:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",universalLink:"https://wallet.ton.org/ton-connect",jsBridgeKey:"tonwallet",bridgeUrl:"https://bridge.tonapi.io/bridge",platforms:["chrome","android"]},{appName:"nicegramWallet",name:"Nicegram Wallet",imageUrl:"https://static.nicegram.app/icon.png",aboutUrl:"https://nicegram.app",universalLink:"https://nicegram.app/tc",deepLink:"nicegram-tc://",jsBridgeKey:"nicegramWallet",bridgeUrl:"https://tc.nicegram.app/bridge",platforms:["ios","android","macos","windows","linux"]},{appName:"tokenpocket",name:"TokenPocket",imageUrl:"https://hk.tpstatic.net/logo/tokenpocket.png",aboutUrl:"https://www.tokenpocket.pro",universalLink:"https://tp-lab.tptool.pro/ton-connect/",jsBridgeKey:"tokenpocket",bridgeUrl:"https://ton-connect.mytokenpocket.vip/bridge",platforms:["ios","android","macos","windows","linux"]},{appName:"dewallet",name:"DeWallet",imageUrl:"https://raw.githubusercontent.com/delab-team/manifests-images/main/WalletAvatar.png",aboutUrl:"https://delabwallet.com",universalLink:"https://t.me/dewallet?attach=wallet",bridgeUrl:"https://bridge.dewallet.pro/bridge",platforms:["ios","android","macos","windows","linux"]},{appName:"cdcTonWallet",name:"Crypto.com DeFi Wallet",imageUrl:"https://apro-ncw-api-file.crypto.com/wallet/logo",aboutUrl:"https://crypto.com/defi-wallet",universalLink:"https://wallet.crypto.com/deeplink/ton-connect",deepLink:"dfw://",jsBridgeKey:"cdcTonWallet",bridgeUrl:"https://wallet.crypto.com/sse/tonbridge",platforms:["ios","android","chrome"]},{appName:"tobi",name:"Tobi",imageUrl:"https://app.tobiwallet.app/icons/logo.png",aboutUrl:"https://tobi.fun",universalLink:"https://t.me/TobiCopilotBot?attach=wallet",bridgeUrl:"https://ton-bridge.tobiwallet.app/bridge",platforms:["ios","android","macos","windows","linux"]},{appName:"trustwalletTon",name:"Trust",imageUrl:"https://assets-cdn.trustwallet.com/dapps/trust.logo.png",aboutUrl:"https://trustwallet.com/about-us",bridgeUrl:"https://tonconnect.trustwallet.com/bridge",jsBridgeKey:"trustwalletTon",platforms:["chrome","ios","android"]},{appName:"bitgetWalletLite",name:"Bitget Wallet Lite",imageUrl:"https://raw.githubusercontent.com/bitgetwallet/download/main/logo/png/bitget_wallet_lite_logo.png",aboutUrl:"https://web3.bitget.com",universalLink:"https://t.me/BitgetWallet_TGBot?attach=wallet",bridgeUrl:"https://ton-connect-bridge.bgwapi.io/bridge",platforms:["ios","android","macos","windows","linux"]},{appName:"onekey",name:"OneKey",imageUrl:"https://common.onekey-asset.com/logo/onekey-x288.png",aboutUrl:"https://onekey.so",jsBridgeKey:"onekeyTonWallet",platforms:["chrome"]},{appName:"tomoWallet",name:"Tomo Wallet",imageUrl:"https://pub.tomo.inc/logo.png",aboutUrl:"https://www.tomo.inc/",universalLink:"https://t.me/tomowalletbot?attach=wallet",bridgeUrl:"https://go-bridge.tomo.inc/bridge",platforms:["ios","android","macos","windows","linux"]},{appName:"hpyTonWallet",name:"HyperPay Wallet",imageUrl:"https://onchain-oss.hyperpay.online/images/logo.png",aboutUrl:"https://www.hyperpay.tech",universalLink:"https://www.hyperpay.tech/download&deeplink=hyperpay://web3/wallet/tonconnect",jsBridgeKey:"hpyTonWallet",bridgeUrl:"https://onchain-wallet.hyperpay.online/bridge",platforms:["ios","android","macos","windows","linux"]},{appName:"unstoppable",name:"Unstoppable Wallet",imageUrl:"https://unstoppable.money/logo288.png",aboutUrl:"https://unstoppable.money/",universalLink:"https://unstoppable.money/ton-connect",bridgeUrl:"https://bridge.unstoppable.money/bridge",platforms:["ios","android","macos","windows","linux"]},{appName:"foxwallet",name:"FoxWallet",imageUrl:"https://hc.foxwallet.com/img/logo.png",aboutUrl:"https://foxwallet.com/",jsBridgeKey:"foxwallet",platforms:["ios","android","macos","windows","linux"]},{appName:"jambo",name:"Jambo",imageUrl:"https://cdn-prod.jambotechnology.xyz/content/jambo_288x288_02da416a6c.png",aboutUrl:"https://www.jambo.technology/",deepLink:"jambotc://",universalLink:"https://jambophone.xyz/",bridgeUrl:"https://bridge.tonapi.io/bridge",jsBridgeKey:"jambowallet",platforms:["android","macos","windows","linux"]}]},actionsConfiguration:{twaReturnUrl:"https://t.me/tc_twa_demo_bot/start"},children:jsxs("div",{className:"app",children:[jsx$1(Header,{}),jsx$1(TxForm,{}),jsx$1(Footer,{})]})})}const index="";var eruda$1={exports:{}};/*! eruda v2.11.3 https://eruda.liriliri.io/ */(function(module,exports){(function(b,_){module.exports=_()})(self,function(){return function(){var __webpack_modules__={422:function(b,_,d){d.d(_,{Z:function(){return rn}});var k=d(5671),j=d(3144),$=d(9340),et=d(2963),tt=d(1120),rt=d(2461),nt=d.n(rt),ot=d(3990),at=d.n(ot),it=d(6768),dt=d.n(it),ct=d(4331),ht=d.n(ct),ft=d(5610),lt=d.n(ft),ut=d(7483),pt=d.n(ut),st=d(6341),wt=d.n(st),yt=d(3875),vt=d.n(yt),St=d(6954),xt=d.n(St);d(9585);function bt(fn){var Sn="luna-".concat(fn,"-");function bn(hn){return nt()(ht()(hn).split(/\s+/),function(_n){return wt()(_n,Sn)?_n:_n.replace(/[\w-]+/,function(ln){return"".concat(Sn).concat(ln)})}).join(" ")}return function(hn){if(/<[^>]*>/g.test(hn))try{var _n=pt().parse(hn);return At(_n,function(ln){ln.attrs&&ln.attrs.class&&(ln.attrs.class=bn(ln.attrs.class))}),pt().stringify(_n)}catch{return bn(hn)}return bn(hn)}}function At(fn,Sn){for(var bn=0,hn=fn.length;bn"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var bn,hn=(0,tt.Z)(fn);if(Sn){var _n=(0,tt.Z)(this).constructor;bn=Reflect.construct(hn,arguments,_n)}else bn=hn.apply(this,arguments);return(0,et.Z)(this,bn)}}var Rn=function(fn){(0,$.Z)(bn,fn);var Sn=yn(bn);function bn(hn,_n){var ln,Mn=_n.compName,Nn=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}).theme,Pn=Nn===void 0?"light":Nn;return(0,k.Z)(this,bn),(ln=Sn.call(this)).subComponents=[],ln.compName=Mn,ln.c=bt(Mn),ln.options={},ln.container=hn,ln.$container=Rt()(hn),ln.$container.addClass(["luna-".concat(Mn),ln.c("platform-".concat(_t()))]),ln.on("optionChange",function(Cn,zn,vn){var Zn=ln.c;Cn==="theme"&&(ln.$container.rmClass(Zn("theme-".concat(vn))).addClass(Zn("theme-".concat(zn))),Jt()(ln.subComponents,function(Ln){return Ln.setOption("theme",zn)}))}),ln.setOption("theme",Pn),ln}return(0,j.Z)(bn,[{key:"destroy",value:function(){this.destroySubComponents();var hn=this.c;this.$container.rmClass("luna-".concat(this.compName)).rmClass(hn("platform-".concat(_t()))).rmClass(hn("theme-".concat(this.options.theme))),this.$container.html(""),this.emit("destroy"),this.removeAllListeners()}},{key:"setOption",value:function(hn,_n){var ln=this,Mn=this.options,Nn={};typeof hn=="string"?Nn[hn]=_n:Nn=hn,Jt()(Nn,function(Pn,Cn){var zn=Mn[Cn];Mn[Cn]=Pn,ln.emit("optionChange",Cn,Pn,zn)})}},{key:"getOption",value:function(hn){return this.options[hn]}},{key:"addSubComponent",value:function(hn){hn.setOption("theme",this.options.theme),this.subComponents.push(hn)}},{key:"removeSubComponent",value:function(hn){En()(this.subComponents,function(_n){return _n===hn})}},{key:"destroySubComponents",value:function(){Jt()(this.subComponents,function(hn){return hn.destroy()}),this.subComponents=[]}},{key:"initOptions",value:function(hn){var _n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};dn()(hn,_n),Gt()(this.options,hn)}},{key:"find",value:function(hn){return this.$container.find(this.c(hn))}}]),bn}(Mt());function Hn(fn){var Sn=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var bn,hn=(0,tt.Z)(fn);if(Sn){var _n=(0,tt.Z)(this).constructor;bn=Reflect.construct(hn,arguments,_n)}else bn=hn.apply(this,arguments);return(0,et.Z)(this,bn)}}b=d.hmd(b);var rn=function(fn){(0,$.Z)(bn,fn);var Sn=Hn(bn);function bn(hn){var _n,ln=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(0,k.Z)(this,bn),(_n=Sn.call(this,hn,{compName:"box-model"})).initOptions(ln),_n.options.element&&_n.render(),_n.bindEvent(),_n}return(0,j.Z)(bn,[{key:"bindEvent",value:function(){var hn=this;this.on("optionChange",function(_n){_n==="element"&&hn.render()})}},{key:"render",value:function(){var hn=this.c,_n=this.getBoxModelData();this.$container.html(['
'),_n.position?'
'):"",_n.position?'
position
').concat(_n.position.top,'

').concat(_n.position.left,"
"):"",'
'),'
margin
').concat(_n.margin.top,'

').concat(_n.margin.left,"
"),'
'),'
border
').concat(_n.border.top,'

').concat(_n.border.left,"
"),'
'),'
padding
').concat(_n.padding.top,'

').concat(_n.padding.left,"
"),'
'),"".concat(_n.content.width," × ").concat(_n.content.height,""),"
",'
').concat(_n.padding.right,'

').concat(_n.padding.bottom,"
"),"
",'
').concat(_n.border.right,'

').concat(_n.border.bottom,"
"),"
",'
').concat(_n.margin.right,'

').concat(_n.margin.bottom,"
"),"
",_n.position?'
').concat(_n.position.right,'

').concat(_n.position.bottom,"
"):"",_n.position?"
":"","
"].join(""))}},{key:"getBoxModelData",value:function(){var hn=this.options.element,_n=window.getComputedStyle(hn);function ln(Nn){var Pn=["top","left","right","bottom"];return Nn!=="position"&&(Pn=nt()(Pn,function(Cn){return"".concat(Nn,"-").concat(Cn)})),Nn==="border"&&(Pn=nt()(Pn,function(Cn){return"".concat(Cn,"-width")})),{top:wn(_n[Pn[0]],Nn),left:wn(_n[Pn[1]],Nn),right:wn(_n[Pn[2]],Nn),bottom:wn(_n[Pn[3]],Nn)}}var Mn={margin:ln("margin"),border:ln("border"),padding:ln("padding"),content:{width:wn(_n.width),height:wn(_n.height)}};return _n.position!=="static"&&(Mn.position=ln("position")),Mn}}]),bn}(Rn);function wn(fn,Sn){if(at()(fn))return fn;if(!dt()(fn))return"‒";var bn,hn=(bn=fn,vt()(bn.replace("px","")));return isNaN(hn)?fn:Sn==="position"?hn:hn===0?"‒":hn}(function(fn,Sn){try{fn.exports=Sn,fn.exports.default=Sn}catch{}})(b,rn)},8816:function(b,_,d){d.d(_,{Z:function(){return ts}});var k=d(168),j=d(181);function $(Er,zr){return function(Sr){if(Array.isArray(Sr))return Sr}(Er)||function(Sr,Ut){var Zt=Sr==null?null:typeof Symbol<"u"&&Sr[Symbol.iterator]||Sr["@@iterator"];if(Zt!=null){var mn,$n,br,fr,_r=[],Cr=!0,Rr=!1;try{if(br=(Zt=Zt.call(Sr)).next,Ut===0){if(Object(Zt)!==Zt)return;Cr=!1}else for(;!(Cr=(mn=br.call(Zt)).done)&&(_r.push(mn.value),_r.length!==Ut);Cr=!0);}catch(Yr){Rr=!0,$n=Yr}finally{try{if(!Cr&&Zt.return!=null&&(fr=Zt.return(),Object(fr)!==fr))return}finally{if(Rr)throw $n}}return _r}}(Er,zr)||(0,j.Z)(Er,zr)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var yn=$(46),Rn=new($(47)).Dispatcher,Hn=new(function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){var $t;nt(this,jt);for(var It=arguments.length,an=new Array(It),nn=0;nnIt&&(Yt.style.cursor="pointer",this.state.collapsed&&(nn=st.a.createElement("span",null,nn.substring(0,It),st.a.createElement("span",Rt(an,"ellipsis")," ...")))),st.a.createElement("div",Rt(an,"string"),st.a.createElement(Wt,Object.assign({type_name:"string"},$t)),st.a.createElement("span",Object.assign({className:"string-value"},Yt,{onClick:this.toggleCollapsed}),'"',nn,'"'))}}]),jt}(st.a.PureComponent),ln=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){return st.a.createElement("div",Rt(this.props.theme,"undefined"),"undefined")}}]),jt}(st.a.PureComponent);function Mn(){return(Mn=Object.assign||function(Et){for(var Lt=1;Lt=0||(Bn[hr]=Jn[hr]);return Bn}(Et,["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"]),Wn,Gn=gn.value!==void 0,Kn=Object(pt.useRef)(null),er=zn(Kn,Lt),Un=Object(pt.useRef)(0),Qn=Object(pt.useRef)(),ir=function(){var Jn=Kn.current,vr=jt&&Qn.current?Qn.current:function(lr){var rr=window.getComputedStyle(lr);if(rr===null)return null;var nr,ar=(nr=rr,An.reduce(function(Mr,Or){return Mr[Or]=nr[Or],Mr},{})),Ar=ar.boxSizing;return Ar===""?null:(Ht&&Ar==="border-box"&&(ar.width=parseFloat(ar.width)+parseFloat(ar.borderRightWidth)+parseFloat(ar.borderLeftWidth)+parseFloat(ar.paddingRight)+parseFloat(ar.paddingLeft)+"px"),{sizingStyle:ar,paddingSize:parseFloat(ar.paddingBottom)+parseFloat(ar.paddingTop),borderSize:parseFloat(ar.borderBottomWidth)+parseFloat(ar.borderTopWidth)})}(Jn);if(vr){Qn.current=vr;var hr=function(lr,rr,nr,ar){nr===void 0&&(nr=1),ar===void 0&&(ar=1/0),Ln||((Ln=document.createElement("textarea")).setAttribute("tab-index","-1"),Ln.setAttribute("aria-hidden","true"),Zn(Ln)),Ln.parentNode===null&&document.body.appendChild(Ln);var Ar=lr.paddingSize,Mr=lr.borderSize,Or=lr.sizingStyle,jr=Or.boxSizing;Object.keys(Or).forEach(function(Nr){var $r=Nr;Ln.style[$r]=Or[$r]}),Zn(Ln),Ln.value=rr;var sn=function(Nr,$r){var Ur=Nr.scrollHeight;return $r.sizingStyle.boxSizing==="border-box"?Ur+$r.borderSize:Ur-$r.paddingSize}(Ln,lr);Ln.value="x";var Lr=Ln.scrollHeight-Ar,Dr=Lr*nr;jr==="border-box"&&(Dr=Dr+Ar+Mr),sn=Math.max(Dr,sn);var Fr=Lr*ar;return jr==="border-box"&&(Fr=Fr+Ar+Mr),[sn=Math.min(Fr,sn),Lr]}(vr,Jn.value||Jn.placeholder||"x",It,$t),jn=hr[0],Bn=hr[1];Un.current!==jn&&(Un.current=jn,Jn.style.setProperty("height",jn+"px","important"),zt(jn,{rowHeight:Bn}))}};return Object(pt.useLayoutEffect)(ir),Wn=Pn(ir),Object(pt.useLayoutEffect)(function(){var Jn=function(vr){Wn.current(vr)};return window.addEventListener("resize",Jn),function(){window.removeEventListener("resize",Jn)}},[]),Object(pt.createElement)("textarea",Mn({},gn,{onChange:function(Jn){Gn||ir(),nn(Jn)},ref:er}))},pn=Object(pt.forwardRef)(Xt);function Tn(Et){Et=Et.trim();try{if((Et=JSON.stringify(JSON.parse(Et)))[0]==="[")return cr("array",JSON.parse(Et));if(Et[0]==="{")return cr("object",JSON.parse(Et));if(Et.match(/\-?\d+\.\d+/)&&Et.match(/\-?\d+\.\d+/)[0]===Et)return cr("float",parseFloat(Et));if(Et.match(/\-?\d+e-\d+/)&&Et.match(/\-?\d+e-\d+/)[0]===Et)return cr("float",Number(Et));if(Et.match(/\-?\d+/)&&Et.match(/\-?\d+/)[0]===Et)return cr("integer",parseInt(Et));if(Et.match(/\-?\d+e\+\d+/)&&Et.match(/\-?\d+e\+\d+/)[0]===Et)return cr("integer",Number(Et))}catch{}switch(Et=Et.toLowerCase()){case"undefined":return cr("undefined",void 0);case"nan":return cr("nan",NaN);case"null":return cr("null",null);case"true":return cr("boolean",!0);case"false":return cr("boolean",!1);default:if(Et=Date.parse(Et))return cr("date",new Date(Et))}return cr(!1,null)}function cr(Et,Lt){return{type:Et,value:Lt}}var yr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",Object.assign({},ur(It),{viewBox:"0 0 24 24",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),st.a.createElement("path",{d:"M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M7,13H17V11H7"})))}}]),jt}(st.a.PureComponent),tr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",Object.assign({},ur(It),{viewBox:"0 0 24 24",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),st.a.createElement("path",{d:"M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,7H11V11H7V13H11V17H13V13H17V11H13V7Z"})))}}]),jt}(st.a.PureComponent),Xn=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]),nn=ur(It).style;return st.a.createElement("span",an,st.a.createElement("svg",{fill:nn.color,width:nn.height,height:nn.width,style:nn,viewBox:"0 0 1792 1792"},st.a.createElement("path",{d:"M1344 800v64q0 14-9 23t-23 9h-832q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h832q14 0 23 9t9 23zm128 448v-832q0-66-47-113t-113-47h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113zm128-832v832q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z"})))}}]),jt}(st.a.PureComponent),gr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]),nn=ur(It).style;return st.a.createElement("span",an,st.a.createElement("svg",{fill:nn.color,width:nn.height,height:nn.width,style:nn,viewBox:"0 0 1792 1792"},st.a.createElement("path",{d:"M1344 800v64q0 14-9 23t-23 9h-352v352q0 14-9 23t-23 9h-64q-14 0-23-9t-9-23v-352h-352q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h352v-352q0-14 9-23t23-9h64q14 0 23 9t9 23v352h352q14 0 23 9t9 23zm128 448v-832q0-66-47-113t-113-47h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113zm128-832v832q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z"})))}}]),jt}(st.a.PureComponent),In=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",{style:rt(rt({},ur(It).style),{},{paddingLeft:"2px",verticalAlign:"top"}),viewBox:"0 0 15 15",fill:"currentColor"},st.a.createElement("path",{d:"M0 14l6-6-6-6z"})))}}]),jt}(st.a.PureComponent),dr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",{style:rt(rt({},ur(It).style),{},{paddingLeft:"2px",verticalAlign:"top"}),viewBox:"0 0 15 15",fill:"currentColor"},st.a.createElement("path",{d:"M0 5l6 6 6-6z"})))}}]),jt}(st.a.PureComponent),Vn=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",Object.assign({},ur(It),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),st.a.createElement("g",null,st.a.createElement("path",{d:"m30 35h-25v-22.5h25v7.5h2.5v-12.5c0-1.4-1.1-2.5-2.5-2.5h-7.5c0-2.8-2.2-5-5-5s-5 2.2-5 5h-7.5c-1.4 0-2.5 1.1-2.5 2.5v27.5c0 1.4 1.1 2.5 2.5 2.5h25c1.4 0 2.5-1.1 2.5-2.5v-5h-2.5v5z m-20-27.5h2.5s2.5-1.1 2.5-2.5 1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5 1.3 2.5 2.5 2.5h2.5s2.5 1.1 2.5 2.5h-20c0-1.5 1.1-2.5 2.5-2.5z m-2.5 20h5v-2.5h-5v2.5z m17.5-5v-5l-10 7.5 10 7.5v-5h12.5v-5h-12.5z m-17.5 10h7.5v-2.5h-7.5v2.5z m12.5-17.5h-12.5v2.5h12.5v-2.5z m-7.5 5h-5v2.5h5v-2.5z"}))))}}]),jt}(st.a.PureComponent),pr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",Object.assign({},ur(It),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),st.a.createElement("g",null,st.a.createElement("path",{d:"m28.6 25q0-0.5-0.4-1l-4-4 4-4q0.4-0.5 0.4-1 0-0.6-0.4-1.1l-2-2q-0.4-0.4-1-0.4-0.6 0-1 0.4l-4.1 4.1-4-4.1q-0.4-0.4-1-0.4-0.6 0-1 0.4l-2 2q-0.5 0.5-0.5 1.1 0 0.5 0.5 1l4 4-4 4q-0.5 0.5-0.5 1 0 0.7 0.5 1.1l2 2q0.4 0.4 1 0.4 0.6 0 1-0.4l4-4.1 4.1 4.1q0.4 0.4 1 0.4 0.6 0 1-0.4l2-2q0.4-0.4 0.4-1z m8.7-5q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z"}))))}}]),jt}(st.a.PureComponent),qn=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",Object.assign({},ur(It),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),st.a.createElement("g",null,st.a.createElement("path",{d:"m30.1 21.4v-2.8q0-0.6-0.4-1t-1-0.5h-5.7v-5.7q0-0.6-0.4-1t-1-0.4h-2.9q-0.6 0-1 0.4t-0.4 1v5.7h-5.7q-0.6 0-1 0.5t-0.5 1v2.8q0 0.6 0.5 1t1 0.5h5.7v5.7q0 0.5 0.4 1t1 0.4h2.9q0.6 0 1-0.4t0.4-1v-5.7h5.7q0.6 0 1-0.5t0.4-1z m7.2-1.4q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z"}))))}}]),jt}(st.a.PureComponent),Fn=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",Object.assign({},ur(It),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),st.a.createElement("g",null,st.a.createElement("path",{d:"m31.6 21.6h-10v10h-3.2v-10h-10v-3.2h10v-10h3.2v10h10v3.2z"}))))}}]),jt}(st.a.PureComponent),sr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",Object.assign({},ur(It),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),st.a.createElement("g",null,st.a.createElement("path",{d:"m19.8 26.4l2.6-2.6-3.4-3.4-2.6 2.6v1.3h2.2v2.1h1.2z m9.8-16q-0.3-0.4-0.7 0l-7.8 7.8q-0.4 0.4 0 0.7t0.7 0l7.8-7.8q0.4-0.4 0-0.7z m1.8 13.2v4.3q0 2.6-1.9 4.5t-4.5 1.9h-18.6q-2.6 0-4.5-1.9t-1.9-4.5v-18.6q0-2.7 1.9-4.6t4.5-1.8h18.6q1.4 0 2.6 0.5 0.3 0.2 0.4 0.5 0.1 0.4-0.2 0.7l-1.1 1.1q-0.3 0.3-0.7 0.1-0.5-0.1-1-0.1h-18.6q-1.4 0-2.5 1.1t-1 2.5v18.6q0 1.4 1 2.5t2.5 1h18.6q1.5 0 2.5-1t1.1-2.5v-2.9q0-0.2 0.2-0.4l1.4-1.5q0.3-0.3 0.8-0.1t0.4 0.6z m-2.1-16.5l6.4 6.5-15 15h-6.4v-6.5z m9.9 3l-2.1 2-6.4-6.4 2.1-2q0.6-0.7 1.5-0.7t1.5 0.7l3.4 3.4q0.6 0.6 0.6 1.5t-0.6 1.5z"}))))}}]),jt}(st.a.PureComponent),or=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){return nt(this,jt),Lt.apply(this,arguments)}return at(jt,[{key:"render",value:function(){var $t=this.props,It=$t.style,an=xt($t,["style"]);return st.a.createElement("span",an,st.a.createElement("svg",Object.assign({},ur(It),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),st.a.createElement("g",null,st.a.createElement("path",{d:"m31.7 16.4q0-0.6-0.4-1l-2.1-2.1q-0.4-0.4-1-0.4t-1 0.4l-9.1 9.1-5-5q-0.5-0.4-1-0.4t-1 0.4l-2.1 2q-0.4 0.4-0.4 1 0 0.6 0.4 1l8.1 8.1q0.4 0.4 1 0.4 0.6 0 1-0.4l12.2-12.1q0.4-0.4 0.4-1z m5.6 3.6q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z"}))))}}]),jt}(st.a.PureComponent);function ur(Et){return Et||(Et={}),{style:rt(rt({verticalAlign:"middle"},Et),{},{color:Et.color?Et.color:"#000000",height:"1em",width:"1em"})}}var xr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt($t){var It;return nt(this,jt),(It=Lt.call(this,$t)).copiedTimer=null,It.handleCopy=function(){var an=document.createElement("textarea"),nn=It.props,Yt=nn.clickCallback,zt=nn.src,gn=nn.namespace;an.innerHTML=JSON.stringify(It.clipboardValue(zt),null," "),document.body.appendChild(an),an.select(),document.execCommand("copy"),document.body.removeChild(an),It.copiedTimer=setTimeout(function(){It.setState({copied:!1})},5500),It.setState({copied:!0},function(){typeof Yt=="function"&&Yt({src:zt,namespace:gn,name:gn[gn.length-1]})})},It.getClippyIcon=function(){var an=It.props.theme;return It.state.copied?st.a.createElement("span",null,st.a.createElement(Vn,Object.assign({className:"copy-icon"},Rt(an,"copy-icon"))),st.a.createElement("span",Rt(an,"copy-icon-copied"),"✔")):st.a.createElement(Vn,Object.assign({className:"copy-icon"},Rt(an,"copy-icon")))},It.clipboardValue=function(an){switch(bt(an)){case"function":case"regexp":return an.toString();default:return an}},It.state={copied:!1},It}return at(jt,[{key:"componentWillUnmount",value:function(){this.copiedTimer&&(clearTimeout(this.copiedTimer),this.copiedTimer=null)}},{key:"render",value:function(){var $t=this.props,It=($t.src,$t.theme),an=$t.hidden,nn=$t.rowHovered,Yt=Rt(It,"copy-to-clipboard").style,zt="inline";return an&&(zt="none"),st.a.createElement("span",{className:"copy-to-clipboard-container",title:"Copy to clipboard",style:{verticalAlign:"top",display:nn?"inline-block":"none"}},st.a.createElement("span",{style:rt(rt({},Yt),{},{display:zt}),onClick:this.handleCopy},this.getClippyIcon()))}}]),jt}(st.a.PureComponent),kr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt($t){var It;return nt(this,jt),(It=Lt.call(this,$t)).getEditIcon=function(){var an=It.props,nn=an.variable,Yt=an.theme;return st.a.createElement("div",{className:"click-to-edit",style:{verticalAlign:"top",display:It.state.hovered?"inline-block":"none"}},st.a.createElement(sr,Object.assign({className:"click-to-edit-icon"},Rt(Yt,"editVarIcon"),{onClick:function(){It.prepopInput(nn)}})))},It.prepopInput=function(an){if(It.props.onEdit!==!1){var nn=function(zt){var gn;switch(bt(zt)){case"undefined":gn="undefined";break;case"nan":gn="NaN";break;case"string":gn=zt;break;case"date":case"function":case"regexp":gn=zt.toString();break;default:try{gn=JSON.stringify(zt,null," ")}catch{gn=""}}return gn}(an.value),Yt=Tn(nn);It.setState({editMode:!0,editValue:nn,parsedInput:{type:Yt.type,value:Yt.value}})}},It.getRemoveIcon=function(){var an=It.props,nn=an.variable,Yt=an.namespace,zt=an.theme,gn=an.rjvId;return st.a.createElement("div",{className:"click-to-remove",style:{verticalAlign:"top",display:It.state.hovered?"inline-block":"none"}},st.a.createElement(pr,Object.assign({className:"click-to-remove-icon"},Rt(zt,"removeVarIcon"),{onClick:function(){Rn.dispatch({name:"VARIABLE_REMOVED",rjvId:gn,data:{name:nn.name,namespace:Yt,existing_value:nn.value,variable_removed:!0}})}})))},It.getValue=function(an,nn){var Yt=!nn&&an.type,zt=ft(It).props;switch(Yt){case!1:return It.getEditInput();case"string":return st.a.createElement(_n,Object.assign({value:an.value},zt));case"integer":return st.a.createElement(bn,Object.assign({value:an.value},zt));case"float":return st.a.createElement(Gt,Object.assign({value:an.value},zt));case"boolean":return st.a.createElement(Jt,Object.assign({value:an.value},zt));case"function":return st.a.createElement(wn,Object.assign({value:an.value},zt));case"null":return st.a.createElement(Sn,zt);case"nan":return st.a.createElement(fn,zt);case"undefined":return st.a.createElement(ln,zt);case"date":return st.a.createElement(Qt,Object.assign({value:an.value},zt));case"regexp":return st.a.createElement(hn,Object.assign({value:an.value},zt));default:return st.a.createElement("div",{className:"object-value"},JSON.stringify(an.value))}},It.getEditInput=function(){var an=It.props.theme,nn=It.state.editValue;return st.a.createElement("div",null,st.a.createElement(pn,Object.assign({type:"text",inputRef:function(Yt){return Yt&&Yt.focus()},value:nn,className:"variable-editor",onChange:function(Yt){var zt=Yt.target.value,gn=Tn(zt);It.setState({editValue:zt,parsedInput:{type:gn.type,value:gn.value}})},onKeyDown:function(Yt){switch(Yt.key){case"Escape":It.setState({editMode:!1,editValue:""});break;case"Enter":(Yt.ctrlKey||Yt.metaKey)&&It.submitEdit(!0)}Yt.stopPropagation()},placeholder:"update this value",minRows:2},Rt(an,"edit-input"))),st.a.createElement("div",Rt(an,"edit-icon-container"),st.a.createElement(pr,Object.assign({className:"edit-cancel"},Rt(an,"cancel-icon"),{onClick:function(){It.setState({editMode:!1,editValue:""})}})),st.a.createElement(or,Object.assign({className:"edit-check string-value"},Rt(an,"check-icon"),{onClick:function(){It.submitEdit()}})),st.a.createElement("div",null,It.showDetected())))},It.submitEdit=function(an){var nn=It.props,Yt=nn.variable,zt=nn.namespace,gn=nn.rjvId,Wn=It.state,Gn=Wn.editValue,Kn=Wn.parsedInput,er=Gn;an&&Kn.type&&(er=Kn.value),It.setState({editMode:!1}),Rn.dispatch({name:"VARIABLE_UPDATED",rjvId:gn,data:{name:Yt.name,namespace:zt,existing_value:Yt.value,new_value:er,variable_removed:!1}})},It.showDetected=function(){var an=It.props,nn=an.theme,Yt=(an.variable,an.namespace,an.rjvId,It.state.parsedInput),zt=(Yt.type,Yt.value,It.getDetectedInput());if(zt)return st.a.createElement("div",null,st.a.createElement("div",Rt(nn,"detected-row"),zt,st.a.createElement(or,{className:"edit-check detected",style:rt({verticalAlign:"top",paddingLeft:"3px"},Rt(nn,"check-icon").style),onClick:function(){It.submitEdit(!0)}})))},It.getDetectedInput=function(){var an=It.state.parsedInput,nn=an.type,Yt=an.value,zt=ft(It).props,gn=zt.theme;if(nn!==!1)switch(nn.toLowerCase()){case"object":return st.a.createElement("span",null,st.a.createElement("span",{style:rt(rt({},Rt(gn,"brace").style),{},{cursor:"default"})},"{"),st.a.createElement("span",{style:rt(rt({},Rt(gn,"ellipsis").style),{},{cursor:"default"})},"..."),st.a.createElement("span",{style:rt(rt({},Rt(gn,"brace").style),{},{cursor:"default"})},"}"));case"array":return st.a.createElement("span",null,st.a.createElement("span",{style:rt(rt({},Rt(gn,"brace").style),{},{cursor:"default"})},"["),st.a.createElement("span",{style:rt(rt({},Rt(gn,"ellipsis").style),{},{cursor:"default"})},"..."),st.a.createElement("span",{style:rt(rt({},Rt(gn,"brace").style),{},{cursor:"default"})},"]"));case"string":return st.a.createElement(_n,Object.assign({value:Yt},zt));case"integer":return st.a.createElement(bn,Object.assign({value:Yt},zt));case"float":return st.a.createElement(Gt,Object.assign({value:Yt},zt));case"boolean":return st.a.createElement(Jt,Object.assign({value:Yt},zt));case"function":return st.a.createElement(wn,Object.assign({value:Yt},zt));case"null":return st.a.createElement(Sn,zt);case"nan":return st.a.createElement(fn,zt);case"undefined":return st.a.createElement(ln,zt);case"date":return st.a.createElement(Qt,Object.assign({value:new Date(Yt)},zt))}},It.state={editMode:!1,editValue:"",hovered:!1,renameKey:!1,parsedInput:{type:!1,value:null}},It}return at(jt,[{key:"render",value:function(){var $t=this,It=this.props,an=It.variable,nn=It.singleIndent,Yt=It.type,zt=It.theme,gn=It.namespace,Wn=It.indentWidth,Gn=It.enableClipboard,Kn=It.onEdit,er=It.onDelete,Un=It.onSelect,Qn=It.displayArrayKey,ir=It.quotesOnKeys,Jn=this.state.editMode;return st.a.createElement("div",Object.assign({},Rt(zt,"objectKeyVal",{paddingLeft:Wn*nn}),{onMouseEnter:function(){return $t.setState(rt(rt({},$t.state),{},{hovered:!0}))},onMouseLeave:function(){return $t.setState(rt(rt({},$t.state),{},{hovered:!1}))},className:"variable-row",key:an.name}),Yt=="array"?Qn?st.a.createElement("span",Object.assign({},Rt(zt,"array-key"),{key:an.name+"_"+gn}),an.name,st.a.createElement("div",Rt(zt,"colon"),":")):null:st.a.createElement("span",null,st.a.createElement("span",Object.assign({},Rt(zt,"object-name"),{className:"object-key",key:an.name+"_"+gn}),!!ir&&st.a.createElement("span",{style:{verticalAlign:"top"}},'"'),st.a.createElement("span",{style:{display:"inline-block"}},an.name),!!ir&&st.a.createElement("span",{style:{verticalAlign:"top"}},'"')),st.a.createElement("span",Rt(zt,"colon"),":")),st.a.createElement("div",Object.assign({className:"variable-value",onClick:Un===!1&&Kn===!1?null:function(vr){var hr=En(gn);(vr.ctrlKey||vr.metaKey)&&Kn!==!1?$t.prepopInput(an):Un!==!1&&(hr.shift(),Un(rt(rt({},an),{},{namespace:hr})))}},Rt(zt,"variableValue",{cursor:Un===!1?"default":"pointer"})),this.getValue(an,Jn)),Gn?st.a.createElement(xr,{rowHovered:this.state.hovered,hidden:Jn,src:an.value,clickCallback:Gn,theme:zt,namespace:[].concat(En(gn),[an.name])}):null,Kn!==!1&&Jn==0?this.getEditIcon():null,er!==!1&&Jn==0?this.getRemoveIcon():null)}}]),jt}(st.a.PureComponent),Tr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){var $t;nt(this,jt);for(var It=arguments.length,an=new Array(It),nn=0;nn0?Gn:null,namespace:Wn.splice(0,Wn.length-1),existing_value:Kn,variable_removed:!1,key_name:null};bt(Kn)==="object"?Rn.dispatch({name:"ADD_VARIABLE_KEY_REQUEST",rjvId:er,data:Qn}):Rn.dispatch({name:"VARIABLE_ADDED",rjvId:er,data:rt(rt({},Qn),{},{new_value:[].concat(En(Kn),[null])})})}})))},$t.getRemoveObject=function(Yt){var zt=$t.props,gn=zt.theme,Wn=(zt.hover,zt.namespace),Gn=zt.name,Kn=zt.src,er=zt.rjvId;if(Wn.length!==1)return st.a.createElement("span",{className:"click-to-remove",style:{display:Yt?"inline-block":"none"}},st.a.createElement(pr,Object.assign({className:"click-to-remove-icon"},Rt(gn,"removeVarIcon"),{onClick:function(){Rn.dispatch({name:"VARIABLE_REMOVED",rjvId:er,data:{name:Gn,namespace:Wn.splice(0,Wn.length-1),existing_value:Kn,variable_removed:!0}})}})))},$t.render=function(){var Yt=$t.props,zt=Yt.theme,gn=Yt.onDelete,Wn=Yt.onAdd,Gn=Yt.enableClipboard,Kn=Yt.src,er=Yt.namespace,Un=Yt.rowHovered;return st.a.createElement("div",Object.assign({},Rt(zt,"object-meta-data"),{className:"object-meta-data",onClick:function(Qn){Qn.stopPropagation()}}),$t.getObjectSize(),Gn?st.a.createElement(xr,{rowHovered:Un,clickCallback:Gn,src:Kn,theme:zt,namespace:er}):null,Wn!==!1?$t.getAddAttribute(Un):null,gn!==!1?$t.getRemoveObject(Un):null)},$t}return jt}(st.a.PureComponent);function Pr(Et){var Lt=Et.parent_type,jt=Et.namespace,$t=Et.quotesOnKeys,It=Et.theme,an=Et.jsvRoot,nn=Et.name,Yt=Et.displayArrayKey,zt=Et.name?Et.name:"";return!an||nn!==!1&&nn!==null?Lt=="array"?Yt?st.a.createElement("span",Object.assign({},Rt(It,"array-key"),{key:jt}),st.a.createElement("span",{className:"array-key"},zt),st.a.createElement("span",Rt(It,"colon"),":")):st.a.createElement("span",null):st.a.createElement("span",Object.assign({},Rt(It,"object-name"),{key:jt}),st.a.createElement("span",{className:"object-key"},$t&&st.a.createElement("span",{style:{verticalAlign:"top"}},'"'),st.a.createElement("span",null,zt),$t&&st.a.createElement("span",{style:{verticalAlign:"top"}},'"')),st.a.createElement("span",Rt(It,"colon"),":")):st.a.createElement("span",null)}function Ir(Et){var Lt=Et.theme;switch(Et.iconStyle){case"triangle":return st.a.createElement(dr,Object.assign({},Rt(Lt,"expanded-icon"),{className:"expanded-icon"}));case"square":return st.a.createElement(Xn,Object.assign({},Rt(Lt,"expanded-icon"),{className:"expanded-icon"}));default:return st.a.createElement(yr,Object.assign({},Rt(Lt,"expanded-icon"),{className:"expanded-icon"}))}}function Wr(Et){var Lt=Et.theme;switch(Et.iconStyle){case"triangle":return st.a.createElement(In,Object.assign({},Rt(Lt,"collapsed-icon"),{className:"collapsed-icon"}));case"square":return st.a.createElement(gr,Object.assign({},Rt(Lt,"collapsed-icon"),{className:"collapsed-icon"}));default:return st.a.createElement(tr,Object.assign({},Rt(Lt,"collapsed-icon"),{className:"collapsed-icon"}))}}var Qr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt($t){var It;return nt(this,jt),(It=Lt.call(this,$t)).toggleCollapsed=function(an){var nn=[];for(var Yt in It.state.expanded)nn.push(It.state.expanded[Yt]);nn[an]=!nn[an],It.setState({expanded:nn})},It.state={expanded:[]},It}return at(jt,[{key:"getExpandedIcon",value:function($t){var It=this.props,an=It.theme,nn=It.iconStyle;return this.state.expanded[$t]?st.a.createElement(Ir,{theme:an,iconStyle:nn}):st.a.createElement(Wr,{theme:an,iconStyle:nn})}},{key:"render",value:function(){var $t=this,It=this.props,an=It.src,nn=It.groupArraysAfterLength,Yt=(It.depth,It.name),zt=It.theme,gn=It.jsvRoot,Wn=It.namespace,Gn=(It.parent_type,xt(It,["src","groupArraysAfterLength","depth","name","theme","jsvRoot","namespace","parent_type"])),Kn=0,er=5*this.props.indentWidth;gn||(Kn=5*this.props.indentWidth);var Un=nn,Qn=Math.ceil(an.length/Un);return st.a.createElement("div",Object.assign({className:"object-key-val"},Rt(zt,gn?"jsv-root":"objectKeyVal",{paddingLeft:Kn})),st.a.createElement(Pr,this.props),st.a.createElement("span",null,st.a.createElement(Tr,Object.assign({size:an.length},this.props))),En(Array(Qn)).map(function(ir,Jn){return st.a.createElement("div",Object.assign({key:Jn,className:"object-key-val array-group"},Rt(zt,"objectKeyVal",{marginLeft:6,paddingLeft:er})),st.a.createElement("span",Rt(zt,"brace-row"),st.a.createElement("div",Object.assign({className:"icon-container"},Rt(zt,"icon-container"),{onClick:function(vr){$t.toggleCollapsed(Jn)}}),$t.getExpandedIcon(Jn)),$t.state.expanded[Jn]?st.a.createElement(kt,Object.assign({key:Yt+Jn,depth:0,name:!1,collapsed:!1,groupArraysAfterLength:Un,index_offset:Jn*Un,src:an.slice(Jn*Un,Jn*Un+Un),namespace:Wn,type:"array",parent_type:"array_group",theme:zt},Gn)):st.a.createElement("span",Object.assign({},Rt(zt,"brace"),{onClick:function(vr){$t.toggleCollapsed(Jn)},className:"array-group-brace"}),"[",st.a.createElement("div",Object.assign({},Rt(zt,"array-group-meta-data"),{className:"array-group-meta-data"}),st.a.createElement("span",Object.assign({className:"object-size"},Rt(zt,"object-size")),Jn*Un," - ",Jn*Un+Un>an.length?an.length:Jn*Un+Un)),"]")))}))}}]),jt}(st.a.PureComponent),Zr=function(Et){dt(jt,Et);var Lt=ut(jt);function jt($t){var It;nt(this,jt),(It=Lt.call(this,$t)).toggleCollapsed=function(){It.setState({expanded:!It.state.expanded},function(){rn.set(It.props.rjvId,It.props.namespace,"expanded",It.state.expanded)})},It.getObjectContent=function(nn,Yt,zt){return st.a.createElement("div",{className:"pushed-content object-container"},st.a.createElement("div",Object.assign({className:"object-content"},Rt(It.props.theme,"pushed-content")),It.renderObjectContents(Yt,zt)))},It.getEllipsis=function(){return It.state.size===0?null:st.a.createElement("div",Object.assign({},Rt(It.props.theme,"ellipsis"),{className:"node-ellipsis",onClick:It.toggleCollapsed}),"...")},It.getObjectMetaData=function(nn){var Yt=It.props,zt=(Yt.rjvId,Yt.theme,It.state),gn=zt.size,Wn=zt.hovered;return st.a.createElement(Tr,Object.assign({rowHovered:Wn,size:gn},It.props))},It.renderObjectContents=function(nn,Yt){var zt,gn=It.props,Wn=gn.depth,Gn=gn.parent_type,Kn=gn.index_offset,er=gn.groupArraysAfterLength,Un=gn.namespace,Qn=It.state.object_type,ir=[],Jn=Object.keys(nn||{});return It.props.sortKeys&&Qn!=="array"&&(Jn=Jn.sort()),Jn.forEach(function(vr){if(zt=new mo(vr,nn[vr]),Gn==="array_group"&&Kn&&(zt.name=parseInt(zt.name)+Kn),nn.hasOwnProperty(vr))if(zt.type==="object")ir.push(st.a.createElement(kt,Object.assign({key:zt.name,depth:Wn+1,name:zt.name,src:zt.value,namespace:Un.concat(zt.name),parent_type:Qn},Yt)));else if(zt.type==="array"){var hr=kt;er&&zt.value.length>er&&(hr=Qr),ir.push(st.a.createElement(hr,Object.assign({key:zt.name,depth:Wn+1,name:zt.name,src:zt.value,namespace:Un.concat(zt.name),type:"array",parent_type:Qn},Yt)))}else ir.push(st.a.createElement(kr,Object.assign({key:zt.name+"_"+Un,variable:zt,singleIndent:5,namespace:Un,type:It.props.type},Yt)))}),ir};var an=jt.getState($t);return It.state=rt(rt({},an),{},{prevProps:{}}),It}return at(jt,[{key:"getBraceStart",value:function($t,It){var an=this,nn=this.props,Yt=nn.src,zt=nn.theme,gn=nn.iconStyle;if(nn.parent_type==="array_group")return st.a.createElement("span",null,st.a.createElement("span",Rt(zt,"brace"),$t==="array"?"[":"{"),It?this.getObjectMetaData(Yt):null);var Wn=It?Ir:Wr;return st.a.createElement("span",null,st.a.createElement("span",Object.assign({onClick:function(Gn){an.toggleCollapsed()}},Rt(zt,"brace-row")),st.a.createElement("div",Object.assign({className:"icon-container"},Rt(zt,"icon-container")),st.a.createElement(Wn,{theme:zt,iconStyle:gn})),st.a.createElement(Pr,this.props),st.a.createElement("span",Rt(zt,"brace"),$t==="array"?"[":"{")),It?this.getObjectMetaData(Yt):null)}},{key:"render",value:function(){var $t=this,It=this.props,an=It.depth,nn=It.src,Yt=(It.namespace,It.name,It.type,It.parent_type),zt=It.theme,gn=It.jsvRoot,Wn=It.iconStyle,Gn=xt(It,["depth","src","namespace","name","type","parent_type","theme","jsvRoot","iconStyle"]),Kn=this.state,er=Kn.object_type,Un=Kn.expanded,Qn={};return gn||Yt==="array_group"?Yt==="array_group"&&(Qn.borderLeft=0,Qn.display="inline"):Qn.paddingLeft=5*this.props.indentWidth,st.a.createElement("div",Object.assign({className:"object-key-val",onMouseEnter:function(){return $t.setState(rt(rt({},$t.state),{},{hovered:!0}))},onMouseLeave:function(){return $t.setState(rt(rt({},$t.state),{},{hovered:!1}))}},Rt(zt,gn?"jsv-root":"objectKeyVal",Qn)),this.getBraceStart(er,Un),Un?this.getObjectContent(an,nn,rt({theme:zt,iconStyle:Wn},Gn)):this.getEllipsis(),st.a.createElement("span",{className:"brace-row"},st.a.createElement("span",{style:rt(rt({},Rt(zt,"brace").style),{},{paddingLeft:Un?"3px":"0px"})},er==="array"?"]":"}"),Un?null:this.getObjectMetaData(nn)))}}],[{key:"getDerivedStateFromProps",value:function($t,It){var an=It.prevProps;return $t.src!==an.src||$t.collapsed!==an.collapsed||$t.name!==an.name||$t.namespace!==an.namespace||$t.rjvId!==an.rjvId?rt(rt({},jt.getState($t)),{},{prevProps:$t}):null}}]),jt}(st.a.PureComponent);Zr.getState=function(Et){var Lt=Object.keys(Et.src).length,jt=(Et.collapsed===!1||Et.collapsed!==!0&&Et.collapsed>Et.depth)&&(!Et.shouldCollapse||Et.shouldCollapse({name:Et.name,src:Et.src,type:bt(Et.src),namespace:Et.namespace})===!1)&&Lt!==0;return{expanded:rn.get(Et.rjvId,Et.namespace,"expanded",jt),object_type:Et.type==="array"?"array":"object",parent_type:Et.type==="array"?"array":"object",size:Lt,hovered:!1}};var mo=function Et(Lt,jt){nt(this,Et),this.name=Lt,this.value=jt,this.type=bt(jt)};St(Zr);var kt=Zr,Bt=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){var $t;nt(this,jt);for(var It=arguments.length,an=new Array(It),nn=0;nnYt.groupArraysAfterLength&&(gn=Qr),st.a.createElement("div",{className:"pretty-json-container object-container"},st.a.createElement("div",{className:"object-content"},st.a.createElement(gn,Object.assign({namespace:zt,depth:0,jsvRoot:!0},Yt))))},$t}return jt}(st.a.PureComponent),Pt=function(Et){dt(jt,Et);var Lt=ut(jt);function jt($t){var It;return nt(this,jt),(It=Lt.call(this,$t)).closeModal=function(){Rn.dispatch({rjvId:It.props.rjvId,name:"RESET"})},It.submit=function(){It.props.submit(It.state.input)},It.state={input:$t.input?$t.input:""},It}return at(jt,[{key:"render",value:function(){var $t=this,It=this.props,an=It.theme,nn=It.rjvId,Yt=It.isValid,zt=this.state.input,gn=Yt(zt);return st.a.createElement("div",Object.assign({className:"key-modal-request"},Rt(an,"key-modal-request"),{onClick:this.closeModal}),st.a.createElement("div",Object.assign({},Rt(an,"key-modal"),{onClick:function(Wn){Wn.stopPropagation()}}),st.a.createElement("div",Rt(an,"key-modal-label"),"Key Name:"),st.a.createElement("div",{style:{position:"relative"}},st.a.createElement("input",Object.assign({},Rt(an,"key-modal-input"),{className:"key-modal-input",ref:function(Wn){return Wn&&Wn.focus()},spellCheck:!1,value:zt,placeholder:"...",onChange:function(Wn){$t.setState({input:Wn.target.value})},onKeyPress:function(Wn){gn&&Wn.key==="Enter"?$t.submit():Wn.key==="Escape"&&$t.closeModal()}})),gn?st.a.createElement(or,Object.assign({},Rt(an,"key-modal-submit"),{className:"key-modal-submit",onClick:function(Wn){return $t.submit()}})):null),st.a.createElement("span",Rt(an,"key-modal-cancel"),st.a.createElement(Fn,Object.assign({},Rt(an,"key-modal-cancel-icon"),{className:"key-modal-cancel",onClick:function(){Rn.dispatch({rjvId:nn,name:"RESET"})}})))))}}]),jt}(st.a.PureComponent),gt=function(Et){dt(jt,Et);var Lt=ut(jt);function jt(){var $t;nt(this,jt);for(var It=arguments.length,an=new Array(It),nn=0;nn_($.updated_src),[]);return jsxs("div",{className:"send-tx-form",children:[jsx$1("h3",{children:"Configure and send transaction"}),jsx$1(ReactJson,{src:defaultTx,theme:"ocean",onEdit:j,onAdd:j,onDelete:j}),d?jsx$1("button",{onClick:()=>k.sendTransaction(b),children:"Send transaction"}):jsx$1("button",{onClick:()=>k.openModal(),children:"Connect wallet to send the transaction"})]})}function App(){return jsx$1(TonConnectUIProvider$1,{manifestUrl:"https://ton-connect.github.io/demo-dapp-with-wallet/tonconnect-manifest.json",uiPreferences:{theme:THEME.DARK},walletsListConfiguration:{includeWallets:[{appName:"telegram-wallet",name:"Wallet",imageUrl:"https://wallet.tg/images/logo-288.png",aboutUrl:"https://wallet.tg/",universalLink:"https://t.me/wallet?attach=wallet",bridgeUrl:"https://bridge.ton.space/bridge",platforms:["ios","android","macos","windows","linux"]},{appName:"tonwallet",name:"TON Wallet",imageUrl:"https://wallet.ton.org/assets/ui/qr-logo.png",aboutUrl:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",universalLink:"https://wallet.ton.org/ton-connect",jsBridgeKey:"tonwallet",bridgeUrl:"https://bridge.tonapi.io/bridge",platforms:["chrome","android"]},{appName:"nicegramWallet",name:"Nicegram Wallet",imageUrl:"https://static.nicegram.app/icon.png",aboutUrl:"https://nicegram.app",universalLink:"https://nicegram.app/tc",deepLink:"nicegram-tc://",jsBridgeKey:"nicegramWallet",bridgeUrl:"https://tc.nicegram.app/bridge",platforms:["ios","android","macos","windows","linux"]},{appName:"tokenpocket",name:"TokenPocket",imageUrl:"https://hk.tpstatic.net/logo/tokenpocket.png",aboutUrl:"https://www.tokenpocket.pro",universalLink:"https://tp-lab.tptool.pro/ton-connect/",jsBridgeKey:"tokenpocket",bridgeUrl:"https://ton-connect.mytokenpocket.vip/bridge",platforms:["ios","android","macos","windows","linux"]},{appName:"dewallet",name:"DeWallet",imageUrl:"https://raw.githubusercontent.com/delab-team/manifests-images/main/WalletAvatar.png",aboutUrl:"https://delabwallet.com",universalLink:"https://t.me/dewallet?attach=wallet",bridgeUrl:"https://bridge.dewallet.pro/bridge",platforms:["ios","android","macos","windows","linux"]},{appName:"cdcTonWallet",name:"Crypto.com DeFi Wallet",imageUrl:"https://apro-ncw-api-file.crypto.com/wallet/logo",aboutUrl:"https://crypto.com/defi-wallet",universalLink:"https://wallet.crypto.com/deeplink/ton-connect",deepLink:"dfw://",jsBridgeKey:"cdcTonWallet",bridgeUrl:"https://wallet.crypto.com/sse/tonbridge",platforms:["ios","android","chrome"]},{appName:"tobi",name:"Tobi",imageUrl:"https://app.tobiwallet.app/icons/logo.png",aboutUrl:"https://tobi.fun",universalLink:"https://t.me/TobiCopilotBot?attach=wallet",bridgeUrl:"https://ton-bridge.tobiwallet.app/bridge",platforms:["ios","android","macos","windows","linux"]},{appName:"trustwalletTon",name:"Trust",imageUrl:"https://assets-cdn.trustwallet.com/dapps/trust.logo.png",aboutUrl:"https://trustwallet.com/about-us",bridgeUrl:"https://tonconnect.trustwallet.com/bridge",jsBridgeKey:"trustwalletTon",platforms:["chrome","ios","android"]},{appName:"bitgetWalletLite",name:"Bitget Wallet Lite",imageUrl:"https://raw.githubusercontent.com/bitgetwallet/download/main/logo/png/bitget_wallet_lite_logo.png",aboutUrl:"https://web3.bitget.com",universalLink:"https://t.me/BitgetWallet_TGBot?attach=wallet",bridgeUrl:"https://ton-connect-bridge.bgwapi.io/bridge",platforms:["ios","android","macos","windows","linux"]},{appName:"onekey",name:"OneKey",imageUrl:"https://common.onekey-asset.com/logo/onekey-x288.png",aboutUrl:"https://onekey.so",jsBridgeKey:"onekeyTonWallet",platforms:["chrome"]},{appName:"tomoWallet",name:"Tomo Wallet",imageUrl:"https://pub.tomo.inc/logo.png",aboutUrl:"https://www.tomo.inc/",universalLink:"https://t.me/tomowalletbot?attach=wallet",bridgeUrl:"https://go-bridge.tomo.inc/bridge",platforms:["ios","android","macos","windows","linux"]},{appName:"hpyTonWallet",name:"HyperPay Wallet",imageUrl:"https://onchain-oss.hyperpay.online/images/logo.png",aboutUrl:"https://www.hyperpay.tech",universalLink:"https://www.hyperpay.tech/download&deeplink=hyperpay://web3/wallet/tonconnect",jsBridgeKey:"hpyTonWallet",bridgeUrl:"https://onchain-wallet.hyperpay.online/bridge",platforms:["ios","android","macos","windows","linux"]},{appName:"unstoppable",name:"Unstoppable Wallet",imageUrl:"https://unstoppable.money/logo288.png",aboutUrl:"https://unstoppable.money/",universalLink:"https://unstoppable.money/ton-connect",bridgeUrl:"https://bridge.unstoppable.money/bridge",platforms:["ios","android","macos","windows","linux"]},{appName:"foxwallet",name:"FoxWallet",imageUrl:"https://hc.foxwallet.com/img/logo.png",aboutUrl:"https://foxwallet.com/",universalLink:"https://link.foxwallet.com/tc",jsBridgeKey:"foxwallet",bridgeUrl:"https://connect.foxwallet.com/ton/bridge",platforms:["ios","android"]},{appName:"jambo",name:"Jambo",imageUrl:"https://cdn-prod.jambotechnology.xyz/content/jambo_288x288_02da416a6c.png",aboutUrl:"https://www.jambo.technology/",deepLink:"jambotc://",universalLink:"https://jambophone.xyz/",bridgeUrl:"https://bridge.tonapi.io/bridge",jsBridgeKey:"jambowallet",platforms:["android","macos","windows","linux"]}]},actionsConfiguration:{twaReturnUrl:"https://t.me/tc_twa_demo_bot/start"},children:jsxs("div",{className:"app",children:[jsx$1(Header,{}),jsx$1(TxForm,{}),jsx$1(Footer,{})]})})}const index="";var eruda$1={exports:{}};/*! eruda v2.11.3 https://eruda.liriliri.io/ */(function(module,exports){(function(b,_){module.exports=_()})(self,function(){return function(){var __webpack_modules__={422:function(b,_,d){d.d(_,{Z:function(){return rn}});var k=d(5671),j=d(3144),$=d(9340),et=d(2963),tt=d(1120),rt=d(2461),nt=d.n(rt),ot=d(3990),at=d.n(ot),it=d(6768),dt=d.n(it),ct=d(4331),ht=d.n(ct),ft=d(5610),lt=d.n(ft),ut=d(7483),pt=d.n(ut),st=d(6341),wt=d.n(st),yt=d(3875),vt=d.n(yt),St=d(6954),xt=d.n(St);d(9585);function bt(fn){var Sn="luna-".concat(fn,"-");function bn(hn){return nt()(ht()(hn).split(/\s+/),function(_n){return wt()(_n,Sn)?_n:_n.replace(/[\w-]+/,function(ln){return"".concat(Sn).concat(ln)})}).join(" ")}return function(hn){if(/<[^>]*>/g.test(hn))try{var _n=pt().parse(hn);return At(_n,function(ln){ln.attrs&&ln.attrs.class&&(ln.attrs.class=bn(ln.attrs.class))}),pt().stringify(_n)}catch{return bn(hn)}return bn(hn)}}function At(fn,Sn){for(var bn=0,hn=fn.length;bn"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var bn,hn=(0,tt.Z)(fn);if(Sn){var _n=(0,tt.Z)(this).constructor;bn=Reflect.construct(hn,arguments,_n)}else bn=hn.apply(this,arguments);return(0,et.Z)(this,bn)}}var Rn=function(fn){(0,$.Z)(bn,fn);var Sn=yn(bn);function bn(hn,_n){var ln,Mn=_n.compName,Nn=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}).theme,Pn=Nn===void 0?"light":Nn;return(0,k.Z)(this,bn),(ln=Sn.call(this)).subComponents=[],ln.compName=Mn,ln.c=bt(Mn),ln.options={},ln.container=hn,ln.$container=Rt()(hn),ln.$container.addClass(["luna-".concat(Mn),ln.c("platform-".concat(_t()))]),ln.on("optionChange",function(Cn,zn,vn){var Zn=ln.c;Cn==="theme"&&(ln.$container.rmClass(Zn("theme-".concat(vn))).addClass(Zn("theme-".concat(zn))),Jt()(ln.subComponents,function(Ln){return Ln.setOption("theme",zn)}))}),ln.setOption("theme",Pn),ln}return(0,j.Z)(bn,[{key:"destroy",value:function(){this.destroySubComponents();var hn=this.c;this.$container.rmClass("luna-".concat(this.compName)).rmClass(hn("platform-".concat(_t()))).rmClass(hn("theme-".concat(this.options.theme))),this.$container.html(""),this.emit("destroy"),this.removeAllListeners()}},{key:"setOption",value:function(hn,_n){var ln=this,Mn=this.options,Nn={};typeof hn=="string"?Nn[hn]=_n:Nn=hn,Jt()(Nn,function(Pn,Cn){var zn=Mn[Cn];Mn[Cn]=Pn,ln.emit("optionChange",Cn,Pn,zn)})}},{key:"getOption",value:function(hn){return this.options[hn]}},{key:"addSubComponent",value:function(hn){hn.setOption("theme",this.options.theme),this.subComponents.push(hn)}},{key:"removeSubComponent",value:function(hn){En()(this.subComponents,function(_n){return _n===hn})}},{key:"destroySubComponents",value:function(){Jt()(this.subComponents,function(hn){return hn.destroy()}),this.subComponents=[]}},{key:"initOptions",value:function(hn){var _n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};dn()(hn,_n),Gt()(this.options,hn)}},{key:"find",value:function(hn){return this.$container.find(this.c(hn))}}]),bn}(Mt());function Hn(fn){var Sn=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var bn,hn=(0,tt.Z)(fn);if(Sn){var _n=(0,tt.Z)(this).constructor;bn=Reflect.construct(hn,arguments,_n)}else bn=hn.apply(this,arguments);return(0,et.Z)(this,bn)}}b=d.hmd(b);var rn=function(fn){(0,$.Z)(bn,fn);var Sn=Hn(bn);function bn(hn){var _n,ln=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(0,k.Z)(this,bn),(_n=Sn.call(this,hn,{compName:"box-model"})).initOptions(ln),_n.options.element&&_n.render(),_n.bindEvent(),_n}return(0,j.Z)(bn,[{key:"bindEvent",value:function(){var hn=this;this.on("optionChange",function(_n){_n==="element"&&hn.render()})}},{key:"render",value:function(){var hn=this.c,_n=this.getBoxModelData();this.$container.html(['
'),_n.position?'
'):"",_n.position?'
position
').concat(_n.position.top,'

').concat(_n.position.left,"
"):"",'
'),'
margin
').concat(_n.margin.top,'

').concat(_n.margin.left,"
"),'
'),'
border
').concat(_n.border.top,'

').concat(_n.border.left,"
"),'
'),'
padding
').concat(_n.padding.top,'

').concat(_n.padding.left,"
"),'
'),"".concat(_n.content.width," × ").concat(_n.content.height,""),"
",'
').concat(_n.padding.right,'

').concat(_n.padding.bottom,"
"),"
",'
').concat(_n.border.right,'

').concat(_n.border.bottom,"
"),"
",'
').concat(_n.margin.right,'

').concat(_n.margin.bottom,"
"),"
",_n.position?'
').concat(_n.position.right,'

').concat(_n.position.bottom,"
"):"",_n.position?"
":"","
"].join(""))}},{key:"getBoxModelData",value:function(){var hn=this.options.element,_n=window.getComputedStyle(hn);function ln(Nn){var Pn=["top","left","right","bottom"];return Nn!=="position"&&(Pn=nt()(Pn,function(Cn){return"".concat(Nn,"-").concat(Cn)})),Nn==="border"&&(Pn=nt()(Pn,function(Cn){return"".concat(Cn,"-width")})),{top:wn(_n[Pn[0]],Nn),left:wn(_n[Pn[1]],Nn),right:wn(_n[Pn[2]],Nn),bottom:wn(_n[Pn[3]],Nn)}}var Mn={margin:ln("margin"),border:ln("border"),padding:ln("padding"),content:{width:wn(_n.width),height:wn(_n.height)}};return _n.position!=="static"&&(Mn.position=ln("position")),Mn}}]),bn}(Rn);function wn(fn,Sn){if(at()(fn))return fn;if(!dt()(fn))return"‒";var bn,hn=(bn=fn,vt()(bn.replace("px","")));return isNaN(hn)?fn:Sn==="position"?hn:hn===0?"‒":hn}(function(fn,Sn){try{fn.exports=Sn,fn.exports.default=Sn}catch{}})(b,rn)},8816:function(b,_,d){d.d(_,{Z:function(){return ts}});var k=d(168),j=d(181);function $(Er,zr){return function(Sr){if(Array.isArray(Sr))return Sr}(Er)||function(Sr,Ut){var Zt=Sr==null?null:typeof Symbol<"u"&&Sr[Symbol.iterator]||Sr["@@iterator"];if(Zt!=null){var mn,$n,br,fr,_r=[],Cr=!0,Rr=!1;try{if(br=(Zt=Zt.call(Sr)).next,Ut===0){if(Object(Zt)!==Zt)return;Cr=!1}else for(;!(Cr=(mn=br.call(Zt)).done)&&(_r.push(mn.value),_r.length!==Ut);Cr=!0);}catch(Yr){Rr=!0,$n=Yr}finally{try{if(!Cr&&Zt.return!=null&&(fr=Zt.return(),Object(fr)!==fr))return}finally{if(Rr)throw $n}}return _r}}(Er,zr)||(0,j.Z)(Er,zr)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var et=d(5671),tt=d(3144),rt=d(1752),nt=d(9340),ot=d(2963),at=d(1120),it=d(7326),dt=d(8901),ct=d.n(dt),ht=d(3367),ft=d.n(ht),lt=d(6341),ut=d.n(lt),pt=d(6930),st=d.n(pt),wt=d(4187),yt=d.n(wt),vt=d(3783),St=d.n(vt),xt=d(4858),bt=d.n(xt),At=d(8887),_t=d.n(At),Ct=d(7756),Mt=d.n(Ct),Ot=d(3023),Rt=d.n(Ot);function Wt(Er){return Er.constructor&&Er.constructor.name?Er.constructor.name:Rt()({}.toString.call(Er).replace(/(\[object )|]/g,""))}var Jt=d(2461),Qt=d.n(Jt),Gt=d(4331),Vt=d.n(Gt),dn=d(5610),kn=d.n(dn),En=d(7483),yn=d.n(En),Rn=d(3990),Hn=d.n(Rn),rn=d(3875),wn=d.n(rn),fn=d(6954),Sn=d.n(fn),bn=d(9585),hn=d.n(bn);function _n(Er){var zr="luna-".concat(Er,"-");function Sr(Ut){return Qt()(Vt()(Ut).split(/\s+/),function(Zt){return ut()(Zt,zr)?Zt:Zt.replace(/[\w-]+/,function(mn){return"".concat(zr).concat(mn)})}).join(" ")}return function(Ut){if(/<[^>]*>/g.test(Ut))try{var Zt=yn().parse(Ut);return ln(Zt,function(mn){mn.attrs&&mn.attrs.class&&(mn.attrs.class=Sr(mn.attrs.class))}),yn().stringify(Zt)}catch{return Sr(Ut)}return Sr(Ut)}}function ln(Er,zr){for(var Sr=0,Ut=Er.length;Sr1&&arguments[1]!==void 0?arguments[1]:{},Ut=Sr.topObj,Zt=Sr.level,mn=Zt===void 0?0:Zt,$n=Sr.getterVal,br=$n!==void 0&&$n,fr=Sr.unenumerable,_r=fr===void 0||fr,Cr="",Rr="",Yr=5,Gr=[],oo=[],po="";Ut=Ut||Er;var Hr={getterVal:br,unenumerable:_r,level:mn+1},ao=mn===0,yo=''),bo=''),So=''),Io=''),vo=''),jo=''),Eo=function(Xr){return ct()(Xr).replace(/\\n/g,"↵").replace(/\\f|\\r|\\t/g,"").replace(/\\/g,"")},wo="",Ao=function(Xr){return yo+Eo(Xr)+wo};function Co(Xr){return Xr=ft()(Xr),ut()(Cn,Xr)||st()(Xr,"Array[")?jo+Eo(Xr)+wo:(Xr.length>100&&(Xr=Mt()(Xr,100,{separator:" ",ellipsis:"…"})),Io+Eo('"'.concat(Xr,'"'))+wo)}function Lo(Xr){if(zr>Yr)po=", …";else{var os=Ao(vn(Xr));if(!br){var Bo=Object.getOwnPropertyDescriptor(Er,Xr);if(Bo&&Bo.get)return Gr.push("".concat(os,": ").concat(Co("(...)"))),void zr++}Gr.push("".concat(os,": ").concat(Pn(Ut[Xr],Hr))),zr++}}try{Rr={}.toString.call(Er)}catch{Rr="[object Object]"}var Po,No=Rr=="[object Array]",Fo=Rr=="[object Object]",Ho=Rr=="[object Number]",Oo=Rr=="[object RegExp]",Ro=Rr=="[object Symbol]",Ls=Rr=="[object Function]",Ps=Rr=="[object Boolean]";if(Rr=="[object String]")Cr=Co(vn(Er));else if(Oo)Po=vn(Er.toString()),Cr=Io+Po+wo;else if(Ls)Cr=Co("ƒ");else if(No)if(ao){Cr="[";var Zo=Er.length,rs="";Zo>100&&(Zo=100,rs=", …");for(var Vo=0;Vo"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var Sr,Ut=(0,at.Z)(Er);if(zr){var Zt=(0,at.Z)(this).constructor;Sr=Reflect.construct(Ut,arguments,Zt)}else Sr=Ut.apply(this,arguments);return(0,ot.Z)(this,Sr)}}var qr=/https?:\/\/([0-9.\-A-Za-z]+)(?::(\d+))?\/[A-Z.a-z0-9/]*\.js/g,eo={comment:"",string:"",number:"",keyword:"",operator:""},to=function(Er){(0,nt.Z)(Sr,Er);var zr=ro(Sr);function Sr(Ut,Zt){var mn,$n=Zt.type,br=$n===void 0?"log":$n,fr=Zt.args,_r=fr===void 0?[]:fr,Cr=Zt.id,Rr=Zt.group,Yr=Zt.targetGroup,Gr=Zt.header,oo=Zt.ignoreFilter,po=oo!==void 0&&oo,Hr=Zt.accessGetter,ao=Zt.unenumerable,yo=Zt.lazyEvaluation;(0,et.Z)(this,Sr),(mn=zr.call(this)).container=nn()("div"),mn.count=1,mn.width=0,mn.height=0,mn.isHidden=!1,mn.columns=[],mn.elements={},mn.objects={},mn.console=Ut,mn.type=br,mn.group=Rr,mn.targetGroup=Yr,mn.args=_r,mn.id=Cr,mn.header=Gr,mn.ignoreFilter=po,mn.collapsed=!1,mn.container.log=(0,it.Z)(mn),mn.height=0,mn.width=0,mn.$container=It()(mn.container),mn.accessGetter=Hr,mn.unenumerable=ao,mn.lazyEvaluation=yo;var bo="info";switch(br){case"debug":bo="verbose";break;case"error":bo="error";break;case"warn":bo="warning"}return mn.level=bo,mn.resizeSensor=new(Xt())(mn.container),mn.onResize=Wn()(function(){hn()(mn.container)?mn.isHidden=!0:(mn.isHidden||mn.updateSize(!1),mn.isHidden=!1)},16),mn.formatMsg(),mn.group&&mn.checkGroup(),mn.bindEvent(),mn}return(0,tt.Z)(Sr,[{key:"checkGroup",value:function(){for(var Ut=this.group,Zt=!1;Ut;){if(Ut.collapsed){Zt=!0;break}Ut=Ut.parent}return Zt!==this.collapsed&&(this.collapsed=Zt,!0)}},{key:"updateIcon",value:function(Ut){var Zt=this.console.c;return this.$container.find(Zt(".icon-container")).find(Zt(".icon")).rmAttr("class").addClass([Zt("icon"),Zt("icon-".concat(Ut))]),this}},{key:"addCount",value:function(){this.count++;var Ut=this.$container,Zt=this.count,mn=this.console.c,$n=Ut.find(mn(".count-container")),br=Ut.find(mn(".icon-container")),fr=$n.find(mn(".count"));return Zt===2&&$n.rmClass(mn("hidden")),fr.text(ft()(Zt)),br.addClass(mn("hidden")),this}},{key:"groupEnd",value:function(){var Ut=this.$container,Zt=this.console.c;return Ut.find(".".concat(Zt("nesting-level"),":not(.").concat(Zt("group-closed"),")")).last().addClass(Zt("group-closed")),this}},{key:"updateTime",value:function(Ut){var Zt=this.$container.find(this.console.c(".time-container"));return this.header&&(Zt.find("span").eq(0).text(Ut),this.header.time=Ut),this}},{key:"isAttached",value:function(){return!!this.container.parentNode}},{key:"isSimple",value:function(){return!nr()(this.args,function(Ut){return Tn()(Ut)})}},{key:"updateSize",value:function(){var Ut=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],Zt=this.container.getBoundingClientRect(),mn=Zt.width,$n=Zt.height-1;this.height!==$n&&(this.height=$n,Ut||this.emit("updateHeight")),this.width!==mn&&(this.width=mn)}},{key:"html",value:function(){return this.container.outerHTML}},{key:"text",value:function(){return this.content.textContent||""}},{key:"select",value:function(){this.$container.addClass(this.console.c("selected"))}},{key:"deselect",value:function(){this.$container.rmClass(this.console.c("selected"))}},{key:"copy",value:function(){var Ut=this.args,Zt="";St()(Ut,function(mn,$n){$n!==0&&(Zt+=" "),Tn()(mn)?Zt+=Kn()(mn):Zt+=ft()(mn)}),Un()(Zt)}},{key:"bindEvent",value:function(){var Ut=this,Zt=this.console.c,mn=this;this.resizeSensor.addListener(this.onResize),this.$container.on("click",Zt(".dom-viewer"),function($n){return $n.stopPropagation()}).on("click",Zt(".preview"),function($n){$n.stopPropagation();var br=It()(this).find(Zt(".preview-icon-container")).find(Zt(".icon")),fr="caret-down";br.hasClass(Zt("icon-caret-down"))&&(fr="caret-right"),br.rmAttr("class").addClass([Zt("icon"),Zt("icon-".concat(fr))]),mn.renderObjectViewer(this)}).on("click",function(){return Ut.click()})}},{key:"renderEl",value:function(){var Ut=this.elements,Zt=this.console.c,mn=this;this.$container.find(Zt(".dom-viewer")).each(function(){var $n=It()(this).data("id");new An.Z(this,{node:Ut[$n],theme:mn.console.getOption("theme")})})}},{key:"renderObjectViewer",value:function(Ut){var Zt=this.console,mn=this.unenumerable,$n=this.accessGetter,br=this.lazyEvaluation,fr=Zt.c,_r=It()(Ut),Cr=_r.data("id");if(Cr){var Rr=this.objects[Cr],Yr=_r.find(fr(".json"));if(Yr.hasClass(fr("hidden"))){if(Yr.data("init")!=="true"){if(br){var Gr=new Ln.Z(Yr.get(0),{unenumerable:mn,accessGetter:$n});Gr.setOption("theme",Zt.getOption("theme")),Gr.set(Rr)}else{var oo=new Ln.q(Yr.get(0));oo.setOption("theme",Zt.getOption("theme")),oo.set(Rr)}Yr.data("init","true")}Yr.rmClass(fr("hidden"))}else Yr.addClass(fr("hidden"))}}},{key:"renderTable",value:function(Ut){var Zt=this,mn="__LunaConsoleValue",$n=this.columns,br=this.$container,fr=this.console,_r=fr.c,Cr=br.find(_r(".data-grid")),Rr=Ut[0],Yr=new Dn.Z(Cr.get(0),{columns:ur()([{id:"(index)",title:"(index)",sortable:!0}],Qt()($n,function(Gr){return{id:Gr,title:Gr===mn?"Value":Gr,sortable:!0}})),theme:fr.getOption("theme")});St()(Rr,function(Gr,oo){var po={"(index)":ft()(oo)};$n.forEach(function(Hr){Tn()(Gr)?po[Hr]=Hr===mn?"":Zt.formatTableVal(Gr[Hr]):In()(Gr)&&(po[Hr]=Hr===mn?Zt.formatTableVal(Gr):"")}),Yr.append(po)})}},{key:"extractObj",value:function(Ut){var Zt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},mn=arguments.length>2?arguments[2]:void 0,$n=this.accessGetter,br=this.unenumerable;Vn()(Zt,{accessGetter:$n,unenumerable:br,symbol:br,timeout:1e3}),function(fr,_r,Cr){var Rr=ir()(fr,_r);vr()(function(){return Cr(Rr)})}(Ut,Zt,function(fr){return mn(JSON.parse(fr))})}},{key:"click",value:function(){var Ut=this.type,Zt=this.$container,mn=this.console,$n=mn.c;switch(Ut){case"log":case"warn":case"info":case"debug":case"output":case"table":case"dir":break;case"group":case"groupCollapsed":mn.toggleGroup(this);break;case"error":Zt.find($n(".stack")).toggleClass($n("hidden"))}}},{key:"formatMsg",value:function(){var Ut=this.args,Zt=this.type,mn=this.id,$n=this.header,br=this.group,fr=this.console.c;Ut=Nt()(Ut);var _r,Cr,Rr="";switch(Zt!=="group"&&Zt!=="groupCollapsed"||Ut.length===0&&(Ut=["console.group"]),Zt){case"log":case"info":case"debug":Rr=this.formatCommon(Ut);break;case"dir":Rr=this.formatDir(Ut);break;case"warn":_r="warn",Rr=this.formatCommon(Ut);break;case"error":yr()(Ut[0])&&Ut.length!==1&&(Ut=this.substituteStr(Ut)),Cr=Ut[0],_r="error",Cr=Xn()(Cr)?Cr:new Error(this.formatCommon(Ut)),Rr=this.formatErr(Cr);break;case"table":Rr=this.formatTable(Ut);break;case"html":Rr=Ut[0];break;case"input":Rr=this.formatJs(Ut[0]),_r="input";break;case"output":Rr=this.formatCommon(Ut),_r="output";break;case"groupCollapsed":Rr=this.formatCommon(Ut),_r="caret-right";break;case"group":Rr=this.formatCommon(Ut),_r="caret-down"}ut()(["log","debug","warn"],Zt)&&this.isSimple()&&(Rr=jn()(Rr,function(Yr){return'').concat(Yr,"")})),Rr=this.render({msg:Rr,type:Zt,icon:_r,id:mn,header:$n,group:br}),this.$container.addClass("".concat(fr("log-container"))).html(Rr),Zt==="table"&&(_t()(this.columns)||this.renderTable(Ut)),_t()(this.elements)||this.renderEl(),this.$content=this.$container.find(fr(".log-content")),this.content=this.$content.get(0)}},{key:"render",value:function(Ut){var Zt=this.console.c,mn="",$n="";if(Ut.group)for(var br=Ut.group.indentLevel,fr=0;fr');Ut.header&&(mn+=Ar()(Zn||(Zn=(0,k.Z)([`
`,` diff --git a/docs/index.html b/docs/index.html index 7b246e0..1cb1b8a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,7 +8,7 @@ Demo Dapp with @tonconnect/ui-react - +