vendor: 4,333 bytes, line 1
1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1417],{11417:(e,t,a)=>{a.d(t,{offchainLookup:()=>b,offchainLookupSignature:()=>m});var r=a(12025),s=a(91497),n=a(66568),o=a(18267);class i extends n.C{constructor({callbackSelector:e,cause:t,data:a,extraData:r,sender:s,urls:n}){super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],t.metaMessages?.length?"":[],"Offchain Gateway Call:",n&&[" Gateway URL(s):",...n.map(e=>` ${(0,o.I)(e)}`)],` Sender: ${s}`,` Data: ${a}`,` Callback selector: ${e}`,` Extra data: ${r}`].flat(),name:"OffchainLookupError"})}}class c extends n.C{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${(0,o.I)(t)}`,`Response: ${(0,s.A)(e)}`],name:"OffchainLookupResponseMalformedError"})}}class u extends n.C{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`],name:"OffchainLookupSenderMismatchError"})}}var d=a(93247),f=a(52856),l=a(44497),h=a(53385),p=a(76429),w=a(89762),y=a(54395);let m="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(e,{blockNumber:t,blockTag:a,data:s,to:n}){let{args:o}=(0,f.W)({data:s,abi:[g]}),[c,d,w,m,b]=o,{ccipRead:C}=e,E=C&&"function"==typeof C?.request?C.request:k;try{if(!(0,h.h)(n,c))throw new u({sender:c,to:n});let s=d.includes(y.J)?await (0,y.X)({data:w,ccipRequest:E}):await E({data:w,sender:c,urls:d}),{data:o}=await (0,r.T)(e,{blockNumber:t,blockTag:a,data:(0,p.xW)([m,(0,l.h)([{type:"bytes"},{type:"bytes"}],[s,b])]),to:n});return o}catch(e){throw new i({callbackSelector:m,cause:e,data:s,extraData:b,sender:c,urls:d})}}async function k({data:e,sender:t,urls:a}){let r=Error("An unknown error occurred.");for(let n=0;n<a.length;n++){let o=a[n],i=o.includes("{data}")?"GET":"POST",u="POST"===i?{data:e,sender:t}:void 0,f="POST"===i?{"Content-Type":"application/json"}:{};try{let a,n=await fetch(o.replace("{sender}",t.toLowerCase()).replace("{data}",e),{body:JSON.stringify(u),headers:f,method:i});if(a=n.headers.get("Content-Type")?.startsWith("application/json")?(await n.json()).data:await n.text(),!n.ok){r=new d.Ci({body:u,details:a?.error?(0,s.A)(a.error):n.statusText,headers:n.headers,status:n.status,url:o});continue}if(!(0,w.q)(a)){r=new c({result:a,url:o});continue}return a}catch(e){r=new d.Ci({body:u,details:e.message,url:o})}}throw r}},54395:(e,t,a)=>{a.d(t,{X:()=>m,J:()=>y});var r=a(18587),s=a(95889),n=a(80044),o=a(81693),i=a(56213),c=a(37826),u=a(24029),d=a(76429),f=a(44497),l=a(42330);let h="/docs/contract/encodeErrorResult";function p(e){let{abi:t,errorName:a,args:r}=e,s=t[0];if(a){let e=(0,l.iY)({abi:t,args:r,name:a});if(!e)throw new n.yy(a,{docsPath:h});s=e}if("error"!==s.type)throw new n.yy(void 0,{docsPath:h});let o=(0,u.B)(s),c=(0,i.V)(o),p="0x";if(r&&r.length>0){if(!s.inputs)throw new n.ZP(s.name,{docsPath:h});p=(0,f.h)(s.inputs,r)}return(0,d.aP)([c,p])}let w="/docs/contract/encodeFunctionResult",y="x-batch-gateway:true";async function m(e){let{data:t,ccipRequest:a}=e,{args:[d]}=function(e){let{abi:t,data:a}=e,r=(0,o.di)(a,0,4),s=t.find(e=>"function"===e.type&&r===(0,i.V)((0,u.B)(e)));if(!s)throw new n.EB(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:s.name,args:"inputs"in s&&s.inputs&&s.inputs.length>0?(0,c.n)(s.inputs,(0,o.di)(a,4)):void 0}}({abi:r.b2,data:t}),h=[],g=[];return await Promise.all(d.map(async(e,t)=>{try{g[t]=e.urls.includes(y)?await m({data:e.data,ccipRequest:a}):await a(e),h[t]=!1}catch(e){var n;h[t]=!0,g[t]="HttpRequestError"===(n=e).name&&n.status?p({abi:r.b2,errorName:"HttpError",args:[n.status,n.shortMessage]}):p({abi:[s.Mc],errorName:"Error",args:["shortMessage"in n?n.shortMessage:n.message]})}})),function(e){let{abi:t,functionName:a,result:r}=e,s=t[0];if(a){let e=(0,l.iY)({abi:t,name:a});if(!e)throw new n.Iz(a,{docsPath:w});s=e}if("function"!==s.type)throw new n.Iz(void 0,{docsPath:w});if(!s.outputs)throw new n.MR(s.name,{docsPath:w});let o=(()=>
1{if(0===s.outputs.length)return[];if(1===s.outputs.length)return[r];if(Array.isArray(r))return r;throw new n.dm(r)})();return(0,f.h)(s.outputs,o)}({abi:r.b2,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.