vendor: 4,643 bytes, line 1
1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1735],{93637:function(t,e,a){a.d(e,{E:function(){return s}});var r=a(10052),n=a(4012);function s(t,e){if(!(0,n.U)(t,{strict:!1}))throw new r.b({address:t});if(!(0,n.U)(e,{strict:!1}))throw new r.b({address:e});return t.toLowerCase()===e.toLowerCase()}},71735:function(t,e,a){a.d(e,{offchainLookup:function(){return b},offchainLookupSignature:function(){return y}});var r=a(40183),n=a(31853),s=a(81544),o=a(97564);class i extends s.G{constructor({callbackSelector:t,cause:e,data:a,extraData:r,sender:n,urls:s}){super(e.shortMessage||"An error occurred while fetching for an offchain result.",{cause:e,metaMessages:[...e.metaMessages||[],e.metaMessages?.length?"":[],"Offchain Gateway Call:",s&&[" Gateway URL(s):",...s.map(t=>` ${(0,o.G)(t)}`)],` Sender: ${n}`,` Data: ${a}`,` Callback selector: ${t}`,` Extra data: ${r}`].flat(),name:"OffchainLookupError"})}}class c extends s.G{constructor({result:t,url:e}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${(0,o.G)(e)}`,`Response: ${(0,n.P)(t)}`],name:"OffchainLookupResponseMalformedError"})}}class u extends s.G{constructor({sender:t,to:e}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${e}`,`OffchainLookup sender address: ${t}`],name:"OffchainLookupSenderMismatchError"})}}var f=a(17057),d=a(33591),l=a(30056),h=a(93637),p=a(89256),w=a(93610),m=a(40748);let y="0x556f1830",g={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function b(t,{blockNumber:e,blockTag:a,data:n,to:s}){let{args:o}=(0,d.p)({data:n,abi:[g]}),[c,f,w,y,b]=o,{ccipRead:M}=t,k=M&&"function"==typeof M?.request?M.request:E;try{if(!(0,h.E)(s,c))throw new u({sender:c,to:s});let n=f.includes(m.M)?await (0,m.w)({data:w,ccipRequest:k}):await k({data:w,sender:c,urls:f}),{data:o}=await (0,r.R)(t,{blockNumber:e,blockTag:a,data:(0,p.zo)([y,(0,l.E)([{type:"bytes"},{type:"bytes"}],[n,b])]),to:s});return o}catch(t){throw new i({callbackSelector:y,cause:t,data:n,extraData:b,sender:c,urls:f})}}async function E({data:t,sender:e,urls:a}){let r=Error("An unknown error occurred.");for(let s=0;s<a.length;s++){let o=a[s],i=o.includes("{data}")?"GET":"POST",u="POST"===i?{data:t,sender:e}:void 0,d="POST"===i?{"Content-Type":"application/json"}:{};try{let a;let s=await fetch(o.replace("{sender}",e.toLowerCase()).replace("{data}",t),{body:JSON.stringify(u),headers:d,method:i});if(a=s.headers.get("Content-Type")?.startsWith("application/json")?(await s.json()).data:await s.text(),!s.ok){r=new f.Gg({body:u,details:a?.error?(0,n.P)(a.error):s.statusText,headers:s.headers,status:s.status,url:o});continue}if(!(0,w.v)(a)){r=new c({result:a,url:o});continue}return a}catch(t){r=new f.Gg({body:u,details:t.message,url:o})}}throw r}},40748:function(t,e,a){a.d(e,{w:function(){return y},M:function(){return m}});var r=a(98158),n=a(55246),s=a(65531),o=a(69921),i=a(10464),c=a(2742),u=a(7275),f=a(89256),d=a(30056),l=a(64043);let h="/docs/contract/encodeErrorResult";function p(t){let{abi:e,errorName:a,args:r}=t,n=e[0];if(a){let t=(0,l.mE)({abi:e,args:r,name:a});if(!t)throw new s.MS(a,{docsPath:h});n=t}if("error"!==n.type)throw new s.MS(void 0,{docsPath:h});let o=(0,u.t)(n),c=(0,i.C)(o),p="0x";if(r&&r.length>0){if(!n.inputs)throw new s.Zh(n.name,{docsPath:h});p=(0,d.E)(n.inputs,r)}return(0,f.SM)([c,p])}let w="/docs/contract/encodeFunctionResult",m="x-batch-gateway:true";async function y(t){let{data:e,ccipRequest:a}=t,{args:[f]}=function(t){let{abi:e,data:a}=t,r=(0,o.tP)(a,0,4),n=e.find(t=>"function"===t.type&&r===(0,i.C)((0,u.t)(t)));if(!n)throw new s.eF(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:n.name,args:"inputs"in n&&n.inputs&&n.inputs.length>0?(0,c.r)(n.inputs,(0,o.tP)(a,4)):void 0}}({abi:r.Yi,data:e}),h=[],g=[];return await Promise.all(f.map(async(t,e)=>{try{g[e]=t.urls.includes(m)?await y({data:t.data,ccipRequest:a}):await a(t),h[e]=!1}catch(t){h[e]=!0,g[e]="HttpRequestError"===t.name&&t.status?p({abi:r.Yi,errorName:"HttpError",args:[t.status,t.shortMessage]}):p({abi:[n.Up],errorName:"Error",args:["shortMessage"in t?t.shortMessage:t.message]})}})),function(t){let{abi:e,functionName:a,result:r}=t,n=e[0];if(a){let t=(0,l.mE)({abi:e,name:a});if(!t)throw new s.xL(a,{docsPath:w});n=t}if("function"!==n.type)throw new s.xL(void 0,{docsPath:w});if(!n.outputs)throw new s.MX(n.name,{docsPath:w});let o=(()=>
1{if(0===n.outputs.length)return[];if(1===n.outputs.length)return[r];if(Array.isArray(r))return r;throw new s.hn(r)})();return(0,d.E)(n.outputs,o)}({abi:r.Yi,functionName:"query",result:[h,g]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.